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 Road Map]: Update the Locations Addition Page #1338

Closed
13 tasks
dubdabasoduba opened this issue Feb 25, 2024 · 5 comments · Fixed by #1358
Closed
13 tasks

[FHIR Road Map]: Update the Locations Addition Page #1338

dubdabasoduba opened this issue Feb 25, 2024 · 5 comments · Fixed by #1358

Comments

@dubdabasoduba
Copy link
Member

dubdabasoduba commented Feb 25, 2024

Issue Context?

  • OpenSRP will start collecting GeoJSON data and add it to the location resources.
  • OpenSRP web is used to manage locations and we would like to add the ability to collect GeoJSON data.

Issue Implementation details?

  • Update the Location module Add Location form to add the ability to collect LAT and LONG for all Locations created for the physical type building. Below is a screenshot of how this would look like.
    • These fields should be optional since not all OpenSRP deployments will collect this data. We do not need configurations to hide or show the fields.
      image 4
  • Update the Location module Add Location form to add the ability to collect GeoJSON for all Locations created for the physical type jurisdiction. Below is a screenshot of how this would look like.
    • This field should be optional since not all OpenSRP deployments will collect this data. We do not need configurations to hide or show the fields.
      image 6
  • Update the Location module Add Location form to add a Type field. These fields might have different value sets e.g. EUSM will use the following types @peterMuriuki let's chat about how to use the ValueSet and CodeSystem resources for this.
    • The values of this field will be added as a code on the type property of the Location Resource. Samples are attached below
[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"csc","display":"Community Service Center"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"csb1","display":"CSB1"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"csb2","display":"CSB2"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"bsd","display":"BSD"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"chrd1","display":"CHRD1"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"chrd2","display":"CHRD2"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"chrr","display":"CHRR"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"sdsp","display":"SDSP"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"drsp","display":"DRSP"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"msp","display":"MSP"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"epp","display":"EPP"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"warehouse","display":"Warehouse"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"water_point","display":"Water Point"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"presco","display":"Presco"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"meah","display":"MEAH"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"dreah","display":"DREAH"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"men","display":"MEN"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"dren","display":"DREN"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"mppspf","display":"MPPSPF"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"drppspf","display":"DRPPSPF"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"ngo_partner","display":"NGO Partner"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"site_communautaire","display":"Site Communautaire"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"drjs","display":"DRJS"},{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"instat","display":"INSTAT"}]}]
  • Update the Location module Add Location form to add an External ID field. This ID should be optional since not all projects use external IDs.
    • This value of this field should be added to the Identifier with the official and the use property on the Identifier.
  • All the new fields should be taken into account when editing any Location

Issue Acceptance criteria?

  • Show the LAT and LONG fields on the Add Location form with physical type building
  • Show the Geometry field on the Add Location form with the physical type jurisdiction
  • Show the External ID field on the Add Location form
  • Show the Type field on the Add Location form

FHIR resources to be used?

  • Location Resource
  • Binary Resource
  • List Resource

Relevant Information

Sample Location with GeoJSON

{
  "resourceType": "Location",
  "id": "25c56dd5-4dca-449d-bf6e-665f90d0ff77",
  "meta": {
    "versionId"  : "1"                            ,
    "lastUpdated": "2023-02-22T16:03:03.752+00:00",
    "source"     : "#797f2c80a50102e1"
  },
  "identifier": [
    {"use": "official", "value": "25c56dd5-4dca-449d-bf6e-665f90d0ff77"}
  ],
  "extension": [
    {
      "url": "http://build.fhir.org/extension-location-boundary-geojson.html",
      "valueAttachment": {
        "data": "Imdlb21ldHJ5IjogewogICAgInR5cGUiOiAiTXVsdGlQb2x5Z29uIiwKICAgICJjb29yZGluYXRlcyI6IFsKICAgICAgWwogICAgICAgIFsKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzYwOCwKICAgICAgICAgICAgLTEuMjY4MgogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzU5NywKICAgICAgICAgICAgLTEuMjY1MwogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzUyOCwKICAgICAgICAgICAgLTEuMjYxNgogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzc4OSwKICAgICAgICAgICAgLTEuMjU2MwogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzk4NywKICAgICAgICAgICAgLTEuMjU5MQogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuODExNywKICAgICAgICAgICAgLTEuMjcyNQogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuODE5NywKICAgICAgICAgICAgLTEuMjkwNgogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzkyNiwKICAgICAgICAgICAgLTEuMjk3MgogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzY4NCwKICAgICAgICAgICAgLTEuMjk3OAogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzU2NCwKICAgICAgICAgICAgLTEuMjk1MwogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzUxNCwKICAgICAgICAgICAgLTEuMjg5NwogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzUzOSwKICAgICAgICAgICAgLTEuMjg2MQogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzUzOSwKICAgICAgICAgICAgLTEuMjgzNQogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzQ5MiwKICAgICAgICAgICAgLTEuMjcxNwogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzU2OSwKICAgICAgICAgICAgLTEuMjcxMgogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzU3NSwKICAgICAgICAgICAgLTEuMjY4NgogICAgICAgICAgXSwKICAgICAgICAgIFsKICAgICAgICAgICAgMzYuNzYwOCwKICAgICAgICAgICAgLTEuMjY4MgogICAgICAgICAgXQogICAgICAgIF0KICAgICAgXQogICAgXQogIH0="
      }
    }
  ],
  "type": {
    "coding": [
      {
        "system" : "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
        "code"   : "csc"                                              ,
        "display": "Community Service Center"
      }
    ]
  },
  "status": "active",
  "name": "Dagoreti North",
  "alias": ["Dagoreti North"],
  "description": "This is Dagoreti North within Nairobi",
  "physicalType": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
        "code": "jdn",
        "display": "Jurisdiction"
      }
    ]
  },
  "partOf": {"reference": "Location/eff94f33-c356-4634-8795-d52340706ba9"}
}

