From 596a82743819c2ad5d498b103856921bf4c6e695 Mon Sep 17 00:00:00 2001 From: TraciebelWairimu Date: Mon, 29 Jan 2024 16:09:46 +0300 Subject: [PATCH] Change Physical_Type to type in locations_payload.json structure --- importer/json_payloads/locations_payload.json | 20 ++++++++++--------- importer/main.py | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/importer/json_payloads/locations_payload.json b/importer/json_payloads/locations_payload.json index 393726f5..edc37cd2 100644 --- a/importer/json_payloads/locations_payload.json +++ b/importer/json_payloads/locations_payload.json @@ -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" + } + ] + } + ] } } diff --git a/importer/main.py b/importer/main.py index 26d9a0d7..b5ab872c 100644 --- a/importer/main.py +++ b/importer/main.py @@ -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