<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Alfonso de la Guarda Reyes</title>
    <description>The latest articles on DEV Community by Alfonso de la Guarda Reyes (@alfonsodg).</description>
    <link>https://dev.to/alfonsodg</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1125751%2Fd7eddc2a-f788-415f-8d30-ec72f780043f.jpeg</url>
      <title>DEV Community: Alfonso de la Guarda Reyes</title>
      <link>https://dev.to/alfonsodg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/alfonsodg"/>
    <language>en</language>
    <item>
      <title>Turning a webcam into a LOINC-coded vital signs source</title>
      <dc:creator>Alfonso de la Guarda Reyes</dc:creator>
      <pubDate>Mon, 23 Nov 2026 01:16:15 +0000</pubDate>
      <link>https://dev.to/alfonsodg/turning-a-webcam-into-a-loinc-coded-vital-signs-source-1g5d</link>
      <guid>https://dev.to/alfonsodg/turning-a-webcam-into-a-loinc-coded-vital-signs-source-1g5d</guid>
      <description>&lt;p&gt;&lt;em&gt;This is a submission for the &lt;a href="https://dev.to/challenges/presage-2026-11-04"&gt;Presage SmartSpectra SDK Challenge&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Built
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;camera-vitals&lt;/code&gt; turns a webcam into a vital-signs source and emits the readings&lt;br&gt;
as &lt;strong&gt;LOINC-coded observations&lt;/strong&gt; — the same vocabulary a clinical system already&lt;br&gt;
speaks — so they can drop into an existing remote patient monitoring pipeline&lt;br&gt;
without anyone rewriting a schema.&lt;/p&gt;

&lt;p&gt;Remote patient monitoring has a hardware problem. Every vital sign needs&lt;br&gt;
something to measure it: a cuff, an oximeter, a scale, a BLE wearable. If the&lt;br&gt;
device is not charged, not paired, or not there, there is no data that day.&lt;br&gt;
Almost every patient already has a camera. This makes that camera count.&lt;/p&gt;

&lt;p&gt;No wearable. No BLE device. No screen to photograph. The camera is the sensor.&lt;/p&gt;
&lt;h2&gt;
  
  
  Demo
&lt;/h2&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/tTGsnqldHQQ" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Direct link:&lt;/strong&gt; &lt;a href="https://youtu.be/tTGsnqldHQQ" rel="noopener noreferrer"&gt;youtu.be/tTGsnqldHQQ&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The recording shows the test suite passing, then a real capture from a 95-second&lt;br&gt;
video — pulse &lt;strong&gt;90.4 bpm&lt;/strong&gt; and breathing &lt;strong&gt;20.5 rpm&lt;/strong&gt; — emitted as FHIR R4&lt;br&gt;
Observations, and the second opinion returning &lt;code&gt;concordant&lt;/code&gt; for an agreeing&lt;br&gt;
reference and &lt;code&gt;discordant&lt;/code&gt; for one that is 30 bpm off.&lt;/p&gt;

&lt;p&gt;Repository: &lt;a href="https://github.com/alfonsodg/camera-vitals" rel="noopener noreferrer"&gt;alfonsodg/camera-vitals&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Code
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/alfonsodg/camera-vitals" rel="noopener noreferrer"&gt;alfonsodg/camera-vitals&lt;/a&gt; — MIT, public, &lt;code&gt;main&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/alfonsodg/camera-vitals
&lt;span class="nb"&gt;cd&lt;/span&gt; camera-vitals
npm install
&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PHYSIOLOGY_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;...
node cli.mjs --seconds 30 --subject patient-42
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Requires Node 20+ and a camera. On Linux the SDK needs an X display and&lt;br&gt;
&lt;code&gt;libx11&lt;/code&gt;; on a headless host use &lt;code&gt;--file&lt;/code&gt; against a recorded video.&lt;/p&gt;

&lt;p&gt;Verifying the SDK integration takes one command and no API key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;test&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ℹ tests 24
ℹ pass 24
ℹ fail 0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The suite covers the LOINC mapping, FHIR shape and id constraints, sink failure&lt;br&gt;
isolation, second-opinion verdicts and the transmission contract. It needs no&lt;br&gt;
camera precisely so a reviewer can run it in a clean clone.&lt;/p&gt;
&lt;h2&gt;
  
  
  How It Responds to Human Signals
