Reference Architecture for Pose-Detection Rehabilitation Dance: On-Device Inference, FHIR Interoperability and Safety Alignment

This article explains a design choice for rehabdance.com: run pose estimation in the browser and send only derived movement metrics in a structured form, instead of streaming raw video to a server. The capture layer uses W3C Media Capture and Streams (getUserMedia), with WebGPU/WebGL used only as an acceleration option. Clinical data exchange follows HL7 FHIR R4 (4.0.1) Observation resources. If the product makes a medical claim, the software lifecycle and risk work must follow IEC 62304:2006+A1:2015 and ISO 14971:2019, and session data counts as special-category health data under GDPR Article 9.

On-device vs. server inference

Pick on-device inference when sessions must work with bad connections, when the privacy rule says video never leaves the device, and when target hardware can keep a steady frame rate for the pose model. Consider server inference only if you need multi-person tracking or heavier models the device cannot run, and only with explicit consent, TLS 1.3 (RFC 8446) and a written retention policy. Before you decide, record the camera resolution, the minimum supported device class, the latency you can accept between movement and feedback, and which landmark set your exercise scoring needs.

Interoperability checklist

Turn session results (range of motion, repetition counts, symmetry indices, adherence) into FHIR R4 Observation resources linked to Patient and EncounterRef. Use standard code systems (LOINC/SNOMED CT) only where a validated code exists. Mark local codes clearly in a separate CodeSystem. Version the scoring algorithm in Observation.method or the device metadata, so that historical values stay reproducible after model updates. Authorize EHR integration with SMART App Launch (OAuth 2.0, RFC 6749).

Illustrative scenario and recovery

In a purely analytical example (not measured), a mid-range tablet at 30 fps gets a 100 ms budget from capture to feedback. If inference keeps going over budget, the client lowers the input resolution, then the model complexity, and finally switches to a 'record-only' mode that stores metrics without real-time correction. Each fallback is logged as a quality flag on the Observation. Low landmark confidence or a lost body in frame pauses scoring and must never produce an invented value. Roll out gradually: shadow scoring first, then a clinician-reviewed pilot, then general availability behind feature flags.

How do we check that pose-derived rehabilitation metrics on rehabdance.com are reliable enough to share with a clinician?

Treat each metric as a versioned algorithm output, not as ground truth. Write down the acceptance criteria before rollout: agreement against a reference method you choose (for example goniometer or marker-based capture) on your own test protocol, minimum landmark-confidence thresholds, and the conditions under which scoring is suspended. Store the model and algorithm version, device class and quality flags with each FHIR Observation. Re-run the validation protocol after any model change. If a regression appears, roll back the scoring version through feature flags and mark affected Observations as entered-in-error or amended, rather than silently overwriting them. No external benchmark or certification is claimed here. Validation evidence must come from your own documented tests under IEC 62304/ISO 14971 processes if the product makes a medical claim.

Back to DanceSaga - Pose Detection · Domains

← Back to DanceSaga - Pose Detection
Engineering & Architecture Brief

Reference Architecture for Pose-Detection Rehabilitation Dance: On-Device Inference, FHIR Interoperability and Safety Alignment

This article explains a design choice for rehabdance.com: run pose estimation in the browser and send only derived movement metrics in a structured form, instead of streaming raw video to a server. The capture layer uses W3C Media Capture and Streams (getUserMedia), with WebGPU/WebGL used only as an acceleration option. Clinical data exchange follows HL7 FHIR R4 (4.0.1) Observation resources. If the product makes a medical claim, the software lifecycle and risk work must follow IEC 62304:2006+A1:2015 and ISO 14971:2019, and session data counts as special-category health data under GDPR Article 9.

On-device vs. server inference

Pick on-device inference when sessions must work with bad connections, when the privacy rule says video never leaves the device, and when target hardware can keep a steady frame rate for the pose model. Consider server inference only if you need multi-person tracking or heavier models the device cannot run, and only with explicit consent, TLS 1.3 (RFC 8446) and a written retention policy. Before you decide, record the camera resolution, the minimum supported device class, the latency you can accept between movement and feedback, and which landmark set your exercise scoring needs.

Interoperability checklist

Turn session results (range of motion, repetition counts, symmetry indices, adherence) into FHIR R4 Observation resources linked to Patient and EncounterRef. Use standard code systems (LOINC/SNOMED CT) only where a validated code exists. Mark local codes clearly in a separate CodeSystem. Version the scoring algorithm in Observation.method or the device metadata, so that historical values stay reproducible after model updates. Authorize EHR integration with SMART App Launch (OAuth 2.0, RFC 6749).

Illustrative scenario and recovery

In a purely analytical example (not measured), a mid-range tablet at 30 fps gets a 100 ms budget from capture to feedback. If inference keeps going over budget, the client lowers the input resolution, then the model complexity, and finally switches to a 'record-only' mode that stores metrics without real-time correction. Each fallback is logged as a quality flag on the Observation. Low landmark confidence or a lost body in frame pauses scoring and must never produce an invented value. Roll out gradually: shadow scoring first, then a clinician-reviewed pilot, then general availability behind feature flags.

Technical FAQ: How do we check that pose-derived rehabilitation metrics on rehabdance.com are reliable enough to share with a clinician?

Treat each metric as a versioned algorithm output, not as ground truth. Write down the acceptance criteria before rollout: agreement against a reference method you choose (for example goniometer or marker-based capture) on your own test protocol, minimum landmark-confidence thresholds, and the conditions under which scoring is suspended. Store the model and algorithm version, device class and quality flags with each FHIR Observation. Re-run the validation protocol after any model change. If a regression appears, roll back the scoring version through feature flags and mark affected Observations as entered-in-error or amended, rather than silently overwriting them. No external benchmark or certification is claimed here. Validation evidence must come from your own documented tests under IEC 62304/ISO 14971 processes if the product makes a medical claim.

Related Architecture Specifications (DANCEGOAL): merenguesteps.com · salsamethod.com · danceheal.com