@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.
Files changed (58) 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
  58. package/lib/tst.d.ts +0 -54
@@ -1,40 +1,40 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patientLinkSearchRespSchema = exports.patientLinkSchema = exports.personSearchRespSchema = exports.personSchema = exports.personLinksSchema = void 0;
4
- const zod_1 = require("zod");
5
- const demographics_1 = require("./demographics");
6
- const enrollment_summary_1 = require("./enrollment-summary");
7
- const link_1 = require("./link");
8
- exports.personLinksSchema = zod_1.z.object({
9
- self: link_1.linkSchema,
10
- patientLink: link_1.linkSchema.optional().nullable(),
11
- patientMatch: link_1.linkSchema.optional().nullable(),
12
- unenroll: link_1.linkSchema.optional().nullable(),
13
- enroll: link_1.linkSchema.optional().nullable(),
14
- reset: link_1.linkSchema.optional().nullable(),
15
- });
16
- // The Person resource represents a natural person independent of a specific healthcare context.
17
- // See: https://specification.commonwellalliance.org/services/rest-api-reference (8.6.6 Person)
18
- exports.personSchema = zod_1.z.object({
19
- enrolled: zod_1.z.boolean().optional().nullable(),
20
- enrollmentSummary: enrollment_summary_1.enrollmentSummarySchema.optional().nullable(),
21
- details: demographics_1.demographicsSchema,
22
- _links: exports.personLinksSchema.optional().nullable(),
23
- });
24
- exports.personSearchRespSchema = zod_1.z.object({
25
- message: zod_1.z.string(),
26
- _embedded: zod_1.z.object({ person: zod_1.z.array(exports.personSchema) }),
27
- _links: zod_1.z.object({ self: link_1.linkSchema }),
28
- });
29
- // Within the context of a Person resource, a PatientLink represents a confirmed relationship to a Patient Record.
30
- // See: https://specification.commonwellalliance.org/services/rest-api-reference (8.6.5 PatientLink)
31
- exports.patientLinkSchema = zod_1.z.object({
32
- patient: zod_1.z.string(),
33
- assuranceLevel: link_1.lolaSchema,
34
- _links: exports.personLinksSchema.optional().nullable(),
35
- });
36
- exports.patientLinkSearchRespSchema = zod_1.z.object({
37
- _embedded: zod_1.z.object({ patientLink: zod_1.z.array(exports.patientLinkSchema) }),
38
- _links: zod_1.z.object({ self: link_1.linkSchema }),
39
- });
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.patientLinkSearchRespSchema = exports.patientLinkSchema = exports.personSearchRespSchema = exports.personSchema = exports.personLinksSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const demographics_1 = require("./demographics");
6
+ const enrollment_summary_1 = require("./enrollment-summary");
7
+ const link_1 = require("./link");
8
+ exports.personLinksSchema = zod_1.z.object({
9
+ self: link_1.linkSchema,
10
+ patientLink: link_1.linkSchema.optional().nullable(),
11
+ patientMatch: link_1.linkSchema.optional().nullable(),
12
+ unenroll: link_1.linkSchema.optional().nullable(),
13
+ enroll: link_1.linkSchema.optional().nullable(),
14
+ reset: link_1.linkSchema.optional().nullable(),
15
+ });
16
+ // The Person resource represents a natural person independent of a specific healthcare context.
17
+ // See: https://specification.commonwellalliance.org/services/rest-api-reference (8.6.6 Person)
18
+ exports.personSchema = zod_1.z.object({
19
+ enrolled: zod_1.z.boolean().optional().nullable(),
20
+ enrollmentSummary: enrollment_summary_1.enrollmentSummarySchema.optional().nullable(),
21
+ details: demographics_1.demographicsSchema,
22
+ _links: exports.personLinksSchema.optional().nullable(),
23
+ });
24
+ exports.personSearchRespSchema = zod_1.z.object({
25
+ message: zod_1.z.string(),
26
+ _embedded: zod_1.z.object({ person: zod_1.z.array(exports.personSchema) }),
27
+ _links: zod_1.z.object({ self: link_1.linkSchema }),
28
+ });
29
+ // Within the context of a Person resource, a PatientLink represents a confirmed relationship to a Patient Record.
30
+ // See: https://specification.commonwellalliance.org/services/rest-api-reference (8.6.5 PatientLink)
31
+ exports.patientLinkSchema = zod_1.z.object({
32
+ patient: zod_1.z.string(),
33
+ assuranceLevel: link_1.lolaSchema,
34
+ _links: exports.personLinksSchema.optional().nullable(),
35
+ });
36
+ exports.patientLinkSearchRespSchema = zod_1.z.object({
37
+ _embedded: zod_1.z.object({ patientLink: zod_1.z.array(exports.patientLinkSchema) }),
38
+ _links: zod_1.z.object({ self: link_1.linkSchema }),
39
+ });
40
40
  //# sourceMappingURL=person.js.map
