Search in sources :

Example 96 with DIAGNOSTICREPORT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.DIAGNOSTICREPORT in project fhir-bridge by ehrbase.

the class DiagnosticReportLabCompositionConverter method convertLaborergebnis.

private List<LaborergebnisObservation> convertLaborergebnis(DiagnosticReport diagnosticReport) {
    List<LaborergebnisObservation> laborergebnisObservationList = new ArrayList<>();
    for (Resource resource : diagnosticReport.getContained()) {
        if (resource.getResourceType() == ResourceType.Observation) {
            LaborergebnisObservation laborergebnisObservation = new LaborergebnisObservationConverter().convert((Observation) resource);
            injectSchlussfolgerung(laborergebnisObservation, diagnosticReport);
            laborergebnisObservationList.add(laborergebnisObservation);
        }
    }
    return laborergebnisObservationList;
}
Also used : LaborergebnisObservationConverter(org.ehrbase.fhirbridge.ehr.converter.specific.observationlab.LaborergebnisObservationConverter) ArrayList(java.util.ArrayList) Resource(org.hl7.fhir.r4.model.Resource) LaborergebnisObservation(org.ehrbase.fhirbridge.ehr.opt.geccolaborbefundcomposition.definition.LaborergebnisObservation)

Example 97 with DIAGNOSTICREPORT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.DIAGNOSTICREPORT in project fhir-bridge by ehrbase.

the class FindDiagnosticReportTransactionIT method findDiagnosticReportRead.

@Test
void findDiagnosticReportRead() throws IOException {
    MethodOutcome outcome = create("DiagnosticReport/transactions/provide-diagnostic-report-create.json");
    IIdType id = outcome.getId();
    DiagnosticReport diagnosticReport = read(id.getIdPart(), DiagnosticReport.class);
    Assertions.assertNotNull(diagnosticReport);
    Assertions.assertNotNull(diagnosticReport.getId(), id.getIdPart());
    Assertions.assertEquals(PATIENT_ID, diagnosticReport.getSubject().getIdentifier().getValue());
}
Also used : DiagnosticReport(org.hl7.fhir.r4.model.DiagnosticReport) MethodOutcome(ca.uhn.fhir.rest.api.MethodOutcome) IIdType(org.hl7.fhir.instance.model.api.IIdType) Test(org.junit.jupiter.api.Test)

Example 98 with DIAGNOSTICREPORT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.DIAGNOSTICREPORT in project fhir-bridge by ehrbase.

the class FindDiagnosticReportTransactionIT method findDiagnosticReportVRead.

@Test
void findDiagnosticReportVRead() throws IOException {
    MethodOutcome outcome = create("DiagnosticReport/transactions/provide-diagnostic-report-create.json");
    IIdType id = outcome.getId();
    DiagnosticReport diagnosticReport = vread(id.getIdPart(), id.getVersionIdPart(), DiagnosticReport.class);
    Assertions.assertNotNull(diagnosticReport);
    Assertions.assertNotNull(diagnosticReport.getId(), id.getIdPart());
    Assertions.assertNotNull(diagnosticReport.getMeta().getVersionId(), id.getVersionIdPart());
    Assertions.assertEquals(PATIENT_ID, diagnosticReport.getSubject().getIdentifier().getValue());
}
Also used : DiagnosticReport(org.hl7.fhir.r4.model.DiagnosticReport) MethodOutcome(ca.uhn.fhir.rest.api.MethodOutcome) IIdType(org.hl7.fhir.instance.model.api.IIdType) Test(org.junit.jupiter.api.Test)

Example 99 with DIAGNOSTICREPORT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.DIAGNOSTICREPORT in project fhir-bridge by ehrbase.

the class ProvideDiagnosticReportTransactionIT method provideDiagnosticReportConditionalUpdate.

@Test
void provideDiagnosticReportConditionalUpdate() throws IOException {
    MethodOutcome outcome;
    outcome = create("DiagnosticReport/transactions/provide-diagnostic-report-create.json");
    IIdType id = outcome.getId();
    outcome = update("DiagnosticReport/transactions/provide-diagnostic-report-update.json", "DiagnosticReport?_id=" + id.getIdPart() + "&subject.identifier=" + PATIENT_ID);
    Assertions.assertEquals(id.getIdPart(), outcome.getId().getIdPart());
    Assertions.assertEquals(id.getVersionIdPartAsLong() + 1, outcome.getId().getVersionIdPartAsLong());
    DiagnosticReport diagnosticReport = (DiagnosticReport) outcome.getResource();
    Assertions.assertEquals(PATIENT_ID, diagnosticReport.getSubject().getIdentifier().getValue());
    Assertions.assertEquals("http://external.fhir.server/ServiceRequest/987", diagnosticReport.getBasedOn().get(0).getReference());
    Assertions.assertEquals(DiagnosticReport.DiagnosticReportStatus.CORRECTED, diagnosticReport.getStatus());
}
Also used : DiagnosticReport(org.hl7.fhir.r4.model.DiagnosticReport) MethodOutcome(ca.uhn.fhir.rest.api.MethodOutcome) IIdType(org.hl7.fhir.instance.model.api.IIdType) Test(org.junit.jupiter.api.Test)

