OpenMRS API Interactions for Reveal Web

Status: In Progress

Owner: Craig Appl

This scoping document defines the processes and URL endpoints for interacting with the OpenMRS API in order to Create Read and Update locations and teams in OpenMRS.

Workflows

We need to deliver the following workflows that require interactions with the OpenMRS API

  1. Create OpenMRS locations based on the locations in Reveal
    1. Load the locations into Reveal
    2. Query the Reveal system for all locations
    3. Walk the tree from highest geographicLevel to lowest, identifying all of the children
      1. Create a location in OpenMRS for each child, linking it to the parent
  2. Create Teams in OpenMRS
    1. Identify an appropriate team structure (likely at the geographic area just above operational_area)
    2. Query for all OpenMRS locations
    3. Filter all openMRS locations and only use those that have the correct geographic Level (Tag)
    4. Create a team for each location at that level
  3. Update OpenMRS location team_id attribute when a team is assigned in the Reveal web UI planning module
    1. Search for each team in the OpenMRS team API
    2. Identify the parent from each team
    3. Query each OpenMRS location and identify their children
    4. Update  the team_id attribute for each operational area location

OpenMRS API Basics

BaseUrl: https://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1

Credentials: (This needs to be a user with superuser permissions at this time)

Authentication: OpenMRS uses basic auth for to start a session.

  1. Start a session
    1. GET BaseUrl/session
      1. The response will include a response header labeled Set-Cookie. Add the contents of this to subsequent responses
      2. In Nifi, we add a property to the InvokeHttp processor named Cookie with value ${Set-Cookie}
  2. End a session
    1. DELETE BaseUrl/session (with the cookie)

API documentation is available in the OpenMRS Legacy Admin Menu at https://openmrs.reveal-stage.smartregister.org/openmrs/module/webservices/rest/apiDocs.htm (Note that it takes some time to load because it builds it in real time

The API supports different representations that are documented here. You can get a full representation and custom representation.

Location Interactions

We need to Create, Read and Update locations in OpenMRS based on the location hierarchy that was loaded in to Reveal.

These interactions include the following properties:

Property in UITypeDescriptionUUIDSample POST code
Parent Location
This is the parent uuid of the location in OpenMRS.N/A
"parentLocation": {
    "uuid": "43a992e6-6b73-4767-b63f-abeb16737e27"
}
mspray_location_idattribute

3302b1cd-8e89-4d44-89ae-8a285f2c5583

{
  "attributeType": {
      "uuid": "802e4109-56d0-407f-adcb-ea3a082840fc"
  },
  "value": "055059f5-bbc2-489b-a573-56558556b5e0",
  "voided": false,
  "resourceVersion": "1.9"
}
team_idattribute

802e4109-56d0-407f-adcb-ea3a082840fc

{
  "attributeType": {
	"uuid": "802e4109-56d0-407f-adcb-ea3a082840fc"
  },
  "value": "055059f5-bbc2-489b-a573-56558556b5e0",
  "voided": false,
  "resourceVersion": "1.9"
}
CountrytagThis is a location tag that shows this is the country level. (Thailand: ADM 0)bdae8d24-df16-47c1-b589-ff58038ba7ca
{
  "uuid": "bdae8d24-df16-47c1-b589-ff58038ba7ca"
}
ProvincetagThis is a location tag that shows this is the provincial level. (Thailand: ADM 1)563fba34-7bfa-40f7-a0e0-9dca3c24bfec
{
  "uuid": "563fba34-7bfa-40f7-a0e0-9dca3c24bfec"
}
DistricttagThis is a location tag that shows this is a district level. (Thailand: ADM 2)19592b42-5181-49e4-85ab-2c502e7193c1
{
  "uuid": "19592b42-5181-49e4-85ab-2c502e7193c1"
}
Sub-districttag(Used in Botswana Only) This is a location tag that shows this is the sub-district level.7de14bdc-9e2a-4183-a6c9-3b506daac8e4
{
  "uuid": "7de14bdc-9e2a-4183-a6c9-3b506daac8e4"
}
VillagetagThis is a location tag that shows this is the village level (Thailand: ADM 3)55a54fc4-a6f2-4e14-9132-815687952804
{
  "uuid": "55a54fc4-a6f2-4e14-9132-815687952804"
}
Cantontag(Used in Thailand Only) This is a location tag that shows this is the canton level. (Thailand: ADM 4)de2ec1a0-1609-4071-af32-a91752956e95
{
  "uuid": "de2ec1a0-1609-4071-af32-a91752956e95"
}
Operational AreatagThis is a location tag that shows this is the operational area level. This is the lowest level in any hierarchy. (Thailand: ADM 5)22abf4d2-c138-463c-8c58-568343dd2b5f
{
  "uuid": "22abf4d2-c138-463c-8c58-568343dd2b5f"
}

