Closed chris-dare closed 2 years ago
@dexios1 please I will be waiting for the api.
Got it.
@pkdadson Richmond has created a design for the prescription. I need you to implement it so it can be integrated from the frontend.
@agbavorrichmond please share the UI design with Dadson. This should be A5 and A5 compatible please
@agbavorrichmond please share the UI for this task here. Merci.
Hello @agbavorrichmond
Sure thing, doing that now
Sure thing, doing that now
@agbavorrichmond ...... :-)
Hi @TuyizereBapt, here is some context on this feature:
We have a version of this feature that generates the PDF on the server and sends to the frontend. We'll start with this and then switch to sharing the JSON instead for the PDF to be generated on the frontend later.
Here is a copy of the API specification: https://serenity-health.readme.io/reference/pharmacy-workflow#print-a-prescription
The task is to update the implementation so that the following are present in the printed prescription:
Implementation recommendations:
Note: An API view was set up for this at medication.views.MedicationRequestPrintListView
. This has been done but requires an update to fulfil the use case. An endpoint has been set up for this view in medication.urls
: {{base_url}}/providers/<provider_id>/medicationrequests/print/<slug:encounter_id>
You will find the pattern and implementation of diagnostics.views.DiagnosticReportPrintView
as a better way to implement the printing of a prescription than seen in MedicationRequestPrintListView
. I recommend this pattern because it's easier to follow and a better OOP approach. The concept of this approach is simple:
Please review DiagnosticReportPrintView
before reviewing the notes below
Now the notes below should be a helpful guide in modifying MedicationRequestPrintListView
to become like DiagnosticReportPrintView
Please replace the existing template: medication/templates/prescriptions.html
with a modified version of diagnostics/templates/diagnostic_report.html
because that file is newer and has a better style which is consistent with all other printed documents. This updated file should have the prescription details listed above.
encounter.models.Encounter
needs to have a method called prescriptions_as_pdf
with the args of:
DiagnosticReport.as_pdf
Why are we putting this method on encounter.models.Encounter
and not medication.models.MedicationRequest
? Because a prescription is a collection of medication requests created in an encounter. So when we know the encounter, we can get all related medication requests created in that encounterSimilarly, encounter.models.Encounter
needs to have a method called build_prescription_template_context
.
This method will be the equivalent of DiagnosticReport.build_template_context
So in conclusion, the API implementation will do this:
diagnostics/templates/diagnostic_report.html
)Hi @TuyizereBapt,
Here's a sample payload to create a medication request:
[
{
"id": "ef7112bf-d735-4da8-9663-a567423aa698",
"name": "Paracetamol for adults",
"priority": "routine",
"form": null,
"category": null,
"code": null,
"date": null,
"encounter": "8d429f1a-8edb-468d-9a0c-00dcdc496d96",
"visit": null,
"intended_dispenser": "Nyaho Medical Center",
"patient": 14496,
"patient_detail": {
"first_name": "Jean baptiste",
"lastname": "Tuyizere",
"gender": "MALE",
"birth_date": "2003-01-01",
"mobile": "+250781633004",
"age": 19
},
"medication_detail": [
{
"id": "6bcc3926-d875-4e0b-a151-17285492263f",
"uuid": "dc94c972-f690-425f-b383-cc8b3a71a0a2",
"created_at": "2022-03-08T08:24:58.896398Z",
"is_deleted": false,
"modified_at": "2022-03-08T08:24:58.896407Z",
"display": "Paracetamol for adults"
}
],
"careplan": null,
"status_reason": null,
"status": "active",
"intent": "order",
"do_not_perform": false,
"performer_practitioner": null,
"performer_practitioner_role": null,
"requester_practitioner": null,
"requester_patient": null,
"requester_practitioner_role": "195f155e-60bd-4ed6-b6fb-f062fe750a9d",
"practitioner_detail": {
"name": "Mr Chris Dare"
},
"recorder_practitioner": null,
"recorder_practitioner_role": null,
"course_of_therapy_type": "continuous",
"prior_prescription": null,
"medication_request_notes": [
{
"id": "d73a47bb-fccb-49a7-a72e-492c3b24512f",
"uuid": "3e94c59a-d462-4756-9262-52131efdb181",
"created_at": "2022-03-08T08:24:58.900286Z",
"modified_at": "2022-03-08T08:24:58.900296Z",
"display": "Note",
"medication_request": "ef7112bf-d735-4da8-9663-a567423aa698"
}
],
"medication_request_dosage_instruction": [
{
"frequency": "BID (twice a day)",
"period": "5",
"period_unit": "Days",
"frequency_unit": null,
"strength": "500mg",
"route": "ORAL_USE"
}
],
"created_at": "2022-03-08T08:24:58.890279Z",
"modified_at": "2022-03-08T08:24:58.890290Z",
"medication_request_insurance": [],
"medication_request_reason_reference": [],
"medication_request_reason_code": [],
"medication_request_category": [
{
"id": "3c961879-0cc8-4394-a0f9-d9c47ce2355f",
"uuid": "be2d04ed-70b2-42a7-b865-9d8833d16936",
"created_at": "2022-03-08T08:24:58.908029Z",
"is_deleted": false,
"modified_at": "2022-03-08T08:24:58.908038Z",
"display": "outpatient"
}
],
"quantity": null,
"past_refills": null,
"next_refill": null,
"dispense_interval_in_days": null,
"number_of_repeats_allowed": null,
"dosage_form": "CAPSULE"
}
]
Hi @pkdadson, please reactivate the feature to print prescriptions.
@agbavorrichmond we need the link to the UI for printing prescriptions
Tell us about your request! Should be able to print a patient's prescription
Which app does this concern? Provider portal
What will be benefit of this feature? What's the value of this feature
Describe the solution you'd like Looks similar to outsourced prescription. (Title will be different of course). See below:
Describe alternatives you've considered Prescriptions are currently written on paper but this is not sustainable or aesthetically pleasing
Additional context N/A