Hi everyone, this thread is for discussion and refinement of the project: https://summerofcode.withgoogle.com/dashboard/project/5824169460629504/overview/ Participant: @ivange94 Mentors: @arastogi @sunbiz @judywawira Proposal Draft:
Hi @ivange94
Good luck on your internship defense! I’ve made some initial suggestions to your proposal and will continue to make some more as I go along
Hi @arastogi
Thanks. I already rounded up with my defense and started responding to your comments.
Update about fhir server setup.
I kept on having issues with making the radiology module a fhir server. After implementing all the classes in radiology as documented in the fhir docs, my builds kept failing. Also the tutorial does not explain much about the different parts of the example server code on github so I have to make guesses about some things. So I decided to build a fhir server from scratch out of radiology just so I can understand the differents parts of the fhir server architecture. The problem I’ve been having so far is knowing which dependencies I should declare in my pom. The code on github is a multi module maven project and some dependencies have nothing to do with setting up a fhir jpa. Also there are some dependencies that are declared in the pom that are not directly used in the code.
I joined the fhir mailing list and posted the problems I was having there and though my problem was not directly solved I was pointed to another sample code that sets up a fhir server. https://github.com/nhsconnect/careconnect-java-examples. This is easier to work with as it’s not a multi module project hence all dependencies in the pom will probably be what’s necessary to setup a fhir server. And this has been helpful, I am beginning to understand why I kept have build failures and trying to resolve them. But still the same I still have to figure things out just by looking at the code.
Here is the link to fhir server I’m working on https://github.com/ivange94/fhir-example-server. I used spring boot. I’ve just implemented the single class necessary to setup a fhir server(a class that extends one of the dstu base classes in this case dstu3). Now when I run the tests spring is unable to initialize the application context due to some missing dependencies. Currently working on that.
Was finally able to build a fhir server from scratch by following the examples on the jpa guide and also some other examples I found on github. Here is a link to my commit https://github.com/ivange94/fhir-example-server/commit/a9df33c2406e20cafb1ac3fad471507618571a11
Now when I do mvn jetty:run I can access my server at http://localhost:8181/fhirjpademoserver/ but I still see an error on the interface I’m trying to fix now. See snapshot below
If you look at the repo here https://github.com/ivange94/fhir-example-server/ you 'll notice I didn’t implement all the files that are in the example on github from the tutorial. This is because I could not understand how they are been used so I skipped them until I have more understanding of their purpose. These files includes all the xml files inside the WEB-INF/ except the web.xml file. For instance I didn’t see how this web-non-polling-subscription-dstu3.xml is been used and the files in the xsd/ and template/ directories. You can see the files I’m talking of here https://github.com/jamesagnew/hapi-fhir/tree/master/hapi-fhir-jpaserver-example/src/main/webapp/WEB-INF
Will be moving ahead now to do the same inside the radiology module.
@sunbiz, @judywawira pls I need clarification on something. The jpa example code is meant for a web application deployed to a web server. Amongst other things it needs it’s own web.xml. I don’t see how just copying those java classes into radiology and deploy on toolkit will make it work. Radiology module is not a web application like how the standard expects it to be, it’s an openmrs module and does not have it’s own configs like database connection settings.
Or do you need me to transform the radiology module to a web app by
- Add a web.xml file in the omod submodule
- Modify the build to generate a .war instead of .omod
- Add the configurations for fhir jpa server and deploy radiology to tomcat as web application on it’s own
It has to be a module and not a separate web app. The web.xml parts can be part of the module config xml
Was able to save report as complex obs using this
@Override
@Transactional
public synchronized RadiologyReport saveRadiologyReport(RadiologyReport radiologyReport, String content) {
final Obs obs = new Obs();
final ConceptComplex concept = radiologyProperties.getConceptForReport();
obs.setConcept(concept);
obs.setPerson(radiologyReport.getRadiologyOrder()
.getPatient());
obs.setObsDatetime(new Date());
File tmpFile = null;
InputStream complexDataInputStream = null;
try {
tmpFile = File.createTempFile("report", ".html");
FileUtils.writeStringToFile(tmpFile, content);
complexDataInputStream = new FileInputStream(tmpFile);
}
catch (IOException e) {
throw new APIException(e.getMessage(), e);
}
final ComplexData complexData = new ComplexData(tmpFile.getName(), complexDataInputStream);
obs.setComplexData(complexData);
radiologyReport.setObs(obs);
Context.getObsService()
.saveObs(obs, "");
return saveRadiologyReport(radiologyReport);
}
But when I visit thepatient dashboard under the obs section I don’t see any obs created but in the database there is an obs associated with the patient.
Screenshot of saved report
Screenshot of patient dashboard
But when I visit the database, there is an obs associated with the patient and the complex value has the name of the report file
I’ve completed my first evaluation, also written my report on my blog and I’ve updated my timeline to show exactly what I’ll be working on at all times. You can have a look here https://docs.google.com/document/d/1txA04jbXu63SnfQR0VHJmw5jvmJCuYbkh4GtCOG-Y18/edit?usp=sharing. The timeline for the final coding phase will be modified. It still talks about template validation but we decided to turn of validation so for the final coding phase I’ll still be working on the UI for radiology. But I’ll update it on the timeline after seeing the progress of the second coding phase. @judywawira, @arastogi have a look and let me know if the timeline is in line with our goals.
Thanks,
Larry