Self Report Shape
type: NodeShape
target class: SelfReport
comment: Validation constraints for patient-reported daily check-ins and self-assessments. Ensures required timestamping, type classification, and completion tracking.
property:
  path: reportDate
  datatype: dateTime
  min count: 1
  max count: 1
  name: Report Date
  message: Self-report must have exactly one reportDate timestamp
  severity: Violation
property:
  path: reportType
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Report Type
  message: Self-report must specify a reportType (e.g., medication_adherence, symptom_tracking, mood, sleep)
  severity: Violation
property:
  path: completionStatus
  datatype: string
  min count: 1
  max count: 1
  in: complete
  in: partial
  in: skipped
  name: Completion Status
  message: Self-report must have a completionStatus of complete, partial, or skipped
  severity: Violation
property:
  path: reportContext
  datatype: string
  max count: 1
  name: Report Context
  message: Consider adding reportContext to link this report to a tracking plan
  severity: Info
property:
  path: reportNotes
  datatype: string
  max count: 1
  name: Report Notes
  message: Consider adding reportNotes for additional patient context
  severity: Info

VO2 Max Statistics Shape
type: NodeShape
target class: VO2MaxStatistics
comment: Validation constraints for VO2 Max statistical summaries. Ensures core statistics, fitness classification, and trend analysis fields are present. Supports the dual-path UI pattern where rich statistics are preferred when available.
property:
  path: vo2Mean
  datatype: double
  min count: 1
  max count: 1
  min inclusive: 0
  name: Mean VO2 Max
  message: VO2 Max statistics must have a mean value (mL/kg/min, >= 0)
  severity: Violation
property:
  path: vo2SampleCount
  datatype: integer
  min count: 1
  max count: 1
  min inclusive: 1
  name: VO2 Sample Count
  message: VO2 Max statistics must have at least 1 sample
  severity: Violation
property:
  path: fitnessClassification
  datatype: string
  min count: 1
  max count: 1
  in: veryPoor
  in: poor
  in: fair
  in: good
  in: excellent
  in: superior
  name: Fitness Classification
  message: VO2 Max statistics must have a fitnessClassification (veryPoor, poor, fair, good, excellent, or superior)
  severity: Violation
property:
  path: periodStart
  datatype: dateTime
  max count: 1
  name: Period Start
  message: VO2 Max statistics should specify the measurement period start date
  severity: Warning
property:
  path: periodEnd
  datatype: dateTime
  max count: 1
  name: Period End
  message: VO2 Max statistics should specify the measurement period end date
  severity: Warning
property:
  path: vo2Min
  datatype: double
  max count: 1
  name: Minimum VO2 Max
  message: Consider including minimum VO2 Max for range analysis
  severity: Info
property:
  path: vo2MaxValue
  datatype: double
  max count: 1
  name: Maximum VO2 Max
  message: Consider including maximum VO2 Max for range analysis
  severity: Info
property:
  path: vo2TrendDirection
  datatype: string
  max count: 1
  in: improving
  in: declining
  in: stable
  in: unknown
  name: VO2 Trend Direction
  message: Consider including vo2TrendDirection for fitness trend analysis
  severity: Info
property:
  path: isSparseData
  datatype: boolean
  max count: 1
  name: Sparse Data Indicator
  message: Consider setting isSparseData to flag limited measurement periods
  severity: Info

HRV Statistics Shape
type: NodeShape
target class: HRVStatistics
comment: Validation constraints for Heart Rate Variability (SDNN) statistical summaries. Ensures core statistics and measurement period are present for trend analysis.
property:
  path: hrvMean
  datatype: double
  min count: 1
  max count: 1
  min inclusive: 0
  name: Mean HRV
  message: HRV statistics must have a mean value (ms, >= 0)
  severity: Violation
property:
  path: hrvSampleCount
  datatype: integer
  min count: 1
  max count: 1
  min inclusive: 1
  name: HRV Sample Count
  message: HRV statistics must have at least 1 sample
  severity: Violation
