@htilabs/platform-common-models 0.4.0-beta.2 → 0.5.2-beta.3
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/dist/constants/index.cjs +18 -9
- 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 +18 -9
- package/dist/constants/index.js.map +1 -1
- package/dist/cvcs/index.cjs +461 -0
- package/dist/cvcs/index.cjs.map +1 -1
- package/dist/cvcs/index.d.cts +529 -26
- package/dist/cvcs/index.d.ts +529 -26
- package/dist/cvcs/index.js +458 -0
- package/dist/cvcs/index.js.map +1 -1
- package/dist/index.cjs +534 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +70 -3
- package/dist/index.d.ts +70 -3
- package/dist/index.js +528 -9
- package/dist/index.js.map +1 -1
- package/dist/{platform-auth-C-G2qeGM.d.cts → platform-auth-CjC57132.d.cts} +10 -7
- package/dist/{platform-auth-C-G2qeGM.d.ts → platform-auth-CjC57132.d.ts} +10 -7
- package/dist/schemas/index.cjs +16 -7
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.js +16 -7
- package/dist/schemas/index.js.map +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/__tests__/__snapshots__/cvc-sot.snap +12 -0
- package/src/__tests__/cvc-sot-snapshot.test.ts +20 -0
- package/src/__tests__/cvc-structural.test.ts +3 -0
- package/src/constants/ic.ts +24 -14
- package/src/cvcs/incidentInvolvementRoles.v1.0.0.json +105 -0
- package/src/cvcs/incidentParticipationRoles.v1.0.0.json +202 -0
- package/src/cvcs/index.ts +6 -0
- package/src/cvcs/raceEthnicity.v1.0.0.json +142 -0
- package/src/generated/cvc-enums.ts +73 -0
|
@@ -398,11 +398,11 @@ declare const INCIDENT_INVOLVEMENT_ROLE: {
|
|
|
398
398
|
readonly OFFENDER: "offender";
|
|
399
399
|
readonly UNKNOWN: "unknown";
|
|
400
400
|
readonly ANONYMOUS: "anonymous";
|
|
401
|
-
readonly
|
|
401
|
+
readonly DATA_NOT_COLLECTED: "data_not_collected";
|
|
402
402
|
};
|
|
403
403
|
type IncidentInvolvementRoleValue = (typeof INCIDENT_INVOLVEMENT_ROLE)[keyof typeof INCIDENT_INVOLVEMENT_ROLE];
|
|
404
404
|
declare const INCIDENT_INVOLVEMENT_ROLE_LABELS: Record<IncidentInvolvementRoleValue, string>;
|
|
405
|
-
/** Involvement roles available for selection in Thread UI (excludes victim_other and
|
|
405
|
+
/** Involvement roles available for selection in Thread UI (excludes victim_other and data_not_collected). */
|
|
406
406
|
declare const THREAD_INVOLVEMENT_ROLES: readonly ["victim_primary", "victim_secondary", "dependent", "witness", "offender", "unknown", "anonymous"];
|
|
407
407
|
declare const PERSON_ROLES: {
|
|
408
408
|
readonly VICTIM_CLIENT: "Victim / Client";
|
|
@@ -629,17 +629,20 @@ declare const INCIDENT_PARTICIPATION_ROLE: {
|
|
|
629
629
|
readonly FRIEND_OR_PEER: "friend_or_peer";
|
|
630
630
|
readonly SERVICE_PROVIDER_STAFF: "service_provider_staff";
|
|
631
631
|
readonly MEDICAL_PROVIDER_STAFF: "medical_provider_staff";
|
|
632
|
+
readonly DATA_ENTRY: "data_entry";
|
|
633
|
+
readonly OTHER_INCIDENT_RESPONDER: "other_incident_responder";
|
|
634
|
+
readonly RESPONDING_OFFICER: "responding_officer";
|
|
632
635
|
readonly UNKNOWN: "unknown";
|
|
633
636
|
readonly ANONYMOUS: "anonymous";
|
|
634
|
-
readonly
|
|
637
|
+
readonly DATA_NOT_COLLECTED: "data_not_collected";
|
|
635
638
|
};
|
|
636
639
|
type IncidentParticipationRoleValue = (typeof INCIDENT_PARTICIPATION_ROLE)[keyof typeof INCIDENT_PARTICIPATION_ROLE];
|
|
637
|
-
declare const INCIDENT_PARTICIPATION_ROLE_VALUES: readonly ["client_subject", "caller_self", "caller_third_party", "reporter", "family_member_or_guardian", "friend_or_peer", "service_provider_staff", "medical_provider_staff", "unknown", "anonymous", "
|
|
640
|
+
declare const INCIDENT_PARTICIPATION_ROLE_VALUES: readonly ["client_subject", "caller_self", "caller_third_party", "reporter", "family_member_or_guardian", "friend_or_peer", "service_provider_staff", "medical_provider_staff", "data_entry", "other_incident_responder", "responding_officer", "unknown", "anonymous", "data_not_collected"];
|
|
638
641
|
declare const INCIDENT_PARTICIPATION_ROLE_LABELS: Record<IncidentParticipationRoleValue, string>;
|
|
639
642
|
/**
|
|
640
643
|
* Participation role category groupings for UI organization.
|
|
641
644
|
*
|
|
642
|
-
* Note: UNKNOWN, ANONYMOUS, and
|
|
645
|
+
* Note: UNKNOWN, ANONYMOUS, and DATA_NOT_COLLECTED are intentionally excluded.
|
|
643
646
|
* These are data quality states, not selectable participation roles.
|
|
644
647
|
* Handle them via separate UI controls (e.g., "Unknown" / "Anonymous" buttons).
|
|
645
648
|
*/
|
|
@@ -672,7 +675,7 @@ declare const PERSON_TYPE_VALUES: readonly ["ProtectedPerson", "PerpetratorPerso
|
|
|
672
675
|
/**
|
|
673
676
|
* Static mapping from involvement role to person type.
|
|
674
677
|
*
|
|
675
|
-
* Note: Returns `null` for UNKNOWN and
|
|
678
|
+
* Note: Returns `null` for UNKNOWN and DATA_NOT_COLLECTED because these roles
|
|
676
679
|
* require contextual handling. For these cases, use `getPersonTypeForRole()`
|
|
677
680
|
* which applies conditional logic (e.g., preserving Personnel context).
|
|
678
681
|
*
|
|
@@ -682,7 +685,7 @@ declare const INVOLVEMENT_ROLE_TO_PERSON_TYPE: Record<IncidentInvolvementRoleVal
|
|
|
682
685
|
/**
|
|
683
686
|
* Get the person type for an involvement role.
|
|
684
687
|
* For 'unknown', preserves PersonnelPerson if provided as context, otherwise defaults to ThirdPartyPerson.
|
|
685
|
-
* Returns null for '
|
|
688
|
+
* Returns null for 'data_not_collected' (data quality state — cannot infer person type).
|
|
686
689
|
*/
|
|
687
690
|
declare function getPersonTypeForRole(role: IncidentInvolvementRoleValue, contextPersonType?: PersonTypeValue): PersonTypeValue | null;
|
|
688
691
|
/**
|
|
@@ -398,11 +398,11 @@ declare const INCIDENT_INVOLVEMENT_ROLE: {
|
|
|
398
398
|
readonly OFFENDER: "offender";
|
|
399
399
|
readonly UNKNOWN: "unknown";
|
|
400
400
|
readonly ANONYMOUS: "anonymous";
|
|
401
|
-
readonly
|
|
401
|
+
readonly DATA_NOT_COLLECTED: "data_not_collected";
|
|
402
402
|
};
|
|
403
403
|
type IncidentInvolvementRoleValue = (typeof INCIDENT_INVOLVEMENT_ROLE)[keyof typeof INCIDENT_INVOLVEMENT_ROLE];
|
|
404
404
|
declare const INCIDENT_INVOLVEMENT_ROLE_LABELS: Record<IncidentInvolvementRoleValue, string>;
|
|
405
|
-
/** Involvement roles available for selection in Thread UI (excludes victim_other and
|
|
405
|
+
/** Involvement roles available for selection in Thread UI (excludes victim_other and data_not_collected). */
|
|
406
406
|
declare const THREAD_INVOLVEMENT_ROLES: readonly ["victim_primary", "victim_secondary", "dependent", "witness", "offender", "unknown", "anonymous"];
|
|
407
407
|
declare const PERSON_ROLES: {
|
|
408
408
|
readonly VICTIM_CLIENT: "Victim / Client";
|
|
@@ -629,17 +629,20 @@ declare const INCIDENT_PARTICIPATION_ROLE: {
|
|
|
629
629
|
readonly FRIEND_OR_PEER: "friend_or_peer";
|
|
630
630
|
readonly SERVICE_PROVIDER_STAFF: "service_provider_staff";
|
|
631
631
|
readonly MEDICAL_PROVIDER_STAFF: "medical_provider_staff";
|
|
632
|
+
readonly DATA_ENTRY: "data_entry";
|
|
633
|
+
readonly OTHER_INCIDENT_RESPONDER: "other_incident_responder";
|
|
634
|
+
readonly RESPONDING_OFFICER: "responding_officer";
|
|
632
635
|
readonly UNKNOWN: "unknown";
|
|
633
636
|
readonly ANONYMOUS: "anonymous";
|
|
634
|
-
readonly
|
|
637
|
+
readonly DATA_NOT_COLLECTED: "data_not_collected";
|
|
635
638
|
};
|
|
636
639
|
type IncidentParticipationRoleValue = (typeof INCIDENT_PARTICIPATION_ROLE)[keyof typeof INCIDENT_PARTICIPATION_ROLE];
|
|
637
|
-
declare const INCIDENT_PARTICIPATION_ROLE_VALUES: readonly ["client_subject", "caller_self", "caller_third_party", "reporter", "family_member_or_guardian", "friend_or_peer", "service_provider_staff", "medical_provider_staff", "unknown", "anonymous", "
|
|
640
|
+
declare const INCIDENT_PARTICIPATION_ROLE_VALUES: readonly ["client_subject", "caller_self", "caller_third_party", "reporter", "family_member_or_guardian", "friend_or_peer", "service_provider_staff", "medical_provider_staff", "data_entry", "other_incident_responder", "responding_officer", "unknown", "anonymous", "data_not_collected"];
|
|
638
641
|
declare const INCIDENT_PARTICIPATION_ROLE_LABELS: Record<IncidentParticipationRoleValue, string>;
|
|
639
642
|
/**
|
|
640
643
|
* Participation role category groupings for UI organization.
|
|
641
644
|
*
|
|
642
|
-
* Note: UNKNOWN, ANONYMOUS, and
|
|
645
|
+
* Note: UNKNOWN, ANONYMOUS, and DATA_NOT_COLLECTED are intentionally excluded.
|
|
643
646
|
* These are data quality states, not selectable participation roles.
|
|
644
647
|
* Handle them via separate UI controls (e.g., "Unknown" / "Anonymous" buttons).
|
|
645
648
|
*/
|
|
@@ -672,7 +675,7 @@ declare const PERSON_TYPE_VALUES: readonly ["ProtectedPerson", "PerpetratorPerso
|
|
|
672
675
|
/**
|
|
673
676
|
* Static mapping from involvement role to person type.
|
|
674
677
|
*
|
|
675
|
-
* Note: Returns `null` for UNKNOWN and
|
|
678
|
+
* Note: Returns `null` for UNKNOWN and DATA_NOT_COLLECTED because these roles
|
|
676
679
|
* require contextual handling. For these cases, use `getPersonTypeForRole()`
|
|
677
680
|
* which applies conditional logic (e.g., preserving Personnel context).
|
|
678
681
|
*
|
|
@@ -682,7 +685,7 @@ declare const INVOLVEMENT_ROLE_TO_PERSON_TYPE: Record<IncidentInvolvementRoleVal
|
|
|
682
685
|
/**
|
|
683
686
|
* Get the person type for an involvement role.
|
|
684
687
|
* For 'unknown', preserves PersonnelPerson if provided as context, otherwise defaults to ThirdPartyPerson.
|
|
685
|
-
* Returns null for '
|
|
688
|
+
* Returns null for 'data_not_collected' (data quality state — cannot infer person type).
|
|
686
689
|
*/
|
|
687
690
|
declare function getPersonTypeForRole(role: IncidentInvolvementRoleValue, contextPersonType?: PersonTypeValue): PersonTypeValue | null;
|
|
688
691
|
/**
|
package/dist/schemas/index.cjs
CHANGED
|
@@ -526,7 +526,7 @@ var INCIDENT_INVOLVEMENT_ROLE = {
|
|
|
526
526
|
OFFENDER: "offender",
|
|
527
527
|
UNKNOWN: "unknown",
|
|
528
528
|
ANONYMOUS: "anonymous",
|
|
529
|
-
|
|
529
|
+
DATA_NOT_COLLECTED: "data_not_collected"
|
|
530
530
|
};
|
|
531
531
|
var INCIDENT_INVOLVEMENT_ROLE_LABELS = {
|
|
532
532
|
[INCIDENT_INVOLVEMENT_ROLE.VICTIM_PRIMARY]: "Primary Victim",
|
|
@@ -537,7 +537,7 @@ var INCIDENT_INVOLVEMENT_ROLE_LABELS = {
|
|
|
537
537
|
[INCIDENT_INVOLVEMENT_ROLE.OFFENDER]: "Offender",
|
|
538
538
|
[INCIDENT_INVOLVEMENT_ROLE.UNKNOWN]: "Unknown",
|
|
539
539
|
[INCIDENT_INVOLVEMENT_ROLE.ANONYMOUS]: "Anonymous",
|
|
540
|
-
[INCIDENT_INVOLVEMENT_ROLE.
|
|
540
|
+
[INCIDENT_INVOLVEMENT_ROLE.DATA_NOT_COLLECTED]: "Not Collected"
|
|
541
541
|
};
|
|
542
542
|
var THREAD_INVOLVEMENT_ROLES = [
|
|
543
543
|
INCIDENT_INVOLVEMENT_ROLE.VICTIM_PRIMARY,
|
|
@@ -565,7 +565,7 @@ var INCIDENT_INVOLVEMENT_ROLE_TO_PERSON_ROLE = {
|
|
|
565
565
|
[INCIDENT_INVOLVEMENT_ROLE.OFFENDER]: PERSON_ROLES.OFFENDER,
|
|
566
566
|
[INCIDENT_INVOLVEMENT_ROLE.UNKNOWN]: PERSON_ROLES.OTHER,
|
|
567
567
|
[INCIDENT_INVOLVEMENT_ROLE.ANONYMOUS]: PERSON_ROLES.OTHER,
|
|
568
|
-
[INCIDENT_INVOLVEMENT_ROLE.
|
|
568
|
+
[INCIDENT_INVOLVEMENT_ROLE.DATA_NOT_COLLECTED]: PERSON_ROLES.OTHER
|
|
569
569
|
};
|
|
570
570
|
var IC_4_AGE_TYPE = {
|
|
571
571
|
EXACT_DOB: 1,
|
|
@@ -885,9 +885,12 @@ var INCIDENT_PARTICIPATION_ROLE = {
|
|
|
885
885
|
FRIEND_OR_PEER: "friend_or_peer",
|
|
886
886
|
SERVICE_PROVIDER_STAFF: "service_provider_staff",
|
|
887
887
|
MEDICAL_PROVIDER_STAFF: "medical_provider_staff",
|
|
888
|
+
DATA_ENTRY: "data_entry",
|
|
889
|
+
OTHER_INCIDENT_RESPONDER: "other_incident_responder",
|
|
890
|
+
RESPONDING_OFFICER: "responding_officer",
|
|
888
891
|
UNKNOWN: "unknown",
|
|
889
892
|
ANONYMOUS: "anonymous",
|
|
890
|
-
|
|
893
|
+
DATA_NOT_COLLECTED: "data_not_collected"
|
|
891
894
|
};
|
|
892
895
|
var INCIDENT_PARTICIPATION_ROLE_VALUES = [
|
|
893
896
|
INCIDENT_PARTICIPATION_ROLE.CLIENT_SUBJECT,
|
|
@@ -898,9 +901,12 @@ var INCIDENT_PARTICIPATION_ROLE_VALUES = [
|
|
|
898
901
|
INCIDENT_PARTICIPATION_ROLE.FRIEND_OR_PEER,
|
|
899
902
|
INCIDENT_PARTICIPATION_ROLE.SERVICE_PROVIDER_STAFF,
|
|
900
903
|
INCIDENT_PARTICIPATION_ROLE.MEDICAL_PROVIDER_STAFF,
|
|
904
|
+
INCIDENT_PARTICIPATION_ROLE.DATA_ENTRY,
|
|
905
|
+
INCIDENT_PARTICIPATION_ROLE.OTHER_INCIDENT_RESPONDER,
|
|
906
|
+
INCIDENT_PARTICIPATION_ROLE.RESPONDING_OFFICER,
|
|
901
907
|
INCIDENT_PARTICIPATION_ROLE.UNKNOWN,
|
|
902
908
|
INCIDENT_PARTICIPATION_ROLE.ANONYMOUS,
|
|
903
|
-
INCIDENT_PARTICIPATION_ROLE.
|
|
909
|
+
INCIDENT_PARTICIPATION_ROLE.DATA_NOT_COLLECTED
|
|
904
910
|
];
|
|
905
911
|
var INCIDENT_PARTICIPATION_ROLE_LABELS = {
|
|
906
912
|
[INCIDENT_PARTICIPATION_ROLE.CLIENT_SUBJECT]: "Client / Subject-of-Record",
|
|
@@ -911,9 +917,12 @@ var INCIDENT_PARTICIPATION_ROLE_LABELS = {
|
|
|
911
917
|
[INCIDENT_PARTICIPATION_ROLE.FRIEND_OR_PEER]: "Friend or Peer",
|
|
912
918
|
[INCIDENT_PARTICIPATION_ROLE.SERVICE_PROVIDER_STAFF]: "Service Provider Staff",
|
|
913
919
|
[INCIDENT_PARTICIPATION_ROLE.MEDICAL_PROVIDER_STAFF]: "Medical Provider Staff",
|
|
920
|
+
[INCIDENT_PARTICIPATION_ROLE.DATA_ENTRY]: "Data Entry / Editor",
|
|
921
|
+
[INCIDENT_PARTICIPATION_ROLE.OTHER_INCIDENT_RESPONDER]: "VSP or Other Incident Responder",
|
|
922
|
+
[INCIDENT_PARTICIPATION_ROLE.RESPONDING_OFFICER]: "LE Responding Officer",
|
|
914
923
|
[INCIDENT_PARTICIPATION_ROLE.UNKNOWN]: "Unknown",
|
|
915
924
|
[INCIDENT_PARTICIPATION_ROLE.ANONYMOUS]: "Anonymous",
|
|
916
|
-
[INCIDENT_PARTICIPATION_ROLE.
|
|
925
|
+
[INCIDENT_PARTICIPATION_ROLE.DATA_NOT_COLLECTED]: "Not Collected"
|
|
917
926
|
};
|
|
918
927
|
var PARTICIPATION_ROLE_CATEGORIES = {
|
|
919
928
|
CLIENT: [INCIDENT_PARTICIPATION_ROLE.CLIENT_SUBJECT],
|
|
@@ -973,7 +982,7 @@ var INVOLVEMENT_ROLE_TO_PERSON_TYPE = {
|
|
|
973
982
|
[INCIDENT_INVOLVEMENT_ROLE.UNKNOWN]: null,
|
|
974
983
|
// Conditional — use getPersonTypeForRole()
|
|
975
984
|
[INCIDENT_INVOLVEMENT_ROLE.ANONYMOUS]: PERSON_TYPE.THIRD_PARTY,
|
|
976
|
-
[INCIDENT_INVOLVEMENT_ROLE.
|
|
985
|
+
[INCIDENT_INVOLVEMENT_ROLE.DATA_NOT_COLLECTED]: null
|
|
977
986
|
};
|
|
978
987
|
var DEFAULT_PARTICIPATION_ROLE_BY_CATEGORY = {
|
|
979
988
|
[PERSON_DISPLAY_CATEGORY.PRIMARY_VICTIM]: INCIDENT_PARTICIPATION_ROLE.CLIENT_SUBJECT,
|