Java Code Examples for ims.framework.MessageButtons

The following are top voted examples for showing how to use ims.framework.MessageButtons. 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
private boolean validateReportConfigFlags() 
{
	String queryServerUrl = ConfigFlag.GEN.QUERY_SERVER_URL.getValue();
	String reportServerUrl = ConfigFlag.GEN.REPORT_SERVER_URL.getValue();
	
	ArrayList<String> errors = new ArrayList<String>();
	
	if(queryServerUrl == null || queryServerUrl.length() == 0 || queryServerUrl.equals(ConfigFlag.GEN.QUERY_SERVER_URL.getDefaultValue()))
	{
		errors.add("The config flag QUERY_SERVER_URL is not set!");
	}
	
	if(reportServerUrl == null || reportServerUrl.length() == 0 || reportServerUrl.equals(ConfigFlag.GEN.REPORT_SERVER_URL.getDefaultValue()))
	{
		errors.add("The config flag REPORT_SERVER_URL is not set !");
	}
	
	if(errors.size() == 0)
		return true;
	
	engine.showMessage(getErrors(errors.toArray(new String[errors.size()])), "Errors", MessageButtons.OK, MessageIcon.ERROR);
	
	return false;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void search(boolean showErrors)
{
	String[] errors = validateSearchCriteria();
	clear();
	if (errors != null && errors.length >0)
	{
		if (showErrors)
			engine.showErrors(errors);
		return;
	}
	
	//WDEV-11654 If selected record has time greater than dateTo change dateTo
	if(form.getLocalContext().getSelectedInstanceIsNotNull() && form.getLocalContext().getSelectedInstance().getAuthoringInformationIsNotNull()
			&& form.getLocalContext().getSelectedInstance().getAuthoringInformation().getAuthoringDateTimeIsNotNull()
			&& form.getLocalContext().getSelectedInstance().getAuthoringInformation().getAuthoringDateTime().isGreaterThan(form.dtimTo().getValue()))
		form.dtimTo().setValue(form.getLocalContext().getSelectedInstance().getAuthoringInformation().getAuthoringDateTime());
			
	VSMetricsCollection metrics = domain.listPatientMetrics(form.getGlobalContext().Core.getPatientShort(),form.dtimFrom().getValue(),form.dtimTo().getValue());
	populateListFromData(metrics);
	if (showErrors && (metrics == null || metrics.size() == 0))
		engine.showMessage("No records found to match your criteria", "No records", MessageButtons.OK, MessageIcon.INFORMATION);
	form.grdMetrics().setValue(form.getLocalContext().getSelectedInstance());
	selectInstance();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnBMIClick() throws PresentationLogicException 
{
	if (form.decHeight().getValue() == null || form.decWeight().getValue() == null) 
	{
		engine.showMessage("Please enter both Height and Weight for Metrics", "Error calculate BMI", MessageButtons.OK);
		return;
	}
	else
	{
		if ((form.decHeight().getValue() == 0 || form.decHeight().getValue() < 1) ||
				(form.decWeight().getValue() == 0 || form.decWeight().getValue() < 0))
		{
			engine.showMessage("A non-zero and greather than 1 value needs to be specified for Height and Weight", "Error calculate BMI", MessageButtons.OK);
			return;
		}
	}
				
	form.decBMI().setValue(bodyMassIndex(form.decHeight().getValue().floatValue(), form.decWeight().getValue().floatValue()));		
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onContextMenuItemClick(int menuItemID, Control sender) throws PresentationLogicException
{
	switch (menuItemID)
	{
		case GenForm.ContextMenus.CoreNamespace.ReportsToModality.NEW :
			onBtnNewClick();
		break;

		case GenForm.ContextMenus.CoreNamespace.ReportsToModality.EDIT :
			onBtnEditClick();
		break;
		
		case GenForm.ContextMenus.CoreNamespace.ReportsToModality.REMOVE :
			form.getLocalContext().setMessageBoxId(engine.showMessage("Are you sure you want to delete the selected record ?", "Delete confirmation", MessageButtons.YESNO));
		break;
	}
	
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnUndoDischargeClick() throws ims.framework.exceptions.PresentationLogicException
{
	//wdev-16428
	PatientShort tempVo = domain.getPatientShort(form.getLocalContext().getPatientShort());
	if( tempVo != null && tempVo.getWardIsNotNull() )
	{
		engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		form.getLocalContext().setSelectedEvent(ADTAdmissionDetailEvent.CANCEL);
		form.fireCustomControlValueChanged();
		return;
	}
	
	String patientName = form.getLocalContext().getPatientShortIsNotNull() && form.getLocalContext().getPatientShort().getNameIsNotNull() ? form.getLocalContext().getPatientShort().getName().toString():"";
	//String wardName = form.getLocalContext().getDischargedEpisodeIsNotNull() && form.getLocalContext().getDischargedEpisode().getPasEventIsNotNull() && form.getLocalContext().getDischargedEpisode().getPasEvent().getLocationIsNotNull() && form.getLocalContext().getDischargedEpisode().getPasEvent().getLocation().getNameIsNotNull() ? form.getLocalContext().getDischargedEpisode().getPasEvent().getLocation().getName():"" ; 
	String wardName = form.getLocalContext().getCareContextShortVoIsNotNull() && form.getLocalContext().getCareContextShortVo().getPasEventIsNotNull() && form.getLocalContext().getCareContextShortVo().getPasEvent().getLocationIsNotNull() && form.getLocalContext().getCareContextShortVo().getPasEvent().getLocation().getNameIsNotNull() ? form.getLocalContext().getCareContextShortVo().getPasEvent().getLocation().getName():"" ;
	form.getLocalContext().setConfimUndoDischargeMsgBoxId(engine.showMessage( "Confirm " + patientName + " is to be re-instated into " + wardName,"Please Confirm", MessageButtons.YESNO, MessageIcon.QUESTION));

	
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateReports(TemplateForPatientDocumentVoCollection templateForPatientDocumentVoCollection) 
{
	form.lyrLetterCreate().tabTemplate().dyngrdReports().getRows().clear();
	
	if (templateForPatientDocumentVoCollection == null || templateForPatientDocumentVoCollection.size() ==0)
	{
		engine.showMessage("No matching templates found.", "No templates", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}

	for (int i = 0; i < templateForPatientDocumentVoCollection.size(); i++)
	{
		TemplateForPatientDocumentVo voReportList = templateForPatientDocumentVoCollection.get(i);
		addReport(voReportList);
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnSelectClick() throws ims.framework.exceptions.PresentationLogicException
{
	for (int i=0;i<form.grdGraphicAssessments().getRows().size();i++)
	{
		if (form.grdGraphicAssessments().getRows().get(i).getcolSelect())
		{
			form.getGlobalContext().ICP.setLinkedGraphicAssessment(form.grdGraphicAssessments().getRows().get(i).getValue());
			form.getGlobalContext().ICP.setLinkedItem(form.grdGraphicAssessments().getRows().get(i).getValue());
			form.getGlobalContext().EAS.setTreatmentSiteConfig(form.grdGraphicAssessments().getRows().get(i).getValue());//WDEV-16638
			break;
		}
	}
	if (!form.getGlobalContext().ICP.getLinkedGraphicAssessmentIsNotNull() || !form.getGlobalContext().ICP.getLinkedItemIsNotNull())
	{
		engine.showMessage("Select an Assessment from the Grid", "Message", MessageButtons.OK);
		return;
	}
	engine.close(DialogResult.OK);
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onCmbStatusValueChanged() throws PresentationLogicException 
{
	//updateContextMenuState();
	/*if (form.lyrTargets().tabExternalMappings().isVisible())
	{  /* WDEV-7027 - doesn't matter what is visible, should prompt anyway! */
		if (form.lyrTargets().tabExternalMappings().grdExternalEventMappings().getRows().size() > 0)
		{
			if (form.cmbStatus().getValue() != null && form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.INACTIVE))
			{
				engine.showMessage("If you wish to inactivate the Event, All Events Mappingss must be inactivated also\nSet all Events Mappings  to 'Inactive' now","Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION);
			}
		}
		
	/*}
	if (form.lyrTargets().tabRTT().isVisible())
	{*/
		if (form.lyrTargets().tabRTT().grdRTT().getRows().size() > 0)
		{
			if (form.cmbStatus().getValue() != null && form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.INACTIVE))
			{
				engine.showMessage("If you wish to inactivate the Event, All RTT Events must be inactivated also\nSet all RTT Events  to 'Inactive' now","Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION);
			}
		}
	/*}*/
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnSelectClick() throws ims.framework.exceptions.PresentationLogicException
{
	for (int i=0;i<form.grdAssessments().getRows().size();i++)
	{
		if (form.grdAssessments().getRows().get(i).getcolSelect())
		{
			form.getGlobalContext().Core.setSelectedUserAssessment(form.grdAssessments().getRows().get(i).getValue());
			form.getGlobalContext().ICP.setLinkedItem(form.grdAssessments().getRows().get(i).getValue());
			
			break;
		}
	}
	if (!form.getGlobalContext().Core.getSelectedUserAssessmentIsNotNull() || !form.getGlobalContext().ICP.getLinkedItemIsNotNull())
	{
		engine.showMessage("Select an Assessment from the Grid", "Message", MessageButtons.OK);
		return;
	}
	engine.close(DialogResult.OK);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onImbSearchClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (form.txtName().getValue()==null)
	{
		engine.showMessage("Please enter a search criteria", "Message", MessageButtons.OK);
		return;
	}
	form.grdAssessments().getRows().clear();
	UserAssessmentShortVoCollection assessments=null;
	if (form.txtName()!=null)
		assessments = domain.listAssessments(form.txtName().getValue());

	if (assessments!=null)
		for (UserAssessmentShortVo item : assessments)
		{
			grdAssessmentsRow aRow = form.grdAssessments().getRows().newRow();
			aRow.setValue(item);
			aRow.setcolName(item.getName());
			aRow.setcolSelect(false);
		}
	else
		engine.showMessage("No results found", "Message", MessageButtons.OK);
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onImbSearchClick() throws PresentationLogicException 
{
	
	String filter = form.txtAssessmentName().getValue();
	if (filter ==null || filter.length() <3)
	{
		engine.showErrors(new String[]{"Please enter at least 3 character to search upon"});
		return;
	}
	
	boolean speciality = GroupSpecialityEnumeration.rdoMySpeciality.equals(form.GroupSpeciality().getValue());
	GraphicAssessmentShortVoCollection graphicAssessments = domain.listGraphicAssessments(filter,speciality);
	if (graphicAssessments == null || graphicAssessments.size() == 0)
	{
		engine.showMessage( "No Records were found !","No Records", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	populateGridFromData(graphicAssessments);
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void doSearchAndShowInGrid() throws PresentationLogicException
{
	form.grdProcedures().getRows().clear();
	ProcedureLiteVoCollection procs = null;
	try
	{
		procs = domain.listProcedures(form.cmbSpeciality().getValue(), form.txtProcName().getValue());
	}
	catch (DomainInterfaceException e)
	{
		throw new PresentationLogicException(e);
	}
	if (procs == null || procs.size() == 0)
	{
		engine.showMessage( "No Procedures were found. Please modify your search criteria","No results", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	populateGridProceduresFromData(procs);

}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void doSearchAndShowInGrid() throws PresentationLogicException
{
	form.grdDiscipline().getRows().clear();
	
	ServiceLiteVoCollection disciplines = null;
	
	try 
	{
		disciplines = domain.listDiscipline();
	} 
	catch (DomainInterfaceException e) 
	{
		e.printStackTrace();
		throw new PresentationLogicException(e);
	}
	
	if (disciplines == null || disciplines.size() == 0)
	{
		engine.showMessage( "No Disciplines were found.","No results", MessageButtons.OK, MessageIcon.INFORMATION);
		return;
	}
	
	populateGridDisciplineFromData(disciplines);
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private PatientDocumentSearchListVoCollection listPatientDocumentsAndDisplayNoResultError()
{
	PatientDocumentSearchListVoCollection patDocs = domain.listPatientDocuments(
				form.getGlobalContext().Core.getPatientShort(),form.cmbEpisodes().getValue(), 
				form.cmbSpecialty().getValue(),  form.ccMos().getValue() instanceof HcpRefVo ? (HcpRefVo) form.ccMos().getValue() : null, 
				form.dteFrom().getValue(), form.dteTo().getValue(), 
				form.cmbDocType().getValue(), form.ccResponsibleHcp().getValue() instanceof HcpRefVo ? (HcpRefVo) form.ccResponsibleHcp().getValue() : null,GroupDateEnumeration.rdoGenerated.equals(form.GroupDate().getValue())?true:null);

	if (patDocs == null || patDocs.size() == 0)
	{
		engine.showMessage("No documents matching your search criteria were found !", "No results",MessageButtons.OK, MessageIcon.INFORMATION);
		return null;
	}
	
	return patDocs;
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public Boolean checkForPatientAlreadyAdmited()
{
	PatientRefVo voPatient = getSelectedPatient();
	
	if(voPatient != null)
	{
		String errors = domain.checkForPatientAlreadyAdmited(voPatient);
		
		if (errors != null){
			engine.showMessage(errors, "Admit Error", MessageButtons.OK, MessageIcon.ERROR);
			return true;			
		}
	}
	
	return false;
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdLayoutsGridCheckBoxClicked(int column, grdLayoutsRow row, boolean isChecked) throws PresentationLogicException
{
	if (Boolean.FALSE.equals(isChecked) && row.getValue().getFloorBedSpaceLayout() != null && row.getValue().getID_BayConfig() != null)
	{
		if (row.getValue().getID_BayConfig() != null)
		{
			BedSpaceVoCollection getBedSpaces = domain.getBedSpacesForLayout(row.getValue().getFloorBedSpaceLayout());
			
			if (areOccupiedBeds(getBedSpaces))
			{
				row.setActive(Boolean.TRUE);
				engine.showMessage("Bay cannot be Inactivated as there are occupied beds on the Ward.", "Warning", MessageButtons.OK, MessageIcon.WARNING);
			}
		}
	}
	
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void dnaPatientMenuItem()
{
	Booking_AppointmentVo voBook = domain.getBookingAppt(form.grdTheatre().getValue());
	if (voBook.getApptStatusIsNotNull() && canBeDNAed(voBook.getApptStatus(), voBook.getAppointmentDate(), voBook.getApptStartTime())) //WDEV-11863
	{
		if (Boolean.TRUE.equals(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue())
				&& domain.hasTCI(voBook))
		{
			form.getLocalContext().setMessageBoxID(engine.showMessage("You are about to mark this record as DNA. Is a new TCI required?", "Warning", MessageButtons.YESNOCANCEL));
		}
		else
		{
			form.getLocalContext().setMessageBoxID(engine.showMessage("Are you sure you want to mark this record as DNA?", "Warning", MessageButtons.YESNO));
		}
	}
	else if (voBook.getApptStatusIsNotNull() && voBook.getApptStatus().equals(Status_Reason.DNA))
	{
		engine.showMessage("This appointment has already been marked as DNA'ed");
		performSearch();
	}
	else if (voBook.getApptStatusIsNotNull() && voBook.getApptStatus().equals(Status_Reason.ADMITTED))
	{
		engine.showMessage("This appointment has already been marked as Admitted");
		performSearch();
	}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isSearchCriteriaValid()
{
	Date dateFrom = form.dteDateFrom().getValue();
	Date dateTo = form.dteDateTo().getValue();

	if (dateFrom != null && dateTo != null && dateTo.isLessThan(dateFrom))
	{
		engine.showMessage("Date From cannot be greater than Date To", "Validation error", MessageButtons.OK, MessageIcon.ERROR);
		return false;
	}

	if( isAtLeastOneSearchFieldCompleted() == false)
	{
		engine.showMessage("Complete at least one search field.", "Validation error", MessageButtons.OK, MessageIcon.ERROR);
		return false;
	}

	return true;
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onImbSearchClick() throws ims.framework.exceptions.PresentationLogicException
{
	ProceduresPerformedByHCPVoCollection procs = domain.listProceduresPerformedByHCP(form.qmbHCP().getValue(), form.cmbServices().getValue());
	if (procs != null)
		populateTree(procs);
	else
	{
		form.treProcedures().clear();
		clearPanel(); //WDEV-17694
		engine.showMessage("No results found", "Message", MessageButtons.OK);
	}
	
	form.getLocalContext().setSelectedNode(null);
	updateContextMenuStatus();
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void undoProviderCancellation()
{
	//wdev-10367
	if (form.dyngrdReferrals().getSelectedRow() != null)
	{
		CatsReferralListVo voCatsRef = null;
		if (form.dyngrdReferrals().getValue() instanceof CatsReferralListManualAssemblyVo)
			voCatsRef = domain.getCatsReferral(new CatsReferralRefVo(((CatsReferralListManualAssemblyVo)form.dyngrdReferrals().getValue()).getCatsReferralId(), 0));
		else	
			voCatsRef = domain.getCatsReferral((CatsReferralListVo)form.dyngrdReferrals().getSelectedRow().getValue());
		
		if(voCatsRef.getCurrentStatusIsNotNull() && !ReferralApptStatus.REFERRAL_CANCELLED_BY_PROVIDER.equals(voCatsRef.getCurrentStatus().getReferralStatus()))
		{
			engine.showMessage("UNDO of this Provider Cancellation was made by another User.");
			search(Boolean.FALSE, form.dyngrdReferrals().getSelectedRow() != null ? (CatsReferralListManualAssemblyVo)form.dyngrdReferrals().getSelectedRow().getValue() : null);
			return;
		}
	}
	//--------------
	form.getLocalContext().setIdUndoCancelProviderMessageBox(engine.showMessage("Please confirm if you wish to proceed with the UNDO of this Provider Cancellation","Please confirm",MessageButtons.YESNO,MessageIcon.QUESTION));
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void doSave()
{
	
	if (!validateAndPopulate())
	{
		return;
	}
	
	
	if (isStatusInactive() && !form.getLocalContext().getIsInactive())
	{
		engine.showMessage("Are you sure you want to inactivate this assessment ?", "Inactive Assessment", MessageButtons.YESNO, MessageIcon.QUESTION);
		return;
	}
	
	performSave();
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnTransferClick() throws PresentationLogicException
{
	//wdev-16867
	TrackingWithPartialAdmissionVo trackingWithDNW = domain.getTrackingWithEDPartialAdmission((TrackingVo) form.dyngrdTrack().getValue());
	if( trackingWithDNW != null )
		form.getGlobalContext().Emergency.setEDTransferVo(trackingWithDNW.getCurrentTransferRecord());
	
	if( trackingWithDNW.getCurrentPartialAdmissionIsNotNull() && !AllocationStatus.CANCELLED_ADMISSION.equals(trackingWithDNW.getCurrentPartialAdmission().getAllocatedStatus()))
	{
		form.getLocalContext().setPartialAdmissionForTrackingVo(trackingWithDNW.getCurrentPartialAdmission());
		form.getLocalContext().setDTAWithTransferMessageId(engine.showMessage("A decision to admit record exists for this patient. If you proceed to Transfer the patient, the record will be cancelled on the ED system and the PAS system. Are you sure you want to continue?","Confirm Transfer" ,MessageButtons.YESNO, MessageIcon.QUESTION));
	}
	else
		engine.open(form.getForms().Emergency.TransferDialog);
	//------------
	
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void search()
{
	super.clearScreen();
	
	ProfileShortVoCollection profiles = domain.listProfiles(form.cmbSite().getValue(), form.qmbProfile().getValue(), form.qmbService().getValue(), form.chkActive().getValue());
	if(profiles != null)
	{
		if (profiles.size()>999)
			engine.showMessage("More than 1000 items were returned", "Message", MessageButtons.OK);
	}
	
	populateTree(profiles);
	updateControlsState();
	
	if (profiles==null)
		engine.showMessage("No records match your search criteria.","No Data Found", MessageButtons.OK);
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean checkForValidEndDate(DynamicGridCell cell, DynamicGridRow row)
{
	DynamicGridCell end_dateCell = row.getCells().get(form.dyngrdOrganisationLocation().getColumns().getByIdentifier(COL_ACCREDITATION_END_DATE));
	 
	if (wasPreviousAccreditationACCREDITED(row.getValue())
 			&& getColByIdentifier(COL_ACCREDITATION_END_DATE) != null
 			&& end_dateCell != null && end_dateCell.getValue() == null)
	{
		engine.showMessage("An Accreditation End date is required for " + ((HcpLocationVo)row.getValue()).getLocation().getName() + ". Please enter one and save.", "Missing End Date", MessageButtons.OK, MessageIcon.ERROR);
				
		if (getColByIdentifier(COL_ACCREDITATION) != null)
		{
			cell = row.getCells().get(form.dyngrdOrganisationLocation().getColumns().getByIdentifier(COL_ACCREDITATION));
			if (cell != null && cell.getType().equals(DynamicCellType.ENUMERATION))
			{
				cell.setValue(AccreditationLocationStatus.ACCREDITED);
				cell.setIdentifier(AccreditationLocationStatus.ACCREDITED);
				cell.setWidth(200);
				cell.setTooltip(createAccreditationHistoryTooltip(((HcpLocationVo)row.getValue()).getAccreditationHistory(), ((HcpLocationVo)row.getValue()).getCaseTypes()));
			}
		}
		return false; 
	}
	return true;
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdVMPSelectionChanged() throws ims.framework.exceptions.PresentationLogicException
{
	form.grdVTM().getRows().clear();
	form.grdAMP().getRows().clear();
	
	try 
	{
		IDMDValue vmp = form.grdVMP().getValue();
		VTMRefVo vtmRef = ((VMPVo)vmp).getVTM();
		if(vtmRef != null)
		{
			addVTMItem(domain.getVTM(vtmRef));
		}
		
		populateAMPValues(domain.searchAMP(form.grdVMP().getValue()));
	} 
	catch (DomainInterfaceException e) 
	{
		engine.showMessage(e.getMessage(), "Error", MessageButtons.OK, MessageIcon.ERROR);
	}
	
	form.fireCustomControlValueChanged();
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void search(boolean searchButtonPressed) 
{
	form.grdWaitingList().getRows().clear();
	clearInstanceControls();
	
	ElectiveListConfigurationVoCollection collWaitingListConfig = domain.search(populateSearchCriteriaDataFromScreen());
	
	if (collWaitingListConfig==null || collWaitingListConfig.size()==0)
	{
		if (searchButtonPressed)
		{
			engine.showMessage("No records that match your search criteria found.", "No results", MessageButtons.OK,MessageIcon.INFORMATION);
		}
		return;
	}
	
	populateGrid(collWaitingListConfig);

	form.grdWaitingList().setValue(form.getLocalContext().getSelectedRecord());
	populateInstanceControlsFromData(form.getLocalContext().getSelectedRecord());	
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isSearchCriteriaValid() 
{
	DateTime dateFrom = form.dtimFrom().getValue();
	DateTime dateTo = form.dtimTo().getValue();
	
	if (dateFrom != null && dateTo != null && dateTo.isLessThan(dateFrom))
	{
		engine.showMessage("Admission Date From cannot be greater than Admission Date To", "Validation error", MessageButtons.OK, MessageIcon.ERROR);
		return false;
	}
	
	if(isAtLeastOneSearchFieldCompleted())
		return true;
	
	engine.showMessage("Complete at least one search field.", "Validation error", MessageButtons.OK, MessageIcon.ERROR);
	
	return false;
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdVTMSelectionChanged() throws ims.framework.exceptions.PresentationLogicException
{			
	form.grdVMP().getRows().clear();
	form.grdAMP().getRows().clear();
	updateControlsState();
	
	try 
	{						
		populateVMPValues(domain.searchVMP(form.grdVTM().getValue()));
	} 
	catch (DomainInterfaceException e) 
	{
		engine.showMessage(e.getMessage(), "Error", MessageButtons.OK, MessageIcon.ERROR);
	}
	
	form.fireCustomControlValueChanged();
}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onContextMenuItemClick(int menuItemID, ims.framework.Control sender) throws ims.framework.exceptions.PresentationLogicException
{
	switch (menuItemID)
	{
		case GenForm.ContextMenus.AdminNamespace.OrganisationAndPCTCode.AddOrganisationCode:
			newOrganisationCode();
			break;
		case GenForm.ContextMenus.AdminNamespace.OrganisationAndPCTCode.EditOrganisationCode:
			updateOrganisationCode();
			break;
		case GenForm.ContextMenus.AdminNamespace.OrganisationAndPCTCode.RemoveOrganisationCode:
			engine.showMessage("Do you really want to remove \"Organisation and PCT Code\"", "Remove Organisation Code", MessageButtons.YESNO, MessageIcon.WARNING, MessageDefaultButton.BUTTON2);
			break;
		case GenForm.ContextMenus.AdminNamespace.OrganisationAndPCTCode.AddPCTCode:
			newPCTCode();
			break;
		case GenForm.ContextMenus.AdminNamespace.OrganisationAndPCTCode.EditPCTCode:
			updatePCTCode();
			break;
		case GenForm.ContextMenus.AdminNamespace.OrganisationAndPCTCode.RemovePCTCode:	
			engine.showMessage("Do you really want to remove \"PCT Code\"", "Remove PCT Code", MessageButtons.YESNO, MessageIcon.WARNING, MessageDefaultButton.BUTTON2);
			break;
	}
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean isSearchCriteriaValid()
{
	Date dateFrom = form.dteFrom().getValue();
	Date dateTo = form.dteTo().getValue();

	if (dateFrom != null && dateTo != null && dateTo.isLessThan(dateFrom))
	{
		engine.showMessage("Admission Date From cannot be greater than Admission Date To", "Validation error", MessageButtons.OK, MessageIcon.ERROR);
		return false;
	}

	if (isAtLeastOneSearchFieldCompleted())
		return true;

	engine.showMessage("Complete at least one search field.", "Validation error", MessageButtons.OK, MessageIcon.ERROR);

	return false;
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open() 
{
	try 
	{			
		if (checkForExistingUserLDAPCredentials())
		{				
			if (authenticateWithLDAP(form.getLocalContext().getLDAPUsername(), form.getLocalContext().getLDAPPassword()))
			{					
				launchEvolve();			
			}				
		}
		else
		{
			engine.open(form.getForms().Admin.LDAPLogin, new Object[]{domain.getLoggedInUser()});
		}
	}
	catch (Exception e) 
	{	
		engine.createSystemLogEntry(SystemLogType.INTEGRATION_ENGINE, SystemLogLevel.ERROR, e.getMessage());
		engine.showMessage(e.getMessage(), "Error", MessageButtons.OK, MessageIcon.ERROR);				
		
		return;
	}		
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateWaitingTime() 
{
	if (form.dteReferralMade().getValue() != null && form.dteAppointment().getValue() != null)
	{
		if (form.dteReferralMade().getValue().isGreaterThan(form.dteAppointment().getValue()))
		{
			engine.showMessage("Referral Made date must be before Appointment date", "Error", MessageButtons.OK, MessageIcon.ERROR);
			return;
		}
		
		form.intWaitingTime().setValue(calculateWaintingTime(form.dteReferralMade().getValue(), form.dteAppointment().getValue()));
	} else {
		form.intWaitingTime().setValue(null);
	}
}
 
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
{
	//check for stale
	if((form.getLocalContext().getRACPCSummary() == null || form.getLocalContext().getRACPCSummary().getID_RACPCSummary() == null) && domain.getRACPCSummary(form.getGlobalContext().Core.getCurrentCareContext()) != null)
	{
		form.htmReport().setHTML("");//WDEV-13664 
		form.getLocalContext().setStaleMessageID(engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue(), "Errors", MessageButtons.OK, MessageIcon.ERROR));//WDEV-13664 
		return;
	}
	
	if(save(false))
		open();
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean getDataFromControls(MskSpineExamFindingVo findingVO)
{
	findingVO.setSpineFindInterpretation(form.txtInterpretation().getValue());
	findingVO.setIsProblem(new Boolean(form.chkSaveAsProblem().getValue()));
	//Set the Findings value back to the context
	form.getGlobalContext().SpinalInjuries.Back.setMskSpineExamFindingVo(findingVO);
	
	if (form.chkSaveAsProblem().getValue())
	{
		String patientProblem = form.txtSiteName().getValue() + " - " + form.cmbFindingType().getValue().toString() + ((form.txtInterpretation().getValue() != null && form.txtInterpretation().getValue().length() > 0) ? " - " + form.txtInterpretation().getValue() : "");
		MedicalProbOnAdmisVo voMedicalProblem = new MedicalProbOnAdmisVo();
		voMedicalProblem.setPatientProblem(patientProblem);//wdev-15280
		voMedicalProblem.setIsActive(Boolean.TRUE);
		voMedicalProblem.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact());
		voMedicalProblem.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
		voMedicalProblem.setProblemContext("Spine Examination");

		form.getGlobalContext().SpinalInjuries.setMedicalProbToSave(voMedicalProblem);
		
		if (patientProblem.length() > 255)
		{
			engine.showMessage("The Problem description exceeds 255 characters. Do you agree to save only the first 255 characters?", "Warning", MessageButtons.YESNO, MessageIcon.WARNING);
			return false;
		}
	}
	else
		form.getGlobalContext().SpinalInjuries.setMedicalProbToSave(null);
		
	return true;
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onImbConfigureChartClick() throws PresentationLogicException 
{
	if(!selectedPatientSexIsKnown() && VIEW_GRAPHICAL.equals(form.cmbView().getValue())) //WDEV-16876
	{
		engine.showMessage("Patient sex is unknown.", "Search Error", MessageButtons.OK, MessageIcon.ERROR);
		return;
	}
	form.getGlobalContext().OCRR.setSelectGroupsInViewGraphic(Boolean.TRUE); //wdev-13893
	form.customControl().selectGroups();
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	DiagnosisBasisofDiagnosis[] selectedValues = form.chklistBasis().getValues();

	if (selectedValues == null || selectedValues.length == 0)
	{
		engine.showMessage("Please either choose a Basis of Diagnosis or Cancel.", "Warning", MessageButtons.OK, MessageIcon.WARNING);
		return;
	}
	
	form.getGlobalContext().Oncology.setSelectedBasisOfDiagnosis(selectedValues[0]);
	engine.close(DialogResult.OK);
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String search() 
{
	form.dyngrdReferrals().getRows().clear();
	CATSReferralFilterVo voFilter = form.getGlobalContext().RefMan.getReferralStatusListFilter();
	
	CatsReferralListManualAssemblyVoCollection voColl = null;
	if (voFilter.countFieldsWithValue() > 3)
	{
		voColl = domain.listCATSReferrals(voFilter, ConfigFlag.GEN.CREATE_ICP_ON_ACCEPTANCE_OF_REFERRAL.getValue(), false);
	}
	else
	{
		return "";
	}
	
	if (voColl == null || voColl.size() == 0)
	{
		engine.showMessage("No records match your search criteria.", "No data found", MessageButtons.OK, MessageIcon.WARNING);
		return "";
	}
	StringBuffer sb = new StringBuffer();
	for (int i = 0 ; voColl != null && i < voColl.size() ; i++)
	{
		addNewDynamicGridRow(voColl.get(i));
		sb.append(voColl.get(i).getCatsReferralId());
		if (i < voColl.size() -1)
			sb.append(", ");
	}
	return sb.toString();
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void searchAndPopulate() 
{
	ContractConfigShortVoCollection contracts = domain.listContracts(form.txtSName().getValue(), form.cmbSOrganisation().getValue(), form.cmbSType().getValue(), form.txtSId().getValue(), form.cmbSStatus().getValue(),form.chkDiagnosticCriteria().getValue(),form.chkNonDiagnosticCriteria().getValue());
	populateListControls(contracts);
	if (form.getLocalContext().getSelectedRecordIsNotNull())
	{
		form.grdDetails().setValue(form.getLocalContext().getSelectedRecord());
		selectInstance();
	}
	updateControlsState();
	if (contracts == null || contracts.size() == 0)
		engine.showMessage("No records that match your search criteria found.", "No results", MessageButtons.OK,MessageIcon.INFORMATION);
	
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void search() throws PresentationLogicException
{
	try 
	{
		ChartResultVoCollection results = null;
		boolean isDFT = isOrderInvestigationDTF();
		
		if(isDFT)
		{
			//WDEV-16618
			if(!selectedPatientSexIsKnown() && VIEW_GRAPHICAL.equals(form.cmbView().getValue()))
			{
				engine.showMessage("Patient sex is unknown.", "Search Error", MessageButtons.OK, MessageIcon.ERROR);
				return;
			}
			
			results = getResultsFromDFTOrderInvestigation(VIEW_TABULAR.equals(form.cmbView().getValue()));
		}
		else
		{
			if(!canSearch())
				return;

			results = domain.listResults(form.getLocalContext().getPatientShort(), form.getGlobalContext().OCRR.getCumulateAnalytes(), form.dteStart().getValue(), form.dteEnd().getValue(), VIEW_TABULAR.equals(form.cmbView().getValue()));//WDEV-16232
			
			if(results == null || results.size() == 0)//WDEV-15802
			{
				engine.showMessage("No records match your search criteria.");
			}
		}

		form.customControl().setValue(generateChartingValueSet(results, isDFT));
	} 
	catch (DomainInterfaceException e) 
	{
		engine.showMessage(e.getMessage());
	}
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean initializeCustomControl() 
{
	UserAssessmentLiteVoCollection list = null;
	form.ccOutpatientAssessment().clearComponent();
	if (form.getGlobalContext().Core.getEpisodeofCareShortIsNotNull())
		list  = domain.listAssessments(form.getGlobalContext().Core.getEpisodeofCareShort().getSpecialty());
	
	if (list != null && list.size() == 1)
	{
		form.getLocalContext().setChosenAssessment(domain.getUserAssessment(list.get(0)));
		loadAssessment();
	}
	else if (list != null && list.size() > 1)
	{
		if (form.getMode().equals(FormMode.EDIT))
		{
			form.getGlobalContext().Assessment.setAssessmentsForSpecialtyCollection(list);
			//engine.open(form..getForms().Assessment.AssessmentsForSpecialty);
		}
	}
		
	if (list.size() == 0)
	{
		if (form.getGlobalContext().Core.getEpisodeofCareShortIsNotNull()
			&& form.getGlobalContext().Core.getEpisodeofCareShort().getSpecialtyIsNotNull())
			engine.showMessage("No configured assessment for Specialty - " + form.getGlobalContext().Core.getEpisodeofCareShort().getSpecialty().toString() + ", was found.", "No Configured Assessment", MessageButtons.OK, MessageIcon.WARNING);
		else
			engine.showMessage("No configured assessment for the current Specialty was found.", "No Configured Assessment", MessageButtons.OK, MessageIcon.WARNING);
		
		form.setMode(FormMode.VIEW);
		manageReadOnly();
		return false;
	}
	form.getLocalContext().setisReadonly(false);
	
	return true;
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onImbNewCustomListClick() throws PresentationLogicException 
{
	if(ConfigFlag.UI.CUSTOM_PATIENT_LIST_ACCESS_TYPE.getValue().equals("HCP"))//WDEV-14238 
	{
		if(domain.getHcpLiteUser()==null) //WDEV-9696 
		{
			form.getLocalContext().setErrorMessage(engine.showMessage("Operation not allowed. User is not HCP.", "", MessageButtons.OK, MessageIcon.INFORMATION));
			return;
		}
	}
		engine.open(form.getForms().Core.NewCustomListDialog);
	}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void search() 
{
	AvailableBedsVo beds = populateDataFromScreen();
	
	form.getGlobalContext().STHK.setAvailableBedsListFilter(beds);
	form.getContextMenus().hideAllGenericGridMenuItems();

	form.grdAvailableBeds().getRows().clear();
	form.lbl6().setValue("Total : 0"); // WDEV-18099 
	BedSpaceStateLiteVoCollection availableBeds = null;
	
	if (beds.countFieldsWithValue() > 0)
	{
		availableBeds  = domain.listAvailableBeds(beds);
	}
	else
	{
		engine.showMessage("Please enter some valid search criteria.", "Invalid search criteria", MessageButtons.OK, MessageIcon.ERROR);
		return;
	}
	
	if (availableBeds == null || availableBeds.size() == 0)
	{
		engine.showMessage("No Bed records match your search criteria.", "No data found", MessageButtons.OK, MessageIcon.WARNING);
		return;
	}
	if (availableBeds != null)
		form.lbl6().setValue("Total : " + String.valueOf(availableBeds.size()));

	populateGrid(availableBeds);	
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * Function used to populate Clinical Outcome records to the grid
 */
private void populateClinicalOutcomeGrid(ClinicalOutcomeConfigDisplayVoCollection clinicalOutcomeConfigDisplayVoCollection, Boolean showErrors)
{
	// Clear screen
	clearScreen();
	
	// Stop if collection is null
	if (clinicalOutcomeConfigDisplayVoCollection == null || clinicalOutcomeConfigDisplayVoCollection.size() == 0)
	{
		if(Boolean.TRUE.equals(showErrors))
		{
			engine.showMessage("No records to match your criteria found", "No records", MessageButtons.OK, MessageIcon.INFORMATION);
		}
		
		return;
	}
	
	for (ClinicalOutcomeConfigDisplayVo outcome : clinicalOutcomeConfigDisplayVoCollection)
	{
		grdClinicalOutcomeConfigsRow row = form.grdClinicalOutcomeConfigs().getRows().newRow();
		
		row.setColCategory(outcome.getCategoryIsNotNull() ? outcome.getCategory().getText() : null);
		row.setColSpecialty(outcome.getSpecialtyIsNotNull() ? outcome.getSpecialty().getText() : null);
		row.setColClinicalOutcome(outcome.getClinicalOutcome());
		row.setColCode(outcome.getDisplayTaxonomy());
		row.setColActive(outcome.getIsActive());
		
		row.setValue(outcome);
	}
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnAcceptClick() throws PresentationLogicException 
{
	if (form.getGlobalContext().RefMan.getReferralContractTypeForPatientIsNotNull() 
		&& ! form.getGlobalContext().RefMan.getReferralContractTypeForPatient().equals(ReferralManagementContractType.REFERRALTRIAGE))
		acceptReferral();
	else
	{
		if (form.getLocalContext().getSelectedRecordIsNotNull()
			&& form.getLocalContext().getSelectedRecord().getReferralDetailsIsNotNull()
			&& form.getLocalContext().getSelectedRecord().getReferralDetails().getServiceIsNotNull())
			form.getLocalContext().setChangeServiceMessageBoxID(engine.showMessage("Do you need to change the Service from - '" + form.getLocalContext().getSelectedRecord().getReferralDetails().getService().getServiceName() + "' to some other Service ?", "Change Service", MessageButtons.YESNO));
	}
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean validateDates()
{
	if (form.dteAppoinmentFrom().getValue() != null && form.dteAppoinmentTo().getValue() != null && form.dteAppoinmentFrom().getValue().isGreaterThan(form.dteAppoinmentTo().getValue()))
	{
		engine.showMessage(" Date To should be greater than Date From .", "Warning", MessageButtons.OK, MessageIcon.WARNING);
		return false;
	}
	
	return true;
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void search(Boolean timerCalled)
{
	PendingEmergencyAdmissionLiteVoCollection voColl = null;

	PendingEmergencyAdmissionsDataVo voFilter = populateDataFromScreen();
	form.grdAdmissions().getRows().clear();
	form.lblTotal().setValue("Total : 0"); //WDEV-18099 
	form.getGlobalContext().STHK.setPendingEmergencyAdmissionsFilter(voFilter);

	if (voFilter.countFieldsWithValue() == 1 && voFilter.getIDTypeIsNotNull())
	{
		engine.showMessage("Please enter some valid search criteria.", "Invalid search cirteria", MessageButtons.OK, MessageIcon.ERROR);
		enableAutoRefeshStart(false);
		return;
	}

	if ((voFilter.countFieldsWithValue() == 1 && voFilter.getIDType() == null) || voFilter.countFieldsWithValue() > 1)
	{
		voColl = domain.listPendingEmergencyAdmissions(voFilter);
	}
	else
	{
		engine.showErrors(new String[]{"Please enter some search criteria."});
		return;
	}

	if (voColl == null || voColl.size() == 0)
	{
		if(!timerCalled)
			engine.showMessage("No matching records found");
		return;
	}
	if (voColl != null)
		form.lblTotal().setValue("Total : " + String.valueOf(voColl.size()));

	if (voColl != null)
		populateGrid(voColl);
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
public boolean save() throws PresentationLogicException
{
	// Get VO data
	TransportBookingShortVo transportBooking = populateDataFromScreen(form.getLocalContext().getselectedTransport());
	Booking_AppointmentTransportVoCollection appointments = getUpdatedAppointments();
	
	// Check for data from screen (an error should never occur)
	if (transportBooking == null)
		throw new CodingRuntimeException("MAJOR LOGICAL ERROR - Can not validate or save a null VO");
	
	// Validate data
	String[] errors = transportBooking.validate();
	
	if (appointments != null)
	{
		errors = appointments.validate(errors);
	}
	
	if (errors != null && errors.length > 0)
	{
		engine.showErrors(errors);
		return false;
	}
	
	try
	{
		// Attempt domain save (will also update the appointments)
		form.getLocalContext().setselectedTransport(domain.saveTransportBooking(transportBooking, appointments));
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue(), "Error", MessageButtons.OK, MessageIcon.ERROR);
		return true;
	}

	return true;
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void showError(String error)
{
	if(error == null || error.length() == 0)
		return;
	
	engine.showMessage(error, "Error", MessageButtons.OK, MessageIcon.ERROR);
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnReloadAllRulesClick() throws PresentationLogicException 
{
	boolean result = engine.reloadAllBusinessRules();
	if(result)
	{
		engine.showMessage("Rules reloaded successfully.", "Rules Reload", MessageButtons.OK, MessageIcon.INFORMATION);
	}
	else 
	{
		engine.showMessage("An error occured while reloading the rules. Please check the system log for the error details.", "Rules Reload", MessageButtons.OK, MessageIcon.ERROR);
	}		
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean checkChildsStatus()
{
	if (form.cmbStatus().getValue() != null)
	{
		if (form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.INACTIVE) && countPreactiveAndActiveRecords() > 0)
		{
			engine.showMessage("If you wish to inactivate the Pathway,All Pathway Targets must be inactivated also.\nSet all Pathway Targets to 'Inactive' now", "Confirmation", MessageButtons.YESNO, MessageIcon.QUESTION);
			return false;
		}
		else if (form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.ACTIVE))
		{
			boolean found = false;
			for (int i = 0; i < form.ctnTargets().grdTargets().getRows().size(); i++)
			{
				if (form.ctnTargets().grdTargets().getRows().get(i).getColStatus().getValue() != null
					&& form.ctnTargets().grdTargets().getRows().get(i).getColStatus().getValue().equals(PreActiveActiveInactiveStatus.PREACTIVE))
				{
					found = true;
					form.ctnTargets().grdTargets().getRows().get(i).setBackColor(Color.Red);
					form.ctnTargets().grdTargets().getRows().get(i).setColStatusReadOnly(false);
				}
			}
			if (found)
			{
				engine.showMessage(WARNING_ACTIVE_PATHWAY);
				return false;
			}
		}
		else if (form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.PREACTIVE))
		{
			for (int i = 0; i < form.ctnTargets().grdTargets().getRows().size(); i++)
			{
				form.ctnTargets().grdTargets().getRows().get(i).setBackColor(null);
				form.ctnTargets().grdTargets().getRows().get(i).setColStatusReadOnly(false);
			}
		}
	}
	return true;
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onCmbRootEntityValueChanged() throws PresentationLogicException
{
	if (form.lyrRules().tabConditions().cmbRootEntity().getValue() == null)
	{
		engine.showMessage("Root entity cannot be null!", "Warning", MessageButtons.OK, MessageIcon.WARNING, MessageDefaultButton.BUTTON1);
	}
	else
	{
		if (form.lyrRules().tabConditions().dyngrdConditions().getRows().size() > 0 && form.lyrRules().tabConditions().dyngrdConditions().getRows().get(0) != null && form.lyrRules().tabConditions().dyngrdConditions().getRows().get(0).getRows().size() > 0)
		{
			engine.showMessage("Root entity is about to be changed. Changed root entity rule will be deleted. Do you want to clear the rule!", "Warning!", MessageButtons.YESNO, MessageIcon.WARNING, MessageDefaultButton.BUTTON2);
		}
		else
		{

			form.lyrRules().tabConditions().dyngrdConditions().getRows().clear();
			form.lyrRules().tabActions().dyngrdActions().getRows().clear();
			addRootLogicalCondition(null);
			DynamicGridRow row = form.lyrRules().tabConditions().dyngrdConditions().getRows().get(0);
			DynamicGridCell cell = row.getCells().get(getColByIndex(1));
			cell.setValue(RuleLogicalCondition.getInstance(RuleLogicalConditionType.ALLTRUE));
			onDyngrdConditionsCellValueChanged(cell);
			form.lyrRules().tabConditions().dyngrdConditions().setSelectedRow(row);
			form.getLocalContext().setRootEntity(form.lyrRules().tabConditions().cmbRootEntity().getValue());
			updateContextMenu();
		}
	}

	updateContextMenu();
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void doSave()
{
	if (!validateAndPopulate())
		return;
	
	if (isStatusInactive() && !form.getLocalContext().getIsInactive())
	{
		engine.showMessage("Are you sure you want to inactivate this assessment ?", "Inactive Assessment", MessageButtons.YESNO, MessageIcon.QUESTION);
		return;
	}

	performSave();
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException
{
	if (!isDepartmentSelected())
	{
		engine.showMessage("Please Select a Department.", "Error", MessageButtons.OK, MessageIcon.WARNING);
	}
	else
	{
		engine.close(DialogResult.OK);
	}
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onGrdAMPSelectionChanged() throws ims.framework.exceptions.PresentationLogicException
{		
	form.grdVTM().getRows().clear();
	form.grdVMP().getRows().clear();
	
	try 
	{
		IDMDValue amp = form.grdAMP().getValue();
		
		VMPRefVo vmpRef = ((AMPVo)amp).getVMP();
		if(vmpRef != null)
		{
			VMPVo vmp = domain.getVMP(((AMPVo)amp).getVMP());
			
			if(vmp != null)
			{
				addVMPItem(vmp);
				if (vmp.getVTM() != null)  //VTMID is optional SN.
					addVTMItem(domain.getVTM(vmp.getVTM()));
			}
		}
	} 
	catch (DomainInterfaceException e) 
	{
		engine.showMessage(e.getMessage(), "Error", MessageButtons.OK, MessageIcon.ERROR);
	}
	
	form.fireCustomControlValueChanged();
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void selectedAttendanceHistory() 
{
	form.getLocalContext().setHistoryMode(false);
	
	
	if(form.grdAttendanceHistory().getValue() instanceof EmergencyAttendanceForTriageLiteVo)
	{
		
		if (form.getLocalContext().getCurrentAttendance() == null) //WDEV-15951, wdev-16751
		{
			EmergencyAttendanceForTriageLiteVo attendance = domain.getEmergencyAttendance((EmergencyAttendanceRefVo) form.grdAttendanceHistory().getValue());
			
			if (attendance.getDischargeDateTime() == null)
			{
				form.getLocalContext().setCurrentAttendance(attendance);
			}
		}
		
		
		if(!form.grdAttendanceHistory().getValue().equals(form.getLocalContext().getCurrentAttendance()))
		{
			form.getLocalContext().setHistoryMode(true);
			form.getLocalContext().setMessageBoxIdForOldEmergencyAttendance(engine.showMessage("Do you wish to view the clinician details for the attendance on " + ((EmergencyAttendanceForTriageLiteVo) form.grdAttendanceHistory().getValue()).getRegistrationDateTime(), "" , MessageButtons.YESNO, MessageIcon.QUESTION));
			
			//WDEV-17745
			form.getLocalContext().setCurrentEvent(EDAssessmentComponent.STOP_TIMER);
			form.fireCustomControlValueChanged();
			
		}
		else
		{
			form.getLocalContext().setSelectedWaitingPatient(domain.geTrackingForTriageByAttendanceId((EmergencyAttendanceForTriageLiteVo) form.grdAttendanceHistory().getValue()));
			form.getGlobalContext().Emergency.setTracking(form.getLocalContext().getSelectedWaitingPatient()); //WDEV-17739
			//form.dyngrdPatients().setValue(form.getLocalContext().getSelectedWaitingPatient());
			
			populateScreenFromData();
			updateControlsState();
		}
	}
}
 
Example 56
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 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * 
 */
protected void onBtnCancelClick() throws PresentationLogicException
{
	if (!form.getLocalContext().getIsModified())
	{
		engine.close(DialogResult.OK);
	}
	else
	{
		engine.showMessage("Rules priority is not saved. Save?", "Rules Not Saved", MessageButtons.YESNOCANCEL);
	}
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean checkReasonableOffer()
{
	String warnings = "";
	int numberOfDates = 0;

	if (Boolean.TRUE.equals(form.chkReasonableOffer().getValue()))
	{

		if (form.dteEarliestDateOffered().getValue() != null && form.dteEarliestDateOffered().getValue().isLessThan(new Date().addDay(REASONABLE_DAYS_LIMIT)))
		{
			warnings += "'Earliest Date Offered' is less than " + REASONABLE_DAYS_LIMIT + " days";
			numberOfDates++;
		}

		if (form.dteSecondDateOffered().getValue() != null && form.dteSecondDateOffered().getValue().isLessThan(new Date().addDay(REASONABLE_DAYS_LIMIT)))
		{
			warnings += (warnings.length() > 0 ? "\n" : "") + "'Second Date Offered' is less than " + REASONABLE_DAYS_LIMIT + " days";
			numberOfDates++;
		}

		if (warnings.length() > 0)
		{
			warnings += "\nDid the patient confirm " + (numberOfDates == 2 ? "these dates" : "this date") + "?";
		}

		if (warnings.length() > 0)
		{
			engine.showMessage(warnings, "Warning", MessageButtons.YESNO, MessageIcon.WARNING);
			return false;
		}
		//else
		//	save(false, true);
	}
	return true;
}
 
Example 59
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())
	{	
		if (form.ctnDetails().qmbEvent().getValue() != null && form.ctnDetails().cmbTargetRTTStat().getValue() != null && form.ctnDetails().cmbTargetRTTStat().getValue().getNationalCode() != null)
		{
			String prefix = "3";
			if (form.ctnDetails().cmbTargetRTTStat().getValue().getNationalCode().toString().startsWith(prefix) && Boolean.FALSE.equals(form.ctnDetails().qmbEvent().getValue().getStopsClock()))
				engine.showMessage("You have selected to map a Target RTT Status Point that stops the pathway clock to '" + form.ctnDetails().qmbEvent().getValue().toString()+ "' pathway event. \rPlease make sure you configure the '" + form.ctnDetails().qmbEvent().getValue().toString() + "' event to stop the pathway clock as well. " , "WARNING!", MessageButtons.OK, MessageIcon.WARNING);
		}	
		open();
	}	
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean initializeCustomControl() 
{
	UserAssessmentLiteVoCollection list = null;
	form.ccAssessment().clearComponent();
	if (form.getGlobalContext().Core.getEpisodeofCareShortIsNotNull())
		list  = domain.listAssessments(form.getGlobalContext().Core.getEpisodeofCareShort().getSpecialty());
	
	if (list != null && list.size() == 1)
	{
		form.getLocalContext().setChosenAssessment(domain.getUserAssessment(list.get(0)));
		loadAssessment();
	}
	else if (list != null && list.size() > 1)
	{
		if (form.getMode().equals(FormMode.EDIT))
		{
			form.getGlobalContext().Assessment.setAssessmentsForSpecialtyCollection(list);
			engine.open(form.getForms().Assessment.AssessmentsForSpecialty);
		}
	}
		
	if (list==null || (list!=null && list.size() == 0))
	{
		if (form.getGlobalContext().Core.getEpisodeofCareShortIsNotNull()
			&& form.getGlobalContext().Core.getEpisodeofCareShort().getSpecialtyIsNotNull())
			engine.showMessage("No configured assessment was found for Specialty - " + form.getGlobalContext().Core.getEpisodeofCareShort().getSpecialty().toString() + " and TaxonomyMapping MAXIMS = ED_ASSESS.", "No Configured Assessment", MessageButtons.OK, MessageIcon.WARNING);
		else
			engine.showMessage("No configured assessment was found for the current Specialty  and TaxonomyMapping MAXIMS = ED_ASSESS.", "No Configured Assessment", MessageButtons.OK, MessageIcon.WARNING);
		
		form.setMode(FormMode.VIEW);
		return false;
	}
	
	form.getLocalContext().setisEnabled(true);
	return true;
}