@metriport/commonwell-sdk 4.1.4-alpha.2 → 4.1.5-alpha.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.
- package/lib/client/document.js +5 -4
- package/lib/client/document.js.map +1 -1
- package/lib/models/demographics.d.ts +5 -5
- package/lib/models/document.d.ts +98 -98
- package/lib/models/identifier.d.ts +7 -7
- package/lib/models/identifier.js +8 -1
- package/lib/models/identifier.js.map +1 -1
- package/lib/models/link.d.ts +9 -9
- package/lib/models/patient.d.ts +45 -45
- package/lib/models/person.d.ts +18 -18
- package/lib/tst.d.ts +54 -0
- package/package.json +2 -2
package/lib/client/document.js
CHANGED
|
@@ -6,21 +6,22 @@ const fileDownload_1 = require("../common/fileDownload");
|
|
|
6
6
|
const util_1 = require("../common/util");
|
|
7
7
|
const document_1 = require("../models/document");
|
|
8
8
|
const commonwell_1 = require("./commonwell");
|
|
9
|
-
async function initQuery(api, headers, patientId
|
|
9
|
+
async function initQuery(api, headers, patientId
|
|
10
|
+
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
) {
|
|
10
12
|
const subjectId = (0, util_1.convertPatientIdToSubjectId)(patientId);
|
|
11
13
|
if (!subjectId) {
|
|
12
14
|
throw new Error(`Could not determine subject ID for document query`);
|
|
13
15
|
}
|
|
14
16
|
const url = `${commonwell_1.CommonWell.DOCUMENT_QUERY_ENDPOINT}?subject.id=${subjectId}`;
|
|
15
17
|
const additionalInfo = { headers, patientId };
|
|
16
|
-
let response; //eslint-disable-line @typescript-eslint/no-explicit-any
|
|
17
18
|
try {
|
|
18
|
-
response = await api.get(url, { headers });
|
|
19
|
+
const response = await api.get(url, { headers });
|
|
20
|
+
return response;
|
|
19
21
|
}
|
|
20
22
|
catch (err) {
|
|
21
23
|
throw new commonwell_error_1.CommonwellError(`Error querying documents`, err, additionalInfo);
|
|
22
24
|
}
|
|
23
|
-
return response;
|
|
24
25
|
}
|
|
25
26
|
async function query(api, headers, patientId) {
|
|
26
27
|
const response = await initQuery(api, headers, patientId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/client/document.ts"],"names":[],"mappings":";;;AAEA,iEAA6D;AAC7D,yDAAsD;AACtD,yCAA6D;AAC7D,iDAK4B;AAC5B,6CAA0C;AAE1C,KAAK,UAAU,SAAS,CACtB,GAAkB,EAClB,OAA+B,EAC/B,SAAiB;
|
|
1
|
+
{"version":3,"file":"document.js","sourceRoot":"","sources":["../../src/client/document.ts"],"names":[],"mappings":";;;AAEA,iEAA6D;AAC7D,yDAAsD;AACtD,yCAA6D;AAC7D,iDAK4B;AAC5B,6CAA0C;AAE1C,KAAK,UAAU,SAAS,CACtB,GAAkB,EAClB,OAA+B,EAC/B,SAAiB;AACjB,6DAA6D;;IAE7D,MAAM,SAAS,GAAG,IAAA,kCAA2B,EAAC,SAAS,CAAC,CAAC;IACzD,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;KACtE;IACD,MAAM,GAAG,GAAG,GAAG,uBAAU,CAAC,uBAAuB,eAAe,SAAS,EAAE,CAAC;IAC5E,MAAM,cAAc,GAAG,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;IAC9C,IAAI;QACF,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QACjD,OAAO,QAAQ,CAAC;KACjB;IAAC,OAAO,GAAG,EAAE;QACZ,MAAM,IAAI,kCAAe,CAAC,0BAA0B,EAAE,GAAG,EAAE,cAAc,CAAC,CAAC;KAC5E;AACH,CAAC;AAEM,KAAK,UAAU,KAAK,CACzB,GAAkB,EAClB,OAA+B,EAC/B,SAAiB;IAEjB,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;IAC1D,IAAI;QACF,OA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key: z.ZodString;
|
|
26
|
-
use: z.ZodNullable<z.ZodOptional<z.ZodEnum<["usual", "official", "temp", "secondary", "old"]>>>;
|
|
26
|
+
use: z.ZodNullable<z.ZodOptional<z.ZodEnum<["usual", "official", "temp", "secondary", "old", "unspecified"]>>>;
|
|
27
27
|
label: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
28
28
|
period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
29
29
|
start: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
@@ -39,7 +39,7 @@ export declare const demographicsSchema: z.ZodObject<{
|
|
|
39
39
|
}, "strip", z.ZodTypeAny, {
|
|
40
40
|
system: string;
|
|
41
41
|
key: string;
|
|
42
|
-
use?: "usual" | "official" | "temp" | "secondary" | "old" | null | undefined;
|
|
42
|
+
use?: "usual" | "official" | "temp" | "secondary" | "old" | "unspecified" | null | undefined;
|
|
43
43
|
label?: string | null | undefined;
|
|
44
44
|
period?: {
|
|
45
45
|
start?: string | undefined;
|
|
@@ -49,7 +49,7 @@ export declare const demographicsSchema: z.ZodObject<{
|
|
|
49
49
|
}, {
|
|
50
50
|
system: string;
|
|
51
51
|
key: string;
|
|
52
|
-
use?: "usual" | "official" | "temp" | "secondary" | "old" | null | undefined;
|
|
52
|
+
use?: "usual" | "official" | "temp" | "secondary" | "old" | "unspecified" | null | undefined;
|
|
53
53
|
label?: string | null | undefined;
|
|
54
54
|
period?: {
|
|
55
55
|
start?: string | undefined;
|
|
@@ -217,7 +217,7 @@ export declare const demographicsSchema: z.ZodObject<{
|
|
|
217
217
|
identifier?: {
|
|
218
218
|
system: string;
|
|
219
219
|
key: string;
|
|
220
|
-
use?: "usual" | "official" | "temp" | "secondary" | "old" | null | undefined;
|
|
220
|
+
use?: "usual" | "official" | "temp" | "secondary" | "old" | "unspecified" | null | undefined;
|
|
221
221
|
label?: string | null | undefined;
|
|
222
222
|
period?: {
|
|
223
223
|
start?: string | undefined;
|
|
@@ -269,7 +269,7 @@ export declare const demographicsSchema: z.ZodObject<{
|
|
|
269
269
|
identifier?: {
|
|
270
270
|
system: string;
|
|
271
271
|
key: string;
|
|
272
|
-
use?: "usual" | "official" | "temp" | "secondary" | "old" | null | undefined;
|
|
272
|
+
use?: "usual" | "official" | "temp" | "secondary" | "old" | "unspecified" | null | undefined;
|
|
273
273
|
label?: string | null | undefined;
|
|
274
274
|
period?: {
|
|
275
275
|
start?: string | undefined;
|