property:
  path: periodStart
  datatype: dateTime
  min count: 1
  max count: 1
  name: Period Start
  message: HRV statistics must specify the measurement period start date
  severity: Violation
property:
  path: periodEnd
  datatype: dateTime
  min count: 1
  max count: 1
  name: Period End
  message: HRV statistics must specify the measurement period end date
  severity: Violation
property:
  path: hrvMedian
  datatype: double
  max count: 1
  name: Median HRV
  message: Consider including median HRV for distribution analysis
  severity: Info
property:
  path: hrvStdDev
  datatype: double
  max count: 1
  name: HRV Standard Deviation
  message: Consider including HRV standard deviation for variability analysis
  severity: Info
property:
  path: hrvMin
  datatype: double
  max count: 1
  name: Minimum HRV
  message: Consider including minimum HRV for range analysis
  severity: Info
property:
  path: hrvMax
  datatype: double
  max count: 1
  name: Maximum HRV
  message: Consider including maximum HRV for range analysis
  severity: Info
property:
  path: hrvTrendDirection
  datatype: string
  max count: 1
  in: improving
  in: declining
  in: stable
  in: unknown
  name: HRV Trend Direction
  message: Consider including hrvTrendDirection for autonomic nervous system trend analysis
  severity: Info

Blood Pressure Statistics Shape
type: NodeShape
target class: BPStatistics
comment: Validation constraints for blood pressure statistical summaries. Ensures mean systolic/diastolic values and AHA category classification are present.
property:
  path: bpMeanSystolic
  datatype: double
  min count: 1
  max count: 1
  min inclusive: 40
  max inclusive: 300
  name: Mean Systolic BP
  message: BP statistics must have a mean systolic value (mmHg, 40-300)
  severity: Violation
property:
  path: bpMeanDiastolic
  datatype: double
  min count: 1
  max count: 1
  min inclusive: 20
  max inclusive: 200
  name: Mean Diastolic BP
  message: BP statistics must have a mean diastolic value (mmHg, 20-200)
  severity: Violation
property:
  path: bpCategory
  datatype: string
  min count: 1
  max count: 1
  in: normal
  in: elevated
  in: hypertension_stage1
  in: hypertension_stage2
  in: hypertensive_crisis
  name: BP Category
  message: BP statistics must have an AHA category (normal, elevated, hypertension_stage1, hypertension_stage2, or hypertensive_crisis)
  severity: Violation
property:
  path: bpSampleCount
  datatype: integer
  max count: 1
  min inclusive: 1
  name: BP Sample Count
  message: BP statistics should include a sample count for data quality assessment
  severity: Warning
property:
  path: bpMinSystolic
  datatype: double
  max count: 1
  name: Minimum Systolic BP
  message: Consider including minimum systolic BP for range analysis
  severity: Info
property:
  path: bpMaxSystolic
  datatype: double
  max count: 1
  name: Maximum Systolic BP
  message: Consider including maximum systolic BP for range analysis
  severity: Info
property:
  path: bpMinDiastolic
  datatype: double
  max count: 1
  name: Minimum Diastolic BP
  message: Consider including minimum diastolic BP for range analysis
  severity: Info
property:
  path: bpMaxDiastolic
  datatype: double
  max count: 1
  name: Maximum Diastolic BP
  message: Consider including maximum diastolic BP for range analysis
  severity: Info

Metric Trend Shape
type: NodeShape
target class: MetricTrend
comment: Validation constraints for time-bounded wellness metric trends. Ensures trend direction is present and encourages confidence and period metadata for proper interpretation.
property:
  path: trendDirection
  datatype: string
  min count: 1
  max count: 1
  in: increasing
  in: decreasing
  in: stable
  in: insufficient_data
  name: Trend Direction
  message: Metric trend must have a direction (increasing, decreasing, stable, or insufficient_data)
  severity: Violation
