Base64 payload and XML to objects
I am trying to import a large base64 string into objects but I can't seem to get it to work:
{
Set readerForItkRequestData = ##class(%XML.Reader).%New()
Set file="c:\Source\test_full.xml"
Set status = readerForItkRequestData.OpenFile(file)
Do readerForItkRequestData.Correlate("Envelope","Phu.Epro.Schema.Itk.Envelope")
set temp = readerForItkRequestData.Next(.pOutput,.tStatus)
Do pOutput.%Save()
}
The class I'm trying to project to:
{
Parameter XMLIGNOREINVALIDTAG = 1;
Property ManifestItemId As %String(XMLNAME = "id", XMLPROJECTION = "attribute");
Property FileName As %String(XMLNAME = "filename", XMLPROJECTION = "attribute");
Property Test As %String(MAXLEN = "", XMLPROJECTION = "content");}
The error I get is:
Here's the xml trying to be imported, with the base64 stripped:
<payload filename="eaf7a956-f09e-43a0-9a20-95696dc5acac.pdf" id="binaryDocument">J....YNCg==</payload>
It's worth mentioning this is a collection. The Payloads can also be quite different (notice how the first one doesn't have "content" and is complex type:
<payload id="clinicalDocument">
<ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:npfitlc="NPFIT:HL7:Localisation" classCode="DOCCLIN" moodCode="EVN">
<typeId extension="POCD_HD000040" root="2.16.840.1.113883.1.3"/>
<custodian typeCode="CST">
</custodian>
<componentOf typeCode="COMP">
</componentOf>
<component contextConductionInd="true" typeCode="COMP">
<nonXMLBody classCode="DOCBODY" moodCode="EVN">
<text mediaType="text/plain" representation="TXT">Refer to other payloads in this message for document content</text>
</nonXMLBody>
</component>
</ClinicalDocument>
</payload>
<payload filename="eaf7a956-f09e-43a0-9a20-95696dc5acac.pdf" id="binaryDocument">J....YNCg==</payload>
. Any help would be appreciated!