Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added address hierarchy instructions

With the latest versions of the Registration App, it is now possible to customize it to your specific needs without custom programming.  For example, you can integrate the address hierarchy module and add additional person attributes.  You can see the full list of configuration options in the template definition found at this link, which describes the config fields.

...

  1. Navigate to System Administration-->Manage Apps
  2. Click the square disable button beside "referenceapplication.registrationapp.registerPatient" to disable the integrated Registration App configuration.
  3. Add a new App Definition by clicking "Add App Definition".
  4. Give your new App a name, perhaps "referenceapplication.registrationapp.myRegisterPat".
  5. Copy the latest template for the registration App, found here (note that the square brackets before and after should not be used). 
  6. Paste this into the Definition (required) field.
  7. 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",
  8. 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",
  9. 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.
  10. Save the new App configuration.

Info
titleNotes:
  • If you have a syntax error, it will give you an error "Invalid Json", and not let you save it until fixed.
  • If you didn't change the App ID in the Json, it will give you an error "The App ID should match the one in the definition" when you try to save it.
  • If the App name is too long, it will give you an error like, "Failed to save referenceapplication.registrationapp.myRegisterPatient", and not let you save it.

...

  1. Find the UUID of the Person Attribute Type (s) that you want to add to the Registration App. 
    1. Go to System Administration --> Advanced Administration --> Manage Person Attribute Types
    2. Click on the name of the Person Attribute, for example "Mother's Name".
    3. You will find the UUID listed in grey, for example... 8d871d18-c2cc-11de-8d13-0010c6dffd0f
  2. Open the App you created in the Initial Steps above.
  3. In the list of sections you can add a new section, or you can simply add the person attribute to an existing section.  Sections and fields are separated with a comma.  The code to add a question of Mother's Name is...

    Code Block
    languagejava
    titleMother Name Person Attribute Field
          {
           "type": "personAttribute",
           "label": "Mother's Name",
           "formFieldName": "mothersName",
           "uuid": "8d871d18-c2cc-11de-8d13-0010c6dffd0f",
           "widget": {
                      "providerName": "uicommons",
                      "fragmentId": "field/text"
                     }
           }

    If you want to add the question in a section of it's own, you would use something like this, placed in the list of sections...

    Code Block
    languagejava
    titlePerson Attribute in own section
    {
        "legend": "My Person Attribute",
        "id": "myPersonAttributeLabel",
        "fields": [
          {
           "type": "personAttribute",
           "label": "Mother's Name",
           "formFieldName": "mothersName",
           "uuid": "8d871d18-c2cc-11de-8d13-0010c6dffd0f",
           "widget": {
                      "providerName": "uicommons",
                      "fragmentId": "field/text"
                     }
           }
          ]
    }
  4. Change the "uuid": value to the UUID of the Person Attribute that you want to appear in the Registration App.
  5. Save your App and enjoy!

...

Code Block
languagejava
titleRegister Patient with Person Attribute Template
firstline1
collapsetrue
    {
        "id": "referenceapplication.registrationapp.myRegisterPat",
        "instanceOf": "registrationapp.registerPatient",
        "label": "My Register Patient",
        "description": "Create MY new Patient Record",
        "extensions": [
            {
                "id": "referenceapplication.registrationapp.myRegisterPat.homepageLink",
                "extensionPointId": "org.openmrs.referenceapplication.homepageLink",
                "type": "link",
                "label": "My Register Patient",
                "url": "registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.myRegisterPat",
                "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"]
                                }
                            ]
                        },
{
    "legend": "My Person Attribute",
    "id": "myPersonAttributeLabel",
    "fields": [
      {
       "type": "personAttribute",
       "label": "Mother's Name",
       "formFieldName": "mothersName",
       "uuid": "8d871d18-c2cc-11de-8d13-0010c6dffd0f",
       "widget": {
                  "providerName": "uicommons",
                  "fragmentId": "field/text"
                 }
       }
      ]
}
                    ]
                }
            ]
        }
    }

Integrate Address Hierarchy

To use the Address Hierarchy Module in the Reference Application Registration App requires a little configuration to a custom App.  The steps are outlined below.

  1. Ensure the Address Hierarchy Module is installed and configured per the instructions; including configuration of the address levels, marking them all "Required".
  2. Open the App you created in the Initial Steps above.
  3. Under the address section, replace...

    Code Block
    languagejava
    titleText Box Address Fields
    "widget": {
              "providerName": "uicommons",
              "fragmentId": "field/personAddress"
              }

    with...

    Code Block
    languagejava
    titleAddress Hierarchy Address Fields
    "widget": {
         "providerName": "registrationapp",
         "fragmentId": "field/personAddressWithHierarchy",
         "config" : {
            "shortcutFor": "address1",
            "manualFields": ["address2"]
            }
    }
Info
titleNotes:
  • The Shortcuts and Manual Fields that are specified in the config don't work because of
    Jira Legacy
    serverOpenMRS JIRA
    serverId45c5771b-fa4b-3e43-b34a-c19dc45ccc95
    keyRA-951

A complete Json template including the Mother's Name Person Attribute, and Address Hierarchy would look like this...

Code Block
languagejava
titleRegister Patient with Person Attribute and Address Hierarchy
firstline1
collapsetrue
    {
        "id": "referenceapplication.registrationapp.myRegisterPat",
        "instanceOf": "registrationapp.registerPatient",
        "label": "My Register Patient",
        "description": "Create MY new Patient Record",
        "extensions": [
            {
                "id": "referenceapplication.registrationapp.myRegisterPat.homepageLink",
                "extensionPointId": "org.openmrs.referenceapplication.homepageLink",
                "type": "link",
                "label": "My Register Patient",
                "url": "registrationapp/registerPatient.page?appId=referenceapplication.registrationapp.myRegisterPat",
                "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": "registrationapp",
     "fragmentId": "field/personAddressWithHierarchy",
     "config" : {
        "shortcutFor": "address1",
        "manualFields": ["address2"]
        }
}
                                }
                            ]
                        },
                        {
                            "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"]
                                }
                            ]
                        },
{
    "legend": "My Person Attribute",
    "id": "myPersonAttributeLabel",
    "fields": [
      {
       "type": "personAttribute",
       "label": "Mother's Name",
       "formFieldName": "mothersName",
       "uuid": "8d871d18-c2cc-11de-8d13-0010c6dffd0f",
       "widget": {
                  "providerName": "uicommons",
                  "fragmentId": "field/text"
                 }
       }
      ]
}
                    ]
                }
            ]
        }
    } 

Filter by label (Content by label)
showLabelsfalse
max5
spacesdocs
sortmodified
showSpacefalse
reversetrue
typepage
labelsregistration

...