&lt;/h2&gt;

&lt;p&gt;Three live Presage signals, sampled continuously and emitted once per second:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Signal&lt;/th&gt;
&lt;th&gt;LOINC&lt;/th&gt;
&lt;th&gt;Window&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Pulse rate&lt;/td&gt;
&lt;td&gt;&lt;a href="https://loinc.org/8867-4" rel="noopener noreferrer"&gt;8867-4&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;12 s average&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Breathing rate&lt;/td&gt;
&lt;td&gt;&lt;a href="https://loinc.org/9279-1" rel="noopener noreferrer"&gt;9279-1&lt;/a&gt;&lt;/td&gt;
&lt;td&gt;30 s average&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HRV (SDNN / RMSSD)&lt;/td&gt;
&lt;td&gt;
&lt;a href="https://loinc.org/80404-7" rel="noopener noreferrer"&gt;80404-7&lt;/a&gt; · &lt;a href="https://loinc.org/80406-2" rel="noopener noreferrer"&gt;80406-2&lt;/a&gt;
&lt;/td&gt;
&lt;td&gt;60 s window&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A number without a code is not interoperable. Every metric is mapped to a code&lt;br&gt;
verified against loinc.org, and the same reading can be emitted as a &lt;strong&gt;FHIR R4&lt;br&gt;
Observation&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"resourceType"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Observation"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"status"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"final"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"category"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"coding"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://terminology.hl7.org/CodeSystem/observation-category"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"vital-signs"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://loinc.org"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"8867-4"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"display"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Heart rate"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"subject"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"reference"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Patient/patient-42"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"valueQuantity"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"value"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mf"&gt;68.4&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"unit"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/min"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"system"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"http://unitsofmeasure.org"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"code"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"/min"&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How the integration works
&lt;/h3&gt;



&lt;pre data-lang="mermaid"&gt;&lt;code&gt;flowchart LR
    cam([Camera]) --&amp;gt; sdk[SmartSpectra SDK&amp;lt;br/&amp;gt;rPPG on device]
    sdk --&amp;gt; cap[capture.mjs&amp;lt;br/&amp;gt;telemetry OFF]
    cap --&amp;gt; loinc[loinc.mjs&amp;lt;br/&amp;gt;LOINC + FHIR R4]
    loinc --&amp;gt; out[JSONL / stdout]
    loinc --&amp;gt; fhir[FHIR Observation]
    loinc --&amp;gt; nats[[NATS vitals.camera]]

    fhir --&amp;gt; rec[reconcile.mjs&amp;lt;br/&amp;gt;second opinion]
    rec --&amp;gt; verdict[concordant /&amp;lt;br/&amp;gt;discordant /&amp;lt;br/&amp;gt;insufficient]

    nats --&amp;gt; m365[(med365x)]
    m365 --&amp;gt; eng[inference-engine&amp;lt;br/&amp;gt;33 profiles]
    eng --&amp;gt; alert[Clinician alert]

    classDef pub fill:#d1fae5,stroke:#10b981,color:#065f46
    classDef core fill:#dbeafe,stroke:#3b82f6,color:#1e3a8a
    class cam,sdk,cap,loinc,out,fhir,nats pub
    class rec,verdict,m365,eng,alert core&lt;/code&gt;&lt;/pre&gt;



&lt;p&gt;
  &lt;a href="https://youtu.be/tTGsnqldHQQ" rel="noopener noreferrer"&gt;
    &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fi.ytimg.com%2Fvi%2FtTGsnqldHQQ%2Fhqdefault.jpg" alt="camera-vitals demo video" width="480" height="360"&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
  &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Falfonsodg%2Fcamera-vitals%2Fmain%2Fdocs%2Fcapture-cli.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Falfonsodg%2Fcamera-vitals%2Fmain%2Fdocs%2Fcapture-cli.png" alt="Terminal capture of a real run" width="800" height="451"&gt;&lt;/a&gt;
  &lt;br&gt;
  Real run: 654 clean validations, pulse 90.4 bpm and breathing 20.5 rpm as
  FHIR R4, then the second opinion returning concordant and discordant.
