/FileExtraction/Java_unseen/IMS-MAXIMS_openMAXIMS/Source Library/openmaxims_workspace/ValueObjects/src/ims/core/vo/PacsConfigurationVo.java
//#############################################################################
//#                                                                           #
//#  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 Barbara Worwood using IMS Development Environment (version 1.80 build 5589.25814)
// Copyright (C) 1995-2015 IMS MAXIMS. All rights reserved.
// WARNING: DO NOT MODIFY the content of this file

package ims.core.vo;

/**
 * Linked to core.configuration.PACSConfiguration business object (ID: 1028100071).
 */
public class PacsConfigurationVo extends ims.core.configuration.vo.PACSConfigurationRefVo implements ims.vo.ImsCloneable, Comparable
{
	private static final long serialVersionUID = 1L;

	public PacsConfigurationVo()
	{
	}
	public PacsConfigurationVo(Integer id, int version)
	{
		super(id, version);
	}
	public PacsConfigurationVo(ims.core.vo.beans.PacsConfigurationVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.serveraddress = bean.getServerAddress();
		this.usernameparam = bean.getUserNameParam();
		this.username = bean.getUsername();
		this.passwordparam = bean.getPasswordParam();
		this.password = bean.getPassword();
		this.accessionparam = bean.getAccessionParam();
		this.accessiontestvalue = bean.getAccessionTestValue();
		this.pacsclienttype = bean.getPACSClientType() == null ? null : ims.core.vo.lookups.PACSClientType.buildLookup(bean.getPACSClientType());
		this.useloggedusername = bean.getUseLoggedUserName();
		this.primaryidentifier = bean.getPrimaryIdentifier() == null ? null : ims.core.vo.lookups.PatIdType.buildLookup(bean.getPrimaryIdentifier());
		this.secondaryidentifier = bean.getSecondaryIdentifier() == null ? null : ims.core.vo.lookups.PatIdType.buildLookup(bean.getSecondaryIdentifier());
		this.patientidentifierparam = bean.getPatientIdentifierParam();
		this.issuerofidentifierparam = bean.getIssuerOfIdentifierParam();
		this.sessiontimeparam = bean.getSessionTimeParam();
		this.primaryidentifiercode = bean.getPrimaryIdentifierCode();
		this.secondaryidentifiercode = bean.getSecondaryIdentifierCode();
		this.aeskey = bean.getAESKey();
		this.useencryptedtoken = bean.getUseEncryptedToken();
		this.encryptedtokenparam = bean.getEncryptedTokenParam();
	}
	public void populate(ims.vo.ValueObjectBeanMap map, ims.core.vo.beans.PacsConfigurationVoBean bean)
	{
		this.id = bean.getId();
		this.version = bean.getVersion();
		this.serveraddress = bean.getServerAddress();
		this.usernameparam = bean.getUserNameParam();
		this.username = bean.getUsername();
		this.passwordparam = bean.getPasswordParam();
		this.password = bean.getPassword();
		this.accessionparam = bean.getAccessionParam();
		this.accessiontestvalue = bean.getAccessionTestValue();
		this.pacsclienttype = bean.getPACSClientType() == null ? null : ims.core.vo.lookups.PACSClientType.buildLookup(bean.getPACSClientType());
		this.useloggedusername = bean.getUseLoggedUserName();
		this.primaryidentifier = bean.getPrimaryIdentifier() == null ? null : ims.core.vo.lookups.PatIdType.buildLookup(bean.getPrimaryIdentifier());
		this.secondaryidentifier = bean.getSecondaryIdentifier() == null ? null : ims.core.vo.lookups.PatIdType.buildLookup(bean.getSecondaryIdentifier());
		this.patientidentifierparam = bean.getPatientIdentifierParam();
		this.issuerofidentifierparam = bean.getIssuerOfIdentifierParam();
		this.sessiontimeparam = bean.getSessionTimeParam();
		this.primaryidentifiercode = bean.getPrimaryIdentifierCode();
		this.secondaryidentifiercode = bean.getSecondaryIdentifierCode();
		this.aeskey = bean.getAESKey();
		this.useencryptedtoken = bean.getUseEncryptedToken();
		this.encryptedtokenparam = bean.getEncryptedTokenParam();
	}
	public ims.vo.ValueObjectBean getBean()
	{
		return this.getBean(new ims.vo.ValueObjectBeanMap());
	}
	public ims.vo.ValueObjectBean getBean(ims.vo.ValueObjectBeanMap map)
	{
		ims.core.vo.beans.PacsConfigurationVoBean bean = null;
		if(map != null)
			bean = (ims.core.vo.beans.PacsConfigurationVoBean)map.getValueObjectBean(this);
		if (bean == null)
		{
			bean = new ims.core.vo.beans.PacsConfigurationVoBean();
			map.addValueObjectBean(this, bean);
			bean.populate(map, this);
		}
		return bean;
	}
	public Object getFieldValueByFieldName(String fieldName)
	{
		if(fieldName == null)
			throw new ims.framework.exceptions.CodingRuntimeException("Invalid field name");
		fieldName = fieldName.toUpperCase();
		if(fieldName.equals("SERVERADDRESS"))
			return getServerAddress();
		if(fieldName.equals("USERNAMEPARAM"))
			return getUserNameParam();
		if(fieldName.equals("USERNAME"))
			return getUsername();
		if(fieldName.equals("PASSWORDPARAM"))
			return getPasswordParam();
		if(fieldName.equals("PASSWORD"))
			return getPassword();
		if(fieldName.equals("ACCESSIONPARAM"))
			return getAccessionParam();
		if(fieldName.equals("ACCESSIONTESTVALUE"))
			return getAccessionTestValue();
		if(fieldName.equals("PACSCLIENTTYPE"))
			return getPACSClientType();
		if(fieldName.equals("USELOGGEDUSERNAME"))
			return getUseLoggedUserName();
		if(fieldName.equals("PRIMARYIDENTIFIER"))
			return getPrimaryIdentifier();
		if(fieldName.equals("SECONDARYIDENTIFIER"))
			return getSecondaryIdentifier();
		if(fieldName.equals("PATIENTIDENTIFIERPARAM"))
			return getPatientIdentifierParam();
		if(fieldName.equals("ISSUEROFIDENTIFIERPARAM"))
			return getIssuerOfIdentifierParam();
		if(fieldName.equals("SESSIONTIMEPARAM"))
			return getSessionTimeParam();
		if(fieldName.equals("PRIMARYIDENTIFIERCODE"))
			return getPrimaryIdentifierCode();
		if(fieldName.equals("SECONDARYIDENTIFIERCODE"))
			return getSecondaryIdentifierCode();
		if(fieldName.equals("AESKEY"))
			return getAESKey();
		if(fieldName.equals("USEENCRYPTEDTOKEN"))
			return getUseEncryptedToken();
		if(fieldName.equals("ENCRYPTEDTOKENPARAM"))
			return getEncryptedTokenParam();
		return super.getFieldValueByFieldName(fieldName);
	}
	public boolean getServerAddressIsNotNull()
	{
		return this.serveraddress != null;
	}
	public String getServerAddress()
	{
		return this.serveraddress;
	}
	public static int getServerAddressMaxLength()
	{
		return 250;
	}
	public void setServerAddress(String value)
	{
		this.isValidated = false;
		this.serveraddress = value;
	}
	public boolean getUserNameParamIsNotNull()
	{
		return this.usernameparam != null;
	}
	public String getUserNameParam()
	{
		return this.usernameparam;
	}
	public static int getUserNameParamMaxLength()
	{
		return 50;
	}
	public void setUserNameParam(String value)
	{
		this.isValidated = false;
		this.usernameparam = value;
	}
	public boolean getUsernameIsNotNull()
	{
		return this.username != null;
	}
	public String getUsername()
	{
		return this.username;
	}
	public static int getUsernameMaxLength()
	{
		return 50;
	}
	public void setUsername(String value)
	{
		this.isValidated = false;
		this.username = value;
	}
	public boolean getPasswordParamIsNotNull()
	{
		return this.passwordparam != null;
	}
	public String getPasswordParam()
	{
		return this.passwordparam;
	}
	public static int getPasswordParamMaxLength()
	{
		return 50;
	}
	public void setPasswordParam(String value)
	{
		this.isValidated = false;
		this.passwordparam = value;
	}
	public boolean getPasswordIsNotNull()
	{
		return this.password != null;
	}
	public String getPassword()
	{
		return this.password;
	}
	public static int getPasswordMaxLength()
	{
		return 50;
	}
	public void setPassword(String value)
	{
		this.isValidated = false;
		this.password = value;
	}
	public boolean getAccessionParamIsNotNull()
	{
		return this.accessionparam != null;
	}
	public String getAccessionParam()
	{
		return this.accessionparam;
	}
	public static int getAccessionParamMaxLength()
	{
		return 50;
	}
	public void setAccessionParam(String value)
	{
		this.isValidated = false;
		this.accessionparam = value;
	}
	public boolean getAccessionTestValueIsNotNull()
	{
		return this.accessiontestvalue != null;
	}
	public String getAccessionTestValue()
	{
		return this.accessiontestvalue;
	}
	public static int getAccessionTestValueMaxLength()
	{
		return 20;
	}
	public void setAccessionTestValue(String value)
	{
		this.isValidated = false;
		this.accessiontestvalue = value;
	}
	public boolean getPACSClientTypeIsNotNull()
	{
		return this.pacsclienttype != null;
	}
	public ims.core.vo.lookups.PACSClientType getPACSClientType()
	{
		return this.pacsclienttype;
	}
	public void setPACSClientType(ims.core.vo.lookups.PACSClientType value)
	{
		this.isValidated = false;
		this.pacsclienttype = value;
	}
	public boolean getUseLoggedUserNameIsNotNull()
	{
		return this.useloggedusername != null;
	}
	public Boolean getUseLoggedUserName()
	{
		return this.useloggedusername;
	}
	public void setUseLoggedUserName(Boolean value)
	{
		this.isValidated = false;
		this.useloggedusername = value;
	}
	public boolean getPrimaryIdentifierIsNotNull()
	{
		return this.primaryidentifier != null;
	}
	public ims.core.vo.lookups.PatIdType getPrimaryIdentifier()
	{
		return this.primaryidentifier;
	}
	public void setPrimaryIdentifier(ims.core.vo.lookups.PatIdType value)
	{
		this.isValidated = false;
		this.primaryidentifier = value;
	}
	public boolean getSecondaryIdentifierIsNotNull()
	{
		return this.secondaryidentifier != null;
	}
	public ims.core.vo.lookups.PatIdType getSecondaryIdentifier()
	{
		return this.secondaryidentifier;
	}
	public void setSecondaryIdentifier(ims.core.vo.lookups.PatIdType value)
	{
		this.isValidated = false;
		this.secondaryidentifier = value;
	}
	public boolean getPatientIdentifierParamIsNotNull()
	{
		return this.patientidentifierparam != null;
	}
	public String getPatientIdentifierParam()
	{
		return this.patientidentifierparam;
	}
	public static int getPatientIdentifierParamMaxLength()
	{
		return 50;
	}
	public void setPatientIdentifierParam(String value)
	{
		this.isValidated = false;
		this.patientidentifierparam = value;
	}
	public boolean getIssuerOfIdentifierParamIsNotNull()
	{
		return this.issuerofidentifierparam != null;
	}
	public String getIssuerOfIdentifierParam()
	{
		return this.issuerofidentifierparam;
	}
	public static int getIssuerOfIdentifierParamMaxLength()
	{
		return 50;
	}
	public void setIssuerOfIdentifierParam(String value)
	{
		this.isValidated = false;
		this.issuerofidentifierparam = value;
	}
	public boolean getSessionTimeParamIsNotNull()
	{
		return this.sessiontimeparam != null;
	}
	public String getSessionTimeParam()
	{
		return this.sessiontimeparam;
	}
	public static int getSessionTimeParamMaxLength()
	{
		return 50;
	}
	public void setSessionTimeParam(String value)
	{
		this.isValidated = false;
		this.sessiontimeparam = value;
	}
	public boolean getPrimaryIdentifierCodeIsNotNull()
	{
		return this.primaryidentifiercode != null;
	}
	public String getPrimaryIdentifierCode()
	{
		return this.primaryidentifiercode;
	}
	public static int getPrimaryIdentifierCodeMaxLength()
	{
		return 50;
	}
	public void setPrimaryIdentifierCode(String value)
	{
		this.isValidated = false;
		this.primaryidentifiercode = value;
	}
	public boolean getSecondaryIdentifierCodeIsNotNull()
	{
		return this.secondaryidentifiercode != null;
	}
	public String getSecondaryIdentifierCode()
	{
		return this.secondaryidentifiercode;
	}
	public static int getSecondaryIdentifierCodeMaxLength()
	{
		return 50;
	}
	public void setSecondaryIdentifierCode(String value)
	{
		this.isValidated = false;
		this.secondaryidentifiercode = value;
	}
	public boolean getAESKeyIsNotNull()
	{
		return this.aeskey != null;
	}
	public String getAESKey()
	{
		return this.aeskey;
	}
	public static int getAESKeyMaxLength()
	{
		return 1024;
	}
	public void setAESKey(String value)
	{
		this.isValidated = false;
		this.aeskey = value;
	}
	public boolean getUseEncryptedTokenIsNotNull()
	{
		return this.useencryptedtoken != null;
	}
	public Boolean getUseEncryptedToken()
	{
		return this.useencryptedtoken;
	}
	public void setUseEncryptedToken(Boolean value)
	{
		this.isValidated = false;
		this.useencryptedtoken = value;
	}
	public boolean getEncryptedTokenParamIsNotNull()
	{
		return this.encryptedtokenparam != null;
	}
	public String getEncryptedTokenParam()
	{
		return this.encryptedtokenparam;
	}
	public static int getEncryptedTokenParamMaxLength()
	{
		return 50;
	}
	public void setEncryptedTokenParam(String value)
	{
		this.isValidated = false;
		this.encryptedtokenparam = value;
	}
	/**
	* getURLWithTestAccessionNumber:
	*/
	public String getURLWithTestAccessionNumber()
	{
		StringBuffer sbURL = new StringBuffer();
			
		sbURL.append(this.getServerAddressIsNotNull() ? this.getServerAddress() : "");
		sbURL.append("&");
		sbURL.append(this.getUserNameParamIsNotNull() ? this.getUserNameParam() : "");
		sbURL.append(this.getUsernameIsNotNull() ? this.getUsername() : "");
		sbURL.append("&");
		sbURL.append(this.getPasswordParamIsNotNull() ? this.getPasswordParam() : "");
		sbURL.append(this.getPasswordIsNotNull() ? this.getPassword() : "");
		sbURL.append("&");
		sbURL.append(this.getAccessionParamIsNotNull() ? this.getAccessionParam() : "");
		sbURL.append(this.getAccessionTestValueIsNotNull() ? this.getAccessionTestValue() : "");
	
		return sbURL.toString();
	}
	/**
	* getURLWithoutTestAccessionNumber:
	*/
	public String getURLWithoutTestAccessionNumber()
	{
		StringBuffer sbURL = new StringBuffer();
			
		sbURL.append(this.getServerAddressIsNotNull() ? this.getServerAddress() : "");
		sbURL.append("&");
		sbURL.append(this.getUserNameParamIsNotNull() ? this.getUserNameParam() : "");
		sbURL.append(this.getUsernameIsNotNull() ? this.getUsername() : "");
		sbURL.append("&");
		sbURL.append(this.getPasswordParamIsNotNull() ? this.getPasswordParam() : "");
		sbURL.append(this.getPasswordIsNotNull() ? this.getPassword() : "");
		sbURL.append("&");
		sbURL.append(this.getAccessionParamIsNotNull() ? this.getAccessionParam() : "");
	
		return sbURL.toString();
	}
	
