How to print an encounter details? - OpenMRS 2x and RefApp 2x


How can I print the Transfer, Discharge, Lab Test or vitals encounters of a patient patient in any visit (either past or active visit). The scenario is: when a patient is transferred from one ward to another, the provider will record the transfer encounter and also print a transfer slip for that patient to show it in destination ward. Also when a patient is discharged, the patient will get a discharge slip to show it in exit counter to close his file.

@dkayiwa: thank you for help in extending XReports 1.9 functionality to be able add any report to patient dashboard. Could you please extend the json to handle the printing of encounters based on type.

In report json (Extension field), if we define the encounter type then for each encounter in all visits of a patient the print icon should appear as shown in attached image. by clicking on print icon, patient-id and encounter-id should be passed to report as parameter.

Regards, Hameedullah Pardess

Can you create a ticket for this?

While creating issue, I could not find the XReports in projects list.

To generate a report, i want to select patient id and visit. How can i pass the visit id as parameter to a report?

Which kind of report are you thinking of where you would like to first select a visit id?

I would like to print all the encounters of a specific visit of a patient. In this scenario i need to have visit id and join it will all relevant encounters.

Do you have a mockup of how such a report would look like?

My main purpose is to be able list types of encounters in XReport JSON (in Extension value) and a print button should appear for those encounters. When I click on print button then encounterID and PatientID should be send as parameter to the report.

Without a mockup, i cant really be sure of what is in your mind. :smile:

I want to print Visit Note and Transfer encounters separately. when a patient visits a doctor then end of the visit i should take print out of his visit note and attach it to his physical file. or when patient is transferred to another ward, I should take print out of his transfer encounter and give him to show in another ward to be admitted.

Even if a patient ask for his Visit Note of his old visit then we should be able to print it for patient. Here are the screenshots:

Ticket is created for this. here is the link

I am thinking for an alternative way to have print button for the encounter. As much I learned, I should customize all forms such as discharge, vitals, clinical note. Then add print button inside each form like following screenshot,

<a target="_blank" href="" style="float: right">Print</a>

I will set the href value as report URL but this href should be created dynamically{{patient.patientId}}&reportId=5$encounterId={{}}

how can i set the encounterId, patientId and visitId ?

This is what I was asking for

Currently, I have hard-coded the xreport URL for each encounter type in Coreapps Module.

In future, we can set this report URL in Form Management for each form. Also we should be able to set the print right based on encounter type.

@dkayiwa: I have designed reports that need two parameters 1. Encounter ID 2. Patient ID In your old post, you have mentioned that parameters should be passed as in URL Query string. I am also doing same but the report is not printed.


but I try to print the report from Home>XReports>Run Reports and entered encounterId and patientId, the report is printed correctly. but the patientId and encouterId are not listed in URL Query string.


@dkayiwa:I have extended the RefApp and I display the print button for each encounter with specific report URL.

But the report printed empty while i press the print button. Although i have all the required parameters in URL

Does this report have a reporting module dataset behind it?

Yeah i have. Here is the screen shots when i run it from Home>XReports>Run Reports

The patientId in XReports is hard-coded. Are we going to do same for all parameters?

@dkayiwa: I feel this is the right controller that would handle the request for a report with paramenters

but I is called only on submit action and then redirect the page to show the report.

Better option will be to create different controller which will get parameters in URL Query string and send those parameters to onSubmit() controller to avoid duplication of code.

Are you able to reproduce this at?