<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="1.3.6.1.4.1.38760.FHIR.2.1.2.1" />
  <url value="https://vvis.gov.lv/fhir/Datatype/Meta/MedicalMeta-v1" />
  <version value="1" />
  <name value="MedicalMeta" />
  <title value="Medical Metadata" />
  <status value="active" />
  <date value="2023-01-01" />
  <publisher value="NHS Latvia" />
  <description value="Metadata needed for medical document processing." />
  <purpose value="To maintain similar data enterer structures among different VVIS subsystems processing medical documents." />
  <copyright value="©NHS Latvia" />
  <fhirVersion value="4.3.0" />
  <kind value="complex-type" />
  <abstract value="false" />
  <type value="Meta" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Meta" />
  <derivation value="constraint" />
  <differential>
    <element id="Meta.id">
      <path value="Meta.id" />
      <max value="0" />
    </element>
    <element id="Meta.versionId">
      <path value="Meta.versionId" />
      <label value="Versija" />
      <definition value="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. &#xD;&#xA;&#xD;&#xA;©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." />
    </element>
    <element id="Meta.lastUpdated">
      <path value="Meta.lastUpdated" />
      <label value="Atjaunošanas datums" />
      <definition value="When the resource last changed - e.g. when the version changed.&#xD;&#xA;&#xD;&#xA;©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." />
    </element>
    <element id="Meta.source">
      <path value="Meta.source" />
      <label value="Datu avots" />
      <definition value="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.&#xD;&#xA;&#xD;&#xA;©NHS: Value SHALL NOT be provided in CREATE and UPDATE requests. It is only available in READ response when required by business." />
    </element>
    <element id="Meta.profile">
      <path value="Meta.profile" />
      <label value="Datu struktūra" />
      <definition value="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).&#xD;&#xA;&#xD;&#xA;©NHS: Profile SHALL always be provided." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Meta.security">
      <path value="Meta.security" />
      <max value="0" />
    </element>
    <element id="Meta.tag">
      <path value="Meta.tag" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="system" />
        </discriminator>
        <rules value="closed" />
      </slicing>
      <definition value="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.&#xD;&#xA;&#xD;&#xA;©NHS: Tags are required to identify who is responsible for the information in the resource, i.e. who provided/created it." />
      <min value="1" />
    </element>
    <element id="Meta.tag:authorMedicalInstitution">
      <path value="Meta.tag" />
      <sliceName value="authorMedicalInstitution" />
      <label value="Autors" />
      <definition value="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.&#xD;&#xA;&#xD;&#xA;©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 value="1" />
    </element>
    <element id="Meta.tag:authorMedicalInstitution.id">
      <path value="Meta.tag.id" />
      <min value="1" />
      <fixedId value="authorMedicalInstitution" />
    </element>
    <element id="Meta.tag:authorMedicalInstitution.system">
      <path value="Meta.tag.system" />
      <min value="1" />
      <fixedUri value="urn:oid:1.3.6.1.4.1.38760.2.23" />
    </element>
    <element id="Meta.tag:authorMedicalInstitution.version">
      <path value="Meta.tag.version" />
      <max value="0" />
    </element>
    <element id="Meta.tag:authorMedicalInstitution.code">
      <path value="Meta.tag.code" />
      <label value="ĀI Veselības inspekcijas kods" />
      <definition value="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).&#xD;&#xA;&#xD;&#xA;©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 &quot;VIAuthorityCode&quot; in JWT." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size&#xD;&#xA;&#xD;&#xA;©NHS: Maximum 20 symbols are expected." />
      <min value="1" />
      <constraint>
        <key value="med-code-1" />
        <severity value="error" />
        <human value="Code value shall be not longer than 20 characters" />
        <expression value="matches('^.{1,20}$')" />
      </constraint>
    </element>
    <element id="Meta.tag:authorMedicalInstitution.display">
      <path value="Meta.tag.display" />
      <label value="ĀI nosaukums" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system.&#xD;&#xA;&#xD;&#xA;©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 &quot;AuthorityFullName&quot; in JWT." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size&#xD;&#xA;&#xD;&#xA;©NHS: Maximum 300 symbols are expected." />
      <min value="1" />
      <maxLength value="300" />
    </element>
    <element id="Meta.tag:authorMedicalInstitution.userSelected">
      <path value="Meta.tag.userSelected" />
      <max value="0" />
    </element>
    <element id="Meta.tag:entererMedicalPerson">
      <path value="Meta.tag" />
      <sliceName value="entererMedicalPerson" />
      <label value="Ievadītājs" />
      <definition value="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.&#xD;&#xA;&#xD;&#xA;©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 value="1" />
    </element>
    <element id="Meta.tag:entererMedicalPerson.id">
      <path value="Meta.tag.id" />
      <min value="1" />
      <fixedId value="entererMedicalPerson" />
    </element>
    <element id="Meta.tag:entererMedicalPerson.system">
      <path value="Meta.tag.system" />
      <min value="1" />
      <fixedUri value="urn:oid:1.3.6.1.4.1.38760.2.1" />
    </element>
    <element id="Meta.tag:entererMedicalPerson.version">
      <path value="Meta.tag.version" />
      <max value="0" />
    </element>
    <element id="Meta.tag:entererMedicalPerson.code">
      <path value="Meta.tag.code" />
      <label value="ĀP Veselības inspekcijas kods" />
      <definition value="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).&#xD;&#xA;&#xD;&#xA;©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 value="Note that FHIR strings SHALL NOT exceed 1MB in size&#xD;&#xA;&#xD;&#xA;©NHS: Maximum 11 symbols are expected." />
      <min value="1" />
      <constraint>
        <key value="med-code-2" />
        <severity value="error" />
        <human value="Code value shall be not longer than 11 characters" />
        <expression value="matches('^.{1,11}$')" />
      </constraint>
    </element>
    <element id="Meta.tag:entererMedicalPerson.display">
      <path value="Meta.tag.display" />
      <label value="ĀP vārds un uzvārds" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system.&#xD;&#xA;&#xD;&#xA;©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 value="Note that FHIR strings SHALL NOT exceed 1MB in size&#xD;&#xA;&#xD;&#xA;©NHS: Maximum 200 symbols are expected." />
      <min value="1" />
      <maxLength value="200" />
    </element>
    <element id="Meta.tag:entererMedicalPerson.userSelected">
      <path value="Meta.tag.userSelected" />
      <max value="0" />
    </element>
    <element id="Meta.tag:entererPersonId">
      <path value="Meta.tag" />
      <sliceName value="entererPersonId" />
      <label value="Ievadītājs" />
      <definition value="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.&#xD;&#xA;&#xD;&#xA;©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 value="1" />
    </element>
    <element id="Meta.tag:entererPersonId.id">
      <path value="Meta.tag.id" />
      <min value="1" />
      <fixedId value="entererPersonId" />
    </element>
    <element id="Meta.tag:entererPersonId.system">
      <path value="Meta.tag.system" />
      <min value="1" />
      <fixedUri value="urn:oid:1.3.6.1.4.1.38760.3.1.1" />
    </element>
    <element id="Meta.tag:entererPersonId.version">
      <path value="Meta.tag.version" />
      <max value="0" />
    </element>
    <element id="Meta.tag:entererPersonId.code">
      <path value="Meta.tag.code" />
      <label value="Personas kods" />
      <definition value="©NHS: Health professional or patient personal identity number is expected.&#xD;&#xA;&#xD;&#xA;©NHS: Personal identity number is expected. When provided SHALL be validated against JWT ppid." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size&#xD;&#xA;&#xD;&#xA;©NHS: Maximum 11 symbols are expected." />
      <min value="1" />
      <constraint>
        <key value="med-code-3" />
        <severity value="error" />
        <human value="Code value shall be not longer than 11 characters" />
        <expression value="matches('^.{1,11}$')" />
      </constraint>
    </element>
    <element id="Meta.tag:entererPersonId.display">
      <path value="Meta.tag.display" />
      <label value="Personas vārds un uzvārds" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system.&#xD;&#xA;&#xD;&#xA;©NHS: Person given and family name are expected. When provided SHALL be validated against JWT &quot;given_name&quot; and family_name&quot;." />
      <comment value="Note that FHIR strings SHALL NOT exceed 1MB in size&#xD;&#xA;&#xD;&#xA;©NHS: Maximum 200 symbols are expected." />
      <min value="1" />
      <maxLength value="200" />
    </element>
    <element id="Meta.tag:entererPersonId.userSelected">
      <path value="Meta.tag.userSelected" />
      <max value="0" />
    </element>
    <element id="Meta.tag:entererSystem">
      <path value="Meta.tag" />
      <sliceName value="entererSystem" />
      <label value="Avota informācijas sistēma" />
      <definition value="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.&#xD;&#xA;&#xD;&#xA;©NHS: HIS, LIS or other information system making the request. Values SHALL be provided in CREATE and UPDATE requests." />
      <max value="1" />
    </element>
    <element id="Meta.tag:entererSystem.id">
      <path value="Meta.tag.id" />
      <min value="1" />
      <fixedId value="entererSystem" />
    </element>
    <element id="Meta.tag:entererSystem.system">
      <path value="Meta.tag.system" />
      <min value="1" />
      <fixedUri value="https://vvis.gov.lv/fhir/CodeSystem/1.3.6.1.4.1.38760.2.3" />
    </element>
    <element id="Meta.tag:entererSystem.version">
      <path value="Meta.tag.version" />
      <max value="0" />
    </element>
    <element id="Meta.tag:entererSystem.code">
      <path value="Meta.tag.code" />
      <label value="Avota informācijas sistēmas kods" />
      <definition value="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).&#xD;&#xA;&#xD;&#xA;©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 value="Note that FHIR strings SHALL NOT exceed 1MB in size&#xD;&#xA;&#xD;&#xA;©NHS: Maximum 64 symbols are expected." />
      <min value="1" />
      <constraint>
        <key value="med-code-4" />
        <severity value="error" />
        <human value="Code value shall be not longer than 64 characters" />
        <expression value="matches('^.{1,64}$')" />
      </constraint>
    </element>
    <element id="Meta.tag:entererSystem.display">
      <path value="Meta.tag.display" />
      <label value="Avota informācijas sistēmas nosaukums" />
      <definition value="A representation of the meaning of the code in the system, following the rules of the system.&#xD;&#xA;&#xD;&#xA;©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 value="Note that FHIR strings SHALL NOT exceed 1MB in size&#xD;&#xA;&#xD;&#xA;©NHS: Maximum 300 symbols are expected." />
      <min value="1" />
      <maxLength value="300" />
    </element>
    <element id="Meta.tag:entererSystem.userSelected">
      <path value="Meta.tag.userSelected" />
      <max value="0" />
    </element>
    <element id="Meta.tag:entererMedicalPersonRole">
      <path value="Meta.tag" />
      <sliceName value="entererMedicalPersonRole" />
      <label value="Ievadītāja darbavieta" />
      <definition value="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.&#xD;&#xA;&#xD;&#xA;©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 value="1" />
    </element>
    <element id="Meta.tag:entererMedicalPersonRole.id">
      <path value="Meta.tag.id" />
      <min value="1" />
      <fixedId value="entererMedicalPersonRole" />
    </element>
    <element id="Meta.tag:entererMedicalPersonRole.system">
      <path value="Meta.tag.system" />
      <min value="1" />
      <fixedUri value="urn:oid:1.3.6.1.4.1.38760.2.37" />
    </element>
    <element id="Meta.tag:entererMedicalPersonRole.version">
      <path value="Meta.tag.version" />
      <max value="0" />
    </element>
    <element id="Meta.tag:entererMedicalPersonRole.code">
      <path value="Meta.tag.code" />
      <label value="Ievadītāja darbavietas kods" />
      <definition value="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).&#xD;&#xA;&#xD;&#xA;©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: &quot;...-1.3.6.1.4.1.38760.2.37:PractitionerRoleCode&quot; when medical person's workplace is used for authorization." />
      <min value="1" />
      <constraint>
        <key value="med-code-5" />
        <severity value="error" />
        <human value="Code value shall be not longer than 20 characters" />
        <expression value="matches('^.{1,20}$')" />
      </constraint>
    </element>
    <element id="Meta.tag:entererMedicalPersonRole.display">
      <path value="Meta.tag.display" />
      <max value="0" />
    </element>
    <element id="Meta.tag:entererMedicalPersonRole.userSelected">
      <path value="Meta.tag.userSelected" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>