Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FHIR Location Hierarchy sample #841

Open
dubdabasoduba opened this issue Sep 22, 2021 · 1 comment
Open

FHIR Location Hierarchy sample #841

dubdabasoduba opened this issue Sep 22, 2021 · 1 comment
Labels
Documentation Improvements or additions to documentation

Comments

@dubdabasoduba
Copy link
Member

  "resourceType": "Bundle",
  "id": "c159c537-41b8-46f4-863f-7b7428a5baf1",
  "meta": {
    "lastUpdated": "2021-09-22T11:47:39.152+00:00"
  },
  "type": "searchset",
  "total": 1,
  "link": [
    {
      "relation": "self",
      "url": "http://fhir-auth.labs.smartregister.org/fhir/LocationHierarchy?identifier=eff94f33-c356-4634-8795-d52340706ba9"
    }
  ],
  "entry": [
    {
      "fullUrl": "http://fhir-auth.labs.smartregister.org/fhir/LocationHierarchy/Location Resource : 2252",
      "resource": {
        "resourceType": "LocationHierarchy",
        "id": "Location Resource : 2252",
        "meta": {
          "profile": [
            "http://hl7.org/fhir/profiles/custom-resource"
          ]
        },
        "LocationHierarchyTree": {
          "locationsHierarchy": {
            "listOfNodes": {
              "treeNodeId": "Location/2252",
              "treeNode": [
                {
                  "nodeId": "Location/2252",
                  "label": "Root OpenSRP Location",
                  "node": {
                    "resourceType": "Location",
                    "id": "2252",
                    "meta": {
                      "versionId": "2",
                      "lastUpdated": "2021-09-22T11:42:37.806+00:00",
                      "source": "#4e76fe88fa6f53e5"
                    },
                    "identifier": [
                      {
                        "use": "official",
                        "value": "eff94f33-c356-4634-8795-d52340706ba9"
                      }
                    ],
                    "status": "active",
                    "name": "Root OpenSRP Location",
                    "alias": [
                      "Root Location"
                    ],
                    "description": "This is the Root Location that all other locations are part of. Any locations that are directly part of this should be displayed as the root location.",
                    "physicalType": {
                      "coding": [
                        {
                          "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                          "code": "jdn",
                          "display": "Jurisdiction"
                        }
                      ]
                    }
                  },
                  "children": [
                    {
                      "childId": "Location/303",
                      "treeNode": {
                        "nodeId": "Location/303",
                        "label": "Ona Office Sub Location",
                        "node": {
                          "resourceType": "Location",
                          "id": "303",
                          "meta": {
                            "versionId": "3",
                            "lastUpdated": "2021-09-22T11:46:36.265+00:00",
                            "source": "#e9183ec8f04ef135"
                          },
                          "identifier": [
                            {
                              "use": "official",
                              "value": "93bc9c3d-6321-41b0-9b93-1275d7114e22"
                            }
                          ],
                          "status": "active",
                          "name": "Ona Office Sub Location",
                          "alias": [
                            "ona office"
                          ],
                          "description": "The Sub location",
                          "physicalType": {
                            "coding": [
                              {
                                "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                "code": "jdn",
                                "display": "Jurisdiction"
                              }
                            ]
                          },
                          "partOf": {
                            "reference": "Location/2252"
                          }
                        },
                        "parent": "Location/2252",
                        "children": [
                          {
                            "childId": "Location/305",
                            "treeNode": {
                              "nodeId": "Location/305",
                              "label": "Part Of Sub Location",
                              "node": {
                                "resourceType": "Location",
                                "id": "305",
                                "meta": {
                                  "versionId": "1",
                                  "lastUpdated": "2021-05-26T15:48:46.680+00:00",
                                  "source": "#a12f7c6c90507352"
                                },
                                "identifier": [
                                  {
                                    "use": "official",
                                    "value": "c3ff106e-91cb-4346-b45f-d7ad5346af5a"
                                  }
                                ],
                                "status": "active",
                                "name": "Part Of Sub Location",
                                "alias": [
                                  "part off"
                                ],
                                "description": "Testing the part of ",
                                "physicalType": {
                                  "coding": [
                                    {
                                      "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                                      "code": "jdn",
                                      "display": "Jurisdiction"
                                    }
                                  ]
                                },
                                "partOf": {
                                  "reference": "Location/303"
                                }
                              },
                              "parent": "Location/303"
                            }
                          }
                        ]
                      }
                    }
                  ]
                }
              ]
            },
            "parentChildren": [
              {
                "identifier": "Location/2252",
                "childIdentifiers": [
                  "Location/303"
                ]
              },
              {
                "identifier": "Location/303",
                "childIdentifiers": [
                  "Location/305"
                ]
              }
            ]
          }
        },
        "locationId": "2252"
      }
    }
  ]
}
@peterMuriuki
Copy link
Collaborator

peterMuriuki commented Mar 21, 2023

Root location resource only:

{
                    "resourceType": "Location",
                    "id": "2252",
                    "meta": {
                      "versionId": "2",
                      "lastUpdated": "2021-09-22T11:42:37.806+00:00",
                      "source": "#4e76fe88fa6f53e5"
                    },
                    "identifier": [
                      {
                        "use": "official",
                        "value": "eff94f33-c356-4634-8795-d52340706ba9"
                      }
                    ],
                    "status": "active",
                    "name": "Root OpenSRP Location",
                    "alias": [
                      "Root Location"
                    ],
                    "description": "This is the Root Location that all other locations are part of. Any locations that are directly part of this should be displayed as the root location.",
                    "physicalType": {
                      "coding": [
                        {
                          "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
                          "code": "jdn",
                          "display": "Jurisdiction"
                        }
                      ]
                    }
}

Identifier value provided in the env config should be the offictial identifier i.e. eff94f33-c356-4634-8795-d52340706ba9 in the example payload above.

value passed for REACT_APP_ROOT_LOCATION_ID should be the id i.e. 2252 in the example payload above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants