hapifhir / hapi-fhir-jpaserver-starter

Apache License 2.0
379 stars 1.02k forks source link

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

Closed adnaanbheda closed 8 months ago

adnaanbheda commented 2 years ago

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.

XcrigX commented 2 years ago

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.

ibrohimislam commented 2 years ago

@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.