Skip to content

Commit bd84d91

Browse files
author
Adrian Clay
authored
Wiremock can return "Large Patient Record" if configured in response to unknown NHS Number (#663)
1 parent 8cc52a4 commit bd84d91

3 files changed

Lines changed: 72 additions & 13 deletions

File tree

wiremock/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ To change the patient record returned to be [No Documents](stubs/__files/correct
7474
curl --request PUT --data '{"state": "No Documents"}' http://localhost:8110/__admin/scenarios/migrateStructuredRecord/state
7575
```
7676

77+
To change the patient record returned to be [Large Patient Record](stubs/__files/correctPatientStructuredRecordLargePayload.json):
78+
79+
```shell
80+
curl --request PUT --data '{"state": "Large Patient Record"}' http://localhost:8110/__admin/scenarios/migrateStructuredRecord/state
81+
```
82+
7783
To change the patient record returned to be NOT FOUND:
7884

7985
```shell

wiremock/stubs/__files/correctPatientStructuredRecordLargePayload.json

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,20 @@
121121
}
122122
],
123123
"active": true,
124+
"telecom":
125+
[
126+
{
127+
"system": "phone",
128+
"value": "01454587554",
129+
"use": "home"
130+
},
131+
{
132+
"system": "phone",
133+
"value": "+447401254880",
134+
"use": "mobile"
135+
}
136+
],
137+
{{^patient}}
124138
"name":
125139
[
126140
{
@@ -137,19 +151,6 @@
137151
]
138152
}
139153
],
140-
"telecom":
141-
[
142-
{
143-
"system": "phone",
144-
"value": "01454587554",
145-
"use": "home"
146-
},
147-
{
148-
"system": "phone",
149-
"value": "+447401254880",
150-
"use": "mobile"
151-
}
152-
],
153154
"gender": "male",
154155
"birthDate": "1925-04-21",
155156
"address":
@@ -165,6 +166,35 @@
165166
"postalCode": "TS18 3BL"
166167
}
167168
],
169+
{{/patient}}
170+
{{#patient}}
171+
"name": [
172+
{
173+
"use": "official",
174+
"text": "{{patient.name.0.given.0}} {{patient.name.0.family}}",
175+
"family": "{{patient.name.0.family}}",
176+
"given": [
177+
"{{patient.name.0.given.0}}"
178+
],
179+
"prefix": [
180+
"{{patient.name.0.prefix.0}}"
181+
]
182+
}
183+
],
184+
"gender": "{{ patient.gender }}",
185+
"birthDate": "{{ patient.birthDate }}",
186+
"address": [
187+
{
188+
"use": "home",
189+
"type": "physical",
190+
"line": [
191+
"{{ patient.address.0.line.0 }}",
192+
"{{ patient.address.0.line.1 }}"
193+
],
194+
"postalCode": "{{ patient.address.0.postalCode }}"
195+
}
196+
],
197+
{{/patient}}
168198
"contact":
169199
[
170200
{
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"priority": 2,
3+
"scenarioName": "migrateStructuredRecord",
4+
"requiredScenarioState": "Large Patient Record",
5+
"request": {
6+
"method": "POST",
7+
"urlPattern": "/.*/STU3/1/gpconnect/fhir/Patient/[$]gpc[.]migratestructuredrecord"
8+
},
9+
"response": {
10+
"status": 200,
11+
"bodyFileName": "correctPatientStructuredRecordLargePayload.json",
12+
"headers": {
13+
"Server": "nginx",
14+
"Date": "{{now format='E, d MMM y HH:mm:ss z'}}",
15+
"Content-Type": "application/fhir+json;charset=UTF-8",
16+
"Transfer-Encoding": "chunked",
17+
"Connection": "keep-alive",
18+
"Cache-Control": "no-store",
19+
"X-Powered-By": "HAPI FHIR 3.0.0 REST Server (FHIR Server; FHIR 3.0.1/DSTU3)",
20+
"Strict-Transport-Security":"max-age=31536000"
21+
}
22+
}
23+
}

0 commit comments

Comments
 (0)