Java Code Examples for ims.core.vo.PersonAddress.getLine1()

The following are Jave code examples for showing how to use getLine1() of the ims.core.vo.PersonAddress class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 5 votes
private String[] vallidateUI()//WDEV-23008
{
	List<String> uiErrors = new ArrayList<String>();
	//wdev-19232
	if( ConfigFlag.UI.SVUH_MANDATORY_DEMOGRAPHIC_ATTRIBUTES.getValue() == true )
	{
		if( form.txtNOKSName().getValue()==null || form.txtNOKSName().getValue().equals(""))
			uiErrors.add("NOK Surname is mandatory.");

		if( form.txtNOKForename().getValue()==null || form.txtNOKForename().getValue().equals(""))
			uiErrors.add("NOK Forename is mandatory.");

		if( form.cmbRelationship().getValue() == null)
		{
			uiErrors.add("NOK Relationship is mandatory.");
		}
		PersonAddress personAddress = form.ccAddressSearch().getValue();
		if( personAddress==null || personAddress.getLine1()==null || personAddress.getLine1()=="")
		{
			uiErrors.add("Please enter the first line of the Address.");
		}
	}
	else if(form.txtNOKSName().getValue()==null && isAddressRecorded())//WDEV-17185
	{
		uiErrors.add("NOK Surname is mandatory.");
		updateControlsState();//WDEV-17185
	}
	
	if(form.txtNOKSName().getValue()!= null && checkConsecutiveSpace(form.txtNOKSName().getValue()))
	{
		uiErrors.add("Please remove consecutive and or leading/trailing spaces in Surname");
	}
	if(form.txtNOKForename().getValue()!= null && checkConsecutiveSpace(form.txtNOKForename().getValue()))
	{
		uiErrors.add("Please remove consecutive and or leading/trailing spaces in Forename");
	}
	return  uiErrors.size() > 0 ? uiErrors.toArray(new String[uiErrors.size()]) : null;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private String displayPracticeAddress(PersonAddress address) 
{
	if(address == null)
		return "";
	
	String practiceAddress = "";
	
	if(address.getLine1IsNotNull() && address.getLine1().length() > 0)
	{
		practiceAddress += " - " + address.getLine1();
	}
	if(address.getLine2IsNotNull() && address.getLine2().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine2();
		}
		else
		{
			practiceAddress += " - " + address.getLine2();
		}
	}
	if(address.getLine3IsNotNull() && address.getLine3().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine3();
		}
		else
		{
			practiceAddress += " - " + address.getLine3();
		}
	}
	if(address.getLine4IsNotNull() && address.getLine4().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine4();
		}
		else
		{
			practiceAddress += " - " + address.getLine4();
		}
	}
	if(address.getLine5IsNotNull() && address.getLine5().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine5();
		}
		else
		{
			practiceAddress += " - " + address.getLine5();
		}
	}
	if(address.getCountyIsNotNull() && address.getCounty().getText() != null && address.getCounty().getText().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += ", " + address.getCounty().getText();
		}
		else
		{
			practiceAddress += " - " + address.getCounty().getText();
		}
	}
	
	return practiceAddress;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View Source Code Vote up 4 votes
private boolean hasAddressChanged(PersonAddress previousAddress)
{
	
	PersonAddress newAddress = form.ccAddressSearch().getValue();
	
	if(previousAddress==null || isEmptyAddress(previousAddress))
		return false;
	else if(newAddress==null)
		return true;
	
	if(previousAddress.getLine1()==null && newAddress.getLine1()==null)
		;
	else if((previousAddress.getLine1()!=null && newAddress.getLine1()==null) || (previousAddress.getLine1()==null && newAddress.getLine1()!=null))
		return true;
	else if(!previousAddress.getLine1().equals(newAddress.getLine1()))
			return true;
	
	if(previousAddress.getLine2()==null && newAddress.getLine2()==null)
		;
	else if((previousAddress.getLine2()!=null && newAddress.getLine2()==null) || (previousAddress.getLine2()==null && newAddress.getLine2()!=null))
		return true;
	else if(!previousAddress.getLine2().equals(newAddress.getLine2()))
			return true;
	
	if(previousAddress.getLine3()==null && newAddress.getLine3()==null)
		;
	else if((previousAddress.getLine3()!=null && newAddress.getLine3()==null) || (previousAddress.getLine3()==null && newAddress.getLine3()!=null))
		return true;
	else if(!previousAddress.getLine3().equals(newAddress.getLine3()))
			return true;
	
	if(previousAddress.getLine4()==null && newAddress.getLine4()==null)
		;
	else if((previousAddress.getLine4()!=null && newAddress.getLine4()==null) || (previousAddress.getLine4()==null && newAddress.getLine4()!=null))
		return true;
	else if(!previousAddress.getLine4().equals(newAddress.getLine4()))
			return true;
	
	if(previousAddress.getPostCode()==null && newAddress.getPostCode()==null)
		;
	else if((previousAddress.getPostCode()!=null && newAddress.getPostCode()==null) || (previousAddress.getPostCode()==null && newAddress.getPostCode()!=null))
		return true;
	else if(!previousAddress.getPostCode().equals(newAddress.getPostCode()))
			return true;

	
	return false;
}
 
