Skip to content

refactor: take the RXO segment the dosage builder is always given - #82

Merged
NSchatz merged 1 commit into
mainfrom
sec11/dosage-rxo-required
Nov 8, 2026
Merged

NSchatz merged 1 commit into
mainfrom
sec11/dosage-rxo-required

Conversation

@NSchatz

@NSchatz NSchatz commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Clears CodeQL alert 16 (js/unneeded-defensive-code) on transform.

In src/messages/medication-request.ts, buildDosageInstruction typed its RXO segment as optional and guarded the dose range on it, but its one caller, buildMedicationRequest, has already returned when the order has no RXO. The parameter is now Segment and the always-true guard is gone; the dose range code runs as before. Output is unchanged: test/messages/orders.test.ts and test/messages/tq1-timing.test.ts pin doseAndRate.doseRange with and without TQ1, and they pass as before.

A patch changeset. The gate ran locally in CI order: typecheck, lint, format, PHI scan, test, coverage, build, attw, conformance, the examples, and the house, dash, and public-surface checks.

Items: SEC11.

Clears CodeQL alert 16 (js/unneeded-defensive-code) on transform.

In `src/messages/medication-request.ts`, `buildDosageInstruction` typed its RXO segment as optional and guarded the dose range on it, but its one caller, `buildMedicationRequest`, has already returned when the order has no RXO. The parameter is now `Segment` and the always-true guard is gone; the dose range code runs as before. Output is unchanged: `test/messages/orders.test.ts` and `test/messages/tq1-timing.test.ts` pin `doseAndRate.doseRange` with and without TQ1, and they pass as before.

A patch changeset. The gate ran locally in CI order: typecheck, lint, format, PHI scan, test, coverage, build, attw, conformance, the examples, and the house, dash, and public-surface checks.

Items: SEC11.
@NSchatz
NSchatz merged commit b8c3f19 into main Nov 8, 2026
13 checks passed
@NSchatz
NSchatz deleted the sec11/dosage-rxo-required branch November 8, 2026 04:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant