@htilabs/platform-common-models 0.87.0 → 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 +12 -0
- package/dist/index.cjs +118 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- 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/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/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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connection, Types } from 'mongoose';
|
|
2
2
|
export { C as CreateInformationScopeResolverInput, I as INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE, a as INFORMATION_SCOPE_READABLE_VERSIONS, b as INFORMATION_SCOPE_SYSTEM_INFO, c as INFORMATION_SCOPE_VERSION, d as InformationScopeResolver, S as ScopeApp, e as ScopeApps, f as ScopeCodeReading, g as ScopeKindBranch, h as ScopeMigration, i as ScopeMigrationRule, j as ScopePersonKind, k as ScopeReadOptions, l as ScopeReading, m as ScopeReadingRule, n as ScopeReadingSubject, o as ScopeRetainedReading, p as ScopeRow, q as ScopeRowStatus, r as ScopeRowType, s as ScopeShareOptions, t as ScopeShareReason, u as ScopeShareVerdict, v as ScopeSpecialDataType, w as ScopeSubjectKind, x as StoredScopeList, y as createInformationScopeResolver, z as isScopeInstrumentRow, A as isScopeRestRow, B as isSelectableScopeRow, D as kindForPerson } from '../informationScopeResolver-BYiubygD.cjs';
|
|
3
|
-
export { CoreInformationScopeSot, CoreInformationScopeSotEntry, CoreInformationScopeSotMigrationLine, INFORMATION_SCOPE_CATEGORY_ORDER, INFORMATION_SCOPE_CATEGORY_SUB, INFORMATION_SCOPE_ROW_HINT, INFORMATION_SCOPE_ROW_ORDER, INFORMATION_SCOPE_UI_COPY_SOURCE, scopeCategorySub, scopeMigrationsFromSot, scopeRowDisplayOrder, scopeRowHint, scopeRowsFromSot, sortScopeCategories, sortScopeRows } from '../information-scope/index.cjs';
|
|
3
|
+
export { CoreInformationScopeSot, CoreInformationScopeSotEntry, CoreInformationScopeSotMigrationLine, INFORMATION_SCOPE_CATEGORY_ORDER, INFORMATION_SCOPE_CATEGORY_SUB, INFORMATION_SCOPE_ROW_HINT, INFORMATION_SCOPE_ROW_ORDER, INFORMATION_SCOPE_UI_COPY_SOURCE, ROI_SCOPE_PRESETS, ROI_SCOPE_PRESETS_SCOPE_VERSION, ROI_SCOPE_PRESETS_SOURCE, ROI_SCOPE_PRESET_IDS, ROI_SCOPE_PRESET_ITEM_IDS, ROI_SCOPE_PRESET_LABELS, RoiScopePresetDefinition, RoiScopePresetId, RoiScopePresetRowLike, RoiScopePresetRowSource, isRoiScopePresetId, roiScopePresetById, roiScopePresetRows, scopeCategorySub, scopeMigrationsFromSot, scopeRowDisplayOrder, scopeRowHint, scopeRowsFromSot, sortScopeCategories, sortScopeRows } from '../information-scope/index.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @htilabs/platform-common-models — CvcRegistryService
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Connection, Types } from 'mongoose';
|
|
2
2
|
export { C as CreateInformationScopeResolverInput, I as INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE, a as INFORMATION_SCOPE_READABLE_VERSIONS, b as INFORMATION_SCOPE_SYSTEM_INFO, c as INFORMATION_SCOPE_VERSION, d as InformationScopeResolver, S as ScopeApp, e as ScopeApps, f as ScopeCodeReading, g as ScopeKindBranch, h as ScopeMigration, i as ScopeMigrationRule, j as ScopePersonKind, k as ScopeReadOptions, l as ScopeReading, m as ScopeReadingRule, n as ScopeReadingSubject, o as ScopeRetainedReading, p as ScopeRow, q as ScopeRowStatus, r as ScopeRowType, s as ScopeShareOptions, t as ScopeShareReason, u as ScopeShareVerdict, v as ScopeSpecialDataType, w as ScopeSubjectKind, x as StoredScopeList, y as createInformationScopeResolver, z as isScopeInstrumentRow, A as isScopeRestRow, B as isSelectableScopeRow, D as kindForPerson } from '../informationScopeResolver-BYiubygD.js';
|
|
3
|
-
export { CoreInformationScopeSot, CoreInformationScopeSotEntry, CoreInformationScopeSotMigrationLine, INFORMATION_SCOPE_CATEGORY_ORDER, INFORMATION_SCOPE_CATEGORY_SUB, INFORMATION_SCOPE_ROW_HINT, INFORMATION_SCOPE_ROW_ORDER, INFORMATION_SCOPE_UI_COPY_SOURCE, scopeCategorySub, scopeMigrationsFromSot, scopeRowDisplayOrder, scopeRowHint, scopeRowsFromSot, sortScopeCategories, sortScopeRows } from '../information-scope/index.js';
|
|
3
|
+
export { CoreInformationScopeSot, CoreInformationScopeSotEntry, CoreInformationScopeSotMigrationLine, INFORMATION_SCOPE_CATEGORY_ORDER, INFORMATION_SCOPE_CATEGORY_SUB, INFORMATION_SCOPE_ROW_HINT, INFORMATION_SCOPE_ROW_ORDER, INFORMATION_SCOPE_UI_COPY_SOURCE, ROI_SCOPE_PRESETS, ROI_SCOPE_PRESETS_SCOPE_VERSION, ROI_SCOPE_PRESETS_SOURCE, ROI_SCOPE_PRESET_IDS, ROI_SCOPE_PRESET_ITEM_IDS, ROI_SCOPE_PRESET_LABELS, RoiScopePresetDefinition, RoiScopePresetId, RoiScopePresetRowLike, RoiScopePresetRowSource, isRoiScopePresetId, roiScopePresetById, roiScopePresetRows, scopeCategorySub, scopeMigrationsFromSot, scopeRowDisplayOrder, scopeRowHint, scopeRowsFromSot, sortScopeCategories, sortScopeRows } from '../information-scope/index.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @htilabs/platform-common-models — CvcRegistryService
|
package/dist/services/index.js
CHANGED
|
@@ -2169,6 +2169,106 @@ function sortScopeCategories(categories) {
|
|
|
2169
2169
|
const n = INFORMATION_SCOPE_CATEGORY_ORDER.length;
|
|
2170
2170
|
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);
|
|
2171
2171
|
}
|
|
2172
|
+
|
|
2173
|
+
// src/roiScopePresets/index.ts
|
|
2174
|
+
var ROI_SCOPE_PRESET_IDS = ["full_collab", "risk_only", "identifying"];
|
|
2175
|
+
var ROI_SCOPE_PRESETS_SCOPE_VERSION = 4;
|
|
2176
|
+
var ROI_SCOPE_PRESETS_SOURCE = {
|
|
2177
|
+
repo: "htilabstech/prototype",
|
|
2178
|
+
file: "HTI-LEADS-PAVE-Thread-prototype.html",
|
|
2179
|
+
commit: "ba5ded6de6affdb11054a18a8a8a561be987a403",
|
|
2180
|
+
mirror: { repo: "htilabstech/platform-prototype", file: "src/data.js", commit: "398fb24" }
|
|
2181
|
+
};
|
|
2182
|
+
var freeze = (p) => Object.freeze({ ...p, itemIds: Object.freeze([...p.itemIds]) });
|
|
2183
|
+
var ROI_SCOPE_PRESETS = Object.freeze([
|
|
2184
|
+
freeze({
|
|
2185
|
+
id: "full_collab",
|
|
2186
|
+
label: "Full case collaboration",
|
|
2187
|
+
description: "Broad packet for coordinated providers working the case together.",
|
|
2188
|
+
enabled: true,
|
|
2189
|
+
itemIds: [
|
|
2190
|
+
"names",
|
|
2191
|
+
"dob",
|
|
2192
|
+
"addresses",
|
|
2193
|
+
"demographics",
|
|
2194
|
+
"screen_indicators",
|
|
2195
|
+
"victimization",
|
|
2196
|
+
"summary_initial_screen",
|
|
2197
|
+
"summary_ae_intake",
|
|
2198
|
+
"summary_ida",
|
|
2199
|
+
"summary_lap",
|
|
2200
|
+
"summary_danger_assessment",
|
|
2201
|
+
"summary_stalking_assessment",
|
|
2202
|
+
"summary_injury_and_strangulation",
|
|
2203
|
+
"summary_tra",
|
|
2204
|
+
"summary_hope_scale",
|
|
2205
|
+
"summary_needs_assessment",
|
|
2206
|
+
"full_ida",
|
|
2207
|
+
"contact_info",
|
|
2208
|
+
"priorities_safety",
|
|
2209
|
+
"encounter_location",
|
|
2210
|
+
"contact_history",
|
|
2211
|
+
"service_history",
|
|
2212
|
+
"plans_goals",
|
|
2213
|
+
"session_summary",
|
|
2214
|
+
"case_notes",
|
|
2215
|
+
"relationships_household",
|
|
2216
|
+
"family",
|
|
2217
|
+
"system_info"
|
|
2218
|
+
]
|
|
2219
|
+
}),
|
|
2220
|
+
freeze({
|
|
2221
|
+
id: "risk_only",
|
|
2222
|
+
label: "Name + risk information",
|
|
2223
|
+
description: "Minimal identifying info \u2014 risk + screening for a coordinated handoff.",
|
|
2224
|
+
enabled: true,
|
|
2225
|
+
itemIds: [
|
|
2226
|
+
"names",
|
|
2227
|
+
"screen_indicators",
|
|
2228
|
+
"victimization",
|
|
2229
|
+
"summary_initial_screen",
|
|
2230
|
+
"summary_ae_intake",
|
|
2231
|
+
"summary_ida",
|
|
2232
|
+
"summary_lap",
|
|
2233
|
+
"summary_danger_assessment",
|
|
2234
|
+
"summary_stalking_assessment",
|
|
2235
|
+
"summary_injury_and_strangulation",
|
|
2236
|
+
"system_info"
|
|
2237
|
+
]
|
|
2238
|
+
}),
|
|
2239
|
+
freeze({
|
|
2240
|
+
id: "identifying",
|
|
2241
|
+
label: "Identifying info only",
|
|
2242
|
+
description: "Used for verification with law enforcement / medical partners.",
|
|
2243
|
+
enabled: true,
|
|
2244
|
+
itemIds: ["names", "dob", "addresses", "additional_ids", "demographics", "system_info"]
|
|
2245
|
+
})
|
|
2246
|
+
]);
|
|
2247
|
+
var ROI_SCOPE_PRESET_LABELS = Object.freeze(
|
|
2248
|
+
Object.fromEntries(ROI_SCOPE_PRESETS.map((p) => [p.id, p.label]))
|
|
2249
|
+
);
|
|
2250
|
+
var ROI_SCOPE_PRESET_ITEM_IDS = Object.freeze(
|
|
2251
|
+
Object.fromEntries(ROI_SCOPE_PRESETS.map((p) => [p.id, p.itemIds]))
|
|
2252
|
+
);
|
|
2253
|
+
function isRoiScopePresetId(id) {
|
|
2254
|
+
return typeof id === "string" && ROI_SCOPE_PRESET_IDS.includes(id);
|
|
2255
|
+
}
|
|
2256
|
+
function roiScopePresetById(id) {
|
|
2257
|
+
return ROI_SCOPE_PRESETS.find((p) => p.id === id);
|
|
2258
|
+
}
|
|
2259
|
+
function roiScopePresetRows(id, scope) {
|
|
2260
|
+
const preset = roiScopePresetById(id);
|
|
2261
|
+
if (!preset) throw new Error(`roiScopePresetRows: "${id}" is not an ROI scope preset`);
|
|
2262
|
+
return preset.itemIds.map((code) => {
|
|
2263
|
+
const row = scope.row(code);
|
|
2264
|
+
if (!row || row.status === "retired") {
|
|
2265
|
+
throw new Error(
|
|
2266
|
+
`roiScopePresetRows: preset "${id}" names "${code}", which is not a live CVC-236 row`
|
|
2267
|
+
);
|
|
2268
|
+
}
|
|
2269
|
+
return row;
|
|
2270
|
+
});
|
|
2271
|
+
}
|
|
2172
2272
|
export {
|
|
2173
2273
|
CvcRegistryService,
|
|
2174
2274
|
INFORMATION_SCOPE_CATEGORY_ORDER,
|
|
@@ -2180,15 +2280,24 @@ export {
|
|
|
2180
2280
|
INFORMATION_SCOPE_SYSTEM_INFO,
|
|
2181
2281
|
INFORMATION_SCOPE_UI_COPY_SOURCE,
|
|
2182
2282
|
INFORMATION_SCOPE_VERSION,
|
|
2283
|
+
ROI_SCOPE_PRESETS,
|
|
2284
|
+
ROI_SCOPE_PRESETS_SCOPE_VERSION,
|
|
2285
|
+
ROI_SCOPE_PRESETS_SOURCE,
|
|
2286
|
+
ROI_SCOPE_PRESET_IDS,
|
|
2287
|
+
ROI_SCOPE_PRESET_ITEM_IDS,
|
|
2288
|
+
ROI_SCOPE_PRESET_LABELS,
|
|
2183
2289
|
applyEntryOverrides,
|
|
2184
2290
|
cascadeExclusions,
|
|
2185
2291
|
createInformationScopeResolver,
|
|
2186
2292
|
cvcVersionsToRecord,
|
|
2293
|
+
isRoiScopePresetId,
|
|
2187
2294
|
isScopeInstrumentRow,
|
|
2188
2295
|
isScopeRestRow,
|
|
2189
2296
|
isSelectableScopeRow,
|
|
2190
2297
|
kindForPerson,
|
|
2191
2298
|
resolveRegistryWithInheritance,
|
|
2299
|
+
roiScopePresetById,
|
|
2300
|
+
roiScopePresetRows,
|
|
2192
2301
|
scopeCategorySub,
|
|
2193
2302
|
scopeMigrationsFromSot,
|
|
2194
2303
|
scopeRowDisplayOrder,
|