@@ -1,29 +1,29 @@
1
- export declare enum PurposeOfUse {
2
- TREATMENT = "TREATMENT",
3
- PAYMENT = "PAYMENT",
4
- OPERATIONS = "OPERATIONS",
5
- SYSADMIN = "SYSADMIN",
6
- FRAUD = "FRAUD",
7
- PSYCHOTHERAPY = "PSYCHOTHERAPY",
8
- TRAINING = "TRAINING",
9
- LEGAL = "LEGAL",
10
- MARKETING = "MARKETING",
11
- DIRECTORY = "DIRECTORY",
12
- FAMILY = "FAMILY",
13
- PRESENT = "PRESENT",
14
- EMERGENCY = "EMERGENCY",
15
- DISASTER = "DISASTER",
16
- PUBLICHEALTH = "PUBLICHEALTH",
17
- ABUSE = "ABUSE",
18
- OVERSIGHT = "OVERSIGHT",
19
- JUDICIAL = "JUDICIAL",
20
- LAW = "LAW",
21
- DECEASED = "DECEASED",
22
- DONATION = "DONATION",
23
- RESEARCH = "RESEARCH",
24
- THREAT = "THREAT",
25
- GOVERNMENT = "GOVERNMENT",
26
- WORKERSCOMP = "WORKERSCOMP",
27
- COVERAGE = "COVERAGE",
28
- REQUEST = "REQUEST"
29
- }
1
+ export declare enum PurposeOfUse {
2
+ TREATMENT = "TREATMENT",
3
+ PAYMENT = "PAYMENT",
4
+ OPERATIONS = "OPERATIONS",
5
+ SYSADMIN = "SYSADMIN",
6
+ FRAUD = "FRAUD",
7
+ PSYCHOTHERAPY = "PSYCHOTHERAPY",
8
+ TRAINING = "TRAINING",
9
+ LEGAL = "LEGAL",
10
+ MARKETING = "MARKETING",
11
+ DIRECTORY = "DIRECTORY",
12
+ FAMILY = "FAMILY",
13
+ PRESENT = "PRESENT",
14
+ EMERGENCY = "EMERGENCY",
15
+ DISASTER = "DISASTER",
16
+ PUBLICHEALTH = "PUBLICHEALTH",
17
+ ABUSE = "ABUSE",
18
+ OVERSIGHT = "OVERSIGHT",
19
+ JUDICIAL = "JUDICIAL",
20
+ LAW = "LAW",
21
+ DECEASED = "DECEASED",
22
+ DONATION = "DONATION",
23
+ RESEARCH = "RESEARCH",
24
+ THREAT = "THREAT",
25
+ GOVERNMENT = "GOVERNMENT",
26
+ WORKERSCOMP = "WORKERSCOMP",
27
+ COVERAGE = "COVERAGE",
28
+ REQUEST = "REQUEST"
29
+ }
@@ -1,35 +1,35 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PurposeOfUse = void 0;
4
- // https://www.hl7.org/fhir/codesystem-nhin-purposeofuse.html
5
- var PurposeOfUse;
6
- (function (PurposeOfUse) {
7
- PurposeOfUse["TREATMENT"] = "TREATMENT";
8
- PurposeOfUse["PAYMENT"] = "PAYMENT";
9
- PurposeOfUse["OPERATIONS"] = "OPERATIONS";
10
- PurposeOfUse["SYSADMIN"] = "SYSADMIN";
11
- PurposeOfUse["FRAUD"] = "FRAUD";
12
- PurposeOfUse["PSYCHOTHERAPY"] = "PSYCHOTHERAPY";
13
- PurposeOfUse["TRAINING"] = "TRAINING";
14
- PurposeOfUse["LEGAL"] = "LEGAL";
15
- PurposeOfUse["MARKETING"] = "MARKETING";
16
- PurposeOfUse["DIRECTORY"] = "DIRECTORY";
17
- PurposeOfUse["FAMILY"] = "FAMILY";
18
- PurposeOfUse["PRESENT"] = "PRESENT";
19
- PurposeOfUse["EMERGENCY"] = "EMERGENCY";
20
- PurposeOfUse["DISASTER"] = "DISASTER";
21
- PurposeOfUse["PUBLICHEALTH"] = "PUBLICHEALTH";
22
- PurposeOfUse["ABUSE"] = "ABUSE";
23
- PurposeOfUse["OVERSIGHT"] = "OVERSIGHT";
24
- PurposeOfUse["JUDICIAL"] = "JUDICIAL";
25
- PurposeOfUse["LAW"] = "LAW";
26
- PurposeOfUse["DECEASED"] = "DECEASED";
27
- PurposeOfUse["DONATION"] = "DONATION";
28
- PurposeOfUse["RESEARCH"] = "RESEARCH";
29
- PurposeOfUse["THREAT"] = "THREAT";
30
- PurposeOfUse["GOVERNMENT"] = "GOVERNMENT";
31
- PurposeOfUse["WORKERSCOMP"] = "WORKERSCOMP";
32
- PurposeOfUse["COVERAGE"] = "COVERAGE";
33
- PurposeOfUse["REQUEST"] = "REQUEST";
34
- })(PurposeOfUse = exports.PurposeOfUse || (exports.PurposeOfUse = {}));
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PurposeOfUse = void 0;
4
+ // https://www.hl7.org/fhir/codesystem-nhin-purposeofuse.html
5
+ var PurposeOfUse;
6
+ (function (PurposeOfUse) {
7
+ PurposeOfUse["TREATMENT"] = "TREATMENT";
8
+ PurposeOfUse["PAYMENT"] = "PAYMENT";
9
+ PurposeOfUse["OPERATIONS"] = "OPERATIONS";
10
+ PurposeOfUse["SYSADMIN"] = "SYSADMIN";
11
+ PurposeOfUse["FRAUD"] = "FRAUD";
12
+ PurposeOfUse["PSYCHOTHERAPY"] = "PSYCHOTHERAPY";
13
+ PurposeOfUse["TRAINING"] = "TRAINING";
14
+ PurposeOfUse["LEGAL"] = "LEGAL";
15
+ PurposeOfUse["MARKETING"] = "MARKETING";
16
+ PurposeOfUse["DIRECTORY"] = "DIRECTORY";
17
+ PurposeOfUse["FAMILY"] = "FAMILY";
18
+ PurposeOfUse["PRESENT"] = "PRESENT";
19
+ PurposeOfUse["EMERGENCY"] = "EMERGENCY";
20
+ PurposeOfUse["DISASTER"] = "DISASTER";
21
+ PurposeOfUse["PUBLICHEALTH"] = "PUBLICHEALTH";
22
+ PurposeOfUse["ABUSE"] = "ABUSE";
23
+ PurposeOfUse["OVERSIGHT"] = "OVERSIGHT";
24
+ PurposeOfUse["JUDICIAL"] = "JUDICIAL";
25
+ PurposeOfUse["LAW"] = "LAW";
26
+ PurposeOfUse["DECEASED"] = "DECEASED";
27
+ PurposeOfUse["DONATION"] = "DONATION";
28
+ PurposeOfUse["RESEARCH"] = "RESEARCH";
29
+ PurposeOfUse["THREAT"] = "THREAT";
30
+ PurposeOfUse["GOVERNMENT"] = "GOVERNMENT";
31
+ PurposeOfUse["WORKERSCOMP"] = "WORKERSCOMP";
32
+ PurposeOfUse["COVERAGE"] = "COVERAGE";
33
+ PurposeOfUse["REQUEST"] = "REQUEST";
34
+ })(PurposeOfUse = exports.PurposeOfUse || (exports.PurposeOfUse = {}));
35
35
  //# sourceMappingURL=purpose-of-use.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metriport/commonwell-sdk",
