Java Code Examples for ims.ocrr.vo.SpecimenWorkListItemListVo

The following are top voted examples for showing how to use ims.ocrr.vo.SpecimenWorkListItemListVo. 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   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException
{
	SpecimenWorkListItemListVo specimenWorkListItem = form.getLocalContext().getSpecimenWorkListItem();

	//WDEV-16582
	if (specimenWorkListItem.getWard() != null) //this means the round was already closed and the screen should be refreshed 
	{
		form.getGlobalContext().OCRR.getMoveToWardDetails().setIsRoundClosed(Boolean.TRUE);
		engine.showMessage("Round was closed by another user. Screen will be refreshed.");
		engine.close(DialogResult.OK);
		return;
	}
	
	if (saveWorkListItem(specimenWorkListItem))
		engine.close(DialogResult.OK);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private Object getIdentifier(SpecimenWorkListItemListVo item)
{
	String patIdValue = "";
	String patIdentifier = ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue();
	PatIdType patIdType = PatIdType.getNegativeInstance(patIdentifier);
	if(patIdType != null)
	{
		PatientIdCollection patIdsColl = null;
		if(item.getSpecimen().getOrderIsNotNull() &&
				item.getSpecimen().getOrder().getPatientIsNotNull())
			patIdsColl = item.getSpecimen().getOrder().getPatient().getIdentifiers();
		for (int i = 0; patIdsColl != null && i < patIdsColl.size(); i++)
		{
			if(patIdsColl.get(i).getTypeIsNotNull() && patIdsColl.get(i).getType().equals(patIdType))
			{
				patIdValue = patIdsColl.get(i).getValue();
				break;
			}
		}
	}
	
	return patIdType.toString() + " " + patIdValue;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createControlsForNotCollection(DynamicGridRow row, SpecimenWorkListItemListVo item)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.LABEL, DynamicGridCellOptions.LABEL_CELL);
	getColumn(QUERY_COL).setAlignment(Alignment.RIGHT);
	cell.setValue("Reason:");
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, item !=null?DynamicGridCellOptions.READ_ONLY_DATA_CELL:DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(item, cell);
	if(item != null)
	{
		if(item.getSpecimenIsNotNull() && item.getSpecimen().getCollectorCommentIsNotNull())
		{
			cell.setValue(item.getSpecimen().getCollectorComment());
			cell.setTooltip(item.getSpecimen().getCollectorComment());
		}
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object arg0, Object arg1)
{
	final int EQUAL  = 0;
	final int AFTER  = 1;
    
	SpecimenWorkListItemListVo voObj1 = (SpecimenWorkListItemListVo) arg0;
	SpecimenWorkListItemListVo voObj2 = (SpecimenWorkListItemListVo) arg1;
	Date startDateToCollect = voObj1.getDateToCollect();
	Date endDateToCollect 	= voObj2.getDateToCollect();
	Time startTimeToCollect = voObj1.getTimeToCollect();
	Time endTimeToCollect 	= voObj2.getTimeToCollect();
	
	if(startDateToCollect != null && endDateToCollect != null)
	{
		//Covers only equal dates and null time (Date Time sort moved into hql query)
		if(startDateToCollect.equals(endDateToCollect))
		{
			if(startTimeToCollect == null && endTimeToCollect != null)
			{
				return AFTER;
			}
		}
	}
	
	return EQUAL;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onBtnPrintClick() throws PresentationLogicException
{
	form.getLocalContext().setContextDummyForReportsLabel(null);
	form.getLocalContext().setContextDummyForReportsScreen(null);
	
	if(form.dyngrdCollect().getRows().size() == 0)
	{
		engine.showMessage("There is no data to print");
		return;
	}
	
	SpecimenWorkListItemListVoCollection voColl = getWorkListItemsToprint();
	if(voColl != null && voColl.size() != 0)
	{			
		SpecimenWorkListItemListVo dummy = new SpecimenWorkListItemListVo();
		dummy.setID_SpecimenWorkListItem(new Integer(-1));
		form.getLocalContext().setContextDummyForReportsLabel(dummy);
	}
	
	form.getGlobalContext().Core.setPrepareForPrinting(Boolean.TRUE);
	engine.open(form.getForms().Core.PrintReport);		
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private SpecimenWorkListItemListVoCollection getWorkListItemsToprint()
{
	SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection();
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				 DynamicGridCell printCell = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getCells().get(getColumn(PRINT_COL));
				 if(printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				 {
					 voColl.add((SpecimenWorkListItemListVo) form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getValue());
				 }
			}
		}
	}
	
	return voColl;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void refreshDataInGrid(SpecimenWorkListItemListVoCollection voColl)
{
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				DynamicGridRow row = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k);
				DynamicGridCell printCell = row.getCells().get(getColumn(PRINT_COL));
				if(printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				{
					loadPrintedStatus(printCell, true);
					printCell.setValue(PrintStatus.PRINTED);
					//Set the value of the row with a new one (otherwise will get a Stale Object Exception when saving)
					SpecimenWorkListItemListVo voNewSavedValue = getNewValueFromSavedList(row.getValue(), voColl);
					if(voNewSavedValue != null)
						row.setValue(voNewSavedValue);
				}
			}
		}
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createControlsForNotCollection(DynamicGridRow row, SpecimenWorkListItemListVo item)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.LABEL, DynamicGridCellOptions.LABEL_CELL);
	cell.setValue("Reason:");
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(item, cell);
	if(item != null)
	{
		if(item.getSpecimenIsNotNull() && item.getSpecimen().getCollectorCommentIsNotNull())
		{	
			cell.setValue(item.getSpecimen().getCollectorComment());
			cell.setTooltip(item.getSpecimen().getCollectorComment());
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private Object getIdentifier(SpecimenWorkListItemListVo item)
{
	String patIdValue = "";
	String patIdentifier = ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue();
	PatIdType patIdType = PatIdType.getNegativeInstance(patIdentifier);
	if (patIdType != null)
	{
		PatientIdCollection patIdsColl = null;
		//WDEV-16232
		if (item.getSpecimenIsNotNull() && item.getSpecimen().getOrderIsNotNull() && item.getSpecimen().getOrder().getPatientIsNotNull())
			patIdsColl = item.getSpecimen().getOrder().getPatient().getIdentifiers();
		else if (item.getDFTOrderInvestigationIsNotNull() && item.getDFTOrderInvestigation().getOrderDetailsIsNotNull() && item.getDFTOrderInvestigation().getOrderDetails().getPatientIsNotNull())
			patIdsColl = item.getDFTOrderInvestigation().getOrderDetails().getPatient().getIdentifiers();
			
		for (int i = 0; patIdsColl != null && i < patIdsColl.size(); i++)
		{
			if (patIdsColl.get(i).getTypeIsNotNull() && patIdsColl.get(i).getType().equals(patIdType))
			{
				patIdValue = patIdsColl.get(i).getValue();
				break;
			}
		}
	}

	return patIdType.toString() + " " + patIdValue;
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createControlsForNotCollection(DynamicGridRow row, SpecimenWorkListItemListVo item)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.LABEL, DynamicGridCellOptions.LABEL_CELL);
	getColumn(QUERY_COL).setAlignment(Alignment.RIGHT);
	cell.setValue("Reason:");
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, item != null ? DynamicGridCellOptions.READ_ONLY_DATA_CELL : DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(item, cell);
	if (item != null)
	{
		if (item.getSpecimenIsNotNull() && item.getSpecimen().getCollectorCommentIsNotNull())
		{
			cell.setValue(item.getSpecimen().getCollectorComment());
			cell.setTooltip(item.getSpecimen().getCollectorComment());
		}
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void enableContextMenu()
{
	boolean isRowEditable = false;
	boolean isAtLeastOneActivePhlebMayCollect = false;
	DynamicGridRow row = form.dyngrdCollect().getSelectedRow();
	if (specimenSelected(row))
	{
		SpecimenWorkListItemListVo specimenWorkListItemListVo = ((SpecimenWorkListItemListVo) row.getValue());
		isRowEditable = isRowEditable(specimenWorkListItemListVo.getCollectionStatus());
		// WDEV-2281
		Boolean isAtLeasOneActive = domain.isAtLeastOneActivePhlebMayCollect(specimenWorkListItemListVo);
		isAtLeastOneActivePhlebMayCollect = isAtLeasOneActive != null ? isAtLeasOneActive.booleanValue() : false;
	}

	form.getContextMenus().getOutpatientPhlebotomyMoveToPhlebotomyItem().setVisible(isRowEditable && isAtLeastOneActivePhlebMayCollect);
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private SpecimenWorkListItemListVoCollection getWorkListItemsToprint()
{
	SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection();
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				DynamicGridCell printCell = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getCells().get(getColumn(PRINT_COL));
				if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				{
					voColl.add((SpecimenWorkListItemListVo) form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getValue());
				}
			}
		}
	}

	return voColl;
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void refreshDataInGrid(SpecimenWorkListItemListVoCollection voColl)
{
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				DynamicGridRow row = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k);
				DynamicGridCell printCell = row.getCells().get(getColumn(PRINT_COL));
				if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				{
					loadPrintedStatus(printCell, true);
					printCell.setValue(PrintStatus.PRINTED);
					// Set the value of the row with a new one (otherwise
					// will get a Stale Object Exception when saving)
					SpecimenWorkListItemListVo voNewSavedValue = getNewValueFromSavedList(row.getValue(), voColl);
					if (voNewSavedValue != null)
						row.setValue(voNewSavedValue);
				}
			}
		}
	}
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createControlsForNotCollection(DynamicGridRow row, SpecimenWorkListItemListVo item)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.LABEL, DynamicGridCellOptions.LABEL_CELL);
	cell.setValue("Reason:");
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(item, cell);
	if(item != null)
	{
		if(item.getSpecimenIsNotNull() && item.getSpecimen().getCollectorCommentIsNotNull())
		{	
			cell.setValue(item.getSpecimen().getCollectorComment());
			cell.setTooltip(item.getSpecimen().getCollectorComment());
		}
	}
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getHeaderTitle(SpecimenWorkListItemListVo item)
{
	StringBuffer sb = new StringBuffer();
	sb.append("Date Required: ");
	sb.append(item.getDateToCollectIsNotNull() ? item.getDateToCollect().toString() : "");
	sb.append(" - Responsible Clinician: ");
	
	if(item.getSpecimenIsNotNull() && item.getSpecimen().getOrderIsNotNull() && item.getSpecimen().getOrder().getResponsibleClinicianIsNotNull() &&
	   item.getSpecimen().getOrder().getResponsibleClinician().getMosIsNotNull() && item.getSpecimen().getOrder().getResponsibleClinician().getMos().getName() != null)
	{
		sb.append(item.getSpecimen().getOrder().getResponsibleClinician().getMos().getName().toString());
	}
	else if(item.getSpecimen() == null && item.getDFTOrderInvestigation() != null && item.getDFTOrderInvestigation().getOrderDetails() != null && item.getDFTOrderInvestigation().getOrderDetails().getResponsibleClinician() != null
			&& item.getDFTOrderInvestigation().getOrderDetails().getResponsibleClinician().getMos() != null	 && item.getDFTOrderInvestigation().getOrderDetails().getResponsibleClinician().getMos().getName() != null)
	{
		sb.append(item.getDFTOrderInvestigation().getOrderDetails().getResponsibleClinician().getMos().getName().toString());
	}
	
	return sb.toString();
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean saveVos(SpecimenWorkListItemListVo voItem, SpecimenWorkListItemListVo voPrevItem)
{
	String[] errors = voPrevItem.validate(voItem.validate(getUiErrors(voItem.getListType(), voItem)));
	if(errors != null)
	{
		engine.showErrors(errors);
		return false;
	}
	
	try
	{
		SpecimenWorkListItemListVo voPrevItemSaved = domain.saveWorkListItem(voItem, voPrevItem);
		form.getGlobalContext().OCRR.setSpecimenWorkListItemList(voPrevItemSaved);
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());	
		return true;//WDEV-16708
	}
	
	return true;
}
 
