@metriport/shared 0.15.1-alpha.1 → 0.16.0

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.
@@ -48,7 +48,7 @@ export declare const patientResourceSchema: z.ZodObject<{
48
48
  state: z.ZodString;
49
49
  line: z.ZodArray<z.ZodString, "many">;
50
50
  city: z.ZodString;
51
- postalCode: z.ZodString;
51
+ postalCode: z.ZodOptional<z.ZodString>;
52
52
  }, "strip", z.ZodTypeAny, {
53
53
  state: string;
54
54
  city: string;
@@ -59,7 +59,7 @@ export declare const patientResourceSchema: z.ZodObject<{
59
59
  end?: string | undefined;
60
60
  };
61
61
  line: string[];
62
- postalCode: string;
62
+ postalCode?: string | undefined;
63
63
  }, {
64
64
  state: string;
65
65
  city: string;
@@ -70,7 +70,7 @@ export declare const patientResourceSchema: z.ZodObject<{
70
70
  end?: string | undefined;
71
71
  };
72
72
  line: string[];
73
- postalCode: string;
73
+ postalCode?: string | undefined;
74
74
  }>, "many">;
75
75
  birthDate: z.ZodString;
76
76
  telecom: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -104,7 +104,7 @@ export declare const patientResourceSchema: z.ZodObject<{
104
104
  end?: string | undefined;
105
105
  };
106
106
  line: string[];
107
- postalCode: string;
107
+ postalCode?: string | undefined;
108
108
  }[];
109
109
  birthDate: string;
110
110
  telecom?: {
@@ -132,6 +132,147 @@ export declare const patientResourceSchema: z.ZodObject<{
132
132
  end?: string | undefined;
133
133
  };
134
134
  line: string[];
135
+ postalCode?: string | undefined;
136
+ }[];
137
+ birthDate: string;
138
+ telecom?: {
139
+ value: string;
140
+ system: "phone" | "email";
141
+ }[] | undefined;
142
+ }>;
143
+ export declare const patientResourceSchemaWithHomeAddress: z.ZodObject<{
144
+ gender: z.ZodString;
145
+ name: z.ZodArray<z.ZodObject<{
146
+ use: z.ZodString;
147
+ period: z.ZodObject<{
148
+ start: z.ZodString;
149
+ end: z.ZodOptional<z.ZodString>;
150
+ }, "strip", z.ZodTypeAny, {
151
+ start: string;
152
+ end?: string | undefined;
153
+ }, {
154
+ start: string;
155
+ end?: string | undefined;
156
+ }>;
157
+ family: z.ZodString;
158
+ given: z.ZodArray<z.ZodString, "many">;
159
+ }, "strip", z.ZodTypeAny, {
160
+ use: string;
161
+ period: {
162
+ start: string;
163
+ end?: string | undefined;
164
+ };
165
+ family: string;
166
+ given: string[];
167
+ }, {
168
+ use: string;
169
+ period: {
170
+ start: string;
171
+ end?: string | undefined;
172
+ };
173
+ family: string;
174
+ given: string[];
175
+ }>, "many">;
176
+ address: z.ZodArray<z.ZodObject<{
177
+ use: z.ZodLiteral<"home">;
178
+ country: z.ZodString;
179
+ period: z.ZodObject<{
180
+ start: z.ZodString;
181
+ end: z.ZodOptional<z.ZodString>;
182
+ }, "strip", z.ZodTypeAny, {
183
+ start: string;
184
+ end?: string | undefined;
185
+ }, {
186
+ start: string;
187
+ end?: string | undefined;
188
+ }>;
189
+ state: z.ZodString;
190
+ line: z.ZodArray<z.ZodString, "many">;
191
+ city: z.ZodString;
192
+ postalCode: z.ZodString;
193
+ }, "strip", z.ZodTypeAny, {
194
+ state: string;
195
+ city: string;
196
+ use: "home";
197
+ country: string;
198
+ period: {
199
+ start: string;
200
+ end?: string | undefined;
201
+ };
202
+ line: string[];
203
+ postalCode: string;
204
+ }, {
205
+ state: string;
206
+ city: string;
207
+ use: "home";
208
+ country: string;
209
+ period: {
210
+ start: string;
211
+ end?: string | undefined;
212
+ };
213
+ line: string[];
214
+ postalCode: string;
215
+ }>, "many">;
216
+ birthDate: z.ZodString;
217
+ telecom: z.ZodOptional<z.ZodArray<z.ZodObject<{
218
+ value: z.ZodString;
219
+ system: z.ZodEnum<["phone", "email"]>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ value: string;
222
+ system: "phone" | "email";
223
+ }, {
224
+ value: string;
225
+ system: "phone" | "email";
226
+ }>, "many">>;
227
+ }, "strip", z.ZodTypeAny, {
228
+ gender: string;
229
+ name: {
230
+ use: string;
231
+ period: {
232
+ start: string;
233
+ end?: string | undefined;
234
+ };
235
+ family: string;
236
+ given: string[];
237
+ }[];
238
+ address: {
239
+ state: string;
240
+ city: string;
241
+ use: "home";
242
+ country: string;
243
+ period: {
244
+ start: string;
245
+ end?: string | undefined;
246
+ };
247
+ line: string[];
248
+ postalCode: string;
249
+ }[];
250
+ birthDate: string;
251
+ telecom?: {
252
+ value: string;
253
+ system: "phone" | "email";
254
+ }[] | undefined;
255
+ }, {
256
+ gender: string;
257
+ name: {
258
+ use: string;
259
+ period: {
260
+ start: string;
261
+ end?: string | undefined;
262
+ };
263
+ family: string;
264
+ given: string[];
265
+ }[];
266
+ address: {
267
+ state: string;
268
+ city: string;
269
+ use: "home";
270
+ country: string;
271
+ period: {
272
+ start: string;
273
+ end?: string | undefined;
274
+ };
275
+ line: string[];
135
276
  postalCode: string;
136
277
  }[];
137
278
  birthDate: string;
@@ -141,6 +282,7 @@ export declare const patientResourceSchema: z.ZodObject<{
141
282
  }[] | undefined;
142
283
  }>;
