Clinical Document Shape
type: NodeShape
target class: ClinicalDocument
comment: Validation constraints for clinical documents imported from EHR
property:
  path: importedAt
  datatype: dateTime
  min count: 1
  max count: 1
  name: Imported At
  message: Clinical document must have exactly one importedAt timestamp
property:
  path: sourceEHR
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  max length: 100
  name: Source EHR
  message: Clinical document must specify the source EHR system
property:
  path: sourceBundleId
  datatype: string
  max count: 1
  pattern: ^[a-zA-Z][a-zA-Z0-9.-]*$
  name: Source Bundle ID
  message: Bundle ID must be a valid iOS bundle identifier
property:
  path: fhirResourceId
  datatype: string
  min count: 1
  max count: 1
  name: FHIR Resource ID
  message: Clinical document must have a FHIR resource ID
property:
  path: fhirResourceType
  datatype: string
  min count: 1
  max count: 1
  name: FHIR Resource Type
  message: Clinical document must specify FHIR resource type
property:
  path: displayName
  datatype: string
  max count: 1
  max length: 500
  name: Display Name
property:
  path: narrativeText
  datatype: string
  max count: 1
  name: Narrative Text
  description: Plain text content extracted from FHIR narrative
property:
  path: narrativeXHTML
  datatype: string
  max count: 1
  name: Narrative XHTML
property:
  path: rawFHIRData
  datatype: base64Binary
  max count: 1
  name: Raw FHIR Data
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: Clinical documents must have valid provenance
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version
  message: Schema version must be in format major.minor
property:
  path: hasSection
  class: ClinicalSection
  name: Sections

Clinical Section Shape
type: NodeShape
target class: ClinicalSection
comment: Validation constraints for clinical document sections
property:
  path: sectionTitle
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  max length: 200
  name: Section Title
  message: Section must have a title
property:
  path: sectionContent
  datatype: string
  min count: 1
  name: Section Content
  message: Section must have content
property:
  path: sectionCode
  datatype: string
  max count: 1
  pattern: ^[0-9]{4,5}-[0-9]$
  name: Section Code
  message: Section code must be a valid LOINC code (e.g., 10154-3)
property:
  path: sectionOrder
  datatype: integer
  max count: 1
  min inclusive: 0
  name: Section Order

Progress Note Shape
type: NodeShape
target class: ProgressNote
comment: Additional constraints for progress notes
node: Clinical Document Shape
property:
  path: encounterDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Encounter 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.
  min count: 1
  max count: 1
  name: Encounter Date
  message: Progress notes must specify the encounter date

Discharge Summary Shape
type: NodeShape
target class: DischargeSummary
comment: Additional constraints for discharge summaries
node: Clinical Document Shape
property:
  path: documentDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Document 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.
  min count: 1
  max count: 1
  name: Document Date
  message: Discharge summary must have a document date

Consultation Note Shape
type: NodeShape
target class: ConsultationNote
comment: Additional constraints for specialist consultation notes
node: Clinical Document Shape
property:
  path: encounterDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Encounter 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: Encounter Date
  message: Consultation note must not carry more than one encounter date

Laboratory Report Shape
type: NodeShape
target class: LaboratoryReport
comment: Additional constraints for laboratory reports
node: Clinical Document Shape
property:
  path: documentDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Document 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.
  min count: 1
  name: Document Date
  message: Lab reports must have a document date

Imaging Report Shape
type: NodeShape
target class: ImagingReport
comment: Additional constraints for imaging/radiology reports
node: Clinical Document Shape
property:
  path: documentDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Document 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.
  min count: 1
  name: Document Date
  message: Imaging reports must have a document date

Visit Summary Shape
type: NodeShape
target class: VisitSummary
comment: Additional constraints for after-visit summaries
node: Clinical Document Shape
property:
  path: encounterDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Encounter 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.
  min count: 1
  max count: 1
  name: Encounter Date
  message: Visit summary must specify the encounter date

Medication Shape
type: NodeShape
target class: Medication
comment: Validation constraints for medication records
property:
  path: drugName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Drug Name
  message: Medication must have a drug name
property:
  path: dosage
  datatype: string
  max count: 1
  name: Dosage
property:
  path: route
  datatype: string
  max count: 1
  name: Route
property:
  path: frequency
  datatype: string
  max count: 1
  name: Frequency
property:
  path: status
  datatype: string
  max count: 1
  name: Status
property:
  path: rxNormCode
  max count: 1
  name: RxNorm Code