Example 4
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private boolean hasAddressChanged(PersonAddress newAddress, PersonAddress previousAddress) 
{
	
	if (previousAddress == null || isEmptyAddress(previousAddress))
		return false;
	else if(newAddress == null)
		return true;
	
	if (previousAddress.getLine1() == null && newAddress.getLine1() == null)
						;
	else if ((previousAddress.getLine1() != null && newAddress.getLine1() == null)	|| (previousAddress.getLine1() == null && newAddress.getLine1() != null))
					return true;
	else if (!previousAddress.getLine1().equals(newAddress.getLine1()))
					return true;
	
	if (previousAddress.getLine2() == null && newAddress.getLine2() == null)
						;
	else if ((previousAddress.getLine2() != null && newAddress.getLine2() == null) || (previousAddress.getLine2() == null && newAddress.getLine2() != null))
					return true;
	else if (!previousAddress.getLine2().equals(newAddress.getLine2()))
					return true;
	
	if(previousAddress.getLine3() == null && newAddress.getLine3() == null)
						;
	else if ((previousAddress.getLine3() != null && newAddress.getLine3() == null) || (previousAddress.getLine3() == null && newAddress.getLine3() != null))
					return true;
	else if (!previousAddress.getLine3().equals(newAddress.getLine3()))
					return true;
	
	if(previousAddress.getLine4() == null && newAddress.getLine4() == null)
						;
	else if ((previousAddress.getLine4() != null && newAddress.getLine4() == null) || (previousAddress.getLine4() == null && newAddress.getLine4()!= null))
					return true;
	else if (!previousAddress.getLine4().equals(newAddress.getLine4()))
					return true;
	////WDEV-19137 ----------------------------------------------
	if(previousAddress.getLine5() == null && (newAddress.getLine5() == null || newAddress.getLine5().equals("")))		//wdev-19228
						;
	else if ((previousAddress.getLine5() != null && newAddress.getLine5() == null) || (previousAddress.getLine5() == null && newAddress.getLine5() != null))
					return true;
	else if (!previousAddress.getLine5().equals(newAddress.getLine5()))
					return true;
	
	if(previousAddress.getCounty() == null && newAddress.getCounty() == null)
						;
	else if ((previousAddress.getCounty() != null && newAddress.getCounty() == null) || (previousAddress.getCounty() == null && newAddress.getCounty() != null))
					return true;
	else if (!previousAddress.getCounty().equals(newAddress.getCounty()))
					return true;
	////WDEV-19137 ----------------------------------------------
	
	//WDEV-19597 -- Area Of Residence added
	if(previousAddress.getAreaOfResidence() == null && newAddress.getAreaOfResidence() == null)
						;
	else if ((previousAddress.getAreaOfResidence() != null && newAddress.getAreaOfResidence() == null) || (previousAddress.getAreaOfResidence() == null && newAddress.getAreaOfResidence() != null))
					return true;
	else if (!previousAddress.getAreaOfResidence().equals(newAddress.getAreaOfResidence()))
					return true;
	
	if (previousAddress.getPostCode() == null && newAddress.getPostCode() == null)
						;
	else if((previousAddress.getPostCode()!= null && newAddress.getPostCode() == null) || (previousAddress.getPostCode() == null && newAddress.getPostCode() != null))
					return true;
	else if (!previousAddress.getPostCode().replaceAll("[^a-zA-Z0-9]", "").equals(newAddress.getPostCode().replaceAll("[^a-zA-Z0-9]", "")))
					return true;
	
	//WDEV-22763		
	if(previousAddress.getCountry() == null && newAddress.getCountry() == null)
						;
	else if ((previousAddress.getCountry() != null && newAddress.getCountry() == null) || (previousAddress.getCountry() == null && newAddress.getCountry() != null))
					return true;
	else if (!previousAddress.getCountry().equals(newAddress.getCountry()))
					return true;
	//---------------------------
	return false;
}
 
