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 menu. 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
That is all. Just go ahead and try to create a new patient, you will see the patient xform come up.
Every time you create new person attributes, or just want to edit this form, simply go under the OpenMRS administration screen and click the "Patient Xform Design" link. This will always load the form with your previous changes. Modify it in any way you and and save to make your changes available for patient registration.
If you want to turn off using the patient xform for registration, just go back to the OpenMRS global properties and set the value of the "xforms.usePatientXform" property to false.
If you want to delete the form to reset the process you can do so by deleting the form with form_id = 0 in your database like so:
Entering Observations during Patient Registration
You can also fill some observations using the patient registration form by doing the following:
- Create a special encounter form with the obs you want to enter using the patient registration form. You can read about this under the Creating an Xform section
- Set the value of the "xforms.patientRegEncounterFormId" global property to that of the formId for the encounter form you have created in the step above.
- Go to the Patient Xform Design and refresh the form by either right clicking the form in the forms panel and select refresh or clicking the refresh toolbar icon, in the form designer. You can do this refresh every time you make changes to the encounter form and you want them reflected in the patient registration form.
Autogenerating Patient Identifiers with the Idgen Module module
Starting from version 4.0.0 of the xforms module, you can use the idgen module to create new patient identifiers after setting these two global properties:
- xforms.autoGeneratePatientIdentifier: Set this to: true
- xforms.new_patient_identifier_type_id: Set this to the value of the patient identifier type id that you want to use for new patients.
Changing the Primary Patient Identifier
To change the primary patient identifier - in the Reference App this shows on the top right of all patient screens preceded by the text "Patient id" - change the global setting emr.primaryIdentifierType to the UUID of the new patient identifier which can be found by picking the new identifier in Advanced Administration/Patient/Manage Identifier Types.
Adding Further Person Attributes to the Registration XForm
Attributes can be defined using the Advanced Administration/Person/Manage Person Attribute Types. In order for the additional attributes to be added to the Patient Registration XForm- open the form from the Advanced Administration/Xforms/Patient XForm Design and then right click on the Patient heading in the left hand pane and pick "Refresh". The new attributes will appear at the foot of the left pane.
- XForms Module
- XForms Module User Guide
- XForms Module Form Designer
- XForms Module External Applications Guide
- XForms Module Technical Overview
- XReports Module ReportDesigner Technical Overview
- XForms Module Release Notes
- Download Module
- GitHub project (source code)
- XForms was discussed on a May 9th University call. Watch xforms video
- XForms Newbies FAQs