Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #519 from ehrbase/bugfix/issues_514_and_516
Browse files Browse the repository at this point in the history
Bugfix/516 unexpected error
  • Loading branch information
subigre authored Oct 20, 2021
2 parents 285730a + 6e0bb17 commit 6499227
Show file tree
Hide file tree
Showing 212 changed files with 1,395 additions and 752 deletions.
228 changes: 114 additions & 114 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,120 +32,120 @@ workflows:
# - release

# WORKFLOW 2/2 Build, Fully Test & Analyze FHIR-bridge code
# QUALITY-GATE-II:
# jobs:
# - build-test-analyse-fhirbridge:
# context: org-global
# filters:
# branches:
# ignore: gh-pages
#
# # Execute Robot Integration Tests (Parallel Execution)
# - BUNDLE-tests:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# ignore: gh-pages
#
# - CONDITION-tests:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# ignore: gh-pages
#
# - CONSENT-tests:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# ignore: gh-pages
#
# - DIAGNOSTIC-tests:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# ignore: gh-pages
#
# - IMMUNIZATION-tests:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# ignore: gh-pages
#
# - MEDICATIONSTATEMENT-tests:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# ignore: gh-pages
#
# - OBSERVATION-tests:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# ignore: gh-pages
#
# - PROCEDURE-tests:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# ignore: gh-pages
#
# - QUESTIONAIRE-tests:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# ignore: gh-pages
#
# - ROBOT-TEST-REPORT:
# context: org-global
# requires:
# - BUNDLE-tests
# - CONDITION-tests
# - CONSENT-tests
# - DIAGNOSTIC-tests
# - IMMUNIZATION-tests
# - MEDICATIONSTATEMENT-tests
# - OBSERVATION-tests
# - PROCEDURE-tests
# - QUESTIONAIRE-tests
#
#
# - tag-version:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# only:
# - /^(release\/v\d+\.\d+\.\d+|hotfix\/v\d+\.\d+\.\d+)$/
#
#
# - build-and-deploy:
# context: org-global
# requires:
# - build-test-analyse-fhirbridge
# filters:
# branches:
# only:
# - /^(release\/v\d+\.\d+\.\d+|hotfix\/v\d+\.\d+\.\d+|master|develop)$/
#
QUALITY-GATE-II:
jobs:
- build-test-analyse-fhirbridge:
context: org-global
filters:
branches:
ignore: gh-pages

# Execute Robot Integration Tests (Parallel Execution)
- BUNDLE-tests:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
ignore: gh-pages

- CONDITION-tests:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
ignore: gh-pages

- CONSENT-tests:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
ignore: gh-pages

- DIAGNOSTIC-tests:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
ignore: gh-pages

- IMMUNIZATION-tests:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
ignore: gh-pages

- MEDICATIONSTATEMENT-tests:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
ignore: gh-pages

- OBSERVATION-tests:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
ignore: gh-pages

- PROCEDURE-tests:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
ignore: gh-pages

- QUESTIONAIRE-tests:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
ignore: gh-pages

- ROBOT-TEST-REPORT:
context: org-global
requires:
- BUNDLE-tests
- CONDITION-tests
- CONSENT-tests
- DIAGNOSTIC-tests
- IMMUNIZATION-tests
- MEDICATIONSTATEMENT-tests
- OBSERVATION-tests
- PROCEDURE-tests
- QUESTIONAIRE-tests


- tag-version:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
only:
- /^(release\/v\d+\.\d+\.\d+|hotfix\/v\d+\.\d+\.\d+)$/


- build-and-deploy:
context: org-global
requires:
- build-test-analyse-fhirbridge
filters:
branches:
only:
- /^(release\/v\d+\.\d+\.\d+|hotfix\/v\d+\.\d+\.\d+|master|develop)$/

