當前位置: 首頁>>代碼示例>>Java>>正文


Java PatientGoalVo.setTarget方法代碼示例

本文整理匯總了Java中ims.clinical.vo.PatientGoalVo.setTarget方法的典型用法代碼示例。如果您正苦於以下問題:Java PatientGoalVo.setTarget方法的具體用法?Java PatientGoalVo.setTarget怎麽用?Java PatientGoalVo.setTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ims.clinical.vo.PatientGoalVo的用法示例。


在下文中一共展示了PatientGoalVo.setTarget方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addNewTargetToSelectedGoal

import ims.clinical.vo.PatientGoalVo; //導入方法依賴的package包/類
/**
 * Function used to temporarily add a target to a goal
 */
private boolean addNewTargetToSelectedGoal()
{
	// Not only the local context containing the selected object needs to be
	// a PatientGoal,
	// but also in the grid on the form a row must be selected, and that row
	// value must be of type PatientGoal

	// Check for a selected PatientGoal
	if (!(form.getLocalContext().getSelectedRowValue() instanceof PatientGoalVo))
		throw new CodingRuntimeException("Major Logical Error - Can only add a PatientGoalTarget to a PatientGoal");

	// Check for a selected row
	if (form.grdTarget().getSelectedRow() != null && !(form.grdTarget().getSelectedRow().getValue() instanceof PatientGoalRefVo))
		throw new CodingRuntimeException("Major Logical Error - Can only add a PatientGoalTarget to a selected Patient Goal");

	// Get a PatientGoalTargetVo from screen data
	PatientGoalTargetVo patientGoalTarget = populatePatientGoalTargetFromScreen();

	// Validate PatientGoalTarget VO obtained from screen data
	String[] errors = patientGoalTarget.validate();

	if (errors != null && errors.length > 0)
	{
		engine.showErrors(errors);
		return false;
	}

	// Add a child row to currently selected row with PatientGoalTarget
	// value
	grdTargetRow newRow = form.grdTarget().getSelectedRow().getRows().newRow();
	setPatientGoalTargetRow(newRow, patientGoalTarget);

	// Set background color for new row
	newRow.setBackColor(Color.Bisque);

	// Get PatientGoalVo from local context
	PatientGoalVo patientGoal = (PatientGoalVo) form.getLocalContext().getSelectedRowValue();

	// Check PatientGoal target collection - create a new collection if need
	// to
	if (!patientGoal.getTargetIsNotNull())
	{
		patientGoal.setTarget(new PatientGoalTargetVoCollection());
	}

	// Add target to selected PatientGoal
	patientGoal.getTarget().add(patientGoalTarget);

	return true;
}
 
開發者ID:oopcell,項目名稱:AvoinApotti,代碼行數:54,代碼來源:Logic.java


注:本文中的ims.clinical.vo.PatientGoalVo.setTarget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。