Example 5
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private boolean hasAddressChanged(PersonAddress previousAddress) //WDEV-19137 Now includes check for County && Address Line 5 
{
	
	PersonAddress newAddress = form.ccAddressSearch().getValue();
	
	if (previousAddress == null || isEmptyAddress(previousAddress))
		return false;
	else if(newAddress == null)
		return true;
	
	if (previousAddress.getLine1() == null && newAddress.getLine1() == null)
						;
	else if ((previousAddress.getLine1() != null && newAddress.getLine1() == null)	|| (previousAddress.getLine1() == null && newAddress.getLine1() != null))
					return true;
	else if (!previousAddress.getLine1().equals(newAddress.getLine1()))
					return true;
	
	if (previousAddress.getLine2() == null && newAddress.getLine2() == null)
						;
	else if ((previousAddress.getLine2() != null && newAddress.getLine2() == null) || (previousAddress.getLine2() == null && newAddress.getLine2() != null))
					return true;
	else if (!previousAddress.getLine2().equals(newAddress.getLine2()))
					return true;
	
	if(previousAddress.getLine3() == null && newAddress.getLine3() == null)
						;
	else if ((previousAddress.getLine3() != null && newAddress.getLine3() == null) || (previousAddress.getLine3() == null && newAddress.getLine3() != null))
					return true;
	else if (!previousAddress.getLine3().equals(newAddress.getLine3()))
					return true;
	
	if(previousAddress.getLine4() == null && newAddress.getLine4() == null)
						;
	else if ((previousAddress.getLine4() != null && newAddress.getLine4() == null) || (previousAddress.getLine4() == null && newAddress.getLine4()!= null))
					return true;
	else if (!previousAddress.getLine4().equals(newAddress.getLine4()))
					return true;
	////WDEV-19137 ----------------------------------------------
	if(previousAddress.getLine5() == null && (newAddress.getLine5() == null || newAddress.getLine5().equals("")))		//wdev-19228
						;
	else if ((previousAddress.getLine5() != null && newAddress.getLine5() == null) || (previousAddress.getLine5() == null && newAddress.getLine5() != null))
					return true;
	else if (!previousAddress.getLine5().equals(newAddress.getLine5()))
					return true;
	
	if(previousAddress.getCounty() == null && newAddress.getCounty() == null)
						;
	else if ((previousAddress.getCounty() != null && newAddress.getCounty() == null) || (previousAddress.getCounty() == null && newAddress.getCounty() != null))
					return true;
	else if (!previousAddress.getCounty().equals(newAddress.getCounty()))
					return true;
	////WDEV-19137 ----------------------------------------------
	
	//WDEV-19597 -- Area Of Residence added
	if(previousAddress.getAreaOfResidence() == null && newAddress.getAreaOfResidence() == null)
						;
	else if ((previousAddress.getAreaOfResidence() != null && newAddress.getAreaOfResidence() == null) || (previousAddress.getAreaOfResidence() == null && newAddress.getAreaOfResidence() != null))
					return true;
	else if (!previousAddress.getAreaOfResidence().equals(newAddress.getAreaOfResidence()))
					return true;
	
	if (previousAddress.getPostCode() == null && newAddress.getPostCode() == null)
						;
	else if((previousAddress.getPostCode()!= null && newAddress.getPostCode() == null) || (previousAddress.getPostCode() == null && newAddress.getPostCode() != null))
					return true;
	else if (!previousAddress.getPostCode().replaceAll("[^a-zA-Z0-9]", "").equals(newAddress.getPostCode().replaceAll("[^a-zA-Z0-9]", "")))
					return true;
	//---------------------------	
	return false;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private String displayGP(GpShortVo gp)
{
	if (gp == null)
		return null;
	
	if (gp.getName() == null)
		return null;
	
	String value = gp.getName().toString();
	
	if (gp.getPracticesIsNotNull())
	{
		GpToPracticesVoCollection practices = gp.getPractices();
		
		for (int i = 0; i < practices.size(); i++)
		{
			if (practices.get(i) == null)
				continue;
			
			if (!Boolean.TRUE.equals(practices.get(i).getIsPrimaryPractice()))
				continue;
			
			OrganisationWithSitesVo practice = practices.get(i).getPractice();
			
			if (practice == null)
				continue;
			
			if (practice.getName() == null)
				continue;
			
			value += ", " + practice.getName();
			
			PersonAddress address = practice.getAddress();
			if (address == null)
				continue;
			
			String addressString = ((address.getLine1() == null || PersonAddress.getLine1MaxLength() == 0)? "" : (address.getLine1()))
								 + ((address.getLine2() == null || PersonAddress.getLine2MaxLength() == 0)? "" : (" " + address.getLine2()))
								 + ((address.getLine3() == null || PersonAddress.getLine3MaxLength() == 0)? "" : (" " + address.getLine3()))
								 + ((address.getLine4() == null || PersonAddress.getLine4MaxLength() == 0)? "" : (" " + address.getLine4()))
								 + ((address.getLine5() == null || PersonAddress.getLine5MaxLength() == 0)? "" : (" " + address.getLine5()))
								 + ((address.getCounty() == null)? "" : (", " + address.getCounty().toString())); 
			
			value += ", " + addressString;
		}
	}
			
	return value;
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private String displayPracticeAddress(PersonAddress address) 
{
	if(address == null)
		return "";
	
	String practiceAddress = "";
	
	if(address.getLine1IsNotNull() && address.getLine1().length() > 0)
	{
		practiceAddress += " - " + address.getLine1();
	}
	if(address.getLine2IsNotNull() && address.getLine2().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine2();
		}
		else
		{
			practiceAddress += " - " + address.getLine2();
		}
	}
	if(address.getLine3IsNotNull() && address.getLine3().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine3();
		}
		else
		{
			practiceAddress += " - " + address.getLine3();
		}
	}
	if(address.getLine4IsNotNull() && address.getLine4().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine4();
		}
		else
		{
			practiceAddress += " - " + address.getLine4();
		}
	}
	if(address.getLine5IsNotNull() && address.getLine5().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine5();
		}
		else
		{
			practiceAddress += " - " + address.getLine5();
		}
	}
	if(address.getCountyIsNotNull() && address.getCounty().getText() != null && address.getCounty().getText().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += ", " + address.getCounty().getText();
		}
		else
		{
			practiceAddress += " - " + address.getCounty().getText();
		}
	}
	
	return practiceAddress;
}
 
