@photonhealth/client 0.0.0-stage → 2.0.0-rc.1
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/LICENSE +15 -0
- package/README.md +89 -2
- package/dist/api/changes/applyOption.d.ts +41 -0
- package/dist/api/changes/applyOption.d.ts.map +1 -0
- package/dist/api/changes/applyOption.js +76 -0
- package/dist/api/changes/applyOption.js.map +1 -0
- package/dist/api/changes/classifyChanges.d.ts +9 -0
- package/dist/api/changes/classifyChanges.d.ts.map +1 -0
- package/dist/api/changes/classifyChanges.js +2 -0
- package/dist/api/changes/classifyChanges.js.map +1 -0
- package/dist/api/changes/index.d.ts +3 -0
- package/dist/api/changes/index.d.ts.map +1 -0
- package/dist/api/changes/index.js +3 -0
- package/dist/api/changes/index.js.map +1 -0
- package/dist/api/client.d.ts +43 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +77 -0
- package/dist/api/client.js.map +1 -0
- package/dist/api/health.d.ts +4 -0
- package/dist/api/health.d.ts.map +1 -0
- package/dist/api/health.js +6 -0
- package/dist/api/health.js.map +1 -0
- package/dist/api/index.d.ts +22 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +21 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/order.d.ts +33 -0
- package/dist/api/order.d.ts.map +1 -0
- package/dist/api/order.js +33 -0
- package/dist/api/order.js.map +1 -0
- package/dist/api/patient.d.ts +33 -0
- package/dist/api/patient.d.ts.map +1 -0
- package/dist/api/patient.js +33 -0
- package/dist/api/patient.js.map +1 -0
- package/dist/api/prescription.d.ts +31 -0
- package/dist/api/prescription.d.ts.map +1 -0
- package/dist/api/prescription.js +30 -0
- package/dist/api/prescription.js.map +1 -0
- package/dist/api/results.d.ts +30 -0
- package/dist/api/results.d.ts.map +1 -0
- package/dist/api/results.js +26 -0
- package/dist/api/results.js.map +1 -0
- package/dist/gql/gql.d.ts +21 -0
- package/dist/gql/gql.d.ts.map +1 -0
- package/dist/gql/gql.js +13 -0
- package/dist/gql/gql.js.map +1 -0
- package/dist/gql/graphql.d.ts +9674 -0
- package/dist/gql/graphql.d.ts.map +1 -0
- package/dist/gql/graphql.js +4030 -0
- package/dist/gql/graphql.js.map +1 -0
- package/dist/gql/index.d.ts +2 -0
- package/dist/gql/index.d.ts.map +1 -0
- package/dist/gql/index.js +3 -0
- package/dist/gql/index.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/photon/auth.d.ts +48 -0
- package/dist/photon/auth.d.ts.map +1 -0
- package/dist/photon/auth.js +34 -0
- package/dist/photon/auth.js.map +1 -0
- package/dist/photon/choices.d.ts +44 -0
- package/dist/photon/choices.d.ts.map +1 -0
- package/dist/photon/choices.js +58 -0
- package/dist/photon/choices.js.map +1 -0
- package/dist/photon/context.d.ts +29 -0
- package/dist/photon/context.d.ts.map +1 -0
- package/dist/photon/context.js +2 -0
- package/dist/photon/context.js.map +1 -0
- package/dist/photon/environments.d.ts +26 -0
- package/dist/photon/environments.d.ts.map +1 -0
- package/dist/photon/environments.js +26 -0
- package/dist/photon/environments.js.map +1 -0
- package/dist/photon/errors.d.ts +26 -0
- package/dist/photon/errors.d.ts.map +1 -0
- package/dist/photon/errors.js +42 -0
- package/dist/photon/errors.js.map +1 -0
- package/dist/photon/index.d.ts +23 -0
- package/dist/photon/index.d.ts.map +1 -0
- package/dist/photon/index.js +11 -0
- package/dist/photon/index.js.map +1 -0
- package/dist/photon/inputs.d.ts +7 -0
- package/dist/photon/inputs.d.ts.map +1 -0
- package/dist/photon/inputs.js +25 -0
- package/dist/photon/inputs.js.map +1 -0
- package/dist/photon/links.d.ts +68 -0
- package/dist/photon/links.d.ts.map +1 -0
- package/dist/photon/links.js +187 -0
- package/dist/photon/links.js.map +1 -0
- package/dist/photon/live.d.ts +62 -0
- package/dist/photon/live.d.ts.map +1 -0
- package/dist/photon/live.js +107 -0
- package/dist/photon/live.js.map +1 -0
- package/dist/photon/map.d.ts +10 -0
- package/dist/photon/map.d.ts.map +1 -0
- package/dist/photon/map.js +211 -0
- package/dist/photon/map.js.map +1 -0
- package/dist/photon/order.d.ts +148 -0
- package/dist/photon/order.d.ts.map +1 -0
- package/dist/photon/order.js +491 -0
- package/dist/photon/order.js.map +1 -0
- package/dist/photon/patient.d.ts +78 -0
- package/dist/photon/patient.d.ts.map +1 -0
- package/dist/photon/patient.js +316 -0
- package/dist/photon/patient.js.map +1 -0
- package/dist/photon/photon.d.ts +150 -0
- package/dist/photon/photon.d.ts.map +1 -0
- package/dist/photon/photon.js +315 -0
- package/dist/photon/photon.js.map +1 -0
- package/dist/photon/prescription.d.ts +132 -0
- package/dist/photon/prescription.d.ts.map +1 -0
- package/dist/photon/prescription.js +381 -0
- package/dist/photon/prescription.js.map +1 -0
- package/dist/photon/session.d.ts +84 -0
- package/dist/photon/session.d.ts.map +1 -0
- package/dist/photon/session.js +350 -0
- package/dist/photon/session.js.map +1 -0
- package/dist/photon/types.d.ts +411 -0
- package/dist/photon/types.d.ts.map +1 -0
- package/dist/photon/types.js +7 -0
- package/dist/photon/types.js.map +1 -0
- package/dist/test-utils/msw.d.ts +23 -0
- package/dist/test-utils/msw.d.ts.map +1 -0
- package/dist/test-utils/msw.js +51 -0
- package/dist/test-utils/msw.js.map +1 -0
- package/dist/testing/fixtures.d.ts +51 -0
- package/dist/testing/fixtures.d.ts.map +1 -0
- package/dist/testing/fixtures.js +166 -0
- package/dist/testing/fixtures.js.map +1 -0
- package/dist/testing/scriptedClient.d.ts +38 -0
- package/dist/testing/scriptedClient.d.ts.map +1 -0
- package/dist/testing/scriptedClient.js +52 -0
- package/dist/testing/scriptedClient.js.map +1 -0
- package/dist/testing.d.ts +11 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +10 -0
- package/dist/testing.js.map +1 -0
- package/package.json +67 -4
- package/src/api/changes/applyOption.ts +103 -0
- package/src/api/changes/classifyChanges.ts +10 -0
- package/src/api/changes/index.ts +2 -0
- package/src/api/client.ts +124 -0
- package/src/api/health.ts +7 -0
- package/src/api/index.ts +22 -0
- package/src/api/order.ts +64 -0
- package/src/api/patient.ts +58 -0
- package/src/api/prescription.ts +68 -0
- package/src/api/results.ts +45 -0
- package/src/gql/gql.ts +56 -0
- package/src/gql/graphql.ts +5344 -0
- package/src/gql/index.ts +2 -0
- package/src/index.ts +14 -0
- package/src/operations/fragments.graphql +351 -0
- package/src/operations/health.graphql +4 -0
- package/src/operations/order.graphql +42 -0
- package/src/operations/patient.graphql +36 -0
- package/src/operations/prescription.graphql +70 -0
- package/src/photon/auth.ts +70 -0
- package/src/photon/choices.ts +79 -0
- package/src/photon/context.ts +30 -0
- package/src/photon/environments.ts +47 -0
- package/src/photon/errors.ts +56 -0
- package/src/photon/index.ts +35 -0
- package/src/photon/inputs.ts +24 -0
- package/src/photon/links.ts +197 -0
- package/src/photon/live.ts +135 -0
- package/src/photon/map.ts +255 -0
- package/src/photon/order.ts +581 -0
- package/src/photon/patient.ts +346 -0
- package/src/photon/photon.ts +513 -0
- package/src/photon/prescription.ts +447 -0
- package/src/photon/session.ts +445 -0
- package/src/photon/types.ts +329 -0
- package/src/test-utils/msw.ts +61 -0
- package/src/testing/fixtures.ts +191 -0
- package/src/testing/scriptedClient.ts +52 -0
- package/src/testing.ts +22 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Photon Health
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,90 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @photonhealth/client
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Photon's prescribing API for JavaScript: `photon()` gives you patients, prescriptions and orders as **live
|
|
4
|
+
objects**. Their state stays current, you can subscribe to them, and their methods await the web calls. The
|
|
5
|
+
workflow rules live inside them. Framework-agnostic, with zero runtime dependencies: it runs in the browser, Node
|
|
6
|
+
and Deno.
|
|
7
|
+
|
|
8
|
+
React cards built on it: [`@photonhealth/react`](https://www.npmjs.com/package/@photonhealth/react).
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
Release candidates are published under the `rc` tag:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install @photonhealth/client@rc
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Quick start
|
|
19
|
+
|
|
20
|
+
```ts
|
|
21
|
+
import { photon } from "@photonhealth/client";
|
|
22
|
+
|
|
23
|
+
const ph = photon({ environment: "neutron", auth: { clientId } }); // or { getToken }: your own sign-in
|
|
24
|
+
|
|
25
|
+
const { patient } = await ph.patient.sync({
|
|
26
|
+
demographic: { name: { first: "Paige", last: "Turner" }, dateOfBirth: "1990-01-01", sex: "FEMALE" },
|
|
27
|
+
});
|
|
28
|
+
patient.subscribe(() => render(patient.state)); // UIs; a backend just awaits
|
|
29
|
+
|
|
30
|
+
const { prescription: rx } = await ph.prescription.sync({ patient: { id: patient.id }, treatment: { id: "med_10" } });
|
|
31
|
+
await rx.update({ instructions: "1 tab PO daily", dispense: { quantity: 30, daysSupply: 30 } });
|
|
32
|
+
await rx.sign(); // the prescriber's approval of exactly what they saw
|
|
33
|
+
|
|
34
|
+
const { order } = await ph.order.sync({ patient: { id: patient.id }, prescriptions: { add: [{ id: rx.id }] } });
|
|
35
|
+
await order.submit(); // the patient chooses a pharmacy
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## The instance and auth
|
|
39
|
+
|
|
40
|
+
`photon({ environment, auth, organization?, appUrl? })` returns an instance. Every URL is inferred from
|
|
41
|
+
`environment`: `neutron` (sandbox) or `photon` (production). `auth` is one of:
|
|
42
|
+
|
|
43
|
+
- **`{ clientId }`**: the client signs the prescriber in, in the browser (Auth0 authorization code with PKCE).
|
|
44
|
+
`ph.session` is a live object with `status`, `user`, `start()`, `signIn()` and `signOut()`. The access token stays
|
|
45
|
+
in memory; `localStorage` keeps the refresh token so a reload signs back in. A script on your page can read that
|
|
46
|
+
refresh token, so treat XSS on the page as a token leak. Auth0's refresh token rotation is the guard.
|
|
47
|
+
- **`{ getToken: () => Promise<string> }`**: you sign the prescriber in yourself. The client calls it before each
|
|
48
|
+
request. `ph.session` is `null`.
|
|
49
|
+
|
|
50
|
+
An instance built on a person's token is for that person. On a server, make one per request, never at module level.
|
|
51
|
+
`ph.ping()` checks the token without touching a record.
|
|
52
|
+
|
|
53
|
+
## Get, sync, update
|
|
54
|
+
|
|
55
|
+
`ph.patient`, `ph.prescription` and `ph.order` each have the same three calls:
|
|
56
|
+
|
|
57
|
+
| Call | Means |
|
|
58
|
+
| ------------------- | -------------------------------------------------------------------------------------------- |
|
|
59
|
+
| `get(id)` | Read the record. Changes nothing. Returns the live object, or `null` when there's no record. |
|
|
60
|
+
| `sync(input)` | Send what's known, with or without an id: the server finds, matches, creates or updates. |
|
|
61
|
+
| `update(id, input)` | Change that one record: only the fields given change. |
|
|
62
|
+
|
|
63
|
+
`sync` and `update` return `{ <object>, candidates, changes }`:
|
|
64
|
+
|
|
65
|
+
- **the live object**, with the record the server settled on, or still without one (`id: null`).
|
|
66
|
+
- **`candidates`**: the records it might be, when the server isn't certain. The client never picks one for you:
|
|
67
|
+
pick with `patient.pick(id)`, `prescription.continueDraft(id)` or `order.pick(id)`.
|
|
68
|
+
- **`changes`**: what was written, what wasn't and why, and any choices offered.
|
|
69
|
+
|
|
70
|
+
## Live objects
|
|
71
|
+
|
|
72
|
+
`Patient`, `Prescription` and `Order` each have `id`, `state` (the record), `status` (`idle` / `loading` / `saving` /
|
|
73
|
+
`error`), `changes`, `subscribe(listener)`, `sync(input)`, `update(input)` and `reload()`, plus their workflow
|
|
74
|
+
methods (`rx.sign()`, `order.submit()`, …). An instance holds one object per record: the same patient opened twice,
|
|
75
|
+
or through an order, is the same object.
|
|
76
|
+
|
|
77
|
+
## Errors
|
|
78
|
+
|
|
79
|
+
Anything the server answers about the data is a result, not an exception. Only failures that different data can't
|
|
80
|
+
fix throw a `PhotonError`, with `kind`: `network` (retryable), `unauthorized`, `upstream` (`retryable` says),
|
|
81
|
+
`invalid` (a request shape the server rejected) or `refused` (an object's rule said no).
|
|
82
|
+
|
|
83
|
+
## Testing
|
|
84
|
+
|
|
85
|
+
`@photonhealth/client/testing` is for your own tests: `photonOver(scriptedClient(...))` is an instance over a
|
|
86
|
+
scripted network client, with fixtures (`patient`, `rx`, `order`, …) to script it with. It may change before 2.0.0.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
ISC
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ChoiceFieldsFragment } from "../../gql/graphql.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Apply a Choice to the input you sent, producing the input to send next.
|
|
4
|
+
*
|
|
5
|
+
* A Change's options are structured next actions: `argument` is a dotted path
|
|
6
|
+
* into the operation's input (numeric segments index arrays) and `value` is
|
|
7
|
+
* what to set there. Picking "Amoxicillin 500 MG Oral Capsule" from a
|
|
8
|
+
* DISAMBIGUATION change is just: applyOption(input, option) → re-send.
|
|
9
|
+
*
|
|
10
|
+
* Options with a null `argument` mean "call a different operation" — they
|
|
11
|
+
* can't be applied inline; check `isInlineOption` first.
|
|
12
|
+
*
|
|
13
|
+
* Pure and immutable: the original input is never modified.
|
|
14
|
+
*/
|
|
15
|
+
type ApplicableOption = Pick<ChoiceFieldsFragment, "argument" | "value" | "operation"> & {
|
|
16
|
+
/** How the option is shown ("Lisinopril Oral Tablet 10 MG"). */
|
|
17
|
+
displayName?: string;
|
|
18
|
+
};
|
|
19
|
+
export declare const isInlineOption: (option: ApplicableOption) => option is ApplicableOption & {
|
|
20
|
+
argument: string;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* `value` arrives as a string. Structured values (objects, arrays, booleans,
|
|
24
|
+
* null) are JSON-encoded; anything else — including numeric-looking ids — is
|
|
25
|
+
* kept as a string so an id like "0123" is never turned into 123.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseOptionValue(value: string | null | undefined): unknown;
|
|
28
|
+
export declare function setAtPath<T>(input: T, path: string, value: unknown): T;
|
|
29
|
+
/**
|
|
30
|
+
* An option's argument path, relative to the mutation's input. network-api sometimes roots it at the
|
|
31
|
+
* argument name — `patient.clinical.allergies.add.0.id` for the `patient` mutation (boson,
|
|
32
|
+
* 2026-09-29) — and sometimes not (`treatment.id` for `prescription`); drop that leading name.
|
|
33
|
+
*/
|
|
34
|
+
export declare function optionPath(option: ApplicableOption & {
|
|
35
|
+
argument: string;
|
|
36
|
+
}): string;
|
|
37
|
+
export declare function applyOption<T>(input: T, option: ApplicableOption): T;
|
|
38
|
+
/** Put a picked value at its path in the input; a locator (`….id`) replaces its siblings (the typed name). */
|
|
39
|
+
export declare function applyAt<T>(input: T, path: string, value: unknown): T;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=applyOption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyOption.d.ts","sourceRoot":"","sources":["../../../src/api/changes/applyOption.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE;;;;;;;;;;;;GAYG;AAEH,KAAK,gBAAgB,GAAG,IAAI,CAAC,oBAAoB,EAAE,UAAU,GAAG,OAAO,GAAG,WAAW,CAAC,GAAG;IACvF,gEAAgE;IAChE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,QAAQ,gBAAgB,KAAG,MAAM,IAAI,gBAAgB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CACtC,CAAC;AAEpE;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAW1E;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAsBtE;AAUD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAKlF;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,EAAE,gBAAgB,GAAG,CAAC,CAKpE;AAED,8GAA8G;AAC9G,wBAAgB,OAAO,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,CAAC,CAQpE"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
export const isInlineOption = (option) => typeof option.argument === "string" && option.argument.length > 0;
|
|
2
|
+
/**
|
|
3
|
+
* `value` arrives as a string. Structured values (objects, arrays, booleans,
|
|
4
|
+
* null) are JSON-encoded; anything else — including numeric-looking ids — is
|
|
5
|
+
* kept as a string so an id like "0123" is never turned into 123.
|
|
6
|
+
*/
|
|
7
|
+
export function parseOptionValue(value) {
|
|
8
|
+
if (value == null)
|
|
9
|
+
return null;
|
|
10
|
+
const trimmed = value.trim();
|
|
11
|
+
if (/^[[{]/.test(trimmed) || trimmed === "true" || trimmed === "false" || trimmed === "null") {
|
|
12
|
+
try {
|
|
13
|
+
return JSON.parse(trimmed);
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return value;
|
|
20
|
+
}
|
|
21
|
+
export function setAtPath(input, path, value) {
|
|
22
|
+
const segments = path.split(".").filter(Boolean);
|
|
23
|
+
if (segments.length === 0)
|
|
24
|
+
return input;
|
|
25
|
+
const write = (node, depth) => {
|
|
26
|
+
const segment = segments[depth];
|
|
27
|
+
const index = /^\d+$/.test(segment) ? Number(segment) : null;
|
|
28
|
+
const isLast = depth === segments.length - 1;
|
|
29
|
+
if (index !== null) {
|
|
30
|
+
const array = Array.isArray(node) ? [...node] : [];
|
|
31
|
+
array[index] = isLast ? value : write(array[index], depth + 1);
|
|
32
|
+
return array;
|
|
33
|
+
}
|
|
34
|
+
const object = node && typeof node === "object" && !Array.isArray(node) ? { ...node } : {};
|
|
35
|
+
object[segment] = isLast
|
|
36
|
+
? value
|
|
37
|
+
: write(object[segment], depth + 1);
|
|
38
|
+
return object;
|
|
39
|
+
};
|
|
40
|
+
return write(input, 0);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Reference inputs (TreatmentReferenceInput, AllergyReferenceInput, …) take exactly ONE locator.
|
|
44
|
+
* Choosing an option like `treatment.id` must replace the free text `treatment.name` the user typed,
|
|
45
|
+
* not sit beside it — so setting a locator clears its sibling locators. (Seen on boson: a
|
|
46
|
+
* DISAMBIGUATION change returns options `{ argument: "treatment.id", value: "med_…" }`.)
|
|
47
|
+
*/
|
|
48
|
+
const LOCATORS = new Set(["id", "name", "rxNormId", "ndc", "upc", "icd10Code", "externalId"]);
|
|
49
|
+
/**
|
|
50
|
+
* An option's argument path, relative to the mutation's input. network-api sometimes roots it at the
|
|
51
|
+
* argument name — `patient.clinical.allergies.add.0.id` for the `patient` mutation (boson,
|
|
52
|
+
* 2026-09-29) — and sometimes not (`treatment.id` for `prescription`); drop that leading name.
|
|
53
|
+
*/
|
|
54
|
+
export function optionPath(option) {
|
|
55
|
+
const root = `${option.operation}.`;
|
|
56
|
+
const path = option.argument.startsWith(root) ? option.argument.slice(root.length) : option.argument;
|
|
57
|
+
// network-api's pharmacy options omit the OrderPharmacyInput wrapper.
|
|
58
|
+
return option.operation === "order" && path === "pharmacy.id" ? "pharmacy.pharmacy.id" : path;
|
|
59
|
+
}
|
|
60
|
+
export function applyOption(input, option) {
|
|
61
|
+
if (!isInlineOption(option)) {
|
|
62
|
+
throw new Error(`Option "${option.operation}" has no argument path; it calls a different operation.`);
|
|
63
|
+
}
|
|
64
|
+
return applyAt(input, optionPath(option), parseOptionValue(option.value));
|
|
65
|
+
}
|
|
66
|
+
/** Put a picked value at its path in the input; a locator (`….id`) replaces its siblings (the typed name). */
|
|
67
|
+
export function applyAt(input, path, value) {
|
|
68
|
+
const segments = path.split(".").filter(Boolean);
|
|
69
|
+
const last = segments.at(-1);
|
|
70
|
+
if (segments.length > 1 && LOCATORS.has(last)) {
|
|
71
|
+
const parentPath = segments.slice(0, -1).join(".");
|
|
72
|
+
return setAtPath(input, parentPath, { [last]: value });
|
|
73
|
+
}
|
|
74
|
+
return setAtPath(input, path, value);
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=applyOption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applyOption.js","sourceRoot":"","sources":["../../../src/api/changes/applyOption.ts"],"names":[],"mappings":"AAqBA,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAwB,EAAqD,EAAE,CAC5G,OAAO,MAAM,CAAC,QAAQ,KA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C,CAAC,CAAC,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAC;AAChG,CAAC;AAED,MAAM,UAAU,WAAW,CAAI,KAAQ,EAAE,MAAwB;IAC/D,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,KAAK,CAAC,WAAW,MAAM,CAAC,SAAS,yDAAyD,CAAC,CAAC;IACxG,CAAC;IACD,OAAO,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,8GAA8G;AAC9G,MAAM,UAAU,OAAO,CAAI,KAAQ,EAAE,IAAY,EAAE,KAAc;IAC/D,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IACjD,MAAM,IAAI,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAC;IAC9B,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9C,MAAM,UAAU,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACnD,OAAO,SAAS,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ChangeFieldsFragment } from "../../gql/graphql.ts";
|
|
2
|
+
export type Change = ChangeFieldsFragment;
|
|
3
|
+
/** Every payload's changes; `status` says which took effect. */
|
|
4
|
+
export interface ChangeSet {
|
|
5
|
+
changes: Change[];
|
|
6
|
+
/** The input that produced these changes: network-api doesn't echo what it tried to resolve. */
|
|
7
|
+
sent?: unknown;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=classifyChanges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classifyChanges.d.ts","sourceRoot":"","sources":["../../../src/api/changes/classifyChanges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,MAAM,MAAM,MAAM,GAAG,oBAAoB,CAAC;AAE1C,gEAAgE;AAChE,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,gGAAgG;IAChG,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classifyChanges.js","sourceRoot":"","sources":["../../../src/api/changes/classifyChanges.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/changes/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/changes/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { RequestSource } from "../gql/graphql.ts";
|
|
2
|
+
import type { TypedDocumentString } from "../gql/graphql.ts";
|
|
3
|
+
/**
|
|
4
|
+
* The only thing that talks HTTP. Framework-agnostic and auth-library-agnostic:
|
|
5
|
+
* tokens come in through `getToken`, and every call gets RequestMetadata stamped
|
|
6
|
+
* with the operation's name, so the server can tell a SyncPrescription from an
|
|
7
|
+
* UpdatePrescription even though both hit `prescription`.
|
|
8
|
+
*/
|
|
9
|
+
interface NetworkClientOptions {
|
|
10
|
+
/** e.g. https://network.boson.health/graphql */
|
|
11
|
+
url: string;
|
|
12
|
+
/** Returns an Auth0 access token for the prescriber (audience https://api.<env>.health). */
|
|
13
|
+
getToken: () => Promise<string>;
|
|
14
|
+
/** How this client is surfaced. Embeds should pass EMBEDDABLE_COMPONENT. */
|
|
15
|
+
source?: RequestSource;
|
|
16
|
+
/** Prefix for RequestMetadata.client; the operation name is appended: "photon-rx/UpdateOrder". */
|
|
17
|
+
clientName?: string;
|
|
18
|
+
sourceVersion?: string;
|
|
19
|
+
fetch?: typeof fetch;
|
|
20
|
+
}
|
|
21
|
+
/** Variables for an operation, minus the metadata the client fills in. */
|
|
22
|
+
export type OperationVariables<V> = Omit<V, "metadata">;
|
|
23
|
+
export interface NetworkClient {
|
|
24
|
+
execute<R, V>(document: TypedDocumentString<R, V>, variables: OperationVariables<V>, options?: {
|
|
25
|
+
signal?: AbortSignal;
|
|
26
|
+
}): Promise<R>;
|
|
27
|
+
}
|
|
28
|
+
/** Transport / GraphQL-level failure: bad token, network down, invalid document. */
|
|
29
|
+
export declare class NetworkTransportError extends Error {
|
|
30
|
+
readonly operationName: string;
|
|
31
|
+
readonly status?: number | undefined;
|
|
32
|
+
readonly code?: string | undefined;
|
|
33
|
+
readonly errors?: unknown[] | undefined;
|
|
34
|
+
constructor(message: string, operationName: string, status?: number | undefined, code?: string | undefined, errors?: unknown[] | undefined);
|
|
35
|
+
}
|
|
36
|
+
export declare function operationNameOf(document: {
|
|
37
|
+
toString(): string;
|
|
38
|
+
}): string;
|
|
39
|
+
/** Every string in the variables, trimmed — so no field ever reaches network-api with stray whitespace. */
|
|
40
|
+
export declare function trimStrings<T>(value: T): T;
|
|
41
|
+
export declare function createNetworkClient(options: NetworkClientOptions): NetworkClient;
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.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M,CAAC,EAAE,OAAO,EAAE,YAAA;CAK9B;AAID,wBAAgB,eAAe,CAAC,QAAQ,EAAE;IAAE,QAAQ,IAAI,MAAM,CAAA;CAAE,GAAG,MAAM,CAExE;AAED,2GAA2G;AAC3G,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAO1C;AAMD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,oBAAoB,GAAG,aAAa,CAuDhF"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** Transport / GraphQL-level failure: bad token, network down, invalid document. */
|
|
2
|
+
export class NetworkTransportError extends Error {
|
|
3
|
+
operationName;
|
|
4
|
+
status;
|
|
5
|
+
code;
|
|
6
|
+
errors;
|
|
7
|
+
constructor(message, operationName, status, code, errors) {
|
|
8
|
+
super(message);
|
|
9
|
+
this.operationName = operationName;
|
|
10
|
+
this.status = status;
|
|
11
|
+
this.code = code;
|
|
12
|
+
this.errors = errors;
|
|
13
|
+
this.name = "NetworkTransportError";
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const OPERATION_NAME = /\b(?:query|mutation|subscription)\s+([_A-Za-z][_0-9A-Za-z]*)/;
|
|
17
|
+
export function operationNameOf(document) {
|
|
18
|
+
return OPERATION_NAME.exec(document.toString())?.[1] ?? "anonymous";
|
|
19
|
+
}
|
|
20
|
+
/** Every string in the variables, trimmed — so no field ever reaches network-api with stray whitespace. */
|
|
21
|
+
export function trimStrings(value) {
|
|
22
|
+
if (typeof value === "string")
|
|
23
|
+
return value.trim();
|
|
24
|
+
if (Array.isArray(value))
|
|
25
|
+
return value.map(trimStrings);
|
|
26
|
+
if (value && typeof value === "object") {
|
|
27
|
+
return Object.fromEntries(Object.entries(value).map(([k, v]) => [k, trimStrings(v)]));
|
|
28
|
+
}
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
function requestId() {
|
|
32
|
+
return globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
33
|
+
}
|
|
34
|
+
export function createNetworkClient(options) {
|
|
35
|
+
// The global fetch is looked up on each call, not when the client is made: a fetch patched later (a mock
|
|
36
|
+
// like MSW's, a polyfill) is the one used.
|
|
37
|
+
const doFetch = options.fetch ?? ((input, init) => globalThis.fetch(input, init));
|
|
38
|
+
const clientName = options.clientName ?? "photon-rx";
|
|
39
|
+
return {
|
|
40
|
+
async execute(document, variables, { signal } = {}) {
|
|
41
|
+
const operationName = operationNameOf(document);
|
|
42
|
+
const metadata = {
|
|
43
|
+
source: options.source ?? "WEB_APP",
|
|
44
|
+
client: `${clientName}/${operationName}`,
|
|
45
|
+
sourceVersion: options.sourceVersion,
|
|
46
|
+
requestId: requestId(),
|
|
47
|
+
};
|
|
48
|
+
const token = await options.getToken();
|
|
49
|
+
const response = await doFetch(options.url, {
|
|
50
|
+
method: "POST",
|
|
51
|
+
signal,
|
|
52
|
+
headers: {
|
|
53
|
+
"content-type": "application/json",
|
|
54
|
+
accept: "application/graphql-response+json, application/json",
|
|
55
|
+
// Standard Bearer (network-api also still takes x-photon-auth-token). CORS allows only
|
|
56
|
+
// Authorization, Content-Type and x-photon-auth-token — any other custom header fails preflight.
|
|
57
|
+
authorization: `Bearer ${token}`,
|
|
58
|
+
},
|
|
59
|
+
body: JSON.stringify({
|
|
60
|
+
operationName,
|
|
61
|
+
query: document.toString(),
|
|
62
|
+
// Every mutation takes RequestMetadata; queries (Ping) just ignore it.
|
|
63
|
+
variables: document.toString().includes("$metadata")
|
|
64
|
+
? { ...trimStrings(variables), metadata }
|
|
65
|
+
: trimStrings(variables),
|
|
66
|
+
}),
|
|
67
|
+
});
|
|
68
|
+
const body = (await response.json().catch(() => null));
|
|
69
|
+
if (body?.errors?.length || !body?.data) {
|
|
70
|
+
const first = body?.errors?.[0];
|
|
71
|
+
throw new NetworkTransportError(first?.message ?? `network-api responded ${response.status}`, operationName, response.status, first?.extensions?.code, body?.errors);
|
|
72
|
+
}
|
|
73
|
+
return body.data;
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/api/client.ts"],"names":[],"mappings":"AAkCA,oFAAoF;AACpF,MAAM,OAAO,qBAAsB,SAAQ,KAAK;IAGnC;IACA;IACA;IACA;IALX,YACE,OAAe,EACN,aAAqB,EACrB,MAAe,EACf,IAAa,EACb,MAAkB;QAE3B,KAAK,CAAC,OAAO,CAAC,CAAC;QALN,kBAAa,GAAb,aAAa,CAAQ;QACrB,WAAM,GAAN,MAAM,CAAS;QACf,SAAI,GAAJ,IAAI,CAAS;QACb,WAAM,GAAN,MAAM,CAAY;QAG3B,IAAI,CAAC,IAAI,GAAG,uBAAuB,CAAC;IACtC,CAAC;CACF;AAED,MAAM,cAAc,GAAG,8DAA8D,CAAC;AAEtF,MAAM,UAAU,eAAe,CAAC,QAAgC;IAC9D,OAAO,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC;AACtE,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAAU,WAAW,CAAI,KAAQ;IACrC,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC,IAAI,EAAO,CAAC;IACxD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC,GAAG,CAAC,WAAW,CAAM,CAAC;IAC7D,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CA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.js","sourceRoot":"","sources":["../../src/api/health.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,+DAA+D;AAC/D,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,MAAqB;IAC9C,OAAO,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The network-api layer: the only code that talks HTTP.
|
|
3
|
+
*
|
|
4
|
+
* client createNetworkClient: fetch + auth header + RequestMetadata
|
|
5
|
+
* Every resource has the same three operations on its one upsert mutation:
|
|
6
|
+
* patient getPatient · syncPatient · updatePatient
|
|
7
|
+
* prescription getPrescription · syncPrescription · updatePrescription (no patient → a drug lookup)
|
|
8
|
+
* order getOrder · syncOrder · updateOrder (+ submitOrder = update state SUBMITTED)
|
|
9
|
+
* health ping
|
|
10
|
+
* changes classifyChanges, applyOption — how to act on any ChangeSet
|
|
11
|
+
*
|
|
12
|
+
* Internal: photon/ builds the public API on it.
|
|
13
|
+
*/
|
|
14
|
+
export * from "./client.ts";
|
|
15
|
+
export * from "./results.ts";
|
|
16
|
+
export * from "./health.ts";
|
|
17
|
+
export * from "./patient.ts";
|
|
18
|
+
export * from "./prescription.ts";
|
|
19
|
+
export * from "./order.ts";
|
|
20
|
+
export * from "./changes/index.ts";
|
|
21
|
+
export type * from "../gql/graphql.ts";
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AAEnC,mBAAmB,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The network-api layer: the only code that talks HTTP.
|
|
3
|
+
*
|
|
4
|
+
* client createNetworkClient: fetch + auth header + RequestMetadata
|
|
5
|
+
* Every resource has the same three operations on its one upsert mutation:
|
|
6
|
+
* patient getPatient · syncPatient · updatePatient
|
|
7
|
+
* prescription getPrescription · syncPrescription · updatePrescription (no patient → a drug lookup)
|
|
8
|
+
* order getOrder · syncOrder · updateOrder (+ submitOrder = update state SUBMITTED)
|
|
9
|
+
* health ping
|
|
10
|
+
* changes classifyChanges, applyOption — how to act on any ChangeSet
|
|
11
|
+
*
|
|
12
|
+
* Internal: photon/ builds the public API on it.
|
|
13
|
+
*/
|
|
14
|
+
export * from "./client.js";
|
|
15
|
+
export * from "./results.js";
|
|
16
|
+
export * from "./health.js";
|
|
17
|
+
export * from "./patient.js";
|
|
18
|
+
export * from "./prescription.js";
|
|
19
|
+
export * from "./order.js";
|
|
20
|
+
export * from "./changes/index.js";
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ChangeSet } from "./changes/index.ts";
|
|
2
|
+
import type { NetworkClient, OperationVariables } from "./client.ts";
|
|
3
|
+
import { type OrderFieldsFragment, type OrderResultFieldsFragment, type SyncOrderMutationVariables, type UpdateOrderMutationVariables } from "../gql/graphql.ts";
|
|
4
|
+
import { type Outcome } from "./results.ts";
|
|
5
|
+
export type Order = OrderFieldsFragment;
|
|
6
|
+
export type OrderCandidate = Extract<OrderResultFieldsFragment, {
|
|
7
|
+
__typename: "AmbiguousOrderMatch";
|
|
8
|
+
}>["candidates"][number];
|
|
9
|
+
export type OrderOutcome = Outcome<{
|
|
10
|
+
order: Order | null;
|
|
11
|
+
changes: ChangeSet;
|
|
12
|
+
}, {
|
|
13
|
+
reason: string;
|
|
14
|
+
candidates: OrderCandidate[];
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* Fields you can patch on an order. Omit one to leave it alone; `pharmacy: { none: true }` unassigns it
|
|
18
|
+
* (the patient chooses again — works after submit too).
|
|
19
|
+
*/
|
|
20
|
+
type OrderPatch = Omit<OperationVariables<UpdateOrderMutationVariables>, "id">;
|
|
21
|
+
/** GetOrder — read a known order with its patient, prescriptions and pharmacy. */
|
|
22
|
+
export declare function getOrder(client: NetworkClient, id: string): Promise<OrderOutcome>;
|
|
23
|
+
/**
|
|
24
|
+
* SyncOrder — whatever's known: the patient's DRAFT order (continued) or a new one, with the prescriptions to
|
|
25
|
+
* put on it; with an id, that order. Nothing is sent until submitOrder.
|
|
26
|
+
*/
|
|
27
|
+
export declare function syncOrder(client: NetworkClient, input: OperationVariables<SyncOrderMutationVariables>): Promise<OrderOutcome>;
|
|
28
|
+
/** UpdateOrder — e.g. `{ prescriptions: { add } }`, `{ pharmacy: { pharmacy } }`, `{ pharmacy: { none: true } }`, `{ state: "CANCELED" }`. */
|
|
29
|
+
export declare function updateOrder(client: NetworkClient, id: string, patch: OrderPatch): Promise<OrderOutcome>;
|
|
30
|
+
/** Send = UpdateOrder to SUBMITTED. Pharmacy untouched: none → the patient chooses; an existing choice is kept. */
|
|
31
|
+
export declare function submitOrder(client: NetworkClient, id: string): Promise<OrderOutcome>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=order.d.ts.map
|
|
@@ -0,0 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BAAgB,WAAW,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,yBAE5D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { GetOrderDocument, SyncOrderDocument, UpdateOrderDocument, } from "../gql/graphql.js";
|
|
2
|
+
import { assertNotOperationError } from "./results.js";
|
|
3
|
+
function settle(result, sent) {
|
|
4
|
+
const r = assertNotOperationError(result);
|
|
5
|
+
if (r.__typename === "AmbiguousOrderMatch") {
|
|
6
|
+
return { kind: "ambiguous", reason: r.reason, candidates: r.candidates };
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
kind: "ok",
|
|
10
|
+
order: r.order,
|
|
11
|
+
changes: { changes: r.changes, sent },
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** GetOrder — read a known order with its patient, prescriptions and pharmacy. */
|
|
15
|
+
export async function getOrder(client, id) {
|
|
16
|
+
return settle((await client.execute(GetOrderDocument, { id })).order, { id });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* SyncOrder — whatever's known: the patient's DRAFT order (continued) or a new one, with the prescriptions to
|
|
20
|
+
* put on it; with an id, that order. Nothing is sent until submitOrder.
|
|
21
|
+
*/
|
|
22
|
+
export async function syncOrder(client, input) {
|
|
23
|
+
return settle((await client.execute(SyncOrderDocument, input)).order, input);
|
|
24
|
+
}
|
|
25
|
+
/** UpdateOrder — e.g. `{ prescriptions: { add } }`, `{ pharmacy: { pharmacy } }`, `{ pharmacy: { none: true } }`, `{ state: "CANCELED" }`. */
|
|
26
|
+
export async function updateOrder(client, id, patch) {
|
|
27
|
+
return settle((await client.execute(UpdateOrderDocument, { id, ...patch })).order, patch);
|
|
28
|
+
}
|
|
29
|
+
/** Send = UpdateOrder to SUBMITTED. Pharmacy untouched: none → the patient chooses; an existing choice is kept. */
|
|
30
|
+
export function submitOrder(client, id) {
|
|
31
|
+
return updateOrder(client, id, { state: "SUBMITTED" });
|
|
32
|
+
}
|
|
33
|
+
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,EAAE,EAAU,EAAE,KAAiB;IACpF,OAAO,MAAM,CAAC,CAAC,MAAM,MAAM,CAAC,OAAO,CAAC,mBAAmB,EAAE,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAC5F,CAAC;AAED,mHAAmH;AACnH,MAAM,UAAU,WAAW,CAAC,MAAqB,EAAE,EAAU;IAC3D,OAAO,WAAW,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;AACzD,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { ChangeSet } from "./changes/index.ts";
|
|
2
|
+
import type { NetworkClient } from "./client.ts";
|
|
3
|
+
import { type PatientClinicalInput, type PatientDemographicInput, type PatientFieldsFragment, type PatientResultFieldsFragment } from "../gql/graphql.ts";
|
|
4
|
+
import { type Outcome } from "./results.ts";
|
|
5
|
+
export type Patient = PatientFieldsFragment;
|
|
6
|
+
export type PatientCandidate = Extract<PatientResultFieldsFragment, {
|
|
7
|
+
__typename: "AmbiguousPatientMatch";
|
|
8
|
+
}>["candidates"][number];
|
|
9
|
+
export type PatientOutcome = Outcome<{
|
|
10
|
+
patient: Patient | null;
|
|
11
|
+
changes: ChangeSet;
|
|
12
|
+
}, {
|
|
13
|
+
reason: string;
|
|
14
|
+
candidates: PatientCandidate[];
|
|
15
|
+
}>;
|
|
16
|
+
/** GetPatient — read a known patient. */
|
|
17
|
+
export declare function getPatient(client: NetworkClient, id: string): Promise<PatientOutcome>;
|
|
18
|
+
type PatientFields = {
|
|
19
|
+
demographic?: PatientDemographicInput;
|
|
20
|
+
clinical?: PatientClinicalInput;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* SyncPatient — whatever's known, an id or not: the server finds the patient, lists candidates (the prescriber
|
|
24
|
+
* picks), says what's missing, or creates one when nothing matches and it has enough (today: first, last, DOB,
|
|
25
|
+
* sex — leave `sex` out to look without creating).
|
|
26
|
+
*/
|
|
27
|
+
export declare function syncPatient(client: NetworkClient, input: PatientFields & {
|
|
28
|
+
id?: string;
|
|
29
|
+
}, signal?: AbortSignal): Promise<PatientOutcome>;
|
|
30
|
+
/** UpdatePatient — change that one patient: demographics and/or clinical lists. NKDA: `clinical: { allergies: { none: true } }`. */
|
|
31
|
+
export declare function updatePatient(client: NetworkClient, id: string, patch: PatientFields): Promise<PatientOutcome>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=patient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patient.d.ts","sourceRoot":"","sources":["../../src/api/patient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAIL,KAAK,oBAAoB,EACzB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA6C,KAAK,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvF,MAAM,MAAM,OAAO,GAAG,qBAAqB,CAAC;AAC5C,MAAM,MAAM,gBAAgB,GAAG,OAAO,CACpC,2BAA2B,EAC3B;IAAE,UAAU,EAAE,uBAAuB,CAAA;CAAE,CACxC,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAExB,MAAM,MAAM,cAAc,GAAG,OAAO,CAClC;IAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,SAAS,CAAA;CAAE,EAC/C;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,gBAAgB,EAAE,CAAA;CAAE,CACnD,CAAC;AAgBF,yCAAyC;AACzC,wBAAsB,UAAU,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,2BAEjE;AAED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