C-CDA export visit and forms to encounters

OEMR developer community,

Our clinic added a few custom forms to associate encounters with clinicians. I have observed that the ccdaservice correctly generates an encounter entry for each visit, but now I need to add the encounters associated with the custom forms. It seems to me that the office visit would count as an encounter in the C-CDA output and each of the forms associated with the visit would be an additional encounter entry in the C-CDA and not added to the encounter entry form.

What is the correct way to represent the following OpenEMR representation of a visit in the C-CDA Encounters section?

ex. OEMR visit

visit: 1, date: 2024-02-20, participant: John Doe
encounter: 1, visit: 1, type: clinical, CPT-code: 123
encounter: 2, visit: 1, type: psychiatric, CPT-code:234
encounter:3, visit:1, type: case management, cpt-code: 345

ex. C-CDA representation

<entry>
   <encounter>
     <code displayName="Office Visit" code="185347001" ... />
   </encounter>
</entry>

<entry> 
   <encounter>
     <code displayName="Clinical" code="123" ... />
   </encounter>
</entry>
  
<entry>
   <encounter>
     <code displayName="Psychiatric" code="234" ... />
   </encounter>
</entry>
  
<entry>
   <encounter>
     <code displayName="Case Management" code="345" ... />
   </encounter>
  </entry>

or would you embed the codes associated with the forms for that participants visit in a single C-CDA encounter like:

<entry>
  <encounter>
    <code displayName="Office Visit" code="185347001">
      <translation code="123" ... />
      <translation code="234" ... />
      <translation code="456" ... />
    </code>
  </encounter>

</entry>

or maybe the info associated with the forms for the visit would go in an entryRelationship tags like here?

<entry>
  <encounter>
    <code displayName="Office Visit" code="185347001">
    <entryRelationship typeCode="REFR" inversionInd="false">
       <act classCode="ACT" moodCode="EVN">
          <code code="123" ...  />
        </act>
     </entryRelationship>
     <entryRelationship typeCode="REFR" inversionInd="false">
       <act classCode="ACT" moodCode="EVN">
          <code code="234" ...  />
        </act>
     </entryRelationship>
     <entryRelationship typeCode="REFR" inversionInd="false">
       <act classCode="ACT" moodCode="EVN">
          <code code="345" ...  />
        </act>
     </entryRelationship>
   </encounter>
</entry>

Thanks in advance,

I ended up solving this by putting the CPT-4 codes alongside their associated encounter as entries. I am also assuming that ICD-9 or 10 codes would go alongside procedure entries.

1 Like