viewof intendedUse = Inputs.select(
["Wellness trend", "Research capture", "Clinician-reviewed report"],
{label: "Intended Use", value: "Wellness trend"}
)
viewof signalQuality = Inputs.range([0, 100], {
value: 82,
step: 1,
label: "Signal Quality Score"
})
viewof relayAgeMinutes = Inputs.range([0, 30], {
value: 3,
step: 1,
label: "Relay Age (minutes)"
})
viewof calibrationHours = Inputs.range([-24, 72], {
value: 12,
step: 1,
label: "Calibration Valid For (hours)"
})
viewof tearLagMinutes = Inputs.range([5, 45], {
value: 20,
step: 5,
label: "Estimated Tear Lag (minutes)"
})
qualityOk = signalQuality >= 75
relayOk = relayAgeMinutes <= 5
calibrationOk = calibrationHours > 0
lagOk = intendedUse === "Wellness trend" ? true : tearLagMinutes <= 20
ready = qualityOk && relayOk && calibrationOk && lagOk
decision = ready
? "Trend can be shown with quality metadata"
: !qualityOk
? "Trend unavailable: repeat the reader session"
: !relayOk
? "Trend unavailable: relay data is stale"
: !calibrationOk
? "Trend unavailable: calibration is expired"
: "Trend unavailable: lag is too high for this claim"
html`<div style="background: #2C3E50; color: white; padding: 25px; border-radius: 8px; margin: 20px 0;">
<h3 style="color: #16A085; margin-top: 0;">Lens Reading Gate</h3>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 20px;">
<div>
<h4 style="color: #3498DB; margin: 10px 0;">Evidence Checks</h4>
<strong>Signal quality:</strong> ${qualityOk ? 'Pass' : 'Fail'} (${signalQuality}/100)<br>
<strong>Relay freshness:</strong> ${relayOk ? 'Pass' : 'Fail'} (${relayAgeMinutes} min)<br>
<strong>Calibration:</strong> ${calibrationOk ? 'Pass' : 'Fail'} (${calibrationHours} h)
</div>
<div>
<h4 style="color: #16A085; margin: 10px 0;">Claim Boundary</h4>
<strong>Use:</strong> ${intendedUse}<br>
<strong>Tear lag:</strong> ${tearLagMinutes} minutes<br>
<strong>Lag check:</strong> ${lagOk ? 'Pass' : 'Fail'}
</div>
</div>
<div style="background: ${ready ? 'rgba(22,160,133,0.2)' : 'rgba(230,126,34,0.2)'}; padding: 15px; border-radius: 6px; border-left: 4px solid ${ready ? '#16A085' : '#E67E22'};">
<h4 style="margin-top: 0;">Decision: ${decision}</h4>
<strong>Status:</strong> ${ready ? 'Ready with provenance' : 'Do not show a confident trend'}
</div>
<div style="margin-top: 15px; font-size: 0.9em; color: #BDC3C7;">
<strong>Key Insight:</strong> the safest user interface treats signal quality, relay age, calibration state, and claim boundary as separate controls.
</div>
</div>`Lens Session Readiness Tool
Lens Session Readiness Tool
animation
connected-health
Try Reduce Signal Quality Score while keeping the other controls unchanged. Then press Calculate readiness.
Observe After pressing Calculate readiness, watch signal quality and decision as Signal Quality Score changes.
Explain Describe how Intended Use changes the lag check after you press Calculate readiness.
Technical boundaries. Readiness uses separate fixed checks for signal quality, relay freshness, calibration, and tear lag. Wellness trend always passes the lag check.