@metriport/fhir-sdk 0.30.0-alpha.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/LICENSE +21 -0
- package/README.md +564 -0
- package/dist/__tests__/careplan.test.d.ts +2 -0
- package/dist/__tests__/careplan.test.d.ts.map +1 -0
- package/dist/__tests__/careplan.test.js +544 -0
- package/dist/__tests__/careplan.test.js.map +1 -0
- package/dist/__tests__/clinical-dates.test.d.ts +2 -0
- package/dist/__tests__/clinical-dates.test.d.ts.map +1 -0
- package/dist/__tests__/clinical-dates.test.js +341 -0
- package/dist/__tests__/clinical-dates.test.js.map +1 -0
- package/dist/__tests__/coding-utilities.test.d.ts +2 -0
- package/dist/__tests__/coding-utilities.test.d.ts.map +1 -0
- package/dist/__tests__/coding-utilities.test.js +482 -0
- package/dist/__tests__/coding-utilities.test.js.map +1 -0
- package/dist/__tests__/date-range-performance.test.d.ts +2 -0
- package/dist/__tests__/date-range-performance.test.d.ts.map +1 -0
- package/dist/__tests__/date-range-performance.test.js +218 -0
- package/dist/__tests__/date-range-performance.test.js.map +1 -0
- package/dist/__tests__/date-range-search.test.d.ts +2 -0
- package/dist/__tests__/date-range-search.test.d.ts.map +1 -0
- package/dist/__tests__/date-range-search.test.js +215 -0
- package/dist/__tests__/date-range-search.test.js.map +1 -0
- package/dist/__tests__/env-setup.d.ts +2 -0
- package/dist/__tests__/env-setup.d.ts.map +1 -0
- package/dist/__tests__/env-setup.js +37 -0
- package/dist/__tests__/env-setup.js.map +1 -0
- package/dist/__tests__/fhir-bundle-sdk-basic.test.d.ts +2 -0
- package/dist/__tests__/fhir-bundle-sdk-basic.test.d.ts.map +1 -0
- package/dist/__tests__/fhir-bundle-sdk-basic.test.js +19 -0
- package/dist/__tests__/fhir-bundle-sdk-basic.test.js.map +1 -0
- package/dist/__tests__/fhir-bundle-sdk.test.d.ts +2 -0
- package/dist/__tests__/fhir-bundle-sdk.test.d.ts.map +1 -0
- package/dist/__tests__/fhir-bundle-sdk.test.js +953 -0
- package/dist/__tests__/fhir-bundle-sdk.test.js.map +1 -0
- package/dist/__tests__/fixtures/fhir-bundles.d.ts +31 -0
- package/dist/__tests__/fixtures/fhir-bundles.d.ts.map +1 -0
- package/dist/__tests__/fixtures/fhir-bundles.js +487 -0
- package/dist/__tests__/fixtures/fhir-bundles.js.map +1 -0
- package/dist/__tests__/phase1-verification.test.d.ts +2 -0
- package/dist/__tests__/phase1-verification.test.d.ts.map +1 -0
- package/dist/__tests__/phase1-verification.test.js +141 -0
- package/dist/__tests__/phase1-verification.test.js.map +1 -0
- package/dist/__tests__/phase2-verification.test.d.ts +2 -0
- package/dist/__tests__/phase2-verification.test.d.ts.map +1 -0
- package/dist/__tests__/phase2-verification.test.js +234 -0
- package/dist/__tests__/phase2-verification.test.js.map +1 -0
- package/dist/__tests__/phase3-verification.test.d.ts +2 -0
- package/dist/__tests__/phase3-verification.test.d.ts.map +1 -0
- package/dist/__tests__/phase3-verification.test.js +121 -0
- package/dist/__tests__/phase3-verification.test.js.map +1 -0
- package/dist/__tests__/phase4-verification.test.d.ts +2 -0
- package/dist/__tests__/phase4-verification.test.d.ts.map +1 -0
- package/dist/__tests__/phase4-verification.test.js +168 -0
- package/dist/__tests__/phase4-verification.test.js.map +1 -0
- package/dist/__tests__/phase5-verification.test.d.ts +2 -0
- package/dist/__tests__/phase5-verification.test.d.ts.map +1 -0
- package/dist/__tests__/phase5-verification.test.js +397 -0
- package/dist/__tests__/phase5-verification.test.js.map +1 -0
- package/dist/__tests__/reverse-references.test.d.ts +2 -0
- package/dist/__tests__/reverse-references.test.d.ts.map +1 -0
- package/dist/__tests__/reverse-references.test.js +294 -0
- package/dist/__tests__/reverse-references.test.js.map +1 -0
- package/dist/__tests__/type-guards.test.d.ts +2 -0
- package/dist/__tests__/type-guards.test.d.ts.map +1 -0
- package/dist/__tests__/type-guards.test.js +163 -0
- package/dist/__tests__/type-guards.test.js.map +1 -0
- package/dist/clinical-dates.d.ts +26 -0
- package/dist/clinical-dates.d.ts.map +1 -0
- package/dist/clinical-dates.js +571 -0
- package/dist/clinical-dates.js.map +1 -0
- package/dist/fhir-bundle-sdk.d.ts +233 -0
- package/dist/fhir-bundle-sdk.d.ts.map +1 -0
- package/dist/fhir-bundle-sdk.js +545 -0
- package/dist/fhir-bundle-sdk.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/bundle-operations.d.ts +14 -0
- package/dist/internal/bundle-operations.d.ts.map +1 -0
- package/dist/internal/bundle-operations.js +55 -0
- package/dist/internal/bundle-operations.js.map +1 -0
- package/dist/internal/coding-systems.d.ts +48 -0
- package/dist/internal/coding-systems.d.ts.map +1 -0
- package/dist/internal/coding-systems.js +55 -0
- package/dist/internal/coding-systems.js.map +1 -0
- package/dist/internal/coding-utilities.d.ts +27 -0
- package/dist/internal/coding-utilities.d.ts.map +1 -0
- package/dist/internal/coding-utilities.js +297 -0
- package/dist/internal/coding-utilities.js.map +1 -0
- package/dist/internal/date-extraction.d.ts +12 -0
- package/dist/internal/date-extraction.d.ts.map +1 -0
- package/dist/internal/date-extraction.js +629 -0
- package/dist/internal/date-extraction.js.map +1 -0
- package/dist/internal/graph-traversal.d.ts +13 -0
- package/dist/internal/graph-traversal.d.ts.map +1 -0
- package/dist/internal/graph-traversal.js +89 -0
- package/dist/internal/graph-traversal.js.map +1 -0
- package/dist/internal/indexing.d.ts +17 -0
- package/dist/internal/indexing.d.ts.map +1 -0
- package/dist/internal/indexing.js +129 -0
- package/dist/internal/indexing.js.map +1 -0
- package/dist/internal/llm-context.d.ts +40 -0
- package/dist/internal/llm-context.d.ts.map +1 -0
- package/dist/internal/llm-context.js +214 -0
- package/dist/internal/llm-context.js.map +1 -0
- package/dist/internal/reference-resolution.d.ts +29 -0
- package/dist/internal/reference-resolution.d.ts.map +1 -0
- package/dist/internal/reference-resolution.js +338 -0
- package/dist/internal/reference-resolution.js.map +1 -0
- package/dist/internal/reference-utils.d.ts +26 -0
- package/dist/internal/reference-utils.d.ts.map +1 -0
- package/dist/internal/reference-utils.js +89 -0
- package/dist/internal/reference-utils.js.map +1 -0
- package/dist/internal/transparent-proxy.d.ts +12 -0
- package/dist/internal/transparent-proxy.d.ts.map +1 -0
- package/dist/internal/transparent-proxy.js +81 -0
- package/dist/internal/transparent-proxy.js.map +1 -0
- package/dist/internal/validation.d.ts +16 -0
- package/dist/internal/validation.d.ts.map +1 -0
- package/dist/internal/validation.js +45 -0
- package/dist/internal/validation.js.map +1 -0
- package/dist/type-guards.d.ts +212 -0
- package/dist/type-guards.d.ts.map +1 -0
- package/dist/type-guards.js +375 -0
- package/dist/type-guards.js.map +1 -0
- package/dist/types/coding-fields.d.ts +311 -0
- package/dist/types/coding-fields.d.ts.map +1 -0
- package/dist/types/coding-fields.js +3 -0
- package/dist/types/coding-fields.js.map +1 -0
- package/dist/types/sdk-types.d.ts +107 -0
- package/dist/types/sdk-types.d.ts.map +1 -0
- package/dist/types/sdk-types.js +17 -0
- package/dist/types/sdk-types.js.map +1 -0
- package/dist/types/smart-resources.d.ts +470 -0
- package/dist/types/smart-resources.d.ts.map +1 -0
- package/dist/types/smart-resources.js +249 -0
- package/dist/types/smart-resources.js.map +1 -0
- package/dist/utils/interval-tree/index.d.ts +87 -0
- package/dist/utils/interval-tree/index.d.ts.map +1 -0
- package/dist/utils/interval-tree/index.js +774 -0
- package/dist/utils/interval-tree/index.js.map +1 -0
- package/dist/utils/interval-tree/shallowequal/arrays.d.ts +3 -0
- package/dist/utils/interval-tree/shallowequal/arrays.d.ts.map +1 -0
- package/dist/utils/interval-tree/shallowequal/arrays.js +25 -0
- package/dist/utils/interval-tree/shallowequal/arrays.js.map +1 -0
- package/dist/utils/interval-tree/shallowequal/index.d.ts +6 -0
- package/dist/utils/interval-tree/shallowequal/index.d.ts.map +1 -0
- package/dist/utils/interval-tree/shallowequal/index.js +28 -0
- package/dist/utils/interval-tree/shallowequal/index.js.map +1 -0
- package/dist/utils/interval-tree/shallowequal/objects.d.ts +3 -0
- package/dist/utils/interval-tree/shallowequal/objects.d.ts.map +1 -0
- package/dist/utils/interval-tree/shallowequal/objects.js +28 -0
- package/dist/utils/interval-tree/shallowequal/objects.js.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import type { Resource, Patient, Observation, DiagnosticReport, Encounter, Practitioner, PractitionerRole, Organization, Location, AllergyIntolerance, Condition, Composition, Coverage, DocumentReference, FamilyMemberHistory, Immunization, Medication, MedicationAdministration, MedicationDispense, MedicationRequest, MedicationStatement, Procedure, RelatedPerson, RiskAssessment, ServiceRequest, CarePlan, Bundle } from "@medplum/fhirtypes";
|
|
2
|
+
import type { Smart } from "./types/smart-resources";
|
|
3
|
+
import type { SmartPatient, SmartObservation, SmartDiagnosticReport, SmartEncounter, SmartPractitioner, SmartPractitionerRole, SmartOrganization, SmartLocation, SmartAllergyIntolerance, SmartCondition, SmartComposition, SmartCoverage, SmartDocumentReference, SmartFamilyMemberHistory, SmartImmunization, SmartMedication, SmartMedicationAdministration, SmartMedicationDispense, SmartMedicationRequest, SmartMedicationStatement, SmartProcedure, SmartRelatedPerson, SmartRiskAssessment, SmartServiceRequest, SmartCarePlan } from "./types/coding-fields";
|
|
4
|
+
/**
|
|
5
|
+
* Patient type guard for Smart resources
|
|
6
|
+
*/
|
|
7
|
+
export declare function isPatient(resource: Smart<Resource> | undefined): resource is SmartPatient;
|
|
8
|
+
/**
|
|
9
|
+
* Observation type guard for Smart resources
|
|
10
|
+
*/
|
|
11
|
+
export declare function isObservation(resource: Smart<Resource> | undefined): resource is SmartObservation;
|
|
12
|
+
/**
|
|
13
|
+
* DiagnosticReport type guard for Smart resources
|
|
14
|
+
*/
|
|
15
|
+
export declare function isDiagnosticReport(resource: Smart<Resource> | undefined): resource is SmartDiagnosticReport;
|
|
16
|
+
/**
|
|
17
|
+
* Encounter type guard for Smart resources
|
|
18
|
+
*/
|
|
19
|
+
export declare function isEncounter(resource: Smart<Resource> | undefined): resource is SmartEncounter;
|
|
20
|
+
/**
|
|
21
|
+
* Practitioner type guard for Smart resources
|
|
22
|
+
*/
|
|
23
|
+
export declare function isPractitioner(resource: Smart<Resource> | undefined): resource is SmartPractitioner;
|
|
24
|
+
/**
|
|
25
|
+
* PractitionerRole type guard for Smart resources
|
|
26
|
+
*/
|
|
27
|
+
export declare function isPractitionerRole(resource: Smart<Resource> | undefined): resource is SmartPractitionerRole;
|
|
28
|
+
/**
|
|
29
|
+
* Organization type guard for Smart resources
|
|
30
|
+
*/
|
|
31
|
+
export declare function isOrganization(resource: Smart<Resource> | undefined): resource is SmartOrganization;
|
|
32
|
+
/**
|
|
33
|
+
* Location type guard for Smart resources
|
|
34
|
+
*/
|
|
35
|
+
export declare function isLocation(resource: Smart<Resource> | undefined): resource is SmartLocation;
|
|
36
|
+
/**
|
|
37
|
+
* AllergyIntolerance type guard for Smart resources
|
|
38
|
+
*/
|
|
39
|
+
export declare function isAllergyIntolerance(resource: Smart<Resource> | undefined): resource is SmartAllergyIntolerance;
|
|
40
|
+
/**
|
|
41
|
+
* Condition type guard for Smart resources
|
|
42
|
+
*/
|
|
43
|
+
export declare function isCondition(resource: Smart<Resource> | undefined): resource is SmartCondition;
|
|
44
|
+
/**
|
|
45
|
+
* Composition type guard for Smart resources
|
|
46
|
+
*/
|
|
47
|
+
export declare function isComposition(resource: Smart<Resource> | undefined): resource is SmartComposition;
|
|
48
|
+
/**
|
|
49
|
+
* Coverage type guard for Smart resources
|
|
50
|
+
*/
|
|
51
|
+
export declare function isCoverage(resource: Smart<Resource> | undefined): resource is SmartCoverage;
|
|
52
|
+
/**
|
|
53
|
+
* DocumentReference type guard for Smart resources
|
|
54
|
+
*/
|
|
55
|
+
export declare function isDocumentReference(resource: Smart<Resource> | undefined): resource is SmartDocumentReference;
|
|
56
|
+
/**
|
|
57
|
+
* FamilyMemberHistory type guard for Smart resources
|
|
58
|
+
*/
|
|
59
|
+
export declare function isFamilyMemberHistory(resource: Smart<Resource> | undefined): resource is SmartFamilyMemberHistory;
|
|
60
|
+
/**
|
|
61
|
+
* Immunization type guard for Smart resources
|
|
62
|
+
*/
|
|
63
|
+
export declare function isImmunization(resource: Smart<Resource> | undefined): resource is SmartImmunization;
|
|
64
|
+
/**
|
|
65
|
+
* Medication type guard for Smart resources
|
|
66
|
+
*/
|
|
67
|
+
export declare function isMedication(resource: Smart<Resource> | undefined): resource is SmartMedication;
|
|
68
|
+
/**
|
|
69
|
+
* MedicationAdministration type guard for Smart resources
|
|
70
|
+
*/
|
|
71
|
+
export declare function isMedicationAdministration(resource: Smart<Resource> | undefined): resource is SmartMedicationAdministration;
|
|
72
|
+
/**
|
|
73
|
+
* MedicationDispense type guard for Smart resources
|
|
74
|
+
*/
|
|
75
|
+
export declare function isMedicationDispense(resource: Smart<Resource> | undefined): resource is SmartMedicationDispense;
|
|
76
|
+
/**
|
|
77
|
+
* MedicationRequest type guard for Smart resources
|
|
78
|
+
*/
|
|
79
|
+
export declare function isMedicationRequest(resource: Smart<Resource> | undefined): resource is SmartMedicationRequest;
|
|
80
|
+
/**
|
|
81
|
+
* MedicationStatement type guard for Smart resources
|
|
82
|
+
*/
|
|
83
|
+
export declare function isMedicationStatement(resource: Smart<Resource> | undefined): resource is SmartMedicationStatement;
|
|
84
|
+
/**
|
|
85
|
+
* Procedure type guard for Smart resources
|
|
86
|
+
*/
|
|
87
|
+
export declare function isProcedure(resource: Smart<Resource> | undefined): resource is SmartProcedure;
|
|
88
|
+
/**
|
|
89
|
+
* RelatedPerson type guard for Smart resources
|
|
90
|
+
*/
|
|
91
|
+
export declare function isRelatedPerson(resource: Smart<Resource> | undefined): resource is SmartRelatedPerson;
|
|
92
|
+
/**
|
|
93
|
+
* RiskAssessment type guard for Smart resources
|
|
94
|
+
*/
|
|
95
|
+
export declare function isRiskAssessment(resource: Smart<Resource> | undefined): resource is SmartRiskAssessment;
|
|
96
|
+
/**
|
|
97
|
+
* ServiceRequest type guard for Smart resources
|
|
98
|
+
*/
|
|
99
|
+
export declare function isServiceRequest(resource: Smart<Resource> | undefined): resource is SmartServiceRequest;
|
|
100
|
+
/**
|
|
101
|
+
* CarePlan type guard for Smart resources
|
|
102
|
+
*/
|
|
103
|
+
export declare function isCarePlan(resource: Smart<Resource> | undefined): resource is SmartCarePlan;
|
|
104
|
+
/**
|
|
105
|
+
* Bundle type guard for Smart resources
|
|
106
|
+
*/
|
|
107
|
+
export declare function isBundle(resource: Smart<Resource> | undefined): resource is Smart<Bundle>;
|
|
108
|
+
/**
|
|
109
|
+
* Patient type guard for plain FHIR resources
|
|
110
|
+
*/
|
|
111
|
+
export declare function isPlainPatient(resource: Resource | undefined): resource is Patient;
|
|
112
|
+
/**
|
|
113
|
+
* Observation type guard for plain FHIR resources
|
|
114
|
+
*/
|
|
115
|
+
export declare function isPlainObservation(resource: Resource | undefined): resource is Observation;
|
|
116
|
+
/**
|
|
117
|
+
* DiagnosticReport type guard for plain FHIR resources
|
|
118
|
+
*/
|
|
119
|
+
export declare function isPlainDiagnosticReport(resource: Resource | undefined): resource is DiagnosticReport;
|
|
120
|
+
/**
|
|
121
|
+
* Encounter type guard for plain FHIR resources
|
|
122
|
+
*/
|
|
123
|
+
export declare function isPlainEncounter(resource: Resource | undefined): resource is Encounter;
|
|
124
|
+
/**
|
|
125
|
+
* Practitioner type guard for plain FHIR resources
|
|
126
|
+
*/
|
|
127
|
+
export declare function isPlainPractitioner(resource: Resource | undefined): resource is Practitioner;
|
|
128
|
+
/**
|
|
129
|
+
* PractitionerRole type guard for plain FHIR resources
|
|
130
|
+
*/
|
|
131
|
+
export declare function isPlainPractitionerRole(resource: Resource | undefined): resource is PractitionerRole;
|
|
132
|
+
/**
|
|
133
|
+
* Organization type guard for plain FHIR resources
|
|
134
|
+
*/
|
|
135
|
+
export declare function isPlainOrganization(resource: Resource | undefined): resource is Organization;
|
|
136
|
+
/**
|
|
137
|
+
* Location type guard for plain FHIR resources
|
|
138
|
+
*/
|
|
139
|
+
export declare function isPlainLocation(resource: Resource | undefined): resource is Location;
|
|
140
|
+
/**
|
|
141
|
+
* AllergyIntolerance type guard for plain FHIR resources
|
|
142
|
+
*/
|
|
143
|
+
export declare function isPlainAllergyIntolerance(resource: Resource | undefined): resource is AllergyIntolerance;
|
|
144
|
+
/**
|
|
145
|
+
* Condition type guard for plain FHIR resources
|
|
146
|
+
*/
|
|
147
|
+
export declare function isPlainCondition(resource: Resource | undefined): resource is Condition;
|
|
148
|
+
/**
|
|
149
|
+
* Composition type guard for plain FHIR resources
|
|
150
|
+
*/
|
|
151
|
+
export declare function isPlainComposition(resource: Resource | undefined): resource is Composition;
|
|
152
|
+
/**
|
|
153
|
+
* Coverage type guard for plain FHIR resources
|
|
154
|
+
*/
|
|
155
|
+
export declare function isPlainCoverage(resource: Resource | undefined): resource is Coverage;
|
|
156
|
+
/**
|
|
157
|
+
* DocumentReference type guard for plain FHIR resources
|
|
158
|
+
*/
|
|
159
|
+
export declare function isPlainDocumentReference(resource: Resource | undefined): resource is DocumentReference;
|
|
160
|
+
/**
|
|
161
|
+
* FamilyMemberHistory type guard for plain FHIR resources
|
|
162
|
+
*/
|
|
163
|
+
export declare function isPlainFamilyMemberHistory(resource: Resource | undefined): resource is FamilyMemberHistory;
|
|
164
|
+
/**
|
|
165
|
+
* Immunization type guard for plain FHIR resources
|
|
166
|
+
*/
|
|
167
|
+
export declare function isPlainImmunization(resource: Resource | undefined): resource is Immunization;
|
|
168
|
+
/**
|
|
169
|
+
* Medication type guard for plain FHIR resources
|
|
170
|
+
*/
|
|
171
|
+
export declare function isPlainMedication(resource: Resource | undefined): resource is Medication;
|
|
172
|
+
/**
|
|
173
|
+
* MedicationAdministration type guard for plain FHIR resources
|
|
174
|
+
*/
|
|
175
|
+
export declare function isPlainMedicationAdministration(resource: Resource | undefined): resource is MedicationAdministration;
|
|
176
|
+
/**
|
|
177
|
+
* MedicationDispense type guard for plain FHIR resources
|
|
178
|
+
*/
|
|
179
|
+
export declare function isPlainMedicationDispense(resource: Resource | undefined): resource is MedicationDispense;
|
|
180
|
+
/**
|
|
181
|
+
* MedicationRequest type guard for plain FHIR resources
|
|
182
|
+
*/
|
|
183
|
+
export declare function isPlainMedicationRequest(resource: Resource | undefined): resource is MedicationRequest;
|
|
184
|
+
/**
|
|
185
|
+
* MedicationStatement type guard for plain FHIR resources
|
|
186
|
+
*/
|
|
187
|
+
export declare function isPlainMedicationStatement(resource: Resource | undefined): resource is MedicationStatement;
|
|
188
|
+
/**
|
|
189
|
+
* Procedure type guard for plain FHIR resources
|
|
190
|
+
*/
|
|
191
|
+
export declare function isPlainProcedure(resource: Resource | undefined): resource is Procedure;
|
|
192
|
+
/**
|
|
193
|
+
* RelatedPerson type guard for plain FHIR resources
|
|
194
|
+
*/
|
|
195
|
+
export declare function isPlainRelatedPerson(resource: Resource | undefined): resource is RelatedPerson;
|
|
196
|
+
/**
|
|
197
|
+
* RiskAssessment type guard for plain FHIR resources
|
|
198
|
+
*/
|
|
199
|
+
export declare function isPlainRiskAssessment(resource: Resource | undefined): resource is RiskAssessment;
|
|
200
|
+
/**
|
|
201
|
+
* ServiceRequest type guard for plain FHIR resources
|
|
202
|
+
*/
|
|
203
|
+
export declare function isPlainServiceRequest(resource: Resource | undefined): resource is ServiceRequest;
|
|
204
|
+
/**
|
|
205
|
+
* CarePlan type guard for plain FHIR resources
|
|
206
|
+
*/
|
|
207
|
+
export declare function isPlainCarePlan(resource: Resource | undefined): resource is CarePlan;
|
|
208
|
+
/**
|
|
209
|
+
* Bundle type guard for plain FHIR resources
|
|
210
|
+
*/
|
|
211
|
+
export declare function isPlainBundle(resource: Resource | undefined): resource is Bundle;
|
|
212
|
+
//# sourceMappingURL=type-guards.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["../src/type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EACR,OAAO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,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,IAAI,SAAS,CAEtF;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,IAAI,aAAa,CAE9F;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,IAAI,cAAc,CAEhG;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,IAAI,cAAc,CAEhG;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,IAAI,QAAQ,CAEpF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,QAAQ,GAAG,SAAS,GAAG,QAAQ,IAAI,MAAM,CAEhF"}
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isPlainServiceRequest = exports.isPlainRiskAssessment = exports.isPlainRelatedPerson = exports.isPlainProcedure = exports.isPlainMedicationStatement = exports.isPlainMedicationRequest = exports.isPlainMedicationDispense = exports.isPlainMedicationAdministration = exports.isPlainMedication = exports.isPlainImmunization = exports.isPlainFamilyMemberHistory = exports.isPlainDocumentReference = exports.isPlainCoverage = exports.isPlainComposition = exports.isPlainCondition = exports.isPlainAllergyIntolerance = exports.isPlainLocation = exports.isPlainOrganization = exports.isPlainPractitionerRole = exports.isPlainPractitioner = exports.isPlainEncounter = exports.isPlainDiagnosticReport = exports.isPlainObservation = exports.isPlainPatient = exports.isBundle = exports.isCarePlan = exports.isServiceRequest = exports.isRiskAssessment = exports.isRelatedPerson = exports.isProcedure = exports.isMedicationStatement = exports.isMedicationRequest = exports.isMedicationDispense = exports.isMedicationAdministration = exports.isMedication = exports.isImmunization = exports.isFamilyMemberHistory = exports.isDocumentReference = exports.isCoverage = exports.isComposition = exports.isCondition = exports.isAllergyIntolerance = exports.isLocation = exports.isOrganization = exports.isPractitionerRole = exports.isPractitioner = exports.isEncounter = exports.isDiagnosticReport = exports.isObservation = exports.isPatient = void 0;
|
|
4
|
+
exports.isPlainBundle = exports.isPlainCarePlan = void 0;
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// Smart Resource Type Guards (for SDK resources)
|
|
7
|
+
// =============================================================================
|
|
8
|
+
/**
|
|
9
|
+
* Patient type guard for Smart resources
|
|
10
|
+
*/
|
|
11
|
+
function isPatient(resource) {
|
|
12
|
+
return resource?.resourceType === "Patient";
|
|
13
|
+
}
|
|
14
|
+
exports.isPatient = isPatient;
|
|
15
|
+
/**
|
|
16
|
+
* Observation type guard for Smart resources
|
|
17
|
+
*/
|
|
18
|
+
function isObservation(resource) {
|
|
19
|
+
return resource?.resourceType === "Observation";
|
|
20
|
+
}
|
|
21
|
+
exports.isObservation = isObservation;
|
|
22
|
+
/**
|
|
23
|
+
* DiagnosticReport type guard for Smart resources
|
|
24
|
+
*/
|
|
25
|
+
function isDiagnosticReport(resource) {
|
|
26
|
+
return resource?.resourceType === "DiagnosticReport";
|
|
27
|
+
}
|
|
28
|
+
exports.isDiagnosticReport = isDiagnosticReport;
|
|
29
|
+
/**
|
|
30
|
+
* Encounter type guard for Smart resources
|
|
31
|
+
*/
|
|
32
|
+
function isEncounter(resource) {
|
|
33
|
+
return resource?.resourceType === "Encounter";
|
|
34
|
+
}
|
|
35
|
+
exports.isEncounter = isEncounter;
|
|
36
|
+
/**
|
|
37
|
+
* Practitioner type guard for Smart resources
|
|
38
|
+
*/
|
|
39
|
+
function isPractitioner(resource) {
|
|
40
|
+
return resource?.resourceType === "Practitioner";
|
|
41
|
+
}
|
|
42
|
+
exports.isPractitioner = isPractitioner;
|
|
43
|
+
/**
|
|
44
|
+
* PractitionerRole type guard for Smart resources
|
|
45
|
+
*/
|
|
46
|
+
function isPractitionerRole(resource) {
|
|
47
|
+
return resource?.resourceType === "PractitionerRole";
|
|
48
|
+
}
|
|
49
|
+
exports.isPractitionerRole = isPractitionerRole;
|
|
50
|
+
/**
|
|
51
|
+
* Organization type guard for Smart resources
|
|
52
|
+
*/
|
|
53
|
+
function isOrganization(resource) {
|
|
54
|
+
return resource?.resourceType === "Organization";
|
|
55
|
+
}
|
|
56
|
+
exports.isOrganization = isOrganization;
|
|
57
|
+
/**
|
|
58
|
+
* Location type guard for Smart resources
|
|
59
|
+
*/
|
|
60
|
+
function isLocation(resource) {
|
|
61
|
+
return resource?.resourceType === "Location";
|
|
62
|
+
}
|
|
63
|
+
exports.isLocation = isLocation;
|
|
64
|
+
/**
|
|
65
|
+
* AllergyIntolerance type guard for Smart resources
|
|
66
|
+
*/
|
|
67
|
+
function isAllergyIntolerance(resource) {
|
|
68
|
+
return resource?.resourceType === "AllergyIntolerance";
|
|
69
|
+
}
|
|
70
|
+
exports.isAllergyIntolerance = isAllergyIntolerance;
|
|
71
|
+
/**
|
|
72
|
+
* Condition type guard for Smart resources
|
|
73
|
+
*/
|
|
74
|
+
function isCondition(resource) {
|
|
75
|
+
return resource?.resourceType === "Condition";
|
|
76
|
+
}
|
|
77
|
+
exports.isCondition = isCondition;
|
|
78
|
+
/**
|
|
79
|
+
* Composition type guard for Smart resources
|
|
80
|
+
*/
|
|
81
|
+
function isComposition(resource) {
|
|
82
|
+
return resource?.resourceType === "Composition";
|
|
83
|
+
}
|
|
84
|
+
exports.isComposition = isComposition;
|
|
85
|
+
/**
|
|
86
|
+
* Coverage type guard for Smart resources
|
|
87
|
+
*/
|
|
88
|
+
function isCoverage(resource) {
|
|
89
|
+
return resource?.resourceType === "Coverage";
|
|
90
|
+
}
|
|
91
|
+
exports.isCoverage = isCoverage;
|
|
92
|
+
/**
|
|
93
|
+
* DocumentReference type guard for Smart resources
|
|
94
|
+
*/
|
|
95
|
+
function isDocumentReference(resource) {
|
|
96
|
+
return resource?.resourceType === "DocumentReference";
|
|
97
|
+
}
|
|
98
|
+
exports.isDocumentReference = isDocumentReference;
|
|
99
|
+
/**
|
|
100
|
+
* FamilyMemberHistory type guard for Smart resources
|
|
101
|
+
*/
|
|
102
|
+
function isFamilyMemberHistory(resource) {
|
|
103
|
+
return resource?.resourceType === "FamilyMemberHistory";
|
|
104
|
+
}
|
|
105
|
+
exports.isFamilyMemberHistory = isFamilyMemberHistory;
|
|
106
|
+
/**
|
|
107
|
+
* Immunization type guard for Smart resources
|
|
108
|
+
*/
|
|
109
|
+
function isImmunization(resource) {
|
|
110
|
+
return resource?.resourceType === "Immunization";
|
|
111
|
+
}
|
|
112
|
+
exports.isImmunization = isImmunization;
|
|
113
|
+
/**
|
|
114
|
+
* Medication type guard for Smart resources
|
|
115
|
+
*/
|
|
116
|
+
function isMedication(resource) {
|
|
117
|
+
return resource?.resourceType === "Medication";
|
|
118
|
+
}
|
|
119
|
+
exports.isMedication = isMedication;
|
|
120
|
+
/**
|
|
121
|
+
* MedicationAdministration type guard for Smart resources
|
|
122
|
+
*/
|
|
123
|
+
function isMedicationAdministration(resource) {
|
|
124
|
+
return resource?.resourceType === "MedicationAdministration";
|
|
125
|
+
}
|
|
126
|
+
exports.isMedicationAdministration = isMedicationAdministration;
|
|
127
|
+
/**
|
|
128
|
+
* MedicationDispense type guard for Smart resources
|
|
129
|
+
*/
|
|
130
|
+
function isMedicationDispense(resource) {
|
|
131
|
+
return resource?.resourceType === "MedicationDispense";
|
|
132
|
+
}
|
|
133
|
+
exports.isMedicationDispense = isMedicationDispense;
|
|
134
|
+
/**
|
|
135
|
+
* MedicationRequest type guard for Smart resources
|
|
136
|
+
*/
|
|
137
|
+
function isMedicationRequest(resource) {
|
|
138
|
+
return resource?.resourceType === "MedicationRequest";
|
|
139
|
+
}
|
|
140
|
+
exports.isMedicationRequest = isMedicationRequest;
|
|
141
|
+
/**
|
|
142
|
+
* MedicationStatement type guard for Smart resources
|
|
143
|
+
*/
|
|
144
|
+
function isMedicationStatement(resource) {
|
|
145
|
+
return resource?.resourceType === "MedicationStatement";
|
|
146
|
+
}
|
|
147
|
+
exports.isMedicationStatement = isMedicationStatement;
|
|
148
|
+
/**
|
|
149
|
+
* Procedure type guard for Smart resources
|
|
150
|
+
*/
|
|
151
|
+
function isProcedure(resource) {
|
|
152
|
+
return resource?.resourceType === "Procedure";
|
|
153
|
+
}
|
|
154
|
+
exports.isProcedure = isProcedure;
|
|
155
|
+
/**
|
|
156
|
+
* RelatedPerson type guard for Smart resources
|
|
157
|
+
*/
|
|
158
|
+
function isRelatedPerson(resource) {
|
|
159
|
+
return resource?.resourceType === "RelatedPerson";
|
|
160
|
+
}
|
|
161
|
+
exports.isRelatedPerson = isRelatedPerson;
|
|
162
|
+
/**
|
|
163
|
+
* RiskAssessment type guard for Smart resources
|
|
164
|
+
*/
|
|
165
|
+
function isRiskAssessment(resource) {
|
|
166
|
+
return resource?.resourceType === "RiskAssessment";
|
|
167
|
+
}
|
|
168
|
+
exports.isRiskAssessment = isRiskAssessment;
|
|
169
|
+
/**
|
|
170
|
+
* ServiceRequest type guard for Smart resources
|
|
171
|
+
*/
|
|
172
|
+
function isServiceRequest(resource) {
|
|
173
|
+
return resource?.resourceType === "ServiceRequest";
|
|
174
|
+
}
|
|
175
|
+
exports.isServiceRequest = isServiceRequest;
|
|
176
|
+
/**
|
|
177
|
+
* CarePlan type guard for Smart resources
|
|
178
|
+
*/
|
|
179
|
+
function isCarePlan(resource) {
|
|
180
|
+
return resource?.resourceType === "CarePlan";
|
|
181
|
+
}
|
|
182
|
+
exports.isCarePlan = isCarePlan;
|
|
183
|
+
/**
|
|
184
|
+
* Bundle type guard for Smart resources
|
|
185
|
+
*/
|
|
186
|
+
function isBundle(resource) {
|
|
187
|
+
return resource?.resourceType === "Bundle";
|
|
188
|
+
}
|
|
189
|
+
exports.isBundle = isBundle;
|
|
190
|
+
// =============================================================================
|
|
191
|
+
// Plain FHIR Resource Type Guards
|
|
192
|
+
// =============================================================================
|
|
193
|
+
/**
|
|
194
|
+
* Patient type guard for plain FHIR resources
|
|
195
|
+
*/
|
|
196
|
+
function isPlainPatient(resource) {
|
|
197
|
+
return resource?.resourceType === "Patient";
|
|
198
|
+
}
|
|
199
|
+
exports.isPlainPatient = isPlainPatient;
|
|
200
|
+
/**
|
|
201
|
+
* Observation type guard for plain FHIR resources
|
|
202
|
+
*/
|
|
203
|
+
function isPlainObservation(resource) {
|
|
204
|
+
return resource?.resourceType === "Observation";
|
|
205
|
+
}
|
|
206
|
+
exports.isPlainObservation = isPlainObservation;
|
|
207
|
+
/**
|
|
208
|
+
* DiagnosticReport type guard for plain FHIR resources
|
|
209
|
+
*/
|
|
210
|
+
function isPlainDiagnosticReport(resource) {
|
|
211
|
+
return resource?.resourceType === "DiagnosticReport";
|
|
212
|
+
}
|
|
213
|
+
exports.isPlainDiagnosticReport = isPlainDiagnosticReport;
|
|
214
|
+
/**
|
|
215
|
+
* Encounter type guard for plain FHIR resources
|
|
216
|
+
*/
|
|
217
|
+
function isPlainEncounter(resource) {
|
|
218
|
+
return resource?.resourceType === "Encounter";
|
|
219
|
+
}
|
|
220
|
+
exports.isPlainEncounter = isPlainEncounter;
|
|
221
|
+
/**
|
|
222
|
+
* Practitioner type guard for plain FHIR resources
|
|
223
|
+
*/
|
|
224
|
+
function isPlainPractitioner(resource) {
|
|
225
|
+
return resource?.resourceType === "Practitioner";
|
|
226
|
+
}
|
|
227
|
+
exports.isPlainPractitioner = isPlainPractitioner;
|
|
228
|
+
/**
|
|
229
|
+
* PractitionerRole type guard for plain FHIR resources
|
|
230
|
+
*/
|
|
231
|
+
function isPlainPractitionerRole(resource) {
|
|
232
|
+
return resource?.resourceType === "PractitionerRole";
|
|
233
|
+
}
|
|
234
|
+
exports.isPlainPractitionerRole = isPlainPractitionerRole;
|
|
235
|
+
/**
|
|
236
|
+
* Organization type guard for plain FHIR resources
|
|
237
|
+
*/
|
|
238
|
+
function isPlainOrganization(resource) {
|
|
239
|
+
return resource?.resourceType === "Organization";
|
|
240
|
+
}
|
|
241
|
+
exports.isPlainOrganization = isPlainOrganization;
|
|
242
|
+
/**
|
|
243
|
+
* Location type guard for plain FHIR resources
|
|
244
|
+
*/
|
|
245
|
+
function isPlainLocation(resource) {
|
|
246
|
+
return resource?.resourceType === "Location";
|
|
247
|
+
}
|
|
248
|
+
exports.isPlainLocation = isPlainLocation;
|
|
249
|
+
/**
|
|
250
|
+
* AllergyIntolerance type guard for plain FHIR resources
|
|
251
|
+
*/
|
|
252
|
+
function isPlainAllergyIntolerance(resource) {
|
|
253
|
+
return resource?.resourceType === "AllergyIntolerance";
|
|
254
|
+
}
|
|
255
|
+
exports.isPlainAllergyIntolerance = isPlainAllergyIntolerance;
|
|
256
|
+
/**
|
|
257
|
+
* Condition type guard for plain FHIR resources
|
|
258
|
+
*/
|
|
259
|
+
function isPlainCondition(resource) {
|
|
260
|
+
return resource?.resourceType === "Condition";
|
|
261
|
+
}
|
|
262
|
+
exports.isPlainCondition = isPlainCondition;
|
|
263
|
+
/**
|
|
264
|
+
* Composition type guard for plain FHIR resources
|
|
265
|
+
*/
|
|
266
|
+
function isPlainComposition(resource) {
|
|
267
|
+
return resource?.resourceType === "Composition";
|
|
268
|
+
}
|
|
269
|
+
exports.isPlainComposition = isPlainComposition;
|
|
270
|
+
/**
|
|
271
|
+
* Coverage type guard for plain FHIR resources
|
|
272
|
+
*/
|
|
273
|
+
function isPlainCoverage(resource) {
|
|
274
|
+
return resource?.resourceType === "Coverage";
|
|
275
|
+
}
|
|
276
|
+
exports.isPlainCoverage = isPlainCoverage;
|
|
277
|
+
/**
|
|
278
|
+
* DocumentReference type guard for plain FHIR resources
|
|
279
|
+
*/
|
|
280
|
+
function isPlainDocumentReference(resource) {
|
|
281
|
+
return resource?.resourceType === "DocumentReference";
|
|
282
|
+
}
|
|
283
|
+
exports.isPlainDocumentReference = isPlainDocumentReference;
|
|
284
|
+
/**
|
|
285
|
+
* FamilyMemberHistory type guard for plain FHIR resources
|
|
286
|
+
*/
|
|
287
|
+
function isPlainFamilyMemberHistory(resource) {
|
|
288
|
+
return resource?.resourceType === "FamilyMemberHistory";
|
|
289
|
+
}
|
|
290
|
+
exports.isPlainFamilyMemberHistory = isPlainFamilyMemberHistory;
|
|
291
|
+
/**
|
|
292
|
+
* Immunization type guard for plain FHIR resources
|
|
293
|
+
*/
|
|
294
|
+
function isPlainImmunization(resource) {
|
|
295
|
+
return resource?.resourceType === "Immunization";
|
|
296
|
+
}
|
|
297
|
+
exports.isPlainImmunization = isPlainImmunization;
|
|
298
|
+
/**
|
|
299
|
+
* Medication type guard for plain FHIR resources
|
|
300
|
+
*/
|
|
301
|
+
function isPlainMedication(resource) {
|
|
302
|
+
return resource?.resourceType === "Medication";
|
|
303
|
+
}
|
|
304
|
+
exports.isPlainMedication = isPlainMedication;
|
|
305
|
+
/**
|
|
306
|
+
* MedicationAdministration type guard for plain FHIR resources
|
|
307
|
+
*/
|
|
308
|
+
function isPlainMedicationAdministration(resource) {
|
|
309
|
+
return resource?.resourceType === "MedicationAdministration";
|
|
310
|
+
}
|
|
311
|
+
exports.isPlainMedicationAdministration = isPlainMedicationAdministration;
|
|
312
|
+
/**
|
|
313
|
+
* MedicationDispense type guard for plain FHIR resources
|
|
314
|
+
*/
|
|
315
|
+
function isPlainMedicationDispense(resource) {
|
|
316
|
+
return resource?.resourceType === "MedicationDispense";
|
|
317
|
+
}
|
|
318
|
+
exports.isPlainMedicationDispense = isPlainMedicationDispense;
|
|
319
|
+
/**
|
|
320
|
+
* MedicationRequest type guard for plain FHIR resources
|
|
321
|
+
*/
|
|
322
|
+
function isPlainMedicationRequest(resource) {
|
|
323
|
+
return resource?.resourceType === "MedicationRequest";
|
|
324
|
+
}
|
|
325
|
+
exports.isPlainMedicationRequest = isPlainMedicationRequest;
|
|
326
|
+
/**
|
|
327
|
+
* MedicationStatement type guard for plain FHIR resources
|
|
328
|
+
*/
|
|
329
|
+
function isPlainMedicationStatement(resource) {
|
|
330
|
+
return resource?.resourceType === "MedicationStatement";
|
|
331
|
+
}
|
|
332
|
+
exports.isPlainMedicationStatement = isPlainMedicationStatement;
|
|
333
|
+
/**
|
|
334
|
+
* Procedure type guard for plain FHIR resources
|
|
335
|
+
*/
|
|
336
|
+
function isPlainProcedure(resource) {
|
|
337
|
+
return resource?.resourceType === "Procedure";
|
|
338
|
+
}
|
|
339
|
+
exports.isPlainProcedure = isPlainProcedure;
|
|
340
|
+
/**
|
|
341
|
+
* RelatedPerson type guard for plain FHIR resources
|
|
342
|
+
*/
|
|
343
|
+
function isPlainRelatedPerson(resource) {
|
|
344
|
+
return resource?.resourceType === "RelatedPerson";
|
|
345
|
+
}
|
|
346
|
+
exports.isPlainRelatedPerson = isPlainRelatedPerson;
|
|
347
|
+
/**
|
|
348
|
+
* RiskAssessment type guard for plain FHIR resources
|
|
349
|
+
*/
|
|
350
|
+
function isPlainRiskAssessment(resource) {
|
|
351
|
+
return resource?.resourceType === "RiskAssessment";
|
|
352
|
+
}
|
|
353
|
+
exports.isPlainRiskAssessment = isPlainRiskAssessment;
|
|
354
|
+
/**
|
|
355
|
+
* ServiceRequest type guard for plain FHIR resources
|
|
356
|
+
*/
|
|
357
|
+
function isPlainServiceRequest(resource) {
|
|
358
|
+
return resource?.resourceType === "ServiceRequest";
|
|
359
|
+
}
|
|
360
|
+
exports.isPlainServiceRequest = isPlainServiceRequest;
|
|
361
|
+
/**
|
|
362
|
+
* CarePlan type guard for plain FHIR resources
|
|
363
|
+
*/
|
|
364
|
+
function isPlainCarePlan(resource) {
|
|
365
|
+
return resource?.resourceType === "CarePlan";
|
|
366
|
+
}
|
|
367
|
+
exports.isPlainCarePlan = isPlainCarePlan;
|
|
368
|
+
/**
|
|
369
|
+
* Bundle type guard for plain FHIR resources
|
|
370
|
+
*/
|
|
371
|
+
function isPlainBundle(resource) {
|
|
372
|
+
return resource?.resourceType === "Bundle";
|
|
373
|
+
}
|
|
374
|
+
exports.isPlainBundle = isPlainBundle;
|
|
375
|
+
//# sourceMappingURL=type-guards.js.map
|
|
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