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;
}
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());
}
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());
}
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());
}
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);
});
}
Aggregations