ECG Rhythm Strip SHA-256 · 0x00
ecg-strip · Lossless 1D signal codec (LPC + Golomb-Rice)
10-second PhysioNet ECG (3,600 samples at 360 Hz) → 1,848 B (Version 32-L), lossless FHIR SampledData where DEFLATE exceeds QR capacity.
Proof of concept for SMART Health Cards vNext
A phone camera scans a compact code, and a small sandboxed WebAssembly codec runs on the receiving device to rebuild a complete, standard FHIR R4 Bundle. No server holds the data, and no network is needed to read it.
The platform separates QR transport and card framing from domain-specific compression so dozens of clinical use cases can ship their own codecs and visualizations. Featured codec #1 (cycle-log) proves the approach on longitudinal menstrual-cycle and daily health tracking: 17 to 1,976 bytes in a card expanding to 3,087 bytes to 1.15 MB of FHIR JSON. Everything on this site is synthetic sample data, and cards are unsigned.
Featured codec #1 · cycle-log — the copper-iud sample record: copper IUD with temperature and mucus charting, a year.
Open this record from its card Browse codecs
The button opens the universal viewer with the card's digits, as a scan does; pointing a phone camera at the code opens the same record. The digits sit after the “#” in the link, so the browser never sends them to a server. To start from the sample instead, with the other sample records listed beside it: the copper-iud sample record in the viewer.
Three layers, shown here with the copper-iud record.
The text is https://joshuamandel.com/shc2-poc/#shc2:/ followed by 780 decimal digits. QR codes store digits compactly (three digits in ten bits) and every scanner and camera app returns them unchanged, which raw binary does not survive. Every 17 digits spell 7 bytes.
https://joshuamandel.com/shc2-poc/#shc2:/00370089663546541247180290425195081649911781146256007916301695871409… 712 more digits
For a link that is pasted or sent rather than scanned, the same card has a shorter text form: shc2:/b/ followed by base64url. For this record the link is 471 characters against 821 with digits. A QR code always uses the digits.
The first byte names the codec by its registry number: 01 is codec 1, cycle-log. The next 318 bytes are that codec's input. The last 2 are a check, the first 2 bytes of the SHA-256 of everything before them: a card that was cut short or altered is refused before any codec runs (it slips through about 1 time in 65,536). There is no other header. A codec that is not registered is named instead by a zero byte and the SHA-256 of its module.
01 50 98 36 ee 44 ad 57 d0 ea 9c a0 8d d4 3a 9d dc 38 42 71 … 299 more bytes … 02 3e
cycle-log is 353,251 bytes of WebAssembly with 0 imports: it cannot reach the network, storage, the clock or the page, only compute. It exports memory, shc_alloc, shc_decode, shc_encode. The receiving page hands it the card and gets back a FHIR R4 Bundle, the same bytes on every engine.
For this card: 694 entries, 684 Observation, 8 MedicationStatement, 1 Patient, 1 Procedure. One of them, a single day's fact:
{
"fullUrl": "resource:4",
"resource": {
"resourceType": "Observation",
"status": "final",
"code": {
"coding": [
{
"system": "https://joshuamandel.com/shc2-poc/CodeSystem/cycle-log",
"code": "menstrual-flow",
"display": "Patient-reported menstrual flow category"
}
]
},
"subject": {
"reference": "resource:0"
},
"effectiveDateTime": "2025-12-08",
"valueCodeableConcept": {
"coding": [
{
"system": "https://joshuamandel.com/shc2-poc/CodeSystem/cycle-log",
"code": "flow-light"
}
]
}
}
}
On the sending side, an app never builds FHIR or bytes by hand. It fills in the codec's input model, 25,709 bytes of JSON for this record, and calls the codec's encoder, shc_encode. Each dataset has exactly one encoding.
Reading a card needs no server and no network: everything is in the code, and the codec runs on the receiving device. That matters where connectivity is limited or filtered, and for sensitive data, which never passes through anyone's server. A SMART Health Link is the other way to share a record from a QR code; the two suit different jobs.
| Question | A card in the QR code (this site) | SMART Health Link |
|---|---|---|
| Where the data is | In the code itself | On a server, encrypted; the code holds the link and the key |
| How much | What one QR code holds: at most 2,875 bytes of card with this site's link in front | Any amount |
| Server and network | None, when shared or when read | A server to host it, and a network when it is opened |
| Update or revoke | Not possible: a code that has been shown can be read for good | The sharer can update it or revoke it |
A clinician can read these codes with a dedicated app on their own phone that understands shc2:/. Such an app needs no web browser and no link: it scans the code, ignores anything in front of shc2:/, runs the same codec and gets the same FHIR Bundle this site's viewer shows, because the mapping from card to FHIR lives in the codec, not in this website. The link in front of the digits and the web viewer exist so that a phone without such an app can still open a code with its camera. This site does not include a native app; that is a statement about the design, not a product here.
shc2:/ card decoder with codec-specific visualization plugins. Open a scanned card, paste a FHIR Bundle, or inspect any of Codec #1's twenty sample records: power-tracker, copper-iud, pcos, minimal, perimenopause, combined-pill, near-empty, own-vocabulary, wellness-diary, calendar-only, smart-cup-hmb, wearable, post-ablation, vitals-follow-up, timestamped, bp-twice-daily, med-doses, bbt-exclusions-and-fever, text-tags, offline-displays.CycleLog with a per-resource report, and reduce it step by step to fit a chosen QR version. Experimental.Beyond registered Codec #1, any clinical domain can publish a zero-import WebAssembly codec addressed directly by 0x00 || sha256(wasm) — no central registry approval required. Each codec below opens directly in the universal viewer from its real QR card.
0x00ecg-strip · Lossless 1D signal codec (LPC + Golomb-Rice)
10-second PhysioNet ECG (3,600 samples at 360 Hz) → 1,848 B (Version 32-L), lossless FHIR SampledData where DEFLATE exceeds QR capacity.
0x00cgm-agp · Lossless time-series + deterministic FHIR summary synthesizer
14-day CGM (4,019 readings, 2.32 MB FHIR) → 1,895 B (1,225×) with deterministic AGP summary metrics.
0x00ips-summary · Embedded 8,207-concept SNOMED CT IPS + EDQM + LOINC dictionary
8,207 SNOMED CT IPS, EDQM & LOINC terms in WASM → 322 B (Version 13-L, 41 FHIR resources).
0x00dental-chart · 2D spatial anatomical differential coding (32 teeth × 6 sites)
32-tooth periodontal & restorative exam (72 FHIR resources, 197 kB) → 248 B (Version 11-L, 792×).
0x00pgx-cpic · Embedded CPIC knowledge base + deterministic CDS expansion
14-gene CPIC diplotype panel & CDS alerts (33 kB FHIR) → 92 B (Version 7-L, 358×).
0x00vision-rx · Bit-packed clinical quantizer (quarter-diopter optical fields)
Bit-packed eyeglasses & contact lens Rx (70–200 B, down to Version 6-L) → FHIR VisionPrescription.
Each record below was encoded by the codec, decoded back, and checked byte for byte against a FHIR Bundle built independently from the same data. QR versions are for the full text, this site's link and the digits, at error correction level L (the level SMART Health Cards 1.x uses) and M. SMART Health Cards 1.x treats Version 22 (949 bytes in this form) as the practical limit; Version 40, the largest QR code, holds 2,875 bytes.
7 of the 20 records need more than Version 22 at level L: power-tracker (Version 26), own-vocabulary (Version 30), wellness-diary (Version 32), timestamped (Version 33), bp-twice-daily (Version 32), med-doses (Version 26), text-tags (Version 28). The three records marked “own vocabulary” keep most of their data in an app's own codes and scales, which a card can carry but must spell out once. DEFLATE, the usual general-purpose compression, fits minimal (Version 19), near-empty (Version 15) and calendar-only (Version 23) into a QR code and none of the others.
| Record | Card, bytes | QR at L | QR at M | FHIR JSON, bytes | Entries | DEFLATE, bytes | DEFLATE QR at L | FHIR ÷ card |
|---|---|---|---|---|---|---|---|---|
| power-trackerpower tracker, fertility awareness then trying to conceive | 1,259 | Version 26 | Version 30 | 1,146,650 | 2,840 | 29,127 | fits none | 911× |
| copper-iudcopper IUD with temperature and mucus charting, a year | 321 | Version 13 | Version 15 | 254,126 | 694 | 6,422 | fits none | 792× |
| pcosirregular cycles suggestive of PCOS | 298 | Version 12 | Version 14 | 161,707 | 494 | 5,092 | fits none | 543× |
| minimalminimal tracker with gaps: bleeding yes/no only, no flow amounts | 34 | Version 4 | Version 5 | 19,448 | 61 | 725 | Version 19 | 572× |
| perimenopauseperimenopausal transition | 713 | Version 19 | Version 22 | 499,249 | 1,434 | 13,101 | fits none | 700× |
| combined-pillcombined oral contraceptive, 21/7, pill log | 260 | Version 11 | Version 13 | 216,342 | 630 | 5,896 | fits none | 832× |
| near-emptynear-empty: breastfeeding, one bleed logged | 17 | Version 4 | Version 4 | 3,087 | 9 | 458 | Version 15 | 182× |
| own-vocabulary own vocabularyapp with its own scales and codes throughout | 1,624 | Version 30 | Version 34 | 849,078 | 2,225 | 23,658 | fits none | 523× |
| wellness-diary own vocabularymigraine and wellness diary, few bleeding facts | 1,873 | Version 32 | Version 37 | 762,832 | 2,416 | 24,334 | fits none | 407× |
| calendar-onlybleeding days from a calendar export, with completeness statements | 55 | Version 5 | Version 6 | 25,122 | 69 | 1,036 | Version 23 | 457× |
| smart-cup-hmbheavy menstrual bleeding measured with a smart cup, fibroids, myomectomy | 347 | Version 13 | Version 15 | 284,412 | 818 | 7,514 | fits none | 820× |
| wearablewearable-centric: nightly skin temperature deviation and sleep | 704 | Version 19 | Version 22 | 282,126 | 744 | 7,488 | fits none | 401× |
| post-ablationafter endometrial ablation: no bleeding, ovarian cycles continue | 474 | Version 16 | Version 18 | 238,831 | 615 | 6,407 | fits none | 504× |
| vitals-follow-uphypertension follow-up while tracking cycles: heart rate, weight, blood pressure | 728 | Version 19 | Version 23 | 486,714 | 1,045 | 12,635 | fits none | 669× |
| timestampedan app that timestamps every entry: habitual times, DST, a trip abroad, symptoms at their own times | 1,976 | Version 33 | Version 38 | 560,272 | 1,285 | 18,362 | fits none | 284× |
| bp-twice-dailyhome blood pressure morning and evening, with heart rate and a daily antihypertensive | 1,830 | Version 32 | Version 36 | 729,755 | 1,323 | 19,996 | fits none | 399× |
| med-dosesendometriosis & heavy bleeding with exact medication doses and wearable skin temperature exclusions | 1,259 | Version 26 | Version 30 | 499,686 | 1,213 | 13,547 | fits none | 397× |
| bbt-exclusions-and-feverfertility awareness BBT with disturbed/excluded readings and separate febrile body temperature (LOINC 8310-5) | 612 | Version 18 | Version 20 | 305,043 | 709 | 8,009 | fits none | 498× |
| text-tags own vocabularytext-only tags and custom scales without synthetic code-system URIs | 1,410 | Version 28 | Version 32 | 743,351 | 2,187 | 22,357 | fits none | 527× |
| offline-displaysclinic record with offline displays and plain-text labels on standard escape codes | 733 | Version 19 | Version 23 | 491,511 | 1,037 | 12,468 | fits none | 671× |
DEFLATE here is raw DEFLATE (no zlib header) at zlib's highest level, 9, computed when this site is built, on the minified FHIR JSON, and written into the QR code the same way as a card. The squeeze lab and the table on the Design page use the browser's CompressionStream, which takes no level and gives zlib's default, 6: 1% to 17% more bytes for these records (copper-iud: 7,469 against 6,422). Card bytes include the 1-byte codec reference and the 2-byte check. Version 25 holds 1,215 bytes and Version 30 holds 1,669 in this form.
shc2:/ prefix, the registry numbers and the proposed codes in the cycle-log CodeSystem are provisional.cycle-log) models calendar-day entries with optional timestamps; continuous wearable streams belong in a different codec or transport.