@htilabs/platform-common-models 0.1.0-beta.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.
Files changed (48) hide show
  1. package/dist/constants/index.cjs +1379 -0
  2. package/dist/constants/index.cjs.map +1 -0
  3. package/dist/constants/index.d.cts +528 -0
  4. package/dist/constants/index.d.ts +528 -0
  5. package/dist/constants/index.js +1252 -0
  6. package/dist/constants/index.js.map +1 -0
  7. package/dist/index.cjs +2138 -0
  8. package/dist/index.cjs.map +1 -0
  9. package/dist/index.d.cts +5 -0
  10. package/dist/index.d.ts +5 -0
  11. package/dist/index.js +1986 -0
  12. package/dist/index.js.map +1 -0
  13. package/dist/models/index.cjs +661 -0
  14. package/dist/models/index.cjs.map +1 -0
  15. package/dist/models/index.d.cts +204 -0
  16. package/dist/models/index.d.ts +204 -0
  17. package/dist/models/index.js +636 -0
  18. package/dist/models/index.js.map +1 -0
  19. package/dist/schemas/index.cjs +1405 -0
  20. package/dist/schemas/index.cjs.map +1 -0
  21. package/dist/schemas/index.d.cts +312 -0
  22. package/dist/schemas/index.d.ts +312 -0
  23. package/dist/schemas/index.js +1353 -0
  24. package/dist/schemas/index.js.map +1 -0
  25. package/dist/scoring-rule-BOkG46I3.d.cts +1179 -0
  26. package/dist/scoring-rule-BOkG46I3.d.ts +1179 -0
  27. package/dist/types/index.cjs +19 -0
  28. package/dist/types/index.cjs.map +1 -0
  29. package/dist/types/index.d.cts +1 -0
  30. package/dist/types/index.d.ts +1 -0
  31. package/dist/types/index.js +1 -0
  32. package/dist/types/index.js.map +1 -0
  33. package/package.json +81 -0
  34. package/src/constants/ic.ts +1630 -0
  35. package/src/constants/index.ts +11 -0
  36. package/src/index.ts +30 -0
  37. package/src/models/formModel.ts +30 -0
  38. package/src/models/index.ts +72 -0
  39. package/src/models/questionModel.ts +30 -0
  40. package/src/models/scoringRuleModel.ts +33 -0
  41. package/src/models/sectionModel.ts +30 -0
  42. package/src/schemas/common.ts +118 -0
  43. package/src/schemas/form.ts +125 -0
  44. package/src/schemas/index.ts +70 -0
  45. package/src/schemas/question.ts +297 -0
  46. package/src/schemas/scoring-rule.ts +169 -0
  47. package/src/schemas/section.ts +158 -0
  48. package/src/types/index.ts +47 -0
