@metriport/commonwell-sdk 1.0.2 → 1.0.3

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.
Files changed (43) hide show
  1. package/lib/client/commonwell.d.ts +29 -0
  2. package/lib/client/commonwell.js +89 -0
  3. package/lib/client/commonwell.js.map +1 -0
  4. package/lib/common/util.d.ts +2 -0
  5. package/lib/common/util.js +9 -0
  6. package/lib/common/util.js.map +1 -0
  7. package/lib/index.d.ts +9 -0
  8. package/lib/index.js +17 -1
  9. package/lib/index.js.map +1 -1
  10. package/lib/models/address.d.ts +50 -0
  11. package/lib/models/address.js +24 -0
  12. package/lib/models/address.js.map +1 -0
  13. package/lib/models/contact.d.ts +50 -0
  14. package/lib/models/contact.js +31 -0
  15. package/lib/models/contact.js.map +1 -0
  16. package/lib/models/demographics.d.ts +291 -0
  17. package/lib/models/demographics.js +32 -0
  18. package/lib/models/demographics.js.map +1 -0
  19. package/lib/models/enrollment-summary.d.ts +18 -0
  20. package/lib/models/enrollment-summary.js +13 -0
  21. package/lib/models/enrollment-summary.js.map +1 -0
  22. package/lib/models/human-name.d.ts +53 -0
  23. package/lib/models/human-name.js +27 -0
  24. package/lib/models/human-name.js.map +1 -0
  25. package/lib/models/identifier.d.ts +46 -0
  26. package/lib/models/identifier.js +22 -0
  27. package/lib/models/identifier.js.map +1 -0
  28. package/lib/models/iso-date.d.ts +3 -0
  29. package/lib/models/iso-date.js +9 -0
  30. package/lib/models/iso-date.js.map +1 -0
  31. package/lib/models/iso-datetime.d.ts +3 -0
  32. package/lib/models/iso-datetime.js +9 -0
  33. package/lib/models/iso-datetime.js.map +1 -0
  34. package/lib/models/link.d.ts +15 -0
  35. package/lib/models/link.js +10 -0
  36. package/lib/models/link.js.map +1 -0
  37. package/lib/models/period.d.ts +12 -0
  38. package/lib/models/period.js +11 -0
  39. package/lib/models/period.js.map +1 -0
  40. package/lib/models/person.d.ts +1700 -0
  41. package/lib/models/person.js +26 -0
  42. package/lib/models/person.js.map +1 -0
  43. package/package.json +4 -3
