@htilabs/platform-common-models 0.7.0-beta.1 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/README.md +0 -44
  2. package/dist/constants/index.cjs +76 -52
  3. package/dist/constants/index.cjs.map +1 -1
  4. package/dist/constants/index.d.cts +1 -1
  5. package/dist/constants/index.d.ts +1 -1
  6. package/dist/constants/index.js +75 -48
  7. package/dist/constants/index.js.map +1 -1
  8. package/dist/{cvcEntry-BCj1OWqL.d.cts → cvcEntry-DaDrEuTa.d.cts} +36 -36
  9. package/dist/{cvcEntry-BCj1OWqL.d.ts → cvcEntry-DaDrEuTa.d.ts} +36 -36
  10. package/dist/cvcs/index.cjs +11136 -136
  11. package/dist/cvcs/index.cjs.map +1 -1
  12. package/dist/cvcs/index.d.cts +12856 -603
  13. package/dist/cvcs/index.d.ts +12856 -603
  14. package/dist/cvcs/index.js +11060 -132
  15. package/dist/cvcs/index.js.map +1 -1
  16. package/dist/{index-I-DiX9eQ.d.ts → index-C0J3f169.d.ts} +1 -1
  17. package/dist/{index-CoVr1jIV.d.cts → index-EPjPjR0z.d.cts} +1 -1
  18. package/dist/index.cjs +12593 -246
  19. package/dist/index.cjs.map +1 -1
  20. package/dist/index.d.cts +1686 -98
  21. package/dist/index.d.ts +1686 -98
  22. package/dist/index.js +12442 -234
  23. package/dist/index.js.map +1 -1
  24. package/dist/models/index.d.cts +2 -2
  25. package/dist/models/index.d.ts +2 -2
  26. package/dist/{platform-auth-C97LpsRd.d.cts → platform-auth-7dL99tZh.d.cts} +21 -9
  27. package/dist/{platform-auth-C97LpsRd.d.ts → platform-auth-7dL99tZh.d.ts} +21 -9
  28. package/dist/schemas/index.cjs +68 -49
  29. package/dist/schemas/index.cjs.map +1 -1
  30. package/dist/schemas/index.d.cts +11 -15
  31. package/dist/schemas/index.d.ts +11 -15
  32. package/dist/schemas/index.js +68 -49
  33. package/dist/schemas/index.js.map +1 -1
  34. package/dist/types/index.d.cts +2 -2
  35. package/dist/types/index.d.ts +2 -2
  36. package/package.json +19 -25
  37. package/src/__tests__/__snapshots__/cvc-sot.snap +297 -9
  38. package/src/__tests__/cvc-sot-snapshot.test.ts +150 -18
  39. package/src/__tests__/cvc-structural.test.ts +76 -3
  40. package/src/constants/ic.ts +163 -51
  41. package/src/cvcs/accommodationType.v1.0.0.json +107 -0
  42. package/src/cvcs/actionStepCompletionStatus.v1.0.0.json +89 -0
  43. package/src/cvcs/actionStepType.v1.0.0.json +71 -0
  44. package/src/cvcs/announcementAudienceScope.v1.0.0.json +80 -0
  45. package/src/cvcs/announcementResponseType.v1.0.0.json +89 -0
  46. package/src/cvcs/basisQuickPicks.v1.0.0.json +123 -0
  47. package/src/cvcs/checkInActivity.v1.0.0.json +233 -0
  48. package/src/cvcs/checkInPhase.v1.0.0.json +152 -0
  49. package/src/cvcs/childBehavioralConcerns.v1.0.0.json +161 -0
  50. package/src/cvcs/childCustodyArrangement.v1.0.0.json +188 -0
  51. package/src/cvcs/collectionContext.v1.0.0.json +88 -0
  52. package/src/cvcs/contactInfoUseType.v1.0.0.json +87 -0
  53. package/src/cvcs/daIncidentArchiveReason.v1.0.0.json +89 -0
  54. package/src/cvcs/daIncidentConfidence.v1.0.0.json +80 -0
  55. package/src/cvcs/daIncidentDayApprox.v1.0.0.json +89 -0
  56. package/src/cvcs/daIncidentSeverity.v1.0.0.json +97 -0
  57. package/src/cvcs/determinationLevel.v1.0.0.json +96 -0
  58. package/src/cvcs/disabilitySubtype.v1.0.0.json +126 -0
  59. package/src/cvcs/discretionLevel.v1.0.0.json +89 -0
  60. package/src/cvcs/emergencyContactCallReason.v1.0.0.json +107 -0
  61. package/src/cvcs/emergencyContactPermissions.v1.0.0.json +125 -0
  62. package/src/cvcs/emergencyExitCascade.v1.0.0.json +89 -0
  63. package/src/cvcs/exitProcessChecklistItem.v1.0.0.json +152 -0
  64. package/src/cvcs/exitReasons.v1.0.0.json +224 -0
  65. package/src/cvcs/facialHair.v1.0.0.json +71 -0
  66. package/src/cvcs/funder.v1.0.0.json +125 -0
  67. package/src/cvcs/goalCategory.v1.0.0.json +161 -0
  68. package/src/cvcs/goalPriority.v1.0.0.json +80 -0
  69. package/src/cvcs/goalStatus.v1.0.0.json +98 -0
  70. package/src/cvcs/goalWithdrawalReason.v1.0.0.json +116 -0
  71. package/src/cvcs/hmisProjectType.v1.0.0.json +178 -0
  72. package/src/cvcs/hopeScaleCaptureContext.v1.0.0.json +116 -0
  73. package/src/cvcs/hopeScaleResponseOptions.v1.0.0.json +125 -0
  74. package/src/cvcs/hopeScaleTier.v1.0.0.json +89 -0
  75. package/src/cvcs/identificationStatus.v1.0.0.json +80 -0
  76. package/src/cvcs/index.ts +150 -6
  77. package/src/cvcs/inferenceType.v1.0.0.json +78 -0
  78. package/src/cvcs/investigativeRequestType.v1.0.0.json +89 -0
  79. package/src/cvcs/languages.v1.0.0.json +1924 -0
  80. package/src/cvcs/leReportStatus.v1.0.0.json +89 -0
  81. package/src/cvcs/legalActionType.v1.0.0.json +116 -0
  82. package/src/cvcs/messageReportReason.v1.0.0.json +107 -0
  83. package/src/cvcs/midStayEventType.v1.0.0.json +116 -0
  84. package/src/cvcs/milestoneType.v1.0.0.json +170 -0
  85. package/src/cvcs/needsResidentialAgain.v1.0.0.json +80 -0
  86. package/src/cvcs/personRelationships.v1.0.0.json +6 -6
  87. package/src/cvcs/petExitReason.v1.0.0.json +107 -0
  88. package/src/cvcs/petRelationshipBasis.v1.0.0.json +80 -0
  89. package/src/cvcs/programSpecificCode.v1.0.0.json +125 -0
  90. package/src/cvcs/proofOfIdType.v1.0.0.json +188 -0
  91. package/src/cvcs/qualityFlags.v1.0.0.json +96 -0
  92. package/src/cvcs/referenceLinkType.v1.0.0.json +125 -0
  93. package/src/cvcs/relationshipDynamics.v1.0.0.json +445 -0
  94. package/src/cvcs/returnedToAbuserStatus.v1.0.0.json +80 -0
  95. package/src/cvcs/roleContext.v1.0.0.json +78 -0
  96. package/src/cvcs/rsvpResponse.v1.0.0.json +80 -0
  97. package/src/cvcs/servicePlanClosureReason.v1.0.0.json +125 -0
  98. package/src/cvcs/servicePlanReviewSnoozeReason.v1.0.0.json +116 -0
  99. package/src/cvcs/serviceSource.v1.0.0.json +71 -0
  100. package/src/cvcs/serviceStates.v1.0.0.json +12 -2
  101. package/src/cvcs/sessionState.v1.0.0.json +96 -0
  102. package/src/cvcs/severityFollowUp.v1.0.0.json +89 -0
  103. package/src/cvcs/signatureMethod.v1.0.0.json +89 -0
  104. package/src/cvcs/signatureType.v1.0.0.json +89 -0
  105. package/src/cvcs/smtBodyLocation.v1.0.0.json +314 -0
  106. package/src/cvcs/smtNameRelation.v1.0.0.json +116 -0
  107. package/src/cvcs/smtSignificanceFlags.v1.0.0.json +116 -0
  108. package/src/cvcs/sourceCategory.v1.1.0.json +96 -0
  109. package/src/cvcs/sourceSubtype.v1.1.0.json +330 -0
  110. package/src/cvcs/substanceUseStatus.v1.0.0.json +90 -0
  111. package/src/cvcs/supportStrength.v1.0.0.json +114 -0
  112. package/src/cvcs/supportTopic.v1.0.0.json +116 -0
  113. package/src/cvcs/threadStatus.v1.0.0.json +80 -0
  114. package/src/cvcs/threadType.v1.0.0.json +98 -0
  115. package/src/cvcs/timeScope.v1.0.0.json +69 -0
  116. package/src/cvcs/verificationMethod.v1.0.0.json +96 -0
  117. package/src/cvcs/verificationStatus.v1.0.0.json +80 -0
  118. package/src/cvcs/visaType.v1.0.0.json +378 -0
  119. package/src/generated/cvc-enums.ts +1816 -46
  120. package/src/index.ts +0 -20
  121. package/src/schemas/common.ts +0 -4
  122. package/dist/config/index.cjs +0 -191
  123. package/dist/config/index.cjs.map +0 -1
  124. package/dist/config/index.d.cts +0 -101
  125. package/dist/config/index.d.ts +0 -101
  126. package/dist/config/index.js +0 -165
  127. package/dist/config/index.js.map +0 -1
  128. package/src/__tests__/runtime-contract-validator.test.ts +0 -556
  129. package/src/config/fixtures/valid.yaml +0 -90
  130. package/src/config/index.ts +0 -352
  131. package/src/cvcs/hmisSex.v1.0.0.json +0 -89
  132. package/src/cvcs/juvenileJusticeEpisodeType.v1.0.0.json +0 -96
  133. package/src/cvcs/recencyBand.v1.0.0.json +0 -124
