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

[Location Hierarchy] Update the hierarchy creation process to retrieve child locations using lineage location tags. #3696

Open
2 tasks
dubdabasoduba opened this issue Jan 21, 2025 · 1 comment

Comments

@dubdabasoduba
Copy link
Member

Describe the feature request.

  • OpenSRP includes a widget called Multiselect Widget, designed to visualize resources in a hierarchical format, primarily locations. For locations, the widget currently retrieves child locations by recursively querying the database.
  • This ticket aims to update the child location retrieval process to utilize lineage location tags instead.
  • A sample of lineage location tags is provided below.
{
  "system": "http://smartregister.org/CodeSystem/location-lineage",
  "code": "4ddd4157-921b-4c65-820c-161b6e845011",
  "display": "Location Name"
}

Additional context

Acceptance criteria

  • Searching the child locations to create the hierarchy should use the lineage location tags instead of the recursively searching based on the Location.partOf property
  • The API should return empty in case the lineage location tags are not available.

Sample resource

{
  "resourceType": "Location",
  "id": "aa5ac053-d8aa-4f42-b326-bae32e5944e1",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2024-07-22T15:13:53.014+00:00",
    "source": "#1b7d28fd21bf0b63",
    "tag": [
      {
        "system" : "http://smartregister.org/CodeSystem/location-lineage",
        "code"   : "03176924-6b3c-4b74-bccd-32afcceebabd"                  ,
        "display": "Madagascar (Level 1)"
      },
      {
        "system" : "http://smartregister.org/CodeSystem/location-lineage",
        "code"   : "bf116fdd-6617-4302-88e4-72fd1af2851c"                  ,
        "display": "ALAOTRA MANGORO (Level 2)"
      },
      {
        "system" : "http://smartregister.org/CodeSystem/location-lineage",
        "code"   : "696b532f-15b1-4422-a0ab-3525587260cd"                  ,
        "display": "Ambatondrazaka (Level 3)"
      }
    ]
  },
  "identifier": [
    {"use": "official", "value": "aa5ac053-d8aa-4f42-b326-bae32e5944e1"}
  ],
  "status": "active",
  "name": "Ambandrika",
  "type": [
    {
      "coding": [
        {
          "system" : "http://terminology.hl7.org/CodeSystem/location-type",
          "code"   : "jdn"                                                ,
          "display": "jurisdiction"
        }
      ]
    },
    {
      "coding": [
        {
          "system" : "https://smartregister.org/codes/administrative-level",
          "code"   : "4"                                                   ,
          "display": "Level 4"
        }
      ]
    },
    {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
          "code": "jdn",
          "display": "Jurisdiction"
        }
      ]
    }
  ],
  "physicalType": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
        "code": "jdn",
        "display": "Jurisdiction"
      }
    ]
  },
  "partOf": {
    "reference": "Location/696b532f-15b1-4422-a0ab-3525587260cd",
    "display"  : "Ambatondrazaka"
  }
}

Implementation plan (For Engineers)
The plan for implementing the solution e.g. via a description or a check list for the various ordered tasks that will need to be completed.
i.e. Describe how you intend to solve the problem

@pld
Copy link
Member

pld commented Jan 22, 2025

Let's use a feature flag to control this, so it is backwards compatible for older gateway versions

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

No branches or pull requests

2 participants