Java Code Examples for ims.core.vo.PersonNameCollection

The following are top voted examples for showing how to use ims.core.vo.PersonNameCollection. 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: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void populateScreenFromData(Object[] args, PersonNameCollection names)
{
	if(names != null)
	{
   		for(int i = 0; i < names.size(); i++)
   		{
   			PersonName name = names.get(i);
   			
   			addGridRow(name);
   		}
	}
	
	if(args != null && args.length > 0)
	{
		if(args.length > 1 && args[1] instanceof Boolean)
		{
			form.getLocalContext().setCanAddOrEdit((Boolean) args[1]);
		}

		if(args[0] instanceof FormMode)
		{
			form.setMode((FormMode) args[0]);
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	if (form.getGlobalContext().Core.getOtherNamesIsNotNull())	
	{
		PersonNameCollection names = form.getGlobalContext().Core.getOtherNames();
	
		GenForm.grdNamesRow row;

		if (names != null)
		{
			for (int i = 0; i < names.size(); i++)
			{
				ims.core.vo.PersonName name = names.get(i);

				row = form.grdNames().getRows().newRow();
				
				if (name.getNameTypeIsNotNull())
					row.setcolNameType(name.getNameType().getText());
				
				if (name.getForenameIsNotNull()) //WDEV-14050 
					{
					row.setcolName(name.getForename() + " " + name.getSurname());
					}
				else row.setcolName(name.getSurname());
				
			}
		}
	}
	
	// Unless using local patient registration, this form should go to view mode only
	if (!ConfigFlag.DOM.LOCAL_PATIENT_REGISTRATION.getValue() || form.getGlobalContext().Core.getParentFormMode().equals(FormMode.VIEW))
		form.setMode(FormMode.VIEW);	
}
 
Example 3
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	if (form.getGlobalContext().Core.getOtherNamesIsNotNull())	
	{
		PersonNameCollection names = form.getGlobalContext().Core.getOtherNames();
	
		GenForm.grdNamesRow row;

		if (names != null)
		{
			for (int i = 0; i < names.size(); i++)
			{
				ims.core.vo.PersonName name = names.get(i);

				row = form.grdNames().getRows().newRow();
				
				if (name.getNameTypeIsNotNull())
					row.setcolNameType(name.getNameType().getText());
				
				if (name.getForenameIsNotNull()) //WDEV-14050 
					{
					row.setcolName(name.getForename() + " " + name.getSurname());
					}
				else row.setcolName(name.getSurname());
				
			}
		}
	}
	
	// Unless using local patient registration, this form should go to view mode only
	if (!ConfigFlag.DOM.LOCAL_PATIENT_REGISTRATION.getValue() || form.getGlobalContext().Core.getParentFormMode().equals(FormMode.VIEW))
		form.setMode(FormMode.VIEW);	
}
 
Example 4
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
@Override
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	if(populateDataFromScreen())
	{
		PersonName name = form.getLocalContext().getAddedItem();
		
		if(name != null)
		{
			//newly added
			if(form.getGlobalContext().Core.getOtherNames() == null)
				form.getGlobalContext().Core.setOtherNames(new PersonNameCollection());
				
			form.getGlobalContext().Core.getOtherNames().add(name);
			
			addGridRow(name);
		}
		else
		{
			name = form.getLocalContext().getEditedItem();
			
			//edited
			grdNamesRow row = form.grdNames().getSelectedRow();
			row.setcolSurname(name.getSurname());
			row.setcolForename(name.getForename());
			row.setcolNameType(name.getNameType());
		}
		
		form.setMode(FormMode.VIEW);
		form.grdNames().setValue(name);
	}
	
	updateControlsStatus();
}
 
Example 5
Project: openMAXIMS   File: PdsPatientUpdateHelper.java   View source code 5 votes vote down vote up
private PersonName getNameByObjectIdentifier(String objectidentifier, PersonNameCollection otherNames)
{
	if(otherNames == null || objectidentifier == null)
		return null;
	
	for(PersonName pn :  otherNames)
	{
		if(objectidentifier.equals(pn.getObjectidentifier()))
			return pn;
	}
	
	return null;
}
 
Example 6
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	if (form.getGlobalContext().Core.getOtherNamesIsNotNull())	
	{
		PersonNameCollection names = form.getGlobalContext().Core.getOtherNames();
	
		GenForm.grdNamesRow row;

		if (names != null)
		{
			for (int i = 0; i < names.size(); i++)
			{
				ims.core.vo.PersonName name = names.get(i);

				row = form.grdNames().getRows().newRow();
				
				if (name.getNameTypeIsNotNull())
					row.setcolNameType(name.getNameType().getText());
				
				if (name.getForenameIsNotNull()) //WDEV-14050 
					{
					row.setcolName(name.getForename() + " " + name.getSurname());
					}
				else row.setcolName(name.getSurname());
				
			}
		}
	}
	
	// Unless using local patient registration, this form should go to view mode only
	if (!ConfigFlag.DOM.LOCAL_PATIENT_REGISTRATION.getValue() || form.getGlobalContext().Core.getParentFormMode().equals(FormMode.VIEW))
		form.setMode(FormMode.VIEW);	
}
 
Example 7
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
protected void onFormOpen() throws ims.framework.exceptions.FormOpenException
{
	if (form.getGlobalContext().Core.getOtherNamesIsNotNull())	
	{
		PersonNameCollection names = form.getGlobalContext().Core.getOtherNames();
	
		GenForm.grdNamesRow row;

		if (names != null)
		{
			for (int i = 0; i < names.size(); i++)
			{
				ims.core.vo.PersonName name = names.get(i);

				row = form.grdNames().getRows().newRow();
				
				if (name.getNameTypeIsNotNull())
					row.setcolNameType(name.getNameType().getText());
				
				if (name.getForenameIsNotNull()) //WDEV-14050 
					{
					row.setcolName(name.getForename() + " " + name.getSurname());
					}
				else row.setcolName(name.getSurname());
				
			}
		}
	}
	
	// Unless using local patient registration, this form should go to view mode only
	if (!ConfigFlag.DOM.LOCAL_PATIENT_REGISTRATION.getValue() || form.getGlobalContext().Core.getParentFormMode().equals(FormMode.VIEW))
		form.setMode(FormMode.VIEW);	
}