Example 17
Project: AvoinApotti   File: SpecimenCollectionClinicImpl.java   Source Code and License 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if(orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);
	
	if(orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE) && doSpecimenWorkListItem.getSpecimen() != null)
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 18
Project: AvoinApotti   File: WardSpecimenCollectionImpl.java   Source Code and License 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if (orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	DomainFactory factory = getDomainFactory();

	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);

	if(doSpecimenWorkListItem.getSpecimen()!=null && orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getInvestigationName(SpecimenWorkListItemListVo specimen)
{
	String investigationName = "";

	if (specimen.getSpecimenIsNotNull())
	{
		for (int j = 0; specimen.getSpecimen().getInvestigationsIsNotNull() && j < specimen.getSpecimen().getInvestigations().size(); j++)
		{
			if (specimen.getSpecimen().getInvestigations().get(j).getInvestigationIsNotNull() && specimen.getSpecimen().getInvestigations().get(j).getInvestigation().getInvestigationIndexIsNotNull() && specimen.getSpecimen().getInvestigations().get(j).getInvestigation().getInvestigationIndex().getName() != null)
			{
				investigationName = (investigationName != "" ? investigationName + ", " + specimen.getSpecimen().getInvestigations().get(j).getInvestigation().getInvestigationIndex().getName() : specimen.getSpecimen().getInvestigations().get(j).getInvestigation().getInvestigationIndex().getName());
			}
		}

		return investigationName;
	}
	else if (specimen.getDFTOrderInvestigationIsNotNull() && specimen.getDFTOrderInvestigation().getInvestigationIsNotNull() && specimen.getDFTOrderInvestigation().getInvestigation().getInvestigationIndexIsNotNull() && specimen.getDFTOrderInvestigation().getInvestigation().getInvestigationIndex().getNameIsNotNull())
	{
		investigationName = specimen.getDFTOrderInvestigation().getInvestigation().getInvestigationIndex().getName();
		return investigationName;
	}

	return investigationName;
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getPatientName(SpecimenWorkListItemListVo specimen)
{
	String patientName = "";
	String surename = "";
	String forename = "";

	if (specimen.getSpecimenIsNotNull() && specimen.getSpecimen().getOrderIsNotNull() && specimen.getSpecimen().getOrder().getPatientIsNotNull() && specimen.getSpecimen().getOrder().getPatient().getNameIsNotNull())
	{
		forename = specimen.getSpecimen().getOrder().getPatient().getName().getForename();
		surename = specimen.getSpecimen().getOrder().getPatient().getName().getSurname();

		patientName = (forename != null ? surename + " " + forename : surename);
		return patientName;
	}
	else if (specimen.getDFTOrderInvestigationIsNotNull() && specimen.getDFTOrderInvestigation().getOrderDetailsIsNotNull() && specimen.getDFTOrderInvestigation().getOrderDetails().getPatientIsNotNull() && specimen.getDFTOrderInvestigation().getOrderDetails().getPatient().getNameIsNotNull())
	{
		forename = specimen.getDFTOrderInvestigation().getOrderDetails().getPatient().getName().getForename();
		surename = specimen.getDFTOrderInvestigation().getOrderDetails().getPatient().getName().getSurname();

		patientName = (forename != null ? surename + " " + forename : surename);
		return patientName;
	}

	return patientName;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private Object getIdentifier(SpecimenWorkListItemListVo item)
{
	String patIdValue = "";
	String patIdentifier = ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue();
	PatIdType patIdType = PatIdType.getNegativeInstance(patIdentifier);
	if(patIdType != null)
	{
		PatientIdCollection patIdsColl = null;
		if(item.getSpecimen().getOrderIsNotNull() &&
				item.getSpecimen().getOrder().getPatientIsNotNull())
			patIdsColl = item.getSpecimen().getOrder().getPatient().getIdentifiers();
		for (int i = 0; patIdsColl != null && i < patIdsColl.size(); i++)
		{
			if(patIdsColl.get(i).getTypeIsNotNull() && patIdsColl.get(i).getType().equals(patIdType))
			{
				patIdValue = patIdsColl.get(i).getValue();
				break;
			}
		}
	}
	
	return patIdType.toString() + " " + patIdValue;
}
 
Example 22
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createControlsForNotCollection(DynamicGridRow row, SpecimenWorkListItemListVo item)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.LABEL, DynamicGridCellOptions.LABEL_CELL);
	cell.setValue("Reason:");
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(item, cell);
	if(item != null)
	{
		if(item.getSpecimenIsNotNull() && item.getSpecimen().getCollectorCommentIsNotNull())
		{	
			cell.setValue(item.getSpecimen().getCollectorComment());
			cell.setTooltip(item.getSpecimen().getCollectorComment());
		}
	}
}
 
Example 23
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public int compare(Object arg0, Object arg1)
{
	final int EQUAL  = 0;
	final int AFTER  = 1;
    
	SpecimenWorkListItemListVo voObj1 = (SpecimenWorkListItemListVo) arg0;
	SpecimenWorkListItemListVo voObj2 = (SpecimenWorkListItemListVo) arg1;
	Date startDateToCollect = voObj1.getDateToCollect();
	Date endDateToCollect 	= voObj2.getDateToCollect();
	Time startTimeToCollect = voObj1.getTimeToCollect();
	Time endTimeToCollect 	= voObj2.getTimeToCollect();
	
	if(startDateToCollect != null && endDateToCollect != null)
	{
		//Covers only equal dates and null time (Date Time sort moved into hql query)
		if(startDateToCollect.equals(endDateToCollect))
		{
			if(startTimeToCollect == null && endTimeToCollect != null)
			{
				return AFTER;
			}
		}
	}
	
	return EQUAL;
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private Object getIdentifier(SpecimenWorkListItemListVo item)
{
	String patIdValue = "";
	String patIdentifier = ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue();
	PatIdType patIdType = PatIdType.getNegativeInstance(patIdentifier);
	if (patIdType != null)
	{
		PatientIdCollection patIdsColl = null;
		//WDEV-16232
		if (item.getSpecimenIsNotNull() && item.getSpecimen().getOrderIsNotNull() && item.getSpecimen().getOrder().getPatientIsNotNull())
			patIdsColl = item.getSpecimen().getOrder().getPatient().getIdentifiers();
		else if (item.getDFTOrderInvestigationIsNotNull() && item.getDFTOrderInvestigation().getOrderDetailsIsNotNull() && item.getDFTOrderInvestigation().getOrderDetails().getPatientIsNotNull())
			patIdsColl = item.getDFTOrderInvestigation().getOrderDetails().getPatient().getIdentifiers();
			
		for (int i = 0; patIdsColl != null && i < patIdsColl.size(); i++)
		{
			if (patIdsColl.get(i).getTypeIsNotNull() && patIdsColl.get(i).getType().equals(patIdType))
			{
				patIdValue = patIdsColl.get(i).getValue();
				break;
			}
		}
	}

	return patIdType.toString() + " " + patIdValue;
}
 
Example 25
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private Object getIdentifier(SpecimenWorkListItemListVo item)
{
	String patIdValue = "";
	String patIdentifier = ConfigFlag.UI.DISPLAY_PATID_TYPE.getValue();
	PatIdType patIdType = PatIdType.getNegativeInstance(patIdentifier);
	if (patIdType != null)
	{
		PatientIdCollection patIdsColl = null;
		//WDEV-16232
		if (item.getSpecimenIsNotNull() && item.getSpecimen().getOrderIsNotNull() && item.getSpecimen().getOrder().getPatientIsNotNull())
			patIdsColl = item.getSpecimen().getOrder().getPatient().getIdentifiers();
		else if (item.getDFTOrderInvestigationIsNotNull() && item.getDFTOrderInvestigation().getOrderDetailsIsNotNull() && item.getDFTOrderInvestigation().getOrderDetails().getPatientIsNotNull())
			patIdsColl = item.getDFTOrderInvestigation().getOrderDetails().getPatient().getIdentifiers();
			
		for (int i = 0; patIdsColl != null && i < patIdsColl.size(); i++)
		{
			if (patIdsColl.get(i).getTypeIsNotNull() && patIdsColl.get(i).getType().equals(patIdType))
			{
				patIdValue = patIdsColl.get(i).getValue();
				break;
			}
		}
	}

	return patIdType.toString() + " " + patIdValue;
}
 
Example 26
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onBtnOKClick() throws ims.framework.exceptions.PresentationLogicException
{
	SpecimenWorkListItemListVo specimenWorkListItem = form.getLocalContext().getSpecimenWorkListItem();

	//WDEV-16582
	if (specimenWorkListItem.getWard() != null) //this means the round was already closed and the screen should be refreshed 
	{
		form.getGlobalContext().OCRR.getMoveToWardDetails().setIsRoundClosed(Boolean.TRUE);
		engine.showMessage("Round was closed by another user. Screen will be refreshed.");
		engine.close(DialogResult.OK);
		return;
	}
	
	if (saveWorkListItem(specimenWorkListItem))
		engine.close(DialogResult.OK);
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createControlsForNotCollection(DynamicGridRow row, SpecimenWorkListItemListVo item)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.LABEL, DynamicGridCellOptions.LABEL_CELL);
	cell.setValue("Reason:");
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(item, cell);
	if(item != null)
	{
		if(item.getSpecimenIsNotNull() && item.getSpecimen().getCollectorCommentIsNotNull())
		{	
			cell.setValue(item.getSpecimen().getCollectorComment());
			cell.setTooltip(item.getSpecimen().getCollectorComment());
		}
	}
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getHeaderTitle(SpecimenWorkListItemListVo item)
{
	StringBuffer sb = new StringBuffer();
	sb.append("Date Required: ");
	sb.append(item.getDateToCollectIsNotNull() ? item.getDateToCollect().toString() : "");
	sb.append(" - Responsible Clinician: ");
	
	if(item.getSpecimenIsNotNull() && item.getSpecimen().getOrderIsNotNull() && item.getSpecimen().getOrder().getResponsibleClinicianIsNotNull() &&
	   item.getSpecimen().getOrder().getResponsibleClinician().getMosIsNotNull() && item.getSpecimen().getOrder().getResponsibleClinician().getMos().getName() != null)
	{
		sb.append(item.getSpecimen().getOrder().getResponsibleClinician().getMos().getName().toString());
	}
	else if(item.getSpecimen() == null && item.getDFTOrderInvestigation() != null && item.getDFTOrderInvestigation().getOrderDetails() != null && item.getDFTOrderInvestigation().getOrderDetails().getResponsibleClinician() != null
			&& item.getDFTOrderInvestigation().getOrderDetails().getResponsibleClinician().getMos() != null	 && item.getDFTOrderInvestigation().getOrderDetails().getResponsibleClinician().getMos().getName() != null)
	{
		sb.append(item.getDFTOrderInvestigation().getOrderDetails().getResponsibleClinician().getMos().getName().toString());
	}
	
	return sb.toString();
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private SpecimenWorkListItemListVoCollection getWorkListItemsToprint()
{
	SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection();
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				 DynamicGridCell printCell = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getCells().get(getColumn(PRINT_COL));
				 if(printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				 {
					 voColl.add((SpecimenWorkListItemListVo) form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getValue());
				 }
			}
		}
	}
	
	return voColl;
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void createControlsForNotCollection(DynamicGridRow row, SpecimenWorkListItemListVo item)
{
	clearVariableCells(row);

	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.LABEL, DynamicGridCellOptions.READ_ONLY_DATA_CELL);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.LABEL, DynamicGridCellOptions.LABEL_CELL);
	cell.setValue("Reason:");
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(item, cell);
	if(item != null)
	{
		if(item.getSpecimenIsNotNull() && item.getSpecimen().getCollectorCommentIsNotNull())
		{	
			cell.setValue(item.getSpecimen().getCollectorComment());
			cell.setTooltip(item.getSpecimen().getCollectorComment());
		}
	}
}
 