Example 100 with DIAGNOSTICREPORT

use of org.hl7.fhir.r4.model.codesystems.ResourceTypes.DIAGNOSTICREPORT in project odm2fhir by num-codex.

the class ImagingProcedures method map.

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");
    if (!"1".equals(generalCoding.getValue())) {
        return Stream.empty();
    }
    var itemDatas = Stream.of(techniqueGroup.getItemData(), befundGroup.getItemData()).flatMap(List::stream).collect(toMap(ItemData::getItemOID, identity()));
    return Stream.of("ct", "roentgen", "us").filter(type -> contains(itemDatas.get("bildgebende_verfahren_" + type).getValue(), "410605003")).filter(type -> !(itemDatas.get("befund_bildgebender_verfahren_" + type).isEmpty())).flatMap(type -> {
        var diagnosticReport = createDiagnosticReport(itemDatas.get("befund_bildgebender_verfahren_" + type));
        var procedure = createProcedure(itemDatas.get("bildgebende_verfahren_" + type)).addReport(new Reference(format("%s/%s", DIAGNOSTICREPORT.toCode(), diagnosticReport.getId())));
        return Stream.of(diagnosticReport, procedure);
    });
}
Also used : FormData(de.difuture.uds.odm2fhir.odm.model.FormData) Item(de.difuture.uds.odm2fhir.fhir.mapper.Item) CodeableConcept(org.hl7.fhir.r4.model.CodeableConcept) DiagnosticReport(org.hl7.fhir.r4.model.DiagnosticReport) PROCEDURE(org.hl7.fhir.r4.model.codesystems.ResourceTypes.PROCEDURE) Reference(org.hl7.fhir.r4.model.Reference) LOINC(de.difuture.uds.odm2fhir.fhir.util.CommonCodeSystem.LOINC) Procedure(org.hl7.fhir.r4.model.Procedure) StringUtils.contains(org.apache.commons.lang3.StringUtils.contains) Collectors.toMap(java.util.stream.Collectors.toMap) COMPLETED(org.hl7.fhir.r4.model.Procedure.ProcedureStatus.COMPLETED) ItemData(de.difuture.uds.odm2fhir.odm.model.ItemData) DIAGNOSTICREPORT(org.hl7.fhir.r4.model.codesystems.ResourceTypes.DIAGNOSTICREPORT) DomainResource(org.hl7.fhir.r4.model.DomainResource) SNOMED_CT(de.difuture.uds.odm2fhir.fhir.util.CommonCodeSystem.SNOMED_CT) DIAGNOSTIC_REPORT_RADIOLOGY(de.difuture.uds.odm2fhir.fhir.util.NUMStructureDefinition.DIAGNOSTIC_REPORT_RADIOLOGY) String.format(java.lang.String.format) List(java.util.List) Collectors.toList(java.util.stream.Collectors.toList) Stream(java.util.stream.Stream) RADIOLOGY_PROCEDURES(de.difuture.uds.odm2fhir.fhir.util.NUMStructureDefinition.RADIOLOGY_PROCEDURES) DigestUtils.sha256Hex(org.apache.commons.codec.digest.DigestUtils.sha256Hex) StringUtils.equalsAny(org.apache.commons.lang3.StringUtils.equalsAny) Function.identity(java.util.function.Function.identity) DIAGNOSTIC_SERVICE_SECTION_ID(de.difuture.uds.odm2fhir.fhir.util.CommonCodeSystem.DIAGNOSTIC_SERVICE_SECTION_ID) FINAL(org.hl7.fhir.r4.model.DiagnosticReport.DiagnosticReportStatus.FINAL) Reference(org.hl7.fhir.r4.model.Reference)

Aggregations

Test (org.junit.Test)133 DiagnosticReport (org.hl7.fhir.r4.model.DiagnosticReport)115 FhirDiagnosticReport (org.openmrs.module.fhir2.model.FhirDiagnosticReport)65 IBundleProvider (ca.uhn.fhir.rest.api.server.IBundleProvider)52 MockHttpServletResponse (org.springframework.mock.web.MockHttpServletResponse)50 SearchParameterMap (org.openmrs.module.fhir2.api.search.param.SearchParameterMap)42 Test (org.junit.jupiter.api.Test)39 BaseModuleContextSensitiveTest (org.openmrs.test.BaseModuleContextSensitiveTest)39 DiagnosticReport (org.hl7.fhir.dstu3.model.DiagnosticReport)32 IBaseResource (org.hl7.fhir.instance.model.api.IBaseResource)29 ReferenceAndListParam (ca.uhn.fhir.rest.param.ReferenceAndListParam)28 ReferenceOrListParam (ca.uhn.fhir.rest.param.ReferenceOrListParam)28 ReferenceParam (ca.uhn.fhir.rest.param.ReferenceParam)28 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)19 Reference (org.hl7.fhir.r4.model.Reference)19 Bundle (org.hl7.fhir.r4.model.Bundle)18 Resource (org.hl7.fhir.r4.model.Resource)18 CodeableConcept (org.hl7.fhir.r4.model.CodeableConcept)16 Include (ca.uhn.fhir.model.api.Include)12 HashSet (java.util.HashSet)12