Medical-Device Product Horizon

Copy Markdown View Source

Architectural Position

MedEx is an SDK for source-preserving medical-device evidence and explicit technical state, paired with optional media providers. Its medical-device specificity comes from exact units and calibration (or explicit :unknown), immutable acquisition and configuration descriptors, per-sample and per-epoch coordinates, explicit missing-value and status semantics, bounded clock uncertainty, durable source lineage across disconnects, and fail-closed command interlocks.

MedEx is deliberately not an EHR/EMR, a clinical decision-support or diagnostic inference engine, a generic media-streaming platform, or a substitute for hardware/firmware safety controls.

Architectural boundaries in MedEx draw from primary healthcare and device interoperability specifications—including HL7 FHIR R4 (Observation vs Device vs Provenance), DICOM Waveform and Synchronization modules, IHE SDPi (separating reporting, alerting, and external control), and Bluetooth SIG medical GATT profiles (PLXS, BLS, CGMS). Those specifications inform the SDK's data seams so downstream hosts can map reviewed evidence faithfully; MedEx itself does not claim turnkey standards or regulatory conformance.

1. Initial Connected-Care And Diagnostic Use Cases

Use CaseFoundation Implemented In MedEx TodayFuture Adapter / Validation Work Required
Digital stethoscopeLossless waveform capture, processing provenance, disposable Opus/WebRTC preview, monitor configuration lineagePhysical transducer characterization, acoustic filter frequency/phase verification, latency qualification
Voice-based monitoringPreserved raw audio windows, source provenance, raw-vs-derived boundaryValidated acoustic/speech models, domain-shift monitoring, clinician escalation workflows
Multi-device telehealth examIndependent per-stream descriptors, independent clocks, shared acquisition_id groupingHardware peripheral adapters, synchronized video/session orchestration
ECG / SpO₂ / PPG monitoringRegular waveform (StreamSpec + SampleFrame) and sparse measurement (MeasurementEvent) families, calibration/status contractsLong-duration storage retention, physiological alarm lifecycles, clinical display qualification
Medical voice intake / assistantSeparation of live communications from authoritative clinical recordsConsent capture, tool authorization boundaries, clinician sign-off workflows
Ultrasound / procedural guidanceAuthenticated source identity and content-addressed artifact reference seams2D/3D image/cine schemas, DICOM export, spatial calibration, latency budgets
Tele-EMS / mobile acquisitionDurable local journal, upstream spool receipts, explicit :source_gap spans, bounded memory/disk capsCellular handover testing, multi-party dispatch coordination, field environmental validation
Respiratory / spirometry devicesRational sample rates, calibrated channels, maneuver/status event separationFlow-volume loop calibration, ATS/ERS maneuver reproducibility rules
Speech / motor rehabilitationLossless source capture and sample-indexed technical spansTask scoring protocols, synchronized kinematics/video
Device troubleshootingAuthenticated boot/epoch tracking, StatusEvent, ControlInterlock audit and :outcome_unknownVendor diagnostic protocols, maintenance privilege separation
Hearing / assistive fittingPersist-before-dispatch setting transitions and configuration epoch lineageCalibrated output safety ceilings and device-resident fitting safeguards
Clinical training / supervisionSample-range references and immutable index digestsMulti-party role permissions, telestration, competency tracking

Stable sample coordinates, provenance descriptors, and storage/provider behaviours minimize host rework as new peripherals are integrated, without pretending that software abstractions pre-validate new physiological modalities or therapeutic hardware.

2. Broader Medical-Device Families

Evaluating a wider range of medical devices clarifies what belongs in MedEx's core contracts today versus what must remain future extensions or separate safety-critical systems:

