Search in sources :

Example 6 with POCDMT000002UK01PatientRole

use of uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01PatientRole in project integration-adaptor-111 by nhsconnect.

the class EncounterMapper method getPatient.

private Optional<Patient> getPatient(POCDMT000002UK01ClinicalDocument1 clinicalDocument1) {
    Patient patient = new Patient();
    if (clinicalDocument1.sizeOfRecordTargetArray() > 0) {
        POCDMT000002UK01PatientRole patientRole = clinicalDocument1.getRecordTargetArray(0).getPatientRole();
        patient = patientMapper.mapPatient(patientRole);
    }
    return Optional.of(patient);
}
Also used : POCDMT000002UK01PatientRole(uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01PatientRole) Patient(org.hl7.fhir.dstu3.model.Patient)

Aggregations

POCDMT000002UK01PatientRole (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01PatientRole)6 Patient (org.hl7.fhir.dstu3.model.Patient)3 Test (org.junit.jupiter.api.Test)3 POCDMT000002UK01RecordTarget (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01RecordTarget)3 IdType (org.hl7.fhir.dstu3.model.IdType)2 Reference (org.hl7.fhir.dstu3.model.Reference)2 POCDMT000002UK01Patient (uk.nhs.connect.iucds.cda.ucr.POCDMT000002UK01Patient)2 Arrays.stream (java.util.Arrays.stream)1 Collections.emptyList (java.util.Collections.emptyList)1 List (java.util.List)1 Optional (java.util.Optional)1 Collectors (java.util.stream.Collectors)1 AllArgsConstructor (lombok.AllArgsConstructor)1 Address (org.hl7.fhir.dstu3.model.Address)1 CodeableConcept (org.hl7.fhir.dstu3.model.CodeableConcept)1 Coding (org.hl7.fhir.dstu3.model.Coding)1 ContactPoint (org.hl7.fhir.dstu3.model.ContactPoint)1 Encounter (org.hl7.fhir.dstu3.model.Encounter)1 UNKNOWN (org.hl7.fhir.dstu3.model.Enumerations.AdministrativeGender.UNKNOWN)1 HumanName (org.hl7.fhir.dstu3.model.HumanName)1