&lt;/p&gt;

&lt;p&gt;Four modules, each doing one thing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;src/capture.mjs&lt;/code&gt; — the SDK session, with telemetry off and validation codes
translated into plain guidance.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/loinc.mjs&lt;/code&gt; — metric → LOINC → FHIR mapping.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/emit.mjs&lt;/code&gt; — sinks, loaded lazily so a broker client is never a
dependency.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;src/reconcile.mjs&lt;/code&gt; — the second opinion (below).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  The part I think matters most: a second opinion
&lt;/h3&gt;

&lt;p&gt;A camera reading is worth more when it can confirm or contradict something the&lt;br&gt;
patient already reported. A pulse oximeter says 72, the camera says 74 — the&lt;br&gt;
reading is corroborated. The same pair at 72 and 96 is not a disagreement to&lt;br&gt;
average away; it is a reason to look.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pulse oximeter: 72    camera: 74   → concordant   (within ±5)
pulse oximeter: 72    camera: 96   → discordant   → review before acting
no prior reading                  → insufficient
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Tolerances default to the larger of an absolute or relative margin per metric&lt;br&gt;
and can be overridden per request. &lt;strong&gt;They are heuristics chosen for this&lt;br&gt;
adapter, not validated clinical limits.&lt;/strong&gt; A deployment must set its own after&lt;br&gt;
comparing against its reference device. A &lt;code&gt;discordant&lt;/code&gt; verdict means "review&lt;br&gt;
before acting", never "the camera is right".&lt;/p&gt;
&lt;h2&gt;
  
  
  Prize Categories
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Best Thoughtful Real-World Use.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The real-world need is the hardware dependency in remote monitoring: a patient&lt;br&gt;
who forgot or broke their device transmits nothing, and the clinician sees a gap&lt;br&gt;
instead of a signal. The camera is already there.&lt;/p&gt;

&lt;p&gt;Two design choices follow from taking that user seriously:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The failure messages are the UX.&lt;/strong&gt; The SDK is strict and emits eighteen&lt;br&gt;
validation codes — face too low, chest not visible, too dark, too much movement.&lt;br&gt;
They are the only guidance a user ever gets, so the adapter translates every one&lt;br&gt;
into an instruction and surfaces it in the API:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;guidance: Face too low — raise your head or tilt the camera down
guidance: Chest not visible — tilt the camera down
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A patient should not see "measurement failed". They should see what to change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interoperability over a dashboard.&lt;/strong&gt; Emitting LOINC and FHIR means a clinic can&lt;br&gt;
receive these readings in the system it already runs, rather than in a new app&lt;br&gt;
someone has to remember to open. That is the difference between a demo and a&lt;br&gt;
channel.&lt;/p&gt;

&lt;p&gt;The adapter is also deliberately small and MIT: it is a connector, not a&lt;br&gt;
platform, so any monitoring product can adopt it.&lt;/p&gt;
&lt;h2&gt;
  
  
  Where this is going: continuous control of the chronic patient
&lt;/h2&gt;

&lt;p&gt;This is not a standalone toy. It is the fifth capture channel of &lt;strong&gt;med365x&lt;/strong&gt;, a&lt;br&gt;
remote patient monitoring platform I work on, alongside BLE, HealthKit, camera&lt;br&gt;
OCR and manual entry.&lt;/p&gt;

&lt;p&gt;The reason it matters for a chronic patient — a hypertensive, a diabetic, someone&lt;br&gt;
under long-term follow-up — is that every existing channel depends on the patient&lt;br&gt;
remembering hardware. Forget the cuff, and today has no data. The gap then reads&lt;br&gt;
as non-adherence when it was really a dead battery.&lt;/p&gt;

