gdc-common-utils-ts 2.9.15 → 2.9.16
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 +6 -0
- package/dist/constants/hl7-roles.d.ts +12 -1
- package/dist/constants/hl7-roles.js +12 -1
- package/dist/models/animal-onboarding.d.ts +5 -2
- package/dist/models/animal-onboarding.js +7 -3
- package/dist/utils/family-organization-summary.d.ts +1 -1
- package/dist/utils/family-organization-summary.js +15 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,6 +80,12 @@ by its attached `Composition.section` graph.
|
|
|
80
80
|
|
|
81
81
|
## Identity Continuity
|
|
82
82
|
|
|
83
|
+
For every Individual Organization, the initial `Organization.member` is the
|
|
84
|
+
indexed subject itself and uses the HL7 relationship `ONESELF`. The creating
|
|
85
|
+
`Organization.owner` is the controller by default. `ONESELF` describes who the
|
|
86
|
+
subject is; controller authority such as `RESPRSN` describes who may act for
|
|
87
|
+
that subject. Never copy the owner/controller role into the SELF member.
|
|
88
|
+
|
|
83
89
|
For ICA-backed organization activation, the representative/controller proof is
|
|
84
90
|
intentionally split into two complementary dimensions:
|
|
85
91
|
|
|
@@ -72,7 +72,18 @@ export declare const HL7_V3_ROLE_CODE_LEGAL_REPRESENTATIVE: Hl7RoleEntry[];
|
|
|
72
72
|
* is required.
|
|
73
73
|
*/
|
|
74
74
|
export declare const HL7_RELATED_PERSON_FUNCTIONAL_ROLES: readonly Hl7RelatedPersonFunctionalRoleEntry[];
|
|
75
|
-
/** Default role
|
|
75
|
+
/** Default SELF-subject role for the initial Individual Organization member. */
|
|
76
|
+
export declare const HL7_DEFAULT_INDIVIDUAL_MEMBER_ROLE = "ONESELF";
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated This is the human controller relationship, not the animal
|
|
79
|
+
* Individual Organization member role. Use
|
|
80
|
+
* `HL7_DEFAULT_CONTROLLER_RELATIONSHIP_ANIMAL_CARE`.
|
|
81
|
+
*/
|
|
76
82
|
export declare const HL7_DEFAULT_ROLE_ANIMAL_CARE = "RESPRSN";
|
|
83
|
+
/**
|
|
84
|
+
* Default human controller-to-animal authorization relationship.
|
|
85
|
+
* This never replaces the animal subject's `ONESELF` member role.
|
|
86
|
+
*/
|
|
87
|
+
export declare const HL7_DEFAULT_CONTROLLER_RELATIONSHIP_ANIMAL_CARE = "RESPRSN";
|
|
77
88
|
/** Default role code for health sector (patient self-represents). */
|
|
78
89
|
export declare const HL7_DEFAULT_ROLE_HEALTH = "ONESELF";
|
|
@@ -290,7 +290,18 @@ export const HL7_RELATED_PERSON_FUNCTIONAL_ROLES = [
|
|
|
290
290
|
codingSystem: HL7_CODING_SYSTEM_V3_ROLE_CODE,
|
|
291
291
|
},
|
|
292
292
|
];
|
|
293
|
-
/** Default role
|
|
293
|
+
/** Default SELF-subject role for the initial Individual Organization member. */
|
|
294
|
+
export const HL7_DEFAULT_INDIVIDUAL_MEMBER_ROLE = 'ONESELF';
|
|
295
|
+
/**
|
|
296
|
+
* @deprecated This is the human controller relationship, not the animal
|
|
297
|
+
* Individual Organization member role. Use
|
|
298
|
+
* `HL7_DEFAULT_CONTROLLER_RELATIONSHIP_ANIMAL_CARE`.
|
|
299
|
+
*/
|
|
294
300
|
export const HL7_DEFAULT_ROLE_ANIMAL_CARE = 'RESPRSN';
|
|
301
|
+
/**
|
|
302
|
+
* Default human controller-to-animal authorization relationship.
|
|
303
|
+
* This never replaces the animal subject's `ONESELF` member role.
|
|
304
|
+
*/
|
|
305
|
+
export const HL7_DEFAULT_CONTROLLER_RELATIONSHIP_ANIMAL_CARE = 'RESPRSN';
|
|
295
306
|
/** Default role code for health sector (patient self-represents). */
|
|
296
307
|
export const HL7_DEFAULT_ROLE_HEALTH = 'ONESELF';
|
|
@@ -49,8 +49,11 @@ export declare function buildNcbiTaxonomyUri(id: NcbiTaxonomyId): string;
|
|
|
49
49
|
* Projects one controller-authorized animal card request to the existing
|
|
50
50
|
* schema.org individual-organization claim envelope.
|
|
51
51
|
*
|
|
52
|
-
* The indexed subject is always
|
|
53
|
-
*
|
|
52
|
+
* The indexed subject is always the first `Organization.member`, with the
|
|
53
|
+
* HL7 relationship `ONESELF`. The human that creates the envelope remains the
|
|
54
|
+
* separate `Organization.owner` controller; `RESPRSN` belongs to that
|
|
55
|
+
* controller authority and must never replace the subject's ONESELF role.
|
|
56
|
+
* Login identity proves only the application session;
|
|
54
57
|
* GW must still verify the enrollment grant before accepting the request. A
|
|
55
58
|
* card must not be shown as active until the authoritative GW transaction
|
|
56
59
|
* returns success.
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ClaimsOrganizationSchemaorg, ClaimsServiceSchemaorg } from '../constants/schemaorg.js';
|
|
2
2
|
import { DataspaceSectors } from '../constants/sectors.js';
|
|
3
|
+
import { HL7_DEFAULT_INDIVIDUAL_MEMBER_ROLE } from '../constants/hl7-roles.js';
|
|
3
4
|
/**
|
|
4
5
|
* @deprecated Animal-card vocabulary is owned by the consuming product SDK.
|
|
5
6
|
* Retained only so consumers of 2.3.x can migrate without a breaking removal.
|
|
@@ -42,8 +43,11 @@ export function buildNcbiTaxonomyUri(id) {
|
|
|
42
43
|
* Projects one controller-authorized animal card request to the existing
|
|
43
44
|
* schema.org individual-organization claim envelope.
|
|
44
45
|
*
|
|
45
|
-
* The indexed subject is always
|
|
46
|
-
*
|
|
46
|
+
* The indexed subject is always the first `Organization.member`, with the
|
|
47
|
+
* HL7 relationship `ONESELF`. The human that creates the envelope remains the
|
|
48
|
+
* separate `Organization.owner` controller; `RESPRSN` belongs to that
|
|
49
|
+
* controller authority and must never replace the subject's ONESELF role.
|
|
50
|
+
* Login identity proves only the application session;
|
|
47
51
|
* GW must still verify the enrollment grant before accepting the request. A
|
|
48
52
|
* card must not be shown as active until the authoritative GW transaction
|
|
49
53
|
* returns success.
|
|
@@ -68,7 +72,7 @@ export function buildAnimalOnboardingClaims(input) {
|
|
|
68
72
|
[ClaimsOrganizationSchemaorg.sameAs]: cardDidWeb,
|
|
69
73
|
[ClaimsOrganizationSchemaorg.memberName]: alternateName,
|
|
70
74
|
[ClaimsOrganizationSchemaorg.memberAdditionalType]: buildNcbiTaxonomyUri(input.ncbiTaxonomyId),
|
|
71
|
-
[ClaimsOrganizationSchemaorg.memberRole]:
|
|
75
|
+
[ClaimsOrganizationSchemaorg.memberRole]: HL7_DEFAULT_INDIVIDUAL_MEMBER_ROLE,
|
|
72
76
|
...(birthDate ? { [ClaimsOrganizationSchemaorg.memberBirthDate]: birthDate } : {}),
|
|
73
77
|
...(gender ? { [ClaimsOrganizationSchemaorg.memberGender]: gender } : {}),
|
|
74
78
|
[ClaimsOrganizationSchemaorg.ownerEmail]: input.controllerEmail?.trim() || '',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type FamilyRegistrationStatus = 'new_created' | 'resume_required' | 'already_exists' | 'not_found';
|
|
1
|
+
export type FamilyRegistrationStatus = 'new_created' | 'draft_saved' | 'resume_required' | 'already_exists' | 'not_found';
|
|
2
2
|
export type FamilyOrganizationSubjectInfo = Readonly<{
|
|
3
3
|
identifierType?: string;
|
|
4
4
|
identifierValue?: string;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
// Copyright 2026 Antifraud Services Inc. under the Apache License, Version 2.0.
|
|
2
|
+
const FAMILY_REGISTRATION_STATUSES = new Set([
|
|
3
|
+
'new_created',
|
|
4
|
+
'draft_saved',
|
|
5
|
+
'resume_required',
|
|
6
|
+
'already_exists',
|
|
7
|
+
'not_found',
|
|
8
|
+
]);
|
|
2
9
|
function asRecord(value) {
|
|
3
10
|
return value && typeof value === 'object' ? value : {};
|
|
4
11
|
}
|
|
@@ -38,8 +45,12 @@ export function readFamilyOrganizationSummaryFromResponseBody(body) {
|
|
|
38
45
|
...asRecord(entryMeta.claims),
|
|
39
46
|
...asRecord(entryResourceMeta.claims),
|
|
40
47
|
};
|
|
41
|
-
const
|
|
42
|
-
if (!
|
|
48
|
+
const rawStatus = normalizeText(claims['org.schema.FamilyRegistration.status'] ?? claims.status);
|
|
49
|
+
if (!rawStatus || !FAMILY_REGISTRATION_STATUSES.has(rawStatus)) {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
const status = rawStatus;
|
|
53
|
+
if (status === 'not_found') {
|
|
43
54
|
return null;
|
|
44
55
|
}
|
|
45
56
|
return {
|
|
@@ -50,7 +61,8 @@ export function readFamilyOrganizationSummaryFromResponseBody(body) {
|
|
|
50
61
|
identifierType: normalizeText(claims['org.schema.Organization.identifier.additionalType']),
|
|
51
62
|
identifierValue: normalizeText(claims['org.schema.Organization.identifier.value']),
|
|
52
63
|
alternateName: normalizeText(claims['org.schema.Organization.alternateName']),
|
|
53
|
-
birthDate: normalizeText(claims['org.schema.
|
|
64
|
+
birthDate: normalizeText(claims['org.schema.Person.birthDate']
|
|
65
|
+
?? claims['org.schema.Organization.foundingDate']),
|
|
54
66
|
ownerTelephone: normalizeText(claims['org.schema.Organization.owner.telephone']),
|
|
55
67
|
},
|
|
56
68
|
missingFields: normalizeStringList(claims['org.schema.FamilyRegistration.missingFields'] ?? claims.missingFields),
|