@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.
- package/dist/constants/index.cjs +1379 -0
- package/dist/constants/index.cjs.map +1 -0
- package/dist/constants/index.d.cts +528 -0
- package/dist/constants/index.d.ts +528 -0
- package/dist/constants/index.js +1252 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/index.cjs +2138 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1986 -0
- package/dist/index.js.map +1 -0
- package/dist/models/index.cjs +661 -0
- package/dist/models/index.cjs.map +1 -0
- package/dist/models/index.d.cts +204 -0
- package/dist/models/index.d.ts +204 -0
- package/dist/models/index.js +636 -0
- package/dist/models/index.js.map +1 -0
- package/dist/schemas/index.cjs +1405 -0
- package/dist/schemas/index.cjs.map +1 -0
- package/dist/schemas/index.d.cts +312 -0
- package/dist/schemas/index.d.ts +312 -0
- package/dist/schemas/index.js +1353 -0
- package/dist/schemas/index.js.map +1 -0
- package/dist/scoring-rule-BOkG46I3.d.cts +1179 -0
- package/dist/scoring-rule-BOkG46I3.d.ts +1179 -0
- package/dist/types/index.cjs +19 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +81 -0
- package/src/constants/ic.ts +1630 -0
- package/src/constants/index.ts +11 -0
- package/src/index.ts +30 -0
- package/src/models/formModel.ts +30 -0
- package/src/models/index.ts +72 -0
- package/src/models/questionModel.ts +30 -0
- package/src/models/scoringRuleModel.ts +33 -0
- package/src/models/sectionModel.ts +30 -0
- package/src/schemas/common.ts +118 -0
- package/src/schemas/form.ts +125 -0
- package/src/schemas/index.ts +70 -0
- package/src/schemas/question.ts +297 -0
- package/src/schemas/scoring-rule.ts +169 -0
- package/src/schemas/section.ts +158 -0
- package/src/types/index.ts +47 -0
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @htilabs/platform-common-models — Information Concept (IC) Constants
|
|
3
|
+
* ENUM integer values matching victim services data standards.
|
|
4
|
+
*
|
|
5
|
+
* Each IC constant object is `as const` so values are narrow literal types.
|
|
6
|
+
* Label records provide display text for UI rendering.
|
|
7
|
+
*/
|
|
8
|
+
declare const DATA_QUALITY: {
|
|
9
|
+
/** Client does not know the answer. */
|
|
10
|
+
readonly CLIENT_DOESNT_KNOW: "client_doesnt_know";
|
|
11
|
+
/** Client explicitly declined to provide the information. */
|
|
12
|
+
readonly CLIENT_PREFERS_NOT_TO_ANSWER: "client_prefers_not_to_answer";
|
|
13
|
+
/** Data was not collected during this interaction. */
|
|
14
|
+
readonly DATA_NOT_COLLECTED: "data_not_collected";
|
|
15
|
+
};
|
|
16
|
+
type DataQualityValue = (typeof DATA_QUALITY)[keyof typeof DATA_QUALITY];
|
|
17
|
+
/** Tuple of valid DATA_QUALITY values for enum constraints (preserves literal types). */
|
|
18
|
+
declare const DATA_QUALITY_VALUES: readonly ["client_doesnt_know", "client_prefers_not_to_answer", "data_not_collected"];
|
|
19
|
+
declare const DATA_QUALITY_LABELS: Record<DataQualityValue, string>;
|
|
20
|
+
declare const DATA_QUALITY_DESCRIPTIONS: Record<DataQualityValue, string>;
|
|
21
|
+
declare const IC_5_VICTIMIZATION: {
|
|
22
|
+
readonly DV: 1;
|
|
23
|
+
readonly SA: 2;
|
|
24
|
+
readonly DMST: 3;
|
|
25
|
+
readonly ST: 4;
|
|
26
|
+
readonly LT: 5;
|
|
27
|
+
readonly OTHER: 99;
|
|
28
|
+
};
|
|
29
|
+
type IC5Value = (typeof IC_5_VICTIMIZATION)[keyof typeof IC_5_VICTIMIZATION];
|
|
30
|
+
declare const IC_5_LABELS: Record<IC5Value, string>;
|
|
31
|
+
declare const IC_5_FULL_LABELS: Record<IC5Value, string>;
|
|
32
|
+
declare const IC_13_RELATIONSHIP_TYPE: {
|
|
33
|
+
readonly SPOUSE: 1;
|
|
34
|
+
readonly PARTNER: 2;
|
|
35
|
+
readonly PARENT: 3;
|
|
36
|
+
readonly CHILD: 4;
|
|
37
|
+
readonly SIBLING: 5;
|
|
38
|
+
readonly OTHER_FAMILY: 6;
|
|
39
|
+
readonly ROOMMATE: 7;
|
|
40
|
+
readonly FRIEND: 8;
|
|
41
|
+
readonly COWORKER: 9;
|
|
42
|
+
readonly ACQUAINTANCE: 10;
|
|
43
|
+
readonly STRANGER: 11;
|
|
44
|
+
readonly OTHER: 99;
|
|
45
|
+
};
|
|
46
|
+
type IC13Value = (typeof IC_13_RELATIONSHIP_TYPE)[keyof typeof IC_13_RELATIONSHIP_TYPE];
|
|
47
|
+
declare const IC_13_LABELS: Record<IC13Value, string>;
|
|
48
|
+
declare const IC_13_RELATIONSHIP_ABBREV: Record<IC13Value, string>;
|
|
49
|
+
/**
|
|
50
|
+
* IC-13 relationship priority groups.
|
|
51
|
+
* Order: Familial > Romantic > Close social > Business > Other social > ungrouped.
|
|
52
|
+
* Used by the UI to sort and group relationship dropdown options.
|
|
53
|
+
*/
|
|
54
|
+
interface IC13PriorityGroup {
|
|
55
|
+
label: string;
|
|
56
|
+
codes: readonly IC13Value[];
|
|
57
|
+
}
|
|
58
|
+
declare const IC_13_PRIORITY_GROUPS: readonly IC13PriorityGroup[];
|
|
59
|
+
/**
|
|
60
|
+
* IC-13 reverse-context labels: frames the relationship FROM the person
|
|
61
|
+
* TO the Primary Victim. E.g., "Parent of victim" means the person IS
|
|
62
|
+
* the parent of the victim.
|
|
63
|
+
*/
|
|
64
|
+
declare const IC_13_REVERSE_CONTEXT_LABELS: Record<IC13Value, string>;
|
|
65
|
+
/**
|
|
66
|
+
* Sort IC-13 relationship codes by priority group order.
|
|
67
|
+
* Codes not in any group are appended at the end.
|
|
68
|
+
*/
|
|
69
|
+
declare function sortRelationshipsByPriority(codes: number[]): number[];
|
|
70
|
+
declare const IC_13_CATEGORIES: {
|
|
71
|
+
readonly familial: readonly IC13Value[];
|
|
72
|
+
readonly romantic: readonly IC13Value[];
|
|
73
|
+
readonly close_social: readonly IC13Value[];
|
|
74
|
+
readonly business: readonly IC13Value[];
|
|
75
|
+
readonly other_social: readonly IC13Value[];
|
|
76
|
+
readonly ungrouped: readonly IC13Value[];
|
|
77
|
+
};
|
|
78
|
+
type IC13Category = keyof typeof IC_13_CATEGORIES;
|
|
79
|
+
/** Display priority order for IC-13 categories (highest priority first). */
|
|
80
|
+
declare const IC_13_CATEGORY_ORDER: readonly IC13Category[];
|
|
81
|
+
declare const RELATIONSHIP_DYNAMICS: {
|
|
82
|
+
readonly APPEARS_CONTROLLING: "appears_controlling";
|
|
83
|
+
readonly CONTROLS_FINANCES: "controls_finances";
|
|
84
|
+
readonly CONTROLS_DOCUMENTATION: "controls_documentation";
|
|
85
|
+
readonly EMOTIONAL_VERBAL_ABUSE: "emotional_verbal_abuse";
|
|
86
|
+
readonly PHYSICAL_ABUSE: "physical_abuse";
|
|
87
|
+
readonly SEXUAL_ABUSE: "sexual_abuse";
|
|
88
|
+
readonly THREATS_OF_HARM: "threats_of_harm";
|
|
89
|
+
readonly THREATS_OF_LEGAL_TROUBLE: "threats_of_legal_trouble";
|
|
90
|
+
readonly AGE_DISPARITY: "age_disparity";
|
|
91
|
+
readonly HAS_KIDS_WITH: "has_kids_with";
|
|
92
|
+
};
|
|
93
|
+
type RelationshipDynamicValue = (typeof RELATIONSHIP_DYNAMICS)[keyof typeof RELATIONSHIP_DYNAMICS];
|
|
94
|
+
declare const RELATIONSHIP_DYNAMICS_LABELS: Record<RelationshipDynamicValue, string>;
|
|
95
|
+
declare const RELATIONSHIP_DYNAMICS_VALUES: readonly RelationshipDynamicValue[];
|
|
96
|
+
declare const RELATIONSHIP_CONCERNS: {
|
|
97
|
+
readonly SAFETY: "safety";
|
|
98
|
+
readonly CUSTODY: "custody";
|
|
99
|
+
readonly IMMIGRATION: "immigration";
|
|
100
|
+
readonly FINANCIAL: "financial";
|
|
101
|
+
readonly HOUSING: "housing";
|
|
102
|
+
readonly SUBSTANCE_USE: "substance_use";
|
|
103
|
+
readonly MENTAL_HEALTH: "mental_health";
|
|
104
|
+
readonly CHILD_WELFARE: "child_welfare";
|
|
105
|
+
};
|
|
106
|
+
type RelationshipConcernValue = (typeof RELATIONSHIP_CONCERNS)[keyof typeof RELATIONSHIP_CONCERNS];
|
|
107
|
+
declare const RELATIONSHIP_CONCERNS_LABELS: Record<RelationshipConcernValue, string>;
|
|
108
|
+
declare const RELATIONSHIP_CONCERNS_VALUES: readonly RelationshipConcernValue[];
|
|
109
|
+
interface ServiceCategoryChild {
|
|
110
|
+
id: number;
|
|
111
|
+
label: string;
|
|
112
|
+
}
|
|
113
|
+
interface ServiceCategory {
|
|
114
|
+
id: number;
|
|
115
|
+
label: string;
|
|
116
|
+
children: ServiceCategoryChild[];
|
|
117
|
+
}
|
|
118
|
+
declare const IC_48_SERVICE_CATEGORIES: ServiceCategory[];
|
|
119
|
+
declare const IC_49_SERVICE_MECHANISM: {
|
|
120
|
+
readonly DATA_NOT_COLLECTED: -2;
|
|
121
|
+
readonly ANONYMOUS: -1;
|
|
122
|
+
readonly UNKNOWN: 0;
|
|
123
|
+
readonly SUPPORT_VIA_REFERRAL: 3;
|
|
124
|
+
readonly INFORMATIONAL_SUPPORT: 4;
|
|
125
|
+
readonly DIRECT_STAFF_CONTRACTOR: 1;
|
|
126
|
+
readonly FINANCIAL_MATERIAL_ASSISTANCE: 2;
|
|
127
|
+
readonly SUPPORT_IDENTIFIED_NOT_ADMINISTERED: 5;
|
|
128
|
+
};
|
|
129
|
+
type IC49Value = (typeof IC_49_SERVICE_MECHANISM)[keyof typeof IC_49_SERVICE_MECHANISM];
|
|
130
|
+
declare const IC_49_LABELS: Record<IC49Value, string>;
|
|
131
|
+
declare const IC_49_DESCRIPTIONS: Record<IC49Value, string>;
|
|
132
|
+
declare const IC_56_SERVICE_DELIVERY_CHANNEL: {
|
|
133
|
+
readonly IN_PERSON: 1;
|
|
134
|
+
readonly ON_SCENE: 2;
|
|
135
|
+
readonly PHONE: 3;
|
|
136
|
+
readonly EMAIL_TEXT_CHAT: 4;
|
|
137
|
+
readonly VIRTUAL: 5;
|
|
138
|
+
};
|
|
139
|
+
type IC56Value = (typeof IC_56_SERVICE_DELIVERY_CHANNEL)[keyof typeof IC_56_SERVICE_DELIVERY_CHANNEL];
|
|
140
|
+
declare const IC_56_LABELS: Record<IC56Value, string>;
|
|
141
|
+
declare const IC_56_DESCRIPTIONS: Record<IC56Value, string>;
|
|
142
|
+
declare const IC_57_SERVICE_AUDIENCE: {
|
|
143
|
+
readonly CLIENT_VICTIM: 1;
|
|
144
|
+
readonly THIRD_PARTY: 2;
|
|
145
|
+
readonly DEPENDENT_SECONDARY: 3;
|
|
146
|
+
readonly CLIENT_GROUPS: 4;
|
|
147
|
+
};
|
|
148
|
+
type IC57Value = (typeof IC_57_SERVICE_AUDIENCE)[keyof typeof IC_57_SERVICE_AUDIENCE];
|
|
149
|
+
declare const IC_57_LABELS: Record<IC57Value, string>;
|
|
150
|
+
declare const IC_58_REFERRAL_ENTITY: {
|
|
151
|
+
readonly UNKNOWN: 0;
|
|
152
|
+
readonly INTERNAL: 1;
|
|
153
|
+
readonly INDIVIDUAL_SELF: 2;
|
|
154
|
+
readonly INDIVIDUAL_FAMILY: 3;
|
|
155
|
+
readonly INDIVIDUAL_PEER: 4;
|
|
156
|
+
readonly INDIVIDUAL_OTHER: 5;
|
|
157
|
+
readonly EXTERNAL_HOUSING_SHELTER: 10;
|
|
158
|
+
readonly EXTERNAL_HOTLINE: 11;
|
|
159
|
+
readonly EXTERNAL_JUSTICE: 12;
|
|
160
|
+
readonly EXTERNAL_OUTREACH: 13;
|
|
161
|
+
readonly EXTERNAL_TEMPORARY_SHELTER: 14;
|
|
162
|
+
readonly EXTERNAL_RESIDENTIAL: 15;
|
|
163
|
+
readonly EXTERNAL_HEALTH: 16;
|
|
164
|
+
readonly EXTERNAL_EDUCATION: 17;
|
|
165
|
+
readonly EXTERNAL_LAW_ENFORCEMENT: 18;
|
|
166
|
+
readonly EXTERNAL_OTHER: 19;
|
|
167
|
+
readonly EXTERNAL_CHILD_WELFARE: 20;
|
|
168
|
+
readonly EXTERNAL_JUVENILE_JUSTICE: 21;
|
|
169
|
+
readonly EXTERNAL_COURTS: 22;
|
|
170
|
+
readonly EXTERNAL_CORRECTIONS: 23;
|
|
171
|
+
readonly EXTERNAL_INPATIENT_PSYCH: 24;
|
|
172
|
+
readonly EXTERNAL_HEALTHCARE_PROVIDER: 25;
|
|
173
|
+
readonly EXTERNAL_VICTIM_COMMUNITY: 26;
|
|
174
|
+
readonly EXTERNAL_CAC: 27;
|
|
175
|
+
readonly EXTERNAL_VSP: 28;
|
|
176
|
+
readonly EXTERNAL_COMMUNITY_PROVIDER: 29;
|
|
177
|
+
readonly EXTERNAL_EMPLOYER: 30;
|
|
178
|
+
readonly EXTERNAL_BENEFITS: 31;
|
|
179
|
+
};
|
|
180
|
+
type IC58Value = (typeof IC_58_REFERRAL_ENTITY)[keyof typeof IC_58_REFERRAL_ENTITY];
|
|
181
|
+
declare const IC_58_LABELS: Record<IC58Value, string>;
|
|
182
|
+
interface ReferralBranch {
|
|
183
|
+
value?: number;
|
|
184
|
+
label: string;
|
|
185
|
+
description: string;
|
|
186
|
+
children?: {
|
|
187
|
+
value: number;
|
|
188
|
+
label: string;
|
|
189
|
+
}[];
|
|
190
|
+
}
|
|
191
|
+
declare const IC_58_PRIMARY_BRANCHES: Record<string, ReferralBranch>;
|
|
192
|
+
interface OrgTypeGroup {
|
|
193
|
+
value: number;
|
|
194
|
+
label: string;
|
|
195
|
+
description?: string;
|
|
196
|
+
children: {
|
|
197
|
+
value: number;
|
|
198
|
+
label: string;
|
|
199
|
+
}[];
|
|
200
|
+
}
|
|
201
|
+
declare const IC_58_ORG_TYPE_GROUPS: OrgTypeGroup[];
|
|
202
|
+
interface IC58ExternalCategory {
|
|
203
|
+
id: number;
|
|
204
|
+
label: string;
|
|
205
|
+
description: string;
|
|
206
|
+
children: {
|
|
207
|
+
id: number;
|
|
208
|
+
label: string;
|
|
209
|
+
}[];
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Tiered organization type structure for External referral sources.
|
|
213
|
+
* Parent categories are collapsible; leaf children are selectable.
|
|
214
|
+
* Based on core_referral_entity_category codebook from Notion.
|
|
215
|
+
*/
|
|
216
|
+
declare const IC_58_EXTERNAL_TIERED: IC58ExternalCategory[];
|
|
217
|
+
declare const IC_59_SERVICE_STATE: {
|
|
218
|
+
readonly IDENTIFIED: 1;
|
|
219
|
+
readonly REFERRED: 2;
|
|
220
|
+
readonly IN_PROGRESS: 3;
|
|
221
|
+
readonly COMPLETED: 4;
|
|
222
|
+
readonly DECLINED: 5;
|
|
223
|
+
};
|
|
224
|
+
type IC59Value = (typeof IC_59_SERVICE_STATE)[keyof typeof IC_59_SERVICE_STATE];
|
|
225
|
+
declare const IC_59_LABELS: Record<IC59Value, string>;
|
|
226
|
+
declare const IC_49_REFERRAL_OUTCOME: {
|
|
227
|
+
readonly UNKNOWN: 0;
|
|
228
|
+
readonly ATTAINED: 1;
|
|
229
|
+
readonly NOT_ATTAINED: 2;
|
|
230
|
+
};
|
|
231
|
+
type IC49ReferralOutcomeValue = (typeof IC_49_REFERRAL_OUTCOME)[keyof typeof IC_49_REFERRAL_OUTCOME];
|
|
232
|
+
declare const IC_49_REFERRAL_OUTCOME_LABELS: Record<IC49ReferralOutcomeValue, string>;
|
|
233
|
+
declare const IC_49_REFERRAL_VERIFICATION: {
|
|
234
|
+
readonly REFERRAL_MADE: 1;
|
|
235
|
+
readonly CONFIRMED_RECEIVED: 2;
|
|
236
|
+
};
|
|
237
|
+
type IC49ReferralVerificationValue = (typeof IC_49_REFERRAL_VERIFICATION)[keyof typeof IC_49_REFERRAL_VERIFICATION];
|
|
238
|
+
declare const IC_49_REFERRAL_VERIFICATION_LABELS: Record<IC49ReferralVerificationValue, string>;
|
|
239
|
+
declare const SESSION_STATES: {
|
|
240
|
+
readonly INITIALIZED: 1;
|
|
241
|
+
readonly ACTION_NEEDED: 2;
|
|
242
|
+
readonly PENDING_SAVE: 3;
|
|
243
|
+
readonly CLOSED: 4;
|
|
244
|
+
readonly DISCARDED: 5;
|
|
245
|
+
};
|
|
246
|
+
type SessionStateValue = (typeof SESSION_STATES)[keyof typeof SESSION_STATES];
|
|
247
|
+
declare const SESSION_STATE_LABELS: Record<SessionStateValue, string>;
|
|
248
|
+
declare const RECORD_STATES: {
|
|
249
|
+
readonly OPEN: 1;
|
|
250
|
+
readonly CLAIMED: 2;
|
|
251
|
+
readonly SUBMITTED_NO_SHARES: 3;
|
|
252
|
+
readonly SUBMITTED_WITH_SHARES: 4;
|
|
253
|
+
readonly CLOSED: 5;
|
|
254
|
+
};
|
|
255
|
+
type RecordStateValue = (typeof RECORD_STATES)[keyof typeof RECORD_STATES];
|
|
256
|
+
declare const RECORD_STATE_LABELS: Record<RecordStateValue, string>;
|
|
257
|
+
declare const INTERACTION_TYPES: {
|
|
258
|
+
readonly HOTLINE_CALL: 1;
|
|
259
|
+
readonly LAP_INCIDENT: 2;
|
|
260
|
+
readonly FIELD_RESPONSE: 3;
|
|
261
|
+
readonly EMAIL_CRISIS: 4;
|
|
262
|
+
readonly OTHER: 99;
|
|
263
|
+
};
|
|
264
|
+
type InteractionTypeValue = (typeof INTERACTION_TYPES)[keyof typeof INTERACTION_TYPES];
|
|
265
|
+
/** Tuple of valid INTERACTION_TYPES values for schema constraints. */
|
|
266
|
+
declare const VALID_INTERACTION_TYPES: readonly InteractionTypeValue[];
|
|
267
|
+
/** Tuple of valid RECORD_STATES values for schema constraints. */
|
|
268
|
+
declare const VALID_RECORD_STATES: readonly RecordStateValue[];
|
|
269
|
+
declare const INTERACTION_TYPE_LABELS: Record<InteractionTypeValue, string>;
|
|
270
|
+
declare const INCIDENT_INVOLVEMENT_ROLE: {
|
|
271
|
+
readonly VICTIM_PRIMARY: "victim_primary";
|
|
272
|
+
readonly VICTIM_SECONDARY: "victim_secondary";
|
|
273
|
+
readonly VICTIM_OTHER: "victim_other";
|
|
274
|
+
readonly DEPENDENT: "dependent";
|
|
275
|
+
readonly WITNESS: "witness";
|
|
276
|
+
readonly OFFENDER: "offender";
|
|
277
|
+
readonly UNKNOWN: "unknown";
|
|
278
|
+
readonly ANONYMOUS: "anonymous";
|
|
279
|
+
readonly NOT_COLLECTED: "not_collected";
|
|
280
|
+
};
|
|
281
|
+
type IncidentInvolvementRoleValue = (typeof INCIDENT_INVOLVEMENT_ROLE)[keyof typeof INCIDENT_INVOLVEMENT_ROLE];
|
|
282
|
+
declare const INCIDENT_INVOLVEMENT_ROLE_LABELS: Record<IncidentInvolvementRoleValue, string>;
|
|
283
|
+
/** Involvement roles available for selection in Thread UI (excludes victim_other and not_collected). */
|
|
284
|
+
declare const THREAD_INVOLVEMENT_ROLES: readonly ["victim_primary", "victim_secondary", "dependent", "witness", "offender", "unknown", "anonymous"];
|
|
285
|
+
declare const PERSON_ROLES: {
|
|
286
|
+
readonly VICTIM_CLIENT: "Victim / Client";
|
|
287
|
+
readonly CALLER_REPORTER: "Caller / Reporter";
|
|
288
|
+
readonly DEPENDENT: "Dependent / Secondary Victim";
|
|
289
|
+
readonly OFFENDER: "Offender";
|
|
290
|
+
readonly PERSONNEL: "Personnel / Staff";
|
|
291
|
+
readonly OTHER: "Other";
|
|
292
|
+
};
|
|
293
|
+
type PersonRoleValue = (typeof PERSON_ROLES)[keyof typeof PERSON_ROLES];
|
|
294
|
+
/**
|
|
295
|
+
* Maps IncidentInvolvementRoleValue (enum key stored on PersonInteracted) to
|
|
296
|
+
* the corresponding PersonRoleValue display string used in the UI.
|
|
297
|
+
*
|
|
298
|
+
* PersonnelPerson always receives PERSON_ROLES.PERSONNEL regardless of their
|
|
299
|
+
* personInvolvementRole — handle that case before consulting this map.
|
|
300
|
+
*
|
|
301
|
+
* All victim variants (primary, secondary, other) resolve to VICTIM_CLIENT
|
|
302
|
+
* because Thread treats them uniformly in the person block UI.
|
|
303
|
+
*/
|
|
304
|
+
declare const INCIDENT_INVOLVEMENT_ROLE_TO_PERSON_ROLE: Record<IncidentInvolvementRoleValue, PersonRoleValue>;
|
|
305
|
+
declare const IC_4_AGE_TYPE: {
|
|
306
|
+
readonly EXACT_DOB: 1;
|
|
307
|
+
readonly APPROXIMATE: 2;
|
|
308
|
+
readonly ESTIMATED_RANGE: 3;
|
|
309
|
+
readonly UNKNOWN: 99;
|
|
310
|
+
};
|
|
311
|
+
type IC4Value = (typeof IC_4_AGE_TYPE)[keyof typeof IC_4_AGE_TYPE];
|
|
312
|
+
declare const IC_4_LABELS: Record<IC4Value, string>;
|
|
313
|
+
declare const IC_22_CORE_SEX: {
|
|
314
|
+
readonly FEMALE: 1;
|
|
315
|
+
readonly MALE: 2;
|
|
316
|
+
readonly INTERSEX: 3;
|
|
317
|
+
readonly UNKNOWN: 99;
|
|
318
|
+
};
|
|
319
|
+
type IC22Value = (typeof IC_22_CORE_SEX)[keyof typeof IC_22_CORE_SEX];
|
|
320
|
+
declare const IC_22_LABELS: Record<IC22Value, string>;
|
|
321
|
+
declare const IC_23_CORE_GENDER_IDENTITY: {
|
|
322
|
+
readonly FEMALE: 1;
|
|
323
|
+
readonly MALE: 2;
|
|
324
|
+
readonly NON_BINARY: 3;
|
|
325
|
+
readonly TRANSGENDER_FEMALE: 4;
|
|
326
|
+
readonly TRANSGENDER_MALE: 5;
|
|
327
|
+
readonly UNKNOWN: 99;
|
|
328
|
+
};
|
|
329
|
+
type IC23Value = (typeof IC_23_CORE_GENDER_IDENTITY)[keyof typeof IC_23_CORE_GENDER_IDENTITY];
|
|
330
|
+
declare const IC_23_LABELS: Record<IC23Value, string>;
|
|
331
|
+
declare const IC_24_RACE: {
|
|
332
|
+
readonly AMERICAN_INDIAN_ALASKA_NATIVE: 1;
|
|
333
|
+
readonly ASIAN: 2;
|
|
334
|
+
readonly BLACK_AFRICAN_AMERICAN: 3;
|
|
335
|
+
readonly NATIVE_HAWAIIAN_PACIFIC_ISLANDER: 4;
|
|
336
|
+
readonly WHITE: 5;
|
|
337
|
+
readonly MULTIPLE_RACES: 6;
|
|
338
|
+
readonly UNKNOWN: 99;
|
|
339
|
+
};
|
|
340
|
+
type IC24Value = (typeof IC_24_RACE)[keyof typeof IC_24_RACE];
|
|
341
|
+
declare const IC_24_LABELS: Record<IC24Value, string>;
|
|
342
|
+
declare const IC_25_ETHNICITY: {
|
|
343
|
+
readonly HISPANIC_LATINO: 1;
|
|
344
|
+
readonly NOT_HISPANIC_LATINO: 2;
|
|
345
|
+
readonly UNKNOWN: 99;
|
|
346
|
+
};
|
|
347
|
+
type IC25Value = (typeof IC_25_ETHNICITY)[keyof typeof IC_25_ETHNICITY];
|
|
348
|
+
declare const IC_25_LABELS: Record<IC25Value, string>;
|
|
349
|
+
declare const ACCOMMODATION_OPTIONS: {
|
|
350
|
+
readonly HEARING_IMPAIRED: "hearing_impaired";
|
|
351
|
+
readonly VISION_IMPAIRED: "vision_impaired";
|
|
352
|
+
readonly MOBILITY_LIMITATION: "mobility_limitation";
|
|
353
|
+
readonly COGNITIVE_DEVELOPMENTAL: "cognitive_developmental";
|
|
354
|
+
readonly LANGUAGE_INTERPRETER: "language_interpreter";
|
|
355
|
+
readonly OTHER: "other";
|
|
356
|
+
};
|
|
357
|
+
type AccommodationValue = (typeof ACCOMMODATION_OPTIONS)[keyof typeof ACCOMMODATION_OPTIONS];
|
|
358
|
+
declare const ACCOMMODATION_LABELS: Record<AccommodationValue, string>;
|
|
359
|
+
declare const MINOR_ADULT_STATUS: {
|
|
360
|
+
readonly MINOR: 1;
|
|
361
|
+
readonly ADULT: 2;
|
|
362
|
+
readonly UNKNOWN: 99;
|
|
363
|
+
};
|
|
364
|
+
type MinorAdultStatusValue = (typeof MINOR_ADULT_STATUS)[keyof typeof MINOR_ADULT_STATUS];
|
|
365
|
+
declare const MINOR_ADULT_STATUS_LABELS: Record<MinorAdultStatusValue, string>;
|
|
366
|
+
declare const APPARENT_AGE: {
|
|
367
|
+
readonly CHILD: "child";
|
|
368
|
+
readonly TEEN: "teen";
|
|
369
|
+
readonly YOUNG_ADULT: "young_adult";
|
|
370
|
+
readonly ADULT: "adult";
|
|
371
|
+
readonly MIDDLE_AGE: "middle_age";
|
|
372
|
+
readonly SENIOR: "senior";
|
|
373
|
+
};
|
|
374
|
+
type ApparentAgeValue = (typeof APPARENT_AGE)[keyof typeof APPARENT_AGE];
|
|
375
|
+
declare const APPARENT_AGE_LABELS: Record<ApparentAgeValue, string>;
|
|
376
|
+
declare const AGE_BIN_REPORTING: {
|
|
377
|
+
readonly AGE_0_12: "age_0_12";
|
|
378
|
+
readonly AGE_13_17: "age_13_17";
|
|
379
|
+
readonly AGE_18_24: "age_18_24";
|
|
380
|
+
readonly AGE_25_59: "age_25_59";
|
|
381
|
+
readonly AGE_60_PLUS: "age_60_plus";
|
|
382
|
+
readonly NOT_REPORTED: "not_reported";
|
|
383
|
+
readonly NOT_TRACKED: "not_tracked";
|
|
384
|
+
};
|
|
385
|
+
type AgeBinReportingValue = (typeof AGE_BIN_REPORTING)[keyof typeof AGE_BIN_REPORTING];
|
|
386
|
+
declare const AGE_BIN_REPORTING_LABELS: Record<AgeBinReportingValue, string>;
|
|
387
|
+
declare const AGE_BIN_REPORTING_IS_MINOR: Record<AgeBinReportingValue, boolean | null>;
|
|
388
|
+
/** Derive VOCA age bin from numeric age */
|
|
389
|
+
declare function deriveAgeBinFromAge(age: number): AgeBinReportingValue;
|
|
390
|
+
declare const QUICK_START_TEMPLATES: {
|
|
391
|
+
readonly HOTLINE_CALL: "hotline_call";
|
|
392
|
+
readonly LAP_INCIDENT: "lap_incident";
|
|
393
|
+
readonly HT_REFERRAL: "ht_referral";
|
|
394
|
+
readonly FIELD_RESPONSE: "field_response";
|
|
395
|
+
readonly EMAIL_CRISIS: "email_crisis";
|
|
396
|
+
readonly OTHER: "other";
|
|
397
|
+
};
|
|
398
|
+
type QuickStartTemplateId = (typeof QUICK_START_TEMPLATES)[keyof typeof QUICK_START_TEMPLATES];
|
|
399
|
+
declare const QUICK_START_LABELS: Record<QuickStartTemplateId, string>;
|
|
400
|
+
declare const QUICK_START_CONFIG: Record<QuickStartTemplateId, {
|
|
401
|
+
contactMethod: number;
|
|
402
|
+
interactionType: number;
|
|
403
|
+
intakeFormKey?: string;
|
|
404
|
+
}>;
|
|
405
|
+
declare const SUBMISSION_STATES: {
|
|
406
|
+
readonly IN_PROGRESS: 1;
|
|
407
|
+
readonly SUBMITTED: 2;
|
|
408
|
+
readonly LOCKED: 3;
|
|
409
|
+
};
|
|
410
|
+
type SubmissionStateValue = (typeof SUBMISSION_STATES)[keyof typeof SUBMISSION_STATES];
|
|
411
|
+
declare const SUBMISSION_STATE_LABELS: Record<SubmissionStateValue, string>;
|
|
412
|
+
declare const FORM_STATUS: {
|
|
413
|
+
readonly DRAFT: "draft";
|
|
414
|
+
readonly ACTIVE: "active";
|
|
415
|
+
readonly DEPRECATED: "deprecated";
|
|
416
|
+
};
|
|
417
|
+
type FormStatusValue = (typeof FORM_STATUS)[keyof typeof FORM_STATUS];
|
|
418
|
+
declare const FORM_STATUS_LABELS: Record<FormStatusValue, string>;
|
|
419
|
+
declare const QUESTION_FORMAT: {
|
|
420
|
+
readonly EXCLUSIVE: "exclusive";
|
|
421
|
+
readonly INCLUSIVE: "inclusive";
|
|
422
|
+
readonly DROPDOWN: "dropdown";
|
|
423
|
+
readonly BINARY: "binary";
|
|
424
|
+
readonly TEXT: "text";
|
|
425
|
+
readonly NUMBER: "number";
|
|
426
|
+
readonly DATE: "date";
|
|
427
|
+
readonly MULTISELECT: "multiselect";
|
|
428
|
+
};
|
|
429
|
+
/** @deprecated Use KNOWN_QUESTION_FORMATS from schemas/forms */
|
|
430
|
+
type QuestionFormatValue = (typeof QUESTION_FORMAT)[keyof typeof QUESTION_FORMAT];
|
|
431
|
+
declare const QUESTION_FORMAT_LABELS: Record<string, string>;
|
|
432
|
+
declare const APP_SCOPE: {
|
|
433
|
+
readonly THREAD: "thread";
|
|
434
|
+
readonly PAVE: "pave";
|
|
435
|
+
readonly BOTH: "both";
|
|
436
|
+
};
|
|
437
|
+
type AppScopeValue = (typeof APP_SCOPE)[keyof typeof APP_SCOPE];
|
|
438
|
+
declare const FORM_TYPE: {
|
|
439
|
+
readonly SCREENING: "screening";
|
|
440
|
+
readonly INTAKE: "intake";
|
|
441
|
+
readonly ASSESSMENT: "assessment";
|
|
442
|
+
readonly DEMOGRAPHICS: "demographics";
|
|
443
|
+
};
|
|
444
|
+
type FormTypeValue = (typeof FORM_TYPE)[keyof typeof FORM_TYPE];
|
|
445
|
+
declare const FORM_TYPE_LABELS: Record<FormTypeValue, string>;
|
|
446
|
+
declare const USER_STATUS: {
|
|
447
|
+
readonly CREATED: 0;
|
|
448
|
+
readonly PENDING_APPROVAL: 1;
|
|
449
|
+
readonly APPROVED: 2;
|
|
450
|
+
readonly DENIED: 3;
|
|
451
|
+
readonly INVITED: 4;
|
|
452
|
+
readonly REVOKED: 5;
|
|
453
|
+
};
|
|
454
|
+
type UserStatusValue = (typeof USER_STATUS)[keyof typeof USER_STATUS];
|
|
455
|
+
declare const USER_STATUS_LABELS: Record<UserStatusValue, string>;
|
|
456
|
+
declare const INCIDENT_PARTICIPATION_ROLE: {
|
|
457
|
+
readonly CLIENT_SUBJECT: "client_subject";
|
|
458
|
+
readonly CALLER_SELF: "caller_self";
|
|
459
|
+
readonly CALLER_THIRD_PARTY: "caller_third_party";
|
|
460
|
+
readonly REPORTER: "reporter";
|
|
461
|
+
readonly FAMILY_MEMBER_OR_GUARDIAN: "family_member_or_guardian";
|
|
462
|
+
readonly FRIEND_OR_PEER: "friend_or_peer";
|
|
463
|
+
readonly SERVICE_PROVIDER_STAFF: "service_provider_staff";
|
|
464
|
+
readonly MEDICAL_PROVIDER_STAFF: "medical_provider_staff";
|
|
465
|
+
readonly UNKNOWN: "unknown";
|
|
466
|
+
readonly ANONYMOUS: "anonymous";
|
|
467
|
+
readonly NOT_COLLECTED: "not_collected";
|
|
468
|
+
};
|
|
469
|
+
type IncidentParticipationRoleValue = (typeof INCIDENT_PARTICIPATION_ROLE)[keyof typeof INCIDENT_PARTICIPATION_ROLE];
|
|
470
|
+
declare const INCIDENT_PARTICIPATION_ROLE_VALUES: readonly ["client_subject", "caller_self", "caller_third_party", "reporter", "family_member_or_guardian", "friend_or_peer", "service_provider_staff", "medical_provider_staff", "unknown", "anonymous", "not_collected"];
|
|
471
|
+
declare const INCIDENT_PARTICIPATION_ROLE_LABELS: Record<IncidentParticipationRoleValue, string>;
|
|
472
|
+
/**
|
|
473
|
+
* Participation role category groupings for UI organization.
|
|
474
|
+
*
|
|
475
|
+
* Note: UNKNOWN, ANONYMOUS, and NOT_COLLECTED are intentionally excluded.
|
|
476
|
+
* These are data quality states, not selectable participation roles.
|
|
477
|
+
* Handle them via separate UI controls (e.g., "Unknown" / "Anonymous" buttons).
|
|
478
|
+
*/
|
|
479
|
+
declare const PARTICIPATION_ROLE_CATEGORIES: {
|
|
480
|
+
readonly CLIENT: readonly ["client_subject"];
|
|
481
|
+
readonly CALLER_REPORTER: readonly ["caller_self", "caller_third_party", "reporter"];
|
|
482
|
+
readonly SUPPORT_NETWORK: readonly ["family_member_or_guardian", "friend_or_peer"];
|
|
483
|
+
readonly SYSTEM_PROFESSIONAL: readonly ["service_provider_staff", "medical_provider_staff"];
|
|
484
|
+
};
|
|
485
|
+
/** All participation roles assigned to a victim who is also the caller. */
|
|
486
|
+
declare const CALLER_IS_VICTIM_ROLES: IncidentParticipationRoleValue[];
|
|
487
|
+
declare const PERSON_DISPLAY_CATEGORY: {
|
|
488
|
+
readonly PRIMARY_VICTIM: "primary_victim";
|
|
489
|
+
readonly ELIGIBLE_FAMILY: "eligible_family";
|
|
490
|
+
readonly OFFENDER: "offender";
|
|
491
|
+
readonly THIRD_PARTY: "third_party";
|
|
492
|
+
readonly PERSONNEL: "personnel";
|
|
493
|
+
};
|
|
494
|
+
type PersonDisplayCategoryValue = (typeof PERSON_DISPLAY_CATEGORY)[keyof typeof PERSON_DISPLAY_CATEGORY];
|
|
495
|
+
declare const PERSON_DISPLAY_CATEGORY_LABELS: Record<PersonDisplayCategoryValue, string>;
|
|
496
|
+
declare const PERSON_TYPE: {
|
|
497
|
+
readonly PROTECTED: "ProtectedPerson";
|
|
498
|
+
readonly PERPETRATOR: "PerpetratorPerson";
|
|
499
|
+
readonly PERSONNEL: "PersonnelPerson";
|
|
500
|
+
readonly THIRD_PARTY: "ThirdPartyPerson";
|
|
501
|
+
};
|
|
502
|
+
type PersonTypeValue = (typeof PERSON_TYPE)[keyof typeof PERSON_TYPE];
|
|
503
|
+
/** Tuple of valid PERSON_TYPE values for schema consumption. */
|
|
504
|
+
declare const PERSON_TYPE_VALUES: readonly ["ProtectedPerson", "PerpetratorPerson", "PersonnelPerson", "ThirdPartyPerson"];
|
|
505
|
+
/**
|
|
506
|
+
* Static mapping from involvement role to person type.
|
|
507
|
+
*
|
|
508
|
+
* Note: Returns `null` for UNKNOWN and NOT_COLLECTED because these roles
|
|
509
|
+
* require contextual handling. For these cases, use `getPersonTypeForRole()`
|
|
510
|
+
* which applies conditional logic (e.g., preserving Personnel context).
|
|
511
|
+
*
|
|
512
|
+
* @see getPersonTypeForRole for the recommended API with null handling
|
|
513
|
+
*/
|
|
514
|
+
declare const INVOLVEMENT_ROLE_TO_PERSON_TYPE: Record<IncidentInvolvementRoleValue, PersonTypeValue | null>;
|
|
515
|
+
/**
|
|
516
|
+
* Get the person type for an involvement role.
|
|
517
|
+
* For 'unknown', preserves PersonnelPerson if provided as context, otherwise defaults to ThirdPartyPerson.
|
|
518
|
+
* Returns null for 'not_collected' (data quality state — cannot infer person type).
|
|
519
|
+
*/
|
|
520
|
+
declare function getPersonTypeForRole(role: IncidentInvolvementRoleValue, contextPersonType?: PersonTypeValue): PersonTypeValue | null;
|
|
521
|
+
/**
|
|
522
|
+
* Get the display category for a person based on involvement role and person type.
|
|
523
|
+
* Handles the conditional 'unknown' case where PersonnelPerson → Personnel category.
|
|
524
|
+
*/
|
|
525
|
+
declare function getDisplayCategoryForRole(role: IncidentInvolvementRoleValue, personType?: PersonTypeValue): PersonDisplayCategoryValue;
|
|
526
|
+
declare const DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY: Record<PersonDisplayCategoryValue, IncidentParticipationRoleValue | null>;
|
|
527
|
+
|
|
528
|
+
export { ACCOMMODATION_LABELS, ACCOMMODATION_OPTIONS, AGE_BIN_REPORTING, AGE_BIN_REPORTING_IS_MINOR, AGE_BIN_REPORTING_LABELS, APPARENT_AGE, APPARENT_AGE_LABELS, APP_SCOPE, type AccommodationValue, type AgeBinReportingValue, type AppScopeValue, type ApparentAgeValue, CALLER_IS_VICTIM_ROLES, DATA_QUALITY, DATA_QUALITY_DESCRIPTIONS, DATA_QUALITY_LABELS, DATA_QUALITY_VALUES, DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY, type DataQualityValue, FORM_STATUS, FORM_STATUS_LABELS, FORM_TYPE, FORM_TYPE_LABELS, type FormStatusValue, type FormTypeValue, type IC13Category, type IC13PriorityGroup, type IC13Value, type IC22Value, type IC23Value, type IC24Value, type IC25Value, type IC49ReferralOutcomeValue, type IC49ReferralVerificationValue, type IC49Value, type IC4Value, type IC56Value, type IC57Value, type IC58ExternalCategory, type IC58Value, type IC59Value, type IC5Value, IC_13_CATEGORIES, IC_13_CATEGORY_ORDER, IC_13_LABELS, IC_13_PRIORITY_GROUPS, IC_13_RELATIONSHIP_ABBREV, IC_13_RELATIONSHIP_TYPE, IC_13_REVERSE_CONTEXT_LABELS, IC_22_CORE_SEX, IC_22_LABELS, IC_23_CORE_GENDER_IDENTITY, IC_23_LABELS, IC_24_LABELS, IC_24_RACE, IC_25_ETHNICITY, IC_25_LABELS, IC_48_SERVICE_CATEGORIES, IC_49_DESCRIPTIONS, IC_49_LABELS, IC_49_REFERRAL_OUTCOME, IC_49_REFERRAL_OUTCOME_LABELS, IC_49_REFERRAL_VERIFICATION, IC_49_REFERRAL_VERIFICATION_LABELS, IC_49_SERVICE_MECHANISM, IC_4_AGE_TYPE, IC_4_LABELS, IC_56_DESCRIPTIONS, IC_56_LABELS, IC_56_SERVICE_DELIVERY_CHANNEL, IC_57_LABELS, IC_57_SERVICE_AUDIENCE, IC_58_EXTERNAL_TIERED, IC_58_LABELS, IC_58_ORG_TYPE_GROUPS, IC_58_PRIMARY_BRANCHES, IC_58_REFERRAL_ENTITY, IC_59_LABELS, IC_59_SERVICE_STATE, IC_5_FULL_LABELS, IC_5_LABELS, IC_5_VICTIMIZATION, INCIDENT_INVOLVEMENT_ROLE, INCIDENT_INVOLVEMENT_ROLE_LABELS, INCIDENT_INVOLVEMENT_ROLE_TO_PERSON_ROLE, INCIDENT_PARTICIPATION_ROLE, INCIDENT_PARTICIPATION_ROLE_LABELS, INCIDENT_PARTICIPATION_ROLE_VALUES, INTERACTION_TYPES, INTERACTION_TYPE_LABELS, INVOLVEMENT_ROLE_TO_PERSON_TYPE, type IncidentInvolvementRoleValue, type IncidentParticipationRoleValue, type InteractionTypeValue, MINOR_ADULT_STATUS, MINOR_ADULT_STATUS_LABELS, type MinorAdultStatusValue, type OrgTypeGroup, PARTICIPATION_ROLE_CATEGORIES, PERSON_DISPLAY_CATEGORY, PERSON_DISPLAY_CATEGORY_LABELS, PERSON_ROLES, PERSON_TYPE, PERSON_TYPE_VALUES, type PersonDisplayCategoryValue, type PersonRoleValue, type PersonTypeValue, QUESTION_FORMAT, QUESTION_FORMAT_LABELS, QUICK_START_CONFIG, QUICK_START_LABELS, QUICK_START_TEMPLATES, type QuestionFormatValue, type QuickStartTemplateId, RECORD_STATES, RECORD_STATE_LABELS, RELATIONSHIP_CONCERNS, RELATIONSHIP_CONCERNS_LABELS, RELATIONSHIP_CONCERNS_VALUES, RELATIONSHIP_DYNAMICS, RELATIONSHIP_DYNAMICS_LABELS, RELATIONSHIP_DYNAMICS_VALUES, type RecordStateValue, type ReferralBranch, type RelationshipConcernValue, type RelationshipDynamicValue, SESSION_STATES, SESSION_STATE_LABELS, SUBMISSION_STATES, SUBMISSION_STATE_LABELS, type ServiceCategory, type ServiceCategoryChild, type SessionStateValue, type SubmissionStateValue, THREAD_INVOLVEMENT_ROLES, USER_STATUS, USER_STATUS_LABELS, type UserStatusValue, VALID_INTERACTION_TYPES, VALID_RECORD_STATES, deriveAgeBinFromAge, getDisplayCategoryForRole, getPersonTypeForRole, sortRelationshipsByPriority };
|