@htilabs/platform-common-models 0.87.1 → 0.88.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 +11 -1
- package/dist/{index-Bj-s0nZy.d.cts → index-1pWiqEBC.d.cts} +1 -1
- package/dist/{index-DvAypMJV.d.ts → index-uz57Fic9.d.ts} +1 -1
- package/dist/index.cjs +118 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +109 -0
- package/dist/index.js.map +1 -1
- package/dist/information-scope/index.cjs +118 -0
- package/dist/information-scope/index.cjs.map +1 -1
- package/dist/information-scope/index.d.cts +88 -1
- package/dist/information-scope/index.d.ts +88 -1
- package/dist/information-scope/index.js +109 -0
- package/dist/information-scope/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/services/index.cjs +118 -0
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +109 -0
- package/dist/services/index.js.map +1 -1
- package/dist/validation/index.d.cts +1 -1
- package/dist/validation/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/__sot__/README.md +1 -0
- package/src/__sot__/roiScopePresets.pin.json +82 -0
- package/src/__tests__/roi-scope-presets-canon.test.ts +106 -0
- package/src/roiScopePresets/index.ts +190 -0
- package/src/services/informationScope.ts +2 -0
- package/dist/{agency-CnVTwLeV.d.ts → agency-BHv54o79.d.ts} +4 -4
- package/dist/{agency-8ufZJJDH.d.cts → agency-Djp57S71.d.cts} +4 -4
- package/dist/{cvcEntry-BLeRivoF.d.cts → cvcEntry-DAuhe0cd.d.cts} +16 -16
- package/dist/{cvcEntry-BLeRivoF.d.ts → cvcEntry-DAuhe0cd.d.ts} +16 -16
package/dist/services/index.cjs
CHANGED
|
@@ -30,15 +30,24 @@ __export(services_exports, {
|
|
|
30
30
|
INFORMATION_SCOPE_SYSTEM_INFO: () => INFORMATION_SCOPE_SYSTEM_INFO,
|
|
31
31
|
INFORMATION_SCOPE_UI_COPY_SOURCE: () => INFORMATION_SCOPE_UI_COPY_SOURCE,
|
|
32
32
|
INFORMATION_SCOPE_VERSION: () => INFORMATION_SCOPE_VERSION,
|
|
33
|
+
ROI_SCOPE_PRESETS: () => ROI_SCOPE_PRESETS,
|
|
34
|
+
ROI_SCOPE_PRESETS_SCOPE_VERSION: () => ROI_SCOPE_PRESETS_SCOPE_VERSION,
|
|
35
|
+
ROI_SCOPE_PRESETS_SOURCE: () => ROI_SCOPE_PRESETS_SOURCE,
|
|
36
|
+
ROI_SCOPE_PRESET_IDS: () => ROI_SCOPE_PRESET_IDS,
|
|
37
|
+
ROI_SCOPE_PRESET_ITEM_IDS: () => ROI_SCOPE_PRESET_ITEM_IDS,
|
|
38
|
+
ROI_SCOPE_PRESET_LABELS: () => ROI_SCOPE_PRESET_LABELS,
|
|
33
39
|
applyEntryOverrides: () => applyEntryOverrides,
|
|
34
40
|
cascadeExclusions: () => cascadeExclusions,
|
|
35
41
|
createInformationScopeResolver: () => createInformationScopeResolver,
|
|
36
42
|
cvcVersionsToRecord: () => cvcVersionsToRecord,
|
|
43
|
+
isRoiScopePresetId: () => isRoiScopePresetId,
|
|
37
44
|
isScopeInstrumentRow: () => isScopeInstrumentRow,
|
|
38
45
|
isScopeRestRow: () => isScopeRestRow,
|
|
39
46
|
isSelectableScopeRow: () => isSelectableScopeRow,
|
|
40
47
|
kindForPerson: () => kindForPerson,
|
|
41
48
|
resolveRegistryWithInheritance: () => resolveRegistryWithInheritance,
|
|
49
|
+
roiScopePresetById: () => roiScopePresetById,
|
|
50
|
+
roiScopePresetRows: () => roiScopePresetRows,
|
|
42
51
|
scopeCategorySub: () => scopeCategorySub,
|
|
43
52
|
scopeMigrationsFromSot: () => scopeMigrationsFromSot,
|
|
44
53
|
scopeRowDisplayOrder: () => scopeRowDisplayOrder,
|
|
@@ -2214,6 +2223,106 @@ function sortScopeCategories(categories) {
|
|
|
2214
2223
|
const n = INFORMATION_SCOPE_CATEGORY_ORDER.length;
|
|
2215
2224
|
return categories.map((c, i) => ({ c, i, at: rank.get(toKey(c)) ?? n })).sort((a, b) => a.at - b.at || a.i - b.i).map((x) => x.c);
|
|
2216
2225
|
}
|
|
2226
|
+
|
|
2227
|
+
// src/roiScopePresets/index.ts
|
|
2228
|
+
var ROI_SCOPE_PRESET_IDS = ["full_collab", "risk_only", "identifying"];
|
|
2229
|
+
var ROI_SCOPE_PRESETS_SCOPE_VERSION = 4;
|
|
2230
|
+
var ROI_SCOPE_PRESETS_SOURCE = {
|
|
2231
|
+
repo: "htilabstech/prototype",
|
|
2232
|
+
file: "HTI-LEADS-PAVE-Thread-prototype.html",
|
|
2233
|
+
commit: "ba5ded6de6affdb11054a18a8a8a561be987a403",
|
|
2234
|
+
mirror: { repo: "htilabstech/platform-prototype", file: "src/data.js", commit: "398fb24" }
|
|
2235
|
+
};
|
|
2236
|
+
var freeze = (p) => Object.freeze({ ...p, itemIds: Object.freeze([...p.itemIds]) });
|
|
2237
|
+
var ROI_SCOPE_PRESETS = Object.freeze([
|
|
2238
|
+
freeze({
|
|
2239
|
+
id: "full_collab",
|
|
2240
|
+
label: "Full case collaboration",
|
|
2241
|
+
description: "Broad packet for coordinated providers working the case together.",
|
|
2242
|
+
enabled: true,
|
|
2243
|
+
itemIds: [
|
|
2244
|
+
"names",
|
|
2245
|
+
"dob",
|
|
2246
|
+
"addresses",
|
|
2247
|
+
"demographics",
|
|
2248
|
+
"screen_indicators",
|
|
2249
|
+
"victimization",
|
|
2250
|
+
"summary_initial_screen",
|
|
2251
|
+
"summary_ae_intake",
|
|
2252
|
+
"summary_ida",
|
|
2253
|
+
"summary_lap",
|
|
2254
|
+
"summary_danger_assessment",
|
|
2255
|
+
"summary_stalking_assessment",
|
|
2256
|
+
"summary_injury_and_strangulation",
|
|
2257
|
+
"summary_tra",
|
|
2258
|
+
"summary_hope_scale",
|
|
2259
|
+
"summary_needs_assessment",
|
|
2260
|
+
"full_ida",
|
|
2261
|
+
"contact_info",
|
|
2262
|
+
"priorities_safety",
|
|
2263
|
+
"encounter_location",
|
|
2264
|
+
"contact_history",
|
|
2265
|
+
"service_history",
|
|
2266
|
+
"plans_goals",
|
|
2267
|
+
"session_summary",
|
|
2268
|
+
"case_notes",
|
|
2269
|
+
"relationships_household",
|
|
2270
|
+
"family",
|
|
2271
|
+
"system_info"
|
|
2272
|
+
]
|
|
2273
|
+
}),
|
|
2274
|
+
freeze({
|
|
2275
|
+
id: "risk_only",
|
|
2276
|
+
label: "Name + risk information",
|
|
2277
|
+
description: "Minimal identifying info \u2014 risk + screening for a coordinated handoff.",
|
|
2278
|
+
enabled: true,
|
|
2279
|
+
itemIds: [
|
|
2280
|
+
"names",
|
|
2281
|
+
"screen_indicators",
|
|
2282
|
+
"victimization",
|
|
2283
|
+
"summary_initial_screen",
|
|
2284
|
+
"summary_ae_intake",
|
|
2285
|
+
"summary_ida",
|
|
2286
|
+
"summary_lap",
|
|
2287
|
+
"summary_danger_assessment",
|
|
2288
|
+
"summary_stalking_assessment",
|
|
2289
|
+
"summary_injury_and_strangulation",
|
|
2290
|
+
"system_info"
|
|
2291
|
+
]
|
|
2292
|
+
}),
|
|
2293
|
+
freeze({
|
|
2294
|
+
id: "identifying",
|
|
2295
|
+
label: "Identifying info only",
|
|
2296
|
+
description: "Used for verification with law enforcement / medical partners.",
|
|
2297
|
+
enabled: true,
|
|
2298
|
+
itemIds: ["names", "dob", "addresses", "additional_ids", "demographics", "system_info"]
|
|
2299
|
+
})
|
|
2300
|
+
]);
|
|
2301
|
+
var ROI_SCOPE_PRESET_LABELS = Object.freeze(
|
|
2302
|
+
Object.fromEntries(ROI_SCOPE_PRESETS.map((p) => [p.id, p.label]))
|
|
2303
|
+
);
|
|
2304
|
+
var ROI_SCOPE_PRESET_ITEM_IDS = Object.freeze(
|
|
2305
|
+
Object.fromEntries(ROI_SCOPE_PRESETS.map((p) => [p.id, p.itemIds]))
|
|
2306
|
+
);
|
|
2307
|
+
function isRoiScopePresetId(id) {
|
|
2308
|
+
return typeof id === "string" && ROI_SCOPE_PRESET_IDS.includes(id);
|
|
2309
|
+
}
|
|
2310
|
+
function roiScopePresetById(id) {
|
|
2311
|
+
return ROI_SCOPE_PRESETS.find((p) => p.id === id);
|
|
2312
|
+
}
|
|
2313
|
+
function roiScopePresetRows(id, scope) {
|
|
2314
|
+
const preset = roiScopePresetById(id);
|
|
2315
|
+
if (!preset) throw new Error(`roiScopePresetRows: "${id}" is not an ROI scope preset`);
|
|
2316
|
+
return preset.itemIds.map((code) => {
|
|
2317
|
+
const row = scope.row(code);
|
|
2318
|
+
if (!row || row.status === "retired") {
|
|
2319
|
+
throw new Error(
|
|
2320
|
+
`roiScopePresetRows: preset "${id}" names "${code}", which is not a live CVC-236 row`
|
|
2321
|
+
);
|
|
2322
|
+
}
|
|
2323
|
+
return row;
|
|
2324
|
+
});
|
|
2325
|
+
}
|
|
2217
2326
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2218
2327
|
0 && (module.exports = {
|
|
2219
2328
|
CvcRegistryService,
|
|
@@ -2226,15 +2335,24 @@ function sortScopeCategories(categories) {
|
|
|
2226
2335
|
INFORMATION_SCOPE_SYSTEM_INFO,
|
|
2227
2336
|
INFORMATION_SCOPE_UI_COPY_SOURCE,
|
|
2228
2337
|
INFORMATION_SCOPE_VERSION,
|
|
2338
|
+
ROI_SCOPE_PRESETS,
|
|
2339
|
+
ROI_SCOPE_PRESETS_SCOPE_VERSION,
|
|
2340
|
+
ROI_SCOPE_PRESETS_SOURCE,
|
|
2341
|
+
ROI_SCOPE_PRESET_IDS,
|
|
2342
|
+
ROI_SCOPE_PRESET_ITEM_IDS,
|
|
2343
|
+
ROI_SCOPE_PRESET_LABELS,
|
|
2229
2344
|
applyEntryOverrides,
|
|
2230
2345
|
cascadeExclusions,
|
|
2231
2346
|
createInformationScopeResolver,
|
|
2232
2347
|
cvcVersionsToRecord,
|
|
2348
|
+
isRoiScopePresetId,
|
|
2233
2349
|
isScopeInstrumentRow,
|
|
2234
2350
|
isScopeRestRow,
|
|
2235
2351
|
isSelectableScopeRow,
|
|
2236
2352
|
kindForPerson,
|
|
2237
2353
|
resolveRegistryWithInheritance,
|
|
2354
|
+
roiScopePresetById,
|
|
2355
|
+
roiScopePresetRows,
|
|
2238
2356
|
scopeCategorySub,
|
|
2239
2357
|
scopeMigrationsFromSot,
|
|
2240
2358
|
scopeRowDisplayOrder,
|