Sample Location with LAT and LONG

{
  "resourceType": "Location",
  "id": "c20fa259-1beb-42ad-b186-b8a7d18fc622",
  "meta": {
    "versionId"  : "1"                            ,
    "lastUpdated": "2023-02-22T16:03:03.752+00:00",
    "source"     : "#797f2c80a50102e1"
  },
  "identifier": [
    {"use": "official", "value": "c20fa259-1beb-42ad-b186-b8a7d18fc622"}
  ],
  "type": {
    "coding": [
      {
        "system" : "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
        "code"   : "work"                                             ,
        "display": "Work Site"
      },
      {
        "system" : "http://terminology.hl7.org/CodeSystem/v3-RoleCode",
        "code"   : "site_communautaire"                               ,
        "display": "Site Communautaire"
      }
    ]
  },
  "status": "active",
  "name": "Coptic Hospital",
  "alias": ["Coptic Hospital"],
  "description": "This is Coptic Hospital in kilimani",
  "physicalType": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
        "code": "bu",
        "display": "Building"
      }
    ]
  },
  "partOf": {"reference": "Location/25c56dd5-4dca-449d-bf6e-665f90d0ff77"},
  "position": {"longitude": 36.797607567050235, "latitude": -1.29757628715006}
}
@peterMuriuki
Copy link
Collaborator

@dubdabasoduba have these resources been pushed to any server?

@dubdabasoduba
Copy link
Member Author

@peterMuriuki the locations are already on the server. I can push the list for you

@peterMuriuki peterMuriuki modified the milestones: M1.2.24, M1.3.24 Mar 4, 2024
@peterMuriuki
Copy link
Collaborator


{
  "resourceType": "CodeSystem",
  "id": "43ef3826-982f-446d-bd3a-dd7a238fedcb",
  "url": "http://smartregister.org/CodeSystem/eusm-service-point-type",
  "version": "1.0",
  "name": "eusm-service-point-type",
  "title": "Service point type",
  "status": "draft",
  "publisher": "OpenSRP",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://opensrp.io"
        }
      ]
    }
  ],
  "valueSet": "http://smartregister.org/ValueSet/eusm-service-point-type",
  "description" : "Defines a set of codes that can be used to indicate the logical grouping types of service points or locations",
  "caseSensitive" : true,
  "content": "complete",
  "concept": [
  { "code": "CSB2", "display": "CSB2" },
  { "code": "BSD", "display": "BSD" },
  { "code": "CHRD1", "display": "CHRD1" },
  { "code": "CHRD2", "display": "CHRD2" },
  { "code": "CHRR", "display": "CHRR" },
  { "code": "SDSP", "display": "SDSP" },
  { "code": "DRSP", "display": "DRSP" },
  { "code": "MSP", "display": "MSP" },
  { "code": "EPP", "display": "EPP" },
  { "code": "CEG", "display": "CEG" },
  { "code": "Warehouse", "display": "Warehouse" },
  { "code": "Water Point", "display": "Water Point" },
  { "code": "Presco", "display": "Presco" },
  { "code": "MEAH", "display": "MEAH" },
  { "code": "DREAH", "display": "DREAH" },
  { "code": "MEN", "display": "MEN" },
  { "code": "DREN", "display": "DREN" },
  { "code": "MPPSPF", "display": "MPPSPF" },
  { "code": "DRPPSPF", "display": "DRPPSPF" },
  { "code": "NGO Partner", "display": "NGO Partner" },
  { "code": "Site Communautaire", "display": "Site Communautaire" },
  { "code": "DRJS", "display": "DRJS" },
  { "code": "INSTAT", "display": "INSTAT" },
  { "code": "Mairie", "display": "Mairie" },
  { "code": "Ecole privé", "display": "Ecole privé" }
]
}