@@ -0,0 +1,29 @@
1
+ import { PurposeOfUse } from "../models/purpose-of-use";
2
+ import { Person, PersonSearchResp } from "../models/person";
3
+ export declare enum APIMode {
4
+ integration = "integration",
5
+ production = "production"
6
+ }
7
+ export interface RequestMetadata {
8
+ role: string;
9
+ subjectId: string;
10
+ purposeOfUse: PurposeOfUse;
11
+ npi?: string;
12
+ payloadHash?: string;
13
+ }
14
+ export declare class CommonWell {
15
+ static integrationUrl: string;
16
+ static productionUrl: string;
17
+ private api;
18
+ private rsaPrivateKey;
19
+ private orgName;
20
+ private oid;
21
+ private httpsAgent;
22
+ constructor(orgCert: string, rsaPrivateKey: string, orgName: string, oid: string, apiMode: APIMode);
23
+ enrollPerson(meta: RequestMetadata, person: Person): Promise<Person>;
24
+ searchPerson(meta: RequestMetadata, key: string, system: string): Promise<PersonSearchResp>;
25
+ updatePerson(meta: RequestMetadata, person: Person, id: string): Promise<Person>;
26
+ unenrollPerson(meta: RequestMetadata, id: string): Promise<Person>;
27
+ deletePerson(meta: RequestMetadata, id: string): Promise<void>;
28
+ private buildQueryHeaders;
29
+ }
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.CommonWell = exports.APIMode = void 0;
13
+ const axios_1 = require("axios");
14
+ const https_1 = require("https");
15
+ const make_jwt_1 = require("../common/make-jwt");
16
+ const person_1 = require("../models/person");
17
+ var APIMode;
18
+ (function (APIMode) {
19
+ APIMode["integration"] = "integration";
20
+ APIMode["production"] = "production";
21
+ })(APIMode = exports.APIMode || (exports.APIMode = {}));
22
+ class CommonWell {
23
+ constructor(orgCert, rsaPrivateKey, orgName, oid, apiMode) {
24
+ this.rsaPrivateKey = rsaPrivateKey;
25
+ this.httpsAgent = new https_1.Agent({ cert: orgCert, key: rsaPrivateKey });
26
+ this.api = axios_1.default.create({
27
+ baseURL: apiMode === APIMode.production
28
+ ? CommonWell.productionUrl
29
+ : CommonWell.integrationUrl,
30
+ httpsAgent: this.httpsAgent,
31
+ });
32
+ this.orgName = orgName;
33
+ this.oid = oid;
34
+ }
35
+ enrollPerson(meta, person) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ const headers = yield this.buildQueryHeaders(meta);
38
+ const resp = yield this.api.post("/person", person, {
39
+ headers,
40
+ });
41
+ return person_1.personSchema.parse(resp.data);
42
+ });
43
+ }
44
+ searchPerson(meta, key, system) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ const headers = yield this.buildQueryHeaders(meta);
47
+ const resp = yield this.api.get("/person", {
48
+ headers,
49
+ params: { key, system },
50
+ });
51
+ return person_1.personSearchRespSchema.parse(resp.data);
52
+ });
53
+ }
54
+ updatePerson(meta, person, id) {
55
+ return __awaiter(this, void 0, void 0, function* () {
56
+ const headers = yield this.buildQueryHeaders(meta);
57
+ const resp = yield this.api.post(`/person/${id}`, person, {
58
+ headers,
59
+ });
60
+ return person_1.personSchema.parse(resp.data);
61
+ });
62
+ }
63
+ unenrollPerson(meta, id) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const headers = yield this.buildQueryHeaders(meta);
66
+ const resp = yield this.api.put(`/person/${id}/unenroll`, {}, {
67
+ headers,
68
+ });
69
+ return person_1.personSchema.parse(resp.data);
70
+ });
71
+ }
72
+ deletePerson(meta, id) {
73
+ return __awaiter(this, void 0, void 0, function* () {
74
+ const headers = yield this.buildQueryHeaders(meta);
75
+ yield this.api.delete(`/person/${id}`, { headers });
76
+ return;
77
+ });
78
+ }
79
+ buildQueryHeaders(meta) {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ const jwt = yield (0, make_jwt_1.makeJwt)(this.rsaPrivateKey, meta.role, meta.subjectId, this.orgName, this.oid, meta.purposeOfUse, meta.npi, meta.payloadHash);
82
+ return { Authorization: `Bearer ${jwt}` };
83
+ });
84
+ }
85
+ }
86
+ exports.CommonWell = CommonWell;
87
+ CommonWell.integrationUrl = "https://integration.rest.api.commonwellalliance.org/v1";
88
+ CommonWell.productionUrl = "https://rest.api.commonwellalliance.org/v1";
89
+ //# sourceMappingURL=commonwell.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commonwell.js","sourceRoot":"","sources":["../../src/client/commonwell.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,2 @@
1
+ import { Person } from "../models/person";
2
+ export declare function getId(object: Person): string;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getId = void 0;
4
+ function getId(object) {
5
+ const url = object._links.self.href;
6
+ return url.substring(url.lastIndexOf("/") + 1);
7
+ }
8
+ exports.getId = getId;
9
+ //# sourceMappingURL=util.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/common/util.ts"],"names":[],"mappings":";;;AAEA,SAAgB,KAAK,CAAC,MAAc;IAClC,MAAM,GAAG,GAAG,MAAM,CAAC,MAAO,CAAC,IAAI,CAAC,IAAI,CAAC;IACrC,OAAO,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AACjD,CAAC;AAHD,sBAGC"}
package/lib/index.d.ts CHANGED
@@ -1,2 +1,11 @@
1
1
  export { makeJwt } from "./common/make-jwt";
2
+ export { getId } from "./common/util";
2
3
  export { PurposeOfUse } from "./models/purpose-of-use";