property:
  path: snomedCode
  name: SNOMED Code
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: Medication records must have valid provenance
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version
property:
  path: prescriber
  datatype: string
  max count: 1
  name: Prescriber
property:
  path: indication
  datatype: string
  max count: 1
  name: Indication
property:
  path: courseOfTherapyType
  datatype: string
  max count: 1
  in: acute
  in: continuous
  in: unknown
  severity: Warning
  name: Course of Therapy Type
  message: courseOfTherapyType should be acute, continuous, or unknown
property:
  path: asNeeded
  datatype: boolean
  max count: 1
  name: As Needed (PRN)
property:
  path: medicationForm
  datatype: string
  max count: 1
  name: Medication Form
property:
  path: activeIngredient
  datatype: string
  max count: 1
  name: Active Ingredient
property:
  path: ingredientStrength
  datatype: string
  max count: 1
  name: Ingredient Strength
property:
  path: provenanceClass
  datatype: string
  max count: 1
  in: healthKitFHIR
  in: userTracked
  in: pharmacyClaim
  in: imported
  name: Provenance Class
property:
  path: sourceFhirResourceType
  datatype: string
  max count: 1
  in: MedicationRequest
  in: MedicationStatement
  in: MedicationDispense
  in: MedicationAdministration
  name: Source FHIR Resource Type
property:
  path: clinicalIntent
  datatype: string
  max count: 1
  in: reportedUse
  in: prescribed
  in: dispensed
  in: administered
  name: Clinical Intent
property:
  path: refillsAllowed
  datatype: integer
  max count: 1
  min inclusive: 0
  name: Refills Allowed
property:
  path: supplyDurationDays
  datatype: integer
  max count: 1
  min inclusive: 0
  name: Supply Duration Days
property:
  path: dispensedQuantity
  datatype: string
  max count: 1
  name: Dispensed Quantity
property:
  path: prescriptionCategory
  datatype: string
  max count: 1
  in: community
  in: inpatient
  in: discharge
  name: Prescription Category

Allergy Shape
type: NodeShape
target class: Allergy
comment: Validation constraints for allergy/intolerance records
property:
  path: allergen
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Allergen
  message: Allergy must specify the allergen
property:
  path: reaction
  datatype: string
  name: Reaction
property:
  path: severity
  datatype: string
  max count: 1
  in: mild
  in: moderate
  in: severe
  name: Severity
  message: Severity must be mild, moderate, or severe
property:
  path: criticality
  datatype: string
  max count: 1
  in: low
  in: high
  in: unable-to-assess
  name: Criticality
property:
  path: category
  datatype: string
  max count: 1
  in: food
  in: medication
  in: environment
  in: biologic
  name: Allergy Category
property:
  path: snomedCode
  name: SNOMED Code
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version

Lab Result Shape
type: NodeShape
target class: LabResult
comment: Validation constraints for laboratory result records
property:
  path: testName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Test Name
  message: Lab result must have a test name
property:
  path: value
  max count: 1
  name: Value
property:
  path: unit
  datatype: string
  max count: 1
  name: Unit
property:
  path: referenceRange
  datatype: string
  max count: 1
  name: Reference Range
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 legacy words. A source code in none of those is carried verbatim on clinical:interpretationSourceCode.
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
property:
  path: loincCode
  max count: 1
  name: LOINC Code
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version

Condition Shape
type: NodeShape
target class: Condition
comment: Validation constraints for condition/diagnosis records
property:
  path: conditionName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Condition Name
  message: Condition must have a name
property:
  path: clinicalStatus
  datatype: string
  max count: 1
  in: active
  in: recurrence
  in: relapse
  in: inactive
  in: remission
  in: resolved
  name: Clinical Status
property:
  path: verificationStatus
  datatype: string
  max count: 1
  in: unconfirmed
  in: provisional
  in: differential
  in: confirmed
  in: refuted
  in: entered-in-error
  name: Verification Status
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
property:
  path: snomedCode
  name: SNOMED Code
property:
  path: icd10Code
  name: ICD-10 Code
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version

Immunization Shape
type: NodeShape
target class: Immunization
comment: Validation constraints for immunization records
property:
  path: vaccineName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Vaccine Name
  message: Immunization must have a vaccine name
property:
  path: cvxCode
  max count: 1
  name: CVX Code
property:
  path: lotNumber
  datatype: string
  max count: 1
  name: Lot Number
property:
  path: site
  datatype: string
  max count: 1
  name: Site
property:
  path: doseQuantity
  datatype: string
  max count: 1
  name: Dose Quantity
