-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfig.ts
More file actions
145 lines (143 loc) · 4.47 KB
/
config.ts
File metadata and controls
145 lines (143 loc) · 4.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import { constants as fhirConstants } from '@projecttacoma/node-fhir-server-core';
import 'dotenv/config';
import * as env from 'env-var';
// Set up whitelist
const whitelistEnv = env.get('WHITELIST').asArray() || false;
// If no whitelist is present, disable CORS
// If its length is 1, set it to a string, so * works
// If there are multiple, keep them as an array
const whitelist = whitelistEnv && whitelistEnv.length === 1 ? whitelistEnv[0] : whitelistEnv;
export default {
server: {
port: env.get('PORT').asInt(),
discoveryEndpoint: '/cds-services',
name: env.get('SERVER_NAME').required().asString()
},
smart: {
endpoint: env.get('SMART_ENDPOINT').required().asUrlString()
},
logging: {
level: 'info'
},
general: {
resourcePath: 'src/cds-library/CRD-DTR',
VsacApiKey: env.get('VSAC_API_KEY').required().asString(),
fullResourceInAppContext: env.get('FULL_RESOURCE_IN_APP_CONTEXT').required().asBool()
},
database: {
selected: 'mongo',
mongoConfig: {
location: env.get('MONGO_URL').asString(),
db_name: env.get('MONGO_DB_NAME').asString(),
options: {
//auto_reconnect: true,
useUnifiedTopology: true,
useNewUrlParser: true
}
}
},
fhirServerConfig: {
auth: {
// This server's URI
resourceServer: env.get('RESOURCE_SERVER').required().asUrlString(),
dockered_ehr_container_name: env.get('DOCKERED_EHR_CONTAINER_NAME').asString()
//
// if you use this strategy, you need to add the corresponding env vars to docker-compose
//
// strategy: {
// name: 'bearer',
// useSession: false,
// service: './src/strategies/bearer.strategy.js'
// },
},
server: {
// support various ENV that uses PORT vs SERVER_PORT
port: env.get('PORT').asInt(),
// allow Access-Control-Allow-Origin
corsOptions: {
maxAge: 86400,
origin: whitelist
}
},
logging: {
level: env.get('LOGGING_LEVEL').required().asString()
},
//
// If you want to set up conformance statement with security enabled
// Uncomment the following block
//
security: [
{
url: 'authorize',
valueUri: `${env.get('AUTH_SERVER_URI').required().asUrlString()}/authorize`
},
{
url: 'token',
valueUri: `${env.get('AUTH_SERVER_URI').required().asUrlString()}/token`
}
// optional - registration
],
//
// Add any profiles you want to support. Each profile can support multiple versions
// if supported by core. To support multiple versions, just add the versions to the array.
//
// Example:
// Account: {
// service: './src/services/account/account.service.js',
// versions: [ VERSIONS['4_0_0'], VERSIONS['3_0_1'], VERSIONS['1_0_2'] ]
// },
//
profiles: {
Patient: {
service: './src/services/patient.service.ts',
versions: [fhirConstants.VERSIONS['4_0_0']]
},
library: {
service: './src/services/library.service.ts',
versions: [fhirConstants.VERSIONS['4_0_0']]
},
questionnaire: {
service: './src/services/questionnaire.service.ts',
versions: [fhirConstants.VERSIONS['4_0_0']],
operation: [
{
name: 'questionnaire-package',
route: '/:id/$questionnaire-package',
method: 'POST',
reference:
'https://build.fhir.org/ig/HL7/davinci-dtr/OperationDefinition-Questionnaire-for-Order.html'
}
]
},
questionnaireresponse: {
service: './src/services/questionnaireresponse.service.ts',
versions: [fhirConstants.VERSIONS['4_0_0']],
operation: [
{
name: 'submit',
route: '/$submit',
method: 'POST',
reference: 'http://hl7.org/fhir/OperationDefinition/QuestionnaireResponse-submit'
}
]
},
valueset: {
service: './src/services/valueset.service.ts',
versions: [fhirConstants.VERSIONS['4_0_0']]
},
guidanceresponse: {
service: './src/services/guidanceresponse.service.ts',
versions: [fhirConstants.VERSIONS['4_0_0']],
operation: [
{
name: 'rems-etasu',
route: '/$rems-etasu',
method: 'POST',
reference:
'https://build.fhir.org/ig/HL7/fhir-medication-rems-ig/OperationDefinition-REMS-ETASU.html'
}
]
}
}
}
};