Java Code Examples for ims.core.vo.ClinicLiteVo

The following are top voted examples for showing how to use ims.core.vo.ClinicLiteVo. 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: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
	// Leave throws so that clinics are not cleared when an invalid search is made
	if (clinicName == null || clinicName.trim().length() < 3)
		throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");
	

	// Build filtering VO
	ClinicLiteVo filterVo = new ClinicLiteVo();
	filterVo.setClinicName(clinicName);
	
	// Retrieve the clinics (list from domain)
	try
	{
		return domain.listClinics(filterVo);
	}
	catch (DomainInterfaceException exception)
	{
		throw new CodingRuntimeException(exception.getMessage());
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
	// Leave throws so that clinics are not cleared when an invalid search is made
	if (clinicName == null || clinicName.trim().length() < 3)
		throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");
	
	
	// Build filtering VO
	ClinicLiteVo filterVo = new ClinicLiteVo();
	filterVo.setClinicName(clinicName);
	
	// Retrieve the clinics (list from domain)
	try
	{
		return domain.listClinics(filterVo);
	}
	catch (DomainInterfaceException exception)
	{
		throw new CodingRuntimeException(exception.getMessage());
	}
	
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onQmbClinicTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
	if(!(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue() instanceof ILocation))
		return;
	
	ClinicLiteVoCollection clinics = domain.listClinicsforLocation(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue().getID(), value);
	
	form.lyrLetterCreate().tabClinicList().qmbClinic().clear();
	
	if(clinics == null || clinics.size() == 0)
		return;
	
	for(int i=0; i<clinics.size(); i++)
	{
		ClinicLiteVo clinic = clinics.get(i);
		
		if(clinic == null)
			continue;
		
		form.lyrLetterCreate().tabClinicList().qmbClinic().newRow(clinic, clinic.getClinicName());
	}
	
	if(clinics.size() > 0)
		form.lyrLetterCreate().tabClinicList().qmbClinic().showOpened();
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
/**
 * Event fired when a selection is made on the tree
 * @param TreeNode node
 * @throws PresentationLogicException
 */
protected void onTreClinicsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
	form.TaxonomyMappings().setComponentMode(FormMode.VIEW);
	clearInstanceDetails();
	form.getLocalContext().setSelectedRecord(null);
	
	if (node.getValue() != null && node.getValue() instanceof ClinicLiteVo)
	{
		ClinicVo clin = domain.getClinic((ClinicLiteVo)node.getValue());
		form.getLocalContext().setSelectedRecord(clin);
		populateInstanceControl(clin);
		form.TaxonomyMappings().setValue(clin.getCodeMappings());
	}
	updateControlsState();
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void setDepartmentValue()
{
	if (form.lyrDetails().tabGenDetails().qmbLocation().getValue() instanceof ClinicLiteVo)
	{
		LocationLiteVo department = domain.getOutpatientDepartmentByClinic((ClinicLiteVo) form.lyrDetails().tabGenDetails().qmbLocation().getValue());

		if (department == null)
			return;

		// WDEV-13890
		if (!form.lyrDetails().tabGenDetails().cmbDepartment().getValues().contains(department))
		{
			form.lyrDetails().tabGenDetails().cmbDepartment().newRow(department, department.getName());
		}
		form.lyrDetails().tabGenDetails().cmbDepartment().setValue(department);
	}
}
 
Example 6
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
	// Leave throws so that clinics are not cleared when an invalid search is made
	if (clinicName == null || clinicName.trim().length() < 3)
		throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");
	

	// Build filtering VO
	ClinicLiteVo filterVo = new ClinicLiteVo();
	filterVo.setClinicName(clinicName);
	
	// Retrieve the clinics (list from domain)
	try
	{
		return domain.listClinics(filterVo);
	}
	catch (DomainInterfaceException exception)
	{
		throw new CodingRuntimeException(exception.getMessage());
	}
}
 
Example 7
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
	// Leave throws so that clinics are not cleared when an invalid search is made
	if (clinicName == null || clinicName.trim().length() < 3)
		throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");
	
	
	// Build filtering VO
	ClinicLiteVo filterVo = new ClinicLiteVo();
	filterVo.setClinicName(clinicName);
	
	// Retrieve the clinics (list from domain)
	try
	{
		return domain.listClinics(filterVo);
	}
	catch (DomainInterfaceException exception)
	{
		throw new CodingRuntimeException(exception.getMessage());
	}
	
}
 
