Skip to content

Commit

Permalink
Advances hapi versions and skips xhtml fields (#1240)
Browse files Browse the repository at this point in the history
  • Loading branch information
bashir2 authored Nov 15, 2024
1 parent f0d0a6c commit d42c792
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import org.apache.avro.Schema;
import org.apache.avro.Schema.Field;
import org.apache.avro.generic.IndexedRecord;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.collections4.CollectionUtils;
import org.hl7.fhir.instance.model.api.IBaseResource;

/** Converter to change HAPI objects into Avro structures and vice versa. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ public Schema getDataType() {
.put("time", STRING_CONVERTER)
.put("string", STRING_CONVERTER)
.put("oid", STRING_CONVERTER)
// Note `xhtml` types are currently skipped because of:
// https://github.com/google/fhir-data-pipes/issues/1014
.put("xhtml", STRING_CONVERTER)
.put("decimal", DOUBLE_CONVERTER)
.put("integer", INTEGER_CONVERTER)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,13 @@ protected Object fromHapi(IPrimitiveType primitive) {

@Override
public Object fromHapi(Object input) {

// TODO: remove this hack! It is added to address this bug:
// https://github.com/google/fhir-data-pipes/issues/1014
// with root cause being:
// https://github.com/hapifhir/org.hl7.fhir.core/issues/1800
if (!(input instanceof IPrimitiveType)) {
return "";
}
return fromHapi((IPrimitiveType) input);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public abstract class StructureDefinitions {
.add("time")
.add("string")
.add("oid")
// Note `xhtml` types are currently skipped because of:
// https://github.com/google/fhir-data-pipes/issues/1014
.add("xhtml")
.add("decimal")
.add("integer")
Expand Down
8 changes: 7 additions & 1 deletion bunsen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

<properties>
<compile.source>11</compile.source>
<hapi.fhir.version>7.2.2</hapi.fhir.version>
<hapi.fhir.version>7.4.5</hapi.fhir.version>
<avro.version>1.12.0</avro.version>
<junit.version>4.13.2</junit.version>
<hamcrest.version>3.0</hamcrest.version>
Expand Down Expand Up @@ -90,6 +90,12 @@
<artifactId>jackson-core</artifactId>
<version>2.18.1</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.hl7.fhir.r4.utils.FHIRLexer.FHIRLexerException;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.junit.MockitoJUnitRunner;
Expand Down Expand Up @@ -144,7 +143,7 @@ public void runAllTests() throws IOException {
String.format(
"Number of rows does not match %d vs %d", totalRows, expectedRows.getNumRows()),
totalRows == expectedRows.getNumRows());
} catch (ViewApplicationException | ViewDefinitionException | FHIRLexerException e) {
} catch (ViewApplicationException | ViewDefinitionException e) {
assertThat(
"View exceptions were thrown while none was expected!", expectedRows == null);
}
Expand Down
8 changes: 7 additions & 1 deletion pipelines/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<junit.version>4.13.2</junit.version>
<slf4j.version>2.0.16</slf4j.version>
<logback.version>1.5.12</logback.version>
<hapi.fhir.version>7.2.2</hapi.fhir.version>
<hapi.fhir.version>7.4.5</hapi.fhir.version>
<hamcrest.version>3.0</hamcrest.version>
<mockito.version>5.2.0</mockito.version>
<jcommander.version>1.82</jcommander.version>
Expand Down Expand Up @@ -233,6 +233,12 @@
<artifactId>jackson-core</artifactId>
<version>2.18.1</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.4</version>
</dependency>
</dependencies>

<build>
Expand Down

0 comments on commit d42c792

Please sign in to comment.