@metriport/commonwell-sdk 0.30.0-alpha.1
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 +21 -0
- package/README.md +64 -0
- package/dist/__tests__/env-setup.d.ts +2 -0
- package/dist/__tests__/env-setup.d.ts.map +1 -0
- package/dist/__tests__/env-setup.js +35 -0
- package/dist/__tests__/env-setup.js.map +1 -0
- package/dist/client/common.d.ts +39 -0
- package/dist/client/common.d.ts.map +1 -0
- package/dist/client/common.js +15 -0
- package/dist/client/common.js.map +1 -0
- package/dist/client/commonwell-api.d.ts +103 -0
- package/dist/client/commonwell-api.d.ts.map +1 -0
- package/dist/client/commonwell-api.js +3 -0
- package/dist/client/commonwell-api.js.map +1 -0
- package/dist/client/commonwell-base.d.ts +47 -0
- package/dist/client/commonwell-base.d.ts.map +1 -0
- package/dist/client/commonwell-base.js +105 -0
- package/dist/client/commonwell-base.js.map +1 -0
- package/dist/client/commonwell-member-api.d.ts +29 -0
- package/dist/client/commonwell-member-api.d.ts.map +1 -0
- package/dist/client/commonwell-member-api.js +3 -0
- package/dist/client/commonwell-member-api.js.map +1 -0
- package/dist/client/commonwell-member.d.ts +168 -0
- package/dist/client/commonwell-member.d.ts.map +1 -0
- package/dist/client/commonwell-member.js +349 -0
- package/dist/client/commonwell-member.js.map +1 -0
- package/dist/client/commonwell.d.ts +245 -0
- package/dist/client/commonwell.d.ts.map +1 -0
- package/dist/client/commonwell.js +502 -0
- package/dist/client/commonwell.js.map +1 -0
- package/dist/common/__tests__/util.test.d.ts +2 -0
- package/dist/common/__tests__/util.test.d.ts.map +1 -0
- package/dist/common/__tests__/util.test.js +51 -0
- package/dist/common/__tests__/util.test.js.map +1 -0
- package/dist/common/__tests__/validate-npi.test.d.ts +2 -0
- package/dist/common/__tests__/validate-npi.test.d.ts.map +1 -0
- package/dist/common/__tests__/validate-npi.test.js +44 -0
- package/dist/common/__tests__/validate-npi.test.js.map +1 -0
- package/dist/common/certificate.d.ts +3 -0
- package/dist/common/certificate.d.ts.map +1 -0
- package/dist/common/certificate.js +11 -0
- package/dist/common/certificate.js.map +1 -0
- package/dist/common/commonwell-error.d.ts +23 -0
- package/dist/common/commonwell-error.d.ts.map +1 -0
- package/dist/common/commonwell-error.js +33 -0
- package/dist/common/commonwell-error.js.map +1 -0
- package/dist/common/fileDownload.d.ts +37 -0
- package/dist/common/fileDownload.d.ts.map +1 -0
- package/dist/common/fileDownload.js +53 -0
- package/dist/common/fileDownload.js.map +1 -0
- package/dist/common/make-jwt.d.ts +60 -0
- package/dist/common/make-jwt.d.ts.map +1 -0
- package/dist/common/make-jwt.js +124 -0
- package/dist/common/make-jwt.js.map +1 -0
- package/dist/common/util.d.ts +78 -0
- package/dist/common/util.d.ts.map +1 -0
- package/dist/common/util.js +104 -0
- package/dist/common/util.js.map +1 -0
- package/dist/common/validate-npi.d.ts +2 -0
- package/dist/common/validate-npi.d.ts.map +1 -0
- package/dist/common/validate-npi.js +6 -0
- package/dist/common/validate-npi.js.map +1 -0
- package/dist/common/zod.d.ts +13 -0
- package/dist/common/zod.d.ts.map +1 -0
- package/dist/common/zod.js +38 -0
- package/dist/common/zod.js.map +1 -0
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/models/__tests__/address.test.d.ts +2 -0
- package/dist/models/__tests__/address.test.d.ts.map +1 -0
- package/dist/models/__tests__/address.test.js +348 -0
- package/dist/models/__tests__/address.test.js.map +1 -0
- package/dist/models/__tests__/demographics.test.d.ts +2 -0
- package/dist/models/__tests__/demographics.test.d.ts.map +1 -0
- package/dist/models/__tests__/demographics.test.js +96 -0
- package/dist/models/__tests__/demographics.test.js.map +1 -0
- package/dist/models/address.d.ts +177 -0
- package/dist/models/address.d.ts.map +1 -0
- package/dist/models/address.js +94 -0
- package/dist/models/address.js.map +1 -0
- package/dist/models/certificates.d.ts +77 -0
- package/dist/models/certificates.d.ts.map +1 -0
- package/dist/models/certificates.js +27 -0
- package/dist/models/certificates.js.map +1 -0
- package/dist/models/contact.d.ts +47 -0
- package/dist/models/contact.d.ts.map +1 -0
- package/dist/models/contact.js +30 -0
- package/dist/models/contact.js.map +1 -0
- package/dist/models/date.d.ts +4 -0
- package/dist/models/date.d.ts.map +1 -0
- package/dist/models/date.js +10 -0
- package/dist/models/date.js.map +1 -0
- package/dist/models/demographics.d.ts +290 -0
- package/dist/models/demographics.d.ts.map +1 -0
- package/dist/models/demographics.js +57 -0
- package/dist/models/demographics.js.map +1 -0
- package/dist/models/document.d.ts +7823 -0
- package/dist/models/document.d.ts.map +1 -0
- package/dist/models/document.js +106 -0
- package/dist/models/document.js.map +1 -0
- package/dist/models/facility.d.ts +82 -0
- package/dist/models/facility.d.ts.map +1 -0
- package/dist/models/facility.js +11 -0
- package/dist/models/facility.js.map +1 -0
- package/dist/models/human-name.d.ts +56 -0
- package/dist/models/human-name.d.ts.map +1 -0
- package/dist/models/human-name.js +39 -0
- package/dist/models/human-name.js.map +1 -0
- package/dist/models/identifier.d.ts +110 -0
- package/dist/models/identifier.d.ts.map +1 -0
- package/dist/models/identifier.js +37 -0
- package/dist/models/identifier.js.map +1 -0
- package/dist/models/organization.d.ts +2390 -0
- package/dist/models/organization.d.ts.map +1 -0
- package/dist/models/organization.js +139 -0
- package/dist/models/organization.js.map +1 -0
- package/dist/models/patient-organization.d.ts +36 -0
- package/dist/models/patient-organization.d.ts.map +1 -0
- package/dist/models/patient-organization.js +10 -0
- package/dist/models/patient-organization.js.map +1 -0
- package/dist/models/patient.d.ts +5350 -0
- package/dist/models/patient.d.ts.map +1 -0
- package/dist/models/patient.js +94 -0
- package/dist/models/patient.js.map +1 -0
- package/dist/models/period.d.ts +13 -0
- package/dist/models/period.d.ts.map +1 -0
- package/dist/models/period.js +13 -0
- package/dist/models/period.js.map +1 -0
- package/dist/models/reference.d.ts +109 -0
- package/dist/models/reference.d.ts.map +1 -0
- package/dist/models/reference.js +12 -0
- package/dist/models/reference.js.map +1 -0
- package/package.json +82 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License Copyright (c) 2023-present Metriport Inc.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of
|
|
4
|
+
charge, to any person obtaining a copy of this software and associated
|
|
5
|
+
documentation files (the "Software"), to deal in the Software without
|
|
6
|
+
restriction, including without limitation the rights to use, copy, modify, merge,
|
|
7
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
|
9
|
+
following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice
|
|
12
|
+
(including the next paragraph) shall be included in all copies or substantial
|
|
13
|
+
portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
|
16
|
+
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
|
18
|
+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
19
|
+
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
20
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# `commonwell-sdk`
|
|
2
|
+
|
|
3
|
+
SDK to simplify CommonWell API integration - by Metriport Inc.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
To connect to the CommonWell API, you can use the one of the options below:
|
|
8
|
+
|
|
9
|
+
- `CommonWellMember` class:
|
|
10
|
+
- This class is used to connect to the CommonWell API as a member organization.
|
|
11
|
+
- It is used to create, update, and delete organizations, certificates, and other resources.
|
|
12
|
+
- `CommonWell` class:
|
|
13
|
+
- This class is used to connect to the CommonWell API as a contributor organization.
|
|
14
|
+
- It is used to create, update, link, and delete patients, query documents, and other resources.
|
|
15
|
+
|
|
16
|
+
### CommonWellMember
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { APIMode, CommonWellMember } from "@metriport/commonwell-sdk";
|
|
20
|
+
|
|
21
|
+
const commonWellMember = new CommonWellMember({
|
|
22
|
+
orgCert: "<member-certificate-string>",
|
|
23
|
+
rsaPrivateKey: "<member-private-key-string>",
|
|
24
|
+
memberName: "<member-name>",
|
|
25
|
+
memberId: "<member-id>",
|
|
26
|
+
apiMode: APIMode.integration, // or APIMode.production
|
|
27
|
+
});
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### CommonWell
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
import { APIMode, CommonWell } from "@metriport/commonwell-sdk";
|
|
34
|
+
|
|
35
|
+
const commonWell = new CommonWell({
|
|
36
|
+
orgCert: "<contributor-certificate-string>",
|
|
37
|
+
rsaPrivateKey: "<contributor-private-key-string>",
|
|
38
|
+
orgName: "<contributor-name>",
|
|
39
|
+
oid: "<contributor-id>",
|
|
40
|
+
homeCommunityId: "<contributor-home-community-id>",
|
|
41
|
+
npi: "<contributor-npi>",
|
|
42
|
+
apiMode: APIMode.integration, // or APIMode.production
|
|
43
|
+
});
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
,▄,
|
|
48
|
+
▄▓███▌
|
|
49
|
+
▄▀╙ ▀▓▀ ²▄
|
|
50
|
+
▄└ ╙▌
|
|
51
|
+
,▀ ╨▄
|
|
52
|
+
▌ ║
|
|
53
|
+
▌
|
|
54
|
+
▌
|
|
55
|
+
,▓██▄ ╔███▄
|
|
56
|
+
╙███▌ ▀███▀
|
|
57
|
+
▀▄
|
|
58
|
+
▀╗▄ ,▄
|
|
59
|
+
'╙▀▀▀▀▀╙''
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
by Metriport Inc.
|
|
63
|
+
|
|
64
|
+
```
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-setup.d.ts","sourceRoot":"","sources":["../../src/__tests__/env-setup.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const dotenv = __importStar(require("dotenv"));
|
|
30
|
+
const path_1 = __importDefault(require("path"));
|
|
31
|
+
const cwd = process.cwd();
|
|
32
|
+
const paths = [cwd, ...(cwd.includes("packages") ? [] : ["packages", "commonwell-sdk"])];
|
|
33
|
+
dotenv.config({ path: path_1.default.resolve(...paths, ".env") });
|
|
34
|
+
// Keep dotenv import and config before everything else
|
|
35
|
+
//# sourceMappingURL=env-setup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env-setup.js","sourceRoot":"","sources":["../../src/__tests__/env-setup.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,gDAAwB;AACxB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;AAC1B,MAAM,KAAK,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;AACzF,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,cAAI,CAAC,OAAO,CAAC,GAAG,KAAK,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AACxD,uDAAuD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ExecuteWithRetriesOptions, PurposeOfUse } from "@metriport/shared";
|
|
2
|
+
import { AxiosResponse, InternalAxiosRequestConfig } from "axios";
|
|
3
|
+
export declare const DEFAULT_AXIOS_TIMEOUT_SECONDS = 120;
|
|
4
|
+
export declare const defaultOnError500: OnError500Options;
|
|
5
|
+
export declare enum APIMode {
|
|
6
|
+
integration = "integration",
|
|
7
|
+
production = "production"
|
|
8
|
+
}
|
|
9
|
+
export type OnError500Options = Omit<ExecuteWithRetriesOptions<unknown>, "shouldRetry"> & {
|
|
10
|
+
retry: boolean;
|
|
11
|
+
};
|
|
12
|
+
export interface CommonWellOptions {
|
|
13
|
+
/** Connection timeout in milliseconds. */
|
|
14
|
+
timeout?: number;
|
|
15
|
+
/** Parameters for handling internal server errors (status code 500). */
|
|
16
|
+
onError500?: OnError500Options;
|
|
17
|
+
/** Function to run before the request is sent. */
|
|
18
|
+
preRequestHook?: (request: InternalAxiosRequestConfig) => void;
|
|
19
|
+
/** Function to run after the request is sent. */
|
|
20
|
+
postRequestHook?: (response: AxiosResponse) => void;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @see https://www.commonwellalliance.org/specification/
|
|
24
|
+
*/
|
|
25
|
+
export type BaseRequestMetadata = {
|
|
26
|
+
/**
|
|
27
|
+
* The practitioner role of the entity making this request.
|
|
28
|
+
* Valid role values: https://hl7.org/fhir/R4/valueset-practitioner-role.html
|
|
29
|
+
*/
|
|
30
|
+
role: string;
|
|
31
|
+
/**
|
|
32
|
+
* The name of the user as required by HIPAA Privacy Disclosure Accounting.
|
|
33
|
+
* This is NOT the patient ID.
|
|
34
|
+
*/
|
|
35
|
+
subjectId: string;
|
|
36
|
+
/** The purpose of use (POU) for this request - the reason for the request. */
|
|
37
|
+
purposeOfUse: PurposeOfUse;
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/client/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,0BAA0B,EAAE,MAAM,OAAO,CAAC;AAElE,eAAO,MAAM,6BAA6B,MAAM,CAAC;AAEjD,eAAO,MAAM,iBAAiB,EAAE,iBAI/B,CAAC;AAEF,oBAAY,OAAO;IACjB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;CAC1B;AAED,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,yBAAyB,CAAC,OAAO,CAAC,EAAE,aAAa,CAAC,GAAG;IACxF,KAAK,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,0CAA0C;IAC1C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wEAAwE;IACxE,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B,kDAAkD;IAClD,cAAc,CAAC,EAAE,CAAC,OAAO,EAAE,0BAA0B,KAAK,IAAI,CAAC;IAC/D,iDAAiD;IACjD,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;CACrD;AAED;;GAEG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,YAAY,EAAE,YAAY,CAAC;CAC5B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APIMode = exports.defaultOnError500 = exports.DEFAULT_AXIOS_TIMEOUT_SECONDS = void 0;
|
|
4
|
+
exports.DEFAULT_AXIOS_TIMEOUT_SECONDS = 120;
|
|
5
|
+
exports.defaultOnError500 = {
|
|
6
|
+
retry: false,
|
|
7
|
+
maxAttempts: 1,
|
|
8
|
+
initialDelay: 0,
|
|
9
|
+
};
|
|
10
|
+
var APIMode;
|
|
11
|
+
(function (APIMode) {
|
|
12
|
+
APIMode["integration"] = "integration";
|
|
13
|
+
APIMode["production"] = "production";
|
|
14
|
+
})(APIMode = exports.APIMode || (exports.APIMode = {}));
|
|
15
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/client/common.ts"],"names":[],"mappings":";;;AAGa,QAAA,6BAA6B,GAAG,GAAG,CAAC;AAEpC,QAAA,iBAAiB,GAAsB;IAClD,KAAK,EAAE,KAAK;IACZ,WAAW,EAAE,CAAC;IACd,YAAY,EAAE,CAAC;CAChB,CAAC;AAEF,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,sCAA2B,CAAA;IAC3B,oCAAyB,CAAA;AAC3B,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { PurposeOfUse } from "@metriport/shared";
|
|
3
|
+
import * as stream from "stream";
|
|
4
|
+
import { DocumentQueryFullResponse, DocumentReference, DocumentStatus } from "../models/document";
|
|
5
|
+
import { Patient, PatientResponseItem, PatientCreateOrUpdateResp, PatientExistingLinks, PatientProbableLinks, StatusResponse } from "../models/patient";
|
|
6
|
+
export type BaseOptions = {
|
|
7
|
+
meta?: OrganizationRequestMetadata;
|
|
8
|
+
};
|
|
9
|
+
export type OrganizationRequestMetadata = {
|
|
10
|
+
role: string;
|
|
11
|
+
subjectId: string;
|
|
12
|
+
purposeOfUse: PurposeOfUse;
|
|
13
|
+
npi: string;
|
|
14
|
+
/**
|
|
15
|
+
* Required for Delegation of Authority (DOA) requests.
|
|
16
|
+
*
|
|
17
|
+
* When sending delegated requests, the delegate organization must include information about the
|
|
18
|
+
* principal organization.
|
|
19
|
+
*
|
|
20
|
+
* The value MUST be the Directory Entry assigned to the Principal for whom the Delegate is
|
|
21
|
+
* initiating the request, formatted using the FHIR (Fast Healthcare Interoperability Resources)
|
|
22
|
+
* Resource (Reference?) format.
|
|
23
|
+
*
|
|
24
|
+
* Example: "Organization/urn:oid:2.16.840.1.113883.3.7204.1"
|
|
25
|
+
*
|
|
26
|
+
* @see https://www.commonwellalliance.org/specification/
|
|
27
|
+
*/
|
|
28
|
+
authGrantorReference?: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Type that represents the Patient's ID in the Edge System in the HL7 CX data type format.
|
|
32
|
+
* Each property represents part of the HL7 CX data type format:
|
|
33
|
+
*
|
|
34
|
+
* IdentifierValue^^^&PatientIdAssignAuthority&PatientIdAssignAuthorityType
|
|
35
|
+
*
|
|
36
|
+
* @see Section "8.3.2 Get Patient" of the spec.
|
|
37
|
+
*/
|
|
38
|
+
export type GetPatientParams = {
|
|
39
|
+
/** The Patient ID of the Edge System without any formatting (not in the HL7 CX data type format). */
|
|
40
|
+
id: string;
|
|
41
|
+
/** The assignAuthority of the Patient ID. */
|
|
42
|
+
assignAuthority: string;
|
|
43
|
+
/** The assignAuthorityType of the Patient ID. */
|
|
44
|
+
assignAuthorityType?: string | undefined;
|
|
45
|
+
};
|
|
46
|
+
export type RetrieveDocumentResponse = {
|
|
47
|
+
contentType: string;
|
|
48
|
+
size: number;
|
|
49
|
+
};
|
|
50
|
+
export interface DocumentQueryParams {
|
|
51
|
+
/** ID of who/what is the subject of the document */
|
|
52
|
+
subjectId?: string;
|
|
53
|
+
/** Author information for the document */
|
|
54
|
+
author?: {
|
|
55
|
+
/** Given name of who and/or what authored the document */
|
|
56
|
+
given?: string;
|
|
57
|
+
/** Family name of who and/or what authored the document */
|
|
58
|
+
family?: string;
|
|
59
|
+
};
|
|
60
|
+
/** Status of the document reference */
|
|
61
|
+
status?: DocumentStatus;
|
|
62
|
+
/** Time of service period being documented */
|
|
63
|
+
period?: {
|
|
64
|
+
/** Time of service start that is being documented. Comparators: ge */
|
|
65
|
+
start?: string;
|
|
66
|
+
/** Time of service end that is being documented. Comparators: le */
|
|
67
|
+
end?: string;
|
|
68
|
+
};
|
|
69
|
+
/** When the document reference was created */
|
|
70
|
+
date?: {
|
|
71
|
+
/** When the document reference was created. Comparators: ge */
|
|
72
|
+
start?: string;
|
|
73
|
+
/** When the document reference was created. Comparators: le */
|
|
74
|
+
end?: string;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface CommonWellAPI {
|
|
78
|
+
get lastTransactionId(): string | undefined;
|
|
79
|
+
createOrUpdatePatient(patient: Patient, options?: BaseOptions): Promise<PatientCreateOrUpdateResp>;
|
|
80
|
+
getPatient(params: GetPatientParams, options?: BaseOptions): Promise<PatientResponseItem | undefined>;
|
|
81
|
+
getPatient(id: string, options?: BaseOptions): Promise<PatientResponseItem | undefined>;
|
|
82
|
+
mergePatients({ nonSurvivingPatientId, survivingPatientId, }: {
|
|
83
|
+
nonSurvivingPatientId: string;
|
|
84
|
+
survivingPatientId: string;
|
|
85
|
+
}, options?: BaseOptions): Promise<StatusResponse>;
|
|
86
|
+
deletePatient(id: string, options?: BaseOptions): Promise<void>;
|
|
87
|
+
getPatientLinksByPatientId(patientId: string, options?: BaseOptions): Promise<PatientExistingLinks>;
|
|
88
|
+
getProbableLinksById(patientId: string, options?: BaseOptions): Promise<PatientProbableLinks>;
|
|
89
|
+
getProbableLinksByDemographics(params: {
|
|
90
|
+
firstName: string;
|
|
91
|
+
lastName: string;
|
|
92
|
+
dob: string;
|
|
93
|
+
gender: string;
|
|
94
|
+
zip: string;
|
|
95
|
+
}, options?: BaseOptions): Promise<PatientProbableLinks>;
|
|
96
|
+
linkPatients(urlToLinkPatients: string, options?: BaseOptions): Promise<StatusResponse>;
|
|
97
|
+
unlinkPatients(urlToUnlinkPatients: string, options?: BaseOptions): Promise<StatusResponse>;
|
|
98
|
+
resetPatientLinks(urlToResetPatientLinks: string, options?: BaseOptions): Promise<StatusResponse>;
|
|
99
|
+
queryDocuments(patientId: string, options?: BaseOptions & DocumentQueryParams): Promise<DocumentReference[]>;
|
|
100
|
+
queryDocumentsFull(patientId: string, options?: BaseOptions): Promise<DocumentQueryFullResponse>;
|
|
101
|
+
retrieveDocument(inputUrl: string, outputStream: stream.Writable, options?: BaseOptions): Promise<RetrieveDocumentResponse>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=commonwell-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonwell-api.d.ts","sourceRoot":"","sources":["../../src/client/commonwell-api.ts"],"names":[],"mappings":";AAAA,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,EAAE;QACN,SAAS,EAAE,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,EACD,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAEjC,YAAY,CAAC,iBAAiB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IACxF,cAAc,CAAC,mBAAmB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5F,iBAAiB,CAAC,sBAAsB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;IAElG,cAAc,CACZ,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,WAAW,GAAG,mBAAmB,GAC1C,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAChC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAEjG,gBAAgB,CACd,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,CAAC,QAAQ,EAC7B,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,wBAAwB,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonwell-api.js","sourceRoot":"","sources":["../../src/client/commonwell-api.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { APIMode, CommonWellOptions, OnError500Options } from "./common";
|
|
3
|
+
/**
|
|
4
|
+
* Implementation of the CommonWell API, v4.
|
|
5
|
+
* @see https://www.commonwellalliance.org/specification/
|
|
6
|
+
*
|
|
7
|
+
* For the Organization management API (member API):
|
|
8
|
+
* @see https://commonwellalliance.sharepoint.com/sites/CommonWellServicesPlatform/SitePages/Organization-APIs.aspx
|
|
9
|
+
*/
|
|
10
|
+
export declare class CommonWellBase {
|
|
11
|
+
static integrationUrl: string;
|
|
12
|
+
static productionUrl: string;
|
|
13
|
+
readonly api: AxiosInstance;
|
|
14
|
+
protected rsaPrivateKey: string;
|
|
15
|
+
private httpsAgent;
|
|
16
|
+
private _lastTransactionId;
|
|
17
|
+
protected onError500: OnError500Options;
|
|
18
|
+
/**
|
|
19
|
+
* Creates a new instance of the CommonWell API client pertaining to an
|
|
20
|
+
* organization to make requests on behalf of.
|
|
21
|
+
*
|
|
22
|
+
* @param orgCert The certificate (public key) for the organization.
|
|
23
|
+
* @param rsaPrivateKey An RSA key corresponding to the specified orgCert.
|
|
24
|
+
* @param memberName The name of the member.
|
|
25
|
+
* @param memberId The ID of the member (not the OID).
|
|
26
|
+
* @param apiMode The mode the client will be running.
|
|
27
|
+
* @param options Optional parameters
|
|
28
|
+
* @param options.timeout Connection timeout in milliseconds, default 120 seconds.
|
|
29
|
+
*/
|
|
30
|
+
constructor({ orgCert, rsaPrivateKey, apiMode, options, }: {
|
|
31
|
+
orgCert: string;
|
|
32
|
+
rsaPrivateKey: string;
|
|
33
|
+
apiMode: APIMode;
|
|
34
|
+
options?: CommonWellOptions;
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Returns the transaction ID from the last request.
|
|
38
|
+
*/
|
|
39
|
+
get lastTransactionId(): string | undefined;
|
|
40
|
+
resetLastTransactionId(): void;
|
|
41
|
+
private axiosPreRequest;
|
|
42
|
+
private postRequest;
|
|
43
|
+
private axiosSuccessfulResponse;
|
|
44
|
+
private axiosErrorResponse;
|
|
45
|
+
protected executeWithRetriesOn500IfEnabled<T>(fn: () => Promise<T>, retryOnTimeout?: boolean): Promise<T>;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=commonwell-base.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonwell-base.d.ts","sourceRoot":"","sources":["../../src/client/commonwell-base.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,aAAa,EAA6C,MAAM,OAAO,CAAC;AAIxF,OAAO,EACL,OAAO,EACP,iBAAiB,EAGjB,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAElB;;;;;;GAMG;AACH,qBAAa,cAAc;IACzB,MAAM,CAAC,cAAc,SAA4D;IACjF,MAAM,CAAC,aAAa,SAAgD;IAEpE,QAAQ,CAAC,GAAG,EAAE,aAAa,CAAC;IAC5B,SAAS,CAAC,aAAa,EAAE,MAAM,CAAC;IAChC,OAAO,CAAC,UAAU,CAAQ;IAC1B,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,SAAS,CAAC,UAAU,EAAE,iBAAiB,CAAC;IAExC;;;;;;;;;;;OAWG;gBACS,EACV,OAAO,EACP,aAAa,EACb,OAAO,EACP,OAAY,GACb,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,MAAM,CAAC;QACtB,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,CAAC,EAAE,iBAAiB,CAAC;KAC7B;IAoBD;;OAEG;IACH,IAAI,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAE1C;IAED,sBAAsB,IAAI,IAAI;IAI9B,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,uBAAuB;IAW/B,OAAO,CAAC,kBAAkB;cAaV,gCAAgC,CAAC,CAAC,EAChD,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACpB,cAAc,UAAQ,GACrB,OAAO,CAAC,CAAC,CAAC;CAed"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CommonWellBase = void 0;
|
|
7
|
+
const axios_1 = __importDefault(require("axios"));
|
|
8
|
+
const https_1 = require("https");
|
|
9
|
+
const shared_1 = require("@metriport/shared");
|
|
10
|
+
const http_status_1 = __importDefault(require("http-status"));
|
|
11
|
+
const common_1 = require("./common");
|
|
12
|
+
/**
|
|
13
|
+
* Implementation of the CommonWell API, v4.
|
|
14
|
+
* @see https://www.commonwellalliance.org/specification/
|
|
15
|
+
*
|
|
16
|
+
* For the Organization management API (member API):
|
|
17
|
+
* @see https://commonwellalliance.sharepoint.com/sites/CommonWellServicesPlatform/SitePages/Organization-APIs.aspx
|
|
18
|
+
*/
|
|
19
|
+
class CommonWellBase {
|
|
20
|
+
/**
|
|
21
|
+
* Creates a new instance of the CommonWell API client pertaining to an
|
|
22
|
+
* organization to make requests on behalf of.
|
|
23
|
+
*
|
|
24
|
+
* @param orgCert The certificate (public key) for the organization.
|
|
25
|
+
* @param rsaPrivateKey An RSA key corresponding to the specified orgCert.
|
|
26
|
+
* @param memberName The name of the member.
|
|
27
|
+
* @param memberId The ID of the member (not the OID).
|
|
28
|
+
* @param apiMode The mode the client will be running.
|
|
29
|
+
* @param options Optional parameters
|
|
30
|
+
* @param options.timeout Connection timeout in milliseconds, default 120 seconds.
|
|
31
|
+
*/
|
|
32
|
+
constructor({ orgCert, rsaPrivateKey, apiMode, options = {}, }) {
|
|
33
|
+
this.rsaPrivateKey = rsaPrivateKey;
|
|
34
|
+
this.httpsAgent = new https_1.Agent({ cert: orgCert, key: rsaPrivateKey });
|
|
35
|
+
this.onError500 = { ...common_1.defaultOnError500, ...(options.onError500 ?? {}) };
|
|
36
|
+
this.api = axios_1.default.create({
|
|
37
|
+
timeout: options?.timeout ?? common_1.DEFAULT_AXIOS_TIMEOUT_SECONDS * 1000,
|
|
38
|
+
baseURL: apiMode === common_1.APIMode.production
|
|
39
|
+
? CommonWellBase.productionUrl
|
|
40
|
+
: CommonWellBase.integrationUrl,
|
|
41
|
+
httpsAgent: this.httpsAgent,
|
|
42
|
+
});
|
|
43
|
+
this.api.interceptors.request.use(this.axiosPreRequest(this, options.preRequestHook));
|
|
44
|
+
this.api.interceptors.response.use(this.axiosSuccessfulResponse(this, options.postRequestHook), this.axiosErrorResponse(this, options.postRequestHook));
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Returns the transaction ID from the last request.
|
|
48
|
+
*/
|
|
49
|
+
get lastTransactionId() {
|
|
50
|
+
return this._lastTransactionId;
|
|
51
|
+
}
|
|
52
|
+
resetLastTransactionId() {
|
|
53
|
+
this._lastTransactionId = undefined;
|
|
54
|
+
}
|
|
55
|
+
axiosPreRequest(_this, preRequestHook) {
|
|
56
|
+
return (reqConfig) => {
|
|
57
|
+
_this.resetLastTransactionId();
|
|
58
|
+
preRequestHook?.(reqConfig);
|
|
59
|
+
return reqConfig;
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
// Being extra safe with these bc a failure here fails the actual request
|
|
63
|
+
postRequest(response) {
|
|
64
|
+
this._lastTransactionId =
|
|
65
|
+
response && response.headers ? response.headers["x-trace-id"] : undefined;
|
|
66
|
+
}
|
|
67
|
+
axiosSuccessfulResponse(_this, postRequestHook) {
|
|
68
|
+
return (response) => {
|
|
69
|
+
if (_this)
|
|
70
|
+
_this.postRequest(response);
|
|
71
|
+
postRequestHook?.(response);
|
|
72
|
+
return response;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
axiosErrorResponse(_this, postRequestHook) {
|
|
76
|
+
//eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
77
|
+
return (error) => {
|
|
78
|
+
const resp = error?.response;
|
|
79
|
+
if (_this && resp)
|
|
80
|
+
_this.postRequest(resp);
|
|
81
|
+
if (resp)
|
|
82
|
+
postRequestHook?.(resp);
|
|
83
|
+
return Promise.reject(error);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
async executeWithRetriesOn500IfEnabled(fn, retryOnTimeout = false) {
|
|
87
|
+
return this.onError500.retry
|
|
88
|
+
? (0, shared_1.executeWithNetworkRetries)(fn, {
|
|
89
|
+
...this.onError500,
|
|
90
|
+
httpCodesToRetry: [...shared_1.defaultOptionsRequestNotAccepted.httpCodesToRetry],
|
|
91
|
+
httpStatusCodesToRetry: [
|
|
92
|
+
...shared_1.defaultOptionsRequestNotAccepted.httpStatusCodesToRetry,
|
|
93
|
+
http_status_1.default.INTERNAL_SERVER_ERROR,
|
|
94
|
+
http_status_1.default.BAD_GATEWAY,
|
|
95
|
+
http_status_1.default.SERVICE_UNAVAILABLE,
|
|
96
|
+
],
|
|
97
|
+
...(retryOnTimeout ? { retryOnTimeout: true } : {}),
|
|
98
|
+
})
|
|
99
|
+
: fn();
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.CommonWellBase = CommonWellBase;
|
|
103
|
+
CommonWellBase.integrationUrl = "https://api.integration.commonwellalliance.lkopera.com";
|
|
104
|
+
CommonWellBase.productionUrl = "https://api.commonwellalliance.lkopera.com";
|
|
105
|
+
//# sourceMappingURL=commonwell-base.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonwell-base.js","sourceRoot":"","sources":["../../src/client/commonwell-base.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAwF;AACxF,iCAA8B;AAC9B,8CAAgG;AAChG,8DAAqC;AACrC,qCAMkB;AAElB;;;;;;GAMG;AACH,MAAa,cAAc;IAUzB;;;;;;;;;;;OAWG;IACH,YAAY,EACV,OAAO,EACP,aAAa,EACb,OAAO,EACP,OAAO,GAAG,EAAE,GAMb;QACC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,UAAU,GAAG,IAAI,aAAK,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,GAAG,E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CAAC,CAAC,EAAE,EAAE,CAAC;IACX,CAAC;;AAzHH,wCA0HC;AAzHQ,6BAAc,GAAG,wDAAwD,CAAC;AAC1E,4BAAa,GAAG,4CAA4C,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { CertificateParam, CertificateResp } from "../models/certificates";
|
|
2
|
+
import { Organization, OrganizationList } from "../models/organization";
|
|
3
|
+
import { BaseRequestMetadata } from "./common";
|
|
4
|
+
export type BaseOptions = {
|
|
5
|
+
meta?: MemberRequestMetadata;
|
|
6
|
+
};
|
|
7
|
+
export type MemberRequestMetadata = BaseRequestMetadata;
|
|
8
|
+
export type GetDirectoryParams = {
|
|
9
|
+
orgName?: string;
|
|
10
|
+
orgId?: string;
|
|
11
|
+
offset?: number;
|
|
12
|
+
limit?: number;
|
|
13
|
+
sort?: string;
|
|
14
|
+
};
|
|
15
|
+
export interface CommonWellMemberAPI {
|
|
16
|
+
get lastTransactionId(): string | undefined;
|
|
17
|
+
listOrganizations(params?: GetDirectoryParams, options?: BaseOptions): Promise<OrganizationList>;
|
|
18
|
+
createOrg(organization: Organization, options?: BaseOptions): Promise<Organization>;
|
|
19
|
+
updateOrg(organization: Organization, options?: BaseOptions): Promise<Organization>;
|
|
20
|
+
getAllOrgs(summary?: boolean, offset?: number, limit?: number, sort?: string, options?: BaseOptions): Promise<OrganizationList>;
|
|
21
|
+
getOneOrg(id: string, options?: BaseOptions): Promise<Organization | undefined>;
|
|
22
|
+
addCertificateToOrg(certificate: CertificateParam, id: string, options?: BaseOptions): Promise<CertificateResp>;
|
|
23
|
+
replaceCertificateForOrg(certificate: CertificateParam, id: string, options?: BaseOptions): Promise<CertificateResp>;
|
|
24
|
+
deleteCertificateFromOrg(id: string, thumbprint: string, purpose: string, options?: BaseOptions): Promise<string>;
|
|
25
|
+
getCertificatesFromOrg(id: string, thumbprint?: string, purpose?: string, options?: BaseOptions): Promise<CertificateResp>;
|
|
26
|
+
getCertificatesFromOrgByThumbprint(id: string, thumbprint: string, purpose?: string, options?: BaseOptions): Promise<CertificateResp>;
|
|
27
|
+
getCertificatesFromOrgByThumbprintAndPurpose(id: string, thumbprint: string, purpose: string, options?: BaseOptions): Promise<CertificateResp>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=commonwell-member-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonwell-member-api.d.ts","sourceRoot":"","sources":["../../src/client/commonwell-member-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAE/C,MAAM,MAAM,WAAW,GAAG;IACxB,IAAI,CAAC,EAAE,qBAAqB,CAAC;CAC9B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAExD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,IAAI,iBAAiB,IAAI,MAAM,GAAG,SAAS,CAAC;IAC5C,iBAAiB,CAAC,MAAM,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACjG,SAAS,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IACpF,SAAS,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CA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,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commonwell-member-api.js","sourceRoot":"","sources":["../../src/client/commonwell-member-api.ts"],"names":[],"mappings":""}
|