Example 8
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onQmbClinicTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
	if(!(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue() instanceof ILocation))
		return;
	
	ClinicLiteVoCollection clinics = domain.listClinicsforLocation(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue().getID(), value);
	
	form.lyrLetterCreate().tabClinicList().qmbClinic().clear();
	
	if(clinics == null || clinics.size() == 0)
		return;
	
	for(int i=0; i<clinics.size(); i++)
	{
		ClinicLiteVo clinic = clinics.get(i);
		
		if(clinic == null)
			continue;
		
		form.lyrLetterCreate().tabClinicList().qmbClinic().newRow(clinic, clinic.getClinicName());
	}
	
	if(clinics.size() > 0)
		form.lyrLetterCreate().tabClinicList().qmbClinic().showOpened();
}
 
Example 9
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
/**
 * Event fired when a selection is made on the tree
 * @param TreeNode node
 * @throws PresentationLogicException
 */
protected void onTreClinicsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
	form.TaxonomyMappings().setComponentMode(FormMode.VIEW);
	clearInstanceDetails();
	form.getLocalContext().setSelectedRecord(null);
	
	if (node.getValue() != null && node.getValue() instanceof ClinicLiteVo)
	{
		ClinicVo clin = domain.getClinic((ClinicLiteVo)node.getValue());
		form.getLocalContext().setSelectedRecord(clin);
		populateInstanceControl(clin);
		form.TaxonomyMappings().setValue(clin.getCodeMappings());
	}
	updateControlsState();
}
 
Example 10
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private OrdersRequiringAuthorisationSearchCriteriaVo getSearchCriteria()
{
	OrdersRequiringAuthorisationSearchCriteriaVo searchCriteria = new OrdersRequiringAuthorisationSearchCriteriaVo();
	
	searchCriteria.setFromDate(form.dteFrom().getValue());
	searchCriteria.setToDate(form.dteTo().getValue());

	searchCriteria.setHospital(form.cmbHospital().getValue());
	searchCriteria.setLoctype(getLocationType());
	
	if(form.grpPatientLocation().getValue().equals(grpPatientLocationEnumeration.rdoClinic))
		searchCriteria.setPatientClinic((ClinicLiteVo) form.qmbPatLocation().getValue());
	else
		searchCriteria.setPatientLocation((LocationLiteVo) form.qmbPatLocation().getValue());
	
	searchCriteria.setRespClinician(form.qmbRespClinician().getValue());
	
	return searchCriteria;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void setDepartmentValue()
{
	if (form.lyrDetails().tabGenDetails().qmbLocation().getValue() instanceof ClinicLiteVo)
	{
		LocationLiteVo department = domain.getOutpatientDepartmentByClinic((ClinicLiteVo) form.lyrDetails().tabGenDetails().qmbLocation().getValue());

		if (department == null)
			return;

		// WDEV-13890
		if (!form.lyrDetails().tabGenDetails().cmbDepartment().getValues().contains(department))
		{
			form.lyrDetails().tabGenDetails().cmbDepartment().newRow(department, department.getName());
		}
		form.lyrDetails().tabGenDetails().cmbDepartment().setValue(department);
	}
}
 
Example 12
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
	// Leave throws so that clinics are not cleared when an invalid search is made
	if (clinicName == null || clinicName.trim().length() < 3)
		throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");
	

	// Build filtering VO
	ClinicLiteVo filterVo = new ClinicLiteVo();
	filterVo.setClinicName(clinicName);
	
	// Retrieve the clinics (list from domain)
	try
	{
		return domain.listClinics(filterVo);
	}
	catch (DomainInterfaceException exception)
	{
		throw new CodingRuntimeException(exception.getMessage());
	}
}
 
Example 13
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
	// Leave throws so that clinics are not cleared when an invalid search is made
	if (clinicName == null || clinicName.trim().length() < 3)
		throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");
	
	
	// Build filtering VO
	ClinicLiteVo filterVo = new ClinicLiteVo();
	filterVo.setClinicName(clinicName);
	
	// Retrieve the clinics (list from domain)
	try
	{
		return domain.listClinics(filterVo);
	}
	catch (DomainInterfaceException exception)
	{
		throw new CodingRuntimeException(exception.getMessage());
	}
	
}
 
