Search in sources :

Example 26 with Composition

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

the class ObservationLabCompositionConverter method convertKategorieValue.

private void convertKategorieValue(CodeableConcept codeableConcept, GECCOLaborbefundComposition composition) {
    for (Coding coding : codeableConcept.getCoding()) {
        if (coding.getSystem().equals(CodeSystem.HL7_OBSERVATI0N_CATEGORY.getUrl())) {
            LaborbefundKategorieElement labortestKategorieElement = new LaborbefundKategorieElement();
            labortestKategorieElement.setValue(coding.getCode());
            composition.setKategorie(List.of(labortestKategorieElement));
        }
    }
}
Also used : Coding(org.hl7.fhir.r4.model.Coding) LaborbefundKategorieElement(org.ehrbase.fhirbridge.ehr.opt.geccolaborbefundcomposition.definition.LaborbefundKategorieElement)

Example 27 with Composition

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

the class PatientDischargeCompositionConverter method mapKategorie.

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

Example 28 with Composition

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

the class GECCODiagnoseIT method testMapping.

@Override
public void testMapping(String resourcePath, String paragonPath) throws IOException {
    Condition resource = (Condition) super.testFileLoader.loadResource(resourcePath);
    GECCODiagnoseCompositionConverter compositionConverter = new GECCODiagnoseCompositionConverter();
    GECCODiagnoseComposition composition = compositionConverter.convert(resource);
    Diff diff = compareCompositions(getJavers(), paragonPath, composition);
    assertEquals(diff.getChanges().size(), 0);
}
Also used : Condition(org.hl7.fhir.r4.model.Condition) GECCODiagnoseComposition(org.ehrbase.fhirbridge.ehr.opt.geccodiagnosecomposition.GECCODiagnoseComposition) GECCODiagnoseCompositionConverter(org.ehrbase.fhirbridge.ehr.converter.specific.geccodiagnose.GECCODiagnoseCompositionConverter) Diff(org.javers.core.diff.Diff)

Example 29 with Composition

use of org.hl7.fhir.dstu3.model.Composition in project nia-patient-switching-standard-adaptor by NHSDigital.

the class DiagnosticReportMapper method createDiagnosticReport.

private DiagnosticReport createDiagnosticReport(RCMRMT030101UK04CompoundStatement compoundStatement, Patient patient, RCMRMT030101UK04EhrComposition composition, List<Encounter> encounters, String practiceCode) {
    final DiagnosticReport diagnosticReport = new DiagnosticReport();
    final String id = compoundStatement.getId().get(0).getRoot();
    diagnosticReport.setMeta(generateMeta(META_PROFILE_URL_SUFFIX));
    diagnosticReport.setId(id);
    diagnosticReport.addIdentifier(buildIdentifier(id, practiceCode));
    diagnosticReport.setCode(createCode());
    diagnosticReport.setStatus(DiagnosticReportStatus.UNKNOWN);
    diagnosticReport.setSubject(new Reference(patient));
    diagnosticReport.setSpecimen(getSpecimenReferences(compoundStatement));
    createIdentifierExtension(compoundStatement.getId()).ifPresent(diagnosticReport::addIdentifier);
    buildContext(composition, encounters).ifPresent(diagnosticReport::setContext);
    setResultReferences(compoundStatement, diagnosticReport);
    return diagnosticReport;
}
Also used : Reference(org.hl7.fhir.dstu3.model.Reference) DiagnosticReport(org.hl7.fhir.dstu3.model.DiagnosticReport)

Example 30 with Composition

use of org.hl7.fhir.dstu3.model.Composition in project cqf-ruler by DBCG.

the class CareGapsProvider method addBundleEntries.

private Bundle addBundleEntries(String serverBase, Composition composition, List<DetectedIssue> detectedIssues, List<MeasureReport> reports, Map<String, Resource> evaluatedResources) {
    Bundle reportBundle = getBundle();
    reportBundle.addEntry(getBundleEntry(serverBase, composition));
    reports.forEach(report -> reportBundle.addEntry(getBundleEntry(serverBase, report)));
    detectedIssues.forEach(detectedIssue -> reportBundle.addEntry(getBundleEntry(serverBase, detectedIssue)));
    configuredResources.values().forEach(resource -> reportBundle.addEntry(getBundleEntry(serverBase, resource)));
    evaluatedResources.values().forEach(resource -> reportBundle.addEntry(getBundleEntry(serverBase, resource)));
    return reportBundle;
}
Also used : Bundle(org.hl7.fhir.r4.model.Bundle)

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