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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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;
}