@photonhealth/client 2.0.0-rc.2 → 2.0.0-rc.4
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/README.md +4 -2
- package/dist/analytics/lifecycleEvents.d.ts +5 -2
- package/dist/analytics/lifecycleEvents.d.ts.map +1 -1
- package/dist/analytics/lifecycleEvents.js +4 -1
- package/dist/analytics/lifecycleEvents.js.map +1 -1
- package/dist/{photon/analytics.d.ts → analytics/track.d.ts} +3 -3
- package/dist/analytics/track.d.ts.map +1 -0
- package/dist/{photon/analytics.js → analytics/track.js} +2 -2
- package/dist/analytics/track.js.map +1 -0
- package/dist/api/changes/applyOption.d.ts +4 -1
- package/dist/api/changes/applyOption.d.ts.map +1 -1
- package/dist/api/changes/applyOption.js +23 -2
- package/dist/api/changes/applyOption.js.map +1 -1
- package/dist/api/orders.d.ts +21 -0
- package/dist/api/orders.d.ts.map +1 -1
- package/dist/gql/gql.d.ts +1 -1
- package/dist/gql/gql.d.ts.map +1 -1
- package/dist/gql/gql.js +1 -1
- package/dist/gql/gql.js.map +1 -1
- package/dist/gql/graphql.d.ts +336 -1
- package/dist/gql/graphql.d.ts.map +1 -1
- package/dist/gql/graphql.js +75 -0
- package/dist/gql/graphql.js.map +1 -1
- package/dist/meta/version.js +1 -1
- package/dist/photon/index.d.ts +2 -2
- package/dist/photon/index.d.ts.map +1 -1
- package/dist/photon/index.js.map +1 -1
- package/dist/photon/map.d.ts.map +1 -1
- package/dist/photon/map.js +13 -11
- package/dist/photon/map.js.map +1 -1
- package/dist/photon/order.d.ts +3 -4
- package/dist/photon/order.d.ts.map +1 -1
- package/dist/photon/order.js +6 -11
- package/dist/photon/order.js.map +1 -1
- package/dist/photon/photon.d.ts +1 -1
- package/dist/photon/photon.d.ts.map +1 -1
- package/dist/photon/photon.js +1 -1
- package/dist/photon/photon.js.map +1 -1
- package/dist/photon/session.d.ts +3 -2
- package/dist/photon/session.d.ts.map +1 -1
- package/dist/photon/session.js +22 -9
- package/dist/photon/session.js.map +1 -1
- package/dist/photon/types.d.ts +10 -2
- package/dist/photon/types.d.ts.map +1 -1
- package/dist/testing/fixtures.d.ts +26 -0
- package/dist/testing/fixtures.d.ts.map +1 -1
- package/dist/testing/fixtures.js +6 -0
- package/dist/testing/fixtures.js.map +1 -1
- package/dist/testing.d.ts +1 -1
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
- package/src/analytics/lifecycleEvents.test.ts +25 -5
- package/src/analytics/lifecycleEvents.ts +20 -3
- package/src/analytics/track.test.ts +231 -0
- package/src/{photon/analytics.ts → analytics/track.ts} +2 -2
- package/src/api/changes/applyOption.ts +25 -2
- package/src/gql/gql.ts +3 -3
- package/src/gql/graphql.ts +523 -111
- package/src/meta/version.ts +1 -1
- package/src/operations/fragments.graphql +3 -0
- package/src/photon/index.ts +2 -1
- package/src/photon/map.ts +14 -11
- package/src/photon/order.ts +7 -12
- package/src/photon/photon.ts +1 -1
- package/src/photon/session.ts +23 -9
- package/src/photon/types.ts +11 -2
- package/src/testing/fixtures.ts +12 -0
- package/src/testing.ts +1 -0
- package/dist/photon/analytics.d.ts.map +0 -1
- package/dist/photon/analytics.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
2
|
import { fakeNetworkApiClient, photonOver } from "../testing.ts";
|
|
3
|
-
import type { Analytics } from "
|
|
3
|
+
import type { Analytics } from "./track.ts";
|
|
4
4
|
import { environmentUrls } from "../photon/environments.ts";
|
|
5
5
|
import type { OrderRecord, Pharmacy, PatientRecord, PrescriptionRecord, ScreeningAlert } from "../photon/types.ts";
|
|
6
6
|
|
|
@@ -302,15 +302,35 @@ describe("draftPrescriptionAdded", () => {
|
|
|
302
302
|
});
|
|
303
303
|
});
|
|
304
304
|
|
|
305
|
-
describe("draftPrescriptionDeleted
|
|
306
|
-
it("
|
|
305
|
+
describe("draftPrescriptionDeleted", () => {
|
|
306
|
+
it("sends only the prescription's id", async () => {
|
|
307
307
|
expect(ownProperties(await propertiesSentBy((analytics) => analytics.draftPrescriptionDeleted("rx_9")))).toEqual({
|
|
308
308
|
category: "ctaClicked",
|
|
309
309
|
prescriptionId: "rx_9",
|
|
310
310
|
});
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
|
|
314
|
+
describe("prescriptionSigned: signing acknowledges the prescription's screening alerts", () => {
|
|
315
|
+
it("counts the screening alerts the signature acknowledged", async () => {
|
|
316
|
+
const signedWithTwoAlerts = prescription("rx_4", { screeningAlerts: [alert(), alert()] });
|
|
317
|
+
expect(
|
|
318
|
+
ownProperties(await propertiesSentBy((analytics) => analytics.prescriptionSigned(signedWithTwoAlerts))),
|
|
319
|
+
).toEqual({ category: "ctaClicked", prescriptionId: "rx_4", screeningAlertCount: 2 });
|
|
320
|
+
});
|
|
321
|
+
|
|
322
|
+
it("counts zero for a prescription screened with no alerts", async () => {
|
|
323
|
+
const signedWithNoAlerts = prescription("rx_4", { screeningAlerts: [] });
|
|
311
324
|
expect(
|
|
312
|
-
ownProperties(await propertiesSentBy((analytics) => analytics.prescriptionSigned(
|
|
313
|
-
).toEqual({ category: "ctaClicked", prescriptionId: "rx_4" });
|
|
325
|
+
ownProperties(await propertiesSentBy((analytics) => analytics.prescriptionSigned(signedWithNoAlerts))),
|
|
326
|
+
).toEqual({ category: "ctaClicked", prescriptionId: "rx_4", screeningAlertCount: 0 });
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
it("leaves the count out when the caller doesn't know the prescription's screening alerts", async () => {
|
|
330
|
+
expect(ownProperties(await propertiesSentBy((analytics) => analytics.prescriptionSigned({ id: "rx_4" })))).toEqual({
|
|
331
|
+
category: "ctaClicked",
|
|
332
|
+
prescriptionId: "rx_4",
|
|
333
|
+
});
|
|
314
334
|
});
|
|
315
335
|
});
|
|
316
336
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AnalyticsProperties } from "
|
|
1
|
+
import type { AnalyticsProperties } from "./track.ts";
|
|
2
2
|
import type { OrderRecord, PatientRecord, PrescriptionRecord, ScreeningAlert } from "../photon/types.ts";
|
|
3
3
|
|
|
4
4
|
export type LifecycleEventName =
|
|
@@ -24,6 +24,10 @@ export type DraftPrescriptionForLifecycleAnalytics = Pick<
|
|
|
24
24
|
|
|
25
25
|
export type PrescriptionForLifecycleAnalytics = Pick<PrescriptionRecord, "id">;
|
|
26
26
|
|
|
27
|
+
export type SignedPrescriptionForLifecycleAnalytics = PrescriptionForLifecycleAnalytics & {
|
|
28
|
+
screeningAlerts?: readonly unknown[] | null;
|
|
29
|
+
};
|
|
30
|
+
|
|
27
31
|
export type OrderForLifecycleAnalytics = Pick<OrderRecord, "id"> & {
|
|
28
32
|
prescriptions: readonly PrescriptionForLifecycleAnalytics[];
|
|
29
33
|
pharmacy: Pick<NonNullable<OrderRecord["pharmacy"]>, "fulfillmentType"> | null;
|
|
@@ -48,7 +52,10 @@ export interface LifecycleAnalytics {
|
|
|
48
52
|
buttonText: string,
|
|
49
53
|
properties?: AnalyticsProperties,
|
|
50
54
|
): Promise<void>;
|
|
51
|
-
prescriptionSigned(
|
|
55
|
+
prescriptionSigned(
|
|
56
|
+
prescription: SignedPrescriptionForLifecycleAnalytics,
|
|
57
|
+
properties?: AnalyticsProperties,
|
|
58
|
+
): Promise<void>;
|
|
52
59
|
orderSent(order: OrderForLifecycleAnalytics, properties?: AnalyticsProperties): Promise<void>;
|
|
53
60
|
}
|
|
54
61
|
|
|
@@ -83,7 +90,11 @@ export function lifecycleAnalyticsSentWith(track: Track): LifecycleAnalytics {
|
|
|
83
90
|
screeningAlertCanceled: (alerts, buttonText, properties) =>
|
|
84
91
|
sendCtaClicked("Screening Alert Canceled", { screeningAlertCount: alerts.length, buttonText }, properties),
|
|
85
92
|
prescriptionSigned: (prescription, properties) =>
|
|
86
|
-
sendCtaClicked(
|
|
93
|
+
sendCtaClicked(
|
|
94
|
+
"Prescription Signed",
|
|
95
|
+
{ prescriptionId: prescription.id, ...screeningAlertsAcknowledgedBySigning(prescription) },
|
|
96
|
+
properties,
|
|
97
|
+
),
|
|
87
98
|
orderSent: (order, properties) =>
|
|
88
99
|
sendCtaClicked(
|
|
89
100
|
"Order Sent",
|
|
@@ -102,6 +113,12 @@ function patientProperties(patient: PatientForLifecycleAnalytics): AnalyticsProp
|
|
|
102
113
|
return { patientId: patient.id, ...patientFormSnapshot(patient) };
|
|
103
114
|
}
|
|
104
115
|
|
|
116
|
+
function screeningAlertsAcknowledgedBySigning(
|
|
117
|
+
prescription: SignedPrescriptionForLifecycleAnalytics,
|
|
118
|
+
): AnalyticsProperties {
|
|
119
|
+
return prescription.screeningAlerts ? { screeningAlertCount: prescription.screeningAlerts.length } : {};
|
|
120
|
+
}
|
|
121
|
+
|
|
105
122
|
function fulfillmentTypeOf(order: OrderForLifecycleAnalytics): string | null {
|
|
106
123
|
if (!order.pharmacy) return SEND_TO_PATIENT;
|
|
107
124
|
const offeredTypes = order.pharmacy.fulfillmentType ?? [];
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
2
|
+
import { clientVersion, environmentUrls, photon } from "../index.ts";
|
|
3
|
+
import { MAX_LIST_LENGTH, MAX_PROPERTY_LENGTH } from "./track.ts";
|
|
4
|
+
import { fakeNetworkApiClient, photonOver } from "../testing.ts";
|
|
5
|
+
|
|
6
|
+
// ph.analytics.track: one event to analytics-api as the signed-in prescriber. Never rejects, never PHI.
|
|
7
|
+
|
|
8
|
+
const jwt = (claims: Record<string, unknown>) => `x.${btoa(JSON.stringify(claims)).replace(/=+$/, "")}.y`;
|
|
9
|
+
const providerCaller = (userId: string) => ({
|
|
10
|
+
me: {
|
|
11
|
+
__typename: "User",
|
|
12
|
+
id: userId,
|
|
13
|
+
name: { first: "Ada", last: "Lovelace" },
|
|
14
|
+
organization: { __typename: "Organization", id: "org_1", name: "Acme Clinic" },
|
|
15
|
+
permissions: [],
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
const photonWithAnalytics = (
|
|
20
|
+
handlers: Parameters<typeof fakeNetworkApiClient>[0] = { Me: () => providerCaller("usr_1") },
|
|
21
|
+
token: () => Promise<string> = async () => jwt({ sub: "auth0|1", org_id: "org_1" }),
|
|
22
|
+
) => {
|
|
23
|
+
const network = fakeNetworkApiClient(handlers);
|
|
24
|
+
const ph = photonOver(network.client, environmentUrls("boson"), {
|
|
25
|
+
analytics: { url: "https://analytics-api.boson.health", token, clientName: "photon-mcp" },
|
|
26
|
+
});
|
|
27
|
+
return { ph, analytics: ph.analytics!, names: network.names };
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
let fetchSpy: ReturnType<typeof vi.fn>;
|
|
31
|
+
const sent = () =>
|
|
32
|
+
fetchSpy.mock.calls.map(([url, init]) => ({
|
|
33
|
+
url: url as string,
|
|
34
|
+
init: init as RequestInit,
|
|
35
|
+
body: JSON.parse((init as RequestInit).body as string) as {
|
|
36
|
+
event: string;
|
|
37
|
+
userId: string;
|
|
38
|
+
properties: Record<string, unknown>;
|
|
39
|
+
},
|
|
40
|
+
}));
|
|
41
|
+
const events = () => sent().map(({ body }) => body.event);
|
|
42
|
+
|
|
43
|
+
beforeEach(() => {
|
|
44
|
+
fetchSpy = vi.fn(async () => new Response(JSON.stringify({ status: "ok" })));
|
|
45
|
+
vi.stubGlobal("fetch", fetchSpy);
|
|
46
|
+
});
|
|
47
|
+
afterEach(() => {
|
|
48
|
+
vi.useRealTimers();
|
|
49
|
+
vi.unstubAllGlobals();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
describe("ph.analytics.track", () => {
|
|
53
|
+
it("POSTs the event to analytics-api with the prescriber's token, as their usr_ id", async () => {
|
|
54
|
+
vi.useFakeTimers({ now: new Date("2026-11-04T12:00:00.000Z"), toFake: ["Date"] });
|
|
55
|
+
const { analytics } = photonWithAnalytics();
|
|
56
|
+
await analytics.track("Patient Created", { patientId: "pat_1", integration: "mcp" });
|
|
57
|
+
const { url, init, body } = sent()[0]!;
|
|
58
|
+
expect(url).toBe("https://analytics-api.boson.health/event");
|
|
59
|
+
expect(init).toMatchObject({
|
|
60
|
+
method: "POST",
|
|
61
|
+
keepalive: true,
|
|
62
|
+
headers: {
|
|
63
|
+
"content-type": "application/json",
|
|
64
|
+
"x-photon-auth-token": jwt({ sub: "auth0|1", org_id: "org_1" }),
|
|
65
|
+
"x-photon-auth-token-type": "auth0",
|
|
66
|
+
},
|
|
67
|
+
});
|
|
68
|
+
expect(body).toEqual({
|
|
69
|
+
event: "Patient Created",
|
|
70
|
+
userId: "usr_1",
|
|
71
|
+
properties: {
|
|
72
|
+
providerId: "usr_1",
|
|
73
|
+
orgId: "org_1",
|
|
74
|
+
environment: "boson",
|
|
75
|
+
clientName: "photon-mcp",
|
|
76
|
+
clientVersion,
|
|
77
|
+
timestamp: "2026-11-04T12:00:00.000Z",
|
|
78
|
+
patientId: "pat_1",
|
|
79
|
+
integration: "mcp",
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("lets the caller set timestamp and its own properties, never providerId, orgId or environment", async () => {
|
|
85
|
+
const { analytics } = photonWithAnalytics();
|
|
86
|
+
await analytics.track("Order Sent", {
|
|
87
|
+
timestamp: "2026-01-01T00:00:00.000Z",
|
|
88
|
+
clientName: "host",
|
|
89
|
+
providerId: "usr_forged",
|
|
90
|
+
orgId: "org_forged",
|
|
91
|
+
environment: "photon",
|
|
92
|
+
});
|
|
93
|
+
expect(sent()[0]!.body.properties).toMatchObject({
|
|
94
|
+
timestamp: "2026-01-01T00:00:00.000Z",
|
|
95
|
+
clientName: "host",
|
|
96
|
+
providerId: "usr_1",
|
|
97
|
+
orgId: "org_1",
|
|
98
|
+
environment: "boson",
|
|
99
|
+
});
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
it("asks network-api who the caller is once per signed-in user", async () => {
|
|
103
|
+
let sub = "auth0|1";
|
|
104
|
+
const { analytics, names } = photonWithAnalytics(
|
|
105
|
+
{ Me: () => providerCaller(sub === "auth0|1" ? "usr_1" : "usr_2") },
|
|
106
|
+
async () => jwt({ sub, org_id: "org_1" }),
|
|
107
|
+
);
|
|
108
|
+
await Promise.all([analytics.track("Event A"), analytics.track("Event B")]);
|
|
109
|
+
sub = "auth0|2";
|
|
110
|
+
await analytics.track("Event C");
|
|
111
|
+
expect(sent().map(({ body }) => [body.event, body.userId, body.properties.providerId])).toEqual([
|
|
112
|
+
["Event A", "usr_1", "usr_1"],
|
|
113
|
+
["Event B", "usr_1", "usr_1"],
|
|
114
|
+
["Event C", "usr_2", "usr_2"],
|
|
115
|
+
]);
|
|
116
|
+
expect(names()).toEqual(["Me", "Me"]);
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
it("drops the event, and asks again next time, when network-api can't say who the caller is", async () => {
|
|
120
|
+
let fail = true;
|
|
121
|
+
const { analytics } = photonWithAnalytics({
|
|
122
|
+
Me: () => {
|
|
123
|
+
if (fail) throw new Error("unreachable");
|
|
124
|
+
return providerCaller("usr_1");
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
await expect(analytics.track("Event A")).resolves.toBeUndefined();
|
|
128
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
129
|
+
fail = false;
|
|
130
|
+
await analytics.track("Event B");
|
|
131
|
+
expect(events()).toEqual(["Event B"]);
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
it("sends nothing for a caller that isn't a prescriber, or a token without a subject", async () => {
|
|
135
|
+
const patient = photonWithAnalytics({
|
|
136
|
+
Me: () => ({ me: { __typename: "Patient", id: "pat_1", name: { first: "Paige", last: "Turner" } } }),
|
|
137
|
+
});
|
|
138
|
+
await patient.analytics.track("Event A");
|
|
139
|
+
const noSub = photonWithAnalytics(undefined, async () => "not-a-jwt");
|
|
140
|
+
await noSub.analytics.track("Event A");
|
|
141
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
142
|
+
expect(noSub.names()).toEqual([]);
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
it("never rejects: a failed token, network-api or analytics-api changes nothing for the caller", async () => {
|
|
146
|
+
await expect(
|
|
147
|
+
photonWithAnalytics(undefined, async () => Promise.reject(new Error("no token"))).analytics.track("Event A"),
|
|
148
|
+
).resolves.toBeUndefined();
|
|
149
|
+
fetchSpy.mockRejectedValueOnce(new TypeError("fetch failed"));
|
|
150
|
+
await expect(photonWithAnalytics().analytics.track("Event A")).resolves.toBeUndefined();
|
|
151
|
+
fetchSpy.mockResolvedValueOnce(new Response("nope", { status: 500 }));
|
|
152
|
+
await expect(photonWithAnalytics().analytics.track("Event A")).resolves.toBeUndefined();
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
describe("guards: mistakes are dropped, not sent", () => {
|
|
156
|
+
it.each([
|
|
157
|
+
["a name that isn't Title Case", "patient created", {}],
|
|
158
|
+
["a name with digits", "Event 1", {}],
|
|
159
|
+
["an object value", "Event A", { patient: { name: "Paige" } }],
|
|
160
|
+
["a list holding a non-string", "Event A", { ids: ["rx_1", 2] }],
|
|
161
|
+
["a list holding an object", "Event A", { ids: [{ id: "rx_1" }] }],
|
|
162
|
+
["a list with a string longer than the limit", "Event A", { ids: ["x".repeat(MAX_PROPERTY_LENGTH + 1)] }],
|
|
163
|
+
[
|
|
164
|
+
"a list longer than the limit",
|
|
165
|
+
"Event A",
|
|
166
|
+
{ ids: Array.from({ length: MAX_LIST_LENGTH + 1 }, (_, i) => `rx_${i}`) },
|
|
167
|
+
],
|
|
168
|
+
["a string longer than the limit", "Event A", { note: "x".repeat(MAX_PROPERTY_LENGTH + 1) }],
|
|
169
|
+
])("%s", async (_why, event, properties) => {
|
|
170
|
+
const { analytics, names } = photonWithAnalytics();
|
|
171
|
+
await analytics.track(event, properties as never);
|
|
172
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
173
|
+
expect(names()).toEqual([]);
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
it("ids, enums, counts, booleans, nulls and a string at the limit pass", async () => {
|
|
177
|
+
const { analytics } = photonWithAnalytics();
|
|
178
|
+
await analytics.track("Prescribe Workflow Viewed", {
|
|
179
|
+
orderId: "ord_1",
|
|
180
|
+
host: "chatgpt",
|
|
181
|
+
count: 2,
|
|
182
|
+
locked: false,
|
|
183
|
+
sessionId: null,
|
|
184
|
+
tag: "x".repeat(MAX_PROPERTY_LENGTH),
|
|
185
|
+
prescriptionIds: Array.from({ length: MAX_LIST_LENGTH }, (_, i) => `rx_${i}`),
|
|
186
|
+
none: [],
|
|
187
|
+
});
|
|
188
|
+
expect(events()).toEqual(["Prescribe Workflow Viewed"]);
|
|
189
|
+
expect(sent()[0]!.body.properties.prescriptionIds).toHaveLength(MAX_LIST_LENGTH);
|
|
190
|
+
});
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
describe("integration: which surface sent it", () => {
|
|
195
|
+
const getToken = async () => jwt({ sub: "auth0|1", org_id: "org_1" });
|
|
196
|
+
const me = async () => new Response(JSON.stringify({ data: providerCaller("usr_1") }));
|
|
197
|
+
|
|
198
|
+
it('an MCP connector\'s instance tags every event integration: "mcp", without the caller saying so', async () => {
|
|
199
|
+
const ph = photon({ environment: "boson", auth: { getToken }, source: "MCP_CONNECTOR", fetch: me });
|
|
200
|
+
expect(ph.analytics?.integration).toBe("mcp");
|
|
201
|
+
await ph.analytics!.track("Patient Created", { patientId: "pat_1" });
|
|
202
|
+
await ph.analytics!.track("Order Sent", { orderId: "ord_1" });
|
|
203
|
+
expect(sent().map(({ body }) => body.properties.integration)).toEqual(["mcp", "mcp"]);
|
|
204
|
+
});
|
|
205
|
+
|
|
206
|
+
it("other instances add none, and an event's own integration wins (React's cards send theirs)", async () => {
|
|
207
|
+
const host = photon({ environment: "boson", auth: { getToken }, source: "EMBEDDABLE_COMPONENT", fetch: me });
|
|
208
|
+
expect(host.analytics?.integration).toBeNull();
|
|
209
|
+
await host.analytics!.track("Event A");
|
|
210
|
+
await host.analytics!.track("Event B", { integration: "react" });
|
|
211
|
+
expect(sent().map(({ body }) => body.properties.integration)).toEqual([undefined, "react"]);
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
describe("photon({ disableAnalytics })", () => {
|
|
216
|
+
const getToken = async () => jwt({ sub: "auth0|1", org_id: "org_1" });
|
|
217
|
+
|
|
218
|
+
it("analytics is on unless it's turned off", () => {
|
|
219
|
+
expect(photon({ environment: "boson", auth: { getToken } }).analytics?.track).toBeTypeOf("function");
|
|
220
|
+
expect(photon({ environment: "boson", auth: { getToken }, disableAnalytics: false }).analytics).not.toBeNull();
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
it("disableAnalytics: no ph.analytics, nothing sent — and the instance works as before", async () => {
|
|
224
|
+
const network = vi.fn(async () => new Response(JSON.stringify({ data: { ping: "pong" } })));
|
|
225
|
+
const ph = photon({ environment: "boson", auth: { getToken }, disableAnalytics: true, fetch: network });
|
|
226
|
+
expect(ph.analytics).toBeNull();
|
|
227
|
+
await ph.ping().catch(() => {});
|
|
228
|
+
expect(network).toHaveBeenCalled();
|
|
229
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
230
|
+
});
|
|
231
|
+
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { clientVersion } from "../meta/version.ts";
|
|
2
|
-
import type { EnvironmentUrls } from "
|
|
3
|
-
import { lifecycleAnalyticsSentWith, type LifecycleAnalytics } from "
|
|
2
|
+
import type { EnvironmentUrls } from "../photon/environments.ts";
|
|
3
|
+
import { lifecycleAnalyticsSentWith, type LifecycleAnalytics } from "./lifecycleEvents.ts";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* An event's properties: ids, enums, booleans, counts, durations, timestamps, and lists of ids (an order's
|
|
@@ -91,13 +91,36 @@ export function applyOption<T>(input: T, option: ApplicableOption): T {
|
|
|
91
91
|
return applyAt(input, optionPath(option), parseOptionValue(option.value));
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Fields beside a locator that describe the entry rather than find it, so a pick keeps them. A medication
|
|
96
|
+
* history entry's `status` is required (MedicationHistoryEntryInput), so dropping it fails the write.
|
|
97
|
+
*/
|
|
98
|
+
const KEPT_BESIDE_LOCATOR = new Set(["status"]);
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Put a picked value at its path in the input. A locator (`….id`) replaces its siblings (the typed name and
|
|
102
|
+
* any search criteria, such as a pharmacy's `near`) but keeps the fields in KEPT_BESIDE_LOCATOR.
|
|
103
|
+
*/
|
|
95
104
|
export function applyAt<T>(input: T, path: string, value: unknown): T {
|
|
96
105
|
const segments = path.split(".").filter(Boolean);
|
|
97
106
|
const last = segments.at(-1)!;
|
|
98
107
|
if (segments.length > 1 && LOCATORS.has(last)) {
|
|
99
108
|
const parentPath = segments.slice(0, -1).join(".");
|
|
100
|
-
|
|
109
|
+
const parent = valueAt(input, segments.slice(0, -1));
|
|
110
|
+
const kept =
|
|
111
|
+
parent && typeof parent === "object" && !Array.isArray(parent)
|
|
112
|
+
? Object.fromEntries(Object.entries(parent).filter(([key]) => KEPT_BESIDE_LOCATOR.has(key)))
|
|
113
|
+
: {};
|
|
114
|
+
return setAtPath(input, parentPath, { ...kept, [last]: value });
|
|
101
115
|
}
|
|
102
116
|
return setAtPath(input, path, value);
|
|
103
117
|
}
|
|
118
|
+
|
|
119
|
+
function valueAt(input: unknown, segments: string[]): unknown {
|
|
120
|
+
let node = input;
|
|
121
|
+
for (const segment of segments) {
|
|
122
|
+
if (!node || typeof node !== "object") return undefined;
|
|
123
|
+
node = (node as Record<string, unknown>)[segment];
|
|
124
|
+
}
|
|
125
|
+
return node;
|
|
126
|
+
}
|
package/src/gql/gql.ts
CHANGED
|
@@ -15,7 +15,7 @@ import * as types from './graphql.js';
|
|
|
15
15
|
* Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
|
|
16
16
|
*/
|
|
17
17
|
type Documents = {
|
|
18
|
-
"fragment TreatmentFields on Treatment {\n id\n name\n rxNormId\n ndc\n upc\n entityKind\n prescribableName\n brandName\n genericName\n form\n route\n strength\n medicationType\n schedule\n}\n\nfragment ChoiceFields on Choice {\n __typename\n displayName\n reason\n operation\n argument\n value\n matchReasons {\n type\n label\n confidence\n value {\n displayValue\n value\n unit\n }\n }\n entity {\n __typename\n ... on Treatment {\n ...TreatmentFields\n templates {\n ...PrescriptionTemplateFields\n }\n }\n ... on Pharmacy {\n ...PharmacyFields\n }\n }\n}\n\nfragment PharmacyOfferFields on PharmacyOffer {\n source\n prescriptionId\n priceType\n isPromoted\n attributeTags {\n kind\n label\n }\n price {\n amount\n retailAmount\n promotions {\n type\n baseAmount\n amountSaved\n }\n }\n deliveryEstimate {\n deliveryPromise\n deliveryPromiseRangeStart\n deliveryPromiseRangeEnd\n }\n redemptionState\n redemptionMethods {\n ...RedemptionMethodFields\n }\n}\n\nfragment RedemptionMethodFields on RedemptionMethod {\n __typename\n ... on PharmacyDiscountCard {\n id\n prescriptionId\n bin\n pcn\n group\n memberId\n externalUrl\n }\n}\n\nfragment ChangeFields on Change {\n key\n label\n status\n severity\n reason\n category\n operation\n options {\n ...ChoiceFields\n }\n before {\n ...ChoiceFields\n }\n after {\n ...ChoiceFields\n }\n}\n\nfragment ChangeSetFields on ChangeSet {\n changes {\n ...ChangeFields\n }\n}\n\nfragment OperationErrorFields on OperationError {\n __typename\n type\n code\n message\n requiredPermission\n service\n retryable\n}\n\nfragment PharmacyFields on Pharmacy {\n id\n name\n logo\n phone\n hours {\n openFrom\n openUntil\n dayOfWeek\n is24Hr\n timezone\n }\n isOpen\n nextEvents {\n open {\n ...PharmacyEventFields\n }\n close {\n ...PharmacyEventFields\n }\n }\n address {\n street1\n street2\n city\n state\n postalCode\n }\n latitude\n longitude\n fulfillmentType\n offers {\n ...PharmacyOfferFields\n }\n}\n\nfragment PharmacyEventFields on PharmacyEvent {\n __typename\n ... on PharmacyOpenEvent {\n type\n datetime\n }\n ... on PharmacyCloseEvent {\n type\n datetime\n }\n ... on PharmacyOpen24HrEvent {\n type\n }\n}\n\nfragment OrganizationFields on Organization {\n id\n name\n customer {\n __typename\n ... on Customer {\n id\n name\n }\n }\n settings {\n brandColor\n brandLogo\n priorAuthorizationExceptionMessage\n patientUx {\n enablePatientRerouting\n enableAutomatedOps\n }\n }\n}\n\nfragment PatientDemographicFields on PatientDemographic {\n name {\n first\n middle\n last\n }\n dateOfBirth\n sex\n gender\n}\n\nfragment PatientContactFields on PatientContact {\n email\n phone\n address {\n street1\n street2\n city\n state\n postalCode\n country\n }\n}\n\nfragment PatientFields on Patient {\n id\n demographic {\n ...PatientDemographicFields\n }\n contact {\n ...PatientContactFields\n }\n benefits {\n status\n entries {\n id\n bin\n pcn\n groupId\n memberId\n }\n }\n preferredPharmacy {\n ...PharmacyFields\n }\n clinical {\n allergies {\n status\n entries {\n id\n name\n rxNormId\n }\n }\n medications {\n status\n entries {\n id\n name\n rxNormId\n status\n }\n }\n diagnoses {\n status\n entries {\n id\n name\n icd10Code\n }\n }\n notes\n }\n}\n\nfragment PatientRecordFields on PatientRecordResult {\n __typename\n ... on Patient {\n ...PatientFields\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment ScreeningAlertFields on ScreeningAlert {\n severity\n type\n description\n category\n involvedEntities {\n id\n name\n }\n options {\n ...ChoiceFields\n }\n}\n\nfragment PrescriptionFields on Prescription {\n id\n prescriber {\n id\n name {\n first\n middle\n last\n }\n }\n fulfillment {\n state\n pharmacyEstimatedReadyAt\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n templateId\n patient {\n id\n }\n treatment {\n ...TreatmentFields\n }\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n clinical {\n diagnoses {\n id\n name\n icd10Code\n }\n notes\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n signing {\n state\n contentHash\n message\n signedAt\n }\n}\n\nfragment OrderFields on Order {\n id\n state\n offers {\n atPharmacy {\n ...PharmacyOfferFields\n }\n }\n organization {\n __typename\n ... on Organization {\n ...OrganizationFields\n }\n }\n patient {\n ...PatientRecordFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n pharmacy {\n ...PharmacyFields\n }\n fulfillment {\n state\n history {\n pharmacy {\n ...PharmacyFields\n }\n selector\n reason\n createdAt\n }\n routability {\n allowed\n reason\n }\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n}\n\nfragment PrescriptionTemplateFields on PrescriptionTemplate {\n id\n source\n name\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n}\n\nfragment PatientResultFields on PatientResult {\n __typename\n ... on PatientPayload {\n patient {\n ...PatientRecordFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPatientMatch {\n reason\n candidates {\n id\n firstName\n lastName\n dateOfBirth\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment PrescriptionResultFields on PrescriptionResult {\n __typename\n ... on PrescriptionPayload {\n prescription {\n ...PrescriptionFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPrescriptionMatch {\n reason\n candidates {\n id\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment OrderCandidateFields on OrderCandidate {\n id\n pharmacy {\n ...PharmacyFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n}\n\nfragment OrderResultFields on OrderResult {\n __typename\n ... on OrderPayload {\n order {\n ...OrderFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousOrderMatch {\n reason\n candidates {\n ...OrderCandidateFields\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}": typeof types.TreatmentFieldsFragmentDoc,
|
|
18
|
+
"fragment TreatmentFields on Treatment {\n id\n name\n rxNormId\n ndc\n upc\n entityKind\n prescribableName\n brandName\n genericName\n form\n route\n strength\n medicationType\n schedule\n}\n\nfragment ChoiceFields on Choice {\n __typename\n displayName\n reason\n operation\n argument\n value\n matchReasons {\n type\n label\n confidence\n value {\n displayValue\n value\n unit\n }\n }\n entity {\n __typename\n ... on Treatment {\n ...TreatmentFields\n templates {\n ...PrescriptionTemplateFields\n }\n }\n ... on Pharmacy {\n ...PharmacyFields\n }\n }\n}\n\nfragment PharmacyOfferFields on PharmacyOffer {\n source\n prescriptionId\n priceType\n isPromoted\n attributeTags {\n kind\n label\n }\n price {\n amount\n retailAmount\n promotions {\n type\n baseAmount\n amountSaved\n }\n }\n deliveryEstimate {\n deliveryPromise\n deliveryPromiseRangeStart\n deliveryPromiseRangeEnd\n }\n redemptionState\n redemptionMethods {\n ...RedemptionMethodFields\n }\n}\n\nfragment RedemptionMethodFields on RedemptionMethod {\n __typename\n ... on PharmacyDiscountCard {\n id\n prescriptionId\n bin\n pcn\n group\n memberId\n externalUrl\n }\n ... on ProgramEnrollmentLink {\n url\n }\n}\n\nfragment ChangeFields on Change {\n key\n label\n status\n severity\n reason\n category\n operation\n options {\n ...ChoiceFields\n }\n before {\n ...ChoiceFields\n }\n after {\n ...ChoiceFields\n }\n}\n\nfragment ChangeSetFields on ChangeSet {\n changes {\n ...ChangeFields\n }\n}\n\nfragment OperationErrorFields on OperationError {\n __typename\n type\n code\n message\n requiredPermission\n service\n retryable\n}\n\nfragment PharmacyFields on Pharmacy {\n id\n name\n logo\n phone\n hours {\n openFrom\n openUntil\n dayOfWeek\n is24Hr\n timezone\n }\n isOpen\n nextEvents {\n open {\n ...PharmacyEventFields\n }\n close {\n ...PharmacyEventFields\n }\n }\n address {\n street1\n street2\n city\n state\n postalCode\n }\n latitude\n longitude\n fulfillmentType\n offers {\n ...PharmacyOfferFields\n }\n}\n\nfragment PharmacyEventFields on PharmacyEvent {\n __typename\n ... on PharmacyOpenEvent {\n type\n datetime\n }\n ... on PharmacyCloseEvent {\n type\n datetime\n }\n ... on PharmacyOpen24HrEvent {\n type\n }\n}\n\nfragment OrganizationFields on Organization {\n id\n name\n customer {\n __typename\n ... on Customer {\n id\n name\n }\n }\n settings {\n brandColor\n brandLogo\n priorAuthorizationExceptionMessage\n patientUx {\n enablePatientRerouting\n enableAutomatedOps\n }\n }\n}\n\nfragment PatientDemographicFields on PatientDemographic {\n name {\n first\n middle\n last\n }\n dateOfBirth\n sex\n gender\n}\n\nfragment PatientContactFields on PatientContact {\n email\n phone\n address {\n street1\n street2\n city\n state\n postalCode\n country\n }\n}\n\nfragment PatientFields on Patient {\n id\n demographic {\n ...PatientDemographicFields\n }\n contact {\n ...PatientContactFields\n }\n benefits {\n status\n entries {\n id\n bin\n pcn\n groupId\n memberId\n }\n }\n preferredPharmacy {\n ...PharmacyFields\n }\n clinical {\n allergies {\n status\n entries {\n id\n name\n rxNormId\n }\n }\n medications {\n status\n entries {\n id\n name\n rxNormId\n status\n }\n }\n diagnoses {\n status\n entries {\n id\n name\n icd10Code\n }\n }\n notes\n }\n}\n\nfragment PatientRecordFields on PatientRecordResult {\n __typename\n ... on Patient {\n ...PatientFields\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment ScreeningAlertFields on ScreeningAlert {\n severity\n type\n description\n category\n involvedEntities {\n id\n name\n }\n options {\n ...ChoiceFields\n }\n}\n\nfragment PrescriptionFields on Prescription {\n id\n prescriber {\n id\n name {\n first\n middle\n last\n }\n }\n fulfillment {\n state\n pharmacyEstimatedReadyAt\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n templateId\n patient {\n id\n }\n treatment {\n ...TreatmentFields\n }\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n clinical {\n diagnoses {\n id\n name\n icd10Code\n }\n notes\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n signing {\n state\n contentHash\n message\n signedAt\n }\n}\n\nfragment OrderFields on Order {\n id\n state\n offers {\n atPharmacy {\n ...PharmacyOfferFields\n }\n }\n organization {\n __typename\n ... on Organization {\n ...OrganizationFields\n }\n }\n patient {\n ...PatientRecordFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n pharmacy {\n ...PharmacyFields\n }\n fulfillment {\n state\n history {\n pharmacy {\n ...PharmacyFields\n }\n selector\n reason\n createdAt\n }\n routability {\n allowed\n reason\n }\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n}\n\nfragment PrescriptionTemplateFields on PrescriptionTemplate {\n id\n source\n name\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n}\n\nfragment PatientResultFields on PatientResult {\n __typename\n ... on PatientPayload {\n patient {\n ...PatientRecordFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPatientMatch {\n reason\n candidates {\n id\n firstName\n lastName\n dateOfBirth\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment PrescriptionResultFields on PrescriptionResult {\n __typename\n ... on PrescriptionPayload {\n prescription {\n ...PrescriptionFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPrescriptionMatch {\n reason\n candidates {\n id\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment OrderCandidateFields on OrderCandidate {\n id\n pharmacy {\n ...PharmacyFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n}\n\nfragment OrderResultFields on OrderResult {\n __typename\n ... on OrderPayload {\n order {\n ...OrderFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousOrderMatch {\n reason\n candidates {\n ...OrderCandidateFields\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}": typeof types.TreatmentFieldsFragmentDoc,
|
|
19
19
|
"query Ping {\n ping\n}": typeof types.PingDocument,
|
|
20
20
|
"query Me {\n me {\n __typename\n ... on User {\n id\n name {\n first\n last\n }\n organization {\n __typename\n ... on Organization {\n id\n name\n }\n }\n permissions\n }\n ... on Patient {\n id\n name {\n first\n last\n }\n }\n ... on Machine {\n organization {\n __typename\n ... on Organization {\n id\n name\n }\n }\n permissions\n }\n ...OperationErrorFields\n }\n}": typeof types.MeDocument,
|
|
21
21
|
"mutation GetOrder($id: ID!, $metadata: RequestMetadata!) {\n order(order: {id: $id}, metadata: $metadata) {\n ...OrderResultFields\n }\n}\n\nmutation SyncOrder($id: ID, $patient: PatientReferenceInput, $prescriptions: OrderPrescriptionsPatch, $pharmacy: OrderPharmacyInput, $metadata: RequestMetadata!) {\n order(\n order: {id: $id, patient: $patient, prescriptions: $prescriptions, pharmacy: $pharmacy}\n metadata: $metadata\n ) {\n ...OrderResultFields\n }\n}\n\nmutation UpdateOrder($id: ID!, $prescriptions: OrderPrescriptionsPatch, $state: OrderState, $pharmacy: OrderPharmacyInput, $metadata: RequestMetadata!) {\n order(\n order: {id: $id, prescriptions: $prescriptions, state: $state, pharmacy: $pharmacy}\n metadata: $metadata\n ) {\n ...OrderResultFields\n }\n}": typeof types.GetOrderDocument,
|
|
@@ -24,7 +24,7 @@ type Documents = {
|
|
|
24
24
|
"mutation GetPrescription($id: ID!, $metadata: RequestMetadata!) {\n prescription(prescription: {id: $id}, metadata: $metadata) {\n ...PrescriptionResultFields\n }\n}\n\nmutation GetPrescriptionTemplates($id: ID!, $metadata: RequestMetadata!) {\n prescription(prescription: {id: $id}, metadata: $metadata) {\n __typename\n ... on PrescriptionPayload {\n prescription {\n treatment {\n templates {\n ...PrescriptionTemplateFields\n }\n }\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n }\n}\n\nmutation SyncPrescription($id: ID, $externalId: String, $patient: PatientReferenceInput, $treatment: TreatmentReferenceInput, $templateId: ID, $instructions: String, $dispense: DispenseInput, $clinical: PrescriptionClinicalInput, $metadata: RequestMetadata!) {\n prescription(\n prescription: {id: $id, externalId: $externalId, patient: $patient, treatment: $treatment, templateId: $templateId, instructions: $instructions, dispense: $dispense, clinical: $clinical}\n metadata: $metadata\n ) {\n ...PrescriptionResultFields\n }\n}\n\nmutation UpdatePrescription($id: ID!, $externalId: String, $treatment: TreatmentReferenceInput, $instructions: String, $dispense: DispenseInput, $clinical: PrescriptionClinicalInput, $signing: PrescriptionSigningDetailsInput, $metadata: RequestMetadata!) {\n prescription(\n prescription: {id: $id, externalId: $externalId, treatment: $treatment, instructions: $instructions, dispense: $dispense, clinical: $clinical, signing: $signing}\n metadata: $metadata\n ) {\n ...PrescriptionResultFields\n }\n}": typeof types.GetPrescriptionDocument,
|
|
25
25
|
};
|
|
26
26
|
const documents: Documents = {
|
|
27
|
-
"fragment TreatmentFields on Treatment {\n id\n name\n rxNormId\n ndc\n upc\n entityKind\n prescribableName\n brandName\n genericName\n form\n route\n strength\n medicationType\n schedule\n}\n\nfragment ChoiceFields on Choice {\n __typename\n displayName\n reason\n operation\n argument\n value\n matchReasons {\n type\n label\n confidence\n value {\n displayValue\n value\n unit\n }\n }\n entity {\n __typename\n ... on Treatment {\n ...TreatmentFields\n templates {\n ...PrescriptionTemplateFields\n }\n }\n ... on Pharmacy {\n ...PharmacyFields\n }\n }\n}\n\nfragment PharmacyOfferFields on PharmacyOffer {\n source\n prescriptionId\n priceType\n isPromoted\n attributeTags {\n kind\n label\n }\n price {\n amount\n retailAmount\n promotions {\n type\n baseAmount\n amountSaved\n }\n }\n deliveryEstimate {\n deliveryPromise\n deliveryPromiseRangeStart\n deliveryPromiseRangeEnd\n }\n redemptionState\n redemptionMethods {\n ...RedemptionMethodFields\n }\n}\n\nfragment RedemptionMethodFields on RedemptionMethod {\n __typename\n ... on PharmacyDiscountCard {\n id\n prescriptionId\n bin\n pcn\n group\n memberId\n externalUrl\n }\n}\n\nfragment ChangeFields on Change {\n key\n label\n status\n severity\n reason\n category\n operation\n options {\n ...ChoiceFields\n }\n before {\n ...ChoiceFields\n }\n after {\n ...ChoiceFields\n }\n}\n\nfragment ChangeSetFields on ChangeSet {\n changes {\n ...ChangeFields\n }\n}\n\nfragment OperationErrorFields on OperationError {\n __typename\n type\n code\n message\n requiredPermission\n service\n retryable\n}\n\nfragment PharmacyFields on Pharmacy {\n id\n name\n logo\n phone\n hours {\n openFrom\n openUntil\n dayOfWeek\n is24Hr\n timezone\n }\n isOpen\n nextEvents {\n open {\n ...PharmacyEventFields\n }\n close {\n ...PharmacyEventFields\n }\n }\n address {\n street1\n street2\n city\n state\n postalCode\n }\n latitude\n longitude\n fulfillmentType\n offers {\n ...PharmacyOfferFields\n }\n}\n\nfragment PharmacyEventFields on PharmacyEvent {\n __typename\n ... on PharmacyOpenEvent {\n type\n datetime\n }\n ... on PharmacyCloseEvent {\n type\n datetime\n }\n ... on PharmacyOpen24HrEvent {\n type\n }\n}\n\nfragment OrganizationFields on Organization {\n id\n name\n customer {\n __typename\n ... on Customer {\n id\n name\n }\n }\n settings {\n brandColor\n brandLogo\n priorAuthorizationExceptionMessage\n patientUx {\n enablePatientRerouting\n enableAutomatedOps\n }\n }\n}\n\nfragment PatientDemographicFields on PatientDemographic {\n name {\n first\n middle\n last\n }\n dateOfBirth\n sex\n gender\n}\n\nfragment PatientContactFields on PatientContact {\n email\n phone\n address {\n street1\n street2\n city\n state\n postalCode\n country\n }\n}\n\nfragment PatientFields on Patient {\n id\n demographic {\n ...PatientDemographicFields\n }\n contact {\n ...PatientContactFields\n }\n benefits {\n status\n entries {\n id\n bin\n pcn\n groupId\n memberId\n }\n }\n preferredPharmacy {\n ...PharmacyFields\n }\n clinical {\n allergies {\n status\n entries {\n id\n name\n rxNormId\n }\n }\n medications {\n status\n entries {\n id\n name\n rxNormId\n status\n }\n }\n diagnoses {\n status\n entries {\n id\n name\n icd10Code\n }\n }\n notes\n }\n}\n\nfragment PatientRecordFields on PatientRecordResult {\n __typename\n ... on Patient {\n ...PatientFields\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment ScreeningAlertFields on ScreeningAlert {\n severity\n type\n description\n category\n involvedEntities {\n id\n name\n }\n options {\n ...ChoiceFields\n }\n}\n\nfragment PrescriptionFields on Prescription {\n id\n prescriber {\n id\n name {\n first\n middle\n last\n }\n }\n fulfillment {\n state\n pharmacyEstimatedReadyAt\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n templateId\n patient {\n id\n }\n treatment {\n ...TreatmentFields\n }\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n clinical {\n diagnoses {\n id\n name\n icd10Code\n }\n notes\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n signing {\n state\n contentHash\n message\n signedAt\n }\n}\n\nfragment OrderFields on Order {\n id\n state\n offers {\n atPharmacy {\n ...PharmacyOfferFields\n }\n }\n organization {\n __typename\n ... on Organization {\n ...OrganizationFields\n }\n }\n patient {\n ...PatientRecordFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n pharmacy {\n ...PharmacyFields\n }\n fulfillment {\n state\n history {\n pharmacy {\n ...PharmacyFields\n }\n selector\n reason\n createdAt\n }\n routability {\n allowed\n reason\n }\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n}\n\nfragment PrescriptionTemplateFields on PrescriptionTemplate {\n id\n source\n name\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n}\n\nfragment PatientResultFields on PatientResult {\n __typename\n ... on PatientPayload {\n patient {\n ...PatientRecordFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPatientMatch {\n reason\n candidates {\n id\n firstName\n lastName\n dateOfBirth\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment PrescriptionResultFields on PrescriptionResult {\n __typename\n ... on PrescriptionPayload {\n prescription {\n ...PrescriptionFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPrescriptionMatch {\n reason\n candidates {\n id\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment OrderCandidateFields on OrderCandidate {\n id\n pharmacy {\n ...PharmacyFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n}\n\nfragment OrderResultFields on OrderResult {\n __typename\n ... on OrderPayload {\n order {\n ...OrderFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousOrderMatch {\n reason\n candidates {\n ...OrderCandidateFields\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}": types.TreatmentFieldsFragmentDoc,
|
|
27
|
+
"fragment TreatmentFields on Treatment {\n id\n name\n rxNormId\n ndc\n upc\n entityKind\n prescribableName\n brandName\n genericName\n form\n route\n strength\n medicationType\n schedule\n}\n\nfragment ChoiceFields on Choice {\n __typename\n displayName\n reason\n operation\n argument\n value\n matchReasons {\n type\n label\n confidence\n value {\n displayValue\n value\n unit\n }\n }\n entity {\n __typename\n ... on Treatment {\n ...TreatmentFields\n templates {\n ...PrescriptionTemplateFields\n }\n }\n ... on Pharmacy {\n ...PharmacyFields\n }\n }\n}\n\nfragment PharmacyOfferFields on PharmacyOffer {\n source\n prescriptionId\n priceType\n isPromoted\n attributeTags {\n kind\n label\n }\n price {\n amount\n retailAmount\n promotions {\n type\n baseAmount\n amountSaved\n }\n }\n deliveryEstimate {\n deliveryPromise\n deliveryPromiseRangeStart\n deliveryPromiseRangeEnd\n }\n redemptionState\n redemptionMethods {\n ...RedemptionMethodFields\n }\n}\n\nfragment RedemptionMethodFields on RedemptionMethod {\n __typename\n ... on PharmacyDiscountCard {\n id\n prescriptionId\n bin\n pcn\n group\n memberId\n externalUrl\n }\n ... on ProgramEnrollmentLink {\n url\n }\n}\n\nfragment ChangeFields on Change {\n key\n label\n status\n severity\n reason\n category\n operation\n options {\n ...ChoiceFields\n }\n before {\n ...ChoiceFields\n }\n after {\n ...ChoiceFields\n }\n}\n\nfragment ChangeSetFields on ChangeSet {\n changes {\n ...ChangeFields\n }\n}\n\nfragment OperationErrorFields on OperationError {\n __typename\n type\n code\n message\n requiredPermission\n service\n retryable\n}\n\nfragment PharmacyFields on Pharmacy {\n id\n name\n logo\n phone\n hours {\n openFrom\n openUntil\n dayOfWeek\n is24Hr\n timezone\n }\n isOpen\n nextEvents {\n open {\n ...PharmacyEventFields\n }\n close {\n ...PharmacyEventFields\n }\n }\n address {\n street1\n street2\n city\n state\n postalCode\n }\n latitude\n longitude\n fulfillmentType\n offers {\n ...PharmacyOfferFields\n }\n}\n\nfragment PharmacyEventFields on PharmacyEvent {\n __typename\n ... on PharmacyOpenEvent {\n type\n datetime\n }\n ... on PharmacyCloseEvent {\n type\n datetime\n }\n ... on PharmacyOpen24HrEvent {\n type\n }\n}\n\nfragment OrganizationFields on Organization {\n id\n name\n customer {\n __typename\n ... on Customer {\n id\n name\n }\n }\n settings {\n brandColor\n brandLogo\n priorAuthorizationExceptionMessage\n patientUx {\n enablePatientRerouting\n enableAutomatedOps\n }\n }\n}\n\nfragment PatientDemographicFields on PatientDemographic {\n name {\n first\n middle\n last\n }\n dateOfBirth\n sex\n gender\n}\n\nfragment PatientContactFields on PatientContact {\n email\n phone\n address {\n street1\n street2\n city\n state\n postalCode\n country\n }\n}\n\nfragment PatientFields on Patient {\n id\n demographic {\n ...PatientDemographicFields\n }\n contact {\n ...PatientContactFields\n }\n benefits {\n status\n entries {\n id\n bin\n pcn\n groupId\n memberId\n }\n }\n preferredPharmacy {\n ...PharmacyFields\n }\n clinical {\n allergies {\n status\n entries {\n id\n name\n rxNormId\n }\n }\n medications {\n status\n entries {\n id\n name\n rxNormId\n status\n }\n }\n diagnoses {\n status\n entries {\n id\n name\n icd10Code\n }\n }\n notes\n }\n}\n\nfragment PatientRecordFields on PatientRecordResult {\n __typename\n ... on Patient {\n ...PatientFields\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment ScreeningAlertFields on ScreeningAlert {\n severity\n type\n description\n category\n involvedEntities {\n id\n name\n }\n options {\n ...ChoiceFields\n }\n}\n\nfragment PrescriptionFields on Prescription {\n id\n prescriber {\n id\n name {\n first\n middle\n last\n }\n }\n fulfillment {\n state\n pharmacyEstimatedReadyAt\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n templateId\n patient {\n id\n }\n treatment {\n ...TreatmentFields\n }\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n clinical {\n diagnoses {\n id\n name\n icd10Code\n }\n notes\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n signing {\n state\n contentHash\n message\n signedAt\n }\n}\n\nfragment OrderFields on Order {\n id\n state\n offers {\n atPharmacy {\n ...PharmacyOfferFields\n }\n }\n organization {\n __typename\n ... on Organization {\n ...OrganizationFields\n }\n }\n patient {\n ...PatientRecordFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n pharmacy {\n ...PharmacyFields\n }\n fulfillment {\n state\n history {\n pharmacy {\n ...PharmacyFields\n }\n selector\n reason\n createdAt\n }\n routability {\n allowed\n reason\n }\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n}\n\nfragment PrescriptionTemplateFields on PrescriptionTemplate {\n id\n source\n name\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n}\n\nfragment PatientResultFields on PatientResult {\n __typename\n ... on PatientPayload {\n patient {\n ...PatientRecordFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPatientMatch {\n reason\n candidates {\n id\n firstName\n lastName\n dateOfBirth\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment PrescriptionResultFields on PrescriptionResult {\n __typename\n ... on PrescriptionPayload {\n prescription {\n ...PrescriptionFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPrescriptionMatch {\n reason\n candidates {\n id\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment OrderCandidateFields on OrderCandidate {\n id\n pharmacy {\n ...PharmacyFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n}\n\nfragment OrderResultFields on OrderResult {\n __typename\n ... on OrderPayload {\n order {\n ...OrderFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousOrderMatch {\n reason\n candidates {\n ...OrderCandidateFields\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}": types.TreatmentFieldsFragmentDoc,
|
|
28
28
|
"query Ping {\n ping\n}": types.PingDocument,
|
|
29
29
|
"query Me {\n me {\n __typename\n ... on User {\n id\n name {\n first\n last\n }\n organization {\n __typename\n ... on Organization {\n id\n name\n }\n }\n permissions\n }\n ... on Patient {\n id\n name {\n first\n last\n }\n }\n ... on Machine {\n organization {\n __typename\n ... on Organization {\n id\n name\n }\n }\n permissions\n }\n ...OperationErrorFields\n }\n}": types.MeDocument,
|
|
30
30
|
"mutation GetOrder($id: ID!, $metadata: RequestMetadata!) {\n order(order: {id: $id}, metadata: $metadata) {\n ...OrderResultFields\n }\n}\n\nmutation SyncOrder($id: ID, $patient: PatientReferenceInput, $prescriptions: OrderPrescriptionsPatch, $pharmacy: OrderPharmacyInput, $metadata: RequestMetadata!) {\n order(\n order: {id: $id, patient: $patient, prescriptions: $prescriptions, pharmacy: $pharmacy}\n metadata: $metadata\n ) {\n ...OrderResultFields\n }\n}\n\nmutation UpdateOrder($id: ID!, $prescriptions: OrderPrescriptionsPatch, $state: OrderState, $pharmacy: OrderPharmacyInput, $metadata: RequestMetadata!) {\n order(\n order: {id: $id, prescriptions: $prescriptions, state: $state, pharmacy: $pharmacy}\n metadata: $metadata\n ) {\n ...OrderResultFields\n }\n}": types.GetOrderDocument,
|
|
@@ -36,7 +36,7 @@ const documents: Documents = {
|
|
|
36
36
|
/**
|
|
37
37
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
38
38
|
*/
|
|
39
|
-
export function graphql(source: "fragment TreatmentFields on Treatment {\n id\n name\n rxNormId\n ndc\n upc\n entityKind\n prescribableName\n brandName\n genericName\n form\n route\n strength\n medicationType\n schedule\n}\n\nfragment ChoiceFields on Choice {\n __typename\n displayName\n reason\n operation\n argument\n value\n matchReasons {\n type\n label\n confidence\n value {\n displayValue\n value\n unit\n }\n }\n entity {\n __typename\n ... on Treatment {\n ...TreatmentFields\n templates {\n ...PrescriptionTemplateFields\n }\n }\n ... on Pharmacy {\n ...PharmacyFields\n }\n }\n}\n\nfragment PharmacyOfferFields on PharmacyOffer {\n source\n prescriptionId\n priceType\n isPromoted\n attributeTags {\n kind\n label\n }\n price {\n amount\n retailAmount\n promotions {\n type\n baseAmount\n amountSaved\n }\n }\n deliveryEstimate {\n deliveryPromise\n deliveryPromiseRangeStart\n deliveryPromiseRangeEnd\n }\n redemptionState\n redemptionMethods {\n ...RedemptionMethodFields\n }\n}\n\nfragment RedemptionMethodFields on RedemptionMethod {\n __typename\n ... on PharmacyDiscountCard {\n id\n prescriptionId\n bin\n pcn\n group\n memberId\n externalUrl\n }\n}\n\nfragment ChangeFields on Change {\n key\n label\n status\n severity\n reason\n category\n operation\n options {\n ...ChoiceFields\n }\n before {\n ...ChoiceFields\n }\n after {\n ...ChoiceFields\n }\n}\n\nfragment ChangeSetFields on ChangeSet {\n changes {\n ...ChangeFields\n }\n}\n\nfragment OperationErrorFields on OperationError {\n __typename\n type\n code\n message\n requiredPermission\n service\n retryable\n}\n\nfragment PharmacyFields on Pharmacy {\n id\n name\n logo\n phone\n hours {\n openFrom\n openUntil\n dayOfWeek\n is24Hr\n timezone\n }\n isOpen\n nextEvents {\n open {\n ...PharmacyEventFields\n }\n close {\n ...PharmacyEventFields\n }\n }\n address {\n street1\n street2\n city\n state\n postalCode\n }\n latitude\n longitude\n fulfillmentType\n offers {\n ...PharmacyOfferFields\n }\n}\n\nfragment PharmacyEventFields on PharmacyEvent {\n __typename\n ... on PharmacyOpenEvent {\n type\n datetime\n }\n ... on PharmacyCloseEvent {\n type\n datetime\n }\n ... on PharmacyOpen24HrEvent {\n type\n }\n}\n\nfragment OrganizationFields on Organization {\n id\n name\n customer {\n __typename\n ... on Customer {\n id\n name\n }\n }\n settings {\n brandColor\n brandLogo\n priorAuthorizationExceptionMessage\n patientUx {\n enablePatientRerouting\n enableAutomatedOps\n }\n }\n}\n\nfragment PatientDemographicFields on PatientDemographic {\n name {\n first\n middle\n last\n }\n dateOfBirth\n sex\n gender\n}\n\nfragment PatientContactFields on PatientContact {\n email\n phone\n address {\n street1\n street2\n city\n state\n postalCode\n country\n }\n}\n\nfragment PatientFields on Patient {\n id\n demographic {\n ...PatientDemographicFields\n }\n contact {\n ...PatientContactFields\n }\n benefits {\n status\n entries {\n id\n bin\n pcn\n groupId\n memberId\n }\n }\n preferredPharmacy {\n ...PharmacyFields\n }\n clinical {\n allergies {\n status\n entries {\n id\n name\n rxNormId\n }\n }\n medications {\n status\n entries {\n id\n name\n rxNormId\n status\n }\n }\n diagnoses {\n status\n entries {\n id\n name\n icd10Code\n }\n }\n notes\n }\n}\n\nfragment PatientRecordFields on PatientRecordResult {\n __typename\n ... on Patient {\n ...PatientFields\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment ScreeningAlertFields on ScreeningAlert {\n severity\n type\n description\n category\n involvedEntities {\n id\n name\n }\n options {\n ...ChoiceFields\n }\n}\n\nfragment PrescriptionFields on Prescription {\n id\n prescriber {\n id\n name {\n first\n middle\n last\n }\n }\n fulfillment {\n state\n pharmacyEstimatedReadyAt\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n templateId\n patient {\n id\n }\n treatment {\n ...TreatmentFields\n }\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n clinical {\n diagnoses {\n id\n name\n icd10Code\n }\n notes\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n signing {\n state\n contentHash\n message\n signedAt\n }\n}\n\nfragment OrderFields on Order {\n id\n state\n offers {\n atPharmacy {\n ...PharmacyOfferFields\n }\n }\n organization {\n __typename\n ... on Organization {\n ...OrganizationFields\n }\n }\n patient {\n ...PatientRecordFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n pharmacy {\n ...PharmacyFields\n }\n fulfillment {\n state\n history {\n pharmacy {\n ...PharmacyFields\n }\n selector\n reason\n createdAt\n }\n routability {\n allowed\n reason\n }\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n}\n\nfragment PrescriptionTemplateFields on PrescriptionTemplate {\n id\n source\n name\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n}\n\nfragment PatientResultFields on PatientResult {\n __typename\n ... on PatientPayload {\n patient {\n ...PatientRecordFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPatientMatch {\n reason\n candidates {\n id\n firstName\n lastName\n dateOfBirth\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment PrescriptionResultFields on PrescriptionResult {\n __typename\n ... on PrescriptionPayload {\n prescription {\n ...PrescriptionFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPrescriptionMatch {\n reason\n candidates {\n id\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment OrderCandidateFields on OrderCandidate {\n id\n pharmacy {\n ...PharmacyFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n}\n\nfragment OrderResultFields on OrderResult {\n __typename\n ... on OrderPayload {\n order {\n ...OrderFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousOrderMatch {\n reason\n candidates {\n ...OrderCandidateFields\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}"): typeof import('./graphql.js').TreatmentFieldsFragmentDoc;
|
|
39
|
+
export function graphql(source: "fragment TreatmentFields on Treatment {\n id\n name\n rxNormId\n ndc\n upc\n entityKind\n prescribableName\n brandName\n genericName\n form\n route\n strength\n medicationType\n schedule\n}\n\nfragment ChoiceFields on Choice {\n __typename\n displayName\n reason\n operation\n argument\n value\n matchReasons {\n type\n label\n confidence\n value {\n displayValue\n value\n unit\n }\n }\n entity {\n __typename\n ... on Treatment {\n ...TreatmentFields\n templates {\n ...PrescriptionTemplateFields\n }\n }\n ... on Pharmacy {\n ...PharmacyFields\n }\n }\n}\n\nfragment PharmacyOfferFields on PharmacyOffer {\n source\n prescriptionId\n priceType\n isPromoted\n attributeTags {\n kind\n label\n }\n price {\n amount\n retailAmount\n promotions {\n type\n baseAmount\n amountSaved\n }\n }\n deliveryEstimate {\n deliveryPromise\n deliveryPromiseRangeStart\n deliveryPromiseRangeEnd\n }\n redemptionState\n redemptionMethods {\n ...RedemptionMethodFields\n }\n}\n\nfragment RedemptionMethodFields on RedemptionMethod {\n __typename\n ... on PharmacyDiscountCard {\n id\n prescriptionId\n bin\n pcn\n group\n memberId\n externalUrl\n }\n ... on ProgramEnrollmentLink {\n url\n }\n}\n\nfragment ChangeFields on Change {\n key\n label\n status\n severity\n reason\n category\n operation\n options {\n ...ChoiceFields\n }\n before {\n ...ChoiceFields\n }\n after {\n ...ChoiceFields\n }\n}\n\nfragment ChangeSetFields on ChangeSet {\n changes {\n ...ChangeFields\n }\n}\n\nfragment OperationErrorFields on OperationError {\n __typename\n type\n code\n message\n requiredPermission\n service\n retryable\n}\n\nfragment PharmacyFields on Pharmacy {\n id\n name\n logo\n phone\n hours {\n openFrom\n openUntil\n dayOfWeek\n is24Hr\n timezone\n }\n isOpen\n nextEvents {\n open {\n ...PharmacyEventFields\n }\n close {\n ...PharmacyEventFields\n }\n }\n address {\n street1\n street2\n city\n state\n postalCode\n }\n latitude\n longitude\n fulfillmentType\n offers {\n ...PharmacyOfferFields\n }\n}\n\nfragment PharmacyEventFields on PharmacyEvent {\n __typename\n ... on PharmacyOpenEvent {\n type\n datetime\n }\n ... on PharmacyCloseEvent {\n type\n datetime\n }\n ... on PharmacyOpen24HrEvent {\n type\n }\n}\n\nfragment OrganizationFields on Organization {\n id\n name\n customer {\n __typename\n ... on Customer {\n id\n name\n }\n }\n settings {\n brandColor\n brandLogo\n priorAuthorizationExceptionMessage\n patientUx {\n enablePatientRerouting\n enableAutomatedOps\n }\n }\n}\n\nfragment PatientDemographicFields on PatientDemographic {\n name {\n first\n middle\n last\n }\n dateOfBirth\n sex\n gender\n}\n\nfragment PatientContactFields on PatientContact {\n email\n phone\n address {\n street1\n street2\n city\n state\n postalCode\n country\n }\n}\n\nfragment PatientFields on Patient {\n id\n demographic {\n ...PatientDemographicFields\n }\n contact {\n ...PatientContactFields\n }\n benefits {\n status\n entries {\n id\n bin\n pcn\n groupId\n memberId\n }\n }\n preferredPharmacy {\n ...PharmacyFields\n }\n clinical {\n allergies {\n status\n entries {\n id\n name\n rxNormId\n }\n }\n medications {\n status\n entries {\n id\n name\n rxNormId\n status\n }\n }\n diagnoses {\n status\n entries {\n id\n name\n icd10Code\n }\n }\n notes\n }\n}\n\nfragment PatientRecordFields on PatientRecordResult {\n __typename\n ... on Patient {\n ...PatientFields\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment ScreeningAlertFields on ScreeningAlert {\n severity\n type\n description\n category\n involvedEntities {\n id\n name\n }\n options {\n ...ChoiceFields\n }\n}\n\nfragment PrescriptionFields on Prescription {\n id\n prescriber {\n id\n name {\n first\n middle\n last\n }\n }\n fulfillment {\n state\n pharmacyEstimatedReadyAt\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n templateId\n patient {\n id\n }\n treatment {\n ...TreatmentFields\n }\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n clinical {\n diagnoses {\n id\n name\n icd10Code\n }\n notes\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n signing {\n state\n contentHash\n message\n signedAt\n }\n}\n\nfragment OrderFields on Order {\n id\n state\n offers {\n atPharmacy {\n ...PharmacyOfferFields\n }\n }\n organization {\n __typename\n ... on Organization {\n ...OrganizationFields\n }\n }\n patient {\n ...PatientRecordFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n screeningAlerts {\n ...ScreeningAlertFields\n }\n pharmacy {\n ...PharmacyFields\n }\n fulfillment {\n state\n history {\n pharmacy {\n ...PharmacyFields\n }\n selector\n reason\n createdAt\n }\n routability {\n allowed\n reason\n }\n exceptions {\n id\n type\n message\n createdAt\n }\n }\n}\n\nfragment PrescriptionTemplateFields on PrescriptionTemplate {\n id\n source\n name\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n}\n\nfragment PatientResultFields on PatientResult {\n __typename\n ... on PatientPayload {\n patient {\n ...PatientRecordFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPatientMatch {\n reason\n candidates {\n id\n firstName\n lastName\n dateOfBirth\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment PrescriptionResultFields on PrescriptionResult {\n __typename\n ... on PrescriptionPayload {\n prescription {\n ...PrescriptionFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousPrescriptionMatch {\n reason\n candidates {\n id\n instructions\n dispense {\n quantity\n unit\n daysSupply\n refillsAllowed\n dispenseAsWritten\n }\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}\n\nfragment OrderCandidateFields on OrderCandidate {\n id\n pharmacy {\n ...PharmacyFields\n }\n prescriptions {\n ...PrescriptionFields\n }\n}\n\nfragment OrderResultFields on OrderResult {\n __typename\n ... on OrderPayload {\n order {\n ...OrderFields\n }\n ...ChangeSetFields\n }\n ... on AmbiguousOrderMatch {\n reason\n candidates {\n ...OrderCandidateFields\n }\n }\n ... on OperationError {\n ...OperationErrorFields\n }\n}"): typeof import('./graphql.js').TreatmentFieldsFragmentDoc;
|
|
40
40
|
/**
|
|
41
41
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
42
42
|
*/
|