Skip to content

Commit

Permalink
Update for API spec upcomming changes
Browse files Browse the repository at this point in the history
  • Loading branch information
JackPlowman committed Apr 5, 2024
1 parent d5381ea commit 5ea3bbb
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 38 deletions.
9 changes: 5 additions & 4 deletions sandbox/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,20 @@ def get_related_persons() -> Union[dict, tuple]:
if (
request.args.get("identifier")
and request.args.get("patient")
and request.args.get("_include") == "patient"
and request.args.get("_include") == "RelatedPerson:patient"
):
# Request with identifier, patient and _include=patient
return get_response(
"./api/responses/GET_RelatedPerson/identifier_and_patient_include.json"
"./api/responses/GET_RelatedPerson/identifier_and_patient_identifier_include.json"
)
elif request.args.get("identifier") and request.args.get("patient"):
# Request with identifier and patient
return get_response(
"./api/responses/GET_RelatedPerson/identifier_and_patient.json"
"./api/responses/GET_RelatedPerson/identifier_and_patient_identifier.json"
)
elif (
request.args.get("identifier") and request.args.get("_include") == "patient"
request.args.get("identifier")
and request.args.get("_include") == "RelatedPerson:patient"
):
# Request with identifier and _include=patient
return get_response(
Expand Down
5 changes: 0 additions & 5 deletions sandbox/api/responses/GET_RelatedPerson/identifier.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
"code": "MTH",
"display": "mother",
"system": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype"
},
{
"code": "Personal",
"display": "Personal relationship with the patient",
"system": "https://fhir.nhs.uk/R4/CodeSystem/UKCore-AdditionalRelatedPersonRole"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
"code": "MTH",
"display": "mother",
"system": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype"
},
{
"code": "Personal",
"display": "Personal relationship with the patient",
"system": "https://fhir.nhs.uk/R4/CodeSystem/UKCore-AdditionalRelatedPersonRole"
}
]
}
Expand Down Expand Up @@ -61,11 +56,6 @@
"code": "MTH",
"display": "mother",
"system": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype"
},
{
"code": "Personal",
"display": "Personal relationship with the patient",
"system": "https://fhir.nhs.uk/R4/CodeSystem/UKCore-AdditionalRelatedPersonRole"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@
"code": "MTH",
"display": "mother",
"system": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype"
},
{
"code": "Personal",
"display": "Personal relationship with the patient",
"system": "https://fhir.nhs.uk/R4/CodeSystem/UKCore-AdditionalRelatedPersonRole"
}
]
}
Expand Down Expand Up @@ -111,11 +106,6 @@
"code": "MTH",
"display": "mother",
"system": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype"
},
{
"code": "Personal",
"display": "Personal relationship with the patient",
"system": "https://fhir.nhs.uk/R4/CodeSystem/UKCore-AdditionalRelatedPersonRole"
}
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@
"code": "MTH",
"display": "mother",
"system": "http://hl7.org/fhir/ValueSet/relatedperson-relationshiptype"
},
{
"code": "Personal",
"display": "Personal relationship with the patient",
"system": "https://fhir.nhs.uk/R4/CodeSystem/UKCore-AdditionalRelatedPersonRole"
}
]
}
Expand Down
16 changes: 12 additions & 4 deletions sandbox/api/tests/test_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,23 @@ def test_health_check(client: object, endpoint: str) -> None:
("identifier=1234567890", "./api/responses/GET_RelatedPerson/identifier.json"),
(
"identifier=1234567890&patient=0987654321",
"./api/responses/GET_RelatedPerson/identifier_and_patient.json",
"./api/responses/GET_RelatedPerson/identifier_and_patient_identifier.json",
),
(
"identifier=1234567890&_include=patient",
"identifier=1234567890&_include=RelatedPerson:patient",
"./api/responses/GET_RelatedPerson/identifier_include.json",
),
(
"identifier=1234567890&patient=0987654321&_include=patient",
"./api/responses/GET_RelatedPerson/identifier_and_patient_include.json",
"identifier=1234567890&patient=0987654321&_include=RelatedPerson:patient",
"./api/responses/GET_RelatedPerson/identifier_and_patient_identifier_include.json",
),
(
"identifier=1234567890&_include=any",
"./api/responses/GET_RelatedPerson/identifier.json",
),
(
"identifier=1234567890&patient=0987654321&_include=any",
"./api/responses/GET_RelatedPerson/identifier_and_patient_identifier.json",
),
],
)
Expand Down

0 comments on commit 5ea3bbb

Please sign in to comment.