hapi-fhir-jpaserver-starter icon indicating copy to clipboard operation
hapi-fhir-jpaserver-starter copied to clipboard

How can I modify code in hapi-fhir and deploy?

Open adnaanbheda opened this issue 3 years ago • 2 comments

I don't know if would be called an "issue" as such, but I couldn't find documentation regarding modifying the behavior of one of the modules in hapi-fhir and deploying the build using the starter code.

I specifically want to modify the ValueSet expansion behaviour and how the filter parameter works

I see that pom.xml lists the dependency but how would I point to a local build?

I'm new to the Java ecosystem so please bear with me !

Thanks.

adnaanbheda avatar Mar 17 '22 06:03 adnaanbheda

This is going to be semi-difficult if you're new to Java/Maven, and will likely be a pain to maintain. It may be cleaner/easier to make your modified feature a custom operation instead of trying to override the default $expand behavior. That way it's distinct and you don't have to mess with the base libraries and keeping it up to date as those base libraries change (merging changes, etc). see: https://github.com/hapifhir/hapi-fhir-jpaserver-starter#adding-custom-operations

But if you did want to try to do it, it would go something like this. You'll want to change the pom.xml version of the base HAPI project you want to modify to some custom version. (i.e. 5.4.0-customexpand). Then you install that custom build (after you've modified $expand) to your local maven repository. From the directory with your custom version pom, you'd run something like: 'mvn clean install'

Once that's done, your custom version is available in your local maven repo and you can change the version in the jpa-starter pom to import your custom version instead of the default version.

XcrigX avatar Mar 22 '22 22:03 XcrigX

@adnaanbheda you can mvn install (read:https://maven.apache.org/plugins/maven-install-plugin/) on hapi-fhir. and then set the hapi-fhir-jpaserver-starter pom.xml to the same version as hapi-fhir.

ibrohimislam avatar Apr 18 '22 20:04 ibrohimislam