@metriport/commonwell-cert-runner 2.4.0 → 2.4.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/document-consumption.d.ts +6 -0
- package/dist/document-consumption.d.ts.map +1 -0
- package/dist/document-consumption.js +85 -0
- package/dist/document-consumption.js.map +1 -0
- package/dist/document-contribution.d.ts +8 -0
- package/dist/document-contribution.d.ts.map +1 -0
- package/dist/document-contribution.js +514 -0
- package/dist/document-contribution.js.map +1 -0
- package/dist/flows/contribution/binary.js +1 -2
- package/dist/flows/contribution/binary.js.map +1 -1
- package/dist/flows/contribution/contribution-server.js +18 -9
- package/dist/flows/contribution/contribution-server.js.map +1 -1
- package/dist/flows/contribution/document-reference.js +1 -2
- package/dist/flows/contribution/document-reference.js.map +1 -1
- package/dist/flows/contribution/token.js +19 -10
- package/dist/flows/contribution/token.js.map +1 -1
- package/dist/flows/directory-management.js +1 -2
- package/dist/flows/directory-management.js.map +1 -1
- package/dist/flows/document-consumption.js +3 -4
- package/dist/flows/document-consumption.js.map +1 -1
- package/dist/flows/document-contribution.js +1 -2
- package/dist/flows/document-contribution.js.map +1 -1
- package/dist/flows/link-management.js +1 -2
- package/dist/flows/link-management.js.map +1 -1
- package/dist/flows/org-management-initiator-only.js +1 -2
- package/dist/flows/org-management-initiator-only.js.map +1 -1
- package/dist/flows/org-management.js +3 -4
- package/dist/flows/org-management.js.map +1 -1
- package/dist/flows/patient-management.js +1 -2
- package/dist/flows/patient-management.js.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/dist/issues/issue425-strong-id-on-link.d.ts +4 -0
- package/dist/issues/issue425-strong-id-on-link.d.ts.map +1 -0
- package/dist/issues/issue425-strong-id-on-link.js +125 -0
- package/dist/issues/issue425-strong-id-on-link.js.map +1 -0
- package/dist/link-management.d.ts +4 -0
- package/dist/link-management.d.ts.map +1 -0
- package/dist/link-management.js +47 -0
- package/dist/link-management.js.map +1 -0
- package/dist/org-management.d.ts +4 -0
- package/dist/org-management.d.ts.map +1 -0
- package/dist/org-management.js +47 -0
- package/dist/org-management.js.map +1 -0
- package/dist/patient-management.d.ts +4 -0
- package/dist/patient-management.d.ts.map +1 -0
- package/dist/patient-management.js +91 -0
- package/dist/patient-management.js.map +1 -0
- package/dist/payloads/probable-patient-sina.js +1 -2
- package/dist/payloads/probable-patient-sina.js.map +1 -1
- package/dist/payloads.d.ts +1 -1
- package/dist/payloads.d.ts.map +1 -1
- package/dist/payloads.js +25 -15
- package/dist/payloads.js.map +1 -1
- package/dist/person-management.d.ts +4 -0
- package/dist/person-management.d.ts.map +1 -0
- package/dist/person-management.js +94 -0
- package/dist/person-management.js.map +1 -0
- package/dist/shared-person.d.ts +22 -0
- package/dist/shared-person.d.ts.map +1 -0
- package/dist/shared-person.js +78 -0
- package/dist/shared-person.js.map +1 -0
- package/dist/single-commands/document-parse.js +18 -9
- package/dist/single-commands/document-parse.js.map +1 -1
- package/dist/single-commands/init-contrib-server.js +18 -9
- package/dist/single-commands/init-contrib-server.js.map +1 -1
- package/dist/single-commands/org-get.js +18 -9
- package/dist/single-commands/org-get.js.map +1 -1
- package/dist/single-commands/patient-create.js +18 -9
- package/dist/single-commands/patient-create.js.map +1 -1
- package/dist/single-commands/patient-delete.js +18 -9
- package/dist/single-commands/patient-delete.js.map +1 -1
- package/dist/single-commands/patient-get-links.js +18 -9
- package/dist/single-commands/patient-get-links.js.map +1 -1
- package/dist/single-commands/patient-get-probable-links.js +18 -9
- package/dist/single-commands/patient-get-probable-links.js.map +1 -1
- package/dist/single-commands/patient-get.js +18 -9
- package/dist/single-commands/patient-get.js.map +1 -1
- package/dist/util.js +26 -17
- package/dist/util.js.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.personManagement = void 0;
|
|
28
|
+
const commonwell_sdk_1 = require("@metriport/commonwell-sdk");
|
|
29
|
+
const nanoid = __importStar(require("nanoid"));
|
|
30
|
+
const payloads_1 = require("./payloads");
|
|
31
|
+
// 1. Person Management
|
|
32
|
+
// https://commonwellalliance.sharepoint.com/sites/ServiceAdopter/SitePages/Person-Management-(REST).aspx
|
|
33
|
+
async function personManagement(commonWell, queryMeta) {
|
|
34
|
+
// C1: Enroll a person
|
|
35
|
+
console.log(`>>> C1a: Enroll a Person with a Strong ID`);
|
|
36
|
+
const respC1a = await commonWell.enrollPerson(queryMeta, payloads_1.personStrongId);
|
|
37
|
+
console.log(respC1a);
|
|
38
|
+
console.log(`>>> C1b: Enroll a Person without a Strong ID`);
|
|
39
|
+
const respC1b = await commonWell.enrollPerson(queryMeta, payloads_1.personNoStrongId);
|
|
40
|
+
console.log(respC1b);
|
|
41
|
+
// C2: Person search
|
|
42
|
+
console.log(`>>> C2a: Search for a Person using the Strong ID`);
|
|
43
|
+
const respC2a = await commonWell.searchPerson(queryMeta, payloads_1.driversLicenseId, payloads_1.caDriversLicenseUri);
|
|
44
|
+
console.log(respC2a);
|
|
45
|
+
console.log(`>>> C2b: Search for a Person using the local Patient demographics.`);
|
|
46
|
+
const personId = (0, commonwell_sdk_1.getId)(respC1a);
|
|
47
|
+
if (!personId)
|
|
48
|
+
throw new Error("No personId on response from enrollPerson");
|
|
49
|
+
const newPatient = await commonWell.registerPatient(queryMeta, (0, payloads_1.makePatient)({ facilityId: commonWell.oid }));
|
|
50
|
+
const patientId = (0, commonwell_sdk_1.getIdTrailingSlash)(newPatient);
|
|
51
|
+
if (!patientId)
|
|
52
|
+
throw new Error("No patientId on response from registerPatient");
|
|
53
|
+
const respC2b = await commonWell.searchPersonByPatientDemo(queryMeta, patientId);
|
|
54
|
+
console.log(respC2b);
|
|
55
|
+
// C3: Person Update
|
|
56
|
+
console.log(`>>> C3a: Update a Person with an existing Strong ID by updating their demographics and/or Strong ID`);
|
|
57
|
+
payloads_1.personStrongId.details.name[0].family[0] = "Graham";
|
|
58
|
+
const respC3a = await commonWell.updatePerson(queryMeta, payloads_1.personStrongId, personId);
|
|
59
|
+
console.log(respC3a);
|
|
60
|
+
console.log(`>>> C3b: Update a Person without a Strong ID by updating their demographics and/or by adding a Strong ID`);
|
|
61
|
+
const personId2 = (0, commonwell_sdk_1.getId)(respC1b);
|
|
62
|
+
if (!personId2)
|
|
63
|
+
throw new Error("No personId2 on response from enrollPerson");
|
|
64
|
+
const driversLicenseId2 = nanoid.nanoid();
|
|
65
|
+
payloads_1.personNoStrongId.details.identifier = [
|
|
66
|
+
{
|
|
67
|
+
use: "usual",
|
|
68
|
+
key: driversLicenseId2,
|
|
69
|
+
system: payloads_1.caDriversLicenseUri,
|
|
70
|
+
period: {
|
|
71
|
+
start: "2016-04-20T00:00:00Z",
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
];
|
|
75
|
+
const respC3b = await commonWell.updatePerson(queryMeta, payloads_1.personNoStrongId, personId2);
|
|
76
|
+
console.log(respC3b);
|
|
77
|
+
// C4: Patient Match
|
|
78
|
+
console.log(`>>> C4a: Search for patients matching the Person demographics.`);
|
|
79
|
+
const respC4a = await commonWell.patientMatch(queryMeta, personId);
|
|
80
|
+
console.log(respC4a);
|
|
81
|
+
// C6: Unenroll a person
|
|
82
|
+
console.log(`>>> C6a: Unenroll a Person who is active`);
|
|
83
|
+
const respC6a = await commonWell.unenrollPerson(queryMeta, personId2);
|
|
84
|
+
console.log(respC6a);
|
|
85
|
+
// C7: Delete Person
|
|
86
|
+
console.log(`>>> C7a: Delete a Person who was previously enrolled with or without a Strong ID and at least one patient link.`);
|
|
87
|
+
// Note: will be deleting both persons created in this run
|
|
88
|
+
await commonWell.deletePerson(queryMeta, personId);
|
|
89
|
+
await commonWell.deletePerson(queryMeta, personId2);
|
|
90
|
+
// Note: delete created patient
|
|
91
|
+
await commonWell.deletePatient(queryMeta, patientId);
|
|
92
|
+
}
|
|
93
|
+
exports.personManagement = personManagement;
|
|
94
|
+
//# sourceMappingURL=person-management.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"person-management.js","sourceRoot":"","sources":["../src/person-management.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,8DAAmG;AACnG,+CAAiC;AAEjC,yCAMoB;AAEpB,uBAAuB;AACvB,yGAAyG;AAElG,KAAK,UAAU,gBAAgB,CAAC,UAAsB,EAAE,SAA0B;IACvF,sBAAsB;IACtB,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,SAAS,EAAE,yBAAc,CAAC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AY,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;IACnD,MAAM,UAAU,CAAC,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;IAEpD,+BAA+B;IAC/B,MAAM,UAAU,CAAC,aAAa,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;AACvD,CAAC;AA1ED,4CA0EC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CommonWell, RequestMetadata } from "@metriport/commonwell-sdk";
|
|
2
|
+
import { makeDocPerson, makePatient } from "./payloads";
|
|
3
|
+
export declare function findOrCreatePerson(commonWell: CommonWell, queryMeta: RequestMetadata, patientData: ReturnType<typeof makeDocPerson> | ReturnType<typeof makePatient>): Promise<{
|
|
4
|
+
patientId: string;
|
|
5
|
+
personId: string;
|
|
6
|
+
}>;
|
|
7
|
+
type FindOrCreatePatientResult = {
|
|
8
|
+
result: "existing";
|
|
9
|
+
patientId: string;
|
|
10
|
+
personId: string;
|
|
11
|
+
} | {
|
|
12
|
+
result: "new";
|
|
13
|
+
patientId: string;
|
|
14
|
+
patientLink: string;
|
|
15
|
+
patientStrongId?: {
|
|
16
|
+
key: string;
|
|
17
|
+
system: string;
|
|
18
|
+
} | undefined;
|
|
19
|
+
};
|
|
20
|
+
export declare function findOrCreatePatient(commonWell: CommonWell, queryMeta: RequestMetadata, patientData: ReturnType<typeof makeDocPerson> | ReturnType<typeof makePatient>, personId?: string): Promise<FindOrCreatePatientResult>;
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=shared-person.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-person.d.ts","sourceRoot":"","sources":["../src/shared-person.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EAKV,eAAe,EAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAOxD,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,eAAe,EAC1B,WAAW,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,GAC7E,OAAO,CAAC;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAuBlD;AAED,KAAK,yBAAyB,GAC1B;IACE,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,GACD;IACE,MAAM,EAAE,KAAK,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EACZ;QACE,GAAG,EAAE,MAAM,CAAC;QACZ,MAAM,EAAE,MAAM,CAAC;KAChB,GACD,SAAS,CAAC;CACf,CAAC;AAEN,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,eAAe,EAC1B,WAAW,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,EAC9E,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,yBAAyB,CAAC,CAyDpC"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.findOrCreatePatient = exports.findOrCreatePerson = void 0;
|
|
4
|
+
const commonwell_sdk_1 = require("@metriport/commonwell-sdk");
|
|
5
|
+
const util_1 = require("./util");
|
|
6
|
+
const commonwellOID = (0, util_1.getEnvOrFail)("COMMONWELL_OID");
|
|
7
|
+
const prefixedCommonwellOID = `urn:oid:${commonwellOID}`;
|
|
8
|
+
async function findOrCreatePerson(commonWell, queryMeta, patientData) {
|
|
9
|
+
const res = await findOrCreatePatient(commonWell, queryMeta, patientData);
|
|
10
|
+
if (res.result === "new") {
|
|
11
|
+
const { patientId, patientLink, patientStrongId } = res;
|
|
12
|
+
const respPerson = await commonWell.enrollPerson(queryMeta, patientData);
|
|
13
|
+
console.log(respPerson);
|
|
14
|
+
const personId = (0, commonwell_sdk_1.getId)(respPerson);
|
|
15
|
+
if (!personId)
|
|
16
|
+
throw new Error("No personId on response from enrollPerson");
|
|
17
|
+
const respLink = await commonWell.addPatientLink(queryMeta, personId, patientLink, patientStrongId);
|
|
18
|
+
console.log(respLink);
|
|
19
|
+
return { patientId, personId };
|
|
20
|
+
//
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
const { patientId, personId } = res;
|
|
24
|
+
return { patientId, personId };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.findOrCreatePerson = findOrCreatePerson;
|
|
28
|
+
async function findOrCreatePatient(commonWell, queryMeta, patientData, personId) {
|
|
29
|
+
const givenName = (0, util_1.firstElementOrFail)(patientData.details.name[0].given, "given name");
|
|
30
|
+
const familyName = (0, util_1.firstElementOrFail)(patientData.details.name[0].family, "family name");
|
|
31
|
+
const respPatient = await commonWell.searchPatient(queryMeta, givenName, familyName, patientData.details.birthDate, patientData.details.gender.code, patientData.details.address[0].zip);
|
|
32
|
+
console.log(respPatient);
|
|
33
|
+
// IF THERE'S A PATIENT, USE IT
|
|
34
|
+
if (respPatient._embedded?.patient?.length > 0) {
|
|
35
|
+
const embeddedPatients = respPatient._embedded.patient;
|
|
36
|
+
if (embeddedPatients.length > 1) {
|
|
37
|
+
console.log(`Found more than one patient, using the first one`);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
console.log(`Found a patient, using it`);
|
|
41
|
+
}
|
|
42
|
+
const patient = embeddedPatients[0];
|
|
43
|
+
const patientId = (0, commonwell_sdk_1.getIdTrailingSlash)(patient);
|
|
44
|
+
if (!patientId)
|
|
45
|
+
throw new Error(`No patient ID found in patient search response`);
|
|
46
|
+
const respPerson = await commonWell.searchPersonByPatientDemo(queryMeta, patientId);
|
|
47
|
+
console.log(respPerson);
|
|
48
|
+
const personId = (0, commonwell_sdk_1.getPersonIdFromSearchByPatientDemo)(respPerson);
|
|
49
|
+
if (!personId)
|
|
50
|
+
throw new Error(`No person ID found in person search response`);
|
|
51
|
+
return { result: "existing", patientId, personId };
|
|
52
|
+
//
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
// OTHERWISE ADD ONE
|
|
56
|
+
console.log(`Did not find a patient, creating one`);
|
|
57
|
+
const respPatientCreate = await commonWell.registerPatient(queryMeta, patientData);
|
|
58
|
+
console.log(respPatientCreate);
|
|
59
|
+
const patientId = (0, commonwell_sdk_1.getIdTrailingSlash)(respPatientCreate);
|
|
60
|
+
if (!patientId)
|
|
61
|
+
throw new Error(`No patient ID found in patient create response`);
|
|
62
|
+
const patientLink = respPatientCreate._links?.self.href;
|
|
63
|
+
if (!patientLink)
|
|
64
|
+
throw new Error(`No patient link found in patient create response`);
|
|
65
|
+
const patientStrongIds = (0, commonwell_sdk_1.getPatientStrongIds)(respPatientCreate);
|
|
66
|
+
const patientStrongId = patientStrongIds
|
|
67
|
+
? patientStrongIds.find(id => id.system === prefixedCommonwellOID)
|
|
68
|
+
: undefined;
|
|
69
|
+
if (personId) {
|
|
70
|
+
// Link the patient to the person
|
|
71
|
+
const respLink = await commonWell.addPatientLink(queryMeta, personId, patientLink, patientStrongId);
|
|
72
|
+
console.log(respLink);
|
|
73
|
+
}
|
|
74
|
+
return { result: "new", patientId, patientLink, patientStrongId };
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.findOrCreatePatient = findOrCreatePatient;
|
|
78
|
+
//# sourceMappingURL=shared-person.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shared-person.js","sourceRoot":"","sources":["../src/shared-person.ts"],"names":[],"mappings":";;;AAAA,8DAOmC;AAEnC,iCAA0D;AAE1D,MAAM,aAAa,GAAG,IAAA,mBAAY,EAAC,gBAAgB,CAAC,CAAC;AAErD,MAAM,qBAAqB,GAAG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SAAM;QACL,oBAAoB;QACpB,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAC;QACpD,MAAM,iBAAiB,GAAG,MAAM,UAAU,CAAC,eAAe,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACnF,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC/B,MAAM,SAAS,GAAG,IAAA,mCAAkB,EAAC,iBAAiB,CAAC,CAAC;QACxD,IAAI,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAClF,MAAM,WAAW,GAAG,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;QACxD,IAAI,CAAC,WAAW;YAAE,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;QACtF,MAAM,gBAAgB,GAAG,IAAA,oCAAmB,EAAC,iBAAiB,CAAC,CAAC;QAChE,MAAM,eAAe,GAAG,gBAAgB;YACtC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,KAAK,qBAAqB,CAAC;YAClE,CAAC,CAAC,SAAS,CAAC;QACd,IAAI,QAAQ,EAAE;YACZ,iCAAiC;YACjC,MAAM,QAAQ,GAAG,MAAM,UAAU,CAAC,cAAc,CAC9C,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,CAChB,CAAC;YACF,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;SACvB;QACD,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC;KACnE;AACH,CAAC;AA9DD,kDA8DC"}
|
|
@@ -15,18 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.parse =
|
|
39
|
+
exports.parse = parse;
|
|
30
40
|
const dotenv = __importStar(require("dotenv"));
|
|
31
41
|
dotenv.config();
|
|
32
42
|
// keep that ^ above all other imports
|
|
@@ -48,6 +58,5 @@ async function parse() {
|
|
|
48
58
|
const docRefs = document_1.documentQueryResponseSchema.parse(JSON.parse(fileContent));
|
|
49
59
|
console.log("DocRefs: " + JSON.stringify(docRefs, null, 2));
|
|
50
60
|
}
|
|
51
|
-
exports.parse = parse;
|
|
52
61
|
parse();
|
|
53
62
|
//# sourceMappingURL=document-parse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document-parse.js","sourceRoot":"","sources":["../../src/single-commands/document-parse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"document-parse.js","sourceRoot":"","sources":["../../src/single-commands/document-parse.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,MAAM,mCAAe;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,wEAAwF;AACxF,4CAAoB;AAEpB;;;;;;GAMG;AACI,KAAK;IACV,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjC,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;IAED,MAAM,WAAW,GAAG,YAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,sCAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IAE3E,OAAO,CAAC,GAAG,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,KAAK,EAAE,CAAC"}
|
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.main =
|
|
36
|
+
exports.main = main;
|
|
27
37
|
const dotenv = __importStar(require("dotenv"));
|
|
28
38
|
dotenv.config();
|
|
29
39
|
// keep that ^ above all other imports
|
|
@@ -56,6 +66,5 @@ async function main() {
|
|
|
56
66
|
});
|
|
57
67
|
await (0, contribution_server_1.initContributionHttpServer)(commonWell);
|
|
58
68
|
}
|
|
59
|
-
exports.main = main;
|
|
60
69
|
main();
|
|
61
70
|
//# sourceMappingURL=init-contrib-server.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-contrib-server.js","sourceRoot":"","sources":["../../src/single-commands/init-contrib-server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"init-contrib-server.js","sourceRoot":"","sources":["../../src/single-commands/init-contrib-server.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,MAAM,mCAAe;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,8DAA8E;AAC9E,gEAAiE;AACjE,gCAAmF;AACnF,mFAAuF;AAEvF;;GAEG;AACI,KAAK;IACV,MAAM,cAAc,GAAG,oBAAc,CAAC;IACtC,IAAI,CAAC,cAAc;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACpE,MAAM,GAAG,GAA+D;QACtE,IAAI,EAAE,mBAAmB;QACzB,cAAc;QACd,QAAQ,EAAE,IAAA,aAAO,GAAE;KACpB,CAAC;IACF,IAAI,CAAC,GAAG,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IACzE,MAAM,UAAU,GAAG,IAAI,2BAAU,CAAC;QAChC,OAAO,EAAE,0BAAoB;QAC7B,aAAa,EAAE,yBAAmB;QAClC,OAAO,EAAE,GAAG,CAAC,IAAI;QACjB,GAAG,EAAE,GAAG,CAAC,cAAc;QACvB,eAAe,EAAE,GAAG,CAAC,cAAc;QACnC,GAAG,EAAE,GAAG,CAAC,QAAQ;QACjB,OAAO,EAAE,wBAAO,CAAC,WAAW;KAC7B,CAAC,CAAC;IACH,MAAM,IAAA,gDAA0B,EAAC,UAAU,CAAC,CAAC;AAC/C,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getOrg =
|
|
36
|
+
exports.getOrg = getOrg;
|
|
27
37
|
const dotenv = __importStar(require("dotenv"));
|
|
28
38
|
dotenv.config();
|
|
29
39
|
// keep that ^ above all other imports
|
|
@@ -54,6 +64,5 @@ async function getOrg() {
|
|
|
54
64
|
console.log("Transaction ID: " + commonWellMember.lastTransactionId);
|
|
55
65
|
console.log("Response: " + JSON.stringify(resp, null, 2));
|
|
56
66
|
}
|
|
57
|
-
exports.getOrg = getOrg;
|
|
58
67
|
getOrg();
|
|
59
68
|
//# sourceMappingURL=org-get.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"org-get.js","sourceRoot":"","sources":["../../src/single-commands/org-get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"org-get.js","sourceRoot":"","sources":["../../src/single-commands/org-get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,MAAM,mCAAe;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,8DAAsE;AACtE,gCAA+F;AAE/F,MAAM,MAAM,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,sCAAsC;AAE1F;;;;;;;GAOG;AACI,KAAK;IACV,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;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;AAED,MAAM,EAAE,CAAC"}
|
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.createPatient =
|
|
36
|
+
exports.createPatient = createPatient;
|
|
27
37
|
const dotenv = __importStar(require("dotenv"));
|
|
28
38
|
dotenv.config();
|
|
29
39
|
const org_management_1 = require("../flows/org-management");
|
|
@@ -56,6 +66,5 @@ async function createPatient() {
|
|
|
56
66
|
const patientId = (0, util_1.getMetriportPatientIdOrFail)(resp, "createPatient");
|
|
57
67
|
console.log("Patient ID: " + patientId);
|
|
58
68
|
}
|
|
59
|
-
exports.createPatient = createPatient;
|
|
60
69
|
createPatient();
|
|
61
70
|
//# sourceMappingURL=patient-create.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patient-create.js","sourceRoot":"","sources":["../../src/single-commands/patient-create.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patient-create.js","sourceRoot":"","sources":["../../src/single-commands/patient-create.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,MAAM,mCAAe;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAGhB,4DAAgE;AAChE,0CAA0C;AAC1C,6DAA8D;AAC9D,kCAAsD;AAEtD,8DAA8D;AAC9D,MAAM,WAAW,GAAqC,iCAAiB,CAAC;AAExE;;;;;;;GAOG;AACI,KAAK;IACV,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;IACnE,CAAC;IACD,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,IAAA,sCAAqB,GAAE,CAAC;IAErD,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC9B,MAAM,aAAa,GAAY,IAAA,sBAAW,EAAC;QACzC,UAAU,EAAE,UAAU,CAAC,GAAG;QAC1B,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IACnE,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;IAC1D,MAAM,SAAS,GAAG,IAAA,kCAA2B,EAAC,IAAI,EAAE,eAAe,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;AAC1C,CAAC;AAED,aAAa,EAAE,CAAC"}
|
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.deletePatient =
|
|
36
|
+
exports.deletePatient = deletePatient;
|
|
27
37
|
const dotenv = __importStar(require("dotenv"));
|
|
28
38
|
dotenv.config();
|
|
29
39
|
// keep that ^ above all other imports
|
|
@@ -53,6 +63,5 @@ async function deletePatient() {
|
|
|
53
63
|
await commonWell.deletePatient(encodedPatientId);
|
|
54
64
|
console.log(`Patient deleted successfully`);
|
|
55
65
|
}
|
|
56
|
-
exports.deletePatient = deletePatient;
|
|
57
66
|
deletePatient();
|
|
58
67
|
//# sourceMappingURL=patient-delete.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patient-delete.js","sourceRoot":"","sources":["../../src/single-commands/patient-delete.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patient-delete.js","sourceRoot":"","sources":["../../src/single-commands/patient-delete.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,MAAM,mCAAe;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,gEAA0E;AAC1E,4DAAgE;AAEhE,MAAM,SAAS,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,6CAA6C;AAEpG;;;;;;;;;GASG;AACI,KAAK;IACV,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;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;IACH,OAAO,CAAC,GAAG,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC;IAC3C,MAAM,UAAU,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;IACjD,OAAO,CAAC,GAAG,CAAC,8BAA8B,CAAC,CAAC;AAC9C,CAAC;AAED,aAAa,EAAE,CAAC"}
|
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getPatientLinks =
|
|
36
|
+
exports.getPatientLinks = getPatientLinks;
|
|
27
37
|
const dotenv = __importStar(require("dotenv"));
|
|
28
38
|
dotenv.config();
|
|
29
39
|
// keep that ^ above all other imports
|
|
@@ -63,6 +73,5 @@ async function getPatientLinks() {
|
|
|
63
73
|
process.exit(1);
|
|
64
74
|
}
|
|
65
75
|
}
|
|
66
|
-
exports.getPatientLinks = getPatientLinks;
|
|
67
76
|
getPatientLinks();
|
|
68
77
|
//# sourceMappingURL=patient-get-links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patient-get-links.js","sourceRoot":"","sources":["../../src/single-commands/patient-get-links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patient-get-links.js","sourceRoot":"","sources":["../../src/single-commands/patient-get-links.ts"],"names":[],"mappings":";;;;;;;;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,CAAC,iBAAiB,CAAC,CAAC;QAC/D,IAAI,OAAO;YAAE,MAAM,KAAK,CAAC;QACzB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,eAAe,EAAE,CAAC"}
|
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getPatientProbableLinks =
|
|
36
|
+
exports.getPatientProbableLinks = getPatientProbableLinks;
|
|
27
37
|
const dotenv = __importStar(require("dotenv"));
|
|
28
38
|
dotenv.config();
|
|
29
39
|
// keep that ^ above all other imports
|
|
@@ -52,6 +62,5 @@ async function getPatientProbableLinks() {
|
|
|
52
62
|
console.log("Transaction ID: " + commonWell.lastTransactionId);
|
|
53
63
|
console.log("Response: " + JSON.stringify(resp, null, 2));
|
|
54
64
|
}
|
|
55
|
-
exports.getPatientProbableLinks = getPatientProbableLinks;
|
|
56
65
|
getPatientProbableLinks();
|
|
57
66
|
//# sourceMappingURL=patient-get-probable-links.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patient-get-probable-links.js","sourceRoot":"","sources":["../../src/single-commands/patient-get-probable-links.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patient-get-probable-links.js","sourceRoot":"","sources":["../../src/single-commands/patient-get-probable-links.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,MAAM,mCAAe;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,gEAA0E;AAC1E,4DAAgE;AAEhE,MAAM,SAAS,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,6CAA6C;AAEpG;;;;;;;GAOG;AACI,KAAK;IACV,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;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;AAED,uBAAuB,EAAE,CAAC"}
|
|
@@ -15,15 +15,25 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getPatient =
|
|
36
|
+
exports.getPatient = getPatient;
|
|
27
37
|
const dotenv = __importStar(require("dotenv"));
|
|
28
38
|
dotenv.config();
|
|
29
39
|
// keep that ^ above all other imports
|
|
@@ -52,6 +62,5 @@ async function getPatient() {
|
|
|
52
62
|
console.log("Transaction ID: " + commonWell.lastTransactionId);
|
|
53
63
|
console.log("Response: " + JSON.stringify(resp, null, 2));
|
|
54
64
|
}
|
|
55
|
-
exports.getPatient = getPatient;
|
|
56
65
|
getPatient();
|
|
57
66
|
//# sourceMappingURL=patient-get.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patient-get.js","sourceRoot":"","sources":["../../src/single-commands/patient-get.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"patient-get.js","sourceRoot":"","sources":["../../src/single-commands/patient-get.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,MAAM,mCAAe;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,gEAA0E;AAC1E,4DAAgE;AAEhE,MAAM,SAAS,GAAuB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,6CAA6C;AAEpG;;;;;;;GAOG;AACI,KAAK;IACV,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;IACjF,CAAC;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,eAAe,SAAS,EAAE,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,UAAU,CAAC,gBAAgB,CAAC,CAAC;IAC3D,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;AAED,UAAU,EAAE,CAAC"}
|