gdc-common-utils-ts 2.9.0 → 2.9.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/README.md CHANGED
@@ -530,9 +530,9 @@ The canonical API contract should live in JSDoc on exported code. The README act
530
530
  - [`buildFhirIpsCreatorProvenance(...)`](src/utils/fhir-ips-creator-identity.ts)
531
531
  and [`docs/101-DIDCOMM-IDENTITY-BOUNDARY.md`](docs/101-DIDCOMM-IDENTITY-BOUNDARY.md)
532
532
  - Keep `Composition.author`, `Composition.attester`, DIDComm sender and
533
- signing key separate. A member-created fact may use the registered
534
- RelatedPerson as both author and personal attester; a dictated
535
- individual-created fact keeps the individual as author.
533
+ signing key separate. The organization, EHR/portal or individual remains
534
+ the document author; a registered PractitionerRole or RelatedPerson is the
535
+ attester, including for content entered by that authenticated person.
536
536
  - [`src/examples/frontend-session.ts`](src/examples/frontend-session.ts)
537
537
  - Frontend profile/session bootstrap examples.
538
538
  - [`src/examples/lifecycle.ts`](src/examples/lifecycle.ts)
@@ -1732,6 +1732,8 @@ export declare const HealthcareActorRoles: Readonly<{
1732
1732
  /** ISCO-08 laboratory occupation for human medical/pathology work. */
1733
1733
  readonly MedicalAndPathologyLaboratoryTechnician: "ISCO-08|3212";
1734
1734
  readonly VeterinaryTechnicianOrAssistant: "ISCO-08|3240";
1735
+ /** General receptionist occupation usable across human, animal and one-health organizations. */
1736
+ readonly Receptionist: "ISCO-08|4226";
1735
1737
  /** Administrative health occupation; it does not imply clinical authority. */
1736
1738
  readonly MedicalSecretary: "ISCO-08|3344";
1737
1739
  }>;
@@ -1757,6 +1759,7 @@ export declare const HealthcareActorRoleCodes: Readonly<{
1757
1759
  readonly LifeScienceTechnician: "3141";
1758
1760
  readonly MedicalAndPathologyLaboratoryTechnician: "3212";
1759
1761
  readonly VeterinaryTechnicianOrAssistant: "3240";
1762
+ readonly Receptionist: "4226";
1760
1763
  readonly MedicalSecretary: "3344";
1761
1764
  }>;
