diff --git a/bruno/APIM/Test_Expired_Bearer_Token_IntEnvi.bru b/bruno/APIM/Test_Expired_Bearer_Token_IntEnvi.bru new file mode 100644 index 0000000..b7c02a9 --- /dev/null +++ b/bruno/APIM/Test_Expired_Bearer_Token_IntEnvi.bru @@ -0,0 +1,474 @@ +meta { + name: Test_Expired_Bearer_Token_IntEnvi + type: http + seq: 63 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: none +} + +headers { + Content-Type: application/fhir+json + Authorization: Bearer {{EXPIRED_BEARER_TOKEN}} +} + +body:json { + { + "resourceType": "Bundle", + "identifier": { + "system": "https://tools.ietf.org/html/rfc4122", + "value": "1f859037-2942-4117-884a-f51b62db5a52" + }, + "type": "document", + "timestamp": "2022-03-08T12:09:00+00:00", + "entry": [ + { + "fullUrl": "urn:uuid:ce2073cd-7f19-4fd8-9956-f30ef7b4bd44", + "resource": { + "resourceType": "Composition", + "id": "ce2073cd-7f19-4fd8-9956-f30ef7b4bd44", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "urn:uuid:1c38d507-9ad7-4b49-ba91-7da204842cac" + } + }, + { + "url": "http://hl7.eu/fhir/laboratory/StructureDefinition/composition-diagnosticReportReference", + "valueReference": { + "reference": "urn:uuid:35d46ca1-f253-4c97-b7ee-fb5fccdf6c20" + } + } + ], + "identifier": { + "system": "https://tools.ietf.org/html/rfc4122", + "value": "c3d5e6f7-8901-2345-6789-0abcdef12345" + }, + "status": "final", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "394915009", + "display": "General pathology (specialty)" + } + ] + } + ], + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "date": "2022-03-08T12:09:00+00:00", + "author": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "title": "Laboratory Report", + "section": [ + { + "title": "CRP (C reactive protein) mass concentration in serum", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "1106741000000105", + "display": "CRP (C reactive protein) mass concentration in serum" + } + ] + }, + "entry": [ + { + "reference": "urn:uuid:8697e1ea-a15d-4cab-95d9-7335f4b57e22" + } + ] + } + ] + } + }, + { + "fullUrl": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "resource": { + "resourceType": "Organization", + "id": "8a6d85b8-9837-4fed-a257-4cf207988338", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y8J7D" + } + ], + "name": "TD008362 PATH LAB 001", + "address": [ + { + "line": [ + "PATHOLOGY LAB", + "7-8 WELLINGTON PLACE" + ], + "city": "LEEDS", + "district": "WEST YORKSHIRE", + "postalCode": "LS1 4AP" + } + ] + } + }, + { + "fullUrl": "urn:uuid:3c43b5b3-06d6-445f-ae9a-48d5f05df434", + "resource": { + "resourceType": "Organization", + "id": "3c43b5b3-06d6-445f-ae9a-48d5f05df434", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "B82033" + } + ], + "name": "PICKERING MEDICAL PRACTICE", + "address": [ + { + "line": [ + "SOUTHGATE" + ], + "city": "PICKERING", + "district": "NORTH YORKSHIRE", + "postalCode": "YO18 8BL" + } + ] + } + }, + { + "fullUrl": "urn:uuid:9a835acf-d715-4d84-8dcf-a8435f6417fe", + "resource": { + "resourceType": "Practitioner", + "id": "9a835acf-d715-4d84-8dcf-a8435f6417fe", + "identifier": [ + { + "system": "https://fhir.hl7.org.uk/Id/gmc-number", + "value": "C1008215" + } + ], + "name": [ + { + "use": "official", + "family": "GASKELL", + "given": [ + "Gale" + ], + "prefix": [ + "Dr" + ] + } + ] + } + }, + { + "fullUrl": "urn:uuid:d4f5e6a1-2b3c-4d5e-9f6a-7b8c9d0e1f2a", + "resource": { + "resourceType": "PractitionerRole", + "id": "d4f5e6a1-2b3c-4d5e-9f6a-7b8c9d0e1f2a", + "practitioner": { + "reference": "urn:uuid:9a835acf-d715-4d84-8dcf-a8435f6417fe" + }, + "organization": { + "reference": "urn:uuid:3c43b5b3-06d6-445f-ae9a-48d5f05df434", + "display": "PICKERING MEDICAL PRACTICE" + } + } + }, + { + "fullUrl": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "resource": { + "resourceType": "Patient", + "id": "ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638", + "use": "official" + } + ] + } + }, + { + "fullUrl": "urn:uuid:1c38d507-9ad7-4b49-ba91-7da204842cac", + "resource": { + "resourceType": "ServiceRequest", + "id": "1c38d507-9ad7-4b49-ba91-7da204842cac", + "identifier": [ + { + "system": "http://B82033-pickeringmedicalpractice.com/labrequest", + "value": "REQ-20220307-000142" + } + ], + "status": "active", + "intent": "order", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "135842001", + "display": "Serum C reactive protein level" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "authoredOn": "2022-01-29T10:24:00+00:00", + "requester": { + "reference": "urn:uuid:d4f5e6a1-2b3c-4d5e-9f6a-7b8c9d0e1f2a" + }, + "performer": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "specimen": [ + { + "reference": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d" + } + ] + } + }, + { + "fullUrl": "urn:uuid:35d46ca1-f253-4c97-b7ee-fb5fccdf6c20", + "resource": { + "resourceType": "DiagnosticReport", + "id": "35d46ca1-f253-4c97-b7ee-fb5fccdf6c20", + "identifier": [ + { + "system": "http://Y8J7D-pathlab001.com/report", + "value": "REP-20220308-004205" + } + ], + "basedOn": [ + { + "reference": "urn:uuid:1c38d507-9ad7-4b49-ba91-7da204842cac" + } + ], + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0074", + "code": "LAB", + "display": "Laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "issued": "2022-03-08T12:09:00+00:00", + "performer": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "specimen": [ + { + "reference": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d" + } + ], + "result": [ + { + "reference": "urn:uuid:8697e1ea-a15d-4cab-95d9-7335f4b57e22" + } + ] + } + }, + { + "fullUrl": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d", + "resource": { + "resourceType": "Specimen", + "id": "bab0eaec-1ec5-4598-b660-90bb38a1030d", + "identifier": [ + { + "system": "http://B82033-pickeringmedicalpractice.com/specimen", + "value": "SPC-REQ-20220307-000105" + } + ], + "accessionIdentifier": { + "system": "http://Y8J7D-pathlab001.com/specimen", + "value": "SPC-Lab-20220307-007856" + }, + "status": "available", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "122555007", + "display": "Venous blood specimen" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "receivedTime": "2022-03-07T14:58:00+00:00", + "collection": { + "collectedDateTime": "2022-03-07T11:42:00+00:00" + } + } + }, + { + "fullUrl": "urn:uuid:8697e1ea-a15d-4cab-95d9-7335f4b57e22", + "resource": { + "resourceType": "Observation", + "id": "8697e1ea-a15d-4cab-95d9-7335f4b57e22", + "identifier": [ + { + "system": "https://tools.ietf.org/html/rfc4122", + "value": "09fd65ba-4bbb-49dd-9d16-ca74f885db6c" + } + ], + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "Laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/valueset-reference", + "valueUri": "https://fhir.hl7.org.uk/ValueSet/UKCore-PathologyBoundedCodeListObservables" + } + ], + "system": "http://snomed.info/sct", + "code": "1001371000000100", + "display": "Serum CRP (C reactive protein) level" + }, + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/valueset-reference", + "valueUri": "https://fhir.hl7.org.uk/ValueSet/UKCore-PathologyAndLaboratoryMedicineObservables" + } + ], + "system": "http://snomed.info/sct", + "code": "1106741000000105", + "display": "CRP (C reactive protein) mass concentration in serum" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "issued": "2022-03-08T12:09:00+00:00", + "performer": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "valueQuantity": { + "value": 200, + "unit": "mg/L", + "system": "http://unitsofmeasure.org", + "code": "mg/L" + }, + "interpretation": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", + "code": "H", + "display": "High" + } + ] + } + ], + "specimen": { + "reference": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d" + }, + "referenceRange": [ + { + "low": { + "value": 0, + "unit": "mg/L", + "system": "http://unitsofmeasure.org", + "code": "mg/L" + }, + "high": { + "value": 5, + "unit": "mg/L", + "system": "http://unitsofmeasure.org", + "code": "mg/L" + } + } + ] + } + } + ] + } +} + +assert { + res.status: eq 401 +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authenticate_IntEnvi.bru b/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authenticate_IntEnvi.bru new file mode 100644 index 0000000..5d5e61f --- /dev/null +++ b/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authenticate_IntEnvi.bru @@ -0,0 +1,83 @@ +meta { + name: Test_MNS_Pathology_Api_Unable_To_Authenticate_IntEnvi + type: http + seq: 56 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "MNS_AUTHENTICATION_ERROR" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 500 +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authorize_Event.bru b/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authorize_Event.bru index 35730ee..7db45ff 100644 --- a/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authorize_Event.bru +++ b/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authorize_Event.bru @@ -1,7 +1,7 @@ meta { name: Test_MNS_Pathology_Api_Unable_To_Authorize_Event type: http - seq: 5 + seq: 6 } post { diff --git a/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authorize_Event_IntEnvi.bru b/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authorize_Event_IntEnvi.bru new file mode 100644 index 0000000..afaa8fe --- /dev/null +++ b/bruno/APIM/Test_MNS_Pathology_Api_Unable_To_Authorize_Event_IntEnvi.bru @@ -0,0 +1,83 @@ +meta { + name: Test_MNS_Pathology_Api_Unable_To_Authorize_Event_IntEnvi + type: http + seq: 57 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "MNS_AUTHORIZATION_ERROR" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 500 +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_MNS_Service_Experience_Bad_Gateway_Error.bru b/bruno/APIM/Test_MNS_Service_Experience_Bad_Gateway_Error.bru index 99ed549..046a350 100644 --- a/bruno/APIM/Test_MNS_Service_Experience_Bad_Gateway_Error.bru +++ b/bruno/APIM/Test_MNS_Service_Experience_Bad_Gateway_Error.bru @@ -1,7 +1,7 @@ meta { name: Test_MNS_Service_Experience_Bad_Gateway_Error type: http - seq: 7 + seq: 9 } post { diff --git a/bruno/APIM/Test_MNS_Service_Experience_Bad_Gateway_Error_IntEnvi.bru b/bruno/APIM/Test_MNS_Service_Experience_Bad_Gateway_Error_IntEnvi.bru new file mode 100644 index 0000000..0c426c1 --- /dev/null +++ b/bruno/APIM/Test_MNS_Service_Experience_Bad_Gateway_Error_IntEnvi.bru @@ -0,0 +1,83 @@ +meta { + name: Test_MNS_Service_Experience_Bad_Gateway_Error_IntEnvi + type: http + seq: 59 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "MNS_BAD_GATEWAY_ERROR" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 500 +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_MNS_Service_Experience_Gateway_Timeout_Error.bru b/bruno/APIM/Test_MNS_Service_Experience_Gateway_Timeout_Error.bru index b278d6c..ae216c0 100644 --- a/bruno/APIM/Test_MNS_Service_Experience_Gateway_Timeout_Error.bru +++ b/bruno/APIM/Test_MNS_Service_Experience_Gateway_Timeout_Error.bru @@ -1,7 +1,7 @@ meta { name: Test_MNS_Service_Experience_Gateway_Timeout_Error type: http - seq: 8 + seq: 11 } post { diff --git a/bruno/APIM/Test_MNS_Service_Experience_Gateway_Timeout_Error_IntEnvi.bru b/bruno/APIM/Test_MNS_Service_Experience_Gateway_Timeout_Error_IntEnvi.bru new file mode 100644 index 0000000..cb8a3da --- /dev/null +++ b/bruno/APIM/Test_MNS_Service_Experience_Gateway_Timeout_Error_IntEnvi.bru @@ -0,0 +1,83 @@ +meta { + name: Test_MNS_Service_Experience_Gateway_Timeout_Error_IntEnvi + type: http + seq: 60 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "MNS_GATEWAY_TIMEOUT_ERROR" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 500 +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_MNS_Service_Experience_Validation_Error.bru b/bruno/APIM/Test_MNS_Service_Experience_Validation_Error.bru index 9df7519..ab829a5 100644 --- a/bruno/APIM/Test_MNS_Service_Experience_Validation_Error.bru +++ b/bruno/APIM/Test_MNS_Service_Experience_Validation_Error.bru @@ -1,7 +1,7 @@ meta { name: Test_MNS_Service_Experience_Validation_Error type: http - seq: 9 + seq: 14 } post { diff --git a/bruno/APIM/Test_MNS_Service_Experience_Validation_Error_IntEnvi.bru b/bruno/APIM/Test_MNS_Service_Experience_Validation_Error_IntEnvi.bru new file mode 100644 index 0000000..9dc8d77 --- /dev/null +++ b/bruno/APIM/Test_MNS_Service_Experience_Validation_Error_IntEnvi.bru @@ -0,0 +1,83 @@ +meta { + name: Test_MNS_Service_Experience_Validation_Error_IntEnvi + type: http + seq: 61 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "MNS_VALIDATION_ERROR" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 500 +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_MNS_Service_Returns_Client_Side_Error.bru b/bruno/APIM/Test_MNS_Service_Returns_Client_Side_Error.bru index 4f8e9a7..598279a 100644 --- a/bruno/APIM/Test_MNS_Service_Returns_Client_Side_Error.bru +++ b/bruno/APIM/Test_MNS_Service_Returns_Client_Side_Error.bru @@ -1,7 +1,7 @@ meta { name: Test_MNS_Service_Returns_Client_Side_Error type: http - seq: 6 + seq: 8 } post { diff --git a/bruno/APIM/Test_MNS_Service_Returns_Client_Side_Error_IntEnvi.bru b/bruno/APIM/Test_MNS_Service_Returns_Client_Side_Error_IntEnvi.bru new file mode 100644 index 0000000..3a98a5b --- /dev/null +++ b/bruno/APIM/Test_MNS_Service_Returns_Client_Side_Error_IntEnvi.bru @@ -0,0 +1,83 @@ +meta { + name: Test_MNS_Service_Returns_Client_Side_Error_IntEnvi + type: http + seq: 58 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "MNS_SERVER_ERROR" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 500 +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Missing_Bearer_Token_IntEnvi.bru b/bruno/APIM/Test_Missing_Bearer_Token_IntEnvi.bru new file mode 100644 index 0000000..1ec7fe6 --- /dev/null +++ b/bruno/APIM/Test_Missing_Bearer_Token_IntEnvi.bru @@ -0,0 +1,83 @@ +meta { + name: Test_Missing_Bearer_Token_IntEnvi + type: http + seq: 62 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: none +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 401 +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_PDM_Api_Server_Error.bru b/bruno/APIM/Test_PDM_Api_Server_Error.bru index 731a50f..71771a0 100644 --- a/bruno/APIM/Test_PDM_Api_Server_Error.bru +++ b/bruno/APIM/Test_PDM_Api_Server_Error.bru @@ -1,7 +1,7 @@ meta { name: Test_PDM_Api_Server_Error type: http - seq: 12 + seq: 18 } post { diff --git a/bruno/APIM/Test_PDM_Api_Server_Error_IntEnvi.bru b/bruno/APIM/Test_PDM_Api_Server_Error_IntEnvi.bru new file mode 100644 index 0000000..2a0e74a --- /dev/null +++ b/bruno/APIM/Test_PDM_Api_Server_Error_IntEnvi.bru @@ -0,0 +1,96 @@ +meta { + name: Test_PDM_Api_Server_Error_IntEnvi + type: http + seq: 41 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "patient", + "resource": { + "resourceType": "Patient", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "PDM_SERVER_ERROR" + } + ] + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 500 + res.body.issue[0].diagnostics: contains Failed to send document: +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_PDM_Api_Validation_Error.bru b/bruno/APIM/Test_PDM_Api_Validation_Error.bru index f690146..db41f04 100644 --- a/bruno/APIM/Test_PDM_Api_Validation_Error.bru +++ b/bruno/APIM/Test_PDM_Api_Validation_Error.bru @@ -1,7 +1,7 @@ meta { name: Test_PDM_Api_Validation_Error type: http - seq: 10 + seq: 15 } post { diff --git a/bruno/APIM/Test_PDM_Api_Validation_Error_IntEnvi.bru b/bruno/APIM/Test_PDM_Api_Validation_Error_IntEnvi.bru new file mode 100644 index 0000000..b37dace --- /dev/null +++ b/bruno/APIM/Test_PDM_Api_Validation_Error_IntEnvi.bru @@ -0,0 +1,96 @@ +meta { + name: Test_PDM_Api_Validation_Error_IntEnvi + type: http + seq: 68 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "patient", + "resource": { + "resourceType": "Patient", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "PDM_VALIDATION_ERROR" + } + ] + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 500 + res.body.issue[0].diagnostics: contains Failed to send document: +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_PDM_Bundle_Succesful_Response.bru b/bruno/APIM/Test_PDM_Bundle_Succesful_Response.bru index 502810a..e448583 100644 --- a/bruno/APIM/Test_PDM_Bundle_Succesful_Response.bru +++ b/bruno/APIM/Test_PDM_Bundle_Succesful_Response.bru @@ -1,7 +1,7 @@ meta { name: Test_PDM_Bundle_Succesful_Response type: http - seq: 12 + seq: 19 } post { diff --git a/bruno/APIM/Test_PDM_Bundle_Succesful_Response_IntEnvi.bru b/bruno/APIM/Test_PDM_Bundle_Succesful_Response_IntEnvi.bru new file mode 100644 index 0000000..349f1ad --- /dev/null +++ b/bruno/APIM/Test_PDM_Bundle_Succesful_Response_IntEnvi.bru @@ -0,0 +1,478 @@ +meta { + name: Test_PDM_Bundle_Succesful_Response_IntEnvi + type: http + seq: 46 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "identifier": { + "system": "https://tools.ietf.org/html/rfc4122", + "value": "1f859037-2942-4117-884a-f51b62db5a52" + }, + "type": "document", + "timestamp": "2022-03-08T12:09:00+00:00", + "entry": [ + { + "fullUrl": "urn:uuid:ce2073cd-7f19-4fd8-9956-f30ef7b4bd44", + "resource": { + "resourceType": "Composition", + "id": "ce2073cd-7f19-4fd8-9956-f30ef7b4bd44", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "urn:uuid:1c38d507-9ad7-4b49-ba91-7da204842cac" + } + }, + { + "url": "http://hl7.eu/fhir/laboratory/StructureDefinition/composition-diagnosticReportReference", + "valueReference": { + "reference": "urn:uuid:35d46ca1-f253-4c97-b7ee-fb5fccdf6c20" + } + } + ], + "identifier": { + "system": "https://tools.ietf.org/html/rfc4122", + "value": "c3d5e6f7-8901-2345-6789-0abcdef12345" + }, + "status": "final", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "394915009", + "display": "General pathology (specialty)" + } + ] + } + ], + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "date": "2022-03-08T12:09:00+00:00", + "author": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "title": "Laboratory Report", + "section": [ + { + "title": "CRP (C reactive protein) mass concentration in serum", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "1106741000000105", + "display": "CRP (C reactive protein) mass concentration in serum" + } + ] + }, + "entry": [ + { + "reference": "urn:uuid:8697e1ea-a15d-4cab-95d9-7335f4b57e22" + } + ] + } + ] + } + }, + { + "fullUrl": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "resource": { + "resourceType": "Organization", + "id": "8a6d85b8-9837-4fed-a257-4cf207988338", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y8J7D" + } + ], + "name": "TD008362 PATH LAB 001", + "address": [ + { + "line": [ + "PATHOLOGY LAB", + "7-8 WELLINGTON PLACE" + ], + "city": "LEEDS", + "district": "WEST YORKSHIRE", + "postalCode": "LS1 4AP" + } + ] + } + }, + { + "fullUrl": "urn:uuid:3c43b5b3-06d6-445f-ae9a-48d5f05df434", + "resource": { + "resourceType": "Organization", + "id": "3c43b5b3-06d6-445f-ae9a-48d5f05df434", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "B82033" + } + ], + "name": "PICKERING MEDICAL PRACTICE", + "address": [ + { + "line": [ + "SOUTHGATE" + ], + "city": "PICKERING", + "district": "NORTH YORKSHIRE", + "postalCode": "YO18 8BL" + } + ] + } + }, + { + "fullUrl": "urn:uuid:9a835acf-d715-4d84-8dcf-a8435f6417fe", + "resource": { + "resourceType": "Practitioner", + "id": "9a835acf-d715-4d84-8dcf-a8435f6417fe", + "identifier": [ + { + "system": "https://fhir.hl7.org.uk/Id/gmc-number", + "value": "C1008215" + } + ], + "name": [ + { + "use": "official", + "family": "GASKELL", + "given": [ + "Gale" + ], + "prefix": [ + "Dr" + ] + } + ] + } + }, + { + "fullUrl": "urn:uuid:d4f5e6a1-2b3c-4d5e-9f6a-7b8c9d0e1f2a", + "resource": { + "resourceType": "PractitionerRole", + "id": "d4f5e6a1-2b3c-4d5e-9f6a-7b8c9d0e1f2a", + "practitioner": { + "reference": "urn:uuid:9a835acf-d715-4d84-8dcf-a8435f6417fe" + }, + "organization": { + "reference": "urn:uuid:3c43b5b3-06d6-445f-ae9a-48d5f05df434", + "display": "PICKERING MEDICAL PRACTICE" + } + } + }, + { + "fullUrl": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "resource": { + "resourceType": "Patient", + "id": "ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638", + "use": "official" + } + ] + } + }, + { + "fullUrl": "urn:uuid:1c38d507-9ad7-4b49-ba91-7da204842cac", + "resource": { + "resourceType": "ServiceRequest", + "id": "1c38d507-9ad7-4b49-ba91-7da204842cac", + "identifier": [ + { + "system": "http://B82033-pickeringmedicalpractice.com/labrequest", + "value": "REQ-20220307-000142" + } + ], + "status": "active", + "intent": "order", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "135842001", + "display": "Serum C reactive protein level" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "authoredOn": "2022-01-29T10:24:00+00:00", + "requester": { + "reference": "urn:uuid:d4f5e6a1-2b3c-4d5e-9f6a-7b8c9d0e1f2a" + }, + "performer": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "specimen": [ + { + "reference": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d" + } + ] + } + }, + { + "fullUrl": "urn:uuid:35d46ca1-f253-4c97-b7ee-fb5fccdf6c20", + "resource": { + "resourceType": "DiagnosticReport", + "id": "35d46ca1-f253-4c97-b7ee-fb5fccdf6c20", + "identifier": [ + { + "system": "http://Y8J7D-pathlab001.com/report", + "value": "REP-20220308-004205" + } + ], + "basedOn": [ + { + "reference": "urn:uuid:1c38d507-9ad7-4b49-ba91-7da204842cac" + } + ], + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0074", + "code": "LAB", + "display": "Laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "issued": "2022-03-08T12:09:00+00:00", + "performer": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "specimen": [ + { + "reference": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d" + } + ], + "result": [ + { + "reference": "urn:uuid:8697e1ea-a15d-4cab-95d9-7335f4b57e22" + } + ] + } + }, + { + "fullUrl": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d", + "resource": { + "resourceType": "Specimen", + "id": "bab0eaec-1ec5-4598-b660-90bb38a1030d", + "identifier": [ + { + "system": "http://B82033-pickeringmedicalpractice.com/specimen", + "value": "SPC-REQ-20220307-000105" + } + ], + "accessionIdentifier": { + "system": "http://Y8J7D-pathlab001.com/specimen", + "value": "SPC-Lab-20220307-007856" + }, + "status": "available", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "122555007", + "display": "Venous blood specimen" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "receivedTime": "2022-03-07T14:58:00+00:00", + "collection": { + "collectedDateTime": "2022-03-07T11:42:00+00:00" + } + } + }, + { + "fullUrl": "urn:uuid:8697e1ea-a15d-4cab-95d9-7335f4b57e22", + "resource": { + "resourceType": "Observation", + "id": "8697e1ea-a15d-4cab-95d9-7335f4b57e22", + "identifier": [ + { + "system": "https://tools.ietf.org/html/rfc4122", + "value": "09fd65ba-4bbb-49dd-9d16-ca74f885db6c" + } + ], + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "Laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/valueset-reference", + "valueUri": "https://fhir.hl7.org.uk/ValueSet/UKCore-PathologyBoundedCodeListObservables" + } + ], + "system": "http://snomed.info/sct", + "code": "1001371000000100", + "display": "Serum CRP (C reactive protein) level" + }, + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/valueset-reference", + "valueUri": "https://fhir.hl7.org.uk/ValueSet/UKCore-PathologyAndLaboratoryMedicineObservables" + } + ], + "system": "http://snomed.info/sct", + "code": "1106741000000105", + "display": "CRP (C reactive protein) mass concentration in serum" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "issued": "2022-03-08T12:09:00+00:00", + "performer": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "valueQuantity": { + "value": 200, + "unit": "mg/L", + "system": "http://unitsofmeasure.org", + "code": "mg/L" + }, + "interpretation": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", + "code": "H", + "display": "High" + } + ] + } + ], + "specimen": { + "reference": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d" + }, + "referenceRange": [ + { + "low": { + "value": 0, + "unit": "mg/L", + "system": "http://unitsofmeasure.org", + "code": "mg/L" + }, + "high": { + "value": 5, + "unit": "mg/L", + "system": "http://unitsofmeasure.org", + "code": "mg/L" + } + } + ] + } + } + ] + } +} + +assert { + res.status: eq 200 + res.body.resourceType: eq "Bundle" + res.body.type: eq document + res.body.id: isNotEmpty + res.body.entry: isArray + res.body.entry[0].resource.subject.identifier.value: isNotEmpty +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_PDM_Bundle_Succesful_Response_IntEnvi_With_CorrelationID_IntEnvi.bru b/bruno/APIM/Test_PDM_Bundle_Succesful_Response_IntEnvi_With_CorrelationID_IntEnvi.bru new file mode 100644 index 0000000..0403701 --- /dev/null +++ b/bruno/APIM/Test_PDM_Bundle_Succesful_Response_IntEnvi_With_CorrelationID_IntEnvi.bru @@ -0,0 +1,479 @@ +meta { + name: Test_PDM_Bundle_Succesful_Response_IntEnvi_With_CorrelationID_IntEnvi + type: http + seq: 68 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json + X-Correlation-ID: 93b04f20-a3b0-476f-a168-92d44669fda9 +} + +body:json { + { + "resourceType": "Bundle", + "identifier": { + "system": "https://tools.ietf.org/html/rfc4122", + "value": "1f859037-2942-4117-884a-f51b62db5a52" + }, + "type": "document", + "timestamp": "2022-03-08T12:09:00+00:00", + "entry": [ + { + "fullUrl": "urn:uuid:ce2073cd-7f19-4fd8-9956-f30ef7b4bd44", + "resource": { + "resourceType": "Composition", + "id": "ce2073cd-7f19-4fd8-9956-f30ef7b4bd44", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "urn:uuid:1c38d507-9ad7-4b49-ba91-7da204842cac" + } + }, + { + "url": "http://hl7.eu/fhir/laboratory/StructureDefinition/composition-diagnosticReportReference", + "valueReference": { + "reference": "urn:uuid:35d46ca1-f253-4c97-b7ee-fb5fccdf6c20" + } + } + ], + "identifier": { + "system": "https://tools.ietf.org/html/rfc4122", + "value": "c3d5e6f7-8901-2345-6789-0abcdef12345" + }, + "status": "final", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" + } + ] + }, + "category": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "394915009", + "display": "General pathology (specialty)" + } + ] + } + ], + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "date": "2022-03-08T12:09:00+00:00", + "author": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "title": "Laboratory Report", + "section": [ + { + "title": "CRP (C reactive protein) mass concentration in serum", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "1106741000000105", + "display": "CRP (C reactive protein) mass concentration in serum" + } + ] + }, + "entry": [ + { + "reference": "urn:uuid:8697e1ea-a15d-4cab-95d9-7335f4b57e22" + } + ] + } + ] + } + }, + { + "fullUrl": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "resource": { + "resourceType": "Organization", + "id": "8a6d85b8-9837-4fed-a257-4cf207988338", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "Y8J7D" + } + ], + "name": "TD008362 PATH LAB 001", + "address": [ + { + "line": [ + "PATHOLOGY LAB", + "7-8 WELLINGTON PLACE" + ], + "city": "LEEDS", + "district": "WEST YORKSHIRE", + "postalCode": "LS1 4AP" + } + ] + } + }, + { + "fullUrl": "urn:uuid:3c43b5b3-06d6-445f-ae9a-48d5f05df434", + "resource": { + "resourceType": "Organization", + "id": "3c43b5b3-06d6-445f-ae9a-48d5f05df434", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "B82033" + } + ], + "name": "PICKERING MEDICAL PRACTICE", + "address": [ + { + "line": [ + "SOUTHGATE" + ], + "city": "PICKERING", + "district": "NORTH YORKSHIRE", + "postalCode": "YO18 8BL" + } + ] + } + }, + { + "fullUrl": "urn:uuid:9a835acf-d715-4d84-8dcf-a8435f6417fe", + "resource": { + "resourceType": "Practitioner", + "id": "9a835acf-d715-4d84-8dcf-a8435f6417fe", + "identifier": [ + { + "system": "https://fhir.hl7.org.uk/Id/gmc-number", + "value": "C1008215" + } + ], + "name": [ + { + "use": "official", + "family": "GASKELL", + "given": [ + "Gale" + ], + "prefix": [ + "Dr" + ] + } + ] + } + }, + { + "fullUrl": "urn:uuid:d4f5e6a1-2b3c-4d5e-9f6a-7b8c9d0e1f2a", + "resource": { + "resourceType": "PractitionerRole", + "id": "d4f5e6a1-2b3c-4d5e-9f6a-7b8c9d0e1f2a", + "practitioner": { + "reference": "urn:uuid:9a835acf-d715-4d84-8dcf-a8435f6417fe" + }, + "organization": { + "reference": "urn:uuid:3c43b5b3-06d6-445f-ae9a-48d5f05df434", + "display": "PICKERING MEDICAL PRACTICE" + } + } + }, + { + "fullUrl": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "resource": { + "resourceType": "Patient", + "id": "ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638", + "use": "official" + } + ] + } + }, + { + "fullUrl": "urn:uuid:1c38d507-9ad7-4b49-ba91-7da204842cac", + "resource": { + "resourceType": "ServiceRequest", + "id": "1c38d507-9ad7-4b49-ba91-7da204842cac", + "identifier": [ + { + "system": "http://B82033-pickeringmedicalpractice.com/labrequest", + "value": "REQ-20220307-000142" + } + ], + "status": "active", + "intent": "order", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "135842001", + "display": "Serum C reactive protein level" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "authoredOn": "2022-01-29T10:24:00+00:00", + "requester": { + "reference": "urn:uuid:d4f5e6a1-2b3c-4d5e-9f6a-7b8c9d0e1f2a" + }, + "performer": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "specimen": [ + { + "reference": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d" + } + ] + } + }, + { + "fullUrl": "urn:uuid:35d46ca1-f253-4c97-b7ee-fb5fccdf6c20", + "resource": { + "resourceType": "DiagnosticReport", + "id": "35d46ca1-f253-4c97-b7ee-fb5fccdf6c20", + "identifier": [ + { + "system": "http://Y8J7D-pathlab001.com/report", + "value": "REP-20220308-004205" + } + ], + "basedOn": [ + { + "reference": "urn:uuid:1c38d507-9ad7-4b49-ba91-7da204842cac" + } + ], + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v2-0074", + "code": "LAB", + "display": "Laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "721981007", + "display": "Diagnostic studies report" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "issued": "2022-03-08T12:09:00+00:00", + "performer": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "specimen": [ + { + "reference": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d" + } + ], + "result": [ + { + "reference": "urn:uuid:8697e1ea-a15d-4cab-95d9-7335f4b57e22" + } + ] + } + }, + { + "fullUrl": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d", + "resource": { + "resourceType": "Specimen", + "id": "bab0eaec-1ec5-4598-b660-90bb38a1030d", + "identifier": [ + { + "system": "http://B82033-pickeringmedicalpractice.com/specimen", + "value": "SPC-REQ-20220307-000105" + } + ], + "accessionIdentifier": { + "system": "http://Y8J7D-pathlab001.com/specimen", + "value": "SPC-Lab-20220307-007856" + }, + "status": "available", + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "122555007", + "display": "Venous blood specimen" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "receivedTime": "2022-03-07T14:58:00+00:00", + "collection": { + "collectedDateTime": "2022-03-07T11:42:00+00:00" + } + } + }, + { + "fullUrl": "urn:uuid:8697e1ea-a15d-4cab-95d9-7335f4b57e22", + "resource": { + "resourceType": "Observation", + "id": "8697e1ea-a15d-4cab-95d9-7335f4b57e22", + "identifier": [ + { + "system": "https://tools.ietf.org/html/rfc4122", + "value": "09fd65ba-4bbb-49dd-9d16-ca74f885db6c" + } + ], + "status": "final", + "category": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/observation-category", + "code": "laboratory", + "display": "Laboratory" + } + ] + } + ], + "code": { + "coding": [ + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/valueset-reference", + "valueUri": "https://fhir.hl7.org.uk/ValueSet/UKCore-PathologyBoundedCodeListObservables" + } + ], + "system": "http://snomed.info/sct", + "code": "1001371000000100", + "display": "Serum CRP (C reactive protein) level" + }, + { + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/valueset-reference", + "valueUri": "https://fhir.hl7.org.uk/ValueSet/UKCore-PathologyAndLaboratoryMedicineObservables" + } + ], + "system": "http://snomed.info/sct", + "code": "1106741000000105", + "display": "CRP (C reactive protein) mass concentration in serum" + } + ] + }, + "subject": { + "reference": "urn:uuid:ab87a3f8-1d37-44a9-804e-5e962598a6e4", + "display": "WELSH, Joel", + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "9727710638" + } + }, + "issued": "2022-03-08T12:09:00+00:00", + "performer": [ + { + "reference": "urn:uuid:8a6d85b8-9837-4fed-a257-4cf207988338", + "display": "TD008362 PATH LAB 001" + } + ], + "valueQuantity": { + "value": 200, + "unit": "mg/L", + "system": "http://unitsofmeasure.org", + "code": "mg/L" + }, + "interpretation": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation", + "code": "H", + "display": "High" + } + ] + } + ], + "specimen": { + "reference": "urn:uuid:bab0eaec-1ec5-4598-b660-90bb38a1030d" + }, + "referenceRange": [ + { + "low": { + "value": 0, + "unit": "mg/L", + "system": "http://unitsofmeasure.org", + "code": "mg/L" + }, + "high": { + "value": 5, + "unit": "mg/L", + "system": "http://unitsofmeasure.org", + "code": "mg/L" + } + } + ] + } + } + ] + } +} + +assert { + res.status: eq 200 + res.body.resourceType: eq "Bundle" + res.body.type: eq document + res.body.id: isNotEmpty + res.body.entry: isArray + res.body.entry[0].resource.subject.identifier.value: isNotEmpty +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_With_Incorrect_ReferenceType.bru b/bruno/APIM/Test_With_Incorrect_ReferenceType.bru index a370aad..a213a5a 100644 --- a/bruno/APIM/Test_With_Incorrect_ReferenceType.bru +++ b/bruno/APIM/Test_With_Incorrect_ReferenceType.bru @@ -1,7 +1,7 @@ meta { name: Test_With_Incorrect_ReferenceType type: http - seq: 13 + seq: 21 } post { diff --git a/bruno/APIM/Test_With_Incorrect_ReferenceType_IntEnvi.bru b/bruno/APIM/Test_With_Incorrect_ReferenceType_IntEnvi.bru new file mode 100644 index 0000000..7ff5353 --- /dev/null +++ b/bruno/APIM/Test_With_Incorrect_ReferenceType_IntEnvi.bru @@ -0,0 +1,84 @@ +meta { + name: Test_With_Incorrect_ReferenceType_IntEnvi + type: http + seq: 44 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": 123 + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq ('entry', 0, 'resource', 'extension', 0, 'valueReference', 'reference') - Input should be a valid string \n +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_With_Incorrect_ReferenceType_in_Extension.bru b/bruno/APIM/Test_With_Incorrect_ReferenceType_in_Extension.bru index 2b64367..3015673 100644 --- a/bruno/APIM/Test_With_Incorrect_ReferenceType_in_Extension.bru +++ b/bruno/APIM/Test_With_Incorrect_ReferenceType_in_Extension.bru @@ -1,7 +1,7 @@ meta { name: Test_With_Incorrect_ReferenceType_in_Extension type: http - seq: 12 + seq: 20 } post { diff --git a/bruno/APIM/Test_With_Incorrect_ReferenceType_in_Extension_IntEnvi.bru b/bruno/APIM/Test_With_Incorrect_ReferenceType_in_Extension_IntEnvi.bru new file mode 100644 index 0000000..eee084b --- /dev/null +++ b/bruno/APIM/Test_With_Incorrect_ReferenceType_in_Extension_IntEnvi.bru @@ -0,0 +1,84 @@ +meta { + name: Test_With_Incorrect_ReferenceType_in_Extension_IntEnvi + type: http + seq: 43 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest123" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq ServiceRequest resource not found with provided reference. Provided reference: servicerequest123 +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_With_Invalid_Identifiers_in_Organization.bru b/bruno/APIM/Test_With_Invalid_Identifiers_in_Organization.bru index 0a9e3cf..51ae0f1 100644 --- a/bruno/APIM/Test_With_Invalid_Identifiers_in_Organization.bru +++ b/bruno/APIM/Test_With_Invalid_Identifiers_in_Organization.bru @@ -1,7 +1,7 @@ meta { name: Test_With_Invalid_Identifiers_in_Organization type: http - seq: 23 + seq: 29 } post { diff --git a/bruno/APIM/Test_With_Invalid_Identifiers_in_Organization_IntEnvi.bru b/bruno/APIM/Test_With_Invalid_Identifiers_in_Organization_IntEnvi.bru new file mode 100644 index 0000000..caa9256 --- /dev/null +++ b/bruno/APIM/Test_With_Invalid_Identifiers_in_Organization_IntEnvi.bru @@ -0,0 +1,84 @@ +meta { + name: Test_With_Invalid_Identifiers_in_Organization_IntEnvi + type: http + seq: 52 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "http://fhir.nhs.uk/Id/ods-organization-code", + "value": "testorg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Organization (organization) does not define a supported identifier. Supported system 'https://fhir.nhs.uk/Id/ods-organization-code' +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_With_Multiple_Bundle_Entries_With_Same_URL.bru b/bruno/APIM/Test_With_Multiple_Bundle_Entries_With_Same_URL.bru index ad21c0a..99b7128 100644 --- a/bruno/APIM/Test_With_Multiple_Bundle_Entries_With_Same_URL.bru +++ b/bruno/APIM/Test_With_Multiple_Bundle_Entries_With_Same_URL.bru @@ -1,7 +1,7 @@ meta { name: Test_With_Multiple_Bundle_Entries_With_Same_URL type: http - seq: 26 + seq: 32 } post { diff --git a/bruno/APIM/Test_With_Multiple_Bundle_Entries_With_Same_URL_IntEnvi.bru b/bruno/APIM/Test_With_Multiple_Bundle_Entries_With_Same_URL_IntEnvi.bru new file mode 100644 index 0000000..27114b1 --- /dev/null +++ b/bruno/APIM/Test_With_Multiple_Bundle_Entries_With_Same_URL_IntEnvi.bru @@ -0,0 +1,105 @@ +meta { + name: Test_With_Multiple_Bundle_Entries_With_Same_URL_IntEnvi + type: http + seq: 54 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Multiple resources provided with same fullUrl: practitionerrole +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_With_Multiple_Identifiers_For_An_Organisation.bru b/bruno/APIM/Test_With_Multiple_Identifiers_For_An_Organisation.bru index 576acdd..1eac7b2 100644 --- a/bruno/APIM/Test_With_Multiple_Identifiers_For_An_Organisation.bru +++ b/bruno/APIM/Test_With_Multiple_Identifiers_For_An_Organisation.bru @@ -1,7 +1,7 @@ meta { name: Test_With_Multiple_Identifiers_For_An_Organisation type: http - seq: 25 + seq: 31 } post { diff --git a/bruno/APIM/Test_With_Multiple_Identifiers_For_An_Organisation_IntEnvi.bru b/bruno/APIM/Test_With_Multiple_Identifiers_For_An_Organisation_IntEnvi.bru new file mode 100644 index 0000000..33edc41 --- /dev/null +++ b/bruno/APIM/Test_With_Multiple_Identifiers_For_An_Organisation_IntEnvi.bru @@ -0,0 +1,88 @@ +meta { + name: Test_With_Multiple_Identifiers_For_An_Organisation_IntEnvi + type: http + seq: 53 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + }, + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "secondOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Organization (organization) defines multiple identifier values. Identifier values: ['testOrg', 'secondOrg'] +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Composition.bru b/bruno/APIM/Test_Without_Composition.bru index 2092ae5..164a2de 100644 --- a/bruno/APIM/Test_Without_Composition.bru +++ b/bruno/APIM/Test_Without_Composition.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Composition type: http - seq: 7 + seq: 10 } post { diff --git a/bruno/APIM/Test_Without_Composition_IntEnvi.bru b/bruno/APIM/Test_Without_Composition_IntEnvi.bru new file mode 100644 index 0000000..dd4fa06 --- /dev/null +++ b/bruno/APIM/Test_Without_Composition_IntEnvi.bru @@ -0,0 +1,64 @@ +meta { + name: Test_Without_Composition_IntEnvi + type: http + seq: 36 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Document must include a single Composition resource +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Extension_URL_is_incorrect.bru b/bruno/APIM/Test_Without_Extension_URL_is_incorrect.bru index 89b771f..abd9965 100644 --- a/bruno/APIM/Test_Without_Extension_URL_is_incorrect.bru +++ b/bruno/APIM/Test_Without_Extension_URL_is_incorrect.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Extension_URL_is_incorrect type: http - seq: 10 + seq: 16 } post { diff --git a/bruno/APIM/Test_Without_Extension_URL_is_incorrect_IntEnvi.bru b/bruno/APIM/Test_Without_Extension_URL_is_incorrect_IntEnvi.bru new file mode 100644 index 0000000..4c5dabd --- /dev/null +++ b/bruno/APIM/Test_Without_Extension_URL_is_incorrect_IntEnvi.bru @@ -0,0 +1,84 @@ +meta { + name: Test_Without_Extension_URL_is_incorrect_IntEnvi + type: http + seq: 39 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "https://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Composition does not define a valid basedOn-order-or-requisition extension +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Extension_in_Composition.bru b/bruno/APIM/Test_Without_Extension_in_Composition.bru index 522b920..5452219 100644 --- a/bruno/APIM/Test_Without_Extension_in_Composition.bru +++ b/bruno/APIM/Test_Without_Extension_in_Composition.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Extension_in_Composition type: http - seq: 8 + seq: 12 } post { diff --git a/bruno/APIM/Test_Without_Extension_in_Composition_IntEnvi.bru b/bruno/APIM/Test_Without_Extension_in_Composition_IntEnvi.bru new file mode 100644 index 0000000..2554512 --- /dev/null +++ b/bruno/APIM/Test_Without_Extension_in_Composition_IntEnvi.bru @@ -0,0 +1,76 @@ +meta { + name: Test_Without_Extension_in_Composition_IntEnvi + type: http + seq: 37 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Composition does not define a valid basedOn-order-or-requisition extension +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Organization.bru b/bruno/APIM/Test_Without_Organization.bru index 281ebdc..0c600ad 100644 --- a/bruno/APIM/Test_Without_Organization.bru +++ b/bruno/APIM/Test_Without_Organization.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Organization type: http - seq: 6 + seq: 9 } post { diff --git a/bruno/APIM/Test_Without_Organization_Identifier.bru b/bruno/APIM/Test_Without_Organization_Identifier.bru index 1fefdf2..2aa0cba 100644 --- a/bruno/APIM/Test_Without_Organization_Identifier.bru +++ b/bruno/APIM/Test_Without_Organization_Identifier.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Organization_Identifier type: http - seq: 17 + seq: 26 } post { diff --git a/bruno/APIM/Test_Without_Organization_Identifier_IntEnvi.bru b/bruno/APIM/Test_Without_Organization_Identifier_IntEnvi.bru new file mode 100644 index 0000000..be4e284 --- /dev/null +++ b/bruno/APIM/Test_Without_Organization_Identifier_IntEnvi.bru @@ -0,0 +1,78 @@ +meta { + name: Test_Without_Organization_Identifier_IntEnvi + type: http + seq: 48 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization" + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Organisation (organization) does not define a valid subject identifier +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Organization_Identifier_Value.bru b/bruno/APIM/Test_Without_Organization_Identifier_Value.bru index d659c0a..7837322 100644 --- a/bruno/APIM/Test_Without_Organization_Identifier_Value.bru +++ b/bruno/APIM/Test_Without_Organization_Identifier_Value.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Organization_Identifier_Value type: http - seq: 20 + seq: 29 } post { diff --git a/bruno/APIM/Test_Without_Organization_Identifier_Value_IntEnvi.bru b/bruno/APIM/Test_Without_Organization_Identifier_Value_IntEnvi.bru new file mode 100644 index 0000000..85e08c3 --- /dev/null +++ b/bruno/APIM/Test_Without_Organization_Identifier_Value_IntEnvi.bru @@ -0,0 +1,83 @@ +meta { + name: Test_Without_Organization_Identifier_Value_IntEnvi + type: http + seq: 51 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq ('entry', 3, 'resource', 'identifier', 0, 'value') - Field required \n +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Organization_IntEnvi.bru b/bruno/APIM/Test_Without_Organization_IntEnvi.bru new file mode 100644 index 0000000..8d710c7 --- /dev/null +++ b/bruno/APIM/Test_Without_Organization_IntEnvi.bru @@ -0,0 +1,72 @@ +meta { + name: Test_Without_Organization_IntEnvi + type: http + seq: 35 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Document must include an Organization resource +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Organization_Invalid_System.bru b/bruno/APIM/Test_Without_Organization_Invalid_System.bru index 4c8f2dc..cc8c87b 100644 --- a/bruno/APIM/Test_Without_Organization_Invalid_System.bru +++ b/bruno/APIM/Test_Without_Organization_Invalid_System.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Organization_Invalid_System type: http - seq: 21 + seq: 27 } post { diff --git a/bruno/APIM/Test_Without_Organization_Invalid_System_IntEnvi.bru b/bruno/APIM/Test_Without_Organization_Invalid_System_IntEnvi.bru new file mode 100644 index 0000000..b0db94c --- /dev/null +++ b/bruno/APIM/Test_Without_Organization_Invalid_System_IntEnvi.bru @@ -0,0 +1,84 @@ +meta { + name: Test_Without_Organization_Invalid_System_IntEnvi + type: http + seq: 64 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "http://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Organization (organization) does not define a supported identifier. Supported system 'https://fhir.nhs.uk/Id/ods-organization-code' +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Organization_Invalid_Value.bru b/bruno/APIM/Test_Without_Organization_Invalid_Value.bru index 8b79c68..768be9f 100644 --- a/bruno/APIM/Test_Without_Organization_Invalid_Value.bru +++ b/bruno/APIM/Test_Without_Organization_Invalid_Value.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Organization_Invalid_Value type: http - seq: 22 + seq: 28 } post { diff --git a/bruno/APIM/Test_Without_Organization_Invalid_Value_IntEnvi.bru b/bruno/APIM/Test_Without_Organization_Invalid_Value_IntEnvi.bru new file mode 100644 index 0000000..1df6f3d --- /dev/null +++ b/bruno/APIM/Test_Without_Organization_Invalid_Value_IntEnvi.bru @@ -0,0 +1,84 @@ +meta { + name: Test_Without_Organization_Invalid_Value_IntEnvi + type: http + seq: 66 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": 123 + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq ('entry', 3, 'resource', 'identifier', 0, 'value') - Input should be a valid string \n +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Organization_System.bru b/bruno/APIM/Test_Without_Organization_System.bru index 6acd7fa..679ff03 100644 --- a/bruno/APIM/Test_Without_Organization_System.bru +++ b/bruno/APIM/Test_Without_Organization_System.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Organization_System type: http - seq: 19 + seq: 26 } post { diff --git a/bruno/APIM/Test_Without_Organization_System_IntEnvi.bru b/bruno/APIM/Test_Without_Organization_System_IntEnvi.bru new file mode 100644 index 0000000..2fe749a --- /dev/null +++ b/bruno/APIM/Test_Without_Organization_System_IntEnvi.bru @@ -0,0 +1,78 @@ +meta { + name: Test_Without_Organization_System_IntEnvi + type: http + seq: 50 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization" + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Organisation (organization) does not define a valid subject identifier +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_PractionerRole.bru b/bruno/APIM/Test_Without_PractionerRole.bru index c96c881..4f8e77f 100644 --- a/bruno/APIM/Test_Without_PractionerRole.bru +++ b/bruno/APIM/Test_Without_PractionerRole.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_PractionerRole type: http - seq: 5 + seq: 7 } post { diff --git a/bruno/APIM/Test_Without_PractionerRole_IntEnvi.bru b/bruno/APIM/Test_Without_PractionerRole_IntEnvi.bru new file mode 100644 index 0000000..014876b --- /dev/null +++ b/bruno/APIM/Test_Without_PractionerRole_IntEnvi.bru @@ -0,0 +1,75 @@ +meta { + name: Test_Without_PractionerRole_IntEnvi + type: http + seq: 34 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Document must include a PractitionerRole resource +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_PractionerRole_On_ServiceRequest_Requester_Reference.bru b/bruno/APIM/Test_Without_PractionerRole_On_ServiceRequest_Requester_Reference.bru index 086a411..898bb1b 100644 --- a/bruno/APIM/Test_Without_PractionerRole_On_ServiceRequest_Requester_Reference.bru +++ b/bruno/APIM/Test_Without_PractionerRole_On_ServiceRequest_Requester_Reference.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_PractionerRole_On_ServiceRequest_Requester_Reference type: http - seq: 24 + seq: 30 } post { diff --git a/bruno/APIM/Test_Without_PractionerRole_On_ServiceRequest_Requester_Reference_IntEnvi.bru b/bruno/APIM/Test_Without_PractionerRole_On_ServiceRequest_Requester_Reference_IntEnvi.bru new file mode 100644 index 0000000..42e32e5 --- /dev/null +++ b/bruno/APIM/Test_Without_PractionerRole_On_ServiceRequest_Requester_Reference_IntEnvi.bru @@ -0,0 +1,75 @@ +meta { + name: Test_Without_PractionerRole_On_ServiceRequest_Requester_Reference_IntEnvi + type: http + seq: 55 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "Testrole" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq "Document must include a PractitionerRole resource" +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_PractionerRole_Reference.bru b/bruno/APIM/Test_Without_PractionerRole_Reference.bru index cae9d24..9bdc18f 100644 --- a/bruno/APIM/Test_Without_PractionerRole_Reference.bru +++ b/bruno/APIM/Test_Without_PractionerRole_Reference.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_PractionerRole_Reference type: http - seq: 16 + seq: 24 } post { diff --git a/bruno/APIM/Test_Without_PractionerRole_Reference_IntEnvi.bru b/bruno/APIM/Test_Without_PractionerRole_Reference_IntEnvi.bru new file mode 100644 index 0000000..aca5a87 --- /dev/null +++ b/bruno/APIM/Test_Without_PractionerRole_Reference_IntEnvi.bru @@ -0,0 +1,84 @@ +meta { + name: Test_Without_PractionerRole_Reference_IntEnvi + type: http + seq: 47 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq "Organization resource not found with provided reference. Provided reference: " +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_PractionerRole_Reference_Value.bru b/bruno/APIM/Test_Without_PractionerRole_Reference_Value.bru index e25e758..e4dc9b2 100644 --- a/bruno/APIM/Test_Without_PractionerRole_Reference_Value.bru +++ b/bruno/APIM/Test_Without_PractionerRole_Reference_Value.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_PractionerRole_Reference_Value type: http - seq: 17 + seq: 25 } post { diff --git a/bruno/APIM/Test_Without_PractionerRole_Reference_Value_IntEnvi.bru b/bruno/APIM/Test_Without_PractionerRole_Reference_Value_IntEnvi.bru new file mode 100644 index 0000000..0999608 --- /dev/null +++ b/bruno/APIM/Test_Without_PractionerRole_Reference_Value_IntEnvi.bru @@ -0,0 +1,83 @@ +meta { + name: Test_Without_PractionerRole_Reference_Value_IntEnvi + type: http + seq: 49 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq ('entry', 2, 'resource', 'organization', 'reference') - Field required \n +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_Reference_in_Extension.bru b/bruno/APIM/Test_Without_Reference_in_Extension.bru index df62721..771693a 100644 --- a/bruno/APIM/Test_Without_Reference_in_Extension.bru +++ b/bruno/APIM/Test_Without_Reference_in_Extension.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_Reference_in_Extension type: http - seq: 11 + seq: 17 } post { diff --git a/bruno/APIM/Test_Without_Reference_in_Extension_IntEnvi.bru b/bruno/APIM/Test_Without_Reference_in_Extension_IntEnvi.bru new file mode 100644 index 0000000..c627f92 --- /dev/null +++ b/bruno/APIM/Test_Without_Reference_in_Extension_IntEnvi.bru @@ -0,0 +1,76 @@ +meta { + name: Test_Without_Reference_in_Extension_IntEnvi + type: http + seq: 40 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest", + "requester": { + "reference": "practitionerrole" + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Composition does not define a valid basedOn-order-or-requisition extension +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_ServiceRequest_IntEnvi.bru b/bruno/APIM/Test_Without_ServiceRequest_IntEnvi.bru new file mode 100644 index 0000000..7a6b6ae --- /dev/null +++ b/bruno/APIM/Test_Without_ServiceRequest_IntEnvi.bru @@ -0,0 +1,75 @@ +meta { + name: Test_Without_ServiceRequest_IntEnvi + type: http + seq: 33 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Document must include a ServiceRequest resource +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_ServiceRequest_Requester.bru b/bruno/APIM/Test_Without_ServiceRequest_Requester.bru index 4a2c38a..8b503eb 100644 --- a/bruno/APIM/Test_Without_ServiceRequest_Requester.bru +++ b/bruno/APIM/Test_Without_ServiceRequest_Requester.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_ServiceRequest_Requester type: http - seq: 14 + seq: 22 } post { diff --git a/bruno/APIM/Test_Without_ServiceRequest_Requester_IntEnvi.bru b/bruno/APIM/Test_Without_ServiceRequest_Requester_IntEnvi.bru new file mode 100644 index 0000000..a7124a1 --- /dev/null +++ b/bruno/APIM/Test_Without_ServiceRequest_Requester_IntEnvi.bru @@ -0,0 +1,81 @@ +meta { + name: Test_Without_ServiceRequest_Requester_IntEnvi + type: http + seq: 45 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest" + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq ServiceRequest does not define a valid requester +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_ServiceRequest_Requester_Reference.bru b/bruno/APIM/Test_Without_ServiceRequest_Requester_Reference.bru index 8dbdbe6..a942e8e 100644 --- a/bruno/APIM/Test_Without_ServiceRequest_Requester_Reference.bru +++ b/bruno/APIM/Test_Without_ServiceRequest_Requester_Reference.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_ServiceRequest_Requester_Reference type: http - seq: 15 + seq: 23 } post { diff --git a/bruno/APIM/Test_Without_ServiceRequest_Requester_Reference_IntEnvi.bru b/bruno/APIM/Test_Without_ServiceRequest_Requester_Reference_IntEnvi.bru new file mode 100644 index 0000000..eb31aa5 --- /dev/null +++ b/bruno/APIM/Test_Without_ServiceRequest_Requester_Reference_IntEnvi.bru @@ -0,0 +1,81 @@ +meta { + name: Test_Without_ServiceRequest_Requester_Reference_IntEnvi + type: http + seq: 46 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "servicerequest" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "servicerequest", + "resource": { + "resourceType": "ServiceRequest" + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq ServiceRequest does not define a valid requester +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/Test_Without_ServiceRequest_Resource.bru b/bruno/APIM/Test_Without_ServiceRequest_Resource.bru index fa078ab..d87713e 100644 --- a/bruno/APIM/Test_Without_ServiceRequest_Resource.bru +++ b/bruno/APIM/Test_Without_ServiceRequest_Resource.bru @@ -1,7 +1,7 @@ meta { name: Test_Without_ServiceRequest_Resource type: http - seq: 8 + seq: 13 } post { diff --git a/bruno/APIM/Test_Without_ServiceRequest_Resource_IntEnvi.bru b/bruno/APIM/Test_Without_ServiceRequest_Resource_IntEnvi.bru new file mode 100644 index 0000000..c210e9f --- /dev/null +++ b/bruno/APIM/Test_Without_ServiceRequest_Resource_IntEnvi.bru @@ -0,0 +1,75 @@ +meta { + name: Test_Without_ServiceRequest_Resource_IntEnvi + type: http + seq: 38 +} + +post { + url: https://int.api.service.nhs.uk/pathology-laboratory-reporting/FHIR/R4/Bundle + body: json + auth: inherit +} + +headers { + Content-Type: application/fhir+json +} + +body:json { + { + "resourceType": "Bundle", + "type": "document", + "entry": [ + { + "fullUrl": "composition", + "resource": { + "resourceType": "Composition", + "extension": [ + { + "url": "http://hl7.eu/fhir/StructureDefinition/composition-basedOn-order-or-requisition", + "valueReference": { + "reference": "" + } + } + ], + "subject": { + "identifier": { + "system": "https://fhir.nhs.uk/Id/nhs-number", + "value": "test-nhs-number" + } + } + } + }, + { + "fullUrl": "practitionerrole", + "resource": { + "resourceType": "PractitionerRole", + "organization": { + "reference": "organization" + } + } + }, + { + "fullUrl": "organization", + "resource": { + "resourceType": "Organization", + "identifier": [ + { + "system": "https://fhir.nhs.uk/Id/ods-organization-code", + "value": "testOrg" + } + ] + } + } + ] + } +} + +assert { + res.status: eq 400 + res.body.issue[0].diagnostics: eq Document must include a ServiceRequest resource +} + +settings { + encodeUrl: true + timeout: 0 +} diff --git a/bruno/APIM/environments/INTEGRATION.bru b/bruno/APIM/environments/INTEGRATION.bru new file mode 100644 index 0000000..a314899 --- /dev/null +++ b/bruno/APIM/environments/INTEGRATION.bru @@ -0,0 +1,7 @@ +vars:secret [ + PRIVATE_KEY_PATH, + KID, + PR_NUMBER, + JWT_SECRET, + EXPIRED_BEARER_TOKEN +]