@htilabs/platform-common-models 0.5.1-beta.2 → 0.5.3-beta.4

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 (35) hide show
  1. package/dist/{cvcEntry-wqktWfzE.d.cts → cvcEntry-BCj1OWqL.d.cts} +8 -8
  2. package/dist/{cvcEntry-wqktWfzE.d.ts → cvcEntry-BCj1OWqL.d.ts} +8 -8
  3. package/dist/cvcs/index.cjs +2266 -0
  4. package/dist/cvcs/index.cjs.map +1 -1
  5. package/dist/cvcs/index.d.cts +2519 -46
  6. package/dist/cvcs/index.d.ts +2519 -46
  7. package/dist/cvcs/index.js +2264 -0
  8. package/dist/cvcs/index.js.map +1 -1
  9. package/dist/{index--NCIPluF.d.cts → index-CoVr1jIV.d.cts} +1 -1
  10. package/dist/{index-CFOrHA8l.d.ts → index-I-DiX9eQ.d.ts} +1 -1
  11. package/dist/index.cjs +2483 -0
  12. package/dist/index.cjs.map +1 -1
  13. package/dist/index.d.cts +225 -4
  14. package/dist/index.d.ts +225 -4
  15. package/dist/index.js +2479 -0
  16. package/dist/index.js.map +1 -1
  17. package/dist/models/index.d.cts +2 -2
  18. package/dist/models/index.d.ts +2 -2
  19. package/dist/schemas/index.d.cts +1 -1
  20. package/dist/schemas/index.d.ts +1 -1
  21. package/dist/validation/index.cjs +6 -0
  22. package/dist/validation/index.cjs.map +1 -1
  23. package/dist/validation/index.d.cts +47 -1
  24. package/dist/validation/index.d.ts +47 -1
  25. package/dist/validation/index.js +5 -0
  26. package/dist/validation/index.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/__tests__/__snapshots__/cvc-sot.snap +8 -0
  29. package/src/__tests__/cvc-sot-snapshot.test.ts +16 -0
  30. package/src/__tests__/cvc-structural.test.ts +17 -0
  31. package/src/cvcs/index.ts +4 -0
  32. package/src/cvcs/primaryLanguage.v1.0.0.json +2116 -0
  33. package/src/cvcs/raceEthnicity.v1.0.0.json +142 -0
  34. package/src/generated/cvc-enums.ts +225 -0
  35. package/src/validation/cvc.ts +17 -0
