Commits
42 42 | private OrganDonorRegistrationHolder organDonorRegistrationHolder; |
43 43 | private TreatmentWillRegistrationHolder treatmentWillRegistrationHolder; |
44 44 | private LivingWillRegistrationHolder livingWillRegistrationHolder; |
45 45 | private Optional<LanguageTypedInV3> languageTypedInV3; |
46 46 | private Optional<TempAddrTypedInV3> tempAddrTypedInV3; |
47 47 | private Optional<DentistTypedInV3> dentistTypedInV3; |
48 48 | private Optional<PatientContactTypedInV3> patientContactTypedInV3; |
49 49 | private List<RelativeTypedInV3> relativeTypedInV3; |
50 50 | public final Optional<Boolean> hasNoResuscitation; |
51 51 | |
52 - | public PdcV3Data(Optional<Boolean> hasNoResuscitation) { this.hasNoResuscitation = hasNoResuscitation; } |
52 + | public PdcV3Data(Optional<Boolean> hasNoResuscitation) { |
53 + | this.hasNoResuscitation = toOptional(hasNoResuscitation, false); |
54 + | } |
55 + | |
56 + | private <T> Optional<T> toOptional(Optional<T> in, T t){ |
57 + | return in != null && in.isPresent() ? in : Optional.of(t); |
58 + | } |
53 59 | |
54 60 | public PrimaryPersonInformationHolder getPrimaryPersonInformation() { return primaryPersonInformation; } |
55 61 | |
56 62 | public PdcV3Data setPrimaryPersonInformation(PrimaryPersonInformationHolder primaryPersonInformation) { |
57 63 | this.primaryPersonInformation = primaryPersonInformation; |
58 64 | return this; |
59 65 | } |
60 66 | |
61 67 | public Optional<ProviderOrganizationHolder> getProviderOrganizationHolder() { return providerOrganizationHolder; } |
62 68 | |