-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code in client program just like CCDTransformerTest giving ClassCast error #4
Comments
Here is the class:
package org.mihin.ccda2fhir.clients;
|
Here is the log: Run of CCD2JsonClient: C:\dl\mihin\0projects\ccda-to-fhir 15:12:56.65
C:\dl\mihin\0projects\ccda-to-fhir 15:13:08.19 |
P.S. I'm using the file from your test/resources dir, "C-CDA_R2-1_CCD.xml" as a test file (after renaming it). |
Hi, Nothing seems wrong in your code, and I can actually run it successfully when I copy your class directly in the cda2fhir project itself. You can test it. I can only reproduce the error when I comment the following line, which is a must for loading CDA definitions from the mdht library:
I suspect that the required libraries, especially mdht is found in your classpath while you are trying to run via mvn exec. Can you make sure of this and test again? |
Mustafa,
Thank you for checking it.
I may just unzip the cda2fhir package again in a new directory, add the
Client, and see if it works.
With mvn:exec, all the mdht jars should be in the classpath.
Tom
…On Sat, Feb 24, 2018 at 4:02 PM, Mustafa Yüksel ***@***.***> wrote:
Hi,
Nothing seems wrong in your code, and I can actually run it successfully
when I copy your class directly in the cda2fhir project itself. You can
test it.
I can only reproduce the error when I comment the following line, which is
a must for loading CDA definitions from the mdht library:
CDAUtil.loadPackages();
I suspect that the required libraries, especially mdht is found in your
classpath while you are trying to run via mvn exec. Can you make sure of
this and test again?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AWeHJIBoMlKIfbsA7-MUaMx--r7C1WcZks5tYHjggaJpZM4SRbVa>
.
|
This worked for me: |
This worked to get the bundle with bare minimum resources. It still misses all the references like e.g. medication section has only the coding and the text part but is missing all the references to medication statement, substance etc. Similarly for the other sections. I face this particular issue only when running this as a spring boot WEB project. When run as a regular spring boot application, this issue does not occuer. I assume it is not loading certain packages when run as a web project. Any leads would be appreciated. |
Good day.
Thank you for your hard work on this project. I'm hoping it will help me.
I work for a Michigan HIE, and I'm trying to put together a self-service project so
providers, insurers, etc., can convert their CCDs to FHIR format.
I downloaded your project, built it, and the tests ran fine.
I tried to take three of the methods that convert CCDs to FHIR from your test, and
put them into a command-line-runnable client using the same methods (renamed).
I copied the pom.xml and I believe I have the same repo jar versions as the original.
I first tried setting up the client as it's own project, and including the jar created from
the build of srdc/cda2fhir. I put the validator jar in the project lib dir also,
and I am able to get it to run where it executes the three methods, but for each
method, I'm getting:
15:05:05.074 [org.mihin.ccda2fhir.clients.CCD2JsonClient.main()] ERROR
t.c.s.c.t.CCDTransformerImpl - ClinicalDocument could not be cast to
ContinuityOfCareDocument. Returning null
java.lang.ClassCastException: org.openhealthtools.mdht.uml.cda.impl.
ClinicalDocumentImpl cannot be cast to org.openhealthtools.mdht.uml.cda.
consol.ContinuityOfCareDocument
at tr.com.srdc.cda2fhir.transform.CCDTransformerImpl.transformDocument(CCDTransformerImpl.java:150)
at org.mihin.ccda2fhir.clients.CCD2JsonClient.runReferenceCCDInstance(CCD2JsonClient.java:121)
at org.mihin.ccda2fhir.clients.CCD2JsonClient.execute(CCD2JsonClient.java:93)
at org.mihin.ccda2fhir.clients.CCD2JsonClient.main(CCD2JsonClient.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:748)
The line in my client this occurs at is apparently the FHIRUtil.printJSON(bundle, "");
call, but the line numbers only match the second and third methods, not the first.
I've cleaned and re-built the project a fiew times, but I still get the above.
I could send the class file and a log of the run, but there is no place to submit them.
I can email them if you'd like. Text only.
Thank you again.
The text was updated successfully, but these errors were encountered: