Phase 1 of WIA-MED-021 defines the JSON shapes that every conformant device, sleep-lab system, EHR bridge and research aggregator must read and emit. The recording is the source of truth, and everything else is a structured description of it. A night of sleep is stored as a session, a sequence of classified epochs, a set of respiratory events, a set of arousals, and one scoring metadata record that says who or what produced the classifications and what the headline numbers were. A downstream reader can then tell what was recorded, how it was scored, and how far the result can be trusted without asking the originating vendor. The HTTP surface, federation between organisations, and the FHIR, EDF and vendor bridges are all deferred to later phases.
| Object family | What it describes |
|---|---|
| Session | One contiguous recording: a night or a nap |
| Sleep stage | One epoch (typically 30 seconds) classified into an AASM stage |
| Respiratory event | Apnoea, hypopnoea, RERA or oxygen desaturation |
| Arousal | An EEG-based or movement-based arousal |
| Scoring metadata | The algorithm and scorer behind the session's classifications, plus summary figures |
A handful of encoding rules apply to all five families:
snake_case keys, and numbers are IEEE 754 double precision.Z suffix. Events tied to specific waveform samples must carry sub-second precision, so an event can be lined up with the raw trace.did:wia:patient:… form, which keeps biometric data out of the wire.wia_sleep_monitoring_version (here "1.0.0") and a type discriminator. A receiver must refuse a major version it does not implement.The stage vocabulary follows the current edition of the AASM Manual: wake, n1, n2, n3, rem. Implementations may also emit unscored for an epoch the algorithm could not classify. Using unscored keeps gaps in the record visible, so an unclassifiable epoch is never silently labelled as some other stage.
The session is the root object. Every other record points back to it through session_id, and it points onward to the raw recording and to the scoring metadata. A trimmed example:
{
"wia_sleep_monitoring_version": "1.0.0",
"type": "session",
"session_id": "ses_01HXY",
"patient_id": "did:wia:patient:01HXY",
"session_kind": "polysomnography",
"started_at": "2026-04-26T22:30:00Z",
"ended_at": "2026-04-27T07:00:00Z",
"clinical_grade": true,
"edf_url": "https://recordings.example/sessions/ses_01HXY.edf",
"edf_sha256": "7d8f2c…",
"scoring_metadata_id": "scm_01HXY",
"signature": { "alg": "Ed25519", "value": "AY3o…" }
}
The session_kind field encodes how much physiology was captured, which determines what can be concluded from the data:
polysomnography is the full clinical study: EEG, EOG and EMG, plus airflow, pulse oximetry and chest and abdomen belts. Only this kind observes brain activity directly, so only it can support true sleep staging.home_sleep_apnoea_test is typically airflow plus SpO2 only. It can count breathing events but has no EEG, so it cannot say how long the patient actually slept.consumer_wearable typically derives sleep stages from heart rate and accelerometer data.nap is a short daytime recording.Other kinds may be registered through the WIA Standards extension process. A receiver that meets an unknown kind treats it as unrecognised and carries on with the rest of the object.
The clinical_grade flag is a deliberate gate. It may be true only when the recording device has regulatory clearance for the signals involved, with FDA 510(k), EU CE-MDR and KFDA approval named as examples. In that case the device record must carry the clearance reference, as defined in WIA-MED-020 Phase 1 §3.2. A conformant reader refuses clinical_grade: true without that reference. This stops a marketing claim from travelling as a clinical one.
For clinical-grade sessions the raw biosignals live in an EDF or EDF+ file (European Data Format), referenced by edf_url and checked by edf_sha256. The file is not embedded, because an overnight study is typically hundreds of megabytes. The hash lets a reviewer confirm that the file they fetched months later is the one the scorer worked from. It also gives anyone who disputes a scoring result a fixed object to re-score.
Each stage record describes one epoch, the fixed time window that sleep technologists and algorithms classify as a unit:
{
"type": "sleep_stage",
"session_id": "ses_01HXY",
"epoch_index": 142,
"epoch_start": "2026-04-26T23:41:00Z",
"epoch_duration_seconds": 30,
"stage": "n2",
"confidence": 0.92,
"scoring_algorithm": "AASM-2024-default",
"signature": null
}
The example is consistent with a zero-based index counted from the session's started_at. Epoch 142 at 30 seconds each begins 71 minutes after 22:30, which is 23:41. Because epoch_start is explicit, a reader does not have to rely on that arithmetic.
AASM guidance scores at 30-second granularity, but the standard does not hard-code that value. Consumer wearables may use 5-minute epochs at lower confidence, and epoch_duration_seconds carries the actual granularity. A hypnogram built from a wearable therefore declares its coarser resolution instead of passing as a PSG hypnogram. The confidence field gives a per-epoch measure that lets a reader weight or filter uncertain stretches.
Signing is handled economically. A stage record inside a session may leave signature as null, because the session is signed and its stages inherit that provenance. A stage record published standalone, for example by a community research aggregator, must be signed. Without the parent session nothing vouches for it.
Respiratory events are the evidence for sleep-disordered breathing. Each one is its own record:
{
"type": "respiratory_event",
"session_id": "ses_01HXY",
"event_id": "re_01HXY-12",
"event_kind": "obstructive_apnoea",
"started_at": "2026-04-26T23:45:12.300Z",
"duration_seconds": 14,
"associated_oxygen_desaturation_pct": 3.5,
"associated_arousal": true,
"scoring_algorithm": "AASM-2024-default",
"scorer_id": "did:wia:scorer:tech-09",
"signature": { "alg": "Ed25519", "value": "Bz9A…" }
}
The six event_kind tokens are obstructive_apnoea, central_apnoea, mixed_apnoea, hypopnoea, rera (Respiratory Effort Related Arousal) and oxygen_desaturation. The clinical distinction between the three apnoea kinds is whether respiratory effort continues while airflow stops. Obstructive events keep effort going against a blocked airway, central events show no effort, and mixed events begin central and end obstructive. Each kind has its own AASM scoring criteria, and the record keeps the per-event details (timing, duration, linked desaturation, linked arousal, scorer, algorithm). Anyone reviewing the study can see exactly which events drove the totals.
The headline indices are derived from these events:
AHI = (apnoeas + hypopnoeas) / sleep_hours
RDI = (apnoeas + hypopnoeas + reras) / sleep_hours
The denominator is sleep time, not time in bed. This is why a home apnoea test without EEG, which cannot measure sleep time directly, yields a different kind of number than a PSG does.
The standard handles the two roles of events and indices as follows. Events are preserved so the AHI and RDI can be re-computed without ambiguity. But implementations must publish AHI and RDI in the scoring metadata record, and downstream consumers must trust those published values rather than recompute them. The stated reason is that consumer wearables sometimes derive AHI from inputs that are not AASM-equivalent. A consumer that recomputed from such events would produce an authoritative-looking figure with no clinical basis. In practice, use the events for audit and review, and use the published values for reporting.
An arousal is a brief shift toward lighter sleep or wakefulness. It matters because it fragments sleep even when the patient never wakes up in a way they would remember. Arousals are often the downstream consequence of a respiratory event, which is what the RERA token captures on the respiratory side.
{
"type": "arousal",
"session_id": "ses_01HXY",
"arousal_id": "ar_01HXY-23",
"started_at": "2026-04-26T23:45:25.100Z",
"duration_seconds": 4,
"kind": "spontaneous",
"associated_event_id": null,
"signature": null
}
The four kinds are spontaneous, respiratory (tied to a respiratory event), limb_movement and external (noise, light and similar disturbances). Linking uses associated_event_id. The sample above is spontaneous and carries null. A respiratory arousal would use kind: "respiratory" and name the event it follows, such as re_01HXY-12 from the previous section. This also lets a reader reconcile the associated_arousal flag on a respiratory event with the arousal records themselves.
One hard rule governs this family. AASM does not score arousals shorter than 3 seconds, so implementations must not emit them and conformant readers refuse them. The rule keeps the arousal count comparable across systems. A vendor that reported shorter blips would make its own arousal index look worse than a competitor's with no real difference between the patients.
The scoring metadata record ties a session's classifications to their producer and carries the summary figures that reports quote:
{
"type": "scoring_metadata",
"scoring_metadata_id": "scm_01HXY",
"session_id": "ses_01HXY",
"scoring_algorithm": "AASM-2024-default",
"scorer_id": "did:wia:scorer:tech-09",
"scored_at": "2026-04-27T09:00:00Z",
"summary": {
"total_sleep_minutes": 480,
"rem_minutes": 102,
"n3_minutes": 88,
"wake_minutes": 25,
"ahi": 4.5,
"rdi": 6.0,
"min_spo2_pct": 88,
"average_spo2_pct": 95
},
"aasm_compliance_level": "full"
}
The abbreviated summary above omits n1_minutes and n2_minutes, which the full record includes. The figures in the draft's example are illustrative: its stage minutes sum to 465 against a stated 480 total sleep minutes. Do not copy them as test vectors. The draft's example also shows its signature key as aleg rather than alg, which looks like a typo, so validate against the published JSON Schemas rather than against the sample text.
The aasm_compliance_level field tells a reader how much weight the scoring can bear:
| Level | Meaning |
|---|---|
full | Meets every scoring rule of the current AASM Manual edition |
partial | Meets a documented subset; the difference from full is published per algorithm under the WIA site's aasm-partial path |
consumer_estimate | Derived from non-AASM-equivalent inputs such as heart rate and accelerometry; not suitable for clinical decisions |
The scoring_algorithm field has one more job, which implementers often miss. AASM rules for children differ from those for adults, so the field must distinguish them (for example AASM-2024-paediatric). Otherwise adult-rule comparisons get applied to paediatric data without anyone noticing. The same field supports re-scoring. When the AASM publishes a Manual update, sessions may need to be scored again. The standard's supersedes chain (Phase 3 §8) lets the new scoring metadata replace the old without moving the raw data again.
A conformant Phase 1 implementation has to do the following:
clinical_grade: true without a regulatory-clearance reference.Unknown enum tokens are handled leniently. Future minor versions add tokens but never remove them, and a receiver treats an unfamiliar token as unrecognised while still processing the rest of the envelope.
clinical_grade is defined in WIA-MED-020 Phase 1 §3.2, not in this standard.Readers who write scoring software should start with 4.4 and 4.6, then pull the JSON Schemas and run the published black-box conformance suite. Hosts that publish bridge_profile=Full are asked to pass its extension tests for at least one third-party scoring algorithm and one vendor wearable platform. Integrators connecting a clinic's PSG system should read 4.2 closely, because EDF storage tends to dominate the budget. A single overnight study produces 100 to 500 MB, and local regulation often requires raw EDF retention for 7 to 25 years. Developers of consumer applications should focus on the compliance levels in 4.6 so their output is never mistaken for a clinical result. Before building against a live system, integrators can exercise their bridge against the reference container wia/sleep-monitoring-host:1.0.0, which serves mock data.
For patients, the main protections in this phase are structural. Patient identifiers use did:wia:patient:… forms, so a sleep record does not carry a name or other direct biometric identifier. The consumer_estimate label tells patients and clinicians when a wearable's night summary is not a diagnostic result. For clinicians, the most useful habit is to read the scoring metadata before the numbers. Check the compliance level, whether the algorithm is the paediatric or the adult one, and which scorer signed the result. Treat the published AHI as the study's figure. Use the event records to review how it was reached.
In summary, Phase 1 fixes five record types and a small, closed vocabulary. The session anchors the recording through an EDF reference and a hash. Stage, event and arousal records describe what happened at a time, and the scoring metadata says how far the interpretation can be trusted. Hard rules, such as the 3-second arousal floor and the clearance requirement for clinical_grade, keep the data comparable between systems. The next chapter moves from the shape of the data to the HTTP interface that exchanges these objects between devices, laboratories and records systems.