{
  "resourceType": "StructureDefinition",
  "id": "biobankcy-sd-visit",
  "url": "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-visit",
  "name": "BIOBANKCYSDVisit",
  "title": "Profile: Visit (biobank.cy)",
  "status": "draft",
  "publisher": "biobank.cy",
  "contact": [
    {
      "name": "Molecular Medicine Research Center (MMRC)",
      "telecom": [
        {
          "system": "email",
          "value": "biobank@ucy.ac.cy",
          "use": "work"
        }
      ]
    }
  ],
  "description": "Represents the visit between a patient (donor or citizen) and a practitioner of the biobank.cy (nurse or researcher). The input of a new entry or the update of an existing entry in the biobank.cy Data Warehouse shall be done only in the context of a visit. Therefore, all the data of a patient resource in the data warehosue shall reference a specific visit in which they were first created or updated.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Encounter",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Encounter",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Encounter.identifier",
        "path": "Encounter.identifier",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Encounter.identifier.type",
        "path": "Encounter.identifier.type",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ],
        "patternCodeableConcept": {
          "coding": [
            {
              "system": "http://terminology.hl7.org/CodeSystem/v2-0203",
              "code": "VN",
              "display": "Visit number"
            }
          ]
        }
      },
      {
        "id": "Encounter.identifier.type.coding.system",
        "path": "Encounter.identifier.type.coding.system",
        "min": 1
      },
      {
        "id": "Encounter.identifier.type.coding.code",
        "path": "Encounter.identifier.type.coding.code",
        "min": 1
      },
      {
        "id": "Encounter.identifier.type.coding.display",
        "path": "Encounter.identifier.type.coding.display",
        "min": 1
      },
      {
        "id": "Encounter.identifier.value",
        "path": "Encounter.identifier.value",
        "min": 1
      },
      {
        "id": "Encounter.status",
        "path": "Encounter.status",
        "comment": "Note that internal business rules will determine the appropriate transitions that may occur between statuses (and also classes).\r\n\r\n biobank.cy: Use only | finished |",
        "fixedCode": "finished"
      },
      {
        "id": "Encounter.statusHistory",
        "path": "Encounter.statusHistory",
        "comment": "The current status is always found in the current version of the resource, not the status history.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.class",
        "path": "Encounter.class",
        "patternCoding": {
          "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
          "code": "AMB"
        }
      },
      {
        "id": "Encounter.class.system",
        "path": "Encounter.class.system",
        "min": 1
      },
      {
        "id": "Encounter.class.code",
        "path": "Encounter.class.code",
        "min": 1
      },
      {
        "id": "Encounter.class.display",
        "path": "Encounter.class.display",
        "min": 1
      },
      {
        "id": "Encounter.classHistory",
        "path": "Encounter.classHistory",
        "comment": "Not to be used for biobank.cy"
      },
      {
        "id": "Encounter.type",
        "path": "Encounter.type",
        "comment": "Since there are many ways to further classify encounters, this element is 0..*.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.serviceType",
        "path": "Encounter.serviceType",
        "comment": "Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.priority",
        "path": "Encounter.priority",
        "comment": "Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.subject",
        "path": "Encounter.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/Group",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-donor",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-citizen"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Encounter.subject.reference",
        "path": "Encounter.subject.reference",
        "min": 1
      },
      {
        "id": "Encounter.subject.identifier.type",
        "path": "Encounter.subject.identifier.type",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ]
      },
      {
        "id": "Encounter.subject.identifier.type.coding.system",
        "path": "Encounter.subject.identifier.type.coding.system",
        "min": 1
      },
      {
        "id": "Encounter.subject.identifier.type.coding.code",
        "path": "Encounter.subject.identifier.type.coding.code",
        "min": 1
      },
      {
        "id": "Encounter.subject.identifier.type.coding.display",
        "path": "Encounter.subject.identifier.type.coding.display",
        "min": 1
      },
      {
        "id": "Encounter.episodeOfCare",
        "path": "Encounter.episodeOfCare",
        "comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.basedOn",
        "path": "Encounter.basedOn",
        "comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.\r\n\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.participant",
        "path": "Encounter.participant",
        "comment": "biobank.cy: Use individual element --> practitioner role (see comment on individual element).",
        "mustSupport": true
      },
      {
        "id": "Encounter.participant.type",
        "path": "Encounter.participant.type",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ]
      },
      {
        "id": "Encounter.participant.type.coding.system",
        "path": "Encounter.participant.type.coding.system",
        "min": 1
      },
      {
        "id": "Encounter.participant.type.coding.code",
        "path": "Encounter.participant.type.coding.code",
        "min": 1
      },
      {
        "id": "Encounter.participant.type.coding.display",
        "path": "Encounter.participant.type.coding.display",
        "min": 1
      },
      {
        "id": "Encounter.participant.individual",
        "path": "Encounter.participant.individual",
        "comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.\r\n\r\n\r\nbiobank.cy use \"primary performer\".",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-practitioner"
            ]
          }
        ]
      },
      {
        "id": "Encounter.participant.individual.reference",
        "path": "Encounter.participant.individual.reference",
        "min": 1
      },
      {
        "id": "Encounter.participant.individual.identifier.type",
        "path": "Encounter.participant.individual.identifier.type",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ]
      },
      {
        "id": "Encounter.participant.individual.identifier.type.coding.system",
        "path": "Encounter.participant.individual.identifier.type.coding.system",
        "min": 1
      },
      {
        "id": "Encounter.participant.individual.identifier.type.coding.code",
        "path": "Encounter.participant.individual.identifier.type.coding.code",
        "min": 1
      },
      {
        "id": "Encounter.participant.individual.identifier.type.coding.display",
        "path": "Encounter.participant.individual.identifier.type.coding.display",
        "min": 1
      },
      {
        "id": "Encounter.appointment",
        "path": "Encounter.appointment",
        "comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.\r\n\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.period",
        "path": "Encounter.period",
        "mustSupport": true
      },
      {
        "id": "Encounter.length",
        "path": "Encounter.length",
        "comment": "May differ from the time the Encounter.period lasted because of leave of absence.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.reasonCode",
        "path": "Encounter.reasonCode",
        "comment": "For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis).\r\n\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.reasonReference",
        "path": "Encounter.reasonReference",
        "comment": "For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis).\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.diagnosis",
        "path": "Encounter.diagnosis",
        "comment": "Not to be used for biobank.cy"
      },
      {
        "id": "Encounter.diagnosis.rank",
        "path": "Encounter.diagnosis.rank",
        "comment": "32 bit number; for values larger than this, use decimal\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.account",
        "path": "Encounter.account",
        "comment": "The billing system may choose to allocate billable items associated with the Encounter to different referenced Accounts based on internal business rules.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.hospitalization",
        "path": "Encounter.hospitalization",
        "comment": "An Encounter may cover more than just the inpatient stay. Contexts such as outpatients, community clinics, and aged care facilities are also included.\r\rThe duration recorded in the period of this encounter covers the entire scope of this hospitalization record.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.location",
        "path": "Encounter.location",
        "mustSupport": true
      },
      {
        "id": "Encounter.location.location",
        "path": "Encounter.location.location",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Location",
              "http://ig.biobank.cy/fhir/StructureDefinition/biobankcy-sd-location"
            ]
          }
        ]
      },
      {
        "id": "Encounter.location.location.reference",
        "path": "Encounter.location.location.reference",
        "min": 1
      },
      {
        "id": "Encounter.location.location.identifier.type",
        "path": "Encounter.location.location.identifier.type",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "http://hl7.org/fhir/uv/ips/StructureDefinition/CodeableConcept-uv-ips"
            ]
          }
        ]
      },
      {
        "id": "Encounter.location.location.identifier.type.coding.system",
        "path": "Encounter.location.location.identifier.type.coding.system",
        "min": 1
      },
      {
        "id": "Encounter.location.location.identifier.type.coding.code",
        "path": "Encounter.location.location.identifier.type.coding.code",
        "min": 1
      },
      {
        "id": "Encounter.location.location.identifier.type.coding.display",
        "path": "Encounter.location.location.identifier.type.coding.display",
        "min": 1
      },
      {
        "id": "Encounter.location.status",
        "path": "Encounter.location.status",
        "comment": "When the patient is no longer active at a location, then the period end date is entered, and the status may be changed to completed.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.location.physicalType",
        "path": "Encounter.location.physicalType",
        "comment": "This information is de-normalized from the Location resource to support the easier understanding of the encounter resource and processing in messaging or query.\n\nThere may be many levels in the hierachy, and this may only pic specific levels that are required for a specific usage scenario.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.location.period",
        "path": "Encounter.location.period",
        "comment": "A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. \"the patient was an inpatient of the hospital for this time range\") or one value from the range applies (e.g. \"give to the patient between these two times\").\n\nPeriod is not used for a duration (a measure of elapsed time). See [Duration](datatypes.html#Duration).\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.serviceProvider",
        "path": "Encounter.serviceProvider",
        "comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.\r\n\r\nNot to be used for biobank.cy"
      },
      {
        "id": "Encounter.partOf",
        "path": "Encounter.partOf",
        "comment": "This is also used for associating a child's encounter back to the mother's encounter.\r\rRefer to the Notes section in the Patient resource for further details.\r\n\r\nNot to be used for biobank.cy"
      }
    ]
  }
}