@bahmni/widgets 0.0.1-dev.119 → 0.0.1-dev.122

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/index.js CHANGED
@@ -1,31 +1,31 @@
1
- import { H as t, B as s, A as o, r, D as n, s as g, L as l, M as c, N as d, w as P, o as v, t as T, R as b, S as W, z as A, V as f, X as u, W as C, K as S, Q as m, T as p, J as D, Y as N, E as R, n as U, u as h, x } from "./index-BSGBBl-w.js";
1
+ import { z as t, x as s, h as r, i as o, j as n, G as g, k as l, M as c, N as P, t as d, P as v, s as T, R as b, n as W, w as f, r as u, T as A, Q as C, E as h, I as m, O as p, B as y, W as I, y as N, f as R, u as S, v as U } from "./index-CQcHNtl1.js";
2
2
  import "react";
3
3
  export {
4
4
  t as ActivePractitionerContext,
5
5
  s as ActivePractitionerProvider,
6
- o as AllergiesTable,
7
- r as ConditionsTable,
6
+ r as AllergiesTable,
7
+ o as ConditionsTable,
8
8
  n as DiagnosesTable,
9
9
  g as GenericServiceRequestTable,
10
10
  l as LabInvestigation,
11
11
  c as MedicationsTable,
12
- d as NotificationProvider,
13
- P as NotificationServiceComponent,
12
+ P as NotificationProvider,
13
+ d as NotificationServiceComponent,
14
14
  v as PatientDetails,
15
15
  T as PatientProgramsTable,
16
16
  b as RadiologyInvestigationTable,
17
17
  W as SearchPatient,
18
- A as UserPrivilegeProvider,
19
- f as VitalFlowSheet,
20
- u as getAllWidgetConfigs,
18
+ f as UserPrivilegeProvider,
19
+ u as VitalFlowSheet,
20
+ A as getAllWidgetConfigs,
21
21
  C as getAllWidgetTypes,
22
- S as getWidget,
22
+ h as getWidget,
23
23
  m as getWidgetConfig,
24
24
  p as hasWidget,
25
- D as registerWidget,
26
- N as resetWidgetRegistry,
27
- R as useActivePractitioner,
28
- U as useNotification,
29
- h as usePatientUUID,
30
- x as useUserPrivilege
25
+ y as registerWidget,
26
+ I as resetWidgetRegistry,
27
+ N as useActivePractitioner,
28
+ R as useNotification,
29
+ S as usePatientUUID,
30
+ U as useUserPrivilege
31
31
  };
@@ -1 +1 @@
1
- {"version":3,"file":"LabInvestigation.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/LabInvestigation.tsx"],"names":[],"mappings":"AAYA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CAqJ3C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"LabInvestigation.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/LabInvestigation.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAI5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AA+BhD,QAAA,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC,WAAW,CA0L3C,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
@@ -1,7 +1,10 @@
1
- import { FormattedLabTest } from '@bahmni/services';
2
1
  import { default as React } from 'react';
2
+ import { FormattedLabInvestigations } from './models';
3
3
  interface LabInvestigationItemProps {
4
- test: FormattedLabTest;
4
+ test: FormattedLabInvestigations;
5
+ isOpen: boolean;
6
+ hasProcessedReport: boolean;
7
+ reportId?: string;
5
8
  }
6
9
  declare const LabInvestigationItem: React.FC<LabInvestigationItemProps>;
7
10
  export default LabInvestigationItem;
