Commit 62bdad2
committed
0.10.1 — eventToShortText: generalize formatDatasource for treatment + procedure
formatDatasource() previously only recognized medication's {drug, intake}
shape (or the legacy flat shape). Newly added treatment-coded ({regimen,
count?, notes?}) and procedure-coded ({procedure, count?, findings?, notes?})
events fell through to the JSON.stringify fallback and rendered the entire
content blob in the diary.
This change resolves the coded value across known shapes (drug / regimen /
procedure) and falls back to the first object property that carries a
`label`. Modality-specific extras append in the same `— …` suffix:
- medication intake (doseValue, doseUnit, route) — preserved
- count > 1 → "×N"
- procedure findings[].label (first 1–2)
- truncated notes
All 50 existing tests still pass.1 parent 6c05131 commit 62bdad2
3 files changed
Lines changed: 48 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
223 | | - | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
224 | 239 | | |
225 | 240 | | |
226 | | - | |
| 241 | + | |
227 | 242 | | |
228 | 243 | | |
229 | 244 | | |
230 | 245 | | |
231 | | - | |
232 | 246 | | |
233 | | - | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
234 | 251 | | |
235 | 252 | | |
236 | 253 | | |
237 | 254 | | |
238 | 255 | | |
239 | | - | |
240 | | - | |
| 256 | + | |
241 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
242 | 276 | | |
243 | 277 | | |
244 | 278 | | |
| |||
0 commit comments