Skip to content

Commit a026d71

Browse files
NPA-4831: Add a new scenaio for _include=Consent:performer
1 parent 473ad23 commit a026d71

File tree

5 files changed

+208
-24
lines changed

5 files changed

+208
-24
lines changed

sandbox/api/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@
4949
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT = (
5050
f"{GET_CONSENT__DIRECTORY}multiple-relationships-single-patient.yaml"
5151
)
52+
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PERFORMER = (
53+
f"{GET_CONSENT__DIRECTORY}multiple-relationships-single-patient-include-performer.yaml"
54+
)
5255
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PATIENT = (
5356
f"{GET_CONSENT__DIRECTORY}multiple-relationships-single-patient-include-patient.yaml"
5457
)

sandbox/api/get_consent.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
GET_CONSENT__FILTERED_RELATIONSHIPS_STATUS_PROPOSED_ACTIVE,
1010
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT,
1111
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PATIENT,
12+
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PERFORMER,
1213
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_BOTH,
1314
GET_CONSENT__MULTIPLE_RELATIONSHIPS,
1415
GET_CONSENT__MULTIPLE_RELATIONSHIPS_INCLUDE_BOTH,
@@ -70,6 +71,7 @@ def get_consent_response() -> Union[dict, tuple]:
7071
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT,
7172
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_BOTH,
7273
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PATIENT,
74+
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PERFORMER,
7375
)
7476
# Filtering
7577
elif performer_identifier == "9000000017":

sandbox/api/tests/test_get_consent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ def test_get_consent_returns_expected_responses__mocked_get_consent(
153153
"./api/examples/GET_Consent/multiple-relationships-single-patient.yaml",
154154
200,
155155
),
156+
(
157+
"patient:identifier=9000000100&_include=Consent:performer",
158+
"./api/examples/GET_Consent/multiple-relationships-single-patient-include-performer.yaml",
159+
200,
160+
),
156161
(
157162
"patient:identifier=9000000100&_include=Consent:patient",
158163
"./api/examples/GET_Consent/multiple-relationships-single-patient-include-patient.yaml",
Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
ConsentMultipleRelationshipsSinglePatientIncludePerformerPatientBundle:
2+
summary: Multiple relationships (multiple proxy relationships with single patient)
3+
description: A Bundle containing multiple proxy relationships with single patient, including proxy details.
4+
value:
5+
resourceType: Bundle
6+
timestamp: '2020-08-26T14:00:00+00:00'
7+
total: 3
8+
type: searchset
9+
entry:
10+
- fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742
11+
resource:
12+
resourceType: RelatedPerson
13+
id: BE974742
14+
identifier:
15+
- system: 'https://fhir.nhs.uk/Id/nhs-number'
16+
value: '9000000020'
17+
- system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier'
18+
value: ABC0000003
19+
patient:
20+
type: Patient
21+
identifier:
22+
system: 'https://fhir.nhs.uk/Id/nhs-number'
23+
value: '9000000100'
24+
relationship:
25+
- coding:
26+
- system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode'
27+
code: PRN
28+
display: parent
29+
- system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode'
30+
code: MTH
31+
display: mother
32+
search:
33+
mode: include
34+
- fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9
35+
resource:
36+
resourceType: Consent
37+
id: BBCC67E9
38+
status: active
39+
scope:
40+
coding:
41+
- system: 'http://terminology.hl7.org/CodeSystem/consentscope'
42+
code: patient-privacy
43+
display: Privacy Consent
44+
text: Patient Privacy Consent
45+
category:
46+
- coding:
47+
- system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
48+
code: INFA
49+
display: Information Access
50+
text: Information Access Consent
51+
patient:
52+
identifier:
53+
system: 'https://fhir.nhs.uk/Id/nhs-number'
54+
value: '9000000100'
55+
dateTime: '2024-07-21T17:32:28Z'
56+
performer:
57+
- identifier:
58+
system: 'https://fhir.nhs.uk/Id/nhs-number'
59+
value: '9000000020'
60+
search:
61+
mode: match
62+
- fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742
63+
resource:
64+
resourceType: RelatedPerson
65+
id: BE974742
66+
identifier:
67+
- system: 'https://fhir.nhs.uk/Id/nhs-number'
68+
value: '9000000021'
69+
- system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier'
70+
value: ABC0000003
71+
patient:
72+
type: Patient
73+
identifier:
74+
system: 'https://fhir.nhs.uk/Id/nhs-number'
75+
value: '9000000100'
76+
relationship:
77+
- coding:
78+
- system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode'
79+
code: Personal
80+
display: Personal relationship with the patient
81+
search:
82+
mode: include
83+
- fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1
84+
resource:
85+
resourceType: Consent
86+
id: WWCC67T1
87+
status: active
88+
scope:
89+
coding:
90+
- system: 'http://terminology.hl7.org/CodeSystem/consentscope'
91+
code: patient-privacy
92+
display: Privacy Consent
93+
text: Patient Privacy Consent
94+
category:
95+
- coding:
96+
- system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
97+
code: INFA
98+
display: Information Access
99+
text: Information Access Consent
100+
patient:
101+
identifier:
102+
system: 'https://fhir.nhs.uk/Id/nhs-number'
103+
value: '9000000100'
104+
dateTime: '2024-07-21T17:32:28Z'
105+
performer:
106+
- identifier:
107+
system: 'https://fhir.nhs.uk/Id/nhs-number'
108+
value: '9000000021'
109+
verification:
110+
- verified: true
111+
verifiedWith:
112+
identifier:
113+
system: 'https://fhir.nhs.uk/Id/nhs-number'
114+
value: '9000000021'
115+
verificationDate: '2024-07-21T17:32:28Z'
116+
search:
117+
mode: match
118+
- fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742
119+
resource:
120+
resourceType: RelatedPerson
121+
id: BE974742
122+
identifier:
123+
- system: 'https://fhir.nhs.uk/Id/nhs-number'
124+
value: '9000000022'
125+
- system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier'
126+
value: ABC0000003
127+
patient:
128+
type: Patient
129+
identifier:
130+
system: 'https://fhir.nhs.uk/Id/nhs-number'
131+
value: '9000000100'
132+
relationship:
133+
- coding:
134+
- system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode'
135+
code: Personal
136+
display: Personal relationship with the patient
137+
search:
138+
mode: include
139+
- fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1
140+
resource:
141+
resourceType: Consent
142+
id: AATD11A1
143+
status: inactive
144+
scope:
145+
coding:
146+
- system: 'http://terminology.hl7.org/CodeSystem/consentscope'
147+
code: patient-privacy
148+
display: Privacy Consent
149+
text: Patient Privacy Consent
150+
category:
151+
- coding:
152+
- system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
153+
code: INFA
154+
display: Information Access
155+
text: Information Access Consent
156+
patient:
157+
identifier:
158+
system: 'https://fhir.nhs.uk/Id/nhs-number'
159+
value: '9000000100'
160+
dateTime: '2024-07-21T17:32:28Z'
161+
performer:
162+
- identifier:
163+
system: 'https://fhir.nhs.uk/Id/nhs-number'
164+
value: '9000000022'
165+
verification:
166+
- verified: true
167+
verifiedWith:
168+
identifier:
169+
system: 'https://fhir.nhs.uk/Id/nhs-number'
170+
value: '9000000022'
171+
verificationDate: '2024-07-21T17:32:28Z'
172+
search:
173+
mode: match

0 commit comments

Comments
 (0)