<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://fhir.siss.regione.lombardia.it/StructureDefinition/RLCoveragePAI" />
  <name value="RLCoveragePAI" />
  <title value="Coverage PAI" />
  <status value="draft" />
  <date value="2026-10-28" />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Coverage" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Coverage" />
  <derivation value="constraint" />
  <differential>
    <element id="Coverage">
      <path value="Coverage" />
      <short value="Motivo esenzione dal co-pagamento" />
    </element>
    <element id="Coverage.status">
      <path value="Coverage.status" />
      <short value="Stato della copertura" />
      <comment value="La StructureMap valorizza attualmente active." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Coverage.beneficiary">
      <path value="Coverage.beneficiary" />
      <short value="Assistito beneficiario" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.siss.regione.lombardia.it/StructureDefinition/RLPatientCore" />
      </type>
    </element>
    <element id="Coverage.payor">
      <path value="Coverage.payor" />
      <short value="Ente pagatore" />
      <comment value="La StructureMap valorizza attualmente solo il display: Servizio Sanitario Nazionale." />
      <min value="1" />
      <max value="*" />
    </element>
    <element id="Coverage.costToBeneficiary">
      <path value="Coverage.costToBeneficiary" />
      <short value="Esenzioni dell'assistito" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Coverage.costToBeneficiary.value[x]">
      <path value="Coverage.costToBeneficiary.value[x]" />
      <short value="Importo a carico dell'assistito" />
      <comment value="Obbligatorio in FHIR R4. In caso di esenzione la StructureMap valorizza 0 EUR (valueMoney)." />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Coverage.costToBeneficiary.exception">
      <path value="Coverage.costToBeneficiary.exception" />
      <short value="Esenzione dell'assistito" />
      <min value="1" />
      <max value="*" />
    </element>
    <element id="Coverage.costToBeneficiary.exception.type">
      <path value="Coverage.costToBeneficiary.exception.type" />
      <short value="Codice di esenzione" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Coverage.costToBeneficiary.exception.type.coding">
      <path value="Coverage.costToBeneficiary.exception.type.coding" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Coverage.costToBeneficiary.exception.type.coding.system">
      <path value="Coverage.costToBeneficiary.exception.type.coding.system" />
      <short value="Sistema di codifica" />
      <min value="1" />
      <max value="1" />
      <fixedUri value="urn:oid:2.16.840.1.113883.2.9.2.30.6.22" />
    </element>
    <element id="Coverage.costToBeneficiary.exception.type.coding.code">
      <path value="Coverage.costToBeneficiary.exception.type.coding.code" />
      <short value="Codice di esenzione" />
      <min value="1" />
      <max value="1" />
    </element>
    <element id="Coverage.costToBeneficiary.exception.type.coding.display">
      <path value="Coverage.costToBeneficiary.exception.type.coding.display" />
      <short value="Descrizione leggibile del codice" />
      <min value="1" />
      <max value="1" />
    </element>
  </differential>
</StructureDefinition>