Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: APIM_ping
type: http
seq: 4
}

get {
url: {{BASE_URL}}/clinical-data-gateway-api-poc/_ping
body: none
auth: inherit
}

settings {
encodeUrl: true
timeout: 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
meta {
name: APIM_post
type: http
seq: 6
}

post {
url: {{BASE_URL}}/patient/$gpc.getstructuredrecord
body: json
auth: inherit
}

body:json {
{
"resourceType": "Parameters",
"parameter": [
{
"name": "patientNHSNumber",
"valueIdentifier": {
"system": "https://fhir.nhs.uk/Id/nhs-number",
"value": "9999999999"
}
}
]
}
}

settings {
encodeUrl: true
timeout: 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
meta {
name: AWS_POST
type: http
seq: 3
}

post {
url: {{BASE_URL}}/patient/$gpc.getstructuredrecord
body: json
auth: inherit
}

body:json {
{
"resourceType": "Parameters",
"parameter": [
{
"name": "patientNHSNumber",
"valueIdentifier": {
"system": "https://fhir.nhs.uk/Id/nhs-number",
"value": "9999999999"
}
}
]
}
}

settings {
encodeUrl: true
timeout: 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
meta {
name: AWS_health
type: http
seq: 1
}

get {
url: {{BASE_URL}}/health
body: none
auth: inherit
}

settings {
encodeUrl: true
timeout: 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
meta {
name: OrangeBox
type: http
seq: 1
}

post {
url: {{BASE_URL}}/patient/$gpc.getstructuredrecord
body: json
auth: none
}

headers {
Content-Type: application/fhir+json
Accept: application/fhir+json
Ods-From: S44444
}

body:json {
{
"resourceType": "Parameters",
"parameter": [
{
"name": "patientNHSNumber",
"valueIdentifier": {
"system": "https://fhir.nhs.uk/Id/nhs-number",
"value": "{{nhs_number}}"
}
}
]
}
}

script:pre-request {
const { v4: uuidv4 } = require('uuid');
req.setHeader("Ssp-TraceID", uuidv4());
}

tests {
test("Returns a 200 OK status", function() {
expect(res.getStatus()).to.equal(200);
});

test("Response is a standard FHIR Bundle", function() {
const body = res.getBody();
expect(body.resourceType).to.equal("Bundle");
expect(body.type).to.equal("collection");
});

test("Bundle contains the requested Patient data", function() {
const body = res.getBody();
const expectedNhsNumber = bru.getEnvVar("nhs_number");
const expectedFamilyName = bru.getEnvVar("family_name");
const patientEntry = body.entry.find(e => e.resource.resourceType === "Patient");

expect(patientEntry).to.not.be.undefined;

const nhsIdentifier = patientEntry.resource.identifier.find(
id => id.system === "https://fhir.nhs.uk/Id/nhs-number"
);
expect(nhsIdentifier.value).to.equal(expectedNhsNumber);
expect(patientEntry.resource.name[0].family.toUpperCase()).to.equal(expectedFamilyName.toUpperCase());;
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"version": "1",
"name": "clinical-data-gateway-api-poc",
"type": "collection",
"ignore": [
"node_modules",
".git"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vars {
BASE_URL: http://localhost:5000
nhs_number: 9690937278
family_name: SAMUAL
}
Loading