Hi,
I can create a directory in json and post it with success (in EHRBase) but I cannot write one in xml that works. Does anyone have a xml directory folder to share ?
I made several unsuccessful attempts at guessing the right format starting from the json one and from the directory response when using get folder in xml format.
Did you try generating XMLs in the openEHR toolkit?
I did not. Iāll try it thanks
Unfortunately it seems that the free version does not allow it "Your current plan doesnāt include generating instances for FOLDER. You can upgrade your plan from the menu on the left. "
Yes, some types are constrained. COMPOSITIONs are free.
You can also use the CLI from the open source openEHR SDK GitHub - CaboLabs/openEHR-SDK: Java/Groovy Support of openEHR Operational Templates, Reference Model, Data Generators and other tools for www.CaboLabs.com projects
It has generators for all the types, though it requires some setup.
Hope that helps.
Might be a bit, late but there are example folders in the ehrbase openEHR SDK test data.
As the format is not part of the data model, you can just retrieve your working json example as xml.
not too late but unfortunately even the simple xml folder listed there does not pass. The error with EHRBase 2.11 is:
<?xml version='1.0' encoding='UTF-8'?>Bad RequestContent is not allowed in prolog.
and I have no hidden leading characters before ā<?xml etcā nor special characters in the file. The file is saved as UTF-8 without BOM.
Accept Header : wrong??
Hi Ian,
well Iām using similar parameter as the json one (for json directory replace in the following parameters XML with JSON and the directory is accepted.). In detail for xml directory creation:
header: āContent-Typeā:āapplication/xmlā,
āPreferā: āreturn=representationā,
āacceptā:āapplication/xmlā},
params: {āformatā: āXMLā}
I remember that error because it made me say out loud āWTF prolog has got to do with this?ā Please check that your input is utf8 without hidden chars and especially utf BOM. In short, perform some char sanitisation check.
Taking a look at the controller, my understanding is that EHRbase only accepts JSON payload for folders?
Thanks for this. I think the last time I saw the prolog error was when I tried to push some json content to ehrbase using the swagger UI, while the content was set to XML in the UI, which should be easy enough to reproduce.
I got fantastic news
for you though: It should be possible to use the Contribution endpoint to send the folder payload as XML to EHRbaseā¦
From that file I understand that the default value is json but I canāt see xml in some way unsupported. Maybe Iām misreading it.
Iām quite sure Iām sending the xml file
The problem is that I was testing the post directory in XML format for the openEHR tool. I saw that in EHRBase you changed many endpoints and some header so Iām re-checking every method to guarantee that it leads to success.