Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

fix(routes/documents/register): add missing table columns #21

Merged
merged 1 commit into from
Jan 13, 2021
Merged
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
4 changes: 3 additions & 1 deletion src/routes/documents/register/query.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
24 changes: 14 additions & 10 deletions src/routes/documents/register/register.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
],
],
Expand Down Expand Up @@ -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,
},
],
],
Expand Down
4 changes: 3 additions & 1 deletion src/routes/documents/register/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -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([
Expand All @@ -71,6 +71,7 @@ const registerGetSchema = {
"99999 DUCK 11 July 2015 11 27.pdf",
])
)
.prop("fullPath", S.string())
.prop(
"url",
S.string()
Expand All @@ -91,6 +92,7 @@ const registerGetSchema = {
.examples(["2020-08-10T03:51:54.000Z"])
.format("date-time")
)
.prop("patientVisible", S.number())
)
)
.prop(
Expand Down