Java Code Examples for ims.configuration.AppRight

The following are top voted examples for showing how to use ims.configuration.AppRight. 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 void updateContextMenuActionsState()
{
	boolean editMode = FormMode.EDIT.equals(form.getMode());
	
	boolean isCcoSpecific =  ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().equals("CCO");
	boolean isRowSelected = form.dyngrdActions().getSelectedRow() != null;
	boolean isCurrentActionActive = false;
	if (isRowSelected)
		isCurrentActionActive = ((CarePlanInterventions)form.dyngrdActions().getValue()).getActive();
	
	boolean currentActionRemoved = false;
	if (isRowSelected)
		currentActionRemoved = Boolean.TRUE.equals(((CarePlanInterventions)form.dyngrdActions().getValue()).getIsRemoved());
		
	form.getContextMenus().Nursing.getCarePlanEvaluateActionADDItem().setVisible(editMode);
	form.getContextMenus().Nursing.getCarePlanEvaluateActionMARKACTIONCOMPLETEItem().setVisible(editMode && isRowSelected && isCcoSpecific && isCurrentActionActive && !currentActionRemoved);
	form.getContextMenus().Nursing.getCarePlanEvaluateActionREACTIVATEACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !isCurrentActionActive && engine.hasRight(AppRight.NURSING_ADMIN_ROLE) && !currentActionRemoved);
	
	form.getContextMenus().Nursing.getCarePlanEvaluateActionREMOVE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && !currentActionRemoved);
	form.getContextMenus().Nursing.getCarePlanEvaluateActionREINSTATE_ACTIONItem().setVisible(editMode && isRowSelected && isCcoSpecific && currentActionRemoved);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void updateControlsState() 
{
	//WDEV-14080
	form.btnEdit().setVisible(form.getMode().equals(FormMode.VIEW) && form.grdPatClericalTask().getValue()!=null && form.getLocalContext().getlocalContextClericalTaskIsNotNull() && form.getLocalContext().getlocalContextClericalTask().getStatus().equals(PatientClericalTaskStatus.OUTSTANDING));
	form.btnTaskComplete().setVisible(form.getMode().equals(FormMode.VIEW) && form.grdPatClericalTask().getValue()!=null && form.getLocalContext().getlocalContextClericalTaskIsNotNull() &&form.getLocalContext().getlocalContextClericalTask().getStatus().equals(PatientClericalTaskStatus.OUTSTANDING));
	
	form.btnNew().setEnabled(form.getMode().equals(FormMode.VIEW) && engine.hasRight(AppRight.CAN_ALLOCATE_PATIENT_CLERICAL_TASKS));
	form.btnNew().setVisible(form.getMode().equals(FormMode.VIEW));
			
	form.ccRequestor().setEnabled(form.getMode().equals(FormMode.EDIT));
	form.ccAllocate().setEnabled(form.getMode().equals(FormMode.EDIT));
	
	form.lblCompletedBy().setVisible(form.getLocalContext().getlocalContextClericalTaskIsNotNull() && form.getLocalContext().getlocalContextClericalTask().getStatus().equals(PatientClericalTaskStatus.COMPLETED));
	form.ccCompleted().setVisible(form.getLocalContext().getlocalContextClericalTaskIsNotNull() && form.getLocalContext().getlocalContextClericalTask().getStatus().equals(PatientClericalTaskStatus.COMPLETED));
	form.lblCompletedOn().setVisible(form.getLocalContext().getlocalContextClericalTaskIsNotNull() && form.getLocalContext().getlocalContextClericalTask().getStatus().equals(PatientClericalTaskStatus.COMPLETED));
	form.dtimCompleted().setVisible(form.getLocalContext().getlocalContextClericalTaskIsNotNull() && form.getLocalContext().getlocalContextClericalTask().getStatus().equals(PatientClericalTaskStatus.COMPLETED));
	
	//FB latest changes for WDEV-13879 - 12.01.2012
	form.ccCompleted().setEnabled(false);
	form.dtimCompleted().setEnabled(false);
	
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdWardsSelectionChanged() throws ims.framework.exceptions.PresentationLogicException
{					
	form.getGlobalContext().Core.setPatientShort(null);
	

	if (ConfigFlag.UI.INPAT_CREATE_CORRESPONDENCE_DETAILS.getValue())
	{
		selectionChanged();
	}
	else if (engine.hasRight(AppRight.CAN_DISCHARGE_INPATIENT_IN_RCHT))
	{
		selectionChanged();
	}
	else if (ConfigFlag.UI.MAXIMS_ADT_NO_INTERFACE.getValue())
	{
		selectionChanged();
	}
	else
	{
		showDemographics();
	}

}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * Function used to set an action to MET status
 */
private void doActionMet()
{
	try
	{
		MemberOfStaffLiteVo mos = form.getLocalContext().getLoggedInUserIsNotNull() ? form.getLocalContext().getLoggedInUser().getMos() : null;

		// Set action status to Action MET
		domain.setActionStatus(form.getGlobalContext().ICP.getPatientICPRecord(), (PatientICPActionRefVo) form.dyngrdICP().getValue(), ICPActionStatus.MET, engine.hasRight(AppRight.CAN_COUNTERSIGN), mos);

		// Refresh screen
		refresh();
	}
	catch (StaleObjectException exception)
	{
		// Display SOE message
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		// Refresh screen
		refresh();
	}
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * Function used to set an action to NOT MET status
 */
private void doActionNotMet()
{
	try
	{
		MemberOfStaffLiteVo mos = form.getLocalContext().getLoggedInUserIsNotNull() ? form.getLocalContext().getLoggedInUser().getMos() : null;
		
		// Set action status to Action NOT MET
		PatientICPAction_PresentationVo icpAction = domain.setActionStatus(form.getGlobalContext().ICP.getPatientICPRecord(), (PatientICPActionRefVo) form.dyngrdICP().getValue(), ICPActionStatus.NOT_MET, engine.hasRight(AppRight.CAN_COUNTERSIGN), mos);

		// Display dialog for recording action variance
		form.getGlobalContext().ICP.setActionStatus(icpAction.getCurrentStatus());
		engine.open(form.getForms().ICP.RecordICPActionVariance);
	}
	catch (StaleObjectException exception)
	{
		// Display SOE message
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		// Refresh screen
		refresh();
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private SessionTheatreVoCollection listSessions()
{
	SessionTheatreVoCollection voCollSessions = null;
	
	MoveAppointmentDataVo voData = form.getGlobalContext().Scheduling.getMoveAppointmentDialogData();
	if(voData.getFromSlotIsNotNull() && voData.getFromSlot().getAppointmentIsNotNull())
	{
		SessionSearchCriteriaVo voCriteria = domain.getSessionSearchCriteriaByAppointment(voData.getFromSlot().getAppointment());
		if(voCriteria != null)
		{
			voCollSessions = domain.listSession(form.dteSession().getValue(), form.dteSession().getValue(), voCriteria.getSessionService(), voCriteria.getSessionLocation(), voCriteria.getSessionConsultant(), voCriteria.getSessionProcedure(), voCriteria.getSessionTheatreType(), 0, engine.hasRight(AppRight.CAN_OVERBOOK_THEATRE_APPTS), voCriteria.getSessionAnaestheticType());
		}
	}

	return voCollSessions;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateAppRightsCombo(boolean bOnUpdate)
{
	form.lyrRights().tabRightsGranted().cmbRights().clear();
	AppRight[] rights = AppRight.getAllRights();
	AppRightVo[] voRights = AppRightVo.domArrayToVo(rights);
	
	Arrays.sort(voRights, new  AppRightComparator());
			
	for (int i = 0; i < voRights.length; i++)
	{
		AppRightVo voRight = voRights[i];	
		if(bOnUpdate && isAlreadySelected(voRight))
			continue;
		form.lyrRights().tabRightsGranted().cmbRights().newRow(voRight, voRight.getName());
	}		
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void editInstance()
{
	if (form.treTypes().getSelectedNode() == null)
		return;
	if (ConfigFlag.GEN.ALLOW_LOOKUP_TEXT_EDIT.getValue() || engine.hasRight(AppRight.LOOKUP_TEXT_MODIFY))
	{
		setFormMode(FormMode.EDIT);
		populateParentCombo(true);
		form.lyr1().Instance().txtInstText().setEnabled(true);			
	}
	else
	{
		form.getGlobalContext().Core.setYesNoDialogMessage("Editing the text of a lookup should only be done to correct a typing error. It should in no way change the meaning of the lookup.");
		engine.open(form.getForms().Core.YesNoDialog);			
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void switchToSearchView()
{
	if (engine.hasRight(AppRight.OCS_ALLOW_INV_SEARCH))
	{
		populateSearch();

		form.lyrTemplates().showtabSearch();
		form.lyrTemplates().tabTemplate().setHeaderVisible(false);
		form.lyrTemplates().tabSearch().setHeaderVisible(true);
		form.lyrTemplates().tabPreview().setHeaderVisible(false);
		form.lyrTemplates().tabSearch().txtTextName().setFocus();
	}
	else
	{
		form.lyrTemplates().tabSearch().setHeaderVisible(false);
	}
	//WDEV-17035
	updateControlsState();
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void open()
{
	loadActiveOrderEntryTemplates();

	if (engine.hasRight(AppRight.OCS_ALLOW_INV_SEARCH))
	{
		TreeNode searchNode = form.treDetails().getNodes().add(searchNodeValue, "Search");
		searchNode.setCollapsedImage(form.getImages().Core.FindEnabled16);
		searchNode.setExpandedImage(form.getImages().Core.FindEnabled16);
	}

	TreeNode previewNode = form.treDetails().getNodes().add(previewNodeValue, "My Order Preview");
	previewNode.setCollapsedImage(form.getImages().OCRR.MyOrderPreview);
	previewNode.setExpandedImage(form.getImages().OCRR.MyOrderPreview);

	form.treDetails().setValue(searchNodeValue);
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-13999
 * Function used to update state of controls
 */
private void updateControlsState()
{
	boolean userHasAuthorizeRoles = engine.hasRight(AppRight.CAN_AUTHORIZE_PATHOLOGY_ORDERS) && engine.hasRight(AppRight.CAN_AUTHORIZE_CLINICAL_IMAGING_ORDERS);
	boolean canOrderBeAuthorized = canOrderBeAuthorized();
	
	
	form.btnCancel().setVisible(engine.hasRight(AppRight.ALLOW_CANCEL_ORDERINVESTIGATION));
	
	form.btnAmend().setVisible(canOrderBeAmmended() && ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("CARE_UK") && engine.hasRight(AppRight.ALLOW_ORDERINVESTIGATIONS_CAREUK));
	
	form.btnAuthorise().setVisible(canOrderBeAuthorized);
	form.btnAuthorise().setEnabled(!isCancelled(form.getLocalContext().getOrderSummary()));
	form.btnUpdate().setVisible(canOrderBeAuthorized);
	form.btnUpdate().setEnabled(!isCancelled(form.getLocalContext().getOrderSummary()) && userHasAuthorizeRoles);
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onGrdOrdersSelectionChanged() throws ims.framework.exceptions.PresentationLogicException
{
	//WDEV-2526
	form.getGlobalContext().Core.setPatientShort(form.grdOrders().getValue().getPatient());

	//WDEV-13401
	if (engine.hasRight(AppRight.CAN_AUTHORIZE_CLINICAL_IMAGING_ORDERS) || engine.hasRight(AppRight.CAN_AUTHORIZE_PATHOLOGY_ORDERS))
	{
		form.getGlobalContext().OCRR.setOrderAwaitingAuthorisation(form.grdOrders().getValue());
		form.getGlobalContext().OCRR.PathologyResults.setOrder(form.grdOrders().getValue());
		engine.open(form.getForms().OCRR.OrderSummaryDialog);			
	}
	else
	{
		engine.showMessage("Your login role has not been assigned the right to authorise orders.");
	}
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private ORDERSTATE getOcsOrderAuthorisingState()
{
	if (doesOrderContainInvType(Category.CLINICALIMAGING))
	{
		boolean canAuthoriseClinImaging = engine.hasRight(AppRight.CAN_AUTHORIZE_CLINICAL_IMAGING_ORDERS);
		if (!canAuthoriseClinImaging)
			return ORDERSTATE.REQUESTING_AUTHORISATION;

	}
	if (doesOrderContainInvType(Category.PATHOLOGY))
	{
		boolean canAuthorisePathology = engine.hasRight(AppRight.CAN_AUTHORIZE_PATHOLOGY_ORDERS);
		if (!canAuthorisePathology)
			return ORDERSTATE.REQUESTING_AUTHORISATION;
	}

	return ORDERSTATE.AUTHORISING;
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void updateContextMenuState()
{
	SessionParentChildSlotVo voSlot = form.grdSelected().getValue();
	boolean slotAvailable = voSlot != null && voSlot.getAppointment() == null && voSlot.getStatusIsNotNull() && voSlot.getStatus().equals(Status_Reason.SLOTOPENED); 

	//WDEV-13313
	if(engine.getFormName().equals(form.getForms().RefMan.TheatreAvailability))
		form.getContextMenus().Scheduling.getBookTheatreSlotBOOKItem().setVisible(false);
	else
		form.getContextMenus().Scheduling.getBookTheatreSlotBOOKItem().setVisible(slotAvailable);
	
	form.getContextMenus().Scheduling.getBookTheatreSlotSUSPENDItem().setVisible(slotAvailable);
	
	form.getContextMenus().Scheduling.getBookTheatreSlotRELEASEItem().setVisible(voSlot != null && voSlot.getStatusIsNotNull() && voSlot.getStatus().equals(Status_Reason.SUSPENDED));
	
	form.getContextMenus().Scheduling.getBookTheatreSlotADDItem().setVisible(form.grdTheatreSession().getValue() != null && engine.hasRight(AppRight.CAN_OVERBOOK_THEATRE_APPTS));
	
	form.getContextMenus().Scheduling.getBookTheatreSlotMOVEItem().setVisible(voSlot != null && voSlot.getAppointmentIsNotNull() && voSlot.getAppointment().getApptStatusIsNotNull() && voSlot.getAppointment().getApptStatus().equals(Status_Reason.BOOKED));
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public Boolean initialize()
{
	if (form.getMode().equals(FormMode.EDIT))
		return false;

	clearScreen();
	form.setMode(FormMode.VIEW);

	form.customControlAuthoring().setIsRequiredPropertyToControls(true);

	//form.getLocalContext().setDefaultMedication();
	
	open();
	
	if (domain.getHcpLiteUser() == null && !engine.hasRight(AppRight.ALLOW_EDIT_CONSULTATION_DIAGNOSIS))
	{
		engine.showMessage("Logged in user is not a HCP.");
		form.btnEdit().setVisible(false);
		form.setMode(FormMode.VIEW);
		return false;
	}

	manageMenus();
	
	return true;
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void listSessions()
{		
	Date currentDate = domain.getCurrentMonth(form.cmbService().getValue(), form.cmbLocation().getValue(), form.ccConsultant().getValue(), form.qmbProcedure().getValue(), form.cmbTheatreType().getValue());
	if (currentDate != null)	
	{
		if (!form.getLocalContext().getCurrentDateIsNotNull())
		{
			form.bookingCalendar().setCurrentMonth(currentDate);
			form.getLocalContext().setCurrentDate(currentDate);
		}
	}
	
	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());
	
	SessionTheatreVoCollection voCollSessionShort = domain.listSession(dateStart, dateEnd, form.cmbService().getValue(), form.cmbLocation().getValue(), form.ccConsultant().getValue(), form.qmbProcedure().getValue(), form.cmbTheatreType().getValue(), form.intRequiredProcTime().getValue(), engine.hasRight(AppRight.CAN_OVERBOOK_THEATRE_APPTS));
	form.getLocalContext().setSessions(voCollSessionShort);
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void showHideActiveMonitoringAuthoringInfo()
{
	if ( form.getMode().equals(FormMode.EDIT) //WDEV-15475  
		&& ( ! form.GrpDischPatient().getValue().equals(GrpDischPatientEnumeration.rdoDischPatYES))
		&&( (engine.hasRight(AppRight.AUTHORISED_DATA_CORRECTOR)
				&& form.getLocalContext().getcurrentOutcomeVoIsNotNull()
				&& form.getLocalContext().getcurrentOutcomeVo().getActiveMonitoringIsNotNull()
				&& form.getLocalContext().getcurrentOutcomeVo().getActiveMonitoring().getID_ActiveMonitoringIsNotNull())
			|| form.getLocalContext().getcurrentOutcomeVo() == null
			|| form.getLocalContext().getcurrentOutcomeVo().getActiveMonitoring() == null
			|| (form.getLocalContext().getcurrentOutcomeVo().getActiveMonitoringIsNotNull()
					&& form.getLocalContext().getcurrentOutcomeVo().getActiveMonitoring().getID_ActiveMonitoring() == null)) ) 
		{
			form.lyr1().tabActiveMonitoring().ccAMAuthoring().setEnabledAuthoringHCP(isReferralDischarged() ? false : true);
			form.lyr1().tabActiveMonitoring().ccAMAuthoring().setEnabledDateTime(isReferralDischarged() ? false : true);
			form.lyr1().tabActiveMonitoring().ccAMAuthoring().setIsRequiredPropertyToControls(true);
		}
		else
		{
			form.lyr1().tabActiveMonitoring().ccAMAuthoring().setEnabledAuthoringHCP(false);
			form.lyr1().tabActiveMonitoring().ccAMAuthoring().setEnabledDateTime(false);
			form.lyr1().tabActiveMonitoring().ccAMAuthoring().setIsRequiredPropertyToControls(false);
		}
}
 
Example 18
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String allowBooking(SessionTheatreVo session, ProcedureLiteVo voProcedure)
{
	//if we have an overbooking right we disregard all the checks
	if(engine.hasRight(AppRight.CAN_OVERBOOK_THEATRE_APPTS))
		return null;
	
	if(session != null && voProcedure != null)
	{
		if(session.getTheatreProceduresRemainingIsNotNull())
		{
			//if the procedure is limited and the number of procedures left is 0
			for(TheatreProcedureLiteVo voTheatreProc : session.getTheatreProceduresRemaining().getProcedureDetails())
			{
				if(voTheatreProc.getProcedure().equals(voProcedure))
				{
					if(voTheatreProc.getIsLimitedIsNotNull() && voTheatreProc.getIsLimited() && voTheatreProc.getNumberOfProceduresLeftIsNotNull() && voTheatreProc.getNumberOfProceduresLeft() == 0)
						return "Limit has been reached for this procedure.";
				}
			}
		}
	}
	return null;
}
 
Example 19
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnClearClick() throws ims.framework.exceptions.PresentationLogicException
{
	
	form.btnCancel().setEnabled(false);
	form.btnCancelSlot().setEnabled(false);
	form.grdSlots().getRows().clear();
	form.grdSlots().setValue(null);
	form.dteSessionDate().setValue(null);
	form.cmbContract().setValue(null);
	
	if(engine.hasRight(AppRight.CAN_VIEW_CLINICS_ACROSS_ALL_CONTRACTS))
		form.cmbSite().clear();
	else
		form.cmbSite().setValue(null);
	
	form.cmbProfile().clear();
	form.cmbSessions().clear();
	form.cmbStatus().setValue(null);
	form.getContextMenus().RefMan.hideAllClinicListRefManMenuItems();
	form.getGlobalContext().RefMan.setIsProviderCancellation(false);//wdev-6163

	form.getGlobalContext().RefMan.setClinicListFilter(null);
	updateContextMenus();
}
 
Example 20
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void initialize() 
{
	Boolean canViewClinics = engine.hasRight(AppRight.CAN_VIEW_CLINICS_ACROSS_ALL_CONTRACTS);
	
	// WDEV-12682
	// WDEV-12875  - Check if the current location has diagnostic ContractConfiguration records on the branch of the organisation 
	if (form.getGlobalContext().RefMan.getDiagnosticReferralForApplication() == null)
		form.getGlobalContext().RefMan.setDiagnosticReferralForApplication(domain.hasLocationDiagnosticContract((LocationRefVo) engine.getCurrentLocation()));

	form.cmbContract().setEnabled(canViewClinics);
	form.dteSessionDate().setValue(new Date());
	
	if(canViewClinics)
	{
		loadOrganisation();
	}
	else
	{
		listLocationForLoggedUser();
	}
	form.getGlobalContext().Scheduling.setBookingAppointment(null); //wdev-12623
	
	form.getLocalContext().setWasTimerOn(false);//WDEV-13622
	form.getTimers().getTimerSearch().setInterval(ConfigFlag.UI.CLINICLIST_TIMER_INTERVAL.getValue());//WDEV-13622
}
 
Example 21
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void checkForNurse() 
{
	Object hcp = domain.getHcpUser();
	
	if(hcp instanceof NurseVo && engine.hasRight(AppRight.CAN_CONFIRM_NURSING_DOCUMENTATION))
	{
		form.qmbConfirmedBy().newRow((Hcp) hcp, ((Hcp) hcp).toString());
		form.qmbConfirmedBy().setValue((Hcp) hcp);
		form.dteConfirmed().setValue(new Date());
		form.timConfirmed().setValue(new Time());
	}
}
 
Example 22
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private UserAssessmentInstHelper getHelper(DynamicGrid dynGrid, boolean showSelect)
{
	boolean isDpp = true;
	boolean displayOnlyAsnwered = false;
	boolean showConfirmation = engine.hasRight(AppRight.CAN_CONFIRM_NURSING_DOCUMENTATION);
	UserAssessmentInstHelper helper = new UserAssessmentInstHelper(dynGrid, form.getImages().Core.QuestionSmall, form.getImages().Core.TextBox, form.getImages().Core.SmallNew, form.getImages().Core.SmallCancel, form.getImages().Core.MandatoryQuestion, isDpp, displayOnlyAsnwered, showConfirmation, showSelect);
	return helper;
}
 
Example 23
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateControlsState()
{
	if( form.getMode().equals(FormMode.VIEW))
	{
		form.btnNew().setVisible(!form.getLocalContext().getDischargedEpisodeIsNotNull() && form.getLocalContext().getAdmissionDetailIsNotNull() && engine.hasRight(AppRight.MAXIMS_ADT_CAN_DISCHARGE));	
		//form.btnEdit().setVisible(form.getLocalContext().getDischargedEpisodeIsNotNull() && engine.hasRight(AppRight.MAXIMS_ADT_CAN_DISCHARGE));
		PatientShort tempVo = domain.getPatientShort(form.getLocalContext().getPatientShort());
		form.btnUndoDischarge().setVisible(form.getLocalContext().getShowUndoDischargeButton() && form.getLocalContext().getDischargedEpisodeIsNotNull()&& tempVo != null && !tempVo.getWardIsNotNull() && engine.hasRight(AppRight.CAN_UNDO_DISCHARGE) && Boolean.TRUE.equals(ConfigFlag.UI.MAXIMS_ADT_NO_INTERFACE.getValue())); //wdev-16428
	}
}
 
Example 24
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateControlsState() 
{
	if(engine.hasRight(AppRight.CAN_UNLINK_REFERRAL_FROM_EPISODE) && form.grdReferrals().getSelectedRow() != null && form.grdReferrals().getSelectedRow().getColLink())
	{
		ReferralLiteVoCollection linkedReferrals = form.getLocalContext().getLinkedReferrals();
		ReferralLiteVo voReferralLite = form.grdReferrals().getSelectedRow().getValue();
		boolean alreadyLinked = alreadyLinked(linkedReferrals, voReferralLite);
		form.getContextMenus().Core.getReferralsUnlinkReferralItem().setVisible(alreadyLinked);
		form.getContextMenus().Core.getReferralsUnlinkReferralItem().setEnabled(alreadyLinked);
	}
	else
		form.getContextMenus().Core.getReferralsUnlinkReferralItem().setVisible(false);
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onContextMenuItemClick(int menuItemID, Control sender) throws PresentationLogicException
{
	if ((ConfigFlag.UI.INPAT_CREATE_CORRESPONDENCE_DETAILS.getValue()
			|| engine.hasRight(AppRight.CAN_DISCHARGE_INPATIENT_IN_RCHT) 
			|| ConfigFlag.UI.MAXIMS_ADT_NO_INTERFACE.getValue() 
		)
		&& form.getGlobalContext().Core.getPatientShortIsNotNull()
		)
	{
		switch(menuItemID)
		{	
			case GenForm.ContextMenus.ADTMenu.Add:
				addDocumentDetails();
				break;
			case GenForm.ContextMenus.ADTMenu.View:
				viewDocumentDetails();
				break;
			case GenForm.ContextMenus.ADTMenu.Demographics:
				showDemographics();
				break;
			case GenForm.ContextMenus.ADTMenu.Discharge:
				if( !engine.hasRight(AppRight.CAN_DISCHARGE_INPATIENT_IN_RCHT) && ConfigFlag.UI.MAXIMS_ADT_NO_INTERFACE.getValue() && engine.hasRight(AppRight.MAXIMS_ADT_CAN_DISCHARGE))  //wdev-16427
					dischargeInpatientForLeopardstown();
				else
					dischargeInpatientForRCHT();
				break;
			case GenForm.ContextMenus.ADTMenu.Transfer:
				transferPatient();
				break;
			case GenForm.ContextMenus.ADTMenu.CancelAdmission:
				cancelAdmission();
				break;
		}	
	}
}
 
Example 26
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateMenuOptions()
{
	form.getContextMenus().Core.hideAllPendingEmergencyMenuItems();
	boolean isCancelled = form.grdAdmissions().getValue() != null && form.grdAdmissions().getValue().getAdmissionStatusIsNotNull() && form.grdAdmissions().getValue().getAdmissionStatus().equals(EmergencyAdmissionStatus.CANCELLED); //wdev-17355
	form.getContextMenus().Core.getPendingEmergencyASSIGNItem().setVisible(form.grdAdmissions().getValue() != null && !isCancelled);	//wdev-17355
	
	if(engine.hasRight(AppRight.ALLOW_ADT_PENDINGEMERGENCY_REMOVAL))
		form.getContextMenus().Core.getPendingEmergencyREMOVEPATIENTFROMPENDINGEMERGENCYItem().setVisible(form.grdAdmissions().getValue() != null);
}
 
Example 27
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateControlsState() 
{
	form.btnNew().setVisible(true);
	form.btnNew().setEnabled(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()));
	form.btnEdit().setEnabled(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdNotes().getValue() != null && (form.grdNotes().getValue().getAuthoringInformation().getAuthoringHcp().equals(form.getLocalContext().getLoggedHCP()) || engine.hasRight(AppRight.ED_ALLOW_CORRECTION_OF_ANY_MEDIC_NOTE)));
	form.btnRIE().setEnabled(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdNotes().getValue() != null);
	
	form.getContextMenus().Emergency.getMedicNoteMenuNEWItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()));
	form.getContextMenus().Emergency.getMedicNoteMenuEDITItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdNotes().getValue() != null && (form.grdNotes().getValue().getAuthoringInformation().getAuthoringHcp().equals(form.getLocalContext().getLoggedHCP()) || engine.hasRight(AppRight.ED_ALLOW_CORRECTION_OF_ANY_MEDIC_NOTE)));
	form.getContextMenus().Emergency.getMedicNoteMenuRIEItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdNotes().getValue() != null);
}
 
Example 28
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateControlsState() 
{
	form.btnNote().setVisible(true);
	form.btnNote().setEnabled(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()));
	form.btnEdit().setEnabled(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdNotes().getValue() != null && (form.grdNotes().getValue().getAuthoringInformation().getAuthoringHcp().equals(form.getLocalContext().getLoggedHCP()) || engine.hasRight(AppRight.ED_ALLOW_CORRECTION_OF_ANY_TRIAGE_NOTE)));
	form.btnRIE().setEnabled(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdNotes().getValue() != null);
	
	form.getContextMenus().Emergency.getTriageNoteMenuNEWItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()));
	form.getContextMenus().Emergency.getTriageNoteMenuEDITItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdNotes().getValue() != null && (form.grdNotes().getValue().getAuthoringInformation().getAuthoringHcp().equals(form.getLocalContext().getLoggedHCP()) || engine.hasRight(AppRight.ED_ALLOW_CORRECTION_OF_ANY_TRIAGE_NOTE)));
	form.getContextMenus().Emergency.getTriageNoteMenuRIEItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdNotes().getValue() != null);
}
 
Example 29
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean userHasRightToCorrect(AttendanceClinicalNotesVo attendanceClinicalNotesVo)
{	
	if (form.getForms().Emergency.EDTriageWorklistToAssessmentForm.equals(form.getLocalContext().getparentFormName()))
	{
		return AttendanceClinicalNoteType.TRIAGE.equals(attendanceClinicalNotesVo.getNoteType()) && engine.hasRight(AppRight.ED_ALLOW_CORRECTION_OF_ANY_TRIAGE_NOTE); //WDEV-17304
	}
	else if (form.getForms().Emergency.EDClinicianWorklistToAssessmentForm.equals(form.getLocalContext().getparentFormName()))
	{
		return AttendanceClinicalNoteType.MEDIC.equals(attendanceClinicalNotesVo.getNoteType()) && engine.hasRight(AppRight.ED_ALLOW_CORRECTION_OF_ANY_MEDIC_NOTE);//WDEV-17304
	}
	
	return false;
}
 
Example 30
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void bookingCalendar1DateSelected(ims.framework.utils.Date date)
{
	// go through sessions getting ones for the selected date
	SessionShortVoCollection voCollSessionShort = form.getLocalContext().getSessions();
	if (voCollSessionShort == null)
		return;

	SessionShortVoCollection voCollSelectedSessions = new SessionShortVoCollection();
	for (int i = 0; i < voCollSessionShort.size(); i++)
	{
		if (voCollSessionShort.get(i).getSessionDate().equals(date))
		{
			//WDEV-12209 - starts here
			boolean performingOverBook = (engine.hasRight(AppRight.CAN_OVERBOOK_FLEXIBLE_APPT) && form.chkOverBook().getValue() == true);
			
			if(!Boolean.TRUE.equals(voCollSessionShort.get(i).getIsFixed()) && !performingOverBook && voCollSessionShort.get(i).getRemainingTimeIsNotNull() && voCollSessionShort.get(i).getRemainingTime() <= 0)
				continue;
			
			//WDEV-12209 - ends here
			
			voCollSelectedSessions.add(voCollSessionShort.get(i));
		}
	}

	form.getLocalContext().setSelectedSessions(voCollSelectedSessions);
	form.getLocalContext().setSelectedSessionIndex(new Integer(0));
	loadSessionSlots();
}
 
Example 31
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String[] getUIValidationRules(Sch_BookingVo voBooking)
{
	if (voBooking == null)
		throw new CodingRuntimeException("voBooking parameter is null in method getUIValidationRules");

	ArrayList<String> errors = new ArrayList<String>();
	for (Booking_AppointmentVo voAppt : voBooking.getAppointments())
	{
		if (ConfigFlag.DOM.SCHEDULING_LINKED_TO_PATHWAYS.getValue())
		{
			if ((voAppt.getEventIsNotNull() && voAppt.getJourney() == null) || (voAppt.getJourneyIsNotNull() && voAppt.getEvent() == null))
				errors.add("Event and Pathway must both be selected or neither one at all");
		}
		else
		{	
			//TODO check here overbook validation
			boolean performingOverBook = (engine.hasRight(AppRight.CAN_OVERBOOK_FLEXIBLE_APPT) && form.chkOverBook().getValue() == true);
			// if session is flexible validate appt selected against exclusion and appts made within session
			if (voAppt.getSession().getIsFixedIsNotNull() && !voAppt.getSession().getIsFixed() && (voAppt.getID_Booking_Appointment() == null || form.getLocalContext().getIsRebookApptSelectedIsNotNull()))
			{
				BookingAppointmentLiteVoCollection voCollAppts = domain.listNonCancelledAppointmentsForSession(voAppt.getSession());
				errors.addAll(validateFlexibleAppt(voAppt, voCollAppts, performingOverBook));
			}
		}
	}

	return (String[]) (errors.size() > 0 ? errors.toArray(new String[0]) : null);
}
 
Example 32
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void managePricingMenuOptions(Boolean isTreating)
{
	boolean hasRight = engine.hasRight(AppRight.CAN_ACCESS_PRICE_ADJUSTMENT);

	if (ConfigFlag.GEN.SHOW_PROCEDURE_PRICING.getValue() && isTreating && hasRight)
	{
		form.getContextMenus().getGenericGridReplaceItem().setVisible(false);
		if (form.treHeader().getSelectedNode() != null && form.treHeader().getSelectedNode().getNodes().size() > 0)
		{
			form.getContextMenus().getGenericGridReplaceItem().setVisible(true);
			form.getContextMenus().getGenericGridReplaceItem().setText("Input Price Adjs");
			form.getContextMenus().getGenericGridReplaceItem().setIcon(form.getImages().Admin.PricingEuro);
		}

		form.getContextMenus().getGenericGridConfirmItem().setVisible(false);
		if (domain.countBatches(form.getGlobalContext().Admin.getSelectedLocShortVo()) > 0)
		{
			form.getContextMenus().getGenericGridConfirmItem().setVisible(true);
			form.getContextMenus().getGenericGridConfirmItem().setText("Confirm Price Adjs");
			form.getContextMenus().getGenericGridConfirmItem().setIcon(form.getImages().Admin.PricingEuro);
		}
	}
	else
	{
		form.getContextMenus().getGenericGridReplaceItem().setVisible(false);
		form.getContextMenus().getGenericGridConfirmItem().setVisible(false);
	}
}
 
Example 33
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * WDEV-13186
 * Update the state (Hidden/Visible, Enabled/Disabled)  for controls
 */
private void updateControlsState()
{
	if (FormMode.VIEW.equals(form.getMode()))
	{
		// - 'Edit' button - visible only in VIEW mode if the user has right to edit images & image record selected; set as hidden from DevEnv for EDIT mode
		form.btnEdit().setVisible(form.grdImages().getValue() != null && engine.hasRight(AppRight.ALLOW_EDIT_IMAGES));
	}

	// Update the context menu after controls were updated
	updateContextMenuState();
}
 
Example 34
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * Function used to determine if the oder can be authorised
 * This works of analysing the local context value for the order
 */
private boolean canOrderBeAuthorized()
{
	OcsOrderSummaryVo orderSummary = form.getLocalContext().getOrderSummary();

	if (orderSummary == null || orderSummary.getInvestigations() == null)
		return false;
	
	// Check order status - not to be cancelled
	int ordersAwaitingAuthorization = 0;
	
	for (OrderInvestigationListVo investigation : orderSummary.getInvestigations())
	{
		if (investigation.getOrdInvCurrentStatus() != null && OrderInvStatus.AWAITING_AUTHORISATION.equals(investigation.getOrdInvCurrentStatus().getOrdInvStatus()))
			ordersAwaitingAuthorization++;
		
		if (Category.PATHOLOGY.equals(investigation.getInvestigation().getInvestigationIndex().getCategory())
				&& !engine.hasRight(AppRight.CAN_AUTHORIZE_PATHOLOGY_ORDERS)
				&& investigation.getOrdInvCurrentStatus() != null
				&& OrderInvStatus.AWAITING_AUTHORISATION.equals(investigation.getOrdInvCurrentStatus().getOrdInvStatus()))
			return false;
		
		if (Category.CLINICALIMAGING.equals(investigation.getInvestigation().getInvestigationIndex().getCategory())
				&& !engine.hasRight(AppRight.CAN_AUTHORIZE_CLINICAL_IMAGING_ORDERS)
				&& investigation.getOrdInvCurrentStatus() != null
				&& OrderInvStatus.AWAITING_AUTHORISATION.equals(investigation.getOrdInvCurrentStatus().getOrdInvStatus()))
			return false;
	}
	
	if (ordersAwaitingAuthorization == 0)
		return false;
	
	if (engine.hasRight(AppRight.CAN_AUTHORIZE_CLINICAL_IMAGING_ORDERS) && engine.hasRight(AppRight.CAN_AUTHORIZE_PATHOLOGY_ORDERS))
		return true;

	return false;
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void showResultStatusOptions(boolean bVisible)
{
	form.chkEnableExit().setVisible(bVisible);
	
	form.chkMarkAsSeen().setVisible(bVisible && engine.hasRight(AppRight.CAN_UPDATE_RESULT_STATUS) && !engine.hasRight(AppRight.MARK_RESULT_AS_CHECKED));
	form.chkMarkAsChecked().setVisible(bVisible && engine.hasRight(AppRight.CAN_UPDATE_RESULT_STATUS) && engine.hasRight(AppRight.MARK_RESULT_AS_CHECKED));
	
	form.chkMarkForReview().setVisible(bVisible && engine.hasRight(AppRight.CAN_UPDATE_RESULT_STATUS));
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * Function used to update the state of the context menu options
 */
private void updateContextMenuState()
{
	boolean viewMode = FormMode.VIEW.equals(form.getMode());

	// VIEW Mode
	form.getContextMenus().OCRR.getResultsCommentsMenuNEWItem().setVisible(viewMode && engine.hasRight(AppRight.CAN_ADD_RESULT_ANNOTATIONS));
	// EDIT Mode
	form.getContextMenus().OCRR.getResultsCommentsMenuCORRECTItem().setVisible(viewMode && engine.hasRight(AppRight.CAN_CORRECT_RESULT_ANNOTATIONS) && form.grdComments().getSelectedRow() != null);
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialise()
{
	form.setMode(FormMode.VIEW);	
			 
	form.lyr1().tabSearch().ccConsultant().initialize(MosType.HCP);

	//WDEV-13313
	if(!engine.getFormName().equals(form.getForms().RefMan.TheatreAvailability))
	{
		FitForSurgeryAssessmentLiteVo fitForSurgery = domain.getLatestFitForSurgeryAssessment(form.getGlobalContext().RefMan.getCatsReferral());
		form.getLocalContext().setAnaestheticType(fitForSurgery != null ? fitForSurgery.getAnaestheticType() : null);
	}

	form.lyr1().tabSearch().cmbAnaesType().setValue(form.getLocalContext().getAnaestheticType());
	if(form.getLocalContext().getAnaestheticTypeIsNotNull())
	{
		if(!engine.hasRight(AppRight.ALLOW_ANAESTHETIC_TYPE_CHANGE))
		{
			form.lyr1().tabSearch().cmbAnaesType().setVisible(false); //hide the combo
			
			if(form.getLocalContext().getAnaestheticTypeIsNotNull())
				form.lyr1().tabSearch().lblAnaestheticTypeText().setValue(form.getLocalContext().getAnaestheticType().getText());
		}
	}

	loadServices();
	loadLocations();
	
	//WDEV-18396
	form.chkElective().setValue(ConfigFlag.GEN.USE_ELECTIVE_LIST_FUNCTIONALITY.getValue());
	
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void listSessions()
{				
	Date dateStart = form.lyr1().tabSearch().dteFrom().getValue(); 
	Date dateEnd = form.lyr1().tabSearch().dteTo().getValue(); 
	
	SessionTheatreVoCollection voCollSessionShort = domain.listSession(dateStart, dateEnd, form.lyr1().tabSearch().cmbService().getValue(), form.lyr1().tabSearch().cmbLocation().getValue(), form.lyr1().tabSearch().ccConsultant().getValue(), form.lyr1().tabSearch().qmbProcedure().getValue(), form.lyr1().tabSearch().cmbTheatreType().getValue(), form.lyr1().tabSearch().intRequiredProcTime().getValue(), engine.hasRight(AppRight.CAN_OVERBOOK_THEATRE_APPTS), form.lyr1().tabSearch().cmbAnaesType().getValue());
	form.getLocalContext().setSessions(voCollSessionShort);
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if (formName.equals(form.getForms().RefMan.ReferralReviewDetails))
	{
		/*if( Boolean.TRUE.equals((form.lyr1().tabDischarge().isVisible())))				//wdev-15685
		{
			form.lyr1().tabDischarge().htmPreview().setVisible(true);					//wdev-15685
		}*/
		updateReviewButton();		
	}		
	else if (formName.equals(form.getForms().OCRR.SelectAndOrderDialog) && result.equals(DialogResult.OK))
	{
		if(form.lyr1().tabReferralAppts().isVisible())
		{
			CatsReferralDetailsVo voContainer = domain.getReferralDetail(form.getGlobalContext().RefMan.getCatsReferral());		
			form.lyr1().tabReferralAppts().ccAppts().setValue(voContainer.getAppointmentDetail());		
		}
		else if (form.lyr1().tabInvestigations().isVisible())
		{
			form.lyr1().tabInvestigations().ccInvestigations().initialise(engine.hasRight(AppRight.CAN_VIEW_CONFIDENTIAL_INVESTIGATION_RESULTS), engine.hasRight(AppRight.CAN_VIEW_CONFIDENTIAL_INVESTIGATIONS_ORDERED), Boolean.TRUE);	
		}
		
		/*if( Boolean.TRUE.equals((form.lyr1().tabDischarge().isVisible())))				//wdev-15685
		{
			form.lyr1().tabDischarge().htmPreview().setVisible(true);					//wdev-15685
		}*/
	}	
	if( Boolean.TRUE.equals((form.lyr1().tabDischarge().isVisible())))				//wdev-15685
	{
		form.lyr1().tabDischarge().htmPreview().setVisible(true);					//wdev-15685
	}
	form.lyr1().tabReferralLetter().customControlUploadDoc().showHtmlControl();
	form.lyr1().tabSpecimenCollection().ccSpecimenCollection().initialize();//wdev-14020
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean save()
{
	form.getLocalContext().setshouldRemoveLC(false);
	if (engine.hasRight(AppRight.CAN_EDIT_ALL_CLINICAL_NOTES)
		&& form.cmbNoteType().getValue() != null 
		&& !form.cmbNoteType().getValue().equals(ClinicalNoteTypeForAnAppointment.CORRESPONDENCE_NOTES)
		&& form.getGlobalContext().RefMan.getAppointmentClinicalNote().getClinicalNoteTypeIsNotNull()
		&& form.getGlobalContext().RefMan.getAppointmentClinicalNote().getClinicalNoteType().equals(ClinicalNoteTypeForAnAppointment.CORRESPONDENCE_NOTES))
	{
		//If the note is not null and Status equals draft
		if (form.getGlobalContext().RefMan.getAppointmentClinicalNote().getID_AppointmentClinicalNotesIsNotNull())
		{
			AppointmentClinicalNotesVoCollection currentNotes = domain.listClinicalNotes(form.getGlobalContext().RefMan.getCatsReferral());		

			form.getLocalContext().setshouldRemoveLC(!isOtherNoteOfThisTypeActive(form.getGlobalContext().RefMan.getAppointmentClinicalNote(), currentNotes));
			
			//Type of note has change, and no other active note with this type
			if (form.getGlobalContext().RefMan.getAppointmentClinicalNoteIsNotNull()
				&& !isOtherNoteOfThisTypeActive(form.getGlobalContext().RefMan.getAppointmentClinicalNote(), currentNotes))
			{
				form.getLocalContext().setremoveTypeLC(form.getGlobalContext().RefMan.getAppointmentClinicalNote().getNoteType());
			}
		}

	}
	
	AppointmentClinicalNotesVo clinicalNote = populateDataFromScreen();
	
	if(clinicalNote.getID_AppointmentClinicalNotes() == null)
	{
		return addNote(clinicalNote);
	}
	else
	{
		return editNote(clinicalNote);
	}
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void updateControlsState()
{
	if (FormMode.VIEW.equals(form.getMode()))
	{
		form.btnNew().setVisible(true);
		// WDEV-11672
		form.btnNew().setEnabled(form.getLocalContext().getInpatientIsNotNull()						// "New" button is enabled only if there is an InpatientEpisode
				&& Boolean.FALSE.equals(form.getLocalContext().getRecordAwaitingDischarge()));		// and there is no record awaiting discharge - do we need this condition? only one inpatient episode per patient
		
		form.btnEdit().setEnabled(form.getLocalContext().getDischargeSummaryPacuAndWardIsNotNull()					// "Edit" button is only enabled if a selection is made
					&& (Boolean.TRUE.equals(form.getLocalContext().getDischargeSummaryPacuAndWard().getIsCurrent())	// & WDEV-12134 - selected record is the latest discharge
					&& !Boolean.TRUE.equals(form.getLocalContext().getHasInpatient())								// & no InpatientEpisodes exists
					|| !form.getLocalContext().getDischargeSummaryPacuAndWard().getDischargeEpisodeIsNotNull()));	// & selected record has no discharge

		form.btnEdit().setVisible(true);
		
		form.btnClose().setVisible(form.getForms().RefMan.DischargeSummaryWardPacuDialogAlias.equals(engine.getFormName()));
		
		//wdev-11874
		form.lyrContent().tabDischargeSummary().btnPrintDischargeReport().setVisible(engine.hasRight(AppRight.CAN_PRINT_DISCHARGE_FROM_WARD_PACU_SCREEN));
		form.lyrContent().tabDischargeSummary().btnPrintDischargeReport().setEnabled(engine.hasRight(AppRight.CAN_PRINT_DISCHARGE_FROM_WARD_PACU_SCREEN));
		//wdev-11874
	}
	else // WDEV-11672 (FormMode is EDIT)
	{
		//wdev-11969
		form.lyrContent().tabDischargeSummary().btnPrintDischargeReport().setVisible(engine.hasRight(AppRight.CAN_PRINT_DISCHARGE_FROM_WARD_PACU_SCREEN));
		//------
		form.btnDischarge().setEnabled(true);
		form.btnDischarge().setVisible(!form.getLocalContext().getDischargeSummaryPacuAndWardIsNotNull()		// Discharge button should be visible only for new records
				|| !form.getLocalContext().getDischargeSummaryPacuAndWard().getDischargeEpisodeIsNotNull());	// or the current record was not discharge yet
	}
	
	form.lyrContent().tabDischargeDetails().btnBookAppointment().setEnabled(!isLinkedICPCompleted() && Boolean.TRUE.equals(form.getLocalContext().getisReferralAccepted()));
	
	updateContextMenuState();
}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateControlsState()
{
	boolean isReadOnly = Boolean.TRUE.equals(form.getLocalContext().getIsReadOnlyMode());
	
	form.getContextMenus().RefMan.getClinicalNotesMenuADD_DIAGNOSISItem().setVisible(!isReadOnly && form.getLocalContext().getHcpUserIsNotNull() && form.dyngrdNotes().getValue() instanceof BookingAppointmentForClinicalNotesVo);
	form.getContextMenus().RefMan.getClinicalNotesMenuADD_NOTESItem().setVisible(!isReadOnly && form.dyngrdNotes().getValue() instanceof BookingAppointmentForClinicalNotesVo && form.getLocalContext().getMosUserIsNotNull());//	WDEV-14006
	form.getContextMenus().RefMan.getClinicalNotesMenuADD_PROCEDUREItem().setVisible(!isReadOnly && form.getLocalContext().getHcpUserIsNotNull() && form.dyngrdNotes().getValue() instanceof BookingAppointmentForClinicalNotesVo);
	
	form.getContextMenus().RefMan.getClinicalNotesMenuEDIT_NOTEItem().setVisible(!isReadOnly 
			&& form.dyngrdNotes().getValue() instanceof AppointmentClinicalNotesVo 
			&& form.getLocalContext().getMosUserIsNotNull() 
			&& ( engine.hasRight(AppRight.CAN_EDIT_ALL_CLINICAL_NOTES) 
					|| (((AppointmentClinicalNotesVo) form.dyngrdNotes().getValue()).getAuthoringUser().equals(form.getLocalContext().getMosUser()) || (form.getLocalContext().getHcpUserIsNotNull() && ((AppointmentClinicalNotesVo) form.dyngrdNotes().getValue()).getAuthoringInformation().getAuthoringHcp().equals(form.getLocalContext().getHcpUser())))) );//	WDEV-14006
	
	form.getContextMenus().RefMan.getClinicalNotesMenuEDIT_DIAGNOSEItem().setVisible(!isReadOnly && form.getLocalContext().getHcpUserIsNotNull() && form.dyngrdNotes().getValue() instanceof PatientDiagnosisApptDetailVo && ((PatientDiagnosisApptDetailVo) form.dyngrdNotes().getValue()).getAuthoringInfo().getAuthoringHcp().equals(form.getLocalContext().getHcpUser()));
	form.getContextMenus().RefMan.getClinicalNotesMenuEDIT_PROCEDUREItem().setVisible(!isReadOnly && form.getLocalContext().getHcpUserIsNotNull() && form.dyngrdNotes().getValue() instanceof PatientProcedureApptDetailVo && ((PatientProcedureApptDetailVo) form.dyngrdNotes().getValue()).getAuthoringInformation().getAuthoringHcp().equals(form.getLocalContext().getHcpUser()));
	
	form.getContextMenus().RefMan.getClinicalNotesMenuDELETE_NOTEItem().setVisible(!isReadOnly 
			&& form.dyngrdNotes().getValue() instanceof AppointmentClinicalNotesVo 
			&& engine.hasRight(AppRight.ALLOW_DELETION_OF_APPOINTMENT_CLINICAL_NOTES) 
			&& form.getLocalContext().getMosUserIsNotNull() && (((AppointmentClinicalNotesVo) form.dyngrdNotes().getValue()).getAuthoringUser().equals(form.getLocalContext().getMosUser()) || (form.getLocalContext().getHcpUserIsNotNull() && ((AppointmentClinicalNotesVo) form.dyngrdNotes().getValue()).getAuthoringInformation().getAuthoringHcp().equals(form.getLocalContext().getHcpUser()))));//	WDEV-14006
	
	form.getContextMenus().RefMan.getClinicalNotesMenuDELETE_DIAGNOSISItem().setVisible(!isReadOnly && form.dyngrdNotes().getValue() instanceof PatientDiagnosisApptDetailVo && engine.hasRight(AppRight.ALLOW_DELETION_OF_APPOINTMENT_CLINICAL_NOTES));
	form.getContextMenus().RefMan.getClinicalNotesMenuDELETE_PROCEDUREItem().setVisible(!isReadOnly && form.dyngrdNotes().getValue() instanceof PatientProcedureApptDetailVo && engine.hasRight(AppRight.ALLOW_DELETION_OF_APPOINTMENT_CLINICAL_NOTES));
	
	form.btnPrevious().setVisible(form.getGlobalContext().RefMan.getPreviousReferralsIsNotNull() && form.getGlobalContext().RefMan.getPreviousReferrals().size() > 0);
	if(form.getGlobalContext().RefMan.getPreviousReferralsIsNotNull() && form.getGlobalContext().RefMan.getPreviousReferrals().size() > 0)
		form.btnPrevious().setText(PREVIOUS_REFERRALS + form.getGlobalContext().RefMan.getPreviousReferrals().size());

	form.btnPrint().setVisible(!isReadOnly && form.dyngrdNotes().getValue() instanceof AppointmentClinicalNotesVo 
			&& ((AppointmentClinicalNotesVo)form.dyngrdNotes().getValue()).getClinicalNoteTypeIsNotNull()
			&& ((AppointmentClinicalNotesVo)form.dyngrdNotes().getValue()).getNoteStatusIsNotNull()
			&& ((AppointmentClinicalNotesVo)form.dyngrdNotes().getValue()).getNoteStatus().equals(ReportNoteStatus.ACTIVE)
			&& ((AppointmentClinicalNotesVo)form.dyngrdNotes().getValue()).getClinicalNoteType().equals(ClinicalNoteTypeForAnAppointment.CORRESPONDENCE_NOTES));
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setActionedDNAedAndCancelledButtons() 
{
	form.lyrSelect().tabAppInvs().btnActioned().setVisible(false);
	form.lyrSelect().tabAppInvs().btnDNAReviewed().setVisible(false);
	form.lyrSelect().tabAppInvs().btnCancelReviewed().setVisible(false);

	CatsReferralVo voRefWizard = domain.getCatsReferral(form.getGlobalContext().RefMan.getCatsReferral());
	if (voRefWizard.getHasRejectedInvIsNotNull()
			&& voRefWizard.getHasRejectedInv().booleanValue() )
	{
		form.lyrSelect().tabAppInvs().btnActioned().setEnabled(true);
		form.lyrSelect().tabAppInvs().btnActioned().setVisible(true);
	}
	if (voRefWizard.getHasDNAApptsForReviewIsNotNull()
		&& voRefWizard.getHasDNAApptsForReview().booleanValue()
		&& engine.hasRight(AppRight.CAN_REVIEW_AND_REMOVE_DNA_APPTS))
	{
		form.lyrSelect().tabAppInvs().btnDNAReviewed().setEnabled(true);
		form.lyrSelect().tabAppInvs().btnDNAReviewed().setVisible(true);
	}
	if (voRefWizard.getHasCancelledApptsForReviewIsNotNull()
		&& voRefWizard.getHasCancelledApptsForReview().booleanValue()
		&& engine.hasRight(AppRight.CAN_REVIEW_AND_REMOVE_CANCELLED_APPTS))
	{
		form.lyrSelect().tabAppInvs().btnCancelReviewed().setEnabled(true);
		form.lyrSelect().tabAppInvs().btnCancelReviewed().setVisible(true);
	}
	
	//WDEV-18380
	form.getLocalContext().setReferralCancelledByProvider(voRefWizard.getCurrentStatus() != null && ReferralApptStatus.REFERRAL_CANCELLED_BY_PROVIDER.equals(voRefWizard.getCurrentStatus().getReferralStatus()));
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void initializeScreen()
{
	form.getLocalContext().setConsultationClinicalNotesVo(null);
	if(form.getGlobalContext().Core.getPatientShortIsNotNull())
			form.getLocalContext().setPatientAllergyCollection(domain.listPatientAllergies(form.getGlobalContext().Core.getPatientShort()));
	form.ccInitiallySeen().initializeComponent();
	enableInitiallySeenComponent(engine.hasRight(AppRight.CAN_EDIT_INITIALLY_SEEN_BY));
	form.ccLastUpdating().initializeComponent();
	form.setMode(FormMode.VIEW);
	
	initializeHasNoKnownAllergies();
	
	open();
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setContractForSelectedSite() 
{
	if(!engine.hasRight(AppRight.CAN_VIEW_CLINICS_ACROSS_ALL_CONTRACTS))
	{
		OrganisationLiteVo rootOrg = null;
		
		if(form.cmbSite().getValue() instanceof ILocation)
		{
			rootOrg = domain.getOrganisationByLocation(form.cmbSite().getValue().getID());
			form.cmbContract().newRow(rootOrg, rootOrg.getName());
		}
		
		form.cmbContract().setValue(rootOrg);
	}
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean validateSearch()
{
	List<String> uiErrors = new ArrayList<String>();
	
	if(form.cmbContract().getValue() == null && engine.hasRight(AppRight.CAN_VIEW_CLINICS_ACROSS_ALL_CONTRACTS))
		uiErrors.add("Please select a Contract");
	
	if(form.cmbSite().getValue() == null)
		uiErrors.add("Please select a Site");
	
	if(form.cmbProfile().getValue() == null)
		uiErrors.add("Please select a Profile");
		
	if(form.cmbSessions().getValue() == null)
		uiErrors.add("Please select a Clinic");
	
	if(form.dteSessionDate().getValue() == null)
		uiErrors.add("Please enter a Date");
	
	if(uiErrors.size() > 0)
	{
		engine.showErrors(uiErrors.toArray(new String[0]));
		return false;
	}
	
	return true;
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean parentEnded()
{
	// we dont care about any rules if the user is a clinical administrator
	if (engine.hasRight(AppRight.CAN_ADD_CONTACT_AFTER_ENDDATE_SUPPLIED))
		return false;

	if (ConfigFlag.UI.STOP_CLINICAL_DATACREATION_IFENDDATE_SUPPLIED.getValue())
	{
		// check if the selected item is ended
		if (form.dyngrdList().getValue() != null)
		{
			if (form.dyngrdList().getValue() instanceof EpisodeofCareVo)
			{
				if (((EpisodeofCareVo) form.dyngrdList().getValue()).getEndDateIsNotNull())
					return true;
			}

			else if (form.dyngrdList().getValue() instanceof CareContextVo)
			{
				if (((CareContextVo) form.dyngrdList().getValue()).getEndDateTimeIsNotNull() || ((EpisodeofCareVo) form.dyngrdList().getSelectedRow().getParent().getValue()).getEndDateIsNotNull())
					return true;
			}
			else if (form.dyngrdList().getValue() instanceof ClinicalContactShortVo)
			{
				if (((CareContextVo) form.dyngrdList().getSelectedRow().getParent().getValue()).getEndDateTimeIsNotNull() || ((EpisodeofCareVo) form.dyngrdList().getSelectedRow().getParent().getParent().getValue()).getEndDateIsNotNull())
					return true;
			}
		}
	}

	return false;
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void updateControlsState() 
{
	boolean isNewStatus = form.getLocalContext().getSelectedInstance() == null || (form.getLocalContext().getSelectedInstanceIsNotNull() && HospitalAtNightPatientStatus.NEW.equals(form.getLocalContext().getSelectedInstance().getCurrentStatus().getStatus()));
	boolean isNotRemoveFromList = form.getLocalContext().getSelectedInstance() == null || (form.getLocalContext().getSelectedInstanceIsNotNull() && !HospitalAtNightPatientStatus.REMOVE_FROM_LIST.equals(form.getLocalContext().getSelectedInstance().getCurrentStatus().getStatus()));
	
	form.ccRequestingHCP().setEnabled(FormMode.EDIT.equals(form.getMode()) && isNewStatus);
	
	form.getContextMenus().Clinical.getHospitalAtNightClinicalTaskMenuEDITItem().setVisible(FormMode.EDIT.equals(form.getMode()) && isNewStatus);
	form.getContextMenus().Clinical.getHospitalAtNightUpdateNotesNEWItem().setVisible(form.getLocalContext().getLoggedHCPIsNotNull() && isNotRemoveFromList);
	form.getContextMenus().Clinical.getHospitalAtNightUpdateNotesEDITItem().setVisible(form.getLocalContext().getLoggedHCPIsNotNull() && form.grdUpdatedNotes().getValue() instanceof HospitalAtNightNotesVo && isNotRemoveFromList);
	
	if(FormMode.VIEW.equals(form.getMode()))
	{
		//WDEV-18180
		boolean canAllocateTask = engine.hasRight(AppRight.HAN_CAN_ALLOCATE_TASKS)&& form.getLocalContext().getLoggedHCPIsNotNull() && form.getLocalContext().getSelectedInstanceIsNotNull() && HospitalAtNightPatientStatus.NEW.equals(form.getLocalContext().getSelectedInstance().getCurrentStatus().getStatus());
		form.btnActive().setVisible(canAllocateTask);
		form.btnRemoveFromList().setVisible(form.getLocalContext().getLoggedHCPIsNotNull() && form.getLocalContext().getSelectedInstanceIsNotNull() && HospitalAtNightPatientStatus.ACTIVE.equals(form.getLocalContext().getSelectedInstance().getCurrentStatus().getStatus()));//	WDEV-13968
		form.btnEdit().setVisible(form.getLocalContext().getLoggedHCPIsNotNull() && form.getLocalContext().getSelectedInstanceIsNotNull() && HospitalAtNightPatientStatus.NEW.equals(form.getLocalContext().getSelectedInstance().getCurrentStatus().getStatus()));
	}
	else if(FormMode.EDIT.equals(form.getMode()))
	{
		form.txtSituation().setEnabled(isNewStatus);
		form.txtBackground().setEnabled(isNewStatus);
		form.txtAssessment().setEnabled(isNewStatus);
		form.txtRecommendation().setEnabled(isNewStatus);
		form.cmbMEWS().setEnabled(isNewStatus);
		form.grdTypeRequest().setReadOnly(!isNewStatus);
		form.dtimRequestingDate().setEnabled(isNewStatus);
	}
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void updateContextMenus()
{
	form.getContextMenus().hideAllGenericGridMenuItems();
	form.getContextMenus().getGenericGridAddItem().setVisible(form.getMode().equals(FormMode.EDIT));
	form.getContextMenus().getGenericGridUpdateItem().setVisible(false/*form.getMode().equals(FormMode.EDIT) && form.grdFollowUp().getSelectedRow() != null)*/);
	if(form.getLocalContext().getcurentSurgicalOpNotes() != null)
		if(form.getLocalContext().getcurentSurgicalOpNotes().getSignOffHCP() != null && form.getLocalContext().getcurentSurgicalOpNotes().getSignOffDateTime() != null && Boolean.FALSE.equals(engine.hasRight(AppRight.CAN_UNDO_SURGICAL_OPERATION_NOTES_COMPLETE)))  //wdev-14074
		{
			
			form.getContextMenus().getGenericGridAddItem().setVisible(false);
			form.getContextMenus().getGenericGridUpdateItem().setVisible(false);
		}
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void setReadOnly(Boolean isRead) 
{
	if( Boolean.TRUE.equals(engine.hasRight(AppRight.CAN_UNDO_SURGICAL_OPERATION_NOTES_COMPLETE)))		//wdev-13658
		form.getLocalContext().setReadOnly(false);														//wdev-13658
	else
		form.getLocalContext().setReadOnly(isRead);
	updateControlsState();		
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void initialise()
{
	form.getLocalContext().setCarePlans(domain.listCarePlans(form.getGlobalContext().Core.getCurrentCareContext()));

	form.btnUpdateActions().setVisible(ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().toString().equals("CCO"));
	form.btnUpdateActions().setEnabled(areCarePlansSelected());

	form.chkConfirmed().setEnabled(false);
	
	if (form.getGlobalContext().Core.getClinicalNotingModeIsNotNull()
		&& (form.getGlobalContext().Core.getClinicalNotingMode().equals(ClinicalNotingMode.NEW)
			|| form.getGlobalContext().Core.getClinicalNotingMode().equals(ClinicalNotingMode.UPDATE) ) )
	{
		if(engine.hasRight(AppRight.CAN_CONFIRM_NURSING_DOCUMENTATION))
			form.chkConfirmed().setEnabled(true);
	}
	form.gridCarePlan().setReadOnly(false);
	form.gridCarePlan().setEnabled(true);

	form.ccAuthoredBy().setIsRequiredPropertyToControls(ConfigFlag.GEN.CARE_PLAN_FUNCTIONALITY_TYPE.getValue().toString().equals("CCO") ? false : true);
	
	
	form.ccConfirmedBYMOS().setEnabled(form.chkConfirmed().getValue());
	form.dtimConfirmedBY().setEnabled(form.chkConfirmed().getValue());

	form.lblCorrection().setVisible(false);
	form.txtCorrection().setVisible(false);
	form.ccConfirmedBYMOS().isRequired(true);
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void newClinicalNote() 
{
	form.setMode(FormMode.EDIT);

	clearScreen();
	
	form.getLocalContext().setSelectedClinicalNote(null);
	
	form.ccRecordingUser().setValue((IMos) domain.getMosUser());
	form.dtimRecordingDateTime().setValue(new DateTime());

	AuthoringInformationVo voAuth = new AuthoringInformationVo();
	if (domain.getHcpUser() != null)
		voAuth.setAuthoringHcp((HcpLiteVo) domain.getHcpLiteUser());
	voAuth.setAuthoringDateTime(new DateTime());
	form.ccAuthoredBy().setValue(voAuth);
	
	if(engine.hasRight(AppRight.CAN_CONFIRM_NURSING_DOCUMENTATION))
		form.chkConfirmed().setEnabled(true);
	else
		form.chkConfirmed().setEnabled(false);

	form.ccConfirmedBYMOS().setEnabled(false);
	form.dtimConfirmedBY().setEnabled(false);

	form.btnUpdateActions().setEnabled(false);
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private boolean returnFlagStatus()
{
	return engine.hasRight(AppRight.CAN_CONFIRM_NURSING_DOCUMENTATION);
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private boolean returnFlagStatus()
{
	return engine.hasRight(AppRight.CAN_CONFIRM_NURSING_DOCUMENTATION);
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	form.setMode(FormMode.EDIT);
	if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("UK"))
	{
		form.lblEthnicOrigin().setVisible(true);
		form.cmbEthnic().setVisible(true);
		form.cmbEthnic().setEnabled(false);
		form.cmbOccupation().setVisible(false);
		form.lblOccupation().setVisible(false);
		form.lyrAdditionalDetails().hide();
	}
	else if (ConfigFlag.UI.DEMOGRAPHICS_TYPE.getValue().equals("IRISH"))
	{
		form.lyrAdditionalDetails().showtabMedicalCardIrish();
		form.lblEthnicOrigin().setVisible(false);
		form.cmbEthnic().setVisible(false);
		form.cmbOccupation().setEnabled(false);
	}
	
	if (Boolean.TRUE.equals(ConfigFlag.UI.SHOW_PREFERRED_LANGUAGE_ON_DEMOGRAPHICS.getValue()))
	{
		form.lyrAdditionalDetails().showtabPLanguage();
	}

	form.getGlobalContext().Core.setNOKDetails(null);
	form.getGlobalContext().Core.setGPDetails(null);
	form.getGlobalContext().Core.setDeathDetails(null);
	
	if (args != null && args.length == 1 && args[0] instanceof ISelectedPatient)
	{
		form.getGlobalContext().Core.setPatientShort(null);
		PatientShort ps = new ims.core.vo.PatientShort(((ISelectedPatient) args[0]).getISelectedPatientID(), 0);
		PatientId psId = new PatientId();
		PatientIdCollection psColl = new PatientIdCollection();
		ims.core.vo.lookups.PatIdType type = ims.core.vo.lookups.PatIdType.getNegativeInstance(((ISelectedPatient) args[0]).getISelectedPatientInterfaceIDType());
		if (type != null)
		{
			psId.setType(type);
			psId.setValue(((ISelectedPatient) args[0]).getISelectedPatientInterfaceID());
			if (psId.getValueIsNotNull())
			{
				psColl.add(psId);
				ps.setIdentifiers(psColl);
			}
		}

		form.getGlobalContext().Core.setPatientToBeDisplayed(ps);

	}

	form.getLocalContext().setbEventFired(false);//wdev-6137
	form.btnDeceased().setVisible(false);
	displayDemographics();
	form.setMode(FormMode.EDIT);
	if (form.getGlobalContext().Core.getPatientShortIsNotNull())
	{
		if (engine.hasRight(AppRight.ALLOW_MARK_PATIENT_AS_DECEASED))
			form.btnDeceased().setVisible(!form.getGlobalContext().Core.getPatientShort().getDodIsNotNull());
		form.dteDod().setVisible(form.getGlobalContext().Core.getPatientShort().getDodIsNotNull());
		form.dteDod().setEnabled(false);
		form.lblDod().setVisible(form.getGlobalContext().Core.getPatientShort().getDodIsNotNull());
	}

	form.cmbSex().setRequired(ConfigFlag.DOM.GENDER_IS_MANDATORY_FOR_REGISTRATION.getValue());	//WDEV-13031
	
	updateControlsState();
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void updateControlsState()
{
	if(form.getMode().equals(FormMode.EDIT))
	{
		if(form.ansIVUser().getValue() != null && form.ansIVUser().getValue().equals(YesNoUnknown.YES) && !engine.hasRight(AppRight.NURSING_ADMIN_ROLE))
			form.ansIVUser().setEnabled(false);
		else
			form.ansIVUser().setEnabled(true);
		
		form.btnNew().setVisible(false);
		form.btnUpdate().setVisible(false);
		
	
	}
	else
	{
		form.getContextMenus().Core.hideAllSocialHistoryGridMenuItems();
		form.getContextMenus().hideAllGenericGridMenuItems();
		form.ansIVUser().setEnabled(false);
		SocialHistoryVo socialHistory = form.getLocalContext().getvoSocialHistory();
		
		if (engine.getFormName().equals(form.getForms().Core.SocialHistoryCoreClinicalRecord))
		{
			form.btnNew().setVisible(false);
			form.btnUpdate().setVisible(false);
		}
		else
		{
			if (form.getLocalContext().getcurrentSocialHistory() == null)
			{
				form.btnNew().setVisible(true);
			}
			else
			{
				form.btnNew().setVisible(false);
				if(form.getLocalContext().getcurrentSocialHistory().equals(socialHistory))
					form.btnUpdate().setVisible(true);
				else
					form.btnUpdate().setVisible(false);
			}
		}
	}
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void setControlStateForEndedItems()
{
	CareSpellDialogMode mode = form.getGlobalContext().Core.getCareSpellDialogMode();
	
	if(mode == null)
		throw new CodingRuntimeException("CareSpellDialogMode enumeration not supplied");
	//we dont care about any rules if the user is a clinical administrator 
	if(engine.hasRight(AppRight.CAN_ADD_CONTACT_AFTER_ENDDATE_SUPPLIED))
		return;
	
	if(ConfigFlag.UI.STOP_CLINICAL_DATACREATION_IFENDDATE_SUPPLIED.getValue())
	{
		//check if the selected item is ended and disable and clear all controls below
		if(mode.equals(CareSpellDialogMode.EDITEPISODEOFCARE) || mode.equals(CareSpellDialogMode.NEWEPISODEOFCARE))
		{	
			form.dtimCtxStart().setEnabled(form.dteEcEnd().getValue() == null);
			form.dtimCtxEnd().setEnabled(form.dteEcEnd().getValue() == null);
			form.cmbCtxContextType().setEnabled(form.dteEcEnd().getValue() == null);
			form.cmbCtxLocationType().setEnabled(form.dteEcEnd().getValue() == null);
			
			form.dtimConStart().setEnabled(form.dteEcEnd().getValue() == null);
			form.dtimConEnd().setEnabled(form.dteEcEnd().getValue() == null);
			form.qmbConSeenBy().setEnabled(form.dteEcEnd().getValue() == null);
			form.cmbConSpecialty().setEnabled(form.dteEcEnd().getValue() == null);
			form.cmbConContactType().setEnabled(form.dteEcEnd().getValue() == null);
				
			if(form.dteEcEnd().getValue() != null)
			{
				form.dtimCtxStart().setValue(null);
				form.dtimCtxEnd().setValue(null);
				form.cmbCtxContextType().setValue(null);
				form.cmbCtxLocationType().setValue(null);
				
				form.dtimConStart().setValue(null);
				form.dtimConEnd().setValue(null);
				form.qmbConSeenBy().setValue(null);
				form.cmbConSpecialty().setValue(null);
				form.cmbConContactType().setValue(null);
			}

			if(form.dtimCtxEnd().getValue() != null)
			{
				form.dtimConStart().setValue(null);
				form.dtimConEnd().setValue(null);
				form.qmbConSeenBy().setValue(null);
				form.cmbConSpecialty().setValue(null);
				form.cmbConContactType().setValue(null);
				
				form.dtimConStart().setEnabled(form.dtimCtxEnd().getValue() == null);
				form.dtimConEnd().setEnabled(form.dtimCtxEnd().getValue() == null);
				form.qmbConSeenBy().setEnabled(form.dtimCtxEnd().getValue() == null);
				form.cmbConSpecialty().setEnabled(form.dtimCtxEnd().getValue() == null);
				form.cmbConContactType().setEnabled(form.dtimCtxEnd().getValue() == null);
			}
		}
		else if(mode.equals(CareSpellDialogMode.EDITCONTACTCONTEXTDETAILS) || mode.equals(CareSpellDialogMode.ADDCONTACTCONTEXTDETAILS))
		{
			form.dtimConStart().setEnabled(form.dtimCtxEnd().getValue() == null);
			form.dtimConEnd().setEnabled(form.dtimCtxEnd().getValue() == null);
			form.qmbConSeenBy().setEnabled(form.dtimCtxEnd().getValue() == null);
			form.cmbConSpecialty().setEnabled(form.dtimCtxEnd().getValue() == null);
			form.cmbConContactType().setEnabled(form.dtimCtxEnd().getValue() == null);
			
			if(form.dtimCtxEnd().getValue() != null)
			{
				form.dtimConStart().setValue(null);
				form.dtimConEnd().setValue(null);
				form.qmbConSeenBy().setValue(null);
				form.cmbConSpecialty().setValue(null);
				form.cmbConContactType().setValue(null);
			}
		}
	}
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void setContextMenusState() 
{							
	DocumentStatus lkpStatus = null;
	
	lkpStatus = form.grdInpatients().getSelectedRowIndex() < 0 ? null : form.grdInpatients().getSelectedRow().getValue().getPasEvent().getCspDocumentStatus();
		
	boolean boolCanAddCSP = false;
	boolean boolCanViewCSP = false; 
	if (lkpStatus != null)
	{
		boolCanAddCSP = lkpStatus.equals(DocumentStatus.LETTERREQUIRED);
		boolCanViewCSP = lkpStatus.equals(DocumentStatus.GENNOTPRINTED) || lkpStatus.equals(DocumentStatus.PRINTEDNOSIGNATURE) || lkpStatus.equals(DocumentStatus.SIGNED);
		//boolCanPreviewLetter = lkpStatus.equals(DocumentStatus.GENNOTPRINTED) || lkpStatus.equals(DocumentStatus.PRINTEDNOSIGNATURE) || lkpStatus.equals(DocumentStatus.SIGNED);
		
		//TODO
		/*
		if (form.getLocalContext().getSelectedCorrespondenceInstanceIsNotNull())
			boolCanViewDocStatusHistory = form.getLocalContext().getSelectedCorrespondenceInstance().getCspStatusHistoryIsNotNull() ? true : false;
		else
			boolCanViewDocStatusHistory = false;
		*/
			
		//boolCanViewContacts = true;
		//boolCanSetLetterRequired = lkpStatus.equals(DocumentStatus.NOLETTERREQUIRED);
		//boolCanSetNOLetterRequired = lkpStatus.equals(DocumentStatus.LETTERREQUIRED);
	}
			
	enableAllContextMenus();
	form.getContextMenus().hideAllADTMenuMenuItems();
	form.getContextMenus().getADTMenuAddItem().setVisible(boolCanAddCSP);
	form.getContextMenus().getADTMenuViewItem().setVisible(boolCanViewCSP);
	form.getContextMenus().getADTMenuDemographicsItem().setVisible(form.grdInpatients().getValue() != null);//WDEV-15975
	
	form.getContextMenus().getADTMenuDischargeItem().setVisible(false);//wdev-15489
	if (engine.hasRight(AppRight.CAN_DISCHARGE_INPATIENT_IN_RCHT))
	{
		form.getContextMenus().getADTMenuDischargeItem().setVisible(form.grdInpatients().getValue() != null);// 	WDEV-15975
	}
	
	if (ConfigFlag.UI.MAXIMS_ADT_NO_INTERFACE.getValue())
	{
		if (form.grdInpatients().getSelectedRow() !=null
			&& form.grdInpatients().getSelectedRow().getValue() != null)
			form.getContextMenus().getADTMenuTransferItem().setVisible(true);

		if (form.grdInpatients().getSelectedRow() !=null
			&& form.grdInpatients().getSelectedRow().getValue() != null)
		{
			if(form.grdInpatients().getSelectedRow().getValue().getWardStays() == null
				|| (form.grdInpatients().getSelectedRow().getValue().getWardStaysIsNotNull()
					&& form.grdInpatients().getSelectedRow().getValue().getWardStays().size() == 0) // initialised but empty.
				|| (form.grdInpatients().getSelectedRow().getValue().getWardStaysIsNotNull()
					&& form.grdInpatients().getSelectedRow().getValue().getWardStays().size() == 1)	)
			{
				InpatientEpisodeVo voIP = domain.getInpatientEpisode(form.grdInpatients().getSelectedRow().getValue());
				if (voIP == null
					|| 
					(voIP != null
					&& voIP.getPasEventIsNotNull()
					&& voIP.getPasEvent().getLocationIsNotNull()
					&& form.grdInpatients().getSelectedRow().getValue() != null
					&& form.grdInpatients().getSelectedRow().getValue().getPasEvent() != null
					&&  ! voIP.getPasEvent().getLocation().equals(form.grdInpatients().getSelectedRow().getValue().getPasEvent().getLocation())))
				{
					engine.showMessage("This In-Patient record has already been updated by another user. The screen will be refreshed.");
					performSearch();
					return;
				}
				form.getContextMenus().getADTMenuCancelAdmissionItem().setVisible(true);
				
			}
		}
		if ( !engine.hasRight(AppRight.CAN_DISCHARGE_INPATIENT_IN_RCHT) && engine.hasRight(AppRight.MAXIMS_ADT_CAN_DISCHARGE))  //wdev-16427
		{
			form.getContextMenus().getADTMenuDischargeItem().setVisible(form.grdInpatients().getValue() != null);
		}
	}

}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void displayPatient(PatientShort patient) throws FormOpenException
{
	Patient voPatient;
	try
	{
		voPatient = domain.getPatient(patient);
		engine.addPatientSelectionToHistory(voPatient);
		//WDEV-13009 
		if(engine.getParentDialogFormName()!= null && engine.getParentDialogFormName().equals(form.getForms().Core.BedInfoDialog))
			form.getLocalContext().setsavedPatient((Patient) voPatient.clone());
	}
	catch (StaleObjectException e)
	{
		// Try a second time. Only then fail.
		try
		{
			voPatient = domain.getPatient(patient);
		}
		catch (StaleObjectException e1)
		{
			throw new FormOpenException("Failed to retrieve Patient due to StaleObjectException");
		}
	}
	if (voPatient == null)
		throw new FormOpenException("Data has been changed, Please perform another Patient Search");

	
	if(ConfigFlag.UI.DISPLAY_PATIENT_IMAGE.getValue() == true)  //wdev-13521
	{			
		form.lyrPatientDetails().tabPage1().ccPatientDetailsWithImage().setbtnDeceasedText("Mark as Deceased");
		form.lyrPatientDetails().tabPage1().ccPatientDetailsWithImage().setbtnDeceasedVisible(false);
	}
	else
	{
		form.lyrPatientDetails().tabPage2().ccPatientDetails().setbtnDeceasedText("Mark as Deceased");
		form.lyrPatientDetails().tabPage2().ccPatientDetails().setbtnDeceasedVisible(false);
	}


	form.getLocalContext().setPatient(voPatient);
	form.getGlobalContext().Core.setPatientShort(voPatient);
	populateScreenFromData(voPatient);

	if (engine.hasRight(AppRight.ALLOW_MARK_PATIENT_AS_DECEASED)
		&& voPatient != null
		&& voPatient.getDodIsNotNull())
	{
		
		if(ConfigFlag.UI.DISPLAY_PATIENT_IMAGE.getValue() == true)  //wdev-13521
		{			
			form.lyrPatientDetails().tabPage1().ccPatientDetailsWithImage().setbtnDeceasedText("Death Details");
			form.lyrPatientDetails().tabPage1().ccPatientDetailsWithImage().setbtnDeceasedVisible(true);
		}
		else
		{
			form.lyrPatientDetails().tabPage2().ccPatientDetails().setbtnDeceasedText("Death Details");
			form.lyrPatientDetails().tabPage2().ccPatientDetails().setbtnDeceasedVisible(true);
		}
		
	}

	if (ConfigFlag.UI.SHOW_CASENOTEFOLDER_ON_DEMOGRAPHICS.getValue())
		displayCaseNoteFolder(patient.getPatId(PatIdType.HOSPNUM));

	form.btnUpdate().setVisible(ConfigFlag.DOM.LOCAL_PATIENT_REGISTRATION.getValue());
	//---------------- wdev-8696
	//DisplayImagePatient(voPatient,false);
	//----------------
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void updateControlsState() 
{
	form.getContextMenus().Emergency.getInterventionsTreatmentsMenuEDITItem().setVisible(form.getLocalContext().getCareContextIsNotNull() 
			&& Boolean.TRUE.equals(form.getLocalContext().getIsEnabled())); //wdev-17637

	form.getContextMenus().Emergency.getInterventionsTreatmentsMenuREMOVEItem().setVisible(form.getLocalContext().getCareContextIsNotNull() 
			&& Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdInterventionsTreatments().getValue() != null);
	
	form.getContextMenus().Emergency.getInterventionsTreatmentsMenuMOVE_DOWNItem().setVisible(form.getLocalContext().getCareContextIsNotNull() 
			&& Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdInterventionsTreatments().getValue() != null 
			&& form.grdInterventionsTreatments().canMoveCurrentDown()
			&& Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()));
	form.getContextMenus().Emergency.getInterventionsTreatmentsMenuMOVE_UPItem().setVisible(form.getLocalContext().getCareContextIsNotNull() 
			&& Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdInterventionsTreatments().getValue() != null 
			&& form.grdInterventionsTreatments().canMoveCurrentUp()
			&& Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()));
	
	form.getContextMenus().Emergency.getDiagnosisForAttendanceNotesMenuADDItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()));
	form.getContextMenus().Emergency.getDiagnosisForAttendanceNotesMenuEDITItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdDiagnosis().getValue() != null);
	form.getContextMenus().Emergency.getDiagnosisForAttendanceNotesMenuREMOVEItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdDiagnosis().getValue() != null && engine.hasRight(AppRight.ED_ATTENDENCE_NOTES_CAN_RIE_DIAGNOSIS));

	form.getContextMenus().Emergency.getDiagnosisForAttendanceNotesMenuMOVE_DOWNItem().setVisible(form.getLocalContext().getCareContextIsNotNull() 
			&& Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdDiagnosis().getValue() != null 
			&& form.grdDiagnosis().canMoveCurrentDown()
			&& Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()));
	form.getContextMenus().Emergency.getDiagnosisForAttendanceNotesMenuMOVE_UPItem().setVisible(form.getLocalContext().getCareContextIsNotNull() 
			&& Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdDiagnosis().getValue() != null 
			&& form.grdDiagnosis().canMoveCurrentUp()
			&& Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()));

	form.getContextMenus().Emergency.getInvestigationsForAttendanceNotesMenuADDItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()));
	form.getContextMenus().Emergency.getInvestigationsForAttendanceNotesMenuEDITItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdInvestigations().getValue() instanceof InvestigationAttendenceDetailVo);
	form.getContextMenus().Emergency.getInvestigationsForAttendanceNotesMenuREMOVEItem().setVisible(form.getLocalContext().getCareContextIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdInvestigations().getValue() instanceof InvestigationAttendenceDetailVo);

	form.getContextMenus().Emergency.getInvestigationsForAttendanceNotesMenuMOVE_DOWNItem().setVisible(form.getLocalContext().getCareContextIsNotNull() 
			&& Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdInvestigations().getValue() != null 
			&& form.grdInvestigations().canMoveCurrentDown()
			&& Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()));
	form.getContextMenus().Emergency.getInvestigationsForAttendanceNotesMenuMOVE_UPItem().setVisible(form.getLocalContext().getCareContextIsNotNull() 
			&& Boolean.TRUE.equals(form.getLocalContext().getIsEnabled()) && form.grdInvestigations().getValue() != null 
			&& form.grdInvestigations().canMoveCurrentUp()
			&& Boolean.TRUE.equals(form.getLocalContext().getAddedDuringCoding()));
	
	boolean bShowSaveCancel = false;
	if (Boolean.TRUE.equals(form.getLocalContext().getInterventionSequenceChanged()) //WDEV-18335
			|| Boolean.TRUE.equals(form.getLocalContext().getInvestigationsSequenceChanged())
			|| Boolean.TRUE.equals(form.getLocalContext().getDiagnosisSequenceChanged()))
		bShowSaveCancel = true;
		form.btnSave().setVisible(bShowSaveCancel);
		form.btnCancel().setVisible(bShowSaveCancel);
		form.btnSave().setEnabled(bShowSaveCancel);
		form.btnCancel().setEnabled(bShowSaveCancel);
}