Skip to content

Commit b001ac0

Browse files
committed
NPA-4922 Update Sandbox to include scenario
1 parent dfbe085 commit b001ac0

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

sandbox/api/constants.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
f"{GET_CONSENT__DIRECTORY}single-mother-child-relationship-include-performer-patient.yaml"
4747
)
4848
GET_CONSENT__STATUS_PARAM_INVALID = f"{GET_CONSENT__DIRECTORY}errors/invalid-status-parameter.yaml"
49-
49+
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT = (
50+
f"{GET_CONSENT__DIRECTORY}multiple-relationships-single-patient.yaml"
51+
)
5052
# POST Consent
5153
POST_CONSENT__DIRECTORY = "./api/examples/POST_Consent/"
5254
POST_CONSENT__SUCCESS = f"{POST_CONSENT__DIRECTORY}success.yaml"

sandbox/api/get_consent.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
GET_CONSENT__FILTERED_RELATIONSHIPS_STATUS_ACTIVE,
88
GET_CONSENT__FILTERED_RELATIONSHIPS_STATUS_INACTIVE,
99
GET_CONSENT__FILTERED_RELATIONSHIPS_STATUS_PROPOSED_ACTIVE,
10+
GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT,
1011
GET_CONSENT__MULTIPLE_RELATIONSHIPS,
1112
GET_CONSENT__MULTIPLE_RELATIONSHIPS_INCLUDE_BOTH,
1213
GET_CONSENT__MULTIPLE_RELATIONSHIPS_INCLUDE_PATIENT,
@@ -61,7 +62,8 @@ def get_consent_response() -> Union[dict, tuple]:
6162
GET_CONSENT__SINGLE_MOTHER_CHILD_RELATIONSHIP,
6263
GET_CONSENT__SINGLE_MOTHER_CHILD_RELATIONSHIP_INCLUDE_BOTH,
6364
)
64-
# TODO: for patient identifier
65+
elif patient_identifier == "9000000100":
66+
return generate_response_from_example(GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT, 200)
6567
# Filtering
6668
elif performer_identifier == "9000000017":
6769
return check_for_consent_filtering(
@@ -71,6 +73,7 @@ def get_consent_response() -> Union[dict, tuple]:
7173
GET_CONSENT__FILTERED_RELATIONSHIPS_STATUS_INACTIVE,
7274
GET_CONSENT__FILTERED_RELATIONSHIPS_STATUS_PROPOSED_ACTIVE,
7375
)
76+
7477
elif performer_identifier == "9000000022":
7578
return check_for_consent_include_params(
7679
_include,

sandbox/api/tests/test_get_consent.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
"./api/examples/errors/invalidated-resource.yaml",
2222
404,
2323
),
24+
(
25+
"patient:identifier=9000000100", # Multiple relationships single patient
26+
"./api/examples/GET_Consent/multiple-relationships-single-patient.yaml",
27+
200,
28+
)
2429
],
2530
)
2631
@patch("sandbox.api.get_consent.generate_response_from_example")

0 commit comments

Comments
 (0)