Reference Application Implementation Dev FAQs

How to do a custom login and/or home page?

A newer approach for overriding a page using a PageRequestMapper can be found here Overriding Requests to Pages and Fragments#OverridingAPage

How to change the logo in the header?

A newer approach for overriding a page using a FragmentRequestMapper can be found here https://openmrs.atlassian.net/wiki/display/docs/Overriding+Requests+to+Pages+and+Fragments#OverridingRequeststoPagesandFragments-OverridingAFragmentt

How to add an app to the home page with a link to a page in the legacy application from a module

For Example, lets add an app to the home page that has url to the find patient page in the legacy application, below are the steps:

1- Create an app descriptor file for the app with the contents below

   

 [

    {
       "id": "legacy.findPatient",
       "extensionPointId": "org.openmrs.referenceapplication.homepageLink",
       "type": "link",
       "label": "referenceapplication.app.legacy.findPatient.label",
       "url": "findPatient.htm",
       "icon": "icon-search",
       "order": 100,
       "requiredPrivilege": "App: legacy.findPatient"
     }
]

 

2- Add the file to the apps directory under the omod sub project of your module

How to define suggested names for registration?

Registration Core comes with 2 algorithms for the auto suggest name feature. You can specify which one to use by setting a global property. Go to the Legacy Administration app, then choose Advanced Settings and set registrationcore.patientNameSearch to one of the following:

  1. registrationcore.ExistingPatientNameSearch - (default) suggests names which have previously been entered more than 5 times
  2. registrationcore.BasicPatientNameSearch - suggests names which are listed as Settings (formerly Global Properties from 1.8 downwards). In order to configure click the Legacy Administration app, then choose Advanced Settings and set a comma separated list of names for these Settings (formerly Global Properties from 1.8 downwards). "registrationcore.familyNameAutoSuggestList" and "registrationcore.givenNameAutoSuggestList". Those will be the ones available for auto select.

 

How to Add Visit Note(Diagnosis) To Closed Visit?

Problem: When a visit ends there wasn't an easy way for a user to reopen the visit X days later and add a visit note.

Solution: Create a HTML form that'll allow the user to add a visit note in the case of a closed visit:

With the HTML Form Entry Module installed, go to:
System Administration -> Advanced Administration -> HTML Form Entry -> Manage Forms -> New HTML Form:

After Clicking save you'll see the below, copy simpleVisitNote.xml contents into the HTML part e.g:

After saving, go to:
DashBoard -> Configure Metadata -> Manage Forms and from UI, click Add:

Then as explained by Darius Jazayeri enter the below: 

for the "UI" bit you want to add it as a visit action (not an overall/general action), and set:
label: "referenceapplication.visitNote.title"
icon: "icon-stethoscope",
order: 30,
requiredPrivilege: "Task: referenceapplication.simpleVisitNote",
require: "!visit.active"

This will now look like this and you can click then click on save:

Now when you want to add a visit note on a closed visit, you'll see the option as per the below, click on Visit Note and Enter Diagnosis as required:

This was Tested on Platform Version 1.11.4