Search in sources :

Example 1 with ResourceFilterUtil

use of uk.nhs.adaptors.pss.translator.util.ResourceFilterUtil in project nia-patient-switching-standard-adaptor by NHSDigital.

the class DiagnosticReportMapper method mapResources.

@Override
public List<DiagnosticReport> mapResources(RCMRMT030101UK04EhrExtract ehrExtract, Patient patient, List<Encounter> encounters, String practiseCode) {
    return mapEhrExtractToFhirResource(ehrExtract, (extract, composition, component) -> extractAllCompoundStatements(component).filter(Objects::nonNull).filter(ResourceFilterUtil::isDiagnosticReport).map(compoundStatement -> {
        DiagnosticReport diagnosticReport = createDiagnosticReport(compoundStatement, patient, composition, encounters, practiseCode);
        getIssued(ehrExtract, compoundStatement, composition).ifPresent(diagnosticReport::setIssuedElement);
        return diagnosticReport;
    })).toList();
}
Also used : RCMRMT030101UK04Author(org.hl7.v3.RCMRMT030101UK04Author) Identifier(org.hl7.fhir.dstu3.model.Identifier) IdType(org.hl7.fhir.dstu3.model.IdType) TextUtil.getLastLine(uk.nhs.adaptors.pss.translator.util.TextUtil.getLastLine) CodeableConcept(org.hl7.fhir.dstu3.model.CodeableConcept) RCMRMT030101UK04Component02(org.hl7.v3.RCMRMT030101UK04Component02) ArrayList(java.util.ArrayList) DiagnosticReportStatus(org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus) Collectors.toCollection(java.util.stream.Collectors.toCollection) DiagnosticReport(org.hl7.fhir.dstu3.model.DiagnosticReport) ResourceType(org.hl7.fhir.dstu3.model.ResourceType) II(org.hl7.v3.II) Service(org.springframework.stereotype.Service) RCMRMT030101UK04EhrExtract(org.hl7.v3.RCMRMT030101UK04EhrExtract) CompoundStatementResourceExtractors.extractAllCompoundStatements(uk.nhs.adaptors.pss.translator.util.CompoundStatementResourceExtractors.extractAllCompoundStatements) RCMRMT030101UK04CompoundStatement(org.hl7.v3.RCMRMT030101UK04CompoundStatement) AbstractMapper(uk.nhs.adaptors.pss.translator.mapper.AbstractMapper) DateFormatUtil.parseToInstantType(uk.nhs.adaptors.pss.translator.util.DateFormatUtil.parseToInstantType) ResourceFilterUtil(uk.nhs.adaptors.pss.translator.util.ResourceFilterUtil) CompoundStatementResourceExtractors(uk.nhs.adaptors.pss.translator.util.CompoundStatementResourceExtractors) Reference(org.hl7.fhir.dstu3.model.Reference) InstantType(org.hl7.fhir.dstu3.model.InstantType) RCMRMT030101UK04EhrComposition(org.hl7.v3.RCMRMT030101UK04EhrComposition) Observation(org.hl7.fhir.dstu3.model.Observation) Objects(java.util.Objects) Encounter(org.hl7.fhir.dstu3.model.Encounter) TS(org.hl7.v3.TS) List(java.util.List) Patient(org.hl7.fhir.dstu3.model.Patient) Optional(java.util.Optional) ResourceUtil.generateMeta(uk.nhs.adaptors.pss.translator.util.ResourceUtil.generateMeta) ResourceUtil.buildIdentifier(uk.nhs.adaptors.pss.translator.util.ResourceUtil.buildIdentifier) Objects(java.util.Objects) DiagnosticReport(org.hl7.fhir.dstu3.model.DiagnosticReport)

Aggregations

ArrayList (java.util.ArrayList)1 List (java.util.List)1 Objects (java.util.Objects)1 Optional (java.util.Optional)1 Collectors.toCollection (java.util.stream.Collectors.toCollection)1 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)1 DiagnosticReport (org.hl7.fhir.dstu3.model.DiagnosticReport)1 DiagnosticReportStatus (org.hl7.fhir.dstu3.model.DiagnosticReport.DiagnosticReportStatus)1 Encounter (org.hl7.fhir.dstu3.model.Encounter)1 IdType (org.hl7.fhir.dstu3.model.IdType)1 Identifier (org.hl7.fhir.dstu3.model.Identifier)1 InstantType (org.hl7.fhir.dstu3.model.InstantType)1 Observation (org.hl7.fhir.dstu3.model.Observation)1 Patient (org.hl7.fhir.dstu3.model.Patient)1 Reference (org.hl7.fhir.dstu3.model.Reference)1 ResourceType (org.hl7.fhir.dstu3.model.ResourceType)1 II (org.hl7.v3.II)1 RCMRMT030101UK04Author (org.hl7.v3.RCMRMT030101UK04Author)1 RCMRMT030101UK04Component02 (org.hl7.v3.RCMRMT030101UK04Component02)1 RCMRMT030101UK04CompoundStatement (org.hl7.v3.RCMRMT030101UK04CompoundStatement)1