Skip to content

Commit c4e3779

Browse files
committed
[GPCAPIM-395]: Add test patient to provider stub
1 parent 5b61536 commit c4e3779

4 files changed

Lines changed: 37 additions & 0 deletions

File tree

gateway-api/stubs/stubs/data/bundles/bundles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@ def _wrap_patient_in_bundle(patient: dict[str, Any]) -> dict[str, Any]:
1818
}
1919

2020
ALICE_JONES_9999999999 = _wrap_patient_in_bundle(Patients.ALICE_JONES_9999999999)
21+
LESTER_EGAN_9692140466 = _wrap_patient_in_bundle(Patients.LESTER_EGAN_9692140466)
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"resourceType": "Patient",
3+
"id": "593C97B5-7B99-4326-9140-B329CC03A0D1",
4+
"meta": {
5+
"versionId": "1533356236474679227",
6+
"profile": [
7+
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
8+
]
9+
},
10+
"identifier": [
11+
{
12+
"system": "https://fhir.nhs.uk/Id/nhs-number",
13+
"value": "9692140466"
14+
}
15+
],
16+
"name": [
17+
{
18+
"use": "official",
19+
"family": "Egan",
20+
"given": ["Lester"]
21+
}
22+
],
23+
"gender": "male",
24+
"birthDate": "1958-02-02",
25+
"generalPractitioner": [
26+
{
27+
"reference": "Practitioner/C8FD0E2C-3124-4C72-AC8D-ABEA65537D1B"
28+
}
29+
]
30+
}

gateway-api/stubs/stubs/data/patients/patients.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ def load_patient(filename: str) -> dict[str, Any]:
2727
)
2828
ALICE_JONES_9999999999 = load_patient("alice_jones_9999999999.json")
2929
ORANGE_BOX_TRIGGER_9690937278 = load_patient("orange_box_trigger_9690937278.json")
30+
LESTER_EGAN_9692140466 = load_patient("lester_egan_9692140466.json")

gateway-api/stubs/stubs/provider/stub.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,11 @@ def access_record_structured(
278278
status_code=200,
279279
json_data=Bundles.ALICE_JONES_9999999999,
280280
)
281+
if nhs_number == "9692140466":
282+
return self._create_response(
283+
status_code=200,
284+
json_data=Bundles.LESTER_EGAN_9692140466,
285+
)
281286

282287
return self._create_response(
283288
status_code=404,

0 commit comments

Comments
 (0)