private boolean save() { InterventionsTreatmentsForAttendenceVo record = populateDataFromScreen(); String[] errors = record.validate(); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { form.getGlobalContext().Emergency.setInterventionsTreatmentsForAttendence(domain.save(record)); } catch (StaleObjectException e) { e.printStackTrace(); engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(false); return false; } return true; }
public InterventionsTreatmentsForAttendenceVo save(InterventionsTreatmentsForAttendenceVo record) throws StaleObjectException { if(record == null) throw new CodingRuntimeException("Cannot save a null InterventionsTreatmentsForAttendenceVo."); if(!record.isValidated()) throw new CodingRuntimeException("InterventionsTreatmentsForAttendenceVo is not validated."); DomainFactory factory = getDomainFactory(); InterventionsTreatmentsForAttendence doRecord = InterventionsTreatmentsForAttendenceVoAssembler.extractInterventionsTreatmentsForAttendence(factory, record); if(record.getID_InterventionsTreatmentsForAttendence() == null && record.getAttendance() != null) { InterventionsTreatmentsForAttendenceVo staleRecord = getInterventionsTreatmentsForAttendence(record.getAttendance()); if(staleRecord != null) throw new StaleObjectException(doRecord); } factory.save(doRecord); return InterventionsTreatmentsForAttendenceVoAssembler.create(doRecord); }
private boolean save() { InterventionsTreatmentsForAttendenceVo record = populateDataFromScreen(); String[] errors = record.validate(validateUIControls()); //WDEV-19406 if(errors != null && errors.length > 0) { engine.showErrors("Validation Errors", errors);//WDEV-19406 return false; } try { form.getGlobalContext().Emergency.setInterventionsTreatmentsForAttendence(domain.save(record, form.getLocalContext().getAddedDuringCoding())); } catch (StaleObjectException e) { e.printStackTrace(); engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); open(false); return false; } return true; }
private void open(boolean isFromFormOpen) { CareContextRefVo attendence = form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence() != null ? form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence().getAttendance() : form.getGlobalContext().Core.getCurrentCareContext(); InterventionsTreatmentsForAttendenceVo record = domain.getInterventionsTreatmentsForAttendence(attendence); if(record != null) { form.getGlobalContext().Emergency.setInterventionsTreatmentsForAttendence(record); } if(form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence() != null) { populateSelectedGrid(form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence().getInterventionTreatments()); } populateHotlistTreatmentInterventions(domain.listTreatmentsInterventionsFromHotlist(getListOfAddedTreatmentsInterventions(), null)); if(!isFromFormOpen) form.ccAuthoringInfo().setValue(null); form.setMode(isFromFormOpen ? FormMode.EDIT : FormMode.VIEW); updateControlsState(); //wdev-17444 if( form.grdSelected().getRows().size() > 0 ) { form.ccAuthoringInfo().setEnabledAuthoringHCP(false); form.ccAuthoringInfo().setEnabledDateTime(false); form.getLocalContext().setAuthoringInfoControlIsEnabled(false); } else form.getLocalContext().setAuthoringInfoControlIsEnabled(true); //------------ }
private InterventionsTreatmentsForAttendenceVo populateDataFromScreen() { InterventionsTreatmentsForAttendenceVo record = form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence(); record.setInterventionTreatments(populateInterventionsTreatmentsFromScreen()); return record; }
private InterventionsTreatmentsForAttendenceVo createInterventionsTreatmentsForAttendence() { InterventionsTreatmentsForAttendenceVo record = new InterventionsTreatmentsForAttendenceVo(); record.setPatient(form.getLocalContext().getPatient()); record.setEpisode(form.getLocalContext().getEpisodeOfCare()); record.setAttendance(form.getLocalContext().getCareContext()); return record; }
private void saveInterventionSequence() { InterventionsTreatmentsForAttendenceVo record = form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence(); if(record == null || record.getInterventionTreatments() == null || record.getInterventionTreatments().size() == 0) return; //Need to save the sequence of Interventions for (int i = 0 ; i < form.grdInterventionsTreatments().getRows().size() ; i++) { InterventionTreatmentDetailVo interventionVo = (InterventionTreatmentDetailVo)form.grdInterventionsTreatments().getRows().get(i).getValue(); interventionVo.setCodingSequence(i); record.getInterventionTreatments().set(record.getInterventionTreatments().indexOf(interventionVo), interventionVo); } String[] errors = record.validate(); if(errors != null && errors.length >0) { engine.showErrors(errors); } try { domain.save(record); } catch (StaleObjectException e) { e.printStackTrace(); engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); form.getGlobalContext().Emergency.setInterventionsTreatmentsForAttendence(domain.getInterventionsTreatmentsForAttendence(form.getLocalContext().getCareContext())); } }
public InterventionsTreatmentsForAttendenceVo getInterventionsTreatmentsForAttendence(CareContextRefVo attendence) { if(attendence == null || attendence.getID_CareContext() == null) return null; DomainFactory factory = getDomainFactory(); String query = "select it from InterventionsTreatmentsForAttendence as it where it.attendance.id = :AttendenceId "; List<?> list = factory.find(query, new String[] {"AttendenceId"}, new Object[] {attendence.getID_CareContext()}); if(list == null || list.size() == 0) return null; return InterventionsTreatmentsForAttendenceVoAssembler.create((InterventionsTreatmentsForAttendence) list.get(0)); }
private InterventionsTreatmentsForAttendenceVo populateDataFromScreen() { InterventionsTreatmentsForAttendenceVo record = (InterventionsTreatmentsForAttendenceVo) form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence().clone(); //WDEV-19058 InterventionTreatmentDetailVoCollection collIntervTreatments = populateInterventionsTreatmentsFromScreen(); record.setInterventionTreatments(collIntervTreatments); return record; }
private void saveInterventionSequence() { InterventionsTreatmentsForAttendenceVo record = form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence(); if(record == null || record.getInterventionTreatments() == null || record.getInterventionTreatments().size() == 0) return; //Need to save the sequence of Interventions for (int i = 0 ; i < form.grdInterventionsTreatments().getRows().size() ; i++) { InterventionTreatmentDetailVo interventionVo = (InterventionTreatmentDetailVo)form.grdInterventionsTreatments().getRows().get(i).getValue(); interventionVo.setCodingSequence(i); record.getInterventionTreatments().set(record.getInterventionTreatments().indexOf(interventionVo), interventionVo); } String[] errors = record.validate(); if(errors != null && errors.length >0) { engine.showErrors(errors); } try { domain.save(record, null, form.getLocalContext().getAddedDuringCoding()); } catch (StaleObjectException e) { e.printStackTrace(); engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); form.getGlobalContext().Emergency.setInterventionsTreatmentsForAttendence(domain.getInterventionsTreatmentsForAttendence(form.getLocalContext().getCareContext())); } }
public InterventionsTreatmentsForAttendenceVo save(InterventionsTreatmentsForAttendenceVo record, AttendDiagInvTreatStatusVo attendDiagInvTreatStatus, Boolean addedDuringCoding) throws StaleObjectException { InterventionsTreatments impl = (InterventionsTreatments) getDomainImpl(InterventionsTreatmentsImpl.class); InterventionsTreatmentsForAttendenceVo newRecord = impl.save(record, addedDuringCoding); if(attendDiagInvTreatStatus != null && !Boolean.TRUE.equals(addedDuringCoding)) { DomainFactory factory = getDomainFactory(); AttendDiagInvTreatStatus doAttendDiagInvTreat = AttendDiagInvTreatStatusVoAssembler.extractAttendDiagInvTreatStatus(factory, attendDiagInvTreatStatus); factory.save(doAttendDiagInvTreat); } return newRecord; }
public InterventionsTreatmentsForAttendenceVo save(InterventionsTreatmentsForAttendenceVo record, Boolean addedDuringCoding) throws StaleObjectException { if(record == null) throw new CodingRuntimeException("Cannot save a null InterventionsTreatmentsForAttendenceVo."); if(!record.isValidated()) throw new CodingRuntimeException("InterventionsTreatmentsForAttendenceVo is not validated."); DomainFactory factory = getDomainFactory(); InterventionsTreatmentsForAttendence doRecord = InterventionsTreatmentsForAttendenceVoAssembler.extractInterventionsTreatmentsForAttendence(factory, record); if(record.getID_InterventionsTreatmentsForAttendence() == null && record.getAttendance() != null) { InterventionsTreatmentsForAttendenceVo staleRecord = getInterventionsTreatmentsForAttendence(record.getAttendance()); if(staleRecord != null) throw new StaleObjectException(doRecord); } factory.save(doRecord); if(!Boolean.TRUE.equals(addedDuringCoding)) { AttendDiagInvTreatStatusVo attendDiagInvTreatStatus = getAttendDiagInvTreatStatus(record.getAttendance()); if (attendDiagInvTreatStatus != null && (Boolean.TRUE.equals(attendDiagInvTreatStatus.getNoTreatments()) || Boolean.TRUE.equals(attendDiagInvTreatStatus.getTreatmentsNotRecorded()))) { attendDiagInvTreatStatus.setNoTreatments(null); attendDiagInvTreatStatus.setTreatmentsNotRecorded(null); AttendDiagInvTreatStatus doAttendDiagInvTreatStatus = AttendDiagInvTreatStatusVoAssembler.extractAttendDiagInvTreatStatus(factory, attendDiagInvTreatStatus); factory.save(doAttendDiagInvTreatStatus); } } return InterventionsTreatmentsForAttendenceVoAssembler.create(doRecord); }
private boolean removeTreatmentIntervention() { InterventionsTreatmentsForAttendenceVo record = form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence(); if(record == null || record.getInterventionTreatments() == null || record.getInterventionTreatments().size() == 0) return false; if(!(form.grdInterventionsTreatments().getValue() instanceof InterventionTreatmentDetailVo)) return false; //WDEV-17648 if the sequence was changed, do an update if (form.getLocalContext().getInterventionSequenceChanged()) { for (int x = 0; x < form.grdInterventionsTreatments().getRows().size(); x++) { InterventionTreatmentDetailVo interventionVo = (InterventionTreatmentDetailVo) form.grdInterventionsTreatments().getRows().get(x).getValue(); interventionVo.setCodingSequence(x); record.getInterventionTreatments().set(record.getInterventionTreatments().indexOf(interventionVo), interventionVo); } form.getLocalContext().setInterventionSequenceChanged(false); } InterventionTreatmentDetailVo treatmenttoRemove = (InterventionTreatmentDetailVo) form.grdInterventionsTreatments().getValue(); record.getInterventionTreatments().remove(treatmenttoRemove); String[] errors = record.validate(); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { form.getGlobalContext().Emergency.setInterventionsTreatmentsForAttendence(domain.save(record)); } catch (StaleObjectException e) { e.printStackTrace(); engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); form.getGlobalContext().Emergency.setInterventionsTreatmentsForAttendence(domain.getInterventionsTreatmentsForAttendence(form.getLocalContext().getCareContext())); populateInterventionsTreatmentsGrid(); return false; } return true; }
public InterventionsTreatmentsForAttendenceVo save(InterventionsTreatmentsForAttendenceVo record) throws StaleObjectException { InterventionsTreatments impl = (InterventionsTreatments) getDomainImpl(InterventionsTreatmentsImpl.class); return impl.save(record); }
public ims.emergency.vo.InterventionsTreatmentsForAttendenceVo getInterventionsTreatmentsForAttendence(ims.core.admin.vo.CareContextRefVo attendence) { InterventionsDiagnosisInvestigationsCc impl = (InterventionsDiagnosisInvestigationsCc)getDomainImpl(InterventionsDiagnosisInvestigationsCcImpl.class); return impl.getInterventionsTreatmentsForAttendence(attendence); }
private boolean removeTreatmentIntervention() { InterventionsTreatmentsForAttendenceVo record = form.getGlobalContext().Emergency.getInterventionsTreatmentsForAttendence(); if(record == null || record.getInterventionTreatments() == null || record.getInterventionTreatments().size() == 0) return false; if(!(form.grdInterventionsTreatments().getValue() instanceof InterventionTreatmentDetailVo)) return false; //WDEV-17648 if the sequence was changed, do an update if (form.getLocalContext().getInterventionSequenceChanged()) { for (int x = 0; x < form.grdInterventionsTreatments().getRows().size(); x++) { InterventionTreatmentDetailVo interventionVo = (InterventionTreatmentDetailVo) form.grdInterventionsTreatments().getRows().get(x).getValue(); interventionVo.setCodingSequence(x); record.getInterventionTreatments().set(record.getInterventionTreatments().indexOf(interventionVo), interventionVo); } form.getLocalContext().setInterventionSequenceChanged(false); } InterventionTreatmentDetailVo treatmenttoRemove = (InterventionTreatmentDetailVo) form.grdInterventionsTreatments().getValue(); record.getInterventionTreatments().remove(treatmenttoRemove); String[] errors = record.validate(); if(errors != null && errors.length > 0) { engine.showErrors(errors); return false; } try { form.getGlobalContext().Emergency.setInterventionsTreatmentsForAttendence(domain.save(record, ((record.getInterventionTreatments() == null || record.getInterventionTreatments().size() == 0) ? populateAttendDiagInvTreatStatus(null, null, null, null, false, true) : null), form.getLocalContext().getAddedDuringCoding())); } catch (StaleObjectException e) { e.printStackTrace(); engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); form.getGlobalContext().Emergency.setInterventionsTreatmentsForAttendence(domain.getInterventionsTreatmentsForAttendence(form.getLocalContext().getCareContext())); populateInterventionsTreatmentsGrid(); return false; } return true; }