gdc-common-utils-ts 2.9.18 → 2.9.19
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/convert/convert-allergy-intolerance.js +30 -0
- package/dist/convert/convert-medication-statement.js +14 -2
- package/dist/models/interoperable-claims/allergy-intolerance-claims.d.ts +63 -0
- package/dist/models/interoperable-claims/allergy-intolerance-claims.js +78 -1
- package/dist/models/interoperable-claims/medication-statement-claims.d.ts +10 -0
- package/dist/models/interoperable-claims/medication-statement-claims.js +12 -0
- package/dist/utils/allergy-intolerance-entry-editor.d.ts +11 -2
- package/dist/utils/allergy-intolerance-entry-editor.js +9 -1
- package/dist/utils/medication-statement-entry-editor.d.ts +8 -0
- package/dist/utils/medication-statement-entry-editor.js +26 -1
- package/dist/utils/observation-entry-editor.d.ts +7 -0
- package/dist/utils/observation-entry-editor.js +11 -0
- package/package.json +1 -1
|
@@ -5,8 +5,15 @@ import { codingFromValue, codingToValue, requireDidWeb, requireSubjectIdentifier
|
|
|
5
5
|
export function allergyIntoleranceFlatToFhirR4(claims) {
|
|
6
6
|
const patient = claims[AllergyIntoleranceClaim.Subject] ?? claims[AllergyIntoleranceClaim.Patient];
|
|
7
7
|
const recorder = claims[AllergyIntoleranceClaim.Recorder];
|
|
8
|
+
const manifestation = claims[AllergyIntoleranceClaim.Manifestation];
|
|
9
|
+
const severity = claims[AllergyIntoleranceClaim.Severity];
|
|
10
|
+
const reactionOnset = claims[AllergyIntoleranceClaim.Onset];
|
|
11
|
+
const route = claims[AllergyIntoleranceClaim.Route];
|
|
8
12
|
if (!patient)
|
|
9
13
|
throw new Error(`Missing required claim: ${AllergyIntoleranceClaim.Subject}`);
|
|
14
|
+
if ((severity || reactionOnset || route) && !manifestation) {
|
|
15
|
+
throw new Error(`${severity ? AllergyIntoleranceClaim.Severity : reactionOnset ? AllergyIntoleranceClaim.Onset : AllergyIntoleranceClaim.Route} requires ${AllergyIntoleranceClaim.Manifestation}`);
|
|
16
|
+
}
|
|
10
17
|
requireSubjectIdentifier(patient, AllergyIntoleranceClaim.Subject);
|
|
11
18
|
if (recorder)
|
|
12
19
|
requireDidWeb(recorder, AllergyIntoleranceClaim.Recorder);
|
|
@@ -31,13 +38,28 @@ export function allergyIntoleranceFlatToFhirR4(claims) {
|
|
|
31
38
|
verificationStatus: claims[AllergyIntoleranceClaim.VerificationStatus] ? { coding: [{ code: claims[AllergyIntoleranceClaim.VerificationStatus] }] } : undefined,
|
|
32
39
|
category: claims[AllergyIntoleranceClaim.Category] ? [claims[AllergyIntoleranceClaim.Category]] : undefined,
|
|
33
40
|
criticality: claims[AllergyIntoleranceClaim.Criticality],
|
|
41
|
+
type: claims[AllergyIntoleranceClaim.Type],
|
|
34
42
|
onsetDateTime: claims[AllergyIntoleranceClaim.OnsetDateTime],
|
|
43
|
+
recordedDate: claims[AllergyIntoleranceClaim.RecordedDate],
|
|
44
|
+
lastOccurrence: claims[AllergyIntoleranceClaim.LastOccurrence],
|
|
45
|
+
asserter: claims[AllergyIntoleranceClaim.Asserter]
|
|
46
|
+
? { reference: claims[AllergyIntoleranceClaim.Asserter] }
|
|
47
|
+
: undefined,
|
|
35
48
|
recorder: recorder ? { reference: recorder } : undefined,
|
|
49
|
+
reaction: manifestation ? [{
|
|
50
|
+
manifestation: [{ coding: codingFromValue(manifestation) }],
|
|
51
|
+
onset: reactionOnset,
|
|
52
|
+
severity,
|
|
53
|
+
exposureRoute: route ? { coding: codingFromValue(route) } : undefined,
|
|
54
|
+
}] : undefined,
|
|
36
55
|
};
|
|
37
56
|
}
|
|
38
57
|
export function allergyIntoleranceFhirR4ToFlat(resource) {
|
|
39
58
|
const subject = resource.patient?.reference;
|
|
40
59
|
const code = resource.code;
|
|
60
|
+
const reaction = resource.reaction?.[0];
|
|
61
|
+
const manifestation = reaction?.manifestation?.[0];
|
|
62
|
+
const exposureRoute = reaction?.exposureRoute;
|
|
41
63
|
return {
|
|
42
64
|
[AllergyIntoleranceClaim.Identifier]: resource.identifier?.[0]?.value,
|
|
43
65
|
[AllergyIntoleranceClaim.Subject]: subject,
|
|
@@ -49,7 +71,15 @@ export function allergyIntoleranceFhirR4ToFlat(resource) {
|
|
|
49
71
|
[AllergyIntoleranceClaim.VerificationStatus]: resource.verificationStatus?.coding?.[0]?.code,
|
|
50
72
|
[AllergyIntoleranceClaim.Category]: resource.category?.[0],
|
|
51
73
|
[AllergyIntoleranceClaim.Criticality]: resource.criticality,
|
|
74
|
+
[AllergyIntoleranceClaim.Type]: resource.type,
|
|
52
75
|
[AllergyIntoleranceClaim.OnsetDateTime]: resource.onsetDateTime,
|
|
76
|
+
[AllergyIntoleranceClaim.RecordedDate]: resource.recordedDate,
|
|
77
|
+
[AllergyIntoleranceClaim.LastOccurrence]: resource.lastOccurrence,
|
|
78
|
+
[AllergyIntoleranceClaim.Asserter]: resource.asserter?.reference,
|
|
79
|
+
[AllergyIntoleranceClaim.Manifestation]: codingToValue(manifestation?.coding?.[0]),
|
|
80
|
+
[AllergyIntoleranceClaim.Onset]: reaction?.onset,
|
|
81
|
+
[AllergyIntoleranceClaim.Route]: codingToValue(exposureRoute?.coding?.[0]),
|
|
82
|
+
[AllergyIntoleranceClaim.Severity]: reaction?.severity,
|
|
53
83
|
[AllergyIntoleranceClaim.Recorder]: resource.recorder?.reference,
|
|
54
84
|
};
|
|
55
85
|
}
|
|
@@ -5,7 +5,12 @@ import { codingFromValue, codingToValue, requireClaim } from './convert-shared.j
|
|
|
5
5
|
export function medicationStatementFlatToFhirR4(claims) {
|
|
6
6
|
const subject = requireClaim(claims, MedicationStatementClaim.Subject);
|
|
7
7
|
const status = requireClaim(claims, MedicationStatementClaim.Status);
|
|
8
|
-
const
|
|
8
|
+
const effectivePeriodEnd = claims[MedicationStatementClaim.EffectivePeriodEnd];
|
|
9
|
+
const effectivePeriodStart = claims[MedicationStatementClaim.EffectivePeriodStart]
|
|
10
|
+
|| (effectivePeriodEnd ? claims[MedicationStatementClaim.Effective] : undefined);
|
|
11
|
+
const effectiveDateTime = effectivePeriodStart || effectivePeriodEnd
|
|
12
|
+
? undefined
|
|
13
|
+
: claims[MedicationStatementClaim.Effective];
|
|
9
14
|
const medicationText = claims[MedicationStatementClaim.CodeText]
|
|
10
15
|
|| claims[MedicationStatementClaim.MedicationText];
|
|
11
16
|
const medicationReference = claims[MedicationStatementClaim.Medication];
|
|
@@ -42,7 +47,11 @@ export function medicationStatementFlatToFhirR4(claims) {
|
|
|
42
47
|
identifier: claims[MedicationStatementClaim.Identifier] ? [{ value: claims[MedicationStatementClaim.Identifier] }] : undefined,
|
|
43
48
|
status,
|
|
44
49
|
subject: { reference: subject },
|
|
45
|
-
effectiveDateTime,
|
|
50
|
+
...(effectiveDateTime ? { effectiveDateTime } : {}),
|
|
51
|
+
effectivePeriod: effectivePeriodStart || effectivePeriodEnd ? {
|
|
52
|
+
start: effectivePeriodStart,
|
|
53
|
+
end: effectivePeriodEnd,
|
|
54
|
+
} : undefined,
|
|
46
55
|
medicationCodeableConcept: !medicationReference && !hasContainedMedication && claims[MedicationStatementClaim.Code]
|
|
47
56
|
? {
|
|
48
57
|
coding: codingFromValue(claims[MedicationStatementClaim.Code])?.map((coding) => ({
|
|
@@ -93,11 +102,14 @@ export function medicationStatementFhirR4ToFlat(resource) {
|
|
|
93
102
|
: undefined;
|
|
94
103
|
const routeCoding = dosage?.route?.coding?.[0];
|
|
95
104
|
const doseQuantity = (dosage?.doseAndRate?.[0]?.doseQuantity);
|
|
105
|
+
const effectivePeriod = resource.effectivePeriod;
|
|
96
106
|
return {
|
|
97
107
|
[MedicationStatementClaim.Identifier]: resource.identifier?.[0]?.value,
|
|
98
108
|
[MedicationStatementClaim.Subject]: resource.subject?.reference,
|
|
99
109
|
[MedicationStatementClaim.Status]: resource.status,
|
|
100
110
|
[MedicationStatementClaim.Effective]: resource.effectiveDateTime,
|
|
111
|
+
[MedicationStatementClaim.EffectivePeriodStart]: effectivePeriod?.start,
|
|
112
|
+
[MedicationStatementClaim.EffectivePeriodEnd]: effectivePeriod?.end,
|
|
101
113
|
[MedicationStatementClaim.Code]: medicationCode,
|
|
102
114
|
[MedicationStatementClaim.CodeText]: medicationText,
|
|
103
115
|
[MedicationStatementClaim.Medication]: medicationReference?.startsWith('#') ? undefined : medicationReference,
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
import type { ClaimSpec } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* FHIR R4 `AllergyIntolerance.criticality` codes describing potential future harm.
|
|
4
|
+
*
|
|
5
|
+
* @see https://hl7.org/fhir/R4/allergyintolerance.html
|
|
6
|
+
* @see https://build.fhir.org/ig/HL7/fhir-ips/en/StructureDefinition-AllergyIntolerance-uv-ips.html
|
|
7
|
+
*/
|
|
8
|
+
export declare const AllergyIntoleranceCriticalities: {
|
|
9
|
+
readonly Low: "low";
|
|
10
|
+
readonly High: "high";
|
|
11
|
+
readonly UnableToAssess: "unable-to-assess";
|
|
12
|
+
};
|
|
13
|
+
export type AllergyIntoleranceCriticality = typeof AllergyIntoleranceCriticalities[keyof typeof AllergyIntoleranceCriticalities];
|
|
14
|
+
/**
|
|
15
|
+
* FHIR R4 `AllergyIntolerance.reaction.severity` codes for one observed reaction event.
|
|
16
|
+
*
|
|
17
|
+
* @see https://hl7.org/fhir/R4/valueset-reaction-event-severity.html
|
|
18
|
+
* @see https://build.fhir.org/ig/HL7/fhir-ips/en/StructureDefinition-AllergyIntolerance-uv-ips.html
|
|
19
|
+
*/
|
|
20
|
+
export declare const AllergyIntoleranceReactionSeverities: {
|
|
21
|
+
readonly Mild: "mild";
|
|
22
|
+
readonly Moderate: "moderate";
|
|
23
|
+
readonly Severe: "severe";
|
|
24
|
+
};
|
|
25
|
+
export type AllergyIntoleranceReactionSeverity = typeof AllergyIntoleranceReactionSeverities[keyof typeof AllergyIntoleranceReactionSeverities];
|
|
2
26
|
export declare const AllergyIntoleranceClaim: {
|
|
3
27
|
readonly Identifier: "AllergyIntolerance.identifier";
|
|
4
28
|
readonly Subject: "AllergyIntolerance.subject";
|
|
@@ -34,6 +58,14 @@ export declare const AllergyIntoleranceClaim: {
|
|
|
34
58
|
*/
|
|
35
59
|
readonly AttachmentContentIds: "AllergyIntolerance.attachment-content-ids";
|
|
36
60
|
readonly Criticality: "AllergyIntolerance.criticality";
|
|
61
|
+
readonly Asserter: "AllergyIntolerance.asserter";
|
|
62
|
+
readonly RecordedDate: "AllergyIntolerance.date";
|
|
63
|
+
readonly LastOccurrence: "AllergyIntolerance.last-date";
|
|
64
|
+
readonly Manifestation: "AllergyIntolerance.manifestation";
|
|
65
|
+
readonly Onset: "AllergyIntolerance.onset";
|
|
66
|
+
readonly Route: "AllergyIntolerance.route";
|
|
67
|
+
readonly Severity: "AllergyIntolerance.severity";
|
|
68
|
+
readonly Type: "AllergyIntolerance.type";
|
|
37
69
|
readonly OnsetDateTime: "AllergyIntolerance.onset-datetime";
|
|
38
70
|
readonly Recorder: "AllergyIntolerance.recorder";
|
|
39
71
|
};
|
|
@@ -49,9 +81,24 @@ export declare enum AllergyIntoleranceClaimsFhirApi {
|
|
|
49
81
|
VerificationStatus = "org.hl7.fhir.api.AllergyIntolerance.verification-status",
|
|
50
82
|
Category = "org.hl7.fhir.api.AllergyIntolerance.category",
|
|
51
83
|
Criticality = "org.hl7.fhir.api.AllergyIntolerance.criticality",
|
|
84
|
+
Asserter = "org.hl7.fhir.api.AllergyIntolerance.asserter",
|
|
85
|
+
Date = "org.hl7.fhir.api.AllergyIntolerance.date",
|
|
86
|
+
LastDate = "org.hl7.fhir.api.AllergyIntolerance.last-date",
|
|
87
|
+
Manifestation = "org.hl7.fhir.api.AllergyIntolerance.manifestation",
|
|
88
|
+
Onset = "org.hl7.fhir.api.AllergyIntolerance.onset",
|
|
89
|
+
Route = "org.hl7.fhir.api.AllergyIntolerance.route",
|
|
90
|
+
Severity = "org.hl7.fhir.api.AllergyIntolerance.severity",
|
|
91
|
+
Type = "org.hl7.fhir.api.AllergyIntolerance.type",
|
|
52
92
|
OnsetDateTime = "org.hl7.fhir.api.AllergyIntolerance.onset-datetime",
|
|
53
93
|
Recorder = "org.hl7.fhir.api.AllergyIntolerance.recorder"
|
|
54
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Resource-specific FHIR R4 search parameters. UI presentation remains governed
|
|
97
|
+
* separately by the applicable IPS StructureDefinition and its obligations.
|
|
98
|
+
*
|
|
99
|
+
* @see https://hl7.org/fhir/R4/allergyintolerance.html#search
|
|
100
|
+
* @see https://build.fhir.org/ig/HL7/fhir-ips/en/CapabilityStatement-ips-server.html
|
|
101
|
+
*/
|
|
55
102
|
export declare const AllergyIntoleranceSearchParamNames: {
|
|
56
103
|
readonly Identifier: "identifier";
|
|
57
104
|
readonly Subject: "subject";
|
|
@@ -63,6 +110,14 @@ export declare const AllergyIntoleranceSearchParamNames: {
|
|
|
63
110
|
readonly VerificationStatus: "verification-status";
|
|
64
111
|
readonly Category: "category";
|
|
65
112
|
readonly Criticality: "criticality";
|
|
113
|
+
readonly Asserter: "asserter";
|
|
114
|
+
readonly Date: "date";
|
|
115
|
+
readonly LastDate: "last-date";
|
|
116
|
+
readonly Manifestation: "manifestation";
|
|
117
|
+
readonly Onset: "onset";
|
|
118
|
+
readonly Route: "route";
|
|
119
|
+
readonly Severity: "severity";
|
|
120
|
+
readonly Type: "type";
|
|
66
121
|
readonly OnsetDateTime: "onset-datetime";
|
|
67
122
|
readonly Recorder: "recorder";
|
|
68
123
|
};
|
|
@@ -79,6 +134,14 @@ export declare const AllergyIntoleranceClaimsFhirApiMap: {
|
|
|
79
134
|
"org.hl7.fhir.api.AllergyIntolerance.verification-status": StringConstructor;
|
|
80
135
|
"org.hl7.fhir.api.AllergyIntolerance.category": StringConstructor;
|
|
81
136
|
"org.hl7.fhir.api.AllergyIntolerance.criticality": StringConstructor;
|
|
137
|
+
"org.hl7.fhir.api.AllergyIntolerance.asserter": StringConstructor;
|
|
138
|
+
"org.hl7.fhir.api.AllergyIntolerance.date": StringConstructor;
|
|
139
|
+
"org.hl7.fhir.api.AllergyIntolerance.last-date": StringConstructor;
|
|
140
|
+
"org.hl7.fhir.api.AllergyIntolerance.manifestation": StringConstructor;
|
|
141
|
+
"org.hl7.fhir.api.AllergyIntolerance.onset": StringConstructor;
|
|
142
|
+
"org.hl7.fhir.api.AllergyIntolerance.route": StringConstructor;
|
|
143
|
+
"org.hl7.fhir.api.AllergyIntolerance.severity": StringConstructor;
|
|
144
|
+
"org.hl7.fhir.api.AllergyIntolerance.type": StringConstructor;
|
|
82
145
|
"org.hl7.fhir.api.AllergyIntolerance.onset-datetime": StringConstructor;
|
|
83
146
|
"org.hl7.fhir.api.AllergyIntolerance.recorder": StringConstructor;
|
|
84
147
|
};
|
|
@@ -1,6 +1,28 @@
|
|
|
1
1
|
// Copyright 2026 Conéctate Soluciones y Aplicaciones SL under the Apache License, Version 2.0.
|
|
2
2
|
// File: src/models/interoperable-claims/allergy-intolerance-claims.ts
|
|
3
3
|
// Always create JSDoc, do not use strings inline in keys nor values, use types instead, and reuse the data test examples.
|
|
4
|
+
/**
|
|
5
|
+
* FHIR R4 `AllergyIntolerance.criticality` codes describing potential future harm.
|
|
6
|
+
*
|
|
7
|
+
* @see https://hl7.org/fhir/R4/allergyintolerance.html
|
|
8
|
+
* @see https://build.fhir.org/ig/HL7/fhir-ips/en/StructureDefinition-AllergyIntolerance-uv-ips.html
|
|
9
|
+
*/
|
|
10
|
+
export const AllergyIntoleranceCriticalities = {
|
|
11
|
+
Low: 'low',
|
|
12
|
+
High: 'high',
|
|
13
|
+
UnableToAssess: 'unable-to-assess',
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* FHIR R4 `AllergyIntolerance.reaction.severity` codes for one observed reaction event.
|
|
17
|
+
*
|
|
18
|
+
* @see https://hl7.org/fhir/R4/valueset-reaction-event-severity.html
|
|
19
|
+
* @see https://build.fhir.org/ig/HL7/fhir-ips/en/StructureDefinition-AllergyIntolerance-uv-ips.html
|
|
20
|
+
*/
|
|
21
|
+
export const AllergyIntoleranceReactionSeverities = {
|
|
22
|
+
Mild: 'mild',
|
|
23
|
+
Moderate: 'moderate',
|
|
24
|
+
Severe: 'severe',
|
|
25
|
+
};
|
|
4
26
|
export const AllergyIntoleranceClaim = {
|
|
5
27
|
Identifier: 'AllergyIntolerance.identifier',
|
|
6
28
|
Subject: 'AllergyIntolerance.subject',
|
|
@@ -36,6 +58,14 @@ export const AllergyIntoleranceClaim = {
|
|
|
36
58
|
*/
|
|
37
59
|
AttachmentContentIds: 'AllergyIntolerance.attachment-content-ids',
|
|
38
60
|
Criticality: 'AllergyIntolerance.criticality',
|
|
61
|
+
Asserter: 'AllergyIntolerance.asserter',
|
|
62
|
+
RecordedDate: 'AllergyIntolerance.date',
|
|
63
|
+
LastOccurrence: 'AllergyIntolerance.last-date',
|
|
64
|
+
Manifestation: 'AllergyIntolerance.manifestation',
|
|
65
|
+
Onset: 'AllergyIntolerance.onset',
|
|
66
|
+
Route: 'AllergyIntolerance.route',
|
|
67
|
+
Severity: 'AllergyIntolerance.severity',
|
|
68
|
+
Type: 'AllergyIntolerance.type',
|
|
39
69
|
OnsetDateTime: 'AllergyIntolerance.onset-datetime',
|
|
40
70
|
Recorder: 'AllergyIntolerance.recorder',
|
|
41
71
|
};
|
|
@@ -51,9 +81,24 @@ export var AllergyIntoleranceClaimsFhirApi;
|
|
|
51
81
|
AllergyIntoleranceClaimsFhirApi["VerificationStatus"] = "org.hl7.fhir.api.AllergyIntolerance.verification-status";
|
|
52
82
|
AllergyIntoleranceClaimsFhirApi["Category"] = "org.hl7.fhir.api.AllergyIntolerance.category";
|
|
53
83
|
AllergyIntoleranceClaimsFhirApi["Criticality"] = "org.hl7.fhir.api.AllergyIntolerance.criticality";
|
|
84
|
+
AllergyIntoleranceClaimsFhirApi["Asserter"] = "org.hl7.fhir.api.AllergyIntolerance.asserter";
|
|
85
|
+
AllergyIntoleranceClaimsFhirApi["Date"] = "org.hl7.fhir.api.AllergyIntolerance.date";
|
|
86
|
+
AllergyIntoleranceClaimsFhirApi["LastDate"] = "org.hl7.fhir.api.AllergyIntolerance.last-date";
|
|
87
|
+
AllergyIntoleranceClaimsFhirApi["Manifestation"] = "org.hl7.fhir.api.AllergyIntolerance.manifestation";
|
|
88
|
+
AllergyIntoleranceClaimsFhirApi["Onset"] = "org.hl7.fhir.api.AllergyIntolerance.onset";
|
|
89
|
+
AllergyIntoleranceClaimsFhirApi["Route"] = "org.hl7.fhir.api.AllergyIntolerance.route";
|
|
90
|
+
AllergyIntoleranceClaimsFhirApi["Severity"] = "org.hl7.fhir.api.AllergyIntolerance.severity";
|
|
91
|
+
AllergyIntoleranceClaimsFhirApi["Type"] = "org.hl7.fhir.api.AllergyIntolerance.type";
|
|
54
92
|
AllergyIntoleranceClaimsFhirApi["OnsetDateTime"] = "org.hl7.fhir.api.AllergyIntolerance.onset-datetime";
|
|
55
93
|
AllergyIntoleranceClaimsFhirApi["Recorder"] = "org.hl7.fhir.api.AllergyIntolerance.recorder";
|
|
56
94
|
})(AllergyIntoleranceClaimsFhirApi || (AllergyIntoleranceClaimsFhirApi = {}));
|
|
95
|
+
/**
|
|
96
|
+
* Resource-specific FHIR R4 search parameters. UI presentation remains governed
|
|
97
|
+
* separately by the applicable IPS StructureDefinition and its obligations.
|
|
98
|
+
*
|
|
99
|
+
* @see https://hl7.org/fhir/R4/allergyintolerance.html#search
|
|
100
|
+
* @see https://build.fhir.org/ig/HL7/fhir-ips/en/CapabilityStatement-ips-server.html
|
|
101
|
+
*/
|
|
57
102
|
export const AllergyIntoleranceSearchParamNames = {
|
|
58
103
|
Identifier: 'identifier',
|
|
59
104
|
Subject: 'subject',
|
|
@@ -65,6 +110,14 @@ export const AllergyIntoleranceSearchParamNames = {
|
|
|
65
110
|
VerificationStatus: 'verification-status',
|
|
66
111
|
Category: 'category',
|
|
67
112
|
Criticality: 'criticality',
|
|
113
|
+
Asserter: 'asserter',
|
|
114
|
+
Date: 'date',
|
|
115
|
+
LastDate: 'last-date',
|
|
116
|
+
Manifestation: 'manifestation',
|
|
117
|
+
Onset: 'onset',
|
|
118
|
+
Route: 'route',
|
|
119
|
+
Severity: 'severity',
|
|
120
|
+
Type: 'type',
|
|
68
121
|
OnsetDateTime: 'onset-datetime',
|
|
69
122
|
Recorder: 'recorder',
|
|
70
123
|
};
|
|
@@ -79,6 +132,14 @@ export const AllergyIntoleranceSearchParamToClaimKey = {
|
|
|
79
132
|
[AllergyIntoleranceSearchParamNames.VerificationStatus]: AllergyIntoleranceClaimsFhirApi.VerificationStatus,
|
|
80
133
|
[AllergyIntoleranceSearchParamNames.Category]: AllergyIntoleranceClaimsFhirApi.Category,
|
|
81
134
|
[AllergyIntoleranceSearchParamNames.Criticality]: AllergyIntoleranceClaimsFhirApi.Criticality,
|
|
135
|
+
[AllergyIntoleranceSearchParamNames.Asserter]: AllergyIntoleranceClaimsFhirApi.Asserter,
|
|
136
|
+
[AllergyIntoleranceSearchParamNames.Date]: AllergyIntoleranceClaimsFhirApi.Date,
|
|
137
|
+
[AllergyIntoleranceSearchParamNames.LastDate]: AllergyIntoleranceClaimsFhirApi.LastDate,
|
|
138
|
+
[AllergyIntoleranceSearchParamNames.Manifestation]: AllergyIntoleranceClaimsFhirApi.Manifestation,
|
|
139
|
+
[AllergyIntoleranceSearchParamNames.Onset]: AllergyIntoleranceClaimsFhirApi.Onset,
|
|
140
|
+
[AllergyIntoleranceSearchParamNames.Route]: AllergyIntoleranceClaimsFhirApi.Route,
|
|
141
|
+
[AllergyIntoleranceSearchParamNames.Severity]: AllergyIntoleranceClaimsFhirApi.Severity,
|
|
142
|
+
[AllergyIntoleranceSearchParamNames.Type]: AllergyIntoleranceClaimsFhirApi.Type,
|
|
82
143
|
[AllergyIntoleranceSearchParamNames.OnsetDateTime]: AllergyIntoleranceClaimsFhirApi.OnsetDateTime,
|
|
83
144
|
[AllergyIntoleranceSearchParamNames.Recorder]: AllergyIntoleranceClaimsFhirApi.Recorder,
|
|
84
145
|
};
|
|
@@ -93,6 +154,14 @@ export const AllergyIntoleranceClaimsFhirApiMap = {
|
|
|
93
154
|
[AllergyIntoleranceClaimsFhirApi.VerificationStatus]: String,
|
|
94
155
|
[AllergyIntoleranceClaimsFhirApi.Category]: String,
|
|
95
156
|
[AllergyIntoleranceClaimsFhirApi.Criticality]: String,
|
|
157
|
+
[AllergyIntoleranceClaimsFhirApi.Asserter]: String,
|
|
158
|
+
[AllergyIntoleranceClaimsFhirApi.Date]: String,
|
|
159
|
+
[AllergyIntoleranceClaimsFhirApi.LastDate]: String,
|
|
160
|
+
[AllergyIntoleranceClaimsFhirApi.Manifestation]: String,
|
|
161
|
+
[AllergyIntoleranceClaimsFhirApi.Onset]: String,
|
|
162
|
+
[AllergyIntoleranceClaimsFhirApi.Route]: String,
|
|
163
|
+
[AllergyIntoleranceClaimsFhirApi.Severity]: String,
|
|
164
|
+
[AllergyIntoleranceClaimsFhirApi.Type]: String,
|
|
96
165
|
[AllergyIntoleranceClaimsFhirApi.OnsetDateTime]: String,
|
|
97
166
|
[AllergyIntoleranceClaimsFhirApi.Recorder]: String,
|
|
98
167
|
};
|
|
@@ -111,7 +180,15 @@ export const AllergyIntoleranceClaimSpecs = [
|
|
|
111
180
|
{ key: AllergyIntoleranceClaim.ClinicalStatus, meaning: 'Clinical status code.', example: 'active' },
|
|
112
181
|
{ key: AllergyIntoleranceClaim.VerificationStatus, meaning: 'Verification status code.', example: 'confirmed' },
|
|
113
182
|
{ key: AllergyIntoleranceClaim.Category, meaning: 'Category value.', example: 'food' },
|
|
114
|
-
{ key: AllergyIntoleranceClaim.Criticality, meaning: '
|
|
183
|
+
{ key: AllergyIntoleranceClaim.Criticality, meaning: 'Potential future harm if exposed to the substance.', example: AllergyIntoleranceCriticalities.High },
|
|
184
|
+
{ key: AllergyIntoleranceClaim.Asserter, meaning: 'Source of the allergy assertion.', example: 'Practitioner/practitioner-123' },
|
|
185
|
+
{ key: AllergyIntoleranceClaim.RecordedDate, meaning: 'Date the allergy record was first captured.', example: '2026-01-10T10:00:00Z' },
|
|
186
|
+
{ key: AllergyIntoleranceClaim.LastOccurrence, meaning: 'Date of the most recent known reaction.', example: '2026-01-09T18:00:00Z' },
|
|
187
|
+
{ key: AllergyIntoleranceClaim.Manifestation, meaning: 'Clinical manifestation of the reaction.', example: 'http://snomed.info/sct|247472004' },
|
|
188
|
+
{ key: AllergyIntoleranceClaim.Onset, meaning: 'Searchable onset value for the allergy or reaction.', example: '2026-01-10' },
|
|
189
|
+
{ key: AllergyIntoleranceClaim.Route, meaning: 'Exposure route for the reaction.', example: 'http://snomed.info/sct|26643006' },
|
|
190
|
+
{ key: AllergyIntoleranceClaim.Severity, meaning: 'Severity of one observed reaction event, distinct from future-risk criticality.', example: AllergyIntoleranceReactionSeverities.Moderate },
|
|
191
|
+
{ key: AllergyIntoleranceClaim.Type, meaning: 'Allergy or intolerance classification.', example: 'allergy' },
|
|
115
192
|
{ key: AllergyIntoleranceClaim.OnsetDateTime, meaning: 'Onset date/time.', example: '2026-01-10T10:00:00Z' },
|
|
116
193
|
{ key: AllergyIntoleranceClaim.Recorder, meaning: 'Recorder reference.', example: 'did:web:<domain>:organization:taxid:<TAXID>:member:<MEMBER_ID>:<roleCode>' },
|
|
117
194
|
];
|
|
@@ -32,6 +32,16 @@ export declare const MedicationStatementClaim: {
|
|
|
32
32
|
readonly Status: "MedicationStatement.status";
|
|
33
33
|
readonly Category: "MedicationStatement.category";
|
|
34
34
|
readonly Effective: "MedicationStatement.effective";
|
|
35
|
+
/**
|
|
36
|
+
* Start of FHIR R4 `effectivePeriod`; mutually exclusive with `Effective`.
|
|
37
|
+
* @see https://hl7.org/fhir/R4/medicationstatement.html
|
|
38
|
+
*/
|
|
39
|
+
readonly EffectivePeriodStart: "MedicationStatement.effective-period-start";
|
|
40
|
+
/**
|
|
41
|
+
* End of FHIR R4 `effectivePeriod`; mutually exclusive with `Effective`.
|
|
42
|
+
* @see https://hl7.org/fhir/R4/medicationstatement.html
|
|
43
|
+
*/
|
|
44
|
+
readonly EffectivePeriodEnd: "MedicationStatement.effective-period-end";
|
|
35
45
|
/** Official token SearchParameter `code`; maps to the medication concept, not a root FHIR element. */
|
|
36
46
|
readonly Code: "MedicationStatement.code";
|
|
37
47
|
/** Local/manual `CodeableConcept.text` companion for the medication concept. */
|
|
@@ -32,6 +32,16 @@ export const MedicationStatementClaim = {
|
|
|
32
32
|
Status: 'MedicationStatement.status',
|
|
33
33
|
Category: 'MedicationStatement.category',
|
|
34
34
|
Effective: 'MedicationStatement.effective',
|
|
35
|
+
/**
|
|
36
|
+
* Start of FHIR R4 `effectivePeriod`; mutually exclusive with `Effective`.
|
|
37
|
+
* @see https://hl7.org/fhir/R4/medicationstatement.html
|
|
38
|
+
*/
|
|
39
|
+
EffectivePeriodStart: 'MedicationStatement.effective-period-start',
|
|
40
|
+
/**
|
|
41
|
+
* End of FHIR R4 `effectivePeriod`; mutually exclusive with `Effective`.
|
|
42
|
+
* @see https://hl7.org/fhir/R4/medicationstatement.html
|
|
43
|
+
*/
|
|
44
|
+
EffectivePeriodEnd: 'MedicationStatement.effective-period-end',
|
|
35
45
|
/** Official token SearchParameter `code`; maps to the medication concept, not a root FHIR element. */
|
|
36
46
|
Code: 'MedicationStatement.code',
|
|
37
47
|
/** Local/manual `CodeableConcept.text` companion for the medication concept. */
|
|
@@ -112,6 +122,8 @@ export const MedicationStatementClaimSpecs = [
|
|
|
112
122
|
{ key: MedicationStatementClaim.Adherence, meaning: 'Official R5 adherence token SearchParameter.', example: `${MEDICATION_STATEMENT_ADHERENCE_CODE_SYSTEM}|taking-as-directed` },
|
|
113
123
|
{ key: MedicationStatementClaim.AdherenceText, meaning: 'Local/manual adherence CodeableConcept.text.', example: 'Tomando según indicación' },
|
|
114
124
|
{ key: MedicationStatementClaim.AdherenceDisplay, meaning: 'Canonical adherence Coding.display.', example: 'Taking As Directed' },
|
|
125
|
+
{ key: MedicationStatementClaim.EffectivePeriodStart, meaning: 'Start of the medication treatment period.', example: '2026-09-01T08:00:00Z' },
|
|
126
|
+
{ key: MedicationStatementClaim.EffectivePeriodEnd, meaning: 'End of the medication treatment period.', example: '2026-09-10T20:00:00Z' },
|
|
115
127
|
];
|
|
116
128
|
/**
|
|
117
129
|
* Flat claims contract for MedicationStatement using FHIR API-like search params.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor.js';
|
|
2
|
+
import { type AllergyIntoleranceCriticality, type AllergyIntoleranceReactionSeverity } from '../models/interoperable-claims/allergy-intolerance-claims.js';
|
|
2
3
|
/**
|
|
3
4
|
* Typed editor for one staged AllergyIntolerance resource entry.
|
|
4
5
|
*
|
|
@@ -46,9 +47,17 @@ export declare class AllergyIntoleranceEntryEditor extends ClinicalResourceEntry
|
|
|
46
47
|
/** Reads the allergy category. */
|
|
47
48
|
getCategory(): string | undefined;
|
|
48
49
|
/** Writes the allergy criticality. */
|
|
49
|
-
setCriticality(criticality?:
|
|
50
|
+
setCriticality(criticality?: AllergyIntoleranceCriticality | null): this;
|
|
50
51
|
/** Reads the allergy criticality. */
|
|
51
|
-
getCriticality():
|
|
52
|
+
getCriticality(): AllergyIntoleranceCriticality | undefined;
|
|
53
|
+
/** Writes the clinical manifestation required for a reaction event. */
|
|
54
|
+
setReactionManifestation(manifestation?: string | null): this;
|
|
55
|
+
/** Reads the clinical manifestation for the reaction event. */
|
|
56
|
+
getReactionManifestation(): string | undefined;
|
|
57
|
+
/** Writes reaction-event severity, which is distinct from potential future-risk criticality. */
|
|
58
|
+
setReactionSeverity(severity?: AllergyIntoleranceReactionSeverity | null): this;
|
|
59
|
+
/** Reads reaction-event severity. */
|
|
60
|
+
getReactionSeverity(): AllergyIntoleranceReactionSeverity | undefined;
|
|
52
61
|
/** Writes the onset date/time. */
|
|
53
62
|
setOnsetDateTime(value?: string | null): this;
|
|
54
63
|
/** Reads the onset date/time. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ClinicalResourceEntryEditor } from './clinical-resource-entry-editor.js';
|
|
2
|
-
import { AllergyIntoleranceClaim } from '../models/interoperable-claims/allergy-intolerance-claims.js';
|
|
2
|
+
import { AllergyIntoleranceClaim, } from '../models/interoperable-claims/allergy-intolerance-claims.js';
|
|
3
3
|
import { BundleEditableResourceTypes } from '../models/bundle-editor-types.js';
|
|
4
4
|
import { registerBundleEntryEditor } from './bundle-editor-registry.js';
|
|
5
5
|
/**
|
|
@@ -50,6 +50,14 @@ export class AllergyIntoleranceEntryEditor extends ClinicalResourceEntryEditor {
|
|
|
50
50
|
setCriticality(criticality) { return this.setScalarClaim(AllergyIntoleranceClaim.Criticality, criticality); }
|
|
51
51
|
/** Reads the allergy criticality. */
|
|
52
52
|
getCriticality() { return this.getScalarClaim(AllergyIntoleranceClaim.Criticality); }
|
|
53
|
+
/** Writes the clinical manifestation required for a reaction event. */
|
|
54
|
+
setReactionManifestation(manifestation) { return this.setScalarClaim(AllergyIntoleranceClaim.Manifestation, manifestation); }
|
|
55
|
+
/** Reads the clinical manifestation for the reaction event. */
|
|
56
|
+
getReactionManifestation() { return this.getScalarClaim(AllergyIntoleranceClaim.Manifestation); }
|
|
57
|
+
/** Writes reaction-event severity, which is distinct from potential future-risk criticality. */
|
|
58
|
+
setReactionSeverity(severity) { return this.setScalarClaim(AllergyIntoleranceClaim.Severity, severity); }
|
|
59
|
+
/** Reads reaction-event severity. */
|
|
60
|
+
getReactionSeverity() { return this.getScalarClaim(AllergyIntoleranceClaim.Severity); }
|
|
53
61
|
/** Writes the onset date/time. */
|
|
54
62
|
setOnsetDateTime(value) { return this.setScalarClaim(AllergyIntoleranceClaim.OnsetDateTime, value); }
|
|
55
63
|
/** Reads the onset date/time. */
|
|
@@ -31,6 +31,14 @@ export declare class MedicationStatementEntryEditor extends ClinicalResourceEntr
|
|
|
31
31
|
setEffective(value?: string | null): this;
|
|
32
32
|
/** Returns the effective date or period token. */
|
|
33
33
|
getEffective(): string | undefined;
|
|
34
|
+
/** Sets the start of `effectivePeriod` and clears the mutually exclusive dateTime claim. */
|
|
35
|
+
setEffectivePeriodStart(value?: string | null): this;
|
|
36
|
+
/** Returns the start of `effectivePeriod`. */
|
|
37
|
+
getEffectivePeriodStart(): string | undefined;
|
|
38
|
+
/** Sets the end of `effectivePeriod`, promoting an existing dateTime value to the period start. */
|
|
39
|
+
setEffectivePeriodEnd(value?: string | null): this;
|
|
40
|
+
/** Returns the end of `effectivePeriod`. */
|
|
41
|
+
getEffectivePeriodEnd(): string | undefined;
|
|
34
42
|
/** Sets the medication code from `code`, `system|code`, or separate `system, code` arguments. */
|
|
35
43
|
setCode(code?: string | null): this;
|
|
36
44
|
setCode(codeSystem: string, codeValue: string): this;
|
|
@@ -31,9 +31,34 @@ export class MedicationStatementEntryEditor extends ClinicalResourceEntryEditor
|
|
|
31
31
|
/** Returns the medication statement status. */
|
|
32
32
|
getStatus() { return this.getScalarClaim(MedicationStatementClaim.Status); }
|
|
33
33
|
/** Sets the effective date or period token stored in the flat-claims model. */
|
|
34
|
-
setEffective(value) {
|
|
34
|
+
setEffective(value) {
|
|
35
|
+
this.removeClaim(MedicationStatementClaim.EffectivePeriodStart);
|
|
36
|
+
this.removeClaim(MedicationStatementClaim.EffectivePeriodEnd);
|
|
37
|
+
return this.setScalarClaim(MedicationStatementClaim.Effective, value);
|
|
38
|
+
}
|
|
35
39
|
/** Returns the effective date or period token. */
|
|
36
40
|
getEffective() { return this.getScalarClaim(MedicationStatementClaim.Effective); }
|
|
41
|
+
/** Sets the start of `effectivePeriod` and clears the mutually exclusive dateTime claim. */
|
|
42
|
+
setEffectivePeriodStart(value) {
|
|
43
|
+
if (value?.trim())
|
|
44
|
+
this.removeClaim(MedicationStatementClaim.Effective);
|
|
45
|
+
return this.setScalarClaim(MedicationStatementClaim.EffectivePeriodStart, value);
|
|
46
|
+
}
|
|
47
|
+
/** Returns the start of `effectivePeriod`. */
|
|
48
|
+
getEffectivePeriodStart() { return this.getScalarClaim(MedicationStatementClaim.EffectivePeriodStart); }
|
|
49
|
+
/** Sets the end of `effectivePeriod`, promoting an existing dateTime value to the period start. */
|
|
50
|
+
setEffectivePeriodEnd(value) {
|
|
51
|
+
if (value?.trim()) {
|
|
52
|
+
const effective = this.getEffective();
|
|
53
|
+
if (effective && !this.getEffectivePeriodStart()) {
|
|
54
|
+
this.setScalarClaim(MedicationStatementClaim.EffectivePeriodStart, effective);
|
|
55
|
+
}
|
|
56
|
+
this.removeClaim(MedicationStatementClaim.Effective);
|
|
57
|
+
}
|
|
58
|
+
return this.setScalarClaim(MedicationStatementClaim.EffectivePeriodEnd, value);
|
|
59
|
+
}
|
|
60
|
+
/** Returns the end of `effectivePeriod`. */
|
|
61
|
+
getEffectivePeriodEnd() { return this.getScalarClaim(MedicationStatementClaim.EffectivePeriodEnd); }
|
|
37
62
|
setCode(codeOrSystem, codeValue) { return this.setCodingTokenCode(MedicationStatementClaim.Code, codeOrSystem, codeValue); }
|
|
38
63
|
/** Returns only the medication code value. */
|
|
39
64
|
getCode() { return this.getCodingTokenCode(MedicationStatementClaim.Code); }
|
|
@@ -34,4 +34,11 @@ export declare class ObservationEntryEditor extends VitalSignEntryEditor {
|
|
|
34
34
|
setHasMemberList(references: readonly string[]): this;
|
|
35
35
|
/** Reads the has-member list. */
|
|
36
36
|
getHasMemberList(): string[];
|
|
37
|
+
/**
|
|
38
|
+
* Writes the human-readable FHIR R4 `Observation.referenceRange.text` guidance.
|
|
39
|
+
* @see https://hl7.org/fhir/R4/observation.html
|
|
40
|
+
*/
|
|
41
|
+
setReferenceRangeText(value?: string | null): this;
|
|
42
|
+
/** Reads the human-readable reference-range guidance. */
|
|
43
|
+
getReferenceRangeText(): string | undefined;
|
|
37
44
|
}
|
|
@@ -71,5 +71,16 @@ export class ObservationEntryEditor extends VitalSignEntryEditor {
|
|
|
71
71
|
getHasMemberList() {
|
|
72
72
|
return getClaimValues(this.getClaims(), ObservationClaim.HasMember);
|
|
73
73
|
}
|
|
74
|
+
/**
|
|
75
|
+
* Writes the human-readable FHIR R4 `Observation.referenceRange.text` guidance.
|
|
76
|
+
* @see https://hl7.org/fhir/R4/observation.html
|
|
77
|
+
*/
|
|
78
|
+
setReferenceRangeText(value) {
|
|
79
|
+
return this.setScalarClaim(ObservationClaim.ReferenceRangeText, value);
|
|
80
|
+
}
|
|
81
|
+
/** Reads the human-readable reference-range guidance. */
|
|
82
|
+
getReferenceRangeText() {
|
|
83
|
+
return this.getScalarClaim(ObservationClaim.ReferenceRangeText);
|
|
84
|
+
}
|
|
74
85
|
}
|
|
75
86
|
registerBundleEntryEditor(BundleEditableResourceTypes.observation, ObservationEntryEditor);
|