@metriport/commonwell-cert-runner 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/package.json +2 -2
  2. package/dist/document-consumption.d.ts +0 -16
  3. package/dist/document-consumption.d.ts.map +0 -1
  4. package/dist/document-consumption.js +0 -85
  5. package/dist/document-consumption.js.map +0 -1
  6. package/dist/document-contribution.d.ts +0 -12
  7. package/dist/document-contribution.d.ts.map +0 -1
  8. package/dist/document-contribution.js +0 -514
  9. package/dist/document-contribution.js.map +0 -1
  10. package/dist/issues/issue425-strong-id-on-link.d.ts +0 -7
  11. package/dist/issues/issue425-strong-id-on-link.d.ts.map +0 -1
  12. package/dist/issues/issue425-strong-id-on-link.js +0 -125
  13. package/dist/issues/issue425-strong-id-on-link.js.map +0 -1
  14. package/dist/link-management.d.ts +0 -7
  15. package/dist/link-management.d.ts.map +0 -1
  16. package/dist/link-management.js +0 -47
  17. package/dist/link-management.js.map +0 -1
  18. package/dist/org-management.d.ts +0 -7
  19. package/dist/org-management.d.ts.map +0 -1
  20. package/dist/org-management.js +0 -47
  21. package/dist/org-management.js.map +0 -1
  22. package/dist/patient-management.d.ts +0 -8
  23. package/dist/patient-management.d.ts.map +0 -1
  24. package/dist/patient-management.js +0 -91
  25. package/dist/patient-management.js.map +0 -1
  26. package/dist/payloads/patient-carin.d.ts +0 -3
  27. package/dist/payloads/patient-carin.d.ts.map +0 -1
  28. package/dist/payloads/patient-carin.js +0 -34
  29. package/dist/payloads/patient-carin.js.map +0 -1
  30. package/dist/payloads/patient-crane.d.ts +0 -3
  31. package/dist/payloads/patient-crane.d.ts.map +0 -1
  32. package/dist/payloads/patient-crane.js +0 -31
  33. package/dist/payloads/patient-crane.js.map +0 -1
  34. package/dist/person-management.d.ts +0 -7
  35. package/dist/person-management.d.ts.map +0 -1
  36. package/dist/person-management.js +0 -94
  37. package/dist/person-management.js.map +0 -1
  38. package/dist/shared-person.d.ts +0 -35
  39. package/dist/shared-person.d.ts.map +0 -1
  40. package/dist/shared-person.js +0 -78
  41. package/dist/shared-person.js.map +0 -1
  42. package/dist/single-commands/create-patient.d.ts +0 -5
  43. package/dist/single-commands/create-patient.d.ts.map +0 -1
  44. package/dist/single-commands/create-patient.js +0 -56
  45. package/dist/single-commands/create-patient.js.map +0 -1
  46. package/dist/single-commands/delete-patient.d.ts +0 -5
  47. package/dist/single-commands/delete-patient.d.ts.map +0 -1
  48. package/dist/single-commands/delete-patient.js +0 -51
  49. package/dist/single-commands/delete-patient.js.map +0 -1
  50. package/dist/single-commands/get-patient-links.d.ts +0 -5
  51. package/dist/single-commands/get-patient-links.d.ts.map +0 -1
  52. package/dist/single-commands/get-patient-links.js +0 -52
  53. package/dist/single-commands/get-patient-links.js.map +0 -1
  54. package/dist/single-commands/get-patient.d.ts +0 -5
  55. package/dist/single-commands/get-patient.d.ts.map +0 -1
  56. package/dist/single-commands/get-patient.js +0 -52
  57. package/dist/single-commands/get-patient.js.map +0 -1
