vet-data-utils-ts 0.5.27 → 0.5.28
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 +5 -0
- package/dist/provenance.d.ts +2 -1
- package/dist/provenance.js +9 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -126,6 +126,11 @@ resource-specific standard SearchParameters and preserves agent correlation as
|
|
|
126
126
|
exact code from the FHIR ParticipationRoleType ValueSet and the value is the
|
|
127
127
|
agent's FHIR Reference or URI. The standard `Provenance.agent` and
|
|
128
128
|
`Provenance.agent-type` claims are indexed alongside that correlation claim.
|
|
129
|
+
For a professional, use
|
|
130
|
+
`buildPractitionerRoleReferenceFromAssignmentIdentifier()` with the real
|
|
131
|
+
Occupation/PractitionerRole assignment UUID returned by GW. The role-bearing
|
|
132
|
+
employee URN and role-license hash remain operational authorization identities;
|
|
133
|
+
they are not substituted for the clinical `PractitionerRole` reference.
|
|
129
134
|
|
|
130
135
|
ResearchStudy professional teams use native FHIR R5 Group resources from
|
|
131
136
|
`vet-data-utils-ts/group`: required type and membership codes, the exact twelve
|
package/dist/provenance.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/** Browser-safe FHIR R5 Provenance flat-claim vocabulary and builders. */
|
|
2
1
|
export declare const FhirR5ParticipationRoleTypeValueSet: "http://hl7.org/fhir/ValueSet/participation-role-type";
|
|
3
2
|
export declare const FhirR5ProvenanceParticipantTypeSystem: "http://terminology.hl7.org/CodeSystem/provenance-participant-type";
|
|
4
3
|
export declare const FhirR5ExtraSecurityRoleTypeSystem: "http://terminology.hl7.org/CodeSystem/extra-security-role-type";
|
|
@@ -23,6 +22,8 @@ export type ProvenanceR5FlatClaimsResource = Readonly<{
|
|
|
23
22
|
claims: Readonly<Record<string, readonly string[]>>;
|
|
24
23
|
}>;
|
|
25
24
|
}>;
|
|
25
|
+
/** Builds the FHIR PractitionerRole reference from the server-issued assignment UUID. */
|
|
26
|
+
export declare function buildPractitionerRoleReferenceFromAssignmentIdentifier(assignmentIdentifier: string): string;
|
|
26
27
|
/** Returns the correlated agent reference claim for one official participation type. */
|
|
27
28
|
export declare function provenanceAgentClaim(code: FhirR5ParticipationRoleTypeCode | string): string;
|
|
28
29
|
/** Returns the system-qualified FHIR token for one official participation type. */
|
package/dist/provenance.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** Browser-safe FHIR R5 Provenance flat-claim vocabulary and builders. */
|
|
2
|
+
import { normalizeUuid } from 'gdc-common-utils-ts/utils/normalize-uuid';
|
|
2
3
|
export const FhirR5ParticipationRoleTypeValueSet = 'http://hl7.org/fhir/ValueSet/participation-role-type';
|
|
3
4
|
export const FhirR5ProvenanceParticipantTypeSystem = 'http://terminology.hl7.org/CodeSystem/provenance-participant-type';
|
|
4
5
|
export const FhirR5ExtraSecurityRoleTypeSystem = 'http://terminology.hl7.org/CodeSystem/extra-security-role-type';
|
|
@@ -30,6 +31,14 @@ const standardClaims = ProvenanceR5SearchParameterCatalog.map(parameter => `Prov
|
|
|
30
31
|
const correlatedAgentClaims = FhirR5ParticipationRoleTypeCodes.map(code => `Provenance.agent-${code}-who`);
|
|
31
32
|
/** Standard search claims plus typed-agent correlation claims. */
|
|
32
33
|
export const ProvenanceFlatClaimCatalog = Object.freeze([...standardClaims, ...correlatedAgentClaims]);
|
|
34
|
+
/** Builds the FHIR PractitionerRole reference from the server-issued assignment UUID. */
|
|
35
|
+
export function buildPractitionerRoleReferenceFromAssignmentIdentifier(assignmentIdentifier) {
|
|
36
|
+
const compact = normalizeUuid(assignmentIdentifier);
|
|
37
|
+
if (!compact)
|
|
38
|
+
throw new TypeError('professional_assignment_identifier_invalid');
|
|
39
|
+
const uuid = `${compact.slice(0, 8)}-${compact.slice(8, 12)}-${compact.slice(12, 16)}-${compact.slice(16, 20)}-${compact.slice(20)}`;
|
|
40
|
+
return `PractitionerRole/${uuid}`;
|
|
41
|
+
}
|
|
33
42
|
/** Returns the correlated agent reference claim for one official participation type. */
|
|
34
43
|
export function provenanceAgentClaim(code) {
|
|
35
44
|
if (!FhirR5ParticipationRoleTypeCodes.includes(code))
|