@htilabs/platform-common-models 0.5.2-beta.3 → 0.6.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/{cvcEntry-wqktWfzE.d.cts → cvcEntry-BCj1OWqL.d.cts} +8 -8
- package/dist/{cvcEntry-wqktWfzE.d.ts → cvcEntry-BCj1OWqL.d.ts} +8 -8
- package/dist/cvcs/index.cjs +8673 -2
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +9511 -56
- package/dist/cvcs/index.d.ts +9511 -56
- package/dist/cvcs/index.js +8634 -1
- package/dist/cvcs/index.js.map +1 -1
- package/dist/{index--NCIPluF.d.cts → index-CoVr1jIV.d.cts} +1 -1
- package/dist/{index-CFOrHA8l.d.ts → index-I-DiX9eQ.d.ts} +1 -1
- package/dist/index.cjs +9637 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1118 -4
- package/dist/index.d.ts +1118 -4
- package/dist/index.js +9561 -0
- package/dist/index.js.map +1 -1
- package/dist/models/index.d.cts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/schemas/index.d.cts +1 -1
- package/dist/schemas/index.d.ts +1 -1
- package/dist/validation/index.cjs +6 -0
- package/dist/validation/index.cjs.map +1 -1
- package/dist/validation/index.d.cts +47 -1
- package/dist/validation/index.d.ts +47 -1
- package/dist/validation/index.js +5 -0
- package/dist/validation/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/cvc-sot.snap +152 -0
- package/src/__tests__/cvc-sot-snapshot.test.ts +303 -0
- package/src/__tests__/cvc-structural.test.ts +51 -0
- package/src/cvcs/administeringJurisdiction.v1.0.0.json +105 -0
- package/src/cvcs/ageBinReporting.v1.0.0.json +114 -0
- package/src/cvcs/contactInfoTypes.v1.0.0.json +250 -0
- package/src/cvcs/contactSafetyStatus.v1.0.0.json +69 -0
- package/src/cvcs/employmentStatus.v1.0.0.json +302 -0
- package/src/cvcs/enrollmentApplicationStatus.v1.0.0.json +123 -0
- package/src/cvcs/eyeColor.v1.0.0.json +114 -0
- package/src/cvcs/facilitatorEntityType.v1.0.0.json +141 -0
- package/src/cvcs/facilitatorLabelUsedInSource.v1.0.0.json +159 -0
- package/src/cvcs/facilitatorSubrole.v1.0.0.json +381 -0
- package/src/cvcs/frequencyCadence.v1.0.0.json +114 -0
- package/src/cvcs/genderIdentity.v1.0.0.json +128 -0
- package/src/cvcs/hairColor.v1.0.0.json +105 -0
- package/src/cvcs/hasTattoos.v1.0.0.json +69 -0
- package/src/cvcs/highestEducationLevelCompleted.v1.0.0.json +124 -0
- package/src/cvcs/homelessStatus.v1.0.0.json +98 -0
- package/src/cvcs/incomeBenefitsSources.v1.0.0.json +392 -0
- package/src/cvcs/index.ts +76 -0
- package/src/cvcs/juvenileJusticeInvolvementStatus.v1.0.0.json +78 -0
- package/src/cvcs/locationType.v1.0.0.json +168 -0
- package/src/cvcs/maritalStatusLegal.v1.0.0.json +96 -0
- package/src/cvcs/militaryBranch.v1.0.0.json +85 -0
- package/src/cvcs/militaryStatus.v1.0.0.json +67 -0
- package/src/cvcs/nameType.v1.0.0.json +123 -0
- package/src/cvcs/offenderStatus.v1.0.0.json +96 -0
- package/src/cvcs/offenderStatusFamily.v1.0.0.json +87 -0
- package/src/cvcs/orientationIdentity.v1.0.0.json +97 -0
- package/src/cvcs/personRelationships.v1.0.0.json +924 -0
- package/src/cvcs/preferredContactMethod.v1.0.0.json +46 -0
- package/src/cvcs/primaryLanguage.v1.0.0.json +2116 -0
- package/src/cvcs/pronouns.v1.0.0.json +87 -0
- package/src/cvcs/referralEntityCategory.v1.0.0.json +439 -0
- package/src/cvcs/relationshipStatusCurrent.v1.0.0.json +69 -0
- package/src/cvcs/relationshipTies.v1.0.0.json +291 -0
- package/src/cvcs/sexProviderSubrole.v1.0.0.json +78 -0
- package/src/cvcs/sharePurpose.v1.0.0.json +82 -0
- package/src/cvcs/smtType.v1.0.0.json +114 -0
- package/src/cvcs/tribes.v1.0.0.json +492 -0
- package/src/cvcs/victimStatusFamily.v1.0.0.json +96 -0
- package/src/generated/cvc-enums.ts +1190 -0
- package/src/validation/cvc.ts +17 -0
|
@@ -84,6 +84,309 @@ const SOT_SPECS: readonly SotSpec[] = [
|
|
|
84
84
|
domain: "race_ethnicity",
|
|
85
85
|
expectedCount: 14,
|
|
86
86
|
},
|
|
87
|
+
// CVC-122 — 187 flat Level-1 language entries (185 Notion Level-1 rows +
|
|
88
|
+
// 2 Notion Level-null Chinese varieties promoted to L1) + 1 missingness
|
|
89
|
+
// root + 3 canonical missingness children (no PNA for primary_language) = 191.
|
|
90
|
+
{
|
|
91
|
+
file: "primaryLanguage.v1.0.0.json",
|
|
92
|
+
domain: "primary_language",
|
|
93
|
+
expectedCount: 191,
|
|
94
|
+
},
|
|
95
|
+
// CVC-16 — 4 flat orientation categories (Bisexual, Gay or Lesbian,
|
|
96
|
+
// Other/self-described, Straight) + 1 missingness root + 4 canonical
|
|
97
|
+
// missingness children (includes PNA for sensitive-data parity with
|
|
98
|
+
// sibling demographic/identity CVCs) = 9.
|
|
99
|
+
{
|
|
100
|
+
file: "orientationIdentity.v1.0.0.json",
|
|
101
|
+
domain: "orientation_identity",
|
|
102
|
+
expectedCount: 9,
|
|
103
|
+
},
|
|
104
|
+
// CVC-147 — 4 flat pronoun categories (He/Him, She/Her, They/Them,
|
|
105
|
+
// Other/self-described) + 1 missingness root + 3 canonical missingness
|
|
106
|
+
// children (no PNA; Notion codebook explicitly lists only UNK/ANON/DNC) = 8.
|
|
107
|
+
{
|
|
108
|
+
file: "pronouns.v1.0.0.json",
|
|
109
|
+
domain: "pronouns",
|
|
110
|
+
expectedCount: 8,
|
|
111
|
+
},
|
|
112
|
+
// CVC-17 — 5 Level-1 gender categories (female, male, non_binary, other,
|
|
113
|
+
// transgender) + 2 Level-2 transgender subtypes (FTM, MTF) + 1 missingness
|
|
114
|
+
// root + 4 canonical missingness children (includes PNA per Notion) = 12.
|
|
115
|
+
{
|
|
116
|
+
file: "genderIdentity.v1.0.0.json",
|
|
117
|
+
domain: "gender_identity",
|
|
118
|
+
expectedCount: 12,
|
|
119
|
+
},
|
|
120
|
+
// CVC-148 — flat starter list of 38 OK tribes + 4 NE tribes + 6 umbrella
|
|
121
|
+
// "(specify)" entries + 1 selectable Other/write-in + 1 missingness root +
|
|
122
|
+
// 3 canonical missingness children (no PNA; Notion codebook explicitly
|
|
123
|
+
// lists only UNK/ANON/DNC, matching pronouns precedent) = 53. Hierarchy
|
|
124
|
+
// flattened per co-8ff.1.4 DECISION (Notion levels inconsistent; sibling
|
|
125
|
+
// race_ethnicity is also flat).
|
|
126
|
+
{
|
|
127
|
+
file: "tribes.v1.0.0.json",
|
|
128
|
+
domain: "tribes",
|
|
129
|
+
expectedCount: 53,
|
|
130
|
+
},
|
|
131
|
+
// CVC-1 — 8 flat Level-1 name-type entries (6 alias categories + 2 full
|
|
132
|
+
// valid name categories; Notion's "Level 1" vs "Level 2" split is semantic
|
|
133
|
+
// only, represented flat at L1 per the raceEthnicity pattern) + 1
|
|
134
|
+
// missingness root + 3 canonical missingness children (no PNA — Notion
|
|
135
|
+
// lacks a PNA row for name_type) = 12.
|
|
136
|
+
{
|
|
137
|
+
file: "nameType.v1.0.0.json",
|
|
138
|
+
domain: "name_type",
|
|
139
|
+
expectedCount: 12,
|
|
140
|
+
},
|
|
141
|
+
// CVC-51 — 5 VOCA/OVC age bins (age_0_12, age_13_17, age_18_24,
|
|
142
|
+
// age_25_59, age_60_plus) + 2 VOCA source-coupled reporting values
|
|
143
|
+
// (not_reported, not_tracked — preserved as first-class L1 entries for
|
|
144
|
+
// Reporting & Regulations fidelity) + 1 missingness root + 3 canonical
|
|
145
|
+
// missingness children = 11.
|
|
146
|
+
{
|
|
147
|
+
file: "ageBinReporting.v1.0.0.json",
|
|
148
|
+
domain: "age_bin_reporting",
|
|
149
|
+
expectedCount: 11,
|
|
150
|
+
},
|
|
151
|
+
// CVC-95 — 3 flat Level-1 involvement-status entries (current, never,
|
|
152
|
+
// previous) + 1 missingness root + 3 HMIS-aligned missingness children
|
|
153
|
+
// (unknown, prefer_not_to_answer, data_not_collected — NOT anonymous;
|
|
154
|
+
// triad preserved per CVC-95 Phase-4-Revise decision to align with
|
|
155
|
+
// HMIS R12) = 7.
|
|
156
|
+
{
|
|
157
|
+
file: "juvenileJusticeInvolvementStatus.v1.0.0.json",
|
|
158
|
+
domain: "juvenile_justice_involvement_status",
|
|
159
|
+
expectedCount: 7,
|
|
160
|
+
},
|
|
161
|
+
// CVC-150 — 7 flat Level-1 eye color entries (black, blue, brown, gray,
|
|
162
|
+
// green, hazel, other) + 1 missingness root + 3 canonical missingness
|
|
163
|
+
// children (no PNA; eye color is observed/recorded, not self-reported,
|
|
164
|
+
// per Notion guidance — matches pronouns/tribes precedent for UNK/ANON/DNC
|
|
165
|
+
// triad) = 11.
|
|
166
|
+
{
|
|
167
|
+
file: "eyeColor.v1.0.0.json",
|
|
168
|
+
domain: "eye_color",
|
|
169
|
+
expectedCount: 11,
|
|
170
|
+
},
|
|
171
|
+
// CVC-153 — 7 flat Level-1 SMT (Scars/Marks/Tattoos) types + 1 missingness
|
|
172
|
+
// root + 3 canonical missingness children = 11.
|
|
173
|
+
{
|
|
174
|
+
file: "smtType.v1.0.0.json",
|
|
175
|
+
domain: "smt_type",
|
|
176
|
+
expectedCount: 11,
|
|
177
|
+
},
|
|
178
|
+
// CVC-164 — 5 flat Level-1 offender-status procedural stages (suspected,
|
|
179
|
+
// person_of_interest, cleared_excluded, charged, convicted; progression is
|
|
180
|
+
// semantic, not hierarchical — all parentCode=null per co-8ff DECISION) + 1
|
|
181
|
+
// missingness root + 3 canonical missingness children (no PNA per Notion
|
|
182
|
+
// codebook) = 9. (Bead FACT comment stated 8 = 3 missingness + 5 substantive,
|
|
183
|
+
// but omitted the mandatory missingness_root; corrected to 9 to match the
|
|
184
|
+
// sibling offender_status_family pattern.)
|
|
185
|
+
{
|
|
186
|
+
file: "offenderStatus.v1.0.0.json",
|
|
187
|
+
domain: "offender_status",
|
|
188
|
+
expectedCount: 9,
|
|
189
|
+
},
|
|
190
|
+
// CVC-167 — 4 flat Level-1 offender-status family entries + 1 missingness
|
|
191
|
+
// root + 3 canonical missingness children = 8.
|
|
192
|
+
{
|
|
193
|
+
file: "offenderStatusFamily.v1.0.0.json",
|
|
194
|
+
domain: "offender_status_family",
|
|
195
|
+
expectedCount: 8,
|
|
196
|
+
},
|
|
197
|
+
// CVC-121 — 4 flat Level-1 military-status entries + 1 missingness root +
|
|
198
|
+
// 1 canonical missingness child (unknown only per Notion v3.0) = 6.
|
|
199
|
+
{
|
|
200
|
+
file: "militaryStatus.v1.0.0.json",
|
|
201
|
+
domain: "military_status",
|
|
202
|
+
expectedCount: 6,
|
|
203
|
+
},
|
|
204
|
+
// CVC-120 — 6 flat Level-1 military-branch entries (Army, Navy, Air Force,
|
|
205
|
+
// Marines, Coast Guard, Space Force) + 1 missingness root + 1 canonical
|
|
206
|
+
// missingness child (unknown only per Notion v3.0; matches sibling CVC-121
|
|
207
|
+
// variant — no PNA/DNC, relies on parent field core_veteran gating) = 8.
|
|
208
|
+
{
|
|
209
|
+
file: "militaryBranch.v1.0.0.json",
|
|
210
|
+
domain: "military_branch",
|
|
211
|
+
expectedCount: 8,
|
|
212
|
+
},
|
|
213
|
+
// CVC-149 — 4 Level-1 type parents + 7 app subtypes + 9 social_media
|
|
214
|
+
// subtypes + 1 missingness root + 3 canonical missingness children = 24.
|
|
215
|
+
{
|
|
216
|
+
file: "contactInfoTypes.v1.0.0.json",
|
|
217
|
+
domain: "contact_info_types",
|
|
218
|
+
expectedCount: 24,
|
|
219
|
+
},
|
|
220
|
+
// CVC-155 — 2 flat Level-1 safety-status entries + 1 missingness root +
|
|
221
|
+
// 3 canonical missingness children = 6.
|
|
222
|
+
{
|
|
223
|
+
file: "contactSafetyStatus.v1.0.0.json",
|
|
224
|
+
domain: "contact_safety_status",
|
|
225
|
+
expectedCount: 6,
|
|
226
|
+
},
|
|
227
|
+
// CVC-180 — 7 flat Level-1 Census/ACS attainment entries + 1 missingness
|
|
228
|
+
// root + 4 canonical missingness children (includes PNA) = 12.
|
|
229
|
+
{
|
|
230
|
+
file: "highestEducationLevelCompleted.v1.0.0.json",
|
|
231
|
+
domain: "highest_education_level_completed",
|
|
232
|
+
expectedCount: 12,
|
|
233
|
+
},
|
|
234
|
+
// CVC-185 — 4 flat preferred-contact-method entries. No missingness entries
|
|
235
|
+
// (variant 0 per Notion: absence encodes "no preference") = 4.
|
|
236
|
+
{
|
|
237
|
+
file: "preferredContactMethod.v1.0.0.json",
|
|
238
|
+
domain: "preferred_contact_method",
|
|
239
|
+
expectedCount: 4,
|
|
240
|
+
},
|
|
241
|
+
// CVC-84 — 8 flat Level-1 intent-based share purposes. No missingness
|
|
242
|
+
// sentinels (variant 0, share_purpose is always known at sharing time) = 8.
|
|
243
|
+
{
|
|
244
|
+
file: "sharePurpose.v1.0.0.json",
|
|
245
|
+
domain: "share_purpose",
|
|
246
|
+
expectedCount: 8,
|
|
247
|
+
},
|
|
248
|
+
// CVC-165 — 10 flat Level-1 entity/establishment types (Notion codebook DB,
|
|
249
|
+
// v1.0) + 1 missingness root + 3 canonical missingness children (no PNA;
|
|
250
|
+
// Notion codebook lists only ANON/DNC/UNK) = 14.
|
|
251
|
+
{
|
|
252
|
+
file: "facilitatorEntityType.v1.0.0.json",
|
|
253
|
+
domain: "facilitator_entity_type",
|
|
254
|
+
expectedCount: 14,
|
|
255
|
+
},
|
|
256
|
+
// CVC-162 — 13 Level-1 primary-function categories + 20 Level-2 specific
|
|
257
|
+
// sub-roles (per live Notion codebook query, not bead FACT comment which
|
|
258
|
+
// undercounted L2 at 17) + 1 missingness root + 3 canonical missingness
|
|
259
|
+
// children (no PNA; Notion codebook explicitly lists only ANON/DNC/UNK) = 37.
|
|
260
|
+
{
|
|
261
|
+
file: "facilitatorSubrole.v1.0.0.json",
|
|
262
|
+
domain: "facilitator_subrole",
|
|
263
|
+
expectedCount: 37,
|
|
264
|
+
},
|
|
265
|
+
// CVC-156 — 5 flat Level-1 legal marital-status entries + 1 missingness
|
|
266
|
+
// root + 3 canonical missingness children = 9.
|
|
267
|
+
{
|
|
268
|
+
file: "maritalStatusLegal.v1.0.0.json",
|
|
269
|
+
domain: "marital_status_legal",
|
|
270
|
+
expectedCount: 9,
|
|
271
|
+
},
|
|
272
|
+
// CVC-157 — 2 flat Level-1 partnered-state codes + 1 missingness root + 3
|
|
273
|
+
// canonical missingness children = 6.
|
|
274
|
+
{
|
|
275
|
+
file: "relationshipStatusCurrent.v1.0.0.json",
|
|
276
|
+
domain: "relationship_status_current",
|
|
277
|
+
expectedCount: 6,
|
|
278
|
+
},
|
|
279
|
+
// CVC-152 — 2 flat Level-1 presence entries + 1 missingness root + 3
|
|
280
|
+
// canonical missingness children = 6.
|
|
281
|
+
{
|
|
282
|
+
file: "hasTattoos.v1.0.0.json",
|
|
283
|
+
domain: "has_tattoos",
|
|
284
|
+
expectedCount: 6,
|
|
285
|
+
},
|
|
286
|
+
// CVC-166 — 12 flat Level-1 source-label entries + 1 missingness root + 3
|
|
287
|
+
// canonical missingness children = 16.
|
|
288
|
+
{
|
|
289
|
+
file: "facilitatorLabelUsedInSource.v1.0.0.json",
|
|
290
|
+
domain: "facilitator_label_used_in_source",
|
|
291
|
+
expectedCount: 16,
|
|
292
|
+
},
|
|
293
|
+
// CVC-96 — 3 flat Level-1 homeless-status entries + 1 missingness root +
|
|
294
|
+
// 5 HMIS R-series missingness children (CEO DECISION on co-8ff.5.4) = 9.
|
|
295
|
+
{
|
|
296
|
+
file: "homelessStatus.v1.0.0.json",
|
|
297
|
+
domain: "homeless_status",
|
|
298
|
+
expectedCount: 9,
|
|
299
|
+
},
|
|
300
|
+
// CVC-20 — 5 flat Level-1 victim-status family entries + 1 missingness
|
|
301
|
+
// root + 3 canonical missingness children = 9.
|
|
302
|
+
{
|
|
303
|
+
file: "victimStatusFamily.v1.0.0.json",
|
|
304
|
+
domain: "victim_status_family",
|
|
305
|
+
expectedCount: 9,
|
|
306
|
+
},
|
|
307
|
+
// CVC-151 — 6 flat Level-1 hair color entries + 1 missingness root + 3
|
|
308
|
+
// canonical missingness children = 10.
|
|
309
|
+
{
|
|
310
|
+
file: "hairColor.v1.0.0.json",
|
|
311
|
+
domain: "hair_color",
|
|
312
|
+
expectedCount: 10,
|
|
313
|
+
},
|
|
314
|
+
// CVC-161 — 3 flat Level-1 provider-subrole codes + 1 missingness root +
|
|
315
|
+
// 3 canonical missingness children = 7.
|
|
316
|
+
{
|
|
317
|
+
file: "sexProviderSubrole.v1.0.0.json",
|
|
318
|
+
domain: "sex_provider_subrole",
|
|
319
|
+
expectedCount: 7,
|
|
320
|
+
},
|
|
321
|
+
// CVC-158 — hierarchical relationship ties = 28.
|
|
322
|
+
{
|
|
323
|
+
file: "relationshipTies.v1.0.0.json",
|
|
324
|
+
domain: "relationship_ties",
|
|
325
|
+
expectedCount: 28,
|
|
326
|
+
},
|
|
327
|
+
// CVC-126 — 3-level person_relationships hierarchy = 1 missingness_root + 2
|
|
328
|
+
// L0 missingness (anonymous, data_not_collected; Notion codebook explicitly
|
|
329
|
+
// omits `unknown` at L0 — the L2 `relationship_unknown` code carries that
|
|
330
|
+
// semantic instead; no PNA) + 8 L1 topics + 35 L2 canonical relationship
|
|
331
|
+
// types + 40 L3 directional role labels + 3 L3 pet-branch roles = 89.
|
|
332
|
+
{
|
|
333
|
+
file: "personRelationships.v1.0.0.json",
|
|
334
|
+
domain: "person_relationships",
|
|
335
|
+
expectedCount: 89,
|
|
336
|
+
},
|
|
337
|
+
// CVC-179 — employment_status: 1 missingness_root + 5 HMIS missingness
|
|
338
|
+
// (unknown, anonymous, data_not_collected, client_doesnt_know,
|
|
339
|
+
// client_refused) + 3 L1 primary (employed, unemployed,
|
|
340
|
+
// not_in_labor_force) + 7 L2 under employed (full_time, part_time,
|
|
341
|
+
// seasonal_sporadic, self_employed, informal_cash_gig, multiple_jobs,
|
|
342
|
+
// unpaid_family_worker) + 5 L2 under unemployed (looking_for_work,
|
|
343
|
+
// actively_seeking, first_time_job_seeker, recently_laid_off,
|
|
344
|
+
// long_term_unemployed) + 8 L2 under NILF (not_looking_for_work,
|
|
345
|
+
// unable_to_work, student, caregiver, disabled, retired,
|
|
346
|
+
// discouraged_worker, other_reason) = 29.
|
|
347
|
+
{
|
|
348
|
+
file: "employmentStatus.v1.0.0.json",
|
|
349
|
+
domain: "employment_status",
|
|
350
|
+
expectedCount: 29,
|
|
351
|
+
},
|
|
352
|
+
// CVC-191 — 13 flat Level-1 location types + 1 missingness root + 3
|
|
353
|
+
// canonical missingness children = 17.
|
|
354
|
+
{
|
|
355
|
+
file: "locationType.v1.0.0.json",
|
|
356
|
+
domain: "location_type",
|
|
357
|
+
expectedCount: 17,
|
|
358
|
+
},
|
|
359
|
+
// CVC-48 — hierarchical referral entity categories = 43.
|
|
360
|
+
{
|
|
361
|
+
file: "referralEntityCategory.v1.0.0.json",
|
|
362
|
+
domain: "referral_entity_category",
|
|
363
|
+
expectedCount: 43,
|
|
364
|
+
},
|
|
365
|
+
// CVC-171 — 5 L1 type groups + 28 L2 source codes + 5 missingness = 38.
|
|
366
|
+
{
|
|
367
|
+
file: "incomeBenefitsSources.v1.0.0.json",
|
|
368
|
+
domain: "income_benefits_sources",
|
|
369
|
+
expectedCount: 38,
|
|
370
|
+
},
|
|
371
|
+
// CVC-175 — 8 flat Level-1 enrollment lifecycle statuses + 1 missingness
|
|
372
|
+
// root + 3 canonical missingness children = 12.
|
|
373
|
+
{
|
|
374
|
+
file: "enrollmentApplicationStatus.v1.0.0.json",
|
|
375
|
+
domain: "enrollment_application_status",
|
|
376
|
+
expectedCount: 12,
|
|
377
|
+
},
|
|
378
|
+
// CVC-177 — administering_jurisdiction.
|
|
379
|
+
{
|
|
380
|
+
file: "administeringJurisdiction.v1.0.0.json",
|
|
381
|
+
domain: "administering_jurisdiction",
|
|
382
|
+
expectedCount: 10,
|
|
383
|
+
},
|
|
384
|
+
// CVC-176 — frequency_cadence.
|
|
385
|
+
{
|
|
386
|
+
file: "frequencyCadence.v1.0.0.json",
|
|
387
|
+
domain: "frequency_cadence",
|
|
388
|
+
expectedCount: 11,
|
|
389
|
+
},
|
|
87
390
|
] as const;
|
|
88
391
|
|
|
89
392
|
// ─── Helpers ────────────────────────────────────────────────────────────────
|
|
@@ -26,6 +26,7 @@ import { describe, it, expect } from "vitest";
|
|
|
26
26
|
|
|
27
27
|
import {
|
|
28
28
|
CvcEnvelopeSchema,
|
|
29
|
+
PrimaryLanguageEntrySchema,
|
|
29
30
|
validateCvc,
|
|
30
31
|
type CvcValidationError,
|
|
31
32
|
} from "../validation/cvc.js";
|
|
@@ -53,6 +54,44 @@ const SOT_FILES: readonly SotFile[] = [
|
|
|
53
54
|
{ file: "incidentParticipationRoles.v1.0.0.json", expectedDomain: "incident_participation_roles" },
|
|
54
55
|
{ file: "incidentInvolvementRoles.v1.0.0.json", expectedDomain: "incident_involvement_roles" },
|
|
55
56
|
{ file: "raceEthnicity.v1.0.0.json", expectedDomain: "race_ethnicity" },
|
|
57
|
+
{ file: "primaryLanguage.v1.0.0.json", expectedDomain: "primary_language" },
|
|
58
|
+
{ file: "orientationIdentity.v1.0.0.json", expectedDomain: "orientation_identity" },
|
|
59
|
+
{ file: "pronouns.v1.0.0.json", expectedDomain: "pronouns" },
|
|
60
|
+
{ file: "genderIdentity.v1.0.0.json", expectedDomain: "gender_identity" },
|
|
61
|
+
{ file: "tribes.v1.0.0.json", expectedDomain: "tribes" },
|
|
62
|
+
{ file: "nameType.v1.0.0.json", expectedDomain: "name_type" },
|
|
63
|
+
{ file: "ageBinReporting.v1.0.0.json", expectedDomain: "age_bin_reporting" },
|
|
64
|
+
{ file: "juvenileJusticeInvolvementStatus.v1.0.0.json", expectedDomain: "juvenile_justice_involvement_status" },
|
|
65
|
+
{ file: "eyeColor.v1.0.0.json", expectedDomain: "eye_color" },
|
|
66
|
+
{ file: "smtType.v1.0.0.json", expectedDomain: "smt_type" },
|
|
67
|
+
{ file: "offenderStatus.v1.0.0.json", expectedDomain: "offender_status" },
|
|
68
|
+
{ file: "offenderStatusFamily.v1.0.0.json", expectedDomain: "offender_status_family" },
|
|
69
|
+
{ file: "militaryStatus.v1.0.0.json", expectedDomain: "military_status" },
|
|
70
|
+
{ file: "militaryBranch.v1.0.0.json", expectedDomain: "military_branch" },
|
|
71
|
+
{ file: "contactInfoTypes.v1.0.0.json", expectedDomain: "contact_info_types" },
|
|
72
|
+
{ file: "contactSafetyStatus.v1.0.0.json", expectedDomain: "contact_safety_status" },
|
|
73
|
+
{ file: "highestEducationLevelCompleted.v1.0.0.json", expectedDomain: "highest_education_level_completed" },
|
|
74
|
+
{ file: "preferredContactMethod.v1.0.0.json", expectedDomain: "preferred_contact_method" },
|
|
75
|
+
{ file: "sharePurpose.v1.0.0.json", expectedDomain: "share_purpose" },
|
|
76
|
+
{ file: "facilitatorEntityType.v1.0.0.json", expectedDomain: "facilitator_entity_type" },
|
|
77
|
+
{ file: "facilitatorSubrole.v1.0.0.json", expectedDomain: "facilitator_subrole" },
|
|
78
|
+
{ file: "maritalStatusLegal.v1.0.0.json", expectedDomain: "marital_status_legal" },
|
|
79
|
+
{ file: "relationshipStatusCurrent.v1.0.0.json", expectedDomain: "relationship_status_current" },
|
|
80
|
+
{ file: "hasTattoos.v1.0.0.json", expectedDomain: "has_tattoos" },
|
|
81
|
+
{ file: "facilitatorLabelUsedInSource.v1.0.0.json", expectedDomain: "facilitator_label_used_in_source" },
|
|
82
|
+
{ file: "homelessStatus.v1.0.0.json", expectedDomain: "homeless_status" },
|
|
83
|
+
{ file: "victimStatusFamily.v1.0.0.json", expectedDomain: "victim_status_family" },
|
|
84
|
+
{ file: "hairColor.v1.0.0.json", expectedDomain: "hair_color" },
|
|
85
|
+
{ file: "sexProviderSubrole.v1.0.0.json", expectedDomain: "sex_provider_subrole" },
|
|
86
|
+
{ file: "relationshipTies.v1.0.0.json", expectedDomain: "relationship_ties" },
|
|
87
|
+
{ file: "personRelationships.v1.0.0.json", expectedDomain: "person_relationships" },
|
|
88
|
+
{ file: "employmentStatus.v1.0.0.json", expectedDomain: "employment_status" },
|
|
89
|
+
{ file: "locationType.v1.0.0.json", expectedDomain: "location_type" },
|
|
90
|
+
{ file: "referralEntityCategory.v1.0.0.json", expectedDomain: "referral_entity_category" },
|
|
91
|
+
{ file: "incomeBenefitsSources.v1.0.0.json", expectedDomain: "income_benefits_sources" },
|
|
92
|
+
{ file: "enrollmentApplicationStatus.v1.0.0.json", expectedDomain: "enrollment_application_status" },
|
|
93
|
+
{ file: "administeringJurisdiction.v1.0.0.json", expectedDomain: "administering_jurisdiction" },
|
|
94
|
+
{ file: "frequencyCadence.v1.0.0.json", expectedDomain: "frequency_cadence" },
|
|
56
95
|
] as const;
|
|
57
96
|
|
|
58
97
|
function loadSot(file: string): unknown {
|
|
@@ -115,6 +154,18 @@ describe("CVC structural invariants (locked spec §4)", () => {
|
|
|
115
154
|
});
|
|
116
155
|
}
|
|
117
156
|
|
|
157
|
+
it("primary_language entries all parse via PrimaryLanguageEntrySchema (iso6391Code + priority)", () => {
|
|
158
|
+
// CvcEnvelopeSchema only validates the base entry shape (+ passthrough);
|
|
159
|
+
// the primary_language domain adds two required fields. Parse every entry
|
|
160
|
+
// through the extended schema so a future drop of `priority` or a wrong
|
|
161
|
+
// `iso6391Code` type fails the build loud.
|
|
162
|
+
const raw = loadSot("primaryLanguage.v1.0.0.json");
|
|
163
|
+
const envelope = CvcEnvelopeSchema.parse(raw);
|
|
164
|
+
for (const entry of envelope.entries) {
|
|
165
|
+
PrimaryLanguageEntrySchema.parse(entry);
|
|
166
|
+
}
|
|
167
|
+
});
|
|
168
|
+
|
|
118
169
|
it("service_categories has at least one entry with relevantMechanisms (sanity: passthrough works)", () => {
|
|
119
170
|
// Guard against a future regression where CvcEntrySchema stops passing
|
|
120
171
|
// domain-specific fields through. Without this, C6 would silently pass
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
{
|
|
2
|
+
"domain": "administering_jurisdiction",
|
|
3
|
+
"name": "Core Administering Jurisdiction",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"levels": {
|
|
6
|
+
"0": "Unknown or Missing",
|
|
7
|
+
"1": "Jurisdiction level"
|
|
8
|
+
},
|
|
9
|
+
"entries": [
|
|
10
|
+
{
|
|
11
|
+
"code": "177-001-000-000-000-000-000",
|
|
12
|
+
"key": "federal",
|
|
13
|
+
"title": "Federal",
|
|
14
|
+
"selectable": true,
|
|
15
|
+
"parentCode": null,
|
|
16
|
+
"childCodes": [],
|
|
17
|
+
"definition": "Program, service, or eligibility administered at the national (federal) government level."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"code": "177-002-000-000-000-000-000",
|
|
21
|
+
"key": "state",
|
|
22
|
+
"title": "State",
|
|
23
|
+
"selectable": true,
|
|
24
|
+
"parentCode": null,
|
|
25
|
+
"childCodes": [],
|
|
26
|
+
"definition": "Program, service, or eligibility administered at the U.S. state (or equivalent) government level."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"code": "177-003-000-000-000-000-000",
|
|
30
|
+
"key": "county",
|
|
31
|
+
"title": "County",
|
|
32
|
+
"selectable": true,
|
|
33
|
+
"parentCode": null,
|
|
34
|
+
"childCodes": [],
|
|
35
|
+
"definition": "Program, service, or eligibility administered at the county (or county-equivalent) government level."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"code": "177-004-000-000-000-000-000",
|
|
39
|
+
"key": "city",
|
|
40
|
+
"title": "City",
|
|
41
|
+
"selectable": true,
|
|
42
|
+
"parentCode": null,
|
|
43
|
+
"childCodes": [],
|
|
44
|
+
"definition": "Program, service, or eligibility administered at the municipal (city, town, or village) government level."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"code": "177-005-000-000-000-000-000",
|
|
48
|
+
"key": "tribal",
|
|
49
|
+
"title": "Tribal",
|
|
50
|
+
"selectable": true,
|
|
51
|
+
"parentCode": null,
|
|
52
|
+
"childCodes": [],
|
|
53
|
+
"definition": "Program, service, or eligibility administered by a federally recognized tribal government or tribal authority."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"code": "177-006-000-000-000-000-000",
|
|
57
|
+
"key": "territory",
|
|
58
|
+
"title": "U.S. Territory",
|
|
59
|
+
"selectable": true,
|
|
60
|
+
"parentCode": null,
|
|
61
|
+
"childCodes": [],
|
|
62
|
+
"definition": "Program, service, or eligibility administered by a U.S. territorial government (e.g., Puerto Rico, Guam, U.S. Virgin Islands, American Samoa, Northern Mariana Islands). Semantically a sub-level of Federal but modeled flat alongside other L1 jurisdictions per brainstorm decision."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"code": "177-000-000-000-000-000-000",
|
|
66
|
+
"key": "missingness_root",
|
|
67
|
+
"title": "Unknown, Redacted, or Missing",
|
|
68
|
+
"selectable": false,
|
|
69
|
+
"parentCode": null,
|
|
70
|
+
"childCodes": [
|
|
71
|
+
"177-000-000-000-000-000-001",
|
|
72
|
+
"177-000-000-000-000-000-002",
|
|
73
|
+
"177-000-000-000-000-000-003"
|
|
74
|
+
],
|
|
75
|
+
"definition": "Root group for values indicating absent, withheld, or uncollected data. Canonical UNK/ANON/DNC triad per CVC-177 Notion codebook (no prefer_not_to_answer row)."
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"code": "177-000-000-000-000-000-001",
|
|
79
|
+
"key": "unknown",
|
|
80
|
+
"title": "Unknown",
|
|
81
|
+
"selectable": true,
|
|
82
|
+
"parentCode": "177-000-000-000-000-000-000",
|
|
83
|
+
"childCodes": [],
|
|
84
|
+
"definition": "Administering jurisdiction level is unknown at time of entry."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"code": "177-000-000-000-000-000-002",
|
|
88
|
+
"key": "anonymous",
|
|
89
|
+
"title": "Anonymous",
|
|
90
|
+
"selectable": true,
|
|
91
|
+
"parentCode": "177-000-000-000-000-000-000",
|
|
92
|
+
"childCodes": [],
|
|
93
|
+
"definition": "Administering jurisdiction level is intentionally withheld or redacted."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"code": "177-000-000-000-000-000-003",
|
|
97
|
+
"key": "data_not_collected",
|
|
98
|
+
"title": "Data not collected",
|
|
99
|
+
"selectable": true,
|
|
100
|
+
"parentCode": "177-000-000-000-000-000-000",
|
|
101
|
+
"childCodes": [],
|
|
102
|
+
"definition": "No attempt was made to collect the administering jurisdiction level."
|
|
103
|
+
}
|
|
104
|
+
]
|
|
105
|
+
}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
{
|
|
2
|
+
"domain": "age_bin_reporting",
|
|
3
|
+
"name": "Core Age Bin (Reporting)",
|
|
4
|
+
"version": "1.0.0",
|
|
5
|
+
"levels": {
|
|
6
|
+
"0": "Unknown or Missing",
|
|
7
|
+
"1": "Age bin"
|
|
8
|
+
},
|
|
9
|
+
"entries": [
|
|
10
|
+
{
|
|
11
|
+
"code": "051-001-000-000-000-000-000",
|
|
12
|
+
"key": "age_0_12",
|
|
13
|
+
"title": "0-12",
|
|
14
|
+
"selectable": true,
|
|
15
|
+
"parentCode": null,
|
|
16
|
+
"childCodes": [],
|
|
17
|
+
"definition": "Age 0-12. Maps to minor_adult_status = minor. Source: VOCA/OVC Age CVC (Notion v2.0)."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"code": "051-002-000-000-000-000-000",
|
|
21
|
+
"key": "age_13_17",
|
|
22
|
+
"title": "13-17",
|
|
23
|
+
"selectable": true,
|
|
24
|
+
"parentCode": null,
|
|
25
|
+
"childCodes": [],
|
|
26
|
+
"definition": "Age 13-17. Maps to minor_adult_status = minor. Source: VOCA/OVC Age CVC (Notion v2.0)."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"code": "051-003-000-000-000-000-000",
|
|
30
|
+
"key": "age_18_24",
|
|
31
|
+
"title": "18-24",
|
|
32
|
+
"selectable": true,
|
|
33
|
+
"parentCode": null,
|
|
34
|
+
"childCodes": [],
|
|
35
|
+
"definition": "Age 18-24. Maps to minor_adult_status = adult. Source: VOCA/OVC Age CVC (Notion v2.0)."
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"code": "051-004-000-000-000-000-000",
|
|
39
|
+
"key": "age_25_59",
|
|
40
|
+
"title": "25-59",
|
|
41
|
+
"selectable": true,
|
|
42
|
+
"parentCode": null,
|
|
43
|
+
"childCodes": [],
|
|
44
|
+
"definition": "Age 25-59. Maps to minor_adult_status = adult. Source: VOCA/OVC Age CVC (Notion v2.0)."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"code": "051-005-000-000-000-000-000",
|
|
48
|
+
"key": "age_60_plus",
|
|
49
|
+
"title": "60+",
|
|
50
|
+
"selectable": true,
|
|
51
|
+
"parentCode": null,
|
|
52
|
+
"childCodes": [],
|
|
53
|
+
"definition": "Age 60 or older. Maps to minor_adult_status = adult. Source: VOCA/OVC Age CVC (Notion v2.0)."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"code": "051-006-000-000-000-000-000",
|
|
57
|
+
"key": "not_reported",
|
|
58
|
+
"title": "Not Reported",
|
|
59
|
+
"selectable": true,
|
|
60
|
+
"parentCode": null,
|
|
61
|
+
"childCodes": [],
|
|
62
|
+
"definition": "VOCA/OVC reporting value indicating age was not reported by the agency or client. Preserved as a first-class L1 entry to maintain VOCA source-coupling; semantically equivalent to canonical missingness key 'unknown' when downstream systems need to normalize."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"code": "051-007-000-000-000-000-000",
|
|
66
|
+
"key": "not_tracked",
|
|
67
|
+
"title": "Not Tracked",
|
|
68
|
+
"selectable": true,
|
|
69
|
+
"parentCode": null,
|
|
70
|
+
"childCodes": [],
|
|
71
|
+
"definition": "VOCA/OVC reporting value indicating the agency does not track age for this service. Preserved as a first-class L1 entry to maintain VOCA source-coupling; semantically equivalent to canonical missingness key 'data_not_collected' when downstream systems need to normalize."
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"code": "051-000-000-000-000-000-000",
|
|
75
|
+
"key": "missingness_root",
|
|
76
|
+
"title": "Unknown, Redacted, or Missing",
|
|
77
|
+
"selectable": false,
|
|
78
|
+
"parentCode": null,
|
|
79
|
+
"childCodes": [
|
|
80
|
+
"051-000-000-000-000-000-001",
|
|
81
|
+
"051-000-000-000-000-000-002",
|
|
82
|
+
"051-000-000-000-000-000-003"
|
|
83
|
+
],
|
|
84
|
+
"definition": "Root group for values indicating absent, withheld, or uncollected data."
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
"code": "051-000-000-000-000-000-001",
|
|
88
|
+
"key": "unknown",
|
|
89
|
+
"title": "Unknown",
|
|
90
|
+
"selectable": true,
|
|
91
|
+
"parentCode": "051-000-000-000-000-000-000",
|
|
92
|
+
"childCodes": [],
|
|
93
|
+
"definition": "Value is unknown at time of entry."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"code": "051-000-000-000-000-000-002",
|
|
97
|
+
"key": "anonymous",
|
|
98
|
+
"title": "Anonymous",
|
|
99
|
+
"selectable": true,
|
|
100
|
+
"parentCode": "051-000-000-000-000-000-000",
|
|
101
|
+
"childCodes": [],
|
|
102
|
+
"definition": "Value is intentionally withheld or redacted."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"code": "051-000-000-000-000-000-003",
|
|
106
|
+
"key": "data_not_collected",
|
|
107
|
+
"title": "Data not collected",
|
|
108
|
+
"selectable": true,
|
|
109
|
+
"parentCode": "051-000-000-000-000-000-000",
|
|
110
|
+
"childCodes": [],
|
|
111
|
+
"definition": "No attempt was made to collect the value."
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
}
|