Skip to content

Commit 207de29

Browse files
NPA-4707: Corrected references
1 parent 1bc0721 commit 207de29

File tree

6 files changed

+38
-10
lines changed

6 files changed

+38
-10
lines changed

sandbox/api/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
INCLUDE_FLAG = "RelatedPerson:patient"
22

3-
PATIENT_IDENTIFIERS = ["9000000017", "9000000033"]
4-
RELATED_IDENTIFIERS = ["9000000009", "9000000025"]
3+
PATIENT_IDENTIFIERS = ["9000000017", "9000000033", "9000000042"]
4+
RELATED_IDENTIFIERS = ["9000000009", "9000000025", "9000000042"]
55

66
CONSENT_PERFORMER = "Consent:performer"
77
CONSENT_PATIENT = "Consent:patient"

sandbox/api/get_related_person.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
RELATED__VERIFY_RELATIONSHIP_09_WITH_INCLUDE,
1212
RELATED__VERIFY_RELATIONSHIP_25,
1313
RELATED__VERIFY_RELATIONSHIP_25_WITH_INCLUDE,
14+
RELATED__LIST_CHILD_RELATIONSHIP,
15+
RELATED__LIST_CHILD_RELATIONSHIP_WITH_INCLUDE,
1416
)
1517
from .utils import (
1618
check_for_empty,
@@ -34,8 +36,10 @@ def get_related_person_response() -> Union[dict, tuple]:
3436
try:
3537
# Check Headers
3638
if errors := check_for_get_related_person_errors(request):
39+
3740
return errors
3841

42+
print("******** ERROR**** ")
3943
identifier = remove_system(request.args.get("identifier"))
4044
patient_identifier = remove_system(request.args.get("patient:identifier"))
4145
include = request.args.get("_include")
@@ -72,13 +76,13 @@ def get_related_person_response() -> Union[dict, tuple]:
7276
RELATED__LIST_RELATIONSHIP_WITH_INCLUDE,
7377
):
7478
return one_seven
75-
79+
print("four2")
7680
if four_two := check_for_list(
7781
"9000000042",
7882
patient_identifier,
7983
include,
80-
RELATED__LIST_RELATIONSHIP,
81-
RELATED__LIST_RELATIONSHIP_WITH_INCLUDE,
84+
RELATED__LIST_CHILD_RELATIONSHIP,
85+
RELATED__LIST_CHILD_RELATIONSHIP_WITH_INCLUDE,
8286
):
8387
return four_two
8488

sandbox/api/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ def check_for_get_related_person_errors(request: Request) -> Optional[tuple]:
4242
Optional[tuple]: Tuple with response and status code if error is found
4343
"""
4444
identifier = request.args.get("identifier")
45+
patient = request.args.get("patient:identifier")
4546
identifier_without_system = remove_system(request.args.get("identifier"))
47+
patient_without_system = remove_system(request.args.get("patient:identifier"))
4648

47-
if not identifier:
49+
if not identifier and not patient:
4850
return generate_response_from_example(RELATED__ERROR_IDENTIFIER_MISSING, 400)
4951
elif identifier and len(identifier_without_system) != 10:
5052
# invalid identifier

specification/examples/responses/GET_RelatedPerson/list_relationship_9000000042.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,29 @@
11
ListRelationship9000000042:
22
summary: List relationship response for 9000000042
33
description: |
4-
Example response containing the details of a list of matched candidate proxy relationship between a child and their birth mother.
4+
Example response containing the details of a list of matched relationship between a child and their birth mother.
55
66
The FHIR Bundle contains a `RelatedPerson` resource for each of the relationships verified against authoritative sources.
77
88
value:
99
entry:
1010
- fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742
1111
resource:
12+
birthDate: '2017-09-23'
1213
id: BE974742
1314
identifier:
1415
- system: https://fhir.nhs.uk/Id/nhs-number
1516
value: '9000000042'
17+
name:
18+
- family: MOGAJI
19+
given:
20+
- GADIL
21+
id: BLnbA
22+
period:
23+
start: '2021-07-08'
24+
prefix:
25+
- MR
26+
use: usual
1627
patient:
1728
identifier:
1829
system: https://fhir.nhs.uk/Id/nhs-number

specification/examples/responses/GET_RelatedPerson/list_relationship_9000000042_include.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ListRelationship9000000042Include:
22
summary: List relationship response for 9000000042 with include
33
description: |
4-
Example response containing the details of a list of matched candidate proxy relationship between a child and their birth mother.
4+
Example response containing the details of a list of matched relationship between a child and their birth mother.
55
66
The FHIR Bundle contains a `RelatedPerson` resource for each of the relationships verified against authoritative sources.
77
@@ -11,10 +11,21 @@ ListRelationship9000000042Include:
1111
entry:
1212
- fullUrl: https://sandbox.api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742
1313
resource:
14+
birthDate: '2017-09-23'
1415
id: BE974742
1516
identifier:
1617
- system: https://fhir.nhs.uk/Id/nhs-number
1718
value: '9000000042'
19+
name:
20+
- family: MOGAJI
21+
given:
22+
- GADIL
23+
id: BLnbA
24+
period:
25+
start: '2021-07-08'
26+
prefix:
27+
- MR
28+
use: usual
1829
patient:
1930
identifier:
2031
system: https://fhir.nhs.uk/Id/nhs-number

specification/validated-relationships-service-api.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,8 @@ paths:
359359
| --------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------- |
360360
| List Relationship | `identifier`=`9000000017` | HTTP Status 200 List of relationships for the proxy |
361361
| List Relationship and include patient's details | `identifier`=`9000000017` and `_include`=`RelatedPerson:patient` | HTTP Status 200 List of relationships for the proxy and includes patient data |
362-
| List Patient Relationship | `identifier`=`9000000042` | HTTP Status 200 List of relationships for the patient |
363-
| List Patient Relationship and include patient's details | `identifier`=`9000000042` and `_include`=`RelatedPerson:patient` | HTTP Status 200 List of relationships for the patient and includes proxy data |
362+
| List Patient Relationship | `patient:identifier`=`9000000042` | HTTP Status 200 List of relationships for the patient |
363+
| List Patient Relationship and include patient's details | `patient:identifier`=`9000000042` and `_include`=`RelatedPerson:patient` | HTTP Status 200 List of relationships for the patient and includes proxy data |
364364
| List Relationship and no relationships returned | `identifier`=`9000000033` | HTTP Status 200 Empty bundle |
365365
| Verify Relationship between proxy and patient | `identifier`=`9000000017` and `patient:identifier`=`9000000009` | HTTP Status 200 Verified relationship between patient and proxy |
366366
| Verify Relationship between proxy and patient and include patient's details | `identifier`=`9000000017` and `patient:identifier`=`9000000009` and `_include`=`RelatedPerson:patient` | HTTP Status 200 Verified relationship between patient and proxy and includes patient's details |

0 commit comments

Comments
 (0)