Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
0.7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
holger-stenzhorn committed Mar 19, 2022
1 parent 7b1f12b commit 6e29b27
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 17 deletions.
23 changes: 9 additions & 14 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

<groupId>de.difuture.uds</groupId>
<artifactId>odm2fhir</artifactId>
<version>0.7.5</version>
<version>0.7.6</version>

<name>ODM2FHIR</name>
<description>Mapper for GECCO based study/patient data in CDISC ODM to HL7 FHIR</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.6.1</version>
<version>2.6.4</version>
</parent>

<properties>
Expand All @@ -25,26 +25,21 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<hapi-fhir.version>5.6.1</hapi-fhir.version>
<jackson.version>2.13.0</jackson.version>
<log4j.version>2.15.0</log4j.version>
<hapi-fhir.version>5.7.0</hapi-fhir.version>
<jackson.version>2.13.2</jackson.version>
<kafka-fhir-serializer.version>1.0.2</kafka-fhir-serializer.version>
<lombok.version>1.18.22</lombok.version>
<spring-boot.version>${project.parent.version}</spring-boot.version>
<spring-retry.version>1.3.1</spring-retry.version>
<woodstox.version>6.2.7</woodstox.version>
<spring-retry.version>1.3.2</spring-retry.version>
<woodstox.version>6.2.8</woodstox.version>

<maven-antrun-plugin.version>3.0.0</maven-antrun-plugin.version>
<maven-compiler-plugin.version>3.8.1</maven-compiler-plugin.version>
<maven-compiler-plugin.version>3.9.0</maven-compiler-plugin.version>
<maven-project-info-reports-plugin.version>3.1.2</maven-project-info-reports-plugin.version>
<maven-site-plugin.version>3.9.1</maven-site-plugin.version>
<maven-site-plugin.version>3.10.0</maven-site-plugin.version>
</properties>

<dependencies>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-to-slf4j</artifactId>
<version>${log4j.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/de/difuture/uds/odm2fhir/fhir/mapper/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import org.hl7.fhir.r4.model.Meta;
import org.hl7.fhir.r4.model.Patient;
import org.hl7.fhir.r4.model.Quantity;
import org.hl7.fhir.r4.model.Quantity.QuantityComparator;
import org.hl7.fhir.r4.model.Reference;
import org.hl7.fhir.r4.model.StringType;
import org.hl7.fhir.r4.model.codesystems.AdministrativeGender;
Expand Down Expand Up @@ -85,6 +86,7 @@
import static de.difuture.uds.odm2fhir.util.EnvironmentProvider.ENVIRONMENT;

import static org.apache.commons.codec.digest.DigestUtils.sha256Hex;
import static org.apache.commons.lang3.StringUtils.defaultString;
import static org.apache.commons.lang3.StringUtils.isBlank;
import static org.apache.commons.lang3.StringUtils.split;
import static org.apache.commons.lang3.StringUtils.splitByWholeSeparator;
Expand Down Expand Up @@ -419,11 +421,23 @@ protected final Age createAge(ItemData itemData) {
}

protected final Quantity createQuantity(ItemData itemData, String code, String unit) {
return createQuantity(itemData, null, code, unit);
}

protected final Quantity createQuantity(ItemData itemData, String comparator, String code, String unit) {
var quantity = new Quantity();

if (itemData != null && !itemData.isEmpty()) {
try {
quantity.setValue(new BigDecimal(itemData.getValue().replace(',', '.')))
.setComparator(QuantityComparator.fromCode(
switch (defaultString(comparator)) {
case "1" -> "<";
case "2" -> "<=";
case "3" -> ">=";
case "4" -> ">";
default -> null;
}))
.setSystem(UCUM.getUrl()).setCode(code).setUnit(unit);
} catch (RuntimeException runtimeException) {
logInvalidValue(QUANTITY, itemData);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ private Observation createObservation(FormData formData, ItemData labValue) {
observation.setCode(new CodeableConcept()
.setCoding(codings)
.setText(labValueName)) //add Parameter Name as Text
.setValue(createQuantity(formData.getItemData(labValueName), unit, unit));
.setValue(createQuantity(formData.getItemData(labValueName),
formData.getItemData(labValueName + "_comparator").getValue(), unit, unit));
}

}
29 changes: 28 additions & 1 deletion src/main/resources/odm/redcap/datadictionary-pre.csv

Large diffs are not rendered by default.

Loading

0 comments on commit 6e29b27

Please sign in to comment.