property:
  path: trendConfidence
  datatype: string
  max count: 1
  in: high
  in: medium
  in: low
  name: Trend Confidence
  message: Metric trend should include confidence level (high >30d, medium 14-30d, low <14d)
  severity: Warning
property:
  path: trendPeriodStart
  datatype: dateTime
  max count: 1
  name: Trend Period Start
  message: Metric trend should specify the observation period start date
  severity: Warning
property:
  path: trendPeriodEnd
  datatype: dateTime
  max count: 1
  name: Trend Period End
  message: Metric trend should specify the observation period end date
  severity: Warning
property:
  path: trendMagnitude
  datatype: decimal
  max count: 1
  name: Trend Magnitude
  message: Consider including trendMagnitude (percentage change) for quantitative trend analysis
  severity: Info
property:
  path: trendBaselineValue
  datatype: decimal
  max count: 1
  name: Baseline Value
  message: Consider including trendBaselineValue for comparative analysis
  severity: Info
property:
  path: trendCurrentValue
  datatype: decimal
  max count: 1
  name: Current Value
  message: Consider including trendCurrentValue for comparative analysis
  severity: Info

Activity Snapshot Shape
type: NodeShape
target class: ActivitySnapshot
comment: Validation constraints for aggregated activity metrics over a measurement period (typically 7 days). All fields are optional since activity data availability depends on device capabilities.
property:
  path: averageDailySteps
  datatype: integer
  max count: 1
  min inclusive: 0
  name: Average Daily Steps
  message: Activity snapshot should include average daily steps as a primary activity metric
  severity: Warning
property:
  path: exerciseMinutesWeekly
  datatype: integer
  max count: 1
  min inclusive: 0
  name: Exercise Minutes (Weekly)
  message: Consider including weekly exercise minutes for fitness context
  severity: Info
property:
  path: standHoursDaily
  datatype: integer
  max count: 1
  min inclusive: 0
  max inclusive: 24
  name: Stand Hours (Daily)
  message: Consider including daily stand hours for sedentary behavior tracking
  severity: Info
property:
  path: activeEnergyBurnedKcal
  datatype: decimal
  max count: 1
  min inclusive: 0
  name: Active Energy Burned (kcal)
  message: Consider including active energy burned for caloric expenditure tracking
  severity: Info

Sleep Snapshot Shape
type: NodeShape
target class: SleepSnapshot
comment: Validation constraints for aggregated sleep metrics over a measurement period (typically 7 days). Sleep data availability depends on device capabilities and user behavior.
property:
  path: averageDurationHours
  datatype: decimal
  max count: 1
  min inclusive: 0
  max inclusive: 24
  name: Average Sleep Duration (hours)
  message: Sleep snapshot should include average duration as a primary sleep metric
  severity: Warning
property:
  path: sleepQuality
  datatype: string
  max count: 1
  name: Sleep Quality
  message: Consider including sleep quality assessment for comprehensive sleep analysis
  severity: Info

Health Profile Shape
type: NodeShape
target class: HealthProfile
target class: ActivityData
target class: SleepData
target class: HeartRateData
target class: BloodPressureData
target class: HRVData
target class: BodyMeasurements
comment: Validation constraints for the top-level wellness profile aggregating vital signs, body measurements, activity, and sleep data from consumer devices. Stored at /wellness/ in the Cascade Pod.
property:
  path: bloodType
  datatype: string
  max count: 1
  in: aPositive
  in: aNegative
  in: bPositive
  in: bNegative
  in: abPositive
  in: abNegative
  in: oPositive
  in: oNegative
  name: Blood Type
  message: Blood type should be a valid ABO/Rh value if provided
  severity: Warning
property:
  path: restingHeartRateHistory
  class: DailyVitalReading
  name: Resting Heart Rate History
  message: Consider populating resting heart rate history for cardiac trend analysis
  severity: Info
