Skip to content

Instantly share code, notes, and snippets.

@suthagar23
Last active June 10, 2018 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suthagar23/f0b92381aec5d0ad6d70e4eb40eb308d to your computer and use it in GitHub Desktop.
Save suthagar23/f0b92381aec5d0ad6d70e4eb40eb308d to your computer and use it in GitHub Desktop.
LocationBasedAccessControl - App Definition for the custom Patient Dashboard
{
"id": "referenceapplication.registrationapp.myRegisterPat",
"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.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"]
}
]
}
]
},
{
"id": "relationships-info",
"label": "registrationapp.person.relationship",
"questions": [
{
"legend": "registrationapp.person.relationship.label",
"header": "registrationapp.person.relationship.question",
"fields": [
{
"type": "personRelationships",
"widget": {
"providerName": "registrationapp",
"fragmentId": "field/personRelationship"
}
}
]
}
]
},
{
"id": "accesslocation-info",
"label": "Access Location",
"questions": [
{
"legend": "Patient Location ",
"id": "patientLocationLabel",
"fields": [
{
"type": "personAttribute",
"label": "Select Location",
"formFieldName": "locationId",
"uuid": "8b5c95ef-103c-41bc-9f24-368b8f77e070",
"widget": {
"providerName": "locationbasedaccess",
"fragmentId": "field/locations"
}
}
]
}
]
}
]
}
}
@suthagar23
Copy link
Author

This is the custom app definition for the location selection fragement,

   {
                    "id": "accesslocation-info",
                    "label": "Access Location",
                    "questions": [
                                  {
                                      "legend": "Patient Location ",
                                      "id": "patientLocationLabel",
                                      "fields": [
                                        {
                                         "type": "personAttribute",
                                         "label": "Select Location",
                                         "formFieldName": "locationId",
                                         "uuid": "8b5c95ef-103c-41bc-9f24-368b8f77e070",
                                         "widget": {
                                                    "providerName": "locationbasedaccess",
                                                    "fragmentId": "field/locations"
                                                   }
                                         }
                                        ]
                                  }
                    ]
                }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment