FHIR Swagger Document generator and enhancements Next Steps

@pascal we can’t use lower case for resources because it’s the way that define in FHIR Specification :slight_smile:

1 Like

Thanks @pascal and @harsha89 for the clarifications.

Hi All,

Past week and these few days I’m fully work with the implementation and able to get the first working swagger out from the FHIR API. It’s the basic version which need several improvements. I had to made several changes with debugging HAPI library with @harsha89 help and sort out issues. Below shows current paths that generated from swagger generator.

@harsha89 I have see that $everything is also supported with some resources. I need to debug and see how HAPI conformance statement provide it. We also need to include it as well right?

Thank you, Rasanjana

1 Like

Looks good @rasanjana. Le’ts add all resource paths and then focus on the body content and the parameter sections of each operation.

@harsha89 I have see that $everything is also supported with some resources. I need to debug and see how HAPI conformance statement provide it. We also need to include it as well righ

Yes we need to include it as well. :slight_smile:

The Swagger UI code used in the Rest Module can be found here. It contains a few small tweaks, so if we want the two docs pages to look the same, then maybe consider using the code in that branch.

Feel free to make improvements if you need to, then we can incorporate those into future releases of the Rest Module.

Thanks @harsha89 I will include it as well.

@pascal thanks for the suggestion, I will look at it and get back to you.

@harsha89 when I going through the release notes of hapi fhir library, there is seems lot’s of improvements. Shall I update the library as well?

@rasanjana yeah let’s update the library version as well. It may cause some compilation failures due to underline changes of library APIs, you will have to correct them as well.

Thanks @harsha89 for the clarification. Now I’m going to upgrade the library as well.

As a update, I also include the $everything for the swagger documentation as well. Also most parameters are included as well. I think swagger documentation part will be mostly done with it.After I committed work @harsha89 could you please go through the swagger documentation and let me know anything to be done?

Also I would like to know whether we have to create a presentation for the mid review?

I have completed most of the swagger document generation with this week. This week I made several improvements and integrate displaying sample outputs which will get calling resource URIs. I have attached below image to display it functionality.

Let me know any questions on this. @harsha89 you can review the pull request and merge it. The target is to work on the upgrade of library version next week and start initial work on the UI component.

1 Like

@rasanjana thanks for the update. I’ll have a look at it. :slight_smile:

Looks good @rasanjana. I have added comments on the PR. I will merge it after you have address them.

I tested fhir swagger this weekend with 50 users and the server with 16 gb crashed . I thought of bringing this to attention and wonder how to overcome this performance issue (maybe a cache unless Code is updated ?)

@judy did you continously hit swagger endpoint with 50 users? Is it a out of memory or is there any other log erros in backend?

@harsha89 Thanks for going through the code. I have address the comments in the code and updated pull request.

Hi Guys,

Previous week I entirely worked on the fhir version upgrade but it seems we can’t moved to 1.5 release version due to some issue cause by xerces library. Here are the work I have done.

  • Upgraded the version to 1.5 which is the latest and fixed compilation issues and ran the tests. Tests were failed due to following error.

Caused by: org.xml.sax.SAXNotRecognizedException: Property ‘http://javax.xml.XMLConstants/property/accessExternalDTD’ is not recognized. at org.apache.xerces.jaxp.validation.XMLSchemaFactory.setProperty(Unknown Source) at ca.uhn.fhir.validation.SchemaBaseValidator.loadSchema(SchemaBaseValidator.java:140) … 123 more

  1. Going through internet I have found a java bug related to this. But people said it has fixed in latest releases. Also people specify that having xerces dependency in classpath can cause this issue. Then I have looked at the both omot and openmrs.war. I have found that xerces library is there in openmrs lib folder
  • To find out why this issue came in this release, I have debug and went through the hapi-fhir code and found (1) code segment added to fix some vulnerability cause this issue.
  1. Then I have downgraded to 1.4 and it’s works fine.

@harsha89 appreciate your thoughts on this.

(1) https://github.com/jamesagnew/hapi-fhir/blob/master/hapi-fhir-base/src/main/java/ca/uhn/fhir/validation/SchemaBaseValidator.java#L145

Thank you Rasanjana

Yes , 50 users simultaneously

The server had 16 GB . @sunbiz may have more information but we didn’t see many errors to explain this

Judy

@rasanjana shall we run a quick load test on this? We also should be able to reproduce this. @judy is machine has enough memory? It’s strange that there is no error on logs.

Great investigation on upgrade. It seems we have no option. Please have a look whether we have a workaround we can eliminate it. I’ll check with James regarding this. Our next focus should be on swagger UI part.

It seems after merge the swagger pull request upgrade pull request has some issues. Can you fix them and update the pull request?

1 Like

@harsha89 thank you for the response. I will do a load test and test if I can reproduce it. I have fixed the conflicts of the pull request. Thank you for merging my first pull request.

These days I’m researching on Open Web app and other alternatives. I will reply after finishing it.

@harsha89 @judy I have done a performance test using Apache Jmeter. It ran for nearly 8 hours and server runs fine without crashing. The thread group configured for send 50 concurrent requests. Below are the memory and thread usages.

@judy I think you will need to set appropriate memory for the tomcat.

1 Like