@@ -0,0 +1,142 @@
1
+ {
2
+ "domain": "race_ethnicity",
3
+ "name": "Core Race/Ethnicity",
4
+ "version": "1.0.0",
5
+ "levels": {
6
+ "0": "Unknown or Missing",
7
+ "1": "Category"
8
+ },
9
+ "entries": [
10
+ {
11
+ "code": "076-000-000-000-000-000-000",
12
+ "key": "missingness_root",
13
+ "title": "Unknown, Redacted, or Missing",
14
+ "selectable": false,
15
+ "parentCode": null,
16
+ "childCodes": [
17
+ "076-000-000-000-000-000-001",
18
+ "076-000-000-000-000-000-002",
19
+ "076-000-000-000-000-000-003",
20
+ "076-000-000-000-000-000-004"
21
+ ],
22
+ "definition": "Root group for values indicating absent, withheld, or uncollected data."
23
+ },
24
+ {
25
+ "code": "076-000-000-000-000-000-001",
26
+ "key": "unknown",
27
+ "title": "Unknown",
28
+ "selectable": true,
29
+ "parentCode": "076-000-000-000-000-000-000",
30
+ "childCodes": [],
31
+ "definition": "Value is unknown at time of entry."
32
+ },
33
+ {
34
+ "code": "076-000-000-000-000-000-002",
35
+ "key": "anonymous",
36
+ "title": "Anonymous",
37
+ "selectable": true,
38
+ "parentCode": "076-000-000-000-000-000-000",
39
+ "childCodes": [],
40
+ "definition": "Value is intentionally withheld or redacted."
41
+ },
42
+ {
43
+ "code": "076-000-000-000-000-000-003",
44
+ "key": "data_not_collected",
45
+ "title": "Data not collected",
46
+ "selectable": true,
47
+ "parentCode": "076-000-000-000-000-000-000",
48
+ "childCodes": [],
49
+ "definition": "No attempt was made to collect the value."
50
+ },
51
+ {
52
+ "code": "076-000-000-000-000-000-004",
53
+ "key": "prefer_not_to_answer",
54
+ "title": "Client prefers not to answer",
55
+ "selectable": true,
56
+ "parentCode": "076-000-000-000-000-000-000",
57
+ "childCodes": [],
58
+ "definition": "Client was offered the opportunity to self-identify and explicitly declined to provide the value."
59
+ },
60
+ {
61
+ "code": "076-001-000-000-000-000-000",
62
+ "key": "american_indian_or_alaska_native",
63
+ "title": "American Indian or Alaska Native",
64
+ "selectable": true,
65
+ "parentCode": null,
66
+ "childCodes": [],
67
+ "definition": "Individuals with origins in any of the original peoples of North, Central, and South America, including, for example, Navajo Nation, Blackfeet Tribe of the Blackfeet Indian Reservation of Montana, Native Village of Barrow Inupiat Traditional Government, Nome Eskimo Community, Aztec, and Maya."
68
+ },
69
+ {
70
+ "code": "076-002-000-000-000-000-000",
71
+ "key": "asian",
72
+ "title": "Asian",
73
+ "selectable": true,
74
+ "parentCode": null,
75
+ "childCodes": [],
76
+ "definition": "Individuals with origins in any of the original peoples of Central or East Asia, Southeast Asia, or South Asia, including, for example, Chinese, Asian Indian, Filipino, Vietnamese, Korean, and Japanese."
77
+ },
78
+ {
79
+ "code": "076-003-000-000-000-000-000",
80
+ "key": "black_or_african_american",
81
+ "title": "Black or African American",
82
+ "selectable": true,
83
+ "parentCode": null,
84
+ "childCodes": [],
85
+ "definition": "Individuals with origins in any of the Black racial groups of Africa, including, for example, African American, Jamaican, Haitian, Nigerian, Ethiopian, and Somali."
86
+ },
87
+ {
88
+ "code": "076-004-000-000-000-000-000",
89
+ "key": "hispanic_or_latino",
90
+ "title": "Hispanic or Latino",
91
+ "selectable": true,
92
+ "parentCode": null,
93
+ "childCodes": [],
94
+ "definition": "Includes individuals of Mexican, Puerto Rican, Salvadoran, Cuban, Dominican, Guatemalan, and other Central or South American or Spanish culture or origin."
95
+ },
96
+ {
97
+ "code": "076-005-000-000-000-000-000",
98
+ "key": "middle_eastern_or_north_african",
99
+ "title": "Middle Eastern or North African",
100
+ "selectable": true,
101
+ "parentCode": null,
102
+ "childCodes": [],
103
+ "definition": "Individuals with origins in any of the original peoples of the Middle East or North Africa, including, for example, Lebanese, Iranian, Egyptian, Syrian, Iraqi, and Israeli."
104
+ },
105
+ {
106
+ "code": "076-006-000-000-000-000-000",
107
+ "key": "multiple_races",
108
+ "title": "Multiple Races [multiple were selected]",
109
+ "selectable": true,
110
+ "parentCode": null,
111
+ "childCodes": [],
112
+ "definition": "Indicates that an individual identifies with more than one racial and/or ethnic category."
113
+ },
114
+ {
115
+ "code": "076-007-000-000-000-000-000",
116
+ "key": "native_hawaiian_or_pacific_islander",
117
+ "title": "Native Hawaiian or Pacific Islander",
118
+ "selectable": true,
119
+ "parentCode": null,
120
+ "childCodes": [],
121
+ "definition": "Individuals with origins in any of the original peoples of Hawaii, Guam, Samoa, or other Pacific Islands, including, for example, Native Hawaiian, Samoan, Chamorro, Tongan, Fijian, and Marshallese."
122
+ },
123
+ {
124
+ "code": "076-008-000-000-000-000-000",
125
+ "key": "other_self_described",
126
+ "title": "Other - [trigger an optional write in]",
127
+ "selectable": true,
128
+ "parentCode": null,
129
+ "childCodes": [],
130
+ "definition": "Allows for additional self-described race or ethnicity information not adequately represented by the listed categories."
131
+ },
132
+ {
133
+ "code": "076-009-000-000-000-000-000",
134
+ "key": "white",
135
+ "title": "White",
136
+ "selectable": true,
137
+ "parentCode": null,
138
+ "childCodes": [],
139
+ "definition": "Individuals with origins in any of the original peoples of Europe, including, for example, English, German, Irish, Italian, Polish, and Scottish."
140
+ }
141
+ ]
142
+ }
@@ -260,3 +260,228 @@ export const IncidentInvolvementRoleKeys = {
260
260
  } as const;
