diff --git a/src/routes/documents/register/query.js b/src/routes/documents/register/query.js index e1b875f5..0521646e 100644 --- a/src/routes/documents/register/query.js +++ b/src/routes/documents/register/query.js @@ -16,9 +16,11 @@ Specialty AS specialty, Clinic AS clinic, Document_Type AS documentType, Filesname AS fileName, +FullPath AS fullPath, URL AS url, CreatedDate AS createdDate, -Modified AS modifiedDate +Modified AS modifiedDate, +patient_visible AS patientVisible FROM ${documentRegisterTable} WHERE Modified ${operator} '${timestamp}' ORDER BY Modified DESC diff --git a/src/routes/documents/register/register.test.js b/src/routes/documents/register/register.test.js index fb534360..9ab11b63 100644 --- a/src/routes/documents/register/register.test.js +++ b/src/routes/documents/register/register.test.js @@ -39,16 +39,18 @@ describe("register", () => { [ { GUID: "EXAMPLE-GUID", - fhir_id: 99999, - Title: "99999 DUCK 11 July 2015 11 27.pdf", - Clinic: "CLO/BIA", - Document_Type: "Clinic Letter", - Filesname: "99999 DUCK 11 July 2015 11 27.pdf", + fhirId: "99999", + title: "99999 DUCK 11 July 2015 11 27.pdf", + clinic: "CLO/BIA", + documentType: "Clinic Letter", + fileName: "99999 DUCK 11 July 2015 11 27.pdf", + fullPath: "./path/path/path", URL: "https://notreal.ydh.nhs.uk/sites/MedicalRecords1/_layouts/15/DocIdRedir.aspx?ID=EXAMPLE-GUID", CreatedDate: "2015-09-30T05:40:14.000Z", Modified: "2020-08-10T03:51:54.000Z", Specialty: "General Surgery", + patientVisible: 1, }, ], ], @@ -90,16 +92,18 @@ describe("register", () => { [ { GUID: "EXAMPLE-GUID", - fhir_id: 99999, - Title: "99999 DUCK 11 July 2015 11 27.pdf", - Clinic: "CLO/BIA", - Document_Type: "Clinic Letter", - Filesname: "99999 DUCK 11 July 2015 11 27.pdf", + fhirId: "99999", + title: "99999 DUCK 11 July 2015 11 27.pdf", + clinic: "CLO/BIA", + documentType: "Clinic Letter", + fileName: "99999 DUCK 11 July 2015 11 27.pdf", + fullPath: "./path/path/path", URL: "https://notreal.ydh.nhs.uk/sites/MedicalRecords1/_layouts/15/DocIdRedir.aspx?ID=EXAMPLE-GUID", CreatedDate: "2015-09-30T05:40:14.000Z", Modified: "2020-08-10T03:51:54.000Z", Specialty: "General Surgery", + patientVisible: 1, }, ], ], diff --git a/src/routes/documents/register/schema.js b/src/routes/documents/register/schema.js index 9092d1fb..e1a66b2e 100644 --- a/src/routes/documents/register/schema.js +++ b/src/routes/documents/register/schema.js @@ -49,7 +49,7 @@ const registerGetSchema = { S.array().items( S.object() .prop("guid", S.string().examples(["EXAMPLE-GUID"])) - .prop("fhirId", S.number().examples(["99999"])) + .prop("fhirId", S.string().examples(["99999"])) .prop( "title", S.string().examples([ @@ -71,6 +71,7 @@ const registerGetSchema = { "99999 DUCK 11 July 2015 11 27.pdf", ]) ) + .prop("fullPath", S.string()) .prop( "url", S.string() @@ -91,6 +92,7 @@ const registerGetSchema = { .examples(["2020-08-10T03:51:54.000Z"]) .format("date-time") ) + .prop("patientVisible", S.number()) ) ) .prop(