Example 31
Project: openMAXIMS   File: WardSpecimenCollectionImpl.java   Source Code and License 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if (orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	DomainFactory factory = getDomainFactory();

	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);

	if(doSpecimenWorkListItem.getSpecimen()!=null && orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void enableContextMenu()
{
	boolean isRowEditable = false;
	boolean isAtLeastOneActivePhlebMayCollect = false;
	DynamicGridRow row = form.dyngrdCollect().getSelectedRow();
	if (specimenSelected(row))
	{
		SpecimenWorkListItemListVo specimenWorkListItemListVo = ((SpecimenWorkListItemListVo) row.getValue());
		isRowEditable = isRowEditable(specimenWorkListItemListVo.getCollectionStatus());
		// WDEV-2281
		Boolean isAtLeasOneActive = domain.isAtLeastOneActivePhlebMayCollect(specimenWorkListItemListVo);
		isAtLeastOneActivePhlebMayCollect = isAtLeasOneActive != null ? isAtLeasOneActive.booleanValue() : false;
	}

	form.getContextMenus().getOutpatientPhlebotomyMoveToPhlebotomyItem().setVisible(isRowEditable && isAtLeastOneActivePhlebMayCollect);
}
 
Example 33
Project: openMAXIMS   File: OutpatientPhlebotomyImpl.java   Source Code and License 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if(orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);
	
	if(orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean saveVos(SpecimenWorkListItemListVo voItem, SpecimenWorkListItemListVo voPrevItem)
{
	String[] errors = voPrevItem.validate(voItem.validate(getUiErrors(voItem.getListType(), voItem)));
	if(errors != null)
	{
		engine.showErrors(errors);
		return false;
	}
	
	try
	{
		SpecimenWorkListItemListVo voPrevItemSaved = domain.saveWorkListItem(voItem, voPrevItem);
		form.getGlobalContext().OCRR.setSpecimenWorkListItemList(voPrevItemSaved);
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ims.configuration.gen.ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());	
		return true;//WDEV-16708
	}
	
	return true;
}
 
Example 35
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private SpecimenWorkListItemListVoCollection getWorkListItemsToprint()
{
	SpecimenWorkListItemListVoCollection voColl = new SpecimenWorkListItemListVoCollection();
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				DynamicGridCell printCell = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getCells().get(getColumn(PRINT_COL));
				if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				{
					voColl.add((SpecimenWorkListItemListVo) form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k).getValue());
				}
			}
		}
	}

	return voColl;
}
 
