diff --git a/sandbox/api/constants.py b/sandbox/api/constants.py index 87f08f5c..b5930479 100644 --- a/sandbox/api/constants.py +++ b/sandbox/api/constants.py @@ -49,6 +49,15 @@ GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT = ( f"{GET_CONSENT__DIRECTORY}multiple-relationships-single-patient.yaml" ) +GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PERFORMER = ( + f"{GET_CONSENT__DIRECTORY}multiple-relationships-single-patient-include-performer.yaml" +) +GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PATIENT = ( + f"{GET_CONSENT__DIRECTORY}multiple-relationships-single-patient-include-patient.yaml" +) +GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_BOTH = ( + f"{GET_CONSENT__DIRECTORY}multiple-relationships-single-patient-include-performer-patient.yaml" +) # POST Consent POST_CONSENT__DIRECTORY = "./api/examples/POST_Consent/" POST_CONSENT__SUCCESS = f"{POST_CONSENT__DIRECTORY}success.yaml" diff --git a/sandbox/api/get_consent.py b/sandbox/api/get_consent.py index 3b04941a..df34839d 100644 --- a/sandbox/api/get_consent.py +++ b/sandbox/api/get_consent.py @@ -8,6 +8,9 @@ GET_CONSENT__FILTERED_RELATIONSHIPS_STATUS_INACTIVE, GET_CONSENT__FILTERED_RELATIONSHIPS_STATUS_PROPOSED_ACTIVE, GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT, + GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PATIENT, + GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PERFORMER, + GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_BOTH, GET_CONSENT__MULTIPLE_RELATIONSHIPS, GET_CONSENT__MULTIPLE_RELATIONSHIPS_INCLUDE_BOTH, GET_CONSENT__MULTIPLE_RELATIONSHIPS_INCLUDE_PATIENT, @@ -63,7 +66,13 @@ def get_consent_response() -> Union[dict, tuple]: GET_CONSENT__SINGLE_MOTHER_CHILD_RELATIONSHIP_INCLUDE_BOTH, ) elif patient_identifier == "9000000100": - return generate_response_from_example(GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT, 200) + return check_for_consent_include_params( + _include, + GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT, + GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_BOTH, + GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PATIENT, + GET_CONSENT__MULTIPLE_RELATIONSHIPS_SINGLE_PATIENT_INCLUDE_PERFORMER, + ) # Filtering elif performer_identifier == "9000000017": return check_for_consent_filtering( diff --git a/sandbox/api/tests/test_get_consent.py b/sandbox/api/tests/test_get_consent.py index c5fa6ff5..c027b4d9 100644 --- a/sandbox/api/tests/test_get_consent.py +++ b/sandbox/api/tests/test_get_consent.py @@ -21,11 +21,6 @@ "./api/examples/errors/invalidated-resource.yaml", 404, ), - ( - "patient:identifier=9000000100", # Multiple relationships single patient - "./api/examples/GET_Consent/multiple-relationships-single-patient.yaml", - 200, - ), ], ) @patch("sandbox.api.get_consent.generate_response_from_example") @@ -153,6 +148,26 @@ def test_get_consent_returns_expected_responses__mocked_get_consent( "./api/examples/GET_Consent/single-mother-child-relationship-include-performer-patient.yaml", 200, ), + ( + "patient:identifier=9000000100", # Multiple relationships single patient + "./api/examples/GET_Consent/multiple-relationships-single-patient.yaml", + 200, + ), + ( + "patient:identifier=9000000100&_include=Consent:performer", + "./api/examples/GET_Consent/multiple-relationships-single-patient-include-performer.yaml", + 200, + ), + ( + "patient:identifier=9000000100&_include=Consent:patient", + "./api/examples/GET_Consent/multiple-relationships-single-patient-include-patient.yaml", + 200, + ), + ( + "patient:identifier=9000000100&_include=Consent:performer&_include=Consent:patient", + "./api/examples/GET_Consent/multiple-relationships-single-patient-include-performer-patient.yaml", + 200, + ), ( "performer:identifier=9000000017&status=test", # Invalid status parameter error "./api/examples/GET_Consent/errors/invalid-status-parameter.yaml", diff --git a/sandbox/api/utils.py b/sandbox/api/utils.py index 2c08195b..601b0d6c 100644 --- a/sandbox/api/utils.py +++ b/sandbox/api/utils.py @@ -248,7 +248,7 @@ def check_for_consent_include_params( logger.error("No consent performer example provided") return generate_response_from_example(INTERNAL_SERVER_ERROR_EXAMPLE, 500) elif _include == [CONSENT_PATIENT]: - if include_performer_response_yaml: + if include_patient_response_yaml: return generate_response_from_example(include_patient_response_yaml, 200) else: logger.error("No consent:patient example provided") diff --git a/specification/examples/responses/GET_Consent/multiple-relationships-single-patient-include-patient.yaml b/specification/examples/responses/GET_Consent/multiple-relationships-single-patient-include-patient.yaml new file mode 100644 index 00000000..c38620f8 --- /dev/null +++ b/specification/examples/responses/GET_Consent/multiple-relationships-single-patient-include-patient.yaml @@ -0,0 +1,135 @@ +ConsentMultipleRelationshipsSinglePatientIncludePatientBundle: + summary: Multiple relationships (multiple proxy relationships with single patient) + description: A Bundle containing multiple proxy relationships with single patient, including patient details. + value: + resourceType: Bundle + timestamp: '2020-08-26T14:00:00+00:00' + total: 4 + type: searchset + entry: + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2 + resource: + resourceType: Patient + id: A3CC67E2 + identifier: + - system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + - system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier' + value: ABC1234567 + name: + - id: '123456' + use: usual + period: + start: '2020-01-01' + end: '2021-12-31' + given: + - Samantha + family: Adams + prefix: + - Miss + birthDate: '1963-11-02' + generalPractitioner: + - type: Organization + identifier: + value: ODS12345 + system: 'https://fhir.nhs.uk/Id/ods-organization-code' + search: + mode: include + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9 + resource: + resourceType: Consent + id: BBCC67E9 + status: active + scope: + coding: + - system: 'http://terminology.hl7.org/CodeSystem/consentscope' + code: patient-privacy + display: Privacy Consent + text: Patient Privacy Consent + category: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode' + code: INFA + display: Information Access + text: Information Access Consent + patient: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + dateTime: '2024-07-21T17:32:28Z' + performer: + - identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000020' + search: + mode: match + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1 + resource: + resourceType: Consent + id: WWCC67T1 + status: active + scope: + coding: + - system: 'http://terminology.hl7.org/CodeSystem/consentscope' + code: patient-privacy + display: Privacy Consent + text: Patient Privacy Consent + category: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode' + code: INFA + display: Information Access + text: Information Access Consent + patient: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + dateTime: '2024-07-21T17:32:28Z' + performer: + - identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000021' + verification: + - verified: true + verifiedWith: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000021' + verificationDate: '2024-07-21T17:32:28Z' + search: + mode: match + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1 + resource: + resourceType: Consent + id: AATD11A1 + status: inactive + scope: + coding: + - system: 'http://terminology.hl7.org/CodeSystem/consentscope' + code: patient-privacy + display: Privacy Consent + text: Patient Privacy Consent + category: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode' + code: INFA + display: Information Access + text: Information Access Consent + patient: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + dateTime: '2024-07-21T17:32:28Z' + performer: + - identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000022' + verification: + - verified: true + verifiedWith: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000022' + verificationDate: '2024-07-21T17:32:28Z' + search: + mode: match diff --git a/specification/examples/responses/GET_Consent/multiple-relationships-single-patient-include-performer-patient.yaml b/specification/examples/responses/GET_Consent/multiple-relationships-single-patient-include-performer-patient.yaml new file mode 100644 index 00000000..d418b01a --- /dev/null +++ b/specification/examples/responses/GET_Consent/multiple-relationships-single-patient-include-performer-patient.yaml @@ -0,0 +1,201 @@ +ConsentMultipleRelationshipsSinglePatientIncludePerformerPatientBundle: + summary: Multiple relationships (multiple proxy relationships with single patient) + description: A Bundle containing multiple proxy relationships with single patient, including patient and proxy details. + value: + resourceType: Bundle + timestamp: '2020-08-26T14:00:00+00:00' + total: 7 + type: searchset + entry: + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Patient/A3CC67E2 + resource: + resourceType: Patient + id: A3CC67E2 + identifier: + - system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + - system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier' + value: ABC1234567 + name: + - id: '123456' + use: usual + period: + start: '2020-01-01' + end: '2021-12-31' + given: + - Samantha + family: Adams + prefix: + - Miss + birthDate: '1963-11-02' + generalPractitioner: + - type: Organization + identifier: + value: ODS12345 + system: 'https://fhir.nhs.uk/Id/ods-organization-code' + search: + mode: include + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 + resource: + resourceType: RelatedPerson + id: BE974742 + identifier: + - system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000020' + - system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier' + value: ABC0000003 + patient: + type: Patient + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + relationship: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode' + code: PRN + display: parent + - system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode' + code: MTH + display: mother + search: + mode: include + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9 + resource: + resourceType: Consent + id: BBCC67E9 + status: active + scope: + coding: + - system: 'http://terminology.hl7.org/CodeSystem/consentscope' + code: patient-privacy + display: Privacy Consent + text: Patient Privacy Consent + category: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode' + code: INFA + display: Information Access + text: Information Access Consent + patient: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + dateTime: '2024-07-21T17:32:28Z' + performer: + - identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000020' + search: + mode: match + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 + resource: + resourceType: RelatedPerson + id: BE974742 + identifier: + - system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000021' + - system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier' + value: ABC0000003 + patient: + type: Patient + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + relationship: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode' + code: Personal + display: Personal relationship with the patient + search: + mode: include + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1 + resource: + resourceType: Consent + id: WWCC67T1 + status: active + scope: + coding: + - system: 'http://terminology.hl7.org/CodeSystem/consentscope' + code: patient-privacy + display: Privacy Consent + text: Patient Privacy Consent + category: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode' + code: INFA + display: Information Access + text: Information Access Consent + patient: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + dateTime: '2024-07-21T17:32:28Z' + performer: + - identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000021' + verification: + - verified: true + verifiedWith: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000021' + verificationDate: '2024-07-21T17:32:28Z' + search: + mode: match + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 + resource: + resourceType: RelatedPerson + id: BE974742 + identifier: + - system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000022' + - system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier' + value: ABC0000003 + patient: + type: Patient + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + relationship: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode' + code: Personal + display: Personal relationship with the patient + search: + mode: include + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1 + resource: + resourceType: Consent + id: AATD11A1 + status: inactive + scope: + coding: + - system: 'http://terminology.hl7.org/CodeSystem/consentscope' + code: patient-privacy + display: Privacy Consent + text: Patient Privacy Consent + category: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode' + code: INFA + display: Information Access + text: Information Access Consent + patient: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + dateTime: '2024-07-21T17:32:28Z' + performer: + - identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000022' + verification: + - verified: true + verifiedWith: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000022' + verificationDate: '2024-07-21T17:32:28Z' + search: + mode: match diff --git a/specification/examples/responses/GET_Consent/multiple-relationships-single-patient-include-performer.yaml b/specification/examples/responses/GET_Consent/multiple-relationships-single-patient-include-performer.yaml new file mode 100644 index 00000000..66629777 --- /dev/null +++ b/specification/examples/responses/GET_Consent/multiple-relationships-single-patient-include-performer.yaml @@ -0,0 +1,173 @@ +ConsentMultipleRelationshipsSinglePatientIncludePerformerPatientBundle: + summary: Multiple relationships (multiple proxy relationships with single patient) + description: A Bundle containing multiple proxy relationships with single patient, including proxy details. + value: + resourceType: Bundle + timestamp: '2020-08-26T14:00:00+00:00' + total: 6 + type: searchset + entry: + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 + resource: + resourceType: RelatedPerson + id: BE974742 + identifier: + - system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000020' + - system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier' + value: ABC0000003 + patient: + type: Patient + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + relationship: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode' + code: PRN + display: parent + - system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode' + code: MTH + display: mother + search: + mode: include + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/BBCC67E9 + resource: + resourceType: Consent + id: BBCC67E9 + status: active + scope: + coding: + - system: 'http://terminology.hl7.org/CodeSystem/consentscope' + code: patient-privacy + display: Privacy Consent + text: Patient Privacy Consent + category: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode' + code: INFA + display: Information Access + text: Information Access Consent + patient: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + dateTime: '2024-07-21T17:32:28Z' + performer: + - identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000020' + search: + mode: match + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 + resource: + resourceType: RelatedPerson + id: BE974742 + identifier: + - system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000021' + - system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier' + value: ABC0000003 + patient: + type: Patient + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + relationship: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode' + code: Personal + display: Personal relationship with the patient + search: + mode: include + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/WWCC67T1 + resource: + resourceType: Consent + id: WWCC67T1 + status: active + scope: + coding: + - system: 'http://terminology.hl7.org/CodeSystem/consentscope' + code: patient-privacy + display: Privacy Consent + text: Patient Privacy Consent + category: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode' + code: INFA + display: Information Access + text: Information Access Consent + patient: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + dateTime: '2024-07-21T17:32:28Z' + performer: + - identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000021' + verification: + - verified: true + verifiedWith: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000021' + verificationDate: '2024-07-21T17:32:28Z' + search: + mode: match + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/RelatedPerson/BE974742 + resource: + resourceType: RelatedPerson + id: BE974742 + identifier: + - system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000022' + - system: 'https://placeholder.fhir.nhs.uk/Id/local-gp-patient-identifier' + value: ABC0000003 + patient: + type: Patient + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + relationship: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-RoleCode' + code: Personal + display: Personal relationship with the patient + search: + mode: include + - fullUrl: https://api.service.nhs.uk/validated-relationships/FHIR/R4/Consent/AATD11A1 + resource: + resourceType: Consent + id: AATD11A1 + status: inactive + scope: + coding: + - system: 'http://terminology.hl7.org/CodeSystem/consentscope' + code: patient-privacy + display: Privacy Consent + text: Patient Privacy Consent + category: + - coding: + - system: 'http://terminology.hl7.org/CodeSystem/v3-ActCode' + code: INFA + display: Information Access + text: Information Access Consent + patient: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000100' + dateTime: '2024-07-21T17:32:28Z' + performer: + - identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000022' + verification: + - verified: true + verifiedWith: + identifier: + system: 'https://fhir.nhs.uk/Id/nhs-number' + value: '9000000022' + verificationDate: '2024-07-21T17:32:28Z' + search: + mode: match diff --git a/specification/validated-relationships-service-api.yaml b/specification/validated-relationships-service-api.yaml index 41194130..4ac3c86e 100644 --- a/specification/validated-relationships-service-api.yaml +++ b/specification/validated-relationships-service-api.yaml @@ -447,28 +447,31 @@ paths: ## Sandbox test scenarios - | Scenario | Request | Response | - | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- | - | Multiple proxy relationships filtered by 'active' status including details | `performer:identifier`=`9000000017` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` and `status`=`active` | HTTP Status 200 Bundle containing a multiple active proxy relationships including performer and patient details | - | Multiple proxy relationships filtered by 'inactive' status | `performer:identifier`=`9000000017` and `status`=`inactive` | HTTP Status 200 Bundle containing a multiple inactive proxy relationships | - | Multiple proxy relationships filtered by 'proposed' and 'active' status | `performer:identifier`=`9000000017` and `status`=`proposed,active` | HTTP Status 200 Bundle containing a multiple proposed and active proxy relationships | - | Multiple proxy relationships without filtering and details | `performer:identifier`=`9000000022` | HTTP Status 200 Bundle containing a multiple proxy relationships without details | - | Multiple proxy relationships including performer details | `performer:identifier`=`9000000022` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer details | - | Multiple proxy relationships including patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` | HTTP Status 200 Bundle containing a multiple proxy relationships including patient details | - | Multiple proxy relationships including performer and patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details | - | Multiple proxy relationships, single patient | `patient:identifier`=`9000000100` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details | - | No proxy relationships | `performer:identifier`=`9000000025` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` and `status` = `active` | HTTP Status 200 empty bundle | - | A single proxy relationship between consenting adults | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` | HTTP Status 200 Bundle containing a single proxy relationship | - | A single proxy relationship between consenting adults including details | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | - | A single proxy relationship between a mother and child | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` | HTTP Status 200 Bundle containing a single proxy relationship | - | A single proxy relationship between a mother and child including details | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | - | Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 422 and INVALID_VALUE error response | - | Invalid include parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `test` | HTTP Status 422 and INVALID_VALUE error response | - | Missing identifier | `patient:identifier`=`9000000009` | HTTP Status 400 and MISSING_IDENTIFIER_VALUE error response | - | Invalid identifier | `identifier`=`900000000` Note: This identifier is 9 characters long, too short to be NHS Number | HTTP Status 422 and INVALID_IDENTIFIER_VALUE error response | - | Invalid identifier system | `identifier`=`https://fhir.nhs.uk/Id/nhs-number/9730675929` | HTTP Status 422 and INVALID_IDENTIFIER_SYSTEM error response | - | No performer record found | `identifier`=`9000000999` | HTTP Status 404 and INVALIDATED_RESOURCE error response | - | GP Practice not found | `identifier`=`9000000012` | HTTP Status 404 and GP_PRACTICE_NOT_FOUND error response | + | Scenario | Request | Response | + | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------- | + | Multiple proxy relationships filtered by 'active' status including details | `performer:identifier`=`9000000017` and `_include` = `Consent:patient` and `_include` = `Consent:performer` and `status`=`active` | HTTP Status 200 Bundle containing a multiple active proxy relationships including performer and patient details | + | Multiple proxy relationships filtered by 'inactive' status | `performer:identifier`=`9000000017` and `status`=`inactive` | HTTP Status 200 Bundle containing a multiple inactive proxy relationships | + | Multiple proxy relationships filtered by 'proposed' and 'active' status | `performer:identifier`=`9000000017` and `status`=`proposed,active` | HTTP Status 200 Bundle containing a multiple proposed and active proxy relationships | + | Multiple proxy relationships without filtering and details | `performer:identifier`=`9000000022` | HTTP Status 200 Bundle containing a multiple proxy relationships without details | + | Multiple proxy relationships including performer details | `performer:identifier`=`9000000022` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer details | + | Multiple proxy relationships including patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` | HTTP Status 200 Bundle containing a multiple proxy relationships including patient details | + | Multiple proxy relationships including performer and patient details | `performer:identifier`=`9000000022` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details | + | Multiple proxy relationships, single patient | `patient:identifier`=`9000000100` | HTTP Status 200 Bundle containing a multiple proxy relationships including performer and patient details | + | Multiple proxy relationships, single patient, including proxy details | `patient:identifier`=`9000000100` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy details | + | Multiple proxy relationships, single patient, including patient details | `patient:identifier`=`9000000100` and `_include` = `Consent:patient` | HTTP Status 200 Bundle containing a multiple proxy relationships including patient details | + | Multiple proxy relationships, single patient, including proxy and patient details | `patient:identifier`=`9000000100` and `_include` = `Consent:patient` and `_include` = `Consent:performer` | HTTP Status 200 Bundle containing a multiple proxy relationships including proxy and patient details | + | No proxy relationships | `performer:identifier`=`9000000025` and `_include` = `Consent:patient` and `_include` = `Consent:performer` and `status` = `active` | HTTP Status 200 empty bundle | + | A single proxy relationship between consenting adults | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` | HTTP Status 200 Bundle containing a single proxy relationship | + | A single proxy relationship between consenting adults including details | `performer:identifier`=`9000000010` and/or `patient:identifier`=`9000000005` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | + | A single proxy relationship between a mother and child | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` | HTTP Status 200 Bundle containing a single proxy relationship | + | A single proxy relationship between a mother and child including details | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `Consent:patient` and `_include` = `Consent:proxy` | HTTP Status 200 Bundle containing a single proxy relationship including performer and patient details | + | Invalid status parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `status` = `test` | HTTP Status 422 and INVALID_VALUE error response | + | Invalid include parameter | `performer:identifier`=`9000000019` and/or `patient:identifier`=`9000000009` and `_include` = `test` | HTTP Status 422 and INVALID_VALUE error response | + | Missing identifier | `patient:identifier`=`9000000009` | HTTP Status 400 and MISSING_IDENTIFIER_VALUE error response | + | Invalid identifier | `identifier`=`900000000` Note: This identifier is 9 characters long, too short to be NHS Number | HTTP Status 422 and INVALID_IDENTIFIER_VALUE error response | + | Invalid identifier system | `identifier`=`https://fhir.nhs.uk/Id/nhs-number/9730675929` | HTTP Status 422 and INVALID_IDENTIFIER_SYSTEM error response | + | No performer record found | `identifier`=`9000000999` | HTTP Status 404 and INVALIDATED_RESOURCE error response | + | GP Practice not found | `identifier`=`9000000012` | HTTP Status 404 and GP_PRACTICE_NOT_FOUND error response | ### Sandbox constraints - Headers are not tested. `X-IM1-Connection-Params`, `X-Request-ID` and `X-Correlation-ID` are disregarded.