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

Commit

Permalink
Merge pull request #21 from Fdawgs/fix/routes-register
Browse files Browse the repository at this point in the history
fix(routes/documents/register): add missing table columns
  • Loading branch information
Fdawgs committed Jan 13, 2021
2 parents 1831643 + 81ece65 commit 017a879
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
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

0 comments on commit 017a879

Please sign in to comment.