@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/README.md
CHANGED
|
@@ -16,7 +16,17 @@ Package exports are organized into a public root API and a small number of
|
|
|
16
16
|
dedicated subpaths (`/validation`, `/cvcs`) — consult `package.json` for the
|
|
17
17
|
authoritative `exports` map.
|
|
18
18
|
|
|
19
|
-
## 0.
|
|
19
|
+
## 0.88.0 — the release (ROI) wizard's quick-fill scope presets, in one place (`ROI_SCOPE_PRESETS`; additive)
|
|
20
|
+
|
|
21
|
+
**What a person gets.** The three presets the release wizard offers ("Full case collaboration", "Name + risk information", "Identifying info only") now come from one list every app reads — Thread, PAVE and the Admin Hub's "Default scope presets" — instead of a copy in each. Their words and what each one fills are the prototype's.
|
|
22
|
+
|
|
23
|
+
**What is in it** (root, `./services` and the browser-safe `./information-scope`):
|
|
24
|
+
- `ROI_SCOPE_PRESETS` — `{ id, label, description, enabled, itemIds }[]` in the wizard's pill order; item ids are CVC-236 v4 row codes in canon's order, `system_info` included. Ids, labels and lists are the monolith's `HTI_ROI_SCOPE_PRESETS` / `presetChip(...)` (prototype `ba5ded6`); `description` and `enabled` are the Admin Hub prototype's (`data.sharing.scopePresets`, `398fb24`). `enabled` is display-only in the prototype and is not stored per account.
|
|
25
|
+
- `ROI_SCOPE_PRESET_IDS`, `RoiScopePresetId`, `ROI_SCOPE_PRESET_LABELS`, `ROI_SCOPE_PRESET_ITEM_IDS`, `ROI_SCOPE_PRESETS_SCOPE_VERSION` (4), `ROI_SCOPE_PRESETS_SOURCE`, `isRoiScopePresetId`, `roiScopePresetById`.
|
|
26
|
+
- `roiScopePresetRows(id, scope)` — a preset's rows resolved against a CVC-236 resolver (`createInformationScopeResolver`), in the preset's order; throws on an unknown id or an item that is not a live row.
|
|
27
|
+
- A new SOT pin `src/__sot__/roiScopePresets.pin.json` (`npm run sot:pins -- --only=roiScopePresets`) and its enforcer `roi-scope-presets-canon.test.ts`.
|
|
28
|
+
|
|
29
|
+
**For a consumer that bumps to this version.** No change is needed; delete your own preset list and read this one.
|
|
20
30
|
|
|
21
31
|
## 0.87.0 — a seat's name log and contact log, the Person id minter (`./seat-logs`), and seat-linked contacts read the seat's contact log (pl-9h4) (additive; a new subpath)
|
|
22
32
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-
|
|
1
|
+
import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-DAuhe0cd.cjs';
|
|
2
2
|
import * as mongoose from 'mongoose';
|
|
3
3
|
import { HydratedDocument, Connection, Model } from 'mongoose';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-
|
|
1
|
+
import { F as Form, l as buildFormSchema, h as Section, q as buildSectionSchema, Q as Question, o as buildQuestionSchema, f as ScoringRule, p as buildScoringRuleSchema, P as PlatformFunction, m as buildPlatformFunctionSchema, d as PlatformRole, n as buildPlatformRoleSchema, b as CvcRegistry, k as buildCvcRegistrySchema, a as CvcEntry, j as buildCvcEntrySchema } from './cvcEntry-DAuhe0cd.js';
|
|
2
2
|
import * as mongoose from 'mongoose';
|
|
3
3
|
import { HydratedDocument, Connection, Model } from 'mongoose';
|
|
4
4
|
|
package/dist/index.cjs
CHANGED
|
@@ -483,6 +483,12 @@ __export(src_exports, {
|
|
|
483
483
|
REPORTING_REGIME_FUNDER_GATES: () => REPORTING_REGIME_FUNDER_GATES,
|
|
484
484
|
REPORTING_REGIME_LABELS: () => REPORTING_REGIME_LABELS,
|
|
485
485
|
REPORT_AUTHORITY_ORG_TYPE_KEYS: () => REPORT_AUTHORITY_ORG_TYPE_KEYS,
|
|
486
|
+
ROI_SCOPE_PRESETS: () => ROI_SCOPE_PRESETS,
|
|
487
|
+
ROI_SCOPE_PRESETS_SCOPE_VERSION: () => ROI_SCOPE_PRESETS_SCOPE_VERSION,
|
|
488
|
+
ROI_SCOPE_PRESETS_SOURCE: () => ROI_SCOPE_PRESETS_SOURCE,
|
|
489
|
+
ROI_SCOPE_PRESET_IDS: () => ROI_SCOPE_PRESET_IDS,
|
|
490
|
+
ROI_SCOPE_PRESET_ITEM_IDS: () => ROI_SCOPE_PRESET_ITEM_IDS,
|
|
491
|
+
ROI_SCOPE_PRESET_LABELS: () => ROI_SCOPE_PRESET_LABELS,
|
|
486
492
|
ROLE_LEVEL: () => ROLE_LEVEL,
|
|
487
493
|
ROLE_LEVEL_LABELS: () => ROLE_LEVEL_LABELS,
|
|
488
494
|
ROLE_LEVEL_VALUES: () => ROLE_LEVEL_VALUES,
|
|
@@ -830,6 +836,7 @@ __export(src_exports, {
|
|
|
830
836
|
isReportAuthorityOrgType: () => isReportAuthorityOrgType,
|
|
831
837
|
isReportingAudienceCode: () => isReportingAudienceCode,
|
|
832
838
|
isReportingRegimeCode: () => isReportingRegimeCode,
|
|
839
|
+
isRoiScopePresetId: () => isRoiScopePresetId,
|
|
833
840
|
isScopeInstrumentRow: () => isScopeInstrumentRow,
|
|
834
841
|
isScopeRestRow: () => isScopeRestRow,
|
|
835
842
|
isSelectableScopeRow: () => isSelectableScopeRow,
|
|
@@ -966,6 +973,8 @@ __export(src_exports, {
|
|
|
966
973
|
riskIdentificationMilestoneSot: () => riskIdentificationMilestone_v1_0_0_default,
|
|
967
974
|
riskSeverityBandSot: () => riskSeverityBand_v1_0_0_default,
|
|
968
975
|
roiMethodSot: () => roiMethod_v1_0_0_default,
|
|
976
|
+
roiScopePresetById: () => roiScopePresetById,
|
|
977
|
+
roiScopePresetRows: () => roiScopePresetRows,
|
|
969
978
|
roiScopeSot: () => roiScope_v1_4_1_default,
|
|
970
979
|
roiStatusSot: () => roiStatus_v1_0_0_default,
|
|
971
980
|
roleContextSot: () => roleContext_v1_0_0_default,
|
|
@@ -27083,6 +27092,106 @@ function sortScopeCategories(categories) {
|
|
|
27083
27092
|
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);
|
|
27084
27093
|
}
|
|
27085
27094
|
|
|
27095
|
+
// src/roiScopePresets/index.ts
|
|
27096
|
+
var ROI_SCOPE_PRESET_IDS = ["full_collab", "risk_only", "identifying"];
|
|
27097
|
+
var ROI_SCOPE_PRESETS_SCOPE_VERSION = 4;
|
|
27098
|
+
var ROI_SCOPE_PRESETS_SOURCE = {
|
|
27099
|
+
repo: "htilabstech/prototype",
|
|
27100
|
+
file: "HTI-LEADS-PAVE-Thread-prototype.html",
|
|
27101
|
+
commit: "ba5ded6de6affdb11054a18a8a8a561be987a403",
|
|
27102
|
+
mirror: { repo: "htilabstech/platform-prototype", file: "src/data.js", commit: "398fb24" }
|
|
27103
|
+
};
|
|
27104
|
+
var freeze = (p) => Object.freeze({ ...p, itemIds: Object.freeze([...p.itemIds]) });
|
|
27105
|
+
var ROI_SCOPE_PRESETS = Object.freeze([
|
|
27106
|
+
freeze({
|
|
27107
|
+
id: "full_collab",
|
|
27108
|
+
label: "Full case collaboration",
|
|
27109
|
+
description: "Broad packet for coordinated providers working the case together.",
|
|
27110
|
+
enabled: true,
|
|
27111
|
+
itemIds: [
|
|
27112
|
+
"names",
|
|
27113
|
+
"dob",
|
|
27114
|
+
"addresses",
|
|
27115
|
+
"demographics",
|
|
27116
|
+
"screen_indicators",
|
|
27117
|
+
"victimization",
|
|
27118
|
+
"summary_initial_screen",
|
|
27119
|
+
"summary_ae_intake",
|
|
27120
|
+
"summary_ida",
|
|
27121
|
+
"summary_lap",
|
|
27122
|
+
"summary_danger_assessment",
|
|
27123
|
+
"summary_stalking_assessment",
|
|
27124
|
+
"summary_injury_and_strangulation",
|
|
27125
|
+
"summary_tra",
|
|
27126
|
+
"summary_hope_scale",
|
|
27127
|
+
"summary_needs_assessment",
|
|
27128
|
+
"full_ida",
|
|
27129
|
+
"contact_info",
|
|
27130
|
+
"priorities_safety",
|
|
27131
|
+
"encounter_location",
|
|
27132
|
+
"contact_history",
|
|
27133
|
+
"service_history",
|
|
27134
|
+
"plans_goals",
|
|
27135
|
+
"session_summary",
|
|
27136
|
+
"case_notes",
|
|
27137
|
+
"relationships_household",
|
|
27138
|
+
"family",
|
|
27139
|
+
"system_info"
|
|
27140
|
+
]
|
|
27141
|
+
}),
|
|
27142
|
+
freeze({
|
|
27143
|
+
id: "risk_only",
|
|
27144
|
+
label: "Name + risk information",
|
|
27145
|
+
description: "Minimal identifying info \u2014 risk + screening for a coordinated handoff.",
|
|
27146
|
+
enabled: true,
|
|
27147
|
+
itemIds: [
|
|
27148
|
+
"names",
|
|
27149
|
+
"screen_indicators",
|
|
27150
|
+
"victimization",
|
|
27151
|
+
"summary_initial_screen",
|
|
27152
|
+
"summary_ae_intake",
|
|
27153
|
+
"summary_ida",
|
|
27154
|
+
"summary_lap",
|
|
27155
|
+
"summary_danger_assessment",
|
|
27156
|
+
"summary_stalking_assessment",
|
|
27157
|
+
"summary_injury_and_strangulation",
|
|
27158
|
+
"system_info"
|
|
27159
|
+
]
|
|
27160
|
+
}),
|
|
27161
|
+
freeze({
|
|
27162
|
+
id: "identifying",
|
|
27163
|
+
label: "Identifying info only",
|
|
27164
|
+
description: "Used for verification with law enforcement / medical partners.",
|
|
27165
|
+
enabled: true,
|
|
27166
|
+
itemIds: ["names", "dob", "addresses", "additional_ids", "demographics", "system_info"]
|
|
27167
|
+
})
|
|
27168
|
+
]);
|
|
27169
|
+
var ROI_SCOPE_PRESET_LABELS = Object.freeze(
|
|
27170
|
+
Object.fromEntries(ROI_SCOPE_PRESETS.map((p) => [p.id, p.label]))
|
|
27171
|
+
);
|
|
27172
|
+
var ROI_SCOPE_PRESET_ITEM_IDS = Object.freeze(
|
|
27173
|
+
Object.fromEntries(ROI_SCOPE_PRESETS.map((p) => [p.id, p.itemIds]))
|
|
27174
|
+
);
|
|
27175
|
+
function isRoiScopePresetId(id) {
|
|
27176
|
+
return typeof id === "string" && ROI_SCOPE_PRESET_IDS.includes(id);
|
|
27177
|
+
}
|
|
27178
|
+
function roiScopePresetById(id) {
|
|
27179
|
+
return ROI_SCOPE_PRESETS.find((p) => p.id === id);
|
|
27180
|
+
}
|
|
27181
|
+
function roiScopePresetRows(id, scope) {
|
|
27182
|
+
const preset = roiScopePresetById(id);
|
|
27183
|
+
if (!preset) throw new Error(`roiScopePresetRows: "${id}" is not an ROI scope preset`);
|
|
27184
|
+
return preset.itemIds.map((code) => {
|
|
27185
|
+
const row = scope.row(code);
|
|
27186
|
+
if (!row || row.status === "retired") {
|
|
27187
|
+
throw new Error(
|
|
27188
|
+
`roiScopePresetRows: preset "${id}" names "${code}", which is not a live CVC-236 row`
|
|
27189
|
+
);
|
|
27190
|
+
}
|
|
27191
|
+
return row;
|
|
27192
|
+
});
|
|
27193
|
+
}
|
|
27194
|
+
|
|
27086
27195
|
// src/age/ageFromDob.ts
|
|
27087
27196
|
var DOB_MIN_YEAR = 1850;
|
|
27088
27197
|
function toNullableNumber(v) {
|
|
@@ -78684,6 +78793,12 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
78684
78793
|
REPORTING_REGIME_FUNDER_GATES,
|
|
78685
78794
|
REPORTING_REGIME_LABELS,
|
|
78686
78795
|
REPORT_AUTHORITY_ORG_TYPE_KEYS,
|
|
78796
|
+
ROI_SCOPE_PRESETS,
|
|
78797
|
+
ROI_SCOPE_PRESETS_SCOPE_VERSION,
|
|
78798
|
+
ROI_SCOPE_PRESETS_SOURCE,
|
|
78799
|
+
ROI_SCOPE_PRESET_IDS,
|
|
78800
|
+
ROI_SCOPE_PRESET_ITEM_IDS,
|
|
78801
|
+
ROI_SCOPE_PRESET_LABELS,
|
|
78687
78802
|
ROLE_LEVEL,
|
|
78688
78803
|
ROLE_LEVEL_LABELS,
|
|
78689
78804
|
ROLE_LEVEL_VALUES,
|
|
@@ -79031,6 +79146,7 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
79031
79146
|
isReportAuthorityOrgType,
|
|
79032
79147
|
isReportingAudienceCode,
|
|
79033
79148
|
isReportingRegimeCode,
|
|
79149
|
+
isRoiScopePresetId,
|
|
79034
79150
|
isScopeInstrumentRow,
|
|
79035
79151
|
isScopeRestRow,
|
|
79036
79152
|
isSelectableScopeRow,
|
|
@@ -79167,6 +79283,8 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
79167
79283
|
riskIdentificationMilestoneSot,
|
|
79168
79284
|
riskSeverityBandSot,
|
|
79169
79285
|
roiMethodSot,
|
|
79286
|
+
roiScopePresetById,
|
|
79287
|
+
roiScopePresetRows,
|
|
79170
79288
|
roiScopeSot,
|
|
79171
79289
|
roiStatusSot,
|
|
79172
79290
|
roleContextSot,
|