Example 14
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onQmbClinicTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
	if(!(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue() instanceof ILocation))
		return;
	
	ClinicLiteVoCollection clinics = domain.listClinicsforLocation(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue().getID(), value);
	
	form.lyrLetterCreate().tabClinicList().qmbClinic().clear();
	
	if(clinics == null || clinics.size() == 0)
		return;
	
	for(int i=0; i<clinics.size(); i++)
	{
		ClinicLiteVo clinic = clinics.get(i);
		
		if(clinic == null)
			continue;
		
		form.lyrLetterCreate().tabClinicList().qmbClinic().newRow(clinic, clinic.getClinicName());
	}
	
	if(clinics.size() > 0)
		form.lyrLetterCreate().tabClinicList().qmbClinic().showOpened();
}
 
Example 15
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
/**
 * Event fired when a selection is made on the tree
 * @param TreeNode node
 * @throws PresentationLogicException
 */
protected void onTreClinicsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
	form.TaxonomyMappings().setComponentMode(FormMode.VIEW);
	clearInstanceDetails();
	form.getLocalContext().setSelectedRecord(null);
	
	if (node.getValue() != null && node.getValue() instanceof ClinicLiteVo)
	{
		ClinicVo clin = domain.getClinic((ClinicLiteVo)node.getValue());
		form.getLocalContext().setSelectedRecord(clin);
		populateInstanceControl(clin);
		form.TaxonomyMappings().setValue(clin.getCodeMappings());
	}
	updateControlsState();
}
 
Example 16
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void setDepartmentValue()
{
	if (form.lyrDetails().tabGenDetails().qmbLocation().getValue() instanceof ClinicLiteVo)
	{
		LocationLiteVo department = domain.getOutpatientDepartmentByClinic((ClinicLiteVo) form.lyrDetails().tabGenDetails().qmbLocation().getValue());

		if (department == null)
			return;

		// WDEV-13890
		if (!form.lyrDetails().tabGenDetails().cmbDepartment().getValues().contains(department))
		{
			form.lyrDetails().tabGenDetails().cmbDepartment().newRow(department, department.getName());
		}
		form.lyrDetails().tabGenDetails().cmbDepartment().setValue(department);
	}
}
 
Example 17
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
	// Leave throws so that clinics are not cleared when an invalid search is made
	if (clinicName == null || clinicName.trim().length() < 3)
		throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");
	

	// Build filtering VO
	ClinicLiteVo filterVo = new ClinicLiteVo();
	filterVo.setClinicName(clinicName);
	
	// Retrieve the clinics (list from domain)
	try
	{
		return domain.listClinics(filterVo);
	}
	catch (DomainInterfaceException exception)
	{
		throw new CodingRuntimeException(exception.getMessage());
	}
}
 
Example 18
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private ClinicLiteVoCollection listClinicsByName(String clinicName) throws CodingRuntimeException
{
	// Leave throws so that clinics are not cleared when an invalid search is made
	if (clinicName == null || clinicName.trim().length() < 3)
		throw new CodingRuntimeException("Clinic name search must be at least 3 characters long");
	
	
	// Build filtering VO
	ClinicLiteVo filterVo = new ClinicLiteVo();
	filterVo.setClinicName(clinicName);
	
	// Retrieve the clinics (list from domain)
	try
	{
		return domain.listClinics(filterVo);
	}
	catch (DomainInterfaceException exception)
	{
		throw new CodingRuntimeException(exception.getMessage());
	}
	
}
 
Example 19
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
@Override
protected void onQmbClinicTextSubmited(String value) throws ims.framework.exceptions.PresentationLogicException
{
	if(!(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue() instanceof ILocation))
		return;
	
	ClinicLiteVoCollection clinics = domain.listClinicsforLocation(form.lyrLetterCreate().tabClinicList().cmbLocation().getValue().getID(), value);
	
	form.lyrLetterCreate().tabClinicList().qmbClinic().clear();
	
	if(clinics == null || clinics.size() == 0)
		return;
	
	for(int i=0; i<clinics.size(); i++)
	{
		ClinicLiteVo clinic = clinics.get(i);
		
		if(clinic == null)
			continue;
		
		form.lyrLetterCreate().tabClinicList().qmbClinic().newRow(clinic, clinic.getClinicName());
	}
	
	if(clinics.size() > 0)
		form.lyrLetterCreate().tabClinicList().qmbClinic().showOpened();
}
 
