@photonhealth/elements 0.0.87 → 0.0.89
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 +92 -93
- package/dist/index.mjs +1384 -1387
- package/dist/store.d.ts +99 -0
- package/package.json +1 -1
package/dist/store.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { PhotonClient } from '@photonhealth/sdk';
|
|
2
|
+
import { Catalog, DispenseUnit, MutationCreatePrescriptionArgs, Patient, Prescription, PrescriptionTemplate, Treatment } from '@photonhealth/sdk/dist/types';
|
|
3
|
+
import { GraphQLError } from 'graphql';
|
|
4
|
+
import { Permission } from '../types';
|
|
5
|
+
export declare class PhotonClientStore {
|
|
6
|
+
private sdk;
|
|
7
|
+
private setStore;
|
|
8
|
+
private store;
|
|
9
|
+
authentication: {
|
|
10
|
+
state: {
|
|
11
|
+
user: any;
|
|
12
|
+
isAuthenticated: boolean;
|
|
13
|
+
isInOrg: boolean;
|
|
14
|
+
permissions: Permission[];
|
|
15
|
+
error?: string;
|
|
16
|
+
isLoading: boolean;
|
|
17
|
+
};
|
|
18
|
+
handleRedirect: (url?: string) => Promise<void>;
|
|
19
|
+
checkSession: () => Promise<void>;
|
|
20
|
+
login: (args?: object) => Promise<void>;
|
|
21
|
+
logout: () => void;
|
|
22
|
+
};
|
|
23
|
+
getSDK: () => PhotonClient;
|
|
24
|
+
clinical: {
|
|
25
|
+
catalog: {
|
|
26
|
+
state: {
|
|
27
|
+
isLoading: boolean;
|
|
28
|
+
treatments: Treatment[];
|
|
29
|
+
templates: PrescriptionTemplate[];
|
|
30
|
+
};
|
|
31
|
+
getCatalog: (args: {
|
|
32
|
+
id: string;
|
|
33
|
+
}) => void;
|
|
34
|
+
};
|
|
35
|
+
catalogs: {
|
|
36
|
+
state: {
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
catalogs: Catalog[];
|
|
39
|
+
};
|
|
40
|
+
getCatalogs: () => void;
|
|
41
|
+
};
|
|
42
|
+
dispenseUnits: {
|
|
43
|
+
state: {
|
|
44
|
+
isLoading: boolean;
|
|
45
|
+
dispenseUnits: Array<DispenseUnit & {
|
|
46
|
+
id: string;
|
|
47
|
+
}>;
|
|
48
|
+
};
|
|
49
|
+
getDispenseUnits: () => void;
|
|
50
|
+
};
|
|
51
|
+
patients: {
|
|
52
|
+
state: {
|
|
53
|
+
isLoading: boolean;
|
|
54
|
+
patients: Patient[];
|
|
55
|
+
finished: boolean;
|
|
56
|
+
};
|
|
57
|
+
getPatients: (args?: {
|
|
58
|
+
after?: string;
|
|
59
|
+
first?: number;
|
|
60
|
+
name?: string;
|
|
61
|
+
clear?: boolean;
|
|
62
|
+
}) => void;
|
|
63
|
+
};
|
|
64
|
+
patient: {
|
|
65
|
+
state: {
|
|
66
|
+
isLoading: boolean;
|
|
67
|
+
patient?: Patient;
|
|
68
|
+
};
|
|
69
|
+
getPatient: (args: {
|
|
70
|
+
id: string;
|
|
71
|
+
}) => Promise<Patient>;
|
|
72
|
+
};
|
|
73
|
+
prescription: {
|
|
74
|
+
state: {
|
|
75
|
+
isLoading: boolean;
|
|
76
|
+
data?: Prescription;
|
|
77
|
+
errors: GraphQLError[];
|
|
78
|
+
error?: any;
|
|
79
|
+
};
|
|
80
|
+
createPrescription: (args: MutationCreatePrescriptionArgs) => Promise<{
|
|
81
|
+
data: {
|
|
82
|
+
createPrescription: Prescription;
|
|
83
|
+
} | null | undefined;
|
|
84
|
+
errors: readonly GraphQLError[] | undefined;
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
constructor(sdk: PhotonClient);
|
|
89
|
+
private _getSDK;
|
|
90
|
+
private checkSession;
|
|
91
|
+
private login;
|
|
92
|
+
private logout;
|
|
93
|
+
private getPatients;
|
|
94
|
+
private getPatient;
|
|
95
|
+
private getCatalog;
|
|
96
|
+
private getCatalogs;
|
|
97
|
+
private getDispenseUnits;
|
|
98
|
+
private createPrescription;
|
|
99
|
+
}
|