143
284
  export type PatientResource = z.infer<typeof patientResourceSchema>;
285
+ export type PatientResourceWithHomeAddress = z.infer<typeof patientResourceSchemaWithHomeAddress>;
144
286
  export declare const patientSearchResourceSchema: z.ZodObject<{
145
287
  entry: z.ZodArray<z.ZodObject<{
146
288
  resource: z.ZodObject<{
@@ -192,7 +334,7 @@ export declare const patientSearchResourceSchema: z.ZodObject<{
192
334
  state: z.ZodString;
193
335
  line: z.ZodArray<z.ZodString, "many">;
194
336
  city: z.ZodString;
195
- postalCode: z.ZodString;
337
+ postalCode: z.ZodOptional<z.ZodString>;
196
338
  }, "strip", z.ZodTypeAny, {
197
339
  state: string;
198
340
  city: string;
@@ -203,7 +345,7 @@ export declare const patientSearchResourceSchema: z.ZodObject<{
203
345
  end?: string | undefined;
204
346
  };
205
347
  line: string[];
206
- postalCode: string;
348
+ postalCode?: string | undefined;
207
349
  }, {
208
350
  state: string;
209
351
  city: string;
@@ -214,7 +356,7 @@ export declare const patientSearchResourceSchema: z.ZodObject<{
214
356
  end?: string | undefined;
215
357
  };
216
358
  line: string[];
217
- postalCode: string;
359
+ postalCode?: string | undefined;
218
360
  }>, "many">;
219
361
  birthDate: z.ZodString;
220
362
  telecom: z.ZodOptional<z.ZodArray<z.ZodObject<{
@@ -248,7 +390,7 @@ export declare const patientSearchResourceSchema: z.ZodObject<{
248
390
  end?: string | undefined;
249
391
  };
250
392
  line: string[];
251
- postalCode: string;
393
+ postalCode?: string | undefined;
252
394
  }[];
253
395
  birthDate: string;
254
396
  telecom?: {
@@ -276,7 +418,7 @@ export declare const patientSearchResourceSchema: z.ZodObject<{
276
418
  end?: string | undefined;
277
419
  };
278
420
  line: string[];
279
- postalCode: string;
421
+ postalCode?: string | undefined;
280
422
  }[];
281
423
  birthDate: string;
282
424
  telecom?: {
@@ -306,7 +448,7 @@ export declare const patientSearchResourceSchema: z.ZodObject<{
306
448
  end?: string | undefined;
307
449
  };
308
450
  line: string[];
309
- postalCode: string;
451
+ postalCode?: string | undefined;
310
452
  }[];
311
453
  birthDate: string;
312
454
  telecom?: {
@@ -336,7 +478,7 @@ export declare const patientSearchResourceSchema: z.ZodObject<{
336
478
  end?: string | undefined;
337
479
  };
338
480
  line: string[];
339
- postalCode: string;
481
+ postalCode?: string | undefined;
340
482
  }[];
341
483
  birthDate: string;
342
484
  telecom?: {
@@ -368,7 +510,7 @@ export declare const patientSearchResourceSchema: z.ZodObject<{
368
510
  end?: string | undefined;
369
511
  };
370
512
  line: string[];
371
- postalCode: string;
513
+ postalCode?: string | undefined;
372
514
  }[];
373
515
  birthDate: string;
374
516
  telecom?: {
@@ -400,7 +542,7 @@ export declare const patientSearchResourceSchema: z.ZodObject<{
400
542
  end?: string | undefined;
401
543
  };
402
544
  line: string[];
403
- postalCode: string;
545
+ postalCode?: string | undefined;
404
546
  }[];
405
547
  birthDate: string;
406
548
  telecom?: {
@@ -1 +1 @@
1
- {"version":3,"file":"patient.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/athenahealth/patient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA6BxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMtC,CAAC"}
1
+ {"version":3,"file":"patient.d.ts","sourceRoot":"","sources":["../../../../src/interface/external/athenahealth/patient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAuCxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM/C,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC;AAClG,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMtC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patientSearchResourceSchema = exports.patientResourceSchema = void 0;
3
+ exports.patientSearchResourceSchema = exports.patientResourceSchemaWithHomeAddress = exports.patientResourceSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const period = zod_1.z.object({
6
6
  start: zod_1.z.string(),
@@ -13,6 +13,15 @@ const address = zod_1.z.object({
13
13
  state: zod_1.z.string(),
14
14
  line: zod_1.z.string().array(),
15
15
  city: zod_1.z.string(),
16
+ postalCode: zod_1.z.string().optional(),
17
+ });
18
+ const homeAddress = zod_1.z.object({
19
+ use: zod_1.z.literal("home"),
20
+ country: zod_1.z.string(),
21
+ period,
22
+ state: zod_1.z.string(),
23
+ line: zod_1.z.string().array(),
24
+ city: zod_1.z.string(),
16
25
  postalCode: zod_1.z.string(),
17
26
  });
18
27
  const telecome = zod_1.z.object({
@@ -32,6 +41,13 @@ exports.patientResourceSchema = zod_1.z.object({
32
41
  birthDate: zod_1.z.string(),
33
42
  telecom: telecome.array().optional(),
34
43
  });
44
+ exports.patientResourceSchemaWithHomeAddress = zod_1.z.object({
45
+ gender: zod_1.z.string(),
46
+ name: name.array(),
47
+ address: homeAddress.array(),
48
+ birthDate: zod_1.z.string(),
49
+ telecom: telecome.array().optional(),
50
+ });
35
51
  exports.patientSearchResourceSchema = zod_1.z.object({
36
52
  entry: zod_1.z
37
53
  .object({
@@ -1 +1 @@
1
- {"version":3,"file":"patient.js","sourceRoot":"","sources":["../../../../src/interface/external/athenahealth/patient.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,MAAM,GAAG,OAAC,CAAC,MAAM,CAAC;IACtB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC3B,CAAC,CAAC;AAEH,MAAM,OAAO,GAAG,OAAC,CAAC,MAAM,CAAC;IACvB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,MAAM;IACN,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACxB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,OAAC,CAAC,MAAM,CAAC;IACxB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;CACnC,CAAC,CAAC;AAEH,MAAM,IAAI,GAAG,OAAC,CAAC,MAAM,CAAC;IACpB,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,MAAM;IACN,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;IAClB,KAAK,EAAE,OAAC,C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,QAAQ,CAAC,KAAK,EAAE,CAAC,QAAQ,EAAE;CACrC,CAAC,CAAC;AAIU,QAAA,2BAA2B,GAAG,OAAC,CAAC,MAAM,CAAC;IAClD,KAAK,EAAE,OAAC;SACL,MAAM,CAAC;QACN,QAAQ,EAAE,6BAAqB;KAChC,CAAC;SACD,KAAK,EAAE;CACX,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ export type CqDirectorySimplifiedOrg = {
2
+ id: string;
3
+ name: string;
4
+ urlXCPD: string;
5
+ urlDQ: string;
6
+ urlDR: string;
7
+ rootOrganization?: string | undefined;
8
+ managingOrganizationId?: string | undefined;
9
+ };
10
+ //# sourceMappingURL=simplified-org.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simplified-org.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/carequality/directory/simplified-org.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,sBAAsB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7C,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=simplified-org.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simplified-org.js","sourceRoot":"","sources":["../../../../../src/interface/external/carequality/directory/simplified-org.ts"],"names":[],"mappings":""}
@@ -1,7 +1,6 @@
1
1
  export * from "./fhir/bundle";
2
- export * from "./fhir/conversion";
3
- export * from "./fhir/observations";
4
2
  export * from "./fhir/resources";
3
+ export * from "./fhir/conversion";
5
4
  export * from "./webhook/webhook-request";
6
5
  export * from "./webhook/webhook-status-response";
7
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/medical/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/medical/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC"}
@@ -15,9 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./fhir/bundle"), exports);
18
- __exportStar(require("./fhir/conversion"), exports);
19
- __exportStar(require("./fhir/observations"), exports);
20
18
  __exportStar(require("./fhir/resources"), exports);
19
+ __exportStar(require("./fhir/conversion"), exports);
21
20
  __exportStar(require("./webhook/webhook-request"), exports);
22
21
  __exportStar(require("./webhook/webhook-status-response"), exports);
23
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/medical/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,oDAAkC;AAClC,sDAAoC;AACpC,mDAAiC;AACjC,4DAA0C;AAC1C,oEAAkD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/medical/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,mDAAiC;AACjC,oDAAkC;AAClC,4DAA0C;AAC1C,oEAAkD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metriport/shared",
3
- "version": "0.15.1-alpha.1",
3
+ "version": "0.16.0",
4
4
  "description": "Common code shared across packages - by Metriport Inc.",
5
5
  "author": "Metriport Inc. <contact@metriport.com>",
6
6
  "homepage": "https://metriport.com/",
@@ -92,5 +92,6 @@
92
92
  "ts-essentials": "^9.3.1",
93
93
  "ts-jest": "29.1.1",
94
94
  "typescript": "^4.9.5"
95
- }
95
+ },
96
+ "gitHead": "9108620248a678e0bd251fb2f2e000184342ab69"
96
97
  }
@@ -1,4 +0,0 @@
1
- import { Observation } from "@medplum/fhirtypes";
2
- export declare const observationDisplayComparator: (a: Observation, b: Observation) => number;
3
- export declare const sortObservationsForDisplay: (observations: Observation[]) => Observation[];
4
- //# sourceMappingURL=observation-ordering.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observation-ordering.d.ts","sourceRoot":"","sources":["../../../src/medical/fhir/observation-ordering.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAsCjD,eAAO,MAAM,4BAA4B,MAAO,WAAW,KAAK,WAAW,KAAG,MAO7E,CAAC;AAEF,eAAO,MAAM,0BAA0B,iBAAkB,WAAW,EAAE,KAAG,WAAW,EAEnF,CAAC"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sortObservationsForDisplay = exports.observationDisplayComparator = void 0;
4
- // Not sure the names of the codes are correct,
5
- // but they're related and should be grouped together regardless
6
- const OXYGEN_SATURATION_LOINC = {
7
- SpO2: "2708-6",
8
- Sp02ByPulseOximetry: "59408-5",
9
- Sp02ByDirectSampling: "20509-6",
10
- Sp02InCapillaryBloodByPulseOximetry: "59466-1",
11
- Sp02OnRoomAir: "59410-1",
12
- };
13
- const VITALS_LOINC = {
14
- HeartRate: "8867-4",
15
- BloodPressureSystolic: "8480-6",
16
- BloodPressureDiastolic: "8462-4",
17
- RespiratoryRate: "9279-1",
18
- InhaledOxygenFlowRate: "3151-8",
19
- Temperature: "8310-5",
20
- ...OXYGEN_SATURATION_LOINC,
21
- Weight: "29463-7",
22
- Height: "8302-2",
23
- BMI: "39156-5",
24
- };
25
- // Create display order based on the order of values in VITALS_LOINC
26
- const VITALS_DISPLAY_ORDER = Object.values(VITALS_LOINC).reduce((acc, code, index) => ({
27
- ...acc,
28
- [code]: index,
29
- }), {});
30
- // Stable sort that puts VITALS_LOINC codes first, then defaults to the upstream order.
31
- const observationDisplayComparator = (a, b) => {
32
- const aCode = a.code?.coding?.[0]?.code;
33
- const bCode = b.code?.coding?.[0]?.code;
34
- const orderA = aCode ? VITALS_DISPLAY_ORDER[aCode] : Number.MAX_SAFE_INTEGER;
35
- const orderB = bCode ? VITALS_DISPLAY_ORDER[bCode] : Number.MAX_SAFE_INTEGER;
36
- return orderA - orderB;
37
- };
38
- exports.observationDisplayComparator = observationDisplayComparator;
39
- const sortObservationsForDisplay = (observations) => {
40
- return [...observations].sort(exports.observationDisplayComparator);
41
- };
42
- exports.sortObservationsForDisplay = sortObservationsForDisplay;
43
- //# sourceMappingURL=observation-ordering.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observation-ordering.js","sourceRoot":"","sources":["../../../src/medical/fhir/observation-ordering.ts"],"names":[],"mappings":";;;AAEA,+CAA+C;AAC/C,gEAAgE;AAChE,MAAM,uBAAuB,GAAG;IAC9B,IAAI,EAAE,QAAQ;IACd,mBAAmB,EAAE,SAAS;IAC9B,oBAAoB,EAAE,SAAS;IAC/B,mCAAmC,EAAE,SAAS;IAC9C,aAAa,EAAE,SAAS;CAChB,CAAC;AAEX,MAAM,YAAY,GAAG;IACnB,SAAS,EAAE,QAAQ;IACnB,qBAAqB,EAAE,QAAQ;IAC/B,sBAAsB,EAAE,QAAQ;IAChC,eAAe,EAAE,QAAQ;IACzB,qBAAqB,EAAE,QAAQ;IAC/B,WAAW,EAAE,QAAQ;IACrB,GAAG,uBAAuB;IAC1B,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,SAAS;CACN,CAAC;AAKX,oEAAoE;AACpE,MAAM,oBAAoB,GAAgC,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,MAAM,CAC1F,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IACrB,GAAG,GAAG;IACN,CAAC,IAAI,CAAC,EAAE,KAAK;CACd,CAAC,EACF,EAAiC,CAClC,CAAC;AAEF,uFAAuF;AAChF,MAAM,4BAA4B,GAAG,CAAC,CAAc,EAAE,CAAc,EAAU,EAAE;IACrF,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IAA+B,CAAC;IACnE,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IAA+B,CAAC;IACnE,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAC7E,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC;IAE7E,OAAO,MAAM,GAAG,MAAM,CAAC;AACzB,CAAC,CAAC;AAPW,QAAA,4BAA4B,gCAOvC;AAEK,MAAM,0BAA0B,GAAG,CAAC,YAA2B,EAAiB,EAAE;IACvF,OAAO,CAAC,GAAG,YAAY,CAAC,CAAC,IAAI,CAAC,oCAA4B,CAAC,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,0BAA0B,8BAErC"}
@@ -1,6 +0,0 @@
1
- import { Observation } from "@medplum/fhirtypes";
2
- export declare const observationDisplayComparator: (a: Observation, b: Observation) => number;
3
- export declare const sortObservationsForDisplay: (observations: Observation[]) => Observation[];
4
- export declare function getObservationCode(observation: Observation): string | undefined;
5
- export declare function getObservationUnits(observation: Observation): string | undefined;
6
- //# sourceMappingURL=observations.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observations.d.ts","sourceRoot":"","sources":["../../../src/medical/fhir/observations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAsCjD,eAAO,MAAM,4BAA4B,MAAO,WAAW,KAAK,WAAW,KAAG,MAO7E,CAAC;AAEF,eAAO,MAAM,0BAA0B,iBAAkB,WAAW,EAAE,KAAG,WAAW,EAEnF,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAE/E;AAED,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,CAEhF"}
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getObservationUnits = exports.getObservationCode = exports.sortObservationsForDisplay = exports.observationDisplayComparator = void 0;
4
- // Not sure the names of the codes are correct,
5
- // but they're related and should be grouped together regardless
6
- const oxygenSaturationLoinc = {
7
- SpO2: "2708-6",
8
- Sp02ByPulseOximetry: "59408-5",
9
- Sp02ByDirectSampling: "20509-6",
10
- Sp02InCapillaryBloodByPulseOximetry: "59466-1",
11
- Sp02OnRoomAir: "59410-1",
12
- };
13
- const vitalsLoinc = {
14
- HeartRate: "8867-4",
15
- BloodPressureSystolic: "8480-6",
16
- BloodPressureDiastolic: "8462-4",
17
- RespiratoryRate: "9279-1",
18
- InhaledOxygenFlowRate: "3151-8",
19
- Temperature: "8310-5",
20
- ...oxygenSaturationLoinc,
21
- Weight: "29463-7",
22
- Height: "8302-2",
23
- BMI: "39156-5",
24
- };
25
- // Create display order based on the order of values in VITALS_LOINC
26
- const VITALS_DISPLAY_ORDER = Object.values(vitalsLoinc).reduce((acc, code, index) => ({
27
- ...acc,
28
- [code]: index,
29
- }), {});
30
- // Stable sort that puts VITALS_LOINC codes first, then defaults to the upstream order.
31
- const observationDisplayComparator = (a, b) => {
32
- const aCode = a.code?.coding?.[0]?.code;
33
- const bCode = b.code?.coding?.[0]?.code;
34
- const orderA = aCode ? VITALS_DISPLAY_ORDER[aCode] : Number.MAX_SAFE_INTEGER;
35
- const orderB = bCode ? VITALS_DISPLAY_ORDER[bCode] : Number.MAX_SAFE_INTEGER;
36
- return orderA - orderB;
37
- };
38
- exports.observationDisplayComparator = observationDisplayComparator;
39
- const sortObservationsForDisplay = (observations) => {
40
- return [...observations].sort(exports.observationDisplayComparator);
41
- };
42
- exports.sortObservationsForDisplay = sortObservationsForDisplay;
43
- function getObservationCode(observation) {
44
- return observation.code?.coding?.find(coding => coding?.code)?.code;
45
- }
46
- exports.getObservationCode = getObservationCode;
47
- function getObservationUnits(observation) {
48
- return observation.valueQuantity?.unit?.replace(/[{()}]/g, "").toLowerCase();
49
- }
50
- exports.getObservationUnits = getObservationUnits;
51
- //# sourceMappingURL=observations.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observations.js","sourceRoot":"","sources":["../../../src/medical/fhir/observations.ts"],"names":[],"mappings":";;;AAEA,+CAA+C;AAC/C,gEAAgE;AAChE,MAAM,qBAAqB,GAAG;IAC5B,IAAI,EAAE,QAAQ;IACd,mBAAmB,EAAE,SAAS;IAC9B,oBAAoB,EAAE,SAAS;IAC/B,mCAAmC,EAAE,SAAS;IAC9C,aAAa,EAAE,SAAS;CAChB,CAAC;AAEX,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,QAAQ;IACnB,qBAAqB,EAAE,QAAQ;IAC/B,sBAAsB,EAAE,QAAQ;IAChC,eAAe,EAAE,QAAQ;IACzB,qBAAqB,EAAE,QAAQ;IAC/B,WAAW,EAAE,QAAQ;IACrB,GAAG,qBAAqB;IACxB,MAAM,EAAE,SAAS;IACjB,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,SAAS;CACN,CAAC;AAKX,oEAAoE;AACpE,MAAM,oBAAoB,GAAgC,MAAM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