property:
  path: manufacturer
  datatype: string
  max count: 1
  name: Manufacturer
property:
  path: status
  datatype: string
  max count: 1
  in: completed
  in: entered-in-error
  in: not-done
  name: Status
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version

Procedure Shape
type: NodeShape
target class: Procedure
comment: Validation constraints for procedure records
or:
  property:
    path: procedureName
    min count: 1
or:
  property:
    path: procedureName
    min count: 1
message: Procedure must have a name, as clinical:procedureName (canonical) or health:procedureName (deprecated import spelling, accepted during the clinical v1.15 migration window)
property:
  path: procedureName
  datatype: string
  max count: 1
  min length: 1
  name: Procedure Name
  message: Procedure name must be a single non-empty string
property:
  path: procedureName
  datatype: string
  max count: 1
  min length: 1
  name: Procedure Name (deprecated spelling)
  message: Procedure name must be a single non-empty string
property:
  path: procedureDate
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Procedure 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: Procedure Date
property:
  path: bodySite
  datatype: string
  max count: 1
  name: Body Site
property:
  path: performer
  datatype: string
  max count: 1
  name: Performer
property:
  path: status
  datatype: string
  max count: 1
  in: preparation
  in: in-progress
  in: not-done
  in: on-hold
  in: stopped
  in: completed
  in: entered-in-error
  in: unknown
  name: Status
property:
  path: cptCode
  datatype: string
  max count: 1
  pattern: ^[0-9]{4}[0-9FTU]$
  name: CPT Code
  message: CPT code must be five characters: five digits (Category I), or four digits followed by F (Category II), T (Category III) or U (Proprietary Laboratory Analyses)
property:
  path: snomedCode
  name: SNOMED Code
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version

Procedure Name Spelling Shape
type: NodeShape
target subjects of: procedureName
comment: Warns that a record carries the deprecated health:procedureName spelling. Accepted during the clinical v1.15 migration window; removed with the window.
property:
  path: procedureName
  max count: 0
  name: Procedure Name (deprecated spelling)
  message: Procedure name is written on health:procedureName, which no Cascade vocabulary defines. Write clinical:procedureName instead: it is the property whose domain is clinical:Procedure and the one clinical:ProcedureShape names. Accepted during the clinical v1.15 migration window; this becomes a VIOLATION when the window closes.
  severity: Warning

Vital Sign Shape
type: NodeShape
target class: VitalSign
comment: Validation constraints for vital sign observations
property:
  path: vitalType
  datatype: string
  min count: 1
  max count: 1
  in: Heart Rate
  in: Blood Pressure
  in: Respiratory Rate
  in: Body Temperature
  in: Oxygen Saturation
  in: Body Weight
  in: Body Height
  in: BMI
  in: heart_rate
  in: blood_pressure
  in: respiratory_rate
  in: body_temperature
  in: oxygen_saturation
  in: body_weight
  in: body_height
  in: bmi
  in: heartRate
  in: bloodPressure
  in: bloodPressureSystolic
  in: bloodPressureDiastolic
  in: respiratoryRate
  in: temperature
  in: oxygenSaturation
  in: bodyWeight
  in: bodyHeight
  in: bodyMassIndex
  name: Vital Type
  message: Vital sign must have a valid type
property:
  path: value
  max count: 1
  name: Value
property:
  path: unit
  datatype: string
  max count: 1
  name: Unit
property:
  path: component1Value
  max count: 1
  name: Component 1 Value
property:
  path: component2Value
  max count: 1
  name: Component 2 Value
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 should 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 legacy words. Carry a code the value sets do not contain verbatim on clinical:interpretationSourceCode and put the nearest ratified reading here. WARNING in clinical v1.15; this becomes a VIOLATION in a later version.
  severity: Warning
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
property:
  path: deviceName
  datatype: string
  max count: 1
  name: Device Name
property:
  path: loincCode
  max count: 1
  name: LOINC Code
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version

Medication Use Episode Shape
type: NodeShape
target class: MedicationUseEpisode
comment: Validation constraints for longitudinal medication episodes. Ensures source linkage and explainable status inference per Cascade Protocol requirements.
property:
  path: canonicalName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Canonical Name
  message: Episode must have a canonical drug name
  severity: Violation
property:
  path: episodeFirstSeenDate
  datatype: dateTime
  min count: 1
  max count: 1
  name: First Seen Date
  message: Episode must have a first seen date (earliest clinical date from source records)
  severity: Violation
