@metriport/commonwell-cert-runner 2.0.0-alpha.0 → 2.0.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/dist/flows/org-management-initiator-only.d.ts +11 -0
- package/dist/flows/org-management-initiator-only.d.ts.map +1 -0
- package/dist/flows/org-management-initiator-only.js +86 -0
- package/dist/flows/org-management-initiator-only.js.map +1 -0
- package/dist/single-commands/org-get.d.ts +10 -0
- package/dist/single-commands/org-get.d.ts.map +1 -0
- package/dist/single-commands/org-get.js +59 -0
- package/dist/single-commands/org-get.js.map +1 -0
- package/dist/single-commands/patient-get-probable-links.d.ts +10 -0
- package/dist/single-commands/patient-get-probable-links.d.ts.map +1 -0
- package/dist/single-commands/patient-get-probable-links.js +57 -0
- package/dist/single-commands/patient-get-probable-links.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CommonWell } from "@metriport/commonwell-sdk";
|
|
2
|
+
export type OrgManagementResponse = {
|
|
3
|
+
commonWell: CommonWell;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Flow to validate the org management API (item 8.2.2 in the spec).
|
|
7
|
+
*
|
|
8
|
+
* @see https://www.commonwellalliance.org/specification/
|
|
9
|
+
*/
|
|
10
|
+
export declare function orgManagementInitiatorOnly(): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=org-management-initiator-only.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-management-initiator-only.d.ts","sourceRoot":"","sources":["../../src/flows/org-management-initiator-only.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,UAAU,EAAoB,MAAM,2BAA2B,CAAC;AAWlF,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,UAAU,CAAC;CACxB,CAAC;AAEF;;;;GAIG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,CA0EhE"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.orgManagementInitiatorOnly = void 0;
|
|
4
|
+
const faker_1 = require("@faker-js/faker");
|
|
5
|
+
const commonwell_sdk_1 = require("@metriport/commonwell-sdk");
|
|
6
|
+
const shared_1 = require("@metriport/shared");
|
|
7
|
+
const env_1 = require("../env");
|
|
8
|
+
const payloads_1 = require("../payloads");
|
|
9
|
+
/**
|
|
10
|
+
* Flow to validate the org management API (item 8.2.2 in the spec).
|
|
11
|
+
*
|
|
12
|
+
* @see https://www.commonwellalliance.org/specification/
|
|
13
|
+
*/
|
|
14
|
+
async function orgManagementInitiatorOnly() {
|
|
15
|
+
const commonWellMember = new commonwell_sdk_1.CommonWellMember({
|
|
16
|
+
orgCert: env_1.memberCertificateString,
|
|
17
|
+
rsaPrivateKey: env_1.memberPrivateKeyString,
|
|
18
|
+
memberName: env_1.memberName,
|
|
19
|
+
memberId: env_1.memberId,
|
|
20
|
+
apiMode: commonwell_sdk_1.APIMode.integration,
|
|
21
|
+
});
|
|
22
|
+
const errors = [];
|
|
23
|
+
console.log(`>>> ---------------------- Initiator Only ----------------------`);
|
|
24
|
+
try {
|
|
25
|
+
console.log(`>>> Create an initiator only org`);
|
|
26
|
+
const initiatorOnlyOrgCreate = (0, payloads_1.makeOrganization)();
|
|
27
|
+
initiatorOnlyOrgCreate.securityTokenKeyType = null;
|
|
28
|
+
initiatorOnlyOrgCreate.authorizationInformation = null;
|
|
29
|
+
// console.log(`Request payload: ${JSON.stringify(org, null, 2)}`);
|
|
30
|
+
const respCreateInitiatorOnly = await commonWellMember.createOrg(initiatorOnlyOrgCreate);
|
|
31
|
+
console.log(">>> Transaction ID: " + commonWellMember.lastTransactionId);
|
|
32
|
+
console.log(">>> Response: " + JSON.stringify(respCreateInitiatorOnly, null, 2));
|
|
33
|
+
const initiatorOnlyOrgId = respCreateInitiatorOnly.organizationId;
|
|
34
|
+
console.log(`>>> Get one org`);
|
|
35
|
+
const respGetInitiatorOnly = await commonWellMember.getOneOrg(initiatorOnlyOrgId);
|
|
36
|
+
console.log(">>> Transaction ID: " + commonWellMember.lastTransactionId);
|
|
37
|
+
console.log(">>> Response: " + JSON.stringify(respGetInitiatorOnly, null, 2));
|
|
38
|
+
if (!respGetInitiatorOnly)
|
|
39
|
+
throw new Error("No org on response from getOneOrg");
|
|
40
|
+
const initiatorOnlyOrg = respGetInitiatorOnly;
|
|
41
|
+
console.log(`>>> Update an org`);
|
|
42
|
+
initiatorOnlyOrg.locations[0].city = faker_1.faker.location.city();
|
|
43
|
+
const respUpdateInitiatorOnly = await commonWellMember.updateOrg(initiatorOnlyOrg);
|
|
44
|
+
console.log(">>> Transaction ID: " + commonWellMember.lastTransactionId);
|
|
45
|
+
console.log(">>> Response: " + JSON.stringify(respUpdateInitiatorOnly, null, 2));
|
|
46
|
+
}
|
|
47
|
+
catch (error) {
|
|
48
|
+
console.log(`Error (txId ${commonWellMember.lastTransactionId}): ${(0, shared_1.errorToString)(error)}`);
|
|
49
|
+
errors.push(error);
|
|
50
|
+
}
|
|
51
|
+
try {
|
|
52
|
+
const orgId = env_1.existingInitiatorOnlyOrgId;
|
|
53
|
+
if (!orgId)
|
|
54
|
+
throw new Error("No org ID to run initiator only org update flow");
|
|
55
|
+
console.log(`>>> Get one org`);
|
|
56
|
+
const respGetInitiatorOnly = await commonWellMember.getOneOrg(orgId);
|
|
57
|
+
console.log(">>> Transaction ID: " + commonWellMember.lastTransactionId);
|
|
58
|
+
console.log(">>> Response: " + JSON.stringify(respGetInitiatorOnly, null, 2));
|
|
59
|
+
if (!respGetInitiatorOnly)
|
|
60
|
+
throw new Error("No org on response from getOneOrg");
|
|
61
|
+
const initiatorOnlyOrg = respGetInitiatorOnly;
|
|
62
|
+
if ("securityTokenKeyType" in initiatorOnlyOrg && initiatorOnlyOrg.securityTokenKeyType) {
|
|
63
|
+
console.log(`HEADS UP: Security token key type is not null`);
|
|
64
|
+
delete initiatorOnlyOrg.securityTokenKeyType;
|
|
65
|
+
}
|
|
66
|
+
if ("authorizationInformation" in initiatorOnlyOrg &&
|
|
67
|
+
initiatorOnlyOrg.authorizationInformation) {
|
|
68
|
+
console.log(`HEADS UP: Authorization information is not null`);
|
|
69
|
+
delete initiatorOnlyOrg.authorizationInformation;
|
|
70
|
+
}
|
|
71
|
+
console.log(`>>> Update the org`);
|
|
72
|
+
initiatorOnlyOrg.locations[0].city = faker_1.faker.location.city();
|
|
73
|
+
const respUpdateInitiatorOnly = await commonWellMember.updateOrg(initiatorOnlyOrg);
|
|
74
|
+
console.log(">>> Transaction ID: " + commonWellMember.lastTransactionId);
|
|
75
|
+
console.log(">>> Response: " + JSON.stringify(respUpdateInitiatorOnly, null, 2));
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
console.log(`Error (txId ${commonWellMember.lastTransactionId}): ${(0, shared_1.errorToString)(error)}`);
|
|
79
|
+
errors.push(error);
|
|
80
|
+
}
|
|
81
|
+
if (errors.length > 0) {
|
|
82
|
+
throw new Error(`Failed to run org management initiator only flow: ${errors.join(", ")}`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.orgManagementInitiatorOnly = orgManagementInitiatorOnly;
|
|
86
|
+
//# sourceMappingURL=org-management-initiator-only.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-management-initiator-only.js","sourceRoot":"","sources":["../../src/flows/org-management-initiator-only.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,8DAAkF;AAClF,8CAAkD;AAClD,gCAMgB;AAChB,0CAA+C;AAM/C;;;;GAIG;AACI,KAAK,UAAU,0BAA0B;IAC9C,MAAM,gBAAgB,GAAG,IAAI,iCAAgB,CAAC;QAC5C,OAAO,EAAE,6BAAuB;QAChC,aAAa,EAAE,4BAAsB;QACrC,UAAU,EAAE,gBAAU;QACtB,QAAQ,EAAR,cAAQ;QACR,OAAO,EAAE,wBAA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BAAgB,CAAC,oBAAoB,CAAC;SAC9C;QACD,IACE,0BAA0B,IAAI,gBAAgB;YAC9C,gBAAgB,CAAC,wBAAwB,EACzC;YACA,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;YAC/D,OAAO,gBAAgB,CAAC,wBAAwB,CAAC;SAClD;QAED,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;QAClC,gBAAgB,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,aAAK,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC3D,MAAM,uBAAuB,GAAG,MAAM,gBAAgB,CAAC,SAAS,CAAC,gBAAgB,CAAC,CAAC;QACnF,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;QACzE,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;KAClF;IAAC,OAAO,KAAK,EAAE;QACd,OAAO,CAAC,GAAG,CAAC,eAAe,gBAAgB,CAAC,iBAAiB,MAAM,IAAA,sBAAa,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC3F,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACpB;IAED,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE;QACrB,MAAM,IAAI,KAAK,CAAC,qDAAqD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;KAC3F;AACH,CAAC;AA1ED,gEA0EC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility to get an Organization by OID.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* - Set env vars - see README.md for details
|
|
6
|
+
* - Run the command
|
|
7
|
+
* $ ts-node src/single-commands/org-get.ts <org-oid>
|
|
8
|
+
*/
|
|
9
|
+
export declare function getOrg(): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=org-get.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-get.d.ts","sourceRoot":"","sources":["../../src/single-commands/org-get.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,wBAAsB,MAAM,kBAgB3B"}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.getOrg = void 0;
|
|
27
|
+
const dotenv = __importStar(require("dotenv"));
|
|
28
|
+
dotenv.config();
|
|
29
|
+
// keep that ^ above all other imports
|
|
30
|
+
const commonwell_sdk_1 = require("@metriport/commonwell-sdk");
|
|
31
|
+
const env_1 = require("../env");
|
|
32
|
+
const orgOID = process.argv[2]; // read OID from command line argument
|
|
33
|
+
/**
|
|
34
|
+
* Utility to get an Organization by OID.
|
|
35
|
+
*
|
|
36
|
+
* Usage:
|
|
37
|
+
* - Set env vars - see README.md for details
|
|
38
|
+
* - Run the command
|
|
39
|
+
* $ ts-node src/single-commands/org-get.ts <org-oid>
|
|
40
|
+
*/
|
|
41
|
+
async function getOrg() {
|
|
42
|
+
if (!orgOID || orgOID.trim().length < 1) {
|
|
43
|
+
throw new Error("No org OID provided. Add it as an argument to the command");
|
|
44
|
+
}
|
|
45
|
+
const commonWellMember = new commonwell_sdk_1.CommonWellMember({
|
|
46
|
+
orgCert: env_1.memberCertificateString,
|
|
47
|
+
rsaPrivateKey: env_1.memberPrivateKeyString,
|
|
48
|
+
memberName: env_1.memberName,
|
|
49
|
+
memberId: env_1.memberId,
|
|
50
|
+
apiMode: commonwell_sdk_1.APIMode.integration,
|
|
51
|
+
});
|
|
52
|
+
console.log(`Get Org ${orgOID}`);
|
|
53
|
+
const resp = await commonWellMember.getOneOrg(orgOID);
|
|
54
|
+
console.log("Transaction ID: " + commonWellMember.lastTransactionId);
|
|
55
|
+
console.log("Response: " + JSON.stringify(resp, null, 2));
|
|
56
|
+
}
|
|
57
|
+
exports.getOrg = getOrg;
|
|
58
|
+
getOrg();
|
|
59
|
+
//# sourceMappingURL=org-get.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-get.js","sourceRoot":"","sources":["../../src/single-commands/org-get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,8DAAsE;AACtE,gCAA+F;AAE/F,MAAM,MAAM,GAAW,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,sCAAsC;AAE9E;;;;;;;GAOG;AACI,KAAK,UAAU,MAAM;IAC1B,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;QACvC,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;KAC9E;IACD,MAAM,gBAAgB,GAAG,IAAI,iCAAgB,CAAC;QAC5C,OAAO,EAAE,6BAAuB;QAChC,aAAa,EAAE,4BAAsB;QACrC,UAAU,EAAE,gBAAU;QACtB,QAAQ,EAAE,cAAQ;QAClB,OAAO,EAAE,wBAAO,CAAC,WAAW;KAC7B,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,WAAW,MAAM,EAAE,CAAC,CAAC;IACjC,MAAM,IAAI,GAAG,MAAM,gBAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACtD,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC;AAhBD,wBAgBC;AAED,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility to get probable links for a patient by ID.
|
|
3
|
+
*
|
|
4
|
+
* Usage:
|
|
5
|
+
* - Set env vars - see README.md for details
|
|
6
|
+
* - Run the command
|
|
7
|
+
* $ ts-node src/single-commands/patient-get-probable-links.ts <patient-id>
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPatientProbableLinks(): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=patient-get-probable-links.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patient-get-probable-links.d.ts","sourceRoot":"","sources":["../../src/single-commands/patient-get-probable-links.ts"],"names":[],"mappings":"AAQA;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,kBAe5C"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.getPatientProbableLinks = void 0;
|
|
27
|
+
const dotenv = __importStar(require("dotenv"));
|
|
28
|
+
dotenv.config();
|
|
29
|
+
// keep that ^ above all other imports
|
|
30
|
+
const util_1 = require("@metriport/commonwell-sdk/common/util");
|
|
31
|
+
const org_management_1 = require("../flows/org-management");
|
|
32
|
+
const patientId = process.argv[2]; // read patient ID from command line argument
|
|
33
|
+
/**
|
|
34
|
+
* Utility to get probable links for a patient by ID.
|
|
35
|
+
*
|
|
36
|
+
* Usage:
|
|
37
|
+
* - Set env vars - see README.md for details
|
|
38
|
+
* - Run the command
|
|
39
|
+
* $ ts-node src/single-commands/patient-get-probable-links.ts <patient-id>
|
|
40
|
+
*/
|
|
41
|
+
async function getPatientProbableLinks() {
|
|
42
|
+
if (!patientId || patientId.trim().length < 1) {
|
|
43
|
+
throw new Error("No patientId provided. Add it as an argument to the command");
|
|
44
|
+
}
|
|
45
|
+
const { commonWell } = await (0, org_management_1.initApiForExistingOrg)();
|
|
46
|
+
const encodedPatientId = (0, util_1.encodeCwPatientId)({
|
|
47
|
+
patientId: patientId,
|
|
48
|
+
assignAuthority: commonWell.oid,
|
|
49
|
+
});
|
|
50
|
+
console.log(`Get Patient Probable Links for ${patientId}`);
|
|
51
|
+
const resp = await commonWell.getProbableLinksById(encodedPatientId);
|
|
52
|
+
console.log("Transaction ID: " + commonWell.lastTransactionId);
|
|
53
|
+
console.log("Response: " + JSON.stringify(resp, null, 2));
|
|
54
|
+
}
|
|
55
|
+
exports.getPatientProbableLinks = getPatientProbableLinks;
|
|
56
|
+
getPatientProbableLinks();
|
|
57
|
+
//# sourceMappingURL=patient-get-probable-links.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patient-get-probable-links.js","sourceRoot":"","sources":["../../src/single-commands/patient-get-probable-links.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,gEAA0E;AAC1E,4DAAgE;AAEhE,MAAM,SAAS,GAAW,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,6CAA6C;AAExF;;;;;;;GAOG;AACI,KAAK,UAAU,uBAAuB;IAC3C,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;QAC7C,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;KAChF;IACD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAA,sCAAqB,GAAE,CAAC;IAErD,MAAM,gBAAgB,GAAG,IAAA,wBAAiB,EAAC;QACzC,SAAS,EAAE,SAAS;QACpB,eAAe,EAAE,UAAU,CAAC,GAAG;KAChC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,kCAAkC,SAAS,EAAE,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,kBAAkB,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAC/D,OAAO,CAAC,GAAG,CAAC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC5D,CAAC;AAfD,0DAeC;AAED,uBAAuB,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metriport/commonwell-cert-runner",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Tool to run through Edge System CommonWell certification test cases - by Metriport Inc.",
|
|
5
5
|
"author": "Metriport Inc. <contact@metriport.com>",
|
|
6
6
|
"homepage": "https://metriport.com/",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"ts-node": "^10.9.1",
|
|
65
65
|
"typescript": "^4.9.5"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "545553811a9873458d83080db6127fc420970c4c"
|
|
68
68
|
}
|