public PatientTransportRequirementsVo getPatientTransportRequirements(CareContextRefVo careContext) { if (careContext == null) return null; String hqlQuery = "SELECT patTranReq FROM PatientTransportRequirements AS patTranReq WHERE patTranReq.careContext.id = :Context_ID AND (patTranReq.isRIE is null OR patTranReq.isRIE = 0)"; return PatientTransportRequirementsVoAssembler.create((PatientTransportRequirements) getDomainFactory().findFirst(hqlQuery, "Context_ID", careContext.getID_CareContext())); }
private PatientTransportRequirementsVo getPatientTransportRequirements(CareContextRefVo careContext) { if (careContext == null) return null; String hqlQuery = "SELECT patTranReq FROM PatientTransportRequirements AS patTranReq WHERE patTranReq.careContext.id = :Context_ID AND (patTranReq.isRIE is null OR patTranReq.isRIE = 0)"; return PatientTransportRequirementsVoAssembler.create((PatientTransportRequirements) getDomainFactory().findFirst(hqlQuery, "Context_ID", careContext.getID_CareContext())); }
private AdmissionDetail updateExtendedDetails(AdmissionDetailVo admissionDetailsVo, DomainFactory factory, InpatientEpisodeLiteVo inpatEpisode,CareContextRefVo voCareContext) { AdmissionDetail admissionDO = AdmissionDetailVoAssembler.extractAdmissionDetail(factory, admissionDetailsVo); PatientTransportRequirementsVo transportDetails = null; if (admissionDO.getTransportDetails() == null) { transportDetails = getPatientTransportRequirements(voCareContext); if (transportDetails != null) { if (inpatEpisode.getTransportDetailsIsNotNull()) { transportDetails.setCareContext(inpatEpisode.getTransportDetails().getCareContext()); transportDetails.setTransport(inpatEpisode.getTransportDetails().getTransport()); transportDetails.setTransportRequired(inpatEpisode.getTransportDetails().getTransportRequired()); } } else { transportDetails = inpatEpisode.getTransportDetails(); } } else { transportDetails = admissionDetailsVo.getTransportDetails(); if (inpatEpisode.getTransportDetailsIsNotNull()) { transportDetails.setCareContext(inpatEpisode.getTransportDetails().getCareContext()); transportDetails.setTransport(inpatEpisode.getTransportDetails().getTransport()); transportDetails.setTransportRequired(inpatEpisode.getTransportDetails().getTransportRequired()); } } admissionDO.setEstDischargeDate(inpatEpisode.getEstDischargeDateIsNotNull() ? inpatEpisode.getEstDischargeDate().getJavaDate() : null); admissionDO.setExtendedLengthOfStayReason(getDomLookup(inpatEpisode.getExtendedLengthOfStayReason())); admissionDO.setPatientRequiresTransport(inpatEpisode.getPatientRequiresTransport()); admissionDO.setTransportDetails( transportDetails != null ? PatientTransportRequirementsVoAssembler.extractPatientTransportRequirements(factory,transportDetails) : null); admissionDO.setAbleToGoDischargeLounge(inpatEpisode.getAbleToGoDischargeLoungeIsNotNull() ? inpatEpisode.getAbleToGoDischargeLounge() : null); admissionDO.setReasonCannotGoDischargeLounge(getDomLookup(inpatEpisode.getReasonCannotGoDischargeLounge())); admissionDO.setReasonDelayedDischarge(inpatEpisode.getReasonDelayedDischargeIsNotNull() ? ReasonForDelayedDischargeVoAssembler.extractReasonForDelayedDischargeList(factory, inpatEpisode.getReasonDelayedDischarge()) : null); admissionDO.setMedicallyFitForDischarge(inpatEpisode.getMedicallyFitForDischargeIsNotNull() ? getDomLookup(inpatEpisode.getMedicallyFitForDischarge()) : null); return admissionDO; }