&lt;p&gt;A camera is already there. It will not be forgotten at home.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Bluetooth ─┐
HealthKit ─┤
Camera OCR ┼──▶ NATS ──▶ ClickHouse ──▶ 33 disease profiles ──▶ FHIR R4
Manual ────┤
Camera rPPG ┘   ← this project
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Three effects that matter clinically:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Continuity without hardware.&lt;/strong&gt; Pulse and breathing come from what the patient&lt;br&gt;
already owns, so the channel does not vanish when a device is discharged.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Signals a cuff cannot see.&lt;/strong&gt; HRV and respiratory pattern capture autonomic&lt;br&gt;
stress and breathing rhythm. For a chronic patient the trend matters more than&lt;br&gt;
any single reading, and these are cheap to sample daily.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Readings that can be contradicted.&lt;/strong&gt; If the patient reports a normal blood&lt;br&gt;
pressure but the camera shows a resting pulse of 96, that is a discrepancy worth&lt;br&gt;
a phone call. Before, it was a number with no context.&lt;/p&gt;

&lt;p&gt;
  &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Falfonsodg%2Fcamera-vitals%2Fmain%2Fdocs%2Fmockup-monitor.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fraw.githubusercontent.com%2Falfonsodg%2Fcamera-vitals%2Fmain%2Fdocs%2Fmockup-monitor.png" alt="Monitor screen with the camera channel added" width="420" height="860"&gt;&lt;/a&gt;
  &lt;br&gt;
  The existing Monitor screen (PA / FC / SpO2 / Temp, BLE history) with the
  camera card added — value, confidence, and the second-opinion verdict against
  the BLE oximeter.
&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;med365x&lt;/strong&gt; is a remote patient monitoring platform with FHIR R4 / HL7&lt;br&gt;
interoperability and 33 disease profiles — &lt;a href="https://med365x.com" rel="noopener noreferrer"&gt;med365x.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Architecture, the two phases (standalone service, then integrated into the app)&lt;br&gt;
and the full sequence are in&lt;br&gt;
&lt;a href="https://github.com/alfonsodg/camera-vitals/blob/main/docs/MED365X-INTEGRATION.md" rel="noopener noreferrer"&gt;MED365X-INTEGRATION.md&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Integration tracking: issue &lt;strong&gt;med365x #143&lt;/strong&gt;.&lt;/p&gt;
&lt;h2&gt;
  
  
  Consent and Data Handling
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Camera access is explicit.&lt;/strong&gt; Nothing is captured until the process starts and&lt;br&gt;
&lt;code&gt;start()&lt;/code&gt; is called. There is no background capture and no idle camera.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SDK telemetry is off.&lt;/strong&gt; SmartSpectra sends aggregate session summaries by&lt;br&gt;
default. This adapter passes &lt;code&gt;enableTelemetry: false&lt;/code&gt; on every session, so no&lt;br&gt;
usage data leaves the device. If you fork this and remove that flag, disclose the&lt;br&gt;
change.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Video never leaves the machine.&lt;/strong&gt; Frames are processed locally and are not&lt;br&gt;
written to disk, uploaded, or retained. &lt;code&gt;--file&lt;/code&gt; reads a local video and does the&lt;br&gt;
same.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Only derived numbers are emitted.&lt;/strong&gt; The output is a heart rate, a breathing&lt;br&gt;
rate and HRV statistics — no imagery, no face landmarks, no embeddings, and no&lt;br&gt;
identifiers beyond the &lt;code&gt;--subject&lt;/code&gt; value the operator supplies.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No storage by default.&lt;/strong&gt; Without &lt;code&gt;--out&lt;/code&gt;, &lt;code&gt;--nats&lt;/code&gt; or &lt;code&gt;--http&lt;/code&gt;, observations go&lt;br&gt;
to stdout and are gone when the process exits. With a sink, retention is whatever&lt;br&gt;
that sink does — this adapter sets none and deletes none.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subjects are pseudonymous.&lt;/strong&gt; &lt;code&gt;--subject&lt;/code&gt; is the operator's choice. Use a study&lt;br&gt;
id or a hashed identifier, not a name. The default is &lt;code&gt;anonymous&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LLM processing is not used.&lt;/strong&gt; The SDK offers optional LLM Insights that send&lt;br&gt;
metric windows to a gateway. This adapter does not enable them.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;No diagnosis, no treatment claims, no covert monitoring.&lt;/strong&gt; Measurements are for&lt;br&gt;
general wellness and informational purposes. They are not FDA-cleared and must&lt;br&gt;
not be used for diagnosis or treatment. See the Presage model cards for validated&lt;br&gt;
ranges and failure conditions.&lt;/p&gt;
&lt;h2&gt;
  
  
  Agent Session
