@htilabs/platform-common-models 0.23.0 → 0.25.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 +104 -0
- package/dist/authz/index.cjs +143 -12
- package/dist/authz/index.cjs.map +1 -1
- package/dist/authz/index.d.cts +121 -12
- package/dist/authz/index.d.ts +121 -12
- package/dist/authz/index.js +136 -12
- package/dist/authz/index.js.map +1 -1
- package/dist/constants/index.cjs +30 -0
- 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 +26 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/{cvcEntry-0BIB9sen.d.cts → cvcEntry-Asg7mxjB.d.cts} +12 -9
- package/dist/{cvcEntry-0BIB9sen.d.ts → cvcEntry-Asg7mxjB.d.ts} +12 -9
- package/dist/{index-CDoqrfc1.d.ts → index-ClTjjJ_S.d.ts} +1 -1
- package/dist/{index-Zu_mOJRn.d.cts → index-Pt82NxQg.d.cts} +1 -1
- package/dist/index.cjs +604 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.js +577 -15
- package/dist/index.js.map +1 -1
- package/dist/information-scope/index.d.cts +3 -350
- package/dist/information-scope/index.d.ts +3 -350
- package/dist/informationScopeResolver-BzYu97DE.d.cts +351 -0
- package/dist/informationScopeResolver-BzYu97DE.d.ts +351 -0
- package/dist/models/index.cjs +26 -1
- package/dist/models/index.cjs.map +1 -1
- package/dist/models/index.d.cts +2 -2
- package/dist/models/index.d.ts +2 -2
- package/dist/models/index.js +26 -1
- package/dist/models/index.js.map +1 -1
- package/dist/{platform-auth-B49Ly57B.d.cts → platform-auth-DJO-r9Pf.d.cts} +48 -1
- package/dist/{platform-auth-B49Ly57B.d.ts → platform-auth-DJO-r9Pf.d.ts} +48 -1
- package/dist/schemas/index.cjs +26 -1
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.d.cts +25 -25
- package/dist/schemas/index.d.ts +25 -25
- package/dist/schemas/index.js +26 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/services/index.cjs +26 -1
- package/dist/services/index.cjs.map +1 -1
- package/dist/services/index.d.cts +2 -1
- package/dist/services/index.d.ts +2 -1
- package/dist/services/index.js +26 -1
- package/dist/services/index.js.map +1 -1
- package/dist/sharing-ceiling/index.cjs +497 -0
- package/dist/sharing-ceiling/index.cjs.map +1 -0
- package/dist/sharing-ceiling/index.d.cts +318 -0
- package/dist/sharing-ceiling/index.d.ts +318 -0
- package/dist/sharing-ceiling/index.js +451 -0
- package/dist/sharing-ceiling/index.js.map +1 -0
- package/dist/types/index.d.cts +11 -3
- package/dist/types/index.d.ts +11 -3
- package/dist/validation/index.cjs +22 -0
- package/dist/validation/index.cjs.map +1 -1
- package/dist/validation/index.js +22 -0
- package/dist/validation/index.js.map +1 -1
- package/package.json +7 -1
- package/src/__sot__/README.md +2 -1
- package/src/__sot__/coreFunctionFields.ts +88 -4
- package/src/__sot__/coreFunctions.pin.json +1040 -113
- package/src/__sot__/sharingStarter.pin.json +229 -0
- package/src/__tests__/authz-resolve.test.ts +115 -31
- package/src/__tests__/core-function-default-bounds.test.ts +374 -0
- package/src/__tests__/core-functions-case-close.test.ts +82 -0
- package/src/__tests__/sharing-starter-canon.test.ts +178 -0
- package/src/authz/defaultBounds.ts +69 -0
- package/src/authz/index.ts +12 -3
- package/src/authz/resolveEffectiveFunctions.ts +69 -29
- package/src/constants/platform-auth.ts +60 -0
- package/src/generated/coreFunctionDefaultBounds.ts +109 -0
- package/src/generated/sharingPlatformStarter.ts +165 -0
- package/src/index.ts +5 -0
- package/src/schemas/platform-role.ts +4 -1
- package/src/sharingCeiling/__tests__/sharingCeiling.test.ts +678 -0
- package/src/sharingCeiling/chain.ts +269 -0
- package/src/sharingCeiling/coverage.ts +346 -0
- package/src/sharingCeiling/index.ts +14 -0
- package/src/sharingCeiling/starter.ts +89 -0
- package/src/types/platform-auth.ts +9 -2
package/dist/index.cjs
CHANGED
|
@@ -50,6 +50,8 @@ __export(src_exports, {
|
|
|
50
50
|
BIRTH_LOCATION_VALUES: () => BIRTH_LOCATION_VALUES,
|
|
51
51
|
BasisQuickPicksKeys: () => BasisQuickPicksKeys,
|
|
52
52
|
CALLER_IS_VICTIM_ROLES: () => CALLER_IS_VICTIM_ROLES,
|
|
53
|
+
CORE_FUNCTION_DEFAULT_BOUNDS: () => CORE_FUNCTION_DEFAULT_BOUNDS,
|
|
54
|
+
CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION: () => CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION,
|
|
53
55
|
CVC_100_LABELS: () => CVC_100_LABELS,
|
|
54
56
|
CVC_100_LIVES_RURAL: () => CVC_100_LIVES_RURAL,
|
|
55
57
|
CVC_100_VALUES: () => CVC_100_VALUES,
|
|
@@ -224,6 +226,10 @@ __export(src_exports, {
|
|
|
224
226
|
DATA_QUALITY_DESCRIPTIONS: () => DATA_QUALITY_DESCRIPTIONS,
|
|
225
227
|
DATA_QUALITY_LABELS: () => DATA_QUALITY_LABELS,
|
|
226
228
|
DATA_QUALITY_VALUES: () => DATA_QUALITY_VALUES,
|
|
229
|
+
DEFAULT_BOUND_STATE: () => DEFAULT_BOUND_STATE,
|
|
230
|
+
DEFAULT_BOUND_STATE_DISPLAY: () => DEFAULT_BOUND_STATE_DISPLAY,
|
|
231
|
+
DEFAULT_BOUND_STATE_LABELS: () => DEFAULT_BOUND_STATE_LABELS,
|
|
232
|
+
DEFAULT_BOUND_STATE_VALUES: () => DEFAULT_BOUND_STATE_VALUES,
|
|
227
233
|
DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY: () => DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY,
|
|
228
234
|
DaIncidentArchiveReasonKeys: () => DaIncidentArchiveReasonKeys,
|
|
229
235
|
DaIncidentConfidenceKeys: () => DaIncidentConfidenceKeys,
|
|
@@ -262,6 +268,9 @@ __export(src_exports, {
|
|
|
262
268
|
GoalStatusKeys: () => GoalStatusKeys,
|
|
263
269
|
GoalWithdrawalReasonKeys: () => GoalWithdrawalReasonKeys,
|
|
264
270
|
HEALTHCARE_ORG_TYPE_KEYS: () => HEALTHCARE_ORG_TYPE_KEYS,
|
|
271
|
+
HTI_SHARE_PLATFORM_PURPOSE_ENABLED: () => HTI_SHARE_PLATFORM_PURPOSE_ENABLED,
|
|
272
|
+
HTI_SHARE_PLATFORM_STARTER: () => HTI_SHARE_PLATFORM_STARTER,
|
|
273
|
+
HTI_SHARE_PLATFORM_STARTER_SOURCE: () => HTI_SHARE_PLATFORM_STARTER_SOURCE,
|
|
265
274
|
HairColorKeys: () => HairColorKeys,
|
|
266
275
|
HasTattoosKeys: () => HasTattoosKeys,
|
|
267
276
|
HighestEducationLevelCompletedKeys: () => HighestEducationLevelCompletedKeys,
|
|
@@ -330,6 +339,7 @@ __export(src_exports, {
|
|
|
330
339
|
INCIDENT_PARTICIPATION_ROLE_LABELS: () => INCIDENT_PARTICIPATION_ROLE_LABELS,
|
|
331
340
|
INCIDENT_PARTICIPATION_ROLE_SUPERSEDED_BY: () => INCIDENT_PARTICIPATION_ROLE_SUPERSEDED_BY,
|
|
332
341
|
INCIDENT_PARTICIPATION_ROLE_VALUES: () => INCIDENT_PARTICIPATION_ROLE_VALUES,
|
|
342
|
+
INFORMATION_SCOPE_FIELD_HOME_ROWS: () => INFORMATION_SCOPE_FIELD_HOME_ROWS,
|
|
333
343
|
INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE: () => INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE,
|
|
334
344
|
INFORMATION_SCOPE_READABLE_VERSIONS: () => INFORMATION_SCOPE_READABLE_VERSIONS,
|
|
335
345
|
INFORMATION_SCOPE_SYSTEM_INFO: () => INFORMATION_SCOPE_SYSTEM_INFO,
|
|
@@ -452,6 +462,9 @@ __export(src_exports, {
|
|
|
452
462
|
SHARE_VIEW: () => SHARE_VIEW,
|
|
453
463
|
SHARE_VIEW_LABELS: () => SHARE_VIEW_LABELS,
|
|
454
464
|
SHARE_VIEW_VALUES: () => SHARE_VIEW_VALUES,
|
|
465
|
+
SHARING_CEILING_DEFAULT_ROW_KEY: () => SHARING_CEILING_DEFAULT_ROW_KEY,
|
|
466
|
+
SHARING_CEILING_EXTERNAL_ROW_KEY: () => SHARING_CEILING_EXTERNAL_ROW_KEY,
|
|
467
|
+
SHARING_CEILING_SCOPE_VERSION: () => SHARING_CEILING_SCOPE_VERSION,
|
|
455
468
|
SUBMISSION_STATES: () => SUBMISSION_STATES,
|
|
456
469
|
SUBMISSION_STATE_LABELS: () => SUBMISSION_STATE_LABELS,
|
|
457
470
|
ServiceAudienceKeys: () => ServiceAudienceKeys,
|
|
@@ -545,6 +558,7 @@ __export(src_exports, {
|
|
|
545
558
|
carCorrectionReasonSot: () => carCorrectionReason_v1_0_0_default,
|
|
546
559
|
cascadeExclusions: () => cascadeExclusions,
|
|
547
560
|
caseShareStateSot: () => caseShareState_v1_0_0_default,
|
|
561
|
+
ceilingCoverage: () => ceilingCoverage,
|
|
548
562
|
checkInActivitySot: () => checkInActivity_v1_0_0_default,
|
|
549
563
|
checkInPhaseSot: () => checkInPhase_v1_1_0_default,
|
|
550
564
|
childBehavioralConcernsSot: () => childBehavioralConcerns_v1_0_0_default,
|
|
@@ -552,6 +566,7 @@ __export(src_exports, {
|
|
|
552
566
|
childCustodyArrangementSot: () => childCustodyArrangement_v1_0_0_default,
|
|
553
567
|
choiceSchema: () => choiceSchema,
|
|
554
568
|
citizenshipSot: () => citizenship_v1_0_0_default,
|
|
569
|
+
codebookDefaultBound: () => codebookDefaultBound,
|
|
555
570
|
collectionContextSot: () => collectionContext_v1_0_0_default,
|
|
556
571
|
compileCvcEntryModel: () => compileModel8,
|
|
557
572
|
compileCvcRegistryModel: () => compileModel7,
|
|
@@ -586,6 +601,7 @@ __export(src_exports, {
|
|
|
586
601
|
determinationLevelSot: () => determinationLevel_v1_0_0_default,
|
|
587
602
|
disabilitySubtypeSot: () => disabilitySubtype_v1_0_0_default,
|
|
588
603
|
discretionLevelSot: () => discretionLevel_v1_0_0_default,
|
|
604
|
+
effectiveCeiling: () => effectiveCeiling,
|
|
589
605
|
emailSchema: () => emailSchema,
|
|
590
606
|
emergencyContactCallReasonSot: () => emergencyContactCallReason_v1_0_0_default,
|
|
591
607
|
emergencyContactPermissionsSot: () => emergencyContactPermissions_v1_0_0_default,
|
|
@@ -625,6 +641,7 @@ __export(src_exports, {
|
|
|
625
641
|
goalWithdrawalReasonSot: () => goalWithdrawalReason_v1_0_0_default,
|
|
626
642
|
guidanceSchema: () => guidanceSchema,
|
|
627
643
|
hairColorSot: () => hairColor_v1_0_0_default,
|
|
644
|
+
hasOwnScopeContent: () => hasOwnScopeContent,
|
|
628
645
|
hasTattoosSot: () => hasTattoos_v1_0_0_default,
|
|
629
646
|
highestEducationLevelCompletedSot: () => highestEducationLevelCompleted_v1_1_0_default,
|
|
630
647
|
hivStatusSot: () => hivStatus_v1_0_0_default,
|
|
@@ -648,6 +665,7 @@ __export(src_exports, {
|
|
|
648
665
|
investigativeRequestTypeSot: () => investigativeRequestType_v1_0_0_default,
|
|
649
666
|
isAgencyTypeKey: () => isAgencyTypeKey,
|
|
650
667
|
isCanonEvaluableFunction: () => isCanonEvaluableFunction,
|
|
668
|
+
isCeilingCoverageRow: () => isCeilingCoverageRow,
|
|
651
669
|
isDeprecatedCoreIndicator: () => isDeprecatedCoreIndicator,
|
|
652
670
|
isDeprecatedIncidentParticipationRole: () => isDeprecatedIncidentParticipationRole,
|
|
653
671
|
isHealthcareOrgType: () => isHealthcareOrgType,
|
|
@@ -664,6 +682,7 @@ __export(src_exports, {
|
|
|
664
682
|
isScopeInstrumentRow: () => isScopeInstrumentRow,
|
|
665
683
|
isScopeRestRow: () => isScopeRestRow,
|
|
666
684
|
isSelectableScopeRow: () => isSelectableScopeRow,
|
|
685
|
+
isSharingPurposeDisabled: () => isSharingPurposeDisabled,
|
|
667
686
|
isStructuredNameType: () => isStructuredNameType,
|
|
668
687
|
isTransgenderGenderIdentity: () => isTransgenderGenderIdentity,
|
|
669
688
|
isVictimServingOrgType: () => isVictimServingOrgType,
|
|
@@ -677,6 +696,7 @@ __export(src_exports, {
|
|
|
677
696
|
livingSituationSot: () => livingSituation_v1_0_0_default,
|
|
678
697
|
locationTypeSot: () => locationType_v1_0_0_default,
|
|
679
698
|
maritalStatusLegalSot: () => maritalStatusLegal_v1_0_0_default,
|
|
699
|
+
maskSelectionToCeiling: () => maskSelectionToCeiling,
|
|
680
700
|
mentalHealthStatusSot: () => mentalHealthStatus_v1_0_0_default,
|
|
681
701
|
messageReportReasonSot: () => messageReportReason_v1_0_0_default,
|
|
682
702
|
midStayEventTypeSot: () => midStayEventType_v1_0_0_default,
|
|
@@ -756,8 +776,12 @@ __export(src_exports, {
|
|
|
756
776
|
roiStatusSot: () => roiStatus_v1_0_0_default,
|
|
757
777
|
roleContextSot: () => roleContext_v1_0_0_default,
|
|
758
778
|
romanticRelationshipChangeTypeSot: () => romanticRelationshipChangeType_v1_0_0_default,
|
|
779
|
+
rowsExpandedByCeiling: () => rowsExpandedByCeiling,
|
|
780
|
+
rowsOutsideCeiling: () => rowsOutsideCeiling,
|
|
781
|
+
rowsOverCeiling: () => rowsOverCeiling,
|
|
759
782
|
rsvpResponseSot: () => rsvpResponse_v1_0_0_default,
|
|
760
783
|
scopeMigrationsFromSot: () => scopeMigrationsFromSot,
|
|
784
|
+
scopeRowWithinCeiling: () => scopeRowWithinCeiling,
|
|
761
785
|
scopeRowsFromSot: () => scopeRowsFromSot,
|
|
762
786
|
scoringConditionSchema: () => scoringConditionSchema,
|
|
763
787
|
scoringRecommendationSchema: () => scoringRecommendationSchema,
|
|
@@ -785,6 +809,9 @@ __export(src_exports, {
|
|
|
785
809
|
sexProviderSubroleSot: () => sexProviderSubrole_v1_0_0_default,
|
|
786
810
|
sharePurposeSot: () => sharePurpose_v1_0_0_default,
|
|
787
811
|
shareResponseReasonSot: () => shareResponseReason_v1_0_0_default,
|
|
812
|
+
sharingCeilingCellList: () => sharingCeilingCellList,
|
|
813
|
+
sharingCeilingRowKey: () => sharingCeilingRowKey,
|
|
814
|
+
sharingScopeEditsFromCells: () => sharingScopeEditsFromCells,
|
|
788
815
|
signatureMethodSot: () => signatureMethod_v1_0_0_default,
|
|
789
816
|
signatureTypeSot: () => signatureType_v1_0_0_default,
|
|
790
817
|
smtBodyLocationSot: () => smtBodyLocation_v1_0_0_default,
|
|
@@ -6749,6 +6776,28 @@ var PERMISSION_STATE_DISPLAY = {
|
|
|
6749
6776
|
icon: "\u{1F512}"
|
|
6750
6777
|
}
|
|
6751
6778
|
};
|
|
6779
|
+
var DEFAULT_BOUND_STATE = {
|
|
6780
|
+
...PERMISSION_STATE,
|
|
6781
|
+
/** Not relevant — canon's `not_applicable_roles` for this function. */
|
|
6782
|
+
NA: "NA"
|
|
6783
|
+
};
|
|
6784
|
+
var DEFAULT_BOUND_STATE_VALUES = [
|
|
6785
|
+
...PERMISSION_STATE_VALUES,
|
|
6786
|
+
DEFAULT_BOUND_STATE.NA
|
|
6787
|
+
];
|
|
6788
|
+
var DEFAULT_BOUND_STATE_LABELS = {
|
|
6789
|
+
...PERMISSION_STATE_LABELS,
|
|
6790
|
+
[DEFAULT_BOUND_STATE.NA]: "Not relevant"
|
|
6791
|
+
};
|
|
6792
|
+
var DEFAULT_BOUND_STATE_DISPLAY = {
|
|
6793
|
+
...PERMISSION_STATE_DISPLAY,
|
|
6794
|
+
[DEFAULT_BOUND_STATE.NA]: {
|
|
6795
|
+
label: "Not relevant",
|
|
6796
|
+
color: "#616161",
|
|
6797
|
+
bgColor: "#f5f5f5",
|
|
6798
|
+
icon: "\u25CC"
|
|
6799
|
+
}
|
|
6800
|
+
};
|
|
6752
6801
|
var SHARE_VIEW = {
|
|
6753
6802
|
/** System metadata only (partial access). */
|
|
6754
6803
|
SYS_INFO: "sys_info",
|
|
@@ -8482,7 +8531,10 @@ var platformRoleSchemaDefinition = {
|
|
|
8482
8531
|
type: Boolean,
|
|
8483
8532
|
default: false
|
|
8484
8533
|
},
|
|
8485
|
-
/**
|
|
8534
|
+
/**
|
|
8535
|
+
* Dynamic map of functionCode → DefaultBoundStateValue (a PERMISSION_STATE
|
|
8536
|
+
* value or the codebook's `NA`); an unlisted function is unbound.
|
|
8537
|
+
*/
|
|
8486
8538
|
functions: {
|
|
8487
8539
|
type: import_mongoose7.Schema.Types.Mixed,
|
|
8488
8540
|
default: {}
|
|
@@ -13882,11 +13934,11 @@ function createInformationScopeResolver(input) {
|
|
|
13882
13934
|
});
|
|
13883
13935
|
migrations.set(m.from, perCode);
|
|
13884
13936
|
}
|
|
13885
|
-
const normalize = (codes,
|
|
13937
|
+
const normalize = (codes, withSystemInfo2 = true) => {
|
|
13886
13938
|
const seen = /* @__PURE__ */ new Set();
|
|
13887
13939
|
const known = [];
|
|
13888
13940
|
const unknown = [];
|
|
13889
|
-
const all =
|
|
13941
|
+
const all = withSystemInfo2 ? [INFORMATION_SCOPE_SYSTEM_INFO, ...codes] : [...codes];
|
|
13890
13942
|
for (const c of all) {
|
|
13891
13943
|
if (seen.has(c)) continue;
|
|
13892
13944
|
seen.add(c);
|
|
@@ -14296,11 +14348,9 @@ var STATES = new Set(Object.values(PERMISSION_STATE));
|
|
|
14296
14348
|
function readState(map, code) {
|
|
14297
14349
|
const v = own(map, code);
|
|
14298
14350
|
if (v === void 0 || v === null) return void 0;
|
|
14351
|
+
if (v === DEFAULT_BOUND_STATE.NA) return PERMISSION_STATE.NEVER;
|
|
14299
14352
|
return typeof v === "string" && STATES.has(v) ? v : "malformed";
|
|
14300
14353
|
}
|
|
14301
|
-
function stringList(v) {
|
|
14302
|
-
return Array.isArray(v) ? v.filter((x) => typeof x === "string") : [];
|
|
14303
|
-
}
|
|
14304
14354
|
function teamValueRestricts(map, code) {
|
|
14305
14355
|
const gate = readState(map, code);
|
|
14306
14356
|
return gate !== void 0 && gate !== PERMISSION_STATE.PREF_YES && gate !== PERMISSION_STATE.ALWAYS;
|
|
@@ -14373,31 +14423,30 @@ function resolveEffectiveFunctions(input) {
|
|
|
14373
14423
|
const retired = own(fn, "retired");
|
|
14374
14424
|
if (typeof code !== "string" || !isCanonEvaluableFunction(code)) continue;
|
|
14375
14425
|
if (retired !== void 0 && retired !== false) continue;
|
|
14376
|
-
vocabulary.push(
|
|
14426
|
+
vocabulary.push(code);
|
|
14377
14427
|
}
|
|
14378
14428
|
const agencyAll = readContainer(input.agencyOverrides);
|
|
14379
14429
|
const team = compileTeamGate(input.teamPolicy);
|
|
14380
14430
|
const granted = /* @__PURE__ */ new Set();
|
|
14381
14431
|
for (const roleCode of heldCodes) {
|
|
14382
14432
|
const role = rolesByCode.get(roleCode);
|
|
14383
|
-
const roleTools = new Set(stringList(own(role, "tools")));
|
|
14384
14433
|
const roleFunctions = readContainer(own(role, "functions"));
|
|
14385
14434
|
if (roleFunctions.kind === "malformed") continue;
|
|
14386
14435
|
const agency = agencyAll.kind === "map" ? readContainer(own(agencyAll.map, roleCode)) : agencyAll;
|
|
14387
14436
|
for (const fn of vocabulary) {
|
|
14388
|
-
if (granted.has(fn
|
|
14389
|
-
const listed = roleFunctions.kind === "map" ? readState(roleFunctions.map, fn
|
|
14390
|
-
|
|
14391
|
-
const tier1 = listed === "malformed" ? PERMISSION_STATE.NEVER : listed
|
|
14437
|
+
if (granted.has(fn)) continue;
|
|
14438
|
+
const listed = roleFunctions.kind === "map" ? readState(roleFunctions.map, fn) : void 0;
|
|
14439
|
+
if (listed === void 0) continue;
|
|
14440
|
+
const tier1 = listed === "malformed" ? PERMISSION_STATE.NEVER : listed;
|
|
14392
14441
|
let state = tier1;
|
|
14393
14442
|
if (tier1 !== PERMISSION_STATE.ALWAYS && tier1 !== PERMISSION_STATE.NEVER) {
|
|
14394
|
-
const override = agency.kind === "malformed" ? "malformed" : agency.kind === "map" ? readState(agency.map, fn
|
|
14443
|
+
const override = agency.kind === "malformed" ? "malformed" : agency.kind === "map" ? readState(agency.map, fn) : void 0;
|
|
14395
14444
|
if (override === "malformed") state = PERMISSION_STATE.NEVER;
|
|
14396
14445
|
else if (override !== void 0) state = override;
|
|
14397
14446
|
}
|
|
14398
14447
|
if (state !== PERMISSION_STATE.ALWAYS && state !== PERMISSION_STATE.PREF_YES) continue;
|
|
14399
|
-
if (state !== PERMISSION_STATE.ALWAYS && teamRestricts(team, roleCode, fn
|
|
14400
|
-
granted.add(fn
|
|
14448
|
+
if (state !== PERMISSION_STATE.ALWAYS && teamRestricts(team, roleCode, fn)) continue;
|
|
14449
|
+
granted.add(fn);
|
|
14401
14450
|
}
|
|
14402
14451
|
}
|
|
14403
14452
|
return [...granted].sort();
|
|
@@ -14420,6 +14469,519 @@ function resolveEffectiveViewingLevel(input, teamViewingLevel) {
|
|
|
14420
14469
|
return viewingLevelFromFunctions(resolveEffectiveFunctions(input), teamViewingLevel);
|
|
14421
14470
|
}
|
|
14422
14471
|
|
|
14472
|
+
// src/generated/coreFunctionDefaultBounds.ts
|
|
14473
|
+
var CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION = "1.3.0";
|
|
14474
|
+
var CORE_FUNCTION_DEFAULT_BOUNDS = {
|
|
14475
|
+
"agency_info_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "TEAM-ADM": "PREF_YES" },
|
|
14476
|
+
"announcement_publish": { "MEM-ADM": "PREF_NO", "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
14477
|
+
"api_key_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "NEVER", "case_nav": "NA", "research_analytics": "NA" },
|
|
14478
|
+
"assessments_conduct": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "PREF_YES", "crisis_response": "NEVER", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "NEVER", "research_analytics": "NA", "screener": "NEVER", "volunteer": "NEVER" },
|
|
14479
|
+
"auth_model_manage_platform": { "AUD": "NEVER", "CIRO": "NEVER", "DATA-ADM": "NEVER", "GOV-AUD": "NEVER", "MEM-ADM": "NEVER", "PLT-ADM": "ALWAYS", "PLT-SUP": "NEVER", "SUP": "NEVER", "TEAM-ADM": "NEVER", "research_analytics": "NA" },
|
|
14480
|
+
"case_assign_reassign": { "AUD": "NA", "CIRO": "NA", "DATA-ADM": "NA", "GOV-AUD": "NA", "MEM-ADM": "ALWAYS", "PLT-ADM": "NA", "SUP": "ALWAYS", "TEAM-ADM": "PREF_YES", "behavioral_health_provider": "NA", "case_nav": "ALWAYS", "crisis_response": "NA", "healthcare_provider_medical": "NA", "intel_analyst": "NA", "investigator": "NA", "le_liaison_vsp": "NA", "legal_advocate": "NA", "mandatory_reporter": "NA", "mdt_participant": "NA", "prosecutor_review": "NA", "public_reporter": "NA", "research_analytics": "NA", "screener": "NA", "volunteer": "NA" },
|
|
14481
|
+
"case_claim": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "PREF_YES", "investigator": "PREF_YES", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mandatory_reporter": "PREF_YES", "mdt_participant": "PREF_YES", "prosecutor_review": "PREF_YES", "public_reporter": "PREF_YES", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_YES" },
|
|
14482
|
+
"case_close": { "AUD": "NA", "CIRO": "NA", "DATA-ADM": "NA", "GOV-AUD": "NA", "MEM-ADM": "ALWAYS", "PLT-ADM": "NA", "SUP": "ALWAYS", "TEAM-ADM": "PREF_YES", "behavioral_health_provider": "NA", "case_nav": "ALWAYS", "crisis_response": "NA", "healthcare_provider_medical": "NA", "intel_analyst": "NA", "investigator": "NA", "le_liaison_vsp": "NA", "legal_advocate": "NA", "mandatory_reporter": "NA", "mdt_participant": "NA", "prosecutor_review": "NA", "public_reporter": "NA", "research_analytics": "NA", "screener": "NA", "volunteer": "NA" },
|
|
14483
|
+
"case_collaborator_add": { "case_nav": "NA", "investigator": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA" },
|
|
14484
|
+
"case_edit": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "PREF_YES", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
14485
|
+
"case_reopen": { "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "investigator": "ALWAYS", "le_liaison_vsp": "NEVER", "research_analytics": "NA", "screener": "NEVER", "volunteer": "PREF_NO" },
|
|
14486
|
+
"case_side_panel_use": { "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mdt_participant": "PREF_YES", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_NO" },
|
|
14487
|
+
"case_status_manage": { "SUP": "PREF_YES", "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
14488
|
+
"case_transfer_bulk": { "MEM-ADM": "PREF_YES", "PLT-ADM": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "PREF_NO", "research_analytics": "NA" },
|
|
14489
|
+
"case_view": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "PREF_YES", "mdt_participant": "PREF_YES", "prosecutor_review": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "NEVER" },
|
|
14490
|
+
"case_visibility_manage": { "MEM-ADM": "ALWAYS", "SUP": "ALWAYS", "case_nav": "NA", "intel_analyst": "PREF_NO", "investigator": "ALWAYS", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
14491
|
+
"ci_periodic_review": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
14492
|
+
"ci_record_purge_or_retire": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
14493
|
+
"ci_record_validate": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
14494
|
+
"ci_to_evidence_export_authorize": { "CIRO": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
14495
|
+
"deconfliction_alert_acknowledge": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
14496
|
+
"deconfliction_unmask": { "case_nav": "NA", "intel_analyst": "PREF_YES", "investigator": "ALWAYS", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
14497
|
+
"determination_perform": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "PREF_YES", "crisis_response": "NEVER", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "NEVER", "legal_advocate": "PREF_YES", "research_analytics": "NA", "screener": "NEVER", "volunteer": "NEVER" },
|
|
14498
|
+
"disclose_external_request": { "CIRO": "PREF_YES", "PLT-ADM": "ALWAYS", "case_nav": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS" },
|
|
14499
|
+
"enrollment_manage": { "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_NO", "volunteer": "PREF_NO" },
|
|
14500
|
+
"exit_discharge_conduct": { "case_nav": "ALWAYS", "crisis_response": "PREF_NO", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "NEVER", "volunteer": "NEVER" },
|
|
14501
|
+
"export_deidentified": { "DATA-ADM": "PREF_YES", "PLT-ADM": "ALWAYS", "research_analytics": "PREF_YES" },
|
|
14502
|
+
"goals_plan_manage": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_NO", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "volunteer": "PREF_NO" },
|
|
14503
|
+
"idb_record_create": { "PLT-ADM": "ALWAYS", "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
14504
|
+
"indicator_manual_add": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "PREF_YES", "investigator": "PREF_YES", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
14505
|
+
"investigation_create_claim": { "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
14506
|
+
"investigation_session_run": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "PREF_YES", "research_analytics": "NA" },
|
|
14507
|
+
"investigative_database_search": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
14508
|
+
"investigative_request_send": { "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
14509
|
+
"lead_create": { "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
14510
|
+
"lead_publish": { "case_nav": "NA", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
14511
|
+
"lead_route_assign": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
14512
|
+
"lead_triage_manage": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
14513
|
+
"magic_link_share_send": { "PLT-ADM": "NA", "case_nav": "PREF_YES", "crisis_response": "PREF_YES", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "PREF_NO", "volunteer": "PREF_NO" },
|
|
14514
|
+
"mandatory_report_send": { "MEM-ADM": "PREF_YES", "PLT-ADM": "NA", "SUP": "PREF_YES", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "mandatory_reporter": "ALWAYS", "public_reporter": "PREF_NO", "screener": "PREF_NO", "volunteer": "PREF_NO" },
|
|
14515
|
+
"member_account_report_generate": { "DATA-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "research_analytics": "PREF_YES" },
|
|
14516
|
+
"member_onboarding_support": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "research_analytics": "NA" },
|
|
14517
|
+
"message_moderate": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS" },
|
|
14518
|
+
"message_send": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "mandatory_reporter": "ALWAYS", "mdt_participant": "ALWAYS", "prosecutor_review": "ALWAYS", "public_reporter": "PREF_NO", "research_analytics": "ALWAYS", "screener": "ALWAYS", "volunteer": "PREF_YES" },
|
|
14519
|
+
"milestone_log": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA" },
|
|
14520
|
+
"needs_priorities_conduct": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_YES" },
|
|
14521
|
+
"network_corpus_access": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
14522
|
+
"note_open_departed_author": { "MEM-ADM": "PREF_NO" },
|
|
14523
|
+
"onboarding_config_sign_off": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS" },
|
|
14524
|
+
"open_source_search": { "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "ALWAYS" },
|
|
14525
|
+
"person_association_update": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "research_analytics": "NA", "screener": "PREF_YES" },
|
|
14526
|
+
"person_merge_manage": { "PLT-ADM": "ALWAYS", "case_nav": "NA", "intel_analyst": "ALWAYS", "investigator": "PREF_YES", "research_analytics": "NA", "volunteer": "NEVER" },
|
|
14527
|
+
"platform_perm_modify": { "PLT-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
14528
|
+
"profile_domain_edit": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
14529
|
+
"record_activity_view": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "PREF_YES", "legal_advocate": "ALWAYS", "mdt_participant": "PREF_YES", "prosecutor_review": "ALWAYS", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_NO" },
|
|
14530
|
+
"record_print": { "CIRO": "PREF_YES", "PLT-ADM": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "investigator": "ALWAYS", "le_liaison_vsp": "NEVER", "legal_advocate": "ALWAYS", "prosecutor_review": "ALWAYS", "research_analytics": "ALWAYS", "screener": "PREF_NO", "volunteer": "NEVER" },
|
|
14531
|
+
"referral_receive_external": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "PREF_YES", "investigator": "PREF_YES", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mandatory_reporter": "PREF_YES", "mdt_participant": "PREF_YES", "prosecutor_review": "ALWAYS", "public_reporter": "PREF_YES", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_YES" },
|
|
14532
|
+
"referral_receive_internal": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "PREF_NO", "healthcare_provider_medical": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
14533
|
+
"referral_send_external": { "PLT-ADM": "NA", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "le_liaison_vsp": "ALWAYS", "mandatory_reporter": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_YES" },
|
|
14534
|
+
"referral_send_internal": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "le_liaison_vsp": "ALWAYS", "mandatory_reporter": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "ALWAYS" },
|
|
14535
|
+
"roi_submit_manage": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "mdt_participant": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "ALWAYS" },
|
|
14536
|
+
"role_assign": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NA", "TEAM-ADM": "PREF_NO", "research_analytics": "NA" },
|
|
14537
|
+
"roles_accounts_toggle": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS" },
|
|
14538
|
+
"sandbox_environment_manage": { "PLT-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
14539
|
+
"screening_conduct": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "PREF_YES", "crisis_response": "PREF_YES", "healthcare_provider_medical": "ALWAYS", "legal_advocate": "PREF_YES", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_YES" },
|
|
14540
|
+
"screening_view": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "PREF_NO", "healthcare_provider_medical": "ALWAYS", "le_liaison_vsp": "NEVER", "prosecutor_review": "NEVER", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "NEVER" },
|
|
14541
|
+
"service_log_manage": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "legal_advocate": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "PREF_YES" },
|
|
14542
|
+
"session_create": { "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "ALWAYS", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "ALWAYS", "legal_advocate": "ALWAYS", "mandatory_reporter": "ALWAYS", "mdt_participant": "ALWAYS", "prosecutor_review": "ALWAYS", "public_reporter": "ALWAYS", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "ALWAYS" },
|
|
14543
|
+
"share_config": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "PREF_YES", "SUP": "NEVER", "TEAM-ADM": "NEVER", "research_analytics": "NA" },
|
|
14544
|
+
"share_revoke": { "PLT-ADM": "ALWAYS", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_YES", "le_liaison_vsp": "PREF_YES", "legal_advocate": "ALWAYS", "mdt_participant": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_NO", "volunteer": "PREF_NO" },
|
|
14545
|
+
"share_rule_approve_cross_agency": { "GOV-AUD": "PREF_YES", "PLT-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
14546
|
+
"share_vsp_to_le": { "PLT-ADM": "ALWAYS", "case_nav": "PREF_YES", "crisis_response": "NA", "le_liaison_vsp": "ALWAYS", "research_analytics": "NA", "screener": "NEVER", "volunteer": "NEVER" },
|
|
14547
|
+
"srl_manage": { "DATA-ADM": "PREF_YES", "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "TEAM-ADM": "PREF_YES" },
|
|
14548
|
+
"supervisee_thread_view": { "PLT-ADM": "ALWAYS", "SUP": "ALWAYS", "TEAM-ADM": "PREF_YES", "case_nav": "NA" },
|
|
14549
|
+
"support_ticket_triage": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
14550
|
+
"system_diagnostics_view": { "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "case_nav": "NA" },
|
|
14551
|
+
"team_config_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "NEVER", "research_analytics": "NA" },
|
|
14552
|
+
"team_membership_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NA", "TEAM-ADM": "ALWAYS", "case_nav": "NA", "research_analytics": "NA" },
|
|
14553
|
+
"team_share_narrowing": { "MEM-ADM": "ALWAYS", "SUP": "PREF_NO", "TEAM-ADM": "PREF_YES", "research_analytics": "NA" },
|
|
14554
|
+
"team_workflow_config_manage": { "MEM-ADM": "ALWAYS", "TEAM-ADM": "PREF_YES", "research_analytics": "NA" },
|
|
14555
|
+
"training_gate_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "PLT-SUP": "PREF_YES", "SUP": "NA", "TEAM-ADM": "PREF_YES", "TRAIN-ADM": "ALWAYS", "research_analytics": "NA" },
|
|
14556
|
+
"usr_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "NEVER", "TEAM-ADM": "PREF_NO", "research_analytics": "NA" },
|
|
14557
|
+
"viewing_config_manage": { "MEM-ADM": "ALWAYS", "PLT-ADM": "ALWAYS", "SUP": "PREF_YES" },
|
|
14558
|
+
"viewing_level_1_search": { "PLT-ADM": "NA", "behavioral_health_provider": "ALWAYS", "case_nav": "ALWAYS", "crisis_response": "ALWAYS", "healthcare_provider_medical": "PREF_YES", "intel_analyst": "ALWAYS", "investigator": "ALWAYS", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_YES", "mandatory_reporter": "PREF_NO", "mdt_participant": "PREF_YES", "prosecutor_review": "PREF_YES", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "PREF_NO" },
|
|
14559
|
+
"viewing_level_2_autocomplete": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_YES", "case_nav": "ALWAYS", "crisis_response": "PREF_YES", "healthcare_provider_medical": "PREF_NO", "intel_analyst": "PREF_YES", "investigator": "ALWAYS", "le_liaison_vsp": "PREF_YES", "legal_advocate": "PREF_NO", "mandatory_reporter": "NEVER", "mdt_participant": "PREF_NO", "prosecutor_review": "PREF_NO", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "ALWAYS", "volunteer": "NEVER" },
|
|
14560
|
+
"viewing_level_3_components": { "PLT-ADM": "NA", "behavioral_health_provider": "PREF_NO", "case_nav": "PREF_YES", "crisis_response": "PREF_NO", "healthcare_provider_medical": "PREF_NO", "intel_analyst": "PREF_NO", "investigator": "PREF_YES", "le_liaison_vsp": "PREF_NO", "legal_advocate": "PREF_NO", "mandatory_reporter": "NEVER", "mdt_participant": "PREF_NO", "prosecutor_review": "PREF_NO", "public_reporter": "NEVER", "research_analytics": "NA", "screener": "PREF_YES", "volunteer": "NEVER" }
|
|
14561
|
+
};
|
|
14562
|
+
|
|
14563
|
+
// src/authz/defaultBounds.ts
|
|
14564
|
+
function codebookDefaultBound(functionCode, roleCode) {
|
|
14565
|
+
if (!Object.hasOwn(CORE_FUNCTION_DEFAULT_BOUNDS, functionCode)) return null;
|
|
14566
|
+
const roles = CORE_FUNCTION_DEFAULT_BOUNDS[functionCode];
|
|
14567
|
+
return Object.hasOwn(roles, roleCode) ? roles[roleCode] : null;
|
|
14568
|
+
}
|
|
14569
|
+
|
|
14570
|
+
// src/generated/sharingPlatformStarter.ts
|
|
14571
|
+
var SHARING_PLATFORM_STARTER_SOURCE = {
|
|
14572
|
+
"monolith": {
|
|
14573
|
+
"repo": "htilabstech/prototype",
|
|
14574
|
+
"file": "HTI-LEADS-PAVE-Thread-prototype.html",
|
|
14575
|
+
"sha": "d85f05b7",
|
|
14576
|
+
"lines": [
|
|
14577
|
+
326475,
|
|
14578
|
+
326543
|
|
14579
|
+
]
|
|
14580
|
+
},
|
|
14581
|
+
"mirror": {
|
|
14582
|
+
"repo": "htilabstech/platform-prototype",
|
|
14583
|
+
"file": "src/data.js",
|
|
14584
|
+
"sha": "a6f1f3a5",
|
|
14585
|
+
"starterLines": [
|
|
14586
|
+
38170,
|
|
14587
|
+
38190
|
|
14588
|
+
],
|
|
14589
|
+
"purposeLines": [
|
|
14590
|
+
32450,
|
|
14591
|
+
32531
|
|
14592
|
+
]
|
|
14593
|
+
},
|
|
14594
|
+
"fieldPlacements": {
|
|
14595
|
+
"repo": "htilabstech/prototype",
|
|
14596
|
+
"file": "docs/share-roi/information_scope_v4.fields.csv",
|
|
14597
|
+
"sha": "d85f05b7"
|
|
14598
|
+
}
|
|
14599
|
+
};
|
|
14600
|
+
var SHARING_PLATFORM_STARTER_DATA = {
|
|
14601
|
+
scopeVersion: 4,
|
|
14602
|
+
scopeByPurpose: {
|
|
14603
|
+
"referral": ["identifying", "contact", "services", "system", "summary_needs_assessment"],
|
|
14604
|
+
"case_collaboration": ["identifying", "risk", "contact", "services", "notes", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "summary_needs_assessment"],
|
|
14605
|
+
"deconfliction": ["identifying", "system"],
|
|
14606
|
+
"mandatory_reporting": ["identifying", "risk", "contact", "services", "notes", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "summary_needs_assessment", "offenders.identifying", "offenders.risk", "relationships_household", "family"],
|
|
14607
|
+
"discretionary_share": ["identifying", "system"],
|
|
14608
|
+
"authority_reporting": ["identifying", "risk", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "offenders.identifying", "offenders.risk", "relationships_household", "family"],
|
|
14609
|
+
"automatic_account_share": ["identifying", "system"],
|
|
14610
|
+
"records_request": ["identifying", "system"]
|
|
14611
|
+
},
|
|
14612
|
+
counterpartyOverrides: {
|
|
14613
|
+
"palomar": {
|
|
14614
|
+
"case_collaboration": ["identifying", "risk", "contact", "services", "notes", "health_accommodation", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "summary_mental_health_screen", "summary_behavioral_health_intake", "summary_trauma_and_coping_screen", "summary_needs_assessment"]
|
|
14615
|
+
},
|
|
14616
|
+
"okcpd": {
|
|
14617
|
+
"mandatory_reporting": ["identifying", "risk", "contact", "services", "notes", "system", "summary_initial_screen", "summary_lap", "summary_danger_assessment", "summary_stalking_assessment", "summary_injury_and_strangulation", "summary_ae_intake", "summary_tra", "summary_needs_assessment", "offenders.identifying", "offenders.risk", "relationships_household", "family"],
|
|
14618
|
+
"referral": ["identifying", "contact", "services", "system", "summary_needs_assessment"]
|
|
14619
|
+
},
|
|
14620
|
+
"legal_aid_ok": {
|
|
14621
|
+
"referral": ["identifying", "contact", "services", "notes", "system", "summary_needs_assessment"]
|
|
14622
|
+
}
|
|
14623
|
+
},
|
|
14624
|
+
purposeEnabled: {
|
|
14625
|
+
"referral": true,
|
|
14626
|
+
"case_collaboration": true,
|
|
14627
|
+
"deconfliction": true,
|
|
14628
|
+
"mandatory_reporting": true,
|
|
14629
|
+
"discretionary_share": true,
|
|
14630
|
+
"authority_reporting": true,
|
|
14631
|
+
"automatic_account_share": true,
|
|
14632
|
+
"records_request": false
|
|
14633
|
+
},
|
|
14634
|
+
fieldHomeRows: [
|
|
14635
|
+
"accommodation_needs",
|
|
14636
|
+
"ad_content",
|
|
14637
|
+
"additional_ids",
|
|
14638
|
+
"addresses",
|
|
14639
|
+
"case_attachments",
|
|
14640
|
+
"case_determinations",
|
|
14641
|
+
"case_lifecycle",
|
|
14642
|
+
"case_notes",
|
|
14643
|
+
"commercial_activity",
|
|
14644
|
+
"contact_info",
|
|
14645
|
+
"demographics",
|
|
14646
|
+
"derived_risk_signals",
|
|
14647
|
+
"dob",
|
|
14648
|
+
"encounter_location",
|
|
14649
|
+
"family.health_accommodation",
|
|
14650
|
+
"family.identifying",
|
|
14651
|
+
"family.risk",
|
|
14652
|
+
"full_ae_intake",
|
|
14653
|
+
"full_behavioral_health_intake",
|
|
14654
|
+
"full_danger_assessment",
|
|
14655
|
+
"full_findings",
|
|
14656
|
+
"full_hope_scale",
|
|
14657
|
+
"full_ida",
|
|
14658
|
+
"full_initial_screen",
|
|
14659
|
+
"full_injury_and_strangulation",
|
|
14660
|
+
"full_lap",
|
|
14661
|
+
"full_mental_health_screen",
|
|
14662
|
+
"full_needs_assessment",
|
|
14663
|
+
"full_stalking_assessment",
|
|
14664
|
+
"full_tra",
|
|
14665
|
+
"full_trauma_and_coping_screen",
|
|
14666
|
+
"health_status",
|
|
14667
|
+
"identifying",
|
|
14668
|
+
"immigration_applications",
|
|
14669
|
+
"immigration_status",
|
|
14670
|
+
"instruments",
|
|
14671
|
+
"names",
|
|
14672
|
+
"network_membership",
|
|
14673
|
+
"object_identity_attributes",
|
|
14674
|
+
"offenders.risk",
|
|
14675
|
+
"others.risk",
|
|
14676
|
+
"persona_links",
|
|
14677
|
+
"phone_identifiers",
|
|
14678
|
+
"plans_goals",
|
|
14679
|
+
"priorities_safety",
|
|
14680
|
+
"relationships_household",
|
|
14681
|
+
"screen_indicators",
|
|
14682
|
+
"service_history",
|
|
14683
|
+
"session_summary",
|
|
14684
|
+
"summary_ae_intake",
|
|
14685
|
+
"summary_behavioral_health_intake",
|
|
14686
|
+
"summary_danger_assessment",
|
|
14687
|
+
"summary_findings",
|
|
14688
|
+
"summary_hope_scale",
|
|
14689
|
+
"summary_ida",
|
|
14690
|
+
"summary_initial_screen",
|
|
14691
|
+
"summary_injury_and_strangulation",
|
|
14692
|
+
"summary_lap",
|
|
14693
|
+
"summary_mental_health_screen",
|
|
14694
|
+
"summary_needs_assessment",
|
|
14695
|
+
"summary_stalking_assessment",
|
|
14696
|
+
"summary_tra",
|
|
14697
|
+
"summary_trauma_and_coping_screen",
|
|
14698
|
+
"system",
|
|
14699
|
+
"system_involvement",
|
|
14700
|
+
"victimization"
|
|
14701
|
+
]
|
|
14702
|
+
};
|
|
14703
|
+
|
|
14704
|
+
// src/sharingCeiling/starter.ts
|
|
14705
|
+
var SHARING_CEILING_SCOPE_VERSION = 4;
|
|
14706
|
+
function freezeLists(lists) {
|
|
14707
|
+
const out = {};
|
|
14708
|
+
for (const [purpose, codes] of Object.entries(lists)) out[purpose] = Object.freeze([...codes]);
|
|
14709
|
+
return Object.freeze(out);
|
|
14710
|
+
}
|
|
14711
|
+
var HTI_SHARE_PLATFORM_STARTER = Object.freeze({
|
|
14712
|
+
scopeVersion: SHARING_CEILING_SCOPE_VERSION,
|
|
14713
|
+
scopeByPurpose: freezeLists(SHARING_PLATFORM_STARTER_DATA.scopeByPurpose),
|
|
14714
|
+
counterpartyOverrides: Object.freeze(
|
|
14715
|
+
Object.fromEntries(
|
|
14716
|
+
Object.entries(SHARING_PLATFORM_STARTER_DATA.counterpartyOverrides).map(([cp, lists]) => [
|
|
14717
|
+
cp,
|
|
14718
|
+
freezeLists(lists)
|
|
14719
|
+
])
|
|
14720
|
+
)
|
|
14721
|
+
)
|
|
14722
|
+
});
|
|
14723
|
+
var HTI_SHARE_PLATFORM_PURPOSE_ENABLED = Object.freeze({
|
|
14724
|
+
...SHARING_PLATFORM_STARTER_DATA.purposeEnabled
|
|
14725
|
+
});
|
|
14726
|
+
var INFORMATION_SCOPE_FIELD_HOME_ROWS = new Set(
|
|
14727
|
+
SHARING_PLATFORM_STARTER_DATA.fieldHomeRows
|
|
14728
|
+
);
|
|
14729
|
+
var HTI_SHARE_PLATFORM_STARTER_SOURCE = SHARING_PLATFORM_STARTER_SOURCE;
|
|
14730
|
+
|
|
14731
|
+
// src/sharingCeiling/chain.ts
|
|
14732
|
+
var SHARING_CEILING_DEFAULT_ROW_KEY = "__default__";
|
|
14733
|
+
var SHARING_CEILING_EXTERNAL_ROW_KEY = "__external__";
|
|
14734
|
+
var own2 = (record, key) => record !== null && typeof record === "object" && Object.prototype.hasOwnProperty.call(record, key) ? record[key] : void 0;
|
|
14735
|
+
var isStringList = (v) => Array.isArray(v) && v.every((c) => typeof c === "string");
|
|
14736
|
+
function sharingCeilingCellList(cell) {
|
|
14737
|
+
if (cell.scopeVersion === SHARING_CEILING_SCOPE_VERSION && isStringList(cell.informationScope)) {
|
|
14738
|
+
return [...cell.informationScope];
|
|
14739
|
+
}
|
|
14740
|
+
return [];
|
|
14741
|
+
}
|
|
14742
|
+
var sameSet = (a, b) => {
|
|
14743
|
+
const sa = new Set(a);
|
|
14744
|
+
const sb = new Set(b);
|
|
14745
|
+
return sa.size === sb.size && [...sa].every((c) => sb.has(c));
|
|
14746
|
+
};
|
|
14747
|
+
function sharingScopeEditsFromCells(cells) {
|
|
14748
|
+
const byRow = /* @__PURE__ */ new Map();
|
|
14749
|
+
if (cells === null || cells === void 0 || typeof cells[Symbol.iterator] !== "function") {
|
|
14750
|
+
return {};
|
|
14751
|
+
}
|
|
14752
|
+
for (const cell of cells) {
|
|
14753
|
+
if (cell === null || typeof cell !== "object") continue;
|
|
14754
|
+
const { rowKey, purpose } = cell;
|
|
14755
|
+
if (typeof rowKey !== "string" || rowKey === "" || typeof purpose !== "string" || purpose === "") continue;
|
|
14756
|
+
const list = sharingCeilingCellList(cell);
|
|
14757
|
+
const row = byRow.get(rowKey) ?? /* @__PURE__ */ new Map();
|
|
14758
|
+
const prior = row.get(purpose);
|
|
14759
|
+
row.set(purpose, prior === void 0 || sameSet(prior, list) ? list : []);
|
|
14760
|
+
byRow.set(rowKey, row);
|
|
14761
|
+
}
|
|
14762
|
+
return Object.fromEntries([...byRow].map(([k, row]) => [k, Object.fromEntries(row)]));
|
|
14763
|
+
}
|
|
14764
|
+
function rungList(value) {
|
|
14765
|
+
if (value === void 0 || value === null) return void 0;
|
|
14766
|
+
return isStringList(value) ? [...value] : [];
|
|
14767
|
+
}
|
|
14768
|
+
function isSharingPurposeDisabled(purpose, purposeOverrides, purposeEnabled) {
|
|
14769
|
+
const override = own2(purposeOverrides, purpose);
|
|
14770
|
+
if (override === false) return true;
|
|
14771
|
+
const callerRow = own2(purposeEnabled, purpose);
|
|
14772
|
+
const enabled = typeof callerRow === "boolean" ? callerRow : own2(HTI_SHARE_PLATFORM_PURPOSE_ENABLED, purpose);
|
|
14773
|
+
return enabled === false && override !== true;
|
|
14774
|
+
}
|
|
14775
|
+
function sharingCeilingRowKey(recipient) {
|
|
14776
|
+
if (recipient.external === true) return SHARING_CEILING_EXTERNAL_ROW_KEY;
|
|
14777
|
+
const id = recipient.id;
|
|
14778
|
+
if (typeof id !== "string" || id === "") {
|
|
14779
|
+
throw new TypeError("sharing ceiling: an on-platform recipient needs a partner id");
|
|
14780
|
+
}
|
|
14781
|
+
if (id === SHARING_CEILING_DEFAULT_ROW_KEY || id === SHARING_CEILING_EXTERNAL_ROW_KEY) {
|
|
14782
|
+
throw new RangeError(`sharing ceiling: "${id}" is a reserved row key, not a partner id`);
|
|
14783
|
+
}
|
|
14784
|
+
return id;
|
|
14785
|
+
}
|
|
14786
|
+
function effectiveCeiling(rowKey, purpose, inputs) {
|
|
14787
|
+
if (typeof rowKey !== "string" || rowKey === "") {
|
|
14788
|
+
throw new TypeError("sharing ceiling: rowKey must be a partner id or __external__");
|
|
14789
|
+
}
|
|
14790
|
+
if (rowKey === SHARING_CEILING_DEFAULT_ROW_KEY) {
|
|
14791
|
+
throw new RangeError("sharing ceiling: __default__ is the account default, not a recipient row key");
|
|
14792
|
+
}
|
|
14793
|
+
if (typeof purpose !== "string" || purpose === "") {
|
|
14794
|
+
throw new TypeError("sharing ceiling: purpose must be a share purpose code");
|
|
14795
|
+
}
|
|
14796
|
+
const starter = inputs.starter ?? HTI_SHARE_PLATFORM_STARTER;
|
|
14797
|
+
if (isSharingPurposeDisabled(purpose, inputs.purposeOverrides, inputs.purposeEnabled)) {
|
|
14798
|
+
return { allowed: [], rung: "purpose_disabled", disabled: true };
|
|
14799
|
+
}
|
|
14800
|
+
const edits = inputs.edits;
|
|
14801
|
+
const rungs = [
|
|
14802
|
+
["partner_rule", own2(own2(edits, rowKey), purpose)],
|
|
14803
|
+
["seeded_partner_rule", own2(own2(starter.counterpartyOverrides, rowKey), purpose)],
|
|
14804
|
+
["account_default", own2(own2(edits, SHARING_CEILING_DEFAULT_ROW_KEY), purpose)],
|
|
14805
|
+
["platform_default", own2(starter.scopeByPurpose, purpose)]
|
|
14806
|
+
];
|
|
14807
|
+
for (const [rung, value] of rungs) {
|
|
14808
|
+
const allowed = rungList(value);
|
|
14809
|
+
if (allowed !== void 0) return { allowed, rung, disabled: false };
|
|
14810
|
+
}
|
|
14811
|
+
return { allowed: [], rung: "none", disabled: false };
|
|
14812
|
+
}
|
|
14813
|
+
|
|
14814
|
+
// src/sharingCeiling/coverage.ts
|
|
14815
|
+
var factsCache = /* @__PURE__ */ new WeakMap();
|
|
14816
|
+
function memoize(fn) {
|
|
14817
|
+
const memo = /* @__PURE__ */ new Map();
|
|
14818
|
+
return (code) => {
|
|
14819
|
+
if (memo.has(code)) return memo.get(code);
|
|
14820
|
+
const out = fn(code);
|
|
14821
|
+
memo.set(code, out);
|
|
14822
|
+
return out;
|
|
14823
|
+
};
|
|
14824
|
+
}
|
|
14825
|
+
function treeFacts(scope) {
|
|
14826
|
+
const hit = factsCache.get(scope);
|
|
14827
|
+
if (hit) return hit;
|
|
14828
|
+
const systemPath = scope.ancestorsOf(INFORMATION_SCOPE_SYSTEM_INFO);
|
|
14829
|
+
const systemRoot = systemPath.length > 0 ? systemPath[systemPath.length - 1] : void 0;
|
|
14830
|
+
const isLive = memoize(
|
|
14831
|
+
(code) => scope.row(code) !== void 0 && scope.ancestorsOf(code).every((c) => scope.row(c)?.status !== "retired")
|
|
14832
|
+
);
|
|
14833
|
+
const isSystem = memoize(
|
|
14834
|
+
(code) => systemRoot !== void 0 && scope.ancestorsOf(code).includes(systemRoot)
|
|
14835
|
+
);
|
|
14836
|
+
const underFloor = memoize(
|
|
14837
|
+
(code) => scope.ancestorsOf(code).some((c) => scope.row(c)?.platformFloor === true)
|
|
14838
|
+
);
|
|
14839
|
+
const isCoverageRow = memoize((code) => isLive(code) && !isSystem(code) && !underFloor(code));
|
|
14840
|
+
const coverageChildren = memoize(
|
|
14841
|
+
(code) => Object.freeze(scope.childrenOf(code).filter(isCoverageRow))
|
|
14842
|
+
);
|
|
14843
|
+
const hasOwnContent = memoize((code) => {
|
|
14844
|
+
const row = scope.row(code);
|
|
14845
|
+
if (row === void 0) return false;
|
|
14846
|
+
const homed = INFORMATION_SCOPE_FIELD_HOME_ROWS.has(code) || row.kindRow !== void 0 && INFORMATION_SCOPE_FIELD_HOME_ROWS.has(row.kindRow);
|
|
14847
|
+
if (!homed) return false;
|
|
14848
|
+
return !scope.childrenOf(code).some((c) => scope.row(c)?.rowType === "category_rest" && isLive(c));
|
|
14849
|
+
});
|
|
14850
|
+
const facts = {
|
|
14851
|
+
isLive,
|
|
14852
|
+
isSystem,
|
|
14853
|
+
underFloor,
|
|
14854
|
+
isCoverageRow,
|
|
14855
|
+
coverageChildren,
|
|
14856
|
+
hasOwnContent
|
|
14857
|
+
};
|
|
14858
|
+
factsCache.set(scope, facts);
|
|
14859
|
+
return facts;
|
|
14860
|
+
}
|
|
14861
|
+
function asCeilingSet(allowed) {
|
|
14862
|
+
if (allowed === null) return null;
|
|
14863
|
+
if (allowed instanceof Set) return allowed;
|
|
14864
|
+
if (Array.isArray(allowed)) {
|
|
14865
|
+
return new Set(allowed.filter((c) => typeof c === "string"));
|
|
14866
|
+
}
|
|
14867
|
+
return /* @__PURE__ */ new Set();
|
|
14868
|
+
}
|
|
14869
|
+
function isCeilingCoverageRow(scope, code) {
|
|
14870
|
+
return treeFacts(scope).isCoverageRow(code);
|
|
14871
|
+
}
|
|
14872
|
+
function hasOwnScopeContent(scope, code) {
|
|
14873
|
+
return treeFacts(scope).hasOwnContent(code);
|
|
14874
|
+
}
|
|
14875
|
+
function ceilingCoverage(scope, allowed) {
|
|
14876
|
+
const facts = treeFacts(scope);
|
|
14877
|
+
const set = asCeilingSet(allowed);
|
|
14878
|
+
const memo = /* @__PURE__ */ new Map();
|
|
14879
|
+
const within = (code) => {
|
|
14880
|
+
const hit = memo.get(code);
|
|
14881
|
+
if (hit !== void 0) return hit;
|
|
14882
|
+
let out;
|
|
14883
|
+
if (!facts.isLive(code)) out = false;
|
|
14884
|
+
else if (set === null) out = true;
|
|
14885
|
+
else if (scope.ancestorsOf(code).some((c) => set.has(c))) out = true;
|
|
14886
|
+
else if (facts.hasOwnContent(code)) out = false;
|
|
14887
|
+
else {
|
|
14888
|
+
const kids = facts.coverageChildren(code);
|
|
14889
|
+
out = kids.length > 0 && kids.every(within);
|
|
14890
|
+
}
|
|
14891
|
+
memo.set(code, out);
|
|
14892
|
+
return out;
|
|
14893
|
+
};
|
|
14894
|
+
return within;
|
|
14895
|
+
}
|
|
14896
|
+
function scopeRowWithinCeiling(scope, allowed, code) {
|
|
14897
|
+
return ceilingCoverage(scope, allowed)(code);
|
|
14898
|
+
}
|
|
14899
|
+
function rowsOverCeiling(scope, declared, allowed) {
|
|
14900
|
+
const facts = treeFacts(scope);
|
|
14901
|
+
const within = ceilingCoverage(scope, allowed);
|
|
14902
|
+
const out = [];
|
|
14903
|
+
for (const code of new Set(Array.isArray(declared) ? declared : [])) {
|
|
14904
|
+
if (code === INFORMATION_SCOPE_SYSTEM_INFO) continue;
|
|
14905
|
+
if (!facts.isLive(code)) {
|
|
14906
|
+
out.push(code);
|
|
14907
|
+
continue;
|
|
14908
|
+
}
|
|
14909
|
+
if (facts.isSystem(code) || facts.underFloor(code)) continue;
|
|
14910
|
+
if (!within(code)) out.push(code);
|
|
14911
|
+
}
|
|
14912
|
+
return out;
|
|
14913
|
+
}
|
|
14914
|
+
function walkCeiling(scope, allowed) {
|
|
14915
|
+
const facts = treeFacts(scope);
|
|
14916
|
+
if (asCeilingSet(allowed) === null) return { outside: [], expanded: [] };
|
|
14917
|
+
const within = ceilingCoverage(scope, allowed);
|
|
14918
|
+
const holdsMemo = /* @__PURE__ */ new Map();
|
|
14919
|
+
const holdsWithin = (code) => {
|
|
14920
|
+
const hit = holdsMemo.get(code);
|
|
14921
|
+
if (hit !== void 0) return hit;
|
|
14922
|
+
const out = scope.childrenOf(code).some((c) => facts.isCoverageRow(c) && within(c) || holdsWithin(c));
|
|
14923
|
+
holdsMemo.set(code, out);
|
|
14924
|
+
return out;
|
|
14925
|
+
};
|
|
14926
|
+
const outside = [];
|
|
14927
|
+
const expanded = [];
|
|
14928
|
+
const visit = (code) => {
|
|
14929
|
+
if (!facts.isLive(code) || within(code)) return;
|
|
14930
|
+
if (!holdsWithin(code)) {
|
|
14931
|
+
outside.push(code);
|
|
14932
|
+
return;
|
|
14933
|
+
}
|
|
14934
|
+
if (facts.hasOwnContent(code)) expanded.push(code);
|
|
14935
|
+
for (const child of scope.childrenOf(code)) visit(child);
|
|
14936
|
+
};
|
|
14937
|
+
for (const r of scope.rows) {
|
|
14938
|
+
if (r.parentScopeCode !== null && r.parentScopeCode !== "") continue;
|
|
14939
|
+
if (facts.isSystem(r.scopeCode)) continue;
|
|
14940
|
+
visit(r.scopeCode);
|
|
14941
|
+
}
|
|
14942
|
+
return { outside, expanded };
|
|
14943
|
+
}
|
|
14944
|
+
function rowsOutsideCeiling(scope, allowed) {
|
|
14945
|
+
return walkCeiling(scope, allowed).outside;
|
|
14946
|
+
}
|
|
14947
|
+
function rowsExpandedByCeiling(scope, allowed) {
|
|
14948
|
+
return walkCeiling(scope, allowed).expanded;
|
|
14949
|
+
}
|
|
14950
|
+
function withSystemInfo(codes) {
|
|
14951
|
+
return [.../* @__PURE__ */ new Set([INFORMATION_SCOPE_SYSTEM_INFO, ...codes])];
|
|
14952
|
+
}
|
|
14953
|
+
function subtractRow(scope, selection, code) {
|
|
14954
|
+
const path = scope.ancestorsOf(code);
|
|
14955
|
+
let sel = selection.filter((c) => !scope.ancestorsOf(c).includes(code));
|
|
14956
|
+
for (; ; ) {
|
|
14957
|
+
const coverAt = path.findIndex((c, i) => i > 0 && sel.includes(c));
|
|
14958
|
+
if (coverAt === -1) break;
|
|
14959
|
+
sel = sel.filter((c) => c !== path[coverAt]);
|
|
14960
|
+
for (let i = coverAt; i >= 1; i -= 1) {
|
|
14961
|
+
const parent = path[i];
|
|
14962
|
+
const onPath = path[i - 1];
|
|
14963
|
+
for (const child of scope.childrenOf(parent)) {
|
|
14964
|
+
if (child !== onPath && !sel.includes(child)) sel.push(child);
|
|
14965
|
+
}
|
|
14966
|
+
}
|
|
14967
|
+
}
|
|
14968
|
+
return sel;
|
|
14969
|
+
}
|
|
14970
|
+
function maskSelectionToCeiling(scope, selection, allowed) {
|
|
14971
|
+
const facts = treeFacts(scope);
|
|
14972
|
+
const { outside, expanded } = walkCeiling(scope, allowed);
|
|
14973
|
+
let sel = (Array.isArray(selection) ? selection : []).filter(
|
|
14974
|
+
(c) => typeof c === "string" && facts.isLive(c)
|
|
14975
|
+
);
|
|
14976
|
+
for (const code of expanded) {
|
|
14977
|
+
if (!scope.ancestorsOf(code).some((c) => sel.includes(c))) continue;
|
|
14978
|
+
sel = subtractRow(scope, sel, code);
|
|
14979
|
+
for (const child of scope.childrenOf(code)) if (!sel.includes(child)) sel.push(child);
|
|
14980
|
+
}
|
|
14981
|
+
for (const code of outside) sel = subtractRow(scope, sel, code);
|
|
14982
|
+
return withSystemInfo(sel.filter((c) => facts.isLive(c)));
|
|
14983
|
+
}
|
|
14984
|
+
|
|
14423
14985
|
// src/validation/cvc.ts
|
|
14424
14986
|
var import_zod = require("zod");
|
|
14425
14987
|
var CvcCodeSchema = import_zod.z.string().regex(/^\d{3}(-\d{3}){6}$/);
|
|
@@ -63687,6 +64249,8 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
63687
64249
|
BIRTH_LOCATION_VALUES,
|
|
63688
64250
|
BasisQuickPicksKeys,
|
|
63689
64251
|
CALLER_IS_VICTIM_ROLES,
|
|
64252
|
+
CORE_FUNCTION_DEFAULT_BOUNDS,
|
|
64253
|
+
CORE_FUNCTION_DEFAULT_BOUNDS_SOT_VERSION,
|
|
63690
64254
|
CVC_100_LABELS,
|
|
63691
64255
|
CVC_100_LIVES_RURAL,
|
|
63692
64256
|
CVC_100_VALUES,
|
|
@@ -63861,6 +64425,10 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
63861
64425
|
DATA_QUALITY_DESCRIPTIONS,
|
|
63862
64426
|
DATA_QUALITY_LABELS,
|
|
63863
64427
|
DATA_QUALITY_VALUES,
|
|
64428
|
+
DEFAULT_BOUND_STATE,
|
|
64429
|
+
DEFAULT_BOUND_STATE_DISPLAY,
|
|
64430
|
+
DEFAULT_BOUND_STATE_LABELS,
|
|
64431
|
+
DEFAULT_BOUND_STATE_VALUES,
|
|
63864
64432
|
DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY,
|
|
63865
64433
|
DaIncidentArchiveReasonKeys,
|
|
63866
64434
|
DaIncidentConfidenceKeys,
|
|
@@ -63899,6 +64467,9 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
63899
64467
|
GoalStatusKeys,
|
|
63900
64468
|
GoalWithdrawalReasonKeys,
|
|
63901
64469
|
HEALTHCARE_ORG_TYPE_KEYS,
|
|
64470
|
+
HTI_SHARE_PLATFORM_PURPOSE_ENABLED,
|
|
64471
|
+
HTI_SHARE_PLATFORM_STARTER,
|
|
64472
|
+
HTI_SHARE_PLATFORM_STARTER_SOURCE,
|
|
63902
64473
|
HairColorKeys,
|
|
63903
64474
|
HasTattoosKeys,
|
|
63904
64475
|
HighestEducationLevelCompletedKeys,
|
|
@@ -63967,6 +64538,7 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
63967
64538
|
INCIDENT_PARTICIPATION_ROLE_LABELS,
|
|
63968
64539
|
INCIDENT_PARTICIPATION_ROLE_SUPERSEDED_BY,
|
|
63969
64540
|
INCIDENT_PARTICIPATION_ROLE_VALUES,
|
|
64541
|
+
INFORMATION_SCOPE_FIELD_HOME_ROWS,
|
|
63970
64542
|
INFORMATION_SCOPE_POLICY_VERSION_ROW_NOTE,
|
|
63971
64543
|
INFORMATION_SCOPE_READABLE_VERSIONS,
|
|
63972
64544
|
INFORMATION_SCOPE_SYSTEM_INFO,
|
|
@@ -64089,6 +64661,9 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64089
64661
|
SHARE_VIEW,
|
|
64090
64662
|
SHARE_VIEW_LABELS,
|
|
64091
64663
|
SHARE_VIEW_VALUES,
|
|
64664
|
+
SHARING_CEILING_DEFAULT_ROW_KEY,
|
|
64665
|
+
SHARING_CEILING_EXTERNAL_ROW_KEY,
|
|
64666
|
+
SHARING_CEILING_SCOPE_VERSION,
|
|
64092
64667
|
SUBMISSION_STATES,
|
|
64093
64668
|
SUBMISSION_STATE_LABELS,
|
|
64094
64669
|
ServiceAudienceKeys,
|
|
@@ -64182,6 +64757,7 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64182
64757
|
carCorrectionReasonSot,
|
|
64183
64758
|
cascadeExclusions,
|
|
64184
64759
|
caseShareStateSot,
|
|
64760
|
+
ceilingCoverage,
|
|
64185
64761
|
checkInActivitySot,
|
|
64186
64762
|
checkInPhaseSot,
|
|
64187
64763
|
childBehavioralConcernsSot,
|
|
@@ -64189,6 +64765,7 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64189
64765
|
childCustodyArrangementSot,
|
|
64190
64766
|
choiceSchema,
|
|
64191
64767
|
citizenshipSot,
|
|
64768
|
+
codebookDefaultBound,
|
|
64192
64769
|
collectionContextSot,
|
|
64193
64770
|
compileCvcEntryModel,
|
|
64194
64771
|
compileCvcRegistryModel,
|
|
@@ -64223,6 +64800,7 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64223
64800
|
determinationLevelSot,
|
|
64224
64801
|
disabilitySubtypeSot,
|
|
64225
64802
|
discretionLevelSot,
|
|
64803
|
+
effectiveCeiling,
|
|
64226
64804
|
emailSchema,
|
|
64227
64805
|
emergencyContactCallReasonSot,
|
|
64228
64806
|
emergencyContactPermissionsSot,
|
|
@@ -64262,6 +64840,7 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64262
64840
|
goalWithdrawalReasonSot,
|
|
64263
64841
|
guidanceSchema,
|
|
64264
64842
|
hairColorSot,
|
|
64843
|
+
hasOwnScopeContent,
|
|
64265
64844
|
hasTattoosSot,
|
|
64266
64845
|
highestEducationLevelCompletedSot,
|
|
64267
64846
|
hivStatusSot,
|
|
@@ -64285,6 +64864,7 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64285
64864
|
investigativeRequestTypeSot,
|
|
64286
64865
|
isAgencyTypeKey,
|
|
64287
64866
|
isCanonEvaluableFunction,
|
|
64867
|
+
isCeilingCoverageRow,
|
|
64288
64868
|
isDeprecatedCoreIndicator,
|
|
64289
64869
|
isDeprecatedIncidentParticipationRole,
|
|
64290
64870
|
isHealthcareOrgType,
|
|
@@ -64301,6 +64881,7 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64301
64881
|
isScopeInstrumentRow,
|
|
64302
64882
|
isScopeRestRow,
|
|
64303
64883
|
isSelectableScopeRow,
|
|
64884
|
+
isSharingPurposeDisabled,
|
|
64304
64885
|
isStructuredNameType,
|
|
64305
64886
|
isTransgenderGenderIdentity,
|
|
64306
64887
|
isVictimServingOrgType,
|
|
@@ -64314,6 +64895,7 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64314
64895
|
livingSituationSot,
|
|
64315
64896
|
locationTypeSot,
|
|
64316
64897
|
maritalStatusLegalSot,
|
|
64898
|
+
maskSelectionToCeiling,
|
|
64317
64899
|
mentalHealthStatusSot,
|
|
64318
64900
|
messageReportReasonSot,
|
|
64319
64901
|
midStayEventTypeSot,
|
|
@@ -64393,8 +64975,12 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64393
64975
|
roiStatusSot,
|
|
64394
64976
|
roleContextSot,
|
|
64395
64977
|
romanticRelationshipChangeTypeSot,
|
|
64978
|
+
rowsExpandedByCeiling,
|
|
64979
|
+
rowsOutsideCeiling,
|
|
64980
|
+
rowsOverCeiling,
|
|
64396
64981
|
rsvpResponseSot,
|
|
64397
64982
|
scopeMigrationsFromSot,
|
|
64983
|
+
scopeRowWithinCeiling,
|
|
64398
64984
|
scopeRowsFromSot,
|
|
64399
64985
|
scoringConditionSchema,
|
|
64400
64986
|
scoringRecommendationSchema,
|
|
@@ -64422,6 +65008,9 @@ var CVC_197_VALUES = selectableCodes(
|
|
|
64422
65008
|
sexProviderSubroleSot,
|
|
64423
65009
|
sharePurposeSot,
|
|
64424
65010
|
shareResponseReasonSot,
|
|
65011
|
+
sharingCeilingCellList,
|
|
65012
|
+
sharingCeilingRowKey,
|
|
65013
|
+
sharingScopeEditsFromCells,
|
|
64425
65014
|
signatureMethodSot,
|
|
64426
65015
|
signatureTypeSot,
|
|
64427
65016
|
smtBodyLocationSot,
|