@metriport/shared 0.20.2 → 0.21.0-alpha.0

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 (129) hide show
  1. package/dist/domain/db.d.ts +2 -2
  2. package/dist/domain/patient/patient-import/schemas.d.ts +19 -0
  3. package/dist/domain/patient/patient-import/schemas.d.ts.map +1 -0
  4. package/dist/domain/patient/patient-import/schemas.js +35 -0
  5. package/dist/domain/patient/patient-import/schemas.js.map +1 -0
  6. package/dist/domain/patient/patient-import/status.d.ts +11 -0
  7. package/dist/domain/patient/patient-import/status.d.ts.map +1 -0
  8. package/dist/domain/patient/patient-import/status.js +48 -0
  9. package/dist/domain/patient/patient-import/status.js.map +1 -0
  10. package/dist/domain/patient/patient-import/types.d.ts +48 -0
  11. package/dist/domain/patient/patient-import/types.d.ts.map +1 -0
  12. package/dist/domain/patient/patient-import/types.js +24 -0
  13. package/dist/domain/patient/patient-import/types.js.map +1 -0
  14. package/dist/domain/patient/patient-import.d.ts +6 -6
  15. package/dist/index.d.ts +7 -7
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +6 -6
  18. package/dist/index.js.map +1 -1
  19. package/dist/interface/external/ehr/elation/cx-mapping.d.ts +43 -0
  20. package/dist/interface/external/ehr/elation/cx-mapping.d.ts.map +1 -0
  21. package/dist/interface/external/ehr/elation/cx-mapping.js +19 -0
  22. package/dist/interface/external/ehr/elation/cx-mapping.js.map +1 -0
  23. package/dist/interface/external/ehr/elation/event.d.ts +106 -0
  24. package/dist/interface/external/ehr/elation/event.d.ts.map +1 -0
  25. package/dist/interface/external/ehr/elation/event.js +31 -0
  26. package/dist/interface/external/ehr/elation/event.js.map +1 -0
  27. package/dist/interface/external/ehr/elation/index.d.ts +1 -0
  28. package/dist/interface/external/ehr/elation/index.d.ts.map +1 -1
  29. package/dist/interface/external/ehr/elation/index.js +1 -0
  30. package/dist/interface/external/ehr/elation/index.js.map +1 -1
  31. package/dist/interface/external/ehr/elation/jwt-token.d.ts +0 -15
  32. package/dist/interface/external/ehr/elation/jwt-token.d.ts.map +1 -1
  33. package/dist/interface/external/ehr/elation/jwt-token.js +1 -7
  34. package/dist/interface/external/ehr/elation/jwt-token.js.map +1 -1
  35. package/dist/interface/external/ehr/elation/patient.d.ts +6 -6
  36. package/dist/interface/external/ehr/elation/subscription.d.ts +53 -0
  37. package/dist/interface/external/ehr/elation/subscription.d.ts.map +1 -0
  38. package/dist/interface/external/ehr/elation/subscription.js +22 -0
  39. package/dist/interface/external/ehr/elation/subscription.js.map +1 -0
  40. package/dist/interface/external/ehr/patient.d.ts +24 -24
  41. package/dist/medical/webhook/webhook-request.d.ts +72 -59
  42. package/dist/medical/webhook/webhook-request.d.ts.map +1 -1
  43. package/dist/medical/webhook/webhook-request.js +11 -2
  44. package/dist/medical/webhook/webhook-request.js.map +1 -1
  45. package/package.json +2 -2
  46. package/dist/common/titleCase.d.ts +0 -2
  47. package/dist/common/titleCase.d.ts.map +0 -1
  48. package/dist/common/titleCase.js +0 -10
  49. package/dist/common/titleCase.js.map +0 -1
  50. package/dist/domain/address/__tests__/normalize-zip.test.d.ts +0 -2
  51. package/dist/domain/address/__tests__/normalize-zip.test.d.ts.map +0 -1
  52. package/dist/domain/address/__tests__/normalize-zip.test.js +0 -83
  53. package/dist/domain/address/__tests__/normalize-zip.test.js.map +0 -1
  54. package/dist/interface/external/athenahealth/appointment.d.ts +0 -63
  55. package/dist/interface/external/athenahealth/appointment.d.ts.map +0 -1
  56. package/dist/interface/external/athenahealth/appointment.js +0 -18
  57. package/dist/interface/external/athenahealth/appointment.js.map +0 -1
  58. package/dist/interface/external/athenahealth/cx-mapping.d.ts +0 -10
  59. package/dist/interface/external/athenahealth/cx-mapping.d.ts.map +0 -1
  60. package/dist/interface/external/athenahealth/cx-mapping.js +0 -8
  61. package/dist/interface/external/athenahealth/cx-mapping.js.map +0 -1
  62. package/dist/interface/external/athenahealth/department.d.ts +0 -28
  63. package/dist/interface/external/athenahealth/department.d.ts.map +0 -1
  64. package/dist/interface/external/athenahealth/department.js +0 -11
  65. package/dist/interface/external/athenahealth/department.js.map +0 -1
  66. package/dist/interface/external/athenahealth/index.d.ts +0 -9
  67. package/dist/interface/external/athenahealth/index.d.ts.map +0 -1
  68. package/dist/interface/external/athenahealth/index.js +0 -25
  69. package/dist/interface/external/athenahealth/index.js.map +0 -1
  70. package/dist/interface/external/athenahealth/jwt-token.d.ts +0 -34
  71. package/dist/interface/external/athenahealth/jwt-token.d.ts.map +0 -1
  72. package/dist/interface/external/athenahealth/jwt-token.js +0 -18
  73. package/dist/interface/external/athenahealth/jwt-token.js.map +0 -1
  74. package/dist/interface/external/athenahealth/medication.d.ts +0 -50
  75. package/dist/interface/external/athenahealth/medication.d.ts.map +0 -1
  76. package/dist/interface/external/athenahealth/medication.js +0 -19
  77. package/dist/interface/external/athenahealth/medication.js.map +0 -1
  78. package/dist/interface/external/athenahealth/patient.d.ts +0 -44
  79. package/dist/interface/external/athenahealth/patient.d.ts.map +0 -1
  80. package/dist/interface/external/athenahealth/patient.js +0 -15
  81. package/dist/interface/external/athenahealth/patient.js.map +0 -1
  82. package/dist/interface/external/athenahealth/problem.d.ts +0 -27
  83. package/dist/interface/external/athenahealth/problem.d.ts.map +0 -1
  84. package/dist/interface/external/athenahealth/problem.js +0 -14
  85. package/dist/interface/external/athenahealth/problem.js.map +0 -1
  86. package/dist/interface/external/athenahealth/subscription.d.ts +0 -20
  87. package/dist/interface/external/athenahealth/subscription.d.ts.map +0 -1
  88. package/dist/interface/external/athenahealth/subscription.js +0 -11
  89. package/dist/interface/external/athenahealth/subscription.js.map +0 -1
  90. package/dist/interface/external/athenahealth/vitals.d.ts +0 -82
  91. package/dist/interface/external/athenahealth/vitals.d.ts.map +0 -1
  92. package/dist/interface/external/athenahealth/vitals.js +0 -15
  93. package/dist/interface/external/athenahealth/vitals.js.map +0 -1
  94. package/dist/interface/external/canvas/appointment.d.ts +0 -68
  95. package/dist/interface/external/canvas/appointment.d.ts.map +0 -1
  96. package/dist/interface/external/canvas/appointment.js +0 -15
  97. package/dist/interface/external/canvas/appointment.js.map +0 -1
  98. package/dist/interface/external/canvas/index.d.ts +0 -3
  99. package/dist/interface/external/canvas/index.d.ts.map +0 -1
  100. package/dist/interface/external/canvas/index.js +0 -19
  101. package/dist/interface/external/canvas/index.js.map +0 -1
  102. package/dist/interface/external/canvas/jwt-token.d.ts +0 -31
  103. package/dist/interface/external/canvas/jwt-token.d.ts.map +0 -1
  104. package/dist/interface/external/canvas/jwt-token.js +0 -17
  105. package/dist/interface/external/canvas/jwt-token.js.map +0 -1
  106. package/dist/interface/external/elation/appointment.d.ts +0 -68
  107. package/dist/interface/external/elation/appointment.d.ts.map +0 -1
  108. package/dist/interface/external/elation/appointment.js +0 -15
  109. package/dist/interface/external/elation/appointment.js.map +0 -1
  110. package/dist/interface/external/elation/index.d.ts +0 -4
  111. package/dist/interface/external/elation/index.d.ts.map +0 -1
  112. package/dist/interface/external/elation/index.js +0 -20
  113. package/dist/interface/external/elation/index.js.map +0 -1
  114. package/dist/interface/external/elation/jwt-token.d.ts +0 -20
  115. package/dist/interface/external/elation/jwt-token.d.ts.map +0 -1
  116. package/dist/interface/external/elation/jwt-token.js +0 -13
  117. package/dist/interface/external/elation/jwt-token.js.map +0 -1
  118. package/dist/interface/external/elation/patient.d.ts +0 -96
  119. package/dist/interface/external/elation/patient.d.ts.map +0 -1
  120. package/dist/interface/external/elation/patient.js +0 -33
  121. package/dist/interface/external/elation/patient.js.map +0 -1
  122. package/dist/interface/external/elation/subscription.d.ts +0 -2
  123. package/dist/interface/external/elation/subscription.d.ts.map +0 -1
  124. package/dist/interface/external/elation/subscription.js +0 -3
  125. package/dist/interface/external/elation/subscription.js.map +0 -1
  126. package/dist/interface/external/shared/ehr/patient.d.ts +0 -250
  127. package/dist/interface/external/shared/ehr/patient.d.ts.map +0 -1
  128. package/dist/interface/external/shared/ehr/patient.js +0 -35
  129. package/dist/interface/external/shared/ehr/patient.js.map +0 -1
