hl7-be / lab

Creative Commons Zero v1.0 Universal
6 stars 9 forks source link

XML on testserver REST API #204

Open FrederikVds opened 1 year ago

FrederikVds commented 1 year ago

We're sending an XML file to the testserver REST API. We get an error saying "unknown testcase" and a JSON parse error. There is no indication that parsing the file as XML was attempted. I've tried the content-types application/xml and application/fhir+xml.

Are XML files supported on the testserver? How can I send them?

(Is the code for the testserver open-source so I can check things like this myself or is it closed source? I couldn't immediately find it.)

bdc-ehealth commented 1 year ago

@FrederikVds,

validation of XML files is supported, but apparently there is a bug for XML files being submitted using the REST API regarding the retrieval of the patient id.

We will look into this. Do you have the opportunity to try the eHBox access using XML?

We have confirmed successful uses for REST/JSON and eHBox/JSON, but you are the first to test with XML.

We will also consider making the repo for the testserver webapp public.

FrederikVds commented 1 year ago

@bdc-ehealth

We have now submitted the same XML document over the eHealthBox. We get another error message: "Error in payload format". Again we also get a JSON parsing error. It's not clear whether XML parsing was attempted as well and failed, or whether only JSON parsing was attempted.

bdc-ehealth commented 1 year ago

@FrederikVds Hi Frederik, there is an XML error at: markup not allowed inside attribute value - illegal < (position: TEXT seen ...<valueString value="<... @1549:22) . You will need to use an entity there.

bdc-ehealth commented 1 year ago

@FrederikVds Frederik, you can also use the visualization tool to detect this kind of mistakes: image

FrederikVds commented 1 year ago

@bdc-ehealth

We are sending &lt; in the eHealthBox attachment. It must get converted to < somewhere on the test server.

The visualization tool only gives the following error on our original file: Error: 400 Bundle must contain a DiagnosticReport

I think it doesn't support collection Bundles yet.

If I extract the document Bundle from the file, I get some useful output from the visualization tool (we seem to be missing units in some places which I will look into). But can you look into making sure the FHIR test server is able to receive the XML file? The error message "Error in payload format" seems to suggest something worse is going on than just some missing values?

FrederikVds commented 1 year ago

@bdc-ehealth

I've sent a test document that successfully validates on the visualization tool and the error remains the same on the test server.

bdc-ehealth commented 1 year ago

@FrederikVds

ok, we will check it out. So we have two issues: 1) the entity gets lost between ehBox and Testserver https://github.com/ehealthplatformstandards/TestServerEhBox/issues/4 https://github.com/ehealthplatformstandards/TestServerWebApp/issues/4 2) the visualizer does not support a collection of reports yet https://github.com/ehealthplatformstandards/laboResultVisualization/issues/31

bdc-ehealth commented 1 year ago

@FrederikVds Treatment of XML should be fine now, for the evaluation, creation and retrieval of testcase. I will make a separate issue for Bundle of Bundles. #206

bdc-ehealth commented 1 year ago

@FrederikVds ,

I think we have the same problem with the rest API again. The testcases are not recognized anymore. I have reopened ehealthplatformstandards/TestServerWebApp#3 again

FrederikVds commented 1 year ago

The problem now isn't limited to XML. JSONs also don't work.

Also, the reason I used the REST API was because the test platform doesn't seem to receive any documents at all when I send them via the eHealth API.

FrederikVds commented 1 year ago

Hi @bdc-ehealth ,

We're still unable to send any document to the test server (neither via REST nor eHealth, and neither XML nor JSON). Is this problem limited to just us or are you not getting documents from anyone? If it's just us, any idea what I can do differently? Previously working documents stopped being received as well.

bdc-ehealth commented 1 year ago

@FrederikVds,

I checked your file once again, and the only difference I see with people that can use the REST API succesfully, is the lack of meta.profile on the patient. I think it will work if you add the meta.profile to the Patient resource (check the other available examples). We are still discussing whether this is a requirement, as the visualizer works without it, but you will be unblocked if you add it.

FrederikVds commented 1 year ago

@bdc-ehealth

I tried that now and it doesn't work.

Are you still successfully receiving messages from other people over both the REST and the eHealth API? Or are you referring to successful messages in the past? To us it seems like the entire test server stopped receiving anything since Friday at 11 AM.

jmp-ehealth commented 1 year ago

@FrederikVds I added the management of the content-type "application/fhir+json" in the rest-api and resubmitted your message Your JSOn message now works, you can retest it. I look now for the xml

bdc-ehealth commented 1 year ago

@FrederikVds ,

No, we have had successful messages from other labs and software-vendors since that time. That is strange indeed...

FrederikVds commented 1 year ago

@jmp-ehealth Your fix works, we can now send JSON over REST. Thanks!

jmp-ehealth commented 1 year ago

@FrederikVds I also adapted the XML code. It was due to the fact that my example XML contained more than 1 tag 'identifier' for the patient, and yours contained only 1 tag It should work now for xml also Let me know

FrederikVds commented 1 year ago

@jmp-ehealth It works now, thanks!

jmp-ehealth commented 1 year ago

@FrederikVds Perfect I close the ticket