Stream: hapi
Topic: custom fhirversion.properties
Christopher Schuler (Oct 11 2016 at 21:06):
Hi,
I am trying to load a custom fhirversion.properties file for dstu2 fhir structures. What is the proper way to do this?
Christopher Schuler (Oct 12 2016 at 16:08):
Perhaps I am being too vague. I have a custom model that extends many of the Hapi ca.uhn.fhir.model.dstu2.resource classes. For data retrieval, I need to map some of these classes to my model's resource classes using my own fhirversion.properties file instead of the default one. I have tried several methods within Gradle to replace the properties file with my own, but can't get it to work. I was wondering if there was some mechanism within Hapi to say "hey the fhirversion.properties I want to use is here".
Thanks
Christopher Schuler (Oct 13 2016 at 05:38):
I think I have figured it out.
I put the fhirversion.properties file in src\main\java\ca\uhn\fhir\model\dstu2 folder and used the following code:
...
setFhirContext(FhirContext.forDstu2());
Properties loader = new Properties();
loader.load(getFhirContext().getVersion().getFhirVersionPropertiesFile());
...
That effectively loads the properties file and maps correctly.
Last updated: Apr 12 2022 at 19:14 UTC