3
- "version": "4.3.2",
3
+ "version": "4.3.4",
4
4
  "description": "SDK to simplify CommonWell API integration - by Metriport Inc.",
5
5
  "author": "Metriport Inc. <contact@metriport.com>",
6
6
  "homepage": "https://metriport.com/",
@@ -51,5 +51,5 @@
51
51
  "prettier": "^2.8.3",
52
52
  "typescript": "^4.9.5"
53
53
  },
54
- "gitHead": "045af199cd150ea1065790d1116820dfadc304f2"
54
+ "gitHead": "63c3af0dad4eb9b9a1b82bde8f547fcdec8489c3"
55
55
  }
package/lib/tst.d.ts DELETED
@@ -1,54 +0,0 @@
1
- import { RequestMetadata } from "./client/commonwell";
2
- export declare const getEnvVar: (varName: string) => string | undefined;
3
- export declare const getEnvVarOrFail: (varName: string) => string;
4
- export declare class Config {
5
- static readonly PROD_ENV = "production";
6
- static readonly DEV_ENV = "dev";
7
- static readonly SANDBOX_ENV = "sandbox";
8
- static readonly STAGING_ENV = "staging";
9
- static readonly SANDBOX_USER_LIMIT = 10;
10
- static isCloudEnv(): boolean;
11
- static getEnvType(): string;
12
- static isProdEnv(): boolean;
13
- static isSandbox(): boolean;
14
- static isStaging(): boolean;
15
- static getVersion(): string | undefined;
16
- static getSlackAlertUrl(): string | undefined;
17
- static getSlackNotificationUrl(): string | undefined;
18
- static getSentryDSN(): string | undefined;
19
- static getConnectWidgetUrl(): string;
20
- static getConnectRedirectUrl(): string;
21
- static getApiUrl(): string;
22
- static getCronometerClientId(): string;
23
- static getCronometerClientSecret(): string;
24
- static getGarminConsumerKey(): string;
25
- static getGarminConsumerSecret(): string;
26
- static getOuraClientId(): string;
27
- static getOuraClientSecret(): string;
28
- static getDexcomClientId(): string;
29
- static getDexcomClientSecret(): string;
30
- static getFitbitClientId(): string;
31
- static getFitbitClientSecret(): string;
32
- static getGoogleClientId(): string;
33
- static getGoogleClientSecret(): string;
34
- static getWhoopClientId(): string;
35
- static getWhoopClientSecret(): string;
36
- static getWithingsClientId(): string;
37
- static getWithingsClientSecret(): string;
38
- static getUsageUrl(): string | undefined;
39
- static getFHIRServerUrl(): string | undefined;
40
- static getSystemRootOID(): string;
41
- static getGatewayEndpoint(): string;
42
- static getGatewayAuthorizationServerEndpoint(): string;
43
- static getGatewayAuthorizationClientId(): string;
44
- static getGatewayAuthorizationClientSecret(): string;
45
- static getMetriportPrivateKey(): string;
46
- static getMetriportCert(): string;
47
- static getMemberManagementPrivateKey(): string;
48
- static getMemberManagementCert(): string;
49
- static getMetriportOrgName(): string;
50
- static getMemberManagementOID(): string;
51
- static getPostHogApiKey(): string | undefined;
52
- }
53
- export type OrgRequestMetadataCreate = Omit<RequestMetadata, "npi" | "role" | "purposeOfUse" | "subjectId"> & Required<Pick<RequestMetadata, "npi">> & Partial<Pick<RequestMetadata, "role" | "purposeOfUse">>;
54
- export declare function organizationQueryMeta(orgName: string, meta: OrgRequestMetadataCreate): RequestMetadata;