Commit 417330e
feat: expandForValueSet for RxNorm and LOINC with SQL push-down
Implement expandForValueSet on both RxNorm and LOINC providers using
better-sqlite3 lazy cursors. The worker passes the full compose hull
(includes, excludes, activeOnly, paging) to each provider, which handles
everything in a single SQL query with LIMIT/OFFSET.
RxNorm: TTY/STY filter mapping, GROUP BY for JOIN dedup, exclude push-down.
LOINC: Relationship/Property/Status filter mapping, UNION per include,
existing indexes cover all patterns without additions.
Paging offset/count are only passed for single-system composes where they
are exact. Multi-system composes get filter/exclude push-down but no paging.
Benchmarks: RxNorm 13/13 pass (median 37x), LOINC 14/14 pass (median 25x).
Replay: no regressions on captured production queries.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 13937db commit 417330e
6 files changed
Lines changed: 711 additions & 400 deletions
File tree
- docs
- tx
- cs
- workers
0 commit comments