property:
  path: walkingHeartRateHistory
  class: DailyVitalReading
  name: Walking Heart Rate History
  message: Consider populating walking heart rate history for activity-related cardiac trends
  severity: Info
property:
  path: hrvHistory
  class: HRVReading
  name: HRV History
  message: Consider populating HRV history for autonomic nervous system analysis
  severity: Info
property:
  path: bloodPressureHistory
  class: BloodPressureReading
  name: Blood Pressure History
  message: Consider populating blood pressure history for cardiovascular trend analysis
  severity: Info
property:
  path: vo2MaxHistory
  class: VitalSignReading
  name: VO2 Max History
  message: Consider populating VO2 Max history for fitness trend analysis
  severity: Info
property:
  path: bodyMassHistory
  class: DailyVitalReading
  name: Body Mass History
  message: Consider populating body mass history for weight trend analysis
  severity: Info
property:
  path: dailyActivityHistory
  class: DailyActivitySnapshot
  name: Daily Activity History
  message: Consider populating daily activity history for activity trend analysis
  severity: Info
property:
  path: dailySleepHistory
  class: DailySleepSnapshot
  name: Daily Sleep History
  message: Consider populating daily sleep history for sleep pattern analysis
  severity: Info
property:
  path: hasHRVStatistics
  class: HRVStatistics
  max count: 1
  node: HRV Statistics Shape
  name: HRV Statistics
  message: Consider linking HRV statistics for heart rate variability summary
  severity: Info
property:
  path: hasBPStatistics
  class: BPStatistics
  max count: 1
  node: Blood Pressure Statistics Shape
  name: BP Statistics
  message: Consider linking BP statistics for blood pressure summary
  severity: Info

Social History Record Shape
type: NodeShape
target class: SocialHistoryRecord
property:
  path: sourceSystem
  datatype: string
  max count: 1
  severity: Info
  name: Source System
  message: Source system attribution is recommended for social history records
property:
  path: smokingStatus
  datatype: string
  max count: 1
  severity: Info
  name: Smoking Status
  message: Smoking status is a key social history field

Lab Result Record Shape
type: NodeShape
target class: LabResultRecord
comment: Validation constraints for laboratory result records. Lifted from clinical:LabResultShape and checked against FHIR R4 Observation.
property:
  path: testName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Test Name
  message: Lab result must have exactly one non-empty testName
  severity: Violation
property:
  path: resultValue
  max count: 1
  name: Result Value
  message: Lab result must not carry more than one resultValue; two readings of the same analyte are two records
  severity: Violation
property:
  path: resultUnit
  datatype: string
  max count: 1
  name: Result Unit
  message: Lab result must not carry more than one resultUnit
  severity: Violation
property:
  path: referenceRange
  datatype: string
  max count: 1
  name: Reference Range
  severity: Violation
