@photonhealth/elements 0.20.5 → 0.20.7

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.
@@ -10,10 +10,8 @@ export declare const AddPrescriptionCard: (props: {
10
10
  enableCombineAndDuplicate?: boolean;
11
11
  screenDraftedPrescriptions: () => void;
12
12
  draftedPrescriptionChanged: () => void;
13
- onDraftPrescriptionCreated: () => void;
14
13
  screeningAlerts: ScreeningAlertType[];
15
14
  catalogId?: string;
16
15
  allowOffCatalogSearch?: boolean;
17
- enableOrder: boolean;
18
16
  disableList?: DisableList;
19
17
  }) => import("solid-js").JSX.Element;
@@ -8,4 +8,5 @@ export declare const DraftPrescriptionCard: (props: {
8
8
  screeningAlerts: ScreeningAlertType[];
9
9
  routingConstraints: RoutingConstraint[];
10
10
  enableOrder: boolean;
11
+ onAddAnotherClick?: () => void;
11
12
  }) => import("solid-js").JSX.Element;
@@ -35,6 +35,9 @@ export type PrescribeProps = {
35
35
  allowOffCatalogSearch?: boolean;
36
36
  disableList?: DisableList;
37
37
  groupId?: string;
38
+ /**
39
+ * This logic keeps the rx form closed when refilling a particular template/prescription
40
+ */
38
41
  initialShowForm: boolean;
39
42
  };
40
43
  export declare const ScreenDraftedPrescriptionsQuery: import("graphql").DocumentNode;
@@ -0,0 +1,6 @@
1
+ interface SupervisorCardProps {
2
+ actions: Record<string, (...args: any) => any>;
3
+ store: Record<string, any>;
4
+ }
5
+ export declare const SupervisorCard: (props: SupervisorCardProps) => import("solid-js").JSX.Element;
6
+ export {};
@@ -1,4 +1,18 @@
1
+ import { TemplateOverrides } from '@photonhealth/components';
2
+ import { PrescribeProps } from './components/PrescribeWorkflow';
1
3
  import '@shoelace-style/shoelace/dist/components/alert/alert';
2
4
  import '@shoelace-style/shoelace/dist/components/icon-button/icon-button';
3
5
  import '@shoelace-style/shoelace/dist/components/icon/icon';
4
6
  import '@shoelace-style/shoelace/dist/components/switch/switch';
7
+ export interface PrescribeWorkflowComponentProps extends Omit<PrescribeProps, 'initialShowForm'> {
8
+ templateIds?: string;
9
+ templateOverrides?: TemplateOverrides;
10
+ prescriptionIds?: string;
11
+ enableCoverageCheck: boolean;
12
+ pharmacyId?: string;
13
+ enableLocalPickup: boolean;
14
+ enableSendToPatient: boolean;
15
+ enableDeliveryPharmacies: boolean;
16
+ mailOrderIds?: string;
17
+ }
18
+ export declare const PhotonPrescribeWorkflowComponent: (props: PrescribeWorkflowComponentProps) => import("solid-js").JSX.Element;
@@ -0,0 +1,49 @@
1
+ import { PhotonClient } from '@photonhealth/sdk';
2
+ /**
3
+ * Creates a PhotonClient for testing.
4
+ *
5
+ * - apolloClinical: real fetch - intercepted by MSW
6
+ * - apollo: real fetch - intercepted by MSW
7
+ * watchQuery overridden (Observable pattern doesn't resolve with MSW in jsdom)
8
+ * - auth: getAccessToken stubbed to skip Auth0
9
+ */
10
+ export declare function createTestClient(): PhotonClient;
11
+ /**
12
+ * Creates a plain object matching the PhotonClientStore shape for PhotonContext.Provider.
13
+ *
14
+ * We can't use the real PhotonClientStore because its constructor initializes auth state
15
+ * as { isAuthenticated: false, isLoading: true } and only updates via checkSession(),
16
+ * which calls Auth0. Components like PhotonAuthorized gate on these values, so we need
17
+ * them pre-set to authenticated. The real store also doesn't expose setStore publicly,
18
+ * so there's no way to override auth state after construction.
19
+ *
20
+ * Network calls triggered by store methods (getDispenseUnits, etc.) are handled by MSW,
21
+ * but the initial auth/loading state must be set here.
22
+ */
23
+ export declare function createTestClientStore(client: PhotonClient): {
24
+ sdk: PhotonClient;
25
+ getSDK: () => PhotonClient;
26
+ autoLogin: boolean;
27
+ authentication: {
28
+ state: {
29
+ isAuthenticated: boolean;
30
+ isLoading: boolean;
31
+ isInOrg: boolean;
32
+ permissions: string[];
33
+ error: undefined;
34
+ };
35
+ login: import("vitest").Mock<(...args: any[]) => any>;
36
+ logout: import("vitest").Mock<(...args: any[]) => any>;
37
+ handleRedirect: import("vitest").Mock<(...args: any[]) => any>;
38
+ checkSession: import("vitest").Mock<(...args: any[]) => any>;
39
+ };
40
+ clinical: {
41
+ dispenseUnits: {
42
+ state: {
43
+ isLoading: boolean;
44
+ dispenseUnits: any[];
45
+ };
46
+ getDispenseUnits: import("vitest").Mock<(...args: any[]) => any>;
47
+ };
48
+ };
49
+ };
@@ -0,0 +1,3 @@
1
+ export declare class MockMedicationSearchElement extends HTMLElement {
2
+ connectedCallback(): void;
3
+ }
@@ -1,9 +1,7 @@
1
1
  import { Struct } from 'superstruct';
2
2
  export declare const message: <T>(struct: Struct<T, any>, message: string) => Struct<T, any>;
3
- export declare const between: (min: number, max: number, inclusive?: boolean) => Struct<unknown, null>;
4
3
  export declare const notFutureDate: Struct<unknown, null>;
5
4
  export declare const afterDate: (date: Date, parser?: (v: string) => Date) => Struct<unknown, null>;
6
- export declare const numericString: () => Struct<string, null>;
7
5
  export declare const zipString: () => Struct<string, null>;
8
6
  export declare const email: () => Struct<string, null>;
9
7
  export declare const empty: () => Struct<any, null>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@photonhealth/elements",
3
- "version": "0.20.5",
3
+ "version": "0.20.7",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "./dist/index.d.ts",