	/**
	* buildParameterList
	*/
		public String buildParameterList(String accessionNum,String userName,String identifierValue,String typeCode)
		{
			StringBuilder params = new StringBuilder();
			params.append(getUserNameParamIsNotNull() ? getUserNameParam() : "");
			
			if(getUseLoggedUserNameIsNotNull()
					&& getUseLoggedUserName().equals(true))
			{
				params.append(userName!=null?userName : "");
			}
			else
			{
				params.append(getUsernameIsNotNull() ? getUsername() : "");
			}
			if(getUseEncryptedToken()==null
					||getUseEncryptedToken().equals(false)
					&&getPasswordParam()!=null)
			{
				params.append("&");
				params.append(getPasswordParamIsNotNull() ? getPasswordParam() : "");
				params.append(getPasswordIsNotNull() ? getPassword() : "");
			}
			if(accessionNum!=null)
			{
				params.append("&");
				params.append(getAccessionParamIsNotNull()?getAccessionParam():"");
				params.append(accessionNum);
			}
			else
			{
				if(identifierValue!=null)
				{
					params.append("&");
					params.append(getPatientIdentifierParamIsNotNull()?getPatientIdentifierParam():"");
					params.append(identifierValue);
				}
				if(typeCode!=null)
				{
					params.append("&");
					params.append(getIssuerOfIdentifierParamIsNotNull()?getIssuerOfIdentifierParam():"");
					params.append(typeCode);
				}
			}
			if(getSessionTimeParamIsNotNull())
			{
				params.append("&");
				params.append(getSessionTimeParam());
				java.text.SimpleDateFormat formatter = new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
				params.append(formatter.format(new java.util.Date()) );
			}
			return params.toString();
	
		}
	