261
261
 
262
262
  export type IncidentInvolvementRoleKey = keyof typeof IncidentInvolvementRoleKeys;
263
+
264
+ /**
265
+ * Key → positional code map for the `race_ethnicity` CVC domain.
266
+ *
267
+ * Domain: `race_ethnicity` · Version: 1.0.0 · Entries: 14
268
+ */
269
+ export const RaceEthnicityKeys = {
270
+ missingness_root: "076-000-000-000-000-000-000",
271
+ unknown: "076-000-000-000-000-000-001",
272
+ anonymous: "076-000-000-000-000-000-002",
273
+ data_not_collected: "076-000-000-000-000-000-003",
274
+ prefer_not_to_answer: "076-000-000-000-000-000-004",
275
+ american_indian_or_alaska_native: "076-001-000-000-000-000-000",
276
+ asian: "076-002-000-000-000-000-000",
277
+ black_or_african_american: "076-003-000-000-000-000-000",
278
+ hispanic_or_latino: "076-004-000-000-000-000-000",
279
+ middle_eastern_or_north_african: "076-005-000-000-000-000-000",
280
+ multiple_races: "076-006-000-000-000-000-000",
281
+ native_hawaiian_or_pacific_islander: "076-007-000-000-000-000-000",
282
+ other_self_described: "076-008-000-000-000-000-000",
283
+ white: "076-009-000-000-000-000-000",
284
+ } as const;
285
+
286
+ export type RaceEthnicityKey = keyof typeof RaceEthnicityKeys;
287
+
288
+ /**
289
+ * Key → positional code map for the `primary_language` CVC domain.
290
+ *
291
+ * Domain: `primary_language` · Version: 1.0.0 · Entries: 191
292
+ */
293
+ export const PrimaryLanguageKeys = {
294
+ missingness_root: "122-000-000-000-000-000-000",
295
+ unknown: "122-000-000-000-000-000-001",
296
+ anonymous: "122-000-000-000-000-000-002",
297
+ data_not_collected: "122-000-000-000-000-000-003",
298
+ abkhazian: "122-001-000-000-000-000-000",
299
+ afar: "122-002-000-000-000-000-000",
300
+ afrikaans: "122-003-000-000-000-000-000",
301
+ akan: "122-004-000-000-000-000-000",
302
+ albanian: "122-005-000-000-000-000-000",
303
+ american_sign_language: "122-006-000-000-000-000-000",
304
+ amharic: "122-007-000-000-000-000-000",
305
+ arabic: "122-008-000-000-000-000-000",
306
+ aragonese: "122-009-000-000-000-000-000",
307
+ armenian: "122-010-000-000-000-000-000",
308
+ assamese: "122-011-000-000-000-000-000",
309
+ avaric: "122-012-000-000-000-000-000",
310
+ avestan: "122-013-000-000-000-000-000",
311
+ aymara: "122-014-000-000-000-000-000",
312
+ azerbaijani: "122-015-000-000-000-000-000",
313
+ bambara: "122-016-000-000-000-000-000",
314
+ bashkir: "122-017-000-000-000-000-000",
315
+ basque: "122-018-000-000-000-000-000",
316
+ belarusian: "122-019-000-000-000-000-000",
317
+ bengali: "122-020-000-000-000-000-000",
318
+ bislama: "122-021-000-000-000-000-000",
319
+ bosnian: "122-022-000-000-000-000-000",
320
+ breton: "122-023-000-000-000-000-000",
321
+ bulgarian: "122-024-000-000-000-000-000",
322
+ burmese: "122-025-000-000-000-000-000",
323
+ catalan_valencian: "122-026-000-000-000-000-000",
324
+ central_khmer: "122-027-000-000-000-000-000",
325
+ chamorro: "122-028-000-000-000-000-000",
326
+ chechen: "122-029-000-000-000-000-000",
327
+ chichewa_chewa_nyanja: "122-030-000-000-000-000-000",
328
+ chinese: "122-031-000-000-000-000-000",
329
+ chinese_cantonese: "122-032-000-000-000-000-000",
330
+ chinese_mandarin: "122-033-000-000-000-000-000",
331
+ church_slavic_old_slavonic_church_slavonic_old_bulgarian_old_church_slavonic: "122-034-000-000-000-000-000",
332
+ chuvash: "122-035-000-000-000-000-000",
333
+ cornish: "122-036-000-000-000-000-000",
334
+ corsican: "122-037-000-000-000-000-000",
335
+ cree: "122-038-000-000-000-000-000",
336
+ croatian: "122-039-000-000-000-000-000",
337
+ czech: "122-040-000-000-000-000-000",
338
+ danish: "122-041-000-000-000-000-000",
339
+ divehi_dhivehi_maldivian: "122-042-000-000-000-000-000",
340
+ dutch_flemish: "122-043-000-000-000-000-000",
341
+ dzongkha: "122-044-000-000-000-000-000",
342
+ english: "122-045-000-000-000-000-000",
343
+ esperanto: "122-046-000-000-000-000-000",
344
+ estonian: "122-047-000-000-000-000-000",
345
+ ewe: "122-048-000-000-000-000-000",
346
+ faroese: "122-049-000-000-000-000-000",
347
+ fijian: "122-050-000-000-000-000-000",
348
+ finnish: "122-051-000-000-000-000-000",
349
+ french: "122-052-000-000-000-000-000",
350
+ fulah: "122-053-000-000-000-000-000",
351
+ gaelic_scottish_gaelic: "122-054-000-000-000-000-000",
352
+ galician: "122-055-000-000-000-000-000",
353
+ ganda: "122-056-000-000-000-000-000",
354
+ georgian: "122-057-000-000-000-000-000",
355
+ german: "122-058-000-000-000-000-000",
356
+ guarani: "122-059-000-000-000-000-000",
357
+ gujarati: "122-060-000-000-000-000-000",
358
+ haitian_haitian_creole: "122-061-000-000-000-000-000",
359
+ hausa: "122-062-000-000-000-000-000",
360
+ hebrew: "122-063-000-000-000-000-000",
361
+ herero: "122-064-000-000-000-000-000",
362
+ hindi: "122-065-000-000-000-000-000",
363
+ hiri_motu: "122-066-000-000-000-000-000",
364
+ hungarian: "122-067-000-000-000-000-000",
365
+ icelandic: "122-068-000-000-000-000-000",
366
+ ido: "122-069-000-000-000-000-000",
367
+ igbo: "122-070-000-000-000-000-000",
368
+ indonesian: "122-071-000-000-000-000-000",
369
+ interlingua: "122-072-000-000-000-000-000",
370
+ interlingue_occidental: "122-073-000-000-000-000-000",
371
+ inuktitut: "122-074-000-000-000-000-000",
372
+ inupiaq: "122-075-000-000-000-000-000",
373
+ irish: "122-076-000-000-000-000-000",
374
+ italian: "122-077-000-000-000-000-000",
375
+ japanese: "122-078-000-000-000-000-000",
376
+ javanese: "122-079-000-000-000-000-000",
377
+ kalaallisut_greenlandic: "122-080-000-000-000-000-000",
378
+ kannada: "122-081-000-000-000-000-000",
379
+ kanuri: "122-082-000-000-000-000-000",
380
+ kashmiri: "122-083-000-000-000-000-000",
381
+ kazakh: "122-084-000-000-000-000-000",
382
+ kikuyu_gikuyu: "122-085-000-000-000-000-000",
383
+ kinyarwanda: "122-086-000-000-000-000-000",
384
+ kirghiz_kyrgyz: "122-087-000-000-000-000-000",
385
+ komi: "122-088-000-000-000-000-000",
386
+ kongo: "122-089-000-000-000-000-000",
387
+ korean: "122-090-000-000-000-000-000",
388
+ kuanyama_kwanyama: "122-091-000-000-000-000-000",
389
+ kurdish: "122-092-000-000-000-000-000",
390
+ lao: "122-093-000-000-000-000-000",
391
+ latin: "122-094-000-000-000-000-000",
392
+ latvian: "122-095-000-000-000-000-000",
393
+ limburgan_limburger_limburgish: "122-096-000-000-000-000-000",
394
+ lingala: "122-097-000-000-000-000-000",
395
+ lithuanian: "122-098-000-000-000-000-000",
396
+ luba_katanga: "122-099-000-000-000-000-000",
397
+ luxembourgish_letzeburgesch: "122-100-000-000-000-000-000",
398
+ macedonian: "122-101-000-000-000-000-000",
399
+ malagasy: "122-102-000-000-000-000-000",
400
+ malay: "122-103-000-000-000-000-000",
401
+ malayalam: "122-104-000-000-000-000-000",
402
+ maltese: "122-105-000-000-000-000-000",
403
+ manx: "122-106-000-000-000-000-000",
404
+ maori: "122-107-000-000-000-000-000",
405
+ marathi: "122-108-000-000-000-000-000",
406
+ marshallese: "122-109-000-000-000-000-000",
407
+ modern_greek: "122-110-000-000-000-000-000",
408
+ mongolian: "122-111-000-000-000-000-000",
409
+ nauru: "122-112-000-000-000-000-000",
410
+ navajo_navaho: "122-113-000-000-000-000-000",
411
+ ndonga: "122-114-000-000-000-000-000",
412
+ nepali: "122-115-000-000-000-000-000",
413
+ north_ndebele: "122-116-000-000-000-000-000",
414
+ northern_sami: "122-117-000-000-000-000-000",
415
+ norwegian: "122-118-000-000-000-000-000",
416
+ norwegian_bokmal: "122-119-000-000-000-000-000",
417
+ norwegian_nynorsk: "122-120-000-000-000-000-000",
418
+ occitan: "122-121-000-000-000-000-000",
419
+ ojibwa: "122-122-000-000-000-000-000",
420
+ oriya: "122-123-000-000-000-000-000",
421
+ oromo: "122-124-000-000-000-000-000",
422
+ ossetian_ossetic: "122-125-000-000-000-000-000",
423
+ other_language: "122-126-000-000-000-000-000",
424
+ pali: "122-127-000-000-000-000-000",
425
+ panjabi_punjabi: "122-128-000-000-000-000-000",
426
+ persian: "122-129-000-000-000-000-000",
427
+ polish: "122-130-000-000-000-000-000",
428
+ portuguese: "122-131-000-000-000-000-000",
429
+ pushto_pashto: "122-132-000-000-000-000-000",
430
+ quechua: "122-133-000-000-000-000-000",
431
+ romanian_moldavian_moldovan: "122-134-000-000-000-000-000",
432
+ romansh: "122-135-000-000-000-000-000",
433
+ rundi: "122-136-000-000-000-000-000",
434
+ russian: "122-137-000-000-000-000-000",
435
+ samoan: "122-138-000-000-000-000-000",
436
+ sango: "122-139-000-000-000-000-000",
437
+ sanskrit: "122-140-000-000-000-000-000",
438
+ sardinian: "122-141-000-000-000-000-000",
439
+ serbian: "122-142-000-000-000-000-000",
440
+ shona: "122-143-000-000-000-000-000",
441
+ sichuan_yi_nuosu: "122-144-000-000-000-000-000",
442
+ sindhi: "122-145-000-000-000-000-000",
443
+ sinhala_sinhalese: "122-146-000-000-000-000-000",
444
+ slovak: "122-147-000-000-000-000-000",
445
+ slovenian: "122-148-000-000-000-000-000",
446
+ somali: "122-149-000-000-000-000-000",
447
+ sotho_southern: "122-150-000-000-000-000-000",
448
+ south_ndebele: "122-151-000-000-000-000-000",
449
+ spanish: "122-152-000-000-000-000-000",
450
+ sundanese: "122-153-000-000-000-000-000",
451
+ swahili: "122-154-000-000-000-000-000",
452
+ swati: "122-155-000-000-000-000-000",
453
+ swedish: "122-156-000-000-000-000-000",
454
+ tagalog: "122-157-000-000-000-000-000",
455
+ tahitian: "122-158-000-000-000-000-000",
456
+ tajik: "122-159-000-000-000-000-000",
457
+ tamil: "122-160-000-000-000-000-000",
458
+ tatar: "122-161-000-000-000-000-000",
459
+ telugu: "122-162-000-000-000-000-000",
460
+ thai: "122-163-000-000-000-000-000",
461
+ tibetan: "122-164-000-000-000-000-000",
462
+ tigrinya: "122-165-000-000-000-000-000",
463
+ tonga: "122-166-000-000-000-000-000",
464
+ tsonga: "122-167-000-000-000-000-000",
465
+ tswana: "122-168-000-000-000-000-000",
466
+ turkish: "122-169-000-000-000-000-000",
467
+ turkmen: "122-170-000-000-000-000-000",
468
+ twi: "122-171-000-000-000-000-000",
469
+ uighur_uyghur: "122-172-000-000-000-000-000",
470
+ ukrainian: "122-173-000-000-000-000-000",
471
+ urdu: "122-174-000-000-000-000-000",
472
+ uzbek: "122-175-000-000-000-000-000",
473
+ venda: "122-176-000-000-000-000-000",
474
+ vietnamese: "122-177-000-000-000-000-000",
475
+ volapuk: "122-178-000-000-000-000-000",
476
+ walloon: "122-179-000-000-000-000-000",
477
+ welsh: "122-180-000-000-000-000-000",
478
+ western_frisian: "122-181-000-000-000-000-000",
479
+ wolof: "122-182-000-000-000-000-000",
480
+ xhosa: "122-183-000-000-000-000-000",
481
+ yiddish: "122-184-000-000-000-000-000",
482
+ yoruba: "122-185-000-000-000-000-000",
483
+ zhuang_chuang: "122-186-000-000-000-000-000",
484
+ zulu: "122-187-000-000-000-000-000",
485
+ } as const;
486
+
487
+ export type PrimaryLanguageKey = keyof typeof PrimaryLanguageKeys;
@@ -80,6 +80,22 @@ export const ServiceCategoryEntrySchema = CvcEntrySchema.extend({
80
80
  relevantMechanisms: z.array(CvcKeySchema).nullable(),
81
81
  });
