Skip to content

Commit

Permalink
#414: further lib updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ohr committed Jan 29, 2024
1 parent 8216cd8 commit af18eda
Show file tree
Hide file tree
Showing 17 changed files with 120 additions and 68 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import reactor.netty.DisposableChannel;
import reactor.netty.internal.util.Metrics;
import reactor.netty.tcp.TcpServer;
import reactor.util.Metrics;

import java.time.Duration;
import java.util.Map;
Expand Down Expand Up @@ -63,7 +63,7 @@ public TlsSyslogServer doStart(String host, int port) {
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000)
.option(ChannelOption.RCVBUF_ALLOCATOR, new FixedRecvByteBufAllocator(65535))
.wiretap(getClass().getName(), LogLevel.TRACE)
.metrics(Metrics.isInstrumentationAvailable())
.metrics(Metrics.isMicrometerAvailable())
.secure(spec -> spec.sslContext(sslContext))
.doOnBind(serverBootstrap -> LOG.info("TLS Syslog Server is about to be started"))
.doOnBound(disposableServer -> LOG.info("TLS Syslog Server bound on {}", disposableServer.address()))
Expand Down
4 changes: 4 additions & 0 deletions commons/ihe/fhir/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation</artifactId>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-caching-caffeine</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.woodstox</groupId>
<artifactId>woodstox-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public Optional<? extends IBaseReference> patientReferenceFromResource(IBaseReso
try {
return SearchParameterUtil.getOnlyPatientSearchParamForResourceType(fhirContext, resourceDefinition.getName())
.map(RuntimeSearchParam::getPath)
.flatMap(path -> fhirContext.newFhirPath().evaluateFirst(resource, simplifyPath(path), IBaseReference.class));
.map(this::simplifyPath)
.flatMap(path -> fhirContext.newFhirPath().evaluateFirst(resource, path, IBaseReference.class));
} catch (Exception e) {
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.openehealth.ipf.commons.ihe.hl7v2.definitions.pam.v25.segment;

import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.model.AbstractSegment;
import ca.uhn.hl7v2.model.Group;
import ca.uhn.hl7v2.model.v25.datatype.*;
Expand Down Expand Up @@ -42,15 +43,19 @@ public class ZBE extends AbstractSegment {
public ZBE(Group parent, ModelClassFactory factory) {
super(parent, factory);
var message = getMessage();
add(EI.class, true, 0, 427, new Object[] { message }, "Movement ID");
add(TS.class, true, 1, 26, new Object[] { message }, "Start Movement Date/Time");
add(TS.class, false, 1, 26, new Object[] { message }, "End Movement Date/Time");
add(ST.class, true, 1, 6, new Object[] { message }, "Movement Action");
add(ID.class, true, 1, 1, new Object[] { message }, "Historical Movement Indicator");
add(ID.class, false, 1, 3, new Object[] { message }, "Original trigger event code");
add(XON.class, false, 1, 567, new Object[] { message }, "Responsible Ward");
add(XON.class, false, 1, 567, new Object[] { message }, "Responsible Nursing Ward");
add(CWE.class, false, 1, 3, new Object[] { message }, "Movement Scope");
try {
add(EI.class, true, 0, 427, new Object[] { message }, "Movement ID");
add(TS.class, true, 1, 26, new Object[] { message }, "Start Movement Date/Time");
add(TS.class, false, 1, 26, new Object[] { message }, "End Movement Date/Time");
add(ST.class, true, 1, 6, new Object[] { message }, "Movement Action");
add(ID.class, true, 1, 1, new Object[] { message }, "Historical Movement Indicator");
add(ID.class, false, 1, 3, new Object[] { message }, "Original trigger event code");
add(XON.class, false, 1, 567, new Object[] { message }, "Responsible Ward");
add(XON.class, false, 1, 567, new Object[] { message }, "Responsible Nursing Ward");
add(CWE.class, false, 1, 3, new Object[] { message }, "Movement Scope");
} catch(HL7Exception e) {
log.error("Unexpected error creating ZBE - this is probably a bug in the source code generator.", e);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import ca.uhn.hl7v2.model.Type;
import ca.uhn.hl7v2.model.v25.datatype.*;
import ca.uhn.hl7v2.parser.ModelClassFactory;
import org.openehealth.ipf.modules.hl7.HL7v2Exception;


/**
Expand All @@ -46,14 +47,18 @@ public class QPD extends AbstractSegment {
public QPD(Group parentGroup, ModelClassFactory modelFactory) {
super(parentGroup, modelFactory);
var msg = getMessage();
add(CE.class, true, 1, 250, new Object[]{msg}, "Message Query Name");
add(ST.class, true, 1, 32, new Object[]{msg}, "Query Tag");
add(QIP.class, true, 0, 256, new Object[]{msg}, "Demographics Fields");
add(NM.class, false, 1, 16, new Object[]{msg}, "Search Confidence Threshold");
add(ST.class, false, 1, 199, new Object[]{msg}, "Algorithm Name");
add(ST.class, false, 1, 199, new Object[]{msg}, "Algorithm Version");
add(ST.class, false, 1, 199, new Object[]{msg}, "Algorithm Description");
add(CX.class, false, 0, 256, new Object[]{msg}, "What domains returned");
try {
add(CE.class, true, 1, 250, new Object[]{msg}, "Message Query Name");
add(ST.class, true, 1, 32, new Object[]{msg}, "Query Tag");
add(QIP.class, true, 0, 256, new Object[]{msg}, "Demographics Fields");
add(NM.class, false, 1, 16, new Object[]{msg}, "Search Confidence Threshold");
add(ST.class, false, 1, 199, new Object[]{msg}, "Algorithm Name");
add(ST.class, false, 1, 199, new Object[]{msg}, "Algorithm Version");
add(ST.class, false, 1, 199, new Object[]{msg}, "Algorithm Description");
add(CX.class, false, 0, 256, new Object[]{msg}, "What domains returned");
} catch (HL7Exception e) {
throw new HL7v2Exception(e);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@
*/
package org.openehealth.ipf.commons.ihe.hl7v2.definitions.pix.v25.segment;

import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.model.AbstractSegment;
import ca.uhn.hl7v2.model.Group;
import ca.uhn.hl7v2.model.Type;
import ca.uhn.hl7v2.model.v25.datatype.CE;
import ca.uhn.hl7v2.model.v25.datatype.CX;
import ca.uhn.hl7v2.model.v25.datatype.ST;
import ca.uhn.hl7v2.parser.ModelClassFactory;

import org.openehealth.ipf.modules.hl7.HL7v2Exception;


/**
Expand All @@ -43,10 +44,14 @@ public class QPD extends AbstractSegment {
public QPD(Group parentGroup, ModelClassFactory modelFactory) {
super(parentGroup, modelFactory);
var msg = getMessage();
add(CE.class, true, 1, 250, new Object[]{msg}, "Message Query Name");
add(ST.class, true, 1, 32, new Object[]{msg}, "Query Tag");
add(CX.class, true, 1, 256, new Object[]{msg}, "Person Identifier");
add(CX.class, false, 0, 256, new Object[]{msg}, "What domains returned");
try {
add(CE.class, true, 1, 250, new Object[]{msg}, "Message Query Name");
add(ST.class, true, 1, 32, new Object[]{msg}, "Query Tag");
add(CX.class, true, 1, 256, new Object[]{msg}, "Person Identifier");
add(CX.class, false, 0, 256, new Object[]{msg}, "What domains returned");
} catch (HL7Exception e) {
throw new HL7v2Exception(e);
}
}

/**
Expand Down
35 changes: 23 additions & 12 deletions dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,38 +11,38 @@
<gpg-plugin-version>1.6</gpg-plugin-version>
<bouncycastle-version>1.76</bouncycastle-version>
<brave-version>5.16.0</brave-version>
<camel-version>4.0.3</camel-version>
<camel-version>4.3.0</camel-version>
<!-- resolve dependency convergence between guava and hapi caffeine -->
<checker-qual-version>3.19.0</checker-qual-version>
<cxf-version>4.0.3</cxf-version>
<commons-io-version>2.15.0</commons-io-version>
<equinox-app.version>1.3.200-v20130910-1609</equinox-app.version>
<equinox-common.version>3.6.200-v20130402-1505</equinox-common.version>
<groovy-version>4.0.15</groovy-version>
<groovy-version>4.0.18</groovy-version>
<hapi-version>2.5.1</hapi-version>
<hapi-fhir-version>6.11.7-SNAPSHOT</hapi-fhir-version>
<hapi-fhir-version>7.0.0-SNAPSHOT</hapi-fhir-version>
<herasaf-version>3.0.2</herasaf-version>
<ipf-gazelle-version>3.0-SNAPSHOT</ipf-gazelle-version>
<ipf-oht-mdht-version>1.2.0.201212201425</ipf-oht-mdht-version>
<!-- hapi-fhir already require jackson 2.15 while spring-boot is on 2.13 -->
<jackson-version>2.15.3</jackson-version>
<jaxb-version>4.0.4 </jaxb-version>
<jackson-version>2.16.0</jackson-version>
<jaxb-version>4.0.4</jaxb-version>
<jakarta-jwsapi-version>3.0.0</jakarta-jwsapi-version>
<jdom-version>2.0.6.1</jdom-version>
<kotlin.dokka.version>1.8.10</kotlin.dokka.version>
<kotlin.version>1.9.10</kotlin.version>
<kotlin.logging.version>3.0.5</kotlin.logging.version>
<methanol-version>1.7.0</methanol-version>
<ph-schematron-version>5.6.5</ph-schematron-version>
<ph-commons-version>9.5.5</ph-commons-version>
<ph-schematron-version>7.1.2</ph-schematron-version>
<ph-commons-version>11.1.0</ph-commons-version>
<saxon-he-version>12.3</saxon-he-version>
<simple-syslog-version>0.0.16</simple-syslog-version>
<spring-boot-version>3.2.0</spring-boot-version>
<spring-boot-version>3.2.2</spring-boot-version>
<velocity-version>2.3</velocity-version>
<vertx-version>4.3.8</vertx-version>
<vibur-version>25.0</vibur-version>
<woodstox-version>6.5.1</woodstox-version>
<xmlsec-version>3.0.2</xmlsec-version>
<xmlsec-version>4.0.1</xmlsec-version>


</properties>
Expand Down Expand Up @@ -98,6 +98,17 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-caching-caffeine</artifactId>
<version>${hapi-fhir-version}</version>
<exclusions>
<exclusion>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-bom</artifactId>
Expand Down Expand Up @@ -400,8 +411,8 @@
<version>${jakarta-jwsapi-version}</version>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<artifactId>ph-schematron</artifactId>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-xslt</artifactId>
<version>${ph-schematron-version}</version>
<exclusions>
<exclusion>
Expand All @@ -411,7 +422,7 @@
</exclusions>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.commons</groupId>
<artifactId>ph-commons</artifactId>
<version>${ph-commons-version}</version>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/
package org.openehealth.ipf.modules.hl7.parser.test.hl7v2.def.v25.segment;

import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.model.AbstractSegment;
import ca.uhn.hl7v2.model.Group;
import ca.uhn.hl7v2.model.v25.datatype.EI;
Expand Down Expand Up @@ -44,10 +45,14 @@ public class ZBE extends AbstractSegment {
public ZBE(Group parent, ModelClassFactory factory) {
super(parent, factory);
var message = getMessage();
add(EI.class, true, 0, 999, new Object[] { message }, null);
add(TS.class, true, 1, 26, new Object[] { message }, null);
add(TS.class, false, 1, 26, new Object[] { message }, null);
add(ST.class, true, 1, 10, new Object[] { message }, null);
try {
add(EI.class, true, 0, 999, new Object[] { message }, null);
add(TS.class, true, 1, 26, new Object[] { message }, null);
add(TS.class, false, 1, 26, new Object[] { message }, null);
add(ST.class, true, 1, 10, new Object[] { message }, null);
} catch(HL7Exception e) {
log.error("Unexpected error creating ZBE - this is probably a bug in the source code generator.", e);
}
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@
*/
package org.openehealth.ipf.platform.camel.core.config;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.openehealth.ipf.commons.core.config.OrderedConfigurer;
Expand Down Expand Up @@ -59,11 +61,16 @@ public void configure(CustomRouteBuilder customRouteBuilder) throws Exception{
if (customRouteBuilder.getIntercepted() != null) {
var intercepted = customRouteBuilder.getIntercepted();
customRouteBuilder.setCamelContext(camelContext);
customRouteBuilder.setRouteCollection(intercepted.getRouteCollection());
customRouteBuilder.setTemplatedRouteCollection(intercepted.getTemplatedRouteCollection());
customRouteBuilder.setRouteTemplateCollection(intercepted.getRouteTemplateCollection());
customRouteBuilder.setRestCollection(intercepted.getRestCollection());
customRouteBuilder.errorHandler(intercepted.getErrorHandlerFactory());
customRouteBuilder.setErrorHandlerFactory(intercepted.getErrorHandlerFactory());

// must invoke configure on the original builder so it adds its configuration to me
Field f1 = RouteBuilder.class.getDeclaredField("routeCollection");
f1.setAccessible(true);
f1.set(customRouteBuilder, intercepted.getRouteCollection());

// must invoke configure on the original builder, so it adds its configuration to me
customRouteBuilder.configure();

} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.openehealth.ipf.platform.camel.ihe.fhir.core.custom;

import org.apache.camel.Category;
import org.apache.camel.spi.UriEndpoint;
import org.openehealth.ipf.commons.ihe.fhir.audit.FhirAuditDataset;
import org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer;
Expand All @@ -26,7 +27,7 @@
* @author Christian Ohr
* @since 3.1
*/
@UriEndpoint(scheme = "fhir", title = "Generic FHIR", syntax = "fhir:host:port", consumerClass = FhirConsumer.class, label = "http")
@UriEndpoint(scheme = "fhir", title = "Generic FHIR", syntax = "fhir:host:port", category = Category.HTTP)
public class CustomFhirEndpoint<AuditDatasetType extends FhirAuditDataset>
extends FhirEndpoint<AuditDatasetType, CustomFhirComponent<AuditDatasetType>> {

Expand Down
6 changes: 3 additions & 3 deletions platform-camel/ihe/fhir/r4/chppqm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<artifactId>ph-schematron</artifactId>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-xslt</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.commons</groupId>
<artifactId>ph-commons</artifactId>
<scope>test</scope>
</dependency>
Expand Down
6 changes: 3 additions & 3 deletions platform-camel/ihe/fhir/r4/mhd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<artifactId>ph-schematron</artifactId>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-xslt</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.commons</groupId>
<artifactId>ph-commons</artifactId>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.openehealth.ipf.platform.camel.ihe.fhir.iti83;

import org.apache.camel.Category;
import org.apache.camel.spi.UriEndpoint;
import org.openehealth.ipf.commons.ihe.fhir.audit.FhirQueryAuditDataset;
import org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer;
Expand All @@ -28,7 +29,7 @@
* @author Christian Ohr
* @since 3.1
*/
@UriEndpoint(scheme = "pixm-iti83", title = "ITI-83 PIXm", syntax = "pixm-iti83:host:port", consumerClass = FhirConsumer.class, label = "http")
@UriEndpoint(scheme = "pixm-iti83", title = "ITI-83 PIXm", syntax = "pixm-iti83:host:port", category = Category.HTTP)
public class Iti83Endpoint extends FhirEndpoint<FhirQueryAuditDataset, Iti83Component> {

public Iti83Endpoint(String uri, Iti83Component fhirComponent, FhirEndpointConfiguration<FhirQueryAuditDataset> config) {
Expand Down
6 changes: 3 additions & 3 deletions platform-camel/ihe/fhir/stu3/mhd/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,12 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<artifactId>ph-schematron</artifactId>
<groupId>com.helger.schematron</groupId>
<artifactId>ph-schematron-xslt</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.helger</groupId>
<groupId>com.helger.commons</groupId>
<artifactId>ph-commons</artifactId>
<scope>test</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package org.openehealth.ipf.platform.camel.ihe.fhir.iti83;

import org.apache.camel.Category;
import org.apache.camel.spi.UriEndpoint;
import org.openehealth.ipf.commons.ihe.fhir.audit.FhirQueryAuditDataset;
import org.openehealth.ipf.platform.camel.ihe.fhir.core.FhirConsumer;
Expand All @@ -28,7 +29,7 @@
* @author Christian Ohr
* @since 3.1
*/
@UriEndpoint(scheme = "pixm-iti83", title = "ITI-83 PIXm", syntax = "pixm-iti83:host:port", consumerClass = FhirConsumer.class, label = "http")
@UriEndpoint(scheme = "pixm-iti83", title = "ITI-83 PIXm", syntax = "pixm-iti83:host:port", category = Category.HTTP)
public class Iti83Endpoint extends FhirEndpoint<FhirQueryAuditDataset, Iti83Component> {

public Iti83Endpoint(String uri, Iti83Component fhirComponent, FhirEndpointConfiguration<FhirQueryAuditDataset> config) {
Expand Down
Loading

0 comments on commit af18eda

Please sign in to comment.