Hello community, on my first steps with processing FHIR requests, I tried to create a capability statement resource an returning its content JSON or XML, depending on what is requested by the client. I create a CapabilityStatement object by parsing a JSON file with: #dim tCapStat as HS.FHIR.DTL.vR4.Model.Resource.CapabilityStatement = ##class(HS.FHIR.DTL.vR4.Model.Resource.CapabilityStatement).FromJSONFile("/opt/home/data/fhir/UkerQsCapabilityStatement.json","vR4")</p>

then, depending on the content of  pRequest.Request.ResponseFormatCode I create a HS.SDA3.QuickStream Object with</p>

do tStream.CopyFrom(tCapStat.ToJSON())</p>

or

do tStream.CopyFrom(tCapStat.ToXML())</p>

In the first case everythin works quite fine as expected,

in the second case an exception occurres:

An exception occurred: <FUNCTION> zToXMLHelper+5^HS.FHIR.DTL.vR4.Model.Resource.CapabilityStatement.1
With an event text saying: ERROR <Ens>ErrException: <FUNCTION>zToXMLHelper+5^HS.FHIR.DTL.vR4.Model.Resource.CapabilityStatement.1 -- logged as '-' number - @' if (r%id)&&(..id '= "") {'

I'd really appreciate, if I could get a hint what goes wrong here.

Thanks and regards,

Martin 

</body></html>