{
  "resourceType" : "ValueSet",
  "id" : "b4129cb7-ec80-44d8-9929-d0f5ad9ea228",
  "url" : "http://smartregister.org/ValueSet/eusm-service-point-type",
  "version" : "1.0.0",
  "name" : "service-point-type",
  "title" : "Service point type",
  "status" : "draft",
  "experimental" : true,
  "date" : "2024-03-06T11:24:39.826Z",
  "publisher": "OpenSRP",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://opensrp.io"
        }
      ]
    }
  ],
  "description" : "Defines a set of codes that can be used to indicate the type of a service point.",
  "immutable" : true,
  "compose" : {
    "include" : [
      {
        "system" : "http://smartregister.org/CodeSystem/eusm-service-point-type"
      }
    ]
  }
}

Unicef sections

{
  "resourceType": "CodeSystem",
  "id": "74814119-cc31-485a-b4a4-e466fc0e86cf",
  "url": "http://smartregister.org/CodeSystem/eusm-unicef-sections",
  "version": "1.0",
  "name": "eusm-unicef-sections",
  "title": "Eusm Unicef Sections",
  "status": "draft",
  "publisher": "OpenSRP",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://opensrp.io"
        }
      ]
    }
  ],
  "valueSet": "http://smartregister.org/ValueSet/eusm-unicef-sections",
  "description" : "Defines a set of codes that can be used to indicate the unicef sections",
  "caseSensitive" : true,
  "content": "complete",
  "concept": [
  { "code": "Health", "display": "Health" },
  { "code": "WASH", "display": "WASH" },
  { "code": "Nutrition", "display": "Nutrition" },
  { "code": "Education", "display": "Education" },
  { "code": "Child Protection", "display": "Child Protection" },
  { "code": "Social Policy", "display": "Social Policy" },
  { "code": "C4D", "display": "C4D" },
  { "code": "DRR", "display": "DRR" },
  { "code": "Several sections", "display": "Several sections" },
  { "code": "NGO partner", "display": "NGO partner" }
]
}

{
  "resourceType" : "ValueSet",
  "id" : "8685c95a-3542-4953-82b0-8dfd8ddd9a53",
  "url" : "http://smartregister.org/ValueSet/eusm-unicef-sections",
  "version" : "1.0.0",
  "name" : "eusm-unicef-sections",
  "title" : "Eusm Unicef Sections",
  "status" : "draft",
  "experimental" : true,
  "date" : "2024-03-06T11:24:39.826Z",
  "publisher": "OpenSRP",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://opensrp.io"
        }
      ]
    }
  ],
  "description" : "Defines a set of codes that can be used to indicate the unicef sections",
  "immutable" : true,
  "compose" : {
    "include" : [
      {
        "system" : "http://smartregister.org/CodeSystem/eusm-unicef-sections"
      }
    ]
  }
}

Donors

