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

Commit

Permalink
0.7.4
Browse files Browse the repository at this point in the history
  • Loading branch information
holger-stenzhorn committed Dec 8, 2021
1 parent 9a98988 commit db2bcde
Show file tree
Hide file tree
Showing 74 changed files with 41,077 additions and 41,001 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ docker run **ENVIRONMENTS** **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**

* `--odm.redcap.mapping` Print current mapping.

* `--odm.incompleteforms.allowed=true` Allow processing of incomplete forms.

* `--fhir.identifier.system.**TYPE**=**TYPE_IDENTIFIER_SYSTEM**` Add an identifier system with `**TYPE**` of `condition`, `consent`, `diagnosticreport`, `encounter`, `immunization`, `medicationstatement`, `observation`, `patient` or `procedure` (see [here](https://simplifier.net/guide/GermanCoronaConsensusDataSet-ImplementationGuide/TransactionBundle)).

* `--fhir.identifier.assigner=**IDENTIFIER_ASSIGNER**` Add an identifier assigner.
Expand Down
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ docker run **ENVIRONMENTS** **VOLUMES** ghcr.io/num-codex/odm2fhir **ARGUMENTS**

* `--odm.redcap.mapping` Print current mapping.

* `--odm.incompleteforms.allowed=true` Allow processing of incomplete forms.

* `--fhir.identifier.system.**TYPE**=**TYPE_IDENTIFIER_SYSTEM**` Add an identifier system with `**TYPE**` of `condition`, `consent`, `diagnosticreport`, `encounter`, `immunization`, `medicationstatement`, `observation`, `patient` or `procedure` (see [here](https://simplifier.net/guide/GermanCoronaConsensusDataSet-ImplementationGuide/TransactionBundle)).

* `--fhir.identifier.assigner=**IDENTIFIER_ASSIGNER**` Add an identifier assigner.
Expand Down
6 changes: 3 additions & 3 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.3</version>
<version>0.7.4</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.0</version>
<version>2.6.1</version>
</parent>

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

<hapi-fhir.version>5.6.0</hapi-fhir.version>
<hapi-fhir.version>5.6.1</hapi-fhir.version>
<jackson.version>2.13.0</jackson.version>
<lombok.version>1.18.22</lombok.version>
<spring-boot.version>${project.parent.version}</spring-boot.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class ODM2FHIRApplication implements CommandLineRunner {
private ODMProcessor odmProcessor;

@Autowired
BuildProperties buildProperties;
private BuildProperties buildProperties;

@Value("classpath:README.md")
private Path readme;
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/de/difuture/uds/odm2fhir/fhir/mapper/Form.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import static de.difuture.uds.odm2fhir.util.EnvironmentProvider.ENVIRONMENT;

import static org.apache.commons.lang3.StringUtils.equalsAny;
import static org.apache.commons.lang3.StringUtils.removeStart;

import static java.util.function.Predicate.not;

Expand All @@ -39,7 +40,7 @@ public abstract class Form {
@Getter
private StudyEvent studyEvent;

public abstract String getOID();
protected abstract String getOID();

protected abstract List<Item> getItems();

Expand All @@ -57,7 +58,7 @@ private boolean isComplete(FormData formData) {
return "demographie".equals(getOID()) ||
ENVIRONMENT.getProperty("odm.incompleteforms.allowed", Boolean.class, false) ||
// Check REDCap X_complete and DIS status field for complete (2), locked (4) or signed (5)
Stream.of(formData.getFormOID() + "_complete", "Status")
Stream.of(removeStart(formData.getFormOID(), "Form.") + "_complete", "Status")
.map(formData::getItemData)
.map(ItemData::getValue)
.anyMatch(value -> equalsAny(value, "2", "4", "5"));
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/de/difuture/uds/odm2fhir/fhir/mapper/Item.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
@Slf4j
public abstract class Item {

@Getter private Form form;
@Getter
private Form form;

public Stream<DomainResource> map(Form form, FormData formData) {
this.form = form;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

public class CardiovascularDiseases extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var itemGroupData = formData.getItemGroupData("anamnese_risikofaktoren.herzkreislauferkrankungen_bluthochdruck");
var generalPresence = formData.getItemData("herzkreislauferkrankungen");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

public class ChronicKidneyDiseases extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("chronische_nierenerkrankungen");
var stageCoding = formData.getItemData("chronische_nierenerkrankungen_schweregrad");
var generalCoding = formData.getItemData("chronische_nierenerkrankungen_code");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

public class ChronicLiverDiseases extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var itemGroupData = formData.getItemGroupData("anamnese_risikofaktoren.chronische_lebererkrankungen_fettleber");
var generalPresence = formData.getItemData("chronische_lebererkrankungen");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

public class ChronicLungDiseases extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var itemGroupData = formData.getItemGroupData("anamnese_risikofaktoren.chronische_lungenerkrankungen_asthma");
var generalPresence = formData.getItemData("chronische_lungenerkrankungen");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

public class ChronicNeurologicalMentalDiseases extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var itemGroupData = formData.getItemGroupData("anamnese_risikofaktoren.chronische_neurologische_oder_psychiatrische_erkrankungen_m_parkinson");
var generalPresence = formData.getItemData("chronische_neurologische_oder_psychiatrische_erkrankungen");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class DNROrder extends Item {

private static final String POLICY = "https://www.aerzteblatt.de/archiv/65440/DNR-Anordnungen-Das-fehlende-Bindeglied";

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("dnranordnung");

return answerCoding.isEmpty() ? Stream.empty() : Stream.of(createConsent(answerCoding));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class GastrointestinalUlcers extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("magengeschwure");
var generalCoding = formData.getItemData("magengeschwure_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class HIVInfection extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("bestehende_hivinfektion");
var generalCoding = formData.getItemData("bestehende_hivinfektion_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public class HistoryOfTravel extends Item {
STATES.put("DE-TH", "Thüringen");
}

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("reiseaktivitat");
var generalCoding = formData.getItemData("reiseaktivitat_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@

public class ImmunizationStatus extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var itemGroupData = formData.getItemGroupData("anamnese_risikofaktoren.impfungen_influenza");

return itemGroupData.isEmpty() ? Stream.empty() :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class MalignantNeoplasticDiseases extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("aktive_tumorkrebserkrankungen");
var generalCoding = formData.getItemData("aktive_tumorkrebserkrankungen_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

public class OrganRecipient extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var itemGroupData = formData.getItemGroupData("anamnese_risikofaktoren.organtransplantiert_herz");
var generalPresence = formData.getItemData("organtransplantiert");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@

public class RespiratoryTherapies extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("bestehende_sauerstoff_oder_beatmungstherapie");
var generalCoding = formData.getItemData("bestehende_sauerstoff_oder_beatmungstherapie_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

public class RheumatologicalImmunologicalDiseases extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var itemGroupData = formData.getItemGroupData("anamnese_risikofaktoren.rheumatologischeimmunologische_erkrankungen_chronisch_entzuendl_darmerkrankung");
var generalPresence = formData.getItemData("rheumatologischeimmunologische_erkrankungen");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class SmokingStatus extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("raucherstatus");
var generalCoding = formData.getItemData("raucherstatus_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public class ComplicationConditions extends Item {
"lungenarterienembolie", "stroke", "myokardinfarkt",
"andere", "pulmonale_co_infektionen", "blutstrominfektionen");

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var generalComplicationCoding = formData.getItemData("komplikation_code");

return !"1".equals(formData.getItemData("komplikation").getValue()) ? Stream.empty() :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@
import static de.difuture.uds.odm2fhir.fhir.util.CommonCodeSystem.LOINC;
import static de.difuture.uds.odm2fhir.fhir.util.CommonStructureDefinition.GERMAN_CONSENT;

import static java.util.function.Predicate.not;
import static java.util.stream.Collectors.toList;

import static org.apache.commons.lang3.StringUtils.removeStart;
import static org.apache.commons.lang3.time.DateUtils.addYears;

Expand All @@ -48,6 +45,9 @@
import static org.hl7.fhir.r4.model.Consent.ConsentState.REJECTED;
import static org.hl7.fhir.r4.model.codesystems.ResourceTypes.CONSENT;

import static java.util.function.Predicate.not;
import static java.util.stream.Collectors.toList;

public class BroadConsent extends Item {

private static final List<String> ELEMENTS = List.of("erhebung_verarbeitung", "krankenkassendaten_retro",
Expand Down Expand Up @@ -103,7 +103,7 @@ public class BroadConsent extends Item {
OIDS.put("projekt_codex_zusatz_4", 38);
}

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var consentPresented = formData.getItemData("miibc_vorlage"); //1=Yes, 2=No, 3=Unknown

return !"1".equals(consentPresented.getValue()) ? Stream.empty() : Stream.of(createConsent(formData));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

public class Age extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("alter");

// TODO Age should not be attached to a patient but rather to an encounter...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class BiologicalSex extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("biologisches_geschlecht");
var generalCoding = formData.getItemData("biologisches_geschlecht_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class BodyHeight extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("korpergrose");
var generalCoding = formData.getItemData("korpergrose_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class BodyWeight extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("gewicht");
var generalCoding = formData.getItemData("gewicht_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public class DateOfBirth extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
getPatient().setBirthDateElement(createDateType(formData.getItemData("geburtsdatum")));

return Stream.empty();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

public class EthnicGroup extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("ethnische_zugehorigkeit");

var coding = createCoding(answerCoding);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

public class FrailtyScore extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("frailtyscore");
var generalCoding = formData.getItemData("frailtyscore_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

public class PregnancyStatus extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("schwangerschaft");
var generalCoding = formData.getItemData("schwangerschaft_code");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

public class ImagingProcedures extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var techniqueGroup = formData.getItemGroupData("bildgebung.bildgebende_verfahren_ct");
var befundGroup = formData.getItemGroupData("bildgebung.befund_bildgebender_verfahren_ct");
var generalCoding = formData.getItemData("bildgebende_verfahren");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public class LaboratoryValue extends Item {
"ptt", "thrombozyten_absolut", "inr", "serumalbumin", "antithrombin_iii",
"pct_procalcitonin", "il6_interleukin_6", "ntprobnp", "fibrinogen");

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
return PARAMETERS.stream()
.map(formData::getItemData)
.filter(not(ItemData::isEmpty))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class SARSCoV2Antibodies extends Item {
"ig_m_ia_ql", SARS_COV_2_IGM_SER_PL_QL_IA,
"ig_m_ia_qn", SARS_COV_2_IGM_SER_PL_IA_ACNC);

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
// Extremely ugly and hacky workaround for non-existent panel parameter in form... :-/
return PARAMETERS.stream()
.map(key -> "sarsco_v2_covid19_" + key)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

public class SARSCoV2RTPCR extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var dateCoding = formData.getItemData("labor_datum");
var generalCoding = formData.getItemData("sarsco_v2rtpcr_code");
var answerCoding = formData.getItemData("sarsco_v2rtpcr");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

public class ACEInhibitors extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var answerCoding = formData.getItemData("acehemmer");
var generalCoding = formData.getItemData("acehemmer_code");
var dateCoding = formData.getItemData("medikation_datum");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

public class Anticoagulation extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var itemGroupData = formData.getItemGroupData("medikation.antikoagulation_absicht");
var generalPresence = formData.getItemData("antikoagulation");
var generalCoding = formData.getItemData("antikoagulation_code");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

public class COVID19Therapy extends Item {

public Stream<DomainResource> map(FormData formData) {
protected Stream<DomainResource> map(FormData formData) {
var itemGroupData = formData.getItemGroupData("medikation.covid19therapie_antipyretika");
var generalPresence = formData.getItemData("covid19therapie");
var dateCoding = formData.getItemData("medikation_datum");
Expand Down
Loading

0 comments on commit db2bcde

Please sign in to comment.