Search in sources :

Example 36 with Composition

use of org.hl7.fhir.r4.model.Composition in project fhir-bridge by ehrbase.

the class VirologischerBefundCompositionConverter method convertInternal.

@Override
public VirologischerBefundComposition convertInternal(@NonNull Observation resource) {
    VirologischerBefundComposition composition = new VirologischerBefundComposition();
    VirologischerBefundBundle virologischerBefundBundle = new VirologischerBefundBundle(resource);
    Observation observation = virologischerBefundBundle.getVirologischerBefund();
    DiagnosticReport diagnosticReport = virologischerBefundBundle.getDiagnosticReport();
    observation.setSpecimenTarget(virologischerBefundBundle.getSpecimen());
    mapStatus(composition, diagnosticReport);
    mapFallIdentifikation(diagnosticReport).ifPresent(composition::setFallidentifikation);
    composition.setBefund(new VirologischerBefundObservationConverter().convert(observation));
    return composition;
}
Also used : Observation(org.hl7.fhir.r4.model.Observation) DiagnosticReport(org.hl7.fhir.r4.model.DiagnosticReport) VirologischerBefundComposition(org.ehrbase.fhirbridge.ehr.opt.virologischerbefundcomposition.VirologischerBefundComposition)

Example 37 with Composition

use of org.hl7.fhir.r4.model.Composition in project fhir-bridge by ehrbase.

the class SofaScoreIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    Observation observation = (Observation) super.testFileLoader.loadResource(resourcePath);
    SofaScoreCompositionConverter converter = new SofaScoreCompositionConverter();
    SOFAComposition composition = converter.convert(observation);
    Diff diff = compareCompositions(getJavers(), paragonPath, composition);
    assertEquals(0, diff.getChanges().size());
}
Also used : Diff(org.javers.core.diff.Diff) SofaScoreObservation(org.ehrbase.fhirbridge.ehr.opt.sofacomposition.definition.SofaScoreObservation) Observation(org.hl7.fhir.r4.model.Observation) SofaScoreCompositionConverter(org.ehrbase.fhirbridge.ehr.converter.specific.sofascore.SofaScoreCompositionConverter) SOFAComposition(org.ehrbase.fhirbridge.ehr.opt.sofacomposition.SOFAComposition)

Example 38 with Composition

use of org.hl7.fhir.r4.model.Composition in project fhir-bridge by ehrbase.

the class BodyWeightCompositionConverter method mapKategorie.

private void mapKategorie(KoerpergewichtComposition composition, Observation resource) {
    List<KoerpergewichtKategorieElement> list = new ArrayList<>();
    for (CodeableConcept category : resource.getCategory()) {
        for (Coding coding : category.getCoding()) {
            KoerpergewichtKategorieElement koerpergewichtTestKategorieElement = new KoerpergewichtKategorieElement();
            koerpergewichtTestKategorieElement.setValue(coding.getCode());
            list.add(koerpergewichtTestKategorieElement);
        }
    }
    composition.setKategorie(list);
}
Also used : Coding(org.hl7.fhir.r4.model.Coding) ArrayList(java.util.ArrayList) KoerpergewichtKategorieElement(org.ehrbase.fhirbridge.ehr.opt.koerpergewichtcomposition.definition.KoerpergewichtKategorieElement) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Example 39 with Composition

use of org.hl7.fhir.r4.model.Composition in project fhir-bridge by ehrbase.

the class ClinicalFrailtyScaleScoreCompositionConverter method mapKategorie.

private void mapKategorie(KlinischeFrailtySkalaComposition composition, Observation resource) {
    List<KlinischeFrailtySkalaKategorieElement> list = new ArrayList<>();
    for (CodeableConcept category : resource.getCategory()) {
        for (Coding coding : category.getCoding()) {
            KlinischeFrailtySkalaKategorieElement klinischeFrailtySkalaKategorieElement = new KlinischeFrailtySkalaKategorieElement();
            klinischeFrailtySkalaKategorieElement.setValue(coding.getCode());
            list.add(klinischeFrailtySkalaKategorieElement);
        }
    }
    composition.setKategorie(list);
}
Also used : KlinischeFrailtySkalaKategorieElement(org.ehrbase.fhirbridge.ehr.opt.klinischefrailtyskalacomposition.definition.KlinischeFrailtySkalaKategorieElement) Coding(org.hl7.fhir.r4.model.Coding) ArrayList(java.util.ArrayList) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Example 40 with Composition

use of org.hl7.fhir.r4.model.Composition in project fhir-bridge by ehrbase.

the class BodyHeightCompositionConverter method mapKategorie.

private void mapKategorie(KoerpergroesseComposition composition, Observation resource) {
    List<KoerpergroesseKategorieElement> list = new ArrayList<>();
    for (CodeableConcept category : resource.getCategory()) {
        for (Coding coding : category.getCoding()) {
            KoerpergroesseKategorieElement koerpergroesseKategorieElement = new KoerpergroesseKategorieElement();
            koerpergroesseKategorieElement.setValue(coding.getCode());
            list.add(koerpergroesseKategorieElement);
        }
    }
    composition.setKategorie(list);
}
Also used : KoerpergroesseKategorieElement(org.ehrbase.fhirbridge.ehr.opt.koerpergroessecomposition.definition.KoerpergroesseKategorieElement) Coding(org.hl7.fhir.r4.model.Coding) ArrayList(java.util.ArrayList) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept)

Aggregations

ArrayList (java.util.ArrayList)16 XhtmlNode (org.hl7.fhir.utilities.xhtml.XhtmlNode)12 Coding (org.hl7.fhir.r4.model.Coding)8 FHIRException (org.hl7.fhir.exceptions.FHIRException)7 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)7 Composition (org.hl7.fhir.r4.model.Composition)6 IOException (java.io.IOException)5 Composition (org.hl7.fhir.dstu3.model.Composition)5 Complex (org.hl7.fhir.dstu3.utils.formats.Turtle.Complex)5 Reference (org.hl7.fhir.r4.model.Reference)5 Complex (org.hl7.fhir.r4.utils.formats.Turtle.Complex)5 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 Complex (org.hl7.fhir.dstu2016may.formats.RdfGenerator.Complex)4 HashMap (java.util.HashMap)3 List (java.util.List)3 Encounter (org.hl7.fhir.dstu3.model.Encounter)3 QuestionnaireResponse (org.hl7.fhir.dstu3.model.QuestionnaireResponse)3 Reference (org.hl7.fhir.dstu3.model.Reference)3 DefinitionException (org.hl7.fhir.exceptions.DefinitionException)3 Map (java.util.Map)2