1762
1765
  export declare const HealthcareRolesByFamily: Readonly<{
@@ -1790,19 +1793,19 @@ export declare const HealthcareRolesByFamily: Readonly<{
1790
1793
  }>;
1791
1794
  export declare const HealthcareAllRolesByClaim: Readonly<Record<string, HealthcareActorRoleDescriptor>>;
1792
1795
  export declare const HealthcareProfessionalRoleCodesBySector: Readonly<{
1793
- readonly "health-care": readonly ("RESPRSN" | "221" | "2211" | "2212" | "2221" | "2222" | "2240" | "3344")[];
1794
- readonly "health-research": readonly ("RESPRSN" | "221" | "2211" | "2212" | "3344")[];
1795
- readonly "health-lab": readonly ("RESPRSN" | "221" | "2212" | "3212" | "3344")[];
1796
- readonly "health-tech": readonly "RESPRSN"[];
1797
- readonly "health-insurance": readonly "RESPRSN"[];
1798
- readonly "animal-care": readonly ("RESPRSN" | "2250" | "3240")[];
1799
- readonly "animal-research": readonly ("RESPRSN" | "2250" | "3240")[];
1800
- readonly "animal-lab": readonly ("RESPRSN" | "2250" | "3141" | "3240")[];
1801
- readonly "animal-insurance": readonly "RESPRSN"[];
1802
- readonly "animal-tech": readonly "RESPRSN"[];
1803
- readonly "onehealth-research": readonly ("RESPRSN" | "221" | "2211" | "2212" | "2250" | "3240" | "3344")[];
1804
- readonly "onehealth-lab": readonly ("RESPRSN" | "221" | "2212" | "2250" | "3141" | "3212" | "3240" | "3344")[];
1805
- readonly "onehealth-tech": readonly "RESPRSN"[];
1796
+ readonly "health-care": readonly ("RESPRSN" | "221" | "2211" | "2212" | "2221" | "2222" | "2240" | "4226" | "3344")[];
1797
+ readonly "health-research": readonly ("RESPRSN" | "221" | "2211" | "2212" | "4226" | "3344")[];
1798
+ readonly "health-lab": readonly ("RESPRSN" | "221" | "2212" | "3212" | "4226" | "3344")[];
1799
+ readonly "health-tech": readonly ("RESPRSN" | "4226")[];
1800
+ readonly "health-insurance": readonly ("RESPRSN" | "4226")[];
1801
+ readonly "animal-care": readonly ("RESPRSN" | "2250" | "3240" | "4226")[];
1802
+ readonly "animal-research": readonly ("RESPRSN" | "2250" | "3240" | "4226")[];
1803
+ readonly "animal-lab": readonly ("RESPRSN" | "2250" | "3141" | "3240" | "4226")[];
1804
+ readonly "animal-insurance": readonly ("RESPRSN" | "4226")[];
1805
+ readonly "animal-tech": readonly ("RESPRSN" | "4226")[];
1806
+ readonly "onehealth-research": readonly ("RESPRSN" | "221" | "2211" | "2212" | "2250" | "3240" | "4226" | "3344")[];
1807
+ readonly "onehealth-lab": readonly ("RESPRSN" | "221" | "2212" | "2250" | "3141" | "3212" | "3240" | "4226" | "3344")[];
1808
+ readonly "onehealth-tech": readonly ("RESPRSN" | "4226")[];
1806
1809
  }>;
1807
1810
  export declare const HealthcareProfessionalRolesBySector: Readonly<{
1808
1811
  readonly "health-care": Readonly<Record<string, Readonly<{
@@ -364,6 +364,8 @@ export const HealthcareActorRoles = Object.freeze({
364
364
  /** ISCO-08 laboratory occupation for human medical/pathology work. */
365
365
  MedicalAndPathologyLaboratoryTechnician: 'ISCO-08|3212',
366
366
  VeterinaryTechnicianOrAssistant: 'ISCO-08|3240',
367
+ /** General receptionist occupation usable across human, animal and one-health organizations. */
368
+ Receptionist: 'ISCO-08|4226',
367
369
  /** Administrative health occupation; it does not imply clinical authority. */
368
370
  MedicalSecretary: 'ISCO-08|3344',
369
371
  });
@@ -389,6 +391,7 @@ export const HealthcareActorRoleCodes = Object.freeze({
389
391
  LifeScienceTechnician: '3141',
390
392
  MedicalAndPathologyLaboratoryTechnician: '3212',
391
393
  VeterinaryTechnicianOrAssistant: '3240',
394
+ Receptionist: '4226',
392
395
  MedicalSecretary: '3344',
393
396
  });
394
397
  function buildProfessionalIscoRoles() {
@@ -503,6 +506,17 @@ function buildProfessionalIscoRoles() {
503
506
  titleEn: 'Veterinary technician or assistant',
504
507
  }),
505
508
  ],
509
+ [
510
+ HealthcareActorRoleCodes.Receptionist,
511
+ Object.freeze({
512
+ family: HealthcareRoleFamilies.ProfessionalOccupationIsco08,
513
+ codingSystem: ISCO08_CODING_SYSTEM,
514
+ code: HealthcareActorRoleCodes.Receptionist,
515
+ claim: HealthcareActorRoles.Receptionist,
516
+ i18nKey: `${ISCO08_I18N_NAMESPACE}.${HealthcareActorRoleCodes.Receptionist}`,
517
+ titleEn: 'Receptionists (general)',
518
+ }),
519
+ ],
506
520
  [
507
521
  HealthcareActorRoleCodes.MedicalSecretary,
508
522
  Object.freeze({
@@ -580,6 +594,7 @@ export const HealthcareProfessionalRoleCodesBySector = Object.freeze({
580
594
  HealthcareActorRoleCodes.NursingProfessional,
581
595
  HealthcareActorRoleCodes.MidwiferyProfessional,
582
596
  HealthcareActorRoleCodes.Paramedic,
597
+ HealthcareActorRoleCodes.Receptionist,
583
598
  HealthcareActorRoleCodes.MedicalSecretary,
584
599
  ]),
585
600
  [DataspaceSectors.HealthResearch]: Object.freeze([
@@ -587,6 +602,7 @@ export const HealthcareProfessionalRoleCodesBySector = Object.freeze({
587
602
  HealthcareActorRoleCodes.MedicalDoctors,
588
603
  HealthcareActorRoleCodes.GeneralistMedicalPractitioner,
589
604
  HealthcareActorRoleCodes.SpecialistMedicalPractitioner,
605
+ HealthcareActorRoleCodes.Receptionist,
590
606
  HealthcareActorRoleCodes.MedicalSecretary,
591
607
  ]),
592
608
  [DataspaceSectors.HealthLab]: Object.freeze([
@@ -594,28 +610,32 @@ export const HealthcareProfessionalRoleCodesBySector = Object.freeze({
594
610
  HealthcareActorRoleCodes.MedicalDoctors,
595
611
  HealthcareActorRoleCodes.SpecialistMedicalPractitioner,
596
612
  HealthcareActorRoleCodes.MedicalAndPathologyLaboratoryTechnician,
613
+ HealthcareActorRoleCodes.Receptionist,
597
614
  HealthcareActorRoleCodes.MedicalSecretary,
598
615
  ]),
599
- [DataspaceSectors.HealthTech]: Object.freeze([HealthcareActorRoleCodes.Controller]),
600
- [DataspaceSectors.HealthInsurance]: Object.freeze([HealthcareActorRoleCodes.Controller]),
616
+ [DataspaceSectors.HealthTech]: Object.freeze([HealthcareActorRoleCodes.Controller, HealthcareActorRoleCodes.Receptionist]),
617
+ [DataspaceSectors.HealthInsurance]: Object.freeze([HealthcareActorRoleCodes.Controller, HealthcareActorRoleCodes.Receptionist]),
601
618
  [DataspaceSectors.AnimalCare]: Object.freeze([
602
619
  HealthcareActorRoleCodes.Controller,
603
620
  HealthcareActorRoleCodes.Veterinarian,
604
621
  HealthcareActorRoleCodes.VeterinaryTechnicianOrAssistant,
622
+ HealthcareActorRoleCodes.Receptionist,
605
623
  ]),
606
624
  [DataspaceSectors.AnimalResearch]: Object.freeze([
607
625
  HealthcareActorRoleCodes.Controller,
608
626
  HealthcareActorRoleCodes.Veterinarian,
609
627
  HealthcareActorRoleCodes.VeterinaryTechnicianOrAssistant,
628
+ HealthcareActorRoleCodes.Receptionist,
610
629
  ]),
611
630
  [DataspaceSectors.AnimalLab]: Object.freeze([
612
631
  HealthcareActorRoleCodes.Controller,
613
632
  HealthcareActorRoleCodes.Veterinarian,
614
633
  HealthcareActorRoleCodes.LifeScienceTechnician,
615
634
  HealthcareActorRoleCodes.VeterinaryTechnicianOrAssistant,
635
+ HealthcareActorRoleCodes.Receptionist,
616
636
  ]),
617
- [DataspaceSectors.AnimalInsurance]: Object.freeze([HealthcareActorRoleCodes.Controller]),
618
- [DataspaceSectors.AnimalTech]: Object.freeze([HealthcareActorRoleCodes.Controller]),
637
+ [DataspaceSectors.AnimalInsurance]: Object.freeze([HealthcareActorRoleCodes.Controller, HealthcareActorRoleCodes.Receptionist]),
638
+ [DataspaceSectors.AnimalTech]: Object.freeze([HealthcareActorRoleCodes.Controller, HealthcareActorRoleCodes.Receptionist]),
619
639
  [DataspaceSectors.OneHealthResearch]: Object.freeze([
620
640
  HealthcareActorRoleCodes.Controller,
621
641
  HealthcareActorRoleCodes.MedicalDoctors,
@@ -623,6 +643,7 @@ export const HealthcareProfessionalRoleCodesBySector = Object.freeze({
623
643
  HealthcareActorRoleCodes.SpecialistMedicalPractitioner,
624
644
  HealthcareActorRoleCodes.Veterinarian,
625
645
  HealthcareActorRoleCodes.VeterinaryTechnicianOrAssistant,
646
+ HealthcareActorRoleCodes.Receptionist,
626
647
  HealthcareActorRoleCodes.MedicalSecretary,
627
648
  ]),
628
649
  [DataspaceSectors.OneHealthLab]: Object.freeze([
@@ -633,9 +654,10 @@ export const HealthcareProfessionalRoleCodesBySector = Object.freeze({
633
654
  HealthcareActorRoleCodes.LifeScienceTechnician,
634
655
  HealthcareActorRoleCodes.MedicalAndPathologyLaboratoryTechnician,
635
656
  HealthcareActorRoleCodes.VeterinaryTechnicianOrAssistant,
657
+ HealthcareActorRoleCodes.Receptionist,
636
658
  HealthcareActorRoleCodes.MedicalSecretary,
637
659
  ]),
638
- [DataspaceSectors.OneHealthTech]: Object.freeze([HealthcareActorRoleCodes.Controller]),
660
+ [DataspaceSectors.OneHealthTech]: Object.freeze([HealthcareActorRoleCodes.Controller, HealthcareActorRoleCodes.Receptionist]),
639
661
  });
640
662
  export const HealthcareProfessionalRolesBySector = Object.freeze({
641
663
  [DataspaceSectors.HealthCare]: pickRoleCatalogByCodes(HealthcareProfessionalAndControllerRoles, HealthcareProfessionalRoleCodesBySector[DataspaceSectors.HealthCare]),
@@ -33,10 +33,11 @@ export type FhirIpsCreatorAuthor = Readonly<{
33
33
  }>;
34
34
  export type FhirIpsCreatorProvenanceInput = FhirIpsCreatorAuthorInput & Readonly<{
35
35
  /**
36
- * Explicit source originator. Defaults to the owning organization or
37
- * individual. When the authenticated member/professional actually authored
38
- * the content, pass its registered RelatedPerson/PractitionerRole assignment
39
- * reference; that same assignment may also remain the attester.
36
+ * Explicit document/source author. Defaults to the owning organization or
37
+ * individual. A registered RelatedPerson/PractitionerRole is an attester,
38
+ * never a substitute for the organization, EHR/portal or individual that
39
+ * authors the document. Passing the assignment reference is normalized to
40
+ * the owner for compatibility with the former creator-as-author contract.
40
41
  */
41
42
  compositionAuthorReference?: string;
42
43
  /** Defaults to professional for employees and personal for individual members. */
@@ -58,13 +59,11 @@ export type FhirIpsCreatorProvenance = Readonly<{
58
59
  /**
59
60
  * Builds source authorship separately from the person or role that attests it.
60
61
  *
61
- * Defaults model delegated flows: an organization's professional attests an
62
- * organization-authored record, while a member/caregiver attests a
63
- * subject-authored record. For content actually created by that authenticated
64
- * member or professional, set `compositionAuthorReference` to its registered
65
- * RelatedPerson or PractitionerRole assignment. Author and attester may then
66
- * intentionally reference the same assignment; neither is the transport
67
- * sender or signing key.
62
+ * An organization's employee attests an organization/EHR-authored record,
63
+ * while a controller/member/caregiver attests an individual-authored record.
64
+ * Neither the attester nor the document author is the transport sender or
65
+ * signing key merely because the same authenticated person performed the
66
+ * submission.
68
67
  */
69
68
  export declare function buildFhirIpsCreatorProvenance(input: FhirIpsCreatorProvenanceInput): FhirIpsCreatorProvenance;
70
69
  /**
@@ -11,13 +11,11 @@ export const FhirIpsCreatorKinds = Object.freeze({
11
11
  /**
12
12
  * Builds source authorship separately from the person or role that attests it.
13
13
  *
14
- * Defaults model delegated flows: an organization's professional attests an
15
- * organization-authored record, while a member/caregiver attests a
16
- * subject-authored record. For content actually created by that authenticated
17
- * member or professional, set `compositionAuthorReference` to its registered
18
- * RelatedPerson or PractitionerRole assignment. Author and attester may then
19
- * intentionally reference the same assignment; neither is the transport
20
- * sender or signing key.
14
+ * An organization's employee attests an organization/EHR-authored record,
15
+ * while a controller/member/caregiver attests an individual-authored record.
16
+ * Neither the attester nor the document author is the transport sender or
17
+ * signing key merely because the same authenticated person performed the
18
+ * submission.
21
19
  */
22
20
  export function buildFhirIpsCreatorProvenance(input) {
23
21
  if (input.kind === FhirIpsCreatorKinds.IndividualSubject) {
@@ -31,11 +29,14 @@ export function buildFhirIpsCreatorProvenance(input) {
31
29
  const defaultAuthor = input.kind === FhirIpsCreatorKinds.Professional
32
30
  ? input.organizationReference
33
31
  : input.subjectReference;
32
+ const requestedAuthor = input.compositionAuthorReference === creator.authorReference
33
+ ? defaultAuthor
34
+ : input.compositionAuthorReference;
34
35
  const mode = input.attesterMode || (input.kind === FhirIpsCreatorKinds.Professional
35
36
  ? CompositionAttesterModes.Professional
36
37
  : CompositionAttesterModes.Personal);
37
38
  return {
38
- authorReference: requireReference(input.compositionAuthorReference || defaultAuthor, 'compositionAuthorReference'),
39
+ authorReference: requireReference(requestedAuthor || defaultAuthor, 'compositionAuthorReference'),
39
40
  attesters: [{
40
41
  mode,
41
42
  party: { reference: creator.authorReference },
@@ -89,6 +90,13 @@ export function buildFhirIpsCreatorAuthor(input) {
89
90
  return {
90
91
  authorReference: authorIdentifier,
91
92
  entries: [
93
+ {
94
+ fullUrl: organizationReference,
95
+ resource: {
96
+ resourceType: 'Organization',
97
+ identifier: [{ value: organizationReference }],
98
+ },
99
+ },
92
100
  {
93
101
  fullUrl: actorIdentifier,
94
102
  resource: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gdc-common-utils-ts",
3
- "version": "2.9.0",
3
+ "version": "2.9.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },