Skip to content

Commit

Permalink
Change Physical_Type to type in locations_payload.json structure
Browse files Browse the repository at this point in the history
  • Loading branch information
TraciebelWairimu committed Jan 29, 2024
1 parent 2df5530 commit 596a827
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
20 changes: 11 additions & 9 deletions importer/json_payloads/locations_payload.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@
"reference": "Location/$parentID",
"display": "$parentName"
},
"physicalType": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
"code": "$pt_code",
"display": "$pt_display"
}
]
}
"type": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/location-physical-type",
"code": "$pt_code",
"display": "$pt_display"
}
]
}
]
}
}
4 changes: 2 additions & 2 deletions importer/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,11 @@ def location_extras(resource, payload_string):
else:
logging.error("Unsupported location type provided for " + resource[0])
obj = json.loads(payload_string)
del obj["resource"]["physicalType"]
del obj["resource"]["type"]
payload_string = json.dumps(obj, indent=4)
except IndexError:
obj = json.loads(payload_string)
del obj["resource"]["physicalType"]
del obj["resource"]["type"]
payload_string = json.dumps(obj, indent=4)

return payload_string
Expand Down

0 comments on commit 596a827

Please sign in to comment.