Add print button to every encounter with custom URL/path - OpenMRS 2x and RefApp 2x

Hi, How can I add print button to each encounter? The print button can have any to two states,

  1. Default: When we do not set any custom settings then it should work as default. In default state, the HTML form have to be printed as it shown in view mode.

  2. Custom: We should be able to set custom path(href/URL) for print button. The path should access some parameters too. It gives good flexibility have our own designed report template (xreport) for each encounter. example of path:

/xreports/reportRunner.page?patientId={{patient.patientId}}&reportId=5$encounterId={{encounter.id}}

/xreports/reportRunner.page?patientId=7&reportId=3&encounterId=3

Relevant Topics:

@dkayiwa, @zafar1234, @mseaton, @mogoodrich

I think the best place for print button is following file of Coreapps Module

https://github.com/openmrs/openmrs-module-coreapps/blob/master/omod/src/main/java/org/openmrs/module/coreapps/fragment/controller/visit/VisitDetailsFragmentController.java

https://github.com/openmrs/openmrs-module-coreapps/blob/master/omod/src/main/webapp/fragments/patientdashboard/encountertemplate/defaultEncounterTemplate.gsp

https://github.com/openmrs/openmrs-module-coreapps/blob/master/omod/src/main/webapp/fragments/patientdashboard/encountertemplate/noDetailsEncounterTemplate.gsp

https://github.com/openmrs/openmrs-module-coreapps/blob/master/omod/src/main/webapp/resources/scripts/fragments/patientdashboard/encountertemplate/defaultEncounterTemplate.js

Did you try make those changes and see what happens?

Coreapps Module is not listed in projects drop-down of issue creation in Jira. Can you please add Coreapps Module among projects list?

For coreapps we use the Reference Application (RA) project.

Here is the issue created for this task: https://issues.openmrs.org/browse/RA-1615