GET BaseUrl/location

This returns a complete list of locations with just the minimal information

//GET BaseUrl/location?q=TwoTwoTwo_01

{
  "results": [
    {
      "uuid": "5398b9e0-71e8-42a5-892d-e031a9a32ca5",
      "display": "TwoTwoTwo_01",
      "links": [
        {
          "rel": "self",
          "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5398b9e0-71e8-42a5-892d-e031a9a32ca5"
        }
      ]
    }
  ]
}


GET BaseUrl/location/{UUID}

This returns the full location

//GET BaseUrl/location/5398b9e0-71e8-42a5-892d-e031a9a32ca5

{
  "uuid": "5398b9e0-71e8-42a5-892d-e031a9a32ca5",
  "display": "TwoTwoTwo_01",
  "name": "TwoTwoTwo_01",
  "description": null,
  "address1": null,
  "address2": null,
  "cityVillage": null,
  "stateProvince": null,
  "country": null,
  "postalCode": null,
  "latitude": null,
  "longitude": null,
  "countyDistrict": null,
  "address3": null,
  "address4": null,
  "address5": null,
  "address6": null,
  "tags": [
    {
      "uuid": "22abf4d2-c138-463c-8c58-568343dd2b5f",
      "display": "Operational Area",
      "links": [
        {
          "rel": "self",
          "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/locationtag/22abf4d2-c138-463c-8c58-568343dd2b5f"
        }
      ]
    }
  ],
  "parentLocation": {
    "uuid": "43a992e6-6b73-4767-b63f-abeb16737e27",
    "display": "Two Two Two Release Village",
    "links": [
      {
        "rel": "self",
        "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/43a992e6-6b73-4767-b63f-abeb16737e27"
      }
    ]
  },
  "childLocations": [],
  "retired": false,
  "attributes": [
    {
      "uuid": "5ecc27f8-5529-4958-8e3d-c08f4608af67",
      "display": "mspray_location_id: 14e2a7a7-fd08-4bed-8cf8-1eeaed303eda",
      "links": [
        {
          "rel": "self",
          "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5398b9e0-71e8-42a5-892d-e031a9a32ca5/attribute/5ecc27f8-5529-4958-8e3d-c08f4608af67"
        }
      ]
    },
    {
      "uuid": "faba93d1-691e-45ce-8612-4a22e2a251dd",
      "display": "team_id: 055059f5-bbc2-489b-a573-56558556b5e0",
      "links": [
        {
          "rel": "self",
          "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5398b9e0-71e8-42a5-892d-e031a9a32ca5/attribute/faba93d1-691e-45ce-8612-4a22e2a251dd"
        }
      ]
    }
  ],
  "address7": null,
  "address8": null,
  "address9": null,
  "address10": null,
  "address11": null,
  "address12": null,
  "address13": null,
  "address14": null,
  "address15": null,
  "links": [
    {
      "rel": "self",
      "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5398b9e0-71e8-42a5-892d-e031a9a32ca5"
    },
    {
      "rel": "full",
      "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5398b9e0-71e8-42a5-892d-e031a9a32ca5?v=full"
    }
  ],
  "resourceVersion": "2.0"
}

POST BaseUrl/location Template

This is a sample Nifi template for generating the location that needs to be posted. Note that you can only generate a location at a time and you can't assign the UUID through the API, so you have to get a response for each location, query again and then update the parents.

