Skip to content

Commit 2162153

Browse files
committed
VED-736: remove contained and add use official
1 parent 51ced50 commit 2162153

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

backend/src/models/utils/generic_utils.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,9 @@ def form_json(response, _element, identifier, baseurl):
152152
# Full Immunization payload to be returned if only the identifier parameter was provided
153153
if identifier and not _element:
154154
resource = response["resource"]
155-
156-
# --- filtering: drop contained and add use=official to identifiers ---
157155
resource.pop("contained", None)
158-
if isinstance(resource.get("identifier"), list):
159-
for item in resource["identifier"]:
160-
if isinstance(item, dict):
161-
item["use"] = "official"
156+
if "use" not in response["identifier"][0]:
157+
resource["identifier"][0]["use"] = "official"
162158

163159
elif identifier and _element:
164160
element = {e.strip().lower() for e in _element.split(",") if e.strip()}

0 commit comments

Comments
 (0)