@@ -44,13 +44,13 @@ export declare const dbPoolSettingsSchema: z.ZodObject<{
44
44
  acquire: z.ZodNumber;
45
45
  idle: z.ZodNumber;
46
46
  }, "strip", z.ZodTypeAny, {
47
- min: number;
48
47
  max: number;
48
+ min: number;
49
49
  acquire: number;
50
50
  idle: number;
51
51
  }, {
52
- min: number;
53
52
  max: number;
53
+ min: number;
54
54
  acquire: number;
55
55
  idle: number;
56
56
  }>;
@@ -0,0 +1,19 @@
1
+ import { z } from "zod";
2
+ export declare const updateJobSchema: z.ZodObject<{
3
+ status: z.ZodEnum<["waiting", "processing", "completed", "failed"]>;
4
+ total: z.ZodOptional<z.ZodNumber>;
5
+ failed: z.ZodOptional<z.ZodNumber>;
6
+ forceStatusUpdate: z.ZodOptional<z.ZodBoolean>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ status: "waiting" | "processing" | "completed" | "failed";
9
+ failed?: number | undefined;
10
+ total?: number | undefined;
11
+ forceStatusUpdate?: boolean | undefined;
12
+ }, {
13
+ status: "waiting" | "processing" | "completed" | "failed";
14
+ failed?: number | undefined;
15
+ total?: number | undefined;
16
+ forceStatusUpdate?: boolean | undefined;
17
+ }>;
18
+ export type UpdateJobSchema = z.infer<typeof updateJobSchema>;
19
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/domain/patient/patient-import/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4BxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;EAK1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateJobSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const types_1 = require("./types");
6
+ // TODO 2330 Review this as part of POST /internal/patient/bulk/coverage-assessment
7
+ // export const patientImportPatientSchema = z.object({
8
+ // dob: z.string().refine(normalizeDobSafe, { message: "Invalid dob" }),
9
+ // gender: z.string().refine(normalizeGenderSafe, { message: "Invalid gender" }),
10
+ // firstname: z.string().min(1, { message: "First name must be defined" }),
11
+ // lastname: z.string().min(1, { message: "Last name must be defined" }),
12
+ // zip: z.string().refine(normalizeZipCodeNewSafe, { message: "Invalid zip" }),
13
+ // city: z.string().min(1, { message: "City must be defined" }),
14
+ // state: z
15
+ // .string()
16
+ // .refine(normalizeUSStateForAddressSafe, { message: "Invalid state or territory" }),
17
+ // addressline1: z.string().min(1, { message: "Address line must be defined" }),
18
+ // addressline2: z.string().optional(),
19
+ // phone1: z.string().refine(isPhoneValid, { message: "Invalid phone" }).optional(),
20
+ // phone2: z.string().refine(isPhoneValid, { message: "Invalid phone" }).optional(),
21
+ // email1: z.string().refine(isEmailValid, { message: "Invalid email" }).optional(),
22
+ // email2: z.string().refine(isEmailValid, { message: "Invalid email" }).optional(),
23
+ // externalid: z.string().optional(),
24
+ // });
25
+ // export type PatientImportPatient = z.infer<typeof patientImportPatientSchema>;
26
+ // export const patientImportSchema = z.object({
27
+ // patients: patientImportPatientSchema.array(),
28
+ // });
29
+ exports.updateJobSchema = zod_1.z.object({
30
+ status: zod_1.z.enum(types_1.patientImportStatus),
31
+ total: zod_1.z.number().optional(),
32
+ failed: zod_1.z.number().optional(),
33
+ forceStatusUpdate: zod_1.z.boolean().optional(),
34
+ });
35
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../src/domain/patient/patient-import/schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,mCAA8C;AAE9C,mFAAmF;AACnF,uDAAuD;AACvD,0EAA0E;AAC1E,mFAAmF;AACnF,6EAA6E;AAC7E,2EAA2E;AAC3E,iFAAiF;AACjF,kEAAkE;AAClE,aAAa;AACb,gBAAgB;AAChB,0FAA0F;AAC1F,kFAAkF;AAClF,yCAAyC;AACzC,sFAAsF;AACtF,sFAAsF;AACtF,sFAAsF;AACtF,sFAAsF;AACtF,uCAAuC;AACvC,MAAM;AACN,iFAAiF;AAEjF,gDAAgD;AAChD,kDAAkD;AAClD,MAAM;AAEO,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,2BAAmB,CAAC;IACnC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,iBAAiB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC1C,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { PatientImportStatus } from "./types";
2
+ /**
3
+ * Validates that a new status is valid based on the current status.
4
+ *
5
+ * @param currentStatus - The current status of the patient import job.
6
+ * @param newStatus - The new status to validate.
7
+ * @returns The validated new status.
8
+ * @throws BadRequestError if the new status is not valid.
9
+ */
10
+ export declare function validateNewStatus(currentStatus: PatientImportStatus, newStatus: PatientImportStatus, dryRun?: boolean): PatientImportStatus;
11
+ //# sourceMappingURL=status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../../src/domain/patient/patient-import/status.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAM9C;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,mBAAmB,EAClC,SAAS,EAAE,mBAAmB,EAC9B,MAAM,CAAC,EAAE,OAAO,GACf,mBAAmB,CAkCrB"}
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateNewStatus = void 0;
4
+ const bad_request_1 = require("../../../error/bad-request");
5
+ // TODO 2330 Unit test this
6
+ // TODO 2330 Unit test this
7
+ // TODO 2330 Unit test this
8
+ /**
9
+ * Validates that a new status is valid based on the current status.
10
+ *
11
+ * @param currentStatus - The current status of the patient import job.
12
+ * @param newStatus - The new status to validate.
13
+ * @returns The validated new status.
14
+ * @throws BadRequestError if the new status is not valid.
15
+ */
16
+ function validateNewStatus(currentStatus, newStatus, dryRun) {
17
+ const validStatusForProcessing = ["waiting", "processing"];
18
+ switch (newStatus) {
19
+ case "waiting":
20
+ throw new bad_request_1.BadRequestError(`Waiting is not a valid status to update`);
21
+ case "processing":
22
+ if (!validStatusForProcessing.includes(currentStatus)) {
23
+ throw new bad_request_1.BadRequestError(`Import job is not in [${validStatusForProcessing.join(",")}], cannot update to processing`);
24
+ }
25
+ break;
26
+ case "completed":
27
+ if (dryRun && currentStatus === "processing") {
28
+ // When dry-run, we don't want to set the status to completed so (1) the cx can tell
29
+ // whether the patients were imported or not, and (2) we can dry-run a job before we
30
+ // actually import the patients
31
+ return "waiting";
32
+ }
33
+ if (currentStatus !== "processing") {
34
+ throw new bad_request_1.BadRequestError(`Import job is not processing, cannot update to completed`);
35
+ }
36
+ break;
37
+ case "failed":
38
+ if (currentStatus !== "processing") {
39
+ throw new bad_request_1.BadRequestError(`Import job is not processing, cannot update to failed`);
40
+ }
41
+ break;
42
+ default:
43
+ throw new bad_request_1.BadRequestError(`Invalid status ${newStatus}`);
44
+ }
45
+ return newStatus;
46
+ }
47
+ exports.validateNewStatus = validateNewStatus;
48
+ //# sourceMappingURL=status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/domain/patient/patient-import/status.ts"],"names":[],"mappings":";;;AAAA,4DAA6D;AAG7D,2BAA2B;AAC3B,2BAA2B;AAC3B,2BAA2B;AAE3B;;;;;;;GAOG;AACH,SAAgB,iBAAiB,CAC/B,aAAkC,EAClC,SAA8B,EAC9B,MAAgB;IAEhB,MAAM,wBAAwB,GAAG,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IAC3D,QAAQ,SAAS,EAAE;QACjB,KAAK,SAAS;YACZ,MAAM,IAAI,6BAAe,CAAC,yCAAyC,CAAC,CAAC;QACvE,KAAK,YAAY;YACf,IAAI,CAAC,wBAAwB,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE;gBACrD,MAAM,IAAI,6BAAe,CACvB,yBAAyB,wBAAwB,CAAC,IAAI,CACpD,GAAG,CACJ,gCAAgC,CAClC,CAAC;aACH;YACD,MAAM;QACR,KAAK,WAAW;YACd,IAAI,MAAM,IAAI,aAAa,KAAK,YAAY,EAAE;gBAC5C,oFAAoF;gBACpF,oFAAoF;gBACpF,+BAA+B;gBAC/B,OAAO,SAAS,CAAC;aAClB;YACD,IAAI,aAAa,KAAK,YAAY,EAAE;gBAClC,MAAM,IAAI,6BAAe,CAAC,0DAA0D,CAAC,CAAC;aACvF;YACD,MAAM;QACR,KAAK,QAAQ;YACX,IAAI,aAAa,KAAK,YAAY,EAAE;gBAClC,MAAM,IAAI,6BAAe,CAAC,uDAAuD,CAAC,CAAC;aACpF;YACD,MAAM;QACR;YACE,MAAM,IAAI,6BAAe,CAAC,kBAAkB,SAAS,EAAE,CAAC,CAAC;KAC5D;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAtCD,8CAsCC"}
@@ -0,0 +1,48 @@
1
+ export declare const patientImportStatus: readonly ["waiting", "processing", "completed", "failed"];
2
+ export type PatientImportStatus = (typeof patientImportStatus)[number];
3
+ export type GetPatientImport = {
4
+ id: string;
5
+ cxId: string;
6
+ };
7
+ export type PatientImportParamsCx = {
8
+ dryRun: boolean;
9
+ };
10
+ export type PatientImportParamsOps = {
11
+ dryRun: boolean;
12
+ rerunPdOnNewDemographics: boolean;
13
+ triggerConsolidated: boolean;
14
+ disableWebhooks: boolean;
15
+ };
16
+ export type PatientImport = {
17
+ id: string;
18
+ cxId: string;
19
+ facilityId: string;
20
+ status: PatientImportStatus;
21
+ reason: string | undefined;
22
+ /** When the job was created, when the jobId was generated. */
23
+ createdAt: Date;
24
+ /** When the job was actually started, after parsing and patient creates started to be sent to the queue for processing. */
25
+ startedAt: Date | undefined;
26
+ /** When the job was finished, when the last data pipeline of the last patient was completed. */
27
+ finishedAt: Date | undefined;
28
+ total: number | undefined;
29
+ successful: number | undefined;
30
+ failed: number | undefined;
31
+ paramsCx: PatientImportParamsCx;
32
+ paramsOps: PatientImportParamsOps;
33
+ };
34
+ export type PatientImportEntryStatusFailed = "failed";
35
+ export type PatientImportEntryStatusParsed = "waiting" | "processing" | "successful";
36
+ export type PatientImportEntryStatus = PatientImportEntryStatusFailed | PatientImportEntryStatusParsed;
37
+ declare const isDevKey = "isDev";
38
+ /**
39
+ * Used to store metadata on the upload URL.
40
+ */
41
+ export type PatientImportUploadMetadata = {
42
+ [isDevKey]?: boolean;
43
+ };
44
+ export declare function metaToRecord(metadata: PatientImportUploadMetadata): Record<keyof PatientImportUploadMetadata, string>;
45
+ export declare function recordToMeta(record: Record<string, string>): PatientImportUploadMetadata;
46
+ export declare function isPatientImportRunningOnDev(metadata: PatientImportUploadMetadata | undefined): boolean;
47
+ export {};
48
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/domain/patient/patient-import/types.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,mBAAmB,2DAA4D,CAAC;AAQ7F,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,wBAAwB,EAAE,OA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SAAS,GAChD,OAAO,CAGT"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isPatientImportRunningOnDev = exports.recordToMeta = exports.metaToRecord = exports.patientImportStatus = void 0;
4
+ // TODO 2330 add expired
5
+ exports.patientImportStatus = ["waiting", "processing", "completed", "failed"];
6
+ const isDevKey = "isDev";
7
+ function metaToRecord(metadata) {
8
+ return {
9
+ [isDevKey]: metadata[isDevKey] ? "true" : "false",
10
+ };
11
+ }
12
+ exports.metaToRecord = metaToRecord;
13
+ function recordToMeta(record) {
14
+ return {
15
+ ...(record[isDevKey] ? { [isDevKey]: record[isDevKey] === "true" } : {}),
16
+ };
17
+ }
18
+ exports.recordToMeta = recordToMeta;
19
+ function isPatientImportRunningOnDev(metadata) {
20
+ const isDevProp = metadata?.[isDevKey];
21
+ return isDevProp ? [true, "true"].includes(isDevProp) : false;
22
+ }
23
+ exports.isPatientImportRunningOnDev = isPatientImportRunningOnDev;
24
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/domain/patient/patient-import/types.ts"],"names":[],"mappings":";;;AAAA,wBAAwB;AACX,QAAA,mBAAmB,GAAG,CAAC,SAAS,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAmD7F,MAAM,QAAQ,GAAG,OAAO,CAAC;AASzB,SAAgB,YAAY,CAC1B,QAAqC;IAErC,OAAO;QACL,CAAC,QAAQ,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;KAClD,CAAC;AACJ,CAAC;AAND,oCAMC;AAED,SAAgB,YAAY,CAAC,MAA8B;IACzD,OAAO;QACL,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,KAAK,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACzE,CAAC;AACJ,CAAC;AAJD,oCAIC;AAED,SAAgB,2BAA2B,CACzC,QAAiD;IAEjD,MAAM,SAAS,GAAG,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC;IACvC,OAAO,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;AAChE,CAAC;AALD,kEAKC"}
@@ -15,13 +15,13 @@ export declare const patientImportPatientSchema: z.ZodObject<{
15
15
  email2: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
16
16
  externalid: z.ZodOptional<z.ZodString>;
17
17
  }, "strip", z.ZodTypeAny, {
18
- state: string;
19
18
  dob: string;
20
19
  gender: string;
21
20
  firstname: string;
22
21
  lastname: string;
23
22
  zip: string;
24
23
  city: string;
24
+ state: string;
25
25
  addressline1: string;
26
26
  addressline2?: string | undefined;
27
27
  phone1?: string | undefined;
@@ -30,13 +30,13 @@ export declare const patientImportPatientSchema: z.ZodObject<{
30
30
  email2?: string | undefined;
31
31
  externalid?: string | undefined;
32
32
  }, {
33
- state: string;
34
33
  dob: string;
35
34
  gender: string;
36
35
  firstname: string;
37
36
  lastname: string;
38
37
  zip: string;
39
38
  city: string;
39
+ state: string;
40
40
  addressline1: string;
41
41
  addressline2?: string | undefined;
42
42
  phone1?: string | undefined;
@@ -63,13 +63,13 @@ export declare const patientImportSchema: z.ZodObject<{
63
63
  email2: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
64
64
  externalid: z.ZodOptional<z.ZodString>;
65
65
  }, "strip", z.ZodTypeAny, {
66
- state: string;
67
66
  dob: string;
68
67
  gender: string;
69
68
  firstname: string;
70
69
  lastname: string;
71
70
  zip: string;
72
71
  city: string;
72
+ state: string;
73
73
  addressline1: string;
74
74
  addressline2?: string | undefined;
75
75
  phone1?: string | undefined;
@@ -78,13 +78,13 @@ export declare const patientImportSchema: z.ZodObject<{
78
78
  email2?: string | undefined;
79
79
  externalid?: string | undefined;
80
80
  }, {
81
- state: string;
82
81
  dob: string;
83
82
  gender: string;
84
83
  firstname: string;
85
84
  lastname: string;
86
85
  zip: string;
87
86
  city: string;
87
+ state: string;
88
88
  addressline1: string;
89
89
  addressline2?: string | undefined;
90
90
  phone1?: string | undefined;
@@ -95,13 +95,13 @@ export declare const patientImportSchema: z.ZodObject<{
95
95
  }>, "many">;
96
96
  }, "strip", z.ZodTypeAny, {
97
97
  patients: {
98
- state: string;
99
98
  dob: string;
100
99
  gender: string;
101
100
  firstname: string;
102
101
  lastname: string;
103
102
  zip: string;
104
103
  city: string;
104
+ state: string;
105
105
  addressline1: string;
106
106
  addressline2?: string | undefined;
107
107
  phone1?: string | undefined;
@@ -112,13 +112,13 @@ export declare const patientImportSchema: z.ZodObject<{
112
112
  }[];
113
113
  }, {
114
114
  patients: {
115
- state: string;
116
115
  dob: string;
117
116
  gender: string;
118
117
  firstname: string;
119
118
  lastname: string;
120
119
  zip: string;
121
120
  city: string;
121
+ state: string;
122
122
  addressline1: string;
123
123
  addressline2?: string | undefined;
124
124
  phone1?: string | undefined;
package/dist/index.d.ts CHANGED
@@ -15,26 +15,26 @@ export * from "./common/string";
15
15
  export { toTitleCase } from "./common/title-case";
16
16
  export { AtLeastOne, stringToBoolean } from "./common/types";
17
17
  export { validateNPI } from "./common/validate-npi";
18
- export * from "./domain/address/index";
18
+ export * from "./domain/address/city";
19
19
  export * from "./domain/address/country";
20
+ export * from "./domain/address/index";
20
21
  export * from "./domain/address/state";
21
22
  export * from "./domain/address/territory";
22
23
  export * from "./domain/address/zip";
23
- export * from "./domain/address/city";
24
24
  export * from "./domain/contact/email";
25
25
  export * from "./domain/contact/phone";
26
+ export * from "./domain/db";
26
27
  export * from "./domain/dob";
27
28
  export * from "./domain/externalId";
28
29
  export * from "./domain/gender";
30
+ export * from "./domain/jwt-token";
29
31
  export { metriportCompanyDetails } from "./domain/metriport";
30
32
  export * from "./domain/patient/patient";
31
- export * from "./domain/patient/patient-import";
32
- export * from "./domain/secrets";
33
+ export * from "./domain/patient/patient-import/schemas";
33
34
  export * from "./domain/rate-limiting";
34
- export * from "./domain/jwt-token";
35
- export * from "./domain/db";
35
+ export * from "./domain/secrets";
36
36
  export { BadRequestError } from "./error/bad-request";
37
- export { MetriportError, AdditionalInfo } from "./error/metriport-error";
37
+ export { AdditionalInfo, MetriportError } from "./error/metriport-error";
38
38
  export { NotFoundError } from "./error/not-found";
39
39
  export { errorToString } from "./error/shared";
40
40
  export { TooManyRequestsError } from "./error/too-many-requests";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,4BAA4B,EAAE,MAAM,gBAAgB,CAAC;AAC9D,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,g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AM,yBAAyB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,cAAc,aAAa,CAAC;AAC5B,OAAO,KAAK,OAAO,MAAM,WAAW,CAAC;AACrC,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -60,25 +60,25 @@ var types_1 = require("./common/types");
60
60
  Object.defineProperty(exports, "stringToBoolean", { enumerable: true, get: function () { return types_1.stringToBoolean; } });
61
61
  var validate_npi_1 = require("./common/validate-npi");
62
62
  Object.defineProperty(exports, "validateNPI", { enumerable: true, get: function () { return validate_npi_1.validateNPI; } });
63
- __exportStar(require("./domain/address/index"), exports);
63
+ __exportStar(require("./domain/address/city"), exports);
64
64
  __exportStar(require("./domain/address/country"), exports);
65
+ __exportStar(require("./domain/address/index"), exports);
65
66
  __exportStar(require("./domain/address/state"), exports);
66
67
  __exportStar(require("./domain/address/territory"), exports);
67
68
  __exportStar(require("./domain/address/zip"), exports);
68
- __exportStar(require("./domain/address/city"), exports);
69
69
  __exportStar(require("./domain/contact/email"), exports);
70
70
  __exportStar(require("./domain/contact/phone"), exports);
71
+ __exportStar(require("./domain/db"), exports);
71
72
  __exportStar(require("./domain/dob"), exports);
72
73
  __exportStar(require("./domain/externalId"), exports);
73
74
  __exportStar(require("./domain/gender"), exports);
75
+ __exportStar(require("./domain/jwt-token"), exports);
74
76
  var metriport_1 = require("./domain/metriport");
75
77
  Object.defineProperty(exports, "metriportCompanyDetails", { enumerable: true, get: function () { return metriport_1.metriportCompanyDetails; } });
76
78
  __exportStar(require("./domain/patient/patient"), exports);
77
- __exportStar(require("./domain/patient/patient-import"), exports);
78
- __exportStar(require("./domain/secrets"), exports);
79
+ __exportStar(require("./domain/patient/patient-import/schemas"), exports);
79
80
  __exportStar(require("./domain/rate-limiting"), exports);
80
- __exportStar(require("./domain/jwt-token"), exports);
81
- __exportStar(require("./domain/db"), exports);
81
+ __exportStar(require("./domain/secrets"), exports);
82
82
  var bad_request_1 = require("./error/bad-request");
83
83
  Object.defineProperty(exports, "BadRequestError", { enumerable: true, get: function () { return bad_request_1.BadRequestError; } });
84
84
  var metriport_error_1 = require("./error/metriport-error");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,wCAAyC;AAAhC,gGAAA,OAAO,OAAA;AAChB,4CAA0C;AAAjC,iGAAA,MAAM,OAAA;AACf,sCAAwF;AAA/E,kGAAA,UAAU,OAAA;AAAE,0GAAA,kBAAkB,OAAA;AAAE,+GAAA,uBAAuB,OAAA;AAChE,wCAA8D;AAArD,qHAAA,4BAA4B,OAAA;AACrC,mDAAiC;AACjC,4CAAiD;AAAxC,wGAAA,aAAa,OAAA;AACtB,0EAAwE;AAA/D,+HAAA,qBAAqB,OAAA;AAC9B,oCAA0C;AAAjC,iGAAA,UAAU,OAAA;AACnB,wDAAsD;AAA7C,6GAAA,YAAY,OAAA;AACrB,0DAAuD;AAA9C,8GAAA,YAAY,OAAA;AACrB,iDAA+B;AAC/B,wCAAoD;AAA3C,8FAAA,KAAK,OAAA;AAAE,oGAAA,WAAW,OAAA;AAC3B,kDAAgC;AAChC,kDAAkD;AAAzC,yGAAA,WAAW,OAAA;AACpB,wCAA6D;AAAxC,wGAAA,eAAe,OAAA;AACpC,sDAAoD;AAA3C,2GAAA,WAAW,OAAA;AACpB,yDAAuC;AACvC,2DAAyC;AACzC,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,wDAAsC;AACtC,yDAAuC;AACvC,yDAAuC;AACvC,+CAA6B;AAC7B,sDAAoC;AACpC,kDAAgC;AAChC,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yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,yDAAuC;AACvC,yDAAuC;AACvC,8CAA4B;AAC5B,+CAA6B;AAC7B,sDAAoC;AACpC,kDAAgC;AAChC,qDAAmC;AACnC,gDAA6D;AAApD,oHAAA,uBAAuB,OAAA;AAChC,2DAAyC;AACzC,0EAAwD;AACxD,yDAAuC;AACvC,mDAAiC;AACjC,mDAAsD;AAA7C,8GAAA,eAAe,OAAA;AACxB,2DAAyE;AAAhD,iHAAA,cAAc,OAAA;AACvC,+CAAkD;AAAzC,0GAAA,aAAa,OAAA;AACtB,yCAA+C;AAAtC,uGAAA,aAAa,OAAA;AACtB,+DAAiE;AAAxD,yHAAA,oBAAoB,OAAA;AAC7B,8CAA4B;AAC5B,qDAAqC;AACrC,8CAA4B;AAC5B,8CAA4B;AAC5B,4CAA0B"}
@@ -0,0 +1,43 @@
1
+ import { z } from "zod";
2
+ export declare const elationSecondaryMappingsSchema: z.ZodObject<{
3
+ webhooks: z.ZodOptional<z.ZodRecord<z.ZodEnum<["appointments", "patients"]>, z.ZodObject<{
4
+ url: z.ZodString;
5
+ signingKey: z.ZodString;
6
+ }, "strip", z.ZodTypeAny, {
7
+ url: string;
8
+ signingKey: string;
9
+ }, {
10
+ url: string;
11
+ signingKey: string;
12
+ }>>>;
13
+ webhookPatientPatientLinkingDisabled: z.ZodOptional<z.ZodBoolean>;
14
+ webhookPatientPatientProcessingEnabled: z.ZodOptional<z.ZodBoolean>;
15
+ webhookAppointmentPatientLinkingDisabled: z.ZodOptional<z.ZodBoolean>;
16
+ webhookAppointmentPatientProcessingDisabled: z.ZodOptional<z.ZodBoolean>;
17
+ backgroundAppointmentPatientLinkingDisabled: z.ZodOptional<z.ZodBoolean>;
18
+ backgroundAppointmentPatientProcessingDisabled: z.ZodOptional<z.ZodBoolean>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ webhooks?: Partial<Record<"patients" | "appointments", {
21
+ url: string;
22
+ signingKey: string;
23
+ }>> | undefined;
24
+ webhookPatientPatientLinkingDisabled?: boolean | undefined;
25
+ webhookPatientPatientProcessingEnabled?: boolean | undefined;
26
+ webhookAppointmentPatientLinkingDisabled?: boolean | undefined;
27
+ webhookAppointmentPatientProcessingDisabled?: boolean | undefined;
28
+ backgroundAppointmentPatientLinkingDisabled?: boolean | undefined;
29
+ backgroundAppointmentPatientProcessingDisabled?: boolean | undefined;
30
+ }, {
31
+ webhooks?: Partial<Record<"patients" | "appointments", {
32
+ url: string;
33
+ signingKey: string;
34
+ }>> | undefined;
35
+ webhookPatientPatientLinkingDisabled?: boolean | undefined;
36
+ webhookPatientPatientProcessingEnabled?: boolean | undefined;
37
+ webhookAppointmentPatientLinkingDisabled?: boolean | undefined;
38
+ webhookAppointmentPatientProcessingDisabled?: boolean | undefined;
39
+ backgroundAppointmentPatientLinkingDisabled?: boolean | undefined;
40
+ backgroundAppointmentPatientProcessingDisabled?: boolean | undefined;
41
+ }>;
42
+ export type ElationSecondaryMappings = z.infer<typeof elationSecondaryMappingsSchema>;
43
+ //# sourceMappingURL=cx-mapping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cx-mapping.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/elation/cx-mapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQzC,CAAC;AACH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.elationSecondaryMappingsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const subscription_1 = require("./subscription");
6
+ const webhookSchema = zod_1.z.object({
7
+ url: zod_1.z.string(),
8
+ signingKey: zod_1.z.string(),
9
+ });
10
+ exports.elationSecondaryMappingsSchema = zod_1.z.object({
11
+ webhooks: zod_1.z.record(zod_1.z.enum(subscription_1.subscriptionResources), webhookSchema).optional(),
12
+ webhookPatientPatientLinkingDisabled: zod_1.z.boolean().optional(),
13
+ webhookPatientPatientProcessingEnabled: zod_1.z.boolean().optional(),
14
+ webhookAppointmentPatientLinkingDisabled: zod_1.z.boolean().optional(),
15
+ webhookAppointmentPatientProcessingDisabled: zod_1.z.boolean().optional(),
16
+ backgroundAppointmentPatientLinkingDisabled: zod_1.z.boolean().optional(),
17
+ backgroundAppointmentPatientProcessingDisabled: zod_1.z.boolean().optional(),
18
+ });
19
+ //# sourceMappingURL=cx-mapping.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cx-mapping.js","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/elation/cx-mapping.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,iDAAuD;AAEvD,MAAM,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7B,GAAG,EAAE,OAAC,CAAC,MAAM,EAAE;IACf,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,IAAI,CAAC,oCAAqB,CAAC,EAAE,aAAa,CAAC,CAAC,QAAQ,EAAE;IAC3E,oCAAoC,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC5D,sCAAsC,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAC9D,wCAAwC,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChE,2CAA2C,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnE,2CAA2C,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACnE,8CAA8C,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CACvE,CAAC,CAAC"}
@@ -0,0 +1,106 @@
1
+ import { z } from "zod";
2
+ export declare const elationAppointmentEventSchema: z.ZodObject<{
3
+ event_id: z.ZodString;
4
+ application_id: z.ZodString;
5
+ resource: z.ZodLiteral<"appointments">;
6
+ action: z.ZodEnum<["saved", "deleted"]>;
7
+ data: z.ZodObject<{
8
+ id: z.ZodString;
9
+ patient: z.ZodString;
10
+ created_date: z.ZodString;
11
+ last_modified_date: z.ZodString;
12
+ status: z.ZodObject<{
13
+ status: z.ZodString;
14
+ }, "strip", z.ZodTypeAny, {
15
+ status: string;
16
+ }, {
17
+ status: string;
18
+ }>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ status: {
21
+ status: string;
22
+ };
23
+ id: string;
24
+ patient: string;
25
+ created_date: string;
26
+ last_modified_date: string;
27
+ }, {
28
+ status: {
29
+ status: string;
30
+ };
31
+ id: string;
32
+ patient: string;
33
+ created_date: string;
34
+ last_modified_date: string;
35
+ }>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ data: {
38
+ status: {
39
+ status: string;
40
+ };
41
+ id: string;
42
+ patient: string;
43
+ created_date: string;
44
+ last_modified_date: string;
45
+ };
46
+ resource: "appointments";
47
+ event_id: string;
48
+ application_id: string;
49
+ action: "saved" | "deleted";
50
+ }, {
51
+ data: {
52
+ status: {
53
+ status: string;
54
+ };
55
+ id: string;
56
+ patient: string;
57
+ created_date: string;
58
+ last_modified_date: string;
59
+ };
60
+ resource: "appointments";
61
+ event_id: string;
62
+ application_id: string;
63
+ action: "saved" | "deleted";
64
+ }>;
65
+ export type ElationAppointmentEvent = z.infer<typeof elationAppointmentEventSchema>;
66
+ export declare const elationPatientEventSchema: z.ZodObject<{
67
+ event_id: z.ZodString;
68
+ application_id: z.ZodString;
69
+ resource: z.ZodLiteral<"patients">;
70
+ action: z.ZodEnum<["saved", "deleted"]>;
71
+ data: z.ZodObject<{
72
+ id: z.ZodString;
73
+ created_date: z.ZodString;
74
+ last_modified: z.ZodString;
75
+ }, "strip", z.ZodTypeAny, {
76
+ id: string;
77
+ created_date: string;
78
+ last_modified: string;
79
+ }, {
80
+ id: string;
81
+ created_date: string;
82
+ last_modified: string;
83
+ }>;
84
+ }, "strip", z.ZodTypeAny, {
85
+ data: {
86
+ id: string;
87
+ created_date: string;
88
+ last_modified: string;
89
+ };
90
+ resource: "patients";
91
+ event_id: string;
92
+ application_id: string;
93
+ action: "saved" | "deleted";
94
+ }, {
95
+ data: {
96
+ id: string;
97
+ created_date: string;
98
+ last_modified: string;
99
+ };
100
+ resource: "patients";
101
+ event_id: string;
102
+ application_id: string;
103
+ action: "saved" | "deleted";
104
+ }>;
105
+ export type ElationPatientEvent = z.infer<typeof elationPatientEventSchema>;
106
+ //# sourceMappingURL=event.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/elation/event.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAcxC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEpF,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUpC,CAAC;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.elationPatientEventSchema = exports.elationAppointmentEventSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.elationAppointmentEventSchema = zod_1.z.object({
6
+ event_id: zod_1.z.coerce.string(),
7
+ application_id: zod_1.z.string(),
8
+ resource: zod_1.z.literal("appointments"),
9
+ action: zod_1.z.enum(["saved", "deleted"]),
10
+ data: zod_1.z.object({
11
+ id: zod_1.z.coerce.string(),
12
+ patient: zod_1.z.coerce.string(),
13
+ created_date: zod_1.z.string(),
14
+ last_modified_date: zod_1.z.string(),
15
+ status: zod_1.z.object({
16
+ status: zod_1.z.string(),
17
+ }),
18
+ }),
19
+ });
20
+ exports.elationPatientEventSchema = zod_1.z.object({
21
+ event_id: zod_1.z.coerce.string(),
22
+ application_id: zod_1.z.string(),
23
+ resource: zod_1.z.literal("patients"),
24
+ action: zod_1.z.enum(["saved", "deleted"]),
25
+ data: zod_1.z.object({
26
+ id: zod_1.z.coerce.string(),
27
+ created_date: zod_1.z.string(),
28
+ last_modified: zod_1.z.string(),
29
+ }),
30
+ });
31
+ //# sourceMappingURL=event.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"event.js","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/elation/event.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE;IAC3B,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,QAAQ,EAAE,OAAC,CAAC,OAAO,CAAC,cAAc,CAAC;IACnC,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACpC,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC;QACb,EAAE,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE;QACrB,OAAO,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE;QAC1B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;QACxB,kBAAkB,EAAE,OAAC,CAAC,MAAM,EAAE;QAC9B,MAAM,EAAE,OAAC,CAAC,MAAM,CAAC;YACf,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE;SACnB,CAAC;KACH,CAAC;CACH,CAAC,CAAC;AAGU,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE;IAC3B,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;IAC1B,QAAQ,EAAE,OAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IAC/B,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IACpC,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC;QACb,EAAE,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE;QACrB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE;QACxB,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE;KAC1B,CAAC;CACH,CAAC,CAAC"}
@@ -2,4 +2,5 @@ export * from "./appointment";
2
2
  export * from "./patient";
3
3
  export * from "./jwt-token";
4
4
  export * from "./problem";
5
+ export * from "./subscription";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/elation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/interface/external/ehr/elation/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}