Variables:

  • revealName - The name of the location in the properties.name attribute of the geojson
  • geographicLevelOpenmrsUuidMapper - We need to build a mapper to tag this location to the correct geographicLevel (ADM N) as defined above
  • openmrsParentUuid - We need to map the Reveal location id to the OpenMRS UUID so that we can correctly identify parents and put it in this field
  • revealLocationId - This is the location id of this location in Reveal
  • openmrsTeamId - This is the team ID that should be assigned to this location. We use this for operational areas when there is team assignment.
{
  "name": "${revealName}",
  "description": null,
  "address1": null,
  "address2": null,
  "cityVillage": null,
  "stateProvince": null,
  "country": null,
  "postalCode": null,
  "latitude": null,
  "longitude": null,
  "countyDistrict": null,
  "address3": null,
  "address4": null,
  "address5": null,
  "address6": null,
  "tags": [
    {
      "uuid": "${geographicLevelOpenmrsUuidMapper}"
    }
  ],
  "parentLocation": {
    "uuid": "${openmrsParentUuid}"
  },
  "childLocations": [],
  "retired": false,
  "attributes": [
    {
      "attributeType": {
        "uuid": "3302b1cd-8e89-4d44-89ae-8a285f2c5583"
      },
      "value": "${revealLocationId}",
      "voided": false,
      "resourceVersion": "1.9"
    },
{
  "attributeType": {
	"uuid": "802e4109-56d0-407f-adcb-ea3a082840fc"
  },
  "value": "${openmrsTeamId}",
  "voided": false,
  "resourceVersion": "1.9"
}
  ],
  "address7": null,
  "address8": null,
  "address9": null,
  "address10": null,
  "address11": null,
  "address12": null,
  "address13": null,
  "address14": null,
  "address15": null,
  "resourceVersion": "2.0"
}

POST BaseUrl/location/{UUID}

This endpoint allows you to update an existing location in the system and should be used for things like reassignment of teams. You only have to POST the updated fields that you wish to change

Team Management

OpenMRS has a team management endpoint where we Create and Read teams. We don't need to Update teams at this time.

GET BaseUrl/team/team?v=default

This endpoint returns a list of all teams in the system. The most important information is the uuid and the teamName

