@photonhealth/client 2.0.0-rc.1 → 2.0.0-rc.2

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.
Files changed (152) hide show
  1. package/README.md +150 -5
  2. package/dist/analytics/lifecycleEvents.d.ts +29 -0
  3. package/dist/analytics/lifecycleEvents.d.ts.map +1 -0
  4. package/dist/analytics/lifecycleEvents.js +72 -0
  5. package/dist/analytics/lifecycleEvents.js.map +1 -0
  6. package/dist/api/client.d.ts +6 -1
  7. package/dist/api/client.d.ts.map +1 -1
  8. package/dist/api/client.js +47 -33
  9. package/dist/api/client.js.map +1 -1
  10. package/dist/api/index.d.ts +2 -0
  11. package/dist/api/index.d.ts.map +1 -1
  12. package/dist/api/index.js +2 -0
  13. package/dist/api/index.js.map +1 -1
  14. package/dist/api/me.d.ts +37 -0
  15. package/dist/api/me.d.ts.map +1 -0
  16. package/dist/api/me.js +6 -0
  17. package/dist/api/me.js.map +1 -0
  18. package/dist/api/orders.d.ts +1047 -0
  19. package/dist/api/orders.d.ts.map +1 -0
  20. package/dist/api/orders.js +7 -0
  21. package/dist/api/orders.js.map +1 -0
  22. package/dist/api/patient.d.ts +5 -2
  23. package/dist/api/patient.d.ts.map +1 -1
  24. package/dist/api/patient.js +1 -1
  25. package/dist/api/patient.js.map +1 -1
  26. package/dist/api/prescription.d.ts +7 -1
  27. package/dist/api/prescription.d.ts.map +1 -1
  28. package/dist/api/prescription.js +10 -1
  29. package/dist/api/prescription.js.map +1 -1
  30. package/dist/gql/gql.d.ts +11 -3
  31. package/dist/gql/gql.d.ts.map +1 -1
  32. package/dist/gql/gql.js +5 -3
  33. package/dist/gql/gql.js.map +1 -1
  34. package/dist/gql/graphql.d.ts +10507 -1563
  35. package/dist/gql/graphql.d.ts.map +1 -1
  36. package/dist/gql/graphql.js +2984 -435
  37. package/dist/gql/graphql.js.map +1 -1
  38. package/dist/index.d.ts +1 -1
  39. package/dist/index.js +1 -1
  40. package/dist/meta/version.d.ts +2 -0
  41. package/dist/meta/version.d.ts.map +1 -0
  42. package/dist/meta/version.js +2 -0
  43. package/dist/meta/version.js.map +1 -0
  44. package/dist/photon/analytics.d.ts +39 -0
  45. package/dist/photon/analytics.d.ts.map +1 -0
  46. package/dist/photon/analytics.js +91 -0
  47. package/dist/photon/analytics.js.map +1 -0
  48. package/dist/photon/auth.d.ts +9 -5
  49. package/dist/photon/auth.d.ts.map +1 -1
  50. package/dist/photon/auth.js +2 -6
  51. package/dist/photon/auth.js.map +1 -1
  52. package/dist/photon/choices.d.ts +1 -1
  53. package/dist/photon/choices.js +2 -2
  54. package/dist/photon/choices.js.map +1 -1
  55. package/dist/photon/environments.d.ts +2 -1
  56. package/dist/photon/environments.d.ts.map +1 -1
  57. package/dist/photon/environments.js +2 -1
  58. package/dist/photon/environments.js.map +1 -1
  59. package/dist/photon/index.d.ts +6 -3
  60. package/dist/photon/index.d.ts.map +1 -1
  61. package/dist/photon/index.js +2 -1
  62. package/dist/photon/index.js.map +1 -1
  63. package/dist/photon/machine.d.ts +28 -0
  64. package/dist/photon/machine.d.ts.map +1 -0
  65. package/dist/photon/machine.js +53 -0
  66. package/dist/photon/machine.js.map +1 -0
  67. package/dist/photon/map.d.ts +6 -2
  68. package/dist/photon/map.d.ts.map +1 -1
  69. package/dist/photon/map.js +133 -33
  70. package/dist/photon/map.js.map +1 -1
  71. package/dist/photon/order.d.ts +21 -1
  72. package/dist/photon/order.d.ts.map +1 -1
  73. package/dist/photon/order.js +79 -12
  74. package/dist/photon/order.js.map +1 -1
  75. package/dist/photon/orders.d.ts +5 -0
  76. package/dist/photon/orders.d.ts.map +1 -0
  77. package/dist/photon/orders.js +39 -0
  78. package/dist/photon/orders.js.map +1 -0
  79. package/dist/photon/patient.d.ts +8 -6
  80. package/dist/photon/patient.d.ts.map +1 -1
  81. package/dist/photon/patient.js +61 -30
  82. package/dist/photon/patient.js.map +1 -1
  83. package/dist/photon/photon.d.ts +39 -1
  84. package/dist/photon/photon.d.ts.map +1 -1
  85. package/dist/photon/photon.js +85 -5
  86. package/dist/photon/photon.js.map +1 -1
  87. package/dist/photon/prescription.d.ts +17 -4
  88. package/dist/photon/prescription.d.ts.map +1 -1
  89. package/dist/photon/prescription.js +48 -11
  90. package/dist/photon/prescription.js.map +1 -1
  91. package/dist/photon/session.d.ts +15 -10
  92. package/dist/photon/session.d.ts.map +1 -1
  93. package/dist/photon/session.js +5 -3
  94. package/dist/photon/session.js.map +1 -1
  95. package/dist/photon/types.d.ts +278 -46
  96. package/dist/photon/types.d.ts.map +1 -1
  97. package/dist/test-utils/msw.d.ts +2 -2
  98. package/dist/test-utils/msw.d.ts.map +1 -1
  99. package/dist/test-utils/msw.js +5 -5
  100. package/dist/test-utils/msw.js.map +1 -1
  101. package/dist/testing/{scriptedClient.d.ts → fakeNetworkApiClient.d.ts} +5 -4
  102. package/dist/testing/fakeNetworkApiClient.d.ts.map +1 -0
  103. package/dist/testing/{scriptedClient.js → fakeNetworkApiClient.js} +8 -4
  104. package/dist/testing/fakeNetworkApiClient.js.map +1 -0
  105. package/dist/testing/fixtures.d.ts +1047 -0
  106. package/dist/testing/fixtures.d.ts.map +1 -1
  107. package/dist/testing/fixtures.js +47 -13
  108. package/dist/testing/fixtures.js.map +1 -1
  109. package/dist/testing.d.ts +4 -4
  110. package/dist/testing.d.ts.map +1 -1
  111. package/dist/testing.js +4 -4
  112. package/dist/testing.js.map +1 -1
  113. package/package.json +2 -2
  114. package/src/analytics/lifecycleEvents.test.ts +417 -0
  115. package/src/analytics/lifecycleEvents.ts +155 -0
  116. package/src/api/client.ts +71 -46
  117. package/src/api/index.ts +2 -0
  118. package/src/api/me.ts +7 -0
  119. package/src/api/orders.ts +8 -0
  120. package/src/api/patient.ts +11 -2
  121. package/src/api/prescription.ts +18 -0
  122. package/src/gql/gql.ts +21 -9
  123. package/src/gql/graphql.ts +4280 -597
  124. package/src/index.ts +1 -1
  125. package/src/meta/version.test.ts +10 -0
  126. package/src/meta/version.ts +1 -0
  127. package/src/operations/fragments.graphql +166 -20
  128. package/src/operations/me.graphql +38 -0
  129. package/src/operations/orders.graphql +35 -0
  130. package/src/operations/patient.graphql +29 -3
  131. package/src/operations/prescription.graphql +20 -0
  132. package/src/photon/analytics.ts +129 -0
  133. package/src/photon/auth.ts +9 -10
  134. package/src/photon/choices.ts +2 -2
  135. package/src/photon/environments.ts +3 -1
  136. package/src/photon/index.ts +16 -2
  137. package/src/photon/machine.ts +90 -0
  138. package/src/photon/map.ts +151 -35
  139. package/src/photon/order.test.ts +142 -0
  140. package/src/photon/order.ts +92 -12
  141. package/src/photon/orders.ts +42 -0
  142. package/src/photon/patient.ts +73 -33
  143. package/src/photon/photon.ts +139 -6
  144. package/src/photon/prescription.ts +71 -12
  145. package/src/photon/session.ts +18 -9
  146. package/src/photon/types.ts +280 -26
  147. package/src/test-utils/msw.ts +16 -5
  148. package/src/testing/{scriptedClient.ts → fakeNetworkApiClient.ts} +8 -4
  149. package/src/testing/fixtures.ts +55 -13
  150. package/src/testing.ts +6 -3
  151. package/dist/testing/scriptedClient.d.ts.map +0 -1
  152. package/dist/testing/scriptedClient.js.map +0 -1