property:
  path: interpretation
  datatype: string
  max count: 1
  in: EX
  in: HM
  in: OBX
  in: CAR
  in: Carrier
  in: B
  in: D
  in: U
  in: W
  in: <
  in: >
  in: AC
  in: IE
  in: QCF
  in: TOX
  in: A
  in: N
  in: I
  in: MS
  in: NCL
  in: NS
  in: R
  in: S
  in: VS
  in: AA
  in: H
  in: L
  in: HH
  in: LL
  in: HX
  in: LX
  in: H>
  in: HU
  in: E
  in: L<
  in: LU
  in: ND
  in: IND
  in: NEG
  in: POS
  in: EXP
  in: UNE
  in: DET
  in: SYN-R
  in: NR
  in: RR
  in: WR
  in: SDD
  in: SYN-S
  in: unknown
  in: asked-unknown
  in: temp-unknown
  in: not-asked
  in: asked-declined
  in: masked
  in: not-applicable
  in: unsupported
  in: as-text
  in: error
  in: not-a-number
  in: negative-infinity
  in: positive-infinity
  in: not-performed
  in: not-permitted
  in: normal
  in: high
  in: low
  in: abnormal
  in: critical
  in: Normal
  in: High
  in: Low
  in: Abnormal
  in: Critical
  name: Interpretation
  message: Interpretation must be a code from the HL7 v3 ObservationInterpretation code system (http://terminology.hl7.org/CodeSystem/v3-ObservationInterpretation), a code from http://terminology.hl7.org/CodeSystem/data-absent-reason, or one of the retained health v2.5 words. A source code in none of those is carried verbatim on health:interpretationSourceCode.
  severity: Violation
property:
  path: interpretationSourceCode
  datatype: string
  max count: 1
  name: Interpretation Source Code
  message: Interpretation source code must be a single string: the source's verbatim code, unmodified
  severity: Violation
property:
  path: performedDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Performed Date must be an xsd:date or an xsd:dateTime. FHIR's dateTime primitive permits date precision (YYYY, YYYY-MM, YYYY-MM-DD), so a source that stated only a calendar day must not be given an invented time; an untyped or xsd:string literal is not either type.
  max count: 1
  name: Performed Date
  severity: Violation
property:
  path: reportedDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Reported Date must be an xsd:date or an xsd:dateTime. FHIR's dateTime primitive permits date precision (YYYY, YYYY-MM, YYYY-MM-DD), so a source that stated only a calendar day must not be given an invented time; an untyped or xsd:string literal is not either type.
  max count: 1
  name: Reported Date
  severity: Violation
property:
  path: testCode
  name: Test Code (LOINC)
  severity: Violation
property:
  path: labCategory
  datatype: string
  name: Lab Category
  severity: Violation
property:
  path: specimenType
  datatype: string
  max count: 1
  name: Specimen Type
  severity: Violation
property:
  path: orderingProvider
  datatype: string
  max count: 1
  name: Ordering Provider
  severity: Violation
property:
  path: performingLab
  datatype: string
  max count: 1
  name: Performing Laboratory
  severity: Violation
property:
  path: sourceRecordId
  datatype: string
  max count: 1
  name: Source Record Identifier
  severity: Violation
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
  message: Lab result must declare exactly one valid cascade:dataProvenance
  severity: Violation
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version
  message: Lab result must declare exactly one schemaVersion in major.minor form
  severity: Violation

Condition Record Shape
type: NodeShape
target class: ConditionRecord
comment: Validation constraints for condition and problem-list records. Lifted from clinical:ConditionShape and checked against FHIR R4 Condition.
property:
  path: conditionName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Condition Name
  message: Condition must have exactly one non-empty conditionName
  severity: Violation
property:
  path: status
  datatype: string
  max count: 1
  in: active
  in: recurrence
  in: relapse
  in: inactive
  in: remission
  in: resolved
  name: Clinical Status
  message: Condition status must be one of the FHIR R4 ConditionClinicalStatusCodes: active, recurrence, relapse, inactive, remission, resolved
  severity: Violation
property:
  path: onsetDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Onset Date must be an xsd:date or an xsd:dateTime. FHIR's dateTime primitive permits date precision (YYYY, YYYY-MM, YYYY-MM-DD), so a source that stated only a calendar day must not be given an invented time; an untyped or xsd:string literal is not either type.
  max count: 1
  name: Onset Date
  severity: Violation
property:
  path: icd10Code
  name: ICD-10-CM Code
  severity: Violation
property:
  path: snomedCode
  name: SNOMED CT Code
  severity: Violation
property:
  path: conditionClass
  datatype: string
  max count: 1
  name: Condition Class
  severity: Violation
property:
  path: monitoredVitalSigns
  max count: 1
  name: Monitored Vital Signs
  message: Monitored vital signs must be a single rdf:List, not repeated
  severity: Violation
property:
  path: sourceRecordId
  datatype: string
  max count: 1
  name: Source Record Identifier
  severity: Violation
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
  message: Condition must declare exactly one valid cascade:dataProvenance
  severity: Violation
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version
  message: Condition must declare exactly one schemaVersion in major.minor form
  severity: Violation

Allergy Record Shape
type: NodeShape
target class: AllergyRecord
comment: Validation constraints for allergy and intolerance records. Lifted from clinical:AllergyShape and checked against FHIR R4 AllergyIntolerance.
property:
  path: allergen
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Allergen
  message: Allergy must specify exactly one non-empty allergen
  severity: Violation
property:
  path: reaction
  datatype: string
  name: Reaction
  severity: Violation
property:
  path: allergySeverity
  datatype: string
  max count: 1
  in: mild
  in: moderate
  in: severe
  name: Allergy Severity
  message: Allergy severity must be one of the FHIR R4 AllergyIntoleranceSeverity codes: mild, moderate, severe
  severity: Violation
property:
  path: allergyCategory
  datatype: string
  max count: 1
  in: food
  in: medication
  in: environment
  in: biologic
  name: Allergy Category
  message: Allergy category must be one of the FHIR R4 AllergyIntoleranceCategory codes: food, medication, environment, biologic
  severity: Violation
property:
  path: onsetDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Onset Date must be an xsd:date or an xsd:dateTime. FHIR's dateTime primitive permits date precision (YYYY, YYYY-MM, YYYY-MM-DD), so a source that stated only a calendar day must not be given an invented time; an untyped or xsd:string literal is not either type.
  max count: 1
  name: Onset Date
  severity: Violation
property:
  path: sourceRecordId
  datatype: string
  max count: 1
  name: Source Record Identifier
  severity: Violation
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
  message: Allergy must declare exactly one valid cascade:dataProvenance
  severity: Violation
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version
  message: Allergy must declare exactly one schemaVersion in major.minor form
  severity: Violation

Immunization Record Shape
type: NodeShape
target class: ImmunizationRecord
comment: Validation constraints for immunization records. Lifted from clinical:ImmunizationShape and checked against FHIR R4 Immunization.
property:
  path: vaccineName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Vaccine Name
  message: Immunization must have exactly one non-empty vaccineName
  severity: Violation
property:
  path: administrationDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Administration Date must be an xsd:date or an xsd:dateTime. FHIR's dateTime primitive permits date precision (YYYY, YYYY-MM, YYYY-MM-DD), so a source that stated only a calendar day must not be given an invented time; an untyped or xsd:string literal is not either type.
  max count: 1
  name: Administration Date
  severity: Violation
property:
  path: status
  datatype: string
  max count: 1
  in: completed
  in: entered-in-error
  in: not-done
  name: Status
  message: Immunization status must be one of the FHIR R4 ImmunizationStatusCodes: completed, entered-in-error, not-done
  severity: Violation
property:
  path: vaccineCode
  datatype: string
  max count: 1
  name: Vaccine Code
  severity: Violation
property:
  path: manufacturer
  datatype: string
  max count: 1
  name: Manufacturer
  severity: Violation
property:
  path: lotNumber
  datatype: string
  max count: 1
  name: Lot Number
  message: Immunization must not carry more than one lotNumber; a lot number identifies a single administered dose
  severity: Violation
property:
  path: doseQuantity
  datatype: string
  max count: 1
  name: Dose Quantity
  severity: Violation
property:
  path: route
  datatype: string
  max count: 1
  name: Route
  severity: Violation
property:
  path: site
  datatype: string
  max count: 1
  name: Administration Site
  severity: Violation
property:
  path: administeringProvider
  datatype: string
  max count: 1
  name: Administering Provider
  severity: Violation
property:
  path: administeringLocation
  datatype: string
  max count: 1
  name: Administering Location
  severity: Violation
property:
  path: sourceRecordId
  datatype: string
  max count: 1
  name: Source Record Identifier
  severity: Violation
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
  message: Immunization must declare exactly one valid cascade:dataProvenance
  severity: Violation
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version
  message: Immunization must declare exactly one schemaVersion in major.minor form
  severity: Violation

Family History Record Shape
type: NodeShape
target class: FamilyHistoryRecord
comment: Validation constraints for family history records. Derived from FHIR R4 FamilyMemberHistory.
property:
  path: conditionName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Condition Name
  message: Family history record must name exactly one condition
  severity: Violation
property:
  path: relationship
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Relationship
  message: Family history record must state exactly one relationship to the patient
  severity: Violation
property:
  path: onsetAge
  datatype: integer
  max count: 1
  min inclusive: 0
  max inclusive: 130
  name: Onset Age
  message: Onset age must be a single integer between 0 and 130
  severity: Violation
property:
  path: sourceRecordId
  datatype: string
  max count: 1
  name: Source Record Identifier
  severity: Violation
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
  message: Family history record must declare exactly one valid cascade:dataProvenance
  severity: Violation
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version
  message: Family history record must declare exactly one schemaVersion in major.minor form
  severity: Violation

Daily Vital Reading Shape
type: NodeShape
target class: DailyVitalReading
comment: Validation constraints for a single day's aggregated vital sign reading inside a history container.
or:
  property:
    path: date
    min count: 1
or:
  property:
    path: date
    min count: 1
message: Daily vital reading must carry a timestamp as either cascade:date or health:date
severity: Violation
property:
  path: date
  datatype: dateTime
  max count: 1
  name: Date
  severity: Violation
property:
  path: date
  datatype: dateTime
  max count: 1
  name: Date
  severity: Violation
property:
  path: sampleCount
  datatype: integer
  max count: 1
  min inclusive: 0
  name: Sample Count
  message: Sample count must be a single non-negative integer
  severity: Violation
property:
  path: value
  max count: 1
  name: Value
  message: Daily vital reading must not carry more than one value
  severity: Violation
property:
  path: unit
  datatype: string
  max count: 1
  name: Unit
  severity: Violation
property:
  path: loincCode
  max count: 1
  name: LOINC Code
  severity: Violation

Daily Activity Snapshot Shape
type: NodeShape
target class: DailyActivitySnapshot
comment: Validation constraints for a single day's activity metrics.
property:
  path: date
  datatype: dateTime
  min count: 1
  max count: 1
  name: Date
  message: Daily activity snapshot must carry exactly one cascade:date
  severity: Violation
property:
  path: steps
  datatype: integer
  max count: 1
  min inclusive: 0
  name: Steps
  message: Steps must be a single non-negative integer
  severity: Violation
property:
  path: activeEnergyKcal
  datatype: decimal
  max count: 1
  min inclusive: 0
  name: Active Energy (kcal)
  message: Active energy must be a single non-negative decimal
  severity: Violation
property:
  path: exerciseMinutes
  datatype: integer
  max count: 1
  min inclusive: 0
  max inclusive: 1440
  name: Exercise Minutes
  message: Exercise minutes must be a single integer between 0 and 1440
  severity: Violation
property:
  path: standHours
  datatype: integer
  max count: 1
  min inclusive: 0
  max inclusive: 24
  name: Stand Hours
  message: Stand hours must be a single integer between 0 and 24
  severity: Violation

Daily Sleep Snapshot Shape
type: NodeShape
target class: DailySleepSnapshot
comment: Validation constraints for a single night's sleep metrics.
property:
  path: date
  datatype: dateTime
  min count: 1
  max count: 1
  name: Date
  message: Daily sleep snapshot must carry exactly one cascade:date
  severity: Violation
property:
  path: durationHours
  datatype: decimal
  max count: 1
  min inclusive: 0
  max inclusive: 24
  name: Sleep Duration (hours)
  message: Sleep duration must be a single decimal between 0 and 24 hours
  severity: Violation
property:
  path: sleepQuality
  max count: 1
  in: Excellent
  in: Good
  in: Fair
  in: Poor
  name: Sleep Quality
  message: Sleep quality must be one of health:Excellent, health:Good, health:Fair, health:Poor
  severity: Violation