@metriport/commonwell-sdk 4.3.3 → 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.
Files changed (57) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +40 -40
  3. package/lib/client/commonwell-api.d.ts +49 -49
  4. package/lib/client/commonwell-api.js +2 -2
  5. package/lib/client/commonwell.d.ts +425 -425
  6. package/lib/client/commonwell.js +739 -739
  7. package/lib/client/document.d.ts +7 -7
  8. package/lib/client/document.js +71 -71
  9. package/lib/common/commonwell-error.d.ts +12 -12
  10. package/lib/common/commonwell-error.js +34 -34
  11. package/lib/common/fileDownload.d.ts +11 -11
  12. package/lib/common/fileDownload.js +43 -43
  13. package/lib/common/make-jwt.d.ts +24 -24
  14. package/lib/common/make-jwt.js +90 -90
  15. package/lib/common/metriport-error.d.ts +4 -4
  16. package/lib/common/metriport-error.js +33 -33
  17. package/lib/common/util.d.ts +25 -25
  18. package/lib/common/util.js +70 -70
  19. package/lib/common/validate-npi.d.ts +9 -9
  20. package/lib/common/validate-npi.js +39 -39
  21. package/lib/index.d.ts +20 -20
  22. package/lib/index.js +54 -54
  23. package/lib/models/address.d.ts +50 -50
  24. package/lib/models/address.js +28 -28
  25. package/lib/models/certificates.d.ts +156 -156
  26. package/lib/models/certificates.js +26 -26
  27. package/lib/models/contact.d.ts +50 -50
  28. package/lib/models/contact.js +39 -39
  29. package/lib/models/demographics.d.ts +292 -292
  30. package/lib/models/demographics.js +34 -34
  31. package/lib/models/document.d.ts +4421 -4421
  32. package/lib/models/document.js +151 -151
  33. package/lib/models/enrollment-summary.d.ts +18 -18
  34. package/lib/models/enrollment-summary.js +14 -14
  35. package/lib/models/facility.d.ts +75 -75
  36. package/lib/models/facility.js +10 -10
  37. package/lib/models/human-name.d.ts +53 -53
  38. package/lib/models/human-name.js +37 -37
  39. package/lib/models/identifier.d.ts +79 -79
  40. package/lib/models/identifier.js +36 -36
  41. package/lib/models/iso-date.d.ts +3 -3
  42. package/lib/models/iso-date.js +6 -6
  43. package/lib/models/iso-datetime.d.ts +3 -3
  44. package/lib/models/iso-datetime.js +8 -8
  45. package/lib/models/link.d.ts +642 -642
  46. package/lib/models/link.js +50 -50
  47. package/lib/models/organization.d.ts +763 -763
  48. package/lib/models/organization.js +83 -83
  49. package/lib/models/patient.d.ts +3617 -3617
  50. package/lib/models/patient.js +49 -49
  51. package/lib/models/period.d.ts +12 -12
  52. package/lib/models/period.js +12 -12
  53. package/lib/models/person.d.ts +2440 -2440
  54. package/lib/models/person.js +39 -39
  55. package/lib/models/purpose-of-use.d.ts +29 -29
  56. package/lib/models/purpose-of-use.js +34 -34
  57. package/package.json +2 -2