Example 20
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
/**
 * Event fired when a selection is made on the tree
 * @param TreeNode node
 * @throws PresentationLogicException
 */
protected void onTreClinicsTreeViewSelectionChanged(TreeNode node) throws PresentationLogicException
{
	form.TaxonomyMappings().setComponentMode(FormMode.VIEW);
	clearInstanceDetails();
	form.getLocalContext().setSelectedRecord(null);
	
	if (node.getValue() != null && node.getValue() instanceof ClinicLiteVo)
	{
		ClinicVo clin = domain.getClinic((ClinicLiteVo)node.getValue());
		form.getLocalContext().setSelectedRecord(clin);
		populateInstanceControl(clin);
		form.TaxonomyMappings().setValue(clin.getCodeMappings());
	}
	updateControlsState();
}
 
Example 21
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void setDepartmentValue()
{
	if (form.lyrDetails().tabGenDetails().qmbLocation().getValue() instanceof ClinicLiteVo)
	{
		LocationLiteVo department = domain.getOutpatientDepartmentByClinic((ClinicLiteVo) form.lyrDetails().tabGenDetails().qmbLocation().getValue());

		if (department == null)
			return;

		// WDEV-13890
		if (!form.lyrDetails().tabGenDetails().cmbDepartment().getValues().contains(department))
		{
			form.lyrDetails().tabGenDetails().cmbDepartment().newRow(department, department.getName());
		}
		form.lyrDetails().tabGenDetails().cmbDepartment().setValue(department);
	}
}
 
Example 22
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void newClinicAssociationRow(DynamicGridRow parrentRow, ClinicLiteVo clinic)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add clinical association row to a null parrent row");
	
	if (clinic == null)
		return;
	
	
	DynamicGridCell newCell;
	DynamicGridColumn column;
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow();
	newRow.setValue(clinic);
	
	// Create the first cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Clinic01);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(clinic.getClinicName());
	newCell.setReadOnly(true);
}
 
Example 23
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void newClinicAssociation(DynamicGridRow parrentRow)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a CLINIC association to a null parrent row");
	
	if (!(parrentRow.getValue() instanceof AssociationCategory) || ((AssociationCategory) parrentRow.getValue()) != AssociationCategory.CLINICS)
		throw new CodingRuntimeException("Logical Error - Function must be called from CLINICS category row only");
	

	parrentRow.setExpanded(true);
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow(true);
	newRow.setValue(new ClinicLiteVo());
	form.dyngrdAssociations().resetScrollPosition();
	
	// Declare a new cell
	DynamicGridCell newCell;
	// Column identifier
	DynamicGridColumn column;
	
	// Create the first cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Clinic01);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.QUERYCOMBOBOX);
	newCell.setAutoPostBack(true);
}
 
Example 24
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void updateClinicAssociationRowValue(DynamicGridRow row)
{
	if (row == null
		|| (row.getParent() == null)
		|| (!(row.getParent().getValue() instanceof AssociationCategory))
		|| (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.CLINICS))
		throw new CodingRuntimeException("Major Logical Failure");
	
	if (row.getValue() == null)
		row.setValue(new ClinicLiteVo());
	
	if (!(row.getValue() instanceof ClinicLiteVo))
		throw new CodingRuntimeException("Major Logical Error - Clinic value expected");
	

	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get the second cell value
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	cell = row.getCells().get(column);
	
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			row.setValue(null);
			cell.setTypedText(null);
		}
		else
			row.setValue((ClinicLiteVo) cell.getValue());
	}
}
 
Example 25
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void addClinicAssociationsToTemplate(ClinicLiteVoCollection clinics, DynamicGridRowCollection rows)
{
	// NOTE: DO NOT make clinics = new ClinicLiteVoCollection() in this function
	// clinics MUST ALWAYS reference the clinics in the TemplateAssociationVo
	
	if (rows == null)
		return;
	
	if (clinics == null)
		throw new CodingRuntimeException("Logical Error - Inserting values into null CLINICS collection");
	
	
	// Add the records from the grid
	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridRow row = rows.get(i);
		
		if (row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof ClinicLiteVo))
			throw new CodingRuntimeException("Major Logical Error - Non Clinical association added to CLINICS category association");
		
		updateClinicAssociationRowValue(row);
		
		ClinicLiteVo clinicAssociation = (ClinicLiteVo) row.getValue();
		
		if (clinicAssociation != null)
			clinics.add(clinicAssociation);
	}
}
 
