@photonhealth/elements 0.0.93 → 0.0.95

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,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
+ }
@@ -1,12 +1,15 @@
1
+ import { PhotonClient } from '@photonhealth/sdk';
2
+ import { Catalog } from '@photonhealth/sdk/dist/types';
3
+ import { GraphQLError } from 'graphql';
1
4
  export declare const CatalogStore: {
2
5
  store: {
3
6
  catalogs: {
4
- data: import("@photonhealth/sdk/dist/types").Catalog[];
5
- errors: readonly import("graphql").GraphQLError[];
7
+ data: Catalog[];
8
+ errors: readonly GraphQLError[];
6
9
  isLoading: boolean;
7
10
  };
8
11
  };
9
12
  actions: {
10
- getCatalogs: (client: import("@photonhealth/sdk").PhotonClient) => Promise<void>;
13
+ getCatalogs: (client: PhotonClient) => Promise<void>;
11
14
  };
12
15
  };
@@ -1,12 +1,18 @@
1
+ import { PhotonClient } from '@photonhealth/sdk';
2
+ import { GraphQLError } from 'graphql';
3
+ import { DispenseUnit } from '@photonhealth/sdk/dist/types';
4
+ export type StoreDispenseUnit = {
5
+ id: string;
6
+ } & DispenseUnit;
1
7
  export declare const DispenseUnitStore: {
2
8
  store: {
3
9
  dispenseUnits: {
4
- data: import("@photonhealth/components/dist/src/stores/dispenseUnit").StoreDispenseUnit[];
5
- errors: readonly import("graphql").GraphQLError[];
10
+ data: StoreDispenseUnit[];
11
+ errors: readonly GraphQLError[];
6
12
  isLoading: boolean;
7
13
  };
8
14
  };
9
15
  actions: {
10
- getDispenseUnits: (client: import("@photonhealth/sdk").PhotonClient) => Promise<void>;
16
+ getDispenseUnits: (client: PhotonClient) => Promise<void>;
11
17
  };
12
18
  };
@@ -1,2 +1,22 @@
1
- import { createFormStore } from '@photonhealth/components';
2
- export { createFormStore };
1
+ import { Struct } from 'superstruct';
2
+ export declare const createFormStore: (initalValue?: Record<string, any>) => {
3
+ store: Record<string, {
4
+ value: any;
5
+ error?: string | undefined;
6
+ } | undefined>;
7
+ actions: {
8
+ updateFormValue: ({ key, value }: {
9
+ key: string;
10
+ value: any;
11
+ }) => void;
12
+ clearKeys: (keys: string[]) => void;
13
+ registerValidator: ({ key, validator }: {
14
+ key: string;
15
+ validator: Struct<any, any>;
16
+ }) => void;
17
+ unRegisterValidator: (key: string) => void;
18
+ validate: (keys?: string[]) => void;
19
+ hasErrors: (keys: string[]) => boolean;
20
+ reset: () => void;
21
+ };
22
+ };
@@ -1,23 +1,26 @@
1
+ import { PhotonClient } from '@photonhealth/sdk';
2
+ import { Patient } from '@photonhealth/sdk/dist/types';
3
+ import { GraphQLError } from 'graphql';
1
4
  export declare const PatientStore: {
2
5
  store: {
3
6
  patients: {
4
- data: import("@photonhealth/sdk/dist/types").Patient[];
5
- errors: readonly import("graphql").GraphQLError[];
7
+ data: Patient[];
8
+ errors: readonly GraphQLError[];
6
9
  isLoading: boolean;
7
10
  finished: boolean;
8
11
  };
9
12
  selectedPatient: {
10
- data?: import("@photonhealth/sdk/dist/types").Patient | undefined;
11
- errors: readonly import("graphql").GraphQLError[];
13
+ data?: Patient;
14
+ errors: readonly GraphQLError[];
12
15
  isLoading: boolean;
13
16
  };
14
17
  };
15
18
  actions: {
16
- getPatients: (client: import("@photonhealth/sdk").PhotonClient, args?: {
17
- first?: number | undefined;
18
- name?: string | undefined;
19
- } | undefined) => Promise<(() => Promise<(() => Promise<any>) | undefined>) | undefined>;
20
- getSelectedPatient: (client: import("@photonhealth/sdk").PhotonClient, id: string) => Promise<void>;
19
+ getPatients: (client: PhotonClient, args?: {
20
+ first?: number;
21
+ name?: string;
22
+ }) => Promise<(() => Promise<(() => Promise<any | undefined>) | undefined>) | undefined>;
23
+ getSelectedPatient: (client: PhotonClient, id: string) => Promise<void>;
21
24
  clearSelectedPatient: () => Promise<void>;
22
25
  reset: () => Promise<void>;
23
26
  };
@@ -1,37 +1,40 @@
1
1
  /// <reference types="@types/google.maps" />
2
+ import { PhotonClient } from '@photonhealth/sdk';
3
+ import { Pharmacy } from '@photonhealth/sdk/dist/types';
4
+ import { GraphQLError } from 'graphql';
2
5
  export declare const PharmacyStore: {
3
6
  store: {
4
7
  pharmacies: {
5
- data: import("@photonhealth/sdk/dist/types").Pharmacy[];
6
- address?: string | undefined;
7
- errors: readonly (import("graphql").GraphQLError | Error)[];
8
+ data: Pharmacy[];
9
+ address?: string;
10
+ errors: readonly (GraphQLError | Error)[];
8
11
  isLoading: boolean;
9
12
  };
10
13
  selectedPharmacy: {
11
- data?: import("@photonhealth/sdk/dist/types").Pharmacy | undefined;
12
- errors: readonly import("graphql").GraphQLError[];
14
+ data?: Pharmacy;
15
+ errors: readonly GraphQLError[];
13
16
  isLoading: boolean;
14
17
  };
15
18
  preferredPharmacies: {
16
- data?: import("@photonhealth/sdk/dist/types").Pharmacy[] | undefined;
17
- errors: readonly import("graphql").GraphQLError[];
19
+ data?: Pharmacy[];
20
+ errors: readonly GraphQLError[];
18
21
  isLoading: boolean;
19
22
  };
20
23
  };
21
24
  actions: {
22
- getPharmacies: (client: import("@photonhealth/sdk").PhotonClient, args: {
23
- name?: string | undefined;
25
+ getPharmacies: (client: PhotonClient, args: {
26
+ name?: string;
24
27
  location: {
25
28
  latitude: number;
26
29
  longitude: number;
27
30
  radius: number;
28
31
  };
29
- first?: number | undefined;
32
+ first?: number;
30
33
  }) => Promise<void>;
31
- getPharmaciesByAddress: (client: import("@photonhealth/sdk").PhotonClient, geocoder: google.maps.Geocoder, address: string, name?: string | undefined) => Promise<void>;
32
- getPharmacy: (client: import("@photonhealth/sdk").PhotonClient, id: string) => Promise<void>;
34
+ getPharmaciesByAddress: (client: PhotonClient, geocoder: google.maps.Geocoder, address: string, name?: string) => Promise<void>;
35
+ getPharmacy: (client: PhotonClient, id: string) => Promise<void>;
33
36
  clearSelectedPharmacy: () => void;
34
- getPreferredPharmacies: (client: import("@photonhealth/sdk").PhotonClient, id: string) => Promise<void>;
37
+ getPreferredPharmacies: (client: PhotonClient, id: string) => Promise<void>;
35
38
  clearPreferredPharmacies: () => void;
36
39
  reset: () => Promise<void>;
37
40
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photonhealth/elements",
3
- "version": "0.0.93",
3
+ "version": "0.0.95",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",