Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XMLParser error & PipeParser for Android. #6

Open
pravingaikwad07 opened this issue Aug 27, 2020 · 5 comments
Open

XMLParser error & PipeParser for Android. #6

pravingaikwad07 opened this issue Aug 27, 2020 · 5 comments

Comments

@pravingaikwad07
Copy link

pravingaikwad07 commented Aug 27, 2020

  IParser parser = FhirContext.forDstu2().newJsonParser();
                parser.setPrettyPrint(true);
                String jsonDump = parser.encodeResourceToString(patient);

This prints proper Patient JSON but while using newXMLParser I am getting this error

detailMessage = "Unable to initialize StAX - XML processing is disabled"
cause = {FactoryConfigurationError@13489} "javax.xml.stream.FactoryConfigurationError: Provider com.bea.xml.stream.XMLOutputFactoryBase not found"

I have added following gradle dependencies :

{
    implementation "javax.xml.stream:stax-api:1.0-2" // for fhir xml parsing
    implementation "ca.uhn.hapi.fhir:hapi-fhir-android:5.1.0"
    implementation "ca.uhn.hapi.fhir:hapi-fhir-structures-dstu2:5.1.0"

}

configurations {
    all*.exclude group: 'org.codehaus.woodstox'
    all*.exclude group: 'org.apache.httpcomponents'
}

Q1: How to resolve this XML parser error ?

Q2: I can convert the Patient data in HL7 Pipes/Segments data in Android ?
In java we can use this link and this as reference. I want to achieve similar behavior in Android without using ADT_A01 object- hapi-base-2.2.jar

@jamesagnew
Copy link
Contributor

XML parsing is not currently supported by the android library, only JSON parsing is due to StAX not working on Android

@pravingaikwad07 pravingaikwad07 changed the title XMLParser error & Pipeparser for Android. XMLParser error & PipeParser for Android. Aug 27, 2020
@pravingaikwad07
Copy link
Author

pravingaikwad07 commented Aug 27, 2020

XML parsing is not currently supported by the android library, only JSON parsing is due to StAX not working on Android

Ohk. Thanks @jamesagnew .
Any future plans to implement/fix this feature XMLParsing ? and any help with Pipeparsing ?

@jamesagnew
Copy link
Contributor

jamesagnew commented Aug 27, 2020 via email

@pravingaikwad07
Copy link
Author

Thanks for the quick update @jamesagnew

Also, any update on help on Pipe Parser ? How I can covert the Patient obj to Pipe presentation or vice versa in Android or it is also not supported yet in Android ?

Sample pipe msg:
"MSH|^~\\&|HIS|RIH|EKG|EKG|199904140038||ADT^A01||P|2.2\r" 53 + "PID|0001|00009874|00001122|A00977|SMITH^JOHN^M|MOM|19581119|F|NOTREAL^LINDA^M|C|564 SPRING ST^^NEEDHAM^MA^02494^US|0002|(818)565-1551|(425)828-3344|E|S|C|0000444444|252-00-4414||||SA|||SA||||NONE|V1|0001|I|D.ER^50A^M110^01|ER|P00055|11B^M011^02|070615^BATMAN^GEORGE^L|555888^NOTREAL^BOB^K^DR^MD|777889^NOTREAL^SAM^T^DR^MD^PHD|ER|D.WT^1A^M010^01|||ER|AMB|02|070615^NOTREAL^BILL^L|ER|000001916994|D||||||||||||||||GDD|WA|NORM|02|O|02|E.IN^02D^M090^01|E.IN^01D^M080^01|199904072124|199904101200|199904101200||||5555112333|||666097^NOTREAL^MANNY^P\r"

@jamesagnew
Copy link
Contributor

jamesagnew commented Aug 27, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants