@htilabs/platform-common-models 0.1.0-beta.0 → 0.1.0-beta.1
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 +45 -0
- package/dist/constants/index.cjs.map +1 -1
- package/dist/constants/index.d.cts +35 -1
- package/dist/constants/index.d.ts +35 -1
- package/dist/constants/index.js +42 -0
- package/dist/constants/index.js.map +1 -1
- package/dist/index.cjs +45 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +42 -0
- package/dist/index.js.map +1 -1
- package/dist/schemas/index.cjs +33 -0
- package/dist/schemas/index.cjs.map +1 -1
- package/dist/schemas/index.js +33 -0
- package/dist/schemas/index.js.map +1 -1
- package/package.json +1 -1
- package/src/constants/ic.ts +58 -0
package/src/constants/ic.ts
CHANGED
|
@@ -463,6 +463,11 @@ export const IC_49_DESCRIPTIONS: Record<IC49Value, string> = {
|
|
|
463
463
|
// ─── IC-56: Service Delivery Channel (Contact Method) ───────────────
|
|
464
464
|
|
|
465
465
|
export const IC_56_SERVICE_DELIVERY_CHANNEL = {
|
|
466
|
+
// Level 0 — Missingness (same pattern as IC-49)
|
|
467
|
+
DATA_NOT_COLLECTED: -2,
|
|
468
|
+
ANONYMOUS: -1,
|
|
469
|
+
UNKNOWN: 0,
|
|
470
|
+
// Level 1 — Actual delivery channels
|
|
466
471
|
IN_PERSON: 1,
|
|
467
472
|
ON_SCENE: 2,
|
|
468
473
|
PHONE: 3,
|
|
@@ -473,7 +478,13 @@ export const IC_56_SERVICE_DELIVERY_CHANNEL = {
|
|
|
473
478
|
export type IC56Value =
|
|
474
479
|
(typeof IC_56_SERVICE_DELIVERY_CHANNEL)[keyof typeof IC_56_SERVICE_DELIVERY_CHANNEL];
|
|
475
480
|
|
|
481
|
+
/** Level 1 values only (excludes missingness codes). */
|
|
482
|
+
export type IC56ChannelValue = 1 | 2 | 3 | 4 | 5;
|
|
483
|
+
|
|
476
484
|
export const IC_56_LABELS: Record<IC56Value, string> = {
|
|
485
|
+
[IC_56_SERVICE_DELIVERY_CHANNEL.DATA_NOT_COLLECTED]: "Data Not Collected",
|
|
486
|
+
[IC_56_SERVICE_DELIVERY_CHANNEL.ANONYMOUS]: "Anonymous",
|
|
487
|
+
[IC_56_SERVICE_DELIVERY_CHANNEL.UNKNOWN]: "Unknown",
|
|
477
488
|
[IC_56_SERVICE_DELIVERY_CHANNEL.IN_PERSON]: "In Person",
|
|
478
489
|
[IC_56_SERVICE_DELIVERY_CHANNEL.ON_SCENE]: "On-scene",
|
|
479
490
|
[IC_56_SERVICE_DELIVERY_CHANNEL.PHONE]: "Phone",
|
|
@@ -482,6 +493,11 @@ export const IC_56_LABELS: Record<IC56Value, string> = {
|
|
|
482
493
|
};
|
|
483
494
|
|
|
484
495
|
export const IC_56_DESCRIPTIONS: Record<IC56Value, string> = {
|
|
496
|
+
[IC_56_SERVICE_DELIVERY_CHANNEL.DATA_NOT_COLLECTED]:
|
|
497
|
+
"Contact method data was not collected",
|
|
498
|
+
[IC_56_SERVICE_DELIVERY_CHANNEL.ANONYMOUS]:
|
|
499
|
+
"Client is anonymous — contact method not trackable",
|
|
500
|
+
[IC_56_SERVICE_DELIVERY_CHANNEL.UNKNOWN]: "Contact method unknown",
|
|
485
501
|
[IC_56_SERVICE_DELIVERY_CHANNEL.IN_PERSON]:
|
|
486
502
|
"Office / shelter / clinic / other in-person setting",
|
|
487
503
|
[IC_56_SERVICE_DELIVERY_CHANNEL.ON_SCENE]:
|
|
@@ -492,6 +508,48 @@ export const IC_56_DESCRIPTIONS: Record<IC56Value, string> = {
|
|
|
492
508
|
[IC_56_SERVICE_DELIVERY_CHANNEL.VIRTUAL]: "Virtual / video call",
|
|
493
509
|
};
|
|
494
510
|
|
|
511
|
+
/**
|
|
512
|
+
* Check if an IC-56 code is a missingness value (Level 0).
|
|
513
|
+
* @param code - The IC-56 code
|
|
514
|
+
* @returns True if the code represents a missingness state
|
|
515
|
+
*/
|
|
516
|
+
export function isIC56Missingness(code: number): boolean {
|
|
517
|
+
return code <= 0;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Check if an IC-56 code is a valid service delivery channel (Level 1).
|
|
522
|
+
* @param code - The IC-56 code
|
|
523
|
+
* @returns True if the code represents an actual delivery channel
|
|
524
|
+
*/
|
|
525
|
+
export function isIC56ValidChannel(code: number): code is IC56ChannelValue {
|
|
526
|
+
return code >= 1 && code <= 5;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/** Options array for dropdown/radio components (Level 1 only). */
|
|
530
|
+
export const IC_56_OPTIONS = [
|
|
531
|
+
{
|
|
532
|
+
value: IC_56_SERVICE_DELIVERY_CHANNEL.IN_PERSON,
|
|
533
|
+
label: IC_56_LABELS[IC_56_SERVICE_DELIVERY_CHANNEL.IN_PERSON],
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
value: IC_56_SERVICE_DELIVERY_CHANNEL.ON_SCENE,
|
|
537
|
+
label: IC_56_LABELS[IC_56_SERVICE_DELIVERY_CHANNEL.ON_SCENE],
|
|
538
|
+
},
|
|
539
|
+
{
|
|
540
|
+
value: IC_56_SERVICE_DELIVERY_CHANNEL.PHONE,
|
|
541
|
+
label: IC_56_LABELS[IC_56_SERVICE_DELIVERY_CHANNEL.PHONE],
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
value: IC_56_SERVICE_DELIVERY_CHANNEL.EMAIL_TEXT_CHAT,
|
|
545
|
+
label: IC_56_LABELS[IC_56_SERVICE_DELIVERY_CHANNEL.EMAIL_TEXT_CHAT],
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
value: IC_56_SERVICE_DELIVERY_CHANNEL.VIRTUAL,
|
|
549
|
+
label: IC_56_LABELS[IC_56_SERVICE_DELIVERY_CHANNEL.VIRTUAL],
|
|
550
|
+
},
|
|
551
|
+
] as const;
|
|
552
|
+
|
|
495
553
|
// ─── IC-57: Service Audience / Beneficiary ──────────────────────────
|
|
496
554
|
|
|
497
555
|
export const IC_57_SERVICE_AUDIENCE = {
|