Example 36
Project: openMAXIMS   File: WardSpecimenCollectionImpl.java   Source Code and License 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if (orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	DomainFactory factory = getDomainFactory();

	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);

	if(doSpecimenWorkListItem.getSpecimen()!=null && orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE))
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 37
Project: openMAXIMS   File: SpecimenCollectionClinicImpl.java   Source Code and License 6 votes vote down vote up
public SpecimenWorkListItemListVo saveWorkListItem(SpecimenWorkListItemListVo orderSpecimenVo) throws StaleObjectException
{
	if(orderSpecimenVo == null)
		throw new CodingRuntimeException("Cannot save null SpecimenWorkListItemListVo");
	
	DomainFactory factory = getDomainFactory();
	SpecimenWorkListItem doSpecimenWorkListItem = SpecimenWorkListItemListVoAssembler.extractSpecimenWorkListItem(factory, orderSpecimenVo);
	
	if(orderSpecimenVo.getCollectionStatusIsNotNull() && orderSpecimenVo.getCollectionStatus().equals(SpecimenCollectionStatus.COLLECTIONCOMPLETE) && doSpecimenWorkListItem.getSpecimen() != null)
	{
		java.util.Set investigations = doSpecimenWorkListItem.getSpecimen().getInvestigations();
		for (java.util.Iterator iter = investigations.iterator(); iter.hasNext();)
		{
			Object obj = iter.next();
			if (obj instanceof OrderInvestigation)
			{
				OrderInvestigation element = (OrderInvestigation) obj;
				element.setDisplayDateTime(orderSpecimenVo.getSpecimen().getCollDateTimePlacer().getJavaDate());
				element.setDisplayFlag(getDomLookup(OcsDisplayFlag.SPEC_COLL));
			}
		}
	}
	
	factory.save(doSpecimenWorkListItem);
	return SpecimenWorkListItemListVoAssembler.create(doSpecimenWorkListItem);
}
 
