I'm working in a project which needs to export EHR information in CCR format. I must use Java. The problem that I'm facing is that I can't find an easy way to do it.
The better way to do what I'm doing would be to export as CDA using something like CDAPI but it's overly expensive (30k/year) and complicated. However it shows an example of what I'd like. Something like:
CCR ccr = new CCR();
...
out.print(ccr.toString()); // Returns XML
But it's as if this doesn't exist.
There's CCR4J but it can only read XML files and make Java objects. Not the other way around.
There's Google Health (now discontinued) which might have what I'm looking for, but I can't even figure out how to use it.
There's CCR Binder which has some convenience methods for creating CCR XML from code built on top of Google Health API, but I can't figure out how to use that either.
I could also just read the ASTM CCR Spec and implement something on my own which at this point begins to look like the faster option.
Now I would really like to stay away from Google Health. Seems to be an overkill for my task as is exporting do CDA. Any comments and suggestions are appreciated.
Just for the benefit of people searching for the same info. Here's the CCR Spec.
I ended up doing something like this: Video: Quick and Dirty CCR
To summarize: Use JAXB to make the classes them marshall them using JAXB marshaller.