@metriport/shared 0.26.11 → 0.27.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 (128) hide show
  1. package/dist/common/merge-settings.d.ts +21 -0
  2. package/dist/common/merge-settings.d.ts.map +1 -0
  3. package/dist/common/merge-settings.js +29 -0
  4. package/dist/common/merge-settings.js.map +1 -0
  5. package/dist/core/src/domain/document-query.d.ts +25 -0
  6. package/dist/core/src/domain/document-query.d.ts.map +1 -0
  7. package/dist/core/src/domain/document-query.js +27 -0
  8. package/dist/core/src/domain/document-query.js.map +1 -0
  9. package/dist/domain/baseDto.d.ts +9 -0
  10. package/dist/domain/baseDto.d.ts.map +1 -0
  11. package/dist/domain/baseDto.js +11 -0
  12. package/dist/domain/baseDto.js.map +1 -0
  13. package/dist/domain/cohort.d.ts +85 -123
  14. package/dist/domain/cohort.d.ts.map +1 -1
  15. package/dist/domain/cohort.js +62 -34
  16. package/dist/domain/cohort.js.map +1 -1
  17. package/dist/domain/job/types.d.ts +1 -1
  18. package/dist/domain/job/types.d.ts.map +1 -1
  19. package/dist/domain/network/network-query.d.ts +30 -0
  20. package/dist/domain/network/network-query.d.ts.map +1 -0
  21. package/dist/domain/network/network-query.js +8 -0
  22. package/dist/domain/network/network-query.js.map +1 -0
  23. package/dist/domain/network-query/network-query.d.ts +31 -0
  24. package/dist/domain/network-query/network-query.d.ts.map +1 -0
  25. package/dist/domain/network-query/network-query.js +9 -0
  26. package/dist/domain/network-query/network-query.js.map +1 -0
  27. package/dist/domain/network-query/source.d.ts +31 -0
  28. package/dist/domain/network-query/source.d.ts.map +1 -0
  29. package/dist/domain/network-query/source.js +9 -0
  30. package/dist/domain/network-query/source.js.map +1 -0
  31. package/dist/domain/network-qyert/network-query.d.ts +31 -0
  32. package/dist/domain/network-qyert/network-query.d.ts.map +1 -0
  33. package/dist/domain/network-qyert/network-query.js +9 -0
  34. package/dist/domain/network-qyert/network-query.js.map +1 -0
  35. package/dist/domain/patient/patient-monitoring/__tests__/utils.test.js +1 -1
  36. package/dist/domain/patient/patient-monitoring/__tests__/utils.test.js.map +1 -1
  37. package/dist/domain/patient/patient-monitoring/discharge-requery.d.ts +58 -1
  38. package/dist/domain/patient/patient-monitoring/discharge-requery.d.ts.map +1 -1
  39. package/dist/domain/patient/patient-monitoring/discharge-requery.js +8 -1
  40. package/dist/domain/patient/patient-monitoring/discharge-requery.js.map +1 -1
  41. package/dist/domain/patient/patient-monitoring/utils.d.ts +1 -1
  42. package/dist/domain/patient/patient-monitoring/utils.d.ts.map +1 -1
  43. package/dist/domain/patient/patient-monitoring/utils.js +3 -3
  44. package/dist/domain/patient/patient-monitoring/utils.js.map +1 -1
  45. package/dist/domain/patient-cohort.d.ts +1 -34
  46. package/dist/domain/patient-cohort.d.ts.map +1 -1
  47. package/dist/domain/patient-cohort.js +0 -9
  48. package/dist/domain/patient-cohort.js.map +1 -1
  49. package/dist/domain/patient-or-all.d.ts +16 -0
  50. package/dist/domain/patient-or-all.d.ts.map +1 -0
  51. package/dist/domain/patient-or-all.js +11 -0
  52. package/dist/domain/patient-or-all.js.map +1 -0
  53. package/dist/domain/roster/patient-roster.d.ts +27 -0
  54. package/dist/domain/roster/patient-roster.d.ts.map +1 -0
  55. package/dist/domain/roster/patient-roster.js +3 -0
  56. package/dist/domain/roster/patient-roster.js.map +1 -0
  57. package/dist/domain/roster/roster-status.d.ts +16 -0
  58. package/dist/domain/roster/roster-status.d.ts.map +1 -0
  59. package/dist/domain/roster/roster-status.js +46 -0
  60. package/dist/domain/roster/roster-status.js.map +1 -0
  61. package/dist/domain/roster/roster.d.ts +32 -0
  62. package/dist/domain/roster/roster.d.ts.map +1 -0
  63. package/dist/domain/roster/roster.js +3 -0
  64. package/dist/domain/roster/roster.js.map +1 -0
  65. package/dist/domain/tcm-encounter.d.ts +6 -6
  66. package/dist/index.d.ts +1 -0
  67. package/dist/index.d.ts.map +1 -1
  68. package/dist/index.js +1 -0
  69. package/dist/index.js.map +1 -1
  70. package/dist/interface/external/ehr/athenahealth/cx-mapping.d.ts +14 -0
  71. package/dist/interface/external/ehr/athenahealth/cx-mapping.d.ts.map +1 -1
  72. package/dist/interface/external/ehr/canvas/cx-mapping.d.ts +14 -0
  73. package/dist/interface/external/ehr/canvas/cx-mapping.d.ts.map +1 -1
  74. package/dist/interface/external/ehr/elation/cx-mapping.d.ts +14 -0
  75. package/dist/interface/external/ehr/elation/cx-mapping.d.ts.map +1 -1
  76. package/dist/interface/external/ehr/healthie/cx-mapping.d.ts +14 -0
  77. package/dist/interface/external/ehr/healthie/cx-mapping.d.ts.map +1 -1
  78. package/dist/interface/external/ehr/shared.d.ts +24 -0
  79. package/dist/interface/external/ehr/shared.d.ts.map +1 -1
  80. package/dist/interface/external/ehr/shared.js +2 -0
  81. package/dist/interface/external/ehr/shared.js.map +1 -1
  82. package/dist/interface/external/quest/fhir.d.ts +22 -0
  83. package/dist/interface/external/quest/fhir.d.ts.map +1 -0
  84. package/dist/interface/external/quest/fhir.js +9 -0
  85. package/dist/interface/external/quest/fhir.js.map +1 -0
  86. package/dist/interface/external/quest/file.d.ts +15 -0
  87. package/dist/interface/external/quest/file.d.ts.map +1 -0
  88. package/dist/interface/external/quest/file.js +3 -0
  89. package/dist/interface/external/quest/file.js.map +1 -0
  90. package/dist/interface/external/quest/roster.d.ts +167 -0
  91. package/dist/interface/external/quest/roster.d.ts.map +1 -0
  92. package/dist/interface/external/quest/roster.js +40 -0
  93. package/dist/interface/external/quest/roster.js.map +1 -0
  94. package/dist/interface/external/surescripts/roster.d.ts +12 -0
  95. package/dist/interface/external/surescripts/roster.d.ts.map +1 -0
  96. package/dist/interface/external/surescripts/roster.js +29 -0
  97. package/dist/interface/external/surescripts/roster.js.map +1 -0
  98. package/dist/interface/external/surescripts/source.d.ts +2 -0
  99. package/dist/interface/external/surescripts/source.d.ts.map +1 -0
  100. package/dist/interface/external/surescripts/source.js +5 -0
  101. package/dist/interface/external/surescripts/source.js.map +1 -0
  102. package/dist/medical/fhir/constants.d.ts +4 -0
  103. package/dist/medical/fhir/constants.d.ts.map +1 -1
  104. package/dist/medical/fhir/constants.js +17 -1
  105. package/dist/medical/fhir/constants.js.map +1 -1
  106. package/dist/net/__tests__/retry.test.js +2 -2
  107. package/dist/net/__tests__/retry.test.js.map +1 -1
  108. package/dist/net/error.d.ts +5 -3
  109. package/dist/net/error.d.ts.map +1 -1
  110. package/dist/net/error.js +12 -2
  111. package/dist/net/error.js.map +1 -1
  112. package/dist/net/retry.d.ts +1 -1
  113. package/dist/net/retry.d.ts.map +1 -1
  114. package/dist/net/retry.js +9 -33
  115. package/dist/net/retry.js.map +1 -1
  116. package/dist/shared/src/domain/network/network-query.d.ts +30 -0
  117. package/dist/shared/src/domain/network/network-query.d.ts.map +1 -0
  118. package/dist/shared/src/domain/network/network-query.js +8 -0
  119. package/dist/shared/src/domain/network/network-query.js.map +1 -0
  120. package/dist/shared/src/domain/network-query/network-query.d.ts +30 -0
  121. package/dist/shared/src/domain/network-query/network-query.d.ts.map +1 -0
  122. package/dist/shared/src/domain/network-query/network-query.js +8 -0
  123. package/dist/shared/src/domain/network-query/network-query.js.map +1 -0
  124. package/dist/shared/src/domain/network-qyert/network-query.d.ts +30 -0
  125. package/dist/shared/src/domain/network-qyert/network-query.d.ts.map +1 -0
  126. package/dist/shared/src/domain/network-qyert/network-query.js +8 -0
  127. package/dist/shared/src/domain/network-qyert/network-query.js.map +1 -0
  128. package/package.json +2 -2
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.networkSources = exports.laboratorySource = exports.pharmacySource = exports.hieSource = exports.sourceQueryStatus = void 0;
4
+ exports.sourceQueryStatus = ["processing", "completed", "failed"];
5
+ exports.hieSource = "hie";
6
+ exports.pharmacySource = "pharmacy";
7
+ exports.laboratorySource = "laboratory";
8
+ exports.networkSources = [exports.hieSource, exports.pharmacySource, exports.laboratorySource];
9
+ //# sourceMappingURL=network-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-query.js","sourceRoot":"","sources":["../../../src/domain/network-query/network-query.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAcnE,QAAA,SAAS,GAAG,KAAK,CAAC;AAClB,QAAA,cAAc,GAAG,UAAU,CAAC;AAC5B,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAChC,QAAA,cAAc,GAAG,CAAC,iBAAS,EAAE,sBAAc,EAAE,wBAAgB,CAAU,CAAC"}
@@ -0,0 +1,31 @@
1
+ export declare const sourceQueryStatus: readonly ["processing", "completed", "failed"];
2
+ export type SourceQueryStatus = (typeof sourceQueryStatus)[number];
3
+ export type NetworkQueryParams = {
4
+ cxId: string;
5
+ facilityId: string;
6
+ patientId: string;
7
+ requestId?: string;
8
+ };
9
+ export type NetworkQueryProgress = {
10
+ networks: SourceQueryStatus[];
11
+ };
12
+ export declare const hieSource = "hie";
13
+ export declare const pharmacySource = "pharmacy";
14
+ export declare const laboratorySource = "laboratory";
15
+ export declare const networkSources: readonly ["hie", "pharmacy", "laboratory"];
16
+ export type NetworkSource = (typeof networkSources)[number];
17
+ export type SourceQueryProgress = {
18
+ type: NetworkSource;
19
+ source?: string;
20
+ status: SourceQueryStatus;
21
+ startedAt?: Date;
22
+ requestId?: string;
23
+ documents?: {
24
+ downloadInProgress: number;
25
+ downloaded: number;
26
+ converted: number;
27
+ failed: number;
28
+ total: number;
29
+ };
30
+ };
31
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../src/domain/network-query/source.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,gDAAiD,CAAC;AAChF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,SAAS,QAAQ,CAAC;AAC/B,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,cAAc,4CAAyD,CAAC;AACrF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE;QACV,kBAAkB,EAAE,MAAM,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.networkSources = exports.laboratorySource = exports.pharmacySource = exports.hieSource = exports.sourceQueryStatus = void 0;
4
+ exports.sourceQueryStatus = ["processing", "completed", "failed"];
5
+ exports.hieSource = "hie";
6
+ exports.pharmacySource = "pharmacy";
7
+ exports.laboratorySource = "laboratory";
8
+ exports.networkSources = [exports.hieSource, exports.pharmacySource, exports.laboratorySource];
9
+ //# sourceMappingURL=source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.js","sourceRoot":"","sources":["../../../src/domain/network-query/source.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAcnE,QAAA,SAAS,GAAG,KAAK,CAAC;AAClB,QAAA,cAAc,GAAG,UAAU,CAAC;AAC5B,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAChC,QAAA,cAAc,GAAG,CAAC,iBAAS,EAAE,sBAAc,EAAE,wBAAgB,CAAU,CAAC"}
@@ -0,0 +1,31 @@
1
+ export declare const sourceQueryStatus: readonly ["processing", "completed", "failed"];
2
+ export type SourceQueryStatus = (typeof sourceQueryStatus)[number];
3
+ export type NetworkQueryParams = {
4
+ cxId: string;
5
+ facilityId: string;
6
+ patientId: string;
7
+ requestId?: string;
8
+ };
9
+ export type NetworkQueryProgress = {
10
+ networks: SourceQueryStatus[];
11
+ };
12
+ export declare const hieSource = "hie";
13
+ export declare const pharmacySource = "pharmacy";
14
+ export declare const laboratorySource = "laboratory";
15
+ export declare const networkSources: readonly ["hie", "pharmacy", "laboratory"];
16
+ export type NetworkSource = (typeof networkSources)[number];
17
+ export type SourceQueryProgress = {
18
+ type: NetworkSource;
19
+ source?: string;
20
+ status: SourceQueryStatus;
21
+ startedAt?: Date;
22
+ requestId?: string;
23
+ documents?: {
24
+ downloadInProgress: number;
25
+ downloaded: number;
26
+ converted: number;
27
+ failed: number;
28
+ total: number;
29
+ };
30
+ };
31
+ //# sourceMappingURL=network-query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-query.d.ts","sourceRoot":"","sources":["../../../src/domain/network-qyert/network-query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,gDAAiD,CAAC;AAChF,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B,CAAC;AAEF,eAAO,MAAM,SAAS,QAAQ,CAAC;AAC/B,eAAO,MAAM,cAAc,aAAa,CAAC;AACzC,eAAO,MAAM,gBAAgB,eAAe,CAAC;AAC7C,eAAO,MAAM,cAAc,4CAAyD,CAAC;AACrF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,aAAa,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,iBAAiB,CAAC;IAC1B,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE;QACV,kBAAkB,EAAE,MAAM,CAAC;QAC3B,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.networkSources = exports.laboratorySource = exports.pharmacySource = exports.hieSource = exports.sourceQueryStatus = void 0;
4
+ exports.sourceQueryStatus = ["processing", "completed", "failed"];
5
+ exports.hieSource = "hie";
6
+ exports.pharmacySource = "pharmacy";
7
+ exports.laboratorySource = "laboratory";
8
+ exports.networkSources = [exports.hieSource, exports.pharmacySource, exports.laboratorySource];
9
+ //# sourceMappingURL=network-query.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"network-query.js","sourceRoot":"","sources":["../../../src/domain/network-qyert/network-query.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAcnE,QAAA,SAAS,GAAG,KAAK,CAAC;AAClB,QAAA,cAAc,GAAG,UAAU,CAAC;AAC5B,QAAA,gBAAgB,GAAG,YAAY,CAAC;AAChC,QAAA,cAAc,GAAG,CAAC,iBAAS,EAAE,sBAAc,EAAE,wBAAgB,CAAU,CAAC"}
@@ -58,7 +58,7 @@ describe("patientMonitoringUtils", () => {
58
58
  it("should return the closest scheduled at", () => {
59
59
  const date1 = new Date("2024-01-01T12:00:00Z");
60
60
  const date2 = new Date("2024-01-01T12:05:00Z");
61
- const result = (0, utils_1.pickEarliestScheduledAt)(date1, date2);
61
+ const result = (0, utils_1.earliest)(date1, date2);
62
62
  expect(result).toEqual(date1);
63
63
  });
64
64
  });
