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

Add the Administrative level to locations #1360

Merged
merged 11 commits into from
Apr 5, 2024
Merged

Conversation

ciremusyoka
Copy link
Collaborator

@ciremusyoka ciremusyoka commented Mar 26, 2024

closes #1349

Changes included with this PR

  • Adds administrative level to locations resource type

Checklist

  • tests are included and passing
  • documentation is changed or added
  • Internationalization:
    • Ensure all strings are internationalized.
  • Role-Based Access:
    • Verify that all user actions have appropriate role-based access permissions set.

Comment on lines 19 to 29
const parseFhirChildren = (rawNodeMap: ChildNodeList[]) => {
const parseFhirChildren = (rawNodeMap: ChildNodeList[], admLevel = 0) => {
return rawNodeMap.map((child) => {
// standardize the parsedHierarchy node structure to be similar for both
// root node and all other descendant nodes.
const { treeNode } = child;
const nextAdmLevel = admLevel + 1;
const parsedNode: ParsedHierarchyNode = {
...treeNode,
children: parseFhirChildren(treeNode.children ?? []) as ParsedHierarchyNode[],
administrativeLevel: admLevel,
children: parseFhirChildren(treeNode.children ?? [], nextAdmLevel) as ParsedHierarchyNode[],
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel iffy about adding the adminstrative level here for 2 reasons:

  1. it possibly duplicates information that already exists in the node
  2. There is no guarantee that parseFhirChildren will only always be used to generate a tree starting with the the root fhir location.

@@ -4,6 +4,7 @@ export const eusmServicePointCodeSystemUri =
export const snomedCodeSystemUri = 'http://snomed.info/sct';
export const hl7PhysicalTypeCodeSystemUri =
'http://terminology.hl7.org/CodeSystem/location-physical-type';
export const administrativeLevelSystemUri = 'https://smartregister.org/codes/administrative-level';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets have this as http://smartregister.org/CodeSystem/administrative-level

@ciremusyoka ciremusyoka merged commit f990991 into main Apr 5, 2024
0 of 2 checks passed
@ciremusyoka ciremusyoka deleted the 1349-location-adm-levels branch April 5, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FHIR Road Map]: Add the Administrative level for each Location created on OpenSRP web
2 participants