@Override protected void onBtnEditClick() throws ims.framework.exceptions.PresentationLogicException { if (!form.getLocalContext().getCurrentRecordIsNotNull()) { SurgicalOperationNotesVo opNotes = domain.getOperationNotes(form.getGlobalContext().Core.getCurrentCareContext()); if (opNotes !=null && opNotes.getMainProcedureIsNotNull() ) try { populateScreenFromData(domain.getDefaultTemplate(opNotes.getMainProcedure())); } catch (DomainInterfaceException e) { throw new PresentationLogicException(e); } } form.setMode(FormMode.EDIT); }
public SurgicalOperationNotesVo getSurgicalOperation(CareContextRefVo careContextRefVo) { if(careContextRefVo == null) throw new CodingRuntimeException("careContextRefVo Filter not provided for list call. "); if(careContextRefVo != null) { DomainFactory factory = getDomainFactory(); List list = factory.find("from SurgicalOperationNotes as s1_1 where (s1_1.careContext.id = :careContextId)" , new String[] {"careContextId"}, new Object[] {careContextRefVo.getID_CareContext()}); if(list != null && list.size() > 0) { SurgicalOperationNotesVoCollection voColl = SurgicalOperationNotesVoAssembler.createSurgicalOperationNotesVoCollectionFromSurgicalOperationNotes(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }
public SurgicalOperationNotesVo getOperationNotes(CareContextRefVo careContextRef) { String query = "from SurgicalOperationNotes as s1_1 where (s1_1.careContext.id = :careContextID)"; List<Object> domObj = getDomainFactory().find(query,new String[]{"careContextID"} , new Object[]{careContextRef.getID_CareContext()}); if (domObj == null || domObj.size() == 0) return null; return SurgicalOperationNotesVoAssembler.create((SurgicalOperationNotes) domObj.get(0)); }
public void updateControlsState() { if(form.getMode().equals(FormMode.EDIT)) { //WDEV-15892 boolean eDischargeExist; if (domain.getDischargeDetails(form.getGlobalContext().Core.getCurrentCareContext())==null) eDischargeExist=false; else eDischargeExist=true; form.txtActions().setEnabled(!eDischargeExist); form.txtNurseEnabled().setEnabled(!eDischargeExist); form.grdFollowUp().setEnabled(!eDischargeExist); form.grdFollowUp().setReadOnly(eDischargeExist); if (eDischargeExist) { form.getContextMenus().hideAllGenericGridMenuItems(); } form.txtGeneral().setEnabled(true); form.ccCompletingClinician().setEnabled(true); //wdev-13658 form.dtimCompletion().setEnabled(true); //wdev-13658 } else { boolean isClinicalCompleted = false; boolean isDocumentGenerated = false; if (form.getLocalContext().getcurentSurgicalOpNotesIsNotNull()) { SurgicalOperationNotesVo getcurentSurgicalOpNotes = form.getLocalContext().getcurentSurgicalOpNotes(); isClinicalCompleted = getcurentSurgicalOpNotes.getSignOffDateTimeIsNotNull() && getcurentSurgicalOpNotes.getSignOffHCPIsNotNull(); isDocumentGenerated = getcurentSurgicalOpNotes.getSurgicalOpNoteDocumentIsNotNull(); } form.btnGenerate().setVisible(isClinicalCompleted && !isDocumentGenerated); if(form.getLocalContext().getReadOnly() != null ) { if(form.getLocalContext().getReadOnly() == false) { form.btnEdit().setEnabled(true); form.btnEdit().setVisible(true); } else { form.btnEdit().setVisible(true); form.btnEdit().setEnabled(false); } } else { form.btnEdit().setEnabled(true); form.btnEdit().setVisible(true); } form.ccCompletingClinician().setEnabled(false); //wdev-13658 form.dtimCompletion().setEnabled(false); //wdev-13658 } }
protected void onBtnEditClick() throws PresentationLogicException { form.getLocalContext().setSurgicalOperationSummary(domain.getSurgicalOperationSUmmary(form.getGlobalContext().Core.getCurrentCareContext())); //wdev-15917 DischargeReportDetailVo tempVo = domain.getDischargeReportDetailsForCareContext(form.getGlobalContext().Core.getCurrentCareContext()); form.setMode(FormMode.EDIT); updateContextMenus(); updateControlsState(); //wdev-13658 if(!form.getLocalContext().getselectedRecordIsNotNull() || (form.getLocalContext().getselectedRecordIsNotNull() && form.getLocalContext().getselectedRecord().getID_FuturePlan() == null && !form.getLocalContext().getselectedRecord().getNurseEnabledInstructionsIsNotNull() )) { SurgicalOperationNotesVo opNotes = domain.getOperationNotes(form.getGlobalContext().Core.getCurrentCareContext()); if (opNotes !=null && opNotes.getMainProcedureIsNotNull() ) try { SurgicalOperationDetailsConfigVo tempSurVo = domain.getDefaultTemplate(opNotes.getMainProcedure()); if(tempSurVo != null) { form.txtActions().setValue(""); form.txtGeneral().setValue(""); form.txtNurseEnabled().setValue(""); form.txtActions().setValue(tempSurVo.getActionsforGP()); form.txtGeneral().setValue(tempSurVo.getHospitalPlan()); form.txtNurseEnabled().setValue(tempSurVo.getNurseEnabledInstructions()); } } catch (DomainInterfaceException e) { throw new PresentationLogicException(e); } } //---------- if(tempVo != null) { if(tempVo.getIsClinicalDetailsComplete() == true && Boolean.FALSE.equals(engine.hasRight(AppRight.CAN_UNDO_SURGICAL_OPERATION_NOTES_COMPLETE))) //verify if edischarge is clinically complete,this is set in edischargepreviewcomponenet tab //wdev-13658 { form.txtActions().setEnabled(false); form.txtGeneral().setEnabled(false); form.txtNurseEnabled().setEnabled(false); form.grdFollowUp().setEnabled(false); form.getContextMenus().getGenericGridAddItem().setVisible(false); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); } } //verify if discharge record is clinically complete if(form.getLocalContext().getcurentSurgicalOpNotes() != null) if(form.getLocalContext().getcurentSurgicalOpNotes().getSignOffHCP() != null && form.getLocalContext().getcurentSurgicalOpNotes().getSignOffDateTime() != null && Boolean.FALSE.equals(engine.hasRight(AppRight.CAN_UNDO_SURGICAL_OPERATION_NOTES_COMPLETE))) //wdev-13658 { form.txtActions().setEnabled(false); form.txtGeneral().setEnabled(false); form.txtNurseEnabled().setEnabled(false); form.grdFollowUp().setEnabled(false); form.getContextMenus().getGenericGridAddItem().setVisible(false); form.getContextMenus().getGenericGridUpdateItem().setVisible(false); } form.getLocalContext().setcomponentValueChanged(new Integer(1)); form.fireCustomControlValueChanged(); }