@metriport/commonwell-sdk 4.3.2 → 4.3.4
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 +20 -20
- package/README.md +40 -40
- package/lib/client/commonwell-api.d.ts +49 -49
- package/lib/client/commonwell-api.js +2 -2
- package/lib/client/commonwell.d.ts +425 -425
- package/lib/client/commonwell.js +739 -739
- package/lib/client/document.d.ts +7 -7
- package/lib/client/document.js +71 -71
- package/lib/common/commonwell-error.d.ts +12 -12
- package/lib/common/commonwell-error.js +34 -34
- package/lib/common/fileDownload.d.ts +11 -11
- package/lib/common/fileDownload.js +43 -43
- package/lib/common/make-jwt.d.ts +24 -24
- package/lib/common/make-jwt.js +90 -90
- package/lib/common/metriport-error.d.ts +4 -4
- package/lib/common/metriport-error.js +33 -33
- package/lib/common/util.d.ts +25 -25
- package/lib/common/util.js +70 -70
- package/lib/common/validate-npi.d.ts +9 -9
- package/lib/common/validate-npi.js +39 -39
- package/lib/index.d.ts +20 -20
- package/lib/index.js +54 -54
- package/lib/models/address.d.ts +50 -50
- package/lib/models/address.js +28 -28
- package/lib/models/certificates.d.ts +156 -156
- package/lib/models/certificates.js +26 -26
- package/lib/models/contact.d.ts +50 -50
- package/lib/models/contact.js +39 -39
- package/lib/models/demographics.d.ts +292 -292
- package/lib/models/demographics.js +34 -34
- package/lib/models/document.d.ts +4421 -4421
- package/lib/models/document.js +151 -151
- package/lib/models/enrollment-summary.d.ts +18 -18
- package/lib/models/enrollment-summary.js +14 -14
- package/lib/models/facility.d.ts +75 -75
- package/lib/models/facility.js +10 -10
- package/lib/models/human-name.d.ts +53 -53
- package/lib/models/human-name.js +37 -37
- package/lib/models/identifier.d.ts +79 -79
- package/lib/models/identifier.js +36 -36
- package/lib/models/iso-date.d.ts +3 -3
- package/lib/models/iso-date.js +6 -6
- package/lib/models/iso-datetime.d.ts +3 -3
- package/lib/models/iso-datetime.js +8 -8
- package/lib/models/link.d.ts +642 -642
- package/lib/models/link.js +50 -50
- package/lib/models/organization.d.ts +763 -763
- package/lib/models/organization.js +83 -83
- package/lib/models/patient.d.ts +3617 -3617
- package/lib/models/patient.js +49 -49
- package/lib/models/period.d.ts +12 -12
- package/lib/models/period.js +12 -12
- package/lib/models/person.d.ts +2440 -2440
- package/lib/models/person.js +39 -39
- package/lib/models/purpose-of-use.d.ts +29 -29
- package/lib/models/purpose-of-use.js +34 -34
- package/package.json +2 -2
- package/lib/tst.d.ts +0 -54
package/lib/models/document.js
CHANGED
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.documentQueryFullResponseSchema = exports.documentQueryResponseSchema = exports.operationOutcomeResourceType = exports.documentReferenceResourceType = exports.operationOutcomeSchema = exports.documentSchema = exports.contentSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const address_1 = require("./address");
|
|
6
|
-
const demographics_1 = require("./demographics");
|
|
7
|
-
const human_name_1 = require("./human-name");
|
|
8
|
-
const identifier_1 = require("./identifier");
|
|
9
|
-
const iso_datetime_1 = require("./iso-datetime");
|
|
10
|
-
const period_1 = require("./period");
|
|
11
|
-
// Used as a reference, but not exactly the actual definition:
|
|
12
|
-
// https://specification.commonwellalliance.org/services/rest-api-reference#8610-documentreference
|
|
13
|
-
// TODO can this be an enum?
|
|
14
|
-
// Bundle, DocumentReference, Organization, Practitioner, OperationOutcome
|
|
15
|
-
const resourceTypeSchema = zod_1.z.string().optional();
|
|
16
|
-
// TODO we should try to reuse identifierSchema from models/identifier instead
|
|
17
|
-
// TODO try to replace this when we can properly test it
|
|
18
|
-
const identifierSchema = zod_1.z.object({
|
|
19
|
-
use: identifier_1.identifierUseCodesSchema.optional(),
|
|
20
|
-
system: zod_1.z.string().optional(),
|
|
21
|
-
value: zod_1.z.string(),
|
|
22
|
-
});
|
|
23
|
-
const codeableConceptSchema = zod_1.z.object({
|
|
24
|
-
coding: zod_1.z
|
|
25
|
-
.array(zod_1.z.object({
|
|
26
|
-
system: zod_1.z.string().optional(),
|
|
27
|
-
code: zod_1.z.string().optional(),
|
|
28
|
-
display: zod_1.z.string().optional(),
|
|
29
|
-
}))
|
|
30
|
-
.optional(),
|
|
31
|
-
text: zod_1.z.string().optional(),
|
|
32
|
-
});
|
|
33
|
-
const containedAddress = address_1.addressSchema.partial({
|
|
34
|
-
zip: true,
|
|
35
|
-
});
|
|
36
|
-
const containedSchema = zod_1.z.object({
|
|
37
|
-
resourceType: resourceTypeSchema,
|
|
38
|
-
id: zod_1.z.string().nullish(),
|
|
39
|
-
identifier: zod_1.z.array(identifierSchema).nullish(),
|
|
40
|
-
name: zod_1.z.string().or(human_name_1.humanNameSchema).or(zod_1.z.array(human_name_1.humanNameSchema)).nullish(),
|
|
41
|
-
organization: zod_1.z
|
|
42
|
-
.object({
|
|
43
|
-
reference: zod_1.z.string(),
|
|
44
|
-
})
|
|
45
|
-
.nullish(),
|
|
46
|
-
gender: zod_1.z
|
|
47
|
-
.object({
|
|
48
|
-
coding: zod_1.z.array(demographics_1.genderSchema).optional(),
|
|
49
|
-
})
|
|
50
|
-
.nullish(),
|
|
51
|
-
birthDate: zod_1.z.string().nullish(),
|
|
52
|
-
address: zod_1.z.array(containedAddress).nullish(),
|
|
53
|
-
});
|
|
54
|
-
const statusSchema = zod_1.z.enum(["current", "superceded", "entered in error"]);
|
|
55
|
-
// Main Clinical Acts Documented
|
|
56
|
-
const eventSchema = codeableConceptSchema;
|
|
57
|
-
// https://specification.commonwellalliance.org/services/rest-api-reference#8610-documentreference
|
|
58
|
-
exports.contentSchema = zod_1.z.object({
|
|
59
|
-
// _links: resourceTypeSchema, // What's the structure here? - A reserved property for presenting the link relations for this resource.
|
|
60
|
-
resourceType: resourceTypeSchema,
|
|
61
|
-
contained: zod_1.z.array(containedSchema).nullish(),
|
|
62
|
-
masterIdentifier: identifierSchema,
|
|
63
|
-
identifier: zod_1.z.array(identifierSchema).optional(),
|
|
64
|
-
subject: zod_1.z.object({
|
|
65
|
-
reference: zod_1.z.string(), // Supposed to be one of these, but sandbox doesn't match it: Patient | Practitioner | Group | Device
|
|
66
|
-
}),
|
|
67
|
-
type: codeableConceptSchema,
|
|
68
|
-
// class: ?, // Likely a codeableConceptSchema like 'type'?
|
|
69
|
-
author: zod_1.z
|
|
70
|
-
.array(zod_1.z.object({
|
|
71
|
-
reference: zod_1.z.string(), // Supposed to be one of these, but sandbox doesn't match it: Practitioner | Device | Patient | RelatedPerson
|
|
72
|
-
}))
|
|
73
|
-
.optional(),
|
|
74
|
-
// custodian: ?, // It's an Organization, but what data are we going to get here, a simple or strong ID?
|
|
75
|
-
// policyManager: ?, // URI, just a simple string/URI, or object with an inner property?
|
|
76
|
-
// authenticator: ?, // same structure as 'author' with diff options, or diff structure?
|
|
77
|
-
// created: ?, // isoDateTimeSchema, like 'indexed'?
|
|
78
|
-
indexed: iso_datetime_1.isoDateTimeSchema,
|
|
79
|
-
status: statusSchema,
|
|
80
|
-
// docStatus: preliminary | final | appended | amended | entered in error, // What's the structure here? Maybe based on codeableConceptSchema?
|
|
81
|
-
// relatesTo: ?, // What's the structure here?
|
|
82
|
-
// code: replaces | transforms | signs | appends, // Supposed to be required, no example - what's the structure here?
|
|
83
|
-
// target: ?, // Supposed to be required, no example - what's the structure here?
|
|
84
|
-
description: zod_1.z.string().optional(),
|
|
85
|
-
// confidentiality: ?[], // What's the structure here? Maybe based on codeableConceptSchema?
|
|
86
|
-
// primaryLanguage: ?, // What's the structure here?
|
|
87
|
-
mimeType: zod_1.z.string().optional(),
|
|
88
|
-
format: zod_1.z.string().or(zod_1.z.array(zod_1.z.string())).optional(),
|
|
89
|
-
size: zod_1.z.number().optional(),
|
|
90
|
-
hash: zod_1.z.string().optional(),
|
|
91
|
-
location: zod_1.z.string().optional(),
|
|
92
|
-
// What's the structure here? Assuming based on logic/docs
|
|
93
|
-
// service: z
|
|
94
|
-
// .object({
|
|
95
|
-
// type: codeableConceptSchema, // Assuming the structure matches this schema - Type of service (i.e. XDS.b)
|
|
96
|
-
// address: z.string().optional(), // Where service is located (usually a URL)
|
|
97
|
-
// parameter: z // Service call parameters
|
|
98
|
-
// .array(
|
|
99
|
-
// z.object({
|
|
100
|
-
// name: z.string(), // Parameter name in service call
|
|
101
|
-
// value: z.string().optional(), // Parameter value for the name
|
|
102
|
-
// })
|
|
103
|
-
// )
|
|
104
|
-
// .optional(),
|
|
105
|
-
// })
|
|
106
|
-
// .optional(),
|
|
107
|
-
context: zod_1.z.object({
|
|
108
|
-
event: zod_1.z.array(eventSchema).optional(),
|
|
109
|
-
period: period_1.periodSchema.optional(),
|
|
110
|
-
facilityType: codeableConceptSchema.optional(), // Kind of facility where patient was seen
|
|
111
|
-
}),
|
|
112
|
-
});
|
|
113
|
-
exports.documentSchema = zod_1.z.object({
|
|
114
|
-
id: zod_1.z.string(),
|
|
115
|
-
content: exports.contentSchema,
|
|
116
|
-
});
|
|
117
|
-
exports.operationOutcomeSchema = zod_1.z.object({
|
|
118
|
-
id: zod_1.z.string(),
|
|
119
|
-
content: zod_1.z.object({
|
|
120
|
-
resourceType: resourceTypeSchema,
|
|
121
|
-
issue: zod_1.z
|
|
122
|
-
.array(zod_1.z.object({
|
|
123
|
-
severity: zod_1.z.string(),
|
|
124
|
-
type: zod_1.z
|
|
125
|
-
.object({
|
|
126
|
-
code: zod_1.z.string(),
|
|
127
|
-
})
|
|
128
|
-
.optional()
|
|
129
|
-
.nullable(),
|
|
130
|
-
details: zod_1.z.string(),
|
|
131
|
-
}))
|
|
132
|
-
.nullish(),
|
|
133
|
-
}),
|
|
134
|
-
});
|
|
135
|
-
exports.documentReferenceResourceType = "DocumentReference";
|
|
136
|
-
exports.operationOutcomeResourceType = "OperationOutcome";
|
|
137
|
-
exports.documentQueryResponseSchema = zod_1.z.object({
|
|
138
|
-
resourceType: resourceTypeSchema,
|
|
139
|
-
entry: zod_1.z.preprocess(entries => {
|
|
140
|
-
const result = zod_1.z.array(zod_1.z.any()).parse(entries);
|
|
141
|
-
return result.filter(e => e.content?.resourceType === exports.documentReferenceResourceType);
|
|
142
|
-
}, zod_1.z.array(exports.documentSchema)),
|
|
143
|
-
});
|
|
144
|
-
exports.documentQueryFullResponseSchema = zod_1.z.object({
|
|
145
|
-
resourceType: resourceTypeSchema,
|
|
146
|
-
entry: zod_1.z.preprocess(entries => {
|
|
147
|
-
const result = zod_1.z.array(zod_1.z.any()).parse(entries);
|
|
148
|
-
return result.filter(e => e.content?.resourceType === exports.documentReferenceResourceType ||
|
|
149
|
-
e.content?.resourceType === exports.operationOutcomeResourceType);
|
|
150
|
-
}, zod_1.z.array(exports.documentSchema.or(exports.operationOutcomeSchema))),
|
|
151
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.documentQueryFullResponseSchema = exports.documentQueryResponseSchema = exports.operationOutcomeResourceType = exports.documentReferenceResourceType = exports.operationOutcomeSchema = exports.documentSchema = exports.contentSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const address_1 = require("./address");
|
|
6
|
+
const demographics_1 = require("./demographics");
|
|
7
|
+
const human_name_1 = require("./human-name");
|
|
8
|
+
const identifier_1 = require("./identifier");
|
|
9
|
+
const iso_datetime_1 = require("./iso-datetime");
|
|
10
|
+
const period_1 = require("./period");
|
|
11
|
+
// Used as a reference, but not exactly the actual definition:
|
|
12
|
+
// https://specification.commonwellalliance.org/services/rest-api-reference#8610-documentreference
|
|
13
|
+
// TODO can this be an enum?
|
|
14
|
+
// Bundle, DocumentReference, Organization, Practitioner, OperationOutcome
|
|
15
|
+
const resourceTypeSchema = zod_1.z.string().optional();
|
|
16
|
+
// TODO we should try to reuse identifierSchema from models/identifier instead
|
|
17
|
+
// TODO try to replace this when we can properly test it
|
|
18
|
+
const identifierSchema = zod_1.z.object({
|
|
19
|
+
use: identifier_1.identifierUseCodesSchema.optional(),
|
|
20
|
+
system: zod_1.z.string().optional(),
|
|
21
|
+
value: zod_1.z.string(),
|
|
22
|
+
});
|
|
23
|
+
const codeableConceptSchema = zod_1.z.object({
|
|
24
|
+
coding: zod_1.z
|
|
25
|
+
.array(zod_1.z.object({
|
|
26
|
+
system: zod_1.z.string().optional(),
|
|
27
|
+
code: zod_1.z.string().optional(),
|
|
28
|
+
display: zod_1.z.string().optional(),
|
|
29
|
+
}))
|
|
30
|
+
.optional(),
|
|
31
|
+
text: zod_1.z.string().optional(),
|
|
32
|
+
});
|
|
33
|
+
const containedAddress = address_1.addressSchema.partial({
|
|
34
|
+
zip: true,
|
|
35
|
+
});
|
|
36
|
+
const containedSchema = zod_1.z.object({
|
|
37
|
+
resourceType: resourceTypeSchema,
|
|
38
|
+
id: zod_1.z.string().nullish(),
|
|
39
|
+
identifier: zod_1.z.array(identifierSchema).nullish(),
|
|
40
|
+
name: zod_1.z.string().or(human_name_1.humanNameSchema).or(zod_1.z.array(human_name_1.humanNameSchema)).nullish(),
|
|
41
|
+
organization: zod_1.z
|
|
42
|
+
.object({
|
|
43
|
+
reference: zod_1.z.string(),
|
|
44
|
+
})
|
|
45
|
+
.nullish(),
|
|
46
|
+
gender: zod_1.z
|
|
47
|
+
.object({
|
|
48
|
+
coding: zod_1.z.array(demographics_1.genderSchema).optional(),
|
|
49
|
+
})
|
|
50
|
+
.nullish(),
|
|
51
|
+
birthDate: zod_1.z.string().nullish(),
|
|
52
|
+
address: zod_1.z.array(containedAddress).nullish(),
|
|
53
|
+
});
|
|
54
|
+
const statusSchema = zod_1.z.enum(["current", "superceded", "entered in error"]);
|
|
55
|
+
// Main Clinical Acts Documented
|
|
56
|
+
const eventSchema = codeableConceptSchema;
|
|
57
|
+
// https://specification.commonwellalliance.org/services/rest-api-reference#8610-documentreference
|
|
58
|
+
exports.contentSchema = zod_1.z.object({
|
|
59
|
+
// _links: resourceTypeSchema, // What's the structure here? - A reserved property for presenting the link relations for this resource.
|
|
60
|
+
resourceType: resourceTypeSchema,
|
|
61
|
+
contained: zod_1.z.array(containedSchema).nullish(),
|
|
62
|
+
masterIdentifier: identifierSchema,
|
|
63
|
+
identifier: zod_1.z.array(identifierSchema).optional(),
|
|
64
|
+
subject: zod_1.z.object({
|
|
65
|
+
reference: zod_1.z.string(), // Supposed to be one of these, but sandbox doesn't match it: Patient | Practitioner | Group | Device
|
|
66
|
+
}),
|
|
67
|
+
type: codeableConceptSchema,
|
|
68
|
+
// class: ?, // Likely a codeableConceptSchema like 'type'?
|
|
69
|
+
author: zod_1.z
|
|
70
|
+
.array(zod_1.z.object({
|
|
71
|
+
reference: zod_1.z.string(), // Supposed to be one of these, but sandbox doesn't match it: Practitioner | Device | Patient | RelatedPerson
|
|
72
|
+
}))
|
|
73
|
+
.optional(),
|
|
74
|
+
// custodian: ?, // It's an Organization, but what data are we going to get here, a simple or strong ID?
|
|
75
|
+
// policyManager: ?, // URI, just a simple string/URI, or object with an inner property?
|
|
76
|
+
// authenticator: ?, // same structure as 'author' with diff options, or diff structure?
|
|
77
|
+
// created: ?, // isoDateTimeSchema, like 'indexed'?
|
|
78
|
+
indexed: iso_datetime_1.isoDateTimeSchema,
|
|
79
|
+
status: statusSchema,
|
|
80
|
+
// docStatus: preliminary | final | appended | amended | entered in error, // What's the structure here? Maybe based on codeableConceptSchema?
|
|
81
|
+
// relatesTo: ?, // What's the structure here?
|
|
82
|
+
// code: replaces | transforms | signs | appends, // Supposed to be required, no example - what's the structure here?
|
|
83
|
+
// target: ?, // Supposed to be required, no example - what's the structure here?
|
|
84
|
+
description: zod_1.z.string().optional(),
|
|
85
|
+
// confidentiality: ?[], // What's the structure here? Maybe based on codeableConceptSchema?
|
|
86
|
+
// primaryLanguage: ?, // What's the structure here?
|
|
87
|
+
mimeType: zod_1.z.string().optional(),
|
|
88
|
+
format: zod_1.z.string().or(zod_1.z.array(zod_1.z.string())).optional(),
|
|
89
|
+
size: zod_1.z.number().optional(),
|
|
90
|
+
hash: zod_1.z.string().optional(),
|
|
91
|
+
location: zod_1.z.string().optional(),
|
|
92
|
+
// What's the structure here? Assuming based on logic/docs
|
|
93
|
+
// service: z
|
|
94
|
+
// .object({
|
|
95
|
+
// type: codeableConceptSchema, // Assuming the structure matches this schema - Type of service (i.e. XDS.b)
|
|
96
|
+
// address: z.string().optional(), // Where service is located (usually a URL)
|
|
97
|
+
// parameter: z // Service call parameters
|
|
98
|
+
// .array(
|
|
99
|
+
// z.object({
|
|
100
|
+
// name: z.string(), // Parameter name in service call
|
|
101
|
+
// value: z.string().optional(), // Parameter value for the name
|
|
102
|
+
// })
|
|
103
|
+
// )
|
|
104
|
+
// .optional(),
|
|
105
|
+
// })
|
|
106
|
+
// .optional(),
|
|
107
|
+
context: zod_1.z.object({
|
|
108
|
+
event: zod_1.z.array(eventSchema).optional(),
|
|
109
|
+
period: period_1.periodSchema.optional(),
|
|
110
|
+
facilityType: codeableConceptSchema.optional(), // Kind of facility where patient was seen
|
|
111
|
+
}),
|
|
112
|
+
});
|
|
113
|
+
exports.documentSchema = zod_1.z.object({
|
|
114
|
+
id: zod_1.z.string(),
|
|
115
|
+
content: exports.contentSchema,
|
|
116
|
+
});
|
|
117
|
+
exports.operationOutcomeSchema = zod_1.z.object({
|
|
118
|
+
id: zod_1.z.string(),
|
|
119
|
+
content: zod_1.z.object({
|
|
120
|
+
resourceType: resourceTypeSchema,
|
|
121
|
+
issue: zod_1.z
|
|
122
|
+
.array(zod_1.z.object({
|
|
123
|
+
severity: zod_1.z.string(),
|
|
124
|
+
type: zod_1.z
|
|
125
|
+
.object({
|
|
126
|
+
code: zod_1.z.string(),
|
|
127
|
+
})
|
|
128
|
+
.optional()
|
|
129
|
+
.nullable(),
|
|
130
|
+
details: zod_1.z.string(),
|
|
131
|
+
}))
|
|
132
|
+
.nullish(),
|
|
133
|
+
}),
|
|
134
|
+
});
|
|
135
|
+
exports.documentReferenceResourceType = "DocumentReference";
|
|
136
|
+
exports.operationOutcomeResourceType = "OperationOutcome";
|
|
137
|
+
exports.documentQueryResponseSchema = zod_1.z.object({
|
|
138
|
+
resourceType: resourceTypeSchema,
|
|
139
|
+
entry: zod_1.z.preprocess(entries => {
|
|
140
|
+
const result = zod_1.z.array(zod_1.z.any()).parse(entries);
|
|
141
|
+
return result.filter(e => e.content?.resourceType === exports.documentReferenceResourceType);
|
|
142
|
+
}, zod_1.z.array(exports.documentSchema)),
|
|
143
|
+
});
|
|
144
|
+
exports.documentQueryFullResponseSchema = zod_1.z.object({
|
|
145
|
+
resourceType: resourceTypeSchema,
|
|
146
|
+
entry: zod_1.z.preprocess(entries => {
|
|
147
|
+
const result = zod_1.z.array(zod_1.z.any()).parse(entries);
|
|
148
|
+
return result.filter(e => e.content?.resourceType === exports.documentReferenceResourceType ||
|
|
149
|
+
e.content?.resourceType === exports.operationOutcomeResourceType);
|
|
150
|
+
}, zod_1.z.array(exports.documentSchema.or(exports.operationOutcomeSchema))),
|
|
151
|
+
});
|
|
152
152
|
//# sourceMappingURL=document.js.map
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const enrollmentSummarySchema: z.ZodObject<{
|
|
3
|
-
dateEnrolled: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
4
|
-
enroller: z.ZodString;
|
|
5
|
-
dateUnenrolled: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
|
|
6
|
-
unenroller: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
7
|
-
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
dateEnrolled: string;
|
|
9
|
-
enroller: string;
|
|
10
|
-
dateUnenrolled?: string | null | undefined;
|
|
11
|
-
unenroller?: string | null | undefined;
|
|
12
|
-
}, {
|
|
13
|
-
dateEnrolled: string;
|
|
14
|
-
enroller: string;
|
|
15
|
-
dateUnenrolled?: string | null | undefined;
|
|
16
|
-
unenroller?: string | null | undefined;
|
|
17
|
-
}>;
|
|
18
|
-
export type EnrollmentSummary = z.infer<typeof enrollmentSummarySchema>;
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const enrollmentSummarySchema: z.ZodObject<{
|
|
3
|
+
dateEnrolled: z.ZodUnion<[z.ZodString, z.ZodString]>;
|
|
4
|
+
enroller: z.ZodString;
|
|
5
|
+
dateUnenrolled: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
|
|
6
|
+
unenroller: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
dateEnrolled: string;
|
|
9
|
+
enroller: string;
|
|
10
|
+
dateUnenrolled?: string | null | undefined;
|
|
11
|
+
unenroller?: string | null | undefined;
|
|
12
|
+
}, {
|
|
13
|
+
dateEnrolled: string;
|
|
14
|
+
enroller: string;
|
|
15
|
+
dateUnenrolled?: string | null | undefined;
|
|
16
|
+
unenroller?: string | null | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export type EnrollmentSummary = z.infer<typeof enrollmentSummarySchema>;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.enrollmentSummarySchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const iso_date_1 = require("./iso-date");
|
|
6
|
-
const iso_datetime_1 = require("./iso-datetime");
|
|
7
|
-
// A summary of a Person’s enrollment status.
|
|
8
|
-
// See: https://specification.commonwellalliance.org/services/rest-api-reference (8.4.9 EnrollmentSummary)
|
|
9
|
-
exports.enrollmentSummarySchema = zod_1.z.object({
|
|
10
|
-
dateEnrolled: iso_datetime_1.isoDateTimeSchema.or(iso_date_1.isoDateSchema),
|
|
11
|
-
enroller: zod_1.z.string(),
|
|
12
|
-
dateUnenrolled: iso_datetime_1.isoDateTimeSchema.or(iso_date_1.isoDateSchema).optional().nullable(),
|
|
13
|
-
unenroller: zod_1.z.string().optional().nullable(),
|
|
14
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.enrollmentSummarySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const iso_date_1 = require("./iso-date");
|
|
6
|
+
const iso_datetime_1 = require("./iso-datetime");
|
|
7
|
+
// A summary of a Person’s enrollment status.
|
|
8
|
+
// See: https://specification.commonwellalliance.org/services/rest-api-reference (8.4.9 EnrollmentSummary)
|
|
9
|
+
exports.enrollmentSummarySchema = zod_1.z.object({
|
|
10
|
+
dateEnrolled: iso_datetime_1.isoDateTimeSchema.or(iso_date_1.isoDateSchema),
|
|
11
|
+
enroller: zod_1.z.string(),
|
|
12
|
+
dateUnenrolled: iso_datetime_1.isoDateTimeSchema.or(iso_date_1.isoDateSchema).optional().nullable(),
|
|
13
|
+
unenroller: zod_1.z.string().optional().nullable(),
|
|
14
|
+
});
|
|
15
15
|
//# sourceMappingURL=enrollment-summary.js.map
|
package/lib/models/facility.d.ts
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare const facilitySchema: z.ZodObject<{
|
|
3
|
-
id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
4
|
-
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
5
|
-
address: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
6
|
-
use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
|
|
7
|
-
line: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
8
|
-
city: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
-
state: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
10
|
-
zip: z.ZodString;
|
|
11
|
-
country: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
-
period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
13
|
-
start: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
14
|
-
end: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
start?: string | undefined;
|
|
17
|
-
end?: string | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
start?: string | undefined;
|
|
20
|
-
end?: string | undefined;
|
|
21
|
-
}>>>;
|
|
22
|
-
}, "strip", z.ZodTypeAny, {
|
|
23
|
-
zip: string;
|
|
24
|
-
use?: string | null | undefined;
|
|
25
|
-
line?: string[] | null | undefined;
|
|
26
|
-
city?: string | null | undefined;
|
|
27
|
-
state?: string | null | undefined;
|
|
28
|
-
country?: string | null | undefined;
|
|
29
|
-
period?: {
|
|
30
|
-
start?: string | undefined;
|
|
31
|
-
end?: string | undefined;
|
|
32
|
-
} | null | undefined;
|
|
33
|
-
}, {
|
|
34
|
-
zip: string;
|
|
35
|
-
use?: string | null | undefined;
|
|
36
|
-
line?: string[] | null | undefined;
|
|
37
|
-
city?: string | null | undefined;
|
|
38
|
-
state?: string | null | undefined;
|
|
39
|
-
country?: string | null | undefined;
|
|
40
|
-
period?: {
|
|
41
|
-
start?: string | undefined;
|
|
42
|
-
end?: string | undefined;
|
|
43
|
-
} | null | undefined;
|
|
44
|
-
}>>>;
|
|
45
|
-
}, "strip", z.ZodTypeAny, {
|
|
46
|
-
id?: string | null | undefined;
|
|
47
|
-
name?: string | null | undefined;
|
|
48
|
-
address?: {
|
|
49
|
-
zip: string;
|
|
50
|
-
use?: string | null | undefined;
|
|
51
|
-
line?: string[] | null | undefined;
|
|
52
|
-
city?: string | null | undefined;
|
|
53
|
-
state?: string | null | undefined;
|
|
54
|
-
country?: string | null | undefined;
|
|
55
|
-
period?: {
|
|
56
|
-
start?: string | undefined;
|
|
57
|
-
end?: string | undefined;
|
|
58
|
-
} | null | undefined;
|
|
59
|
-
} | null | undefined;
|
|
60
|
-
}, {
|
|
61
|
-
id?: string | null | undefined;
|
|
62
|
-
name?: string | null | undefined;
|
|
63
|
-
address?: {
|
|
64
|
-
zip: string;
|
|
65
|
-
use?: string | null | undefined;
|
|
66
|
-
line?: string[] | null | undefined;
|
|
67
|
-
city?: string | null | undefined;
|
|
68
|
-
state?: string | null | undefined;
|
|
69
|
-
country?: string | null | undefined;
|
|
70
|
-
period?: {
|
|
71
|
-
start?: string | undefined;
|
|
72
|
-
end?: string | undefined;
|
|
73
|
-
} | null | undefined;
|
|
74
|
-
} | null | undefined;
|
|
75
|
-
}>;
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const facilitySchema: z.ZodObject<{
|
|
3
|
+
id: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
4
|
+
name: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
5
|
+
address: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
6
|
+
use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
|
|
7
|
+
line: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
|
|
8
|
+
city: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
9
|
+
state: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
10
|
+
zip: z.ZodString;
|
|
11
|
+
country: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
12
|
+
period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
13
|
+
start: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
14
|
+
end: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
start?: string | undefined;
|
|
17
|
+
end?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
start?: string | undefined;
|
|
20
|
+
end?: string | undefined;
|
|
21
|
+
}>>>;
|
|
22
|
+
}, "strip", z.ZodTypeAny, {
|
|
23
|
+
zip: string;
|
|
24
|
+
use?: string | null | undefined;
|
|
25
|
+
line?: string[] | null | undefined;
|
|
26
|
+
city?: string | null | undefined;
|
|
27
|
+
state?: string | null | undefined;
|
|
28
|
+
country?: string | null | undefined;
|
|
29
|
+
period?: {
|
|
30
|
+
start?: string | undefined;
|
|
31
|
+
end?: string | undefined;
|
|
32
|
+
} | null | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
zip: string;
|
|
35
|
+
use?: string | null | undefined;
|
|
36
|
+
line?: string[] | null | undefined;
|
|
37
|
+
city?: string | null | undefined;
|
|
38
|
+
state?: string | null | undefined;
|
|
39
|
+
country?: string | null | undefined;
|
|
40
|
+
period?: {
|
|
41
|
+
start?: string | undefined;
|
|
42
|
+
end?: string | undefined;
|
|
43
|
+
} | null | undefined;
|
|
44
|
+
}>>>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
id?: string | null | undefined;
|
|
47
|
+
name?: string | null | undefined;
|
|
48
|
+
address?: {
|
|
49
|
+
zip: string;
|
|
50
|
+
use?: string | null | undefined;
|
|
51
|
+
line?: string[] | null | undefined;
|
|
52
|
+
city?: string | null | undefined;
|
|
53
|
+
state?: string | null | undefined;
|
|
54
|
+
country?: string | null | undefined;
|
|
55
|
+
period?: {
|
|
56
|
+
start?: string | undefined;
|
|
57
|
+
end?: string | undefined;
|
|
58
|
+
} | null | undefined;
|
|
59
|
+
} | null | undefined;
|
|
60
|
+
}, {
|
|
61
|
+
id?: string | null | undefined;
|
|
62
|
+
name?: string | null | undefined;
|
|
63
|
+
address?: {
|
|
64
|
+
zip: string;
|
|
65
|
+
use?: string | null | undefined;
|
|
66
|
+
line?: string[] | null | undefined;
|
|
67
|
+
city?: string | null | undefined;
|
|
68
|
+
state?: string | null | undefined;
|
|
69
|
+
country?: string | null | undefined;
|
|
70
|
+
period?: {
|
|
71
|
+
start?: string | undefined;
|
|
72
|
+
end?: string | undefined;
|
|
73
|
+
} | null | undefined;
|
|
74
|
+
} | null | undefined;
|
|
75
|
+
}>;
|
package/lib/models/facility.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.facilitySchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
const address_1 = require("./address");
|
|
6
|
-
exports.facilitySchema = zod_1.z.object({
|
|
7
|
-
id: zod_1.z.string().optional().nullable(),
|
|
8
|
-
name: zod_1.z.string().optional().nullable(),
|
|
9
|
-
address: address_1.addressSchema.optional().nullable(),
|
|
10
|
-
});
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.facilitySchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const address_1 = require("./address");
|
|
6
|
+
exports.facilitySchema = zod_1.z.object({
|
|
7
|
+
id: zod_1.z.string().optional().nullable(),
|
|
8
|
+
name: zod_1.z.string().optional().nullable(),
|
|
9
|
+
address: address_1.addressSchema.optional().nullable(),
|
|
10
|
+
});
|
|
11
11
|
//# sourceMappingURL=facility.js.map
|
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
export declare enum NameUseCodes {
|
|
3
|
-
usual = "usual",
|
|
4
|
-
official = "official",
|
|
5
|
-
temp = "temp",
|
|
6
|
-
nickname = "nickname",
|
|
7
|
-
anonymous = "anonymous",
|
|
8
|
-
old = "old",
|
|
9
|
-
maiden = "maiden",
|
|
10
|
-
unspecified = "unspecified"
|
|
11
|
-
}
|
|
12
|
-
export declare const nameUseCodesSchema: z.ZodEnum<[string, ...string[]]>;
|
|
13
|
-
export declare const humanNameSchema: z.ZodObject<{
|
|
14
|
-
use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
|
|
15
|
-
text: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
16
|
-
family: z.ZodArray<z.ZodString, "many">;
|
|
17
|
-
given: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
-
prefix: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
19
|
-
suffix: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
20
|
-
period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
21
|
-
start: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
22
|
-
end: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
23
|
-
}, "strip", z.ZodTypeAny, {
|
|
24
|
-
start?: string | undefined;
|
|
25
|
-
end?: string | undefined;
|
|
26
|
-
}, {
|
|
27
|
-
start?: string | undefined;
|
|
28
|
-
end?: string | undefined;
|
|
29
|
-
}>>>;
|
|
30
|
-
}, "strip", z.ZodTypeAny, {
|
|
31
|
-
family: string[];
|
|
32
|
-
use?: string | null | undefined;
|
|
33
|
-
text?: string | null | undefined;
|
|
34
|
-
given?: string[] | undefined;
|
|
35
|
-
prefix?: string | string[] | null | undefined;
|
|
36
|
-
suffix?: string | null | undefined;
|
|
37
|
-
period?: {
|
|
38
|
-
start?: string | undefined;
|
|
39
|
-
end?: string | undefined;
|
|
40
|
-
} | null | undefined;
|
|
41
|
-
}, {
|
|
42
|
-
family: string[];
|
|
43
|
-
use?: string | null | undefined;
|
|
44
|
-
text?: string | null | undefined;
|
|
45
|
-
given?: string[] | undefined;
|
|
46
|
-
prefix?: string | string[] | null | undefined;
|
|
47
|
-
suffix?: string | null | undefined;
|
|
48
|
-
period?: {
|
|
49
|
-
start?: string | undefined;
|
|
50
|
-
end?: string | undefined;
|
|
51
|
-
} | null | undefined;
|
|
52
|
-
}>;
|
|
53
|
-
export type HumanName = z.infer<typeof humanNameSchema>;
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare enum NameUseCodes {
|
|
3
|
+
usual = "usual",
|
|
4
|
+
official = "official",
|
|
5
|
+
temp = "temp",
|
|
6
|
+
nickname = "nickname",
|
|
7
|
+
anonymous = "anonymous",
|
|
8
|
+
old = "old",
|
|
9
|
+
maiden = "maiden",
|
|
10
|
+
unspecified = "unspecified"
|
|
11
|
+
}
|
|
12
|
+
export declare const nameUseCodesSchema: z.ZodEnum<[string, ...string[]]>;
|
|
13
|
+
export declare const humanNameSchema: z.ZodObject<{
|
|
14
|
+
use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
|
|
15
|
+
text: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
16
|
+
family: z.ZodArray<z.ZodString, "many">;
|
|
17
|
+
given: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
prefix: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>>;
|
|
19
|
+
suffix: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
20
|
+
period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
|
|
21
|
+
start: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
22
|
+
end: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
start?: string | undefined;
|
|
25
|
+
end?: string | undefined;
|
|
26
|
+
}, {
|
|
27
|
+
start?: string | undefined;
|
|
28
|
+
end?: string | undefined;
|
|
29
|
+
}>>>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
family: string[];
|
|
32
|
+
use?: string | null | undefined;
|
|
33
|
+
text?: string | null | undefined;
|
|
34
|
+
given?: string[] | undefined;
|
|
35
|
+
prefix?: string | string[] | null | undefined;
|
|
36
|
+
suffix?: string | null | undefined;
|
|
37
|
+
period?: {
|
|
38
|
+
start?: string | undefined;
|
|
39
|
+
end?: string | undefined;
|
|
40
|
+
} | null | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
family: string[];
|
|
43
|
+
use?: string | null | undefined;
|
|
44
|
+
text?: string | null | undefined;
|
|
45
|
+
given?: string[] | undefined;
|
|
46
|
+
prefix?: string | string[] | null | undefined;
|
|
47
|
+
suffix?: string | null | undefined;
|
|
48
|
+
period?: {
|
|
49
|
+
start?: string | undefined;
|
|
50
|
+
end?: string | undefined;
|
|
51
|
+
} | null | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
export type HumanName = z.infer<typeof humanNameSchema>;
|