# HG changeset patch # User Sebastien Jodogne # Date 1718217817 -7200 # Node ID 296798e7589663698e8ee193649651e94111afe8 # Parent 118adbad648f1e3ca9998f4abb0a060e3f3e7646 publish software name and version in FHIR /metadata diff -r 118adbad648f -r 296798e75896 Samples/FHIR/pom.xml --- a/Samples/FHIR/pom.xml Wed Jun 12 14:44:37 2024 +0200 +++ b/Samples/FHIR/pom.xml Wed Jun 12 20:43:37 2024 +0200 @@ -68,6 +68,7 @@ 1.0.0 + execution1 initialize read-project-properties @@ -78,9 +79,20 @@ + + + + execution2 + generate-resources + + write-project-properties + + + ${project.build.outputDirectory}/app.properties + + - diff -r 118adbad648f -r 296798e75896 Samples/FHIR/src/main/java/ImagingStudyProvider.java --- a/Samples/FHIR/src/main/java/ImagingStudyProvider.java Wed Jun 12 14:44:37 2024 +0200 +++ b/Samples/FHIR/src/main/java/ImagingStudyProvider.java Wed Jun 12 20:43:37 2024 +0200 @@ -29,7 +29,6 @@ import ca.uhn.fhir.rest.server.IResourceProvider; import org.hl7.fhir.r5.model.IdType; import org.hl7.fhir.r5.model.ImagingStudy; -import org.hl7.fhir.r5.model.Patient; import java.util.ArrayList; import java.util.HashMap; diff -r 118adbad648f -r 296798e75896 Samples/FHIR/src/main/java/Main.java --- a/Samples/FHIR/src/main/java/Main.java Wed Jun 12 14:44:37 2024 +0200 +++ b/Samples/FHIR/src/main/java/Main.java Wed Jun 12 20:43:37 2024 +0200 @@ -23,20 +23,18 @@ import be.uclouvain.orthanc.Callbacks; -import be.uclouvain.orthanc.Functions; import ca.uhn.fhir.context.FhirContext; import ca.uhn.fhir.rest.server.HardcodedServerAddressStrategy; import ca.uhn.fhir.rest.server.IResourceProvider; import ca.uhn.fhir.rest.server.RestfulServer; -import org.json.JSONArray; -import org.json.JSONObject; import org.springframework.mock.web.MockServletConfig; +import java.io.IOException; +import java.io.InputStream; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; +import java.util.Properties; import javax.servlet.ServletException; @@ -44,6 +42,16 @@ Main() throws ServletException { setFhirContext(FhirContext.forR5()); + setServerName("Orthanc FHIR server"); + + try (InputStream is = Main.class.getResourceAsStream("app.properties")) { + Properties properties = new Properties(); + properties.load(is); + setServerVersion(properties.getProperty("orthanc_java.version")); + } catch (IOException e) { + // Ignore error + } + FhirConfiguration configuration = new FhirConfiguration(); setServerAddressStrategy(new HardcodedServerAddressStrategy(configuration.getServerBaseUrl())); diff -r 118adbad648f -r 296798e75896 Samples/FHIR/src/main/java/Toolbox.java --- a/Samples/FHIR/src/main/java/Toolbox.java Wed Jun 12 14:44:37 2024 +0200 +++ b/Samples/FHIR/src/main/java/Toolbox.java Wed Jun 12 20:43:37 2024 +0200 @@ -25,7 +25,6 @@ import org.hl7.fhir.r5.model.CodeableConcept; import org.hl7.fhir.r5.model.Reference; -import java.time.LocalDate; import java.util.Calendar; import java.util.Date; import java.util.GregorianCalendar;