hapifhir / hapi-fhir-android-integration-test

Hapi FHIR android Integration Test
Apache License 2.0
7 stars 7 forks source link

XMLParser error & PipeParser for Android. #6

Open pravingaikwad07 opened 4 years ago

pravingaikwad07 commented 4 years ago
  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 commented 4 years ago

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

pravingaikwad07 commented 4 years ago

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 commented 4 years ago

No plans at this time, but it certainly isn't ruled out. A pull request would be welcomed (although I suspect it would be pain to implement, since it would require a bunch of refactoring the existing parser to remove the stax dependencies)

On Thu, Aug 27, 2020 at 5:39 PM pravingaikwad07 notifications@github.com wrote:

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

Ohk. Thanks @jamesagnew https://github.com/jamesagnew . Any future plans to implement this feature ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hapifhir/hapi-fhir-android-integration-test/issues/6#issuecomment-682204532, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2N7HK5F3JW2NTXFXZHNJDSC3HAJANCNFSM4QNNYBVA .

pravingaikwad07 commented 4 years ago

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 commented 4 years ago

HAPI HL7v2 is a completely separate library. I'm not aware of anyone having used it successfully on Android, but I can't think of any reason it wouldn't work. Certainly Android wasn't a design goal of that library (since it was written 15 years before Android was)

On Thu, Aug 27, 2020 at 6:00 PM pravingaikwad07 notifications@github.com wrote:

Thanks for the quick update @jamesagnew https://github.com/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"

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hapifhir/hapi-fhir-android-integration-test/issues/6#issuecomment-682212726, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2N7HKDLWKUI7LGCLAIRCDSC3JQ3ANCNFSM4QNNYBVA .