@@ -2,6 +2,7 @@ import type { Change } from "../api/changes/index.ts";
2
2
  import type { Order } from "../api/order.ts";
3
3
  import type { Patient } from "../api/patient.ts";
4
4
  import type { Prescription } from "../api/prescription.ts";
5
+ import type { OrdersQuery } from "../gql/graphql.ts";
5
6
  export declare const change: (overrides?: Partial<Change>) => Change;
6
7
  type Choice = NonNullable<Change["after"]>;
7
8
  /** One of a Change's options, or its before / after value. */
@@ -10,6 +11,11 @@ type Treatment = Prescription["treatment"];
10
11
  type Pharmacy = NonNullable<Order["pharmacy"]>;
11
12
  type PharmacyOffer = Pharmacy["offers"][number];
12
13
  export declare const pharmacyOffer: (overrides?: Partial<PharmacyOffer>) => PharmacyOffer;
14
+ type PharmacyDiscountCard = Extract<PharmacyOffer["redemptionMethods"][number], {
15
+ __typename: "PharmacyDiscountCard";
16
+ }>;
17
+ /** A minted coupon, as an offer's redemption method. Pair it with `redemptionState: "SETTLED"`. */
18
+ export declare const discountCard: (overrides?: Partial<PharmacyDiscountCard>) => PharmacyDiscountCard;
13
19
  export declare const pharmacy: (overrides?: Partial<Pharmacy>) => Pharmacy;
14
20
  /** A catalog drug, as a prescription or a lookup's option carries it. */
15
21
  export declare const treatment: (overrides?: Partial<Treatment>) => Treatment;
@@ -20,6 +26,1047 @@ export declare const alert: NonNullable<Prescription["screeningAlerts"]>[number]
20
26
  export declare const patient: (overrides?: Partial<Patient>) => Patient;
21
27
  /** An order: a draft for `patient()` with one prescription. */
22
28
  export declare const order: (overrides?: Partial<Order>) => Order;
