SHC vNext QR proof of concept
Codec #1 · 0x01 Canonical encoding 0 WASM imports · 0 floats

cycle-log codec

Longitudinal menstrual-cycle and health tracking spanning up to 10,000 days (bounded naturally by QR capacity): uniform FHIR-aligned entry arrays for bleeding and flow, pain, symptoms, basal and wearable temperature (with exclusions), fertility signs, wellbeing series, pill log, medications (with optional doses), contraception, pregnancy and breastfeeding intervals, procedures, screening answers, custom series, optional export timestamp, name and birth date.

WASM module353,251 Bcodecs/1.wasm
Card sizes17–1,976 Bacross 20 sample records
FHIR profiles3822 value sets
Proposed codes47CodeSystem/cycle-log
Registry ID
1, written in a card as the single byte 01
SHA-256
f2811c67a352393f632482b61756815b4d99dc574b070ebb9fb9a89b046a0f68 (download by hash)
Machine-readable files
model.d.ts · model.schema.json · CodeSystem/cycle-log.json · minimal-teaching.model.json

Interactive tools

Tools specific to cycle-log — kept here on the codec's hub so the platform navigation stays clean as more codecs are added.

Open in Viewer

Inspect synthetic cycle-log cards with the specialized clinical view: KPI snapshot, calendar, cycles, BBT, symptoms, medications, and scannable QR.

Codec #1 viewer plugin

Import a calendar

Turn period days in a calendar export (.ics) into a cycle-log record, card, and QR code locally in your browser.

Client-side .ics importer

Squeeze lab

Trim span, toggle categories, and watch the real WASM encoder's card size, QR version, and byte breakdown react live.

Interactive budget explorer

How a card is packed

Take a real cycle-log card apart symbol by symbol, from QR digits and card bytes down to each day's range-coder cost.

Bit-level explainer

Fit a FHIR Bundle

Lift an arbitrary FHIR R4 Bundle into CycleLog with a per-resource report, and apply omission-only reduction steps to fit a chosen QR version.

Lifter & planner (experimental)

Specification & documentation

Input model
The JSON model an app writes: uniform dated entry arrays, FHIR Coding, inventory diagram, normative TypeScript types, JSON Schema, and built-in vocabulary tables.
FHIR profiles
The cycle-log codec's 38 closed FHIR R4 profiles and 22 value sets, generated directly from the model.
Build & files (README)
The cycle-log codec's source layout, build commands, tests, and measurements for each sample record.
Model design
The model's design: what it carries and why, the evidence for the built-in vocabulary, the samples and the measurements.
FHIR mapping
How each fact of the model becomes FHIR resources, with every code used and how it was checked.
Wire format
The bit-level format: the range coder, its probability models and the order of the walk, precise enough to reimplement.
What the model carries
What common tracking apps record, field by field, and which of it the model carries, approximates or leaves out.
Lifting and fitting
Reading any FHIR Bundle into the model with a report on every resource, and reducing a record step by step to fit a QR code (experimental).
Reductions measured
Each kind of reduction step measured on the samples: the bytes it saves and what it changes or leaves out.

Sample records (20)

Each sample record in three forms: the JSON input model an app writes, the encoded card, and the FHIR R4 Bundle the codec expands it to.

RecordInput modelCardFHIR Bundle
power-tracker power-tracker.model.json 104,146 B digits · link 1,259 B power-tracker.fhir.json 1,146,650 B
copper-iud copper-iud.model.json 25,709 B digits · link 321 B copper-iud.fhir.json 254,126 B
pcos pcos.model.json 32,305 B digits · link 298 B pcos.fhir.json 161,707 B
minimal minimal.model.json 2,504 B digits · link 34 B minimal.fhir.json 19,448 B
perimenopause perimenopause.model.json 59,912 B digits · link 713 B perimenopause.fhir.json 499,249 B
combined-pill combined-pill.model.json 23,592 B digits · link 260 B combined-pill.fhir.json 216,342 B
near-empty near-empty.model.json 284 B digits · link 17 B near-empty.fhir.json 3,087 B
own-vocabulary own-vocabulary.model.json 182,840 B digits · link 1,624 B own-vocabulary.fhir.json 849,078 B
wellness-diary wellness-diary.model.json 149,711 B digits · link 1,873 B wellness-diary.fhir.json 762,832 B
calendar-only calendar-only.model.json 2,627 B digits · link 55 B calendar-only.fhir.json 25,122 B
smart-cup-hmb smart-cup-hmb.model.json 33,323 B digits · link 347 B smart-cup-hmb.fhir.json 284,412 B
wearable wearable.model.json 26,444 B digits · link 704 B wearable.fhir.json 282,126 B
post-ablation post-ablation.model.json 25,076 B digits · link 474 B post-ablation.fhir.json 238,831 B
vitals-follow-up vitals-follow-up.model.json 97,904 B digits · link 728 B vitals-follow-up.fhir.json 486,714 B
timestamped timestamped.model.json 64,533 B digits · link 1,976 B timestamped.fhir.json 560,272 B
bp-twice-daily bp-twice-daily.model.json 179,585 B digits · link 1,830 B bp-twice-daily.fhir.json 729,755 B
med-doses med-doses.model.json 103,708 B digits · link 1,259 B med-doses.fhir.json 499,686 B
bbt-exclusions-and-fever bbt-exclusions-and-fever.model.json 26,259 B digits · link 612 B bbt-exclusions-and-fever.fhir.json 305,043 B
text-tags text-tags.model.json 86,572 B digits · link 1,410 B text-tags.fhir.json 743,351 B
offline-displays offline-displays.model.json 181,459 B digits · link 733 B offline-displays.fhir.json 491,511 B

