· Jun 3, 2017

How to access HL7 fields in SDA extension class

Hi - I created a custom extension to the SDA3 Allergy class, but can't figure out how to access the actual data to plug it into the SDA in the OnAllergy method.

The method (in my extension of the HL7ToSDA class) has a method like this:

ClassMethod OnAllergy()

  Set cr = $c(13,10)

  do ..write(cr_"<Mode>") 
  do ..write(cr_"<Code>"_"ThisWillComeFromACustomFieldInAL1"_"</Code>")
  do ..write(cr_"</Mode>")
  do ..write(cr_"<OnsetDate>") _"ThisWillComeFromACustomFieldInAL1"_"</OnsetDate>") 

In the superclass I see references to various macros which reference variable "s" for segment, and use syntax like this:


but I can't use that in my OnAllergy method because "s" isn't available at that point in the processing.

Does anyone know how to do this?


Discussion (2)0
Log in or sign up to continue

More on this - turns out that Extension fields need to be enclosed in an <Extension> element, like so: