{
  "resourceType": "StructureDefinition",
  "id": "1.3.6.1.4.1.38760.FHIR.1.5.1.1",
  "url": "https://lab.vvis.gov.lv/fhir/StructureDefinition/Specimen/LaboratorySpecimenCollection-v1",
  "version": "1",
  "name": "LaboratorySpecimenCollection",
  "title": "Laboratory Specimen Collection",
  "status": "draft",
  "publisher": "NHS",
  "copyright": "@NHS Latvia",
  "fhirVersion": "4.3.0",
  "kind": "resource",
  "abstract": false,
  "type": "Specimen",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Specimen",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Specimen.meta",
        "path": "Specimen.meta",
        "type": [
          {
            "code": "Meta",
            "profile": [
              "https://vvis.gov.lv/fhir/Datatype/Meta/MedicalMeta-v1"
            ]
          }
        ]
      },
      {
        "id": "Specimen.meta.tag",
        "path": "Specimen.meta.tag"
      },
      {
        "id": "Specimen.meta.tag:authorMedicalInstitution",
        "path": "Specimen.meta.tag",
        "sliceName": "authorMedicalInstitution",
        "min": 1
      },
      {
        "id": "Specimen.meta.tag:entererPersonId",
        "path": "Specimen.meta.tag",
        "sliceName": "entererPersonId",
        "max": "0"
      },
      {
        "id": "Specimen.meta.tag:entererSystem",
        "path": "Specimen.meta.tag",
        "sliceName": "entererSystem",
        "min": 1
      },
      {
        "id": "Specimen.implicitRules",
        "path": "Specimen.implicitRules",
        "max": "0"
      },
      {
        "id": "Specimen.language",
        "path": "Specimen.language",
        "max": "0"
      },
      {
        "id": "Specimen.text",
        "path": "Specimen.text",
        "max": "0"
      },
      {
        "id": "Specimen.contained",
        "path": "Specimen.contained",
        "max": "0"
      },
      {
        "id": "Specimen.extension",
        "path": "Specimen.extension",
        "min": 1
      },
      {
        "id": "Specimen.extension:typeOfSpieces",
        "path": "Specimen.extension",
        "sliceName": "typeOfSpieces",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://lab.vvis.gov.lv/fhir/StructureDefinition/Extension/TypeOfSpieces-v1"
            ]
          }
        ]
      },
      {
        "id": "Specimen.extension:typeOfSpieces.id",
        "path": "Specimen.extension.id",
        "max": "0"
      },
      {
        "id": "Specimen.extension:typeOfSpieces.value[x].id",
        "path": "Specimen.extension.value[x].id",
        "max": "0"
      },
      {
        "id": "Specimen.extension:typeOfSpieces.value[x].coding.id",
        "path": "Specimen.extension.value[x].coding.id",
        "max": "0"
      },
      {
        "id": "Specimen.extension:typeOfSpieces.value[x].text",
        "path": "Specimen.extension.value[x].text",
        "max": "0"
      },
      {
        "id": "Specimen.extension:morphology",
        "path": "Specimen.extension",
        "sliceName": "morphology",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://lab.vvis.gov.lv/fhir/StructureDefinition/Extension/Morphology-v1"
            ]
          }
        ]
      },
      {
        "id": "Specimen.extension:statusReason",
        "path": "Specimen.extension",
        "sliceName": "statusReason",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://lab.vvis.gov.lv/fhir/StructureDefinition/Extention/StatusReason-v1"
            ]
          }
        ]
      },
      {
        "id": "Specimen.identifier",
        "path": "Specimen.identifier",
        "definition": "Id for specimen. Id assigned by the specimen collector.",
        "max": "1"
      },
      {
        "id": "Specimen.identifier.use",
        "path": "Specimen.identifier.use",
        "max": "0"
      },
      {
        "id": "Specimen.identifier.type",
        "path": "Specimen.identifier.type",
        "max": "0"
      },
      {
        "id": "Specimen.identifier.system",
        "path": "Specimen.identifier.system",
        "max": "0"
      },
      {
        "id": "Specimen.identifier.value",
        "path": "Specimen.identifier.value",
        "min": 1
      },
      {
        "id": "Specimen.identifier.period",
        "path": "Specimen.identifier.period",
        "max": "0"
      },
      {
        "id": "Specimen.identifier.assigner",
        "path": "Specimen.identifier.assigner",
        "min": 1
      },
      {
        "id": "Specimen.identifier.assigner.id",
        "path": "Specimen.identifier.assigner.id",
        "max": "0"
      },
      {
        "id": "Specimen.identifier.assigner.type",
        "path": "Specimen.identifier.assigner.type",
        "min": 1,
        "fixedUri": "Organization"
      },
      {
        "id": "Specimen.identifier.assigner.identifier",
        "path": "Specimen.identifier.assigner.identifier",
        "max": "0"
      },
      {
        "id": "Specimen.accessionIdentifier.id",
        "path": "Specimen.accessionIdentifier.id",
        "max": "0"
      },
      {
        "id": "Specimen.accessionIdentifier.use",
        "path": "Specimen.accessionIdentifier.use",
        "max": "0"
      },
      {
        "id": "Specimen.accessionIdentifier.type",
        "path": "Specimen.accessionIdentifier.type",
        "max": "0"
      },
      {
        "id": "Specimen.accessionIdentifier.system",
        "path": "Specimen.accessionIdentifier.system",
        "max": "0"
      },
      {
        "id": "Specimen.accessionIdentifier.value",
        "path": "Specimen.accessionIdentifier.value",
        "min": 1
      },
      {
        "id": "Specimen.accessionIdentifier.period",
        "path": "Specimen.accessionIdentifier.period",
        "max": "0"
      },
      {
        "id": "Specimen.accessionIdentifier.assigner",
        "path": "Specimen.accessionIdentifier.assigner",
        "min": 1
      },
      {
        "id": "Specimen.accessionIdentifier.assigner.id",
        "path": "Specimen.accessionIdentifier.assigner.id",
        "max": "0"
      },
      {
        "id": "Specimen.accessionIdentifier.assigner.type",
        "path": "Specimen.accessionIdentifier.assigner.type",
        "min": 1,
        "fixedUri": "Organization"
      },
      {
        "id": "Specimen.accessionIdentifier.assigner.identifier",
        "path": "Specimen.accessionIdentifier.assigner.identifier",
        "max": "0"
      },
      {
        "id": "Specimen.accessionIdentifier.assigner.display",
        "path": "Specimen.accessionIdentifier.assigner.display",
        "definition": "Plain text narrative that identifies the resource in addition to the resource reference. Organization name is expected."
      },
      {
        "id": "Specimen.status",
        "path": "Specimen.status",
        "min": 1
      },
      {
        "id": "Specimen.type.coding",
        "path": "Specimen.type.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Specimen.type.coding.system",
        "path": "Specimen.type.coding.system",
        "min": 1,
        "fixedUri": "https://vvis.gov.lv/fhir/ValueSet/1.3.6.1.4.1.38760.2.809"
      },
      {
        "id": "Specimen.type.coding.version",
        "path": "Specimen.type.coding.version",
        "max": "0"
      },
      {
        "id": "Specimen.type.coding.code",
        "path": "Specimen.type.coding.code",
        "min": 1
      },
      {
        "id": "Specimen.type.coding.display",
        "path": "Specimen.type.coding.display",
        "min": 1
      },
      {
        "id": "Specimen.type.coding.userSelected",
        "path": "Specimen.type.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Specimen.subject",
        "path": "Specimen.subject",
        "min": 1
      },
      {
        "id": "Specimen.subject.type",
        "path": "Specimen.subject.type",
        "min": 1,
        "fixedUri": "Patient"
      },
      {
        "id": "Specimen.subject.identifier",
        "path": "Specimen.subject.identifier",
        "max": "0"
      },
      {
        "id": "Specimen.subject.display",
        "path": "Specimen.subject.display",
        "max": "0"
      },
      {
        "id": "Specimen.receivedTime",
        "path": "Specimen.receivedTime",
        "mustSupport": true
      },
      {
        "id": "Specimen.parent",
        "path": "Specimen.parent",
        "max": "0"
      },
      {
        "id": "Specimen.request",
        "path": "Specimen.request",
        "max": "0"
      },
      {
        "id": "Specimen.collection",
        "path": "Specimen.collection",
        "min": 1
      },
      {
        "id": "Specimen.collection.collector",
        "path": "Specimen.collection.collector",
        "min": 1
      },
      {
        "id": "Specimen.collection.collector.reference",
        "path": "Specimen.collection.collector.reference",
        "definition": "PractitionerRole SHALL be referenced when known. When unknow, Practitioner SHALL be referenced.",
        "min": 1
      },
      {
        "id": "Specimen.collection.collector.type",
        "path": "Specimen.collection.collector.type",
        "min": 1
      },
      {
        "id": "Specimen.collection.collector.identifier",
        "path": "Specimen.collection.collector.identifier",
        "max": "0"
      },
      {
        "id": "Specimen.collection.collector.display",
        "path": "Specimen.collection.collector.display",
        "max": "0"
      },
      {
        "id": "Specimen.collection.collected[x]",
        "path": "Specimen.collection.collected[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Specimen.collection.collected[x]:collectedDateTime",
        "path": "Specimen.collection.collected[x]",
        "sliceName": "collectedDateTime",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Specimen.collection.collected[x]:collectedDateTime.value",
        "path": "Specimen.collection.collected[x].value",
        "min": 1
      },
      {
        "id": "Specimen.collection.collected[x]:collectedPeriod",
        "path": "Specimen.collection.collected[x]",
        "sliceName": "collectedPeriod",
        "type": [
          {
            "code": "Period"
          }
        ]
      },
      {
        "id": "Specimen.collection.collected[x]:collectedPeriod.start",
        "path": "Specimen.collection.collected[x].start",
        "min": 1
      },
      {
        "id": "Specimen.collection.collected[x]:collectedPeriod.end",
        "path": "Specimen.collection.collected[x].end",
        "min": 1
      },
      {
        "id": "Specimen.collection.duration.value",
        "path": "Specimen.collection.duration.value",
        "min": 1
      },
      {
        "id": "Specimen.collection.duration.unit",
        "path": "Specimen.collection.duration.unit",
        "min": 1
      },
      {
        "id": "Specimen.collection.duration.system",
        "path": "Specimen.collection.duration.system",
        "fixedUri": "http://unitsofmeasure.org"
      },
      {
        "id": "Specimen.collection.duration.code",
        "path": "Specimen.collection.duration.code",
        "definition": "UCUM time codes SHALL be used.",
        "min": 1,
        "binding": {
          "strength": "required",
          "description": "UCUM units",
          "valueSet": "https://vvis.gov.lv/fhir/ValueSet/1.3.6.1.4.1.38760.2.803"
        }
      },
      {
        "id": "Specimen.collection.quantity.value",
        "path": "Specimen.collection.quantity.value",
        "min": 1
      },
      {
        "id": "Specimen.collection.quantity.unit",
        "path": "Specimen.collection.quantity.unit",
        "min": 1
      },
      {
        "id": "Specimen.collection.quantity.system",
        "path": "Specimen.collection.quantity.system",
        "min": 1,
        "fixedUri": "http://unitsofmeasure.org"
      },
      {
        "id": "Specimen.collection.quantity.code",
        "path": "Specimen.collection.quantity.code",
        "min": 1
      },
      {
        "id": "Specimen.collection.method.coding",
        "path": "Specimen.collection.method.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Specimen.collection.method.coding.system",
        "path": "Specimen.collection.method.coding.system",
        "min": 1,
        "fixedUri": "https://vvis.gov.lv/fhir/ValueSet/1.3.6.1.4.1.38760.2.811"
      },
      {
        "id": "Specimen.collection.method.coding.version",
        "path": "Specimen.collection.method.coding.version",
        "max": "0"
      },
      {
        "id": "Specimen.collection.method.coding.code",
        "path": "Specimen.collection.method.coding.code",
        "min": 1
      },
      {
        "id": "Specimen.collection.method.coding.display",
        "path": "Specimen.collection.method.coding.display",
        "min": 1
      },
      {
        "id": "Specimen.collection.method.coding.userSelected",
        "path": "Specimen.collection.method.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Specimen.collection.bodySite.coding",
        "path": "Specimen.collection.bodySite.coding",
        "max": "0"
      },
      {
        "id": "Specimen.collection.fastingStatus[x]",
        "path": "Specimen.collection.fastingStatus[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "closed"
        }
      },
      {
        "id": "Specimen.collection.fastingStatus[x]:fastingStatusCodeableConcept",
        "path": "Specimen.collection.fastingStatus[x]",
        "sliceName": "fastingStatusCodeableConcept",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "Specimen.collection.fastingStatus[x]:fastingStatusCodeableConcept.coding",
        "path": "Specimen.collection.fastingStatus[x].coding",
        "max": "0"
      },
      {
        "id": "Specimen.processing.procedure",
        "path": "Specimen.processing.procedure",
        "min": 1
      },
      {
        "id": "Specimen.processing.procedure.coding",
        "path": "Specimen.processing.procedure.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Specimen.processing.procedure.coding.system",
        "path": "Specimen.processing.procedure.coding.system",
        "min": 1,
        "fixedUri": "https://vvis.gov.lv/fhir/ValueSet/1.3.6.1.4.1.38760.2.811"
      },
      {
        "id": "Specimen.processing.procedure.coding.version",
        "path": "Specimen.processing.procedure.coding.version",
        "max": "0"
      },
      {
        "id": "Specimen.processing.procedure.coding.code",
        "path": "Specimen.processing.procedure.coding.code",
        "min": 1
      },
      {
        "id": "Specimen.processing.procedure.coding.display",
        "path": "Specimen.processing.procedure.coding.display",
        "min": 1
      },
      {
        "id": "Specimen.processing.procedure.coding.userSelected",
        "path": "Specimen.processing.procedure.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Specimen.condition",
        "path": "Specimen.condition",
        "max": "1"
      },
      {
        "id": "Specimen.condition.coding",
        "path": "Specimen.condition.coding",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Specimen.condition.coding.system",
        "path": "Specimen.condition.coding.system",
        "min": 1,
        "fixedUri": "https://vvis.gov.lv/fhir/ValueSet/1.3.6.1.4.1.38760.2.812"
      },
      {
        "id": "Specimen.condition.coding.version",
        "path": "Specimen.condition.coding.version",
        "max": "0"
      },
      {
        "id": "Specimen.condition.coding.code",
        "path": "Specimen.condition.coding.code",
        "min": 1
      },
      {
        "id": "Specimen.condition.coding.display",
        "path": "Specimen.condition.coding.display",
        "min": 1
      },
      {
        "id": "Specimen.condition.coding.userSelected",
        "path": "Specimen.condition.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Specimen.note.author[x]",
        "path": "Specimen.note.author[x]",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ]
      },
      {
        "id": "Specimen.note.author[x].id",
        "path": "Specimen.note.author[x].id",
        "max": "0"
      },
      {
        "id": "Specimen.note.author[x].reference",
        "path": "Specimen.note.author[x].reference",
        "definition": "Reference to PractitionerRole SHOULD be provided.",
        "min": 1
      },
      {
        "id": "Specimen.note.author[x].type",
        "path": "Specimen.note.author[x].type",
        "min": 1
      },
      {
        "id": "Specimen.note.author[x].identifier",
        "path": "Specimen.note.author[x].identifier",
        "max": "0"
      },
      {
        "id": "Specimen.note.author[x].display",
        "path": "Specimen.note.author[x].display",
        "max": "0"
      },
      {
        "id": "Specimen.note.time",
        "path": "Specimen.note.time",
        "min": 1
      }
    ]
  }
}