Device / Workflow FamilyDistinct Requirement ExposedCore Seam Present TodayFuture Extension (Build Only When Exercised)
Blood-pressure cuff (BLS)Discrete inflation maneuver, systolic/diastolic/MAP group, motion/cuff statusMulti-metric MeasurementEvent, device_status, raw bytesCuff maneuver/abort adapter and profile validation
Episodic glucose meterStored historical records, meal/specimen context, exact unitssource_record_id, device_time vs receipt_time, decimal metricsMeter historical sync protocol and specimen context in host
Continuous glucose monitor (CGMS)Warm-up phase, calibration changes, trend/unavailable statessource_epoch / config_epoch, {:missing, reason}, calibration refsCGM session lifecycle adapter and trend profiles
Thermometer and scaleIntermittent decimal readings, measurement site/methodExact {mantissa, exponent} decimals, provenance factsDevice-specific profile adapters
EEG / EMG / evoked potentialsHigh channel counts, stimulus triggers, synchronous multichannel rowsUp to 32 interleaved channels, rational rates, :s24le/:s32leHigher-channel-count benchmarks, trigger-event family, neuro display
PolysomnographyMulti-hour heterogeneous rates, multi-pass scoring revisionsIndependent per-stream rates/clocks, immutable stream indexesMulti-hour retention tiers and sleep-study scoring workflows
Maternal / fetal monitoringMulti-subject physiological attributionExplicit source_ref / stream_id and provenance factsMaternal-fetal subject association and CTG review safety rules
Ventilator / CPAPSimultaneous pressure/flow waveforms, mode settings, and alarmsSeparate waveform, StatusEvent, and config_epoch modelsVendor mode schemas and verified clinical alarm lifecycles
Infusion / insulin pumpHigh-consequence drug delivery actuationCommand audit IDs and :outcome_unknown state tracking onlyDevice-resident safety interlocks, dose limits, and hazard validation
Dialysis equipmentCoupled fluid/pressure telemetry and treatment phasesTyped channels, exact decimals, independent status streamsTreatment state machine and safety-critical integration
Implantable telemetryIntermittent privileged programmer sessionsAuthenticated source_ref, boot_id, and epoch boundariesProgrammer link security, local device authority, specialist workflow
Neurostimulation / prostheticsSub-millisecond closed-loop actuationConfiguration provenance and measured timing boundsDedicated real-time firmware/RTOS; BEAM networking is not hard real-time
Point-of-care / lab analyzersSpecimen ID, reagent lot, QC lockouts, amended resultsOpaque provenance facts and immutable original MeasurementEventSpecimen/reagent/QC domain model in host application
Rapid-test / coagulation readersSingle-shot validity flags and lot calibration{:missing, reason}, device_status, raw payload digestAssay-specific validity and interpretation rules
Gait / rehabilitation IMUsMulti-axis inertial channels and coordinate framesSynchronous multi-channel :s16le/:s32le streams and provenanceOrientation frame conventions and sensor-fusion workers
Medication adherence devicesUncertain human action vs physical sensor triggerObserved technical event kept distinct from clinical inferenceHost workflow that records sensor events without inferring ingestion
Ophthalmic / dermatoscopic imagingStill frames, color/spatial calibration, large payloadsContent-addressed artifact digest and provenance patternsDedicated image/DICOM artifact family (never fake 1-sample waveforms)
Connected surgical / robotic toolsHard real-time actuation and local operator authorityPost-hoc telemetry and command audit records onlyDedicated local real-time safety architecture outside MedEx

When given an unsupported encoding, invalid descriptor, or unverified calibration, MedEx fails closed rather than coercing values into approximate representations.

3. Implemented Capabilities Versus Future Directions

Implemented In MedEx Today

  • Canonical :med_ex OTP application with zero runtime Hex dependencies and enforced pure-core / effectful-capture separation.
  • Regular waveform (StreamSpec, SampleFrame, MEX1, FrameFingerprint), sparse measurement (MeasurementEvent), technical status (StatusEvent), and qualifier (IntegritySpan) contracts.
  • Fenced per-stream StreamWriter with POSIX content-addressed .pcm segments, checksummed stream.mejournal, volatile-vs-durable receipts, replay/conflict handling, crash recovery, and frozen predecessor lineage import.
  • Exact rational affine clock-bound solver (ClockAlign) and persist-before-dispatch device command state machine (ControlInterlock).
  • Browser 48 kHz mono WAV capture (MedEx.Capture, MedEx.Evidence, MedEx.Web) and optional :med_ex_opus / :med_ex_rtc media providers usable in-VM or in an isolated sidecar process.

Future Directions (Not Implemented In MedEx Today)

  • Physical USB, serial, or Bluetooth Low Energy (BLE) hardware transport adapters and Nerves firmware packages.
  • Dedicated image/cine/DICOM artifact contracts and high-channel-count (>32 channel) neurophysiology extensions.
  • Out-of-band signal-processing, quality-scoring, and ML/AI inference workers consuming sealed StreamIndex artifacts.
  • Clinical alarm routing or therapeutic device actuation frameworks.

4. Validation And Maturity Stages

Engineering verification of MedEx software contracts does not substitute for hardware or clinical validation in a downstream medical product:

StageScopeRequired Evidence
A — Software SDK & Simulated Reference Workflows (current)Pure contracts, POSIX journaled storage/recovery, fault-injected transport/process tests, optional preview isolation, and browser WAV compatibilityAutomated unit/property/vector tests, boundary checks, multi-profile consumer builds, and separate-process fault-injection qualification
B — Physical Device IntegrationA specific physical stethoscope, ECG, or pulse oximeter peripheralBench captures against calibrated signal generators; oscillator drift, ADC scale, BLE/USB dropout, reboot, and end-to-end latency characterization
C — Multi-Device Operational DeploymentConcurrent clinical rooms, sustained retention, and production infrastructureLoad/soak testing, disk retention and backup/restore drills, key rotation, observability, and operational runbooks
D — Regulated Clinical WorkflowIntended diagnostic or monitoring use in a target jurisdictionRisk management (e.g., ISO 14971), software lifecycle (IEC 62304), usability engineering (IEC 62366), cybersecurity, and clinical evaluation
E — Higher-Risk Control Or Autonomous AnalyticsClosed-loop actuation, physiological alarms, or diagnostic AIDedicated hazard controls, local hardware/firmware safety authority, clinical algorithm validation, and regulatory clearance

5. Deliberate Exclusions

MedEx intentionally excludes a built-in EHR/FHIR resource library, DICOM parser, BLE radio stack, Nerves system image, distributed consensus clock, generic workflow DSL, dynamic plugin registry, clinical alarm router, or universal therapeutic control API. Host applications such as Med Fabric own clinical identity, persistence, review, and HL7 FHIR exchange at the application layer.

Primary Standards References