@centricare/contract 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/index.cjs +787 -299
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +414 -336
- package/dist/index.d.ts +414 -336
- package/dist/index.mjs +780 -297
- package/dist/index.mjs.map +1 -1
- package/dist/registry/index.cjs +616 -97
- package/dist/registry/index.cjs.map +1 -1
- package/dist/registry/index.mjs +616 -97
- package/dist/registry/index.mjs.map +1 -1
- package/package.json +6 -2
package/dist/index.mjs
CHANGED
|
@@ -28,17 +28,50 @@ var singleResourceResponseSchema = (dataSchema) => apiResponseSchema(dataSchema)
|
|
|
28
28
|
message: "Single resource response metadata must have total=1, offset=0, limit=0, next=null, previous=null"
|
|
29
29
|
}
|
|
30
30
|
);
|
|
31
|
+
var SETTING_OPTIONS_TYPE = [
|
|
32
|
+
// Single input
|
|
33
|
+
"string",
|
|
34
|
+
// Mapped to text input in client
|
|
35
|
+
"number",
|
|
36
|
+
// Mapped to number input in client
|
|
37
|
+
"boolean",
|
|
38
|
+
// Mapped to checkbox/switch in client
|
|
39
|
+
"date",
|
|
40
|
+
// Mapped date picker in client
|
|
41
|
+
"datetime",
|
|
42
|
+
// Mapped datetime picker in client
|
|
43
|
+
"daterange",
|
|
44
|
+
// Mapped date range picker in client
|
|
45
|
+
"image",
|
|
46
|
+
// Mapped to file input (single image only) in client
|
|
47
|
+
// Multiple input
|
|
48
|
+
"strings",
|
|
49
|
+
// Mapped to nested array text input in client
|
|
50
|
+
"numbers",
|
|
51
|
+
// Mapped to nested array number input in client
|
|
52
|
+
"images",
|
|
53
|
+
// Mapped to file input (multiple image) in client
|
|
54
|
+
"keyvals"
|
|
55
|
+
// Mapped to nested array text input pair in client
|
|
56
|
+
];
|
|
31
57
|
var settingOptionTypeSchema = z.union([
|
|
32
|
-
z.enum(
|
|
33
|
-
z.
|
|
34
|
-
z.string()
|
|
58
|
+
z.enum(SETTING_OPTIONS_TYPE),
|
|
59
|
+
z.string(),
|
|
60
|
+
z.string().array()
|
|
35
61
|
]);
|
|
36
62
|
var settingOptionSchema = z.object({
|
|
37
63
|
field: z.string().min(1, { message: "field is required" }),
|
|
38
64
|
label: z.string().optional(),
|
|
39
65
|
type: settingOptionTypeSchema,
|
|
40
66
|
default: z.string().nullable(),
|
|
41
|
-
value: z.union([
|
|
67
|
+
value: z.union([
|
|
68
|
+
z.string(),
|
|
69
|
+
z.boolean(),
|
|
70
|
+
z.number(),
|
|
71
|
+
z.string().array(),
|
|
72
|
+
z.number().array(),
|
|
73
|
+
z.object({ key: z.string(), value: z.string() })
|
|
74
|
+
]).nullable()
|
|
42
75
|
});
|
|
43
76
|
|
|
44
77
|
// src/registry/registry.json
|
|
@@ -52,9 +85,24 @@ var registry_default = {
|
|
|
52
85
|
description: "Status of a record",
|
|
53
86
|
type: "parameter",
|
|
54
87
|
values: [
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
88
|
+
{
|
|
89
|
+
value: "active",
|
|
90
|
+
display: "Active",
|
|
91
|
+
description: "Record is still active and valid",
|
|
92
|
+
status: "Active"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
value: "inactive",
|
|
96
|
+
display: "Inactive",
|
|
97
|
+
description: "Record is no longer active and valid",
|
|
98
|
+
status: "Active"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
value: "suspended",
|
|
102
|
+
display: "Suspended",
|
|
103
|
+
description: "Record is suspended and may not be used or valid until the suspension is over",
|
|
104
|
+
status: "Active"
|
|
105
|
+
}
|
|
58
106
|
]
|
|
59
107
|
},
|
|
60
108
|
{
|
|
@@ -65,8 +113,18 @@ var registry_default = {
|
|
|
65
113
|
description: "Patient-specific status codes",
|
|
66
114
|
type: "parameter",
|
|
67
115
|
values: [
|
|
68
|
-
{
|
|
69
|
-
|
|
116
|
+
{
|
|
117
|
+
value: "blacklisted",
|
|
118
|
+
display: "Blacklisted",
|
|
119
|
+
description: "Patient is blacklisted from the facility",
|
|
120
|
+
status: "Active"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
value: "deceased",
|
|
124
|
+
display: "Deceased",
|
|
125
|
+
description: "Patient is already deceased",
|
|
126
|
+
status: "Active"
|
|
127
|
+
}
|
|
70
128
|
]
|
|
71
129
|
},
|
|
72
130
|
{
|
|
@@ -77,10 +135,30 @@ var registry_default = {
|
|
|
77
135
|
description: "Marital status codes",
|
|
78
136
|
type: "parameter",
|
|
79
137
|
values: [
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
138
|
+
{
|
|
139
|
+
value: "married",
|
|
140
|
+
display: "Married",
|
|
141
|
+
description: "Person is married",
|
|
142
|
+
status: "Active"
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
value: "unmarried",
|
|
146
|
+
display: "Unmarried",
|
|
147
|
+
description: "Person is not married",
|
|
148
|
+
status: "Active"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
value: "widowed",
|
|
152
|
+
display: "Widowed",
|
|
153
|
+
description: "Person is widowed due to the death of their spouse",
|
|
154
|
+
status: "Active"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
value: "divorced",
|
|
158
|
+
display: "Divorced",
|
|
159
|
+
description: "Person is legally divorced",
|
|
160
|
+
status: "Active"
|
|
161
|
+
}
|
|
84
162
|
]
|
|
85
163
|
},
|
|
86
164
|
{
|
|
@@ -91,9 +169,24 @@ var registry_default = {
|
|
|
91
169
|
description: "Resource operational status",
|
|
92
170
|
type: "parameter",
|
|
93
171
|
values: [
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
172
|
+
{
|
|
173
|
+
value: "open",
|
|
174
|
+
display: "Open",
|
|
175
|
+
description: "Resource is open and operating",
|
|
176
|
+
status: "Active"
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
value: "closed",
|
|
180
|
+
display: "Closed",
|
|
181
|
+
description: "Resource is closed and not operating",
|
|
182
|
+
status: "Active"
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
value: "maintenance",
|
|
186
|
+
display: "Maintenance",
|
|
187
|
+
description: "Resource is in maintenance and not operating",
|
|
188
|
+
status: "Active"
|
|
189
|
+
}
|
|
97
190
|
]
|
|
98
191
|
},
|
|
99
192
|
{
|
|
@@ -104,9 +197,30 @@ var registry_default = {
|
|
|
104
197
|
description: "Queue number status",
|
|
105
198
|
type: "parameter",
|
|
106
199
|
values: [
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
200
|
+
{
|
|
201
|
+
value: "idle",
|
|
202
|
+
display: "Idle",
|
|
203
|
+
description: "Queue number are not in progress",
|
|
204
|
+
status: "Active"
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
value: "in-progress",
|
|
208
|
+
display: "In Progress",
|
|
209
|
+
description: "Queue number are in progress",
|
|
210
|
+
status: "Active"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
value: "done",
|
|
214
|
+
display: "Done",
|
|
215
|
+
description: "Queue number are done with service",
|
|
216
|
+
status: "Active"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
value: "skip",
|
|
220
|
+
display: "Skip",
|
|
221
|
+
description: "Indicate the queue number are skipped and at the bottom of call priority",
|
|
222
|
+
status: "Active"
|
|
223
|
+
}
|
|
110
224
|
]
|
|
111
225
|
},
|
|
112
226
|
{
|
|
@@ -117,9 +231,24 @@ var registry_default = {
|
|
|
117
231
|
description: "Person salutations/honorifics",
|
|
118
232
|
type: "parameter",
|
|
119
233
|
values: [
|
|
120
|
-
{
|
|
121
|
-
|
|
122
|
-
|
|
234
|
+
{
|
|
235
|
+
value: "tuan",
|
|
236
|
+
display: "Tn.",
|
|
237
|
+
description: "Adult male honorific or title (Mr.)",
|
|
238
|
+
status: "Active"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
value: "nyonya",
|
|
242
|
+
display: "Ny.",
|
|
243
|
+
description: "Married or adult female honorific or title (Mrs.)",
|
|
244
|
+
status: "Active"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
value: "anak",
|
|
248
|
+
display: "An.",
|
|
249
|
+
description: "Child or pediatric patient honorific",
|
|
250
|
+
status: "Active"
|
|
251
|
+
}
|
|
123
252
|
]
|
|
124
253
|
},
|
|
125
254
|
{
|
|
@@ -130,9 +259,24 @@ var registry_default = {
|
|
|
130
259
|
description: "Biological and physiological characteristics",
|
|
131
260
|
type: "parameter",
|
|
132
261
|
values: [
|
|
133
|
-
{
|
|
134
|
-
|
|
135
|
-
|
|
262
|
+
{
|
|
263
|
+
value: "m",
|
|
264
|
+
display: "Male",
|
|
265
|
+
description: "Male characteristics",
|
|
266
|
+
status: "Active"
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
value: "f",
|
|
270
|
+
display: "Female",
|
|
271
|
+
description: "Female characteristics",
|
|
272
|
+
status: "Active"
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
value: "i",
|
|
276
|
+
display: "Intersex",
|
|
277
|
+
description: "Biological sex characteristics that do not fit typical medical definitions",
|
|
278
|
+
status: "Proposed"
|
|
279
|
+
}
|
|
136
280
|
]
|
|
137
281
|
},
|
|
138
282
|
{
|
|
@@ -143,12 +287,42 @@ var registry_default = {
|
|
|
143
287
|
description: "Religion or belief system",
|
|
144
288
|
type: "parameter",
|
|
145
289
|
values: [
|
|
146
|
-
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
290
|
+
{
|
|
291
|
+
value: "islam",
|
|
292
|
+
display: "Islam",
|
|
293
|
+
description: "The islamic belief system",
|
|
294
|
+
status: "Active"
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
value: "protestantism",
|
|
298
|
+
display: "Protestant",
|
|
299
|
+
description: "The protestantism belief system",
|
|
300
|
+
status: "Active"
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
value: "catholicism",
|
|
304
|
+
display: "Catholic",
|
|
305
|
+
description: "The catholicism belief system",
|
|
306
|
+
status: "Active"
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
value: "hinduism",
|
|
310
|
+
display: "Hindu",
|
|
311
|
+
description: "The hinduism belief system",
|
|
312
|
+
status: "Active"
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
value: "buddhism",
|
|
316
|
+
display: "Buddha",
|
|
317
|
+
description: "The buddhism belief system",
|
|
318
|
+
status: "Active"
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
value: "confucianism",
|
|
322
|
+
display: "Confucian",
|
|
323
|
+
description: "The confucianism belief system",
|
|
324
|
+
status: "Active"
|
|
325
|
+
}
|
|
152
326
|
]
|
|
153
327
|
},
|
|
154
328
|
{
|
|
@@ -159,10 +333,30 @@ var registry_default = {
|
|
|
159
333
|
description: "Blood group types",
|
|
160
334
|
type: "parameter",
|
|
161
335
|
values: [
|
|
162
|
-
{
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
336
|
+
{
|
|
337
|
+
value: "a",
|
|
338
|
+
display: "A",
|
|
339
|
+
description: "Blood group A",
|
|
340
|
+
status: "Active"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
value: "b",
|
|
344
|
+
display: "B",
|
|
345
|
+
description: "Blood group B",
|
|
346
|
+
status: "Active"
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
value: "ab",
|
|
350
|
+
display: "AB",
|
|
351
|
+
description: "Blood group AB",
|
|
352
|
+
status: "Active"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
value: "o",
|
|
356
|
+
display: "O",
|
|
357
|
+
description: "Blood group O",
|
|
358
|
+
status: "Active"
|
|
359
|
+
}
|
|
166
360
|
]
|
|
167
361
|
},
|
|
168
362
|
{
|
|
@@ -173,8 +367,18 @@ var registry_default = {
|
|
|
173
367
|
description: "RhD antigen presence",
|
|
174
368
|
type: "parameter",
|
|
175
369
|
values: [
|
|
176
|
-
{
|
|
177
|
-
|
|
370
|
+
{
|
|
371
|
+
value: "positive",
|
|
372
|
+
display: "Rh-Positive (+)",
|
|
373
|
+
description: "Presence of Rhesus (RhD) antigen",
|
|
374
|
+
status: "Active"
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
value: "negative",
|
|
378
|
+
display: "Rh-Negative (-)",
|
|
379
|
+
description: "Absence of Rhesus (RhD) antigen",
|
|
380
|
+
status: "Active"
|
|
381
|
+
}
|
|
178
382
|
]
|
|
179
383
|
},
|
|
180
384
|
{
|
|
@@ -185,9 +389,24 @@ var registry_default = {
|
|
|
185
389
|
description: "Priority/precedence levels",
|
|
186
390
|
type: "parameter",
|
|
187
391
|
values: [
|
|
188
|
-
{
|
|
189
|
-
|
|
190
|
-
|
|
392
|
+
{
|
|
393
|
+
value: "primary",
|
|
394
|
+
display: "Primary",
|
|
395
|
+
description: "Highest level of priority",
|
|
396
|
+
status: "Active"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
value: "secondary",
|
|
400
|
+
display: "Secondary",
|
|
401
|
+
description: "Secondary level of priority",
|
|
402
|
+
status: "Active"
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
value: "tertiary",
|
|
406
|
+
display: "Tertiary",
|
|
407
|
+
description: "Third-tier or lowest level of priority",
|
|
408
|
+
status: "Active"
|
|
409
|
+
}
|
|
191
410
|
]
|
|
192
411
|
},
|
|
193
412
|
{
|
|
@@ -198,11 +417,36 @@ var registry_default = {
|
|
|
198
417
|
description: "Intensity/severity levels",
|
|
199
418
|
type: "parameter",
|
|
200
419
|
values: [
|
|
201
|
-
{
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
420
|
+
{
|
|
421
|
+
value: "very-low",
|
|
422
|
+
display: "Very Low",
|
|
423
|
+
description: "Minimal or lowest level of intensity",
|
|
424
|
+
status: "Active"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
value: "low",
|
|
428
|
+
display: "Low",
|
|
429
|
+
description: "Minor or low level of intensity",
|
|
430
|
+
status: "Active"
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
value: "medium",
|
|
434
|
+
display: "Medium",
|
|
435
|
+
description: "Moderate or average level of intensity",
|
|
436
|
+
status: "Active"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
value: "high",
|
|
440
|
+
display: "High",
|
|
441
|
+
description: "High or elevated level of intensity",
|
|
442
|
+
status: "Active"
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
value: "very-high",
|
|
446
|
+
display: "Very High",
|
|
447
|
+
description: "Extreme or critical level of intensity",
|
|
448
|
+
status: "Active"
|
|
449
|
+
}
|
|
206
450
|
]
|
|
207
451
|
},
|
|
208
452
|
{
|
|
@@ -213,9 +457,24 @@ var registry_default = {
|
|
|
213
457
|
description: "Medical Record Number separators",
|
|
214
458
|
type: "parameter",
|
|
215
459
|
values: [
|
|
216
|
-
{
|
|
217
|
-
|
|
218
|
-
|
|
460
|
+
{
|
|
461
|
+
value: "dash",
|
|
462
|
+
display: "Dash (-)",
|
|
463
|
+
description: "Use dash as separator",
|
|
464
|
+
status: "Active"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
value: "dot",
|
|
468
|
+
display: "Dot (.)",
|
|
469
|
+
description: "Use dot as separator",
|
|
470
|
+
status: "Active"
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
value: "none",
|
|
474
|
+
display: "None",
|
|
475
|
+
description: "No separator",
|
|
476
|
+
status: "Active"
|
|
477
|
+
}
|
|
219
478
|
]
|
|
220
479
|
},
|
|
221
480
|
{
|
|
@@ -226,11 +485,36 @@ var registry_default = {
|
|
|
226
485
|
description: "Types of patient additional information",
|
|
227
486
|
type: "parameter",
|
|
228
487
|
values: [
|
|
229
|
-
{
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
488
|
+
{
|
|
489
|
+
value: "emergency-contact",
|
|
490
|
+
display: "Emergency Contact",
|
|
491
|
+
description: "Patient emergency contact info",
|
|
492
|
+
status: "Active"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
value: "emergency-address",
|
|
496
|
+
display: "Emergency Address",
|
|
497
|
+
description: "Patient emergency address info",
|
|
498
|
+
status: "Active"
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
value: "relationship",
|
|
502
|
+
display: "Relationship",
|
|
503
|
+
description: "Patient relationship information",
|
|
504
|
+
status: "Active"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
value: "blood-info",
|
|
508
|
+
display: "Blood Information",
|
|
509
|
+
description: "Patient blood information",
|
|
510
|
+
status: "Active"
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
value: "payer",
|
|
514
|
+
display: "Payer Information",
|
|
515
|
+
description: "Patient payer information",
|
|
516
|
+
status: "Active"
|
|
517
|
+
}
|
|
234
518
|
]
|
|
235
519
|
},
|
|
236
520
|
{
|
|
@@ -241,10 +525,30 @@ var registry_default = {
|
|
|
241
525
|
description: "Healthcare payer categories",
|
|
242
526
|
type: "parameter",
|
|
243
527
|
values: [
|
|
244
|
-
{
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
528
|
+
{
|
|
529
|
+
value: "insurance",
|
|
530
|
+
display: "Insurance",
|
|
531
|
+
description: "Third-party health insurance payer",
|
|
532
|
+
status: "Active"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
value: "government",
|
|
536
|
+
display: "Government",
|
|
537
|
+
description: "Government-sponsored health program",
|
|
538
|
+
status: "Active"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
value: "corporate",
|
|
542
|
+
display: "Corporate",
|
|
543
|
+
description: "Company-sponsored health benefit",
|
|
544
|
+
status: "Active"
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
value: "self",
|
|
548
|
+
display: "Self",
|
|
549
|
+
description: "Patient pay out of pocket",
|
|
550
|
+
status: "Active"
|
|
551
|
+
}
|
|
248
552
|
]
|
|
249
553
|
},
|
|
250
554
|
{
|
|
@@ -255,8 +559,40 @@ var registry_default = {
|
|
|
255
559
|
description: "Queue processing stages",
|
|
256
560
|
type: "parameter",
|
|
257
561
|
values: [
|
|
258
|
-
{
|
|
259
|
-
|
|
562
|
+
{
|
|
563
|
+
value: "waiting",
|
|
564
|
+
display: "Waiting",
|
|
565
|
+
description: "Waiting stage",
|
|
566
|
+
status: "Active"
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
value: "processing",
|
|
570
|
+
display: "Processing",
|
|
571
|
+
description: "Processing stage",
|
|
572
|
+
status: "Active"
|
|
573
|
+
}
|
|
574
|
+
]
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
system: "crn:queue:priority",
|
|
578
|
+
domain: "queue",
|
|
579
|
+
variant: "priority",
|
|
580
|
+
display: "Queue Priority",
|
|
581
|
+
description: "Queue sort and call priority",
|
|
582
|
+
type: "parameter",
|
|
583
|
+
values: [
|
|
584
|
+
{
|
|
585
|
+
value: "sequence",
|
|
586
|
+
display: "Sequence",
|
|
587
|
+
description: "Based on queue sequence number",
|
|
588
|
+
status: "Active"
|
|
589
|
+
},
|
|
590
|
+
{
|
|
591
|
+
value: "arrival",
|
|
592
|
+
display: "Arrival",
|
|
593
|
+
description: "Based on queue arrival",
|
|
594
|
+
status: "Active"
|
|
595
|
+
}
|
|
260
596
|
]
|
|
261
597
|
},
|
|
262
598
|
{
|
|
@@ -267,13 +603,48 @@ var registry_default = {
|
|
|
267
603
|
description: "Family relationship types",
|
|
268
604
|
type: "parameter",
|
|
269
605
|
values: [
|
|
270
|
-
{
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
{
|
|
606
|
+
{
|
|
607
|
+
value: "spouse",
|
|
608
|
+
display: "Spouse",
|
|
609
|
+
description: "Partner in a marriage or legal union",
|
|
610
|
+
status: "Active"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
value: "father",
|
|
614
|
+
display: "Father",
|
|
615
|
+
description: "Male parent",
|
|
616
|
+
status: "Active"
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
value: "mother",
|
|
620
|
+
display: "Mother",
|
|
621
|
+
description: "Female parent",
|
|
622
|
+
status: "Active"
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
value: "grandfather",
|
|
626
|
+
display: "Grandfather",
|
|
627
|
+
description: "Father of a person's father or mother",
|
|
628
|
+
status: "Active"
|
|
629
|
+
},
|
|
630
|
+
{
|
|
631
|
+
value: "grandmother",
|
|
632
|
+
display: "Grandmother",
|
|
633
|
+
description: "Mother of a person's father or mother",
|
|
634
|
+
status: "Active"
|
|
635
|
+
},
|
|
636
|
+
{
|
|
637
|
+
value: "grandchildren",
|
|
638
|
+
display: "Grandchildren",
|
|
639
|
+
description: "Child or children of a person's son or daughter",
|
|
640
|
+
status: "Active"
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
value: "children",
|
|
644
|
+
display: "Children",
|
|
645
|
+
description: "Person's offspring or child",
|
|
646
|
+
status: "Active"
|
|
647
|
+
}
|
|
277
648
|
]
|
|
278
649
|
},
|
|
279
650
|
{
|
|
@@ -284,8 +655,18 @@ var registry_default = {
|
|
|
284
655
|
description: "Practitioner schedule types",
|
|
285
656
|
type: "parameter",
|
|
286
657
|
values: [
|
|
287
|
-
{
|
|
288
|
-
|
|
658
|
+
{
|
|
659
|
+
value: "recurring",
|
|
660
|
+
display: "Recurring",
|
|
661
|
+
description: "A recurring schedule",
|
|
662
|
+
status: "Active"
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
value: "one-time",
|
|
666
|
+
display: "One-Time",
|
|
667
|
+
description: "A one-time schedule",
|
|
668
|
+
status: "Active"
|
|
669
|
+
}
|
|
289
670
|
]
|
|
290
671
|
},
|
|
291
672
|
{
|
|
@@ -296,9 +677,24 @@ var registry_default = {
|
|
|
296
677
|
description: "Department classifications",
|
|
297
678
|
type: "parameter",
|
|
298
679
|
values: [
|
|
299
|
-
{
|
|
300
|
-
|
|
301
|
-
|
|
680
|
+
{
|
|
681
|
+
value: "medical",
|
|
682
|
+
display: "Medical",
|
|
683
|
+
description: "Department for medical affair",
|
|
684
|
+
status: "Active"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
value: "administrative",
|
|
688
|
+
display: "Administrative",
|
|
689
|
+
description: "Department for administrative affair",
|
|
690
|
+
status: "Active"
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
value: "operational",
|
|
694
|
+
display: "Operational",
|
|
695
|
+
description: "Department for operational affair",
|
|
696
|
+
status: "Active"
|
|
697
|
+
}
|
|
302
698
|
]
|
|
303
699
|
},
|
|
304
700
|
{
|
|
@@ -309,10 +705,36 @@ var registry_default = {
|
|
|
309
705
|
description: "Unit classifications",
|
|
310
706
|
type: "parameter",
|
|
311
707
|
values: [
|
|
312
|
-
{
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
708
|
+
{
|
|
709
|
+
value: "medical-service",
|
|
710
|
+
display: "Medical Service",
|
|
711
|
+
description: "Unit that provide medical service",
|
|
712
|
+
status: "Active"
|
|
713
|
+
},
|
|
714
|
+
{
|
|
715
|
+
value: "pharmacy",
|
|
716
|
+
display: "Pharmacy",
|
|
717
|
+
description: "Unit for pharmacy",
|
|
718
|
+
status: "Active"
|
|
719
|
+
},
|
|
720
|
+
{
|
|
721
|
+
value: "ancillary",
|
|
722
|
+
display: "Ancillary",
|
|
723
|
+
description: "Unit for ancillary services",
|
|
724
|
+
status: "Active"
|
|
725
|
+
},
|
|
726
|
+
{
|
|
727
|
+
value: "service-counter",
|
|
728
|
+
display: "Service Counter",
|
|
729
|
+
description: "Unit that act as counter for various purposes",
|
|
730
|
+
status: "Active"
|
|
731
|
+
},
|
|
732
|
+
{
|
|
733
|
+
value: "cashier",
|
|
734
|
+
display: "Cashier",
|
|
735
|
+
description: "Unit that act as counter for cashier",
|
|
736
|
+
status: "Active"
|
|
737
|
+
}
|
|
316
738
|
]
|
|
317
739
|
},
|
|
318
740
|
{
|
|
@@ -323,10 +745,30 @@ var registry_default = {
|
|
|
323
745
|
description: "Location classifications",
|
|
324
746
|
type: "parameter",
|
|
325
747
|
values: [
|
|
326
|
-
{
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
748
|
+
{
|
|
749
|
+
value: "building",
|
|
750
|
+
display: "Building",
|
|
751
|
+
description: "A building",
|
|
752
|
+
status: "Active"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
value: "level",
|
|
756
|
+
display: "Level",
|
|
757
|
+
description: "A floor level",
|
|
758
|
+
status: "Active"
|
|
759
|
+
},
|
|
760
|
+
{
|
|
761
|
+
value: "bed",
|
|
762
|
+
display: "Bed",
|
|
763
|
+
description: "A bed",
|
|
764
|
+
status: "Active"
|
|
765
|
+
},
|
|
766
|
+
{
|
|
767
|
+
value: "cabinet",
|
|
768
|
+
display: "Cabinet",
|
|
769
|
+
description: "A cabinet",
|
|
770
|
+
status: "Active"
|
|
771
|
+
}
|
|
330
772
|
]
|
|
331
773
|
},
|
|
332
774
|
{
|
|
@@ -337,9 +779,24 @@ var registry_default = {
|
|
|
337
779
|
description: "Staff classifications",
|
|
338
780
|
type: "parameter",
|
|
339
781
|
values: [
|
|
340
|
-
{
|
|
341
|
-
|
|
342
|
-
|
|
782
|
+
{
|
|
783
|
+
value: "practitioner",
|
|
784
|
+
display: "Practitioner",
|
|
785
|
+
description: "Healthcare practitioner (i.e. Doctor)",
|
|
786
|
+
status: "Active"
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
value: "medical",
|
|
790
|
+
display: "Medical",
|
|
791
|
+
description: "Medical staff (i.e. Nurse, Therapist)",
|
|
792
|
+
status: "Active"
|
|
793
|
+
},
|
|
794
|
+
{
|
|
795
|
+
value: "non-medical",
|
|
796
|
+
display: "Non Medical",
|
|
797
|
+
description: "Non medical staff (i.e. Administrator staff)",
|
|
798
|
+
status: "Active"
|
|
799
|
+
}
|
|
343
800
|
]
|
|
344
801
|
},
|
|
345
802
|
{
|
|
@@ -350,8 +807,18 @@ var registry_default = {
|
|
|
350
807
|
description: "Resource assignment types",
|
|
351
808
|
type: "parameter",
|
|
352
809
|
values: [
|
|
353
|
-
{
|
|
354
|
-
|
|
810
|
+
{
|
|
811
|
+
value: "staff-to-unit",
|
|
812
|
+
display: "Staff to Unit",
|
|
813
|
+
description: "Assignment of staff to a unit",
|
|
814
|
+
status: "Active"
|
|
815
|
+
},
|
|
816
|
+
{
|
|
817
|
+
value: "location-to-unit",
|
|
818
|
+
display: "Location to Unit",
|
|
819
|
+
description: "Assignment of location to a unit",
|
|
820
|
+
status: "Active"
|
|
821
|
+
}
|
|
355
822
|
]
|
|
356
823
|
},
|
|
357
824
|
{
|
|
@@ -362,12 +829,42 @@ var registry_default = {
|
|
|
362
829
|
description: "Person identifier types",
|
|
363
830
|
type: "parameter",
|
|
364
831
|
values: [
|
|
365
|
-
{
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
832
|
+
{
|
|
833
|
+
value: "nik",
|
|
834
|
+
display: "NIK",
|
|
835
|
+
description: "Nomor Induk Kependudukan",
|
|
836
|
+
status: "Active"
|
|
837
|
+
},
|
|
838
|
+
{
|
|
839
|
+
value: "mrn",
|
|
840
|
+
display: "MRN",
|
|
841
|
+
description: "Medical Record Number",
|
|
842
|
+
status: "Active"
|
|
843
|
+
},
|
|
844
|
+
{
|
|
845
|
+
value: "passport",
|
|
846
|
+
display: "Passport Number",
|
|
847
|
+
description: "Passport Number",
|
|
848
|
+
status: "Active"
|
|
849
|
+
},
|
|
850
|
+
{
|
|
851
|
+
value: "str",
|
|
852
|
+
display: "STR",
|
|
853
|
+
description: "Surat Tanda Registrasi by Konsil Kedokteran Indonesia",
|
|
854
|
+
status: "Active"
|
|
855
|
+
},
|
|
856
|
+
{
|
|
857
|
+
value: "sip",
|
|
858
|
+
display: "SIP",
|
|
859
|
+
description: "Surat Izin Praktik by Dinas Kesehatan",
|
|
860
|
+
status: "Active"
|
|
861
|
+
},
|
|
862
|
+
{
|
|
863
|
+
value: "npa",
|
|
864
|
+
display: "NPA",
|
|
865
|
+
description: "Nomor Pokok Anggota by Ikatan Dokter Indonesia",
|
|
866
|
+
status: "Active"
|
|
867
|
+
}
|
|
371
868
|
]
|
|
372
869
|
},
|
|
373
870
|
{
|
|
@@ -378,10 +875,30 @@ var registry_default = {
|
|
|
378
875
|
description: "Method of contacting a person",
|
|
379
876
|
type: "label",
|
|
380
877
|
values: [
|
|
381
|
-
{
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
878
|
+
{
|
|
879
|
+
value: "mobile",
|
|
880
|
+
display: "Mobile",
|
|
881
|
+
description: "Cellular or mobile phone contact number",
|
|
882
|
+
status: "Active"
|
|
883
|
+
},
|
|
884
|
+
{
|
|
885
|
+
value: "phone",
|
|
886
|
+
display: "Phone",
|
|
887
|
+
description: "Landline or primary telephone contact number",
|
|
888
|
+
status: "Active"
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
value: "email",
|
|
892
|
+
display: "Email",
|
|
893
|
+
description: "Electronic mail address for digital communication",
|
|
894
|
+
status: "Active"
|
|
895
|
+
},
|
|
896
|
+
{
|
|
897
|
+
value: "fax",
|
|
898
|
+
display: "Fax",
|
|
899
|
+
description: "Facsimile machine contact number",
|
|
900
|
+
status: "Active"
|
|
901
|
+
}
|
|
385
902
|
]
|
|
386
903
|
},
|
|
387
904
|
{
|
|
@@ -392,9 +909,24 @@ var registry_default = {
|
|
|
392
909
|
description: "System event types",
|
|
393
910
|
type: "parameter",
|
|
394
911
|
values: [
|
|
395
|
-
{
|
|
396
|
-
|
|
397
|
-
|
|
912
|
+
{
|
|
913
|
+
value: "create",
|
|
914
|
+
display: "Create",
|
|
915
|
+
description: "Event triggered when creating a resource",
|
|
916
|
+
status: "Active"
|
|
917
|
+
},
|
|
918
|
+
{
|
|
919
|
+
value: "update",
|
|
920
|
+
display: "Update",
|
|
921
|
+
description: "Event triggered when updating a resource",
|
|
922
|
+
status: "Active"
|
|
923
|
+
},
|
|
924
|
+
{
|
|
925
|
+
value: "delete",
|
|
926
|
+
display: "Delete",
|
|
927
|
+
description: "Event triggered when deleting a resource",
|
|
928
|
+
status: "Active"
|
|
929
|
+
}
|
|
398
930
|
]
|
|
399
931
|
},
|
|
400
932
|
{
|
|
@@ -405,10 +937,30 @@ var registry_default = {
|
|
|
405
937
|
description: "Queue event types",
|
|
406
938
|
type: "parameter",
|
|
407
939
|
values: [
|
|
408
|
-
{
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
940
|
+
{
|
|
941
|
+
value: "called",
|
|
942
|
+
display: "Called",
|
|
943
|
+
description: "Event triggered when calling a queue number",
|
|
944
|
+
status: "Active"
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
value: "skipped",
|
|
948
|
+
display: "Skipped",
|
|
949
|
+
description: "Event triggered when skipping a queue number",
|
|
950
|
+
status: "Active"
|
|
951
|
+
},
|
|
952
|
+
{
|
|
953
|
+
value: "noshow",
|
|
954
|
+
display: "No Show",
|
|
955
|
+
description: "Event triggered when patient fails to show up",
|
|
956
|
+
status: "Active"
|
|
957
|
+
},
|
|
958
|
+
{
|
|
959
|
+
value: "arrived",
|
|
960
|
+
display: "Arrived",
|
|
961
|
+
description: "Event triggered when patient arrives at the location",
|
|
962
|
+
status: "Active"
|
|
963
|
+
}
|
|
412
964
|
]
|
|
413
965
|
}
|
|
414
966
|
]
|
|
@@ -441,11 +993,11 @@ var codedConceptSchema = z.object({
|
|
|
441
993
|
});
|
|
442
994
|
var demographicSchema = z5.object({
|
|
443
995
|
sex: codedConceptSchema,
|
|
444
|
-
religion: codedConceptSchema,
|
|
445
|
-
ethnicity: z5.string().
|
|
446
|
-
marital_status: codedConceptSchema,
|
|
447
|
-
date_of_birth: z5.string(),
|
|
448
|
-
place_of_birth: z5.string().
|
|
996
|
+
religion: codedConceptSchema.nullable(),
|
|
997
|
+
ethnicity: z5.string().nullable(),
|
|
998
|
+
marital_status: codedConceptSchema.nullable(),
|
|
999
|
+
date_of_birth: z5.string().nullable(),
|
|
1000
|
+
place_of_birth: z5.string().nullable()
|
|
449
1001
|
});
|
|
450
1002
|
var addressSchema = z.object({
|
|
451
1003
|
street: z.string().min(1, { message: "street is required" }),
|
|
@@ -460,6 +1012,23 @@ var objectIdSchema = z.string().length(24, {
|
|
|
460
1012
|
}).regex(/^[0-9a-fA-F]{24}$/, {
|
|
461
1013
|
message: "ObjectId must be a valid MongoDB ObjectId (24-character hex string)"
|
|
462
1014
|
});
|
|
1015
|
+
var baseSchema = (version) => z.object({
|
|
1016
|
+
_id: objectIdSchema,
|
|
1017
|
+
created_at: timestampSchema,
|
|
1018
|
+
created_by: z.string().min(1, { message: "created_by is required" }),
|
|
1019
|
+
updated_at: timestampSchema,
|
|
1020
|
+
updated_by: z.string().min(1, { message: "updated_by is required" }),
|
|
1021
|
+
schema_version: z.number().int().positive().default(version)
|
|
1022
|
+
});
|
|
1023
|
+
var baseSchemaWithExpiredAt = (version) => z.object({
|
|
1024
|
+
_id: objectIdSchema,
|
|
1025
|
+
created_at: timestampSchema,
|
|
1026
|
+
created_by: z.string().min(1, { message: "created_by is required" }),
|
|
1027
|
+
updated_at: timestampSchema,
|
|
1028
|
+
updated_by: z.string().min(1, { message: "updated_by is required" }),
|
|
1029
|
+
expired_at: timestampSchema,
|
|
1030
|
+
schema_version: z.number().int().positive().default(version)
|
|
1031
|
+
});
|
|
463
1032
|
var USER_SCHEMA_VERSION = 1;
|
|
464
1033
|
var userSchema = z.object({
|
|
465
1034
|
id: z.string(),
|
|
@@ -521,25 +1090,23 @@ var userMinimalSchema = userSchema.omit({
|
|
|
521
1090
|
|
|
522
1091
|
// src/models/user/user-partial.schema.ts
|
|
523
1092
|
var userPartialSchema = userMinimalSchema.partial();
|
|
524
|
-
var nonEmpty = z.string().min(1, { message: "assigned_to is required" });
|
|
525
1093
|
var ASSIGNMENT_SCHEMA_VERSION = 1;
|
|
526
|
-
var assignmentSchema =
|
|
527
|
-
_id: objectIdSchema,
|
|
1094
|
+
var assignmentSchema = baseSchema(ASSIGNMENT_SCHEMA_VERSION).extend({
|
|
528
1095
|
facility_id: objectIdSchema,
|
|
529
1096
|
type: codedConceptSchema,
|
|
530
1097
|
for: z.string().min(1, { message: "for is required" }),
|
|
531
|
-
assigned_to: z.
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
updated_at: z.string(),
|
|
537
|
-
updated_by: z.string(),
|
|
538
|
-
schema_version: z.number().int().positive().default(ASSIGNMENT_SCHEMA_VERSION)
|
|
1098
|
+
assigned_to: z.array(
|
|
1099
|
+
z.string().min(1, {
|
|
1100
|
+
message: "assigned_to is required"
|
|
1101
|
+
})
|
|
1102
|
+
).min(1)
|
|
539
1103
|
});
|
|
540
1104
|
var AssignmentMongooseSchema = toMongooseSchema(assignmentSchema);
|
|
541
1105
|
var AssignmentModelName = "assignments";
|
|
542
|
-
var AssignmentModel = model(
|
|
1106
|
+
var AssignmentModel = model(
|
|
1107
|
+
AssignmentModelName,
|
|
1108
|
+
AssignmentMongooseSchema
|
|
1109
|
+
);
|
|
543
1110
|
|
|
544
1111
|
// src/models/assignment/assignment-minimal.schema.ts
|
|
545
1112
|
var assignmentMinimalSchema = assignmentSchema.omit({
|
|
@@ -554,16 +1121,10 @@ var assignmentMinimalSchema = assignmentSchema.omit({
|
|
|
554
1121
|
// src/models/assignment/assignment-partial.schema.ts
|
|
555
1122
|
var assignmentPartialSchema = assignmentMinimalSchema.partial();
|
|
556
1123
|
var DEPARTMENT_SCHEMA_VERSION = 1;
|
|
557
|
-
var departmentSchema =
|
|
558
|
-
_id: objectIdSchema,
|
|
1124
|
+
var departmentSchema = baseSchema(DEPARTMENT_SCHEMA_VERSION).extend({
|
|
559
1125
|
facility_id: objectIdSchema,
|
|
560
1126
|
name: z.string().min(1, { message: "name is required" }),
|
|
561
|
-
type: codedConceptSchema
|
|
562
|
-
created_at: z.string(),
|
|
563
|
-
created_by: z.string(),
|
|
564
|
-
updated_at: z.string(),
|
|
565
|
-
updated_by: z.string(),
|
|
566
|
-
schema_version: z.number().int().positive().default(DEPARTMENT_SCHEMA_VERSION)
|
|
1127
|
+
type: codedConceptSchema
|
|
567
1128
|
});
|
|
568
1129
|
var DepartmentMongooseSchema = toMongooseSchema(departmentSchema);
|
|
569
1130
|
var DepartmentModelName = "departments";
|
|
@@ -600,10 +1161,15 @@ var FACILITY_SETTING_FIELDS = [
|
|
|
600
1161
|
"satusehat_org_id",
|
|
601
1162
|
"satusehat_client_id",
|
|
602
1163
|
"satusehat_client_secret",
|
|
1164
|
+
"queue_number_length",
|
|
603
1165
|
"queue_number_separator",
|
|
604
|
-
"
|
|
605
|
-
"
|
|
606
|
-
"
|
|
1166
|
+
"queue_call_threshold",
|
|
1167
|
+
"queue_call_priority",
|
|
1168
|
+
"kiosk_announcements",
|
|
1169
|
+
"kiosk_gallery",
|
|
1170
|
+
"kiosk_faq",
|
|
1171
|
+
"kiosk_services",
|
|
1172
|
+
"payer_types"
|
|
607
1173
|
];
|
|
608
1174
|
var FACILITY_SETTINGS_SCHEMA_VERSION = 1;
|
|
609
1175
|
var facilitySettingsSchema = z.object({
|
|
@@ -620,14 +1186,21 @@ var facilitySettingsSchema = z.object({
|
|
|
620
1186
|
schema_version: z.number().int().positive().default(FACILITY_SETTINGS_SCHEMA_VERSION)
|
|
621
1187
|
});
|
|
622
1188
|
var facilitySettingsKVSchema = z.object({
|
|
623
|
-
branding_logo: z.string().
|
|
624
|
-
satusehat_org_id: z.string().
|
|
625
|
-
satusehat_client_id: z.string().
|
|
626
|
-
satusehat_client_secret: z.string().
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
1189
|
+
branding_logo: z.string().nullable(),
|
|
1190
|
+
satusehat_org_id: z.string().nullable(),
|
|
1191
|
+
satusehat_client_id: z.string().nullable(),
|
|
1192
|
+
satusehat_client_secret: z.string().nullable(),
|
|
1193
|
+
queue_number_length: z.number().int().positive().nullable().default(3),
|
|
1194
|
+
queue_number_separator: z.string().nullable(),
|
|
1195
|
+
queue_call_priority: z.string().default("sequence").refine((data) => validateCode("crn:queue:priority", data), {
|
|
1196
|
+
message: "Invalid CodedConcept: system/value combination not found in registry"
|
|
1197
|
+
}),
|
|
1198
|
+
queue_call_threshold: z.number().int().positive().default(3),
|
|
1199
|
+
kiosk_announcements: z.string().array(),
|
|
1200
|
+
kiosk_gallery: z.url().array(),
|
|
1201
|
+
kiosk_faq: z.object({ key: z.string(), value: z.string() }).array(),
|
|
1202
|
+
kiosk_services: z.object({ key: z.string(), value: z.string() }).array(),
|
|
1203
|
+
payer_types: z.string().array()
|
|
631
1204
|
});
|
|
632
1205
|
|
|
633
1206
|
// src/models/facility/facility-minimal.schema.ts
|
|
@@ -640,8 +1213,7 @@ var facilityMinimalSchema = facilitySchema.omit({
|
|
|
640
1213
|
// src/models/facility/facility-partial.schema.ts
|
|
641
1214
|
var facilityPartialSchema = facilityMinimalSchema.partial();
|
|
642
1215
|
var LOCATION_SCHEMA_VERSION = 1;
|
|
643
|
-
var locationSchema =
|
|
644
|
-
_id: objectIdSchema,
|
|
1216
|
+
var locationSchema = baseSchema(LOCATION_SCHEMA_VERSION).extend({
|
|
645
1217
|
parent_id: objectIdSchema,
|
|
646
1218
|
identifiers: z.array(codedConceptSchema).nonempty({
|
|
647
1219
|
message: "identifiers must contain at least one CodedConcept"
|
|
@@ -653,12 +1225,7 @@ var locationSchema = z.object({
|
|
|
653
1225
|
statuses: z.array(codedConceptSchema).nonempty({
|
|
654
1226
|
message: "statuses must contain at least one CodedConcept"
|
|
655
1227
|
}),
|
|
656
|
-
settings_id: objectIdSchema
|
|
657
|
-
created_at: timestampSchema,
|
|
658
|
-
created_by: z.string(),
|
|
659
|
-
updated_at: timestampSchema,
|
|
660
|
-
updated_by: z.string(),
|
|
661
|
-
schema_version: z.number().int().positive().default(LOCATION_SCHEMA_VERSION)
|
|
1228
|
+
settings_id: objectIdSchema
|
|
662
1229
|
});
|
|
663
1230
|
var LocationMongooseSchema = toMongooseSchema(locationSchema);
|
|
664
1231
|
var LocationModelName = "locations";
|
|
@@ -694,7 +1261,8 @@ var locationMinimalSchema = locationSchema.omit({
|
|
|
694
1261
|
created_at: true,
|
|
695
1262
|
created_by: true,
|
|
696
1263
|
updated_at: true,
|
|
697
|
-
updated_by: true
|
|
1264
|
+
updated_by: true,
|
|
1265
|
+
schema_version: true
|
|
698
1266
|
});
|
|
699
1267
|
|
|
700
1268
|
// src/models/location/location-partial.schema.ts
|
|
@@ -769,28 +1337,26 @@ var organizationMinimalSchema = organizationSchema.omit({
|
|
|
769
1337
|
// src/models/organization/organization-partial.schema.ts
|
|
770
1338
|
var organizationPartialSchema = organizationMinimalSchema.partial();
|
|
771
1339
|
var PATIENT_SCHEMA_VERSION = 1;
|
|
772
|
-
var patientSchema =
|
|
773
|
-
_id: objectIdSchema,
|
|
1340
|
+
var patientSchema = baseSchema(PATIENT_SCHEMA_VERSION).extend({
|
|
774
1341
|
organization_id: objectIdSchema,
|
|
775
1342
|
registering_facility_id: objectIdSchema,
|
|
776
1343
|
identifiers: z.array(codedConceptSchema),
|
|
777
|
-
salutation:
|
|
1344
|
+
salutation: codedConceptSchema,
|
|
778
1345
|
first_name: z.string().min(1, { message: "first_name is required" }),
|
|
779
1346
|
middle_name: z.string().optional(),
|
|
780
1347
|
last_name: z.string().min(1, { message: "last_name is required" }),
|
|
781
1348
|
title: z.string().optional(),
|
|
782
1349
|
image: z.string().optional(),
|
|
783
|
-
demographic: demographicSchema
|
|
1350
|
+
demographic: demographicSchema.extend({
|
|
1351
|
+
place_of_birth: demographicSchema.shape.place_of_birth.unwrap(),
|
|
1352
|
+
date_of_birth: demographicSchema.shape.date_of_birth.unwrap(),
|
|
1353
|
+
marital_status: demographicSchema.shape.marital_status.unwrap()
|
|
1354
|
+
}),
|
|
784
1355
|
statuses: z.array(codedConceptSchema).nonempty({
|
|
785
1356
|
message: "statuses must contain at least one CodedConcept"
|
|
786
1357
|
}),
|
|
787
1358
|
contacts: z.array(codedConceptSchema).optional(),
|
|
788
|
-
address: addressSchema
|
|
789
|
-
created_at: timestampSchema,
|
|
790
|
-
created_by: z.string(),
|
|
791
|
-
updated_at: timestampSchema,
|
|
792
|
-
updated_by: z.string(),
|
|
793
|
-
schema_version: z.number().int().positive().default(PATIENT_SCHEMA_VERSION)
|
|
1359
|
+
address: addressSchema
|
|
794
1360
|
});
|
|
795
1361
|
var PatientMongooseSchema = toMongooseSchema(patientSchema);
|
|
796
1362
|
var PatientModelName = "patients";
|
|
@@ -809,16 +1375,10 @@ var patientMinimalSchema = patientSchema.omit({
|
|
|
809
1375
|
// src/models/patient/patient-partial.schema.ts
|
|
810
1376
|
var patientPartialSchema = patientMinimalSchema.partial();
|
|
811
1377
|
var PATIENT_ADDITIONAL_SCHEMA_VERSION = 1;
|
|
812
|
-
var patientAdditionalSchema =
|
|
813
|
-
id: z.string().uuid({ message: "id must be a valid UUID" }),
|
|
1378
|
+
var patientAdditionalSchema = baseSchema(PATIENT_ADDITIONAL_SCHEMA_VERSION).extend({
|
|
814
1379
|
patient_id: objectIdSchema,
|
|
815
1380
|
type: codedConceptSchema,
|
|
816
|
-
data: z.union([z.object({}), z.array(z.any())])
|
|
817
|
-
created_at: timestampSchema,
|
|
818
|
-
created_by: z.string(),
|
|
819
|
-
updated_at: timestampSchema,
|
|
820
|
-
updated_by: z.string(),
|
|
821
|
-
schema_version: z.number().int().positive().default(PATIENT_ADDITIONAL_SCHEMA_VERSION)
|
|
1381
|
+
data: z.union([z.object({}), z.array(z.any())])
|
|
822
1382
|
});
|
|
823
1383
|
var PatientAdditionalMongooseSchema = toMongooseSchema(patientAdditionalSchema);
|
|
824
1384
|
var PatientAdditionalModelName = "patient_additionals";
|
|
@@ -826,7 +1386,7 @@ var PatientAdditionalModel = model(PatientAdditionalModelName, PatientAdditional
|
|
|
826
1386
|
|
|
827
1387
|
// src/models/patient-additional/patient-additional-minimal.schema.ts
|
|
828
1388
|
var patientAdditionalMinimalSchema = patientAdditionalSchema.omit({
|
|
829
|
-
|
|
1389
|
+
_id: true,
|
|
830
1390
|
created_at: true,
|
|
831
1391
|
created_by: true,
|
|
832
1392
|
updated_at: true,
|
|
@@ -837,20 +1397,14 @@ var patientAdditionalMinimalSchema = patientAdditionalSchema.omit({
|
|
|
837
1397
|
// src/models/patient-additional/patient-additional-partial.schema.ts
|
|
838
1398
|
var patientAdditionalPartialSchema = patientAdditionalMinimalSchema.partial();
|
|
839
1399
|
var STAFF_SCHEMA_VERSION = 1;
|
|
840
|
-
var staffSchema =
|
|
841
|
-
id: z.string().uuid({ message: "id must be a valid UUID" }),
|
|
1400
|
+
var staffSchema = baseSchema(STAFF_SCHEMA_VERSION).extend({
|
|
842
1401
|
team_id: objectIdSchema,
|
|
843
1402
|
user_id: objectIdSchema,
|
|
844
1403
|
type: codedConceptSchema,
|
|
845
1404
|
status: codedConceptSchema,
|
|
846
1405
|
membership_key: z.string().optional(),
|
|
847
1406
|
group: z.string().optional(),
|
|
848
|
-
subspecialist: z.string().optional()
|
|
849
|
-
created_at: timestampSchema,
|
|
850
|
-
created_by: z.string(),
|
|
851
|
-
updated_at: timestampSchema,
|
|
852
|
-
updated_by: z.string(),
|
|
853
|
-
schema_version: z.number().int().positive().default(STAFF_SCHEMA_VERSION)
|
|
1407
|
+
subspecialist: z.string().optional()
|
|
854
1408
|
});
|
|
855
1409
|
var StaffMongooseSchema = toMongooseSchema(staffSchema);
|
|
856
1410
|
var StaffModelName = "staffs";
|
|
@@ -858,7 +1412,7 @@ var StaffModel = model(StaffModelName, StaffMongooseSchema);
|
|
|
858
1412
|
|
|
859
1413
|
// src/models/staff/staff-minimal.schema.ts
|
|
860
1414
|
var staffMinimalSchema = staffSchema.omit({
|
|
861
|
-
|
|
1415
|
+
_id: true,
|
|
862
1416
|
created_at: true,
|
|
863
1417
|
created_by: true,
|
|
864
1418
|
updated_at: true,
|
|
@@ -869,8 +1423,7 @@ var staffMinimalSchema = staffSchema.omit({
|
|
|
869
1423
|
// src/models/staff/staff-partial.schema.ts
|
|
870
1424
|
var staffPartialSchema = staffMinimalSchema.partial();
|
|
871
1425
|
var UNIT_SCHEMA_VERSION = 1;
|
|
872
|
-
var unitSchema =
|
|
873
|
-
_id: objectIdSchema,
|
|
1426
|
+
var unitSchema = baseSchema(UNIT_SCHEMA_VERSION).extend({
|
|
874
1427
|
facility_id: objectIdSchema,
|
|
875
1428
|
department_id: objectIdSchema,
|
|
876
1429
|
name: z.string().min(1, { message: "name is required" }),
|
|
@@ -879,12 +1432,7 @@ var unitSchema = z.object({
|
|
|
879
1432
|
statuses: z.array(codedConceptSchema).nonempty({
|
|
880
1433
|
message: "statuses must contain at least one CodedConcept"
|
|
881
1434
|
}),
|
|
882
|
-
settings_id: objectIdSchema
|
|
883
|
-
created_at: timestampSchema,
|
|
884
|
-
created_by: z.string(),
|
|
885
|
-
updated_at: timestampSchema,
|
|
886
|
-
updated_by: z.string(),
|
|
887
|
-
schema_version: z.number().int().positive().default(UNIT_SCHEMA_VERSION)
|
|
1435
|
+
settings_id: objectIdSchema
|
|
888
1436
|
});
|
|
889
1437
|
var UnitMongooseSchema = toMongooseSchema(unitSchema);
|
|
890
1438
|
var UnitModelName = "units";
|
|
@@ -903,19 +1451,15 @@ var unitMinimalSchema = unitSchema.omit({
|
|
|
903
1451
|
// src/models/unit/unit-partial.schema.ts
|
|
904
1452
|
var unitPartialSchema = unitMinimalSchema.partial();
|
|
905
1453
|
var PRACTITIONER_SCHEDULE_SCHEMA_VERSION = 1;
|
|
906
|
-
var practitionerScheduleSchema =
|
|
1454
|
+
var practitionerScheduleSchema = baseSchema(
|
|
1455
|
+
PRACTITIONER_SCHEDULE_SCHEMA_VERSION
|
|
1456
|
+
).extend({
|
|
907
1457
|
organization_id: objectIdSchema,
|
|
908
1458
|
facility_id: objectIdSchema,
|
|
909
1459
|
staff_id: objectIdSchema,
|
|
910
1460
|
unit_id: objectIdSchema,
|
|
911
1461
|
type: codedConceptSchema,
|
|
912
|
-
day: z.union([z.number(), z.string()]).refine((val) => val != null, { message: "day is required" })
|
|
913
|
-
_id: objectIdSchema,
|
|
914
|
-
created_at: timestampSchema.optional(),
|
|
915
|
-
created_by: z.string().optional(),
|
|
916
|
-
updated_at: timestampSchema.optional(),
|
|
917
|
-
updated_by: z.string().optional(),
|
|
918
|
-
schema_version: z.number().int().positive().default(PRACTITIONER_SCHEDULE_SCHEMA_VERSION)
|
|
1462
|
+
day: z.union([z.number(), z.string()]).refine((val) => val != null, { message: "day is required" })
|
|
919
1463
|
});
|
|
920
1464
|
var PractitionerScheduleMongooseSchema = toMongooseSchema(practitionerScheduleSchema);
|
|
921
1465
|
var PractitionerScheduleModelName = "practitioner_schedules";
|
|
@@ -934,19 +1478,15 @@ var practitionerScheduleMinimalSchema = practitionerScheduleSchema.omit({
|
|
|
934
1478
|
// src/models/practitioner-schedule/practitioner-schedule-partial.schema.ts
|
|
935
1479
|
var practitionerSchedulePartialSchema = practitionerScheduleMinimalSchema.partial();
|
|
936
1480
|
var PRACTITIONER_SESSION_SCHEMA_VERSION = 1;
|
|
937
|
-
var practitionerSessionSchema =
|
|
1481
|
+
var practitionerSessionSchema = baseSchema(
|
|
1482
|
+
PRACTITIONER_SESSION_SCHEMA_VERSION
|
|
1483
|
+
).extend({
|
|
938
1484
|
schedule_id: objectIdSchema,
|
|
939
1485
|
staff_id: objectIdSchema,
|
|
940
1486
|
unit_id: objectIdSchema,
|
|
941
1487
|
start: z.string().min(1, { message: "start is required" }),
|
|
942
1488
|
end: z.string().min(1, { message: "end is required" }),
|
|
943
|
-
max_quota: z.number().int().positive({ message: "max_quota must be a positive integer" })
|
|
944
|
-
_id: objectIdSchema,
|
|
945
|
-
created_at: timestampSchema.optional(),
|
|
946
|
-
created_by: z.string().optional(),
|
|
947
|
-
updated_at: timestampSchema.optional(),
|
|
948
|
-
updated_by: z.string().optional(),
|
|
949
|
-
schema_version: z.number().int().positive().default(PRACTITIONER_SESSION_SCHEMA_VERSION)
|
|
1489
|
+
max_quota: z.number().int().positive({ message: "max_quota must be a positive integer" })
|
|
950
1490
|
});
|
|
951
1491
|
var PractitionerSessionMongooseSchema = toMongooseSchema(practitionerSessionSchema);
|
|
952
1492
|
var PractitionerSessionModelName = "practitioner_sessions";
|
|
@@ -965,17 +1505,11 @@ var practitionerSessionMinimalSchema = practitionerSessionSchema.omit({
|
|
|
965
1505
|
// src/models/practitioner-session/practitioner-session-partial.schema.ts
|
|
966
1506
|
var practitionerSessionPartialSchema = practitionerSessionMinimalSchema.partial();
|
|
967
1507
|
var KSM_SCHEMA_VERSION = 1;
|
|
968
|
-
var ksmSchema =
|
|
969
|
-
id: z.string().uuid({ message: "id must be a valid UUID" }),
|
|
1508
|
+
var ksmSchema = baseSchema(KSM_SCHEMA_VERSION).extend({
|
|
970
1509
|
organization_id: objectIdSchema,
|
|
971
1510
|
facility_id: objectIdSchema,
|
|
972
1511
|
name: z.string().min(1, { message: "name is required" }),
|
|
973
|
-
subspecialist: z.array(z.string()).min(1, { message: "subspecialist is required" })
|
|
974
|
-
created_at: timestampSchema,
|
|
975
|
-
created_by: z.string().min(1, { message: "created_by is required" }),
|
|
976
|
-
updated_at: timestampSchema.nullable(),
|
|
977
|
-
updated_by: z.string().nullable(),
|
|
978
|
-
schema_version: z.number().int().positive().default(KSM_SCHEMA_VERSION)
|
|
1512
|
+
subspecialist: z.array(z.string()).min(1, { message: "subspecialist is required" })
|
|
979
1513
|
});
|
|
980
1514
|
var KsmMongooseSchema = toMongooseSchema(ksmSchema);
|
|
981
1515
|
var KsmModelName = "medical_staff_groups";
|
|
@@ -983,7 +1517,7 @@ var KsmModel = model(KsmModelName, KsmMongooseSchema);
|
|
|
983
1517
|
|
|
984
1518
|
// src/models/ksm/ksm-minimal.schema.ts
|
|
985
1519
|
var ksmMinimalSchema = ksmSchema.omit({
|
|
986
|
-
|
|
1520
|
+
_id: true,
|
|
987
1521
|
created_at: true,
|
|
988
1522
|
created_by: true,
|
|
989
1523
|
updated_at: true,
|
|
@@ -995,8 +1529,7 @@ var ksmMinimalSchema = ksmSchema.omit({
|
|
|
995
1529
|
var ksmPartialSchema = ksmMinimalSchema.partial();
|
|
996
1530
|
var isoDatetimeRegex3 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})$/;
|
|
997
1531
|
var PAYER_SCHEMA_VERSION = 1;
|
|
998
|
-
var payerSchema =
|
|
999
|
-
id: z.string().uuid({ message: "id must be a valid UUID" }),
|
|
1532
|
+
var payerSchema = baseSchema(PAYER_SCHEMA_VERSION).extend({
|
|
1000
1533
|
organization_id: objectIdSchema,
|
|
1001
1534
|
facility_id: objectIdSchema,
|
|
1002
1535
|
code: z.string().min(1, { message: "code is required" }),
|
|
@@ -1031,12 +1564,7 @@ var payerSchema = z.object({
|
|
|
1031
1564
|
),
|
|
1032
1565
|
settings_id: objectIdSchema
|
|
1033
1566
|
})
|
|
1034
|
-
)
|
|
1035
|
-
created_at: timestampSchema,
|
|
1036
|
-
created_by: z.string().min(1, { message: "created_by is required" }),
|
|
1037
|
-
updated_at: timestampSchema,
|
|
1038
|
-
updated_by: z.string().min(1, { message: "updated_by is required" }),
|
|
1039
|
-
schema_version: z.number().int().positive().default(PAYER_SCHEMA_VERSION)
|
|
1567
|
+
)
|
|
1040
1568
|
});
|
|
1041
1569
|
var PayerMongooseSchema = toMongooseSchema(payerSchema);
|
|
1042
1570
|
var PayerModelName = "payers";
|
|
@@ -1094,7 +1622,7 @@ var payerSettingsKVSchema = z.object({
|
|
|
1094
1622
|
|
|
1095
1623
|
// src/models/payer/payer-minimal.schema.ts
|
|
1096
1624
|
var payerMinimalSchema = payerSchema.omit({
|
|
1097
|
-
|
|
1625
|
+
_id: true,
|
|
1098
1626
|
created_at: true,
|
|
1099
1627
|
created_by: true,
|
|
1100
1628
|
updated_at: true,
|
|
@@ -1105,8 +1633,7 @@ var payerMinimalSchema = payerSchema.omit({
|
|
|
1105
1633
|
// src/models/payer/payer-partial.schema.ts
|
|
1106
1634
|
var payerPartialSchema = payerMinimalSchema.partial();
|
|
1107
1635
|
var QUEUE_SCHEMA_VERSION = 1;
|
|
1108
|
-
var queueSchema =
|
|
1109
|
-
id: z.string().uuid({ message: "id must be a valid UUID" }),
|
|
1636
|
+
var queueSchema = baseSchema(QUEUE_SCHEMA_VERSION).extend({
|
|
1110
1637
|
organization_id: objectIdSchema,
|
|
1111
1638
|
facility_id: objectIdSchema,
|
|
1112
1639
|
unit_id: objectIdSchema,
|
|
@@ -1119,70 +1646,15 @@ var queueSchema = z.object({
|
|
|
1119
1646
|
status: codedConceptSchema,
|
|
1120
1647
|
call_count: z.number().int().positive({ message: "call_count must be a positive integer" })
|
|
1121
1648
|
})
|
|
1122
|
-
)
|
|
1123
|
-
created_at: timestampSchema,
|
|
1124
|
-
created_by: z.string().min(1, { message: "created_by is required" }),
|
|
1125
|
-
updated_at: timestampSchema,
|
|
1126
|
-
updated_by: z.string().min(1, { message: "updated_by is required" }),
|
|
1127
|
-
schema_version: z.number().int().positive().default(QUEUE_SCHEMA_VERSION)
|
|
1649
|
+
)
|
|
1128
1650
|
});
|
|
1129
1651
|
var QueueMongooseSchema = toMongooseSchema(queueSchema);
|
|
1130
1652
|
var QueueModelName = "queues";
|
|
1131
1653
|
var QueueModel = model(QueueModelName, QueueMongooseSchema);
|
|
1132
|
-
var QUEUE_SETTING_FIELDS = [
|
|
1133
|
-
"use_header_contact_info",
|
|
1134
|
-
"use_header_bank_info",
|
|
1135
|
-
"use_header_status_info",
|
|
1136
|
-
"rules_drug_formulary",
|
|
1137
|
-
"rules_method",
|
|
1138
|
-
"rules_global_cover_outpatient",
|
|
1139
|
-
"rules_global_cover_emergency",
|
|
1140
|
-
"rules_global_tariff_calculation_date",
|
|
1141
|
-
"rules_global_margin_id",
|
|
1142
|
-
"rules_global_rule_type",
|
|
1143
|
-
"rules_admin_calculate",
|
|
1144
|
-
"rules_admin_min_fee",
|
|
1145
|
-
"rules_admin_max_fee",
|
|
1146
|
-
"rules_admin_before_discount",
|
|
1147
|
-
"rules_admin_covered",
|
|
1148
|
-
"rules_item_restriction_id"
|
|
1149
|
-
];
|
|
1150
|
-
var QUEUE_SETTINGS_SCHEMA_VERSION = 1;
|
|
1151
|
-
var queueSettingsSchema = z.object({
|
|
1152
|
-
_id: objectIdSchema,
|
|
1153
|
-
scope: z.string().min(1),
|
|
1154
|
-
options: z.array(
|
|
1155
|
-
settingOptionSchema.refine(
|
|
1156
|
-
(opt) => QUEUE_SETTING_FIELDS.includes(opt.field),
|
|
1157
|
-
{ message: "Invalid field for queue settings" }
|
|
1158
|
-
)
|
|
1159
|
-
),
|
|
1160
|
-
updated_at: timestampSchema,
|
|
1161
|
-
updated_by: z.string(),
|
|
1162
|
-
schema_version: z.number().int().positive().default(QUEUE_SETTINGS_SCHEMA_VERSION)
|
|
1163
|
-
});
|
|
1164
|
-
var queueSettingsKVSchema = z.object({
|
|
1165
|
-
use_header_contact_info: z.boolean().default(false),
|
|
1166
|
-
use_header_bank_info: z.boolean().default(false),
|
|
1167
|
-
use_header_status_info: z.boolean().default(true),
|
|
1168
|
-
rules_drug_formulary: z.string().optional(),
|
|
1169
|
-
rules_method: z.string().optional(),
|
|
1170
|
-
rules_global_cover_outpatient: z.boolean().default(true),
|
|
1171
|
-
rules_global_cover_emergency: z.boolean().default(true),
|
|
1172
|
-
rules_global_tariff_calculation_date: z.enum(["transaction-date", "billing-date"]).default("transaction-date"),
|
|
1173
|
-
rules_global_margin_id: z.string().optional(),
|
|
1174
|
-
rules_global_rule_type: z.enum(["margin", "plafond"]).default("margin"),
|
|
1175
|
-
rules_admin_calculate: z.boolean().default(false),
|
|
1176
|
-
rules_admin_min_fee: z.number().default(0),
|
|
1177
|
-
rules_admin_max_fee: z.number().default(0),
|
|
1178
|
-
rules_admin_before_discount: z.boolean().default(false),
|
|
1179
|
-
rules_admin_covered: z.boolean().default(true),
|
|
1180
|
-
rules_item_restriction_id: z.string().optional()
|
|
1181
|
-
});
|
|
1182
1654
|
|
|
1183
1655
|
// src/models/queue/queue-minimal.schema.ts
|
|
1184
1656
|
var queueMinimalSchema = queueSchema.omit({
|
|
1185
|
-
|
|
1657
|
+
_id: true,
|
|
1186
1658
|
created_at: true,
|
|
1187
1659
|
created_by: true,
|
|
1188
1660
|
updated_at: true,
|
|
@@ -1193,17 +1665,11 @@ var queueMinimalSchema = queueSchema.omit({
|
|
|
1193
1665
|
// src/models/queue/queue-partial.schema.ts
|
|
1194
1666
|
var queuePartialSchema = queueMinimalSchema.partial();
|
|
1195
1667
|
var QUEUE_EVENT_LOG_SCHEMA_VERSION = 1;
|
|
1196
|
-
var queueEventLogSchema =
|
|
1197
|
-
id: z.string().uuid({ message: "id must be a valid UUID" }),
|
|
1668
|
+
var queueEventLogSchema = baseSchema(QUEUE_EVENT_LOG_SCHEMA_VERSION).extend({
|
|
1198
1669
|
queue_number_id: objectIdSchema,
|
|
1199
1670
|
queue_number: z.string().min(1, { message: "queue_number is required" }),
|
|
1200
1671
|
events: z.array(codedConceptSchema),
|
|
1201
|
-
count: z.number().int().positive({ message: "count must be a positive integer" })
|
|
1202
|
-
created_at: timestampSchema,
|
|
1203
|
-
created_by: z.string().min(1, { message: "created_by is required" }),
|
|
1204
|
-
updated_at: timestampSchema,
|
|
1205
|
-
updated_by: z.string().min(1, { message: "updated_by is required" }),
|
|
1206
|
-
schema_version: z.number().int().positive().default(QUEUE_EVENT_LOG_SCHEMA_VERSION)
|
|
1672
|
+
count: z.number().int().positive({ message: "count must be a positive integer" })
|
|
1207
1673
|
});
|
|
1208
1674
|
var QueueEventLogMongooseSchema = toMongooseSchema(queueEventLogSchema);
|
|
1209
1675
|
var QueueEventLogModelName = "queue_event_logs";
|
|
@@ -1211,7 +1677,7 @@ var QueueEventLogModel = model(QueueEventLogModelName, QueueEventLogMongooseSche
|
|
|
1211
1677
|
|
|
1212
1678
|
// src/models/queue-event-log/queue-event-log-minimal.schema.ts
|
|
1213
1679
|
var queueEventLogMinimalSchema = queueEventLogSchema.omit({
|
|
1214
|
-
|
|
1680
|
+
_id: true,
|
|
1215
1681
|
created_at: true,
|
|
1216
1682
|
created_by: true,
|
|
1217
1683
|
updated_at: true,
|
|
@@ -1223,8 +1689,9 @@ var queueEventLogMinimalSchema = queueEventLogSchema.omit({
|
|
|
1223
1689
|
var queueEventLogPartialSchema = queueEventLogMinimalSchema.partial();
|
|
1224
1690
|
var isoDatetimeRegex4 = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:?\d{2})$/;
|
|
1225
1691
|
var QUEUE_NUMBER_SCHEMA_VERSION = 1;
|
|
1226
|
-
var queueNumberSchema =
|
|
1227
|
-
|
|
1692
|
+
var queueNumberSchema = baseSchemaWithExpiredAt(
|
|
1693
|
+
QUEUE_NUMBER_SCHEMA_VERSION
|
|
1694
|
+
).extend({
|
|
1228
1695
|
organization_id: objectIdSchema,
|
|
1229
1696
|
facility_id: objectIdSchema,
|
|
1230
1697
|
patient_id: objectIdSchema,
|
|
@@ -1239,15 +1706,7 @@ var queueNumberSchema = z.object({
|
|
|
1239
1706
|
}),
|
|
1240
1707
|
sequence: z.number().int().positive({ message: "sequence must be a positive integer" }),
|
|
1241
1708
|
prefix: z.string().min(1, { message: "prefix is required" }),
|
|
1242
|
-
number: z.string().min(1, { message: "number is required" })
|
|
1243
|
-
created_at: timestampSchema,
|
|
1244
|
-
created_by: z.string().min(1, { message: "created_by is required" }),
|
|
1245
|
-
updated_at: timestampSchema,
|
|
1246
|
-
updated_by: z.string().min(1, { message: "updated_by is required" }),
|
|
1247
|
-
expired_at: z.string().refine((val) => isoDatetimeRegex4.test(val), {
|
|
1248
|
-
message: "expired_at must be a valid ISO 8601 datetime"
|
|
1249
|
-
}),
|
|
1250
|
-
schema_version: z.number().int().positive().default(QUEUE_NUMBER_SCHEMA_VERSION)
|
|
1709
|
+
number: z.string().min(1, { message: "number is required" })
|
|
1251
1710
|
});
|
|
1252
1711
|
var QueueNumberMongooseSchema = toMongooseSchema(queueNumberSchema);
|
|
1253
1712
|
var QueueNumberModelName = "queue_numbers";
|
|
@@ -1308,7 +1767,7 @@ var queueNumberSettingsKVSchema = z.object({
|
|
|
1308
1767
|
|
|
1309
1768
|
// src/models/queue-number/queue-number-minimal.schema.ts
|
|
1310
1769
|
var queueNumberMinimalSchema = queueNumberSchema.omit({
|
|
1311
|
-
|
|
1770
|
+
_id: true,
|
|
1312
1771
|
created_at: true,
|
|
1313
1772
|
created_by: true,
|
|
1314
1773
|
updated_at: true,
|
|
@@ -1319,7 +1778,31 @@ var queueNumberMinimalSchema = queueNumberSchema.omit({
|
|
|
1319
1778
|
|
|
1320
1779
|
// src/models/queue-number/queue-number-partial.schema.ts
|
|
1321
1780
|
var queueNumberPartialSchema = queueNumberMinimalSchema.partial();
|
|
1781
|
+
var ARTICLE_SCHEMA_VERSION = 1;
|
|
1782
|
+
var articleSchema = baseSchema(ARTICLE_SCHEMA_VERSION).extend({
|
|
1783
|
+
facility_id: objectIdSchema,
|
|
1784
|
+
title: z.string().min(1, { message: "for is required" }),
|
|
1785
|
+
banner: z.url(),
|
|
1786
|
+
body: z.string(),
|
|
1787
|
+
status: codedConceptSchema
|
|
1788
|
+
});
|
|
1789
|
+
var ArticleMongooseSchema = toMongooseSchema(articleSchema);
|
|
1790
|
+
var ArticleModelName = "articles";
|
|
1791
|
+
var ArticleModel = model(ArticleModelName, ArticleMongooseSchema);
|
|
1792
|
+
|
|
1793
|
+
// src/models/article/article-minimal.schema.ts
|
|
1794
|
+
var articleMinimalSchema = articleSchema.omit({
|
|
1795
|
+
_id: true,
|
|
1796
|
+
created_at: true,
|
|
1797
|
+
created_by: true,
|
|
1798
|
+
updated_at: true,
|
|
1799
|
+
updated_by: true,
|
|
1800
|
+
schema_version: true
|
|
1801
|
+
});
|
|
1802
|
+
|
|
1803
|
+
// src/models/article/article-partial.schema.ts
|
|
1804
|
+
var articlePartialSchema = articleMinimalSchema.partial();
|
|
1322
1805
|
|
|
1323
|
-
export { ASSIGNMENT_SCHEMA_VERSION, AssignmentModel, AssignmentMongooseSchema, DEPARTMENT_SCHEMA_VERSION, DepartmentModel, DepartmentMongooseSchema, FACILITY_SCHEMA_VERSION, FACILITY_SETTINGS_SCHEMA_VERSION, FacilityModel, FacilityMongooseSchema, KSM_SCHEMA_VERSION, KsmModel, KsmMongooseSchema, LOCATION_SCHEMA_VERSION, LOCATION_SETTINGS_SCHEMA_VERSION, LocationModel, LocationMongooseSchema, MEMBER_SCHEMA_VERSION, MemberModel, MemberMongooseSchema, ORGANIZATION_SCHEMA_VERSION, ORGANIZATION_SETTINGS_SCHEMA_VERSION, OrganizationModel, OrganizationMongooseSchema, PATIENT_ADDITIONAL_SCHEMA_VERSION, PATIENT_SCHEMA_VERSION, PAYER_SCHEMA_VERSION, PAYER_SETTINGS_SCHEMA_VERSION, PRACTITIONER_SCHEDULE_SCHEMA_VERSION, PRACTITIONER_SESSION_SCHEMA_VERSION, PatientAdditionalModel, PatientAdditionalMongooseSchema, PatientModel, PatientMongooseSchema, PayerModel, PayerMongooseSchema, PractitionerScheduleModel, PractitionerScheduleMongooseSchema, PractitionerSessionModel, PractitionerSessionMongooseSchema, QUEUE_EVENT_LOG_SCHEMA_VERSION, QUEUE_NUMBER_SCHEMA_VERSION, QUEUE_NUMBER_SETTINGS_SCHEMA_VERSION, QUEUE_SCHEMA_VERSION,
|
|
1806
|
+
export { ARTICLE_SCHEMA_VERSION, ASSIGNMENT_SCHEMA_VERSION, ArticleModel, ArticleMongooseSchema, AssignmentModel, AssignmentMongooseSchema, DEPARTMENT_SCHEMA_VERSION, DepartmentModel, DepartmentMongooseSchema, FACILITY_SCHEMA_VERSION, FACILITY_SETTINGS_SCHEMA_VERSION, FacilityModel, FacilityMongooseSchema, KSM_SCHEMA_VERSION, KsmModel, KsmMongooseSchema, LOCATION_SCHEMA_VERSION, LOCATION_SETTINGS_SCHEMA_VERSION, LocationModel, LocationMongooseSchema, MEMBER_SCHEMA_VERSION, MemberModel, MemberMongooseSchema, ORGANIZATION_SCHEMA_VERSION, ORGANIZATION_SETTINGS_SCHEMA_VERSION, OrganizationModel, OrganizationMongooseSchema, PATIENT_ADDITIONAL_SCHEMA_VERSION, PATIENT_SCHEMA_VERSION, PAYER_SCHEMA_VERSION, PAYER_SETTINGS_SCHEMA_VERSION, PRACTITIONER_SCHEDULE_SCHEMA_VERSION, PRACTITIONER_SESSION_SCHEMA_VERSION, PatientAdditionalModel, PatientAdditionalMongooseSchema, PatientModel, PatientMongooseSchema, PayerModel, PayerMongooseSchema, PractitionerScheduleModel, PractitionerScheduleMongooseSchema, PractitionerSessionModel, PractitionerSessionMongooseSchema, QUEUE_EVENT_LOG_SCHEMA_VERSION, QUEUE_NUMBER_SCHEMA_VERSION, QUEUE_NUMBER_SETTINGS_SCHEMA_VERSION, QUEUE_SCHEMA_VERSION, QueueEventLogModel, QueueEventLogMongooseSchema, QueueModel, QueueMongooseSchema, QueueNumberModel, QueueNumberMongooseSchema, STAFF_SCHEMA_VERSION, StaffModel, StaffMongooseSchema, UNIT_SCHEMA_VERSION, USER_SCHEMA_VERSION, USER_SETTINGS_SCHEMA_VERSION, UnitModel, UnitMongooseSchema, UserModel, UserMongooseSchema, addressSchema, apiResponseSchema, articleMinimalSchema, articlePartialSchema, articleSchema, assignmentMinimalSchema, assignmentPartialSchema, assignmentSchema, baseSchema, baseSchemaWithExpiredAt, codedConceptSchema, demographicSchema, departmentMinimalSchema, departmentPartialSchema, departmentSchema, facilityMinimalSchema, facilityPartialSchema, facilitySchema, facilitySettingsKVSchema, facilitySettingsSchema, ksmMinimalSchema, ksmPartialSchema, ksmSchema, locationMinimalSchema, locationPartialSchema, locationSchema, locationSettingsKVSchema, locationSettingsSchema, memberMinimalSchema, memberPartialSchema, memberSchema, metadataSchema, objectIdSchema, organizationMinimalSchema, organizationPartialSchema, organizationSchema, organizationSettingsKVSchema, organizationSettingsSchema, patientAdditionalMinimalSchema, patientAdditionalPartialSchema, patientAdditionalSchema, patientMinimalSchema, patientPartialSchema, patientSchema, payerMinimalSchema, payerPartialSchema, payerSchema, payerSettingsKVSchema, payerSettingsSchema, practitionerScheduleMinimalSchema, practitionerSchedulePartialSchema, practitionerScheduleSchema, practitionerSessionMinimalSchema, practitionerSessionPartialSchema, practitionerSessionSchema, queueEventLogMinimalSchema, queueEventLogPartialSchema, queueEventLogSchema, queueMinimalSchema, queueNumberMinimalSchema, queueNumberPartialSchema, queueNumberSchema, queueNumberSettingsKVSchema, queueNumberSettingsSchema, queuePartialSchema, queueSchema, settingOptionSchema, settingOptionTypeSchema, singleResourceResponseSchema, staffMinimalSchema, staffPartialSchema, staffSchema, timestampSchema, unitMinimalSchema, unitPartialSchema, unitSchema, userMinimalSchema, userPartialSchema, userSchema, userSettingsKVSchema, userSettingsSchema };
|
|
1324
1807
|
//# sourceMappingURL=index.mjs.map
|
|
1325
1808
|
//# sourceMappingURL=index.mjs.map
|