Example 26
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean clinicNotOnScreen(ClinicLiteVo clinicLiteVo, DynamicGridRow parentRow) 
{
	for(int i=0; i<parentRow.getRows().size(); i++)
	{
		if(clinicLiteVo.equals(parentRow.getRows().get(i).getValue()))
				return false;
	}
	return true;
}
 
Example 27
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void populateRowClinic(DynamicGridRow childRow, ClinicLiteVo clinicLiteVo, boolean newClinic, boolean reviewClinic, boolean createRow) 
{
	if(createRow)
	{
		DynamicGridColumn column = null;
		DynamicGridCell cell = null;
		
		childRow.setValue(clinicLiteVo);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_IMAGE);
		cell = childRow.getCells().newCell(column, DynamicCellType.IMAGE);
		cell.setValue(form.getImages().Admin.Clinic01);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_HEADING);
		cell = childRow.getCells().newCell(column, DynamicCellType.STRING);
		cell.setReadOnly(true);
		cell.setValue(clinicLiteVo.getClinicName());
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE);
		cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
		engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
		cell.setAutoPostBack(false);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE);
		cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
		engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
		cell.setAutoPostBack(false);
	}
	
	if(newClinic)
	{
		childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
	}
	if(reviewClinic)
	{
		childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
	}
	
}
 
Example 28
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
public void updateControlsState()
{
	form.getContextMenus().Correspondence.getNoLetterIsRequiredADDItem().setVisible(form.getMode().equals(FormMode.EDIT) && form.dyngrdLetter().getValue() instanceof Correspondence);
	form.getContextMenus().Correspondence.getNoLetterIsRequiredREMOVEItem().setVisible(form.getMode().equals(FormMode.EDIT) 
			&& (form.dyngrdLetter().getValue() instanceof ClinicLiteVo 
					|| form.dyngrdLetter().getValue() instanceof Specialty
						|| form.dyngrdLetter().getValue() instanceof MedicLiteVo));
}
 
Example 29
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void removeInstance(DynamicGridRow selectedRow) 
{
	if(selectedRow.getValue() instanceof ClinicLiteVo 
			|| selectedRow.getValue() instanceof Specialty
				|| selectedRow.getValue() instanceof MedicLiteVo)
	{
		form.dyngrdLetter().getRows().remove(selectedRow);
	}
}
 
Example 30
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void updateClinicAccessRowValue(DynamicGridRow row)
{
	DynamicGridColumn column;
	DynamicGridCell cell;
	
	if (row == null || (row.getParent() == null) || (!(row.getParent().getValue() instanceof AccessCategory)) || (((AccessCategory)row.getParent().getValue()) != AccessCategory.CLINICS))
		throw new CodingRuntimeException("Major Logical Error");
	
	if (row.getValue() == null)
		row.setValue(new ClinicAccessVo());
	
	if (!(row.getValue() instanceof ClinicAccessVo))
		throw new CodingRuntimeException("BUG");
	

	// Get second cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESS_CATEGORY);
	cell = row.getCells().get(column);
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			((ClinicAccessVo) row.getValue()).setClinic(null);
			cell.setTypedText(null);
		}
		else
		{
			((ClinicAccessVo) row.getValue()).setClinic((ClinicLiteVo) cell.getValue());
		}
	}
	
	// Get third cell value
	column = form.dyngrdDetails().getColumns().getByIdentifier(COL_ACCESSRIGHTS);
	cell = row.getCells().get(column);
	cell.getValue();
	((ClinicAccessVo) row.getValue()).setAccessRight((Access) cell.getValue());
}
 
Example 31
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private ClinicLiteVoCollection populateClinicInstanceData()
{
	ClinicLiteVoCollection voCollClinics = new ClinicLiteVoCollection();
	for (int i = 0; i < form.treAssociate().getNodes().size(); i++) 
	{
		if (form.treAssociate().getNodes().get(i).getValue() instanceof ClinicLiteVo
			&& form.treAssociate().getNodes().get(i).isChecked())
				voCollClinics.add((ClinicLiteVo) form.treAssociate().getNodes().get(i).getValue());			
	}
	
	return voCollClinics;
}
 