Example 8
Project: openMAXIMS   File: Logic.java   View Source Code Vote up 4 votes
private boolean hasAddressChanged(PersonAddress previousAddress)
{
	
	PersonAddress newAddress = form.ccAddressSearch().getValue();
	
	if(previousAddress==null || isEmptyAddress(previousAddress))
		return false;
	else if(newAddress==null)
		return true;
	
	if(previousAddress.getLine1()==null && newAddress.getLine1()==null)
		;
	else if((previousAddress.getLine1()!=null && newAddress.getLine1()==null) || (previousAddress.getLine1()==null && newAddress.getLine1()!=null))
		return true;
	else if(!previousAddress.getLine1().equals(newAddress.getLine1()))
			return true;
	
	if(previousAddress.getLine2()==null && newAddress.getLine2()==null)
		;
	else if((previousAddress.getLine2()!=null && newAddress.getLine2()==null) || (previousAddress.getLine2()==null && newAddress.getLine2()!=null))
		return true;
	else if(!previousAddress.getLine2().equals(newAddress.getLine2()))
			return true;
	
	if(previousAddress.getLine3()==null && newAddress.getLine3()==null)
		;
	else if((previousAddress.getLine3()!=null && newAddress.getLine3()==null) || (previousAddress.getLine3()==null && newAddress.getLine3()!=null))
		return true;
	else if(!previousAddress.getLine3().equals(newAddress.getLine3()))
			return true;
	
	if(previousAddress.getLine4()==null && newAddress.getLine4()==null)
		;
	else if((previousAddress.getLine4()!=null && newAddress.getLine4()==null) || (previousAddress.getLine4()==null && newAddress.getLine4()!=null))
		return true;
	else if(!previousAddress.getLine4().equals(newAddress.getLine4()))
			return true;
	
	if(previousAddress.getPostCode()==null && newAddress.getPostCode()==null)
		;
	else if((previousAddress.getPostCode()!=null && newAddress.getPostCode()==null) || (previousAddress.getPostCode()==null && newAddress.getPostCode()!=null))
		return true;
	else if(!previousAddress.getPostCode().equals(newAddress.getPostCode()))
			return true;

	
	return false;
}
 