property:
  path: episodeLastSeenDate
  datatype: dateTime
  min count: 1
  max count: 1
  name: Last Seen Date
  message: Episode must have a last seen date (most recent clinical date from source records)
  severity: Violation
property:
  path: derivedFromRecord
  min count: 1
  name: Derived From Record
  message: Episode MUST link to at least one source MedicationRecord (sourceRecordIds required per Cascade Protocol)
  description: Every episode must trace back to its source records for explainability
  severity: Violation
property:
  path: inferredStatus
  datatype: string
  min count: 1
  max count: 1
  in: active
  in: inactive
  name: Inferred Status
  message: Episode MUST have an inferred status (active or inactive)
  severity: Violation
property:
  path: statusReason
  datatype: string
  min count: 1
  max count: 1
  in: explicitStatus
  in: hasRecentEndDate
  in: noRecentActivity
  in: inferredFromRefills
  in: userOverride
  name: Status Reason
  message: Episode MUST have a status reason explaining WHY system thinks this status (per No Silent Inference policy)
  description: Enables answering: 'Why does system think this medication is active?'
  severity: Violation
property:
  path: statusConfidence
  datatype: string
  min count: 1
  max count: 1
  in: high
  in: medium
  in: low
  name: Status Confidence
  message: Episode must declare confidence level for status inference
  severity: Violation
property:
  path: conceptUri
  max count: 1
  name: Concept URI
  description: Stable URI for the medication concept (RxNorm URI or minted Cascade URI)
property:
  path: currentDose
  datatype: string
  max count: 1
  name: Current Dose
property:
  path: currentFrequency
  datatype: string
  max count: 1
  name: Current Frequency
property:
  path: currentRoute
  datatype: string
  max count: 1
  name: Current Route
property:
  path: usePattern
  datatype: string
  max count: 1
  in: chronic
  in: shortCourse
  in: oneTime
  in: asNeeded
  in: unknown
  name: Use Pattern
property:
  path: therapeuticClass
  datatype: string
  max count: 1
  name: Therapeutic Class
property:
  path: hasUnresolvedConflicts
  datatype: boolean
  max count: 1
  name: Has Unresolved Conflicts
  description: Flag indicating episode has data conflicts requiring user attention
property:
  path: durationDays
  datatype: integer
  max count: 1
  min inclusive: 0
  name: Duration Days
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: Reconciled
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
  message: Episode must have valid provenance (typically Reconciled for derived episodes)
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version

Supplement Shape
type: NodeShape
target class: Supplement
comment: Validation constraints for supplement records. Ensures regulatory status is always explicit per Cascade Protocol requirements.
property:
  path: supplementName
  datatype: string
  min count: 1
  max count: 1
  min length: 1
  name: Supplement Name
  message: Supplement must have a name
  severity: Violation
property:
  path: regulatoryStatus
  datatype: string
  min count: 1
  max count: 1
  in: dietarySupplement
  in: otcDrug
  in: homeopathic
  in: herbalRemedy
  in: unknown
  name: Regulatory Status
  message: Supplement MUST have explicit regulatory status to distinguish from FDA-approved medications
  description: Required per Cascade Protocol to avoid implying clinical equivalence with prescription medications
  severity: Violation
property:
  path: dose
  datatype: string
  max count: 1
  name: Dose
property:
  path: frequency
  datatype: string
  max count: 1
  name: Frequency
property:
  path: brand
  datatype: string
  max count: 1
  name: Brand
property:
  path: form
  datatype: string
  max count: 1
  in: capsule
  in: tablet
  in: softgel
  in: liquid
  in: powder
  in: gummy
  in: spray
  in: patch
  in: tea
  in: tincture
  in: other
  name: Form
property:
  path: evidenceStrength
  datatype: string
  max count: 1
  in: strongEvidence
  in: moderateEvidence
  in: limitedEvidence
  in: traditionalUse
  in: noEvidence
  in: unknown
  name: Evidence Strength
  description: Level of clinical evidence supporting supplement use
property:
  path: isActive
  datatype: boolean
  max count: 1
  name: Is Active
property:
  path: dsldId
  datatype: string
  max count: 1
  name: DSLD ID
  description: NIH Dietary Supplement Label Database identifier
property:
  path: upc
  datatype: string
  max count: 1
  name: UPC
property:
  path: cascadeUri
  max count: 1
  name: Cascade URI
  description: Stable Cascade Protocol identifier (minted when no external ID exists)
property:
  path: reasonForUse
  datatype: string
  max count: 1
  name: Reason For Use
