Java Code Examples for ims.framework.utils.Date

The following are top voted examples for showing how to use ims.framework.utils.Date. 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
public void newInstance() throws PresentationLogicException
{
	if (allowNew())
	{
		// initalise the screen for a new record
		form.getLocalContext().setSelectedRecord(new SocialStatusVo());
		clearInstanceControls();
		form.ctnSocialStatus().customControlAuthor().initializeComponent();
		form.ctnSocialStatus().dteDateOPD().setValue(new Date());
		form.ctnSocialStatus().setCollapsed(false);
		//set the form mode
		form.grdModalityIndex().setValue(null);//wdev-2041
		form.setMode(FormMode.EDIT);
		//set any control status specific this form
		//form.ctnSocialStatus().setcustomControlAuthorEnabled(true);
	}	
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean validateSearchCriteria() 
{
	ArrayList<String> uiErrors = new ArrayList<String>();
	Date dateFrom = form.dteFrom().getValue();
	Date dateTo = form.dteTo().getValue();
	
	if (dateFrom != null && dateTo != null && dateTo.isLessThan(dateFrom))
	{
		uiErrors.add("From Date can not be greater than End Date");
	}
	
	if (uiErrors.size() > 0)
	{
		engine.showErrors(uiErrors.toArray(new String[uiErrors.size()]));
		return false;
	}
	return true;
}
 
Example 3
Project: AvoinApotti   File: ClinicListwithICPActionsImpl.java   View source code 6 votes vote down vote up
private PathwayRTTStatus createPatientRTTStatus(int nationalCode) //WDEV-18325
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();
	
	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);
	
	rttSTatusDO.setRTTStatus(rttStatusPoint);
	
	Object mos = getMosUser();
	MemberOfStaff doMos = null;
	
	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}
	
	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(new java.util.Date());
	
	rttSTatusDO.setSetting("O");
	
	return rttSTatusDO;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean validateSearchCriteria(boolean showErrors)
{
	ArrayList<String> uiErrors = new ArrayList<String>();
	
	Date dateFrom = form.dteFrom().getValue();
	Date dateTo = form.dteTo().getValue();
	
	if (dateFrom != null && dateTo != null && dateTo.isLessThan(dateFrom))
	{
		uiErrors.add("Date from can not be greater than date to");
	}
	
	if (uiErrors.size() > 0)
	{
		if (showErrors)
			engine.showErrors(uiErrors.toArray(new String[uiErrors.size()]));
		return false;
	}
	
	return true;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void listSessions(boolean useFirstAvaialbleCheck)
{

	ActivityVo voActivity = form.cmbActivity().getValue();

	if (useFirstAvaialbleCheck)
	{
		if (form.chkFirst().getValue() == true)
		{
			Date currentDate = domain.getCurrentMonth(form.cmbClinic().getValue(), voActivity, form.cmbSpecialty().getValue(), form.cmbLocation().getValue(), form.customControlHcp().getValue(), form.chkFirst().getValue());
			if (currentDate != null)
			{
				form.bookingCalendar1().setCurrentMonth(currentDate);
				form.getLocalContext().setCurrentDate(currentDate);
			}
		}
	}

	Date dateStart = new Date(form.bookingCalendar1().getCurrentMonth().getYear(), form.bookingCalendar1().getCurrentMonth().getMonth(), 1);
	Date dateEnd = new Date(form.bookingCalendar1().getCurrentMonth().getYear(), form.bookingCalendar1().getCurrentMonth().getMonth(), form.bookingCalendar1().getCurrentMonth().getNumberOfDaysInTheMonth());

	SessionShortVoCollection voCollSessionShort = domain.listGenericSession(dateStart, dateEnd, form.cmbClinic().getValue(), voActivity, form.cmbSpecialty().getValue(), form.cmbLocation().getValue(), form.customControlHcp().getValue(), form.chkFirst().getValue(), form.chkOverBook().getValue());
	form.getLocalContext().setSessions(voCollSessionShort);
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void updateDocumentStatus(DocumentStatus value)
{

	if (value.equals(DocumentStatus.SUPLEMENTRY))
	{

		CorrespondenceDetailsVo voCorrespondenceDetails = form.getLocalContext().getcorrespondenceDetails();
		DocumentVo nuDoc = new DocumentVo();
		nuDoc.setTemplate(form.getGlobalContext().Correspondence.getReportTemplate());
		nuDoc.setPatient(form.getGlobalContext().Core.getPatientShort());
		nuDoc.setStatus(DocumentStatus.GENNOTPRINTED);
		nuDoc.setContent(voCorrespondenceDetails.getCurrentDocument().getContent());
		nuDoc.setCreationDate(new Date());
		voCorrespondenceDetails.setCurrentDocument(nuDoc);
		voCorrespondenceDetails.setCurrentStatus(DocumentStatus.GENNOTPRINTED);
		form.getLocalContext().setcorrespondenceDetails(voCorrespondenceDetails);
		form.getLocalContext().getcorrespondenceDetails();

	}
	else
	{

		form.getLocalContext().getcorrespondenceDetails().getCurrentDocument().setStatus(value);

	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initialise()
{
	if(form.getGlobalContext().Nursing.getCarePlanEvaluationFilterIsNotNull())		//wdev-10789
	{
		CarePlanEvaluationFilterVo tempVo = form.getGlobalContext().Nursing.getCarePlanEvaluationFilter();
		form.dteFrom().setValue(tempVo.getFromDate());
		form.dteTo().setValue(tempVo.getToDate());
		form.chkActive().setValue(tempVo.getActiveOnly());
	}
	else
	{
		form.dteFrom().setValue(new Date().addDay(-30));
		form.dteTo().setValue(new Date());
		form.chkActive().setValue(true);
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void prePopulateOtherControls()
{
	SpecimenCollectionMethodCollection collTypes = LookupHelper.getSpecimenCollectionMethod(domain.getLookupService());
	for (int i = 0; i < collTypes.size(); i++)
	{
		if (collTypes.get(i).equals(SpecimenCollectionMethod.OTHER))
		{
			for (int p = 0; p < collTypes.get(i).getChildren().length; p++)
				form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().newRow((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p], ((SpecimenCollectionMethod) collTypes.get(i).getChildren()[p]).getText());

			break;
		}
	}

	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().dteCollectOther().setValue(new Date());
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().cmbRequestedTypeOther().setValue(SpecimenCollectionMethod.WARDCOLLECTION);
	form.lyrDetails().tabPathDetails().lyrPathology().tabOther().btnApplyOther().setEnabled(true);
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initialize()
{
	form.lyrMain().tabCharting().chartingControl().initialize(engine.isDialog());
	
	populateDispipline();
	populateChartTypes();
	form.lyrMain().tabSearch().GroupFilterResults().setValue(GenForm.lyrMainLayer.tabSearchContainer.GroupFilterResultsEnumeration.rdoAll);
	form.lyrMain().tabSearch().GrpCriteria().setValue(GenForm.lyrMainLayer.tabSearchContainer.GrpCriteriaEnumeration.rdoBegins);
	updateTotal(0);

	form.lyrMain().tabCharting().dteChartingStartDate().setValue(new Date().addYear(-1));
	form.lyrMain().tabCharting().dteChartingEndDate().setValue(new Date());

	setupGraphingView();
	
	//security level WDEV-11036
	RoleDisciplineSecurityLevelLiteGCVo voRoleDisciplineSecurityLevels = form.getGlobalContext().OCRR.getRoleDisciplineSecurityLevels();
	if(voRoleDisciplineSecurityLevels == null || (voRoleDisciplineSecurityLevels != null &&  voRoleDisciplineSecurityLevels.getIsConfigLoadedIsNotNull() && !voRoleDisciplineSecurityLevels.getIsConfigLoaded().equals(false)))
		form.getGlobalContext().OCRR.setRoleDisciplineSecurityLevels(domain.getRoleDisciplineSecurityLevels(engine.getLoggedInRole()));
	
	form.btnPrint().setEnabled(false);
	
	updatePrintCumulativeButtonStatus();
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onBtnNewClick() throws PresentationLogicException
{

	clearScreen();
	form.setMode(FormMode.EDIT);
	form.txtComments().setFocus();

	TransferNote voTran = new TransferNote();
	form.getLocalContext().setRecord(voTran);

	if (domain.getMosUser() != null)
		form.txtHCP().setValue(((MemberOfStaffShortVo) domain.getMosUser()).toString());

	form.dteRecording().setValue(new Date());
	form.timRecording().setValue(new Time());

	form.dteTransfer().setValue(new Date());
	form.timTransfer().setValue(new Time());

	form.btnUpdate().setEnabled(false);
}
 
Example 11
Project: AvoinApotti   File: IntraOperativeCareRecordImpl.java   View source code 6 votes vote down vote up
public Booking_AppointmentShortVo getMostRecentOutPatientAppointment(PatientRefVo voPatientRef)
{
	if (voPatientRef == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	
	String hql = "from Booking_Appointment as b1	where (b1.appointmentDate <= :todayDate and b1.theatreBooking is null and b1.patient.id = :patID) order by b1.appointmentDate desc";

	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();

	paramNames.add("todayDate");
	paramValues.add(new Date().getDate());
	
	paramNames.add("patID");
	paramValues.add(voPatientRef.getID_Patient());
	
	List list = factory.find(hql, paramNames, paramValues);
	if (list != null && list.size() > 0)
		return Booking_AppointmentShortVoAssembler.createBooking_AppointmentShortVoCollectionFromBooking_Appointment(list).get(0);
	else
		return null;
}
 
Example 12
Project: AvoinApotti   File: DemographicsImpl.java   View source code 6 votes vote down vote up
private PathwayRTTStatus createPathwRTTStatus(int nationalCode) throws StaleObjectException //WDEV-18326
{
	PathwayRTTStatus rttSTatusDO = new PathwayRTTStatus();

	RTTStatusPoint rttStatusPoint = getRTTStatusPointFromConfig(nationalCode);

	rttSTatusDO.setRTTStatus(rttStatusPoint);

	Object mos = getMosUser();
	MemberOfStaff doMos = null;

	if(mos instanceof MemberOfStaffLiteVo)
	{
		doMos = MemberOfStaffLiteVoAssembler.extractMemberOfStaff(getDomainFactory(), (MemberOfStaffLiteVo) mos);
	}

	rttSTatusDO.setStatusBy(doMos);
	rttSTatusDO.setStatusDateTime(new java.util.Date());

	return rttSTatusDO;
}
 
Example 13
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private Date[] getDateArray()
{
	Date[] arrDates = new Date[8];
	Date dispDate1 = form.dteStart().getValue().copy();
	arrDates[0] = dispDate1;
	Date dispDate2 = form.dteStart().getValue().copy().addDay(1);
	arrDates[1] = dispDate2;
	Date dispDate3 = form.dteStart().getValue().copy().addDay(2);
	arrDates[2] = dispDate3;
	Date dispDate4 = form.dteStart().getValue().copy().addDay(3);
	arrDates[3] = dispDate4;
	Date dispDate5 = form.dteStart().getValue().copy().addDay(4);
	arrDates[4] = dispDate5;
	Date dispDate6 = form.dteStart().getValue().copy().addDay(5);
	arrDates[5] = dispDate6;
	Date dispDate7 = form.dteStart().getValue().copy().addDay(6);
	arrDates[6] = dispDate7;
	Date dispDate8 = form.dteStart().getValue().copy().addDay(7);
	arrDates[7] = dispDate8;

	return arrDates;
}
 
Example 14
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onGridActionsGridCheckBoxClicked(int column, gridActionsRow row, boolean isChecked) throws PresentationLogicException
{
	if (isChecked)
	{
		row.setColActionDate(new Date().toString(DateFormat.STANDARD));

		Object hcpLite = domain.getHcpLiteUser();
		row.setColByValue(hcpLite != null ? (HcpLiteVo) hcpLite : null);
		row.setColBy(hcpLite != null ? (((HcpLiteVo) hcpLite).getName() != null ? ((HcpLiteVo) hcpLite).getName().toString() : null) : null);
	}
	else
	{
		row.setColActionDate(null);
		row.setColBy("");
		row.setColDetails("");
		// row.setReadOnly(true);
	}

}
 
Example 15
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onGrdHomeLeaveSelectionChanged() throws PresentationLogicException 
{
	form.getLocalContext().setAdmissionDetail(null);
	clearScreen();
	if(form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue() == null)
		return;

	form.dteHLDateReturn().setEnabled(true);
	form.timHLTimeOfReturn().setEnabled(true);
	form.dteHLDateReturn().setValue(new Date());

	form.getLocalContext().setRecordSelected(true);
	
	InpatientEpisodeLiteVo voInWaiting = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue();
	AdmissionDetailVo voAdmission = domain.getAdmissionDetailByPasEvent(voInWaiting.getPasEvent());
	if(voAdmission == null)
		return;
	
	form.getLocalContext().setAdmissionDetail(voAdmission);
	form.fireCustomControlValueChanged();
}
 
Example 16
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateResultsGrid(ClinicalResultListVoCollection voCollResults, Date dateUnseen)
{
	if (voCollResults == null || voCollResults.size() == 0)
	{
		engine.showMessage("No records match your search criteria.");
		return;
	}

	form.getLocalContext().setResultCollectionFromGrid(null); //WDEV-16882
	
	for (int i = 0; i < voCollResults.size(); i++)
	{
		Color backColour = ((i % 2) == 0 ? Color.Beige : Color.Default);
		addResultRow(voCollResults.get(i), dateUnseen, backColour);
	}
	
	updateTotal();
}
 
Example 17
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 18
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private String getNumberOfDaysPostOp(DateTime surgeryStartTime) 
{
	if(surgeryStartTime == null)
		return "";
	
	Date currentDate = new Date();
	
	if(surgeryStartTime.getDate().equals(currentDate))
		return "Number of days post op = 0";
	
	if(surgeryStartTime.getDate().isGreaterThan(currentDate))
		return "";
	
	long a = Date.daysBetween(surgeryStartTime.getDate(), currentDate);
	
	return "Number of days post op = " + a;
}
 
Example 19
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void populateScreenFromPatientSelected(PatientShort voPatient)
{
	clearScreen();
	
	if(voPatient == null)
		return;
	
	if(form.getGlobalContext().Core.getADTWardIsNotNull())
	{
		form.cmbWard().newRow(form.getGlobalContext().Core.getADTWard(), form.getGlobalContext().Core.getADTWard().toString());
		form.cmbWard().setValue(form.getGlobalContext().Core.getADTWard());			
	}
	
	//WDEV-10076
	form.cmbMethod().setValue(null);
	form.dtimAdmit().setValue(new DateTime());
	form.dteEstDischarge().setValue(new Date()); 	
	form.chkChaplain().setValue(false);
	
	form.cmbPatientStatus().setValue(PatientStatus.NHS);

	loadEpisodes();
	
}
 
Example 20
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void listAppointments(Date endDate, Date startDate, boolean listBookedAppointments)
{
	try
	{
		// Perform domain search
		Booking_AppointmentTransportVoCollection appointments = domain.listAppoinments(startDate, endDate, listBookedAppointments);
		
		// Show message for no results found
		if (appointments == null || appointments.size() == 0)
		{
			engine.showMessage("No results were found.");
		}
		
		// Show the search results
		setSearchResultsGrid(appointments);
	}
	catch (DomainInterfaceException e)
	{
		// Show errors message for exceptions
		engine.showMessage(e.getMessage(), "Error");
	}
}
 
Example 21
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void clearBookingCalendar()
{
	form.bookingCalendar().clearBookedChecks();
	form.bookingCalendar().clearChecks();
	form.bookingCalendar().clearPercentages();
	form.bookingCalendar().clearNoSessionDates();
	form.bookingCalendar().clearNoSlotDates();
	form.bookingCalendar().clearBackColors();

	Date dateStart = new Date(form.bookingCalendar().getCurrentMonth().getYear(), form.bookingCalendar().getCurrentMonth().getMonth(), 1);
	Date dateEnd = new Date(form.bookingCalendar().getCurrentMonth().getYear(), form.bookingCalendar().getCurrentMonth().getMonth(), form.bookingCalendar().getCurrentMonth().getNumberOfDaysInTheMonth());

	while (dateStart.isLessOrEqualThan(dateEnd))
	{
		form.bookingCalendar().addNoSessionDates(new Date(dateStart));
		dateStart.addDay(1);
	}
}
 
Example 22
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean isSearchCriteriaValid()
{
	if (form.txtType().getValue() != null && form.cmbType().getValue() == null)
	{
		engine.showMessage("Please select a Patient ID Type");
		return false;
	}

	ArrayList<String> uiErrors = new ArrayList<String>();

	Date dateFrom = form.dteFrom().getValue();
	Date dateTo = form.dteTo().getValue();

	if (dateFrom != null && dateTo != null && dateTo.isLessThan(dateFrom))
	{
		uiErrors.add("'Date From' can not be greater than 'Date To'");
	}

	if (uiErrors.size() > 0)
	{
		engine.showErrors(uiErrors.toArray(new String[uiErrors.size()]));
		return false;
	}

	return true;
}
 
Example 23
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws PresentationLogicException
{
	initializeDynamicGrid();
	//WDEV-16115
	form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.NEWRESULT);
	if (form.ccPrinter().getSelectedPrinter() == null)
	{
		form.ccPrinter().initialize(domain.getCurrentLocation(), PrinterScope.OCSORDER);
	}
	PathologyResultListShortVoCollection results = form.getGlobalContext().OCRR.getResultsForPrint();
	if (results == null)
		return;

	Integer nNewResUnseenDays = new Integer(ConfigFlag.DOM.OCS_NEWRES_UNSEEN_CUTOFF.getValue());
	Date dateUnseen = new Date().addDay(-1 * nNewResUnseenDays.intValue());

	for (int x = 0; x < results.size(); x++)
	{
		addResult(results.get(x), dateUnseen);
	}		
}
 
Example 24
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void clearBookingCalendar()
{
	form.bookingCalendar1().clearBookedChecks();
	form.bookingCalendar1().clearChecks();
	form.bookingCalendar1().clearPercentages();
	form.bookingCalendar1().clearNoSessionDates();
	form.bookingCalendar1().clearNoSlotDates();
	form.bookingCalendar1().clearBackColors();

	Date dateStart = new Date(form.bookingCalendar1().getCurrentMonth().getYear(), form.bookingCalendar1().getCurrentMonth().getMonth(), 1);
	Date dateEnd = new Date(form.bookingCalendar1().getCurrentMonth().getYear(), form.bookingCalendar1().getCurrentMonth().getMonth(), form.bookingCalendar1().getCurrentMonth().getNumberOfDaysInTheMonth());

	while (dateStart.isLessOrEqualThan(dateEnd))
	{
		form.bookingCalendar1().addNoSessionDates(new Date(dateStart));
		dateStart.addDay(1);
	}
}
 
Example 25
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onRadioButtongrpShowByValueChanged() throws PresentationLogicException 
{
	if(form.grpShowBy().getValue().equals(GenForm.grpShowByEnumeration.rdoByDay))
	{
		form.dteShowByDay().setEnabled(true);
		form.dteShowByDay().setValue(new Date());
		form.dteFrom().setEnabled(false);
		form.dteTo().setEnabled(false);
		form.dteFrom().setValue(null);
		form.dteTo().setValue(null);
	}
	else
	{
		form.dteShowByDay().setEnabled(false);
		form.dteShowByDay().setValue(null);
		form.dteFrom().setEnabled(true);
		form.dteTo().setEnabled(true);
		form.dteFrom().setValue(new Date());
		form.dteTo().setValue(new Date());
	}
	onBtnViewClick();
}
 
Example 26
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onRadioButtongrpShowByValueChanged() throws PresentationLogicException 
{
	if(form.grpShowBy().getValue().equals(GenForm.grpShowByEnumeration.rdoDay))
	{
		form.dteShowByDay().setEnabled(true);
		form.dteShowByDay().setValue(new Date());
		form.dteFrom().setEnabled(false);
		form.dteTo().setEnabled(false);
		form.dteFrom().setValue(null);
		form.dteTo().setValue(null);
	}
	else
	{
		form.dteShowByDay().setEnabled(false);
		form.dteShowByDay().setValue(null);
		form.dteFrom().setEnabled(true);
		form.dteTo().setEnabled(true);
		form.dteFrom().setValue(new Date());
		form.dteTo().setValue(new Date());
	}
	
	onBtnViewClick();
	
}
 
Example 27
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
protected void onRadioButtongrpShowByValueChanged() throws ims.framework.exceptions.PresentationLogicException
{
	if(form.grpShowBy().getValue().equals(GenForm.grpShowByEnumeration.rdoDay))
	{
		form.dteDay().setEnabled(true);
		form.dteDay().setValue(new Date());
		form.dteFrom().setEnabled(false);
		form.dteTo().setEnabled(false);
		form.dteFrom().setValue(null);
		form.dteTo().setValue(null);
	}
	else
	{
		form.dteDay().setEnabled(false);
		form.dteDay().setValue(null);
		form.dteFrom().setEnabled(true);
		form.dteTo().setEnabled(true);
		form.dteFrom().setValue(new Date());
		form.dteTo().setValue(new Date());
	}
	
	onBtnViewClick();
}
 
Example 28
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private Integer calculateWaintingTime(Date sd, Date ed)
{
	if (sd != null && ed != null)	
		return (int)Date.daysBetween(sd, ed);
	
	return null;
}
 
Example 29
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onBookingCalendarApptsMonthSelected(
		ims.framework.utils.Date date)
		throws ims.framework.exceptions.PresentationLogicException {
	if (validateSearchCriteria() == null) {
		clearBookingCalendar();
		listSessions();
		form.bookingCalendarAppts().clearNoSessionDates();
		initialiseCalendar();
	}
}
 
Example 30
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
public String[] validateUIRules()
{
	List<String> uiErrors = new ArrayList<String>();
	
	if (form.cmbStatus().getValue() != null)
	{
		if (form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.ACTIVE) && form.dteActiveFrom().getValue() == null)
			uiErrors.add("Please enter Active From date value.");
	
		if (form.cmbStatus().getValue().equals(PreActiveActiveInactiveStatus.INACTIVE) && (form.dteActiveFrom().getValue() == null || form.dteActiveTo().getValue() == null))
			uiErrors.add("Please enter Active From and Active To date values.");
		
	}
	
	// Validate Active To date not to be set into future if version status is inactive
	if (PreActiveActiveInactiveStatus.INACTIVE.equals(form.cmbStatus().getValue()) && form.dteActiveTo().getValue() != null && form.dteActiveTo().getValue().isGreaterThan(new Date()))
		uiErrors.add("Active To date can not be set into future if version status is inactive");
	
	if (form.dteActiveFrom().getValue() != null && form.dteActiveTo().getValue() != null)
		if (form.dteActiveFrom().getValue().isGreaterThan(form.dteActiveTo().getValue()))
			uiErrors.add("Active From date must be before Active To date.");
	
	String[] voValidate = new String[uiErrors.size()];
	uiErrors.toArray(voValidate);
	
	return voValidate;
}
 
Example 31
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onRadioButtonGroup1ValueChanged() throws PresentationLogicException 
{
	//WDEV-15957
	if(Group1Enumeration.rdoYes.equals(form.lyrAdditionalDetails().tabCopy().Group1().getValue()) && form.lyrAdditionalDetails().tabCopy().dteEffectiveFromDate().getValue() == null)
	{
		form.lyrAdditionalDetails().tabCopy().dteEffectiveFromDate().setValue(new Date());
		form.lyrAdditionalDetails().tabCopy().dteEffectiveFromDate().setRequired(true);
	}
	else
	{
		form.lyrAdditionalDetails().tabCopy().dteEffectiveFromDate().setValue(null);
		form.lyrAdditionalDetails().tabCopy().dteEffectiveFromDate().setRequired(false);
	}
}
 
Example 32
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void listAppointmentsForPatientAndDate()
{
	Date dteAppt = null;
	if(form.getLocalContext().getDateApptIsNotNull())
		dteAppt = form.getLocalContext().getDateAppt();
	else
		dteAppt = form.dteAppt().getValue();
	Booking_AppointmentShortVoCollection voCollBookingAppointment = domain.listBookingAppointmentByPatientAndDate(form.getLocalContext().getselectedPatient(), dteAppt);
	populateApptsGrid(voCollBookingAppointment);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String[] validateUIRules()
{
	ArrayList<String> errors = new ArrayList<String>();
	
	if (form.lyrDetails().tabDetails().dteDecisionTreat().getValue() != null && form.lyrDetails().tabDetails().dteDecisionTreat().getValue().isGreaterThan(new Date()))
		errors.add("Date Decision to Treat can not be set in the future.");

	if (form.lyrDetails().tabDetails().dteStart().getValue() != null && form.lyrDetails().tabDetails().dteEnd().getValue() != null && form.lyrDetails().tabDetails().dteStart().getValue().isGreaterThan(form.lyrDetails().tabDetails().dteEnd().getValue()))
		errors.add("Actual Start Date can not be greater than Actual End Date.");
	
	if (errors.size() == 0)
		return null;

	return errors.toArray(new String[errors.size()]);
}
 
Example 34
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
@Override
protected void onIntAMPeriodValueChanged() throws PresentationLogicException 
{
	if (form.lyr1().tabActiveMonitoring().dteAMApptBy().getValue() == null
		&& form.lyr1().tabActiveMonitoring().intAMPeriod().getValue() != null
		&& form.lyr1().tabActiveMonitoring().intAMPeriod().getValue() > 0)
		form.lyr1().tabActiveMonitoring().dteAMApptBy().setValue(new Date().addDay(form.lyr1().tabActiveMonitoring().intAMPeriod().getValue()));
}
 
Example 35
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void initialise()
{
	form.dteDate().setValue(new Date());
	loadHospitals();

	createDynamicGrid();

	updateControlsState();
}
 
Example 36
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void initialize()
{
	form.qmbClinic().setEnabled(false);

	PatIdType dispIdType = PatIdType.getNegativeInstance(ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue());
	form.grdOutPatient().setcolHospnumCaption(dispIdType.getText());
	loadClinicLocationCombo();

	UserAccessVo voUserAccess = domain.getUserAccess(engine.getLoggedInUser().getUserId());
	
	if(voUserAccess!=null){
		form.qmbClinic().setVisible(false);
		form.cmbClinic().setVisible(true);
		form.qmbConsultant().setVisible(false);
		form.cmbConsultant().setVisible(true);
		populateCombos(voUserAccess);
	}
	else{
		form.qmbClinic().setVisible(true);
		form.qmbClinic().setEnabled(true);
		form.cmbClinic().setVisible(false);
		form.qmbConsultant().setVisible(true);
		form.cmbConsultant().setVisible(false);
		// WDEV-2847
		populateQmbConsultants();
	}
	form.dteApptDateTo().setValue(new Date());

}
 
Example 37
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private Date calculateEnd18WW(ContractConfigShortVo contract)
{
	if (contract != null)
		return new Date().addDay(contract.getDaysToRTTBreachDate());

	return new Date();
}
 
Example 38
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private String getSlotDateTimeString(SessionSlotListVo slot) {
	String slotDateTime = "";

	Date daySel = form.bookingCalendarAppts().getSelectedDay();
	if (daySel != null)
		slotDateTime += daySel.toString();

	if (slot.getStartTmIsNotNull())
		slotDateTime += " " + slot.getStartTm();

	return slotDateTime;
}
 
Example 39
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void calculateAndSetDateRange()
{
	if (form.cmbDays().getValue() != null)
	{
		int days = form.cmbDays().getValue().intValue();
		form.dteTo().setValue(new Date());
		form.dteFrom().setValue(new Date().addDay(-1 * days));
	}
}
 
Example 40
Project: AvoinApotti   File: PatientAppointmentMangementRefManImpl.java   View source code 5 votes vote down vote up
private void saveLastApptArrivedDate(DomainFactory factory, Booking_Appointment doBookAppt) throws StaleObjectException
{
	if(factory == null || doBookAppt == null)
		throw new CodingRuntimeException("all mandatory params not populated for method saveLastApptArrivedDate");
	
	List lstCatsRef = factory.find("from CatsReferral catsRef join fetch catsRef.appointments appt where appt.id = '" + doBookAppt.getId() + "'");
	if(lstCatsRef != null && lstCatsRef.size() == 1)
	{
		CatsReferral doCatsRef = (CatsReferral) lstCatsRef.get(0);
		doCatsRef.setLastApptArrivedDate(new Date().getDate());
		factory.save(doCatsRef);
	}
}