@@ -1 +1 @@
1
- {"version":3,"file":"utils.test.js","sourceRoot":"","sources":["../../../../../src/domain/patient/patient-monitoring/__tests__/utils.test.ts"],"names":[],"mappings":";;;;;AAAA,kDAA0B;AAC1B,oCAUkB;AAElB,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,QAAQ,CAAC,0BAA0B,EAAE,GAAG,EAAE;QACxC,0DAA0D;QAC1D,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAElD,UAAU,CAAC,GAAG,EAAE;YACd,IAAI,CAAC,aAAa,EAAE,CAAC;YACrB,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,SAAS,CAAC,GAAG,EAAE;YACb,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,GAAG,EAAE;YACZ,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;YACrE,MAAM,MAAM,GA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C,EAAE,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qEAAqE,EAAE,GAAG,EAAE;YAC7E,MAAM,MAAM,GAAG,IAAA,oCAA4B,EAAC,CAAC,EAAE,CAAC,CAAC,CAAC;YAClD,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,wCAAwC,EAAE,GAAG,EAAE;YAChD,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC;YAC/C,MAAM,KAAK,GAAG,IAAI,IAAI,CAAC,sBAAsB,CAAC,CAAC;YAE/C,MAAM,MAAM,GAAG,IAAA,gBAAQ,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YACtC,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAChC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -1,26 +1,83 @@
1
- import { PatientJob } from "../../../domain/job/patient-job";
2
1
  import { z } from "zod";
2
+ import { PatientJob } from "../../../domain/job/patient-job";
3
3
  export declare const remainingAttemptsSchema: z.ZodNumber;
4
+ export declare const dischargeDataSchema: z.ZodObject<{
5
+ encounterEndDate: z.ZodString;
6
+ tcmEncounterId: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ encounterEndDate: string;
9
+ tcmEncounterId: string;
10
+ }, {
11
+ encounterEndDate: string;
12
+ tcmEncounterId: string;
13
+ }>;
14
+ export type DischargeData = z.infer<typeof dischargeDataSchema>;
15
+ export declare const multipleDischargeDataSchema: z.ZodArray<z.ZodObject<{
16
+ encounterEndDate: z.ZodString;
17
+ tcmEncounterId: z.ZodString;
18
+ }, "strip", z.ZodTypeAny, {
19
+ encounterEndDate: string;
20
+ tcmEncounterId: string;
21
+ }, {
22
+ encounterEndDate: string;
23
+ tcmEncounterId: string;
24
+ }>, "many">;
4
25
  export declare const createDischargeRequeryParamsSchema: z.ZodObject<{
5
26
  patientId: z.ZodString;
6
27
  cxId: z.ZodString;
7
28
  remainingAttempts: z.ZodOptional<z.ZodNumber>;
29
+ dischargeData: z.ZodArray<z.ZodObject<{
30
+ encounterEndDate: z.ZodString;
31
+ tcmEncounterId: z.ZodString;
32
+ }, "strip", z.ZodTypeAny, {
33
+ encounterEndDate: string;
34
+ tcmEncounterId: string;
35
+ }, {
36
+ encounterEndDate: string;
37
+ tcmEncounterId: string;
38
+ }>, "many">;
8
39
  }, "strip", z.ZodTypeAny, {
9
40
  cxId: string;
10
41
  patientId: string;
42
+ dischargeData: {
43
+ encounterEndDate: string;
44
+ tcmEncounterId: string;
45
+ }[];
11
46
  remainingAttempts?: number | undefined;
12
47
  }, {
13
48
  cxId: string;
14
49
  patientId: string;
50
+ dischargeData: {
51
+ encounterEndDate: string;
52
+ tcmEncounterId: string;
53
+ }[];
15
54
  remainingAttempts?: number | undefined;
16
55
  }>;
17
56
  export type CreateDischargeRequeryParams = z.infer<typeof createDischargeRequeryParamsSchema>;
18
57
  export declare const dischargeRequeryParamsOpsSchema: z.ZodObject<{
19
58
  remainingAttempts: z.ZodNumber;
59
+ dischargeData: z.ZodArray<z.ZodObject<{
60
+ encounterEndDate: z.ZodString;
61
+ tcmEncounterId: z.ZodString;
62
+ }, "strip", z.ZodTypeAny, {
63
+ encounterEndDate: string;
64
+ tcmEncounterId: string;
65
+ }, {
66
+ encounterEndDate: string;
67
+ tcmEncounterId: string;
68
+ }>, "many">;
20
69
  }, "strip", z.ZodTypeAny, {
21
70
  remainingAttempts: number;
71
+ dischargeData: {
72
+ encounterEndDate: string;
73
+ tcmEncounterId: string;
74
+ }[];
22
75
  }, {
23
76
  remainingAttempts: number;
77
+ dischargeData: {
78
+ encounterEndDate: string;
79
+ tcmEncounterId: string;
80
+ }[];
24
81
  }>;
25
82
  export type DischargeRequeryParamsOps = z.infer<typeof dischargeRequeryParamsOpsSchema>;
26
83
  export declare const dischargeRequeryRuntimeDataSchema: z.ZodOptional<z.ZodNullable<z.ZodObject<{
@@ -1 +1 @@
1
- {"version":3,"file":"discharge-requery.d.ts","sourceRoot":"","sources":["../../../../src/domain/patient/patient-monitoring/discharge-requery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,uBAAuB,aAA2C,CAAC;AAEhF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;EAI7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,+BAA+B;;;;;;EAE1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;IAMlC,CAAC;AAEb,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE/F,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG;IAC7C,SAAS,EAAE,yBAAyB,CAAC;IACrC,WAAW,EAAE,IAAI,CAAC;IAClB,WAAW,CAAC,EAAE,8BAA8B,CAAC;CAC9C,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,UAAU,GAAG,mBAAmB,CAO7E"}
1
+ {"version":3,"file":"discharge-requery.d.ts","sourceRoot":"","sources":["../../../../src/domain/patient/patient-monitoring/discharge-requery.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,eAAO,MAAM,uBAAuB,aAA2C,CAAC;AAChF,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,eAAO,MAAM,2BAA2B;;;;;;;;;WAA+B,CAAC;AAExE,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK7C,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kCAAkC,CAAC,CAAC;AAE9F,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;EAG1C,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAExF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;IAMlC,CAAC;AAEb,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iCAAiC,CAAC,CAAC;AAE/F,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAE1C,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG;IAC7C,SAAS,EAAE,yBAAyB,CAAC;IACrC,WAAW,EAAE,IAAI,CAAC;IAClB,WAAW,CAAC,EAAE,8BAA8B,CAAC;CAC9C,CAAC;AAEF,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,UAAU,GAAG,mBAAmB,CAO7E"}
@@ -1,16 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseDischargeRequeryJob = exports.scheduledAtSchema = exports.dischargeRequeryRuntimeDataSchema = exports.dischargeRequeryParamsOpsSchema = exports.createDischargeRequeryParamsSchema = exports.remainingAttemptsSchema = void 0;
3
+ exports.parseDischargeRequeryJob = exports.scheduledAtSchema = exports.dischargeRequeryRuntimeDataSchema = exports.dischargeRequeryParamsOpsSchema = exports.createDischargeRequeryParamsSchema = exports.multipleDischargeDataSchema = exports.dischargeDataSchema = exports.remainingAttemptsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const utils_1 = require("./utils");
6
6
  exports.remainingAttemptsSchema = zod_1.z.number().max(utils_1.defaultRemainingAttempts);
7
+ exports.dischargeDataSchema = zod_1.z.object({
8
+ encounterEndDate: zod_1.z.string(),
9
+ tcmEncounterId: zod_1.z.string(),
10
+ });
11
+ exports.multipleDischargeDataSchema = zod_1.z.array(exports.dischargeDataSchema);
7
12
  exports.createDischargeRequeryParamsSchema = zod_1.z.object({
8
13
  patientId: zod_1.z.string(),
9
14
  cxId: zod_1.z.string(),
10
15
  remainingAttempts: exports.remainingAttemptsSchema.optional(),
16
+ dischargeData: exports.multipleDischargeDataSchema,
11
17
  });
12
18
  exports.dischargeRequeryParamsOpsSchema = zod_1.z.object({
13
19
  remainingAttempts: exports.remainingAttemptsSchema,
20
+ dischargeData: exports.multipleDischargeDataSchema,
14
21
  });
15
22
  exports.dischargeRequeryRuntimeDataSchema = zod_1.z
16
23
  .object({
@@ -1 +1 @@
1
- {"version":3,"file":"discharge-requery.js","sourceRoot":"","sources":["../../../../src/domain/patient/patient-monitoring/discharge-requery.ts"],"names":[],"mappings":";;;AACA,6BAAwB;AACxB,mCAAmD;AAEtC,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,gCAAwB,CAAC,CAAC;AAEnE,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,iBAAiB,EAAE,+BAAuB,CAAC,QAAQ,EAAE;CACtD,CAAC,CAAC;AAIU,QAAA,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IACtD,iBAAiB,EAAE,+BAAuB;CAC3C,CAAC,CAAC;AAIU,QAAA,iCAAiC,GAAG,OAAC;KAC/C,MAAM,CAAC;IACN,sBAAsB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7C,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC;KACD,OAAO,EAAE,CAAC;AAIA,QAAA,iBAAiB,GAAG,OAAC,CAAC,IAAI,EAAE,CAAC;AAQ1C,SAAgB,wBAAwB,CAAC,GAAe;IACtD,OAAO;QACL,GAAG,GAAG;QACN,SAAS,EAAE,uCAA+B,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC;QAC/D,WAAW,EAAE,yCAAiC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;QACrE,WAAW,EAAE,yBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;KACtD,CAAC;AACJ,CAAC;AAPD,4DAOC"}
1
+ {"version":3,"file":"discharge-requery.js","sourceRoot":"","sources":["../../../../src/domain/patient/patient-monitoring/discharge-requery.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,mCAAmD;AAEtC,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,gCAAwB,CAAC,CAAC;AACnE,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,gBAAgB,EAAE,OAAC,CAAC,MAAM,EAAE;IAC5B,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE;CAC3B,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,OAAC,CAAC,KAAK,CAAC,2BAAmB,CAAC,CAAC;AAE3D,QAAA,kCAAkC,GAAG,OAAC,CAAC,MAAM,CAAC;IACzD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,iBAAiB,EAAE,+BAAuB,CAAC,QAAQ,EAAE;IACrD,aAAa,EAAE,mCAA2B;CAC3C,CAAC,CAAC;AAIU,QAAA,+BAA+B,GAAG,OAAC,CAAC,MAAM,CAAC;IACtD,iBAAiB,EAAE,+BAAuB;IAC1C,aAAa,EAAE,mCAA2B;CAC3C,CAAC,CAAC;AAIU,QAAA,iCAAiC,GAAG,OAAC;KAC/C,MAAM,CAAC;IACN,sBAAsB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7C,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACpC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACpC,CAAC;KACD,OAAO,EAAE,CAAC;AAIA,QAAA,iBAAiB,GAAG,OAAC,CAAC,IAAI,EAAE,CAAC;AAQ1C,SAAgB,wBAAwB,CAAC,GAAe;IACtD,OAAO;QACL,GAAG,GAAG;QACN,SAAS,EAAE,uCAA+B,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC;QAC/D,WAAW,EAAE,yCAAiC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;QACrE,WAAW,EAAE,yBAAiB,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;KACtD,CAAC;AACJ,CAAC;AAPD,4DAOC"}
@@ -7,5 +7,5 @@ export declare const backoffSix: number;
7
7
  export declare const defaultRemainingAttempts: number;
8
8
  export declare function calculateScheduledAt(newAttempts: number): Date;
9
9
  export declare function pickLargestRemainingAttempts(existingAttempts: number, newAttempts: number): number;
10
- export declare function pickEarliestScheduledAt(existingDate: Date, newDate: Date): Date;
10
+ export declare function earliest(existingDate: Date, newDate: Date): Date;
11
11
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/domain/patient/patient-monitoring/utils.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU,QAAgB,CAAC;AACxC,eAAO,MAAM,UAAU,QAAiB,CAAC;AACzC,eAAO,MAAM,YAAY,QAAqB,CAAC;AAC/C,eAAO,MAAM,WAAW,QAA0B,CAAC;AACnD,eAAO,MAAM,WAAW,QAA0B,CAAC;AACnD,eAAO,MAAM,UAAU,QAA0B,CAAC;AAUlD,eAAO,MAAM,wBAAwB,QAA+C,CAAC;AAErF,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAU9D;AAED,wBAAgB,4BAA4B,CAC1C,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB,MAAM,CAER;AAED,wBAAgB,uBAAuB,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,IAAI,CAI/E"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/domain/patient/patient-monitoring/utils.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,UAAU,QAAgB,CAAC;AACxC,eAAO,MAAM,UAAU,QAAiB,CAAC;AACzC,eAAO,MAAM,YAAY,QAAqB,CAAC;AAC/C,eAAO,MAAM,WAAW,QAA0B,CAAC;AACnD,eAAO,MAAM,WAAW,QAA0B,CAAC;AACnD,eAAO,MAAM,UAAU,QAA0B,CAAC;AAUlD,eAAO,MAAM,wBAAwB,QAA+C,CAAC;AAErF,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAU9D;AAED,wBAAgB,4BAA4B,CAC1C,gBAAgB,EAAE,MAAM,EACxB,WAAW,EAAE,MAAM,GAClB,MAAM,CAER;AAED,wBAAgB,QAAQ,CAAC,YAAY,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,GAAG,IAAI,CAIhE"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.pickEarliestScheduledAt = exports.pickLargestRemainingAttempts = exports.calculateScheduledAt = exports.defaultRemainingAttempts = exports.backoffSix = exports.backoffFive = exports.backoffFour = exports.backoffThree = exports.backoffTwo = exports.backoffOne = void 0;
6
+ exports.earliest = exports.pickLargestRemainingAttempts = exports.calculateScheduledAt = exports.defaultRemainingAttempts = exports.backoffSix = exports.backoffFive = exports.backoffFour = exports.backoffThree = exports.backoffTwo = exports.backoffOne = void 0;
7
7
  const dayjs_1 = __importDefault(require("dayjs"));
8
8
  const duration_1 = __importDefault(require("dayjs/plugin/duration"));
9
9
  const date_1 = require("../../../common/date");
@@ -34,10 +34,10 @@ function pickLargestRemainingAttempts(existingAttempts, newAttempts) {
34
34
  return Math.max(existingAttempts, newAttempts);
35
35
  }
36
36
  exports.pickLargestRemainingAttempts = pickLargestRemainingAttempts;
37
- function pickEarliestScheduledAt(existingDate, newDate) {
37
+ function earliest(existingDate, newDate) {
38
38
  const existingDateMs = existingDate.getTime();
39
39
  const newDateMs = newDate.getTime();
40
40
  return existingDateMs < newDateMs ? existingDate : newDate;
41
41
  }
42
- exports.pickEarliestScheduledAt = pickEarliestScheduledAt;
42
+ exports.earliest = earliest;
43
43
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/domain/patient/patient-monitoring/utils.ts"],"names":[],"mappings":";;;;;;AAAA,kDAA0B;AAC1B,qEAA6C;AAC7C,+CAAkD;AAElD,eAAK,CAAC,MAAM,CAAC,kBAAQ,CAAC,CAAC;AAEV,QAAA,UAAU,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,YAAY;AACxC,QAAA,UAAU,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAC1C,QAAA,YAAY,GAAG,CAAC,GAAG,EAAE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Y,CAAC,CAAC,CAAC,OAAO,CAAC;AAC7D,CAAC;AAJD,4BAIC"}
@@ -1,39 +1,6 @@
1
- import { z } from "zod";
2
1
  import { BaseDomain } from "./base-domain";
3
- export declare const patientCohortSchema: z.ZodObject<{
4
- patientId: z.ZodString;
5
- cohortId: z.ZodString;
6
- }, "strip", z.ZodTypeAny, {
2
+ export type PatientCohort = BaseDomain & {
7
3
  patientId: string;
8
4
  cohortId: string;
9
- }, {
10
- patientId: string;
11
- cohortId: string;
12
- }>;
13
- export type BasePatientCohort = z.infer<typeof patientCohortSchema>;
14
- export declare const patientCohortCreateSchema: z.ZodObject<{
15
- patientId: z.ZodString;
16
- cohortId: z.ZodString;
17
- }, "strip", z.ZodTypeAny, {
18
- patientId: string;
19
- cohortId: string;
20
- }, {
21
- patientId: string;
22
- cohortId: string;
23
- }>;
24
- export declare const patientCohortUpdateSchema: z.ZodObject<{
25
- patientId: z.ZodOptional<z.ZodString>;
26
- cohortId: z.ZodOptional<z.ZodString>;
27
- }, "strip", z.ZodTypeAny, {
28
- patientId?: string | undefined;
29
- cohortId?: string | undefined;
30
- }, {
31
- patientId?: string | undefined;
32
- cohortId?: string | undefined;
33
- }>;
34
- export type PatientCohortUpdateCmd = z.infer<typeof patientCohortUpdateSchema>;
35
- export type PatientCohortCreateCmd = z.infer<typeof patientCohortCreateSchema>;
36
- export type PatientCohort = BasePatientCohort & BaseDomain & {
37
- cxId: string;
38
5
  };
39
6
  //# sourceMappingURL=patient-cohort.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"patient-cohort.d.ts","sourceRoot":"","sources":["../../src/domain/patient-cohort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEpE,eAAO,MAAM,yBAAyB;;;;;;;;;EAAsB,CAAC;AAC7D,eAAO,MAAM,yBAAyB;;;;;;;;;EAAsC,CAAC;AAG7E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC/E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAG/E,MAAM,MAAM,aAAa,GAAG,iBAAiB,GAAG,UAAU,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC"}
1
+ {"version":3,"file":"patient-cohort.d.ts","sourceRoot":"","sources":["../../src/domain/patient-cohort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC"}
@@ -1,12 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patientCohortUpdateSchema = exports.patientCohortCreateSchema = exports.patientCohortSchema = void 0;
4
- const zod_1 = require("zod");
5
- // PatientCohort Base Interface
6
- exports.patientCohortSchema = zod_1.z.object({
7
- patientId: zod_1.z.string(),
8
- cohortId: zod_1.z.string(),
9
- });
10
- exports.patientCohortCreateSchema = exports.patientCohortSchema;
11
- exports.patientCohortUpdateSchema = exports.patientCohortCreateSchema.partial();
12
3
  //# sourceMappingURL=patient-cohort.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"patient-cohort.js","sourceRoot":"","sources":["../../src/domain/patient-cohort.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAGxB,+BAA+B;AAClB,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAGU,QAAA,yBAAyB,GAAG,2BAAmB,CAAC;AAChD,QAAA,yBAAyB,GAAG,iCAAyB,CAAC,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"patient-cohort.js","sourceRoot":"","sources":["../../src/domain/patient-cohort.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { z } from "zod";
2
+ export declare const patientIdsSchema: z.ZodArray<z.ZodString, "many">;
3
+ export declare const allOrSubsetPatientIdsSchema: z.ZodUnion<[z.ZodObject<{
4
+ allPatients: z.ZodLiteral<true>;
5
+ }, "strict", z.ZodTypeAny, {
6
+ allPatients: true;
7
+ }, {
8
+ allPatients: true;
9
+ }>, z.ZodObject<{
10
+ patientIds: z.ZodArray<z.ZodString, "many">;
11
+ }, "strict", z.ZodTypeAny, {
12
+ patientIds: string[];
13
+ }, {
14
+ patientIds: string[];
15
+ }>]>;
16
+ //# sourceMappingURL=patient-or-all.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patient-or-all.d.ts","sourceRoot":"","sources":["../../src/domain/patient-or-all.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,gBAAgB,iCAAkD,CAAC;AAEhF,eAAO,MAAM,2BAA2B;;;;;;;;;;;;IAGtC,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.allOrSubsetPatientIdsSchema = exports.patientIdsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const PATIENT_IDS_MIN_LENGTH = 1;
6
+ exports.patientIdsSchema = zod_1.z.array(zod_1.z.string()).min(PATIENT_IDS_MIN_LENGTH);
7
+ exports.allOrSubsetPatientIdsSchema = zod_1.z.union([
8
+ zod_1.z.object({ allPatients: zod_1.z.literal(true) }).strict(),
9
+ zod_1.z.object({ patientIds: exports.patientIdsSchema }).strict(),
10
+ ]);
11
+ //# sourceMappingURL=patient-or-all.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patient-or-all.js","sourceRoot":"","sources":["../../src/domain/patient-or-all.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAExB,MAAM,sBAAsB,GAAG,CAAC,CAAC;AAEpB,QAAA,gBAAgB,GAAG,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAEnE,QAAA,2BAA2B,GAAG,OAAC,CAAC,KAAK,CAAC;IACjD,OAAC,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE,OAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE;IACnD,OAAC,CAAC,MAAM,CAAC,EAAE,UAAU,EAAE,wBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE;CACpD,CAAC,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { CreateRosterCmd, GetRosterCmd, ListRostersCmd } from "./roster";
2
+ export type PatientRoster = {
3
+ id: string;
4
+ cxId: string;
5
+ patientId: string;
6
+ rosterId: string;
7
+ };
8
+ export type DeletePatientRosterCmd = Pick<PatientRoster, "cxId" | "patientId">;
9
+ export type AssignPatientsToRosterCmd = Pick<GetRosterCmd, "rosterId" | "cxId"> & {
10
+ patientIds?: string[];
11
+ isAssignAll?: boolean;
12
+ overrideClose?: boolean;
13
+ };
14
+ export type RemovePatientsFromRosterCmd = Pick<GetRosterCmd, "rosterId" | "cxId"> & {
15
+ patientIds?: string[];
16
+ isRemoveAll?: boolean;
17
+ overrideClose?: boolean;
18
+ };
19
+ export type AssignPatientsAndCreateRosterCmd = Pick<CreateRosterCmd, "cxId" | "source" | "rosterType" | "data"> & {
20
+ patientIds?: string[];
21
+ isAssignAll?: boolean;
22
+ closeOnCreate?: boolean;
23
+ };
24
+ export type ListRostersForPatientCmd = ListRostersCmd & {
25
+ patientId: string;
26
+ };
27
+ //# sourceMappingURL=patient-roster.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patient-roster.d.ts","sourceRoot":"","sources":["../../../src/domain/roster/patient-roster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAEzE,MAAM,MAAM,aAAa,GAAG;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC;AAE/E,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG;IAChF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,MAAM,CAAC,GAAG;IAClF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG,IAAI,CACjD,eAAe,EACf,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAC1C,GAAG;IACF,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG;IACtD,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=patient-roster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patient-roster.js","sourceRoot":"","sources":["../../../src/domain/roster/patient-roster.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ export declare const rosterStatus: readonly ["open", "closed"];
2
+ export type RosterStatus = (typeof rosterStatus)[number];
3
+ export declare function isValidRosterStatus(status: string): status is RosterStatus;
4
+ export declare const rosterInitialStatus: RosterStatus;
5
+ export declare function isRosterOpen(status: RosterStatus): boolean;
6
+ export declare function isRosterClosed(status: RosterStatus): boolean;
7
+ /**
8
+ * Validates that a new status is valid based on the current status.
9
+ *
10
+ * @param currentStatus - The current status of the roster.
11
+ * @param newStatus - The new status to validate.
12
+ * @returns The validated new status.
13
+ * @throws BadRequestError if the new status is not valid.
14
+ */
15
+ export declare function validateNewRosterStatus(currentStatus: RosterStatus, newStatus: RosterStatus): RosterStatus;
16
+ //# sourceMappingURL=roster-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roster-status.d.ts","sourceRoot":"","sources":["../../../src/domain/roster/roster-status.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,6BAA8B,CAAC;AACxD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,YAAY,CAE1E;AAED,eAAO,MAAM,mBAAmB,EAAE,YAAqB,CAAC;AAExD,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE1D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAE5D;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,YAAY,EAC3B,SAAS,EAAE,YAAY,GACtB,YAAY,CAyBd"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateNewRosterStatus = exports.isRosterClosed = exports.isRosterOpen = exports.rosterInitialStatus = exports.isValidRosterStatus = exports.rosterStatus = void 0;
4
+ const bad_request_1 = require("../../error/bad-request");
5
+ exports.rosterStatus = ["open", "closed"];
6
+ function isValidRosterStatus(status) {
7
+ return exports.rosterStatus.includes(status);
8
+ }
9
+ exports.isValidRosterStatus = isValidRosterStatus;
10
+ exports.rosterInitialStatus = "open";
11
+ function isRosterOpen(status) {
12
+ return status === "open";
13
+ }
14
+ exports.isRosterOpen = isRosterOpen;
15
+ function isRosterClosed(status) {
16
+ return status === "closed";
17
+ }
18
+ exports.isRosterClosed = isRosterClosed;
19
+ /**
20
+ * Validates that a new status is valid based on the current status.
21
+ *
22
+ * @param currentStatus - The current status of the roster.
23
+ * @param newStatus - The new status to validate.
24
+ * @returns The validated new status.
25
+ * @throws BadRequestError if the new status is not valid.
26
+ */
27
+ function validateNewRosterStatus(currentStatus, newStatus) {
28
+ const additionalInfo = {
29
+ currentStatus,
30
+ newStatus,
31
+ };
32
+ switch (newStatus) {
33
+ case "open":
34
+ throw new bad_request_1.BadRequestError(`Open is not a valid status to update to`, undefined, additionalInfo);
35
+ case "closed":
36
+ if (currentStatus !== "open") {
37
+ throw new bad_request_1.BadRequestError(`Roster is not in a valid state to update to closed`, undefined, additionalInfo);
38
+ }
39
+ break;
40
+ default:
41
+ throw new bad_request_1.BadRequestError(`Invalid roster status`, undefined, additionalInfo);
42
+ }
43
+ return newStatus;
44
+ }
45
+ exports.validateNewRosterStatus = validateNewRosterStatus;
46
+ //# sourceMappingURL=roster-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roster-status.js","sourceRoot":"","sources":["../../../src/domain/roster/roster-status.ts"],"names":[],"mappings":";;;AAAA,yDAA0D;AAE7C,QAAA,YAAY,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAU,CAAC;AAGxD,SAAgB,mBAAmB,CAAC,MAAc;IAChD,OAAO,oBAAY,CAAC,QAAQ,CAAC,MAAsB,CAAC,CAAC;AACvD,CAAC;AAFD,kDAEC;AAEY,QAAA,mBAAmB,GAAiB,MAAM,CAAC;AAExD,SAAgB,YAAY,CAAC,MAAoB;IAC/C,OAAO,MAAM,KAAK,MAAM,CAAC;AAC3B,CAAC;AAFD,oCAEC;AAED,SAAgB,cAAc,CAAC,MAAoB;IACjD,OAAO,MAAM,KAAK,QAAQ,CAAC;AAC7B,CAAC;AAFD,wCAEC;AAED;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CACrC,aAA2B,EAC3B,SAAuB;IAEvB,MAAM,cAAc,GAAG;QACrB,aAAa;QACb,SAAS;KACV,CAAC;IACF,QAAQ,SAAS,EAAE;QACjB,KAAK,MAAM;YACT,MAAM,IAAI,6BAAe,CACvB,yCAAyC,EACzC,SAAS,EACT,cAAc,CACf,CAAC;QACJ,KAAK,QAAQ;YACX,IAAI,aAAa,KAAK,MAAM,EAAE;gBAC5B,MAAM,IAAI,6BAAe,CACvB,oDAAoD,EACpD,SAAS,EACT,cAAc,CACf,CAAC;aACH;YACD,MAAM;QACR;YACE,MAAM,IAAI,6BAAe,CAAC,uBAAuB,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;KACjF;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AA5BD,0DA4BC"}
@@ -0,0 +1,32 @@
1
+ import { RosterStatus } from "./roster-status";
2
+ export type Roster = {
3
+ id: string;
4
+ cxId: string;
5
+ source: string;
6
+ rosterType: string;
7
+ status: RosterStatus;
8
+ statusReason?: string;
9
+ closedAt?: Date;
10
+ data?: unknown;
11
+ };
12
+ export type RosterWithSize = Roster & {
13
+ size: number;
14
+ };
15
+ export type CreateRosterCmd = Pick<Roster, "cxId" | "source" | "rosterType" | "data"> & Partial<Pick<Roster, "status">>;
16
+ export type UpdateRosterCmd = Pick<Roster, "cxId" | "id" | "data">;
17
+ export type GetRosterCmd = Pick<Roster, "cxId"> & {
18
+ rosterId: string;
19
+ };
20
+ export type DeleteRosterCmd = GetRosterCmd;
21
+ export type CloseRosterCmd = GetRosterCmd & {
22
+ reason: string;
23
+ forceStatusUpdate?: boolean;
24
+ };
25
+ export type ListRostersCmd = Pick<Roster, "cxId"> & Partial<Pick<Roster, "source" | "rosterType" | "status">> & {
26
+ sortBy?: {
27
+ column: "createdAt";
28
+ order: "ASC" | "DESC";
29
+ };
30
+ limit?: number;
31
+ };
32
+ //# sourceMappingURL=roster.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roster.d.ts","sourceRoot":"","sources":["../../../src/domain/roster/roster.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,MAAM,MAAM,MAAM,GAAG;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,YAAY,GAAG,MAAM,CAAC,GACnF,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC;AAElC,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvE,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,iBAAiB,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAE5F,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,GAC/C,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,GAAG,YAAY,GAAG,QAAQ,CAAC,CAAC,GAAG;IAC1D,MAAM,CAAC,EAAE;QACP,MAAM,EAAE,WAAW,CAAC;QACpB,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=roster.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roster.js","sourceRoot":"","sources":["../../../src/domain/roster/roster.ts"],"names":[],"mappings":""}
@@ -274,6 +274,9 @@ export declare const tcmEncounterResponseSchema: z.ZodObject<z.objectUtil.extend
274
274
  }>, "strict", z.ZodTypeAny, {
275
275
  id: string;
276
276
  cxId: string;
277
+ createdAt: string;
278
+ updatedAt: string;
279
+ eTag: string;
277
280
  patientId: string;
278
281
  facilityName: string;
279
282
  latestEvent: "Admitted" | "Transferred" | "Discharged";
@@ -284,9 +287,6 @@ export declare const tcmEncounterResponseSchema: z.ZodObject<z.objectUtil.extend
284
287
  }[];
285
288
  clinicalInformation: Record<string, unknown>;
286
289
  patientName: string;
287
- createdAt: string;
288
- updatedAt: string;
289
- eTag: string;
290
290
  admitTime?: Date | undefined;
291
291
  dischargeTime?: Date | null | undefined;
292
292
  outreachStatus?: "Not Started" | "Attempted" | "Completed" | undefined;
@@ -296,12 +296,12 @@ export declare const tcmEncounterResponseSchema: z.ZodObject<z.objectUtil.extend
296
296
  }, {
297
297
  id: string;
298
298
  cxId: string;
299
- patientId: string;
300
- latestEvent: "Admitted" | "Transferred" | "Discharged";
301
- patientName: string;
302
299
  createdAt: string;
303
300
  updatedAt: string;
304
301
  eTag: string;
302
+ patientId: string;
303
+ latestEvent: "Admitted" | "Transferred" | "Discharged";
304
+ patientName: string;
305
305
  facilityName?: string | null | undefined;
306
306
  class?: string | null | undefined;
307
307
  admitTime?: string | undefined;