property:
  path: dataProvenance
  in: ClinicalGenerated
  in: EHRVerified
  in: DeviceGenerated
  in: PatientReported
  in: SelfReported
  in: AIExtracted
  min count: 1
  max count: 1
  name: Data Provenance
property:
  path: schemaVersion
  datatype: string
  min count: 1
  max count: 1
  pattern: ^[0-9]+\.[0-9]+$
  name: Schema Version

Social History Record Shape
type: NodeShape
target class: SocialHistoryRecord
property:
  path: socialHistoryCategory
  datatype: string
  min count: 1
  max count: 1
  in: smokingStatus
  in: alcoholUse
  in: substanceUse
  in: occupation
  in: exercise
  in: diet
  in: sexualHistory
  in: other
  severity: Violation
  name: Social History Category
  message: SocialHistoryRecord requires a socialHistoryCategory from the defined value set
property:
  path: packsPerYear
  datatype: decimal
  max count: 1
  min inclusive: 0.0
  severity: Warning
  name: Packs Per Year
property:
  path: alcoholDrinksPerWeek
  datatype: decimal
  max count: 1
  min inclusive: 0.0
  severity: Warning
  name: Alcohol Drinks Per Week
property:
  path: occupationTitle
  datatype: string
  max count: 1
  severity: Warning
  name: Occupation Title

Encounter Shape
type: NodeShape
target class: Encounter
node kind: IRI
comment: Minimal validation constraints for clinical encounters (visits). Constrains cardinality, datatype and provenance; deliberately does not constrain what kind of visit an encounter may be.
message: A clinical:Encounter must be identified by an IRI so that clinical:hasEncounter edges can resolve to it
property:
  path: encounterClass
  datatype: string
  max count: 1
  name: Encounter Class
  severity: Violation
property:
  path: encounterStatus
  datatype: string
  max count: 1
  in: planned
  in: arrived
  in: triaged
  in: in-progress
  in: onleave
  in: finished
  in: cancelled
  in: entered-in-error
  in: unknown
  name: Encounter Status
  message: Encounter status should be one of the FHIR R4 EncounterStatus codes: planned, arrived, triaged, in-progress, onleave, finished, cancelled, entered-in-error, unknown
  severity: Warning
property:
  path: encounterType
  datatype: string
  max count: 1
  name: Encounter Type
  severity: Violation
property:
  path: encounterStart
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Encounter Start 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: Encounter Start
  severity: Violation
property:
  path: encounterEnd
  or:
    datatype: date
  or:
    datatype: dateTime
  message: Encounter End 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: Encounter End
  severity: Violation
property:
  path: snomedCode
  name: SNOMED Code
  severity: Violation
property:
  path: providerName
  datatype: string
  max count: 1
  name: Provider Name
  severity: Violation
property:
  path: facilityName
  datatype: string
  max count: 1
  name: Facility Name
  severity: Violation
property:
  path: sourceRecordId
  datatype: string
  max count: 1
  name: Source Record ID
  severity: Violation
property:
  path: sourceEHR
  datatype: string
  max count: 1
  max length: 100
  name: Source EHR
  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: Encounter 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
  severity: Violation

Encounter Temporal Shape
type: NodeShape
target class: Encounter
or:
  path: encounterStart
  min count: 1
or:
  path: encounterEnd
  min count: 1
or:
  path: encounterDate
  min count: 1
message: Encounter should carry a start, an end or an encounter date so that records linked to it can be placed in time
severity: Warning

HasEncounterEdgeShape
type: PropertyShape
target subjects of: hasEncounter
path: hasEncounter
node kind: IRI
severity: Warning
message: clinical:hasEncounter should reference a clinical:Encounter by IRI
name: Has Encounter Edge

IndicationReferenceEdgeShape
type: PropertyShape
target subjects of: indicationReference
path: indicationReference
node kind: IRI
severity: Warning
message: clinical:indicationReference should reference the reason record (a Condition or Observation) by IRI
name: Indication Reference Edge

LinkedConditionEdgeShape
type: PropertyShape
target subjects of: linkedCondition
path: linkedCondition
node kind: IRI
severity: Warning
message: clinical:linkedCondition should reference a clinical:Condition by IRI
name: Linked Condition Edge

ParsedIndicationReferenceEdgeShape
type: PropertyShape
target subjects of: parsedIndicationReference
path: parsedIndicationReference
node kind: IRI
severity: Warning
message: clinical:parsedIndicationReference should reference the matched reason record (a Condition or Observation) by IRI
name: Parsed Indication Reference Edge