Mapping error
I am mapping a field to the FHIR Location resource field address.line. Using message class HS.FHIR.DTL.vR4.Model.Resource.Location
The line field is repeating
.png)
I set field as such,
.png)
This causes the error,
ERROR <Ens>ErrException: <INVALID OREF>zTransform+71^AH.AHEDSLPFD.Transforms.ReltioEntityToPFDFHIRLocation.1 -- logged as '-' number - @' If 'tIgnore { Set tSC=target.address.line.SetAt(zVALz,(1)) }'
Any suggestions on how I can format the target?
Comments
Hello @Michael Wood,
The line property is actually a list of string in address object property. So You should use direct Insert action instead of Set for that property when doing mapping in DTL for single values. If it's list/collection the you should foreach the list property and insert the values to the line() property. Refer the screenshots below for both scenarios.
Direct single Insert
.png)
XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='CSVtoHL7.Inputfile.Record' targetClass='HS.FHIR.DTL.vR4.Model.Resource.Location' create='new' language='objectscript' >
<assign value='source.FirstName' property='target.address.line' action='insert' key='1' />
</transform>
}List
.png)
XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='CSVtoHL7.Inputfile.Record' targetClass='HS.FHIR.DTL.vR4.Model.Resource.Location' create='new' language='objectscript' >
<foreach property='source.AddressLine()' key='k1' >
<assign value='source.AddressLine.(k1)' property='target.address.line' action='insert' key='k1' />
</foreach>
</transform>
}result
.png)
Worked like a charm. Thanks Ashok