gt: 		voSkin = this.populateDataFromScreen();
context: //#############################################################################
  //#                                                                           #
  //#  Copyright (C) <2015>  <IMS MAXIMS>                                       #
  //#                                                                           #
  //#  This program is free software: you can redistribute it and/or modify     #
  //#  it under the terms of the GNU Affero General Public License as           #
  //#  published by the Free Software Foundation, either version 3 of the       #
  //#  License, or (at your option) any later version.                          # 
  //#                                                                           #
  //#  This program is distributed in the hope that it will be useful,          #
  //#  but WITHOUT ANY WARRANTY; without even the implied warranty of           #
  //#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            #
  //#  GNU Affero General Public License for more details.                      #
  //#                                                                           #
  //#  You should have received a copy of the GNU Affero General Public License #
  //#  along with this program.  If not, see <http://www.gnu.org/licenses/>.    #
  //#                                                                           #
  //#  IMS MAXIMS provides absolutely NO GUARANTEE OF THE CLINICAL SAFTEY of    #
  //#  this program.  Users of this software do so entirely at their own risk.  #
  //#  IMS MAXIMS only ensures the Clinical Safety of unaltered run-time        #
  //#  software that it builds, deploys and maintains.                          #
  //#                                                                           #
  //#############################################################################
  //#EOH
  // This code was generated by Daniel Laffan using IMS Development Environment (version 1.22 build 41124.1200)
  // Copyright (C) 1995-2004 IMS MAXIMS plc. All rights reserved.
  
  package ims.spinalinjuries.forms.nurassessmentskin;
  
  import ims.coe.vo.RiskAssessment;
  import ims.coe.vo.RiskAssessmentCollection;
  import ims.coe.vo.RiskDescription;
  import ims.core.vo.HcpLiteVo;
  import ims.domain.exceptions.DomainRuntimeException;
  import ims.domain.exceptions.StaleObjectException;
  import ims.framework.FormName;
  import ims.framework.enumerations.DialogResult;
  import ims.framework.enumerations.FormMode;
  import ims.framework.exceptions.PresentationLogicException;
  import ims.framework.utils.DateTime;
  import ims.nursing.vo.AssessmentHeaderInfo;
  import ims.nursing.vo.BradenScale;
  import ims.nursing.vo.BradenScaleDetails;
  import ims.nursing.vo.BradenScaleDetailsCollection;
  import ims.nursing.vo.CarePlanTemplate;
  import ims.nursing.vo.CarePlanTemplateCollection;
  import ims.nursing.vo.CarePlanTemplateTitle;
  import ims.nursing.vo.CarePlanTemplateTitleCollection;
  import ims.nursing.vo.PatientTurnsVo;
  import ims.nursing.vo.PatientTurnsVoCollection;
  import ims.nursing.vo.SkinAssessment;
  import ims.nursing.vo.SkinAssessmentFindings;
  import ims.nursing.vo.SkinAssessmentFindingsCollection;
  import ims.nursing.vo.SkinAssessmentReviewCollection;
  import ims.nursing.vo.lookups.AssessmentComponentType;
  import ims.nursing.vo.lookups.AssessmentType;
  import ims.spinalinjuries.vo.NurAssessmentSkinVo;
  
  public class Logic extends BaseLogic
  {
  	protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
  	{
  		getBradenAssessment();
  		open();
  		
  		// WDEV-9321
  		// Josan George Cristian:
  		// I know it's a bad practice to put updateControlsState() here but open() has several return paths that should not be there
  		updateControlsState();
  	}
  
  	private void open()
  	{
  		if (form.getGlobalContext().Core.getAssessmentIsReadOnly() == null || form.getGlobalContext().Core.getAssessmentIsReadOnly() == false)
  			form.setMode(FormMode.EDIT);
  		else
  		{
  			form.setMode(FormMode.VIEW);
  			form.chkSectionComplete().setEnabled(false);
  		}
  		form.chkCopy().setEnabled(false);
  
  		// Care Plans
  		CarePlanTemplateTitleCollection tempColl = domain.listCarePlanTemplates(AssessmentComponentType.SPINAL_SKIN);
  		if (tempColl != null)
  		{
  			form.grdCarePlan().getRows().clear();
  			GenForm.grdCarePlanRow tempRow;
  			for (int i = 0; i < tempColl.size(); i++)
  			{
  				CarePlanTemplateTitle template = tempColl.get(i);
  				tempRow = form.grdCarePlan().getRows().newRow();
  				tempRow.setValue(template);
  				tempRow.setcolCarePlans(template.getTitle());
  			}
  		}
  
  		checkForPreviousAssessent();
  
  		// If there is an assessment in the global context, we want to call the
  		// get component
  		// domain method
  		// Otherwise, it is a new assessment component
  		AssessmentHeaderInfo assmnt = form.getGlobalContext().Nursing.getAssessmentHeaderInfo();
  		form.getLocalContext().setAssessment(assmnt);
  		NurAssessmentSkinVo voSkin = null;
  		if (assmnt != null && assmnt.getCurrentComponent() != null)
  		{
  			voSkin = (NurAssessmentSkinVo) domain.getComponent(assmnt.getCurrentComponent());
  			if (voSkin == null)
  				return;
  
  			form.getGlobalContext().COE.setBradenScaleRecord(voSkin.getBradenScale());
  			form.getLocalContext().setAssessmentSkin(voSkin);
  			this.populateScreenFromData(voSkin);
  		}
  		else
  		{
  			if (form.getGlobalContext().Nursing.getAssessmentComponent() != null)
  			{
  				voSkin = (NurAssessmentSkinVo) form.getGlobalContext().Nursing.getAssessmentComponent();
  				this.populateScreenFromData(voSkin);
  			}
  			if (form.getGlobalContext().Core.getAssessmentIsReadOnly() == null || form.getGlobalContext().Core.getAssessmentIsReadOnly() == false)
  				form.setMode(FormMode.EDIT);
  			else
  				form.setMode(FormMode.VIEW);
  		}
  
  		if (assmnt != null)
  		{
  			if (assmnt.getAssessmentType().equals(AssessmentType.INITIAL))
  			{
  				if (voSkin == null)
  				{
  					form.chkSectionComplete().setEnabled(false);
  					return;
  				}
  
  				if (voSkin.getBradenScaleIsNotNull() && voSkin.getSkinAssessmentIsNotNull())
  				{
  					if ((voSkin.getIsCompleteIsNotNull()) && (voSkin.getIsComplete().booleanValue() == false))
  						form.chkSectionComplete().setEnabled(true);
  				}
  				else
  					form.chkSectionComplete().setEnabled(false);
  			}
  		}
  		setBradenTooltip();
  	}
  
  	protected void checkForPreviousAssessent()
  	{
  		NurAssessmentSkinVo assessAccSkin = (NurAssessmentSkinVo) domain.getLastAssessmentComponentByCareContext(form.getGlobalContext().Core.getCurrentCareContext(), AssessmentComponentType.SPINAL_SKIN);
  
  		if (assessAccSkin == null)
  		{
  			this.form.chkCopy().setValue(false);
  			return;
  		}
  
  		form.getLocalContext().setPreviousAssSkin(assessAccSkin);
  		if(form.getMode().equals(FormMode.EDIT))
  			form.chkCopy().setEnabled(true);
  	}
  
  	protected void onLnkSkinAssessmentClick() throws ims.framework.exceptions.PresentationLogicException
  	{
  		NurAssessmentSkinVo voSkin = litePopulateDataFromScreen();// this.populateDataFromScreen();
  		if (voSkin == null)
  			return;
  
  		form.getGlobalContext().Nursing.setAssessmentComponent(voSkin);
  		// engine.open(form.getForms().Nursing.SkinBodyChart);
  
  		engine.open(form.getForms().Nursing.SkinBodyChartDialog);
  	}
  
  	private NurAssessmentSkinVo litePopulateDataFromScreen()
  	{
  		NurAssessmentSkinVo voSkin = form.getLocalContext().getAssessmentSkin();
  
  		if (voSkin == null)
  			voSkin = new NurAssessmentSkinVo();
  
  		form.getLocalContext().setAssessmentSkin(voSkin);
  
  		return voSkin;
  	}
  
  	protected void onImbDeleteTurnClick() throws ims.framework.exceptions.PresentationLogicException
  	{
  		if (form.grdTurns().getSelectedRowIndex() >= 0)
  			form.grdTurns().getRows().remove(form.grdTurns().getSelectedRowIndex());
  		
  		updateControlsState();
  	}
  
  	protected void onImbNewTurnClick() throws ims.framework.exceptions.PresentationLogicException
  	{
  		GenForm.grdTurnsRow row = form.grdTurns().getRows().newRow();
  		row.setValue(new PatientTurnsVo());
  	}
  
  	protected void onBtnCancelClick() throws ims.framework.exceptions.PresentationLogicException
  	{
  		engine.open(form.getForms().Nursing.AdmissionAssessOverview);
  	}
  
  	protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
  	{
  		NurAssessmentSkinVo voSkin = form.getLocalContext().getAssessmentSkin();
  		if (voSkin == null)
  			voSkin = new NurAssessmentSkinVo();
  
  