4
+ export { Address, AddressUseCodes } from "./models/address";
5
+ export { Contact, ContactSystemCodes, ContactUseCodes } from "./models/contact";
6
+ export { Demographics, GenderCodes } from "./models/demographics";
7
+ export { EnrollmentSummary } from "./models/enrollment-summary";
8
+ export { HumanName, NameUseCodes } from "./models/human-name";
9
+ export { Identifier, IdentifierUseCodes } from "./models/identifier";
10
+ export { Person } from "./models/person";
11
+ export { CommonWell, APIMode, RequestMetadata } from "./client/commonwell";
package/lib/index.js CHANGED
@@ -1,8 +1,24 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PurposeOfUse = exports.makeJwt = void 0;
3
+ exports.APIMode = exports.CommonWell = exports.IdentifierUseCodes = exports.NameUseCodes = exports.GenderCodes = exports.ContactUseCodes = exports.ContactSystemCodes = exports.AddressUseCodes = exports.PurposeOfUse = exports.getId = exports.makeJwt = void 0;
4
4
  var make_jwt_1 = require("./common/make-jwt");
5
5
  Object.defineProperty(exports, "makeJwt", { enumerable: true, get: function () { return make_jwt_1.makeJwt; } });
6
+ var util_1 = require("./common/util");
7
+ Object.defineProperty(exports, "getId", { enumerable: true, get: function () { return util_1.getId; } });
6
8
  var purpose_of_use_1 = require("./models/purpose-of-use");
7
9
  Object.defineProperty(exports, "PurposeOfUse", { enumerable: true, get: function () { return purpose_of_use_1.PurposeOfUse; } });
