Java Code Examples for ims.framework.enumerations.DialogResult

The following are top voted examples for showing how to use ims.framework.enumerations.DialogResult. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	//WDEV-16762
	if(form.getGlobalContext().OCRR.getRefusedInvestigation() != null && form.getGlobalContext().OCRR.getRefusedInvestigation().size() > 0)
	{
		removeQuestionsInformations();
		
		if(form.getGlobalContext().OCRR.getMyOrderInformations() == null || form.getGlobalContext().OCRR.getMyOrderInformations().size() == 0)
		{
			engine.close(result);
			return;
		}
		
		populateQuestionsInformations();
	}
	
	form.getLocalContext().setYesNoResult(result);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (formName.equals(form.getForms().Core.YesNoDialog))
	{
		if (result.equals(DialogResult.YES))
		{
			// WDEV-11598
			if (form.ctnDetails().lyrDetails().tabDetails().cmbAction().getValue() != null || form.ctnDetails().lyrDetails().tabDetails().cmbMovement().getValue() != null || form.ctnDetails().lyrDetails().tabDetails().intEOR().getValue() != null || form.ctnDetails().lyrDetails().tabDetails().intSOR().getValue() != null)

				// See if we can promote the unsaved child.
				if (addOrUpdateChild())
				{
					saveWithoutCheck();
					open();
				}
		}
		else
		{
			clearDetailsInstanceControls();
		}
	}
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnCopyClick() throws ims.framework.exceptions.PresentationLogicException
{
	PatientGraphicAssessmentFindingVoCollection coll = new PatientGraphicAssessmentFindingVoCollection();
	
	for (int i = 0; i < form.grdFinding().getRows().size(); i++)
	{
		grdFindingRow row = form.grdFinding().getRows().get(i);
		
		if(row.getColumnSelect())
		{
			PatientGraphicAssessmentFindingVo item = row.getValue();
			item.setDrawingId(new Integer(i));
			coll.add(cloneFinding(item));
		}
	}
	
	if(coll.size() == 0)
	{
		engine.showMessage("Please select at least one finding !");
		return;
	}
	
	form.getGlobalContext().Assessment.setPatientGraphicAssessmentFinding(coll);
	
	engine.close(DialogResult.OK);
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(formName.equals(form.getForms().OCRR.OrderSummaryDialog))
	{
		if(result.equals(DialogResult.OK))
		{
			if(validateUISearchCriteria() == false)
				return;
			
			form.getLocalContext().setPrintingContext(null);
			
			// WDEV-11643
			populateResultsGrid(domain.listRadOrderInvestigation(form.cmbService().getValue(), form.cmbDepartment().getValue(), Category.CLINICALIMAGING, form.chkCompleted().isVisible() ? form.chkCompleted().getValue() : Boolean.FALSE, form.dteFrom().getValue(), form.dteTo().getValue()));
			
			enablePrintButton();
		}
	}
			
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if(formName.equals(form.getForms().Core.PrintReport) && result.equals(DialogResult.OK))
	{
		printSelectedItems();
	}
	if(formName.equals(form.getForms().OCRR.WardSpecimenMoveTo))
	{
		if(result.equals(DialogResult.OK))
		{
			refreshRecord(form.getGlobalContext().OCRR.getSpecimenWorkListItemList());
			enableContextMenu();
		}
		form.getGlobalContext().OCRR.setSpecimenWorkListItemList(null);
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	//wdev-11861
	if(formName.equals(form.getForms().OCRR.OrderSummaryDialog))
	{
		if(result.equals(DialogResult.OK) || result.equals(DialogResult.CANCEL))
		{
			if(validateUISearchCriteria() == false)
				return;
			form.getLocalContext().setPrintingContext(null);
			
			
			//wdev-11986
			// WDEV-12692 - Pass 'From Date' and 'To Date' as search criteria
			populateOrdersGrid(domain.listPathologyOrderInvestigation(form.cmbService().getValue(),form.cmbDepartment().getValue(), Category.PATHOLOGY, form.dteFrom().getValue(), form.dteTo().getValue()));
			//-------------
			
			enablePrintButton();
		}
	}
	//----
	
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException
	{		
		
/*		if (form.cmbCorrectness().getValue() != null
			&& form.cmbCorrectness().getValue().equals(MedOverviewCorrectness.INACURATE)
			&& !form.getLocalContext().getMedicationRecordChanged().booleanValue() )
		{
			engine.showMessage("Please edit the Medication overview before saving as you have indicated the overview is inacurate.");
			return;
		}
*/		
		save();
		
		if (form.getGlobalContext().Clinical.getCurrentMedicationOverViewIsNotNull())
			engine.close(DialogResult.OK);
		else
			engine.close(DialogResult.CANCEL);
	}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result)
		throws PresentationLogicException 
		{
	/*if(formName.equals(form.getForms().Assessment.AssessmentsForSpecialty) 
			&& result.equals(DialogResult.OK)
			&& form.getGlobalContext().Core.getSelectedUserAssessmentLiteIsNotNull())
		{
			form.getLocalContext().setChosenAssessment(domain.getUserAssessment(form.getGlobalContext().Core.getSelectedUserAssessmentLite()));
			loadAssessment();
		}
		if(formName.equals(form.getForms().Assessment.AssessmentsForSpecialty) 
			&& result.equals(DialogResult.CANCEL))
			form.setMode(FormMode.VIEW);*/
	
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnOkClick() throws ims.framework.exceptions.PresentationLogicException
{
	String[] uiErrors = getUIErrors();
	if (uiErrors != null)
	{
		engine.showErrors(uiErrors);
		return;
	}

	NextEvaluationDateTimeVo newNextEvaluationDateTime = new NextEvaluationDateTimeVo();

	newNextEvaluationDateTime.setNextEvaluationDate(form.dteNextEvaluationDate().getValue());

	form.getGlobalContext().Nursing.setNewNextEvaluationDateEntered(newNextEvaluationDateTime);

	engine.close(DialogResult.OK);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException
{		
	form.getGlobalContext().Admin.getOrganisationPCTLinkConfigGlobalContext().setOrganisationCode(form.txtOrganisationCode().getValue());
	form.getGlobalContext().Admin.getOrganisationPCTLinkConfigGlobalContext().setPctCode(form.txtPctCode().getValue());
	
	String[] errors = form.getGlobalContext().Admin.getOrganisationPCTLinkConfigGlobalContext().validate();
	
	if(errors != null && errors.length > 0 && form.txtPctCode().isVisible())
	{
		engine.showErrors(errors); 
	}
	else
	{
		engine.close(DialogResult.OK);
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(formName.equals(form.getForms().Core.TaxonomySearch) && result.equals(DialogResult.OK))
	{
		TaxonomyMap voTaxonomy = form.getGlobalContext().Core.getTaxonomyMap();
		if(voTaxonomy != null)
		{
			//Check for duplicates
			if(form.grdTaxonomy().getValues().indexOf(voTaxonomy) < 0)
				setTaxonomyGridRowData(form.grdTaxonomy().getRows().newRow(true), form.getGlobalContext().Core.getTaxonomyMap());
		}
	}
	if(formName.equals(form.getForms().Core.QuestionAnswerType) && result.equals(DialogResult.OK))
	{
		QuestionAnswerTypeVo voAnswType = form.getGlobalContext().Core.getQuestionAnswerType();
		if(voAnswType != null)
		{
			GenForm.grdAnswerTypeRow row = form.grdAnswerType().getRowByValue(voAnswType);
			if(row == null)
				row = form.grdAnswerType().getRows().newRow(true);   
			setAnswerGridRowData(row, voAnswType);
			enableContextMenu();
		}
	}
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException
{
	ReferralToSpecialtyCommentsVo commentForReferral = populateDataFromScreen();

	String[] errors = commentForReferral.validate();
	if (errors != null && errors.length > 0)
	{
		engine.showErrors(errors);
		return;
	}

	form.getGlobalContext().Emergency.setReferralToSpecialtyComments(commentForReferral);

	engine.close(DialogResult.OK);
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	boolean closeDialog = false;
	
	if ((form.grpInfection().getValue() != null && form.grpInfection().getValue().equals(GenForm.grpInfectionEnumeration.radioButtonInfectionYes)) && (form.grpSwab().getValue() != null && !form.grpSwab().getValue().equals(GenForm.grpSwabEnumeration.radioButtonSwabYes)))
	{
		engine.showMessage("If an infection is suspected, 'Swab Taken' must be set to Yes ");	//wdev-12411
		return;
	}
	if ((form.grpInfection().getValue() != null && form.grpInfection().getValue().equals(GenForm.grpInfectionEnumeration.radioButtonInfectionYes)) && (form.grpTraced().getValue() != null && !form.grpTraced().getValue().equals(GenForm.grpTracedEnumeration.radioButtonTracedYes)))
	{
		engine.showMessage("If an infection is suspected, 'Wound Traced' must be set to Yes ");
		return;
	}
	if(screenOpenedFromReview())
		closeDialog = populateReviewVO();
	else
		closeDialog = populateFindingVO();
	
	if(closeDialog)
	{
		clearGlobalContext();
		engine.close(DialogResult.OK);
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onMessageBoxClosed(int messageBoxId, DialogResult result) throws PresentationLogicException
{
	if (form.getLocalContext().getMessageBoxIsNotNull())
		if (messageBoxId == form.getLocalContext().getMessageBox() && result.equals(DialogResult.YES))
		{
			if (form.treProcedures().getSelectedNode() != null && form.treProcedures().getSelectedNode().getIdentifier() != null && form.treProcedures().getSelectedNode().getIdentifier() instanceof ProceduresPerformedByHCPVo)
				try
				{
					domain.removeProcedure((ProceduresPerformedByHCPVo) form.treProcedures().getSelectedNode().getIdentifier());
					populateTree(domain.listProceduresPerformedByHCP(form.qmbHCP().getValue(), form.cmbServices().getValue()));
				}
				catch (ForeignKeyViolationException e)
				{
					e.printStackTrace();
				}
			initialize();
		}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (formName.equals(form.getForms().Core.PrintReport) && result.equals(DialogResult.OK))
	{
		printSelectedItems();
		refreshDataInGrid();
		form.getLocalContext().setContextDummyForReportsLabel(null);
		form.getLocalContext().setSelectedRound(form.cmbRound().getValue());
	}
	
	//WDEV-17760
	if (formName.equals(form.getForms().Core.PrintMultipleOrders) && result.equals(DialogResult.OK))
	{
		refreshDataInGrid();
	}
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean save()
{
	ReferralClinicalNotesVo referralClinicalNotes = domain.getReferralClinicalNotes(form.getGlobalContext().RefMan.getCatsReferral());
	referralClinicalNotes = populateReferralClinicalNotes(referralClinicalNotes);
	
	String[] errors = referralClinicalNotes.validate(validateUIRules());
	if(errors != null && errors.length > 0)
	{
		engine.showErrors(errors);
		return false;
	}
	
	try
	{
		return domain.saveReferralClinicalNotes(referralClinicalNotes);
	}
	catch (StaleObjectException e)
	{
		e.printStackTrace();
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		engine.close(DialogResult.ABORT);
		return false;
	}
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnCloseClick() throws PresentationLogicException
{
	BedSpaceStateLiteVo voBedSpaceState = form.getGlobalContext().Core.getSelectedBedSpaceState();

	if (voBedSpaceState == null)
		throw new CodingRuntimeException("voBedSpaceState is null in method onBtnCloseClick");

	// move to previous
	if (voBedSpaceState.getCurrentBedStatusIsNotNull())
	{
		voBedSpaceState.setPreviousBedStatus((BedSpaceStateStatusLiteVo) voBedSpaceState.getCurrentBedStatus().clone());
		voBedSpaceState.setCurrentBedStatus(new BedSpaceStateStatusLiteVo());
		voBedSpaceState.getCurrentBedStatus().setStatusDateTime(form.lyrDetail().tabCloseBed().dtimClose().getValue());
		voBedSpaceState.getCurrentBedStatus().setBedStatus(BedStatus.CLOSED);
	}

	String[] arrErrors = voBedSpaceState.validate(getUIValidationForCloseBed());
	if (arrErrors != null)
	{
		engine.showErrors(arrErrors);
		return;
	}

	try
	{
		domain.saveCloseBed(voBedSpaceState, form.lyrDetail().tabCloseBed().cmbUser().getValue(), form.lyrDetail().tabCloseBed().cmbCloseReason().getValue(), form.lyrDetail().tabCloseBed().dtimEstReOpen().getValue());
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		initialise();
		engine.close(DialogResult.OK);
		return;
	}

	engine.close(DialogResult.OK);
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void doSave()
{
	if (save())
	{
		form.getGlobalContext().Nursing.setPatientAssessmentVo(form.getLocalContext().getPatientAssessmentVo());
		engine.close(DialogResult.OK);
	}
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(formName.equals(form.getForms().Core.ReferralDetailsNoteDialog)
			&& result.equals(DialogResult.OK))
	{
			saveReferralNote(form.getGlobalContext().RefMan.getReferralNote());
	}		
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnSaveClick() throws PresentationLogicException 
{								
	Hcp voHcp = new Hcp();		
	
	if (form.getLocalContext().getbHcpDisciplineChangedIsNotNull() && form.getLocalContext().getbHcpDisciplineChanged() == Boolean.TRUE)
	{
		deActivateGlobalContextHCP();
		// Swap in newly created Hcp to the global context.
		voHcp = form.getLocalContext().getHcpVo();
	}
	else
	{
		if (form.getGlobalContext().getHcpIsNotNull())
			voHcp = form.getGlobalContext().getHcp();
	}				
	
	if (voHcp instanceof MedicVo)
		populateDataFromScreenVoSpecific((MedicVo) voHcp);
	else if (voHcp instanceof NurseVo)
		populateDataFromScreenVoSpecific((NurseVo) voHcp);
	else if (voHcp instanceof TherapistVo)
		populateDataFromScreenVoSpecific((TherapistVo) voHcp);
	else
		populateDataFromScreenVoSpecific(voHcp);						
	
	
	form.getGlobalContext().setHcp(voHcp);	
	form.getGlobalContext().setMosFullName(getMosName());
	
	engine.close(DialogResult.OK);				
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onMessageBoxClosed(int messageBoxId, DialogResult result) throws PresentationLogicException
{
	form.getGlobalContext().Assessment.setIsDynamicAssessmentOpenedForPreview(false);
	form.getGlobalContext().Assessment.setForceCompletion(true);

	engine.open(form.getForms().Assessment.DynamicAssessmentsDialog, new Object[] { form.getLocalContext().getSecsRecord().getEWSProtocol() }, "EWS Assessment", false);
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	IClinicalCodingValue result = form.customControlCodingItem().getValue();		
	String[] errors = validateUIRules();
	if (errors != null && errors.length > 0)
	{
			engine.showErrors(errors);
			return;
			
	}
	
	ValueObject vo = result.getIClinicalCodingValue();
	if(vo instanceof ProcedureLiteVo)
	{
		SubProceduresVo voSub = new SubProceduresVo();
		voSub.setProcedure((ProcedureLiteVo) result.getIClinicalCodingValue());
		voSub.setSubProcedureDescription(result.getIClinicalCodingValueDescription());
		form.getGlobalContext().Clinical.setSelectedSubProcedure(voSub);
	}
	else
	{
		throw new CodingRuntimeException("ProcedureLiteVo expected from component");
	}
	
	engine.close(DialogResult.OK);
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(form.getForms().OCRR.SearchDisciplines.equals(formName))
	{
		if(DialogResult.OK.equals(result))
		{
			populateDisciplineGrid(form.getGlobalContext().OCRR.getSelectedDisciplines());
		}
	}
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(result.equals(DialogResult.OK) && formName.equals(form.getForms().OCRR.ItemSelection))
	{
		addSelectedItems();
	}
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
/**
 * WDEV-12569 - Request confirmation for save from user (occurs when saving with unconfigured Overall Prognostic records)
 */
protected void onMessageBoxClosed(int messageBoxId, DialogResult result) throws PresentationLogicException
{
	if (DialogResult.YES.equals(result))
	{
		if (save(false))
		{
			engine.close(DialogResult.OK);
		}
	}
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
	if (formName.equals(form.getForms().Assessment.UserDefinedFormSearch) && result.equals(DialogResult.OK))
	{
		UserDefinedObjectComponentVoCollection voColl = form.getGlobalContext().Core.getUserDefinedObjectComponents();
		populateUserDefinedGrid(voColl);
	}
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(formName.equals(form.getForms().Core.BayFloorPlanDesigner) && result.equals(DialogResult.OK))
	{
		open();
	}
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnSelectClick() throws ims.framework.exceptions.PresentationLogicException
{
	// Set the current selection as the phase to be cloned
	form.getGlobalContext().ICP.setStageForCloning(form.grdStages().getValue());		
	// Close dialog as success
	engine.close(DialogResult.OK);
}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	if(form.dteEOC().getValue() != null)
	{
		updateEndOfCare(form.dteEOC().getValue());
		engine.close(DialogResult.OK);
	}
	else
		engine.showMessage("No End of Care date specified.");
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (formName.equals(form.getForms().Core.RieConfirmationDialog) && DialogResult.OK.equals(result))
	{
		doRIE();
	}
	
	open();
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
	if (formName.equals(form.getForms().Clinical.HCPsWithRecordsForProcedure) && result.equals(DialogResult.OK))
	{
		if (form.getGlobalContext().ClinicalAdmin.getSurgicalOpDetailsConfig() != null)
		{
			populateTextBoxes(form.getGlobalContext().ClinicalAdmin.getSurgicalOpDetailsConfig());

			form.getLocalContext().setCurentSelectedSUrgicalOperationDetailsConfig(null);
			form.setMode(FormMode.EDIT);

		}
	}
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	//WDEV-18105
	form.getGlobalContext().Oncology.setSelectedPrimaryTumourDetail(null);
	engine.close(DialogResult.CANCEL);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (!validateUiRules())
		return;

	TCIOutcomeForPatientElectiveListVo tciOutcome = form.getGlobalContext().RefMan.getTCIOutcomeForPatientElectiveList();
	
	if (tciOutcome == null)
		tciOutcome = new TCIOutcomeForPatientElectiveListVo();

	tciOutcome.setCancelTheatreAppointment(Boolean.FALSE);
	tciOutcome.setChangeBy((MemberOfStaffRefVo) form.ccMos().getValue());
	tciOutcome.setOutcome(form.cmbCancellationType().getValue());
	tciOutcome.setStatusDateTime(form.dtimCancelled().getValue());
	tciOutcome.setCancelledForNonMedicalReason(form.chkCancelledForNonMedicalReason().getValue());	//wdev-18419
	
	form.getGlobalContext().RefMan.setTCIOutcomeForPatientElectiveList(tciOutcome);
	
	//WDEV-18541
	if (tciOutcome.getTciId() != null)
	{
		ElectiveTCIForReferralDetailsVo tciDetails = domain.getTCIDetails(tciOutcome.getTciId());
		
		if (tciDetails != null && tciDetails.getAppointment() != null && tciDetails.getAppointment().getTheatreBooking() != null 
			&& Status_Reason.BOOKED.equals(tciDetails.getAppointment().getApptStatus()) && tciDetails.getAppointment().getAppointmentDate() != null
			&& tciDetails.getAppointment().getAppointmentDate().isGreaterOrEqualThan(new Date()))
		{
			engine.showMessage("Would you like to cancel the associated Theatre Appointment ?", "Warning", MessageButtons.YESNO, MessageIcon.WARNING);
			return;
		}
	}

	engine.close(DialogResult.OK);
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onMessageBoxClosed(int messageBoxId, DialogResult result) throws PresentationLogicException
{

	if (result.equals(DialogResult.CONFIRM))
	{
		form.setMode(FormMode.EDIT);
		clearDetails();
		form.getLocalContext().setEditdRecord(Boolean.TRUE);
		form.getLocalContext().setCurrentImage(form.grdImages().getValue());
	}

}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnSaveClick() throws PresentationLogicException 
{	
	BusinessRuleVo rule = form.ccRules().getValue();
	if (rule != null)
	{
		form.getGlobalContext().ICP.RulesEditorDialog.setRule(form.ccRules().getValue());
		engine.close(DialogResult.OK);
	}
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result)	throws PresentationLogicException 
{
	if (formName.equals(form.getForms().Clinical.PatientProceduresDialog) && result.equals(DialogResult.OK))
	{
		if (form.getGlobalContext().Clinical.getSelectedPatientProcedureFromSurgicalAudit().equals(form.grdPlannedProcedures().getValue()) )
		{
			updateRowToProcedureGrid(form.getGlobalContext().Clinical.getSelectedPatientProcedureFromSurgicalAudit());
		}
	}
	
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	if(getDataFromControls())
	{
		clearGlobalContext();
		engine.close(DialogResult.OK);
	}
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (formName.equals(form.getForms().Core.YesNoDialog))
	{
		if (result.equals(DialogResult.OK) || result.equals(DialogResult.YES))
		{
			domain.clearOutboundRegistration();
		}
	}
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onMessageBoxClosed(int messageBoxId, DialogResult result) throws PresentationLogicException
{
	if (DialogResult.CONFIRM.equals(result))
	{
		if (delete())
		{
			form.dyngrdMain().getRows().remove(form.dyngrdMain().getSelectedRow());
			open();
		}
	}
	
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException
{
	if(form.grdSelectedItems().getRows().size() == 0)
	{
		engine.showMessage("No items were selected.");
		return;
	}
	
	ProcedureLiteVoCollection procColl = new ProcedureLiteVoCollection();
	DiagLiteVoCollection diagColl = new DiagLiteVoCollection();
	ClinicalProblemShortVoCollection probColl = new ClinicalProblemShortVoCollection();
	VaccineLiteVoCollection vaccColl = new VaccineLiteVoCollection();
	
	for (int j = 0; j < form.grdSelectedItems().getRows().size(); j++)
	{
		grdSelectedItemsRow selRow = form.grdSelectedItems().getRows().get(j);

		if(selRow.getValue() instanceof ProcedureLiteVo)
			procColl.add((ProcedureLiteVo)selRow.getValue());
		else if(selRow.getValue() instanceof DiagLiteVo)
			diagColl.add((DiagLiteVo)selRow.getValue());
		else if(selRow.getValue() instanceof ClinicalProblemShortVo)
			probColl.add((ClinicalProblemShortVo)selRow.getValue());
		else if(selRow.getValue() instanceof VaccineLiteVo)
			vaccColl.add((VaccineLiteVo) selRow.getValue());
	}
	
	if(form.getGlobalContext().Clinical.getPMHConfigSearchTypeIsNotNull() && form.getGlobalContext().Clinical.getPMHConfigSearchType().equalsIgnoreCase("P"))
		form.getGlobalContext().Clinical.setSelectedProcedures(procColl);
	else if(form.getGlobalContext().Clinical.getPMHConfigSearchTypeIsNotNull() && form.getGlobalContext().Clinical.getPMHConfigSearchType().equalsIgnoreCase("D"))
		form.getGlobalContext().Clinical.setSelectedDiagnosis(diagColl);
	else if(form.getGlobalContext().Clinical.getPMHConfigSearchTypeIsNotNull() && form.getGlobalContext().Clinical.getPMHConfigSearchType().equalsIgnoreCase("PR"))
		form.getGlobalContext().Clinical.setSelectedProblems(probColl);
	else if(form.getGlobalContext().Clinical.getPMHConfigSearchTypeIsNotNull() && form.getGlobalContext().Clinical.getPMHConfigSearchType().equalsIgnoreCase("VACCINE"))
		form.getGlobalContext().Clinical.CCISearch.setSelectedVaccines(vaccColl);
	
	engine.close(DialogResult.OK);
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	ProcedureLiteVoCollection procedures=new ProcedureLiteVoCollection();
	for (int i=0;i<form.grd2().getRows().size();i++)
	{
		procedures.add(form.grd2().getRows().get(i).getValue());
	}
	form.getGlobalContext().RefMan.setprocedureListForActivity(procedures);
	engine.close(DialogResult.OK);
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (formName.equals(form.getForms().Emergency.DiscriminatorSelectDialog) && result.equals(DialogResult.OK))
	{
		if (!form.getGlobalContext().Emergency.getManchesterTriageProtocolIsNotNull())
		{
			return;
		}

		populateDiscriminatorsGrid(form.getGlobalContext().Emergency.getManchesterTriageProtocol());
		updateControlsState();
	}
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(ims.framework.FormName formName, ims.framework.enumerations.DialogResult result) throws ims.framework.exceptions.PresentationLogicException
{
	if (formName!=null && formName.equals(form.getForms().Clinical.HCGDialog) && result != null && result.equals(DialogResult.OK))
	{
		if (form.getGlobalContext().Clinical.getSelectedHCGTestItem().equals(form.grdHCg().getValue()) && form.grdHCg().getValue() != null)
		{
			saveItem();
		}
		else
		{
			save();
		}
		//WDEV-17337
		form.getLocalContext().setSelectedEvent(EdAssessment_CustomControlsEvents.SAVE);
		form.fireCustomControlValueChanged();
		
	}
	else if (formName!=null && formName.equals(form.getForms().Core.RieConfirmationDialog) && result != null && result.equals(DialogResult.OK ))
	{
		rieHCGItem();
		//WDEV-17337
		form.getLocalContext().setSelectedEvent(EdAssessment_CustomControlsEvents.RIE);
		form.fireCustomControlValueChanged();
	}
	
	//WDEV-17337
	if (result.equals(DialogResult.CANCEL ) || result.equals(DialogResult.NO ) )
	{
		form.getLocalContext().setSelectedEvent(EdAssessment_CustomControlsEvents.CANCEL);
		form.fireCustomControlValueChanged();
	}
	
	open();
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	//WDEV=18084
	if (formName.equals(form.getForms().RefMan.SelectElectiveListConfiguration))
	{
		if (result.equals(DialogResult.OK))
		{
			if (form.getGlobalContext().RefMan.getSelectedWaitingListConfigIsNotNull())
			{
				//WDEV-18396
				if (form.getLocalContext().getPatientElectiveListIsNotNull())
				{
					form.getLocalContext().setConfirmCreateNewPatientElectiveListMessageBoxID(engine.showMessage("Please confirm adding " + form.getGlobalContext().Core.getPatientShort().getName().toString() + " to " + form.getGlobalContext().RefMan.getSelectedWaitingListConfig().getWaitingListName(), "Confirmation message", MessageButtons.YESNO, MessageIcon.QUESTION, MessageDefaultButton.BUTTON1));
				}
				else
				{	
   					form.htmElectiveListName().setHTML("<b>"+ form.getGlobalContext().RefMan.getSelectedWaitingListConfig().getWaitingListName() +"</b>" );
   					form.getLocalContext().setElectiveListConfigurationWasSelectedFromDialog(true);
				}
				
			}
			else if (form.getGlobalContext().RefMan.getSelectedPatientElectiveListIsNotNull())
			{
				
				form.getLocalContext().setPatientElectiveList(form.getGlobalContext().RefMan.getSelectedPatientElectiveList());
				form.getGlobalContext().RefMan.setSelectedWaitingListConfig(form.getGlobalContext().RefMan.getSelectedPatientElectiveList().getElectiveList());
				form.getLocalContext().setElectiveListConfigurationWasSelectedFromDialog(false);
				populatePatientElectiveListFromData(form.getLocalContext().getPatientElectiveList());
				
			}
		}
		
		updateControlState();
		
		return ;
	}
	
	engine.close(DialogResult.OK);
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnCloseClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.getLocalContext().getYesNoResultIsNotNull())
		engine.close(form.getLocalContext().getYesNoResult());
	else
		engine.close(DialogResult.OK);
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onMessageBoxClosed(int messageBoxId, DialogResult result) throws PresentationLogicException
{
	if (DialogResult.YES.equals(result))
	{
		PatientElectiveListBedAdmissionVo patientElectiveList = form.getLocalContext().getPatientElectiveList();
		PatientElectiveListBedAdmissionVoCollection differentPatientElectiveListForService = null;
		
		if (patientElectiveList != null)
		{
			differentPatientElectiveListForService = domain.getDifferentPatientElectiveListForService(form.getGlobalContext().Core.getPatientShort(), patientElectiveList, patientElectiveList.getElectiveList().getService());
			
			for (PatientElectiveListBedAdmissionVo patientElective : differentPatientElectiveListForService)
			{
				TCIOutcomeForPatientElectiveListVo outcome = new TCIOutcomeForPatientElectiveListVo();
				if (patientElective.getTCIDetails().getTCIDate().isLessThan(new ims.framework.utils.Date()))
					outcome.setOutcome(AdmissionOfferOutcome.ADMISSION_CANCELLED_BY_HOSPITAL_BEFORE_6);
				else
					outcome.setOutcome(AdmissionOfferOutcome.ADMISSION_CANCELLED_BY_HOSPITAL_ON_DAY_7);
				outcome.setChangeBy((MemberOfStaffRefVo) domain.getMosUser());
				outcome.setStatusDateTime(new DateTime());
				outcome.setOutcomeReason(TCIStatusChangeReason.CANCELLEDBYREMOVALOFELECTIVELISTRECORD);
				
				patientElective.getTCIDetails().setCurrentOutcome(outcome);
				patientElective.getTCIDetails().getOutcomeHistory().add(outcome);
				patientElective.getTCIDetails().setIsActive(false);
			}
		}
		
		if (saveAdmission(patientElectiveList, differentPatientElectiveListForService))
			engine.close(DialogResult.OK);
	}
	else if (DialogResult.NO.equals(result))
	{
		if (saveAdmission(form.getLocalContext().getPatientElectiveList(), null))
			engine.close(DialogResult.OK);
	}
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (result.equals(DialogResult.OK) && formName.equals(form.getForms().Core.Reports))
	{
		printReport();
	}
	else if (result.equals(DialogResult.OK) && formName.equals(form.getForms().Nursing.BradenScaleDialog))
		filterValueChanged();
	
	updateControlsState();
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	if (result.equals(DialogResult.OK) && formName.equals(form.getForms().Core.Reports))
	{
		printReport();
	}
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 *	Event handler for OnClick event for 'Activate' event
 *	<br />
 *	<i>Note:</i> Do not put complex logic code in here - instead just call functions to easy replicate
 *	this functionality where needed
 */
@Override
protected void onBtnActivateClick() throws ims.framework.exceptions.PresentationLogicException
{
	// If the save was successful then close the form with 'OK' result
	if (save())
	{
		engine.close(DialogResult.OK);
	}
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (save())
	{
		//open();
		engine.close(DialogResult.CANCEL);		//wdev-16015
	}
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnCopyClick() throws ims.framework.exceptions.PresentationLogicException
{
	// Fill patient medication collection to be passed to parent form
	form.getGlobalContext().Clinical.setPatientMedicationCollection(getSelectedMedications());
	
	if (!form.getGlobalContext().Clinical.getPatientMedicationCollectionIsNotNull() || form.getGlobalContext().Clinical.getPatientMedicationCollection().size() == 0)
	{
		engine.showMessage("No medication were selected to be copied");
		return;
	}
	
	// Close window
	engine.close(DialogResult.OK);
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException
{
	form.getLocalContext().setCustomEvent(null);
	
	// Check if printing is necessary
	if (form.getForms().Admin.SelectPrinterDialog.equals(formName) && DialogResult.OK.equals(result))
	{
		printSelectedAdviceLeaflets();
	}
	
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onBtnCloseClick() throws PresentationLogicException
{
	engine.close(DialogResult.CANCEL);
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	engine.close(DialogResult.CANCEL);
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
protected void onBtnCloseClick() throws ims.framework.exceptions.PresentationLogicException
{
	clearContexts();
	engine.close(DialogResult.OK);
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onMessageBoxClosed(int messageBoxId, DialogResult result) throws PresentationLogicException 
{
	if (form.getLocalContext().getPDSStatusMessageIDIsNotNull()
		&& messageBoxId == form.getLocalContext().getPDSStatusMessageID())
	{
		//wdev-15181
		if(result.equals(DialogResult.YES))
		{
			form.getLocalContext().setbUpdatePDS(Boolean.TRUE);//wdev-15181
			//WDEV-14397
			if (validateData())
			{
				performSave();
			}
		}
		else
			cancelSave();
		
		return;
	}

	if (form.getLocalContext().getRemoveAppointmentsMessageIDIsNotNull()
		&& messageBoxId == form.getLocalContext().getRemoveAppointmentsMessageID())
	{
		form.getLocalContext().setbRemovePatientAppointments(result.equals(DialogResult.YES) ? Boolean.TRUE : Boolean.FALSE);

		//WDEV-14397
		if (validateData())
		{
			performSave();
		}
		return;
	}
		
	if (form.getLocalContext().getAliasChangedMessageIDIsNotNull()
		&&messageBoxId == form.getLocalContext().getAliasChangedMessageID())
	{	
		if (result.equals(DialogResult.YES))
		{
			form.getLocalContext().setbSaveAliasChange(true);
			form.getGlobalContext().Core.setAliasName(form.getLocalContext().getPatientIsNotNull() && form.getLocalContext().getPatient().getNameIsNotNull() ? form.getLocalContext().getPatient().getName().getSurname() : null);			
		}
		else if (result.equals(DialogResult.NO))
			form.getLocalContext().setbSaveAliasChange(false);

		//WDEV-14397
		if (validateData())
		{
			performSave();
		}
		return;
	}
	
	//WDEV-14397
	// This is to continue the save in the case where just a warning is issued.
	if (form.getLocalContext().getPCTMessageIdIsNotNull())
	{
		//WDEV-14397			
		if (form.getLocalContext().getPCTMessageId().equals(DialogResult.OK))
			performSave();
		return;
	}
	
	
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	engine.close(DialogResult.CANCEL);
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	engine.close(DialogResult.CANCEL);
}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	engine.close(DialogResult.CANCEL);
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
{
	engine.close(DialogResult.CANCEL);	
}