Skip to content

Commit 5cfd623

Browse files
committed
Plan 46: README — eventToShortText shapes + forEvent walk-up
Notes the generalised eventToShortText (handles {drug}/{regimen}/{procedure} payloads with optional count, findings, notes) and adds a forEvent example showing parent-stream walk-up for context-via-substream resolution.
1 parent 43e5cf9 commit 5cfd623

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Generic toolkit for server and web applications — [Health Data Safe](https://g
1414
3. **HDSSettings** — Per-app user settings (locale, theme, timezone, date format, unit system)
1515
4. **HDSProfile** — Account-level profile (display name, avatar, date of birth, sex, country)
1616
5. **Pryv extensions** — Extends [Pryv JS lib](https://github.com/pryv/lib-js) with Socket.io and Monitor support
17-
6. **Toolkit** — Stream auto-creation, reminders, duration parsing, event formatting
17+
6. **Toolkit** — Stream auto-creation, reminders, duration parsing, event formatting (`eventToShortText` handles `{drug}` / `{regimen}` / `{procedure}` payload shapes uniformly, with optional `×count`, procedure findings, and truncated notes)
1818

1919
## Quick start
2020

@@ -26,6 +26,10 @@ await HDSLib.initHDSModel();
2626

2727
const model = HDSLib.getHDSModel();
2828
const weight = model.itemsDefs.forKey('body-weight');
29+
30+
// Resolve the itemDef for an event — walks parent streams for context-via-substream cases
31+
// (e.g. event on `treatment-fertility` resolves to `treatment-coded` registered at `treatment`).
32+
const itemDef = model.itemsDefs.forEvent(event);
2933
```
3034

3135
## Dev

0 commit comments

Comments
 (0)