Published on InterSystems Developer Community (https://community.intersystems.com)

Home > How to convert a FHIR Patient resource in XML format into a Cache object

Question
Mike.W · Mar 15, 2023

How to convert a FHIR Patient resource in XML format into a Cache object

Hi.

We are going to have basic patient demographic data coming in to Cache via a webservice. I thought that I should define the input as XML something like the FHIR format (with UK extensions).

In the past we've input XML streams and used the  %XML.Reader to convert them to matching classes successfully, so I thought it would be easy. However, I've found that the FHIR format stores everything in attributes like:

  <gender value="male"/>
  <birthDate value="1982-01-23"/>

Looking in the Cache documentation here there seems no easy way to make a property match to an attribute of "value" without defining another class for each item with a single property called "value" and  XMLPROJECTION = "ATTRIBUTE" . Is that correct or have I missed something? I could invest in Ensemble or IRIS (though I can see nothing different in the IRIS documentation), but seems overkill for one small inbound message. Or should I forget FHIR and stick to a simple XML structure.

Thanks / Mike

#FHIR #XML #Caché
Product version: Caché 2018.1

Source URL:https://community.intersystems.com/post/how-convert-fhir-patient-resource-xml-format-cache-object