@@ -1 +1 @@
1
- {"version":3,"file":"LabInvestigationItem.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/LabInvestigationItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,UAAU,yBAAyB;IACjC,IAAI,EAAE,gBAAgB,CAAC;CACxB;AACD,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAqC7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"LabInvestigationItem.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/LabInvestigationItem.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAkB,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAA4B,MAAM,UAAU,CAAC;AAIhF,UAAU,yBAAyB;IACjC,IAAI,EAAE,0BAA0B,CAAC;IACjC,MAAM,EAAE,OAAO,CAAC;IAChB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CA0I7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
@@ -0,0 +1,30 @@
1
+ export declare enum LabInvestigationPriority {
2
+ stat = "Urgent",
3
+ routine = "Routine"
4
+ }
5
+ export interface FormattedLabInvestigations {
6
+ readonly id: string;
7
+ readonly testName: string;
8
+ readonly priority: LabInvestigationPriority;
9
+ readonly orderedBy: string;
10
+ readonly orderedDate: string;
11
+ readonly formattedDate: string;
12
+ readonly result?: string | LabTestResult[];
13
+ readonly testType: string;
14
+ readonly note?: string;
15
+ }
16
+ export interface LabInvestigationsByDate {
17
+ readonly date: string;
18
+ readonly rawDate: string;
19
+ readonly tests: FormattedLabInvestigations[];
20
+ }
21
+ export interface LabTestResult {
22
+ status: string;
23
+ TestName: string;
24
+ Result: string;
25
+ referenceRange: string;
26
+ reportedOn: string;
27
+ actions: string;
28
+ interpretation?: string;
29
+ }
30
+ //# sourceMappingURL=models.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/models.ts"],"names":[],"mappings":"AAAA,oBAAY,wBAAwB;IAClC,IAAI,WAAW;IACf,OAAO,YAAY;CACpB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,wBAAwB,CAAC;IAC5C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,EAAE,CAAC;IAC3C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,0BAA0B,EAAE,CAAC;CAC9C;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,38 @@
1
+ import { Bundle, ServiceRequest, DiagnosticReport, Observation } from 'fhir/r4';
2
+ import { FormattedLabInvestigations, LabInvestigationPriority, LabInvestigationsByDate, LabTestResult } from './models';
3
+ export declare function filterLabInvestigationEntries(labInvestigationBundle: Bundle<ServiceRequest>): ServiceRequest[];
4
+ /**
5
+ * Maps a FHIR priority code to LabInvestigationPriority enum
6
+ **/
7
+ export declare const mapLabInvestigationPriority: (labTest: ServiceRequest) => LabInvestigationPriority;
8
+ export declare const determineInvestigationType: (labTest: ServiceRequest) => string;
9
+ export declare function formatLabInvestigations(labInvestigations: ServiceRequest[], t: (key: string) => string): FormattedLabInvestigations[];
10
+ export declare function groupLabInvestigationsByDate(labTests: FormattedLabInvestigations[]): LabInvestigationsByDate[];
11
+ /**
12
+ * Sorts tests within each date group to show urgent tests first
13
+ */
14
+ export declare function sortLabInvestigationsByPriority(labTestsByDate: LabInvestigationsByDate[]): LabInvestigationsByDate[];
15
+ export declare function getProcessedTestIds(diagnosticReports: DiagnosticReport[] | undefined): string[];
16
+ /**
17
+ * Creates a mapping from test IDs to report IDs for processed diagnostic reports
18
+ */
19
+ export declare function getTestIdToReportIdMap(diagnosticReports: DiagnosticReport[] | undefined): Map<string, string>;
20
+ export declare function extractDiagnosticReportsFromBundle(bundle: Bundle<DiagnosticReport> | undefined): DiagnosticReport[];
21
+ export declare function extractObservationsFromBundle(bundle: Bundle | undefined): Observation[];
22
+ export declare function formatObservationsAsLabTestResults(observations: Observation[], t: (key: string) => string): LabTestResult[];
23
+ export declare function mapDiagnosticReportBundlesToTestResults(bundles: (Bundle | undefined)[], t: (key: string) => string): Map<string, LabTestResult[]>;
24
+ /**
25
+ * Maps a single diagnostic report bundle to test results
26
+ * @param bundle - DiagnosticReport bundle with observations
27
+ * @param t - Translation function
28
+ * @returns Array of LabTestResult or undefined if no valid results
29
+ */
30
+ export declare function mapSingleDiagnosticReportBundleToTestResults(bundle: Bundle | undefined, t: (key: string) => string): LabTestResult[] | undefined;
31
+ /**
32
+ * Updates tests with results from diagnostic report bundles
33
+ * @param tests - Array of formatted lab tests
34
+ * @param resultsMap - Map of test ID to LabTestResult arrays
35
+ * @returns Updated array of tests with results
36
+ */
37
+ export declare function updateTestsWithResults(tests: FormattedLabInvestigations[], resultsMap: Map<string, LabTestResult[]>): FormattedLabInvestigations[];
38
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/labinvestigation/utils.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,MAAM,EAAE,cAAc,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E,CA4DjB;AAED,wBAAgB,uCAAuC,CACrD,OAAO,EAAE,CAAC,MAAM,GAAG,SAAS,CAAC,EAAE,EAC/B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GACzB,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,CA8B9B;AAED;;;;;GAKG;AACH,wBAAgB,4CAA4C,CAC1D,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GACzB,aAAa,EAAE,GAAG,SAAS,CAiB7B;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,0BAA0B,EAAE,EACnC,UAAU,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,CAAC,GACvC,0BAA0B,EAAE,CAW9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bahmni/widgets",
3
- "version": "0.0.1-dev.119",
3
+ "version": "0.0.1-dev.122",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",