private CubicleAllocationShortVo getCunicleShort(CubicleAllocationShortVoCollection tempColl,CubicleAllocationVo cubic) { if(tempColl == null || tempColl.size() == 0 ) return null; for(int i = 0; i < tempColl.size();i++) { CubicleAllocationShortVo tempVo = tempColl.get(i); if(tempVo!= null) { if(cubic.getID_CubicleAllocationIsNotNull() && cubic.getID_CubicleAllocation().equals(tempVo.getID_CubicleAllocation())) return tempVo; } } return null; }
private void populateScreenFromData(CubicleAllocationVo cubic) { clearControlDetails(); if(cubic != null) { form.ccAllocatedBy().setValue(cubic.getAllocatedBy()); form.dtimAllocatedCubicle().setValue(cubic.getAllocatedCubicleDateTime()); form.cmbCubicle().setValue(cubic.getCubicleRoomBed()); //wdev-16011 form.lblNameOfTrackingArea().setValue(cubic.getTrackingAreaIsNotNull()? cubic.getTrackingArea().getAreaDisplayName():""); //wdev-16011 form.cmbCubicle().clear(); if( cubic.getTrackingAreaIsNotNull()) { TrackingAreaCubiclesVo tempVo = domain.getTrackingAreaCubicles(cubic.getTrackingArea()); if( tempVo != null && tempVo.getCubiclesRoomsBedsIsNotNull()) { for(int i = 0;i < tempVo.getCubiclesRoomsBeds().size();i++) { form.cmbCubicle().newRow(tempVo.getCubiclesRoomsBeds().get(i), tempVo.getCubiclesRoomsBeds().get(i).getCubicleRoomBedName()); } } form.cmbCubicle().setValue(cubic.getCubicleRoomBed()); } //--------- } }
public ims.emergency.vo.CubicleAllocationVo getCubicleAllocation(ims.emergency.vo.CubicleAllocationRefVo cubicleRef) { if( cubicleRef == null ) throw new CodingRuntimeException("CubicleAllocation not provided"); DomainFactory factory = getDomainFactory(); CubicleAllocation doCubicleAllocation =(CubicleAllocation) factory.getDomainObject(CubicleAllocation.class, cubicleRef.getID_CubicleAllocation()); return CubicleAllocationVoAssembler.create(doCubicleAllocation); }
private void newInstanceNewClick() { clear(); form.getLocalContext().setCurrentTracking(domain.getTracking(form.getGlobalContext().Emergency.getTracking())); //WDEV-15827 form.getLocalContext().setCurrentCubicleAllocation(new CubicleAllocationVo()); MemberOfStaffLiteVo temp = null; if(domain.getMosUser() instanceof MemberOfStaffLiteVo) { temp = (MemberOfStaffLiteVo) domain.getMosUser(); } form.ccAllocatedBy().setValue(temp); if(form.getLocalContext().getCurrentTrackingIsNotNull()) { TrackingAreaLiteVo trackingArea = form.getLocalContext().getCurrentTracking().getCurrentArea(); form.lblNameOfTrackingArea().setValue(trackingArea != null ? trackingArea.getAreaDisplayName():""); } else { form.lblNameOfTrackingArea().setValue(""); } form.dtimAllocatedCubicle().setValue(new DateTime()); initializeCubiclesRoomsBedsCombo(); //wdev-16011 //wdev-16068 if( form.cmbCubicle().getValues().size() == 1) { TrackingCubicleRoomBedVo tempvo = (TrackingCubicleRoomBedVo) form.cmbCubicle().getValues().get(0); form.cmbCubicle().setValue(tempvo); } //---------------- form.setMode(FormMode.EDIT); }
private boolean save() { TrackingForAllocateCubicleVo trackinrecord = null; String[] uiErrors = getUiErrors(); if (uiErrors != null) { engine.showErrors(uiErrors); return false; } CubicleAllocationVo record = populateDataFromScreen(form.getLocalContext().getCurrentCubicleAllocation()); String[] errors = record.validate(); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } //verify if is new record and the patient is in ED if( record.getID_CubicleAllocation() == null && form.getLocalContext().getCurrentTrackingIsNotNull() && !Boolean.TRUE.equals(form.getLocalContext().getCurrentTracking().getIsDischarged())) { trackinrecord = form.getLocalContext().getCurrentTracking(); trackinrecord.setCurrentCubicle(record); errors = trackinrecord.validate(); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } } //WDEV-17469 -> verify if Cubicle was removed from configuration by another user TrackingAreaCubiclesVo cubicles = domain.getTrackingAreaCubicles(form.getLocalContext().getCurrentTracking().getCurrentArea()); if (cubicles != null && cubicles.getCubiclesRoomsBeds() != null && (! cubicles.getCubiclesRoomsBeds().contains(form.cmbCubicle().getValue()))) { engine.showMessage("Selected Cubicle/Room/Bed was removed from Configuration. Please select another."); return false; } try { if( trackinrecord != null) record = domain.saveCubicleAllocation(null,trackinrecord); else record = domain.saveCubicleAllocation(record,null); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); if( form.getGlobalContext().Emergency.getTracking() != null) form.getLocalContext().setCurrentTracking(domain.getTracking(form.getGlobalContext().Emergency.getTracking())); } form.getLocalContext().setCurrentCubicleAllocation(record); return true; }
private void populateScreenFromData(CubicleAllocationVo cubic) { clearControlDetails(); if(cubic != null) { form.ccAllocatedBy().setValue(cubic.getAllocatedBy()); form.dtimAllocatedCubicle().setValue(cubic.getAllocatedCubicleDateTime()); form.cmbCubicle().setValue(cubic.getCubicleRoomBed()); //wdev-16011 form.lblNameOfTrackingArea().setValue(cubic.getTrackingAreaIsNotNull()? cubic.getTrackingArea().getAreaDisplayName():""); //wdev-16011 form.cmbCubicle().clear(); if( cubic.getTrackingAreaIsNotNull()) { TrackingAreaCubiclesVo tempVo = domain.getTrackingAreaCubicles(cubic.getTrackingArea()); if( tempVo != null && tempVo.getCubiclesRoomsBedsIsNotNull()) { //WDEV-20720 TrackingCubicleRoomBedVoCollection collCurrentlyAllocatedCubicle = domain.getCurrentlyAllocatedCubicles(form.getLocalContext().getCurrentTracking().getCurrentArea()); for(int i = 0;i < tempVo.getCubiclesRoomsBeds().size();i++) { if (collCurrentlyAllocatedCubicle!=null && collCurrentlyAllocatedCubicle.size()>0 && collCurrentlyAllocatedCubicle.contains(tempVo.getCubiclesRoomsBeds().get(i))) { form.cmbCubicle().newRow(tempVo.getCubiclesRoomsBeds().get(i), tempVo.getCubiclesRoomsBeds().get(i).getCubicleRoomBedName(), Color.Red); } else { form.cmbCubicle().newRow(tempVo.getCubiclesRoomsBeds().get(i), tempVo.getCubiclesRoomsBeds().get(i).getCubicleRoomBedName()); } } } form.cmbCubicle().setValue(cubic.getCubicleRoomBed()); } //--------- } }
private boolean save() { if( form.getLocalContext().getAttendaceDetailsOrOtherIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getAttendaceDetailsOrOther())) //wdev-14567 { TrackingLiteVo trackLiteVo = form.getLocalContext().getTracking(); TrackingAreaVo selectedTrackingArea = getTrackingAreaWithCubicle(); if( trackLiteVo != null) { trackLiteVo.setLastMovementDateTime(new DateTime()); if (trackLiteVo.getCurrentAreaIsNotNull())//WDEV-19031 - in case the patient got discharged, do not set the Current area trackLiteVo.setCurrentArea(selectedTrackingArea); if (form.cmbCubicleRoom().getValue() != null) { CubicleAllocationVo record = new CubicleAllocationVo(); record.setAllocatedBy((MemberOfStaffLiteVo) domain.getMosUser()); record.setAllocatedCubicleDateTime(new DateTime()); record.setAttendance(form.getGlobalContext().Core.getCurrentCareContext()); record.setCubicleRoomBed(form.cmbCubicleRoom().getValue()); record.setEpisode(form.getGlobalContext().Core.getEpisodeofCareShort()); record.setPatient(form.getGlobalContext().Core.getPatientShort()); record.setTrackingArea(domain.getTrackingAreaLite(selectedTrackingArea)); trackLiteVo.setCurrentCubicle(record); } else trackLiteVo.setCurrentCubicle(null); } TrackingMovementTimesVo trackMovVo = new TrackingMovementTimesVo(); trackMovVo.setPatient(form.getGlobalContext().Core.getPatientShort()); trackMovVo.setEpisode(form.getGlobalContext().Core.getEpisodeofCareShort()); trackMovVo.setAttendance(form.getGlobalContext().Core.getCurrentCareContext()); trackMovVo.setAreaMovedTo(selectedTrackingArea); trackMovVo.setMovedDateTime(new DateTime()); trackMovVo.setMovedBy((MemberOfStaffLiteVo) domain.getMosUser()); CareContextVo newCareContext = form.getLocalContext().getlcCurrentCareContext(); if (newCareContext != null) { String[] errors = newCareContext.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } } try { domain.saveTrackingAndTrackingMovementTimes(trackLiteVo, trackMovVo, form.getLocalContext().getlcCurrentPartialAdmission(), form.getLocalContext().getlcTriggePreAdmissionToPAS(), form.getLocalContext().getlcCurrentEpisodeOfCare(), newCareContext); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); engine.close(DialogResult.CANCEL); //WDEV-19188 return false; } } else form.getGlobalContext().Emergency.setTrackingAreaForSendToAreaVo(getTrackingAreaWithCubicle()); if (Boolean.TRUE.equals(form.dtimEndTriage().isVisible())) form.getGlobalContext().Emergency.setTriageCompletedDateTime(form.dtimEndTriage().getValue()); return true; }
public ims.emergency.vo.CubicleAllocationVo saveCubicleAllocation(CubicleAllocationVo record, TrackingForAllocateCubicleVo tracking) throws ims.domain.exceptions.StaleObjectException { if( record == null && tracking == null) throw new CodingRuntimeException("CubicleAllocation not provided and TrackingForAllocateCubicleVo not provided"); DomainFactory factory = getDomainFactory(); if( record != null) { CubicleAllocation doCubicleAllocation = CubicleAllocationVoAssembler.extractCubicleAllocation(factory, record); factory.save(doCubicleAllocation); return CubicleAllocationVoAssembler.create(doCubicleAllocation); } else if( tracking != null) { ims.emergency.domain.objects.Tracking doTracking = TrackingForAllocateCubicleVoAssembler.extractTracking(factory, tracking); factory.save(doTracking); TrackingForAllocateCubicleVo track = TrackingForAllocateCubicleVoAssembler.create(doTracking); if( track != null) return track.getCurrentCubicle(); } return null; }