@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.
- package/dist/common/merge-settings.d.ts +21 -0
- package/dist/common/merge-settings.d.ts.map +1 -0
- package/dist/common/merge-settings.js +29 -0
- package/dist/common/merge-settings.js.map +1 -0
- package/dist/core/src/domain/document-query.d.ts +25 -0
- package/dist/core/src/domain/document-query.d.ts.map +1 -0
- package/dist/core/src/domain/document-query.js +27 -0
- package/dist/core/src/domain/document-query.js.map +1 -0
- package/dist/domain/baseDto.d.ts +9 -0
- package/dist/domain/baseDto.d.ts.map +1 -0
- package/dist/domain/baseDto.js +11 -0
- package/dist/domain/baseDto.js.map +1 -0
- package/dist/domain/cohort.d.ts +85 -123
- package/dist/domain/cohort.d.ts.map +1 -1
- package/dist/domain/cohort.js +62 -34
- package/dist/domain/cohort.js.map +1 -1
- package/dist/domain/job/types.d.ts +1 -1
- package/dist/domain/job/types.d.ts.map +1 -1
- package/dist/domain/network/network-query.d.ts +30 -0
- package/dist/domain/network/network-query.d.ts.map +1 -0
- package/dist/domain/network/network-query.js +8 -0
- package/dist/domain/network/network-query.js.map +1 -0
- package/dist/domain/network-query/network-query.d.ts +31 -0
- package/dist/domain/network-query/network-query.d.ts.map +1 -0
- package/dist/domain/network-query/network-query.js +9 -0
- package/dist/domain/network-query/network-query.js.map +1 -0
- package/dist/domain/network-query/source.d.ts +31 -0
- package/dist/domain/network-query/source.d.ts.map +1 -0
- package/dist/domain/network-query/source.js +9 -0
- package/dist/domain/network-query/source.js.map +1 -0
- package/dist/domain/network-qyert/network-query.d.ts +31 -0
- package/dist/domain/network-qyert/network-query.d.ts.map +1 -0
- package/dist/domain/network-qyert/network-query.js +9 -0
- package/dist/domain/network-qyert/network-query.js.map +1 -0
- package/dist/domain/patient/patient-monitoring/__tests__/utils.test.js +1 -1
- package/dist/domain/patient/patient-monitoring/__tests__/utils.test.js.map +1 -1
- package/dist/domain/patient/patient-monitoring/discharge-requery.d.ts +58 -1
- package/dist/domain/patient/patient-monitoring/discharge-requery.d.ts.map +1 -1
- package/dist/domain/patient/patient-monitoring/discharge-requery.js +8 -1
- package/dist/domain/patient/patient-monitoring/discharge-requery.js.map +1 -1
- package/dist/domain/patient/patient-monitoring/utils.d.ts +1 -1
- package/dist/domain/patient/patient-monitoring/utils.d.ts.map +1 -1
- package/dist/domain/patient/patient-monitoring/utils.js +3 -3
- package/dist/domain/patient/patient-monitoring/utils.js.map +1 -1
- package/dist/domain/patient-cohort.d.ts +1 -34
- package/dist/domain/patient-cohort.d.ts.map +1 -1
- package/dist/domain/patient-cohort.js +0 -9
- package/dist/domain/patient-cohort.js.map +1 -1
- package/dist/domain/patient-or-all.d.ts +16 -0
- package/dist/domain/patient-or-all.d.ts.map +1 -0
- package/dist/domain/patient-or-all.js +11 -0
- package/dist/domain/patient-or-all.js.map +1 -0
- package/dist/domain/roster/patient-roster.d.ts +27 -0
- package/dist/domain/roster/patient-roster.d.ts.map +1 -0
- package/dist/domain/roster/patient-roster.js +3 -0
- package/dist/domain/roster/patient-roster.js.map +1 -0
- package/dist/domain/roster/roster-status.d.ts +16 -0
- package/dist/domain/roster/roster-status.d.ts.map +1 -0
- package/dist/domain/roster/roster-status.js +46 -0
- package/dist/domain/roster/roster-status.js.map +1 -0
- package/dist/domain/roster/roster.d.ts +32 -0
- package/dist/domain/roster/roster.d.ts.map +1 -0
- package/dist/domain/roster/roster.js +3 -0
- package/dist/domain/roster/roster.js.map +1 -0
- package/dist/domain/tcm-encounter.d.ts +6 -6
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/interface/external/ehr/athenahealth/cx-mapping.d.ts +14 -0
- package/dist/interface/external/ehr/athenahealth/cx-mapping.d.ts.map +1 -1
- package/dist/interface/external/ehr/canvas/cx-mapping.d.ts +14 -0
- package/dist/interface/external/ehr/canvas/cx-mapping.d.ts.map +1 -1
- package/dist/interface/external/ehr/elation/cx-mapping.d.ts +14 -0
- package/dist/interface/external/ehr/elation/cx-mapping.d.ts.map +1 -1
- package/dist/interface/external/ehr/healthie/cx-mapping.d.ts +14 -0
- package/dist/interface/external/ehr/healthie/cx-mapping.d.ts.map +1 -1
- package/dist/interface/external/ehr/shared.d.ts +24 -0
- package/dist/interface/external/ehr/shared.d.ts.map +1 -1
- package/dist/interface/external/ehr/shared.js +2 -0
- package/dist/interface/external/ehr/shared.js.map +1 -1
- package/dist/interface/external/quest/fhir.d.ts +22 -0
- package/dist/interface/external/quest/fhir.d.ts.map +1 -0
- package/dist/interface/external/quest/fhir.js +9 -0
- package/dist/interface/external/quest/fhir.js.map +1 -0
- package/dist/interface/external/quest/file.d.ts +15 -0
- package/dist/interface/external/quest/file.d.ts.map +1 -0
- package/dist/interface/external/quest/file.js +3 -0
- package/dist/interface/external/quest/file.js.map +1 -0
- package/dist/interface/external/quest/roster.d.ts +167 -0
- package/dist/interface/external/quest/roster.d.ts.map +1 -0
- package/dist/interface/external/quest/roster.js +40 -0
- package/dist/interface/external/quest/roster.js.map +1 -0
- package/dist/interface/external/surescripts/roster.d.ts +12 -0
- package/dist/interface/external/surescripts/roster.d.ts.map +1 -0
- package/dist/interface/external/surescripts/roster.js +29 -0
- package/dist/interface/external/surescripts/roster.js.map +1 -0
- package/dist/interface/external/surescripts/source.d.ts +2 -0
- package/dist/interface/external/surescripts/source.d.ts.map +1 -0
- package/dist/interface/external/surescripts/source.js +5 -0
- package/dist/interface/external/surescripts/source.js.map +1 -0
- package/dist/medical/fhir/constants.d.ts +4 -0
- package/dist/medical/fhir/constants.d.ts.map +1 -1
- package/dist/medical/fhir/constants.js +17 -1
- package/dist/medical/fhir/constants.js.map +1 -1
- package/dist/net/__tests__/retry.test.js +2 -2
- package/dist/net/__tests__/retry.test.js.map +1 -1
- package/dist/net/error.d.ts +5 -3
- package/dist/net/error.d.ts.map +1 -1
- package/dist/net/error.js +12 -2
- package/dist/net/error.js.map +1 -1
- package/dist/net/retry.d.ts +1 -1
- package/dist/net/retry.d.ts.map +1 -1
- package/dist/net/retry.js +9 -33
- package/dist/net/retry.js.map +1 -1
- package/dist/shared/src/domain/network/network-query.d.ts +30 -0
- package/dist/shared/src/domain/network/network-query.d.ts.map +1 -0
- package/dist/shared/src/domain/network/network-query.js +8 -0
- package/dist/shared/src/domain/network/network-query.js.map +1 -0
- package/dist/shared/src/domain/network-query/network-query.d.ts +30 -0
- package/dist/shared/src/domain/network-query/network-query.d.ts.map +1 -0
- package/dist/shared/src/domain/network-query/network-query.js +8 -0
- package/dist/shared/src/domain/network-query/network-query.js.map +1 -0
- package/dist/shared/src/domain/network-qyert/network-query.d.ts +30 -0
- package/dist/shared/src/domain/network-qyert/network-query.d.ts.map +1 -0
- package/dist/shared/src/domain/network-qyert/network-query.js +8 -0
- package/dist/shared/src/domain/network-qyert/network-query.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deep partial type that makes all properties optional recursively
|
|
3
|
+
*/
|
|
4
|
+
export type DeepPartial<T> = {
|
|
5
|
+
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Generic utility to merge settings objects with proper deep merging behavior.
|
|
9
|
+
* Merges new settings into old settings. If a new setting is undefined, the old value is used. !!Otherwise, the new value is used!!
|
|
10
|
+
* The old settings must be a full object, not a partial object.
|
|
11
|
+
*
|
|
12
|
+
* @param oldSettings The full old settings object
|
|
13
|
+
* @param newSettings The partial new settings to merge in
|
|
14
|
+
* @returns The merged settings object
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
export declare function mergeSettings<T>({ oldSettings, newSettings, }: {
|
|
18
|
+
oldSettings: T;
|
|
19
|
+
newSettings?: DeepPartial<T>;
|
|
20
|
+
}): T;
|
|
21
|
+
//# sourceMappingURL=merge-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-settings.d.ts","sourceRoot":"","sources":["../../src/common/merge-settings.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI;KAC1B,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAChE,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,EAC/B,WAAW,EACX,WAAW,GACZ,EAAE;IACD,WAAW,EAAE,CAAC,CAAC;IACf,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;CAC9B,GAAG,CAAC,CASJ"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeSettings = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
/**
|
|
6
|
+
* Generic utility to merge settings objects with proper deep merging behavior.
|
|
7
|
+
* Merges new settings into old settings. If a new setting is undefined, the old value is used. !!Otherwise, the new value is used!!
|
|
8
|
+
* The old settings must be a full object, not a partial object.
|
|
9
|
+
*
|
|
10
|
+
* @param oldSettings The full old settings object
|
|
11
|
+
* @param newSettings The partial new settings to merge in
|
|
12
|
+
* @returns The merged settings object
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
function mergeSettings({ oldSettings, newSettings, }) {
|
|
16
|
+
if (!newSettings)
|
|
17
|
+
return oldSettings;
|
|
18
|
+
return (0, lodash_1.mergeWith)((0, lodash_1.cloneDeep)(oldSettings), newSettings, (prev, next) => {
|
|
19
|
+
if (next === undefined)
|
|
20
|
+
return prev;
|
|
21
|
+
if (Array.isArray(next))
|
|
22
|
+
return next;
|
|
23
|
+
if (!(0, lodash_1.isPlainObject)(next))
|
|
24
|
+
return next;
|
|
25
|
+
return undefined;
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
exports.mergeSettings = mergeSettings;
|
|
29
|
+
//# sourceMappingURL=merge-settings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"merge-settings.js","sourceRoot":"","sources":["../../src/common/merge-settings.ts"],"names":[],"mappings":";;;AAAA,mCAA6D;AAS7D;;;;;;;;;GASG;AACH,SAAgB,aAAa,CAAI,EAC/B,WAAW,EACX,WAAW,GAIZ;IACC,IAAI,CAAC,WAAW;QAAE,OAAO,WAAW,CAAC;IAErC,OAAO,IAAA,kBAAS,EAAC,IAAA,kBAAS,EAAC,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE;QACnE,IAAI,IAAI,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QACpC,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QACrC,IAAI,CAAC,IAAA,sBAAa,EAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QACtC,OAAO,SAAS,CAAC;IACnB,CAAC,CAAM,CAAC;AACV,CAAC;AAfD,sCAeC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export declare const documentQueryStatus: readonly ["processing", "completed", "failed"];
|
|
2
|
+
export type DocumentQueryStatus = (typeof documentQueryStatus)[number];
|
|
3
|
+
export type Progress = {
|
|
4
|
+
status: DocumentQueryStatus;
|
|
5
|
+
total?: number;
|
|
6
|
+
successful?: number;
|
|
7
|
+
errors?: number;
|
|
8
|
+
webhookSent?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type ProgressIntKeys = keyof Omit<Progress, "status">;
|
|
11
|
+
export declare const progressTypes: readonly ["convert", "download"];
|
|
12
|
+
export type ProgressType = (typeof progressTypes)[number];
|
|
13
|
+
export type DocumentQueryProgress = Partial<Record<ProgressType, Progress> & {
|
|
14
|
+
requestId: string;
|
|
15
|
+
startedAt: Date;
|
|
16
|
+
triggerConsolidated: boolean;
|
|
17
|
+
forceDownload: boolean;
|
|
18
|
+
}>;
|
|
19
|
+
export declare const convertResult: readonly ["success", "failed"];
|
|
20
|
+
export type ConvertResult = (typeof convertResult)[number];
|
|
21
|
+
export declare function getStatusFromProgress(progress: Pick<Progress, "errors" | "successful" | "total">): DocumentQueryStatus;
|
|
22
|
+
export declare function isProcessingStatus(status?: DocumentQueryStatus | undefined): boolean;
|
|
23
|
+
export declare function isFinalStatus(status?: DocumentQueryStatus | undefined): boolean;
|
|
24
|
+
export declare function isProcessing(progress?: Progress | undefined): boolean;
|
|
25
|
+
//# sourceMappingURL=document-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-query.d.ts","sourceRoot":"","sources":["../../../../../core/src/domain/document-query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,gDAAiD,CAAC;AAClF,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,MAAM,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAE7D,eAAO,MAAM,aAAa,kCAAmC,CAAC;AAC9D,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1D,MAAM,MAAM,qBAAqB,GAAG,OAAO,CACzC,MAAM,CAAC,YAAY,EAAE,QAAQ,CAAC,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,IAAI,CAAC;IAChB,mBAAmB,EAAE,OAAO,CAAC;IAC7B,aAAa,EAAE,OAAO,CAAC;CACxB,CACF,CAAC;AAEF,eAAO,MAAM,aAAa,gCAAiC,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,YAAY,GAAG,OAAO,CAAC,GAC1D,mBAAmB,CAIrB;AAED,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,SAAS,WAG1E;AACD,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE,mBAAmB,GAAG,SAAS,WAErE;AAED,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,QAAQ,GAAG,SAAS,WAE3D"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isProcessing = exports.isFinalStatus = exports.isProcessingStatus = exports.getStatusFromProgress = exports.convertResult = exports.progressTypes = exports.documentQueryStatus = void 0;
|
|
4
|
+
exports.documentQueryStatus = ["processing", "completed", "failed"];
|
|
5
|
+
exports.progressTypes = ["convert", "download"];
|
|
6
|
+
exports.convertResult = ["success", "failed"];
|
|
7
|
+
function getStatusFromProgress(progress) {
|
|
8
|
+
const { successful, errors, total } = progress;
|
|
9
|
+
const isConversionCompleted = (successful ?? 0) + (errors ?? 0) >= (total ?? 0);
|
|
10
|
+
return isConversionCompleted ? "completed" : "processing";
|
|
11
|
+
}
|
|
12
|
+
exports.getStatusFromProgress = getStatusFromProgress;
|
|
13
|
+
function isProcessingStatus(status) {
|
|
14
|
+
if (!status)
|
|
15
|
+
return false;
|
|
16
|
+
return status === "processing";
|
|
17
|
+
}
|
|
18
|
+
exports.isProcessingStatus = isProcessingStatus;
|
|
19
|
+
function isFinalStatus(status) {
|
|
20
|
+
return !isProcessingStatus(status);
|
|
21
|
+
}
|
|
22
|
+
exports.isFinalStatus = isFinalStatus;
|
|
23
|
+
function isProcessing(progress) {
|
|
24
|
+
return isProcessingStatus(progress?.status);
|
|
25
|
+
}
|
|
26
|
+
exports.isProcessing = isProcessing;
|
|
27
|
+
//# sourceMappingURL=document-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"document-query.js","sourceRoot":"","sources":["../../../../../core/src/domain/document-query.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG,CAAC,YAAY,EAAE,WAAW,EAAE,QAAQ,CAAU,CAAC;AAarE,QAAA,aAAa,GAAG,CAAC,SAAS,EAAE,UAAU,CAAU,CAAC;AAYjD,QAAA,aAAa,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAU,CAAC;AAG5D,SAAgB,qBAAqB,CACnC,QAA2D;IAE3D,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAC/C,MAAM,qBAAqB,GAAG,CAAC,UAAU,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;IAChF,OAAO,qBAAqB,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC;AAC5D,CAAC;AAND,sDAMC;AAED,SAAgB,kBAAkB,CAAC,MAAwC;IACzE,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IAC1B,OAAO,MAAM,KAAK,YAAY,CAAC;AACjC,CAAC;AAHD,gDAGC;AACD,SAAgB,aAAa,CAAC,MAAwC;IACpE,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACrC,CAAC;AAFD,sCAEC;AAED,SAAgB,YAAY,CAAC,QAA+B;IAC1D,OAAO,kBAAkB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAC9C,CAAC;AAFD,oCAEC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseDto.d.ts","sourceRoot":"","sources":["../../src/domain/baseDto.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAgB,SAAS,CAAC,KAAK,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAKtE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.toBaseDTO = void 0;
|
|
4
|
+
function toBaseDTO(model) {
|
|
5
|
+
return {
|
|
6
|
+
id: model.id,
|
|
7
|
+
eTag: model.eTag,
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
exports.toBaseDTO = toBaseDTO;
|
|
11
|
+
//# sourceMappingURL=baseDto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"baseDto.js","sourceRoot":"","sources":["../../src/domain/baseDto.ts"],"names":[],"mappings":";;;AAKA,SAAgB,SAAS,CAAC,KAAmC;IAC3D,OAAO;QACL,EAAE,EAAE,KAAK,CAAC,EAAE;QACZ,IAAI,EAAE,KAAK,CAAC,IAAI;KACjB,CAAC;AACJ,CAAC;AALD,8BAKC"}
|
package/dist/domain/cohort.d.ts
CHANGED
|
@@ -1,142 +1,104 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DeepPartial } from "../common/merge-settings";
|
|
2
2
|
import { BaseDomain } from "./base-domain";
|
|
3
|
+
import { BaseDTO } from "./baseDto";
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* WARNING IF UPDATING THIS FILE, YOU MUST UPDATE THE ROUTE SCHEMAS FILES TOO
|
|
7
|
+
*
|
|
8
|
+
* WARNING IF UPDATING THIS FILE, YOU MUST UPDATE THE ROUTE SCHEMAS FILES TOO
|
|
9
|
+
*
|
|
10
|
+
* WARNING IF UPDATING THIS FILE, YOU MUST UPDATE THE ROUTE SCHEMAS FILES TOO
|
|
11
|
+
*
|
|
12
|
+
* See @metriport/api/src/routes/medical/schemas/cohort.ts
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
3
15
|
export declare const COHORT_COLORS: readonly ["red", "green", "blue", "yellow", "purple", "orange", "pink", "brown", "gray", "black", "white"];
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
export declare const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
export declare const COHORT_FREQUENCIES: readonly ["monthly", "biweekly", "weekly"];
|
|
17
|
+
export declare const DEFAULT_COLOR = "white";
|
|
18
|
+
export declare const DEFAULT_FREQUENCY = "monthly";
|
|
19
|
+
export declare const DEFAULT_SCHEDULE: Schedule;
|
|
20
|
+
export declare const DEFAULT_SCHEDULE_HIE: Schedule;
|
|
21
|
+
export declare const DEFAULT_NOTIFICATION: Notification;
|
|
22
|
+
export declare const DEFAULT_NOTIFICATION_SCHEDULE: NotificationSchedule;
|
|
23
|
+
export declare const DEFAULT_MONITORING: MonitoringSettings;
|
|
24
|
+
export declare const DEFAULT_SETTINGS: SettingsWithoutOverrides;
|
|
25
|
+
export type CohortColors = (typeof COHORT_COLORS)[number];
|
|
26
|
+
export type CohortFrequency = (typeof COHORT_FREQUENCIES)[number];
|
|
27
|
+
export type Schedule = {
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
frequency: CohortFrequency;
|
|
30
|
+
};
|
|
31
|
+
export type NotificationSchedule = {
|
|
32
|
+
notifications: boolean;
|
|
33
|
+
schedule: Schedule;
|
|
34
|
+
};
|
|
35
|
+
type Notification = {
|
|
36
|
+
notifications: boolean;
|
|
37
|
+
};
|
|
38
|
+
export type AdtSchema = {
|
|
39
|
+
enabled: boolean;
|
|
40
|
+
};
|
|
41
|
+
export type MonitoringSettings = {
|
|
42
|
+
adt: AdtSchema;
|
|
43
|
+
hie: Schedule;
|
|
44
|
+
pharmacy: NotificationSchedule;
|
|
45
|
+
laboratory: Notification;
|
|
46
|
+
};
|
|
47
|
+
export type Overrides = Record<string, boolean> | undefined;
|
|
48
|
+
export type Settings = {
|
|
49
|
+
monitoring: MonitoringSettings;
|
|
50
|
+
overrides: Overrides;
|
|
51
|
+
};
|
|
52
|
+
export type SettingsWithoutOverrides = {
|
|
53
|
+
monitoring: MonitoringSettings;
|
|
54
|
+
};
|
|
55
|
+
export type AllOptionalMonitoringSchema = DeepPartial<MonitoringSettings>;
|
|
56
|
+
export type AllOptionalSettingsWithoutOverrides = DeepPartial<SettingsWithoutOverrides>;
|
|
57
|
+
export type AllOptionalSettingsWithOverrides = DeepPartial<Settings>;
|
|
58
|
+
export type Cohort = BaseDomain & {
|
|
31
59
|
name: string;
|
|
32
|
-
color:
|
|
60
|
+
color: CohortColors;
|
|
33
61
|
description: string;
|
|
34
|
-
settings:
|
|
35
|
-
adtMonitoring?: boolean | undefined;
|
|
36
|
-
};
|
|
37
|
-
}>;
|
|
38
|
-
export type CohortColors = z.infer<typeof cohortColorsSchema>;
|
|
39
|
-
export type CohortSettings = z.infer<typeof cohortSettingsSchema>;
|
|
40
|
-
export type BaseCohort = z.infer<typeof baseCohortSchema>;
|
|
41
|
-
export declare const cohortCreateSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
42
|
-
name: z.ZodEffects<z.ZodString, string, string>;
|
|
43
|
-
color: z.ZodEnum<["red", "green", "blue", "yellow", "purple", "orange", "pink", "brown", "gray", "black", "white"]>;
|
|
44
|
-
description: z.ZodString;
|
|
45
|
-
settings: z.ZodObject<{
|
|
46
|
-
adtMonitoring: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
-
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
adtMonitoring?: boolean | undefined;
|
|
49
|
-
}, {
|
|
50
|
-
adtMonitoring?: boolean | undefined;
|
|
51
|
-
}>;
|
|
52
|
-
}, {
|
|
53
|
-
description: z.ZodOptional<z.ZodString>;
|
|
54
|
-
settings: z.ZodOptional<z.ZodObject<{
|
|
55
|
-
adtMonitoring: z.ZodOptional<z.ZodBoolean>;
|
|
56
|
-
}, "strip", z.ZodTypeAny, {
|
|
57
|
-
adtMonitoring?: boolean | undefined;
|
|
58
|
-
}, {
|
|
59
|
-
adtMonitoring?: boolean | undefined;
|
|
60
|
-
}>>;
|
|
61
|
-
}>, "strip", z.ZodTypeAny, {
|
|
62
|
-
name: string;
|
|
63
|
-
color: "red" | "green" | "blue" | "yellow" | "purple" | "orange" | "pink" | "brown" | "gray" | "black" | "white";
|
|
64
|
-
description?: string | undefined;
|
|
65
|
-
settings?: {
|
|
66
|
-
adtMonitoring?: boolean | undefined;
|
|
67
|
-
} | undefined;
|
|
68
|
-
}, {
|
|
69
|
-
name: string;
|
|
70
|
-
color: "red" | "green" | "blue" | "yellow" | "purple" | "orange" | "pink" | "brown" | "gray" | "black" | "white";
|
|
71
|
-
description?: string | undefined;
|
|
72
|
-
settings?: {
|
|
73
|
-
adtMonitoring?: boolean | undefined;
|
|
74
|
-
} | undefined;
|
|
75
|
-
}>;
|
|
76
|
-
export declare const cohortUpdateSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
77
|
-
name: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
|
|
78
|
-
color: z.ZodOptional<z.ZodEnum<["red", "green", "blue", "yellow", "purple", "orange", "pink", "brown", "gray", "black", "white"]>>;
|
|
79
|
-
description: z.ZodOptional<z.ZodOptional<z.ZodString>>;
|
|
80
|
-
settings: z.ZodOptional<z.ZodOptional<z.ZodObject<{
|
|
81
|
-
adtMonitoring: z.ZodOptional<z.ZodBoolean>;
|
|
82
|
-
}, "strip", z.ZodTypeAny, {
|
|
83
|
-
adtMonitoring?: boolean | undefined;
|
|
84
|
-
}, {
|
|
85
|
-
adtMonitoring?: boolean | undefined;
|
|
86
|
-
}>>>;
|
|
87
|
-
}, {
|
|
88
|
-
eTag: z.ZodOptional<z.ZodString>;
|
|
89
|
-
}>, "strip", z.ZodTypeAny, {
|
|
90
|
-
name?: string | undefined;
|
|
91
|
-
color?: "red" | "green" | "blue" | "yellow" | "purple" | "orange" | "pink" | "brown" | "gray" | "black" | "white" | undefined;
|
|
92
|
-
description?: string | undefined;
|
|
93
|
-
settings?: {
|
|
94
|
-
adtMonitoring?: boolean | undefined;
|
|
95
|
-
} | undefined;
|
|
96
|
-
eTag?: string | undefined;
|
|
97
|
-
}, {
|
|
98
|
-
name?: string | undefined;
|
|
99
|
-
color?: "red" | "green" | "blue" | "yellow" | "purple" | "orange" | "pink" | "brown" | "gray" | "black" | "white" | undefined;
|
|
100
|
-
description?: string | undefined;
|
|
101
|
-
settings?: {
|
|
102
|
-
adtMonitoring?: boolean | undefined;
|
|
103
|
-
} | undefined;
|
|
104
|
-
eTag?: string | undefined;
|
|
105
|
-
}>;
|
|
106
|
-
export type CohortCreateRequest = z.infer<typeof cohortCreateSchema>;
|
|
107
|
-
export type CohortUpdateRequest = z.infer<typeof cohortUpdateSchema>;
|
|
108
|
-
export type CohortCreateCmd = z.infer<typeof cohortCreateSchema> & {
|
|
62
|
+
settings: Settings;
|
|
109
63
|
cxId: string;
|
|
110
64
|
};
|
|
111
|
-
export type
|
|
112
|
-
|
|
113
|
-
|
|
65
|
+
export type CohortWithOverrides = Omit<Cohort, "id" | "cxId" | "createdAt" | "updatedAt" | "eTag">;
|
|
66
|
+
type CohortWithoutOverrides = Omit<CohortWithOverrides, "settings"> & {
|
|
67
|
+
settings: SettingsWithoutOverrides;
|
|
68
|
+
};
|
|
69
|
+
export type CohortCreateRequest = Pick<Cohort, "name"> & Partial<Pick<Cohort, "description" | "color">> & {
|
|
70
|
+
settings?: SettingsWithoutOverrides;
|
|
114
71
|
};
|
|
115
|
-
export type
|
|
72
|
+
export type CohortCreateCmd = CohortCreateRequest & {
|
|
116
73
|
cxId: string;
|
|
117
74
|
};
|
|
118
|
-
export type
|
|
119
|
-
|
|
120
|
-
eTag
|
|
75
|
+
export type CohortUpdateRequestWithoutOverrides = Partial<Omit<CohortWithoutOverrides, "settings">> & {
|
|
76
|
+
settings?: AllOptionalSettingsWithoutOverrides;
|
|
77
|
+
eTag?: string;
|
|
121
78
|
};
|
|
122
|
-
export
|
|
123
|
-
id: string;
|
|
124
|
-
eTag: string;
|
|
125
|
-
}): BaseDTO;
|
|
126
|
-
export type CohortDTO = {
|
|
79
|
+
export type CohortUpdateCmd = Omit<CohortUpdateRequestWithoutOverrides, "settings"> & {
|
|
127
80
|
id: string;
|
|
81
|
+
cxId: string;
|
|
82
|
+
eTag?: string;
|
|
83
|
+
settings?: AllOptionalSettingsWithOverrides;
|
|
84
|
+
};
|
|
85
|
+
export type CohortResponse = BaseDTO & {
|
|
128
86
|
name: string;
|
|
129
87
|
description: string;
|
|
130
|
-
|
|
88
|
+
color: CohortColors;
|
|
89
|
+
settings: SettingsWithoutOverrides;
|
|
131
90
|
};
|
|
132
|
-
export type
|
|
133
|
-
cohort: CohortDTO;
|
|
91
|
+
export type CohortWithSizeResponse = CohortResponse & {
|
|
134
92
|
size: number;
|
|
135
93
|
};
|
|
136
|
-
export type
|
|
137
|
-
|
|
94
|
+
export type CohortWithSize = Cohort & {
|
|
95
|
+
size: number;
|
|
138
96
|
};
|
|
139
|
-
export declare function
|
|
97
|
+
export declare function responseDtoFromCohort(cohort: CohortWithOverrides & {
|
|
140
98
|
eTag: string;
|
|
141
|
-
|
|
99
|
+
id: string;
|
|
100
|
+
}): CohortResponse;
|
|
101
|
+
export declare const cohortPatientMaxPageSize = 100;
|
|
102
|
+
export declare function normalizeCohortName(name: string): string;
|
|
103
|
+
export {};
|
|
142
104
|
//# sourceMappingURL=cohort.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cohort.d.ts","sourceRoot":"","sources":["../../src/domain/cohort.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cohort.d.ts","sourceRoot":"","sources":["../../src/domain/cohort.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAa,MAAM,WAAW,CAAC;AAE/C;;;;;;;;;;GAUG;AAEH,eAAO,MAAM,aAAa,4GAYhB,CAAC;AAEX,eAAO,MAAM,kBAAkB,4CAA6C,CAAC;AAE7E,eAAO,MAAM,aAAa,UAAU,CAAC;AAErC,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAC3C,eAAO,MAAM,gBAAgB,EAAE,QAG9B,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,QAGlC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,YAElC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,oBAG3C,CAAC;AAMF,eAAO,MAAM,kBAAkB,EAAE,kBAKhC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,wBAE9B,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAC1D,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,MAAM,MAAM,QAAQ,GAAG;IACrB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,eAAe,CAAC;CAC5B,C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AAE,MAAM,CAAA;CAAE,GACzD,cAAc,CAWhB;AAED,eAAO,MAAM,wBAAwB,MAAM,CAAC;AAE5C,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAMxD"}
|
package/dist/domain/cohort.js
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.normalizeCohortName = exports.cohortPatientMaxPageSize = exports.responseDtoFromCohort = exports.DEFAULT_SETTINGS = exports.DEFAULT_MONITORING = exports.DEFAULT_NOTIFICATION_SCHEDULE = exports.DEFAULT_NOTIFICATION = exports.DEFAULT_SCHEDULE_HIE = exports.DEFAULT_SCHEDULE = exports.DEFAULT_FREQUENCY = exports.DEFAULT_COLOR = exports.COHORT_FREQUENCIES = exports.COHORT_COLORS = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const bad_request_1 = require("../error/bad-request");
|
|
6
|
+
const baseDto_1 = require("./baseDto");
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* WARNING IF UPDATING THIS FILE, YOU MUST UPDATE THE ROUTE SCHEMAS FILES TOO
|
|
10
|
+
*
|
|
11
|
+
* WARNING IF UPDATING THIS FILE, YOU MUST UPDATE THE ROUTE SCHEMAS FILES TOO
|
|
12
|
+
*
|
|
13
|
+
* WARNING IF UPDATING THIS FILE, YOU MUST UPDATE THE ROUTE SCHEMAS FILES TOO
|
|
14
|
+
*
|
|
15
|
+
* See @metriport/api/src/routes/medical/schemas/cohort.ts
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
5
18
|
exports.COHORT_COLORS = [
|
|
6
19
|
"red",
|
|
7
20
|
"green",
|
|
@@ -15,41 +28,56 @@ exports.COHORT_COLORS = [
|
|
|
15
28
|
"black",
|
|
16
29
|
"white",
|
|
17
30
|
];
|
|
18
|
-
|
|
19
|
-
exports.
|
|
20
|
-
exports.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
exports.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
exports.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
31
|
+
exports.COHORT_FREQUENCIES = ["monthly", "biweekly", "weekly"];
|
|
32
|
+
exports.DEFAULT_COLOR = "white";
|
|
33
|
+
exports.DEFAULT_FREQUENCY = "monthly";
|
|
34
|
+
exports.DEFAULT_SCHEDULE = {
|
|
35
|
+
enabled: false,
|
|
36
|
+
frequency: exports.DEFAULT_FREQUENCY,
|
|
37
|
+
};
|
|
38
|
+
exports.DEFAULT_SCHEDULE_HIE = {
|
|
39
|
+
enabled: false,
|
|
40
|
+
frequency: exports.DEFAULT_FREQUENCY,
|
|
41
|
+
};
|
|
42
|
+
exports.DEFAULT_NOTIFICATION = {
|
|
43
|
+
notifications: false,
|
|
44
|
+
};
|
|
45
|
+
exports.DEFAULT_NOTIFICATION_SCHEDULE = {
|
|
46
|
+
notifications: exports.DEFAULT_NOTIFICATION.notifications,
|
|
47
|
+
schedule: exports.DEFAULT_SCHEDULE,
|
|
48
|
+
};
|
|
49
|
+
const DEFAULT_ADT = {
|
|
50
|
+
enabled: false,
|
|
51
|
+
};
|
|
52
|
+
exports.DEFAULT_MONITORING = {
|
|
53
|
+
adt: (0, lodash_1.cloneDeep)(DEFAULT_ADT),
|
|
54
|
+
hie: (0, lodash_1.cloneDeep)(exports.DEFAULT_SCHEDULE_HIE),
|
|
55
|
+
pharmacy: (0, lodash_1.cloneDeep)(exports.DEFAULT_NOTIFICATION_SCHEDULE),
|
|
56
|
+
laboratory: (0, lodash_1.cloneDeep)(exports.DEFAULT_NOTIFICATION),
|
|
57
|
+
};
|
|
58
|
+
exports.DEFAULT_SETTINGS = {
|
|
59
|
+
monitoring: exports.DEFAULT_MONITORING,
|
|
60
|
+
};
|
|
61
|
+
function responseDtoFromCohort(cohort) {
|
|
62
|
+
//eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
63
|
+
const { overrides: _removedOverrides, ...settingsWithoutOverrides } = cohort.settings;
|
|
40
64
|
return {
|
|
41
|
-
id:
|
|
42
|
-
eTag: model.eTag,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
exports.toBaseDTO = toBaseDTO;
|
|
46
|
-
function dtoFromCohort(cohort) {
|
|
47
|
-
return {
|
|
48
|
-
...toBaseDTO(cohort),
|
|
65
|
+
...(0, baseDto_1.toBaseDTO)({ id: cohort.id, eTag: cohort.eTag }),
|
|
49
66
|
name: cohort.name,
|
|
67
|
+
color: cohort.color,
|
|
50
68
|
description: cohort.description,
|
|
51
|
-
settings:
|
|
69
|
+
settings: settingsWithoutOverrides,
|
|
52
70
|
};
|
|
53
71
|
}
|
|
54
|
-
exports.
|
|
72
|
+
exports.responseDtoFromCohort = responseDtoFromCohort;
|
|
73
|
+
// ### Query Constants ###
|
|
74
|
+
exports.cohortPatientMaxPageSize = 100;
|
|
75
|
+
function normalizeCohortName(name) {
|
|
76
|
+
const trimmed = name.trim();
|
|
77
|
+
if (trimmed.length === 0) {
|
|
78
|
+
throw new bad_request_1.BadRequestError("Cohort name cannot be empty");
|
|
79
|
+
}
|
|
80
|
+
return trimmed;
|
|
81
|
+
}
|
|
82
|
+
exports.normalizeCohortName = normalizeCohortName;
|
|
55
83
|
//# sourceMappingURL=cohort.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cohort.js","sourceRoot":"","sources":["../../src/domain/cohort.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"cohort.js","sourceRoot":"","sources":["../../src/domain/cohort.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,sDAAuD;AAGvD,uCAA+C;AAE/C;;;;;;;;;;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AAC,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC;QAClD,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,QAAQ,EAAE,wBAAwB;KACnC,CAAC;AACJ,CAAC;AAbD,sDAaC;AACD,0BAA0B;AACb,QAAA,wBAAwB,GAAG,GAAG,CAAC;AAE5C,SAAgB,mBAAmB,CAAC,IAAY;IAC9C,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE;QACxB,MAAM,IAAI,6BAAe,CAAC,6BAA6B,CAAC,CAAC;KAC1D;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAND,kDAMC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export type JobParamsCx = Record<string, string | boolean>;
|
|
3
|
-
export type JobParamsOps = Record<string, string | boolean | number>;
|
|
3
|
+
export type JobParamsOps = Record<string, string | boolean | number | object>;
|
|
4
4
|
declare const failed: "failed";
|
|
5
5
|
declare const successful: "successful";
|
|
6
6
|
export type JobEntryStatus = typeof failed | typeof successful;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/domain/job/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/domain/job/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC,CAAC;AAE9E,QAAA,MAAM,MAAM,UAAoB,CAAC;AACjC,QAAA,MAAM,UAAU,cAAwB,CAAC;AACzC,MAAM,MAAM,cAAc,GAAG,OAAO,MAAM,GAAG,OAAO,UAAU,CAAC;AAE/D,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,cAAc,CAE9E;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;EAG3B,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DocumentQueryStatus } from "./document-query";
|
|
2
|
+
export type NetworkQueryParams = {
|
|
3
|
+
cxId: string;
|
|
4
|
+
facilityId: string;
|
|
5
|
+
patientId: string;
|
|
6
|
+
requestId?: string;
|
|
7
|
+
};
|
|
8
|
+
export type NetworkQueryProgress = {
|
|
9
|
+
networks: SourceQueryProgress[];
|
|
10
|
+
};
|
|
11
|
+
export declare const hieSource = "hie";
|
|
12
|
+
export declare const pharmacySource = "pharmacy";
|
|
13
|
+
export declare const laboratorySource = "laboratory";
|
|
14
|
+
export declare const networkSources: readonly ["hie", "pharmacy", "laboratory"];
|
|
15
|
+
export type NetworkSource = (typeof networkSources)[number];
|
|
16
|
+
export type SourceQueryProgress = {
|
|
17
|
+
type: NetworkSource;
|
|
18
|
+
source?: string;
|
|
19
|
+
status: DocumentQueryStatus;
|
|
20
|
+
startedAt?: Date;
|
|
21
|
+
requestId?: string;
|
|
22
|
+
documents?: {
|
|
23
|
+
downloadInProgress: number;
|
|
24
|
+
downloaded: number;
|
|
25
|
+
converted: number;
|
|
26
|
+
failed: number;
|
|
27
|
+
total: number;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=network-query.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-query.d.ts","sourceRoot":"","sources":["../../../src/domain/network/network-query.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEvD,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,mBAAmB,EAAE,CAAC;CACjC,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,mBAAmB,CAAC;IAC5B,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,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.networkSources = exports.laboratorySource = exports.pharmacySource = exports.hieSource = void 0;
|
|
4
|
+
exports.hieSource = "hie";
|
|
5
|
+
exports.pharmacySource = "pharmacy";
|
|
6
|
+
exports.laboratorySource = "laboratory";
|
|
7
|
+
exports.networkSources = [exports.hieSource, exports.pharmacySource, exports.laboratorySource];
|
|
8
|
+
//# sourceMappingURL=network-query.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network-query.js","sourceRoot":"","sources":["../../../src/domain/network/network-query.ts"],"names":[],"mappings":";;;AAaa,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-query/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"}
|