Example 32
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
/**
 * Update the control state of the form dependant on the FormMode, Config Flag and if a location\Hospital is selected
 */
private void updateControlsState()
{		
	boolean allowEdits = form.getMode().equals(FormMode.VIEW) && ConfigFlag.GEN.ALLOW_CLINIC_EDIT.getValue();
	boolean clinicSelected = (form.treClinics().getSelectedNode() != null && form.treClinics().getSelectedNode().getValue() instanceof ClinicLiteVo);
	boolean locationSelected = (form.treClinics().getSelectedNode() != null && form.treClinics().getSelectedNode().getValue() instanceof LocationLiteVo);
	
	form.btnUpdate().setVisible(allowEdits && clinicSelected);	
	form.btnNew().setVisible(allowEdits);	
	form.getContextMenus().getClinicNewItem().setVisible(allowEdits);
	form.getContextMenus().getClinicAddItem().setVisible(allowEdits && locationSelected);
	if (form.getContextMenus().getClinicAddItem().isVisible())
	{
		form.getContextMenus().getClinicAddItem().setText("Add New Clinic in " + ((LocationLiteVo)form.treClinics().getSelectedNode().getValue()).getName());
	}
	form.getContextMenus().getClinicUpdateItem().setVisible(allowEdits && clinicSelected);
	form.TaxonomyMappings().setComponentMode(form.getMode());	//WDEV-11914
	
	//WDEV-11914 - starts here
	if(FormMode.VIEW.equals(form.getMode()))
	{
		form.cmbSearchOutpatient().setEnabled(form.cmbSearchLoc().getValue() instanceof LocationLiteVo);
	}
	
	if(FormMode.EDIT.equals(form.getMode()))
	{
		form.cmbOutpatient().setEnabled(form.cmbClinicLoc().getValue() instanceof LocationLiteVo);
	}
	//WDEV-11914 - ends here
}
 
Example 33
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void newClinicAssociationRow(DynamicGridRow parrentRow, ClinicLiteVo clinic)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add clinical association row to a null parrent row");
	
	if (clinic == null)
		return;
	
	
	DynamicGridCell newCell;
	DynamicGridColumn column;
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow();
	newRow.setValue(clinic);
	
	// Create the first cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Clinic01);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.STRING);
	newCell.setValue(clinic.getClinicName());
	newCell.setReadOnly(true);
}
 
Example 34
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void newClinicAssociation(DynamicGridRow parrentRow)
{
	if (parrentRow == null)
		throw new CodingRuntimeException("Major Logical Error - Can not add a CLINIC association to a null parrent row");
	
	if (!(parrentRow.getValue() instanceof AssociationCategory) || ((AssociationCategory) parrentRow.getValue()) != AssociationCategory.CLINICS)
		throw new CodingRuntimeException("Logical Error - Function must be called from CLINICS category row only");
	

	parrentRow.setExpanded(true);
	
	// Create a new row
	DynamicGridRow newRow = parrentRow.getRows().newRow(true);
	newRow.setValue(new ClinicLiteVo());
	form.dyngrdAssociations().resetScrollPosition();
	
	// Declare a new cell
	DynamicGridCell newCell;
	// Column identifier
	DynamicGridColumn column;
	
	// Create the first cell in the row (IMAGE)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_IMAGE);
	newCell = newRow.getCells().newCell(column, DynamicCellType.IMAGE);
	newCell.setValue(form.getImages().Admin.Clinic01);
	
	// Create the second cell in the row (STRING)
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	newCell = newRow.getCells().newCell(column, DynamicCellType.QUERYCOMBOBOX);
	newCell.setAutoPostBack(true);
}
 
Example 35
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void updateClinicAssociationRowValue(DynamicGridRow row)
{
	if (row == null
		|| (row.getParent() == null)
		|| (!(row.getParent().getValue() instanceof AssociationCategory))
		|| (((AssociationCategory) row.getParent().getValue()) != AssociationCategory.CLINICS))
		throw new CodingRuntimeException("Major Logical Failure");
	
	if (row.getValue() == null)
		row.setValue(new ClinicLiteVo());
	
	if (!(row.getValue() instanceof ClinicLiteVo))
		throw new CodingRuntimeException("Major Logical Error - Clinic value expected");
	

	DynamicGridColumn column;
	DynamicGridCell cell;
	
	// Get the second cell value
	column = form.dyngrdAssociations().getColumns().getByIdentifier(COL_ASSOCIATION);
	cell = row.getCells().get(column);
	
	if (cell.getType() != DynamicCellType.STRING)
	{
		if (cell.getValue() == null)
		{
			row.setValue(null);
			cell.setTypedText(null);
		}
		else
			row.setValue((ClinicLiteVo) cell.getValue());
	}
}
 