@@ -1,51 +1,51 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patientLinkProxySchema = exports.networkLinkSchema = exports.linkSchema = exports.lolaSchema = exports.isLOLA4 = exports.isLOLA3 = exports.isLOLA2 = exports.isLOLA1 = exports.LOLA = void 0;
4
- const zod_1 = require("zod");
5
- const demographics_1 = require("./demographics");
6
- var LOLA;
7
- (function (LOLA) {
8
- LOLA["level_0"] = "0";
9
- LOLA["level_1"] = "1";
10
- LOLA["level_2"] = "2";
11
- LOLA["level_3"] = "3";
12
- LOLA["level_4"] = "4";
13
- })(LOLA = exports.LOLA || (exports.LOLA = {}));
14
- const isLOLA1 = (link) => link && link.assuranceLevel === LOLA.level_1;
15
- exports.isLOLA1 = isLOLA1;
16
- const isLOLA2 = (link) => link && link.assuranceLevel === LOLA.level_2;
17
- exports.isLOLA2 = isLOLA2;
18
- const isLOLA3 = (link) => link && link.assuranceLevel === LOLA.level_3;
19
- exports.isLOLA3 = isLOLA3;
20
- const isLOLA4 = (link) => link && link.assuranceLevel === LOLA.level_4;
21
- exports.isLOLA4 = isLOLA4;
22
- exports.lolaSchema = zod_1.z.enum(Object.values(LOLA));
23
- // A Link Object represents a hyperlink from the containing resource to a URI.
24
- // See: https://specification.commonwellalliance.org/services/rest-api-reference (8.4.3 Address)
25
- exports.linkSchema = zod_1.z.object({
26
- href: zod_1.z.string().optional().nullable(),
27
- templated: zod_1.z.boolean().optional().nullable(),
28
- type: zod_1.z.string().optional().nullable(),
29
- });
30
- exports.networkLinkSchema = zod_1.z.object({
31
- _links: zod_1.z
32
- .object({
33
- self: exports.linkSchema.optional().nullable(),
34
- upgrade: exports.linkSchema.optional().nullable(),
35
- downgrade: exports.linkSchema.optional().nullable(),
36
- })
37
- .optional()
38
- .nullable(),
39
- assuranceLevel: exports.lolaSchema.optional().nullable(),
40
- patient: zod_1.z
41
- .object({
42
- details: demographics_1.demographicsSchema,
43
- })
44
- .optional()
45
- .nullable(),
46
- });
47
- exports.patientLinkProxySchema = zod_1.z.object({
48
- relationship: zod_1.z.string().optional().nullable(),
49
- name: zod_1.z.string().optional().nullable(),
50
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.patientLinkProxySchema = exports.networkLinkSchema = exports.linkSchema = exports.lolaSchema = exports.isLOLA4 = exports.isLOLA3 = exports.isLOLA2 = exports.isLOLA1 = exports.LOLA = void 0;
4
+ const zod_1 = require("zod");
5
+ const demographics_1 = require("./demographics");
6
+ var LOLA;
7
+ (function (LOLA) {
8
+ LOLA["level_0"] = "0";
9
+ LOLA["level_1"] = "1";
10
+ LOLA["level_2"] = "2";
11
+ LOLA["level_3"] = "3";
12
+ LOLA["level_4"] = "4";
13
+ })(LOLA = exports.LOLA || (exports.LOLA = {}));
14
+ const isLOLA1 = (link) => link && link.assuranceLevel === LOLA.level_1;
15
+ exports.isLOLA1 = isLOLA1;
16
+ const isLOLA2 = (link) => link && link.assuranceLevel === LOLA.level_2;
17
+ exports.isLOLA2 = isLOLA2;
18
+ const isLOLA3 = (link) => link && link.assuranceLevel === LOLA.level_3;
19
+ exports.isLOLA3 = isLOLA3;
20
+ const isLOLA4 = (link) => link && link.assuranceLevel === LOLA.level_4;
21
+ exports.isLOLA4 = isLOLA4;
22
+ exports.lolaSchema = zod_1.z.enum(Object.values(LOLA));
23
+ // A Link Object represents a hyperlink from the containing resource to a URI.
24
+ // See: https://specification.commonwellalliance.org/services/rest-api-reference (8.4.3 Address)
25
+ exports.linkSchema = zod_1.z.object({
26
+ href: zod_1.z.string().optional().nullable(),
27
+ templated: zod_1.z.boolean().optional().nullable(),
28
+ type: zod_1.z.string().optional().nullable(),
29
+ });
30
+ exports.networkLinkSchema = zod_1.z.object({
31
+ _links: zod_1.z
32
+ .object({
33
+ self: exports.linkSchema.optional().nullable(),
34
+ upgrade: exports.linkSchema.optional().nullable(),
35
+ downgrade: exports.linkSchema.optional().nullable(),
36
+ })
37
+ .optional()
38
+ .nullable(),
39
+ assuranceLevel: exports.lolaSchema.optional().nullable(),
40
+ patient: zod_1.z
41
+ .object({
42
+ details: demographics_1.demographicsSchema,
43
+ })
44
+ .optional()
45
+ .nullable(),
46
+ });
47
+ exports.patientLinkProxySchema = zod_1.z.object({
48
+ relationship: zod_1.z.string().optional().nullable(),
49
+ name: zod_1.z.string().optional().nullable(),
50
+ });
51
51
  //# sourceMappingURL=link.js.map