{
  "resourceType": "StructureDefinition",
  "url": "https://medico-emr.net/medico/r4/sd/DiagnosticReport_LabReport_1",
  "name": "DiagnosticReport_LabReport_1",
  "status": "active",
  "description": "represents a diagnostic report containing ward lab results or central lab results",
  "fhirVersion": "4.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "DiagnosticReport",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DiagnosticReport",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "DiagnosticReport.id",
        "path": "DiagnosticReport.id",
        "definition": "if a Central Lab: DiagnosticReport.CL-######\r\nif a ward lab: DiagnosticReport.WL-#####",
        "min": 1
      },
      {
        "id": "DiagnosticReport.meta",
        "path": "DiagnosticReport.meta",
        "min": 1
      },
      {
        "id": "DiagnosticReport.meta.id",
        "path": "DiagnosticReport.meta.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.meta.versionId",
        "path": "DiagnosticReport.meta.versionId",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.meta.lastUpdated",
        "path": "DiagnosticReport.meta.lastUpdated",
        "min": 1
      },
      {
        "id": "DiagnosticReport.meta.source",
        "path": "DiagnosticReport.meta.source",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.meta.profile",
        "path": "DiagnosticReport.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://medico-emr.net/medico/r4/sd/DiagnosticReport_LabReport_1"
      },
      {
        "id": "DiagnosticReport.meta.security",
        "path": "DiagnosticReport.meta.security",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.meta.tag",
        "path": "DiagnosticReport.meta.tag",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.implicitRules",
        "path": "DiagnosticReport.implicitRules",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.language",
        "path": "DiagnosticReport.language",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.text",
        "path": "DiagnosticReport.text",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.contained",
        "path": "DiagnosticReport.contained",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.identifier",
        "path": "DiagnosticReport.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "max": "1"
      },
      {
        "id": "DiagnosticReport.identifier:medicoResourceId-CentralLab",
        "path": "DiagnosticReport.identifier",
        "sliceName": "medicoResourceId-CentralLab",
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Identifier_medicoResourceId_1"
            ]
          }
        ]
      },
      {
        "id": "DiagnosticReport.identifier:medicoResourceId-CentralLab.system",
        "path": "DiagnosticReport.identifier.system",
        "definition": "Must be a constant underneath https://medico-emr.net/medico/%KUNDE%/sid1/\r\nwith one of the following identifiers\r\nDiagnosticReport.CL - if from central lab",
        "comment": "Dynamically resolved for validation\r\n--FixedValue=https://medico-emr.net/medico/%KUNDE%/sid1/DiagnosticReport.CL"
      },
      {
        "id": "DiagnosticReport.identifier:medicoResourceId-WardLab",
        "path": "DiagnosticReport.identifier",
        "sliceName": "medicoResourceId-WardLab",
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Identifier_medicoResourceId_1"
            ]
          }
        ]
      },
      {
        "id": "DiagnosticReport.identifier:medicoResourceId-WardLab.system",
        "path": "DiagnosticReport.identifier.system",
        "comment": "Dynamically resolved for validation\r\n--FixedValue=https://medico-emr.net/medico/%KUNDE%/sid1/DiagnosticReport.WL"
      },
      {
        "id": "DiagnosticReport.basedOn",
        "path": "DiagnosticReport.basedOn",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.status",
        "path": "DiagnosticReport.status",
        "short": "partial",
        "definition": "There is no status available in medico, so we'll send always partial.",
        "fixedCode": "partial"
      },
      {
        "id": "DiagnosticReport.category",
        "path": "DiagnosticReport.category",
        "min": 1
      },
      {
        "id": "DiagnosticReport.category.id",
        "path": "DiagnosticReport.category.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.category.coding",
        "path": "DiagnosticReport.category.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "DiagnosticReport.category.coding.id",
        "path": "DiagnosticReport.category.coding.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.category.coding.system",
        "path": "DiagnosticReport.category.coding.system",
        "min": 1,
        "fixedUri": "http://hl7.org/fhir/ValueSet/observation-category"
      },
      {
        "id": "DiagnosticReport.category.coding.version",
        "path": "DiagnosticReport.category.coding.version",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.category.coding.code",
        "path": "DiagnosticReport.category.coding.code",
        "min": 1,
        "fixedCode": "laboratory"
      },
      {
        "id": "DiagnosticReport.category.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "DiagnosticReport.category.coding.display",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.category.coding.userSelected",
        "path": "DiagnosticReport.category.coding.userSelected",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.category.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "DiagnosticReport.category.text",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code",
        "path": "DiagnosticReport.code",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.code"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "DiagnosticReport.code:WardLabReport",
        "path": "DiagnosticReport.code",
        "sliceName": "WardLabReport"
      },
      {
        "id": "DiagnosticReport.code:WardLabReport.id",
        "path": "DiagnosticReport.code.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:WardLabReport.coding",
        "path": "DiagnosticReport.code.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "DiagnosticReport.code:WardLabReport.coding.id",
        "path": "DiagnosticReport.code.coding.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:WardLabReport.coding.system",
        "path": "DiagnosticReport.code.coding.system",
        "min": 1,
        "fixedUri": "https://medico-emr.net/medico/cs/cs1"
      },
      {
        "id": "DiagnosticReport.code:WardLabReport.coding.version",
        "path": "DiagnosticReport.code.coding.version",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:WardLabReport.coding.code",
        "path": "DiagnosticReport.code.coding.code",
        "min": 1,
        "fixedCode": "WardLabReport-1"
      },
      {
        "id": "DiagnosticReport.code:WardLabReport.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "DiagnosticReport.code.coding.display",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:WardLabReport.coding.userSelected",
        "path": "DiagnosticReport.code.coding.userSelected",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:WardLabReport.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "DiagnosticReport.code.text",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport",
        "path": "DiagnosticReport.code",
        "sliceName": "CentralLabReport"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport.id",
        "path": "DiagnosticReport.code.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport.coding",
        "path": "DiagnosticReport.code.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport.coding.id",
        "path": "DiagnosticReport.code.coding.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport.coding.system",
        "path": "DiagnosticReport.code.coding.system",
        "min": 1,
        "fixedUri": "https://medico-emr.net/medico/cs/cs1"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport.coding.version",
        "path": "DiagnosticReport.code.coding.version",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport.coding.code",
        "path": "DiagnosticReport.code.coding.code",
        "min": 1,
        "fixedCode": "CentralLabReport-1"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "DiagnosticReport.code.coding.display",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport.coding.userSelected",
        "path": "DiagnosticReport.code.coding.userSelected",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.code:CentralLabReport.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "DiagnosticReport.code.text",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.subject",
        "path": "DiagnosticReport.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Reference_SubjectPatient_1"
            ],
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Patient_Patient_1"
            ]
          }
        ]
      },
      {
        "id": "DiagnosticReport.encounter",
        "path": "DiagnosticReport.encounter",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Reference_ContextEncounter_1"
            ],
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Encounter_Case_1"
            ]
          }
        ]
      },
      {
        "id": "DiagnosticReport.effective[x]",
        "path": "DiagnosticReport.effective[x]",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.issued",
        "path": "DiagnosticReport.issued",
        "definition": "The date and time that this version of the report was released from the source diagnostic service. chd/crd from medico source table is used.",
        "min": 1
      },
      {
        "id": "DiagnosticReport.performer",
        "path": "DiagnosticReport.performer",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Practitioner_User_1"
            ]
          }
        ]
      },
      {
        "id": "DiagnosticReport.performer.reference",
        "path": "DiagnosticReport.performer.reference",
        "min": 1
      },
      {
        "id": "DiagnosticReport.performer.type",
        "path": "DiagnosticReport.performer.type",
        "min": 1,
        "fixedUri": "Practitioner"
      },
      {
        "id": "DiagnosticReport.performer.identifier",
        "path": "DiagnosticReport.performer.identifier",
        "min": 1
      },
      {
        "id": "DiagnosticReport.performer.identifier.id",
        "path": "DiagnosticReport.performer.identifier.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.performer.identifier.use",
        "path": "DiagnosticReport.performer.identifier.use",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.performer.identifier.type",
        "path": "DiagnosticReport.performer.identifier.type",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.performer.identifier.system",
        "path": "DiagnosticReport.performer.identifier.system",
        "min": 1
      },
      {
        "id": "DiagnosticReport.performer.identifier.value",
        "path": "DiagnosticReport.performer.identifier.value",
        "min": 1
      },
      {
        "id": "DiagnosticReport.performer.identifier.period",
        "path": "DiagnosticReport.performer.identifier.period",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.performer.identifier.assigner",
        "path": "DiagnosticReport.performer.identifier.assigner",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.performer.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "DiagnosticReport.performer.display",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.resultsInterpreter",
        "path": "DiagnosticReport.resultsInterpreter",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.specimen",
        "path": "DiagnosticReport.specimen",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.result",
        "path": "DiagnosticReport.result",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://medico-emr.net/medico/r4/sd/Observation_CentralLab_1",
              "https://medico-emr.net/medico/r4/sd/Observation_WardLab_1"
            ]
          }
        ]
      },
      {
        "id": "DiagnosticReport.result.id",
        "path": "DiagnosticReport.result.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.result.reference",
        "path": "DiagnosticReport.result.reference",
        "min": 1
      },
      {
        "id": "DiagnosticReport.result.type",
        "path": "DiagnosticReport.result.type",
        "min": 1,
        "type": [
          {
            "code": "uri",
            "profile": [
              "https://medico-emr.net/medico/r4/sd/Observation_WardLab_1",
              "https://medico-emr.net/medico/r4/sd/Observation_CentralLab_1"
            ]
          }
        ]
      },
      {
        "id": "DiagnosticReport.result.type.id",
        "path": "DiagnosticReport.result.type.id",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.result.identifier",
        "path": "DiagnosticReport.result.identifier",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.result.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "DiagnosticReport.result.display",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.imagingStudy",
        "path": "DiagnosticReport.imagingStudy",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.media",
        "path": "DiagnosticReport.media",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.conclusion",
        "path": "DiagnosticReport.conclusion",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.conclusionCode",
        "path": "DiagnosticReport.conclusionCode",
        "max": "0"
      },
      {
        "id": "DiagnosticReport.presentedForm",
        "path": "DiagnosticReport.presentedForm",
        "max": "0"
      }
    ]
  }
}