diff --git a/tests/e2e/personal-demographics-service-sandbox.json b/tests/e2e/personal-demographics-service-sandbox.json index c8e50cb3c..9db046656 100644 --- a/tests/e2e/personal-demographics-service-sandbox.json +++ b/tests/e2e/personal-demographics-service-sandbox.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "8e329df9-b7ae-446c-9374-019d36f88e6f", + "_postman_id": "872e436c-9066-47fb-8899-af94590bea31", "name": "Sandbox", "description": "Sandbox Testing", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" @@ -12,24 +12,1724 @@ { "name": "Search", "item": [ + { + "name": "Advanced", + "item": [ + { + "name": "Successful advanced search", + "event": [ + { + "listen": "test", + "script": { + "id": "7ecbe0ae-b410-442b-a3ff-0b1dfa815794", + "exec": [ + "pm.test(\"Returns status code 200 OK\", () =>{", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Returns correct canned response\", () =>{", + " console.log(\"Expected Response: \" + JSON.stringify(pm.environment.get(\"expected_response\")));", + " console.log(\"Actual Response: \" + JSON.stringify(pm.response.json().entry[0]));", + " pm.expect(JSON.stringify(pm.response.json().entry[0])).to.eql(JSON.stringify(pm.environment.get(\"expected_response\").entry[0]));", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "id": "88f01085-7f0b-4603-9e06-81181c0ca103", + "exec": [ + "var expected_response =", + "{\"entry\": [", + " {", + " \"search\": {", + " \"score\": 0.8343", + " },", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"9000000009\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\",", + " \"extension\": [", + " {", + " \"url\": \"https://fhir.nhs.uk/R4/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/UKCore-NHSNumberVerificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"01\",", + " \"display\": \"Number present and verified\"", + " }", + " ]", + " }", + " }", + " ]", + " }", + " ],", + " \"meta\": {", + " \"versionId\": \"2\"", + " },", + " \"name\": [", + " {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jane\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " }", + " ],", + " \"gender\": \"female\",", + " \"birthDate\": \"2010-10-22\",", + " \"deceasedDateTime\": \"2010-10-22T00:00:00+00:00\",", + " \"address\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"use\": \"work\",", + " \"type\": \"both\",", + " \"line\": [", + " \"NHS Digital\",", + " \"Whitehall II\",", + " \"Whitehall Quay\",", + " \"Leeds\",", + " \"West Yorkshire\"", + " ],", + " \"postalCode\": \"LS1 6AE\",", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-AddressKey\",", + " \"extension\": [", + " {", + " \"url\": \"type\",", + " \"valueCoding\": {", + " \"system\": \"https://simplifier.net/guide/UKCoreDecember2019/CodeSystemUKCore-AddressKeyType\",", + " \"code\": \"PAF\"", + " }", + " },", + " {", + " \"url\": \"value\",", + " \"valueString\": \"12345678\"", + " }", + " ]", + " }", + " ]", + " }", + " ],", + " \"contact\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v2-0131\",", + " \"version\": \"2.9\",", + " \"code\": \"C\",", + " \"display\": \"Emergency Contact\"", + " }", + " ]", + " }", + " ],", + " \"name\": {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jane\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " },", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ]", + " }", + " ],", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ],", + " \"generalPractitioner\": [", + " {", + " \"id\": \"254406A3\",", + " \"type\": \"Organization\",", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://digital.nhs.uk/services/organisation-data-service\",", + " \"value\": \"Y12345\"", + " }", + " }", + " ],", + " \"communication\": [", + " {", + " \"language\": {", + " \"coding\": [", + " {", + " \"system\": \"https://nhsconnect.github.io/FHIR-R4-Core-IG-Prototype/CodeSystem-UKCore-HumanLanguage.html\",", + " \"version\": \"1.0.0\",", + " \"code\": \"en\",", + " \"display\": \"English\"", + " }", + " ]", + " },", + " \"preferred\": true", + " }", + " ],", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-NominatedPharmacy\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y12345\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DispensingDoctor\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y23456\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y23456\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-MedicalApplianceSupplier\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y34567\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y34567\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DeathNotificationStatus\",", + " \"extension\": [", + " {", + " \"url\": \"deathNotificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://simplifier.net/UKCore/CodeSystem-UKCore-DeathNotificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"2\",", + " \"display\": \"Formal - death notice received from Registrar of Deaths\"", + " }", + " ]", + " }", + " },", + " {", + " \"url\": \"systemEffectiveDate\",", + " \"valueDateTime\": \"2010-10-22T00:00:00+00:00\"", + " }", + " ]", + " }", + " ]", + " }", + " },", + " {", + " \"search\": {", + " \"score\": 0.8343", + " },", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"9000000010\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\",", + " \"extension\": [", + " {", + " \"url\": \"https://fhir.nhs.uk/R4/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/UKCore-NHSNumberVerificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"01\",", + " \"display\": \"Number present and verified\"", + " }", + " ]", + " }", + " }", + " ]", + " }", + " ],", + " \"meta\": {", + " \"versionId\": \"2\"", + " },", + " \"name\": [", + " {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jayne\"", + " ],", + " \"family\": \"Smyth\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " }", + " ],", + " \"gender\": \"female\",", + " \"birthDate\": \"2010-10-22\",", + " \"deceasedDateTime\": \"2010-10-22T00:00:00+00:00\",", + " \"address\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"use\": \"work\",", + " \"type\": \"both\",", + " \"line\": [", + " \"NHS Digital\",", + " \"Whitehall II\",", + " \"Whitehall Quay\",", + " \"Leeds\",", + " \"West Yorkshire\"", + " ],", + " \"postalCode\": \"LS1 6AE\",", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-AddressKey\",", + " \"extension\": [", + " {", + " \"url\": \"type\",", + " \"valueCoding\": {", + " \"system\": \"https://simplifier.net/guide/UKCoreDecember2019/CodeSystemUKCore-AddressKeyType\",", + " \"code\": \"PAF\"", + " }", + " },", + " {", + " \"url\": \"value\",", + " \"valueString\": \"12345678\"", + " }", + " ]", + " }", + " ]", + " }", + " ],", + " \"contact\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v2-0131\",", + " \"version\": \"2.9\",", + " \"code\": \"C\",", + " \"display\": \"Emergency Contact\"", + " }", + " ]", + " }", + " ],", + " \"name\": {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jayne\"", + " ],", + " \"family\": \"Smyth\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " },", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ]", + " }", + " ],", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ],", + " \"generalPractitioner\": [", + " {", + " \"id\": \"254406A3\",", + " \"type\": \"Organization\",", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://digital.nhs.uk/services/organisation-data-service\",", + " \"value\": \"Y12345\"", + " }", + " }", + " ],", + " \"communication\": [", + " {", + " \"language\": {", + " \"coding\": [", + " {", + " \"system\": \"https://nhsconnect.github.io/FHIR-R4-Core-IG-Prototype/CodeSystem-UKCore-HumanLanguage.html\",", + " \"version\": \"1.0.0\",", + " \"code\": \"en\",", + " \"display\": \"English\"", + " }", + " ]", + " },", + " \"preferred\": true", + " }", + " ],", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-NominatedPharmacy\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y12345\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DispensingDoctor\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y23456\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y23456\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-MedicalApplianceSupplier\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y34567\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y34567\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DeathNotificationStatus\",", + " \"extension\": [", + " {", + " \"url\": \"deathNotificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://simplifier.net/UKCore/CodeSystem-UKCore-DeathNotificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"2\",", + " \"display\": \"Formal - death notice received from Registrar of Deaths\"", + " }", + " ]", + " }", + " },", + " {", + " \"url\": \"systemEffectiveDate\",", + " \"valueDateTime\": \"2010-10-22T00:00:00+00:00\"", + " }", + " ]", + " }", + " ]", + " }", + " }", + " ]", + "}", + "pm.environment.set(\"expected_response\", expected_response);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{environment}}/Patient?family=Sm*&gender=female&birthdate=eq2010-10-22", + "host": [ + "{{environment}}" + ], + "path": [ + "Patient" + ], + "query": [ + { + "key": "family", + "value": "Sm*" + }, + { + "key": "gender", + "value": "female" + }, + { + "key": "birthdate", + "value": "eq2010-10-22" + } + ] + }, + "description": "HTTP Status 200 with search result of two." + }, + "response": [] + }, + { + "name": "Successful advanced search with max-results", + "event": [ + { + "listen": "test", + "script": { + "id": "7ecbe0ae-b410-442b-a3ff-0b1dfa815794", + "exec": [ + "pm.test(\"Returns status code 200 OK\", () =>{", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Returns correct canned response\", () =>{", + " console.log(\"Expected Response: \" + JSON.stringify(pm.environment.get(\"expected_response\")));", + " console.log(\"Actual Response: \" + JSON.stringify(pm.response.json().entry[0]));", + " pm.expect(JSON.stringify(pm.response.json().entry[0])).to.eql(JSON.stringify(pm.environment.get(\"expected_response\").entry[0]));", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "id": "88f01085-7f0b-4603-9e06-81181c0ca103", + "exec": [ + "var expected_response =", + "{", + " \"entry\": [", + " {", + " \"search\": {", + " \"score\": 0.8343", + " },", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"9000000009\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\",", + " \"extension\": [", + " {", + " \"url\": \"https://fhir.nhs.uk/R4/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/UKCore-NHSNumberVerificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"01\",", + " \"display\": \"Number present and verified\"", + " }", + " ]", + " }", + " }", + " ]", + " }", + " ],", + " \"meta\": {", + " \"versionId\": \"2\"", + " },", + " \"name\": [", + " {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jane\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " }", + " ],", + " \"gender\": \"female\",", + " \"birthDate\": \"2010-10-22\",", + " \"deceasedDateTime\": \"2010-10-22T00:00:00+00:00\",", + " \"address\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"use\": \"work\",", + " \"type\": \"both\",", + " \"line\": [", + " \"NHS Digital\",", + " \"Whitehall II\",", + " \"Whitehall Quay\",", + " \"Leeds\",", + " \"West Yorkshire\"", + " ],", + " \"postalCode\": \"LS1 6AE\",", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-AddressKey\",", + " \"extension\": [", + " {", + " \"url\": \"type\",", + " \"valueCoding\": {", + " \"system\": \"https://simplifier.net/guide/UKCoreDecember2019/CodeSystemUKCore-AddressKeyType\",", + " \"code\": \"PAF\"", + " }", + " },", + " {", + " \"url\": \"value\",", + " \"valueString\": \"12345678\"", + " }", + " ]", + " }", + " ]", + " }", + " ],", + " \"contact\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v2-0131\",", + " \"version\": \"2.9\",", + " \"code\": \"C\",", + " \"display\": \"Emergency Contact\"", + " }", + " ]", + " }", + " ],", + " \"name\": {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jane\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " },", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ]", + " }", + " ],", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ],", + " \"generalPractitioner\": [", + " {", + " \"id\": \"254406A3\",", + " \"type\": \"Organization\",", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://digital.nhs.uk/services/organisation-data-service\",", + " \"value\": \"Y12345\"", + " }", + " }", + " ],", + " \"communication\": [", + " {", + " \"language\": {", + " \"coding\": [", + " {", + " \"system\": \"https://nhsconnect.github.io/FHIR-R4-Core-IG-Prototype/CodeSystem-UKCore-HumanLanguage.html\",", + " \"version\": \"1.0.0\",", + " \"code\": \"en\",", + " \"display\": \"English\"", + " }", + " ]", + " },", + " \"preferred\": true", + " }", + " ],", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-NominatedPharmacy\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y12345\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DispensingDoctor\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y23456\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y23456\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-MedicalApplianceSupplier\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y34567\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y34567\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DeathNotificationStatus\",", + " \"extension\": [", + " {", + " \"url\": \"deathNotificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://simplifier.net/UKCore/CodeSystem-UKCore-DeathNotificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"2\",", + " \"display\": \"Formal - death notice received from Registrar of Deaths\"", + " }", + " ]", + " }", + " },", + " {", + " \"url\": \"systemEffectiveDate\",", + " \"valueDateTime\": \"2010-10-22T00:00:00+00:00\"", + " }", + " ]", + " }", + " ]", + " }", + " },", + " {", + " \"search\": {", + " \"score\": 0.8343", + " },", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"9000000010\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\",", + " \"extension\": [", + " {", + " \"url\": \"https://fhir.nhs.uk/R4/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/UKCore-NHSNumberVerificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"01\",", + " \"display\": \"Number present and verified\"", + " }", + " ]", + " }", + " }", + " ]", + " }", + " ],", + " \"meta\": {", + " \"versionId\": \"2\"", + " },", + " \"name\": [", + " {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jayne\"", + " ],", + " \"family\": \"Smyth\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " }", + " ],", + " \"gender\": \"female\",", + " \"birthDate\": \"2010-10-22\",", + " \"deceasedDateTime\": \"2010-10-22T00:00:00+00:00\",", + " \"address\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"use\": \"work\",", + " \"type\": \"both\",", + " \"line\": [", + " \"NHS Digital\",", + " \"Whitehall II\",", + " \"Whitehall Quay\",", + " \"Leeds\",", + " \"West Yorkshire\"", + " ],", + " \"postalCode\": \"LS1 6AE\",", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-AddressKey\",", + " \"extension\": [", + " {", + " \"url\": \"type\",", + " \"valueCoding\": {", + " \"system\": \"https://simplifier.net/guide/UKCoreDecember2019/CodeSystemUKCore-AddressKeyType\",", + " \"code\": \"PAF\"", + " }", + " },", + " {", + " \"url\": \"value\",", + " \"valueString\": \"12345678\"", + " }", + " ]", + " }", + " ]", + " }", + " ],", + " \"contact\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v2-0131\",", + " \"version\": \"2.9\",", + " \"code\": \"C\",", + " \"display\": \"Emergency Contact\"", + " }", + " ]", + " }", + " ],", + " \"name\": {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jayne\"", + " ],", + " \"family\": \"Smyth\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " },", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ]", + " }", + " ],", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ],", + " \"generalPractitioner\": [", + " {", + " \"id\": \"254406A3\",", + " \"type\": \"Organization\",", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://digital.nhs.uk/services/organisation-data-service\",", + " \"value\": \"Y12345\"", + " }", + " }", + " ],", + " \"communication\": [", + " {", + " \"language\": {", + " \"coding\": [", + " {", + " \"system\": \"https://nhsconnect.github.io/FHIR-R4-Core-IG-Prototype/CodeSystem-UKCore-HumanLanguage.html\",", + " \"version\": \"1.0.0\",", + " \"code\": \"en\",", + " \"display\": \"English\"", + " }", + " ]", + " },", + " \"preferred\": true", + " }", + " ],", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-NominatedPharmacy\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y12345\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DispensingDoctor\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y23456\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y23456\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-MedicalApplianceSupplier\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y34567\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y34567\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DeathNotificationStatus\",", + " \"extension\": [", + " {", + " \"url\": \"deathNotificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://simplifier.net/UKCore/CodeSystem-UKCore-DeathNotificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"2\",", + " \"display\": \"Formal - death notice received from Registrar of Deaths\"", + " }", + " ]", + " }", + " },", + " {", + " \"url\": \"systemEffectiveDate\",", + " \"valueDateTime\": \"2010-10-22T00:00:00+00:00\"", + " }", + " ]", + " }", + " ]", + " }", + " }", + " ]", + "}", + "", + "pm.environment.set(\"expected_response\", expected_response);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{environment}}/Patient?family=Sm*&gender=female&birthdate=eq2010-10-22&_max-results=2", + "host": [ + "{{environment}}" + ], + "path": [ + "Patient" + ], + "query": [ + { + "key": "family", + "value": "Sm*" + }, + { + "key": "gender", + "value": "female" + }, + { + "key": "birthdate", + "value": "eq2010-10-22" + }, + { + "key": "_max-results", + "value": "2" + } + ] + }, + "description": "HTTP Status 200 with search result of two." + }, + "response": [] + }, + { + "name": "Successful advanced search with data range parameters", + "event": [ + { + "listen": "test", + "script": { + "id": "7ecbe0ae-b410-442b-a3ff-0b1dfa815794", + "exec": [ + "pm.test(\"Returns status code 200 OK\", () =>{", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Returns correct canned response\", () =>{", + " console.log(\"Expected Response: \" + JSON.stringify(pm.environment.get(\"expected_response\")));", + " console.log(\"Actual Response: \" + JSON.stringify(pm.response.json().entry[0]));", + " pm.expect(JSON.stringify(pm.response.json().entry[0])).to.eql(JSON.stringify(pm.environment.get(\"expected_response\").entry[0]));", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "id": "88f01085-7f0b-4603-9e06-81181c0ca103", + "exec": [ + "var expected_response =", + "{\"entry\": [", + " {", + " \"search\": {", + " \"score\": 1", + " },", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"9000000009\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000009\",", + " \"extension\": [", + " {", + " \"url\": \"https://fhir.nhs.uk/R4/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/UKCore-NHSNumberVerificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"01\",", + " \"display\": \"Number present and verified\"", + " }", + " ]", + " }", + " }", + " ]", + " }", + " ],", + " \"meta\": {", + " \"versionId\": \"2\"", + " },", + " \"name\": [", + " {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jane\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " }", + " ],", + " \"gender\": \"female\",", + " \"birthDate\": \"2010-10-22\",", + " \"deceasedDateTime\": \"2010-10-22T00:00:00+00:00\",", + " \"address\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"use\": \"work\",", + " \"type\": \"both\",", + " \"line\": [", + " \"NHS Digital\",", + " \"Whitehall II\",", + " \"Whitehall Quay\",", + " \"Leeds\",", + " \"West Yorkshire\"", + " ],", + " \"postalCode\": \"LS1 6AE\",", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-AddressKey\",", + " \"extension\": [", + " {", + " \"url\": \"type\",", + " \"valueCoding\": {", + " \"system\": \"https://simplifier.net/guide/UKCoreDecember2019/CodeSystemUKCore-AddressKeyType\",", + " \"code\": \"PAF\"", + " }", + " },", + " {", + " \"url\": \"value\",", + " \"valueString\": \"12345678\"", + " }", + " ]", + " }", + " ]", + " }", + " ],", + " \"contact\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v2-0131\",", + " \"version\": \"2.9\",", + " \"code\": \"C\",", + " \"display\": \"Emergency Contact\"", + " }", + " ]", + " }", + " ],", + " \"name\": {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jane\"", + " ],", + " \"family\": \"Smith\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " },", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ]", + " }", + " ],", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ],", + " \"generalPractitioner\": [", + " {", + " \"id\": \"254406A3\",", + " \"type\": \"Organization\",", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://digital.nhs.uk/services/organisation-data-service\",", + " \"value\": \"Y12345\"", + " }", + " }", + " ],", + " \"communication\": [", + " {", + " \"language\": {", + " \"coding\": [", + " {", + " \"system\": \"https://nhsconnect.github.io/FHIR-R4-Core-IG-Prototype/CodeSystem-UKCore-HumanLanguage.html\",", + " \"version\": \"1.0.0\",", + " \"code\": \"en\",", + " \"display\": \"English\"", + " }", + " ]", + " },", + " \"preferred\": true", + " }", + " ],", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-NominatedPharmacy\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y12345\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DispensingDoctor\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y23456\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y23456\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-MedicalApplianceSupplier\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y34567\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y34567\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DeathNotificationStatus\",", + " \"extension\": [", + " {", + " \"url\": \"deathNotificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://simplifier.net/UKCore/CodeSystem-UKCore-DeathNotificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"2\",", + " \"display\": \"Formal - death notice received from Registrar of Deaths\"", + " }", + " ]", + " }", + " },", + " {", + " \"url\": \"systemEffectiveDate\",", + " \"valueDateTime\": \"2010-10-22T00:00:00+00:00\"", + " }", + " ]", + " }", + " ]", + " }", + " }", + " ]", + "}", + "", + "pm.environment.set(\"expected_response\", expected_response);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{environment}}/Patient?family=Smith&gender=female&birthdate=ge2010-10-21&birthdate=le2010-10-23", + "host": [ + "{{environment}}" + ], + "path": [ + "Patient" + ], + "query": [ + { + "key": "family", + "value": "Smith" + }, + { + "key": "gender", + "value": "female" + }, + { + "key": "birthdate", + "value": "ge2010-10-21" + }, + { + "key": "birthdate", + "value": "le2010-10-23" + } + ] + }, + "description": "HTTP Status 200 with single search result." + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, + { + "name": "Algorithmic", + "item": [ + { + "name": "Successful algorithmic search", + "event": [ + { + "listen": "test", + "script": { + "id": "7ecbe0ae-b410-442b-a3ff-0b1dfa815794", + "exec": [ + "pm.test(\"Returns status code 200 OK\", () =>{", + " pm.response.to.have.status(200);", + "});", + "", + "pm.test(\"Returns correct canned response\", () =>{", + " console.log(\"Expected Response: \" + JSON.stringify(pm.environment.get(\"expected_response\")));", + " console.log(\"Actual Response: \" + JSON.stringify(pm.response.json().entry[0]));", + " pm.expect(JSON.stringify(pm.response.json().entry[0])).to.eql(JSON.stringify(pm.environment.get(\"expected_response\").entry[0]));", + "});" + ], + "type": "text/javascript" + } + }, + { + "listen": "prerequest", + "script": { + "id": "88f01085-7f0b-4603-9e06-81181c0ca103", + "exec": [ + "var expected_response =", + "{", + " \"entry\": [", + " {", + " \"search\": {", + " \"score\": 0.8976", + " },", + " \"resource\": {", + " \"resourceType\": \"Patient\",", + " \"id\": \"9000000010\",", + " \"identifier\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",", + " \"value\": \"9000000010\",", + " \"extension\": [", + " {", + " \"url\": \"https://fhir.nhs.uk/R4/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/UKCore-NHSNumberVerificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"01\",", + " \"display\": \"Number present and verified\"", + " }", + " ]", + " }", + " }", + " ]", + " }", + " ],", + " \"meta\": {", + " \"versionId\": \"2\"", + " },", + " \"name\": [", + " {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jayne\"", + " ],", + " \"family\": \"Smyth\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " }", + " ],", + " \"gender\": \"female\",", + " \"birthDate\": \"2010-10-22\",", + " \"deceasedDateTime\": \"2010-10-22T00:00:00+00:00\",", + " \"address\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"use\": \"work\",", + " \"type\": \"both\",", + " \"line\": [", + " \"NHS Digital\",", + " \"Whitehall II\",", + " \"Whitehall Quay\",", + " \"Leeds\",", + " \"West Yorkshire\"", + " ],", + " \"postalCode\": \"LS1 6AE\",", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-AddressKey\",", + " \"extension\": [", + " {", + " \"url\": \"type\",", + " \"valueCoding\": {", + " \"system\": \"https://simplifier.net/guide/UKCoreDecember2019/CodeSystemUKCore-AddressKeyType\",", + " \"code\": \"PAF\"", + " }", + " },", + " {", + " \"url\": \"value\",", + " \"valueString\": \"12345678\"", + " }", + " ]", + " }", + " ]", + " }", + " ],", + " \"contact\": [", + " {", + " \"id\": \"123\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"relationship\": [", + " {", + " \"coding\": [", + " {", + " \"system\": \"http://terminology.hl7.org/CodeSystem/v2-0131\",", + " \"version\": \"2.9\",", + " \"code\": \"C\",", + " \"display\": \"Emergency Contact\"", + " }", + " ]", + " }", + " ],", + " \"name\": {", + " \"use\": \"usual\",", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"given\": [", + " \"Jayne\"", + " ],", + " \"family\": \"Smyth\",", + " \"prefix\": [", + " \"Mrs\"", + " ],", + " \"suffix\": [", + " \"MBE\"", + " ]", + " },", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ]", + " }", + " ],", + " \"telecom\": [", + " {", + " \"period\": {", + " \"start\": \"2020-01-01\",", + " \"end\": \"2020-12-31\"", + " },", + " \"system\": \"phone\",", + " \"value\": \"01632960587\",", + " \"use\": \"work\",", + " \"rank\": 1", + " }", + " ],", + " \"generalPractitioner\": [", + " {", + " \"id\": \"254406A3\",", + " \"type\": \"Organization\",", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://digital.nhs.uk/services/organisation-data-service\",", + " \"value\": \"Y12345\"", + " }", + " }", + " ],", + " \"communication\": [", + " {", + " \"language\": {", + " \"coding\": [", + " {", + " \"system\": \"https://nhsconnect.github.io/FHIR-R4-Core-IG-Prototype/CodeSystem-UKCore-HumanLanguage.html\",", + " \"version\": \"1.0.0\",", + " \"code\": \"en\",", + " \"display\": \"English\"", + " }", + " ]", + " },", + " \"preferred\": true", + " }", + " ],", + " \"extension\": [", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-NominatedPharmacy\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y12345\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DispensingDoctor\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y23456\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y23456\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-MedicalApplianceSupplier\",", + " \"valueReference\": {", + " \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y34567\",", + " \"identifier\": {", + " \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",", + " \"value\": \"Y34567\"", + " }", + " }", + " },", + " {", + " \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DeathNotificationStatus\",", + " \"extension\": [", + " {", + " \"url\": \"deathNotificationStatus\",", + " \"valueCodeableConcept\": {", + " \"coding\": [", + " {", + " \"system\": \"https://simplifier.net/UKCore/CodeSystem-UKCore-DeathNotificationStatus\",", + " \"version\": \"1.0.0\",", + " \"code\": \"2\",", + " \"display\": \"Formal - death notice received from Registrar of Deaths\"", + " }", + " ]", + " }", + " },", + " {", + " \"url\": \"systemEffectiveDate\",", + " \"valueDateTime\": \"2010-10-22T00:00:00+00:00\"", + " }", + " ]", + " }", + " ]", + " }", + " }", + " ]", + "}", + "pm.environment.set(\"expected_response\", expected_response);" + ], + "type": "text/javascript" + } + } + ], + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{environment}}/Patient?family=Smith&given=Jane&gender=female&birthdate=eq2010-10-22&_fuzzy-match=true", + "host": [ + "{{environment}}" + ], + "path": [ + "Patient" + ], + "query": [ + { + "key": "family", + "value": "Smith" + }, + { + "key": "given", + "value": "Jane" + }, + { + "key": "gender", + "value": "female" + }, + { + "key": "birthdate", + "value": "eq2010-10-22" + }, + { + "key": "_fuzzy-match", + "value": "true" + } + ] + }, + "description": "HTTP Status 200 with single search result." + }, + "response": [] + } + ], + "protocolProfileBehavior": {}, + "_postman_isSubFolder": true + }, { "name": "Successful simple search", "event": [ { "listen": "test", "script": { - "id": "560bab76-e84b-4ee4-b162-74f75914f6a0", + "id": "7ecbe0ae-b410-442b-a3ff-0b1dfa815794", "exec": [ "pm.test(\"Returns status code 200 OK\", () =>{", " pm.response.to.have.status(200);", "});", "", "pm.test(\"Returns correct canned response\", () =>{", - " let expectedResponse = pm.variables.get(\"expected_response\");", - " let actualResponse = pm.response.json().entry[0];", - " console.log(\"Expected Canned Response: \" + expectedResponse);", - " console.log(\"Actual Response: \" + actualResponse);", - " pm.expect(pm.response.json().entry[0]).to.eql(expectedResponse);", + " console.log(\"Expected Response: \" + JSON.stringify(pm.environment.get(\"expected_response\")));", + " console.log(\"Actual Response: \" + JSON.stringify(pm.response.json().entry[0]));", + " pm.expect(JSON.stringify(pm.response.json().entry[0])).to.eql(JSON.stringify(pm.environment.get(\"expected_response\").entry[0]));", "});" ], "type": "text/javascript" @@ -38,10 +1738,12 @@ { "listen": "prerequest", "script": { - "id": "07c5f9f1-1588-4eb6-b1b2-d82db92c928c", + "id": "88f01085-7f0b-4603-9e06-81181c0ca103", "exec": [ - "let expected_response =", + "var expected_response =", "{", + " \"entry\": [", + " {", " \"search\": {", " \"score\": 1", " },", @@ -275,8 +1977,10 @@ " ]", " }", " }", + " ]", + "}", "", - "pm.variables.set(\"expected_response\", expected_response);" + "pm.environment.set(\"expected_response\", expected_response);" ], "type": "text/javascript" } @@ -286,7 +1990,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{environment}}/Patient?family=Smith&given=Jane&gender=female&birthdate=2010-10-22", + "raw": "{{environment}}/Patient?family=Smith&gender=female&birthdate=eq2010-10-22", "host": [ "{{environment}}" ], @@ -336,7 +2040,7 @@ "method": "GET", "header": [], "url": { - "raw": "{{environment}}/Patient?family=Bingham&given=John&gender=male&birthdate=1934-12-18", + "raw": "{{environment}}/Patient?family=Bingham&given=John&gender=male&birthdate=eq1934-12-18", "host": [ "{{environment}}" ], @@ -597,9 +2301,9 @@ "});", "", "pm.test(\"Returns correct canned response\", () =>{", - " var expected = pm.environment.get(\"expected_response\");", - " var actual = response;", - " pm.expect(actual).to.deep.equal(expected);", + " var expected = JSON.stringify(pm.environment.get(\"expected_response\"));", + " var actual = JSON.stringify(response);", + " pm.expect(actual).to.eql(expected);", "});", "" ], @@ -863,7 +2567,68 @@ }, "description": "GIVEN I have a valid NHS Number\nWHEN I call the simple search query\nTHEN I should get the patients details" }, - "response": [] + "response": [ + { + "name": "Retrieve: Patient Exists", + "originalRequest": { + "method": "GET", + "header": [], + "url": { + "raw": "{{environment}}/Patient/9000000009", + "host": [ + "{{environment}}" + ], + "path": [ + "Patient", + "9000000009" + ] + } + }, + "status": "OK", + "code": 200, + "_postman_previewlanguage": "json", + "header": [ + { + "key": "Date", + "value": "Fri, 21 Feb 2020 16:55:50 GMT" + }, + { + "key": "Content-Type", + "value": "application/fhir+json; fhirVersion=4.0" + }, + { + "key": "Transfer-Encoding", + "value": "chunked" + }, + { + "key": "Connection", + "value": "keep-alive" + }, + { + "key": "etag", + "value": "W/\"2\"" + }, + { + "key": "vary", + "value": "origin,accept-encoding" + }, + { + "key": "access-control-expose-headers", + "value": "WWW-Authenticate,Server-Authorization" + }, + { + "key": "cache-control", + "value": "no-cache" + }, + { + "key": "content-encoding", + "value": "gzip" + } + ], + "cookie": [], + "body": "{\n \"resourceType\": \"Patient\",\n \"id\": \"9000000009\",\n \"identifier\": [\n {\n \"system\": \"https://fhir.nhs.uk/Id/nhs-number\",\n \"value\": \"9000000009\",\n \"extension\": [\n {\n \"url\": \"https://fhir.nhs.uk/R4/StructureDefinition/Extension-UKCore-NHSNumberVerificationStatus\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://fhir.nhs.uk/R4/CodeSystem/UKCore-NHSNumberVerificationStatus\",\n \"version\": \"1.0.0\",\n \"code\": \"01\",\n \"display\": \"Number present and verified\"\n }\n ]\n }\n }\n ]\n }\n ],\n \"meta\": {\n \"versionId\": \"2\"\n },\n \"name\": [\n {\n \"use\": \"usual\",\n \"period\": {\n \"start\": \"2020-01-01\",\n \"end\": \"2020-12-31\"\n },\n \"given\": [\n \"Jane\"\n ],\n \"family\": \"Smith\",\n \"prefix\": \"Mrs\",\n \"suffix\": \"MBE\"\n }\n ],\n \"gender\": \"female\",\n \"birthDate\": \"2010-10-22\",\n \"deceasedDateTime\": \"2010-10-22T00:00:00+00:00\",\n \"address\": [\n {\n \"id\": \"123\",\n \"period\": {\n \"start\": \"2020-01-01\",\n \"end\": \"2020-12-31\"\n },\n \"use\": \"work\",\n \"type\": \"both\",\n \"line\": [\n \"NHS Digital\",\n \"Whitehall II\",\n \"Whitehall Quay\",\n \"Leeds\",\n \"West Yorkshire\"\n ],\n \"postalCode\": \"LS1 6AE\",\n \"extension\": [\n {\n \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-AddressKey\",\n \"extension\": [\n {\n \"url\": \"type\",\n \"valueCoding\": {\n \"system\": \"https://simplifier.net/guide/UKCoreDecember2019/CodeSystemUKCore-AddressKeyType\",\n \"code\": \"PAF\"\n }\n },\n {\n \"url\": \"value\",\n \"valueString\": \"12345678\"\n }\n ]\n }\n ]\n }\n ],\n \"contact\": [\n {\n \"id\": \"123\",\n \"period\": {\n \"start\": \"2020-01-01\",\n \"end\": \"2020-12-31\"\n },\n \"relationship\": [\n {\n \"coding\": [\n {\n \"system\": \"http://terminology.hl7.org/CodeSystem/v2-0131\",\n \"version\": \"2.9\",\n \"code\": \"C\",\n \"display\": \"Emergency Contact\"\n }\n ]\n }\n ],\n \"name\": {\n \"use\": \"usual\",\n \"period\": {\n \"start\": \"2020-01-01\",\n \"end\": \"2020-12-31\"\n },\n \"given\": [\n \"Jane\"\n ],\n \"family\": \"Smith\",\n \"prefix\": \"Mrs\",\n \"suffix\": \"MBE\"\n },\n \"telecom\": [\n {\n \"period\": {\n \"start\": \"2020-01-01\",\n \"end\": \"2020-12-31\"\n },\n \"system\": \"phone\",\n \"value\": \"01632960587\",\n \"use\": \"work\",\n \"rank\": 1\n }\n ]\n }\n ],\n \"telecom\": [\n {\n \"period\": {\n \"start\": \"2020-01-01\",\n \"end\": \"2020-12-31\"\n },\n \"system\": \"phone\",\n \"value\": \"01632960587\",\n \"use\": \"work\",\n \"rank\": 1\n }\n ],\n \"generalPractitioner\": [\n {\n \"id\": \"Y12345\",\n \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\"\n }\n ],\n \"communication\": [\n {\n \"language\": {\n \"coding\": [\n {\n \"system\": \"https://nhsconnect.github.io/FHIR-R4-Core-IG-Prototype/CodeSystem-UKCore-HumanLanguage.html\",\n \"version\": \"1.0.0\",\n \"code\": \"en\",\n \"display\": \"English\"\n }\n ]\n },\n \"preferred\": true\n }\n ],\n \"extension\": [\n {\n \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-NominatedPharmacy\",\n \"valueReference\": {\n \"reference\": \"https://directory.spineservices.nhs.uk/STU3/Organization/Y12345\",\n \"identifier\": {\n \"system\": \"https://fhir.nhs.uk/Id/ods-organization-code\",\n \"value\": \"Y12345\"\n }\n }\n },\n {\n \"url\": \"https://simplifier.net/guide/UKCoreDecember2019/ExtensionUKCore-DeathNotificationStatus\",\n \"extension\": [\n {\n \"url\": \"deathNotificationStatus\",\n \"valueCodeableConcept\": {\n \"coding\": [\n {\n \"system\": \"https://simplifier.net/UKCore/CodeSystem-UKCore-DeathNotificationStatus\",\n \"version\": \"1.0.0\",\n \"code\": \"2\",\n \"display\": \"Formal - death notice received from Registrar of Deaths\"\n }\n ]\n }\n },\n {\n \"url\": \"systemEffectiveDate\",\n \"valueDateTime\": \"2010-10-22T00:00:00+00:00\"\n }\n ]\n }\n ]\n}" + } + ] }, { "name": "Retrieve: Patient does not Exist",