@clinia/context-engine-js 0.7.0 → 0.9.0
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/CHANGELOG.md +64 -0
- package/README.md +15 -16
- package/dist/generated/context-engine.d.ts +669 -345
- package/dist/generated/types.d.ts +7 -1
- package/dist/index.js +23 -6
- package/dist/index.js.map +1 -1
- package/dist/resources/info.d.ts +8 -0
- package/dist/resources/ingest.d.ts +56 -1
- package/dist/resources/sessions.d.ts +23 -51
- package/package.json +14 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# @clinia/context-engine-js
|
|
2
2
|
|
|
3
|
+
## 0.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 15c24e0: Concept-identity evidence in resolution decisions now reports its layer as `deterministic-code`, like the other code-based evidence, instead of its own `concept-identity` layer. No stored concept-identity evidence exists in any deployment, so no data migration is needed.
|
|
8
|
+
- 565b767: Facts and events now carry every date their source states, each under its own name, such as `occurredAt` or `expiresAt`.
|
|
9
|
+
- In the graph API, read `authoredAt` instead of `date`, `effectivePeriod.start` instead of a condition's `onsetDate`, and `occurredAt` instead of an immunization's `occurrenceDate`.
|
|
10
|
+
- Immunizations, demographics and family history no longer carry an `effectivePeriod`.
|
|
11
|
+
|
|
12
|
+
- daf1ece: - Medication `extracted_fact` nodes carry `routeDecision`: the route the record was given and every decision behind it.
|
|
13
|
+
- Each decision says what it came from: the product's dose form, a phrase in the record, or a model.
|
|
14
|
+
- A model's decision also gives the model, how sure it was, and what it read.
|
|
15
|
+
- Only medications whose route was decided at ingestion carry it.
|
|
16
|
+
- 7216e9a: Depending on how it was ingested, a medication fact in the patient graph can now be returned as what identifies it: its RxNorm ingredients and its route, in a new `identity` field. Its `display` then reads like `metformin hydrochloride, oral`. The fact keeps only its codes, effective period and status, and `fieldVerdicts` holds only `status`. Its dose, frequency, route text and other dates are on the extracted facts in its `members`. Medications stored before this release keep coming back in full until new records about them are ingested.
|
|
17
|
+
|
|
18
|
+
Two medications become one entry only when they have the same ingredients and the same route, so oral and topical diclofenac stay separate. Resolution evidence has three new kinds, `medication-identity-match`, `medication-identity-mismatch` and `medication-identity-incomplete`, each showing both medications' ingredients and route as a `MedicationIdentity`.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- 8253136: Release candidates of the TypeScript client are no longer published to npm. Only stable releases are. The `rc` tag on npm will not get new versions. If you install `@clinia/context-engine-js@rc`, switch to the latest stable version.
|
|
23
|
+
- d44392f: Each child in a VFS browse result can carry a `display` label, a readable name shown beside its `name`. The `name` stays what you put in the path.
|
|
24
|
+
|
|
25
|
+
## 0.9.0-rc.3
|
|
26
|
+
|
|
27
|
+
No changes in this release.
|
|
28
|
+
|
|
29
|
+
## 0.9.0-rc.2
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- daf1ece: - Medication `extracted_fact` nodes carry `routeDecision`: the route the record was given and every decision behind it.
|
|
34
|
+
- Each decision says what it came from: the product's dose form, a phrase in the record, or a model.
|
|
35
|
+
- A model's decision also gives the model, how sure it was, and what it read.
|
|
36
|
+
- Only medications whose route was decided at ingestion carry it.
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- d44392f: Each child in a VFS browse result can carry a `display` label, a readable name shown beside its `name`. The `name` stays what you put in the path.
|
|
41
|
+
|
|
42
|
+
## 0.9.0-rc.1
|
|
43
|
+
|
|
44
|
+
### Minor Changes
|
|
45
|
+
|
|
46
|
+
- 7216e9a: Depending on how it was ingested, a medication fact in the patient graph can now be returned as what identifies it: its RxNorm ingredients and its route, in a new `identity` field. Its `display` then reads like `metformin hydrochloride, oral`. The fact keeps only its codes, effective period and status, and `fieldVerdicts` holds only `status`. Its dose, frequency, route text and other dates are on the extracted facts in its `members`. Medications stored before this release keep coming back in full until new records about them are ingested.
|
|
47
|
+
|
|
48
|
+
Two medications become one entry only when they have the same ingredients and the same route, so oral and topical diclofenac stay separate. Resolution evidence has three new kinds, `medication-identity-match`, `medication-identity-mismatch` and `medication-identity-incomplete`, each showing both medications' ingredients and route as a `MedicationIdentity`.
|
|
49
|
+
|
|
50
|
+
## 0.9.0-rc.0
|
|
51
|
+
|
|
52
|
+
### Minor Changes
|
|
53
|
+
|
|
54
|
+
- 15c24e0: Concept-identity evidence in resolution decisions now reports its layer as `deterministic-code`, like the other code-based evidence, instead of its own `concept-identity` layer. No stored concept-identity evidence exists in any deployment, so no data migration is needed.
|
|
55
|
+
- 565b767: Facts and events now carry every date their source states, each under its own name, such as `occurredAt` or `expiresAt`.
|
|
56
|
+
- In the graph API, read `authoredAt` instead of `date`, `effectivePeriod.start` instead of a condition's `onsetDate`, and `occurredAt` instead of an immunization's `occurrenceDate`.
|
|
57
|
+
- Immunizations, demographics and family history no longer carry an `effectivePeriod`.
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- 8253136: Release candidates of the TypeScript client are no longer published to npm. Only stable releases are. The `rc` tag on npm will not get new versions. If you install `@clinia/context-engine-js@rc`, switch to the latest stable version.
|
|
62
|
+
|
|
63
|
+
## 0.8.0
|
|
64
|
+
|
|
65
|
+
No changes in this release.
|
|
66
|
+
|
|
3
67
|
## 0.7.0
|
|
4
68
|
|
|
5
69
|
No changes in this release.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Context Engine TypeScript Client
|
|
2
2
|
|
|
3
3
|
TypeScript client for the Clinia Context Engine API. A thin, typed wrapper over
|
|
4
4
|
[`openapi-fetch`](https://openapi-ts.dev/openapi-fetch/) — request/response
|
|
@@ -13,14 +13,8 @@ npm install @clinia/context-engine-js
|
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Published on [npm](https://www.npmjs.com/package/@clinia/context-engine-js). No
|
|
16
|
-
registry configuration or authentication is needed.
|
|
17
|
-
|
|
18
|
-
While the engine is in release-candidate phase, the newest build is under the
|
|
19
|
-
`rc` dist-tag:
|
|
20
|
-
|
|
21
|
-
```sh
|
|
22
|
-
npm install @clinia/context-engine-js@rc
|
|
23
|
-
```
|
|
16
|
+
registry configuration or authentication is needed. Only stable releases are
|
|
17
|
+
published here.
|
|
24
18
|
|
|
25
19
|
**This package is ESM-only** (`"type": "module"`). `require()` of it throws
|
|
26
20
|
`ERR_REQUIRE_ESM`; use `import`, or a dynamic `await import()` from CommonJS.
|
|
@@ -73,6 +67,9 @@ await client.patients.getPatient("abc");
|
|
|
73
67
|
await client.graph.listNodes("abc", "fact", { query: { perPage: 50 } });
|
|
74
68
|
await client.ingest.ingestCdaR2("abc", cdaXml);
|
|
75
69
|
await client.ingest.ingestCdaR2Multipart("abc", { documents: [firstCda, secondCda] });
|
|
70
|
+
await client.ingest.ingestSessions("abc", {
|
|
71
|
+
sessions: [{ messages: [{ role: "user", content: "Hi" }] }],
|
|
72
|
+
});
|
|
76
73
|
```
|
|
77
74
|
|
|
78
75
|
Responses are `{ data, error }` — nothing throws on a non-2xx.
|
|
@@ -153,18 +150,20 @@ is implemented as such a middleware internally.
|
|
|
153
150
|
## Development
|
|
154
151
|
|
|
155
152
|
```sh
|
|
156
|
-
pnpm
|
|
153
|
+
pnpm install
|
|
157
154
|
pnpm build # bundle (tsup) + emit declarations (tsc)
|
|
158
155
|
pnpm typecheck
|
|
156
|
+
pnpm test
|
|
159
157
|
```
|
|
160
158
|
|
|
161
|
-
|
|
159
|
+
`src/generated/` and `src/resources/` are generated from the Context Engine OpenAPI spec on each release. Don't edit them by hand.
|
|
162
160
|
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
161
|
+
The [GitHub repository](https://github.com/clinia/context-engine-js) mirrors each release, so it can't merge pull requests. Report bugs in its [issues](https://github.com/clinia/context-engine-js/issues).
|
|
162
|
+
|
|
163
|
+
## Changelog
|
|
164
|
+
|
|
165
|
+
See the [Context Engine changelog](https://docs.clinia.com/changelog).
|
|
167
166
|
|
|
168
167
|
## License
|
|
169
168
|
|
|
170
|
-
[Apache-2.0](LICENSE) © Clinia Health Inc.
|
|
169
|
+
[Apache-2.0](https://github.com/clinia/context-engine-js/blob/main/LICENSE) © Clinia Health Inc.
|