&lt;/h2&gt;


&lt;h2&gt;
  
  
  What I learned building this
&lt;/h2&gt;

&lt;p&gt;Six things that are not in the SDK documentation and cost me real time. They are&lt;br&gt;
in the post because they will cost the next person the same:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;MetricType.cardio&lt;/code&gt; does not exist.&lt;/strong&gt; The metrics are &lt;code&gt;PULSE_RATE&lt;/code&gt;, &lt;code&gt;HRV&lt;/code&gt;,&lt;br&gt;
&lt;code&gt;BREATHING_RATE&lt;/code&gt;. Passing an &lt;code&gt;undefined&lt;/code&gt; makes the server reject the metric&lt;br&gt;
list, and no frames arrive at all — which looks like a camera problem.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The metrics event is a protobuf Buffer, and decoding it fails silently.&lt;/strong&gt;&lt;br&gt;
The generated class needed by &lt;code&gt;decodeMetrics()&lt;/code&gt; is not in the package's&lt;br&gt;
&lt;code&gt;exports&lt;/code&gt; map, so &lt;code&gt;require("@smartspectra/node-sdk/js/messages/generated.js")&lt;/code&gt;&lt;br&gt;
throws &lt;code&gt;ERR_PACKAGE_PATH_NOT_EXPORTED&lt;/code&gt;. Resolve it by file path, register it&lt;br&gt;
with &lt;code&gt;setMetricsClass()&lt;/code&gt;, and every field stops looking like an empty byte&lt;br&gt;
array.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The SDK warms up for about twenty seconds&lt;/strong&gt; before the first frame is&lt;br&gt;
validated. A 10-second capture takes roughly 30 seconds end to end. Any&lt;br&gt;
deadline you set has to account for it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Without &lt;code&gt;DISPLAY&lt;/code&gt; the SDK stalls instead of failing.&lt;/strong&gt; It opens the video&lt;br&gt;
device and then sleeps. On a headless host this is indistinguishable from a&lt;br&gt;
hung camera, and it is the first thing to check.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Capture has to run in a child process.&lt;/strong&gt; Starting a session inside an HTTP&lt;br&gt;
request handler hangs; isolating it also means a stuck capture is killed on&lt;br&gt;
deadline and an API restart never leaves the device locked.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The upper chest is mandatory even for pulse.&lt;/strong&gt; Requesting only&lt;br&gt;
&lt;code&gt;PULSE_RATE&lt;/code&gt; still returns &lt;code&gt;kChestNotVisible&lt;/code&gt;. It is a physical requirement of&lt;br&gt;
the SDK, not a per-metric one — so the framing guide is not optional.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The validation codes are the product.&lt;/strong&gt; There are eighteen of them and they&lt;br&gt;
describe exactly why the measurement cannot proceed. Treating them as errors&lt;br&gt;
hides the only actionable information the SDK gives you.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Limitations, honestly
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;The framing requirement is real and unforgiving.&lt;/strong&gt; The SDK needs the face&lt;br&gt;
centred &lt;em&gt;and&lt;/em&gt; the upper chest visible, and requesting &lt;code&gt;PULSE_RATE&lt;/code&gt; alone does not&lt;br&gt;
relax it. From a laptop at desk distance the frame cut at my neck and no&lt;br&gt;
measurement was possible — 421 consecutive &lt;code&gt;kChestNotVisible&lt;/code&gt; codes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;FaceTooLow       447 → 26    fixed by moving the head
ChestNotVisible    0 → 421   fixed only by changing the camera
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A phone recording at 60–70 cm, with the shoulders in frame, worked immediately:&lt;br&gt;
654 clean &lt;code&gt;kOk&lt;/code&gt; validations and a stable reading. That is a physical setup&lt;br&gt;
problem, not a code one — but it is exactly why the framing guide has to be part&lt;br&gt;
of the product, not an error message after the fact.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The payload is protobuf and the shape is not obvious.&lt;/strong&gt; My first version read&lt;br&gt;
&lt;code&gt;cardio.pulseRate&lt;/code&gt; as a number; it is an &lt;em&gt;array&lt;/em&gt; of &lt;code&gt;MeasurementWithConfidence&lt;/code&gt;.&lt;br&gt;
Worse, the generated class needed to decode the buffer is not in the package's&lt;br&gt;
&lt;code&gt;exports&lt;/code&gt; map, so registering it fails silently and every frame looks empty —&lt;br&gt;
which is indistinguishable from a framing problem. That cost me most of a day.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HRV needs a full 60-second window.&lt;/strong&gt; Confidence stays at zero until it&lt;br&gt;
completes. A 30-second run reports pulse and breathing but no HRV — expected, not&lt;br&gt;
a bug.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Validated ranges are narrow.&lt;/strong&gt; Pulse 40–110 BPM, breathing 5–40 breaths/min.&lt;br&gt;
Outside those the model cards say accuracy degrades.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tolerances are not clinical.&lt;/strong&gt; Restating it because it matters: the second&lt;br&gt;
opinion thresholds are mine, not a validated standard.&lt;/p&gt;