package/dist/index.cjs ADDED
@@ -0,0 +1,2138 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ ACCOMMODATION_LABELS: () => ACCOMMODATION_LABELS,
24
+ ACCOMMODATION_OPTIONS: () => ACCOMMODATION_OPTIONS,
25
+ AGE_BIN_REPORTING: () => AGE_BIN_REPORTING,
26
+ AGE_BIN_REPORTING_IS_MINOR: () => AGE_BIN_REPORTING_IS_MINOR,
27
+ AGE_BIN_REPORTING_LABELS: () => AGE_BIN_REPORTING_LABELS,
28
+ APPARENT_AGE: () => APPARENT_AGE,
29
+ APPARENT_AGE_LABELS: () => APPARENT_AGE_LABELS,
30
+ APP_SCOPE: () => APP_SCOPE,
31
+ CALLER_IS_VICTIM_ROLES: () => CALLER_IS_VICTIM_ROLES,
32
+ DATA_QUALITY: () => DATA_QUALITY,
33
+ DATA_QUALITY_DESCRIPTIONS: () => DATA_QUALITY_DESCRIPTIONS,
34
+ DATA_QUALITY_LABELS: () => DATA_QUALITY_LABELS,
35
+ DATA_QUALITY_VALUES: () => DATA_QUALITY_VALUES,
36
+ DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY: () => DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY,
37
+ FORM_STATUS: () => FORM_STATUS,
38
+ FORM_STATUS_LABELS: () => FORM_STATUS_LABELS,
39
+ FORM_TYPE: () => FORM_TYPE,
40
+ FORM_TYPE_LABELS: () => FORM_TYPE_LABELS,
41
+ IC_13_CATEGORIES: () => IC_13_CATEGORIES,
42
+ IC_13_CATEGORY_ORDER: () => IC_13_CATEGORY_ORDER,
43
+ IC_13_LABELS: () => IC_13_LABELS,
44
+ IC_13_PRIORITY_GROUPS: () => IC_13_PRIORITY_GROUPS,
45
+ IC_13_RELATIONSHIP_ABBREV: () => IC_13_RELATIONSHIP_ABBREV,
46
+ IC_13_RELATIONSHIP_TYPE: () => IC_13_RELATIONSHIP_TYPE,
47
+ IC_13_REVERSE_CONTEXT_LABELS: () => IC_13_REVERSE_CONTEXT_LABELS,
48
+ IC_22_CORE_SEX: () => IC_22_CORE_SEX,
49
+ IC_22_LABELS: () => IC_22_LABELS,
50
+ IC_23_CORE_GENDER_IDENTITY: () => IC_23_CORE_GENDER_IDENTITY,
51
+ IC_23_LABELS: () => IC_23_LABELS,
52
+ IC_24_LABELS: () => IC_24_LABELS,
53
+ IC_24_RACE: () => IC_24_RACE,
54
+ IC_25_ETHNICITY: () => IC_25_ETHNICITY,
55
+ IC_25_LABELS: () => IC_25_LABELS,
56
+ IC_48_SERVICE_CATEGORIES: () => IC_48_SERVICE_CATEGORIES,
57
+ IC_49_DESCRIPTIONS: () => IC_49_DESCRIPTIONS,
58
+ IC_49_LABELS: () => IC_49_LABELS,
59
+ IC_49_REFERRAL_OUTCOME: () => IC_49_REFERRAL_OUTCOME,
60
+ IC_49_REFERRAL_OUTCOME_LABELS: () => IC_49_REFERRAL_OUTCOME_LABELS,
61
+ IC_49_REFERRAL_VERIFICATION: () => IC_49_REFERRAL_VERIFICATION,
62
+ IC_49_REFERRAL_VERIFICATION_LABELS: () => IC_49_REFERRAL_VERIFICATION_LABELS,
63
+ IC_49_SERVICE_MECHANISM: () => IC_49_SERVICE_MECHANISM,
64
+ IC_4_AGE_TYPE: () => IC_4_AGE_TYPE,
65
+ IC_4_LABELS: () => IC_4_LABELS,
66
+ IC_56_DESCRIPTIONS: () => IC_56_DESCRIPTIONS,
67
+ IC_56_LABELS: () => IC_56_LABELS,
68
+ IC_56_SERVICE_DELIVERY_CHANNEL: () => IC_56_SERVICE_DELIVERY_CHANNEL,
69
+ IC_57_LABELS: () => IC_57_LABELS,
70
+ IC_57_SERVICE_AUDIENCE: () => IC_57_SERVICE_AUDIENCE,
71
+ IC_58_EXTERNAL_TIERED: () => IC_58_EXTERNAL_TIERED,
72
+ IC_58_LABELS: () => IC_58_LABELS,
73
+ IC_58_ORG_TYPE_GROUPS: () => IC_58_ORG_TYPE_GROUPS,
74
+ IC_58_PRIMARY_BRANCHES: () => IC_58_PRIMARY_BRANCHES,
75
+ IC_58_REFERRAL_ENTITY: () => IC_58_REFERRAL_ENTITY,
76
+ IC_59_LABELS: () => IC_59_LABELS,
77
+ IC_59_SERVICE_STATE: () => IC_59_SERVICE_STATE,
78
+ IC_5_FULL_LABELS: () => IC_5_FULL_LABELS,
79
+ IC_5_LABELS: () => IC_5_LABELS,
80
+ IC_5_VICTIMIZATION: () => IC_5_VICTIMIZATION,
81
+ INCIDENT_INVOLVEMENT_ROLE: () => INCIDENT_INVOLVEMENT_ROLE,
82
+ INCIDENT_INVOLVEMENT_ROLE_LABELS: () => INCIDENT_INVOLVEMENT_ROLE_LABELS,
83
+ INCIDENT_INVOLVEMENT_ROLE_TO_PERSON_ROLE: () => INCIDENT_INVOLVEMENT_ROLE_TO_PERSON_ROLE,
84
+ INCIDENT_PARTICIPATION_ROLE: () => INCIDENT_PARTICIPATION_ROLE,
85
+ INCIDENT_PARTICIPATION_ROLE_LABELS: () => INCIDENT_PARTICIPATION_ROLE_LABELS,
86
+ INCIDENT_PARTICIPATION_ROLE_VALUES: () => INCIDENT_PARTICIPATION_ROLE_VALUES,
87
+ INTERACTION_TYPES: () => INTERACTION_TYPES,
88
+ INTERACTION_TYPE_LABELS: () => INTERACTION_TYPE_LABELS,
89
+ INVOLVEMENT_ROLE_TO_PERSON_TYPE: () => INVOLVEMENT_ROLE_TO_PERSON_TYPE,
90
+ MINOR_ADULT_STATUS: () => MINOR_ADULT_STATUS,
91
+ MINOR_ADULT_STATUS_LABELS: () => MINOR_ADULT_STATUS_LABELS,
92
+ PARTICIPATION_ROLE_CATEGORIES: () => PARTICIPATION_ROLE_CATEGORIES,
93
+ PERSON_DISPLAY_CATEGORY: () => PERSON_DISPLAY_CATEGORY,
94
+ PERSON_DISPLAY_CATEGORY_LABELS: () => PERSON_DISPLAY_CATEGORY_LABELS,
95
+ PERSON_ROLES: () => PERSON_ROLES,
96
+ PERSON_TYPE: () => PERSON_TYPE,
97
+ PERSON_TYPE_VALUES: () => PERSON_TYPE_VALUES,
98
+ QUESTION_FORMAT: () => QUESTION_FORMAT,
99
+ QUESTION_FORMAT_LABELS: () => QUESTION_FORMAT_LABELS,
100
+ QUICK_START_CONFIG: () => QUICK_START_CONFIG,
101
+ QUICK_START_LABELS: () => QUICK_START_LABELS,
102
+ QUICK_START_TEMPLATES: () => QUICK_START_TEMPLATES,
103
+ RECORD_STATES: () => RECORD_STATES,
104
+ RECORD_STATE_LABELS: () => RECORD_STATE_LABELS,
105
+ RELATIONSHIP_CONCERNS: () => RELATIONSHIP_CONCERNS,
106
+ RELATIONSHIP_CONCERNS_LABELS: () => RELATIONSHIP_CONCERNS_LABELS,
107
+ RELATIONSHIP_CONCERNS_VALUES: () => RELATIONSHIP_CONCERNS_VALUES,
108
+ RELATIONSHIP_DYNAMICS: () => RELATIONSHIP_DYNAMICS,
109
+ RELATIONSHIP_DYNAMICS_LABELS: () => RELATIONSHIP_DYNAMICS_LABELS,
110
+ RELATIONSHIP_DYNAMICS_VALUES: () => RELATIONSHIP_DYNAMICS_VALUES,
111
+ SESSION_STATES: () => SESSION_STATES,
112
+ SESSION_STATE_LABELS: () => SESSION_STATE_LABELS,
113
+ SUBMISSION_STATES: () => SUBMISSION_STATES,
114
+ SUBMISSION_STATE_LABELS: () => SUBMISSION_STATE_LABELS,
115
+ THREAD_INVOLVEMENT_ROLES: () => THREAD_INVOLVEMENT_ROLES,
116
+ USER_STATUS: () => USER_STATUS,
117
+ USER_STATUS_LABELS: () => USER_STATUS_LABELS,
118
+ VALID_INTERACTION_TYPES: () => VALID_INTERACTION_TYPES,
119
+ VALID_RECORD_STATES: () => VALID_RECORD_STATES,
120
+ addressSchema: () => addressSchema,
121
+ buildFormSchema: () => buildFormSchema,
122
+ buildQuestionSchema: () => buildQuestionSchema,
123
+ buildScoringRuleSchema: () => buildScoringRuleSchema,
124
+ buildSectionSchema: () => buildSectionSchema,
125
+ choiceSchema: () => choiceSchema,
126
+ createPlatformModels: () => createPlatformModels,
127
+ demographicsSchema: () => demographicsSchema,
128
+ deriveAgeBinFromAge: () => deriveAgeBinFromAge,
129
+ emailSchema: () => emailSchema,
130
+ formModel: () => formModel_exports,
131
+ formSchemaDefinition: () => formSchemaDefinition,
132
+ formSchemaOptions: () => formSchemaOptions,
133
+ formSectionRefSchema: () => formSectionRefSchema,
134
+ getDisplayCategoryForRole: () => getDisplayCategoryForRole,
135
+ getPersonTypeForRole: () => getPersonTypeForRole,
136
+ guidanceSchema: () => guidanceSchema,
137
+ layoutSchema: () => layoutSchema,
138
+ personNameSchema: () => personNameSchema,
139
+ phoneSchema: () => phoneSchema,
140
+ questionModel: () => questionModel_exports,
141
+ questionSchemaDefinition: () => questionSchemaDefinition,
142
+ questionSchemaOptions: () => questionSchemaOptions,
143
+ scoringConditionSchema: () => scoringConditionSchema,
144
+ scoringRecommendationSchema: () => scoringRecommendationSchema,
145
+ scoringRuleModel: () => scoringRuleModel_exports,
146
+ scoringRuleSchemaDefinition: () => scoringRuleSchemaDefinition,
147
+ scoringRuleSchemaOptions: () => scoringRuleSchemaOptions,
148
+ scoringThresholdSchema: () => scoringThresholdSchema,
149
+ sectionModel: () => sectionModel_exports,
150
+ sectionQuestionRefSchema: () => sectionQuestionRefSchema,
151
+ sectionSchemaDefinition: () => sectionSchemaDefinition,
152
+ sectionSchemaOptions: () => sectionSchemaOptions,
153
+ sortRelationshipsByPriority: () => sortRelationshipsByPriority,
154
+ visibilityRuleSchema: () => visibilityRuleSchema
155
+ });
156
+ module.exports = __toCommonJS(src_exports);
157
+
158
+ // src/constants/ic.ts
159
+ var DATA_QUALITY = {
160
+ /** Client does not know the answer. */
161
+ CLIENT_DOESNT_KNOW: "client_doesnt_know",
162
+ /** Client explicitly declined to provide the information. */
163
+ CLIENT_PREFERS_NOT_TO_ANSWER: "client_prefers_not_to_answer",
164
+ /** Data was not collected during this interaction. */
165
+ DATA_NOT_COLLECTED: "data_not_collected"
166
+ };
167
+ var DATA_QUALITY_VALUES = [
168
+ DATA_QUALITY.CLIENT_DOESNT_KNOW,
169
+ DATA_QUALITY.CLIENT_PREFERS_NOT_TO_ANSWER,
170
+ DATA_QUALITY.DATA_NOT_COLLECTED
171
+ ];
172
+ var DATA_QUALITY_LABELS = {
173
+ [DATA_QUALITY.CLIENT_DOESNT_KNOW]: "Client Doesn't Know",
174
+ [DATA_QUALITY.CLIENT_PREFERS_NOT_TO_ANSWER]: "Client Declined",
175
+ [DATA_QUALITY.DATA_NOT_COLLECTED]: "Not Collected"
176
+ };
177
+ var DATA_QUALITY_DESCRIPTIONS = {
178
+ [DATA_QUALITY.CLIENT_DOESNT_KNOW]: "Client does not know the answer",
179
+ [DATA_QUALITY.CLIENT_PREFERS_NOT_TO_ANSWER]: "Client explicitly declined to provide this information",
180
+ [DATA_QUALITY.DATA_NOT_COLLECTED]: "Data was not collected during this interaction"
181
+ };
182
+ var IC_5_VICTIMIZATION = {
183
+ DV: 1,
184
+ SA: 2,
185
+ DMST: 3,
186
+ ST: 4,
187
+ LT: 5,
188
+ OTHER: 99
189
+ };
190
+ var IC_5_LABELS = {
191
+ [IC_5_VICTIMIZATION.DV]: "DV",
192
+ [IC_5_VICTIMIZATION.SA]: "SA",
193
+ [IC_5_VICTIMIZATION.DMST]: "DMST",
194
+ [IC_5_VICTIMIZATION.ST]: "ST",
195
+ [IC_5_VICTIMIZATION.LT]: "LT",
196
+ [IC_5_VICTIMIZATION.OTHER]: "Other"
197
+ };
198
+ var IC_5_FULL_LABELS = {
199
+ [IC_5_VICTIMIZATION.DV]: "Domestic Violence",
200
+ [IC_5_VICTIMIZATION.SA]: "Sexual Assault",
201
+ [IC_5_VICTIMIZATION.DMST]: "Domestic Minor Sex Trafficking",
202
+ [IC_5_VICTIMIZATION.ST]: "Sex Trafficking",
203
+ [IC_5_VICTIMIZATION.LT]: "Labor Trafficking",
204
+ [IC_5_VICTIMIZATION.OTHER]: "Other"
205
+ };
206
+ var IC_13_RELATIONSHIP_TYPE = {
207
+ SPOUSE: 1,
208
+ PARTNER: 2,
209
+ PARENT: 3,
210
+ CHILD: 4,
211
+ SIBLING: 5,
212
+ OTHER_FAMILY: 6,
213
+ ROOMMATE: 7,
214
+ FRIEND: 8,
215
+ COWORKER: 9,
216
+ ACQUAINTANCE: 10,
217
+ STRANGER: 11,
218
+ OTHER: 99
219
+ };
220
+ var IC_13_LABELS = {
221
+ 1: "Spouse",
222
+ 2: "Partner / Significant Other",
223
+ 3: "Parent / Guardian",
224
+ 4: "Child / Dependent",
225
+ 5: "Sibling",
226
+ 6: "Other Family Member",
227
+ 7: "Roommate / Housemate",
228
+ 8: "Friend",
229
+ 9: "Coworker",
230
+ 10: "Acquaintance",
231
+ 11: "Stranger",
232
+ 99: "Other"
233
+ };
234
+ var IC_13_RELATIONSHIP_ABBREV = {
235
+ 1: "SP",
236
+ 2: "PTR",
237
+ 3: "P/G",
238
+ 4: "CHD",
239
+ 5: "SIB",
240
+ 6: "FAM",
241
+ 7: "RM",
242
+ 8: "FRD",
243
+ 9: "CW",
244
+ 10: "ACQ",
245
+ 11: "STR",
246
+ 99: "OTH"
247
+ };
248
+ var IC_13_PRIORITY_GROUPS = [
249
+ {
250
+ label: "Familial",
251
+ codes: [
252
+ IC_13_RELATIONSHIP_TYPE.PARENT,
253
+ IC_13_RELATIONSHIP_TYPE.CHILD,
254
+ IC_13_RELATIONSHIP_TYPE.SIBLING,
255
+ IC_13_RELATIONSHIP_TYPE.OTHER_FAMILY
256
+ ]
257
+ },
258
+ {
259
+ label: "Romantic",
260
+ codes: [IC_13_RELATIONSHIP_TYPE.SPOUSE, IC_13_RELATIONSHIP_TYPE.PARTNER]
261
+ },
262
+ {
263
+ label: "Close Social",
264
+ codes: [IC_13_RELATIONSHIP_TYPE.ROOMMATE, IC_13_RELATIONSHIP_TYPE.FRIEND]
265
+ },
266
+ {
267
+ label: "Business",
268
+ codes: [IC_13_RELATIONSHIP_TYPE.COWORKER]
269
+ },
270
+ {
271
+ label: "Other Social",
272
+ codes: [
273
+ IC_13_RELATIONSHIP_TYPE.ACQUAINTANCE,
274
+ IC_13_RELATIONSHIP_TYPE.STRANGER
275
+ ]
276
+ },
277
+ {
278
+ label: "Other",
279
+ codes: [IC_13_RELATIONSHIP_TYPE.OTHER]
280
+ }
281
+ ];
282
+ var IC_13_REVERSE_CONTEXT_LABELS = {
283
+ 1: "Spouse of victim",
284
+ 2: "Partner of victim",
285
+ 3: "Parent / Guardian of victim",
286
+ 4: "Child / Dependent of victim",
287
+ 5: "Sibling of victim",
288
+ 6: "Other family of victim",
289
+ 7: "Roommate of victim",
290
+ 8: "Friend of victim",
291
+ 9: "Coworker of victim",
292
+ 10: "Acquaintance of victim",
293
+ 11: "Stranger to victim",
294
+ 99: "Other relationship to victim"
295
+ };
296
+ function sortRelationshipsByPriority(codes) {
297
+ const orderMap = /* @__PURE__ */ new Map();
298
+ let order = 0;
299
+ for (const group of IC_13_PRIORITY_GROUPS) {
300
+ for (const code of group.codes) {
301
+ orderMap.set(code, order++);
302
+ }
303
+ }
304
+ return [...codes].sort((a, b) => {
305
+ const oa = orderMap.get(a) ?? 999;
306
+ const ob = orderMap.get(b) ?? 999;
307
+ return oa - ob;
308
+ });
309
+ }
310
+ var R = IC_13_RELATIONSHIP_TYPE;
311
+ var IC_13_CATEGORIES = {
312
+ familial: [
313
+ R.PARENT,
314
+ R.CHILD,
315
+ R.SIBLING,
316
+ R.OTHER_FAMILY
317
+ ],
318
+ romantic: [R.SPOUSE, R.PARTNER],
319
+ close_social: [R.FRIEND, R.ROOMMATE],
320
+ business: [R.COWORKER],
321
+ other_social: [R.ACQUAINTANCE, R.STRANGER],
322
+ ungrouped: [R.OTHER]
323
+ };
324
+ var IC_13_CATEGORY_ORDER = [
325
+ "familial",
326
+ "romantic",
327
+ "close_social",
328
+ "business",
329
+ "other_social",
330
+ "ungrouped"
331
+ ];
332
+ var RELATIONSHIP_DYNAMICS = {
333
+ APPEARS_CONTROLLING: "appears_controlling",
334
+ CONTROLS_FINANCES: "controls_finances",
335
+ CONTROLS_DOCUMENTATION: "controls_documentation",
336
+ EMOTIONAL_VERBAL_ABUSE: "emotional_verbal_abuse",
337
+ PHYSICAL_ABUSE: "physical_abuse",
338
+ SEXUAL_ABUSE: "sexual_abuse",
339
+ THREATS_OF_HARM: "threats_of_harm",
340
+ THREATS_OF_LEGAL_TROUBLE: "threats_of_legal_trouble",
341
+ AGE_DISPARITY: "age_disparity",
342
+ HAS_KIDS_WITH: "has_kids_with"
343
+ };
344
+ var RELATIONSHIP_DYNAMICS_LABELS = {
345
+ appears_controlling: "Appears Controlling",
346
+ controls_finances: "Controls Finances",
347
+ controls_documentation: "Controls Documentation",
348
+ emotional_verbal_abuse: "Emotional / Verbal Abuse",
349
+ physical_abuse: "Physical Abuse",
350
+ sexual_abuse: "Sexual Abuse",
351
+ threats_of_harm: "Threats of Harm",
352
+ threats_of_legal_trouble: "Threats of Legal Trouble",
353
+ age_disparity: "Age Disparity",
354
+ has_kids_with: "Has Kids With"
355
+ };
356
+ var RELATIONSHIP_DYNAMICS_VALUES = Object.values(
357
+ RELATIONSHIP_DYNAMICS
358
+ );
359
+ var RELATIONSHIP_CONCERNS = {
360
+ SAFETY: "safety",
361
+ CUSTODY: "custody",
362
+ IMMIGRATION: "immigration",
363
+ FINANCIAL: "financial",
364
+ HOUSING: "housing",
365
+ SUBSTANCE_USE: "substance_use",
366
+ MENTAL_HEALTH: "mental_health",
367
+ CHILD_WELFARE: "child_welfare"
368
+ };
369
+ var RELATIONSHIP_CONCERNS_LABELS = {
370
+ safety: "Safety",
371
+ custody: "Custody",
372
+ immigration: "Immigration",
373
+ financial: "Financial",
374
+ housing: "Housing",
375
+ substance_use: "Substance Use",
376
+ mental_health: "Mental Health",
377
+ child_welfare: "Child Welfare"
378
+ };
379
+ var RELATIONSHIP_CONCERNS_VALUES = Object.values(
380
+ RELATIONSHIP_CONCERNS
381
+ );
382
+ var IC_48_SERVICE_CATEGORIES = [
383
+ {
384
+ id: 1,
385
+ label: "Crisis Intervention",
386
+ children: [
387
+ { id: 101, label: "Crisis Hotline Services" },
388
+ { id: 102, label: "Safety Planning" },
389
+ { id: 103, label: "Emergency Transportation" },
390
+ { id: 104, label: "Crisis Counseling" }
391
+ ]
392
+ },
393
+ {
394
+ id: 2,
395
+ label: "Shelter / Housing",
396
+ children: [
397
+ { id: 201, label: "Emergency Shelter" },
398
+ { id: 202, label: "Transitional Housing" },
399
+ { id: 203, label: "Permanent Housing Assistance" },
400
+ { id: 204, label: "Relocation Assistance" }
401
+ ]
402
+ },
403
+ {
404
+ id: 3,
405
+ label: "Legal Services",
406
+ children: [
407
+ { id: 301, label: "Protection Order Assistance" },
408
+ { id: 302, label: "Legal Representation" },
409
+ { id: 303, label: "Court Advocacy" },
410
+ { id: 304, label: "Immigration Legal Services" }
411
+ ]
412
+ },
413
+ {
414
+ id: 4,
415
+ label: "Mental Health",
416
+ children: [
417
+ { id: 401, label: "Individual Counseling" },
418
+ { id: 402, label: "Group Counseling" },
419
+ { id: 403, label: "Trauma-Specific Therapy" },
420
+ { id: 404, label: "Substance Abuse Treatment" }
421
+ ]
422
+ },
423
+ {
424
+ id: 5,
425
+ label: "Medical / Health",
426
+ children: [
427
+ { id: 501, label: "Medical Care" },
428
+ { id: 502, label: "Forensic Exam" },
429
+ { id: 503, label: "Dental Care" },
430
+ { id: 504, label: "Prescription Assistance" }
431
+ ]
432
+ },
433
+ {
434
+ id: 6,
435
+ label: "Case Management",
436
+ children: [
437
+ { id: 601, label: "Needs Assessment" },
438
+ { id: 602, label: "Service Coordination" },
439
+ { id: 603, label: "Benefits Enrollment" },
440
+ { id: 604, label: "Document Retrieval" }
441
+ ]
442
+ },
443
+ {
444
+ id: 7,
445
+ label: "Financial Assistance",
446
+ children: [
447
+ { id: 701, label: "Emergency Funds" },
448
+ { id: 702, label: "Employment Assistance" },
449
+ { id: 703, label: "Job Training" },
450
+ { id: 704, label: "Financial Literacy" }
451
+ ]
452
+ },
453
+ {
454
+ id: 8,
455
+ label: "Law Enforcement",
456
+ children: [
457
+ { id: 801, label: "Report Filing" },
458
+ { id: 802, label: "Victim Notification" },
459
+ { id: 803, label: "Investigation Referral" }
460
+ ]
461
+ }
462
+ ];
463
+ var IC_49_SERVICE_MECHANISM = {
464
+ // Level 0 — Unknown / Not Collected
465
+ DATA_NOT_COLLECTED: -2,
466
+ ANONYMOUS: -1,
467
+ UNKNOWN: 0,
468
+ // Level 1
469
+ SUPPORT_VIA_REFERRAL: 3,
470
+ INFORMATIONAL_SUPPORT: 4,
471
+ // Level 2
472
+ DIRECT_STAFF_CONTRACTOR: 1,
473
+ FINANCIAL_MATERIAL_ASSISTANCE: 2,
474
+ // Mutually exclusive — no other mechanisms when selected
475
+ SUPPORT_IDENTIFIED_NOT_ADMINISTERED: 5
476
+ };
477
+ var IC_49_LABELS = {
478
+ [IC_49_SERVICE_MECHANISM.DATA_NOT_COLLECTED]: "Data Not Collected",
479
+ [IC_49_SERVICE_MECHANISM.ANONYMOUS]: "Anonymous",
480
+ [IC_49_SERVICE_MECHANISM.UNKNOWN]: "Unknown",
481
+ [IC_49_SERVICE_MECHANISM.SUPPORT_VIA_REFERRAL]: "Support via Referral",
482
+ [IC_49_SERVICE_MECHANISM.INFORMATIONAL_SUPPORT]: "Informational Support",
483
+ [IC_49_SERVICE_MECHANISM.DIRECT_STAFF_CONTRACTOR]: "Direct Staff / Contractor",
484
+ [IC_49_SERVICE_MECHANISM.FINANCIAL_MATERIAL_ASSISTANCE]: "Financial / Material Assistance",
485
+ [IC_49_SERVICE_MECHANISM.SUPPORT_IDENTIFIED_NOT_ADMINISTERED]: "Support Identified, Not Administered"
486
+ };
487
+ var IC_49_DESCRIPTIONS = {
488
+ [IC_49_SERVICE_MECHANISM.DATA_NOT_COLLECTED]: "Mechanism data was not collected",
489
+ [IC_49_SERVICE_MECHANISM.ANONYMOUS]: "Client is anonymous \u2014 mechanism not trackable",
490
+ [IC_49_SERVICE_MECHANISM.UNKNOWN]: "Mechanism unknown",
491
+ [IC_49_SERVICE_MECHANISM.SUPPORT_VIA_REFERRAL]: "Connected to external provider for service delivery",
492
+ [IC_49_SERVICE_MECHANISM.INFORMATIONAL_SUPPORT]: "Information, education, or resource list provided",
493
+ [IC_49_SERVICE_MECHANISM.DIRECT_STAFF_CONTRACTOR]: "Service delivered directly by agency staff or contractor",
494
+ [IC_49_SERVICE_MECHANISM.FINANCIAL_MATERIAL_ASSISTANCE]: "Financial aid, gift cards, vouchers, or material goods",
495
+ [IC_49_SERVICE_MECHANISM.SUPPORT_IDENTIFIED_NOT_ADMINISTERED]: "Service need identified but not administered during this session"
496
+ };
497
+ var IC_56_SERVICE_DELIVERY_CHANNEL = {
498
+ IN_PERSON: 1,
499
+ ON_SCENE: 2,
500
+ PHONE: 3,
501
+ EMAIL_TEXT_CHAT: 4,
502
+ VIRTUAL: 5
503
+ };
504
+ var IC_56_LABELS = {
505
+ [IC_56_SERVICE_DELIVERY_CHANNEL.IN_PERSON]: "In Person",
506
+ [IC_56_SERVICE_DELIVERY_CHANNEL.ON_SCENE]: "On-scene",
507
+ [IC_56_SERVICE_DELIVERY_CHANNEL.PHONE]: "Phone",
508
+ [IC_56_SERVICE_DELIVERY_CHANNEL.EMAIL_TEXT_CHAT]: "Email / Text / Chat",
509
+ [IC_56_SERVICE_DELIVERY_CHANNEL.VIRTUAL]: "Virtual"
510
+ };
511
+ var IC_56_DESCRIPTIONS = {
512
+ [IC_56_SERVICE_DELIVERY_CHANNEL.IN_PERSON]: "Office / shelter / clinic / other in-person setting",
513
+ [IC_56_SERVICE_DELIVERY_CHANNEL.ON_SCENE]: "Field response / crisis response / mobile advocacy",
514
+ [IC_56_SERVICE_DELIVERY_CHANNEL.PHONE]: "Phone call",
515
+ [IC_56_SERVICE_DELIVERY_CHANNEL.EMAIL_TEXT_CHAT]: "Email, text message, or chat",
516
+ [IC_56_SERVICE_DELIVERY_CHANNEL.VIRTUAL]: "Virtual / video call"
517
+ };
518
+ var IC_57_SERVICE_AUDIENCE = {
519
+ CLIENT_VICTIM: 1,
520
+ THIRD_PARTY: 2,
521
+ DEPENDENT_SECONDARY: 3,
522
+ CLIENT_GROUPS: 4
523
+ };
524
+ var IC_57_LABELS = {
525
+ [IC_57_SERVICE_AUDIENCE.CLIENT_VICTIM]: "Client / Victim",
526
+ [IC_57_SERVICE_AUDIENCE.THIRD_PARTY]: "Third-Party",
527
+ [IC_57_SERVICE_AUDIENCE.DEPENDENT_SECONDARY]: "Dependent / Secondary Victim",
528
+ [IC_57_SERVICE_AUDIENCE.CLIENT_GROUPS]: "Client Groups"
529
+ };
530
+ var IC_58_REFERRAL_ENTITY = {
531
+ UNKNOWN: 0,
532
+ INTERNAL: 1,
533
+ INDIVIDUAL_SELF: 2,
534
+ INDIVIDUAL_FAMILY: 3,
535
+ INDIVIDUAL_PEER: 4,
536
+ INDIVIDUAL_OTHER: 5,
537
+ // External organization parent categories
538
+ EXTERNAL_HOUSING_SHELTER: 10,
539
+ EXTERNAL_HOTLINE: 11,
540
+ EXTERNAL_JUSTICE: 12,
541
+ EXTERNAL_OUTREACH: 13,
542
+ EXTERNAL_TEMPORARY_SHELTER: 14,
543
+ EXTERNAL_RESIDENTIAL: 15,
544
+ EXTERNAL_HEALTH: 16,
545
+ EXTERNAL_EDUCATION: 17,
546
+ EXTERNAL_LAW_ENFORCEMENT: 18,
547
+ EXTERNAL_OTHER: 19,
548
+ // Justice & Protective Systems children
549
+ EXTERNAL_CHILD_WELFARE: 20,
550
+ EXTERNAL_JUVENILE_JUSTICE: 21,
551
+ EXTERNAL_COURTS: 22,
552
+ EXTERNAL_CORRECTIONS: 23,
553
+ // Health / Behavioral Health children
554
+ EXTERNAL_INPATIENT_PSYCH: 24,
555
+ EXTERNAL_HEALTHCARE_PROVIDER: 25,
556
+ // Victim + Community Service Providers
557
+ EXTERNAL_VICTIM_COMMUNITY: 26,
558
+ EXTERNAL_CAC: 27,
559
+ EXTERNAL_VSP: 28,
560
+ EXTERNAL_COMMUNITY_PROVIDER: 29,
561
+ // Other children
562
+ EXTERNAL_EMPLOYER: 30,
563
+ EXTERNAL_BENEFITS: 31
564
+ };
565
+ var IC_58_LABELS = {
566
+ 0: "Unknown",
567
+ 1: "Internal referral",
568
+ 2: "Self-referred / walk-in",
569
+ 3: "Family / guardian / friend / foster parent",
570
+ 4: "Peer / another client",
571
+ 5: "Other individual",
572
+ // External organization categories (Level 1B)
573
+ 10: "Housing / Shelter Continuum",
574
+ 11: "Hotline",
575
+ 12: "Justice & Protective Systems",
576
+ 13: "Outreach Project",
577
+ 14: "Temporary Shelter",
578
+ 15: "Residential Project",
579
+ 16: "Health / Behavioral Health",
580
+ 17: "Education",
581
+ 18: "Law Enforcement / Police",
582
+ 19: "Other External",
583
+ // Justice & Protective Systems children
584
+ 20: "Child Welfare / CPS",
585
+ 21: "Juvenile Justice",
586
+ 22: "Courts or Prosecution",
587
+ 23: "Correction / Probation",
588
+ // Health / Behavioral Health children
589
+ 24: "Inpatient Psychiatric Facility",
590
+ 25: "Healthcare Provider",
591
+ // Victim + Community Service Providers
592
+ 26: "Victim + Community Service Providers",
593
+ 27: "Child Advocacy Center (CAC)",
594
+ 28: "Victim Service Provider",
595
+ 29: "Community-Based Service Provider",
596
+ // Other children
597
+ 30: "Employer",
598
+ 31: "Benefits / Public Assistance Office"
599
+ };
600
+ var IC_58_PRIMARY_BRANCHES = {
601
+ INTERNAL: {
602
+ value: 1,
603
+ label: "Internal referral (from my agency)",
604
+ description: "From within another program/unit within your agency."
605
+ },
606
+ INDIVIDUAL: {
607
+ label: "Individual",
608
+ description: "Self / family / peer / other individual.",
609
+ children: [
610
+ { value: 2, label: "Self-referred / walk-in" },
611
+ { value: 3, label: "Family / guardian / friend / foster parent" },
612
+ { value: 4, label: "Peer / another client" },
613
+ { value: 5, label: "Other individual" }
614
+ ]
615
+ },
616
+ EXTERNAL: {
617
+ label: "External organization",
618
+ description: "Another organization or system referred.",
619
+ children: [
620
+ { value: 10, label: "Housing / Shelter Continuum" },
621
+ { value: 11, label: "Hotline" },
622
+ { value: 12, label: "Justice & Protective Systems" },
623
+ { value: 13, label: "Outreach Project" },
624
+ { value: 14, label: "Temporary Shelter" },
625
+ { value: 15, label: "Residential Project" },
626
+ { value: 16, label: "Health / Behavioral Health" },
627
+ { value: 17, label: "Education" },
628
+ { value: 18, label: "Law Enforcement / Police" },
629
+ { value: 19, label: "Other External" },
630
+ { value: 20, label: "Child Welfare / CPS" },
631
+ { value: 21, label: "Juvenile Justice" },
632
+ { value: 22, label: "Courts or Prosecution" },
633
+ { value: 23, label: "Correction / Probation" },
634
+ { value: 24, label: "Inpatient Psychiatric Facility" },
635
+ { value: 25, label: "Healthcare Provider" },
636
+ { value: 26, label: "Victim + Community Service Providers" },
637
+ { value: 27, label: "Child Advocacy Center (CAC)" },
638
+ { value: 28, label: "Victim Service Provider" },
639
+ { value: 29, label: "Community-Based Service Provider" },
640
+ { value: 30, label: "Employer" },
641
+ { value: 31, label: "Benefits / Public Assistance Office" }
642
+ ]
643
+ },
644
+ UNKNOWN: {
645
+ value: 0,
646
+ label: "Unknown",
647
+ description: "Referral source not documented."
648
+ }
649
+ };
650
+ var IC_58_ORG_TYPE_GROUPS = [
651
+ {
652
+ value: 10,
653
+ label: "Housing / Shelter Continuum",
654
+ children: [
655
+ { value: 13, label: "Outreach Project" },
656
+ { value: 14, label: "Temporary Shelter" },
657
+ { value: 15, label: "Residential Project" }
658
+ ]
659
+ },
660
+ {
661
+ value: 12,
662
+ label: "Justice & Protective Systems",
663
+ children: [
664
+ { value: 20, label: "Child Welfare / CPS" },
665
+ { value: 21, label: "Juvenile Justice" },
666
+ { value: 18, label: "Law Enforcement / Police" },
667
+ { value: 22, label: "Courts or Prosecution" },
668
+ { value: 23, label: "Correction / Probation" }
669
+ ]
670
+ },
671
+ {
672
+ value: 11,
673
+ label: "Hotline",
674
+ description: "Crisis hotline or call center",
675
+ children: []
676
+ },
677
+ {
678
+ value: 16,
679
+ label: "Health / Behavioral Health",
680
+ children: [
681
+ { value: 24, label: "Inpatient Psychiatric Facility" },
682
+ { value: 25, label: "Healthcare Provider" }
683
+ ]
684
+ },
685
+ {
686
+ value: 26,
687
+ label: "Victim + Community Service Providers",
688
+ children: [
689
+ { value: 27, label: "Child Advocacy Center (CAC)" },
690
+ { value: 28, label: "Victim Service Provider" },
691
+ { value: 29, label: "Community-Based Service Provider" }
692
+ ]
693
+ },
694
+ {
695
+ value: 17,
696
+ label: "Education",
697
+ children: []
698
+ },
699
+ {
700
+ value: 19,
701
+ label: "Other External",
702
+ children: [
703
+ { value: 30, label: "Employer" },
704
+ { value: 31, label: "Benefits / Public Assistance Office" }
705
+ ]
706
+ }
707
+ ];
708
+ var IC_58_EXTERNAL_TIERED = [
709
+ {
710
+ id: 10,
711
+ label: "Housing / Shelter Continuum",
712
+ description: "Outreach, emergency shelter, residential programs",
713
+ children: [
714
+ { id: 13, label: "Outreach Project" },
715
+ { id: 14, label: "Temporary Shelter" },
716
+ { id: 15, label: "Residential Project" }
717
+ ]
718
+ },
719
+ {
720
+ id: 12,
721
+ label: "Justice & Protective Systems",
722
+ description: "Law enforcement, courts, child welfare",
723
+ children: [
724
+ { id: 20, label: "Child Welfare / CPS" },
725
+ { id: 21, label: "Juvenile Justice" },
726
+ { id: 18, label: "Law Enforcement / Police" },
727
+ { id: 22, label: "Courts or Prosecution" },
728
+ { id: 23, label: "Correction / Probation" }
729
+ ]
730
+ },
731
+ {
732
+ id: 11,
733
+ label: "Hotline",
734
+ description: "Crisis hotline or call center",
735
+ children: []
736
+ },
737
+ {
738
+ id: 16,
739
+ label: "Health / Behavioral Health",
740
+ description: "Healthcare providers, mental health facilities",
741
+ children: [
742
+ { id: 24, label: "Inpatient Psychiatric Facility" },
743
+ { id: 25, label: "Healthcare Provider" }
744
+ ]
745
+ },
746
+ {
747
+ id: 26,
748
+ label: "Victim + Community Service Providers",
749
+ description: "Victim services, advocacy, community-based programs",
750
+ children: [
751
+ { id: 27, label: "Child Advocacy Center (CAC)" },
752
+ { id: 28, label: "Victim Service Provider" },
753
+ { id: 29, label: "Community-Based Service Provider" }
754
+ ]
755
+ },
756
+ {
757
+ id: 17,
758
+ label: "Education",
759
+ description: "Schools, academic institutions",
760
+ children: []
761
+ },
762
+ {
763
+ id: 19,
764
+ label: "Other External",
765
+ description: "Other external organization or system",
766
+ children: [
767
+ { id: 30, label: "Employer" },
768
+ { id: 31, label: "Benefits / Public Assistance Office" }
769
+ ]
770
+ }
771
+ ];
772
+ var IC_59_SERVICE_STATE = {
773
+ IDENTIFIED: 1,
774
+ REFERRED: 2,
775
+ IN_PROGRESS: 3,
776
+ COMPLETED: 4,
777
+ DECLINED: 5
778
+ };
779
+ var IC_59_LABELS = {
780
+ [IC_59_SERVICE_STATE.IDENTIFIED]: "Identified",
781
+ [IC_59_SERVICE_STATE.REFERRED]: "Referred",
782
+ [IC_59_SERVICE_STATE.IN_PROGRESS]: "In Progress",
783
+ [IC_59_SERVICE_STATE.COMPLETED]: "Completed",
784
+ [IC_59_SERVICE_STATE.DECLINED]: "Declined"
785
+ };
786
+ var IC_49_REFERRAL_OUTCOME = {
787
+ UNKNOWN: 0,
788
+ ATTAINED: 1,
789
+ NOT_ATTAINED: 2
790
+ };
791
+ var IC_49_REFERRAL_OUTCOME_LABELS = {
792
+ [IC_49_REFERRAL_OUTCOME.UNKNOWN]: "Unknown",
793
+ [IC_49_REFERRAL_OUTCOME.ATTAINED]: "Attained",
794
+ [IC_49_REFERRAL_OUTCOME.NOT_ATTAINED]: "Not Attained"
795
+ };
796
+ var IC_49_REFERRAL_VERIFICATION = {
797
+ REFERRAL_MADE: 1,
798
+ CONFIRMED_RECEIVED: 2
799
+ };
800
+ var IC_49_REFERRAL_VERIFICATION_LABELS = {
801
+ [IC_49_REFERRAL_VERIFICATION.REFERRAL_MADE]: "Referral Made",
802
+ [IC_49_REFERRAL_VERIFICATION.CONFIRMED_RECEIVED]: "Confirmed Received / Connected"
803
+ };
804
+ var SESSION_STATES = {
805
+ INITIALIZED: 1,
806
+ ACTION_NEEDED: 2,
807
+ PENDING_SAVE: 3,
808
+ CLOSED: 4,
809
+ DISCARDED: 5
810
+ };
811
+ var SESSION_STATE_LABELS = {
812
+ [SESSION_STATES.INITIALIZED]: "Initialized",
813
+ [SESSION_STATES.ACTION_NEEDED]: "Action Needed",
814
+ [SESSION_STATES.PENDING_SAVE]: "Pending Save",
815
+ [SESSION_STATES.CLOSED]: "Closed",
816
+ [SESSION_STATES.DISCARDED]: "Discarded"
817
+ };
818
+ var RECORD_STATES = {
819
+ OPEN: 1,
820
+ CLAIMED: 2,
821
+ SUBMITTED_NO_SHARES: 3,
822
+ SUBMITTED_WITH_SHARES: 4,
823
+ CLOSED: 5
824
+ };
825
+ var RECORD_STATE_LABELS = {
826
+ [RECORD_STATES.OPEN]: "Open",
827
+ [RECORD_STATES.CLAIMED]: "Claimed",
828
+ [RECORD_STATES.SUBMITTED_NO_SHARES]: "Submitted (No Shares)",
829
+ [RECORD_STATES.SUBMITTED_WITH_SHARES]: "Submitted (With Shares)",
830
+ [RECORD_STATES.CLOSED]: "Closed"
831
+ };
832
+ var INTERACTION_TYPES = {
833
+ HOTLINE_CALL: 1,
834
+ LAP_INCIDENT: 2,
835
+ FIELD_RESPONSE: 3,
836
+ EMAIL_CRISIS: 4,
837
+ OTHER: 99
838
+ };
839
+ var VALID_INTERACTION_TYPES = Object.values(
840
+ INTERACTION_TYPES
841
+ );
842
+ var VALID_RECORD_STATES = Object.values(
843
+ RECORD_STATES
844
+ );
845
+ var INTERACTION_TYPE_LABELS = {
846
+ [INTERACTION_TYPES.HOTLINE_CALL]: "Hotline Call",
847
+ [INTERACTION_TYPES.LAP_INCIDENT]: "LAP Incident",
848
+ [INTERACTION_TYPES.FIELD_RESPONSE]: "Field Response",
849
+ [INTERACTION_TYPES.EMAIL_CRISIS]: "Email Crisis",
850
+ [INTERACTION_TYPES.OTHER]: "Other"
851
+ };
852
+ var INCIDENT_INVOLVEMENT_ROLE = {
853
+ VICTIM_PRIMARY: "victim_primary",
854
+ VICTIM_SECONDARY: "victim_secondary",
855
+ VICTIM_OTHER: "victim_other",
856
+ DEPENDENT: "dependent",
857
+ WITNESS: "witness",
858
+ OFFENDER: "offender",
859
+ UNKNOWN: "unknown",
860
+ ANONYMOUS: "anonymous",
861
+ NOT_COLLECTED: "not_collected"
862
+ };
863
+ var INCIDENT_INVOLVEMENT_ROLE_LABELS = {
864
+ [INCIDENT_INVOLVEMENT_ROLE.VICTIM_PRIMARY]: "Primary Victim",
865
+ [INCIDENT_INVOLVEMENT_ROLE.VICTIM_SECONDARY]: "Secondary Victim",
866
+ [INCIDENT_INVOLVEMENT_ROLE.VICTIM_OTHER]: "Other Victim",
867
+ [INCIDENT_INVOLVEMENT_ROLE.DEPENDENT]: "Dependent",
868
+ [INCIDENT_INVOLVEMENT_ROLE.WITNESS]: "Witness",
869
+ [INCIDENT_INVOLVEMENT_ROLE.OFFENDER]: "Offender",
870
+ [INCIDENT_INVOLVEMENT_ROLE.UNKNOWN]: "Unknown",
871
+ [INCIDENT_INVOLVEMENT_ROLE.ANONYMOUS]: "Anonymous",
872
+ [INCIDENT_INVOLVEMENT_ROLE.NOT_COLLECTED]: "Not Collected"
873
+ };
874
+ var THREAD_INVOLVEMENT_ROLES = [
875
+ INCIDENT_INVOLVEMENT_ROLE.VICTIM_PRIMARY,
876
+ INCIDENT_INVOLVEMENT_ROLE.VICTIM_SECONDARY,
877
+ INCIDENT_INVOLVEMENT_ROLE.DEPENDENT,
878
+ INCIDENT_INVOLVEMENT_ROLE.WITNESS,
879
+ INCIDENT_INVOLVEMENT_ROLE.OFFENDER,
880
+ INCIDENT_INVOLVEMENT_ROLE.UNKNOWN,
881
+ INCIDENT_INVOLVEMENT_ROLE.ANONYMOUS
882
+ ];
883
+ var PERSON_ROLES = {
884
+ VICTIM_CLIENT: "Victim / Client",
885
+ CALLER_REPORTER: "Caller / Reporter",
886
+ DEPENDENT: "Dependent / Secondary Victim",
887
+ OFFENDER: "Offender",
888
+ PERSONNEL: "Personnel / Staff",
889
+ OTHER: "Other"
890
+ };
891
+ var INCIDENT_INVOLVEMENT_ROLE_TO_PERSON_ROLE = {
892
+ [INCIDENT_INVOLVEMENT_ROLE.VICTIM_PRIMARY]: PERSON_ROLES.VICTIM_CLIENT,
893
+ [INCIDENT_INVOLVEMENT_ROLE.VICTIM_SECONDARY]: PERSON_ROLES.VICTIM_CLIENT,
894
+ [INCIDENT_INVOLVEMENT_ROLE.VICTIM_OTHER]: PERSON_ROLES.VICTIM_CLIENT,
895
+ [INCIDENT_INVOLVEMENT_ROLE.DEPENDENT]: PERSON_ROLES.DEPENDENT,
896
+ [INCIDENT_INVOLVEMENT_ROLE.WITNESS]: PERSON_ROLES.CALLER_REPORTER,
897
+ [INCIDENT_INVOLVEMENT_ROLE.OFFENDER]: PERSON_ROLES.OFFENDER,
898
+ [INCIDENT_INVOLVEMENT_ROLE.UNKNOWN]: PERSON_ROLES.OTHER,
899
+ [INCIDENT_INVOLVEMENT_ROLE.ANONYMOUS]: PERSON_ROLES.OTHER,
900
+ [INCIDENT_INVOLVEMENT_ROLE.NOT_COLLECTED]: PERSON_ROLES.OTHER
901
+ };
902
+ var IC_4_AGE_TYPE = {
903
+ EXACT_DOB: 1,
904
+ APPROXIMATE: 2,
905
+ ESTIMATED_RANGE: 3,
906
+ UNKNOWN: 99
907
+ };
908
+ var IC_4_LABELS = {
909
+ [IC_4_AGE_TYPE.EXACT_DOB]: "Exact Date of Birth",
910
+ [IC_4_AGE_TYPE.APPROXIMATE]: "Approximate Age",
911
+ [IC_4_AGE_TYPE.ESTIMATED_RANGE]: "Estimated Range",
912
+ [IC_4_AGE_TYPE.UNKNOWN]: "Unknown"
913
+ };
914
+ var IC_22_CORE_SEX = {
915
+ FEMALE: 1,
916
+ MALE: 2,
917
+ INTERSEX: 3,
918
+ UNKNOWN: 99
919
+ };
920
+ var IC_22_LABELS = {
921
+ [IC_22_CORE_SEX.FEMALE]: "Female",
922
+ [IC_22_CORE_SEX.MALE]: "Male",
923
+ [IC_22_CORE_SEX.INTERSEX]: "Intersex",
924
+ [IC_22_CORE_SEX.UNKNOWN]: "Unknown"
925
+ };
926
+ var IC_23_CORE_GENDER_IDENTITY = {
927
+ FEMALE: 1,
928
+ MALE: 2,
929
+ NON_BINARY: 3,
930
+ TRANSGENDER_FEMALE: 4,
931
+ TRANSGENDER_MALE: 5,
932
+ UNKNOWN: 99
933
+ };
934
+ var IC_23_LABELS = {
935
+ [IC_23_CORE_GENDER_IDENTITY.FEMALE]: "Female",
936
+ [IC_23_CORE_GENDER_IDENTITY.MALE]: "Male",
937
+ [IC_23_CORE_GENDER_IDENTITY.NON_BINARY]: "Non-Binary",
938
+ [IC_23_CORE_GENDER_IDENTITY.TRANSGENDER_FEMALE]: "Transgender Female",
939
+ [IC_23_CORE_GENDER_IDENTITY.TRANSGENDER_MALE]: "Transgender Male",
940
+ [IC_23_CORE_GENDER_IDENTITY.UNKNOWN]: "Unknown"
941
+ };
942
+ var IC_24_RACE = {
943
+ AMERICAN_INDIAN_ALASKA_NATIVE: 1,
944
+ ASIAN: 2,
945
+ BLACK_AFRICAN_AMERICAN: 3,
946
+ NATIVE_HAWAIIAN_PACIFIC_ISLANDER: 4,
947
+ WHITE: 5,
948
+ MULTIPLE_RACES: 6,
949
+ UNKNOWN: 99
950
+ };
951
+ var IC_24_LABELS = {
952
+ [IC_24_RACE.AMERICAN_INDIAN_ALASKA_NATIVE]: "American Indian / Alaska Native",
953
+ [IC_24_RACE.ASIAN]: "Asian",
954
+ [IC_24_RACE.BLACK_AFRICAN_AMERICAN]: "Black / African American",
955
+ [IC_24_RACE.NATIVE_HAWAIIAN_PACIFIC_ISLANDER]: "Native Hawaiian / Pacific Islander",
956
+ [IC_24_RACE.WHITE]: "White",
957
+ [IC_24_RACE.MULTIPLE_RACES]: "Multiple Races",
958
+ [IC_24_RACE.UNKNOWN]: "Unknown"
959
+ };
960
+ var IC_25_ETHNICITY = {
961
+ HISPANIC_LATINO: 1,
962
+ NOT_HISPANIC_LATINO: 2,
963
+ UNKNOWN: 99
964
+ };
965
+ var IC_25_LABELS = {
966
+ [IC_25_ETHNICITY.HISPANIC_LATINO]: "Hispanic / Latino",
967
+ [IC_25_ETHNICITY.NOT_HISPANIC_LATINO]: "Not Hispanic / Latino",
968
+ [IC_25_ETHNICITY.UNKNOWN]: "Unknown"
969
+ };
970
+ var ACCOMMODATION_OPTIONS = {
971
+ HEARING_IMPAIRED: "hearing_impaired",
972
+ VISION_IMPAIRED: "vision_impaired",
973
+ MOBILITY_LIMITATION: "mobility_limitation",
974
+ COGNITIVE_DEVELOPMENTAL: "cognitive_developmental",
975
+ LANGUAGE_INTERPRETER: "language_interpreter",
976
+ OTHER: "other"
977
+ };
978
+ var ACCOMMODATION_LABELS = {
979
+ [ACCOMMODATION_OPTIONS.HEARING_IMPAIRED]: "Hearing Impaired",
980
+ [ACCOMMODATION_OPTIONS.VISION_IMPAIRED]: "Vision Impaired",
981
+ [ACCOMMODATION_OPTIONS.MOBILITY_LIMITATION]: "Mobility Limitation",
982
+ [ACCOMMODATION_OPTIONS.COGNITIVE_DEVELOPMENTAL]: "Cognitive / Developmental",
983
+ [ACCOMMODATION_OPTIONS.LANGUAGE_INTERPRETER]: "Language / Interpreter",
984
+ [ACCOMMODATION_OPTIONS.OTHER]: "Other"
985
+ };
986
+ var MINOR_ADULT_STATUS = {
987
+ MINOR: 1,
988
+ ADULT: 2,
989
+ UNKNOWN: 99
990
+ };
991
+ var MINOR_ADULT_STATUS_LABELS = {
992
+ [MINOR_ADULT_STATUS.MINOR]: "Minor (under 18)",
993
+ [MINOR_ADULT_STATUS.ADULT]: "Adult (18+)",
994
+ [MINOR_ADULT_STATUS.UNKNOWN]: "Unknown"
995
+ };
996
+ var APPARENT_AGE = {
997
+ CHILD: "child",
998
+ TEEN: "teen",
999
+ YOUNG_ADULT: "young_adult",
1000
+ ADULT: "adult",
1001
+ MIDDLE_AGE: "middle_age",
1002
+ SENIOR: "senior"
1003
+ };
1004
+ var APPARENT_AGE_LABELS = {
1005
+ [APPARENT_AGE.CHILD]: "Child",
1006
+ [APPARENT_AGE.TEEN]: "Teen",
1007
+ [APPARENT_AGE.YOUNG_ADULT]: "Young Adult",
1008
+ [APPARENT_AGE.ADULT]: "Adult",
1009
+ [APPARENT_AGE.MIDDLE_AGE]: "Middle Age",
1010
+ [APPARENT_AGE.SENIOR]: "Senior"
1011
+ };
1012
+ var AGE_BIN_REPORTING = {
1013
+ AGE_0_12: "age_0_12",
1014
+ AGE_13_17: "age_13_17",
1015
+ AGE_18_24: "age_18_24",
1016
+ AGE_25_59: "age_25_59",
1017
+ AGE_60_PLUS: "age_60_plus",
1018
+ NOT_REPORTED: "not_reported",
1019
+ NOT_TRACKED: "not_tracked"
1020
+ };
1021
+ var AGE_BIN_REPORTING_LABELS = {
1022
+ [AGE_BIN_REPORTING.AGE_0_12]: "0\u201312 years",
1023
+ [AGE_BIN_REPORTING.AGE_13_17]: "13\u201317 years",
1024
+ [AGE_BIN_REPORTING.AGE_18_24]: "18\u201324 years",
1025
+ [AGE_BIN_REPORTING.AGE_25_59]: "25\u201359 years",
1026
+ [AGE_BIN_REPORTING.AGE_60_PLUS]: "60+ years",
1027
+ [AGE_BIN_REPORTING.NOT_REPORTED]: "Not Reported",
1028
+ [AGE_BIN_REPORTING.NOT_TRACKED]: "Not Tracked"
1029
+ };
1030
+ var AGE_BIN_REPORTING_IS_MINOR = {
1031
+ [AGE_BIN_REPORTING.AGE_0_12]: true,
1032
+ [AGE_BIN_REPORTING.AGE_13_17]: true,
1033
+ [AGE_BIN_REPORTING.AGE_18_24]: false,
1034
+ [AGE_BIN_REPORTING.AGE_25_59]: false,
1035
+ [AGE_BIN_REPORTING.AGE_60_PLUS]: false,
1036
+ [AGE_BIN_REPORTING.NOT_REPORTED]: null,
1037
+ [AGE_BIN_REPORTING.NOT_TRACKED]: null
1038
+ };
1039
+ function deriveAgeBinFromAge(age) {
1040
+ if (!Number.isFinite(age) || !Number.isInteger(age) || age < 0 || age > 150) {
1041
+ return AGE_BIN_REPORTING.NOT_REPORTED;
1042
+ }
1043
+ if (age <= 12) return AGE_BIN_REPORTING.AGE_0_12;
1044
+ if (age <= 17) return AGE_BIN_REPORTING.AGE_13_17;
1045
+ if (age <= 24) return AGE_BIN_REPORTING.AGE_18_24;
1046
+ if (age <= 59) return AGE_BIN_REPORTING.AGE_25_59;
1047
+ return AGE_BIN_REPORTING.AGE_60_PLUS;
1048
+ }
1049
+ var QUICK_START_TEMPLATES = {
1050
+ HOTLINE_CALL: "hotline_call",
1051
+ LAP_INCIDENT: "lap_incident",
1052
+ HT_REFERRAL: "ht_referral",
1053
+ FIELD_RESPONSE: "field_response",
1054
+ EMAIL_CRISIS: "email_crisis",
1055
+ OTHER: "other"
1056
+ };
1057
+ var QUICK_START_LABELS = {
1058
+ hotline_call: "Hotline Call",
1059
+ lap_incident: "LAP Incident",
1060
+ ht_referral: "HT Referral",
1061
+ field_response: "Field Response",
1062
+ email_crisis: "Email / Crisis",
1063
+ other: "Other"
1064
+ };
1065
+ var QUICK_START_CONFIG = {
1066
+ hotline_call: {
1067
+ contactMethod: IC_56_SERVICE_DELIVERY_CHANNEL.PHONE,
1068
+ interactionType: INTERACTION_TYPES.HOTLINE_CALL,
1069
+ intakeFormKey: "hotline_call"
1070
+ },
1071
+ lap_incident: {
1072
+ contactMethod: IC_56_SERVICE_DELIVERY_CHANNEL.ON_SCENE,
1073
+ interactionType: INTERACTION_TYPES.LAP_INCIDENT
1074
+ },
1075
+ ht_referral: {
1076
+ contactMethod: IC_56_SERVICE_DELIVERY_CHANNEL.IN_PERSON,
1077
+ interactionType: INTERACTION_TYPES.OTHER
1078
+ },
1079
+ field_response: {
1080
+ contactMethod: IC_56_SERVICE_DELIVERY_CHANNEL.ON_SCENE,
1081
+ interactionType: INTERACTION_TYPES.FIELD_RESPONSE
1082
+ },
1083
+ email_crisis: {
1084
+ contactMethod: IC_56_SERVICE_DELIVERY_CHANNEL.PHONE,
1085
+ interactionType: INTERACTION_TYPES.EMAIL_CRISIS
1086
+ },
1087
+ other: {
1088
+ contactMethod: IC_56_SERVICE_DELIVERY_CHANNEL.PHONE,
1089
+ interactionType: INTERACTION_TYPES.OTHER
1090
+ }
1091
+ };
1092
+ var SUBMISSION_STATES = {
1093
+ IN_PROGRESS: 1,
1094
+ SUBMITTED: 2,
1095
+ LOCKED: 3
1096
+ };
1097
+ var SUBMISSION_STATE_LABELS = {
1098
+ [SUBMISSION_STATES.IN_PROGRESS]: "In Progress",
1099
+ [SUBMISSION_STATES.SUBMITTED]: "Submitted",
1100
+ [SUBMISSION_STATES.LOCKED]: "Locked"
1101
+ };
1102
+ var FORM_STATUS = {
1103
+ DRAFT: "draft",
1104
+ ACTIVE: "active",
1105
+ DEPRECATED: "deprecated"
1106
+ };
1107
+ var FORM_STATUS_LABELS = {
1108
+ [FORM_STATUS.DRAFT]: "Draft",
1109
+ [FORM_STATUS.ACTIVE]: "Active",
1110
+ [FORM_STATUS.DEPRECATED]: "Deprecated"
1111
+ };
1112
+ var QUESTION_FORMAT = {
1113
+ EXCLUSIVE: "exclusive",
1114
+ INCLUSIVE: "inclusive",
1115
+ DROPDOWN: "dropdown",
1116
+ BINARY: "binary",
1117
+ TEXT: "text",
1118
+ NUMBER: "number",
1119
+ DATE: "date",
1120
+ MULTISELECT: "multiselect"
1121
+ };
1122
+ var QUESTION_FORMAT_LABELS = {
1123
+ [QUESTION_FORMAT.EXCLUSIVE]: "Single Select (Radio)",
1124
+ [QUESTION_FORMAT.INCLUSIVE]: "Multi Select (Checkbox)",
1125
+ [QUESTION_FORMAT.DROPDOWN]: "Dropdown",
1126
+ [QUESTION_FORMAT.BINARY]: "Yes / No",
1127
+ [QUESTION_FORMAT.TEXT]: "Text",
1128
+ [QUESTION_FORMAT.NUMBER]: "Number",
1129
+ [QUESTION_FORMAT.DATE]: "Date",
1130
+ [QUESTION_FORMAT.MULTISELECT]: "Multi Select (Dropdown)"
1131
+ };
1132
+ var APP_SCOPE = {
1133
+ THREAD: "thread",
1134
+ PAVE: "pave",
1135
+ BOTH: "both"
1136
+ };
1137
+ var FORM_TYPE = {
1138
+ SCREENING: "screening",
1139
+ INTAKE: "intake",
1140
+ ASSESSMENT: "assessment",
1141
+ DEMOGRAPHICS: "demographics"
1142
+ };
1143
+ var FORM_TYPE_LABELS = {
1144
+ [FORM_TYPE.SCREENING]: "Screening",
1145
+ [FORM_TYPE.INTAKE]: "Intake",
1146
+ [FORM_TYPE.ASSESSMENT]: "Assessment",
1147
+ [FORM_TYPE.DEMOGRAPHICS]: "Demographics"
1148
+ };
1149
+ var USER_STATUS = {
1150
+ CREATED: 0,
1151
+ PENDING_APPROVAL: 1,
1152
+ APPROVED: 2,
1153
+ DENIED: 3,
1154
+ INVITED: 4,
1155
+ REVOKED: 5
1156
+ };
1157
+ var USER_STATUS_LABELS = {
1158
+ [USER_STATUS.CREATED]: "Created",
1159
+ [USER_STATUS.PENDING_APPROVAL]: "Pending Approval",
1160
+ [USER_STATUS.APPROVED]: "Approved",
1161
+ [USER_STATUS.DENIED]: "Denied",
1162
+ [USER_STATUS.INVITED]: "Invited",
1163
+ [USER_STATUS.REVOKED]: "Revoked"
1164
+ };
1165
+ var INCIDENT_PARTICIPATION_ROLE = {
1166
+ CLIENT_SUBJECT: "client_subject",
1167
+ // Exactly 1 per session
1168
+ CALLER_SELF: "caller_self",
1169
+ CALLER_THIRD_PARTY: "caller_third_party",
1170
+ REPORTER: "reporter",
1171
+ FAMILY_MEMBER_OR_GUARDIAN: "family_member_or_guardian",
1172
+ FRIEND_OR_PEER: "friend_or_peer",
1173
+ SERVICE_PROVIDER_STAFF: "service_provider_staff",
1174
+ MEDICAL_PROVIDER_STAFF: "medical_provider_staff",
1175
+ UNKNOWN: "unknown",
1176
+ ANONYMOUS: "anonymous",
1177
+ NOT_COLLECTED: "not_collected"
1178
+ };
1179
+ var INCIDENT_PARTICIPATION_ROLE_VALUES = [
1180
+ INCIDENT_PARTICIPATION_ROLE.CLIENT_SUBJECT,
1181
+ INCIDENT_PARTICIPATION_ROLE.CALLER_SELF,
1182
+ INCIDENT_PARTICIPATION_ROLE.CALLER_THIRD_PARTY,
1183
+ INCIDENT_PARTICIPATION_ROLE.REPORTER,
1184
+ INCIDENT_PARTICIPATION_ROLE.FAMILY_MEMBER_OR_GUARDIAN,
1185
+ INCIDENT_PARTICIPATION_ROLE.FRIEND_OR_PEER,
1186
+ INCIDENT_PARTICIPATION_ROLE.SERVICE_PROVIDER_STAFF,
1187
+ INCIDENT_PARTICIPATION_ROLE.MEDICAL_PROVIDER_STAFF,
1188
+ INCIDENT_PARTICIPATION_ROLE.UNKNOWN,
1189
+ INCIDENT_PARTICIPATION_ROLE.ANONYMOUS,
1190
+ INCIDENT_PARTICIPATION_ROLE.NOT_COLLECTED
1191
+ ];
1192
+ var INCIDENT_PARTICIPATION_ROLE_LABELS = {
1193
+ [INCIDENT_PARTICIPATION_ROLE.CLIENT_SUBJECT]: "Client / Subject-of-Record",
1194
+ [INCIDENT_PARTICIPATION_ROLE.CALLER_SELF]: "Caller (Self)",
1195
+ [INCIDENT_PARTICIPATION_ROLE.CALLER_THIRD_PARTY]: "Caller (Third Party)",
1196
+ [INCIDENT_PARTICIPATION_ROLE.REPORTER]: "Reporter / Information Source",
1197
+ [INCIDENT_PARTICIPATION_ROLE.FAMILY_MEMBER_OR_GUARDIAN]: "Family Member or Guardian",
1198
+ [INCIDENT_PARTICIPATION_ROLE.FRIEND_OR_PEER]: "Friend or Peer",
1199
+ [INCIDENT_PARTICIPATION_ROLE.SERVICE_PROVIDER_STAFF]: "Service Provider Staff",
1200
+ [INCIDENT_PARTICIPATION_ROLE.MEDICAL_PROVIDER_STAFF]: "Medical Provider Staff",
1201
+ [INCIDENT_PARTICIPATION_ROLE.UNKNOWN]: "Unknown",
1202
+ [INCIDENT_PARTICIPATION_ROLE.ANONYMOUS]: "Anonymous",
1203
+ [INCIDENT_PARTICIPATION_ROLE.NOT_COLLECTED]: "Not Collected"
1204
+ };
1205
+ var PARTICIPATION_ROLE_CATEGORIES = {
1206
+ CLIENT: [INCIDENT_PARTICIPATION_ROLE.CLIENT_SUBJECT],
1207
+ CALLER_REPORTER: [
1208
+ INCIDENT_PARTICIPATION_ROLE.CALLER_SELF,
1209
+ INCIDENT_PARTICIPATION_ROLE.CALLER_THIRD_PARTY,
1210
+ INCIDENT_PARTICIPATION_ROLE.REPORTER
1211
+ ],
1212
+ SUPPORT_NETWORK: [
1213
+ INCIDENT_PARTICIPATION_ROLE.FAMILY_MEMBER_OR_GUARDIAN,
1214
+ INCIDENT_PARTICIPATION_ROLE.FRIEND_OR_PEER
1215
+ ],
1216
+ SYSTEM_PROFESSIONAL: [
1217
+ INCIDENT_PARTICIPATION_ROLE.SERVICE_PROVIDER_STAFF,
1218
+ INCIDENT_PARTICIPATION_ROLE.MEDICAL_PROVIDER_STAFF
1219
+ ]
1220
+ };
1221
+ var CALLER_IS_VICTIM_ROLES = [
1222
+ INCIDENT_PARTICIPATION_ROLE.CLIENT_SUBJECT,
1223
+ INCIDENT_PARTICIPATION_ROLE.CALLER_SELF,
1224
+ INCIDENT_PARTICIPATION_ROLE.REPORTER
1225
+ ];
1226
+ var PERSON_DISPLAY_CATEGORY = {
1227
+ PRIMARY_VICTIM: "primary_victim",
1228
+ ELIGIBLE_FAMILY: "eligible_family",
1229
+ OFFENDER: "offender",
1230
+ THIRD_PARTY: "third_party",
1231
+ PERSONNEL: "personnel"
1232
+ };
1233
+ var PERSON_DISPLAY_CATEGORY_LABELS = {
1234
+ [PERSON_DISPLAY_CATEGORY.PRIMARY_VICTIM]: "Primary Victim",
1235
+ [PERSON_DISPLAY_CATEGORY.ELIGIBLE_FAMILY]: "Eligible Family Member",
1236
+ [PERSON_DISPLAY_CATEGORY.OFFENDER]: "Offender",
1237
+ [PERSON_DISPLAY_CATEGORY.THIRD_PARTY]: "Third Party",
1238
+ [PERSON_DISPLAY_CATEGORY.PERSONNEL]: "Personnel"
1239
+ };
1240
+ var PERSON_TYPE = {
1241
+ PROTECTED: "ProtectedPerson",
1242
+ PERPETRATOR: "PerpetratorPerson",
1243
+ PERSONNEL: "PersonnelPerson",
1244
+ THIRD_PARTY: "ThirdPartyPerson"
1245
+ };
1246
+ var PERSON_TYPE_VALUES = [
1247
+ PERSON_TYPE.PROTECTED,
1248
+ PERSON_TYPE.PERPETRATOR,
1249
+ PERSON_TYPE.PERSONNEL,
1250
+ PERSON_TYPE.THIRD_PARTY
1251
+ ];
1252
+ var INVOLVEMENT_ROLE_TO_PERSON_TYPE = {
1253
+ [INCIDENT_INVOLVEMENT_ROLE.VICTIM_PRIMARY]: PERSON_TYPE.PROTECTED,
1254
+ [INCIDENT_INVOLVEMENT_ROLE.VICTIM_SECONDARY]: PERSON_TYPE.PROTECTED,
1255
+ [INCIDENT_INVOLVEMENT_ROLE.VICTIM_OTHER]: PERSON_TYPE.PROTECTED,
1256
+ [INCIDENT_INVOLVEMENT_ROLE.DEPENDENT]: PERSON_TYPE.PROTECTED,
1257
+ [INCIDENT_INVOLVEMENT_ROLE.WITNESS]: PERSON_TYPE.THIRD_PARTY,
1258
+ [INCIDENT_INVOLVEMENT_ROLE.OFFENDER]: PERSON_TYPE.PERPETRATOR,
1259
+ // unknown defaults to ThirdParty unless context indicates Personnel
1260
+ [INCIDENT_INVOLVEMENT_ROLE.UNKNOWN]: null,
1261
+ // Conditional — use getPersonTypeForRole()
1262
+ [INCIDENT_INVOLVEMENT_ROLE.ANONYMOUS]: PERSON_TYPE.THIRD_PARTY,
1263
+ [INCIDENT_INVOLVEMENT_ROLE.NOT_COLLECTED]: null
1264
+ };
1265
+ function getPersonTypeForRole(role, contextPersonType) {
1266
+ if (role === INCIDENT_INVOLVEMENT_ROLE.NOT_COLLECTED) {
1267
+ return null;
1268
+ }
1269
+ if (role === INCIDENT_INVOLVEMENT_ROLE.UNKNOWN) {
1270
+ return contextPersonType === PERSON_TYPE.PERSONNEL ? PERSON_TYPE.PERSONNEL : PERSON_TYPE.THIRD_PARTY;
1271
+ }
1272
+ return INVOLVEMENT_ROLE_TO_PERSON_TYPE[role] ?? PERSON_TYPE.THIRD_PARTY;
1273
+ }
1274
+ function getDisplayCategoryForRole(role, personType) {
1275
+ switch (role) {
1276
+ case INCIDENT_INVOLVEMENT_ROLE.VICTIM_PRIMARY:
1277
+ return PERSON_DISPLAY_CATEGORY.PRIMARY_VICTIM;
1278
+ case INCIDENT_INVOLVEMENT_ROLE.DEPENDENT:
1279
+ case INCIDENT_INVOLVEMENT_ROLE.VICTIM_SECONDARY:
1280
+ return PERSON_DISPLAY_CATEGORY.ELIGIBLE_FAMILY;
1281
+ case INCIDENT_INVOLVEMENT_ROLE.OFFENDER:
1282
+ return PERSON_DISPLAY_CATEGORY.OFFENDER;
1283
+ case INCIDENT_INVOLVEMENT_ROLE.WITNESS:
1284
+ case INCIDENT_INVOLVEMENT_ROLE.ANONYMOUS:
1285
+ return PERSON_DISPLAY_CATEGORY.THIRD_PARTY;
1286
+ case INCIDENT_INVOLVEMENT_ROLE.UNKNOWN:
1287
+ if (personType === PERSON_TYPE.PERSONNEL) {
1288
+ return PERSON_DISPLAY_CATEGORY.PERSONNEL;
1289
+ }
1290
+ return PERSON_DISPLAY_CATEGORY.THIRD_PARTY;
1291
+ case INCIDENT_INVOLVEMENT_ROLE.VICTIM_OTHER:
1292
+ return PERSON_DISPLAY_CATEGORY.ELIGIBLE_FAMILY;
1293
+ case INCIDENT_INVOLVEMENT_ROLE.NOT_COLLECTED:
1294
+ default:
1295
+ return PERSON_DISPLAY_CATEGORY.THIRD_PARTY;
1296
+ }
1297
+ }
1298
+ var DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY = {
1299
+ [PERSON_DISPLAY_CATEGORY.PRIMARY_VICTIM]: INCIDENT_PARTICIPATION_ROLE.CLIENT_SUBJECT,
1300
+ [PERSON_DISPLAY_CATEGORY.ELIGIBLE_FAMILY]: INCIDENT_PARTICIPATION_ROLE.FAMILY_MEMBER_OR_GUARDIAN,
1301
+ // Offenders are classified by involvement (CVC-130), not session participation (CVC-69)
1302
+ [PERSON_DISPLAY_CATEGORY.OFFENDER]: null,
1303
+ [PERSON_DISPLAY_CATEGORY.THIRD_PARTY]: INCIDENT_PARTICIPATION_ROLE.FRIEND_OR_PEER,
1304
+ [PERSON_DISPLAY_CATEGORY.PERSONNEL]: INCIDENT_PARTICIPATION_ROLE.SERVICE_PROVIDER_STAFF
1305
+ };
1306
+
1307
+ // src/schemas/common.ts
1308
+ var import_mongoose = require("mongoose");
1309
+ var addressSchema = new import_mongoose.Schema(
1310
+ {
1311
+ formattedAddress: String,
1312
+ street: String,
1313
+ city: String,
1314
+ county: String,
1315
+ state: String,
1316
+ zip: String,
1317
+ country: String,
1318
+ lat: Number,
1319
+ lng: Number,
1320
+ placeId: String
1321
+ },
1322
+ { _id: false }
1323
+ );
1324
+ var personNameSchema = new import_mongoose.Schema(
1325
+ {
1326
+ firstName: String,
1327
+ lastName: String,
1328
+ middleName: String,
1329
+ suffix: String,
1330
+ nameType: String,
1331
+ isPrimary: Boolean,
1332
+ alias: Boolean,
1333
+ isUnknown: Boolean,
1334
+ isAnonymous: Boolean
1335
+ },
1336
+ { _id: false }
1337
+ );
1338
+ var phoneSchema = new import_mongoose.Schema(
1339
+ {
1340
+ number: String,
1341
+ type: String,
1342
+ safeToContact: Boolean,
1343
+ dataQuality: { type: String, enum: DATA_QUALITY_VALUES }
1344
+ },
1345
+ { _id: false }
1346
+ );
1347
+ var emailSchema = new import_mongoose.Schema(
1348
+ {
1349
+ address: String,
1350
+ type: String,
1351
+ safeToContact: Boolean
1352
+ },
1353
+ { _id: false }
1354
+ );
1355
+ var demographicsSchema = new import_mongoose.Schema(
1356
+ {
1357
+ // Age / DOB fields
1358
+ age: Number,
1359
+ dateOfBirth: String,
1360
+ dobMonth: String,
1361
+ dobDay: String,
1362
+ dobYear: String,
1363
+ ageAtContact: Number,
1364
+ ageBin: String,
1365
+ apparentAge: String,
1366
+ ageType: Number,
1367
+ minorAdultStatus: Number,
1368
+ // Demographics value fields (IC-22, IC-23, IC-24, IC-25)
1369
+ sex: Number,
1370
+ genderIdentity: Number,
1371
+ race: [Number],
1372
+ ethnicity: [Number],
1373
+ // Free-text detail for race/gender
1374
+ raceOtherText: String,
1375
+ genderOtherText: String,
1376
+ // Special accommodations
1377
+ accommodations: [String],
1378
+ accommodationOtherText: String,
1379
+ // Per-field data quality indicators (HMIS-aligned)
1380
+ ageDataQuality: { type: String, enum: DATA_QUALITY_VALUES },
1381
+ sexDataQuality: { type: String, enum: DATA_QUALITY_VALUES },
1382
+ genderDataQuality: { type: String, enum: DATA_QUALITY_VALUES },
1383
+ raceDataQuality: { type: String, enum: DATA_QUALITY_VALUES },
1384
+ ethnicityDataQuality: { type: String, enum: DATA_QUALITY_VALUES }
1385
+ },
1386
+ { _id: false }
1387
+ );
1388
+
1389
+ // src/schemas/form.ts
1390
+ var import_mongoose2 = require("mongoose");
1391
+ var formSectionRefSchema = new import_mongoose2.Schema(
1392
+ {
1393
+ sectionId: { type: String, required: true },
1394
+ sectionVersion: { type: String, required: true },
1395
+ index: { type: Number, required: true },
1396
+ isStep: { type: Boolean, default: false },
1397
+ wizardStep: { type: Number },
1398
+ label: { type: String },
1399
+ presetsType: { type: String }
1400
+ },
1401
+ { _id: false }
1402
+ );
1403
+ var formSchemaDefinition = {
1404
+ _schemaVersion: {
1405
+ type: Number,
1406
+ required: true,
1407
+ default: 1
1408
+ },
1409
+ // Audit fields
1410
+ createdUser: {
1411
+ type: import_mongoose2.Schema.Types.ObjectId,
1412
+ required: true,
1413
+ index: true
1414
+ },
1415
+ updatedUser: {
1416
+ type: import_mongoose2.Schema.Types.ObjectId,
1417
+ index: true
1418
+ },
1419
+ // Versioning
1420
+ key: {
1421
+ type: String,
1422
+ required: true
1423
+ },
1424
+ version: {
1425
+ type: String,
1426
+ required: true
1427
+ },
1428
+ // Form info
1429
+ name: {
1430
+ type: String,
1431
+ required: true
1432
+ },
1433
+ description: {
1434
+ type: String
1435
+ },
1436
+ formType: {
1437
+ type: String,
1438
+ index: true
1439
+ },
1440
+ appScope: {
1441
+ type: [String],
1442
+ enum: ["thread", "pave", "both"],
1443
+ default: []
1444
+ },
1445
+ // Ordered sections
1446
+ sections: {
1447
+ type: [formSectionRefSchema],
1448
+ default: []
1449
+ },
1450
+ // Lifecycle
1451
+ status: {
1452
+ type: String,
1453
+ required: true,
1454
+ enum: ["draft", "active", "deprecated"],
1455
+ default: "draft",
1456
+ index: true
1457
+ },
1458
+ supersedes: {
1459
+ type: String
1460
+ }
1461
+ };
1462
+ var formSchemaOptions = {
1463
+ timestamps: {
1464
+ createdAt: "createdTime",
1465
+ updatedAt: "updatedTime"
1466
+ },
1467
+ collection: "forms"
1468
+ };
1469
+ function buildFormSchema() {
1470
+ const schema = new import_mongoose2.Schema(formSchemaDefinition, formSchemaOptions);
1471
+ schema.index({ key: 1, version: 1 }, { unique: true });
1472
+ schema.index(
1473
+ { key: 1 },
1474
+ { unique: true, partialFilterExpression: { status: "active" } }
1475
+ );
1476
+ return schema;
1477
+ }
1478
+ var _formSchema = buildFormSchema();
1479
+
1480
+ // src/schemas/section.ts
1481
+ var import_mongoose3 = require("mongoose");
1482
+ var sectionQuestionRefSchema = new import_mongoose3.Schema(
1483
+ {
1484
+ questionId: { type: String, required: true },
1485
+ questionVersion: { type: String, required: true },
1486
+ index: { type: Number, required: true }
1487
+ },
1488
+ { _id: false }
1489
+ );
1490
+ var guidanceSchema = new import_mongoose3.Schema(
1491
+ {
1492
+ type: {
1493
+ type: String,
1494
+ required: true,
1495
+ enum: ["tip", "warning", "prompt"]
1496
+ },
1497
+ text: { type: String, required: true }
1498
+ },
1499
+ { _id: false }
1500
+ );
1501
+ var sectionSchemaDefinition = {
1502
+ _schemaVersion: {
1503
+ type: Number,
1504
+ required: true,
1505
+ default: 1
1506
+ },
1507
+ // Audit fields
1508
+ createdUser: {
1509
+ type: import_mongoose3.Schema.Types.ObjectId,
1510
+ required: true,
1511
+ index: true
1512
+ },
1513
+ updatedUser: {
1514
+ type: import_mongoose3.Schema.Types.ObjectId,
1515
+ index: true
1516
+ },
1517
+ // Versioning
1518
+ key: {
1519
+ type: String,
1520
+ required: true
1521
+ },
1522
+ version: {
1523
+ type: String,
1524
+ required: true
1525
+ },
1526
+ // Section info
1527
+ name: {
1528
+ type: String,
1529
+ required: true
1530
+ },
1531
+ directions: {
1532
+ type: String
1533
+ },
1534
+ // Typed guidance items
1535
+ guidance: {
1536
+ type: [guidanceSchema],
1537
+ default: []
1538
+ },
1539
+ // Ordered question refs
1540
+ questions: {
1541
+ type: [sectionQuestionRefSchema],
1542
+ default: []
1543
+ },
1544
+ // Template visibility
1545
+ templateScope: {
1546
+ type: [String],
1547
+ default: void 0
1548
+ },
1549
+ collapsible: {
1550
+ type: Boolean,
1551
+ default: false
1552
+ },
1553
+ defaultCollapsed: {
1554
+ type: Boolean,
1555
+ default: false
1556
+ },
1557
+ // Lifecycle
1558
+ status: {
1559
+ type: String,
1560
+ required: true,
1561
+ enum: ["draft", "active", "deprecated"],
1562
+ default: "draft",
1563
+ index: true
1564
+ },
1565
+ supersedes: {
1566
+ type: String
1567
+ },
1568
+ // PAVE-aligned optional fields
1569
+ rephrasing: {
1570
+ type: String
1571
+ },
1572
+ script: {
1573
+ type: String
1574
+ }
1575
+ };
1576
+ var sectionSchemaOptions = {
1577
+ timestamps: {
1578
+ createdAt: "createdTime",
1579
+ updatedAt: "updatedTime"
1580
+ },
1581
+ collection: "sections"
1582
+ };
1583
+ function buildSectionSchema() {
1584
+ const schema = new import_mongoose3.Schema(sectionSchemaDefinition, sectionSchemaOptions);
1585
+ schema.index({ key: 1, version: 1 }, { unique: true });
1586
+ schema.index(
1587
+ { key: 1 },
1588
+ { unique: true, partialFilterExpression: { status: "active" } }
1589
+ );
1590
+ return schema;
1591
+ }
1592
+ var _sectionSchema = buildSectionSchema();
1593
+
1594
+ // src/schemas/question.ts
1595
+ var import_mongoose4 = require("mongoose");
1596
+ var choiceSchema = new import_mongoose4.Schema(
1597
+ {
1598
+ val: { type: import_mongoose4.Schema.Types.Mixed, required: true },
1599
+ text: { type: String, required: true },
1600
+ tip: { type: String },
1601
+ trigger: { type: [String] }
1602
+ },
1603
+ { _id: false }
1604
+ );
1605
+ var visibilityRuleSchema = new import_mongoose4.Schema(
1606
+ {
1607
+ dependsOn: { type: String, required: true },
1608
+ condition: {
1609
+ type: String,
1610
+ required: true,
1611
+ enum: ["equals", "not_equals", "any_of", "in_range"]
1612
+ },
1613
+ values: { type: [import_mongoose4.Schema.Types.Mixed], required: true },
1614
+ source: {
1615
+ type: String,
1616
+ enum: ["form", "session"],
1617
+ default: "form"
1618
+ }
1619
+ },
1620
+ { _id: false }
1621
+ );
1622
+ var layoutSchema = new import_mongoose4.Schema(
1623
+ {
1624
+ columns: { type: Number, default: 1, min: 1, max: 4 },
1625
+ collapsible: { type: Boolean, default: false },
1626
+ groupKey: { type: String }
1627
+ },
1628
+ { _id: false }
1629
+ );
1630
+ var questionSchemaDefinition = {
1631
+ _schemaVersion: {
1632
+ type: Number,
1633
+ required: true,
1634
+ default: 1
1635
+ },
1636
+ // Audit fields
1637
+ createdUser: {
1638
+ type: import_mongoose4.Schema.Types.ObjectId,
1639
+ required: true,
1640
+ index: true
1641
+ },
1642
+ updatedUser: {
1643
+ type: import_mongoose4.Schema.Types.ObjectId,
1644
+ index: true
1645
+ },
1646
+ // Versioning
1647
+ key: {
1648
+ type: String,
1649
+ required: true
1650
+ },
1651
+ version: {
1652
+ type: String,
1653
+ required: true
1654
+ },
1655
+ // Question definition
1656
+ index: {
1657
+ type: Number,
1658
+ required: true
1659
+ },
1660
+ text: {
1661
+ type: String,
1662
+ required: true
1663
+ },
1664
+ format: {
1665
+ type: String,
1666
+ required: true
1667
+ },
1668
+ sectionId: {
1669
+ type: String,
1670
+ required: true
1671
+ },
1672
+ required: {
1673
+ type: Boolean,
1674
+ default: false
1675
+ },
1676
+ allowMultiple: {
1677
+ type: Boolean,
1678
+ default: false
1679
+ },
1680
+ // Nesting
1681
+ isNested: {
1682
+ type: Boolean,
1683
+ default: false
1684
+ },
1685
+ nested: {
1686
+ type: [String],
1687
+ default: []
1688
+ },
1689
+ // Trigger logic
1690
+ isTriggered: {
1691
+ type: Boolean,
1692
+ default: false
1693
+ },
1694
+ triggersWhenAnswered: {
1695
+ type: [String],
1696
+ default: []
1697
+ },
1698
+ // Display
1699
+ header: { type: String },
1700
+ directions: { type: String },
1701
+ tip: { type: String },
1702
+ // Dynamic choices
1703
+ hasDynamicChoices: {
1704
+ type: Boolean,
1705
+ default: false
1706
+ },
1707
+ dynamicChoiceSet: { type: String },
1708
+ group: { type: String },
1709
+ // Static choices
1710
+ choices: {
1711
+ type: [choiceSchema],
1712
+ default: []
1713
+ },
1714
+ // UI rendering hints
1715
+ componentProps: {
1716
+ type: import_mongoose4.Schema.Types.Mixed
1717
+ },
1718
+ // Autofill
1719
+ autofillRules: {
1720
+ type: import_mongoose4.Schema.Types.Mixed,
1721
+ default: []
1722
+ },
1723
+ // Classification
1724
+ formType: {
1725
+ type: [String],
1726
+ enum: ["screening", "intake", "assessment", "demographics"],
1727
+ default: []
1728
+ },
1729
+ icCode: {
1730
+ type: String
1731
+ },
1732
+ // Lifecycle
1733
+ status: {
1734
+ type: String,
1735
+ required: true,
1736
+ enum: ["draft", "active", "deprecated"],
1737
+ default: "draft",
1738
+ index: true
1739
+ },
1740
+ supersedes: {
1741
+ type: String
1742
+ },
1743
+ // Entity mapping (dual-write bridge)
1744
+ targetEntity: {
1745
+ type: String,
1746
+ enum: [
1747
+ "caseSession",
1748
+ "protectedPerson",
1749
+ "perpetratorPerson",
1750
+ "personnelPerson",
1751
+ "caseRecord",
1752
+ "serviceInstance"
1753
+ ]
1754
+ },
1755
+ targetField: {
1756
+ type: String
1757
+ },
1758
+ // Conditional visibility
1759
+ visibilityRule: {
1760
+ type: visibilityRuleSchema
1761
+ },
1762
+ // Layout hints
1763
+ layout: {
1764
+ type: layoutSchema
1765
+ },
1766
+ microcopy: {
1767
+ type: String
1768
+ },
1769
+ sensitivity: {
1770
+ type: String,
1771
+ enum: ["standard", "sensitive", "highly_sensitive"]
1772
+ },
1773
+ // Scoring group
1774
+ scoringGroup: {
1775
+ type: String
1776
+ },
1777
+ // PAVE-aligned optional fields
1778
+ groups: {
1779
+ type: [String],
1780
+ default: void 0
1781
+ },
1782
+ rephrasingSelector: {
1783
+ type: import_mongoose4.Schema.Types.Mixed
1784
+ },
1785
+ textSelector: {
1786
+ type: import_mongoose4.Schema.Types.Mixed
1787
+ },
1788
+ tipSelector: {
1789
+ type: import_mongoose4.Schema.Types.Mixed
1790
+ },
1791
+ sortChoices: {
1792
+ type: Boolean
1793
+ },
1794
+ isAllRequired: {
1795
+ type: Boolean
1796
+ },
1797
+ itemLabel: {
1798
+ type: String
1799
+ },
1800
+ prompts: {
1801
+ type: [String],
1802
+ default: void 0
1803
+ },
1804
+ rephrasing: {
1805
+ type: String
1806
+ },
1807
+ dynamicChoiceTrigger: {
1808
+ type: String
1809
+ }
1810
+ };
1811
+ var questionSchemaOptions = {
1812
+ timestamps: {
1813
+ createdAt: "createdTime",
1814
+ updatedAt: "updatedTime"
1815
+ },
1816
+ collection: "questions"
1817
+ };
1818
+ function buildQuestionSchema() {
1819
+ const schema = new import_mongoose4.Schema(questionSchemaDefinition, questionSchemaOptions);
1820
+ schema.index({ key: 1, version: 1 }, { unique: true });
1821
+ schema.index(
1822
+ { key: 1 },
1823
+ { unique: true, partialFilterExpression: { status: "active" } }
1824
+ );
1825
+ schema.index({ sectionId: 1, index: 1 });
1826
+ schema.index({ icCode: 1 }, { sparse: true });
1827
+ return schema;
1828
+ }
1829
+ var _questionSchema = buildQuestionSchema();
1830
+
1831
+ // src/schemas/scoring-rule.ts
1832
+ var import_mongoose5 = require("mongoose");
1833
+ var scoringConditionSchema = new import_mongoose5.Schema(
1834
+ {
1835
+ questionKey: { type: String, required: true },
1836
+ operator: {
1837
+ type: String,
1838
+ required: true,
1839
+ enum: ["eq", "ne", "in", "not_in", "gt", "gte", "lt", "lte"]
1840
+ },
1841
+ value: { type: import_mongoose5.Schema.Types.Mixed, required: true },
1842
+ weight: { type: Number, required: true }
1843
+ },
1844
+ { _id: false }
1845
+ );
1846
+ var scoringThresholdSchema = new import_mongoose5.Schema(
1847
+ {
1848
+ minScore: { type: Number, required: true },
1849
+ maxScore: { type: Number, required: true },
1850
+ riskLevel: { type: String, required: true },
1851
+ label: { type: String, required: true }
1852
+ },
1853
+ { _id: false }
1854
+ );
1855
+ var scoringRecommendationSchema = new import_mongoose5.Schema(
1856
+ {
1857
+ riskLevel: { type: String, required: true },
1858
+ action: { type: String, required: true },
1859
+ description: { type: String, required: true }
1860
+ },
1861
+ { _id: false }
1862
+ );
1863
+ var scoringRuleSchemaDefinition = {
1864
+ _schemaVersion: {
1865
+ type: Number,
1866
+ required: true,
1867
+ default: 1
1868
+ },
1869
+ // Audit fields
1870
+ createdUser: {
1871
+ type: import_mongoose5.Schema.Types.ObjectId,
1872
+ required: true,
1873
+ index: true
1874
+ },
1875
+ updatedUser: {
1876
+ type: import_mongoose5.Schema.Types.ObjectId,
1877
+ index: true
1878
+ },
1879
+ // Reference to Form (cross-db string, not ObjectId)
1880
+ formId: {
1881
+ type: String,
1882
+ required: true
1883
+ },
1884
+ formVersion: {
1885
+ type: String,
1886
+ required: true
1887
+ },
1888
+ // Rule info
1889
+ name: {
1890
+ type: String,
1891
+ required: true
1892
+ },
1893
+ version: {
1894
+ type: String,
1895
+ required: true
1896
+ },
1897
+ appScope: {
1898
+ type: [String],
1899
+ enum: ["thread", "pave", "both"],
1900
+ default: []
1901
+ },
1902
+ // Lifecycle
1903
+ status: {
1904
+ type: String,
1905
+ required: true,
1906
+ enum: ["draft", "active", "deprecated"],
1907
+ default: "draft",
1908
+ index: true
1909
+ },
1910
+ effectiveDate: {
1911
+ type: Date
1912
+ },
1913
+ deprecatedDate: {
1914
+ type: Date
1915
+ },
1916
+ replacedBy: {
1917
+ type: String
1918
+ },
1919
+ // Scoring logic
1920
+ conditions: {
1921
+ type: [scoringConditionSchema],
1922
+ default: []
1923
+ },
1924
+ thresholds: {
1925
+ type: [scoringThresholdSchema],
1926
+ default: []
1927
+ },
1928
+ recommendations: {
1929
+ type: [scoringRecommendationSchema],
1930
+ default: []
1931
+ }
1932
+ };
1933
+ var scoringRuleSchemaOptions = {
1934
+ timestamps: {
1935
+ createdAt: "createdTime",
1936
+ updatedAt: "updatedTime"
1937
+ },
1938
+ collection: "scoringrules"
1939
+ };
1940
+ function buildScoringRuleSchema() {
1941
+ const schema = new import_mongoose5.Schema(
1942
+ scoringRuleSchemaDefinition,
1943
+ scoringRuleSchemaOptions
1944
+ );
1945
+ schema.index(
1946
+ { formId: 1, formVersion: 1, version: 1, name: 1 },
1947
+ { unique: true }
1948
+ );
1949
+ schema.index({ formId: 1, formVersion: 1, status: 1 });
1950
+ return schema;
1951
+ }
1952
+ var _scoringRuleSchema = buildScoringRuleSchema();
1953
+
1954
+ // src/models/formModel.ts
1955
+ var formModel_exports = {};
1956
+ __export(formModel_exports, {
1957
+ buildSchema: () => buildFormSchema,
1958
+ compileModel: () => compileModel
1959
+ });
1960
+ function compileModel(connection, schema = buildFormSchema()) {
1961
+ return connection.model("Form", schema);
1962
+ }
1963
+
1964
+ // src/models/sectionModel.ts
1965
+ var sectionModel_exports = {};
1966
+ __export(sectionModel_exports, {
1967
+ buildSchema: () => buildSectionSchema,
1968
+ compileModel: () => compileModel2
1969
+ });
1970
+ function compileModel2(connection, schema = buildSectionSchema()) {
1971
+ return connection.model("Section", schema);
1972
+ }
1973
+
1974
+ // src/models/questionModel.ts
1975
+ var questionModel_exports = {};
1976
+ __export(questionModel_exports, {
1977
+ buildSchema: () => buildQuestionSchema,
1978
+ compileModel: () => compileModel3
1979
+ });
1980
+ function compileModel3(connection, schema = buildQuestionSchema()) {
1981
+ return connection.model("Question", schema);
1982
+ }
1983
+
1984
+ // src/models/scoringRuleModel.ts
1985
+ var scoringRuleModel_exports = {};
1986
+ __export(scoringRuleModel_exports, {
1987
+ buildSchema: () => buildScoringRuleSchema,
1988
+ compileModel: () => compileModel4
1989
+ });
1990
+ function compileModel4(connection, schema = buildScoringRuleSchema()) {
1991
+ return connection.model("ScoringRule", schema);
1992
+ }
1993
+
1994
+ // src/models/index.ts
1995
+ function createPlatformModels(connection) {
1996
+ return {
1997
+ FormModel: compileModel(connection),
1998
+ SectionModel: compileModel2(connection),
1999
+ QuestionModel: compileModel3(connection),
2000
+ ScoringRuleModel: compileModel4(connection)
2001
+ };
2002
+ }
2003
+ // Annotate the CommonJS export names for ESM import in node:
2004
+ 0 && (module.exports = {
2005
+ ACCOMMODATION_LABELS,
2006
+ ACCOMMODATION_OPTIONS,
2007
+ AGE_BIN_REPORTING,
2008
+ AGE_BIN_REPORTING_IS_MINOR,
2009
+ AGE_BIN_REPORTING_LABELS,
2010
+ APPARENT_AGE,
2011
+ APPARENT_AGE_LABELS,
2012
+ APP_SCOPE,
2013
+ CALLER_IS_VICTIM_ROLES,
2014
+ DATA_QUALITY,
2015
+ DATA_QUALITY_DESCRIPTIONS,
2016
+ DATA_QUALITY_LABELS,
2017
+ DATA_QUALITY_VALUES,
2018
+ DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY,
2019
+ FORM_STATUS,
2020
+ FORM_STATUS_LABELS,
2021
+ FORM_TYPE,
2022
+ FORM_TYPE_LABELS,
2023
+ IC_13_CATEGORIES,
2024
+ IC_13_CATEGORY_ORDER,
2025
+ IC_13_LABELS,
2026
+ IC_13_PRIORITY_GROUPS,
2027
+ IC_13_RELATIONSHIP_ABBREV,
2028
+ IC_13_RELATIONSHIP_TYPE,
2029
+ IC_13_REVERSE_CONTEXT_LABELS,
2030
+ IC_22_CORE_SEX,
2031
+ IC_22_LABELS,
2032
+ IC_23_CORE_GENDER_IDENTITY,
2033
+ IC_23_LABELS,
2034
+ IC_24_LABELS,
2035
+ IC_24_RACE,
2036
+ IC_25_ETHNICITY,
2037
+ IC_25_LABELS,
2038
+ IC_48_SERVICE_CATEGORIES,
2039
+ IC_49_DESCRIPTIONS,
2040
+ IC_49_LABELS,
2041
+ IC_49_REFERRAL_OUTCOME,
2042
+ IC_49_REFERRAL_OUTCOME_LABELS,
2043
+ IC_49_REFERRAL_VERIFICATION,
2044
+ IC_49_REFERRAL_VERIFICATION_LABELS,
2045
+ IC_49_SERVICE_MECHANISM,
2046
+ IC_4_AGE_TYPE,
2047
+ IC_4_LABELS,
2048
+ IC_56_DESCRIPTIONS,
2049
+ IC_56_LABELS,
2050
+ IC_56_SERVICE_DELIVERY_CHANNEL,
2051
+ IC_57_LABELS,
2052
+ IC_57_SERVICE_AUDIENCE,
2053
+ IC_58_EXTERNAL_TIERED,
2054
+ IC_58_LABELS,
2055
+ IC_58_ORG_TYPE_GROUPS,
2056
+ IC_58_PRIMARY_BRANCHES,
2057
+ IC_58_REFERRAL_ENTITY,
2058
+ IC_59_LABELS,
2059
+ IC_59_SERVICE_STATE,
2060
+ IC_5_FULL_LABELS,
2061
+ IC_5_LABELS,
2062
+ IC_5_VICTIMIZATION,
2063
+ INCIDENT_INVOLVEMENT_ROLE,
2064
+ INCIDENT_INVOLVEMENT_ROLE_LABELS,
2065
+ INCIDENT_INVOLVEMENT_ROLE_TO_PERSON_ROLE,
2066
+ INCIDENT_PARTICIPATION_ROLE,
2067
+ INCIDENT_PARTICIPATION_ROLE_LABELS,
2068
+ INCIDENT_PARTICIPATION_ROLE_VALUES,
2069
+ INTERACTION_TYPES,
2070
+ INTERACTION_TYPE_LABELS,
2071
+ INVOLVEMENT_ROLE_TO_PERSON_TYPE,
2072
+ MINOR_ADULT_STATUS,
2073
+ MINOR_ADULT_STATUS_LABELS,
2074
+ PARTICIPATION_ROLE_CATEGORIES,
2075
+ PERSON_DISPLAY_CATEGORY,
2076
+ PERSON_DISPLAY_CATEGORY_LABELS,
2077
+ PERSON_ROLES,
2078
+ PERSON_TYPE,
2079
+ PERSON_TYPE_VALUES,
2080
+ QUESTION_FORMAT,
2081
+ QUESTION_FORMAT_LABELS,
2082
+ QUICK_START_CONFIG,
2083
+ QUICK_START_LABELS,
2084
+ QUICK_START_TEMPLATES,
2085
+ RECORD_STATES,
2086
+ RECORD_STATE_LABELS,
2087
+ RELATIONSHIP_CONCERNS,
2088
+ RELATIONSHIP_CONCERNS_LABELS,
2089
+ RELATIONSHIP_CONCERNS_VALUES,
2090
+ RELATIONSHIP_DYNAMICS,
2091
+ RELATIONSHIP_DYNAMICS_LABELS,
2092
+ RELATIONSHIP_DYNAMICS_VALUES,
2093
+ SESSION_STATES,
2094
+ SESSION_STATE_LABELS,
2095
+ SUBMISSION_STATES,
2096
+ SUBMISSION_STATE_LABELS,
2097
+ THREAD_INVOLVEMENT_ROLES,
2098
+ USER_STATUS,
2099
+ USER_STATUS_LABELS,
2100
+ VALID_INTERACTION_TYPES,
2101
+ VALID_RECORD_STATES,
2102
+ addressSchema,
2103
+ buildFormSchema,
2104
+ buildQuestionSchema,
2105
+ buildScoringRuleSchema,
2106
+ buildSectionSchema,
2107
+ choiceSchema,
2108
+ createPlatformModels,
2109
+ demographicsSchema,
2110
+ deriveAgeBinFromAge,
2111
+ emailSchema,
2112
+ formModel,
2113
+ formSchemaDefinition,
2114
+ formSchemaOptions,
2115
+ formSectionRefSchema,
2116
+ getDisplayCategoryForRole,
2117
+ getPersonTypeForRole,
2118
+ guidanceSchema,
2119
+ layoutSchema,
2120
+ personNameSchema,
2121
+ phoneSchema,
2122
+ questionModel,
2123
+ questionSchemaDefinition,
2124
+ questionSchemaOptions,
2125
+ scoringConditionSchema,
2126
+ scoringRecommendationSchema,
2127
+ scoringRuleModel,
2128
+ scoringRuleSchemaDefinition,
2129
+ scoringRuleSchemaOptions,
2130
+ scoringThresholdSchema,
2131
+ sectionModel,
2132
+ sectionQuestionRefSchema,
2133
+ sectionSchemaDefinition,
2134
+ sectionSchemaOptions,
2135
+ sortRelationshipsByPriority,
2136
+ visibilityRuleSchema
2137
+ });
2138
+ //# sourceMappingURL=index.cjs.map