AI measurements need a human correction path
At MyMedicalHub, automated movement analysis places lines and angles on recorded frames to measure range of motion. Sometimes it chooses an imperfect frame or a slightly wrong anatomical position. A clinical reviewer then has to pick the right frame, correct the lines and angles, compare against reference guidance, and save a revised measurement without losing the exercise context.
In the legacy tool, all of that lived inside the canvas. Points drifted when the media was scaled. Lines that should move along one axis moved freely. When upstream data was malformed, the canvas just failed, with nothing to tell the reviewer why.
If the tool for correcting AI is itself ambiguous, people end up trusting the AI more, not less.
Geometry became a domain, separate from rendering
Coordinate and measurement calculations are now pure functions that can be tested without Konva. The canvas renders and handles interaction. The domain decides what is correct.
Measurement semantics stay explicit through load, edit, render and save: line type, direction, measurement type, left and right values and plumb-line relationships. A line restricted to one axis is restricted by the model, not by hoping the drag handler behaves.
Review became a controlled sequence
Frame selection, alignment and verification are explicit steps. Save cannot run against incomplete media or geometry, because the workflow does not reach a state where saving is possible until those steps are done.
Reviewers also get explicit unavailable, loading, validation, save, retake and completion states instead of a blank or half-initialised canvas.
Legacy data is validated before it reaches the UI
The review depends on several tenant-specific legacy APIs whose payloads can be missing, stale or inconsistent. Responses are parsed and mapped at the boundary, so a malformed contract becomes a diagnosable unavailable state rather than an exception deep in the canvas.
Large video frames and rendered images are validated and preloaded so processing does not freeze the interface. The rebuilt tool uses Next.js, React and TypeScript, with unit, integration and browser-oriented tests covering geometry, upstream mappings, API contracts and the critical review interactions, while the legacy services keep running.
Konva draws. The domain model decides what is true.
