Repository navigation
feat(flow4d): Phase D — governed DRG catalog → conformance bridge (ships dark) - #115
Merged
Merged
Conversation
…ips dark) D1 ReferenceModelCompiler: pure declarative compile (ordered activities, timing targets, data-driven deviation labels) + content-address digest; thin DB adapter returns null for a version with no persisted executable layer (every version in the current inactive release). D2 milestone↔OCEL activity map + the `care-pathways:ocel-coverage` gap report. D4 PathwayInstanceReadService: flag+schema-guarded, append-only reads via the current-status views. D5 synthetic demo overlay — curated HF milestones → the SAME pure compiler → LOS-driven progress in the journey drawer, gated only by care-pathways.demo; new flow4d.pathway_progress serving flag composes with the assignment gate (both off by default). D3 CPG-on-FHIR-vs-bespoke decision memo. Serving stays dark (plan G-9): nothing per-patient from the DRG catalog reaches a screen without [SU]/clinical sign-off; the journey response is byte-identical when both flags are off. No migration. 25 new PHP tests + 6 JS tests, all green (compiler determinism/digest pin, coverage report, read-service inertness + append-only untouched, demo synthesis, journey inertness + demo attach, drawer render + schema tolerance).
3 tasks done
sudoshi
added a commit
that referenced
this pull request
Jul 28, 2026
Follows the independent review of PR #115 (no CRITICAL/HIGH; PHI-opaqueness, dark-serving inertness, append-only reads all confirmed). - PatientJourneyService: cast Carbon 3's float diffInMinutes to int before intdiv (was E_DEPRECATED lossy float→int per demo journey-open, TypeError under PHP 9); cache the designated-demo-encounter lookup 60s (was an unindexed ORDER BY admitted_at scan per journey request while the demo flag is on). - PathwayInstanceReadService: select only the 3 columns used from patient_experience.pathway_instances (the table also carries an encrypted source-identity column — never pull it into memory). - ReferenceModelCompiler: dedup duplicate stable_keys in the public compile() (first occurrence wins; compileVersion already relies on the DB unique key). - Tests: fractional-timestamp LOS regression with an E_DEPRECATED trap (PHPUnit here isn't set to fail on deprecations), null-encounter-id short-circuit, duplicate-stable_key dedup. 116 CarePathways+PatientFlow green; Pint clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Phase D of the Flow-4D Patient-Journey & Conformance plan — the bridge between the governed 250-DRG care-pathway catalog and the Arena conformance engine. Ships dark: nothing per-patient from the DRG catalog reaches a screen without [SU]/clinical sign-off (plan G-9). The only visible artifact is a synthetic, clearly-labeled demo overlay under the already-on demo flag. No migration; no prod flags changed.
ReferenceModelCompiler— purecompile()→ the declarative portion of the sidecarPATHWAYSspec (ordered activities, timing targets, data-driven deviation labels) + a content-address digest; DB adapter returnsnullfor a version with no persisted executable layer (every version in the inactive release). Deliberately does not emit the sidecar's imperativeevaluatecallable.config/care-pathways-ocel-map.php+care-pathways:ocel-coverage— the honest unmapped-milestone gap report.PlanDefinitionas canonical representation (serving-gated follow-up), defer CQL execution, ship the bespoke compiler now.PathwayInstanceReadService—assignment_enabled+Schema::hasTableguarded, append-only reads via thecurrent_*_statusesviews, grant resolved bysource_encounter_id.FlowPathwayDemoService— curated HF milestones → the same pure compiler → LOS-driven synthetic progress in the journey drawer (PathwayProgressPanel), gated bycare_pathways.demo. Newflow4d.pathway_progressserving flag composes withassignment_enabled.Why it's safe (dark)
pathway_progressentirely when both the serving flag and the demo flag are off — byte-identical inertness, test-pinned.FLOW4D_PATHWAY_PROGRESS_ENABLEDandCARE_PATHWAYS_ASSIGNMENT_ENABLED(both off by default) — checked at the service AND the orchestrator/component.clinical_useis always false; the demo carries an explicit "Demo — not clinical guidance" notice and writes nothing to the DB.Test plan
compileVersionadapter, OCEL coverage report, read-service progress + flag-off inertness + append-only-untouched, demo synthesis, journey inertness + demo-attach). Full CarePathways + PatientFlow suites: 113 green.tsc --noEmit,vite build(stricter),check-ui-canon.sh, Pint — all clean.Deferred (with serving; not scheduled)
PlanDefinitionprojection output (D3); any real per-patient serving from the DRG catalog ([SU]/clinical, G-9); authoring the executable milestone layer.🤖 Generated with Claude Code