From ff23da2f3a3042b4f18ba9772a5df7ad4b39ee22 Mon Sep 17 00:00:00 2001 From: SenecaAnderson Date: Fri, 30 Jul 2021 10:05:52 -0400 Subject: [PATCH 1/2] Update config.schema.json for use with react-jsonschema-form; export JSON object from index.js --- src/helpers/schemas/config.schema.json | 23 ++++++++++++++++++++++- src/index.js | 4 ++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/helpers/schemas/config.schema.json b/src/helpers/schemas/config.schema.json index 62a34417..f8b6ebba 100644 --- a/src/helpers/schemas/config.schema.json +++ b/src/helpers/schemas/config.schema.json @@ -5,6 +5,7 @@ "type": "object", "properties": { "patientIdCsvPath": { + "title": "Patient ID CSV File", "type": "string" }, "commonExtractorArgs": { @@ -14,6 +15,7 @@ "$ref": "#/$defs/notificationInfo" }, "extractors": { + "title": "Extractors", "type": "array", "items": { "$ref": "#/$defs/extractor" @@ -22,32 +24,40 @@ }, "$defs": { "commonExtractorArgs": { + "title": "Common Extractor Arguments", "type": "object", "properties": { "baseFhirUrl": { + "title": "Base FHIR URL", "type": "string", "format": "uri" }, "requestHeaders": { + "title": "Request Headers", "type": "object" } } }, "notificationInfo": { + "title": "Notification Info", "type": "object", "properties": { "host": { + "title": "Host", "type": "string", "format": "hostname" }, "port": { + "title": "Port", "type": "integer" }, "from": { + "title": "From", "type": "string", "format": "email-with-name" }, "to": { + "title": "To", "anyOf": [ { "type": "string", @@ -63,6 +73,7 @@ ] }, "tlsRejectUnauthorized": { + "title": "Reject Unauthorized Connections", "type": "boolean" } }, @@ -72,12 +83,15 @@ ] }, "extractor": { + "title": "Extractor", "type": "object", "properties": { "label": { + "title": "Label", "type": "string" }, "type": { + "title": "Type", "type": "string" }, "constructorArgs": { @@ -86,25 +100,32 @@ } }, "constructorArgs": { + "title": "Constructor Arguments", "type": "object", "properties": { "filePath": { + "title": "File Path", "type": "string" }, "url": { + "title": "URL", "type": "string", "format": "uri" }, "clinicalSiteID": { + "title": "Clinical Site ID", "type": "string" }, "clinicalSiteSystem": { + "title": "Clinical Site System", "type": "string" }, "type": { + "title": "Type", "type": "string" }, "mask": { + "title": "Masked Fields", "type": "array", "items": { "type": "string" @@ -117,4 +138,4 @@ "extractors", "patientIdCsvPath" ] -} +} \ No newline at end of file diff --git a/src/index.js b/src/index.js index 6160db71..50bb930d 100644 --- a/src/index.js +++ b/src/index.js @@ -69,6 +69,8 @@ const { getConditionEntriesFromContext, getConditionsFromContext, getEncountersF const { parsePatientIds } = require('./helpers/appUtils'); const { getConfig, validateConfig } = require('./helpers/configUtils'); +const configSchema = require('./helpers/schemas/config.schema.json'); + module.exports = { // CLI Related utilities RunInstanceLogger, @@ -147,4 +149,6 @@ module.exports = { getConditionsFromContext, getEncountersFromContext, getPatientFromContext, + // Configuration file schema + configSchema, }; From 4cd323b26626817b3f312354f2bce7f7c2a69d34 Mon Sep 17 00:00:00 2001 From: SenecaAnderson Date: Fri, 30 Jul 2021 17:17:35 -0400 Subject: [PATCH 2/2] Made requested changes --- src/helpers/schemas/config.schema.json | 2 +- src/index.js | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/helpers/schemas/config.schema.json b/src/helpers/schemas/config.schema.json index f8b6ebba..02b80470 100644 --- a/src/helpers/schemas/config.schema.json +++ b/src/helpers/schemas/config.schema.json @@ -73,7 +73,7 @@ ] }, "tlsRejectUnauthorized": { - "title": "Reject Unauthorized Connections", + "title": "TLS Reject Unauthorized Connections", "type": "boolean" } }, diff --git a/src/index.js b/src/index.js index 50bb930d..53bb8b45 100644 --- a/src/index.js +++ b/src/index.js @@ -68,7 +68,6 @@ const { lowercaseLookupQuery, createLowercaseLookup, createInvertedLookup } = re const { getConditionEntriesFromContext, getConditionsFromContext, getEncountersFromContext, getPatientFromContext } = require('./helpers/contextUtils'); const { parsePatientIds } = require('./helpers/appUtils'); const { getConfig, validateConfig } = require('./helpers/configUtils'); - const configSchema = require('./helpers/schemas/config.schema.json'); module.exports = {