...
- Get the list of OpenMRS location UUIDs per location that was imported from VitalWave
- Match those locations to Reveal and run a Nifi processor group that:
- Define a list of Reveal locations to query
- GET the location from Reveal
- (https://reveal-stage.smartregister.org/opensrp/rest/location/{identifier}?is_jurisdiction=true)
- Check to see if the OpenMRS_Id property is already on the location
- Update the location to add the OpenMRS_Id property
- PUT the location back to Reveal (https://reveal-stage.smartregister.org/opensrp/rest/location/?is_jurisdiction=true)
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "identifier": "437cc699-cfa7-414c-ba27-1668b6b517e6", "active": true, "name": "Test User Lusaka", "userId": "cad04f1e-9b05-4eac-92ce-4b38aa478644", "username": "lusaka" } |
Field | Description |
---|---|
identifier | this is a unique ID for this user |
active | true or false depending on whether this user is active |
name | The full name of the user |
userId | This is the UUID from the user in OpenMRS (displayed in grey in the Show Advanced Options in OpenMRS) |
username | This is the OpenMRS username |
Steps:
- Copy all of the information from OpenMRS into Excel
- Create the JSON above in excel
- (You can copy and paste unique identifiers to excel from an online GUID generator if you like)
- Sample Excel Formula: ="{""identifier"": """&A2&""",""active"": true,""name"": """&C2&""",""userId"": """&D2&""",""username"": """&B2&"""},"
A Identifier | B Username | C Name | D OpenMRS User UUID |
---|---|---|---|
f7369d1d-9463-486e-8f9d-2c5e2160c8j9 | testUser1 | Test User One | 1998b24e-b631-42fd-8dd3-f09463e3e626 |
c304705b-467e-4f38-bfd3-2c683eac411b | testUser2 | Test User Two | f3229835-0433-4bc9-a626-736d58035df4 |
- POST this JSON to the /practitioner endpoint (one user at a time) (https://reveal-stage.smartregister.org/opensrp/rest/practitionerpractitioners)
Create Organizations in Reveal
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "identifier": "fcc19470-d599-11e9-bb65-2a2ae2dbcce4", "active": true, "name": "The Luang", "type": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/organization-type", "code": "team", "display": "Team" } ] } } |
Field | Description |
---|---|
identifier | This is the unique GUID of the organization |
active | true or false depending on whether this organization is active |
name | This is the name of the organization |
type | Don't change this. It's a link to a FHIR coded type. |
Steps:
- Create the organization JSON as above
- POST to the /organization endpoint (https://reveal-stage.smartregister.org/opensrp/rest/organization)
...
Code Block | ||||
---|---|---|---|---|
| ||||
{ "identifier": "85771b10-1d77-40c8-bdf2-d6eb74380f76", "active": true, "organization": "0c7fd90f-5b99-4ed9-b337-0b42d51eab97", "practitioner": "d7c9c000-e9b3-427a-890e-49c301aa48e6", "code": { "text": "Community Health Worker" } } |
Field | Description |
---|---|
identifier | This is a unique GUID for this practitionerRole |
active | true or false depending on whether this organization is active |
organization | This is the identifier of the organization |
practitioner | This is the identifier of the practitioner |
code.text | This can be anything. We use Community Health Worker as a placeholder |
Steps:
- Create the practitionerRole for each practitioner
- POST to the /practitionerRole endpoint (https://reveal-stage.smartregister.org/opensrp/rest/practitionerRole)
...
Code Block | ||||
---|---|---|---|---|
| ||||
[{ "organization": "", "jurisdictionIdjurisdiction": "304cbcd4-0850-404a-a8b1-486b02f7b84d", "planIdplan": "144f4d78-a406-5a4f-a45c-8f2b66919e35", "fromDate": "2019-09-17T00:00:00.000Z", "toDate": "2019-12-01T00:00:00.000Z" }] |
Field | Description |
---|
organization | This is the identifier of the organization |
jurisdiction | This is the identifier of the operational area to be assigned. This must be a jurisdiction type location and we do not support cascading, so it must be the lowest level in the hierarchy |
plan | This is the identifier of the plan |
fromDate | This is the start date of the assignment |
toDate | This is the end date of the assignment. If this passes, users will not be able to access this assignment. |
Steps:
- Create the JSON as defined above (usually done in Excel)
- POST the entire list of changes to the endpoint, we don't post them individually (https://reveal-stage.smartregister.org/opensrp/rest/organization/assignLocationsAndPlans)