{
  "resourceType": "StructureDefinition",
  "meta": {
    "lastUpdated": "2018-03-06T09:17:53.911+00:00"
  },
  "url": "http://trilliumbridge.eu/fhir/StructureDefinition/observation-laboratory-uv-trillium2",
  "version": "0.1",
  "name": "Observation-laboratory-uv-trillium2",
  "status": "draft",
  "experimental": true,
  "date": "2018-02-09T21:39:56.838+00:00",
  "publisher": "Trillium II",
  "contact": [
    {
      "name": "François Macary - Phast"
    }
  ],
  "description": "This profile constrains the Observation resource to represent laboratory results in a patient summary",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation.extension",
        "path": "Observation.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Observation.extension:specialty",
        "path": "Observation.extension",
        "sliceName": "specialty",
        "short": "Optional Extensions Element",
        "definition": "Optional Extension Element - found in all resources.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://trilliumbridge.eu/fhir/StructureDefinition/observation-specialty-uv-trillium2"
          }
        ],
        "binding": {
          "strength": "extensible",
          "valueSetUri": "http://trilliumbridge.eu/fhir/ValueSet/laboratory-specialty"
        }
      },
      {
        "id": "Observation.basedOn",
        "path": "Observation.basedOn",
        "max": "0"
      },
      {
        "id": "Observation.status",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint",
            "valueString": "default: final"
          }
        ],
        "path": "Observation.status",
        "fixedCode": "final"
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Observation.category.coding.code",
        "path": "Observation.category.coding.code",
        "fixedCode": "laboratory"
      },
      {
        "id": "Observation.code",
        "path": "Observation.code",
        "definition": "Describes what was observed. Sometimes this is called the observation \"name\".",
        "comment": "In the context of this observation-laboratory-uv-trillium2 profile, when the observation plays the role of a grouper of member sub-observations, the code represent the group (for instance a panel code). In case no code is available, at least a text shall be provided.",
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "ObservationCode"
            }
          ],
          "strength": "extensible",
          "valueSetUri": "http://trilliumbridge.eu/fhir/ValueSet/laboratory-tests-and-panels"
        }
      },
      {
        "id": "Observation.code.coding",
        "path": "Observation.code.coding",
        "binding": {
          "strength": "extensible",
          "valueSetUri": "http://trilliumbridge.eu/fhir/ValueSet/laboratory-tests-and-panels"
        }
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Observation.effective[x]",
        "path": "Observation.effective[x]",
        "min": 1
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Practitioner",
            "aggregation": [
              "referenced"
            ]
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient",
            "aggregation": [
              "referenced"
            ]
          },
          {
            "code": "Reference",
            "targetProfile": "http://trilliumbridge.eu/fhir/StructureDefinition/organization-laboratory-uv-trillium2",
            "aggregation": [
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "type": [
          {
            "code": "Quantity"
          },
          {
            "code": "CodeableConcept"
          },
          {
            "code": "string"
          },
          {
            "code": "Range"
          },
          {
            "code": "Ratio"
          },
          {
            "code": "time"
          },
          {
            "code": "dateTime"
          },
          {
            "code": "Period"
          }
        ],
        "condition": [
          "value"
        ],
        "constraint": [
          {
            "key": "val-1",
            "severity": "error",
            "human": "if no \"related\" element is present then Observation must have a\" value\"",
            "expression": "hasValue() or related.exists"
          }
        ]
      },
      {
        "id": "Observation.dataAbsentReason",
        "path": "Observation.dataAbsentReason",
        "max": "0"
      },
      {
        "id": "Observation.bodySite",
        "path": "Observation.bodySite",
        "max": "0"
      },
      {
        "id": "Observation.specimen",
        "path": "Observation.specimen",
        "comment": "The specimen is often implied by the observation code. \r\nIn the context of this observation-laboratory-uv-trillium2 profile, specimen should be provided only when it is not implied by the Observation.code",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://trilliumbridge.eu/fhir/StructureDefinition/specimen-uv-trillium2"
          }
        ]
      },
      {
        "id": "Observation.device",
        "path": "Observation.device",
        "max": "0"
      },
      {
        "id": "Observation.referenceRange.type",
        "path": "Observation.referenceRange.type",
        "min": 1
      },
      {
        "id": "Observation.referenceRange.appliesTo",
        "path": "Observation.referenceRange.appliesTo",
        "max": "0"
      },
      {
        "id": "Observation.referenceRange.age",
        "path": "Observation.referenceRange.age",
        "max": "0"
      },
      {
        "id": "Observation.related",
        "path": "Observation.related",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type"
            }
          ],
          "rules": "open"
        },
        "definition": "A  reference to another Observation profiled by observation-member-laboratory-uv-trillium2. The target observation is considered as a sub-observation of the current one, which plays the role of a grouper",
        "comment": "This element is used in the context of Trillium II international patient summary when there is a need to group a collection of observations, because they belong to the same panel, or because they share a common interpretation comment, or a common media attachment (illustrative image or graph). In these cases, the current observation profiled as observation-laboratory-uv-trillium2 is the grouper, and its set of sub-observations are related observations  using the type \"has-member\" and the profile observation-member-laboratory-uv-trillium2."
      },
      {
        "id": "Observation.related.type",
        "path": "Observation.related.type",
        "short": "has-member: the related observation is a sub-observation of the current one, which acts as a grouper",
        "definition": "A code specifying the kind of relationship that exists with the target resource.\r\nThe only authorized value in this profile is \"has-member\"",
        "comment": "",
        "requirements": "",
        "min": 1,
        "fixedCode": "has-member"
      },
      {
        "id": "Observation.related:sub-observation",
        "path": "Observation.related",
        "sliceName": "sub-observation",
        "short": "sub-observation member of this observation",
        "definition": "A  reference to an Observation resource playing the role of sub-observation of the current one. For instance an individial test member of a panel."
      },
      {
        "id": "Observation.related:sub-observation.type",
        "path": "Observation.related.type",
        "fixedCode": "has-member"
      },
      {
        "id": "Observation.related:sub-observation.target",
        "path": "Observation.related.target",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://trilliumbridge.eu/fhir/StructureDefinition/observation-member-laboratory-uv-trillium2"
          }
        ]
      },
      {
        "id": "Observation.related:attachment",
        "path": "Observation.related",
        "sliceName": "attachment",
        "short": "attachment associated to this observation",
        "definition": "A  reference to another Observation, which is constrained to valueAttachment, in order to convey an illustrative media content."
      },
      {
        "id": "Observation.related:attachment.type",
        "path": "Observation.related.type",
        "fixedCode": "derived-from"
      },
      {
        "id": "Observation.related:attachment.target",
        "path": "Observation.related.target",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://trilliumbridge.eu/fhir/StructureDefinition/observation-attachment-uv-trillium2"
          }
        ]
      },
      {
        "id": "Observation.related:otherRelated",
        "path": "Observation.related",
        "sliceName": "otherRelated"
      },
      {
        "id": "Observation.component",
        "path": "Observation.component",
        "max": "0"
      }
    ]
  }
}