{
  "resourceType": "StructureDefinition",
  "id": "rdc-Observation-Report",
  "url": "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation-Report",
  "version": "1.0.0",
  "name": "RdcObservationReport",
  "title": "RDC Observation Report",
  "publisher": "F. Hoffmann-La Roche AG",
  "description": "A profile designed to capture Additional values from Observations as means, standard deviations, coefficients, percentages etc. for reporting.",
  "copyright": "Copyright and related rights waived via CC0, https://creativecommons.org/publicdomain/zero/1.0/. This does not apply to information from third parties, for example a medical terminology system. The implementer alone is responsible for identifying and obtaining any necessary licenses or authorizations to utilize third party IP in connection with the specification or otherwise.",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "status": "active",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "https://roche.com/fhir/iop/StructureDefinition/rdc-Observation-Additional",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "constraint": [
          {
            "key": "glucose-unit-rule",
            "human": "Glucose unit rule for Report Observation Values",
            "source": "http://example.org/StructureDefinition/rdc-Observation-Report",
            "severity": "error",
            "expression": "(code = '97507-8' or code = 'R4615-4' or code = 'R7533-3') implies (valueQuantity.code = 'mg/dL' or valueQuantity.code = 'mmol/L')"
          },
          {
            "key": "percentage-unit-rule",
            "human": "Percentage unit rule for Report Observation Values",
            "source": "http://example.org/StructureDefinition/rdc-Observation-Report",
            "severity": "error",
            "expression": "(code = '97504-5' or code = '97506-0' or code = '104639-0' or code = '104640-8' or code = '97510-2' or code = '104641-6' or code = '104642-4' or code = 'R9599-2' or code = 'R4686-2' or code = 'R6599-5' or code = 'R4843-9' or code = 'R7925-1' or code = 'R5422-1' or code = 'R7572-1') implies (valueQuantity.code = '%')"
          },
          {
            "key": "count-unit-rule",
            "human": "Count unit rule for Report Observation Values",
            "source": "http://example.org/StructureDefinition/rdc-Observation-Report",
            "severity": "error",
            "expression": "(code = 'R7534-3') implies (valueQuantity.code = '{count}')"
          },
          {
            "key": "count-per-day-unit-rule",
            "human": "Count per day unit rule for Report Observation Values",
            "source": "http://example.org/StructureDefinition/rdc-Observation-Report",
            "severity": "error",
            "expression": "(code = 'R4614-4') implies (valueQuantity.code = '{count}/d')"
          }
        ]
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "binding": {
          "strength": "required",
          "valueSet": "https://roche.com/fhir/iop/ValueSet/report-observation-codes"
        }
      },
      {
        "id": "Observation.device",
        "path": "Observation.device",
        "max": "0"
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "max": "0"
      }
    ]
  }
}