{
  "resourceType": "CodeSystem",
  "id": "1cc7c85c-77be-454e-9f19-3cefc7b454bc",
  "url": "http://smartregister.org/CodeSystem/eusm-donors",
  "version": "1.0",
  "name": "eusm-donors",
  "title": "EUSM Donors",
  "status": "draft",
  "publisher": "OpenSRP",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://opensrp.io"
        }
      ]
    }
  ],
  "valueSet": "http://smartregister.org/ValueSet/eusm-donors",
  "description" : "Defines a set of codes that can be used to indicate donors",
  "caseSensitive" : true,
  "content": "complete",
  "concept": [
  { "code": "ADB", "display": "ADB" },
  { "code": "NatCom Belgium", "display": "NatCom Belgium" },
  { "code": "BMGF", "display": "BMGF" },
  { "code": "Govt of Canada", "display": "Govt of Canada" },
  { "code": "NatCom Canada", "display": "NatCom Canada" },
  { "code": "NatCom Denmark", "display": "NatCom Denmark" },
  { "code": "ECW", "display": "ECW" },
  { "code": "End Violence Fund", "display": "End Violence Fund" },
  { "code": "ECHO", "display": "ECHO" },
  { "code": "EC", "display": "EC" },
  { "code": "NatCom Finland", "display": "NatCom Finland" },
  { "code": "Govt of France", "display": "Govt of France" },
  { "code": "NatCom France", "display": "NatCom France" },
  { "code": "GAVI", "display": "GAVI" },
  { "code": "NatCom Germany", "display": "NatCom Germany" },
  { "code": "Govt of Germany", "display": "Govt of Germany" },
  { "code": "NatCom Iceland", "display": "NatCom Iceland" },
  { "code": "NatCom Italy", "display": "NatCom Italy" },
  { "code": "Govt of Japan", "display": "Govt of Japan" },
  { "code": "NatCom Japan", "display": "NatCom Japan" },
  { "code": "NatCom Luxembourg", "display": "NatCom Luxembourg" },
  { "code": "Monaco", "display": "Monaco" },
  { "code": "NatCom Netherlands", "display": "NatCom Netherlands" },
  { "code": "Govt of Norway", "display": "Govt of Norway" },
  { "code": "NatCom Norway", "display": "NatCom Norway" },
  {
    "code": "Nutrition International",
    "display": "Nutrition International"
  },
  { "code": "NatCom Poland", "display": "NatCom Poland" },
  { "code": "Govt of Korea", "display": "Govt of Korea" },
  { "code": "NatCom Spain", "display": "NatCom Spain" },
  { "code": "NatCom Sweden", "display": "NatCom Sweden" },
  { "code": "NatCom Switzerland", "display": "NatCom Switzerland" },
  { "code": "Govt of UK", "display": "Govt of UK" },
  { "code": "NatCom UK", "display": "NatCom UK" },
  { "code": "NatCom USA", "display": "NatCom USA" },
  { "code": "OFDA", "display": "OFDA" },
  { "code": "CDC", "display": "CDC" },
  { "code": "USAID", "display": "USAID" },
  { "code": "USAID FFP", "display": "USAID FFP" },
  { "code": "World Bank", "display": "World Bank" },
  { "code": "UNICEF", "display": "UNICEF" }
]

}

{
  "resourceType" : "ValueSet",
  "id" : "a6258f70-3014-41a8-a898-c05bfb210f69",
  "url" : "http://smartregister.org/ValueSet/eusm-donors",
  "version" : "1.0.0",
  "name" : "eusm-donors",
  "title" : "EUSM Donors",
  "status" : "draft",
  "experimental" : true,
  "date" : "2024-03-06T11:24:39.826Z",
  "publisher": "OpenSRP",
  "contact" : [
    {
      "telecom" : [
        {
          "system" : "url",
          "value" : "http://opensrp.io"
        }
      ]
    }
  ],
  "description" : "Defines a set of codes that can be used to indicate donors",
  "immutable" : true,
  "compose" : {
    "include" : [
      {
        "system" : "http://smartregister.org/CodeSystem/eusm-donors"
      }
    ]
  }
}

@peterMuriuki
Copy link
Collaborator

peterMuriuki commented Mar 7, 2024

The following request attempts to expand the service point types valueset

https://fhir.labs.smartregister.org/fhir/ValueSet/b4129cb7-ec80-44d8-9929-d0f5ad9ea228/$expand

It however fails with the below error in our staging servers:

{
  "resourceType": "OperationOutcome",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Operation Outcome</h1><table border=\"0\"><tr><td style=\"font-weight: bold;\">ERROR</td><td>[]</td><td><pre>HAPI-0389: Failed to call access method: org.hibernate.search.util.common.SearchException: HSEARCH800001: Hibernate Search was not initialized.</pre></td>\n\t\t\t</tr>\n\t\t</table>\n\t</div>"
  },
  "issue": [
    {
      "severity": "error",
      "code": "processing",
      "diagnostics": "HAPI-0389: Failed to call access method: org.hibernate.search.util.common.SearchException: HSEARCH800001: Hibernate Search was not initialized."
    }
  ]
}

cc @dubdabasoduba @ndegwamartin @bennsimon

Tested this locally By adding hibernate.search.enabled: true to jpa.properties in application.yaml and it works there.

@dubdabasoduba
Copy link
Member Author

This should unblock the above blocker from @peterMuriuki

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

Successfully merging a pull request may close this issue.

3 participants