#
#
# - deploy-testdocs-githup-pages:
Expand Down
16 changes: 11 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<maven-jacoco-plugin.version>0.8.5</maven-jacoco-plugin.version>
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
<minio.version>8.3.1</minio.version>
<okhttp.version>4.9.2</okhttp.version>
<saxon.version>10.5</saxon.version>
<spring-boot.version>2.5.5</spring-boot.version>
<woodstox.version>6.2.6</woodstox.version>
Expand Down Expand Up @@ -382,16 +383,21 @@
<artifactId>guava</artifactId>
<version>${guava.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb-core.version}</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
<version>${okhttp.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${commons-io.version}</version>
</dependency>
<dependency>
<groupId>io.github.classgraph</groupId>
<artifactId>classgraph</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public void process(Exchange exchange) throws Exception {

IIdType patientId;
if (subject.hasReference()) {
patientId = subject.getReferenceElement();
Patient patient = patientDao.read(subject.getReferenceElement());
patientId = patient.getIdElement();
} else if (hasIdentifier(subject)) {
patientId = handleSubjectIdentifier(subject, requestDetails);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,11 @@ public static DvCodedText parseDefiningCode(EnumValueSet enumValueSet) {
return new DvCodedText(enumValueSet.getValue(), new CodePhrase(new TerminologyId(enumValueSet.getTerminologyId(), ""), enumValueSet.getCode()));
}

/**
* @deprecated Use {@link org.ehrbase.fhirbridge.ehr.converter.DvCodedTextParser#parseFHIRCoding(Coding)}
*/
@Deprecated(since = "1.4", forRemoval = true)
public static Optional<DvCodedText> parseFHIRCodingOld(Coding coding) {
if (coding.hasDisplay() && coding.hasSystem() && coding.hasCode() && coding.getSystem().equals(CodeSystem.SNOMED.getUrl())) {
return Optional.of(new DvCodedText(coding.getDisplay(), new CodePhrase(new TerminologyId("SNOMED Clinical Terms", ""), coding.getCode())));
} else if (coding.hasCode() && coding.getSystem().equals(CodeSystem.SNOMED.getUrl())) {
return Optional.of(new DvCodedText("", new CodePhrase(new TerminologyId("SNOMED Clinical Terms", ""), coding.getCode())));
} else {
return Optional.empty();
}
}

/**
* @deprecated Use {@link org.ehrbase.fhirbridge.ehr.converter.DvCodedTextParser#parseFHIRCoding(Coding)}
*/
@Deprecated(since = "1.4", forRemoval = true)
public static Optional<DvCodedText> parseFHIRCoding(Coding coding) {
if (coding.hasDisplay() && coding.hasSystem() && coding.hasCode()) {
return Optional.of(new DvCodedText(coding.getDisplay(), new CodePhrase(new TerminologyId(coding.getSystem(), ""), coding.getCode())));
} else {
return Optional.empty();
}
}

public static DvCodedText parseBirthInteger(IntegerType multipleBirthIntegerType) {
return new DvCodedText("amount of multiple births", new CodePhrase(new TerminologyId("", ""), multipleBirthIntegerType.toString()));
}

public static DvCodedText parseBirthBoolean(BooleanType multipleBirthBoolean) {
return new DvCodedText("multiple births present", new CodePhrase(new TerminologyId("", ""), multipleBirthBoolean.toString()));
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.ehrbase.client.classgenerator.interfaces.LocatableEntity;
import org.ehrbase.client.classgenerator.shareddefinition.NullFlavour;
import org.ehrbase.fhirbridge.ehr.converter.parser.DvCodedTextParser;
import org.ehrbase.fhirbridge.ehr.converter.DvCodedTextParser;
import org.ehrbase.fhirbridge.ehr.opt.befundderblutgasanalysecomposition.definition.KohlendioxidpartialdruckCluster;
import org.ehrbase.fhirbridge.ehr.opt.befundderblutgasanalysecomposition.definition.KohlendioxidpartialdruckErgebnisStatusElement;
import org.hl7.fhir.r4.model.Observation;
Expand All @@ -18,17 +18,19 @@ public KohlendioxidpartialdruckConverter(Observation fhirObservation) {
public KohlendioxidpartialdruckCluster map() {
KohlendioxidpartialdruckCluster kohlendioxidpartialdruckCluster = new KohlendioxidpartialdruckCluster();
kohlendioxidpartialdruckCluster.setErgebnisStatus(mapKohlendioxidErgebnisStatus());
DvCodedTextParser.parseFHIRCoding(fhirObservation.getCode().getCoding().get(0)).ifPresent(kohlendioxidpartialdruckCluster::setBezeichnungDesAnalyts);
DvCodedTextParser.getInstance()
.parseFHIRCoding(fhirObservation.getCode().getCoding().get(0))
.ifPresent(kohlendioxidpartialdruckCluster::setBezeichnungDesAnalyts);
convertAnalytErgebnis(kohlendioxidpartialdruckCluster);
return kohlendioxidpartialdruckCluster;
}

@Override
void convertAnalytErgebnis(LocatableEntity locatableEntity) {
if(fhirObservation.hasValue()){
if (fhirObservation.hasValue()) {
((KohlendioxidpartialdruckCluster) locatableEntity).setAnalytErgebnisUnits("mmHg");
((KohlendioxidpartialdruckCluster) locatableEntity).setAnalytErgebnisMagnitude(mapValue());
}else{
} else {
((KohlendioxidpartialdruckCluster) locatableEntity).setAnalytErgebnisNullFlavourDefiningCode(NullFlavour.UNKNOWN);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.ehrbase.client.classgenerator.interfaces.LocatableEntity;
import org.ehrbase.client.classgenerator.shareddefinition.NullFlavour;
import org.ehrbase.fhirbridge.ehr.converter.parser.DvCodedTextParser;
import org.ehrbase.fhirbridge.ehr.converter.DvCodedTextParser;
import org.ehrbase.fhirbridge.ehr.opt.befundderblutgasanalysecomposition.definition.PhWertCluster;
import org.ehrbase.fhirbridge.ehr.opt.befundderblutgasanalysecomposition.definition.SauerstoffpartialdruckErgebnisStatusElement;
import org.hl7.fhir.r4.model.Observation;
Expand All @@ -18,24 +18,26 @@ public PhWertConverter(Observation fhirObservation) {
public PhWertCluster map() {
PhWertCluster phWertCluster = new PhWertCluster();
phWertCluster.setErgebnisStatus(mapPhClusterErgebnisStatus());
DvCodedTextParser.parseFHIRCoding(fhirObservation.getCode().getCoding().get(0)).ifPresent(phWertCluster::setBezeichnungDesAnalyts);
DvCodedTextParser.getInstance()
.parseFHIRCoding(fhirObservation.getCode().getCoding().get(0))
.ifPresent(phWertCluster::setBezeichnungDesAnalyts);
convertAnalytErgebnis(phWertCluster);
convertAnalytErgebnis(phWertCluster);
return phWertCluster;
}

private List<SauerstoffpartialdruckErgebnisStatusElement> mapPhClusterErgebnisStatus() {
SauerstoffpartialdruckErgebnisStatusElement sauerstoffpartialdruckErgebnisStatusElement = new SauerstoffpartialdruckErgebnisStatusElement();
sauerstoffpartialdruckErgebnisStatusElement.setValue(mapErgebnisStatus());
return List.of(sauerstoffpartialdruckErgebnisStatusElement);
sauerstoffpartialdruckErgebnisStatusElement.setValue(mapErgebnisStatus());
return List.of(sauerstoffpartialdruckErgebnisStatusElement);
}

@Override
void convertAnalytErgebnis(LocatableEntity locatableEntity) {
if(fhirObservation.hasValue()){
if (fhirObservation.hasValue()) {
((PhWertCluster) locatableEntity).setAnalytErgebnisUnits("pH");
((PhWertCluster) locatableEntity).setAnalytErgebnisMagnitude(mapValue());
}else{
} else {
((PhWertCluster) locatableEntity).setAnalytErgebnisNullFlavourDefiningCode(NullFlavour.UNKNOWN);
}
}
Expand Down
Loading

0 comments on commit 6499227

Please sign in to comment.