10
+ var address_1 = require("./models/address");
11
+ Object.defineProperty(exports, "AddressUseCodes", { enumerable: true, get: function () { return address_1.AddressUseCodes; } });
12
+ var contact_1 = require("./models/contact");
13
+ Object.defineProperty(exports, "ContactSystemCodes", { enumerable: true, get: function () { return contact_1.ContactSystemCodes; } });
14
+ Object.defineProperty(exports, "ContactUseCodes", { enumerable: true, get: function () { return contact_1.ContactUseCodes; } });
15
+ var demographics_1 = require("./models/demographics");
16
+ Object.defineProperty(exports, "GenderCodes", { enumerable: true, get: function () { return demographics_1.GenderCodes; } });
17
+ var human_name_1 = require("./models/human-name");
18
+ Object.defineProperty(exports, "NameUseCodes", { enumerable: true, get: function () { return human_name_1.NameUseCodes; } });
19
+ var identifier_1 = require("./models/identifier");
20
+ Object.defineProperty(exports, "IdentifierUseCodes", { enumerable: true, get: function () { return identifier_1.IdentifierUseCodes; } });
21
+ var commonwell_1 = require("./client/commonwell");
22
+ Object.defineProperty(exports, "CommonWell", { enumerable: true, get: function () { return commonwell_1.CommonWell; } });
23
+ Object.defineProperty(exports, "APIMode", { enumerable: true, get: function () { return commonwell_1.APIMode; } });
8
24
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,8CAA4C;AAAnC,mGAAA,OAAO,OAAA;AAChB,0DAAqD;AAA7C,8GAAA,YAAY,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,8CAA4C;AAAnC,mGAAA,OAAO,OAAA;AAChB,sCAAsC;AAA7B,6FAAA,KAAK,OAAA;AACd,0DAAuD;AAA9C,8GAAA,YAAY,OAAA;AACrB,4CAA4D;AAA1C,0GAAA,eAAe,OAAA;AACjC,4CAAgF;AAA9D,6GAAA,kBAAkB,OAAA;AAAE,0GAAA,eAAe,OAAA;AACrD,sDAAkE;AAA3C,2GAAA,WAAW,OAAA;AAElC,kDAA8D;AAA1C,0GAAA,YAAY,OAAA;AAChC,kDAAqE;AAAhD,gHAAA,kBAAkB,OAAA;AAEvC,kDAA2E;AAAlE,wGAAA,UAAU,OAAA;AAAE,qGAAA,OAAO,OAAA"}
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ export declare enum AddressUseCodes {
3
+ home = "home",
4
+ work = "work",
5
+ temp = "temp",
6
+ old = "old",
7
+ unspecified = "unspecified"
8
+ }
9
+ export declare const addressUseCodesSchema: z.ZodEnum<[string, ...string[]]>;
10
+ export declare const addressSchema: z.ZodObject<{
11
+ use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
12
+ line: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
13
+ city: z.ZodNullable<z.ZodOptional<z.ZodString>>;
14
+ state: z.ZodNullable<z.ZodOptional<z.ZodString>>;
15
+ zip: z.ZodString;
16
+ country: z.ZodNullable<z.ZodOptional<z.ZodString>>;
17
+ period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
18
+ start: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
19
+ end: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
20
+ }, "strip", z.ZodTypeAny, {
21
+ end?: string;
22
+ start?: string;
23
+ }, {
24
+ end?: string;
25
+ start?: string;
26
+ }>>>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ line?: string[];
29
+ use?: string;
30
+ period?: {
31
+ end?: string;
32
+ start?: string;
33
+ };
34
+ city?: string;
35
+ state?: string;
36
+ zip?: string;
37
+ country?: string;
38
+ }, {
39
+ line?: string[];
40
+ use?: string;
41
+ period?: {
42
+ end?: string;
43
+ start?: string;
44
+ };
45
+ city?: string;
46
+ state?: string;
47
+ zip?: string;
48
+ country?: string;
49
+ }>;
50
+ export type Address = z.infer<typeof addressSchema>;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addressSchema = exports.addressUseCodesSchema = exports.AddressUseCodes = void 0;
4
+ const zod_1 = require("zod");
5
+ const period_1 = require("./period");
6
+ var AddressUseCodes;
7
+ (function (AddressUseCodes) {
8
+ AddressUseCodes["home"] = "home";
9
+ AddressUseCodes["work"] = "work";
10
+ AddressUseCodes["temp"] = "temp";
11
+ AddressUseCodes["old"] = "old";
12
+ AddressUseCodes["unspecified"] = "unspecified";
13
+ })(AddressUseCodes = exports.AddressUseCodes || (exports.AddressUseCodes = {}));
14
+ exports.addressUseCodesSchema = zod_1.z.enum(Object.keys(AddressUseCodes));
15
+ exports.addressSchema = zod_1.z.object({
16
+ use: exports.addressUseCodesSchema.optional().nullable(),
17
+ line: zod_1.z.array(zod_1.z.string()).optional().nullable(),
18
+ city: zod_1.z.string().optional().nullable(),
19
+ state: zod_1.z.string().optional().nullable(),
20
+ zip: zod_1.z.string(),
21
+ country: zod_1.z.string().optional().nullable(),
22
+ period: period_1.periodSchema.optional().nullable(),
23
+ });
24
+ //# sourceMappingURL=address.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"address.js","sourceRoot":"","sources":["../../src/models/address.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,qCAAwC;AAKxC,IAAY,eAMX;AAND,WAAY,eAAe;IACzB,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,8BAAW,CAAA;IACX,8CAA2B,CAAA;AAC7B,CAAC,EANW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAM1B;AACY,QAAA,qBAAqB,GAAG,OAAC,CAAC,IAAI,CACzC,MAAM,CAAC,IAAI,CAAC,eAAe,CAA0B,CACtD,CAAC;AAIW,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,GAAG,EAAE,6BAAqB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAChD,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC/C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACtC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACvC,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACzC,MAAM,EAAE,qBAAY,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { z } from "zod";
2
+ export declare enum ContactUseCodes {
3
+ usual = "usual",
4
+ home = "home",
5
+ work = "work",
6
+ temp = "temp",
7
+ old = "old",
8
+ mobile = "mobile",
9
+ unspecified = "unspecified"
10
+ }
11
+ export declare const contactUseCodesSchema: z.ZodEnum<[string, ...string[]]>;
12
+ export declare enum ContactSystemCodes {
13
+ phone = "phone",
14
+ fax = "fax",
15
+ email = "email",
16
+ url = "url"
17
+ }
18
+ export declare const contactSystemCodesSchema: z.ZodEnum<[string, ...string[]]>;
19
+ export declare const contactSchema: z.ZodObject<{
20
+ use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
21
+ system: z.ZodNullable<z.ZodOptional<z.ZodString>>;
22
+ value: z.ZodNullable<z.ZodOptional<z.ZodString>>;
23
+ period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
24
+ start: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
25
+ end: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ end?: string;
28
+ start?: string;
29
+ }, {
30
+ end?: string;
31
+ start?: string;
32
+ }>>>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ value?: string;
35
+ use?: string;
36
+ system?: string;
37
+ period?: {
38
+ end?: string;
39
+ start?: string;
40
+ };
41
+ }, {
42
+ value?: string;
43
+ use?: string;
44
+ system?: string;
45
+ period?: {
46
+ end?: string;
47
+ start?: string;
48
+ };
49
+ }>;
50
+ export type Contact = z.infer<typeof contactSchema>;
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.contactSchema = exports.contactSystemCodesSchema = exports.ContactSystemCodes = exports.contactUseCodesSchema = exports.ContactUseCodes = void 0;
4
+ const zod_1 = require("zod");
5
+ const period_1 = require("./period");
6
+ var ContactUseCodes;
7
+ (function (ContactUseCodes) {
8
+ ContactUseCodes["usual"] = "usual";
9
+ ContactUseCodes["home"] = "home";
10
+ ContactUseCodes["work"] = "work";
11
+ ContactUseCodes["temp"] = "temp";
12
+ ContactUseCodes["old"] = "old";
13
+ ContactUseCodes["mobile"] = "mobile";
14
+ ContactUseCodes["unspecified"] = "unspecified";
15
+ })(ContactUseCodes = exports.ContactUseCodes || (exports.ContactUseCodes = {}));
16
+ exports.contactUseCodesSchema = zod_1.z.enum(Object.keys(ContactUseCodes));
17
+ var ContactSystemCodes;
18
+ (function (ContactSystemCodes) {
19
+ ContactSystemCodes["phone"] = "phone";
20
+ ContactSystemCodes["fax"] = "fax";
21
+ ContactSystemCodes["email"] = "email";
22
+ ContactSystemCodes["url"] = "url";
23
+ })(ContactSystemCodes = exports.ContactSystemCodes || (exports.ContactSystemCodes = {}));
24
+ exports.contactSystemCodesSchema = zod_1.z.enum(Object.keys(ContactSystemCodes));
25
+ exports.contactSchema = zod_1.z.object({
26
+ use: exports.contactUseCodesSchema.optional().nullable(),
27
+ system: zod_1.z.string().optional().nullable(),
28
+ value: zod_1.z.string().optional().nullable(),
29
+ period: period_1.periodSchema.optional().nullable(),
30
+ });
31
+ //# sourceMappingURL=contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.js","sourceRoot":"","sources":["../../src/models/contact.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,qCAAwC;AAKxC,IAAY,eAQX;AARD,WAAY,eAAe;IACzB,kCAAe,CAAA;IACf,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,gCAAa,CAAA;IACb,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,8CAA2B,CAAA;AAC7B,CAAC,EARW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAQ1B;AACY,QAAA,qBAAqB,GAAG,OAAC,CAAC,IAAI,CACzC,MAAM,CAAC,IAAI,CAAC,eAAe,CAA0B,CACtD,CAAC;AAKF,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC5B,qCAAe,CAAA;IACf,iCAAW,CAAA;IACX,qCAAe,CAAA;IACf,iCAAW,CAAA;AACb,CAAC,EALW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAK7B;AACY,QAAA,wBAAwB,GAAG,OAAC,CAAC,IAAI,CAC5C,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAA0B,CACzD,CAAC;AAKW,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,GAAG,EAAE,6BAAqB,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAChD,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACxC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACvC,MAAM,EAAE,qBAAY,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC"}
@@ -0,0 +1,291 @@
1
+ import { z } from "zod";
2
+ export declare enum GenderCodes {
3
+ F = "F",
4
+ M = "M",
5
+ UN = "UN"
6
+ }
7
+ export declare const genderCodesSchema: z.ZodEnum<[string, ...string[]]>;
8
+ export declare const genderSchema: z.ZodObject<{
9
+ code: z.ZodEnum<[string, ...string[]]>;
10
+ display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
11
+ system: z.ZodNullable<z.ZodOptional<z.ZodString>>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ code?: string;
14
+ system?: string;
15
+ display?: string;
16
+ }, {
17
+ code?: string;
18
+ system?: string;
19
+ display?: string;
20
+ }>;
21
+ export type Gender = z.infer<typeof genderSchema>;
22
+ export declare const demographicsSchema: z.ZodObject<{
23
+ identifier: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
24
+ use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
25
+ label: z.ZodNullable<z.ZodOptional<z.ZodString>>;
26
+ system: z.ZodNullable<z.ZodOptional<z.ZodString>>;
27
+ key: z.ZodString;
28
+ period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
29
+ start: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
30
+ end: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
31
+ }, "strip", z.ZodTypeAny, {
32
+ end?: string;
33
+ start?: string;
34
+ }, {
35
+ end?: string;
36
+ start?: string;
37
+ }>>>;
38
+ assigner: z.ZodNullable<z.ZodOptional<z.ZodString>>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ key?: string;
41
+ use?: string;
42
+ label?: string;
43
+ system?: string;
44
+ period?: {
45
+ end?: string;
46
+ start?: string;
47
+ };
48
+ assigner?: string;
49
+ }, {
50
+ key?: string;
51
+ use?: string;
52
+ label?: string;
53
+ system?: string;
54
+ period?: {
55
+ end?: string;
56
+ start?: string;
57
+ };
58
+ assigner?: string;
59
+ }>, "many">>>;
60
+ name: z.ZodArray<z.ZodObject<{
61
+ use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
62
+ text: z.ZodNullable<z.ZodOptional<z.ZodString>>;
63
+ family: z.ZodArray<z.ZodString, "many">;
64
+ given: z.ZodArray<z.ZodString, "many">;
65
+ prefix: z.ZodNullable<z.ZodOptional<z.ZodString>>;
66
+ suffix: z.ZodNullable<z.ZodOptional<z.ZodString>>;
67
+ period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
68
+ start: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
69
+ end: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ end?: string;
72
+ start?: string;
73
+ }, {
74
+ end?: string;
75
+ start?: string;
76
+ }>>>;
77
+ }, "strip", z.ZodTypeAny, {
78
+ family?: string[];
79
+ use?: string;
80
+ period?: {
81
+ end?: string;
82
+ start?: string;
83
+ };
84
+ text?: string;
85
+ given?: string[];
86
+ prefix?: string;
87
+ suffix?: string;
88
+ }, {
89
+ family?: string[];
90
+ use?: string;
91
+ period?: {
92
+ end?: string;
93
+ start?: string;
94
+ };
95
+ text?: string;
96
+ given?: string[];
97
+ prefix?: string;
98
+ suffix?: string;
99
+ }>, "many">;
100
+ telecom: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodObject<{
101
+ use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
102
+ system: z.ZodNullable<z.ZodOptional<z.ZodString>>;
103
+ value: z.ZodNullable<z.ZodOptional<z.ZodString>>;
104
+ period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
105
+ start: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
106
+ end: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ end?: string;
109
+ start?: string;
110
+ }, {
111
+ end?: string;
112
+ start?: string;
113
+ }>>>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ value?: string;
116
+ use?: string;
117
+ system?: string;
118
+ period?: {
119
+ end?: string;
120
+ start?: string;
121
+ };
122
+ }, {
123
+ value?: string;
124
+ use?: string;
125
+ system?: string;
126
+ period?: {
127
+ end?: string;
128
+ start?: string;
129
+ };
130
+ }>, "many">>>;
131
+ gender: z.ZodObject<{
132
+ code: z.ZodEnum<[string, ...string[]]>;
133
+ display: z.ZodNullable<z.ZodOptional<z.ZodString>>;
134
+ system: z.ZodNullable<z.ZodOptional<z.ZodString>>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ code?: string;
137
+ system?: string;
138
+ display?: string;
139
+ }, {
140
+ code?: string;
141
+ system?: string;
142
+ display?: string;
143
+ }>;
144
+ birthDate: z.ZodUnion<[z.ZodString, z.ZodString]>;
145
+ address: z.ZodArray<z.ZodObject<{
146
+ use: z.ZodNullable<z.ZodOptional<z.ZodEnum<[string, ...string[]]>>>;
147
+ line: z.ZodNullable<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
148
+ city: z.ZodNullable<z.ZodOptional<z.ZodString>>;
149
+ state: z.ZodNullable<z.ZodOptional<z.ZodString>>;
150
+ zip: z.ZodString;
151
+ country: z.ZodNullable<z.ZodOptional<z.ZodString>>;
152
+ period: z.ZodNullable<z.ZodOptional<z.ZodObject<{
153
+ start: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
154
+ end: z.ZodNullable<z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodString]>>>;
155
+ }, "strip", z.ZodTypeAny, {
156
+ end?: string;
157
+ start?: string;
158
+ }, {
159
+ end?: string;
160
+ start?: string;
161
+ }>>>;
162
+ }, "strip", z.ZodTypeAny, {
163
+ line?: string[];
164
+ use?: string;
165
+ period?: {
166
+ end?: string;
167
+ start?: string;
168
+ };
169
+ city?: string;
170
+ state?: string;
171
+ zip?: string;
172
+ country?: string;
173
+ }, {
174
+ line?: string[];
175
+ use?: string;
176
+ period?: {
177
+ end?: string;
178
+ start?: string;
179
+ };
180
+ city?: string;
181
+ state?: string;
182
+ zip?: string;
183
+ country?: string;
184
+ }>, "many">;
185
+ picture: z.ZodNullable<z.ZodOptional<z.ZodAny>>;
186
+ }, "strip", z.ZodTypeAny, {
187
+ name?: {
188
+ family?: string[];
189
+ use?: string;
190
+ period?: {
191
+ end?: string;
192
+ start?: string;
193
+ };
194
+ text?: string;
195
+ given?: string[];
196
+ prefix?: string;
197
+ suffix?: string;
198
+ }[];
199
+ identifier?: {
200
+ key?: string;
201
+ use?: string;
202
+ label?: string;
203
+ system?: string;
204
+ period?: {
205
+ end?: string;
206
+ start?: string;
207
+ };
208
+ assigner?: string;
209
+ }[];
210
+ telecom?: {
211
+ value?: string;
212
+ use?: string;
213
+ system?: string;
214
+ period?: {
215
+ end?: string;
216
+ start?: string;
217
+ };
218
+ }[];
219
+ gender?: {
220
+ code?: string;
221
+ system?: string;
222
+ display?: string;
223
+ };
224
+ birthDate?: string;
225
+ address?: {
226
+ line?: string[];
227
+ use?: string;
228
+ period?: {
229
+ end?: string;
230
+ start?: string;
231
+ };
232
+ city?: string;
233
+ state?: string;
234
+ zip?: string;
235
+ country?: string;
236
+ }[];
237
+ picture?: any;
238
+ }, {
239
+ name?: {
240
+ family?: string[];
241
+ use?: string;
242
+ period?: {
243
+ end?: string;
244
+ start?: string;
245
+ };
246
+ text?: string;
247
+ given?: string[];
248
+ prefix?: string;
249
+ suffix?: string;
250
+ }[];
251
+ identifier?: {
252
+ key?: string;
253
+ use?: string;
254
+ label?: string;
255
+ system?: string;
256
+ period?: {
257
+ end?: string;
258
+ start?: string;
259
+ };
260
+ assigner?: string;
261
+ }[];
262
+ telecom?: {
263
+ value?: string;
264
+ use?: string;
265
+ system?: string;
266
+ period?: {
267
+ end?: string;
268
+ start?: string;
269
+ };
270
+ }[];
271
+ gender?: {
272
+ code?: string;
273
+ system?: string;
274
+ display?: string;
275
+ };
276
+ birthDate?: string;
277
+ address?: {
278
+ line?: string[];
279
+ use?: string;
280
+ period?: {
281
+ end?: string;
282
+ start?: string;
283
+ };
284
+ city?: string;
285
+ state?: string;
286
+ zip?: string;
287
+ country?: string;
288
+ }[];
289
+ picture?: any;
290
+ }>;
291
+ export type Demographics = z.infer<typeof demographicsSchema>;