Skip to content

Commit 3c585cf

Browse files
author
Adrian Clay
authored
Add PWTP9 (Patient with lots of investigations) Wiremock scenario (#1096)
* Add PWTP9 (Patient with lots of investigations) Wiremock scenario Also add some NOPAT configuration to some of the Resources to help test confidentiality code functionality. * Add comment field to Filing Comment Observation This will ensure a NarrativeStatement gets generated so we can observe the NOPAT functionality associated with it.
1 parent 71b992f commit 3c585cf

File tree

3 files changed

+118
-36
lines changed

3 files changed

+118
-36
lines changed

wiremock/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,12 @@ To change the patient record returned to be [PWTP6, which has many Immunisations
8787
curl --request PUT --data '{"state": "Immunisations"}' http://localhost:8110/__admin/scenarios/migrateStructuredRecord/state
8888
```
8989

90+
To change the patient record returned to be [PWTP9, which has many Investigations](stubs/__files/EMISPatientStructurede2eResponsePWTP9.json):
91+
92+
```shell
93+
curl --request PUT --data '{"state": "Investigations"}' http://localhost:8110/__admin/scenarios/migrateStructuredRecord/state
94+
```
95+
9096
To change the patient record returned to be [Large Patient Record](stubs/__files/correctPatientStructuredRecordLargePayload.json):
9197

9298
```shell

wiremock/stubs/__files/EMISPatientStructurede2eResponsePWTP9.json

Lines changed: 89 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2085,37 +2085,64 @@
20852085
"value": "{{jsonPath request.body '$.parameter[0].valueIdentifier.value'}}"
20862086
}
20872087
],
2088-
"name": [
2089-
{
2090-
"use": "official",
2091-
"family": "Adams",
2092-
"given": [
2093-
"Chas",
2094-
"Calvin"
2095-
],
2096-
"prefix": [
2097-
"Mr"
2098-
]
2099-
},
2100-
{
2101-
"use": "old",
2102-
"family": "Pwtestpatient"
2103-
}
2104-
],
2105-
"gender": "male",
2106-
"birthDate": "2021-11-10",
2107-
"address": [
2108-
{
2109-
"use": "home",
2110-
"type": "physical",
2111-
"line": [
2112-
"Dar es Salaam",
2113-
"Grimsby Road"
2114-
],
2115-
"city": "Grimsby",
2116-
"postalCode": "DN37 7DY"
2117-
}
2118-
],
2088+
{{^patient}}
2089+
"name": [
2090+
{
2091+
"use": "official",
2092+
"text": "Samuel HESLBY",
2093+
"family": "HESLBY",
2094+
"given": [
2095+
"Samuel"
2096+
],
2097+
"prefix": [
2098+
"MR"
2099+
]
2100+
}
2101+
],
2102+
"gender": "male",
2103+
"birthDate": "1936-03-17",
2104+
"address": [
2105+
{
2106+
"use": "home",
2107+
"type": "physical",
2108+
"line": [
2109+
"10 MANOR DRIVE",
2110+
"STILLINGTON"
2111+
],
2112+
"city": "STOCKTON-ON-TEES",
2113+
"district": "CLEVELAND",
2114+
"postalCode": "TS21 1JG"
2115+
}
2116+
],
2117+
{{/patient}}
2118+
{{#patient}}
2119+
"name": [
2120+
{
2121+
"use": "official",
2122+
"text": "{{patient.name.0.given.0}} {{patient.name.0.family}}",
2123+
"family": "{{patient.name.0.family}}",
2124+
"given": [
2125+
"{{patient.name.0.given.0}}"
2126+
],
2127+
"prefix": [
2128+
"{{patient.name.0.prefix.0}}"
2129+
]
2130+
}
2131+
],
2132+
"gender": "{{ patient.gender }}",
2133+
"birthDate": "{{ patient.birthDate }}",
2134+
"address": [
2135+
{
2136+
"use": "home",
2137+
"type": "physical",
2138+
"line": [
2139+
"{{ patient.address.0.line.0 }}",
2140+
"{{ patient.address.0.line.1 }}"
2141+
],
2142+
"postalCode": "{{ patient.address.0.postalCode }}"
2143+
}
2144+
],
2145+
{{/patient}}
21192146
"generalPractitioner": [
21202147
{
21212148
"reference": "Practitioner/6D340A1B-BC15-4D4E-93CF-BBCB5B74DF73"
@@ -2737,7 +2764,12 @@
27372764
"meta": {
27382765
"profile": [
27392766
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-DiagnosticReport-1"
2740-
]
2767+
],
2768+
"security": [{
2769+
"system":"http://hl7.org/fhir/v3/ActCode",
2770+
"code":"NOPAT",
2771+
"display":"no disclosure to patient, family or caregivers without attending provider's authorization"
2772+
}]
27412773
},
27422774
"identifier": [
27432775
{
@@ -11121,7 +11153,12 @@
1112111153
"meta": {
1112211154
"profile": [
1112311155
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Specimen-1"
11124-
]
11156+
],
11157+
"security": [{
11158+
"system":"http://hl7.org/fhir/v3/ActCode",
11159+
"code":"NOPAT",
11160+
"display":"no disclosure to patient, family or caregivers without attending provider's authorization"
11161+
}]
1112511162
},
1112611163
"identifier": [
1112711164
{
@@ -11240,7 +11277,12 @@
1124011277
"meta": {
1124111278
"profile": [
1124211279
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1"
11243-
]
11280+
],
11281+
"security": [{
11282+
"system":"http://hl7.org/fhir/v3/ActCode",
11283+
"code":"NOPAT",
11284+
"display":"no disclosure to patient, family or caregivers without attending provider's authorization"
11285+
}]
1124411286
},
1124511287
"identifier": [
1124611288
{
@@ -11263,6 +11305,7 @@
1126311305
},
1126411306
"effectiveDateTime": "2010-06-24T12:41:27.053+01:00",
1126511307
"issued": "2010-06-24T12:41:27.053+01:00",
11308+
"comment": "This is a test of the NOPAT filing comment behaviour.",
1126611309
"performer": [
1126711310
{
1126811311
"reference": "Practitioner/6D340A1B-BC15-4D4E-93CF-BBCB5B74DF73"
@@ -11946,7 +11989,12 @@
1194611989
"meta": {
1194711990
"profile": [
1194811991
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1"
11949-
]
11992+
],
11993+
"security": [{
11994+
"system":"http://hl7.org/fhir/v3/ActCode",
11995+
"code":"NOPAT",
11996+
"display":"no disclosure to patient, family or caregivers without attending provider's authorization"
11997+
}]
1195011998
},
1195111999
"identifier": [
1195212000
{
@@ -25809,7 +25857,12 @@
2580925857
"meta": {
2581025858
"profile": [
2581125859
"https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Observation-1"
25812-
]
25860+
],
25861+
"security": [{
25862+
"system":"http://hl7.org/fhir/v3/ActCode",
25863+
"code":"NOPAT",
25864+
"display":"no disclosure to patient, family or caregivers without attending provider's authorization"
25865+
}]
2581325866
},
2581425867
"identifier": [
2581525868
{
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": "Investigations",
5+
"request": {
6+
"method": "POST",
7+
"urlPattern": "/.*/STU3/1/gpconnect/fhir/Patient/[$]gpc[.]migratestructuredrecord"
8+
},
9+
"response": {
10+
"status": 200,
11+
"bodyFileName": "EMISPatientStructurede2eResponsePWTP9.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)