0

I am using HAPI FHIR Libraries and receiving an XML-based FHIR message as a response to a REST call, which is stored in a string variable. This message contains UTF-8 characters such as tabs, new lines, and special characters. However, when converting the string response message to a Bundle object, these characters are being removed. Attaching example as a picture, as UTF chars are getting converted into new line and tab.

enter image description here

Below is the piece of code:

private void processResponse(String response) {
        Bundle bundle = FhirContext.forDstu2_1().newXmlParser().parseResource(Bundle.class, response);
}

I need these UTF characters to remain AS-IS in the message so that they can be used further in the UI.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.