Example 38
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void refreshDataInGrid(SpecimenWorkListItemListVoCollection voColl)
{
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				DynamicGridRow row = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k);
				DynamicGridCell printCell = row.getCells().get(getColumn(PRINT_COL));
				if(printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				{
					loadPrintedStatus(printCell, true);
					printCell.setValue(PrintStatus.PRINTED);
					//Set the value of the row with a new one (otherwise will get a Stale Object Exception when saving)
					SpecimenWorkListItemListVo voNewSavedValue = getNewValueFromSavedList(row.getValue(), voColl);
					if(voNewSavedValue != null)
						row.setValue(voNewSavedValue);
				}
			}
		}
	}
}
 
Example 39
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void enableContextMenu()
{
	boolean isRowEditable = false;
	boolean isAtLeastOneActivePhlebMayCollect = false;
	DynamicGridRow row = form.dyngrdCollect().getSelectedRow();
	if (specimenSelected(row))
	{
		SpecimenWorkListItemListVo specimenWorkListItemListVo = ((SpecimenWorkListItemListVo) row.getValue());
		isRowEditable = isRowEditable(specimenWorkListItemListVo.getCollectionStatus());
		// WDEV-2281
		Boolean isAtLeasOneActive = domain.isAtLeastOneActivePhlebMayCollect(specimenWorkListItemListVo);
		isAtLeastOneActivePhlebMayCollect = isAtLeasOneActive != null ? isAtLeasOneActive.booleanValue() : false;
	}

	form.getContextMenus().getOutpatientPhlebotomyMoveToPhlebotomyItem().setVisible(isRowEditable && isAtLeastOneActivePhlebMayCollect);
}
 