29
+ type ListedOrder = Extract<OrdersQuery["orders"], {
30
+ __typename: "OrdersPayload";
31
+ }>["orders"][number];
32
+ /** A query snapshot; pharmacy choices are requested separately from the record. */
33
+ export declare const listedOrder: (overrides?: Partial<ListedOrder>) => ListedOrder;
34
+ /** Orders query response, including an empty result when passed []. */
35
+ export declare const orders: (records?: ListedOrder[]) => {
36
+ orders: {
37
+ __typename: "OrdersPayload";
38
+ orders: {
39
+ __typename: "Order";
40
+ id: string;
41
+ state: import("../gql/graphql.ts").OrderState;
42
+ routablePharmacies?: {
43
+ __typename: "ChoicePage";
44
+ totalCount: number;
45
+ nextOffset: number | null;
46
+ options: Array<{
47
+ __typename: "Choice";
48
+ displayName: string;
49
+ reason: string | null;
50
+ operation: string;
51
+ argument: string | null;
52
+ value: string | null;
53
+ matchReasons: Array<{
54
+ __typename: "MatchReason";
55
+ type: import("../gql/graphql.ts").MatchReasonType;
56
+ label: string;
57
+ confidence: import("../gql/graphql.ts").ConfidenceLevel | null;
58
+ value: {
59
+ __typename: "QuantityValue";
60
+ displayValue: string;
61
+ value: number;
62
+ unit: string;
63
+ } | null;
64
+ }>;
65
+ entity: {
66
+ __typename: "Allergy";
67
+ } | {
68
+ __typename: "Diagnosis";
69
+ } | {
70
+ __typename: "MedicationCandidate";
71
+ } | {
72
+ __typename: "PatientCandidate";
73
+ } | {
74
+ __typename: "Pharmacy";
75
+ id: string;
76
+ name: string;
77
+ logo: string | null;
78
+ phone: string | null;
79
+ isOpen: boolean | null;
80
+ latitude: number | null;
81
+ longitude: number | null;
82
+ fulfillmentType: Array<import("../gql/graphql.ts").FulfillmentType> | null;
83
+ hours: Array<{
84
+ __typename: "PharmacyHours";
85
+ openFrom: string;
86
+ openUntil: string;
87
+ dayOfWeek: import("../gql/graphql.ts").DayOfWeek;
88
+ is24Hr: boolean;
89
+ timezone: string;
90
+ }> | null;
91
+ nextEvents: {
92
+ __typename: "PharmacyEvents";
93
+ open: {
94
+ __typename: "PharmacyCloseEvent";
95
+ type: string;
96
+ datetime: string;
97
+ } | {
98
+ __typename: "PharmacyOpen24HrEvent";
99
+ type: string;
100
+ } | {
101
+ __typename: "PharmacyOpenEvent";
102
+ type: string;
103
+ datetime: string;
104
+ };
105
+ close: {
106
+ __typename: "PharmacyCloseEvent";
107
+ type: string;
108
+ datetime: string;
109
+ } | {
110
+ __typename: "PharmacyOpen24HrEvent";
111
+ type: string;
112
+ } | {
113
+ __typename: "PharmacyOpenEvent";
114
+ type: string;
115
+ datetime: string;
116
+ };
117
+ } | null;
118
+ address: {
119
+ __typename: "PharmacyAddress";
120
+ street1: string | null;
121
+ street2: string | null;
122
+ city: string | null;
123
+ state: string | null;
124
+ postalCode: string | null;
125
+ } | null;
126
+ offers: Array<{
127
+ __typename: "PharmacyOffer";
128
+ source: string;
129
+ prescriptionId: string;
130
+ priceType: import("../gql/graphql.ts").OfferPriceType | null;
131
+ isPromoted: boolean;
132
+ redemptionState: import("../gql/graphql.ts").RedemptionState;
133
+ attributeTags: Array<{
134
+ __typename: "OfferAttributeTag";
135
+ kind: string;
136
+ label: string;
137
+ }>;
138
+ price: {
139
+ __typename: "OfferPrice";
140
+ amount: number | null;
141
+ retailAmount: number | null;
142
+ promotions: Array<{
143
+ __typename: "OfferPromotion";
144
+ type: string | null;
145
+ baseAmount: number | null;
146
+ amountSaved: number | null;
147
+ }>;
148
+ } | null;
149
+ deliveryEstimate: {
150
+ __typename: "OfferDeliveryEstimate";
151
+ deliveryPromise: string;
152
+ deliveryPromiseRangeStart: string | null;
153
+ deliveryPromiseRangeEnd: string | null;
154
+ } | null;
155
+ redemptionMethods: Array<{
156
+ __typename: "PharmacyDiscountCard";
157
+ id: string;
158
+ prescriptionId: string;
159
+ bin: string;
160
+ pcn: string;
161
+ group: string;
162
+ memberId: string;
163
+ externalUrl: string | null;
164
+ }>;
165
+ }>;
166
+ } | {
167
+ __typename: "Prescription";
168
+ } | {
169
+ __typename: "Treatment";
170
+ id: string;
171
+ name: string;
172
+ rxNormId: string | null;
173
+ ndc: string | null;
174
+ upc: string | null;
175
+ entityKind: import("../gql/graphql.ts").CatalogEntityKind | null;
176
+ prescribableName: string | null;
177
+ brandName: string | null;
178
+ genericName: string | null;
179
+ form: string | null;
180
+ route: string | null;
181
+ strength: string | null;
182
+ medicationType: string | null;
183
+ schedule: string | null;
184
+ templates: Array<{
185
+ __typename: "PrescriptionTemplate";
186
+ id: string | null;
187
+ source: import("../gql/graphql.ts").TemplateSource;
188
+ name: string | null;
189
+ instructions: string | null;
190
+ dispense: {
191
+ __typename: "Dispense";
192
+ quantity: number | null;
193
+ unit: string | null;
194
+ daysSupply: number | null;
195
+ refillsAllowed: number | null;
196
+ dispenseAsWritten: boolean | null;
197
+ } | null;
198
+ }> | null;
199
+ } | null;
200
+ }>;
201
+ } | null;
202
+ offers: {
203
+ __typename: "OrderOffers";
204
+ atPharmacy: Array<{
205
+ __typename: "PharmacyOffer";
206
+ source: string;
207
+ prescriptionId: string;
208
+ priceType: import("../gql/graphql.ts").OfferPriceType | null;
209
+ isPromoted: boolean;
210
+ redemptionState: import("../gql/graphql.ts").RedemptionState;
211
+ attributeTags: Array<{
212
+ __typename: "OfferAttributeTag";
213
+ kind: string;
214
+ label: string;
215
+ }>;
216
+ price: {
217
+ __typename: "OfferPrice";
218
+ amount: number | null;
219
+ retailAmount: number | null;
220
+ promotions: Array<{
221
+ __typename: "OfferPromotion";
222
+ type: string | null;
223
+ baseAmount: number | null;
224
+ amountSaved: number | null;
225
+ }>;
226
+ } | null;
227
+ deliveryEstimate: {
228
+ __typename: "OfferDeliveryEstimate";
229
+ deliveryPromise: string;
230
+ deliveryPromiseRangeStart: string | null;
231
+ deliveryPromiseRangeEnd: string | null;
232
+ } | null;
233
+ redemptionMethods: Array<{
234
+ __typename: "PharmacyDiscountCard";
235
+ id: string;
236
+ prescriptionId: string;
237
+ bin: string;
238
+ pcn: string;
239
+ group: string;
240
+ memberId: string;
241
+ externalUrl: string | null;
242
+ }>;
243
+ }> | null;
244
+ };
245
+ organization: {
246
+ __typename: "OperationError";
247
+ } | {
248
+ __typename: "Organization";
249
+ id: string;
250
+ name: string;
251
+ customer: {
252
+ __typename: "Customer";
253
+ id: string;
254
+ name: string;
255
+ } | {
256
+ __typename: "OperationError";
257
+ } | null;
258
+ settings: {
259
+ __typename: "OrganizationSettings";
260
+ brandColor: string;
261
+ brandLogo: string | null;
262
+ priorAuthorizationExceptionMessage: string | null;
263
+ patientUx: {
264
+ __typename: "OrganizationPatientUxSettings";
265
+ enablePatientRerouting: boolean;
266
+ enableAutomatedOps: boolean;
267
+ };
268
+ } | null;
269
+ } | null;
270
+ patient: {
271
+ __typename: "OperationError";
272
+ type: import("../gql/graphql.ts").OperationErrorType;
273
+ code: string;
274
+ message: string;
275
+ requiredPermission: string | null;
276
+ service: string | null;
277
+ retryable: boolean;
278
+ } | {
279
+ __typename: "Patient";
280
+ id: string;
281
+ demographic: {
282
+ __typename: "PatientDemographic";
283
+ dateOfBirth: string | null;
284
+ sex: import("../gql/graphql.ts").Sex | null;
285
+ gender: string | null;
286
+ name: {
287
+ __typename: "HumanName";
288
+ first: string | null;
289
+ middle: string | null;
290
+ last: string | null;
291
+ };
292
+ } | null;
293
+ contact: {
294
+ __typename: "PatientContact";
295
+ email: string | null;
296
+ phone: string | null;
297
+ address: {
298
+ __typename: "PatientAddress";
299
+ street1: string | null;
300
+ street2: string | null;
301
+ city: string | null;
302
+ state: string | null;
303
+ postalCode: string | null;
304
+ country: string | null;
305
+ } | null;
306
+ } | null;
307
+ benefits: {
308
+ __typename: "BenefitList";
309
+ status: import("../gql/graphql.ts").ListDocumentationStatus | null;
310
+ entries: Array<{
311
+ __typename: "Benefit";
312
+ id: string;
313
+ bin: string;
314
+ pcn: string | null;
315
+ groupId: string | null;
316
+ memberId: string;
317
+ }>;
318
+ };
319
+ preferredPharmacy: {
320
+ __typename: "Pharmacy";
321
+ id: string;
322
+ name: string;
323
+ logo: string | null;
324
+ phone: string | null;
325
+ isOpen: boolean | null;
326
+ latitude: number | null;
327
+ longitude: number | null;
328
+ fulfillmentType: Array<import("../gql/graphql.ts").FulfillmentType> | null;
329
+ hours: Array<{
330
+ __typename: "PharmacyHours";
331
+ openFrom: string;
332
+ openUntil: string;
333
+ dayOfWeek: import("../gql/graphql.ts").DayOfWeek;
334
+ is24Hr: boolean;
335
+ timezone: string;
336
+ }> | null;
337
+ nextEvents: {
338
+ __typename: "PharmacyEvents";
339
+ open: {
340
+ __typename: "PharmacyCloseEvent";
341
+ type: string;
342
+ datetime: string;
343
+ } | {
344
+ __typename: "PharmacyOpen24HrEvent";
345
+ type: string;
346
+ } | {
347
+ __typename: "PharmacyOpenEvent";
348
+ type: string;
349
+ datetime: string;
350
+ };
351
+ close: {
352
+ __typename: "PharmacyCloseEvent";
353
+ type: string;
354
+ datetime: string;
355
+ } | {
356
+ __typename: "PharmacyOpen24HrEvent";
357
+ type: string;
358
+ } | {
359
+ __typename: "PharmacyOpenEvent";
360
+ type: string;
361
+ datetime: string;
362
+ };
363
+ } | null;
364
+ address: {
365
+ __typename: "PharmacyAddress";
366
+ street1: string | null;
367
+ street2: string | null;
368
+ city: string | null;
369
+ state: string | null;
370
+ postalCode: string | null;
371
+ } | null;
372
+ offers: Array<{
373
+ __typename: "PharmacyOffer";
374
+ source: string;
375
+ prescriptionId: string;
376
+ priceType: import("../gql/graphql.ts").OfferPriceType | null;
377
+ isPromoted: boolean;
378
+ redemptionState: import("../gql/graphql.ts").RedemptionState;
379
+ attributeTags: Array<{
380
+ __typename: "OfferAttributeTag";
381
+ kind: string;
382
+ label: string;
383
+ }>;
384
+ price: {
385
+ __typename: "OfferPrice";
386
+ amount: number | null;
387
+ retailAmount: number | null;
388
+ promotions: Array<{
389
+ __typename: "OfferPromotion";
390
+ type: string | null;
391
+ baseAmount: number | null;
392
+ amountSaved: number | null;
393
+ }>;
394
+ } | null;
395
+ deliveryEstimate: {
396
+ __typename: "OfferDeliveryEstimate";
397
+ deliveryPromise: string;
398
+ deliveryPromiseRangeStart: string | null;
399
+ deliveryPromiseRangeEnd: string | null;
400
+ } | null;
401
+ redemptionMethods: Array<{
402
+ __typename: "PharmacyDiscountCard";
403
+ id: string;
404
+ prescriptionId: string;
405
+ bin: string;
406
+ pcn: string;
407
+ group: string;
408
+ memberId: string;
409
+ externalUrl: string | null;
410
+ }>;
411
+ }>;
412
+ } | null;
413
+ clinical: {
414
+ __typename: "PatientClinical";
415
+ notes: string | null;
416
+ allergies: {
417
+ __typename: "AllergyList";
418
+ status: import("../gql/graphql.ts").ListDocumentationStatus;
419
+ entries: Array<{
420
+ __typename: "Allergy";
421
+ id: string;
422
+ name: string;
423
+ rxNormId: string | null;
424
+ }>;
425
+ };
426
+ medications: {
427
+ __typename: "MedicationHistoryList";
428
+ status: import("../gql/graphql.ts").ListDocumentationStatus | null;
429
+ entries: Array<{
430
+ __typename: "MedicationHistoryEntry";
431
+ id: string;
432
+ name: string;
433
+ rxNormId: string | null;
434
+ status: import("../gql/graphql.ts").MedicationHistoryStatus;
435
+ }>;
436
+ };
437
+ diagnoses: {
438
+ __typename: "DiagnosisList";
439
+ status: import("../gql/graphql.ts").ListDocumentationStatus | null;
440
+ entries: Array<{
441
+ __typename: "Diagnosis";
442
+ id: string;
443
+ name: string | null;
444
+ icd10Code: string | null;
445
+ }>;
446
+ };
447
+ } | null;
448
+ } | null;
449
+ prescriptions: Array<{
450
+ __typename: "Prescription";
451
+ id: string;
452
+ templateId: string | null;
453
+ instructions: string | null;
454
+ prescriber: {
455
+ __typename: "Prescriber";
456
+ id: string;
457
+ name: {
458
+ __typename: "HumanName";
459
+ first: string | null;
460
+ middle: string | null;
461
+ last: string | null;
462
+ };
463
+ } | null;
464
+ fulfillment: {
465
+ __typename: "PrescriptionFulfillment";
466
+ state: import("../gql/graphql.ts").PrescriptionFulfillmentState | null;
467
+ pharmacyEstimatedReadyAt: string | null;
468
+ exceptions: Array<{
469
+ __typename: "PrescriptionFulfillmentException";
470
+ id: string;
471
+ type: import("../gql/graphql.ts").PrescriptionFulfillmentExceptionType;
472
+ message: string | null;
473
+ createdAt: string;
474
+ }>;
475
+ } | null;
476
+ patient: {
477
+ __typename: "PatientReference";
478
+ id: string;
479
+ } | null;
480
+ treatment: {
481
+ __typename: "Treatment";
482
+ id: string;
483
+ name: string;
484
+ rxNormId: string | null;
485
+ ndc: string | null;
486
+ upc: string | null;
487
+ entityKind: import("../gql/graphql.ts").CatalogEntityKind | null;
488
+ prescribableName: string | null;
489
+ brandName: string | null;
490
+ genericName: string | null;
491
+ form: string | null;
492
+ route: string | null;
493
+ strength: string | null;
494
+ medicationType: string | null;
495
+ schedule: string | null;
496
+ };
497
+ dispense: {
498
+ __typename: "Dispense";
499
+ quantity: number | null;
500
+ unit: string | null;
501
+ daysSupply: number | null;
502
+ refillsAllowed: number | null;
503
+ dispenseAsWritten: boolean | null;
504
+ } | null;
505
+ clinical: {
506
+ __typename: "PrescriptionClinical";
507
+ notes: string | null;
508
+ diagnoses: Array<{
509
+ __typename: "Diagnosis";
510
+ id: string;
511
+ name: string | null;
512
+ icd10Code: string | null;
513
+ }>;
514
+ } | null;
515
+ screeningAlerts: Array<{
516
+ __typename: "ScreeningAlert";
517
+ severity: import("../gql/graphql.ts").ScreeningSeverity;
518
+ type: import("../gql/graphql.ts").ScreeningAlertType;
519
+ description: string;
520
+ category: import("../gql/graphql.ts").ChangeCategory;
521
+ involvedEntities: Array<{
522
+ __typename: "InvolvedEntity";
523
+ id: string;
524
+ name: string;
525
+ }>;
526
+ options: Array<{
527
+ __typename: "Choice";
528
+ displayName: string;
529
+ reason: string | null;
530
+ operation: string;
531
+ argument: string | null;
532
+ value: string | null;
533
+ matchReasons: Array<{
534
+ __typename: "MatchReason";
535
+ type: import("../gql/graphql.ts").MatchReasonType;
536
+ label: string;
537
+ confidence: import("../gql/graphql.ts").ConfidenceLevel | null;
538
+ value: {
539
+ __typename: "QuantityValue";
540
+ displayValue: string;
541
+ value: number;
542
+ unit: string;
543
+ } | null;
544
+ }>;
545
+ entity: {
546
+ __typename: "Allergy";
547
+ } | {
548
+ __typename: "Diagnosis";
549
+ } | {
550
+ __typename: "MedicationCandidate";
551
+ } | {
552
+ __typename: "PatientCandidate";
553
+ } | {
554
+ __typename: "Pharmacy";
555
+ id: string;
556
+ name: string;
557
+ logo: string | null;
558
+ phone: string | null;
559
+ isOpen: boolean | null;
560
+ latitude: number | null;
561
+ longitude: number | null;
562
+ fulfillmentType: Array<import("../gql/graphql.ts").FulfillmentType> | null;
563
+ hours: Array<{
564
+ __typename: "PharmacyHours";
565
+ openFrom: string;
566
+ openUntil: string;
567
+ dayOfWeek: import("../gql/graphql.ts").DayOfWeek;
568
+ is24Hr: boolean;
569
+ timezone: string;
570
+ }> | null;
571
+ nextEvents: {
572
+ __typename: "PharmacyEvents";
573
+ open: {
574
+ __typename: "PharmacyCloseEvent";
575
+ type: string;
576
+ datetime: string;
577
+ } | {
578
+ __typename: "PharmacyOpen24HrEvent";
579
+ type: string;
580
+ } | {
581
+ __typename: "PharmacyOpenEvent";
582
+ type: string;
583
+ datetime: string;
584
+ };
585
+ close: {
586
+ __typename: "PharmacyCloseEvent";
587
+ type: string;
588
+ datetime: string;
589
+ } | {
590
+ __typename: "PharmacyOpen24HrEvent";
591
+ type: string;
592
+ } | {
593
+ __typename: "PharmacyOpenEvent";
594
+ type: string;
595
+ datetime: string;
596
+ };
597
+ } | null;
598
+ address: {
599
+ __typename: "PharmacyAddress";
600
+ street1: string | null;
601
+ street2: string | null;
602
+ city: string | null;
603
+ state: string | null;
604
+ postalCode: string | null;
605
+ } | null;
606
+ offers: Array<{
607
+ __typename: "PharmacyOffer";
608
+ source: string;
609
+ prescriptionId: string;
610
+ priceType: import("../gql/graphql.ts").OfferPriceType | null;
611
+ isPromoted: boolean;
612
+ redemptionState: import("../gql/graphql.ts").RedemptionState;
613
+ attributeTags: Array<{
614
+ __typename: "OfferAttributeTag";
615
+ kind: string;
616
+ label: string;
617
+ }>;
618
+ price: {
619
+ __typename: "OfferPrice";
620
+ amount: number | null;
621
+ retailAmount: number | null;
622
+ promotions: Array<{
623
+ __typename: "OfferPromotion";
624
+ type: string | null;
625
+ baseAmount: number | null;
626
+ amountSaved: number | null;
627
+ }>;
628
+ } | null;
629
+ deliveryEstimate: {
630
+ __typename: "OfferDeliveryEstimate";
631
+ deliveryPromise: string;
632
+ deliveryPromiseRangeStart: string | null;
633
+ deliveryPromiseRangeEnd: string | null;
634
+ } | null;
635
+ redemptionMethods: Array<{
636
+ __typename: "PharmacyDiscountCard";
637
+ id: string;
638
+ prescriptionId: string;
639
+ bin: string;
640
+ pcn: string;
641
+ group: string;
642
+ memberId: string;
643
+ externalUrl: string | null;
644
+ }>;
645
+ }>;
646
+ } | {
647
+ __typename: "Prescription";
648
+ } | {
649
+ __typename: "Treatment";
650
+ id: string;
651
+ name: string;
652
+ rxNormId: string | null;
653
+ ndc: string | null;
654
+ upc: string | null;
655
+ entityKind: import("../gql/graphql.ts").CatalogEntityKind | null;
656
+ prescribableName: string | null;
657
+ brandName: string | null;
658
+ genericName: string | null;
659
+ form: string | null;
660
+ route: string | null;
661
+ strength: string | null;
662
+ medicationType: string | null;
663
+ schedule: string | null;
664
+ templates: Array<{
665
+ __typename: "PrescriptionTemplate";
666
+ id: string | null;
667
+ source: import("../gql/graphql.ts").TemplateSource;
668
+ name: string | null;
669
+ instructions: string | null;
670
+ dispense: {
671
+ __typename: "Dispense";
672
+ quantity: number | null;
673
+ unit: string | null;
674
+ daysSupply: number | null;
675
+ refillsAllowed: number | null;
676
+ dispenseAsWritten: boolean | null;
677
+ } | null;
678
+ }> | null;
679
+ } | null;
680
+ }> | null;
681
+ }> | null;
682
+ signing: {
683
+ __typename: "PrescriptionSigningDetails";
684
+ state: import("../gql/graphql.ts").PrescriptionSigningState;
685
+ contentHash: string;
686
+ message: string | null;
687
+ signedAt: string | null;
688
+ };
689
+ }>;
690
+ screeningAlerts: Array<{
691
+ __typename: "ScreeningAlert";
692
+ severity: import("../gql/graphql.ts").ScreeningSeverity;
693
+ type: import("../gql/graphql.ts").ScreeningAlertType;
694
+ description: string;
695
+ category: import("../gql/graphql.ts").ChangeCategory;
696
+ involvedEntities: Array<{
697
+ __typename: "InvolvedEntity";
698
+ id: string;
699
+ name: string;
700
+ }>;
701
+ options: Array<{
702
+ __typename: "Choice";
703
+ displayName: string;
704
+ reason: string | null;
705
+ operation: string;
706
+ argument: string | null;
707
+ value: string | null;
708
+ matchReasons: Array<{
709
+ __typename: "MatchReason";
710
+ type: import("../gql/graphql.ts").MatchReasonType;
711
+ label: string;
712
+ confidence: import("../gql/graphql.ts").ConfidenceLevel | null;
713
+ value: {
714
+ __typename: "QuantityValue";
715
+ displayValue: string;
716
+ value: number;
717
+ unit: string;
718
+ } | null;
719
+ }>;
720
+ entity: {
721
+ __typename: "Allergy";
722
+ } | {
723
+ __typename: "Diagnosis";
724
+ } | {
725
+ __typename: "MedicationCandidate";
726
+ } | {
727
+ __typename: "PatientCandidate";
728
+ } | {
729
+ __typename: "Pharmacy";
730
+ id: string;
731
+ name: string;
732
+ logo: string | null;
733
+ phone: string | null;
734
+ isOpen: boolean | null;
735
+ latitude: number | null;
736
+ longitude: number | null;
737
+ fulfillmentType: Array<import("../gql/graphql.ts").FulfillmentType> | null;
738
+ hours: Array<{
739
+ __typename: "PharmacyHours";
740
+ openFrom: string;
741
+ openUntil: string;
742
+ dayOfWeek: import("../gql/graphql.ts").DayOfWeek;
743
+ is24Hr: boolean;
744
+ timezone: string;
745
+ }> | null;
746
+ nextEvents: {
747
+ __typename: "PharmacyEvents";
748
+ open: {
749
+ __typename: "PharmacyCloseEvent";
750
+ type: string;
751
+ datetime: string;
752
+ } | {
753
+ __typename: "PharmacyOpen24HrEvent";
754
+ type: string;
755
+ } | {
756
+ __typename: "PharmacyOpenEvent";
757
+ type: string;
758
+ datetime: string;
759
+ };
760
+ close: {
761
+ __typename: "PharmacyCloseEvent";
762
+ type: string;
763
+ datetime: string;
764
+ } | {
765
+ __typename: "PharmacyOpen24HrEvent";
766
+ type: string;
767
+ } | {
768
+ __typename: "PharmacyOpenEvent";
769
+ type: string;
770
+ datetime: string;
771
+ };
772
+ } | null;
773
+ address: {
774
+ __typename: "PharmacyAddress";
775
+ street1: string | null;
776
+ street2: string | null;
777
+ city: string | null;
778
+ state: string | null;
779
+ postalCode: string | null;
780
+ } | null;
781
+ offers: Array<{
782
+ __typename: "PharmacyOffer";
783
+ source: string;
784
+ prescriptionId: string;
785
+ priceType: import("../gql/graphql.ts").OfferPriceType | null;
786
+ isPromoted: boolean;
787
+ redemptionState: import("../gql/graphql.ts").RedemptionState;
788
+ attributeTags: Array<{
789
+ __typename: "OfferAttributeTag";
790
+ kind: string;
791
+ label: string;
792
+ }>;
793
+ price: {
794
+ __typename: "OfferPrice";
795
+ amount: number | null;
796
+ retailAmount: number | null;
797
+ promotions: Array<{
798
+ __typename: "OfferPromotion";
799
+ type: string | null;
800
+ baseAmount: number | null;
801
+ amountSaved: number | null;
802
+ }>;
803
+ } | null;
804
+ deliveryEstimate: {
805
+ __typename: "OfferDeliveryEstimate";
806
+ deliveryPromise: string;
807
+ deliveryPromiseRangeStart: string | null;
808
+ deliveryPromiseRangeEnd: string | null;
809
+ } | null;
810
+ redemptionMethods: Array<{
811
+ __typename: "PharmacyDiscountCard";
812
+ id: string;
813
+ prescriptionId: string;
814
+ bin: string;
815
+ pcn: string;
816
+ group: string;
817
+ memberId: string;
818
+ externalUrl: string | null;
819
+ }>;
820
+ }>;
821
+ } | {
822
+ __typename: "Prescription";
823
+ } | {
824
+ __typename: "Treatment";
825
+ id: string;
826
+ name: string;
827
+ rxNormId: string | null;
828
+ ndc: string | null;
829
+ upc: string | null;
830
+ entityKind: import("../gql/graphql.ts").CatalogEntityKind | null;
831
+ prescribableName: string | null;
832
+ brandName: string | null;
833
+ genericName: string | null;
834
+ form: string | null;
835
+ route: string | null;
836
+ strength: string | null;
837
+ medicationType: string | null;
838
+ schedule: string | null;
839
+ templates: Array<{
840
+ __typename: "PrescriptionTemplate";
841
+ id: string | null;
842
+ source: import("../gql/graphql.ts").TemplateSource;
843
+ name: string | null;
844
+ instructions: string | null;
845
+ dispense: {
846
+ __typename: "Dispense";
847
+ quantity: number | null;
848
+ unit: string | null;
849
+ daysSupply: number | null;
850
+ refillsAllowed: number | null;
851
+ dispenseAsWritten: boolean | null;
852
+ } | null;
853
+ }> | null;
854
+ } | null;
855
+ }> | null;
856
+ }> | null;
857
+ pharmacy: {
858
+ __typename: "Pharmacy";
859
+ id: string;
860
+ name: string;
861
+ logo: string | null;
862
+ phone: string | null;
863
+ isOpen: boolean | null;
864
+ latitude: number | null;
865
+ longitude: number | null;
866
+ fulfillmentType: Array<import("../gql/graphql.ts").FulfillmentType> | null;
867
+ hours: Array<{
868
+ __typename: "PharmacyHours";
869
+ openFrom: string;
870
+ openUntil: string;
871
+ dayOfWeek: import("../gql/graphql.ts").DayOfWeek;
872
+ is24Hr: boolean;
873
+ timezone: string;
874
+ }> | null;
875
+ nextEvents: {
876
+ __typename: "PharmacyEvents";
877
+ open: {
878
+ __typename: "PharmacyCloseEvent";
879
+ type: string;
880
+ datetime: string;
881
+ } | {
882
+ __typename: "PharmacyOpen24HrEvent";
883
+ type: string;
884
+ } | {
885
+ __typename: "PharmacyOpenEvent";
886
+ type: string;
887
+ datetime: string;
888
+ };
889
+ close: {
890
+ __typename: "PharmacyCloseEvent";
891
+ type: string;
892
+ datetime: string;
893
+ } | {
894
+ __typename: "PharmacyOpen24HrEvent";
895
+ type: string;
896
+ } | {
897
+ __typename: "PharmacyOpenEvent";
898
+ type: string;
899
+ datetime: string;
900
+ };
901
+ } | null;
902
+ address: {
903
+ __typename: "PharmacyAddress";
904
+ street1: string | null;
905
+ street2: string | null;
906
+ city: string | null;
907
+ state: string | null;
908
+ postalCode: string | null;
909
+ } | null;
910
+ offers: Array<{
911
+ __typename: "PharmacyOffer";
912
+ source: string;
913
+ prescriptionId: string;
914
+ priceType: import("../gql/graphql.ts").OfferPriceType | null;
915
+ isPromoted: boolean;
916
+ redemptionState: import("../gql/graphql.ts").RedemptionState;
917
+ attributeTags: Array<{
918
+ __typename: "OfferAttributeTag";
919
+ kind: string;
920
+ label: string;
921
+ }>;
922
+ price: {
923
+ __typename: "OfferPrice";
924
+ amount: number | null;
925
+ retailAmount: number | null;
926
+ promotions: Array<{
927
+ __typename: "OfferPromotion";
928
+ type: string | null;
929
+ baseAmount: number | null;
930
+ amountSaved: number | null;
931
+ }>;
932
+ } | null;
933
+ deliveryEstimate: {
934
+ __typename: "OfferDeliveryEstimate";
935
+ deliveryPromise: string;
936
+ deliveryPromiseRangeStart: string | null;
937
+ deliveryPromiseRangeEnd: string | null;
938
+ } | null;
939
+ redemptionMethods: Array<{
940
+ __typename: "PharmacyDiscountCard";
941
+ id: string;
942
+ prescriptionId: string;
943
+ bin: string;
944
+ pcn: string;
945
+ group: string;
946
+ memberId: string;
947
+ externalUrl: string | null;
948
+ }>;
949
+ }>;
950
+ } | null;
951
+ fulfillment: {
952
+ __typename: "OrderFulfillment";
953
+ state: import("../gql/graphql.ts").OrderFulfillmentState | null;
954
+ history: Array<{
955
+ __typename: "OrderRoutingHistoryEntry";
956
+ selector: import("../gql/graphql.ts").OrderRoutingSelector;
957
+ reason: string | null;
958
+ createdAt: string;
959
+ pharmacy: {
960
+ __typename: "Pharmacy";
961
+ id: string;
962
+ name: string;
963
+ logo: string | null;
964
+ phone: string | null;
965
+ isOpen: boolean | null;
966
+ latitude: number | null;
967
+ longitude: number | null;
968
+ fulfillmentType: Array<import("../gql/graphql.ts").FulfillmentType> | null;
969
+ hours: Array<{
970
+ __typename: "PharmacyHours";
971
+ openFrom: string;
972
+ openUntil: string;
973
+ dayOfWeek: import("../gql/graphql.ts").DayOfWeek;
974
+ is24Hr: boolean;
975
+ timezone: string;
976
+ }> | null;
977
+ nextEvents: {
978
+ __typename: "PharmacyEvents";
979
+ open: {
980
+ __typename: "PharmacyCloseEvent";
981
+ type: string;
982
+ datetime: string;
983
+ } | {
984
+ __typename: "PharmacyOpen24HrEvent";
985
+ type: string;
986
+ } | {
987
+ __typename: "PharmacyOpenEvent";
988
+ type: string;
989
+ datetime: string;
990
+ };
991
+ close: {
992
+ __typename: "PharmacyCloseEvent";
993
+ type: string;
994
+ datetime: string;
995
+ } | {
996
+ __typename: "PharmacyOpen24HrEvent";
997
+ type: string;
998
+ } | {
999
+ __typename: "PharmacyOpenEvent";
1000
+ type: string;
1001
+ datetime: string;
1002
+ };
1003
+ } | null;
1004
+ address: {
1005
+ __typename: "PharmacyAddress";
1006
+ street1: string | null;
1007
+ street2: string | null;
1008
+ city: string | null;
1009
+ state: string | null;
1010
+ postalCode: string | null;
1011
+ } | null;
1012
+ offers: Array<{
1013
+ __typename: "PharmacyOffer";
1014
+ source: string;
1015
+ prescriptionId: string;
1016
+ priceType: import("../gql/graphql.ts").OfferPriceType | null;
1017
+ isPromoted: boolean;
1018
+ redemptionState: import("../gql/graphql.ts").RedemptionState;
1019
+ attributeTags: Array<{
1020
+ __typename: "OfferAttributeTag";
1021
+ kind: string;
1022
+ label: string;
1023
+ }>;
1024
+ price: {
1025
+ __typename: "OfferPrice";
1026
+ amount: number | null;
1027
+ retailAmount: number | null;
1028
+ promotions: Array<{
1029
+ __typename: "OfferPromotion";
1030
+ type: string | null;
1031
+ baseAmount: number | null;
1032
+ amountSaved: number | null;
1033
+ }>;
1034
+ } | null;
1035
+ deliveryEstimate: {
1036
+ __typename: "OfferDeliveryEstimate";
1037
+ deliveryPromise: string;
1038
+ deliveryPromiseRangeStart: string | null;
1039
+ deliveryPromiseRangeEnd: string | null;
1040
+ } | null;
1041
+ redemptionMethods: Array<{
1042
+ __typename: "PharmacyDiscountCard";
1043
+ id: string;
1044
+ prescriptionId: string;
1045
+ bin: string;
1046
+ pcn: string;
1047
+ group: string;
1048
+ memberId: string;
1049
+ externalUrl: string | null;
1050
+ }>;
1051
+ }>;
1052
+ };
1053
+ }>;
1054
+ routability: {
1055
+ __typename: "OrderRoutability";
1056
+ allowed: boolean;
1057
+ reason: string | null;
1058
+ } | null;
1059
+ exceptions: Array<{
1060
+ __typename: "OrderException";
1061
+ id: string;
1062
+ type: import("../gql/graphql.ts").OrderExceptionType;
1063
+ message: string | null;
1064
+ createdAt: string;
1065
+ }>;
1066
+ } | null;
1067
+ }[];
1068
+ };
1069
+ };
23
1070
  /** A patient query nobody matches: no record, and nothing the server still asks for. */
24
1071
  export declare const noMatch: () => {
25
1072
  patient: {