@uxland/primary-shell 7.46.8 → 7.46.9

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.
@@ -0,0 +1,2 @@
1
+ import { PrimariaApi } from '../../api/api';
2
+ export declare const getVisiId: (api: PrimariaApi) => Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxland/primary-shell",
3
- "version": "7.46.8",
3
+ "version": "7.46.9",
4
4
  "description": "Primaria Shell",
5
5
  "author": "UXLand <dev@uxland.es>",
6
6
  "homepage": "https://github.com/uxland/harmonix/tree/app#readme",
@@ -1,5 +1,6 @@
1
1
  import { shellApi } from "../../api/api";
2
2
  import { getPatientCip } from "../../features/get-patient-cip/action";
3
+ import { getVisiId } from "../../features/get-visi-id/action";
3
4
  import { navigateToEcap } from "../../features/navigate-to-ecap/navigate-to-ecap";
4
5
  import { ClinicalPathwaysActionMenu } from "../components/clinical-pathways-action-menu/clinical-pathways-action-menu";
5
6
  import { PetitionerActionMenu } from "../components/petitioner-action-menu/petitioner-action-menu";
@@ -69,7 +70,10 @@ const doctorNavMenuItems: MenuItemConfig[] = [
69
70
  {
70
71
  icon: "open_in_new",
71
72
  label: "Prescripció",
72
- callbackFn: () => navigateToEcap("PRESCRIPCIO_ACTIVA"),
73
+ callbackFn: async () => {
74
+ const visiId = await getVisiId(shellApi);
75
+ navigateToEcap("PRESCRIPCIO_ACTIVA", "NO_TANCAR", { VisiId: visiId });
76
+ },
73
77
  },
74
78
  {
75
79
  icon: "open_in_new",
@@ -102,7 +106,10 @@ const doctorNavMenuItems: MenuItemConfig[] = [
102
106
  label: "Incapacitat temporal",
103
107
  type: "item",
104
108
  sortHint: "0100",
105
- callbackFn: () => navigateToEcap("REV_IT"),
109
+ callbackFn: async () => {
110
+ const visiId = await getVisiId(shellApi);
111
+ navigateToEcap("REV_IT", "NO_TANCAR", { VisiId: visiId });
112
+ },
106
113
  },
107
114
  {
108
115
  id: "visits",
@@ -0,0 +1,7 @@
1
+ import { PrimariaApi } from "../../api/api";
2
+
3
+ export const getVisiId = async (api: PrimariaApi): Promise<string> => {
4
+ const context = api.contextManager.getContext();
5
+ if (context.visi_id) return context.visi_id as string;
6
+ return (await api.broker.send("get_visi_id")) as string;
7
+ };