Example 40
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void refreshDataInGrid(SpecimenWorkListItemListVoCollection voColl)
{
	for (int i = 0; i < form.dyngrdCollect().getRows().size(); i++)
	{
		for (int j = 0; j < form.dyngrdCollect().getRows().get(i).getRows().size(); j++)
		{
			for (int k = 0; k < form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().size(); k++)
			{
				DynamicGridRow row = form.dyngrdCollect().getRows().get(i).getRows().get(j).getRows().get(k);
				DynamicGridCell printCell = row.getCells().get(getColumn(PRINT_COL));
				if (printCell != null && printCell.getValue() != null && printCell.getValue().equals(PrintStatus.FORPRINTING))
				{
					loadPrintedStatus(printCell, true);
					printCell.setValue(PrintStatus.PRINTED);
					// Set the value of the row with a new one (otherwise
					// will get a Stale Object Exception when saving)
					SpecimenWorkListItemListVo voNewSavedValue = getNewValueFromSavedList(row.getValue(), voColl);
					if (voNewSavedValue != null)
						row.setValue(voNewSavedValue);
				}
			}
		}
	}
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateHospitalAndWardControls()
{
	SpecimenWorkListItemListVo specimenWorkListItem = domain.getSpecimenWorklistItem(form.getGlobalContext().OCRR.getMoveToWardDetails().getSpecimenId());
	PatientShort patientShort = domain.getPatient(specimenWorkListItem.getSpecimen().getOrder().getPatient().getID_Patient());
	
	form.getLocalContext().setSpecimenWorkListItem(specimenWorkListItem);
	form.getGlobalContext().Core.setPatientShort(patientShort);

	LocShortMappingsVoCollection coll = domain.listActiveHospitals();

	LocationLiteVo patientWard = domain.getPatientWard(specimenWorkListItem.getSpecimen().getOrder().getPatient().getWard().getID_Location());
	LocationLiteVo hospital = null;

	if (patientWard != null)
	{
		hospital = domain.getHospitalForCurrentLocation(patientWard.getID_Location());
	}

	for (int i = 0; i < coll.size(); i++)
	{
		form.cmbHospital().newRow(coll.get(i), coll.get(i).getName());
	}

	form.cmbHospital().setValue(hospital);

	if (patientWard != null)
	{
		form.qmbWard().newRow(patientWard, patientWard.getName().toString());
		form.qmbWard().setValue(patientWard);
	}

}
 
Example 42
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String gePatientTitle(SpecimenWorkListItemListVo item)
{
	StringBuffer sb = new StringBuffer();
	String patient = "(No patient)";
	if(item.getSpecimen().getOrderIsNotNull() &&
		item.getSpecimen().getOrder().getPatientIsNotNull() &&
		item.getSpecimen().getOrder().getPatient().getNameIsNotNull())
		patient = item.getSpecimen().getOrder().getPatient().getName().toString();

	sb.append(patient);
	sb.append(" - ");
	sb.append(getIdentifier(item));
	return sb.toString();
}
 
Example 43
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientRefVo getPatientIdentifier(SpecimenWorkListItemListVo item)
{
	if(item.getSpecimen().getOrderIsNotNull() &&
		item.getSpecimen().getOrder().getPatientIsNotNull())
		return item.getSpecimen().getOrder().getPatient();
	return null;
}
 
Example 44
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String geDateTimeTitle(SpecimenWorkListItemListVo item)
{
	StringBuffer sb = new StringBuffer();
	sb.append(item.getTimeToCollectIsNotNull()?item.getTimeToCollect().toString():"(No Time)");
	sb.append(" - ");
	sb.append(item.getDateToCollectIsNotNull()?item.getDateToCollect().toString():"(No Date)");
	return sb.toString();
}
 
Example 45
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createControlsForCollection(DynamicGridRow row)
{
	clearVariableCells(row);
	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultDateValue(cell);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultTimeValue(cell);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.QUERYCOMBOBOX, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	getColumn(QUERY_COL).setAlignment(Alignment.LEFT);
	cell.setAutoPostBack(true);
	setDefaultMosValue(cell);
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(((row.getValue() instanceof SpecimenWorkListItemListVo)?((SpecimenWorkListItemListVo)row.getValue()):null), cell);
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void moveToPhlebotomy()
{
	Object value = form.dyngrdCollect().getValue();
	if(value instanceof SpecimenWorkListItemListVo)
	{
		form.getGlobalContext().OCRR.setSpecimenWorkListItemList((SpecimenWorkListItemListVo)value);
		engine.open(form.getForms().OCRR.WardSpecimenMoveTo);			
	}	
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void enableContextMenu()
{
	boolean isRowEditable = false;
	boolean isAtLeastOneActivePhlebMayCollect = false;
	DynamicGridRow row = form.dyngrdCollect().getSelectedRow();
	if(specimenSelected(row))
	{
		SpecimenWorkListItemListVo specimenWorkListItemListVo = ((SpecimenWorkListItemListVo)row.getValue());
		isRowEditable = isRowEditable(specimenWorkListItemListVo.getCollectionStatus());
		Boolean isAtLeasOneActive = domain.isAtLeastOneActivePhlebMayCollect(specimenWorkListItemListVo);
		isAtLeastOneActivePhlebMayCollect = isAtLeasOneActive != null? isAtLeasOneActive.booleanValue():false; 
	}
	
	form.getContextMenus().getOutpatientPhlebotomyMoveToPhlebotomyItem().setVisible(isRowEditable && isAtLeastOneActivePhlebMayCollect);
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void refreshRecord(SpecimenWorkListItemListVo specimenWorkListItemList)
{
	if(specimenWorkListItemList != null && specimenWorkListItemList.getCollectionStatus().equals(SpecimenCollectionStatus.MOVEDTOPHLEBOTOMY))
	{
		DynamicGridRow row = form.dyngrdCollect().getSelectedRow();
		if(row != null)
		{
			//WDEV-2990 - clear existing cell and then set the value to the selected row 
			clearVariableCells(row);
			removeCommonCells(row);
			displayCommonCells(specimenWorkListItemList, row);
			row.setValue(specimenWorkListItemList);
		}
	}
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private SpecimenWorkListItemListVo getNewValueFromSavedList(Object value, SpecimenWorkListItemListVoCollection voColl)
{
	if(value == null)
		return null;
	for (int i = 0; i < voColl.size(); i++)
	{
		if(voColl.get(i).equals(value))
		{
			return voColl.get(i);
		}
	}
	
	return null;
}
 
Example 50
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createControlsForCollection(DynamicGridRow row)
{
	clearVariableCells(row);
	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultDateValue(cell);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultTimeValue(cell);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.QUERYCOMBOBOX, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	cell.setAutoPostBack(true);
	setDefaultMosValue(cell);
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(((row.getValue() instanceof SpecimenWorkListItemListVo)?((SpecimenWorkListItemListVo)row.getValue()):null), cell);
}
 
Example 51
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getHeaderTitle(SpecimenWorkListItemListVo item)
{
	StringBuffer sb = new StringBuffer();
	sb.append("Date Required: ");
	sb.append(item.getDateToCollectIsNotNull() ? item.getDateToCollect().toString() : "");
	sb.append(" Responsible Clinician: ");
	if(item.getSpecimenIsNotNull() && 
	   item.getSpecimen().getOrderIsNotNull() && 
	   item.getSpecimen().getOrder().getResponsibleClinicianIsNotNull() &&
	   item.getSpecimen().getOrder().getResponsibleClinician().getMosIsNotNull() &&
	   item.getSpecimen().getOrder().getResponsibleClinician().getMos().getName() != null)
	sb.append(item.getSpecimen().getOrder().getResponsibleClinician().getMos().getName().toString());
	return sb.toString();
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String gePatientTitle(SpecimenWorkListItemListVo item)
{
	StringBuffer sb = new StringBuffer();
	String patient = "(No patient)";
	//WDEV-16232
	if (item.getSpecimenIsNotNull() && item.getSpecimen().getOrderIsNotNull() && item.getSpecimen().getOrder().getPatientIsNotNull() && item.getSpecimen().getOrder().getPatient().getNameIsNotNull())
		patient = item.getSpecimen().getOrder().getPatient().getName().toString();
	else if (item.getDFTOrderInvestigationIsNotNull() && item.getDFTOrderInvestigation().getOrderDetailsIsNotNull() && item.getDFTOrderInvestigation().getOrderDetails().getPatientIsNotNull() && item.getDFTOrderInvestigation().getOrderDetails().getPatient().getNameIsNotNull())
		patient=item.getDFTOrderInvestigation().getOrderDetails().getPatient().getName().toString();
	
	sb.append(patient);
	sb.append(" - ");
	sb.append(getIdentifier(item));
	return sb.toString();
}
 
Example 53
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientRefVo getPatientIdentifier(SpecimenWorkListItemListVo item)
{
	//WDEV-16232
	if (item.getSpecimenIsNotNull() && item.getSpecimen().getOrderIsNotNull() && item.getSpecimen().getOrder().getPatientIsNotNull())
		return item.getSpecimen().getOrder().getPatient();
	else if (item.getDFTOrderInvestigationIsNotNull() && item.getDFTOrderInvestigation().getOrderDetailsIsNotNull() && item.getDFTOrderInvestigation().getOrderDetails().getPatientIsNotNull())
		item.getDFTOrderInvestigation().getOrderDetails().getPatient();
	return null;
}
 
Example 54
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private String geDateTimeTitle(SpecimenWorkListItemListVo item)
{
	StringBuffer sb = new StringBuffer();
	sb.append(item.getTimeToCollectIsNotNull() ? item.getTimeToCollect().toString() : "(No Time)");
	sb.append(" - ");
	sb.append(item.getDateToCollectIsNotNull() ? item.getDateToCollect().toString() : "(No Date)");
	return sb.toString();
}
 
Example 55
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createCollectorsCommentsCell(DynamicGridCell cell)
{
	if (cell.getRow().getValue() instanceof SpecimenWorkListItemListVo)
	{
		SpecimenWorkListItemListVo item = (SpecimenWorkListItemListVo) cell.getRow().getValue();

		if (item != null && item.getSpecimen() != null && item.getSpecimen().getCollectorComment() != null && item.getSpecimen().getCollectorComment().length() > 0)
		{
			DynamicGridCell cellText = cell.getRow().getCells().newCell(form.dyngrdCollect().getColumns().getByIdentifier(TEXT_COL), DynamicCellType.STRING);
			cellText.setValue(item.getSpecimen().getCollectorComment());
			cellText.setTooltip(item.getSpecimen().getCollectorComment());
			cellText.setReadOnly(true);
		}
	}
}
 
Example 56
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void createControlsForCollection(DynamicGridRow row)
{
	clearVariableCells(row);
	DynamicGridCell cell = row.getCells().newCell(getColumn(DATE_COL), DynamicCellType.DATE, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultDateValue(cell);
	cell = row.getCells().newCell(getColumn(TIME_COL), DynamicCellType.TIME, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setDefaultTimeValue(cell);
	cell = row.getCells().newCell(getColumn(QUERY_COL), DynamicCellType.QUERYCOMBOBOX, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	getColumn(QUERY_COL).setAlignment(Alignment.LEFT);
	cell.setAutoPostBack(true);
	setDefaultMosValue(cell);
	cell = row.getCells().newCell(getColumn(TEXT_COL), DynamicCellType.STRING, DynamicGridCellOptions.EDITABLE_DATA_CELL);
	setCellMaxLength(((row.getValue() instanceof SpecimenWorkListItemListVo) ? ((SpecimenWorkListItemListVo) row.getValue()) : null), cell);
}
 
Example 57
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public int compare(Object arg0, Object arg1)
{
	final int EQUAL = 0;
	final int AFTER = 1;

	SpecimenWorkListItemListVo voObj1 = (SpecimenWorkListItemListVo) arg0;
	SpecimenWorkListItemListVo voObj2 = (SpecimenWorkListItemListVo) arg1;
	Date startDateToCollect = voObj1.getDateToCollect();
	Date endDateToCollect = voObj2.getDateToCollect();
	Time startTimeToCollect = voObj1.getTimeToCollect();
	Time endTimeToCollect = voObj2.getTimeToCollect();

	if (startDateToCollect != null && endDateToCollect != null)
	{
		// Covers only equal dates and null time (Date Time sort moved
		// into hql query)
		if (startDateToCollect.equals(endDateToCollect))
		{
			if (startTimeToCollect == null && endTimeToCollect != null)
			{
				return AFTER;
			}
		}
	}

	return EQUAL;
}
 
Example 58
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void moveToPhlebotomy()
{
	Object value = form.dyngrdCollect().getValue();
	if (value instanceof SpecimenWorkListItemListVo)
	{
		form.getGlobalContext().OCRR.setSpecimenWorkListItemList((SpecimenWorkListItemListVo) value);
		engine.open(form.getForms().OCRR.WardSpecimenMoveTo);
	}
}
 
Example 59
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnPrintClick() throws PresentationLogicException
{
	form.getLocalContext().setContextDummyForReportsLabel(null);
	form.getLocalContext().setContextDummyForReportsScreen(null);

	if (form.dyngrdCollect().getRows().size() == 0)
	{
		engine.showMessage("There is no data to print");
		return;
	}

	SpecimenWorkListItemListVoCollection voColl = getWorkListItemsToprint();

	if (voColl.size() == 0)
	{
		form.getLocalContext().setContextDummyForReportsScreen(form.cmbHospital().getValue());
		engine.showMessage("Please select at least one Specimen to print");
		return;
	}
	else
	{
		SpecimenWorkListItemListVo dummy = new SpecimenWorkListItemListVo();
		dummy.setID_SpecimenWorkListItem(new Integer(-1));
		form.getLocalContext().setContextDummyForReportsLabel(dummy);
	}

	form.getGlobalContext().Core.setPrepareForPrinting(Boolean.TRUE);
	form.getGlobalContext().Core.setSpecimenWorkListItemsForPrint(voColl);
	engine.open(form.getForms().Core.PrintMultipleOrders); //WDEV-17760

	// form.getGlobalContext().OCRR.setSpecimenWorkListItemPrintList(voColl);
	// engine.open(form.getForms().OCRR.WardSpecimenPrint);
}
 
Example 60
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void refreshRecord(SpecimenWorkListItemListVo specimenWorkListItemList)
{
	
	if (specimenWorkListItemList != null)
	{
		DynamicGridRow row = form.dyngrdCollect().getSelectedRow();
		
		if (specimenWorkListItemList.getCollectionStatus().equals(SpecimenCollectionStatus.MOVEDTOPHLEBOTOMY))
		{
			if (row != null)
			{
				// WDEV-2990 - clear existing cell and then set the value to
				// the
				// selected row
				clearVariableCells(row);
				removeCommonCells(row);
				displayCommonCells(specimenWorkListItemList, row);
				row.setValue(specimenWorkListItemList);
			}
		} //WDEV-16764
		else if (SpecimenCollectionStatus.COLLECTIONCOMPLETE.equals(specimenWorkListItemList.getCollectionStatus()) || SpecimenCollectionStatus.CANCELLED.equals(specimenWorkListItemList.getCollectionStatus()))
		{
			row.setBackColor(Color.LightGray);
			removeCommonCells(row);
			displayCommonCells(specimenWorkListItemList, row);
			enableContextMenu();
		}
	}
}