Example 36
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void addClinicAssociationsToTemplate(ClinicLiteVoCollection clinics, DynamicGridRowCollection rows)
{
	// NOTE: DO NOT make clinics = new ClinicLiteVoCollection() in this function
	// clinics MUST ALWAYS reference the clinics in the TemplateAssociationVo
	
	if (rows == null)
		return;
	
	if (clinics == null)
		throw new CodingRuntimeException("Logical Error - Inserting values into null CLINICS collection");
	
	
	// Add the records from the grid
	for (int i = 0; i < rows.size(); i++)
	{
		DynamicGridRow row = rows.get(i);
		
		if (row.getValue() == null)
			continue;
		
		if (!(row.getValue() instanceof ClinicLiteVo))
			throw new CodingRuntimeException("Major Logical Error - Non Clinical association added to CLINICS category association");
		
		updateClinicAssociationRowValue(row);
		
		ClinicLiteVo clinicAssociation = (ClinicLiteVo) row.getValue();
		
		if (clinicAssociation != null)
			clinics.add(clinicAssociation);
	}
}
 
Example 37
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private boolean clinicNotOnScreen(ClinicLiteVo clinicLiteVo, DynamicGridRow parentRow) 
{
	for(int i=0; i<parentRow.getRows().size(); i++)
	{
		if(clinicLiteVo.equals(parentRow.getRows().get(i).getValue()))
				return false;
	}
	return true;
}
 
Example 38
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void populateRowClinic(DynamicGridRow childRow, ClinicLiteVo clinicLiteVo, boolean newClinic, boolean reviewClinic, boolean createRow) 
{
	if(createRow)
	{
		DynamicGridColumn column = null;
		DynamicGridCell cell = null;
		
		childRow.setValue(clinicLiteVo);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_IMAGE);
		cell = childRow.getCells().newCell(column, DynamicCellType.IMAGE);
		cell.setValue(form.getImages().Admin.Clinic01);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_HEADING);
		cell = childRow.getCells().newCell(column, DynamicCellType.STRING);
		cell.setReadOnly(true);
		cell.setValue(clinicLiteVo.getClinicName());
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE);
		cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
		engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
		cell.setAutoPostBack(false);
		
		column = form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE);
		cell = childRow.getCells().newCell(column, DynamicCellType.ANSWER);
		engine.populate(cell, ims.correspondence.vo.lookups.Yes.getNegativeInstancesAsIItemCollection());
		cell.setAutoPostBack(false);
	}
	
	if(newClinic)
	{
		childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_NEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
	}
	if(reviewClinic)
	{
		childRow.getCells().get(form.dyngrdLetter().getColumns().getByIdentifier(COL_REVIEWEXCLUDE)).setValue(ims.correspondence.vo.lookups.Yes.YES);
	}
	
}
 
Example 39
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
public void updateControlsState()
{
	form.getContextMenus().Correspondence.getNoLetterIsRequiredADDItem().setVisible(form.getMode().equals(FormMode.EDIT) && form.dyngrdLetter().getValue() instanceof Correspondence);
	form.getContextMenus().Correspondence.getNoLetterIsRequiredREMOVEItem().setVisible(form.getMode().equals(FormMode.EDIT) 
			&& (form.dyngrdLetter().getValue() instanceof ClinicLiteVo 
					|| form.dyngrdLetter().getValue() instanceof Specialty
						|| form.dyngrdLetter().getValue() instanceof MedicLiteVo));
}
 
Example 40
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void removeInstance(DynamicGridRow selectedRow) 
{
	if(selectedRow.getValue() instanceof ClinicLiteVo 
			|| selectedRow.getValue() instanceof Specialty
				|| selectedRow.getValue() instanceof MedicLiteVo)
	{
		form.dyngrdLetter().getRows().remove(selectedRow);
	}
}