{
  "resourceType": "StructureDefinition",
  "id": "1.3.6.1.4.1.38760.FHIR.2.1.2.1",
  "url": "https://vvis.gov.lv/fhir/Datatype/Meta/MedicalMeta-v1",
  "version": "1",
  "name": "MedicalMeta",
  "title": "Medical Metadata",
  "status": "active",
  "date": "2023-01-01",
  "publisher": "NHS Latvia",
  "description": "Metadata needed for medical document processing.",
  "purpose": "To maintain similar data enterer structures among different VVIS subsystems processing medical documents.",
  "copyright": "©NHS Latvia",
  "fhirVersion": "4.3.0",
  "kind": "complex-type",
  "abstract": false,
  "type": "Meta",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Meta",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Meta.id",
        "path": "Meta.id",
        "max": "0"
      },
      {
        "id": "Meta.versionId",
        "path": "Meta.versionId",
        "label": "Versija",
        "definition": "The version specific identifier, as it appears in the version portion of the URL. This value changes when the resource is created, updated, or deleted. \r\n\r\n©NHS: Value SHALL NOT be provided in CREATE and UPDATE requests. VersionId is being applied by the system and it is only available in READ response."
      },
      {
        "id": "Meta.lastUpdated",
        "path": "Meta.lastUpdated",
        "label": "Atjaunošanas datums",
        "definition": "When the resource last changed - e.g. when the version changed.\r\n\r\n©NHS: Value SHALL NOT be provided in CREATE and UPDATE requests. lastUpdated is being applied by the system and it is only available in READ response."
      },
      {
        "id": "Meta.source",
        "path": "Meta.source",
        "label": "Datu avots",
        "definition": "A uri that identifies the source system of the resource. This provides a minimal amount of [Provenance](provenance.html#) information that can be used to track or differentiate the source of information in the resource. The source may identify another FHIR server, document, message, database, etc.\r\n\r\n©NHS: Value SHALL NOT be provided in CREATE and UPDATE requests. It is only available in READ response when required by business."
      },
      {
        "id": "Meta.profile",
        "path": "Meta.profile",
        "label": "Datu struktūra",
        "definition": "A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url](structuredefinition-definitions.html#StructureDefinition.url).\r\n\r\n©NHS: Profile SHALL always be provided.",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Meta.security",
        "path": "Meta.security",
        "max": "0"
      },
      {
        "id": "Meta.tag",
        "path": "Meta.tag",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "closed"
        },
        "definition": "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.\r\n\r\n©NHS: Tags are required to identify who is responsible for the information in the resource, i.e. who provided/created it.",
        "min": 1
      },
      {
        "id": "Meta.tag:authorMedicalInstitution",
        "path": "Meta.tag",
        "sliceName": "authorMedicalInstitution",
        "label": "Autors",
        "definition": "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.\r\n\r\n©NHS: Authorized Medical Institution making the request. Values SHALL be provided in CREATE and UPDATE requests of Medical Institutions. When provided SHALL be validated against JWT.",
        "max": "1"
      },
      {
        "id": "Meta.tag:authorMedicalInstitution.id",
        "path": "Meta.tag.id",
        "min": 1,
        "fixedId": "authorMedicalInstitution"
      },
      {
        "id": "Meta.tag:authorMedicalInstitution.system",
        "path": "Meta.tag.system",
        "min": 1,
        "fixedUri": "urn:oid:1.3.6.1.4.1.38760.2.23"
      },
      {
        "id": "Meta.tag:authorMedicalInstitution.version",
        "path": "Meta.tag.version",
        "max": "0"
      },
      {
        "id": "Meta.tag:authorMedicalInstitution.code",
        "path": "Meta.tag.code",
        "label": "ĀI Veselības inspekcijas kods",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).\r\n\r\n©NHS: Medical Institution code. ConceptCode from VVIS 1.3.6.1.4.1.38760.2.23 (Organization.identifier:medicalInstitutionIdentifier.value) is expected. Code SHALL be identical to \"VIAuthorityCode\" in JWT.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size\r\n\r\n©NHS: Maximum 20 symbols are expected.",
        "min": 1,
        "constraint": [
          {
            "key": "med-code-1",
            "severity": "error",
            "human": "Code value shall be not longer than 20 characters",
            "expression": "matches('^.{1,20}$')"
          }
        ]
      },
      {
        "id": "Meta.tag:authorMedicalInstitution.display",
        "path": "Meta.tag.display",
        "label": "ĀI nosaukums",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.\r\n\r\n©NHS: Medical Institution name. ConceptCode displayText from VVIS 1.3.6.1.4.1.38760.2.23 (Organization.name) is expected. DisplayText SHALL be identical to \"AuthorityFullName\" in JWT.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size\r\n\r\n©NHS: Maximum 300 symbols are expected.",
        "min": 1,
        "maxLength": 300
      },
      {
        "id": "Meta.tag:authorMedicalInstitution.userSelected",
        "path": "Meta.tag.userSelected",
        "max": "0"
      },
      {
        "id": "Meta.tag:entererMedicalPerson",
        "path": "Meta.tag",
        "sliceName": "entererMedicalPerson",
        "label": "Ievadītājs",
        "definition": "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.\r\n\r\n©NHS: Authorized Medical Person making the request. Values SHALL be provided in CREATE and UPDATE requests of Medical Personal. When provided SHALL be validated against JWT.",
        "max": "1"
      },
      {
        "id": "Meta.tag:entererMedicalPerson.id",
        "path": "Meta.tag.id",
        "min": 1,
        "fixedId": "entererMedicalPerson"
      },
      {
        "id": "Meta.tag:entererMedicalPerson.system",
        "path": "Meta.tag.system",
        "min": 1,
        "fixedUri": "urn:oid:1.3.6.1.4.1.38760.2.1"
      },
      {
        "id": "Meta.tag:entererMedicalPerson.version",
        "path": "Meta.tag.version",
        "max": "0"
      },
      {
        "id": "Meta.tag:entererMedicalPerson.code",
        "path": "Meta.tag.code",
        "label": "ĀP Veselības inspekcijas kods",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).\r\n\r\n©NHS: Medical Person code. Property id=4 from VVIS 1.3.6.1.4.1.38760.2.1 (Practitioner.identifier:HealthInspectorateIdentifier.value where system=1.3.6.1.4.1.38760.3.1.4) is expected. When provided SHALL be validated aigainst JWT VIMedicalCode.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size\r\n\r\n©NHS: Maximum 11 symbols are expected.",
        "min": 1,
        "constraint": [
          {
            "key": "med-code-2",
            "severity": "error",
            "human": "Code value shall be not longer than 11 characters",
            "expression": "matches('^.{1,11}$')"
          }
        ]
      },
      {
        "id": "Meta.tag:entererMedicalPerson.display",
        "path": "Meta.tag.display",
        "label": "ĀP vārds un uzvārds",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.\r\n\r\n©NHS: Medical Person name. ConceptCode displayText from VVIS 1.3.6.1.4.1.38760.2.1 (Practitioner.name.text) is expected. Value SHALL be identical to displayText from VVIS 1.3.6.1.4.1.38760.2.1 (Practitioner.name.text) at the request time.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size\r\n\r\n©NHS: Maximum 200 symbols are expected.",
        "min": 1,
        "maxLength": 200
      },
      {
        "id": "Meta.tag:entererMedicalPerson.userSelected",
        "path": "Meta.tag.userSelected",
        "max": "0"
      },
      {
        "id": "Meta.tag:entererPersonId",
        "path": "Meta.tag",
        "sliceName": "entererPersonId",
        "label": "Ievadītājs",
        "definition": "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.\r\n\r\n©NHS: Authorized Person making the request. Values SHOULD be provided in CREATE and UPDATE requests of any human actor not registered in Health Inspection. When provided SHALL be validated against JWT.",
        "max": "1"
      },
      {
        "id": "Meta.tag:entererPersonId.id",
        "path": "Meta.tag.id",
        "min": 1,
        "fixedId": "entererPersonId"
      },
      {
        "id": "Meta.tag:entererPersonId.system",
        "path": "Meta.tag.system",
        "min": 1,
        "fixedUri": "urn:oid:1.3.6.1.4.1.38760.3.1.1"
      },
      {
        "id": "Meta.tag:entererPersonId.version",
        "path": "Meta.tag.version",
        "max": "0"
      },
      {
        "id": "Meta.tag:entererPersonId.code",
        "path": "Meta.tag.code",
        "label": "Personas kods",
        "definition": "©NHS: Health professional or patient personal identity number is expected.\r\n\r\n©NHS: Personal identity number is expected. When provided SHALL be validated against JWT ppid.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size\r\n\r\n©NHS: Maximum 11 symbols are expected.",
        "min": 1,
        "constraint": [
          {
            "key": "med-code-3",
            "severity": "error",
            "human": "Code value shall be not longer than 11 characters",
            "expression": "matches('^.{1,11}$')"
          }
        ]
      },
      {
        "id": "Meta.tag:entererPersonId.display",
        "path": "Meta.tag.display",
        "label": "Personas vārds un uzvārds",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.\r\n\r\n©NHS: Person given and family name are expected. When provided SHALL be validated against JWT \"given_name\" and family_name\".",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size\r\n\r\n©NHS: Maximum 200 symbols are expected.",
        "min": 1,
        "maxLength": 200
      },
      {
        "id": "Meta.tag:entererPersonId.userSelected",
        "path": "Meta.tag.userSelected",
        "max": "0"
      },
      {
        "id": "Meta.tag:entererSystem",
        "path": "Meta.tag",
        "sliceName": "entererSystem",
        "label": "Avota informācijas sistēma",
        "definition": "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.\r\n\r\n©NHS: HIS, LIS or other information system making the request. Values SHALL be provided in CREATE and UPDATE requests.",
        "max": "1"
      },
      {
        "id": "Meta.tag:entererSystem.id",
        "path": "Meta.tag.id",
        "min": 1,
        "fixedId": "entererSystem"
      },
      {
        "id": "Meta.tag:entererSystem.system",
        "path": "Meta.tag.system",
        "min": 1,
        "fixedUri": "https://vvis.gov.lv/fhir/CodeSystem/1.3.6.1.4.1.38760.2.3"
      },
      {
        "id": "Meta.tag:entererSystem.version",
        "path": "Meta.tag.version",
        "max": "0"
      },
      {
        "id": "Meta.tag:entererSystem.code",
        "path": "Meta.tag.code",
        "label": "Avota informācijas sistēmas kods",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).\r\n\r\n©NHS: Information system code, NOT system developer code. Information system code from VVIS 1.3.6.1.4.1.38760.2.3 is expected. Code SHALL be identical to classifier code on the request dateTime.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size\r\n\r\n©NHS: Maximum 64 symbols are expected.",
        "min": 1,
        "constraint": [
          {
            "key": "med-code-4",
            "severity": "error",
            "human": "Code value shall be not longer than 64 characters",
            "expression": "matches('^.{1,64}$')"
          }
        ]
      },
      {
        "id": "Meta.tag:entererSystem.display",
        "path": "Meta.tag.display",
        "label": "Avota informācijas sistēmas nosaukums",
        "definition": "A representation of the meaning of the code in the system, following the rules of the system.\r\n\r\n©NHS: Information system name, NOT system developer name. Information system code displayText from VVIS 1.3.6.1.4.1.38760.2.3 is expected. DisplayText SHALL be identical to classifier code displayText on the request dateTime.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1MB in size\r\n\r\n©NHS: Maximum 300 symbols are expected.",
        "min": 1,
        "maxLength": 300
      },
      {
        "id": "Meta.tag:entererSystem.userSelected",
        "path": "Meta.tag.userSelected",
        "max": "0"
      },
      {
        "id": "Meta.tag:entererMedicalPersonRole",
        "path": "Meta.tag",
        "sliceName": "entererMedicalPersonRole",
        "label": "Ievadītāja darbavieta",
        "definition": "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.\r\n\r\n©NHS: Authorized Medical Person Role making the request. Values SHALL be provided in CREATE and UPDATE requests of Medical Institutions when Medical Person Role is used for authorization. When provided SHALL be validated against JWT.",
        "max": "1"
      },
      {
        "id": "Meta.tag:entererMedicalPersonRole.id",
        "path": "Meta.tag.id",
        "min": 1,
        "fixedId": "entererMedicalPersonRole"
      },
      {
        "id": "Meta.tag:entererMedicalPersonRole.system",
        "path": "Meta.tag.system",
        "min": 1,
        "fixedUri": "urn:oid:1.3.6.1.4.1.38760.2.37"
      },
      {
        "id": "Meta.tag:entererMedicalPersonRole.version",
        "path": "Meta.tag.version",
        "max": "0"
      },
      {
        "id": "Meta.tag:entererMedicalPersonRole.code",
        "path": "Meta.tag.code",
        "label": "Ievadītāja darbavietas kods",
        "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).\r\n\r\n©NHS: Medical Person Role code. Code from VVIS 1.3.6.1.4.1.38760.2.37 (PractitionerRole.identifier.value) is expected. Code SHALL be identical to JWT sub: \"...-1.3.6.1.4.1.38760.2.37:PractitionerRoleCode\" when medical person's workplace is used for authorization.",
        "min": 1,
        "constraint": [
          {
            "key": "med-code-5",
            "severity": "error",
            "human": "Code value shall be not longer than 20 characters",
            "expression": "matches('^.{1,20}$')"
          }
        ]
      },
      {
        "id": "Meta.tag:entererMedicalPersonRole.display",
        "path": "Meta.tag.display",
        "max": "0"
      },
      {
        "id": "Meta.tag:entererMedicalPersonRole.userSelected",
        "path": "Meta.tag.userSelected",
        "max": "0"
      }
    ]
  }
}