Also published: minimal-teaching.model.json, the smallest useful example.

Proposed CodeSystem (47 concepts)

The concepts of the cycle-log dense-card codec (SMART Health Cards dense QR experiment) that no standard terminology covers exactly (checked on tx.fhir.org, LOINC 2.83, SNOMED CT International 20260701): the bleeding and flow facts, the symptom fact, and the other series, values and statements the card defines. Each is a candidate for submission to LOINC or SNOMED CT. The design started from the HL7 Period Tracking guide; reconciling these concepts with its code system is future work. Not for production use. Version 0.1.0, status draft. FHIR JSON: CodeSystem/cycle-log.json, also served at its canonical address CodeSystem/cycle-log.

Show all 47 proposed concepts
CodeDisplayDefinition
menstrual-bleedingMenstrual bleedingWhether the person had menstrual bleeding on a day, as they recorded it: valueBoolean true = bleeding (any amount), false = explicitly recorded as no bleeding. Absence of the fact means not recorded, never no bleeding. When a flow category is also known, a menstrual-flow fact on the same day gives it.
menstrual-flowPatient-reported menstrual flow categoryThe person's own rating of the amount of menstrual flow on a day. Values are flow-none, flow-spotting, flow-light, flow-moderate and flow-heavy of this system. Always paired with a menstrual-bleeding fact on the same day: false with flow-none, true with any other flow.
flow-noneNo flowNo menstrual flow on the day (recorded explicitly).
flow-spottingSpottingA few drops of blood, not needing protection or only a liner.
flow-lightLight flowLight menstrual flow.
flow-moderateModerate flowModerate menstrual flow.
flow-heavyHeavy flowHeavy menstrual flow, as the person rated it.
symptomSymptomA symptom the person recorded on a day. The value is the symptom as a coded concept (SNOMED CT clinical findings for the built-in symptoms, or any other concept the source used). Presence only: a symptom not recorded is not recorded, never absent.
cervical-mucusCervical mucus quality (self-observed)The person's own observation of cervical mucus (vulvar sensation and appearance) on a day, as charted in fertility-awareness and cycle-tracking apps. Values are the mucus-* codes of this system, or any other coded concept the source used.
mucus-dryDryNo cervical mucus seen or felt (Apple HealthKit cervicalMucusQuality dry).
mucus-stickyStickySticky, tacky or pasty mucus that breaks easily.
mucus-creamyCreamyCreamy, lotion-like mucus.
mucus-wateryWateryClear, wet, watery mucus.
mucus-egg-whiteEgg whiteClear, slippery, stretchy mucus resembling raw egg white; the most fertile-type mucus.
ovulation-testHome urine ovulation test resultResult of a home urine test for the luteinizing hormone (LH) surge, optionally combined with an estrogen-metabolite (estrone-3-glucuronide) channel as in 'advanced' digital tests. Values: SNOMED CT 260385009 Negative, 10828004 Positive (LH surge detected), 82334004 Indeterminate, or estrogen-surge from this system, or any other coded concept the source used.
estrogen-surgeEstrogen rise detected, no LH surgeA combined LH/estrogen home test reported rising estrogen (often shown as 'high fertility') without an LH surge (Apple HealthKit ovulationTestResult estrogenSurge).
pdg-testHome urine progesterone metabolite (PdG) test resultResult of a qualitative home urine test for pregnanediol-3-glucuronide above the device threshold, used to confirm ovulation (Apple HealthKit progesteroneTestResult). Values: SNOMED CT 260385009 Negative, 10828004 Positive, 82334004 Indeterminate.
no-sexual-intercourseNo sexual intercourse (explicitly recorded)The person explicitly recorded that no sexual intercourse took place on the day. Used as a value of SNOMED CT 364316005 Sexual intercourse observable.
contraceptive-pill-takenContraceptive pill taken (self-reported)Whether the person took their scheduled oral contraceptive pill on the day: valueBoolean true = taken, false = explicitly recorded as missed (equivalent to SNOMED CT 315604002 Missed contraceptive pill (situation)). Absence of the fact means not recorded. The kind of pill is given by the contraception-method Observation (LOINC 8659-5) covering the day. SNOMED CT has a concept for the missed case only, none for 'pill taken'.
mood-valenceSelf-rated mood valence (7-point)The person's rating of how they felt on a day on a 7-point valence scale from very unpleasant to very pleasant (Apple HealthKit HKStateOfMind valence classification). Values are the valence-* codes of this system, or the levels of another mood scale as coded concepts.
valence-very-unpleasantVery unpleasantValence 1 of 7.
valence-unpleasantUnpleasantValence 2 of 7.
valence-slightly-unpleasantSlightly unpleasantValence 3 of 7.
valence-neutralNeutralValence 4 of 7.
valence-slightly-pleasantSlightly pleasantValence 5 of 7.
valence-pleasantPleasantValence 6 of 7.
valence-very-pleasantVery pleasantValence 7 of 7.
energy-levelSelf-rated energy level (4-point)The person's rating of their energy on a day on a 4-level ordinal scale (Clue: exhausted, low energy, high energy, energized). Values are the energy-* codes of this system, or the levels of another energy scale as coded concepts.
energy-exhaustedExhaustedEnergy level 1 of 4.
energy-lowLow energyEnergy level 2 of 4.
energy-highHigh energyEnergy level 3 of 4.
energy-energizedEnergizedEnergy level 4 of 4.
menstrual-fluid-volumeMenstrual fluid volume collected (measured)Total menstrual fluid collected on a day, in mL, as measured by a smart cup or read from a graduated cup. Collected fluid includes non-blood components: blood averaged 36% of menstrual fluid (range 2–82%; Fraser 1985, PMID 3969232) and about 50% in heavy losses (Fraser 2001, PMID 11704173). Not the same as SNOMED CT 364308001 Quantity of menstrual blood loss.
skin-temperature-deviationNightly skin temperature deviation from personal baseline (wearable)A wearable's nightly skin or wrist temperature expressed as the difference from the wearer's own baseline as the device computes it (e.g. Oura temperature_deviation, Fitbit nightlyRelative), attributed to the wake day. Signed; a positive value is warmer than baseline. The value is a temperature difference, carried in Cel (or [degF] for a Fahrenheit device). Not a basal body temperature.
nightly-skin-temperatureNightly skin temperature (wearable, absolute)A wearable's absolute nightly skin or wrist temperature aggregated over sleep (e.g. Apple appleSleepingWristTemperature, Google Health nightlyTemperatureCelsius), attributed to the wake day. Not a basal body temperature.
hot-flashHot flashA sudden feeling of heat, typically over the face, neck and chest, often with flushing and sweating, recorded as a symptom without asserting its cause. SNOMED CT International has only cause-specific concepts (198436008 Menopausal flushing, 427368007 Climacteric flushing, 143661000119109 Non-menopausal hot flash, 439407002 Hot flash caused by medication).
basal-body-temperatureBasal body temperatureWaking resting basal body temperature at 0.01 Cel or 0.01 [degF] precision. Distinct from general LOINC 8310-5 Body temperature so clinic or fever temperatures never pollute a basal temperature chart.
reading-excludedReading excluded from baseline/shiftComponent flag (valueBoolean true) marking a basal or wearable skin temperature reading as disturbed or excluded from cycle thermal-shift interpretation while keeping the recorded temperature visible.
reading-exclusion-reasonReason reading was excludedComponent giving the coded reason a temperature reading was marked excluded (an exclude-* code of this system or any other coded concept).
exclude-feverFever or illnessTemperature reading disturbed by fever or acute illness.
exclude-alcoholAlcoholTemperature reading disturbed by alcohol intake.
exclude-poor-sleepPoor or disrupted sleepTemperature reading disturbed by short or disrupted sleep.
exclude-late-wakeUnusual wake timeTemperature reading taken significantly earlier or later than habitual wake time.
exclude-travelTravel or time-zone shiftTemperature reading disturbed by travel or circadian shift.
exclude-stressStressTemperature reading disturbed by acute stress.
exclude-medicationMedication effectTemperature reading disturbed by antipyretic or other temperature-altering medication.
exclude-otherOther disturbanceTemperature reading disturbed for another unspecified reason.