private EDischargeSummarySectionStatus getProcStatus(EDischargeSTHKSummaryForProcComponentVo summary) { if(summary == null || summary.getSummaryDetails() == null) return null; for(int i=0; i< summary.getSummaryDetails().size(); i++) { EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i); if(summaryDetails == null) continue; if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection())) { return summaryDetails.getProgressStatus(); } } return null; }
private EDischargeSTHKSummaryForProcComponentVo populateEDischargeSummary() { EDischargeSTHKSummaryForProcComponentVo summary = form.getLocalContext().getSTHKSummaryVo(); if(summary != null && summary.getSummaryDetails() != null) { for(int i=0; i<summary.getSummaryDetails().size(); i++) { EDischargeSTHKSummaryDetailVo summaryDetails = summary.getSummaryDetails().get(i); if(summaryDetails == null) continue; if(EDischargeSummarySection.OPERATIONS_AND_PROCS.equals(summaryDetails.getSection())) { summaryDetails.setProgressStatus(form.chkComplete().getValue() ? EDischargeSummarySectionStatus.COMPLETED : EDischargeSummarySectionStatus.IN_PROGRESS); } } } if(summary != null) //wdev-13375 summary.validate(); return summary; }
public String getDisplayStringAfterSave(SummaryRefVo summaryId) { //Get number of incomplete sections String hql = "select count (detail.id) from Summary as summa left join summa.summaryDetails as detail where " + "(summa.id = :summaryId and detail.progressStatus.id <> :progressId and summa.isRIE is null and detail.isRIE is null)"; DomainFactory df = getDomainFactory(); long noOfNotCompleted = df.countWithHQL(hql, new String[] {"summaryId","progressId"}, new Object[]{summaryId.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID()}); if (noOfNotCompleted > 0) return null; //Get GP's email hql = "select comm.commValue from Summary as summary left join summary.careContext as cc left join cc.episodeOfCare as eoc " + "left join eoc.careSpell as cs left join cs.patient as pat left join pat.gp as gp " + "left join gp.commChannels as comm left join comm.channelType as chanType where (summary.id = :summId and chanType.id = :emailId)"; List<?> find = df.find(hql,new String[]{"summId","emailId"},new Object[]{summaryId.getID_Summary(),ChannelType.EMAIL.getID()}); if (find!=null && find.size() > 0) { if (find.get(0) instanceof String) { String email = (String) find.get(0); if (email.trim().length()>0) return "Discharge Summary Sent to GP"; } } return "Discharge Summary Sent to Print"; }
private void populateCompleteCheckbox() { if(form.getLocalContext().getSTHKSummary() != null) { form.getLocalContext().setSTHKSummaryVo(domain.getEDischargeSummary(form.getLocalContext().getSTHKSummary())); form.chkComplete().setValue(EDischargeSummarySectionStatus.COMPLETED.equals(getProcStatus(form.getLocalContext().getSTHKSummaryVo()))); } //wdev-13397 if(form.getLocalContext().getSTHKSummaryVo() == null) form.chkComplete().setVisible(Boolean.FALSE); //--------- }
public void updateSummaryIfRequired(IEDischargeSummary record, SummaryRefVo summary, DomainFactory factory) throws ims.domain.exceptions.StaleObjectException { if(summary == null) return; boolean updateRequired = false; Summary doSummary = (Summary)factory.getDomainObject(summary); /* * If in the meantime the Discharge Letter has been generated than it's a SOE */ if (getDomLookup(DischargeLetterStatus.GENERATED).equals(doSummary.getDischargeLetterStatus())) throw new StaleObjectException(null); SummaryDetail doSummaryDetail = (SummaryDetail) doSummary.getSummaryDetails().get(findDetailRecordForType(doSummary.getSummaryDetails(),record.getIEDischargeSummarySection())); if(record.getIEDischargeSummaryIsComplete()) { updateRequired = true; doSummaryDetail.setProgressStatus(getDomLookup(EDischargeSummarySectionStatus.COMPLETED)); } else { updateRequired = true; doSummaryDetail.setProgressStatus(getDomLookup(EDischargeSummarySectionStatus.IN_PROGRESS)); } if(updateRequired) factory.save(doSummaryDetail); }
public Boolean isSectionComplete(SummaryRefVo summary, EDischargeSummarySection section) { final String hql = "select count(summ.id) from Summary as summ left join summ.summaryDetails " + "as sd left join sd.section as sec left join sd.progressStatus as prgress where " + "(summ.id = :summary and prgress.id = :progress and sec.id = :section and summ.isRIE is null)"; long count = getDomainFactory().countWithHQL(hql, new String[]{"summary","progress","section"}, new Object[]{summary.getID_Summary(),EDischargeSummarySectionStatus.COMPLETED.getID(),section.getID()}); return count > 0; }
private void updateControlState() { form.btnAdditional().setVisible(false); form.getLocalContext().setAllowChangeOpsProcs(false); form.getLocalContext().setAllowChangeNeoNatalPlastics(false); //if a section of neonatal or plastics is present and not started //or ops procs is not started if(form.getLocalContext().getSelectedInstanceIsNotNull() && form.getLocalContext().getSelectedInstance().getID_Summary() != null) { EDischargeSTHKSummaryVo voSummary = form.getLocalContext().getSelectedInstance(); EDischargeSTHKSummaryDetailVoCollection voCollDetails = voSummary.getSummaryDetails(); boolean canChangeOpsProcs = true; boolean canChangePlasticsOrNeonatal = true; if(voCollDetails != null) { for(int i=0; i<voCollDetails.size(); i++) { if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS))) { if(voCollDetails.get(i).getSectionIsNotNull() && (voCollDetails.get(i).getSection().equals(EDischargeSummarySection.NEONATAL) || voCollDetails.get(i).getSection().equals(EDischargeSummarySection.PLASTICS)) && voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS))) { canChangePlasticsOrNeonatal = false; } } if(voCollDetails.get(i).getSectionIsNotNull() && voCollDetails.get(i).getSection().equals(EDischargeSummarySection.OPERATIONS_AND_PROCS)) { if(voCollDetails.get(i).getProgressStatusIsNotNull() && (voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.COMPLETED) || voCollDetails.get(i).getProgressStatus().equals(EDischargeSummarySectionStatus.IN_PROGRESS))) { canChangeOpsProcs = false; } } } } if(canChangeOpsProcs || canChangePlasticsOrNeonatal) { form.btnAdditional().setVisible(true); form.getLocalContext().setAllowChangeOpsProcs(canChangeOpsProcs); form.getLocalContext().setAllowChangeNeoNatalPlastics(canChangePlasticsOrNeonatal); } } }
private void updateControlState() { if (form.getLocalContext().getisReadonlyIsNotNull() && form.getLocalContext().getisReadonly()) return; if (form.getMode().equals(FormMode.VIEW)) { // WDEV-8372 form.ctnDetails().lblResponsible().setVisible(form.grdProcs().getSelectedRow() != null); form.ctnDetails().lblResponsible().setEnabled(true); if (form.getLocalContext().getPatientProcedureVoIsNotNull()) { form.btnEdit().setVisible(true); form.btnEdit().setEnabled(true); } else { form.btnEdit().setVisible(false); } form.chkComplete().setVisible(form.getLocalContext().getSTHKSummaryVo()!= null); //wdev-13397 EDischargeSummarySectionStatus procStatus = getProcStatus(form.getLocalContext().getSTHKSummaryVo());//WDEV-13252 form.chkComplete().setEnabled(!(EDischargeSummarySectionStatus.NOT_STARTED.equals(procStatus)) && form.grdProcs().getRows().size() > 0);//WDEV-13037, WDEV-13252, wdev-14750 form.grdProcs().setEnabled(true);// WDEV-13621 form.grdProcs().setReadOnly(false);// WDEV-13621 } else { //WDEV-12923 - starts here form.ctnDetails().grpProcedureType().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); form.ctnDetails().cmbLaterality().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); form.ctnDetails().pdtPerformed().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); form.ctnDetails().txtSite().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); form.ctnDetails().timProc().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); //WDEV-12923 - ends here /*WDEV-12923if (form.getLocalContext().getHcpIsNotNull()) form.ctnDetails().ccAuthor().setEnabledAuthoringHCP(false); else form.ctnDetails().ccAuthor().setEnabledAuthoringHCP(true); */ if (form.getLocalContext().getIsSaveOrEditIsNotNull()) { if (form.getLocalContext().getIsSaveOrEdit()) form.grdProcs().setEnabled(false); else form.grdProcs().setEnabled(true); } } form.ctnDetails().ccPerformedBy().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getIsIncludedChanged() == null); // WDEV-12923 form.ctnDetails().ccProcedure().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getIsIncludedChanged() == null); // WDEV-12923 form.ctnDetails().ccAuthor().setEnabledAuthoringHCP(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getIsIncludedChanged() == null);// WDEV-13536 form.ctnDetails().ccAuthor().setEnabledDateTime(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getIsIncludedChanged() == null);// WDEV-13536 }
private void updateControlState() { if (form.getLocalContext().getisReadonlyIsNotNull() && form.getLocalContext().getisReadonly()) return; if (form.getMode().equals(FormMode.VIEW)) { // WDEV-8372 form.ctnDetails().lblResponsible().setVisible(form.grdProcs().getSelectedRow() != null); form.ctnDetails().lblResponsible().setEnabled(true); if (form.getLocalContext().getPatientProcedureVoIsNotNull()) { form.btnEdit().setVisible(true); form.btnEdit().setEnabled(true); } else { form.btnEdit().setVisible(false); } form.chkComplete().setVisible(form.getLocalContext().getSTHKSummaryVo()!= null); //wdev-13397 EDischargeSummarySectionStatus procStatus = getProcStatus(form.getLocalContext().getSTHKSummaryVo());//WDEV-13252 form.chkComplete().setEnabled(!(EDischargeSummarySectionStatus.NOT_STARTED.equals(procStatus)) && form.grdProcs().getRows().size() > 0);//WDEV-13037, WDEV-13252, wdev-14750 form.grdProcs().setEnabled(true);// WDEV-13621 form.grdProcs().setReadOnly(false);// WDEV-13621 } else { form.chkComplete().setVisible(false); // WDEV-20190 //WDEV-12923 - starts here form.ctnDetails().grpProcedureType().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); form.ctnDetails().cmbLaterality().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); form.ctnDetails().pdtPerformed().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); form.ctnDetails().txtSite().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); form.ctnDetails().timProc().setEnabled(form.getLocalContext().getIsIncludedChanged() == null); //WDEV-12923 - ends here /*WDEV-12923if (form.getLocalContext().getHcpIsNotNull()) form.ctnDetails().ccAuthor().setEnabledAuthoringHCP(false); else form.ctnDetails().ccAuthor().setEnabledAuthoringHCP(true); */ if (form.getLocalContext().getIsSaveOrEditIsNotNull()) { if (form.getLocalContext().getIsSaveOrEdit()) form.grdProcs().setEnabled(false); else form.grdProcs().setEnabled(true); } } form.ctnDetails().ccPerformedBy().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getIsIncludedChanged() == null); // WDEV-12923 form.ctnDetails().ccProcedure().setEnabled(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getIsIncludedChanged() == null); // WDEV-12923 form.ctnDetails().ccAuthor().setEnabledAuthoringHCP(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getIsIncludedChanged() == null);// WDEV-13536 form.ctnDetails().ccAuthor().setEnabledDateTime(FormMode.EDIT.equals(form.getMode()) && form.getLocalContext().getIsIncludedChanged() == null);// WDEV-13536 }