Skip to content

Commit df298a2

Browse files
committed
filter in form_json4
1 parent 85d3d31 commit df298a2

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

backend/src/fhir_service.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def get_immunization_by_identifier(
6767
imms_resp = self.immunization_repo.get_immunization_by_identifier(
6868
identifier_pk, imms_vax_type_perms
6969
)
70+
patient_full_url = f"urn:uuid:{str(uuid4())}"
71+
filtered_resource = Filter.search(imms_resp['resource'], patient_full_url)
72+
imms_resp['resource'] = filtered_resource
73+
7074
if not imms_resp:
7175
base_url = f"{get_service_url()}/Immunization"
7276
response = form_json(imms_resp, None, None, base_url)

backend/src/models/utils/generic_utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,6 @@ 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-
resource.pop("contained", None)
156-
if "use" not in resource["identifier"][0]:
157-
resource["identifier"][0]["use"] = "official"
158155

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

0 commit comments

Comments
 (0)