@Override public void rIEWardStay(WardStayVo stay) throws StaleObjectException { DomainFactory factory = getDomainFactory(); WardStay stayDom = WardStayVoAssembler.extractWardStay(factory, stay); stayDom.setIsRIE(true); factory.save(stayDom); }
public AdmissionDetailVo saveEmergencyAdmissionInElectiveCase(AdmissionDetailVo admission, CareSpellVo careSpell, CatsReferralEmergencyAdmissionVo catsReferral, BedSpaceStateLiteVo bedSpaceState, WardStayVo wardStay, ConsultantStayVo consultant) throws DomainInterfaceException, StaleObjectException { if (admission == null) throw new CodingRuntimeException("Admission Details parameter is mandatory."); if (careSpell == null) throw new CodingRuntimeException("Care Spell parameter is mandatory."); if (catsReferral == null) throw new CodingRuntimeException("Cats Referral parameter is mandatory."); PatientPathwayJourneyRefVo journey = createPatientJourney(catsReferral, admission); catsReferral.setJourney(journey); @SuppressWarnings("rawtypes") HashMap domMap = new HashMap(); AdmissionDetail domAdmissionDetail = AdmissionDetailVoAssembler.extractAdmissionDetail(getDomainFactory(), admission, domMap); CareSpell domCareSpell = CareSpellVoAssembler.extractCareSpell(getDomainFactory(), careSpell, domMap); CatsReferral domCatsReferral = CatsReferralEmergencyAdmissionVoAssembler.extractCatsReferral(getDomainFactory(), catsReferral, domMap); domCatsReferral.getCareContext().setPasEvent(domAdmissionDetail.getPasEvent()); getDomainFactory().save(domAdmissionDetail); getDomainFactory().save(domCareSpell); getDomainFactory().save(domCatsReferral); InpatientEpisode inpatEpisode = new InpatientEpisode(); inpatEpisode.setPasEvent(domAdmissionDetail.getPasEvent()); inpatEpisode.getPasEvent().setConsultant(domAdmissionDetail.getConsultant()); inpatEpisode.setAdmissionDateTime(domAdmissionDetail.getAdmissionDateTime()); inpatEpisode.setEstDischargeDate(null); inpatEpisode.setWardType(domAdmissionDetail.getWardType()); if (wardStay != null) inpatEpisode.getWardStays().add(WardStayVoAssembler.extractWardStay(getDomainFactory(), wardStay, domMap)); if (consultant != null) inpatEpisode.getConsultantStays().add(ConsultantStayVoAssembler.extractConsultantStay(getDomainFactory(), consultant, domMap)); BedSpaceState doBedSpaceState = BedSpaceStateLiteVoAssembler.extractBedSpaceState(getDomainFactory(), bedSpaceState, domMap); if(doBedSpaceState != null) { doBedSpaceState.setInpatientEpisode(inpatEpisode); inpatEpisode.setBed(doBedSpaceState); inpatEpisode.setBedNo(doBedSpaceState.getBedSpace().getBedNumber()); } if (wardStay != null && wardStay.getWardIsNotNull() && ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue() == true) { Location doloc = getLocation(wardStay.getWard().getID_Location(), getDomainFactory()); if (doloc != null && !Boolean.TRUE.equals(doloc.isVTEAsessmentNotRequired())) { inpatEpisode.setVTEAssessmentStatus(getDomLookup(VTEAsessmentStatus.REQUIRED)); } } getDomainFactory().save(inpatEpisode); return null; }