How to Customize Demographics in Reference Registration App

The excellent wiki shows me how to configure Patient Registration in the current Reference App. However this seems only to relevant to “Contact Info”. Could you tell me how I could do something similar with the Demographics input?

Are you referring to this? https://wiki.openmrs.org/display/docs/Registration+App+Configuration

Yes that is it.

Not sure if i understand you well. Can you give some more details or examples? :slight_smile:

So hopefully this image shows the basic patient registration screen that is in 2 parts. The upper related to patient Demographics and the lower to Contact Info. and I would like to configure the demographic data eg change family name to the first field.

So I am following these instructions to configure the Registration App from the wiki:

Initial Steps Follow the basic instructions to disable an App and add a custom App found at System Administration: Manage Apps. Navigate to System Administration–>Manage Apps Click the square disable button beside “referenceapplication.registrationapp.registerPatient” to disable the integrated Registration App configuration. Add a new App Definition by clicking “Add App Definition”. Give your new App a name, perhaps “referenceapplication.registrationapp.myRegisterPat”. _Copy the latest template for the registration App, found here (note that the square brackets before and after should not be used). _ Paste this into the Definition (required) field. Modify the ID to represent the ID you specified in step 4 above. For example, change “id”: “referenceapplication.registrationapp.registerPatient”, to “id”: “referenceapplication.registrationapp.myRegisterPat”, Modify the URL line to represent the ID you specified in step 4 above. For example, change “url”: “registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.registerPatient”, to “url”: “registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.myRegisterPat”, If you prefer, you can change the “description” and “label” fields to your liking, for example, name them in your language. You can also change the icon and order to your liking. Save the new App configuration.

But the code below, taken from the link, does not seem to contain any reference to the Demographic Section. My question is where do I go to find that code?

{ “id”: “referenceapplication.registrationapp.registerPatient”, “instanceOf”: “registrationapp.registerPatient”, “label”: “Register Patient”, “description”: “Create a new Patient Record”, “extensions”: [ { “id”: “referenceapplication.registrationapp.registerPatient.homepageLink”, “extensionPointId”: “org.openmrs.referenceapplication.homepageLink”, “type”: “link”, “label”: “referenceapplication.app.registerPatient.label”, “url”: “registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.registerPatient”, “icon”: “icon-user”, “order”: 1, “requiredPrivilege”: “App: registrationapp.registerPatient” } ], “config”: { “afterCreatedUrl”: “/coreapps/clinicianfacing/patient.page?patientId={{patientId}}”, “sections”: [ { “id”: “contactInfo”, “label”: “registrationapp.patient.contactInfo.label”, “questions”: [ { “legend”: “Person.address”, “fields”: [ { “type”: “personAddress”, “label”: “registrationapp.patient.address.question”, “widget”: { “providerName”: “uicommons”, “fragmentId”: “field/personAddress” } } ] }, { “legend”: “registrationapp.patient.phone.label”, “id”: “phoneNumberLabel”, “fields”: [ { “type”: “personAttribute”, “label”: “registrationapp.patient.phone.question”, “formFieldName”: “phoneNumber”, “uuid”: “14d4f066-15f5-102d-96e4-000c29c2a5d7”, “widget”: { “providerName”: “uicommons”, “fragmentId”: “field/text” }, “cssClasses”: [“phone”] } ] } ] } ] }

The other fields you looking for are included as fragments on registerPatient.page or registerPatient.gsp.

You can find the back-end implementation of patient registration workflow in Registration App Module. The registerPatient.gsp uses fields from registrationapp and uicommons modules.

They fragments are embedded using: ${ ui.includeFragment("module_name", "ui_element", [configurations]

For instance: ${ ui.includeFragment("registrationapp", "field/personName", [...] to add name fields under demographics section

Broadly the demographic section is not configurable, it’s only the additional sections that are.

However I believe you can change the order of the name fields by changing the underlying name layout in openmrs-core. See https://wiki.openmrs.org/x/P4_-B

And if you do not find all the above satisfying, you could take a look at this: https://wiki.openmrs.org/display/docs/XForms+Module+Patient+Registration

Thanks so much for the suggestion. However, I am not sure if this is a version issue but the reference app dos not seem to have the files referred to in this wiki.

Thank you for the suggestion, but having looked at the code I seem to end with more questions than when I started. I think I will try the xform approach and come back to this if it does not work.

Daniel,

This feels like the solution that I need but I think I am again stuck on module compatibility issues. The wiki link says:

You can design an xform to override the default OpenMRS patient registration short form by doing the following. On the OpenMRS administration screen, click the “Patient Xform Design” link. This will take you to the form designer and will load the standard patient properties and any custom person attributes that you may have. _After customizing the form in the form designer, click the save button on the tool bar or select save from the file enu. Remember to click the design surface tab and ensure that you have some widgets before saving. Under the OpenMRS administration screen, select the “Manage Global Properties” link (for those using version 1.9+, the link is “Advanced Settings”) Set the value of the property called “xforms.usePatientXform” to true

Unfortunately there is not a patient xform design link in the Systems Admin menu, nor does global properties have a xforms.usePatientXform entry and I see no Advanced settings.

I thought maybe Xforms module was absent from the reference app but having tried to install it I get:

xforms-4.3.9.omod is already associated with a loaded module.

I am beginning to get the feeling that the reference app and its associated core are much different to current documentation. I am happy to continue to draw attention to the problems, but will need some help to maintain progress.

@mafrica just try to restart your tomcat instance. You will then be able to see it like you can, on this server: int-refapp.openmrs.org

Daniel,

The Tomcat restart fixed the last problem.

And I have made some further progress. I have managed to design an XForm entry screen that is getting close to my needs - by copying and amending the Basic Form. However (probably my understanding) but I have hit a couple snags:

  1. When I use the form through the data entry facility then data does not appear to be saved. I sense that the supplied submit botton is not firing.
  2. To change the field labels I assume that I change the Text component of the field property. Unfortunately this does not seem to impact either the preview or design surface although it does change the left panel.

I think I have read all the wiki on this, perhaps you can advise?

With this form open in the form designer, select “Save As” from the “File” menu. Then paste the file contents at pastebin.com and send the paste link here for me to take a look at the form definition.

http://pastebin.com/4ya4n0Qn

Did you get my private email for the recompiled modules?

Just to be sure regarding how you created this form, do you mind creating it at? http://int-refapp.openmrs.org/

Apologies for not getting back sooner - holidays left me without contact to my development machine while I was travelling

I have now understood the text/label edit process on the design surface and so overcome one of my earlier problems above.

As requested I have (partially) recreated by form (remember this was for patient registration in order to capture some demographics not within the reference app demographic section).

So far no errors are reported if I download the xml, but I have yet to extend the schema for the extra data items. However as above when I apply the form (MATest) and submit, then the entered data does not display if I revisit the form for the same patient eg add an additional contact/relationship.

In the ref. app I had chosen encounter type to be ADULTINITIAL (seems like the right thing for registration) but the demo site does not seem to have this as an option and so I have opted for admission. For initial registration which encounter type is correct?

In both situations though I am only able to add information to an existing patient and not create a new patient…do I need to replace the default registration app/form for this to be possible?

Can you create the form here http://int-refapp.openmrs.org/ such that i can see what you are exactly experiencing?

It is there - MATest

Can you share an exact url to a specific patient form where entered data does not display on http://int-refapp.openmrs.org/?