// https://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/team/team?v=default
{
  "results": [
    {
      "display": "Miti",
      "uuid": "7e104eee-ec8a-4733-bcf7-c02c51cf43f4",
      "teamName": "Miti",
      "teamIdentifier": "MTL",
      "supervisor": "",
      "supervisorUuid": "",
      "supervisorTeam": "",
      "supervisorTeamUuid": "",
      "supervisorIdentifier": "",
      "voided": false,
      "voidReason": null,
      "members": 3,
      "location": {
        "uuid": "18e9f800-55c7-4261-907a-d804d6081f93",
        "display": "ea Miti Rural Health Centre",
        "name": "ea Miti Rural Health Centre",
        "description": null,
        "address1": null,
        "address2": null,
        "cityVillage": null,
        "stateProvince": "Eastern",
        "country": "Zambia",
        "postalCode": null,
        "latitude": null,
        "longitude": null,
        "countyDistrict": "Chadiza",
        "address3": null,
        "address4": null,
        "address5": null,
        "address6": null,
        "tags": [
          {
            "uuid": "b5372a31-13f5-48f9-a441-bcb5adf8ac6e",
            "display": "Rural Health Centre",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/locationtag/b5372a31-13f5-48f9-a441-bcb5adf8ac6e"
              }
            ]
          }
        ],
        "parentLocation": {
          "uuid": "315ca4ed-eebd-40ca-87a8-cf5aac69dd37",
          "display": "ea Chadiza District",
          "links": [
            {
              "rel": "self",
              "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/315ca4ed-eebd-40ca-87a8-cf5aac69dd37"
            }
          ]
        },
        "childLocations": [
          {
            "uuid": "f6caabb8-8461-4f04-a0d1-dc57208009eb",
            "display": "MKB_5",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/f6caabb8-8461-4f04-a0d1-dc57208009eb"
              }
            ]
          },
          {
            "uuid": "b4de8b63-d430-47eb-831b-8c291a828e04",
            "display": "MTI_13",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/b4de8b63-d430-47eb-831b-8c291a828e04"
              }
            ]
          },
          {
            "uuid": "91221652-f3b3-47fe-9997-543bac1f0a74",
            "display": "MTI_18",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/91221652-f3b3-47fe-9997-543bac1f0a74"
              }
            ]
          },
          {
            "uuid": "7322f6b4-5c23-4d08-85b2-8cad40a16374",
            "display": "MTI_24",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/7322f6b4-5c23-4d08-85b2-8cad40a16374"
              }
            ]
          },
          {
            "uuid": "f3dcba9e-4728-45d7-a549-07be9e9d4c73",
            "display": "MTI_47",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/f3dcba9e-4728-45d7-a549-07be9e9d4c73"
              }
            ]
          },
          {
            "uuid": "37d307fb-895f-4b93-838f-0456e0fdaf05",
            "display": "MTI_48",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/37d307fb-895f-4b93-838f-0456e0fdaf05"
              }
            ]
          },
          {
            "uuid": "fc93e7e1-3f48-49f6-8c2d-c995a748edca",
            "display": "MTI_49",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/fc93e7e1-3f48-49f6-8c2d-c995a748edca"
              }
            ]
          },
          {
            "uuid": "be786c91-7883-42fa-8d26-d8fb9d5f7366",
            "display": "MTI_5",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/be786c91-7883-42fa-8d26-d8fb9d5f7366"
              }
            ]
          },
          {
            "uuid": "a1bf2902-4475-45ee-a348-d17fe5f1909d",
            "display": "MTI_52",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/a1bf2902-4475-45ee-a348-d17fe5f1909d"
              }
            ]
          },
          {
            "uuid": "434780bd-924d-4bc3-8913-2d061e71a041",
            "display": "MTI_53",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/434780bd-924d-4bc3-8913-2d061e71a041"
              }
            ]
          },
          {
            "uuid": "1fce4065-dae5-473f-9ed3-05e3b1e91738",
            "display": "MTI_55",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/1fce4065-dae5-473f-9ed3-05e3b1e91738"
              }
            ]
          },
          {
            "uuid": "418589ef-0de1-416e-b72a-b0c599fb3a0d",
            "display": "MTI_57",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/418589ef-0de1-416e-b72a-b0c599fb3a0d"
              }
            ]
          },
          {
            "uuid": "c6c2f6ad-3692-4212-b87f-b73d5285b47c",
            "display": "MTI_58",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/c6c2f6ad-3692-4212-b87f-b73d5285b47c"
              }
            ]
          },
          {
            "uuid": "f5e81bb0-6b2c-4588-b3c0-d1b04f304b9f",
            "display": "MTI_59",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/f5e81bb0-6b2c-4588-b3c0-d1b04f304b9f"
              }
            ]
          },
          {
            "uuid": "5d9fc8bf-dbfd-440a-89c5-edbdfd93b374",
            "display": "MTI_60",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5d9fc8bf-dbfd-440a-89c5-edbdfd93b374"
              }
            ]
          },
          {
            "uuid": "2cea88fe-4c11-4ee0-a02a-08cb04420da5",
            "display": "MTI_63",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/2cea88fe-4c11-4ee0-a02a-08cb04420da5"
              }
            ]
          },
          {
            "uuid": "178b0c0a-d9af-4796-b4e0-cdd4533328d7",
            "display": "MTI_64",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/178b0c0a-d9af-4796-b4e0-cdd4533328d7"
              }
            ]
          },
          {
            "uuid": "ce26ec21-ea27-48f3-aa7b-e02c2b536af4",
            "display": "MTI_65",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/ce26ec21-ea27-48f3-aa7b-e02c2b536af4"
              }
            ]
          },
          {
            "uuid": "79f156de-d543-48a4-bb3c-639fe151f567",
            "display": "MTI_66",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/79f156de-d543-48a4-bb3c-639fe151f567"
              }
            ]
          },
          {
            "uuid": "8dca4838-12ad-4806-a3b0-4d4b443d3c99",
            "display": "MTI_68",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/8dca4838-12ad-4806-a3b0-4d4b443d3c99"
              }
            ]
          },
          {
            "uuid": "621b8f4d-fb42-44eb-818f-5f1db74a4f5b",
            "display": "MTI_69",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/621b8f4d-fb42-44eb-818f-5f1db74a4f5b"
              }
            ]
          },
          {
            "uuid": "063d7df2-b9f4-4e49-8f6e-b78b63933f5d",
            "display": "MTI_70",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/063d7df2-b9f4-4e49-8f6e-b78b63933f5d"
              }
            ]
          },
          {
            "uuid": "df09d9a0-5314-49da-8633-6c15e7da7bff",
            "display": "MTI_71",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/df09d9a0-5314-49da-8633-6c15e7da7bff"
              }
            ]
          },
          {
            "uuid": "fe16e30a-f2b8-494a-892c-a01940f496d2",
            "display": "MTI_73",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/fe16e30a-f2b8-494a-892c-a01940f496d2"
              }
            ]
          },
          {
            "uuid": "9c98917e-1fb4-46b1-88ab-093a838e449b",
            "display": "MTI_74",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/9c98917e-1fb4-46b1-88ab-093a838e449b"
              }
            ]
          },
          {
            "uuid": "d8a81789-24b9-42f4-a0ec-50e363f28595",
            "display": "MTI_75",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/d8a81789-24b9-42f4-a0ec-50e363f28595"
              }
            ]
          },
          {
            "uuid": "cd5d55f6-dad0-4d5c-b49e-c3885118866b",
            "display": "MTI_79",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/cd5d55f6-dad0-4d5c-b49e-c3885118866b"
              }
            ]
          },
          {
            "uuid": "efed725f-d6ff-4f30-b78e-c3fa6a9aec54",
            "display": "MTI_80",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/efed725f-d6ff-4f30-b78e-c3fa6a9aec54"
              }
            ]
          },
          {
            "uuid": "27ebabc7-c94e-4815-8754-e69248ca4c7a",
            "display": "MTI_83",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/27ebabc7-c94e-4815-8754-e69248ca4c7a"
              }
            ]
          },
          {
            "uuid": "c46813a0-545a-4dad-8eb6-f8ecc2c70ef3",
            "display": "MTI_84",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/c46813a0-545a-4dad-8eb6-f8ecc2c70ef3"
              }
            ]
          },
          {
            "uuid": "f2e83797-6511-4a35-8864-26d6ea362300",
            "display": "MTI_85",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/f2e83797-6511-4a35-8864-26d6ea362300"
              }
            ]
          },
          {
            "uuid": "269cb1d7-e06f-4a73-8b8f-1a3c54bc4c8f",
            "display": "MTI_87",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/269cb1d7-e06f-4a73-8b8f-1a3c54bc4c8f"
              }
            ]
          },
          {
            "uuid": "9d682f61-c27b-41c4-abed-e079bd07cf1b",
            "display": "MTI_INV",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/9d682f61-c27b-41c4-abed-e079bd07cf1b"
              }
            ]
          }
        ],
        "retired": false,
        "attributes": [
          {
            "uuid": "cd11c2ed-ae25-4bc1-8b9d-4f0d1f2635bb",
            "display": "mspray_location_id: 2953",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/18e9f800-55c7-4261-907a-d804d6081f93/attribute/cd11c2ed-ae25-4bc1-8b9d-4f0d1f2635bb"
              }
            ]
          },
          {
            "uuid": "62e5e9cc-da30-49c5-90cf-7fae48b68334",
            "display": "campaign_id: IRS_2019_S1",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/18e9f800-55c7-4261-907a-d804d6081f93/attribute/62e5e9cc-da30-49c5-90cf-7fae48b68334"
              }
            ]
          },
          {
            "uuid": "d8548400-c006-45ac-bc54-e7c45dba1d00",
            "display": "campaign_id: campaign_001",
            "voided": true,
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/18e9f800-55c7-4261-907a-d804d6081f93/attribute/d8548400-c006-45ac-bc54-e7c45dba1d00"
              }
            ]
          }
        ],
        "address7": null,
        "address8": null,
        "address9": null,
        "address10": null,
        "address11": null,
        "address12": null,
        "address13": null,
        "address14": null,
        "address15": null,
        "links": [
          {
            "rel": "self",
            "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/18e9f800-55c7-4261-907a-d804d6081f93"
          },
          {
            "rel": "full",
            "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/18e9f800-55c7-4261-907a-d804d6081f93?v=full"
          }
        ],
        "resourceVersion": "2.0"
      },
      "resourceVersion": "1.8"
    },
    {
      "display": "Tafelansoni",
      "uuid": "fd8274ad-2acb-439d-adad-7a0185af0120",
      "teamName": "Tafelansoni",
      "teamIdentifier": "TFL",
      "supervisor": "",
      "supervisorUuid": "",
      "supervisorTeam": "",
      "supervisorTeamUuid": "",
      "supervisorIdentifier": "",
      "voided": false,
      "voidReason": null,
      "members": 1,
      "location": {
        "uuid": "5c0fc51f-8bd0-42a9-a21e-7c0fff122983",
        "display": "ea Tafelansoni Rural Health Centre",
        "name": "ea Tafelansoni Rural Health Centre",
        "description": null,
        "address1": null,
        "address2": null,
        "cityVillage": null,
        "stateProvince": "Eastern",
        "country": "Zambia",
        "postalCode": null,
        "latitude": null,
        "longitude": null,
        "countyDistrict": "Chadiza",
        "address3": null,
        "address4": null,
        "address5": null,
        "address6": null,
        "tags": [
          {
            "uuid": "b5372a31-13f5-48f9-a441-bcb5adf8ac6e",
            "display": "Rural Health Centre",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/locationtag/b5372a31-13f5-48f9-a441-bcb5adf8ac6e"
              }
            ]
          }
        ],
        "parentLocation": {
          "uuid": "315ca4ed-eebd-40ca-87a8-cf5aac69dd37",
          "display": "ea Chadiza District",
          "links": [
            {
              "rel": "self",
              "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/315ca4ed-eebd-40ca-87a8-cf5aac69dd37"
            }
          ]
        },
        "childLocations": [
          {
            "uuid": "bdc20d37-c9a6-4a62-87d2-a5e3df3058c3",
            "display": "TFL_250",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/bdc20d37-c9a6-4a62-87d2-a5e3df3058c3"
              }
            ]
          },
          {
            "uuid": "ea21d62e-8108-429d-a093-e97e6bdafd6b",
            "display": "TFL_251",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/ea21d62e-8108-429d-a093-e97e6bdafd6b"
              }
            ]
          },
          {
            "uuid": "eb9793c1-74b7-427a-b6f0-1d8bf6a79b0f",
            "display": "TFL_252",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/eb9793c1-74b7-427a-b6f0-1d8bf6a79b0f"
              }
            ]
          },
          {
            "uuid": "0942021c-b966-4a90-b5cc-0afc9a8b888a",
            "display": "TFL_253",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/0942021c-b966-4a90-b5cc-0afc9a8b888a"
              }
            ]
          },
          {
            "uuid": "3d0184ff-8bb6-42da-89e2-2bb2c06b0e37",
            "display": "TFL_259a",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/3d0184ff-8bb6-42da-89e2-2bb2c06b0e37"
              }
            ]
          },
          {
            "uuid": "6a5a3ff6-9b23-4d03-90dc-9ef18ef1cea6",
            "display": "TFL_259b",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/6a5a3ff6-9b23-4d03-90dc-9ef18ef1cea6"
              }
            ]
          },
          {
            "uuid": "d31d74d1-7b7c-4665-ae4a-7f7b35d82216",
            "display": "TFL_259c",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/d31d74d1-7b7c-4665-ae4a-7f7b35d82216"
              }
            ]
          }
        ],
        "retired": false,
        "attributes": [
          {
            "uuid": "d9030af1-fe68-4116-8fe3-de5ee2b6d3a8",
            "display": "mspray_location_id: 2948",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5c0fc51f-8bd0-42a9-a21e-7c0fff122983/attribute/d9030af1-fe68-4116-8fe3-de5ee2b6d3a8"
              }
            ]
          },
          {
            "uuid": "2964d4fe-644a-427b-9187-c670e3bb69e9",
            "display": "campaign_id: campaign_002,campaign_005",
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5c0fc51f-8bd0-42a9-a21e-7c0fff122983/attribute/2964d4fe-644a-427b-9187-c670e3bb69e9"
              }
            ]
          },
          {
            "uuid": "3c24bc3e-9a75-4869-aef2-72fd9fee9b25",
            "display": "campaign_id: campaign_002",
            "voided": true,
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5c0fc51f-8bd0-42a9-a21e-7c0fff122983/attribute/3c24bc3e-9a75-4869-aef2-72fd9fee9b25"
              }
            ]
          },
          {
            "uuid": "e65cd564-7203-4f75-96b4-e81a74b8f99c",
            "display": "campaign_id: campaign_005",
            "voided": true,
            "links": [
              {
                "rel": "self",
                "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5c0fc51f-8bd0-42a9-a21e-7c0fff122983/attribute/e65cd564-7203-4f75-96b4-e81a74b8f99c"
              }
            ]
          }
        ],
        "address7": null,
        "address8": null,
        "address9": null,
        "address10": null,
        "address11": null,
        "address12": null,
        "address13": null,
        "address14": null,
        "address15": null,
        "links": [
          {
            "rel": "self",
            "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5c0fc51f-8bd0-42a9-a21e-7c0fff122983"
          },
          {
            "rel": "full",
            "uri": "http://openmrs.reveal-stage.smartregister.org/openmrs/ws/rest/v1/location/5c0fc51f-8bd0-42a9-a21e-7c0fff122983?v=full"
          }
        ],
        "resourceVersion": "2.0"
      },
      "resourceVersion": "1.8"
    }
  ]
}

POST BaseUrl/team/team

This allows us to post a team to OpenMRS. Note that the response returns the UUID of the team.

Variables:

  • teamName - The name of the team
  • openmrsLocationUuid - This is the uuid of the OpenMRS location where the team is assigned
  • teamIdentifier - This is the identifier of the team
{
  "teamName": "${teamName}",
  "location": "${openmrsLocationUuid}",
  "teamIdentifier": "${teamIdentifier}",
  "supervisor": "0"
}