@clinia/context-engine-js 0.7.0 → 0.10.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 CHANGED
@@ -1,5 +1,93 @@
1
1
  # @clinia/context-engine-js
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 7e113a5: - Medication `extracted_fact` nodes carry `identity`: the record's own ingredients, route, and dose forms for `other`.
8
+ - They also carry `identityEvidence`: how each part was decided.
9
+ - For ingredients and dose form: every candidate the vocabulary found, or why it found none.
10
+ - For the route: every step's decision, as `routeDecision.evidence` gave it.
11
+ - `routeDecision` is gone. Read the route from `identity.route` and its decisions from `identityEvidence.route`.
12
+
13
+ ## 0.10.0-rc.1
14
+
15
+ No changes in this release.
16
+
17
+ ## 0.10.0-rc.0
18
+
19
+ ### Minor Changes
20
+
21
+ - 7e113a5: - Medication `extracted_fact` nodes carry `identity`: the record's own ingredients, route, and dose forms for `other`.
22
+ - They also carry `identityEvidence`: how each part was decided.
23
+ - For ingredients and dose form: every candidate the vocabulary found, or why it found none.
24
+ - For the route: every step's decision, as `routeDecision.evidence` gave it.
25
+ - `routeDecision` is gone. Read the route from `identity.route` and its decisions from `identityEvidence.route`.
26
+
27
+ ## 0.9.0
28
+
29
+ ### Minor Changes
30
+
31
+ - 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.
32
+ - 565b767: Facts and events now carry every date their source states, each under its own name, such as `occurredAt` or `expiresAt`.
33
+ - 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`.
34
+ - Immunizations, demographics and family history no longer carry an `effectivePeriod`.
35
+
36
+ - daf1ece: - Medication `extracted_fact` nodes carry `routeDecision`: the route the record was given and every decision behind it.
37
+ - Each decision says what it came from: the product's dose form, a phrase in the record, or a model.
38
+ - A model's decision also gives the model, how sure it was, and what it read.
39
+ - Only medications whose route was decided at ingestion carry it.
40
+ - 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.
41
+
42
+ 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`.
43
+
44
+ ### Patch Changes
45
+
46
+ - 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.
47
+ - 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.
48
+
49
+ ## 0.9.0-rc.3
50
+
51
+ No changes in this release.
52
+
53
+ ## 0.9.0-rc.2
54
+
55
+ ### Minor Changes
56
+
57
+ - daf1ece: - Medication `extracted_fact` nodes carry `routeDecision`: the route the record was given and every decision behind it.
58
+ - Each decision says what it came from: the product's dose form, a phrase in the record, or a model.
59
+ - A model's decision also gives the model, how sure it was, and what it read.
60
+ - Only medications whose route was decided at ingestion carry it.
61
+
62
+ ### Patch Changes
63
+
64
+ - 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.
65
+
66
+ ## 0.9.0-rc.1
67
+
68
+ ### Minor Changes
69
+
70
+ - 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.
71
+
72
+ 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`.
73
+
74
+ ## 0.9.0-rc.0
75
+
76
+ ### Minor Changes
77
+
78
+ - 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.
79
+ - 565b767: Facts and events now carry every date their source states, each under its own name, such as `occurredAt` or `expiresAt`.
80
+ - 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`.
81
+ - Immunizations, demographics and family history no longer carry an `effectivePeriod`.
82
+
83
+ ### Patch Changes
84
+
85
+ - 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.
86
+
87
+ ## 0.8.0
88
+
89
+ No changes in this release.
90
+
3
91
  ## 0.7.0
4
92
 
5
93
  No changes in this release.
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @clinia/context-engine-js
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 generate # regenerate types from ../../context-engine.yaml
153
+ pnpm install
157
154
  pnpm build # bundle (tsup) + emit declarations (tsc)
158
155
  pnpm typecheck
156
+ pnpm test
159
157
  ```
160
158
 
161
- Tests run from the repo root (Vitest discovers this package's `vitest.config.ts`):
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
- ```sh
164
- pnpm test # whole workspace
165
- pnpm vitest run --project context-engine-js # this package only
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.