82
82
 
83
+ /**
84
+ * Primary-language-specific entry. Adds:
85
+ * - `iso6391Code` — the ISO 639-1 alpha-2 code for the language, or `null`
86
+ * for entries without an ISO 639-1 code (missingness entries, Chinese
87
+ * varieties Mandarin/Cantonese, `other_language`). ASL is stored as
88
+ * `"ase"` (ISO 639-3) per Notion's convention; the CVC header documents
89
+ * this caveat.
90
+ * - `priority` — `true` for front-end short-list entries (14 total in
91
+ * CVC-122: 13 L1 languages plus the canonical `unknown` missingness
92
+ * entry). See locked spec §9.2.
93
+ */
94
+ export const PrimaryLanguageEntrySchema = CvcEntrySchema.extend({
95
+ iso6391Code: z.string().nullable(),
96
+ priority: z.boolean(),
97
+ });
98
+
83
99
  // ─── Envelope schema ─────────────────────────────────────────────────────────
84
100
 
85
101
  /**
@@ -104,6 +120,7 @@ export type CvcCode = z.infer<typeof CvcCodeSchema>;
104
120
  export type CvcKey = z.infer<typeof CvcKeySchema>;
105
121
  export type CvcEntry = z.infer<typeof CvcEntrySchema>;
106
122
  export type ServiceCategoryEntry = z.infer<typeof ServiceCategoryEntrySchema>;
123
+ export type PrimaryLanguageEntry = z.infer<typeof PrimaryLanguageEntrySchema>;
107
124
  export type CvcEnvelope = z.infer<typeof CvcEnvelopeSchema>;
108
125
 
109
126
  /**