@@ -1,352 +0,0 @@
1
- /**
2
- * @htilabs/platform-common-models — Runtime Config Contract Validator
3
- *
4
- * Implements contract R12.1 (platform-common home):
5
- * - validateAgainstContract(runtimeYamlPath, opts?) — startup validator (R3.2)
6
- * - createConfigEndpoint(runtimeYamlPath, opts?) — /api/config factory (R7)
7
- *
8
- * Consumers MUST call validateAgainstContract once at process startup, before
9
- * any other initialization that reads env vars. Build-phase variables
10
- * (phase: build) are NOT checked at runtime per R3.4.
11
- *
12
- * No secret VALUES are read, stored, or returned here. Secret env vars are
13
- * validated for presence but their values are never logged or exposed.
14
- *
15
- * Dual ESM + CJS via tsup. Plain JS consumers (pave, leads) use require():
16
- * const { validateAgainstContract } = require('@htilabs/platform-common-models/config');
17
- */
18
-
19
- import { readFileSync } from "node:fs";
20
- import { parse } from "yaml";
21
-
22
- // ─── Schema types (mirrors thread's runtime-config-lib.ts VariableSpec) ──────
23
-
24
- export interface VariableSpec {
25
- type: "string" | "boolean" | "number" | "enum" | "url" | "json";
26
- required: boolean;
27
- secret: boolean;
28
- description: string;
29
- phase?: "runtime" | "build";
30
- values?: string[];
31
- default?: Record<string, unknown>;
32
- provider?: string;
33
- name?: string;
34
- client_visible?: boolean;
35
- deprecated?: { since: string; remove_after?: string; replacement?: string };
36
- }
37
-
38
- export interface ServiceContract {
39
- service: string;
40
- version: number;
41
- environments: string[];
42
- // Thread extensions (tolerated, not required — R1.1 note)
43
- port?: number;
44
- build_secrets?: string[];
45
- variables: Record<string, VariableSpec>;
46
- }
47
-
48
- /** Typed config accessor returned by validateAgainstContract. */
49
- export type TypedConfig = Record<string, string | boolean | number | unknown>;
50
-
51
- export interface ValidateOptions {
52
- /**
53
- * Environment name used to select per-env defaults (e.g. "local", "test").
54
- * Defaults to process.env.NODE_ENV, then "local".
55
- */
56
- env?: string;
57
- /**
58
- * If true, do not call process.exit(1) on failure; throw instead.
59
- * Useful for tests. Defaults to false (production mode exits).
60
- */
61
- throwOnFailure?: boolean;
62
- }
63
-
64
- export interface EndpointOptions {
65
- /** Cache-Control header value. Defaults to "private, no-store". */
66
- cacheControl?: string;
67
- }
68
-
69
- /**
70
- * A framework-agnostic route handler that returns a JSON response.
71
- * Compatible with:
72
- * - Next.js App Router: export const GET = createConfigEndpoint(...)
73
- * - Fastify: instance.get('/api/config', createConfigEndpoint(...))
74
- * - Express: app.get('/api/config', createConfigEndpoint(...))
75
- */
76
- export type RouteHandler = (
77
- req?: unknown,
78
- res?: unknown,
79
- ) => Promise<Response | void> | Response | void;
80
-
81
- // ─── YAML parser ──────────────────────────────────────────────────────────────
82
-
83
- function loadContract(runtimeYamlPath: string): ServiceContract {
84
- let raw: string;
85
- try {
86
- raw = readFileSync(runtimeYamlPath, "utf8");
87
- } catch (err) {
88
- const msg =
89
- err instanceof Error ? err.message : String(err);
90
- throw new Error(
91
- `[platform-common/config] Cannot read ${runtimeYamlPath}: ${msg}`,
92
- );
93
- }
94
- const parsed = parse(raw) as ServiceContract | null;
95
- if (!parsed || typeof parsed !== "object") {
96
- throw new Error(
97
- `[platform-common/config] ${runtimeYamlPath}: not a YAML mapping`,
98
- );
99
- }
100
- if (parsed.version !== 1) {
101
- throw new Error(
102
- `[platform-common/config] ${runtimeYamlPath}: unsupported contract version ${parsed.version} (expected 1)`,
103
- );
104
- }
105
- if (!parsed.variables || typeof parsed.variables !== "object") {
106
- throw new Error(
107
- `[platform-common/config] ${runtimeYamlPath}: missing "variables" map`,
108
- );
109
- }
110
- return parsed;
111
- }
112
-
113
- // ─── Coercion ────────────────────────────────────────────────────────────────
114
-
115
- /**
116
- * Coerce a raw environment string value to the declared type.
117
- * Returns [ok, coerced] or [false, errorMessage].
118
- */
119
- function coerce(
120
- key: string,
121
- raw: string,
122
- spec: VariableSpec,
123
- ): [true, unknown] | [false, string] {
124
- switch (spec.type) {
125
- case "boolean": {
126
- if (raw === "true" || raw === "1") return [true, true];
127
- if (raw === "false" || raw === "0") return [true, false];
128
- return [false, `${key}: expected boolean ("true"/"false"/"1"/"0"), got "${raw}"`];
129
- }
130
- case "number": {
131
- const n = Number(raw);
132
- if (!Number.isFinite(n)) {
133
- return [false, `${key}: expected number, got "${raw}"`];
134
- }
135
- return [true, n];
136
- }
137
- case "enum": {
138
- const vals = spec.values ?? [];
139
- if (!vals.includes(raw)) {
140
- return [false, `${key}: expected one of [${vals.join(", ")}], got "${raw}"`];
141
- }
142
- return [true, raw];
143
- }
144
- case "url": {
145
- try {
146
- new URL(raw);
147
- return [true, raw];
148
- } catch {
149
- return [false, `${key}: expected a valid URL, got "${raw}"`];
150
- }
151
- }
152
- case "json": {
153
- try {
154
- const parsed = JSON.parse(raw) as unknown;
155
- return [true, parsed];
156
- } catch {
157
- return [false, `${key}: expected valid JSON, got "${raw}"`];
158
- }
159
- }
160
- default:
161
- // string
162
- return [true, raw];
163
- }
164
- }
165
-
166
- // ─── Default application ─────────────────────────────────────────────────────
167
-
168
- /**
169
- * Returns the default value for a variable in the given environment,
170
- * or undefined if no default applies.
171
- *
172
- * Exact env match only — defaults are per-environment and MUST NOT bleed
173
- * across envs. (A local default stays local; it does not fall back into prod.)
174
- */
175
- function resolveDefault(
176
- spec: VariableSpec,
177
- env: string,
178
- ): string | undefined {
179
- if (!spec.default) return undefined;
180
- const v = spec.default[env];
181
- if (v === undefined) return undefined;
182
- return String(v);
183
- }
184
-
185
- // ─── validateAgainstContract ─────────────────────────────────────────────────
186
-
187
- /**
188
- * Parse `runtimeYamlPath`, coerce every runtime-phase variable from
189
- * `process.env` (with per-env defaults applied), and fail fast on any
190
- * missing or invalid required variable (R3.2).
191
- *
192
- * Build-phase variables (phase: build) are skipped per R3.4.
193
- *
194
- * Returns a typed config object keyed by variable name.
195
- */
196
- export function validateAgainstContract(
197
- runtimeYamlPath: string,
198
- opts: ValidateOptions = {},
199
- ): TypedConfig {
200
- const contract = loadContract(runtimeYamlPath);
201
- const env =
202
- opts.env ??
203
- (process.env.NODE_ENV as string | undefined) ??
204
- "local";
205
-
206
- const errors: string[] = [];
207
- const result: TypedConfig = {};
208
-
209
- for (const [key, spec] of Object.entries(contract.variables)) {
210
- // R3.4: skip build-phase variables entirely at runtime.
211
- if (spec.phase === "build") continue;
212
-
213
- const rawFromEnv = process.env[key];
214
- const defaultValue = resolveDefault(spec, env);
215
- const effective = rawFromEnv ?? defaultValue;
216
-
217
- if (effective === undefined || effective === "") {
218
- if (spec.required) {
219
- errors.push(
220
- `${key}: required but not set (no value in process.env and no default for env "${env}")`,
221
- );
222
- }
223
- // Not required and not set — omit from result.
224
- continue;
225
- }
226
-
227
- const [ok, coerced] = coerce(key, effective, spec);
228
- if (!ok) {
229
- errors.push(coerced as string);
230
- continue;
231
- }
232
- result[key] = coerced;
233
- }
234
-
235
- if (errors.length > 0) {
236
- const message = [
237
- `[platform-common/config] validateAgainstContract failed for ${runtimeYamlPath}`,
238
- `${errors.length} variable(s) missing or invalid:`,
239
- ...errors.map((e) => ` - ${e}`),
240
- ].join("\n");
241
-
242
- if (opts.throwOnFailure) {
243
- throw new Error(message);
244
- }
245
- console.error(message);
246
- process.exit(1);
247
- }
248
-
249
- return result;
250
- }
251
-
252
- // ─── createConfigEndpoint ────────────────────────────────────────────────────
253
-
254
- /**
255
- * Build a static JSON payload containing only variables that are
256
- * client_visible: true AND secret: false (R7.2, R7.3). Reads process.env
257
- * once at factory call time.
258
- */
259
- function buildClientPayload(
260
- contract: ServiceContract,
261
- env: string,
262
- ): Record<string, unknown> {
263
- const payload: Record<string, unknown> = {};
264
-
265
- for (const [key, spec] of Object.entries(contract.variables)) {
266
- // R7.3: never expose secrets.
267
- if (spec.secret) continue;
268
- // R7.2: only expose client_visible vars.
269
- if (!spec.client_visible) continue;
270
- // R3.4: build-phase vars are not available at runtime.
271
- if (spec.phase === "build") continue;
272
-
273
- const raw = process.env[key] ?? resolveDefault(spec, env);
274
- if (raw === undefined) continue;
275
-
276
- const [ok, coerced] = coerce(key, raw, spec);
277
- payload[key] = ok ? coerced : raw;
278
- }
279
-
280
- return payload;
281
- }
282
-
283
- /**
284
- * Route-handler factory for GET /api/config (R7.1).
285
- *
286
- * Reads the contract and process.env once at factory-call time and caches
287
- * the JSON payload. The returned handler is compatible with:
288
- *
289
- * Next.js App Router:
290
- * export const GET = createConfigEndpoint(path);
291
- *
292
- * Fastify:
293
- * instance.get('/api/config', createConfigEndpoint(path));
294
- *
295
- * Express:
296
- * app.get('/api/config', createConfigEndpoint(path));
297
- *
298
- * The handler detects the calling convention at runtime:
299
- * - Next.js / fetch-native: called with no arguments; returns a Response.
300
- * - Express: called with (req, res); calls res.json() and returns void.
301
- * - Fastify: called with (req, reply); calls reply.send() and returns void.
302
- */
303
- export function createConfigEndpoint(
304
- runtimeYamlPath: string,
305
- opts: EndpointOptions = {},
306
- ): RouteHandler {
307
- const contract = loadContract(runtimeYamlPath);
308
- const env =
309
- (process.env.NODE_ENV as string | undefined) ?? "local";
310
- const payload = buildClientPayload(contract, env);
311
- const cacheControl = opts.cacheControl ?? "private, no-store";
312
- const body = JSON.stringify(payload);
313
-
314
- return function configHandler(
315
- _req?: unknown,
316
- res?: unknown,
317
- ): Promise<Response | void> | Response | void {
318
- // Express-shaped: res has .json()
319
- if (res && typeof (res as Record<string, unknown>)["json"] === "function") {
320
- const r = res as {
321
- setHeader: (k: string, v: string) => void;
322
- json: (data: unknown) => void;
323
- };
324
- r.setHeader("Cache-Control", cacheControl);
325
- r.setHeader("Content-Type", "application/json");
326
- r.json(payload);
327
- return;
328
- }
329
-
330
- // Fastify-shaped: res has .send()
331
- if (res && typeof (res as Record<string, unknown>)["send"] === "function") {
332
- const r = res as {
333
- header: (k: string, v: string) => void;
334
- type: (ct: string) => void;
335
- send: (data: string) => void;
336
- };
337
- r.header("Cache-Control", cacheControl);
338
- r.type("application/json");
339
- r.send(body);
340
- return;
341
- }
342
-
343
- // Next.js / fetch-native (no res argument, or unrecognised res)
344
- return new Response(body, {
345
- status: 200,
346
- headers: {
347
- "Content-Type": "application/json",
348
- "Cache-Control": cacheControl,
349
- },
350
- });
351
- };
352
- }
@@ -1,89 +0,0 @@
1
- {
2
- "domain": "hmis_sex",
3
- "name": "Core HMIS Sex",
4
- "version": "1.0.0",
5
- "levels": {
6
- "0": "Unknown or Missing",
7
- "1": "Sex"
8
- },
9
- "entries": [
10
- {
11
- "code": "067-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
- "067-000-000-000-000-000-001",
18
- "067-000-000-000-000-000-002",
19
- "067-000-000-000-000-000-003",
20
- "067-000-000-000-000-000-004",
21
- "067-000-000-000-000-000-005"
22
- ],
23
- "definition": "Root group for values indicating absent, withheld, or uncollected data."
24
- },
25
- {
26
- "code": "067-000-000-000-000-000-001",
27
- "key": "unknown",
28
- "title": "Unknown",
29
- "selectable": true,
30
- "parentCode": "067-000-000-000-000-000-000",
31
- "childCodes": [],
32
- "definition": "Value is unknown at time of entry."
33
- },
34
- {
35
- "code": "067-000-000-000-000-000-002",
36
- "key": "anonymous",
37
- "title": "Anonymous",
38
- "selectable": true,
39
- "parentCode": "067-000-000-000-000-000-000",
40
- "childCodes": [],
41
- "definition": "Value is intentionally withheld or redacted."
42
- },
43
- {
44
- "code": "067-000-000-000-000-000-003",
45
- "key": "data_not_collected",
46
- "title": "Data not collected",
47
- "selectable": true,
48
- "parentCode": "067-000-000-000-000-000-000",
49
- "childCodes": [],
50
- "definition": "Use this response if the staff does not ask the person to provide their sex."
51
- },
52
- {
53
- "code": "067-000-000-000-000-000-004",
54
- "key": "client_doesn_t_know",
55
- "title": "Client doesn't know",
56
- "selectable": true,
57
- "parentCode": "067-000-000-000-000-000-000",
58
- "childCodes": [],
59
- "definition": "\"Client doesn't know\" should only be selected when a person does not know their sex from among the responses."
60
- },
61
- {
62
- "code": "067-000-000-000-000-000-005",
63
- "key": "client_prefers_not_to_answer",
64
- "title": "Client prefers not to answer",
65
- "selectable": true,
66
- "parentCode": "067-000-000-000-000-000-000",
67
- "childCodes": [],
68
- "definition": "\"Client prefers not to answer\" should only be selected when a person chooses not to identify their sex from among the responses."
69
- },
70
- {
71
- "code": "067-001-000-000-000-000-000",
72
- "key": "female",
73
- "title": "Female",
74
- "selectable": true,
75
- "parentCode": null,
76
- "childCodes": [],
77
- "definition": "A person of the sex characterized by a reproductive system with the biological function of producing eggs (ova)."
78
- },
79
- {
80
- "code": "067-002-000-000-000-000-000",
81
- "key": "male",
82
- "title": "Male",
83
- "selectable": true,
84
- "parentCode": null,
85
- "childCodes": [],
86
- "definition": "A person of the sex characterized by a reproductive system with the biological function of producing sperm."
87
- }
88
- ]
89
- }
@@ -1,96 +0,0 @@
1
- {
2
- "domain": "juvenile_justice_episode_type",
3
- "name": "Core Juvenile Justice Episode Type",
4
- "version": "1.0.0",
5
- "levels": {
6
- "0": "Unknown or Missing",
7
- "1": "Episode Type"
8
- },
9
- "entries": [
10
- {
11
- "code": "197-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
- "197-000-000-000-000-000-001",
18
- "197-000-000-000-000-000-002",
19
- "197-000-000-000-000-000-003"
20
- ],
21
- "definition": "Root group for values indicating absent, withheld, or uncollected data."
22
- },
23
- {
24
- "code": "197-000-000-000-000-000-001",
25
- "key": "unknown",
26
- "title": "Unknown",
27
- "selectable": true,
28
- "parentCode": "197-000-000-000-000-000-000",
29
- "childCodes": [],
30
- "definition": "Value is unknown at time of entry."
31
- },
32
- {
33
- "code": "197-000-000-000-000-000-002",
34
- "key": "anonymous",
35
- "title": "Anonymous",
36
- "selectable": true,
37
- "parentCode": "197-000-000-000-000-000-000",
38
- "childCodes": [],
39
- "definition": "Value is intentionally withheld or redacted."
40
- },
41
- {
42
- "code": "197-000-000-000-000-000-003",
43
- "key": "data_not_collected",
44
- "title": "Data not collected",
45
- "selectable": true,
46
- "parentCode": "197-000-000-000-000-000-000",
47
- "childCodes": [],
48
- "definition": "No attempt was made to collect the value."
49
- },
50
- {
51
- "code": "197-001-000-000-000-000-000",
52
- "key": "detention_stay",
53
- "title": "Detention stay",
54
- "selectable": true,
55
- "parentCode": null,
56
- "childCodes": [],
57
- "definition": "A period of confinement in a juvenile detention facility."
58
- },
59
- {
60
- "code": "197-002-000-000-000-000-000",
61
- "key": "diversion_program",
62
- "title": "Diversion program",
63
- "selectable": true,
64
- "parentCode": null,
65
- "childCodes": [],
66
- "definition": "Participation in a program that diverts a youth away from formal juvenile court processing."
67
- },
68
- {
69
- "code": "197-003-000-000-000-000-000",
70
- "key": "pending_adjudication",
71
- "title": "Pending charges / adjudication process",
72
- "selectable": true,
73
- "parentCode": null,
74
- "childCodes": [],
75
- "definition": "An open juvenile case awaiting adjudication."
76
- },
77
- {
78
- "code": "197-004-000-000-000-000-000",
79
- "key": "probation_supervision",
80
- "title": "Probation / community supervision (juvenile)",
81
- "selectable": true,
82
- "parentCode": null,
83
- "childCodes": [],
84
- "definition": "Court-ordered supervision of a youth in the community rather than in confinement."
85
- },
86
- {
87
- "code": "197-005-000-000-000-000-000",
88
- "key": "residential_jj_placement",
89
- "title": "Residential JJ placement",
90
- "selectable": true,
91
- "parentCode": null,
92
- "childCodes": [],
93
- "definition": "Placement in a residential juvenile justice facility (e.g. training school, residential treatment)."
94
- }
95
- ]
96
- }
@@ -1,124 +0,0 @@
1
- {
2
- "domain": "recency_band",
3
- "name": "Core Recency Band",
4
- "version": "1.0.0",
5
- "levels": {
6
- "0": "Unknown or Missing",
7
- "1": "Recency Band"
8
- },
9
- "entries": [
10
- {
11
- "code": "137-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
- "137-000-000-000-000-000-001",
18
- "137-000-000-000-000-000-002",
19
- "137-000-000-000-000-000-003",
20
- "137-000-000-000-000-000-004"
21
- ],
22
- "definition": "Root group for values indicating absent, withheld, or uncollected data."
23
- },
24
- {
25
- "code": "137-000-000-000-000-000-001",
26
- "key": "unknown",
27
- "title": "Unknown",
28
- "selectable": true,
29
- "parentCode": "137-000-000-000-000-000-000",
30
- "childCodes": [],
31
- "definition": "Value is unknown at time of entry."
32
- },
33
- {
34
- "code": "137-000-000-000-000-000-002",
35
- "key": "anonymous",
36
- "title": "Anonymous",
37
- "selectable": true,
38
- "parentCode": "137-000-000-000-000-000-000",
39
- "childCodes": [],
40
- "definition": "Value is intentionally withheld or redacted."
41
- },
42
- {
43
- "code": "137-000-000-000-000-000-003",
44
- "key": "data_not_collected",
45
- "title": "Data not collected",
46
- "selectable": true,
47
- "parentCode": "137-000-000-000-000-000-000",
48
- "childCodes": [],
49
- "definition": "No attempt was made to collect the value."
50
- },
51
- {
52
- "code": "137-000-000-000-000-000-004",
53
- "key": "prefer_not_to_answer",
54
- "title": "Client prefers not to answer",
55
- "selectable": true,
56
- "parentCode": "137-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": "137-001-000-000-000-000-000",
62
- "key": "less_than_3_years",
63
- "title": "Less than 3 years ago",
64
- "selectable": true,
65
- "parentCode": null,
66
- "childCodes": [],
67
- "definition": "The asserted event occurred less than 3 years ago."
68
- },
69
- {
70
- "code": "137-002-000-000-000-000-000",
71
- "key": "months_3_to_6",
72
- "title": "3-6 months ago",
73
- "selectable": true,
74
- "parentCode": null,
75
- "childCodes": [],
76
- "definition": "The asserted event occurred between 3 and 6 months ago."
77
- },
78
- {
79
- "code": "137-003-000-000-000-000-000",
80
- "key": "months_6_to_12",
81
- "title": "6-12 months ago",
82
- "selectable": true,
83
- "parentCode": null,
84
- "childCodes": [],
85
- "definition": "The asserted event occurred between 6 and 12 months ago."
86
- },
87
- {
88
- "code": "137-004-000-000-000-000-000",
89
- "key": "one_year_or_more",
90
- "title": "One year or more",
91
- "selectable": true,
92
- "parentCode": null,
93
- "childCodes": [],
94
- "definition": "The asserted event occurred one year or more ago (without further granularity)."
95
- },
96
- {
97
- "code": "137-005-000-000-000-000-000",
98
- "key": "ten_plus_years",
99
- "title": "10+ years ago",
100
- "selectable": true,
101
- "parentCode": null,
102
- "childCodes": [],
103
- "definition": "The asserted event occurred 10 or more years ago."
104
- },
105
- {
106
- "code": "137-006-000-000-000-000-000",
107
- "key": "within_3_months",
108
- "title": "Within past 3 months",
109
- "selectable": true,
110
- "parentCode": null,
111
- "childCodes": [],
112
- "definition": "The asserted event occurred within the past 3 months."
113
- },
114
- {
115
- "code": "137-007-000-000-000-000-000",
116
- "key": "years_3_to_10",
117
- "title": "3-10 years ago",
118
- "selectable": true,
119
- "parentCode": null,
120
- "childCodes": [],
121
- "definition": "The asserted event occurred between 3 and 10 years ago."
122
- }
123
- ]
124
- }