	public boolean isValidated()
	{
		if(this.isBusy)
			return true;
		this.isBusy = true;
	
		if(!this.isValidated)
		{
			this.isBusy = false;
			return false;
		}
		this.isBusy = false;
		return true;
	}
	public String[] validate()
	{
		return validate(null);
	}
	public String[] validate(String[] existingErrors)
	{
		if(this.isBusy)
			return null;
		this.isBusy = true;
	
		java.util.ArrayList<String> listOfErrors = new java.util.ArrayList<String>();
		if(existingErrors != null)
		{
			for(int x = 0; x < existingErrors.length; x++)
			{
				listOfErrors.add(existingErrors[x]);
			}
		}
		if(this.serveraddress == null || this.serveraddress.length() == 0)
			listOfErrors.add("ServerAddress is mandatory");
		else if(this.serveraddress.length() > 250)
			listOfErrors.add("The length of the field [serveraddress] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 250");
		if(this.usernameparam == null || this.usernameparam.length() == 0)
			listOfErrors.add("UserNameParam is mandatory");
		else if(this.usernameparam.length() > 50)
			listOfErrors.add("The length of the field [usernameparam] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.username != null)
			if(this.username.length() > 50)
				listOfErrors.add("The length of the field [username] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.passwordparam != null)
			if(this.passwordparam.length() > 50)
				listOfErrors.add("The length of the field [passwordparam] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.password != null)
			if(this.password.length() > 50)
				listOfErrors.add("The length of the field [password] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.accessionparam != null)
			if(this.accessionparam.length() > 50)
				listOfErrors.add("The length of the field [accessionparam] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.accessiontestvalue != null)
			if(this.accessiontestvalue.length() > 20)
				listOfErrors.add("The length of the field [accessiontestvalue] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 20");
		if(this.pacsclienttype == null)
			listOfErrors.add("PACSClientType is mandatory");
		if(this.patientidentifierparam != null)
			if(this.patientidentifierparam.length() > 50)
				listOfErrors.add("The length of the field [patientidentifierparam] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.issuerofidentifierparam != null)
			if(this.issuerofidentifierparam.length() > 50)
				listOfErrors.add("The length of the field [issuerofidentifierparam] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.sessiontimeparam != null)
			if(this.sessiontimeparam.length() > 50)
				listOfErrors.add("The length of the field [sessiontimeparam] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.primaryidentifiercode != null)
			if(this.primaryidentifiercode.length() > 50)
				listOfErrors.add("The length of the field [primaryidentifiercode] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.secondaryidentifiercode != null)
			if(this.secondaryidentifiercode.length() > 50)
				listOfErrors.add("The length of the field [secondaryidentifiercode] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		if(this.aeskey != null)
			if(this.aeskey.length() > 1024)
				listOfErrors.add("The length of the field [aeskey] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 1024");
		if(this.encryptedtokenparam != null)
			if(this.encryptedtokenparam.length() > 50)
				listOfErrors.add("The length of the field [encryptedtokenparam] in the value object [ims.core.vo.PacsConfigurationVo] is too big. It should be less or equal to 50");
		int errorCount = listOfErrors.size();
		if(errorCount == 0)
		{
			this.isBusy = false;
			this.isValidated = true;
			return null;
		}
		String[] result = new String[errorCount];
		for(int x = 0; x < errorCount; x++)
			result[x] = (String)listOfErrors.get(x);
		this.isBusy = false;
		this.isValidated = false;
		return result;
	}
	public void clearIDAndVersion()
	{
		this.id = null;
		this.version = 0;
	}
	public Object clone()
	{
		if(this.isBusy)
			return this;
		this.isBusy = true;
	
		PacsConfigurationVo clone = new PacsConfigurationVo(this.id, this.version);
		
		clone.serveraddress = this.serveraddress;
		clone.usernameparam = this.usernameparam;
		clone.username = this.username;
		clone.passwordparam = this.passwordparam;
		clone.password = this.password;
		clone.accessionparam = this.accessionparam;
		clone.accessiontestvalue = this.accessiontestvalue;
		if(this.pacsclienttype == null)
			clone.pacsclienttype = null;
		else
			clone.pacsclienttype = (ims.core.vo.lookups.PACSClientType)this.pacsclienttype.clone();
		clone.useloggedusername = this.useloggedusername;
		if(this.primaryidentifier == null)
			clone.primaryidentifier = null;
		else
			clone.primaryidentifier = (ims.core.vo.lookups.PatIdType)this.primaryidentifier.clone();
		if(this.secondaryidentifier == null)
			clone.secondaryidentifier = null;
		else
			clone.secondaryidentifier = (ims.core.vo.lookups.PatIdType)this.secondaryidentifier.clone();
		clone.patientidentifierparam = this.patientidentifierparam;
		clone.issuerofidentifierparam = this.issuerofidentifierparam;
		clone.sessiontimeparam = this.sessiontimeparam;
		clone.primaryidentifiercode = this.primaryidentifiercode;
		clone.secondaryidentifiercode = this.secondaryidentifiercode;
		clone.aeskey = this.aeskey;
		clone.useencryptedtoken = this.useencryptedtoken;
		clone.encryptedtokenparam = this.encryptedtokenparam;
		clone.isValidated = this.isValidated;
		
		this.isBusy = false;
		return clone;
	}
	public int compareTo(Object obj)
	{
		return compareTo(obj, true);
	}
	public int compareTo(Object obj, boolean caseInsensitive)
	{
		if (obj == null)
		{
			return -1;
		}
		if(caseInsensitive); // this is to avoid eclipse warning only.
		if (!(PacsConfigurationVo.class.isAssignableFrom(obj.getClass())))
		{
			throw new ClassCastException("A PacsConfigurationVo object cannot be compared an Object of type " + obj.getClass().getName());
		}
		if (this.id == null)
			return 1;
		if (((PacsConfigurationVo)obj).getBoId() == null)
			return -1;
		return this.id.compareTo(((PacsConfigurationVo)obj).getBoId());
	}
	public synchronized static int generateValueObjectUniqueID()
	{
		return ims.vo.ValueObject.generateUniqueID();
	}
	public int countFieldsWithValue()
	{
		int count = 0;
		if(this.serveraddress != null)
			count++;
		if(this.usernameparam != null)
			count++;
		if(this.username != null)
			count++;
		if(this.passwordparam != null)
			count++;
		if(this.password != null)
			count++;
		if(this.accessionparam != null)
			count++;
		if(this.accessiontestvalue != null)
			count++;
		if(this.pacsclienttype != null)
			count++;
		if(this.useloggedusername != null)
			count++;
		if(this.primaryidentifier != null)
			count++;
		if(this.secondaryidentifier != null)
			count++;
		if(this.patientidentifierparam != null)
			count++;
		if(this.issuerofidentifierparam != null)
			count++;
		if(this.sessiontimeparam != null)
			count++;
		if(this.primaryidentifiercode != null)
			count++;
		if(this.secondaryidentifiercode != null)
			count++;
		if(this.aeskey != null)
			count++;
		if(this.useencryptedtoken != null)
			count++;
		if(this.encryptedtokenparam != null)
			count++;
		return count;
	}
	public int countValueObjectFields()
	{
		return 19;
	}
	protected String serveraddress;
	protected String usernameparam;
	protected String username;
	protected String passwordparam;
	protected String password;
	protected String accessionparam;
	protected String accessiontestvalue;
	protected ims.core.vo.lookups.PACSClientType pacsclienttype;
	protected Boolean useloggedusername;
	protected ims.core.vo.lookups.PatIdType primaryidentifier;
	protected ims.core.vo.lookups.PatIdType secondaryidentifier;
	protected String patientidentifierparam;
	protected String issuerofidentifierparam;
	protected String sessiontimeparam;
	protected String primaryidentifiercode;
	protected String secondaryidentifiercode;
	protected String aeskey;
	protected Boolean useencryptedtoken;
	protected String encryptedtokenparam;
	private boolean isValidated = false;
	private boolean isBusy = false;
}
