ministero-salute / it-fse-support

32 stars 17 forks source link

Problemi con validazione RSA #893

Closed ebneuro closed 1 week ago

ebneuro commented 2 weeks ago

Salve, stiamo cercando di far validare un nostro CDA, ma ci viene restituito questo errore: ResponseBody: {"workflowInstanceId":"2.16.840.1.113883.2.9.2.120.4.4.b7547905c1f52436d5db4c85ffef339b708a8e15c636f0d055873eb06f4fb104.74af79b268^^^^urn:ihe:iti:xdw:2013:workflowInstanceId","traceId":"4d637017f22255c5","spanId":"4d637017f22255c5","type":"/msg/syntax","title":"Errore di sintassi.","detail": "ERROR: -1,-1 cvc-complex-type.2.4.a: Invalid content was found starting with element 'id'. One of '{\"urn:hl7-org:v3\":dischargeDispositionCode, \"urn:hl7-org:v3\":responsibleParty, \"urn:hl7-org:v3\":encounterParticipant, \"urn:hl7-org:v3\":location}' is expected., ERROR: -1,-1 cvc-complex-type.2.4.a: Invalid content was found starting with element 'id'. One of '{\"urn:hl7-org:v3\":name, \"urn:hl7-org:v3\":telecom, \"urn:hl7-org:v3\":addr, \"urn:hl7-org:v3\":standardIndustryClassCode, \"urn:hl7-org:v3\":asOrganizationPartOf}' is expected., ERROR: -1,-1 cvc-complex-type.2.4.d: Invalid content was found starting with element 'act'. No child element is expected at this point.","status":400,"instance":"/validation/error","govway_id":null,"warning":null}

In particolare non riesco a capire quali sono i nodi "id" errati e perchè non ci potrebbero essere nodi figli per l'act.

image

Ecco il cda preso in esame.