</description>
      <category>devchallenge</category>
      <category>presagechallenge</category>
    </item>
    <item>
      <title>We have released #MermaidXP , you can contribute in our repo https://github.com/ccvass/mermaidxp and try here https://mxp.apulab.com</title>
      <dc:creator>Alfonso de la Guarda Reyes</dc:creator>
      <pubDate>Tue, 07 Oct 2025 03:28:07 +0000</pubDate>
      <link>https://dev.to/alfonsodg/we-have-released-mermaidxp-you-can-contribute-in-our-repo-httpsgithubcomccvassmermaidxp-4l0h</link>
      <guid>https://dev.to/alfonsodg/we-have-released-mermaidxp-you-can-contribute-in-our-repo-httpsgithubcomccvassmermaidxp-4l0h</guid>
      <description>&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
        &lt;div class="c-embed__cover"&gt;
          &lt;a href="https://github.com/ccvass/mermaidxp" class="c-link align-middle" rel="noopener noreferrer"&gt;
            &lt;img alt="" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Frepository-images.githubusercontent.com%2F1071208867%2Fbbc60a8b-611a-43b5-8a33-495893b1a56d" height="935" class="m-0" width="1916"&gt;
          &lt;/a&gt;
        &lt;/div&gt;
      &lt;div class="c-embed__body"&gt;
        &lt;h2 class="fs-xl lh-tight"&gt;
          &lt;a href="https://github.com/ccvass/mermaidxp" rel="noopener noreferrer" class="c-link"&gt;
            GitHub - ccvass/mermaidxp: Mermaid Pro Viewer · GitHub
          &lt;/a&gt;
        &lt;/h2&gt;
          &lt;p class="truncate-at-3"&gt;
            Mermaid Pro Viewer. Contribute to ccvass/mermaidxp development by creating an account on GitHub.
          &lt;/p&gt;
        &lt;div class="color-secondary fs-s flex items-center"&gt;
            &lt;img alt="favicon" class="c-embed__favicon m-0 mr-2 radius-0" src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.githubassets.com%2Ffavicons%2Ffavicon.svg" width="32" height="32"&gt;
          github.com
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;div class="crayons-card c-embed text-styles text-styles--secondary"&gt;
    &lt;div class="c-embed__content"&gt;
      &lt;div class="c-embed__body flex items-center justify-between"&gt;
        &lt;a href="https://mxp.apulab.com" rel="noopener noreferrer" class="c-link fw-bold flex items-center"&gt;
          &lt;span class="mr-2"&gt;mxp.apulab.com&lt;/span&gt;
          

        &lt;/a&gt;
      &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


</description>
    </item>
  </channel>
</rss>
