@htilabs/platform-common-models 0.8.8 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -0
- package/dist/config/index.cjs +191 -0
- package/dist/config/index.cjs.map +1 -0
- package/dist/config/index.d.cts +101 -0
- package/dist/config/index.d.ts +101 -0
- package/dist/config/index.js +165 -0
- package/dist/config/index.js.map +1 -0
- package/dist/constants/index.cjs +5 -432
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +1 -1
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +5 -429
- package/dist/constants/index.js.map +1 -1
- package/dist/{cvcEntry-DaDrEuTa.d.cts → cvcEntry-0BIB9sen.d.cts} +44 -44
- package/dist/{cvcEntry-DaDrEuTa.d.ts → cvcEntry-0BIB9sen.d.ts} +44 -44
- package/dist/cvcs/index.cjs +5863 -7181
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +3127 -4581
- package/dist/cvcs/index.d.ts +3127 -4581
- package/dist/cvcs/index.js +5863 -7173
- package/dist/cvcs/index.js.map +1 -1
- package/dist/{index-C0J3f169.d.ts → index-CDoqrfc1.d.ts} +1 -1
- package/dist/{index-EPjPjR0z.d.cts → index-Zu_mOJRn.d.cts} +1 -1
- package/dist/index.cjs +1780 -3613
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +191 -544
- package/dist/index.d.ts +191 -544
- package/dist/index.js +5967 -7775
- 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/{platform-auth-BSKYSDKe.d.cts → platform-auth-XVB9aHqR.d.cts} +3 -19
- package/dist/{platform-auth-BSKYSDKe.d.ts → platform-auth-XVB9aHqR.d.ts} +3 -19
- package/dist/schemas/index.cjs +9 -26
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +39 -35
- package/dist/schemas/index.d.ts +39 -35
- package/dist/schemas/index.js +9 -26
- package/dist/schemas/index.js.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +25 -19
- package/src/__tests__/__snapshots__/cvc-sot.snap +13 -77
- package/src/__tests__/cvc-sot-snapshot.test.ts +11 -62
- package/src/__tests__/cvc-structural.test.ts +2 -11
- package/src/__tests__/runtime-contract-validator.test.ts +556 -0
- package/src/config/fixtures/valid.yaml +90 -0
- package/src/config/index.ts +352 -0
- package/src/constants/ic.ts +3 -445
- package/src/cvcs/highestEducationLevelCompleted.v1.0.0.json +0 -9
- package/src/cvcs/hmisSex.v1.0.0.json +89 -0
- package/src/cvcs/identificationStatus.v1.0.0.json +0 -18
- package/src/cvcs/incomeBenefitsSources.v1.0.0.json +2 -31
- package/src/cvcs/index.ts +1 -17
- package/src/cvcs/juvenileJusticeEpisodeType.v1.0.0.json +96 -0
- package/src/cvcs/recencyBand.v1.0.0.json +57 -38
- package/src/cvcs/{serviceCategories.v1.1.0.json → serviceCategories.v1.0.0.json} +1091 -1091
- package/src/cvcs/serviceStates.v1.0.0.json +1 -23
- package/src/cvcs/sourceSubtype.v1.1.0.json +0 -36
- package/src/cvcs/verificationMethod.v1.0.0.json +0 -18
- package/src/generated/cvc-enums.ts +149 -572
- package/src/index.ts +20 -0
- package/src/schemas/common.ts +4 -0
- package/src/cvcs/activityType.v1.0.0.json +0 -143
- package/src/cvcs/assertionDomain.v1.0.0.json +0 -629
- package/src/cvcs/contactLinkType.v1.0.0.json +0 -89
- package/src/cvcs/hmisRelationshipToHoh.v1.0.0.json +0 -104
- package/src/cvcs/housingSubsidyTypes.v1.0.0.json +0 -159
- package/src/cvcs/htType.v1.0.0.json +0 -87
- package/src/cvcs/livingSituation.v1.0.0.json +0 -213
- package/src/cvcs/provenanceSourceId.v1.0.0.json +0 -134
- package/src/cvcs/radiusBucket.v1.0.0.json +0 -98
- package/src/cvcs/relationshipConcern.v1.0.0.json +0 -114
- package/src/cvcs/roiMethod.v1.0.0.json +0 -107
- package/src/cvcs/serviceAudience.v1.0.0.json +0 -96
- package/src/cvcs/sessionNoteVisibility.v1.0.0.json +0 -80
- package/src/cvcs/suggestionSource.v1.0.0.json +0 -71
- package/src/cvcs/victimAbuseTypes.v1.0.0.json +0 -276
package/src/index.ts
CHANGED
|
@@ -88,3 +88,23 @@ export { compileModel as compileCvcEntryModel } from "./models/cvcEntryModel.js"
|
|
|
88
88
|
// filesystem access. See `./cvcs/index.ts` for the full list and naming.
|
|
89
89
|
|
|
90
90
|
export * from "./cvcs/index.js";
|
|
91
|
+
|
|
92
|
+
// ─── SOT-first CVC flat-array aliases ───────────────────────────────────────
|
|
93
|
+
// Legacy-shaped `CVC_<N>_VALUES` arrays for CVCs that are SOT-native (no
|
|
94
|
+
// ic.ts constants). Derived from the SOT JSON envelope's `entries` filtered
|
|
95
|
+
// to `selectable: true` so the SOT JSON remains the single source of truth
|
|
96
|
+
// AND the non-selectable `missingness_root` grouping code is excluded (it
|
|
97
|
+
// would otherwise fail schema enum validation on write).
|
|
98
|
+
|
|
99
|
+
import recencyBandSot from "./cvcs/recencyBand.v1.0.0.json" with { type: "json" };
|
|
100
|
+
import juvenileJusticeEpisodeTypeSot from "./cvcs/juvenileJusticeEpisodeType.v1.0.0.json" with { type: "json" };
|
|
101
|
+
|
|
102
|
+
const selectableCodes = (envelope: {
|
|
103
|
+
entries: ReadonlyArray<{ code: string; selectable: boolean }>;
|
|
104
|
+
}): string[] =>
|
|
105
|
+
envelope.entries.filter((e) => e.selectable).map((e) => e.code);
|
|
106
|
+
|
|
107
|
+
export const CVC_137_VALUES: string[] = selectableCodes(recencyBandSot);
|
|
108
|
+
export const CVC_197_VALUES: string[] = selectableCodes(
|
|
109
|
+
juvenileJusticeEpisodeTypeSot,
|
|
110
|
+
);
|
package/src/schemas/common.ts
CHANGED
|
@@ -42,6 +42,10 @@ export const personNameSchema = new Schema(
|
|
|
42
42
|
alias: Boolean,
|
|
43
43
|
isUnknown: Boolean,
|
|
44
44
|
isAnonymous: Boolean,
|
|
45
|
+
// Shape flag: this person has only one name (e.g., Madonna). A mononym
|
|
46
|
+
// can itself be legal, a nickname, a trade name, etc. — it's orthogonal
|
|
47
|
+
// to nameType, not a value of it.
|
|
48
|
+
isMononym: Boolean,
|
|
45
49
|
},
|
|
46
50
|
{ _id: false },
|
|
47
51
|
);
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"domain": "activity_type",
|
|
3
|
-
"name": "activityType",
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"_status": "PROVISIONAL — net-new value-CVC not yet in Notion; provisional 900+ numbering; substantive values sourced verbatim from the PAVE @pave/domain enum of the same name (D10 source-from-platform-common). PENDING canonical Notion authoring + steward ratification of titles/definitions.",
|
|
6
|
-
"_source": "pave-2.0/packages/domain/src/enums.ts",
|
|
7
|
-
"levels": {
|
|
8
|
-
"0": "Unknown or Missing",
|
|
9
|
-
"1": "Activity type"
|
|
10
|
-
},
|
|
11
|
-
"entries": [
|
|
12
|
-
{
|
|
13
|
-
"code": "965-000-000-000-000-000-000",
|
|
14
|
-
"key": "missingness_root",
|
|
15
|
-
"title": "Unknown, Redacted, or Missing",
|
|
16
|
-
"selectable": false,
|
|
17
|
-
"parentCode": null,
|
|
18
|
-
"childCodes": [
|
|
19
|
-
"965-000-000-000-000-000-001",
|
|
20
|
-
"965-000-000-000-000-000-002",
|
|
21
|
-
"965-000-000-000-000-000-003"
|
|
22
|
-
],
|
|
23
|
-
"definition": "Root group for values indicating absent, withheld, or uncollected data."
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"code": "965-000-000-000-000-000-001",
|
|
27
|
-
"key": "unknown",
|
|
28
|
-
"title": "Unknown",
|
|
29
|
-
"selectable": true,
|
|
30
|
-
"parentCode": "965-000-000-000-000-000-000",
|
|
31
|
-
"childCodes": [],
|
|
32
|
-
"definition": "The activity_type is unknown or cannot be determined."
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"code": "965-000-000-000-000-000-002",
|
|
36
|
-
"key": "anonymous",
|
|
37
|
-
"title": "Anonymous / declined to answer",
|
|
38
|
-
"selectable": true,
|
|
39
|
-
"parentCode": "965-000-000-000-000-000-000",
|
|
40
|
-
"childCodes": [],
|
|
41
|
-
"definition": "Value is intentionally withheld, declined, or redacted."
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"code": "965-000-000-000-000-000-003",
|
|
45
|
-
"key": "data_not_collected",
|
|
46
|
-
"title": "Data not collected",
|
|
47
|
-
"selectable": true,
|
|
48
|
-
"parentCode": "965-000-000-000-000-000-000",
|
|
49
|
-
"childCodes": [],
|
|
50
|
-
"definition": "No attempt was made to collect the value."
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"code": "965-001-000-000-000-000-000",
|
|
54
|
-
"key": "resided",
|
|
55
|
-
"title": "Resided",
|
|
56
|
-
"selectable": true,
|
|
57
|
-
"parentCode": null,
|
|
58
|
-
"childCodes": [],
|
|
59
|
-
"definition": "Activity type 'resided' recorded on a person/relationship interaction."
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"code": "965-002-000-000-000-000-000",
|
|
63
|
-
"key": "sheltered",
|
|
64
|
-
"title": "Sheltered",
|
|
65
|
-
"selectable": true,
|
|
66
|
-
"parentCode": null,
|
|
67
|
-
"childCodes": [],
|
|
68
|
-
"definition": "Activity type 'sheltered' recorded on a person/relationship interaction."
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"code": "965-003-000-000-000-000-000",
|
|
72
|
-
"key": "service_delivered",
|
|
73
|
-
"title": "Service Delivered",
|
|
74
|
-
"selectable": true,
|
|
75
|
-
"parentCode": null,
|
|
76
|
-
"childCodes": [],
|
|
77
|
-
"definition": "Activity type 'service_delivered' recorded on a person/relationship interaction."
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
"code": "965-004-000-000-000-000-000",
|
|
81
|
-
"key": "met",
|
|
82
|
-
"title": "Met",
|
|
83
|
-
"selectable": true,
|
|
84
|
-
"parentCode": null,
|
|
85
|
-
"childCodes": [],
|
|
86
|
-
"definition": "Activity type 'met' recorded on a person/relationship interaction."
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
"code": "965-005-000-000-000-000-000",
|
|
90
|
-
"key": "advertised",
|
|
91
|
-
"title": "Advertised",
|
|
92
|
-
"selectable": true,
|
|
93
|
-
"parentCode": null,
|
|
94
|
-
"childCodes": [],
|
|
95
|
-
"definition": "Activity type 'advertised' recorded on a person/relationship interaction."
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"code": "965-006-000-000-000-000-000",
|
|
99
|
-
"key": "arrested",
|
|
100
|
-
"title": "Arrested",
|
|
101
|
-
"selectable": true,
|
|
102
|
-
"parentCode": null,
|
|
103
|
-
"childCodes": [],
|
|
104
|
-
"definition": "Activity type 'arrested' recorded on a person/relationship interaction."
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
"code": "965-007-000-000-000-000-000",
|
|
108
|
-
"key": "visited",
|
|
109
|
-
"title": "Visited",
|
|
110
|
-
"selectable": true,
|
|
111
|
-
"parentCode": null,
|
|
112
|
-
"childCodes": [],
|
|
113
|
-
"definition": "Activity type 'visited' recorded on a person/relationship interaction."
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
"code": "965-008-000-000-000-000-000",
|
|
117
|
-
"key": "child_welfare_visit",
|
|
118
|
-
"title": "Child Welfare Visit",
|
|
119
|
-
"selectable": true,
|
|
120
|
-
"parentCode": null,
|
|
121
|
-
"childCodes": [],
|
|
122
|
-
"definition": "Activity type 'child_welfare_visit' recorded on a person/relationship interaction."
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
"code": "965-009-000-000-000-000-000",
|
|
126
|
-
"key": "incident",
|
|
127
|
-
"title": "Incident",
|
|
128
|
-
"selectable": true,
|
|
129
|
-
"parentCode": null,
|
|
130
|
-
"childCodes": [],
|
|
131
|
-
"definition": "Activity type 'incident' recorded on a person/relationship interaction."
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
"code": "965-010-000-000-000-000-000",
|
|
135
|
-
"key": "other",
|
|
136
|
-
"title": "Other",
|
|
137
|
-
"selectable": true,
|
|
138
|
-
"parentCode": null,
|
|
139
|
-
"childCodes": [],
|
|
140
|
-
"definition": "Activity type 'other' recorded on a person/relationship interaction."
|
|
141
|
-
}
|
|
142
|
-
]
|
|
143
|
-
}
|