Example 9
Project: openmaxims-linux   File: Logic.java   View Source Code Vote up 4 votes
private String displayPracticeAddress(PersonAddress address) 
{
	if(address == null)
		return "";
	
	String practiceAddress = "";
	
	if(address.getLine1IsNotNull() && address.getLine1().length() > 0)
	{
		practiceAddress += " - " + address.getLine1();
	}
	if(address.getLine2IsNotNull() && address.getLine2().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine2();
		}
		else
		{
			practiceAddress += " - " + address.getLine2();
		}
	}
	if(address.getLine3IsNotNull() && address.getLine3().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine3();
		}
		else
		{
			practiceAddress += " - " + address.getLine3();
		}
	}
	if(address.getLine4IsNotNull() && address.getLine4().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine4();
		}
		else
		{
			practiceAddress += " - " + address.getLine4();
		}
	}
	if(address.getLine5IsNotNull() && address.getLine5().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += " " + address.getLine5();
		}
		else
		{
			practiceAddress += " - " + address.getLine5();
		}
	}
	if(address.getCountyIsNotNull() && address.getCounty().getText() != null && address.getCounty().getText().length() > 0)
	{
		if(practiceAddress.length() > 0)
		{
			practiceAddress += ", " + address.getCounty().getText();
		}
		else
		{
			practiceAddress += " - " + address.getCounty().getText();
		}
	}
	
	return practiceAddress;
}
 
Example 10
Project: openmaxims-linux   File: Logic.java   View Source Code Vote up 4 votes
private boolean hasAddressChanged(PersonAddress previousAddress)
{
	
	PersonAddress newAddress = form.ccAddressSearch().getValue();
	
	if(previousAddress==null || isEmptyAddress(previousAddress))
		return false;
	else if(newAddress==null)
		return true;
	
	if(previousAddress.getLine1()==null && newAddress.getLine1()==null)
		;
	else if((previousAddress.getLine1()!=null && newAddress.getLine1()==null) || (previousAddress.getLine1()==null && newAddress.getLine1()!=null))
		return true;
	else if(!previousAddress.getLine1().equals(newAddress.getLine1()))
			return true;
	
	if(previousAddress.getLine2()==null && newAddress.getLine2()==null)
		;
	else if((previousAddress.getLine2()!=null && newAddress.getLine2()==null) || (previousAddress.getLine2()==null && newAddress.getLine2()!=null))
		return true;
	else if(!previousAddress.getLine2().equals(newAddress.getLine2()))
			return true;
	
	if(previousAddress.getLine3()==null && newAddress.getLine3()==null)
		;
	else if((previousAddress.getLine3()!=null && newAddress.getLine3()==null) || (previousAddress.getLine3()==null && newAddress.getLine3()!=null))
		return true;
	else if(!previousAddress.getLine3().equals(newAddress.getLine3()))
			return true;
	
	if(previousAddress.getLine4()==null && newAddress.getLine4()==null)
		;
	else if((previousAddress.getLine4()!=null && newAddress.getLine4()==null) || (previousAddress.getLine4()==null && newAddress.getLine4()!=null))
		return true;
	else if(!previousAddress.getLine4().equals(newAddress.getLine4()))
			return true;
	
	if(previousAddress.getPostCode()==null && newAddress.getPostCode()==null)
		;
	else if((previousAddress.getPostCode()!=null && newAddress.getPostCode()==null) || (previousAddress.getPostCode()==null && newAddress.getPostCode()!=null))
		return true;
	else if(!previousAddress.getPostCode().equals(newAddress.getPostCode()))
			return true;

	
	return false;
}