-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathconfig.ts
407 lines (364 loc) · 12.9 KB
/
config.ts
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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
const ENV = process.env.NODE_ENV || "production";
const PORT = +(process.env.PORT || (ENV == "test" ? 9444 : 9443));
export default {
baseUrl: process.env.BASE_URL || `http://localhost:${PORT}`,
port: PORT,
// Delay in milliseconds between NDJSON row generation
throttle: 0,
// Delay in milliseconds between files processed in the status endpoint
statusThrottle: ENV == "test" ? 10 : 200,
// Max. number of fhir resources (lines) in one ndjson file
defaultPageSize: 10000,
// Pretend that we are creating files for 10 seconds
defaultWaitTime: 10,
// Default Token LifeTime in minutes
defaultTokenLifeTime: 15,
// The maximum number of files that can be downloaded
maxFiles: 1500,
// How many rows to select (load into memory and then stream them one by one).
// The bigger the number the fewer sql queries will be executed but more
// memory will be needed to store those bigger chunks of data
rowsPerChunk: 1000,
// In minutes! Files created after export are deleted after 60 minutes.
maxExportAge: 60,
jwtSecret: process.env.SECRET || "this-is-our-big-secret",
jobsPath: process.env.NODE_ENV === "test" ? __dirname + "/jobs/test" : __dirname + "/jobs",
// Used while testing to fix the current timestamp. Otherwise approximate
// dates can shift and test will start failing over time!
now: process.env.NODE_ENV === "test" ? +new Date(2024, 12, 20) : undefined,
supportedSigningAlgorithms: [
"HS256", "HS384", "HS512",
"RS256", "RS384", "RS512",
"ES256", "ES384", "ES512",
"PS256", "PS384", "PS512",
],
errors: {
"missing_parameter" : "Missing %s parameter",
"invalid_parameter" : "Invalid %s parameter",
"form_content_type_required" : "Invalid request content-type header (must be 'application/x-www-form-urlencoded')",
"sim_invalid_token" : "Simulated invalid token error",
"invalid_token" : "Invalid token: %s",
"missing_client_assertion_type" : "Missing client_assertion_type parameter",
"invalid_client_assertion_type" : "Invalid client_assertion_type parameter. Must be 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer'.",
"invalid_jti" : "Invalid 'jti' value",
"invalid_aud" : "Invalid token 'aud' value. Must be '%s'.",
"invalid_token_iss" : "The given iss '%s' does not match the registered client_id '%s'",
"token_expired_registration_token": "Registration token expired",
"invalid_registration_token" : "Invalid registration token: %s",
"invalid_client_details_token" : "Invalid client details token: %s",
"invalid_scope" : 'Invalid scope: "%s".',
"missing_scope" : "Empty scope",
"token_invalid_scope" : "Simulated invalid scope error",
"bad_grant_type" : "Unknown or missing grant_type parameter",
"file_expired" : 'The requested file "%s" is missing or expired',
"file_generation_failed" : "File generation failed",
"only_json_supported" : "Only the JSON format is supported",
"jku_not_whitelisted" : "The provided jku '%s' is different than the one used at registration time (%s)",
"__custom__" : "%s"
},
oauthErrors: { // errorName: defaultMessage
// The request is missing a required parameter, includes an
// unsupported parameter value (other than grant type),
// repeats a parameter, includes multiple credentials,
// utilizes more than one mechanism for authenticating the
// client, or is otherwise malformed.
"invalid_request": "Invalid request",
// Client authentication failed (e.g., unknown client, no
// client authentication included, or unsupported
// authentication method). The authorization server MAY
// return an HTTP 401 (Unauthorized) status code to indicate
// which HTTP authentication schemes are supported. If the
// client attempted to authenticate via the "Authorization"
// request header field, the authorization server MUST
// respond with an HTTP 401 (Unauthorized) status code and
// include the "WWW-Authenticate" response header field
// matching the authentication scheme used by the client.
"invalid_client": "Invalid client",
// The provided authorization grant (e.g., authorization
// code, resource owner credentials) or refresh token is
// invalid, expired, revoked, does not match the redirection
// URI used in the authorization request, or was issued to
// another client.
"invalid_grant": "Invalid grant",
// The authenticated client is not authorized to use this
// authorization grant type.
"unauthorized_client": "Unauthorized client",
// The authorization grant type is not supported by the
// authorization server.
"unsupported_grant_type": "Unsupported grant type",
// The requested scope is invalid, unknown, malformed, or
// exceeds the scope granted by the resource owner.
"invalid_scope": "Invalid scope"
},
// When the "_elements" parameter is used the values are concatenated to
// this array to ensure that required elements are always included.
// Can contain:
// - [element] to match against any resourceType
// - [ResourceType].[element] to mach within a specified resource type
// Note that items below are based on US Core or Argonaut R4 Profiles
requiredElements: [
"resourceType",
"id",
"AllergyIntolerance.patient",
"AllergyIntolerance.substance",
"AllergyIntolerance.status",
"CarePlan.text",
"CarePlan.subject",
"CarePlan.status",
"CarePlan.category",
"CareTeam.subject",
"CareTeam.status",
"CareTeam.category",
// Claim
"Condition.patient",
"Condition.code",
"Condition.category",
"Condition.clinicalStatus",
"Condition.verificationStatus",
"Device.type",
"Device.udicarrier",
"Device.patient",
"DiagnosticReport.status",
"DiagnosticReport.category",
"DiagnosticReport.code",
"DiagnosticReport.subject",
"DiagnosticReport.effectiveDateTime",
"DiagnosticReport.effectivePeriod",
"DiagnosticReport.issued",
"DiagnosticReport.performer",
"DiagnosticReport.result",
"DiagnosticReport.image",
"DiagnosticReport.presentedForm",
"DocumentReference.status",
"DocumentReference.type",
"DocumentReference.category",
"DocumentReference.subject",
"DocumentReference.content",
"Encounter.status",
"Encounter.class",
"Encounter.type",
"Encounter.subject",
// ExplanationOfBenefit
// Group
// ImagingStudy
"MedicationRequest.status",
"MedicationRequest.intent",
"MedicationRequest.medicationCodeableConcept",
"MedicationRequest.medicationReference",
"MedicationRequest.subject",
"MedicationRequest.authoredOn",
"MedicationRequest.requester",
"Organization.active",
"Organization.name",
"Practitioner.identifier",
"Practitioner.name",
"Observation.status",
"Observation.category",
"Observation.code",
"Observation.subject",
"Observation.valueQuantity",
"Observation.valueCodeableConcept",
"Observation.valueString",
"Observation.valueRange",
"Observation.valueRatio",
"Observation.valueSampledData",
"Observation.valueAttachment",
"Observation.valueTime",
"Observation.valueDateTime",
"Observation.valuePeriod",
"Observation.DataAbsentReason",
"Observation.effectiveDateTime",
"Observation.effectivePeriod",
"Observation.referenceRange",
"Immunization.status",
"Immunization.date",
"Immunization.vaccineCode",
"Immunization.patient",
"Immunization.wasNotGiven",
"Immunization.reported",
"Patient.identifier",
"Patient.name",
"Patient.gender",
"Procedure.patient",
"Procedure.status",
"Procedure.code",
"Procedure.performedDateTime",
"Procedure.performedPeriod",
],
// Groups created by users via the FHIR API fill expire in this many days
// and will be automatically deleted after that
customGroupsLifetimeDays: 7,
patientCompartment: [
"Account",
"ActivityDefinition",
"AdverseEvent",
"AllergyIntolerance",
"Appointment",
"AppointmentResponse",
"AuditEvent",
"Basic",
"BodyStructure",
"CarePlan",
"CareTeam",
"ChargeItem",
"Claim",
"ClaimResponse",
"ClinicalImpression",
"Communication",
"CommunicationRequest",
"Composition",
"Condition",
"Consent",
"Coverage",
"CoverageEligibilityRequest",
"CoverageEligibilityResponse",
"DetectedIssue",
"Device",
"DeviceRequest",
"DeviceUseStatement",
"DiagnosticReport",
"DocumentManifest",
"DocumentReference",
"Encounter",
"Endpoint",
"EnrollmentRequest",
"EnrollmentResponse",
"EpisodeOfCare",
"ExplanationOfBenefit",
"FamilyMemberHistory",
"Flag",
"Goal",
"Group",
"ImagingStudy",
"Immunization",
"ImmunizationEvaluation",
"ImmunizationRecommendation",
"Invoice",
"Library",
"Linkage",
"List",
"Location",
"MeasureReport",
"Media",
"Medication",
"MedicationAdministration",
"MedicationDispense",
"MedicationRequest",
"MedicationStatement",
"MolecularSequence",
"NutritionOrder",
"Observation",
"OperationDefinition",
"OperationOutcome",
"Organization",
"Patient",
"PaymentNotice",
"PaymentReconciliation",
"Person",
"PlanDefinition",
"Practitioner",
"PractitionerRole",
"Procedure",
"Provenance",
"Questionnaire",
"QuestionnaireResponse",
"RelatedPerson",
"RequestGroup",
"ResearchSubject",
"RiskAssessment",
"Schedule",
"ServiceRequest",
"Slot",
"Specimen",
"StructureDefinition",
"Subscription",
"Substance",
"SupplyDelivery",
"SupplyRequest",
"Task",
"TerminologyCapabilities",
"TestReport",
"TestScript",
"ValueSet",
"VerificationResult",
"VisionPrescription"
],
practitionerCompartment: [
"Account",
"AllergyIntolerance",
"Appointment",
"AppointmentResponse",
"AuditEvent",
"Basic",
"CarePlan",
"CareTeam",
"ChargeItem",
"Claim",
"ClaimResponse",
"ClinicalImpression",
"Communication",
"CommunicationRequest",
"Condition",
"Coverage",
"CoverageEligibilityRequest",
"CoverageEligibilityResponse",
"DetectedIssue",
"Device",
"DeviceRequest",
"DeviceUseStatement",
"DiagnosticReport",
"DocumentManifest",
"DocumentReference",
"Encounter",
"EnrollmentRequest",
"EnrollmentResponse",
"EpisodeOfCare",
"ExplanationOfBenefit",
"FamilyMemberHistory",
"Flag",
"Goal",
"Group",
"ImagingStudy",
"Immunization",
"ImmunizationEvaluation",
"ImmunizationRecommendation",
"Invoice",
"List",
"Location",
"MeasureReport",
"Media",
"Medication",
"MedicationAdministration",
"MedicationDispense",
"MedicationRequest",
"MedicationStatement",
"NutritionOrder",
"Observation",
"Organization",
"Patient",
"PaymentNotice",
"PaymentReconciliation",
"Person",
"PlanDefinition",
"Practitioner",
"PractitionerRole",
"Procedure",
"Provenance",
"Questionnaire",
"QuestionnaireResponse",
"RelatedPerson",
"RequestGroup",
"ResearchSubject",
"RiskAssessment",
"Schedule",
"ServiceRequest",
"Slot",
"Specimen",
"Subscription",
"Substance",
"SupplyDelivery",
"SupplyRequest",
"Task",
"VisionPrescription"
]
};