<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:mif="urn:hl7-org:v3/mif" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:lab="urn:oid:1.3.6.1.4.1.19376.1.3.2" xmlns:sdtc="urn:hl7-org:sdtc">
  <realmCode code="IT" />
  <typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040" />
  <templateId root="2.16.840.1.113883.2.9.10.1.9.1" extension="1.1" />
  <id root="2.16.840.1.113883.2.9.2.120.4.4" extension="FSEIUD1" assigningAuthorityName="Regione Lazio" />
  <code code="11488-4" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Nota di consulto" />
  <title>Referto</title>
  <sdtc:statusCode code="completed" />
  <effectiveTime value="20240411145501+0200" />
  <confidentialityCode code="N" codeSystem="2.16.840.1.113883.5.25" codeSystemName="HL7 Confidentiality" displayName="Normal" />
  <languageCode code="it-IT" />
  <setId root="2.16.840.1.113883.2.9.2.120.4.4" extension="POCD_HD000040" assigningAuthorityName="Regione Lazio" />
  <versionNumber value="1" />
  <recordTarget>
    <patientRole>
      <id root="2.16.840.1.113883.2.9.4.3.2" extension="VRDMRC67T20I257E" assigningAuthorityName="Ministero Economia e Finanze" />
      <addr use="HP">
        <country>ITA</country>
        <state>
        </state>
        <county>
        </county>
        <city>ROVIGO</city>
        <censusTract>029041</censusTract>
        <postalCode>45100</postalCode>
        <streetAddressLine>VLE AMENDOLA GIOVANNI, 100</streetAddressLine>
      </addr>
      <patient>
        <name>
          <family>TEST</family>
          <given>TEST</given>
        </name>
        <administrativeGenderCode code="2.16.840.1.113883.5.1" codeSystem="2.16.840.1.113883.5.1" codeSystemName="HL7 AdministrativeGender" displayName="M" />
        <birthTime value="19470811000000+0200" />
        <birthplace>
          <place>
            <addr>
              <country>ITA</country>
              <state>
              </state>
              <county>
              </county>
              <city>FIRENZE</city>
              <censusTract>
              </censusTract>
              <postalCode>
              </postalCode>
              <streetAddressLine>
              </streetAddressLine>
            </addr>
          </place>
        </birthplace>
      </patient>
    </patientRole>
  </recordTarget>
  <author>
    <time value="20240411145501+0200" />
    <assignedAuthor classCode="ASSIGNED">
      <id root="2.16.840.1.113883.2.9.4.3.2" extension="PRTMTT71T12D612L" assigningAuthorityName="MEF" />
      <telecom use="WP" value="tel:0425010101" />
      <telecom use="WP" value="mailto://TESTING@AOU.PADOVA.IT" />
      <assignedPerson>
        <name>
          <family>PRATESI</family>
          <given>MATTEO</given>
        </name>
      </assignedPerson>
      <representedOrganization>
        <id root="2.16.840.1.113883.2.9.4.1.2" extension="050901" assigningAuthorityName="Ministero della Salute" />
        <name>Uni Ospedaliera Padova</name>
      </representedOrganization>
    </assignedAuthor>
  </author>
  <custodian>
    <assignedCustodian>
      <representedCustodianOrganization>
        <id root="2.16.840.1.113883.2.9.4.1.1" extension="050901" assigningAuthorityName="Ministero della Salute" />
        <name>Uni Ospedaliera Padova</name>
      </representedCustodianOrganization>
    </assignedCustodian>
  </custodian>
  <legalAuthenticator>
    <time value="20240411145501+0200" />
    <signatureCode code="S" />
    <assignedEntity>
      <id root="2.16.840.1.113883.2.9.4.3.2" extension="PRTMTT71T12D612L" assigningAuthorityName="MEF" />
      <assignedPerson>
        <name>
          <family>PRATESI</family>
          <prefix>
          </prefix>
        </name>
      </assignedPerson>
      <representedOrganization>
        <id root="2.16.840.1.113883.2.9.4.1.2" extension="050901" assigningAuthorityName="Ministero della Salute" />
        <name>Uni Ospedaliera Padova</name>
      </representedOrganization>
    </assignedEntity>
  </legalAuthenticator>
  <inFulfillmentOf>
    <order classCode="ACT" moodCode="RQO">
      <id root="2.16.840.1.113883.2.9.2.50502.4.8" extension="OqCG1iTLIO1TVh8lYD4q" assigningAuthorityName="Ministero delle Finanze" />
      <priorityCode code="R" codeSystem="2.16.840.1.113883.5.7" codeSystemName="HL7 ActPriority" displayName="Routine" />
    </order>
  </inFulfillmentOf>
  <componentOf>
    <encompassingEncounter>
      <effectiveTime value="20240411144806+0200" />
      <id root="2.16.840.1.113883.2.9.2.50502.4.13.2" extension="876202865" />
      <location>
        <healthCareFacility>
          <id root="2.16.840.1.113883.2.9.2.50.4.11.7" extension="R2309" />
          <location>
            <name>Neurologia</name>
          </location>
          <serviceProviderOrganization>
            <name>Uni Ospedaliera Padova</name>
            <id root="2.16.840.1.113883.2.9.4.1.1" extension="050901" assigningAuthorityName="Ministero della Salute" />
            <asOrganizationPartOf>
              <id root="2.16.840.1.113883.2.9.4.1.1" extension="050901" />
            </asOrganizationPartOf>
          </serviceProviderOrganization>
        </healthCareFacility>
      </location>
    </encompassingEncounter>
  </componentOf>
  <component>
    <structuredBody>
      <component>
        <section>
          <code code="62387-6" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Interventi" />
          <title>Prestazioni</title>
          <text>
          </text>
          <entry>
            <act moodCode="EVN" classCode="ACT">
              <code code="89.14.4" codeSystem="2.16.840.1.113883.2.9.2.50.6.12" codeSystemName="Ministero della Salute" displayName="ELETTROENCEFALOGRAMMA DINAMICO 12 ORE" />
              <effectiveTime value="20240411144801+0200" />
            </act>
            <act moodCode="EVN" classCode="ACT">
              <code code="89.19.2" codeSystem="2.16.840.1.113883.2.9.2.50.6.12" codeSystemName="Ministero della Salute" displayName="POLIGRAFIA CON VIDEOREGISTRAZIONE" />
              <effectiveTime value="20240411144801+0200" />
            </act>
            <act moodCode="EVN" classCode="ACT">
              <code code="89.14" codeSystem="2.16.840.1.113883.2.9.2.50.6.12" codeSystemName="Ministero della Salute" displayName="ELETTROENCEFALOGRAMMA" />
              <effectiveTime value="20240411144801+0200" />
            </act>
          </entry>
        </section>
      </component>
      <component>
        <section>
          <code code="47045-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="Referto" />
          <title>Referto</title>
          <text>
            <paragraph>Referto EMG generico in cui il medico descrive la diagnosi dell'esame.</paragraph>
            <paragraph>Testo formattato con il nuovo controllo HTML nella preview <content styleCode="Bold">dell'esame di next</content> e si possono anche inserire delle formattazioni.</paragraph>
          </text>
        </section>
      </component>
    </structuredBody>
  </component>
</ClinicalDocument>
vigliottim commented 2 weeks ago

Buonasera, i primi due errori sintattici relativi agli id sono dovuti alla mancata valorizzazione dei campi nell'ordine corretto, ovvero:

L'ultimo errore sintattico riguarda il fatto che, secondo lo schema, una entry può contenere un solo clinical statement. Pertanto, ogni act riportato nella sezione "Prestazioni" deve essere inserito in una entry separata.

ebneuro commented 1 week ago

Buongiorno, la ringrazio, provvedo subito a correggere. Suggerisco di aggiornare la documentazione RSA in quanto viene riportatato: image

La relazione entry-act sembra quindi uno a molti.