@@ -1,35 +0,0 @@
1
- import { CommonWell, RequestMetadata } from "@metriport/commonwell-sdk";
2
- import { makeDocPerson, makePatient } from "./payloads";
3
- export declare function findOrCreatePerson(
4
- commonWell: CommonWell,
5
- queryMeta: RequestMetadata,
6
- patientData: ReturnType<typeof makeDocPerson> | ReturnType<typeof makePatient>
7
- ): Promise<{
8
- patientId: string;
9
- personId: string;
10
- }>;
11
- type FindOrCreatePatientResult =
12
- | {
13
- result: "existing";
14
- patientId: string;
15
- personId: string;
16
- }
17
- | {
18
- result: "new";
19
- patientId: string;
20
- patientLink: string;
21
- patientStrongId?:
22
- | {
23
- key: string;
24
- system: string;
25
- }
26
- | undefined;
27
- };
28
- export declare function findOrCreatePatient(
29
- commonWell: CommonWell,
30
- queryMeta: RequestMetadata,
31
- patientData: ReturnType<typeof makeDocPerson> | ReturnType<typeof makePatient>,
32
- personId?: string
33
- ): Promise<FindOrCreatePatientResult>;
34
- export {};
35
- //# sourceMappingURL=shared-person.d.ts.map
@@ -1 +0,0 @@
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"}
@@ -1,78 +0,0 @@
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
@@ -1 +0,0 @@
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,WAAW,aAAa,EAAE,CAAC;AAElD,KAAK,UAAU,kBAAkB,CACtC,UAAsB,EACtB,SAA0B,EAC1B,WAA8E;IAE9E,MAAM,GAAG,GAAG,MAAM,mBAAmB,CAAC,UAAU,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IAE1E,IAAI,GAAG,CAAC,MAAM,KAAK,KAAK,EAAE;QACxB,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,GAAG,GAAG,CAAC;QACxD,MAAM,UAAU,GAAG,MAAM,UAAU,CAAC,YAAY,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;QACzE,OAAO,C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AAI,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"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Supporting function used to create a patient.
3
- */
4
- export declare function createPatient(): Promise<void>;
5
- //# sourceMappingURL=create-patient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-patient.d.ts","sourceRoot":"","sources":["../../src/single-commands/create-patient.ts"],"names":[],"mappings":"AAYA;;GAEG;AACH,wBAAsB,aAAa,kBAgBlC"}
@@ -1,56 +0,0 @@
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.createPatient = void 0;
27
- const dotenv = __importStar(require("dotenv"));
28
- dotenv.config();
29
- const org_management_1 = require("../flows/org-management");
30
- const payloads_1 = require("../payloads");
31
- const patient_tracy_1 = require("../payloads/patient-tracy");
32
- const util_1 = require("../util");
33
- // Set one of the patient demographics from "../payloads" here
34
- const patientDemo = patient_tracy_1.patientTracyCrane;
35
- /**
36
- * Supporting function used to create a patient.
37
- */
38
- async function createPatient() {
39
- if (!patientDemo) {
40
- throw new Error("No patient demographics set, this is required");
41
- }
42
- const { commonWell } = await (0, org_management_1.initApiForExistingOrg)();
43
- console.log(`Create Patient`);
44
- const patientCreate = (0, payloads_1.makePatient)({
45
- facilityId: commonWell.oid,
46
- demographics: patientDemo,
47
- });
48
- const resp = await commonWell.createOrUpdatePatient(patientCreate);
49
- console.log("Transaction ID: " + commonWell.lastTransactionId);
50
- console.log("Response: " + JSON.stringify(resp, null, 2));
51
- const patientId = (0, util_1.getMetriportPatientIdOrFail)(resp.Patients[0], "createPatient");
52
- console.log("Patient ID: " + patientId);
53
- }
54
- exports.createPatient = createPatient;
55
- createPatient();
56
- //# sourceMappingURL=create-patient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-patient.js","sourceRoot":"","sources":["../../src/single-commands/create-patient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAGhB,4DAAgE;AAChE,0CAA0C;AAC1C,6DAA8D;AAC9D,kCAAsD;AAEtD,8DAA8D;AAC9D,MAAM,WAAW,GAAqC,iCAAiB,CAAC;AAExE;;GAEG;AACI,KAAK,UAAU,aAAa;IACjC,IAAI,CAAC,WAAW,EAAE;QAChB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;KAClE;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,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,eAAe,CAAC,CAAC;IACjF,OAAO,CAAC,GAAG,CAAC,cAAc,GAAG,SAAS,CAAC,CAAC;AAC1C,CAAC;AAhBD,sCAgBC;AAED,aAAa,EAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Supporting function used in case the flow breaks and we don't delete the patient.
3
- */
4
- export declare function deletePatient(): Promise<void>;
5
- //# sourceMappingURL=delete-patient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-patient.d.ts","sourceRoot":"","sources":["../../src/single-commands/delete-patient.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAsB,aAAa,kBAalC"}
@@ -1,51 +0,0 @@
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.deletePatient = 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
- * Supporting function used in case the flow breaks and we don't delete the patient.
35
- */
36
- async function deletePatient() {
37
- if (!patientId || patientId.trim().length < 1) {
38
- throw new Error("No patientId provided. Add it as an argument to the command");
39
- }
40
- const { commonWell } = await (0, org_management_1.initApiForExistingOrg)();
41
- const encodedPatientId = (0, util_1.encodeToCwPatientId)({
42
- patientId: patientId,
43
- assignAuthority: commonWell.oid,
44
- });
45
- console.log(`Delete Patient ${patientId}`);
46
- await commonWell.deletePatient(encodedPatientId);
47
- console.log(`Patient deleted successfully`);
48
- }
49
- exports.deletePatient = deletePatient;
50
- deletePatient();
51
- //# sourceMappingURL=delete-patient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delete-patient.js","sourceRoot":"","sources":["../../src/single-commands/delete-patient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,gEAA4E;AAC5E,4DAAgE;AAEhE,MAAM,SAAS,GAAW,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,6CAA6C;AAExF;;GAEG;AACI,KAAK,UAAU,aAAa;IACjC,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,0BAAmB,EAAC;QAC3C,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;AAbD,sCAaC;AAED,aAAa,EAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Supporting function used to get links for a patient by ID.
3
- */
4
- export declare function getPatientLinks(): Promise<void>;
5
- //# sourceMappingURL=get-patient-links.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-patient-links.d.ts","sourceRoot":"","sources":["../../src/single-commands/get-patient-links.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAsB,eAAe,kBAepC"}
@@ -1,52 +0,0 @@
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.getPatientLinks = 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
- * Supporting function used to get links for a patient by ID.
35
- */
36
- async function getPatientLinks() {
37
- if (!patientId || patientId.trim().length < 1) {
38
- throw new Error("No patientId provided. Add it as an argument to the command");
39
- }
40
- const { commonWell } = await (0, org_management_1.initApiForExistingOrg)();
41
- const encodedPatientId = (0, util_1.encodeToCwPatientId)({
42
- patientId: patientId,
43
- assignAuthority: commonWell.oid,
44
- });
45
- console.log(`Get Patient Links for ${patientId}`);
46
- const resp = await commonWell.getPatientLinksByPatientId(encodedPatientId);
47
- console.log("Transaction ID: " + commonWell.lastTransactionId);
48
- console.log("Response: " + JSON.stringify(resp, null, 2));
49
- }
50
- exports.getPatientLinks = getPatientLinks;
51
- getPatientLinks();
52
- //# sourceMappingURL=get-patient-links.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-patient-links.js","sourceRoot":"","sources":["../../src/single-commands/get-patient-links.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,gEAA4E;AAC5E,4DAAgE;AAEhE,MAAM,SAAS,GAAW,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,6CAA6C;AAExF;;GAEG;AACI,KAAK,UAAU,eAAe;IACnC,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,0BAAmB,EAAC;QAC3C,SAAS,EAAE,SAAS;QACpB,eAAe,EAAE,UAAU,CAAC,GAAG;KAChC,CAAC,CAAC;IAEH,OAAO,CAAC,GAAG,CAAC,yBAAyB,SAAS,EAAE,CAAC,CAAC;IAClD,MAAM,IAAI,GAAG,MAAM,UAAU,CAAC,0BAA0B,CAAC,gBAAgB,CAAC,CAAC;IAC3E,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,0CAeC;AAED,eAAe,EAAE,CAAC"}
@@ -1,5 +0,0 @@
1
- /**
2
- * Supporting function used to get a patient by ID.
3
- */
4
- export declare function getPatient(): Promise<void>;
5
- //# sourceMappingURL=get-patient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-patient.d.ts","sourceRoot":"","sources":["../../src/single-commands/get-patient.ts"],"names":[],"mappings":"AAQA;;GAEG;AACH,wBAAsB,UAAU,kBAe/B"}
@@ -1,52 +0,0 @@
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.getPatient = 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
- * Supporting function used to get a patient by ID.
35
- */
36
- async function getPatient() {
37
- if (!patientId || patientId.trim().length < 1) {
38
- throw new Error("No patientId provided. Add it as an argument to the command");
39
- }
40
- const { commonWell } = await (0, org_management_1.initApiForExistingOrg)();
41
- const encodedPatientId = (0, util_1.encodeToCwPatientId)({
42
- patientId: patientId,
43
- assignAuthority: commonWell.oid,
44
- });
45
- console.log(`Get Patient ${patientId}`);
46
- const resp = await commonWell.getPatient(encodedPatientId);
47
- console.log("Transaction ID: " + commonWell.lastTransactionId);
48
- console.log("Response: " + JSON.stringify(resp, null, 2));
49
- }
50
- exports.getPatient = getPatient;
51
- getPatient();
52
- //# sourceMappingURL=get-patient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-patient.js","sourceRoot":"","sources":["../../src/single-commands/get-patient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,CAAC;AAChB,sCAAsC;AACtC,gEAA4E;AAC5E,4DAAgE;AAEhE,MAAM,SAAS,GAAW,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,6CAA6C;AAExF;;GAEG;AACI,KAAK,UAAU,UAAU;IAC9B,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,0BAAmB,EAAC;QAC3C,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;AAfD,gCAeC;AAED,UAAU,EAAE,CAAC"}