Java Code Examples for ims.ocrr.vo.lookups.Category

The following are top voted examples for showing how to use ims.ocrr.vo.lookups.Category. 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: OcsIfInboundImpl.java   Source Code and License 6 votes vote down vote up
public IfOcsOrderVo getOrderByPlacerOrFiller(String placerOrdNum, String fillerOrdNum, Category category) throws DomainInterfaceException
{
		// If placerOrdNum is not null, we created it, so it should be found
	if (placerOrdNum != null)
	{
		IfOcsOrderVo orderVo = getOrderByPlacerOrdNum(placerOrdNum, category);
		if (orderVo != null)
			return orderVo;
	}
	
	if (fillerOrdNum == null)
		throw new DomainInterfaceException("Filler Order Number cannot be null as Placer Order Number is null");
	
	if (category != null && category.equals(Category.CLINICALIMAGING))
		return this.getOrderByInvFillerOrdNum(fillerOrdNum);
	else
		return this.getOrderBySpecFillerOrdNum(fillerOrdNum);
		
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-13988
 */
@Override
protected void onCmbCategoryValueChanged() throws PresentationLogicException
{
	// If ClinicalImaging is selected then default to saved values, else clear values
	if (Category.CLINICALIMAGING.equals(form.cmbCategory().getValue()) && form.getLocalContext().getSelectedRecordIsNotNull())
	{
		form.chkAssociateReferralLetter().setValue(Boolean.TRUE.equals(form.getLocalContext().getSelectedRecord().getSendReferralLetter()));
		form.chkAssociateSafetyQuestionnaire().setValue(Boolean.TRUE.equals(form.getLocalContext().getSelectedRecord().getSendQuestionnaire()));
	}
	else
	{
		form.chkAssociateReferralLetter().setValue(null);
		form.chkAssociateSafetyQuestionnaire().setValue(null);
	}
	
	updateControlsState();
}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-13988
 */
protected void onCmbCategoryValueChanged() throws PresentationLogicException
{
	// If ClinicalImaging is selected then default to saved values, else clear values
	if (Category.CLINICALIMAGING.equals(form.cmbCategory().getValue()) && form.getLocalContext().getSelectedRecordIsNotNull())
	{
		form.chkAssociateReferralLetter().setValue(Boolean.TRUE.equals(form.getLocalContext().getSelectedRecord().getSendReferralLetter()));
		form.chkAssociateSafetyQuestionnaire().setValue(Boolean.TRUE.equals(form.getLocalContext().getSelectedRecord().getSendQuestionnaire()));
	}
	else
	{
		form.chkAssociateReferralLetter().setValue(null);
		form.chkAssociateSafetyQuestionnaire().setValue(null);
	}
	
	updateControlsState();
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getStatusText(OrderInvStatus ordInvStatus)
{
	if(ordInvStatus == null || form.cmbInvestigation().getValue() == null)
		return null;
	OcsPathRadResultVo item = form.cmbInvestigation().getValue();
	
	if(ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("CARE_UK") || ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("UKSH")) //WDEV-11881
	{
		if(item.getCategoryIsNotNull())
		{
			if(item.getCategory().equals(Category.CLINICALIMAGING))
			{
				if(ordInvStatus.equals(ordInvStatus.ORDERED))
				{
					return "Ready";
				}
			}
			else
				ordInvStatus.getText();
		}
	}
	return ordInvStatus.getText();
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void doHeaderSelectionChanged()
{
	updateControlsState(form.getLocalContext().getCurrentScreenMode());

	form.getLocalContext().setSelectedInvestigation(domain.getInvestigation(form.lyrInvestigations().tabProvider().grdHeaders().getValue().getID_Investigation()));

	displayInvestigationRecord(form.getLocalContext().getSelectedInvestigation());

	setDetailTabsVisible(true);
	
	//wdev-14252
	if (form.cmbCategory().getValue() != null && form.cmbCategory().getValue().equals(Category.PATHOLOGY) && form.lyrInvestigations().tabGeneralDet().chkAddOn().getValue() == true)
	{
		if (form.lyrInvestigations().tabHelpTexts().isHeaderVisible())
		{
			form.lyrInvestigations().tabPathologyDetails().setHeaderVisible(!form.lyrInvestigations().tabGeneralDet().chkAddOn().getValue());
			form.lyrInvestigations().tabLinkedInvestigations().setHeaderVisible(!form.lyrInvestigations().tabGeneralDet().chkAddOn().getValue());
		}
	}
	//-----------
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void addHelpText()
{
	grdTestHelpRow row = form.lyrInvestigations().tabHelpTexts().grdTestHelp().getRows().newRow(true);

	HelpTextVo item = new HelpTextVo();
	item.setID_HelpText(new Integer(0 - HelpTextVo.generateValueObjectUniqueID()));

	boolean addInstructToCollectItem = true;
	if (form.cmbCategory().getValue() != null && form.cmbCategory().getValue().equals(Category.CLINICALIMAGING) || (form.getLocalContext().getisProfileIsNotNull() && form.getLocalContext().getisProfile().equals(Boolean.TRUE) && !form.cmbCategory().getValue().equals(Category.PATHOLOGY)))
		addInstructToCollectItem = false;

	bindHelpTextCol(row, addInstructToCollectItem);

	row.setValue(item);
	
	updateControlsState(form.getLocalContext().getCurrentScreenMode());
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadLocations(Category value)
{
	LocationLiteVo backup = form.lyrInvestigations().tabGeneralDet().cmbProvider().getValue();//WDEV-12979
	
	form.lyrInvestigations().tabGeneralDet().cmbProvider().clear();

	if (value == null)
		return;

	LocationLiteVoCollection coll = domain.listProvidersByCategory(value);
	for (int i = 0; i < coll.size(); i++)
	{
		form.lyrInvestigations().tabGeneralDet().cmbProvider().newRow(coll.get(i), coll.get(i).getName());
	}
	
	form.lyrInvestigations().tabGeneralDet().cmbProvider().setValue(backup);////WDEV-12979
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadDiscipline(Category value)
{
	form.cmbDiscipline().clear();
	if (value == null)
		return;

	ServiceShortVoCollection voCollServiceShort = new ServiceShortVoCollection();

	//WDEV-17122
	if (form.cmbCategory().getValue().equals(Category.PATHOLOGY))
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.PATHOLOGY_DISCIPLINE);
	else if (Category.CLINICALIMAGING.equals(form.cmbCategory().getValue()))
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.RADIOLOGY_MODALITY);
	else
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.CLINICAL);

	for (int i = 0; i < voCollServiceShort.size(); i++)
	{
		form.cmbDiscipline().newRow(voCollServiceShort.get(i), voCollServiceShort.get(i).getServiceName());
	}

}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private ORDERSTATE getOcsOrderAuthorisingState()
{
	if (doesOrderContainInvType(Category.CLINICALIMAGING))
	{
		boolean canAuthoriseClinImaging = engine.hasRight(AppRight.CAN_AUTHORIZE_CLINICAL_IMAGING_ORDERS);
		if (!canAuthoriseClinImaging)
			return ORDERSTATE.REQUESTING_AUTHORISATION;

	}
	if (doesOrderContainInvType(Category.PATHOLOGY))
	{
		boolean canAuthorisePathology = engine.hasRight(AppRight.CAN_AUTHORIZE_PATHOLOGY_ORDERS);
		if (!canAuthorisePathology)
			return ORDERSTATE.REQUESTING_AUTHORISATION;
	}

	return ORDERSTATE.AUTHORISING;
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean doesOrderContainInvType(Category category)
{
	if (category == null)
		return false;

	OrderInvestigationVoCollection voCollOrderInvest = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	if (voCollOrderInvest == null)
		return false;

	boolean isClinicalImagingFound = false;
	for (int i = 0; i < voCollOrderInvest.size(); i++)
	{
		if (voCollOrderInvest.get(i).getOrdInvCurrentStatus() == null
				|| (!OrderInvStatus.CANCEL_REQUEST.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus())))
		{
			if (voCollOrderInvest.get(i).getInvestigationIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(category))
			{
				isClinicalImagingFound = true;
				break;
			}
		}
	}

	return isClinicalImagingFound;
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadDiscipline(Category value)
{
	form.cmbDiscipline().clear();

	if(value == null)
		return;
	
	ServiceShortVoCollection voCollServiceShort = new ServiceShortVoCollection();
	
	if(form.cmbCategory().getValue().equals(Category.PATHOLOGY))
		voCollServiceShort = domain.listServiceforLocationByType(LocationType.PATHOLOGYLABORATORY);
	else
		voCollServiceShort = domain.listServiceforLocationByType(LocationType.CLINICALIMAGINGDEPARTMENT);
		
	for(int i=0;i<voCollServiceShort.size();i++)
	{
		form.cmbDiscipline().newRow(voCollServiceShort.get(i), voCollServiceShort.get(i).getServiceName());
	}
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onImbSearchClick() throws ims.framework.exceptions.PresentationLogicException
{
	if(validateUISearchCriteria() == false)
		return;
	
	form.getLocalContext().setPrintingContext(null);
	
	//wdev-11986
	// WDEV-12692 - Pass 'From Date' and 'To Date' as search criteria 
	PathologyOrderVoCollection results = domain.listPathologyOrderInvestigation(form.cmbService().getValue(),form.cmbDepartment().getValue(), Category.PATHOLOGY, form.dteFrom().getValue(), form.dteTo().getValue());
	
	if (results == null || results.size() == 0)
	{
		engine.showMessage("No results found for search criteria.");
	}

	populateOrdersGrid(results);
	//--------
	
	enablePrintButton();
}
 
Example 13
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	//wdev-11861
	if(formName.equals(form.getForms().OCRR.OrderSummaryDialog))
	{
		if(result.equals(DialogResult.OK) || result.equals(DialogResult.CANCEL))
		{
			if(validateUISearchCriteria() == false)
				return;
			form.getLocalContext().setPrintingContext(null);
			
			
			//wdev-11986
			// WDEV-12692 - Pass 'From Date' and 'To Date' as search criteria
			populateOrdersGrid(domain.listPathologyOrderInvestigation(form.cmbService().getValue(),form.cmbDepartment().getValue(), Category.PATHOLOGY, form.dteFrom().getValue(), form.dteTo().getValue()));
			//-------------
			
			enablePrintButton();
		}
	}
	//----
	
}
 
Example 14
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onImbSearchClick()
{
	if(validateUISearchCriteria() == false)
		return;
	
	form.getLocalContext().setPrintingContext(null);
	
	// WDEV-11643
	RadiologyOrderVoCollection listRadOrderInvestigation = domain.listRadOrderInvestigation(form.cmbService().getValue(), form.cmbDepartment().getValue(), Category.CLINICALIMAGING, form.chkCompleted().isVisible() ? form.chkCompleted().getValue() : Boolean.FALSE, form.dteFrom().getValue(), form.dteTo().getValue());
	
	// WDEV-12571 - Show 'No records found' message
	if (listRadOrderInvestigation == null || listRadOrderInvestigation.size() == 0)
	{
		engine.showMessage("No records found to match search criteria.");
	}
	
	populateResultsGrid(listRadOrderInvestigation);
	
	enablePrintButton();
}
 
Example 15
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(formName.equals(form.getForms().OCRR.OrderSummaryDialog))
	{
		if(result.equals(DialogResult.OK))
		{
			if(validateUISearchCriteria() == false)
				return;
			
			form.getLocalContext().setPrintingContext(null);
			
			// WDEV-11643
			populateResultsGrid(domain.listRadOrderInvestigation(form.cmbService().getValue(), form.cmbDepartment().getValue(), Category.CLINICALIMAGING, form.chkCompleted().isVisible() ? form.chkCompleted().getValue() : Boolean.FALSE, form.dteFrom().getValue(), form.dteTo().getValue()));
			
			enablePrintButton();
		}
	}
			
}
 
Example 16
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdOrderInvestigationMutableComboBoxSelected(int column, grdOrderInvestigationRow row, Object value) throws PresentationLogicException
{
	if (value != null && Category.PATHOLOGY.equals(row.getcolComponent().getCategory()) && Boolean.FALSE.equals(form.getLocalContext().getPathologyChanged()))
	{
		form.getLocalContext().setPathologyChanged(changePrioritiesForCategory(value, Category.PATHOLOGY));
	}
	else if (value != null && Category.CLINICALIMAGING.equals(row.getcolComponent().getCategory()) && Boolean.FALSE.equals(form.getLocalContext().getRadioloyChanged()))
	{
		form.getLocalContext().setRadioloyChanged(changePrioritiesForCategory(value, Category.CLINICALIMAGING));
	}
	else if (value != null && Category.CLINICAL.equals(row.getcolComponent().getCategory()) && Boolean.FALSE.equals(form.getLocalContext().getClinicalChanged()))
	{
		form.getLocalContext().setClinicalChanged(changePrioritiesForCategory(value, Category.CLINICAL));
	}
}
 
Example 17
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private Boolean changePrioritiesForCategory(Object value, Category category)
{
	if (category == null)
		return Boolean.FALSE;
	
	for (int i = 0; i < form.grdOrderInvestigation().getRows().size(); i++)
	{
		grdOrderInvestigationRow row = form.grdOrderInvestigation().getRows().get(i);
		
		if (row.getParentRow() == null && category.equals(row.getcolComponent().getCategory()) && row.getcolPriority().getValue() == null)
		{
			row.getcolPriority().setValue(value);
		}
	}
	
	return Boolean.TRUE;
}
 
Example 18
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   Source Code and License 6 votes vote down vote up
private CategoryCollection getCategoryCollection(InvestigationOcsQuestionsVoCollection investigationOcsQuestionsColl)
{
	CategoryCollection categoryColl = new CategoryCollection();
	for (int i = 0; investigationOcsQuestionsColl != null && i < investigationOcsQuestionsColl.size(); i++)
	{
		InvestigationOcsQuestionsVo voOrderInv = investigationOcsQuestionsColl.get(i);
		if (voOrderInv.getInvestigationIndexIsNotNull())
		{
			Category category = voOrderInv.getInvestigationIndex().getCategory();
			if (categoryColl.indexOf(category) < 0)
				categoryColl.add(category);
		}
	}

	categoryColl.sort();
	
	return categoryColl;
}
 
Example 19
Project: AvoinApotti   File: MyOrderImpl.java   Source Code and License 6 votes vote down vote up
/**
 * Function used to retrieve Question & Answers for the category for amended investigation
 */
public GeneralQuestionAnswerVoCollection getCategoryQuestionsAnswers(OcsOrderSessionRefVo orderDetails, Category category)
{
	if (orderDetails == null || category == null)
		return null;
	
	StringBuilder query = new StringBuilder();
	
	query.append("SELECT questions ");
	query.append(" FROM OcsOrderSession AS ocsOrder LEFT JOIN ocsOrder.clinicalInfo AS clinInfo LEFT JOIN clinInfo.categoryQuestionAnswers AS categoryQA ");
	query.append(" LEFT JOIN categoryQA.categoryQuestionAnswers AS questions LEFT JOIN categoryQA.category AS category ");
	query.append(" WHERE ocsOrder.id = :ID_ORDER AND category.id = :ID_CATEGORY ");
	
	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();
	
	paramNames.add("ID_ORDER");			paramValues.add(orderDetails.getID_OcsOrderSession());
	paramNames.add("ID_CATEGORY");		paramValues.add(category.getID());

	return GeneralQuestionAnswerVoAssembler.createGeneralQuestionAnswerVoCollectionFromGeneralQuestionAnswer(getDomainFactory().find(query.toString(), paramNames, paramValues));
}
 
Example 20
Project: AvoinApotti   File: ClinicalOrdersResultsOCRRFormImpl.java   Source Code and License 6 votes vote down vote up
/**
 * listInvestigations
 */
public ims.ocrr.vo.InvestigationIndexLiteVoCollection listInvestigations(String name, Boolean beginWith)
{
	if (name != null)
	{
		name.replaceAll("%", "");

		if (beginWith != null)
			name = (!beginWith ? "%" + name.toUpperCase() + "%" : name.toUpperCase() + "%");
		else
			name = name.toUpperCase() + "%";

	}
	return InvestigationIndexLiteVoAssembler.createInvestigationIndexLiteVoCollectionFromInvestigationIndex(getDomainFactory().find("select distinct i1_1 from InvestigationIndex as i1_1 left join i1_1.synonyms as i2_1 where (i1_1.category = :cat and ((i2_1.upperName like :name and i2_1.activeStatus = :Active) or i1_1.upperName like :name ) and i1_1.activeStatus = :status and i1_1.isProfile = :isProfile) order by i1_1.upperName", new String[] { "name", "cat", "status", "isProfile", "Active" }, new Object[] { name, getDomLookup(Category.CLINICAL), getDomLookup(PreActiveActiveInactiveStatus.ACTIVE), Boolean.FALSE, Boolean.TRUE }));

}
 
Example 21
Project: AvoinApotti   File: PathologyResultsImpl.java   Source Code and License 6 votes vote down vote up
public InvestigationIndexLiteVoCollection listInvestigationTypesSynonyms(String name, Boolean beginWith) 
{
			
	if(name != null)
	{
		name.replaceAll("%", "");
				
		if(beginWith != null)
			name = (!beginWith ? "%" + name.toUpperCase() + "%" : name.toUpperCase() + "%");
		else
			name = name.toUpperCase() + "%";
		
			
	}
	
	return InvestigationIndexLiteVoAssembler.createInvestigationIndexLiteVoCollectionFromInvestigationIndex(
			getDomainFactory().find("select distinct i1_1 from InvestigationIndex as i1_1 left join i1_1.synonyms as i2_1 where (i1_1.category = :category and ((i2_1.upperName like :name and i2_1.activeStatus = :Active) or i1_1.upperName like :name )and i1_1.activeStatus = :status and i1_1.isProfile = :isProfile) order by i1_1.upperName", 
					new String[] {"category", "name", "status", "isProfile", "Active"}, new Object[] {getDomLookup(Category.PATHOLOGY), name, getDomLookup(PreActiveActiveInactiveStatus.ACTIVE), Boolean.FALSE,Boolean.TRUE}));

}
 
Example 22
Project: AvoinApotti   File: ResultCommentsDialogImpl.java   Source Code and License 6 votes vote down vote up
public void removeComment(OcsPathRadResultVo result, ResultCommentsVo comment) throws StaleObjectException, ForeignKeyViolationException
{
	if (result == null)
		throw new DomainRuntimeException("Can not remove comment from null parent.");
	

	if (Category.PATHOLOGY.equals(result.getCategory()))
	{
		removeComentFromOrderSpecimen(result, comment);
		return;
	}
	
	if (Category.CLINICALIMAGING.equals(result.getCategory()))
	{
		removeCommentFromOrderInvestigation(result, comment);
		return;
	}
	
	return;
}
 
Example 23
Project: AvoinApotti   File: ClinicalImagingResultsImpl.java   Source Code and License 6 votes vote down vote up
public InvestigationIndexLiteVoCollection listExamsSynonyms(String name,Boolean beginWith) 
{
	
	if(name != null)
	{
		name.replaceAll("%", "");
				
		if(beginWith != null)
			name = (!beginWith ? "%" + name.toUpperCase() + "%" : name.toUpperCase() + "%");
		else
			name = name.toUpperCase() + "%";
				
	}
	return InvestigationIndexLiteVoAssembler.createInvestigationIndexLiteVoCollectionFromInvestigationIndex(
			getDomainFactory().find("select distinct i1_1 from InvestigationIndex as i1_1 left join i1_1.synonyms as i2_1 where (i1_1.category = :cat and ((i2_1.upperName like :name and i2_1.activeStatus = :Active) or i1_1.upperName like :name ) and i1_1.activeStatus = :status and i1_1.isProfile = :isProfile) order by i1_1.upperName", 
					new String[] {"name", "cat", "status", "isProfile", "Active"}, new Object[] {name, getDomLookup(Category.CLINICALIMAGING), getDomLookup(PreActiveActiveInactiveStatus.ACTIVE), Boolean.FALSE, Boolean.TRUE}));
	
}
 
Example 24
Project: AvoinApotti   File: TestEditImpl.java   Source Code and License 6 votes vote down vote up
public LocationLiteVoCollection listProvidersByCategory(Category lookupCategory)
{
	if (lookupCategory == null)
		return null;

	DomainFactory factory = getDomainFactory();

	java.util.List locations = null;
	LookupInstance type = null;

	if (lookupCategory.equals(Category.PATHOLOGY))
		type = getDomLookup(LocationType.PATHOLOGYLABORATORY);
	else if (lookupCategory.equals(Category.CLINICALIMAGING))
		type = getDomLookup(LocationType.CLINICALIMAGINGDEPARTMENT);
	else if (lookupCategory.equals(Category.CLINICAL))
		type = getDomLookup(LocationType.CLINICAL);

	if (type == null)
		throw new DomainRuntimeException("type id not found (listProvidersByCategory method)");

	locations = factory.find("from Location loc where loc.type = :type", new String[]{"type"}, new Object[]{type});

	return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locations).sort();
}
 
Example 25
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private SpecimenWorkListItemLiteVo isPathologyAndSpecimenWorkListItemExists(ReferralAppointmentDetailsOrderInvestigationVo voOrderInv)
{
	if(voOrderInv == null)
		throw new CodingRuntimeException("voOrderInv is null in method isPathologyAndSpecimenWorkListItemExists");
	
	if(voOrderInv.getInvestigationIsNotNull() && voOrderInv.getInvestigation().getInvestigationIndexIsNotNull() && voOrderInv.getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voOrderInv.getInvestigation().getInvestigationIndex().getCategory().equals(Category.PATHOLOGY))
	{
		SpecimenWorkListItemLiteVoCollection voCollWorkList = form.getLocalContext().getCollectedWorkListItems();
		if(voCollWorkList != null)
		{
			for (SpecimenWorkListItemLiteVo voSpecimenWorkListItem : voCollWorkList)
			{
				if(voOrderInv.getSpecimenIsNotNull())
					if(voSpecimenWorkListItem.getSpecimenIsNotNull() && voSpecimenWorkListItem.getSpecimen().equals(voOrderInv.getSpecimen()))
						return voSpecimenWorkListItem;
			}
		}
	}
	return null;
}
 
Example 26
Project: AvoinApotti   File: ReferralAppointmentDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
/**
 *  List all SpecimenWorkListItems for the CatsReferral.investigationOrders.Investigations of type pathology that have 'ward' and 'datetocollect' as null and status is not cancelled
 */
public SpecimenWorkListItemLiteVoCollection listSpecimenWorKlistItemsForCatsReferral(CatsReferralRefVo catsReferral)
{
	if(catsReferral == null || catsReferral.getID_CatsReferral() == null)
		throw new CodingRuntimeException("catsReferral is null or id not provided in method listSpecimenWorKlistItemsForCatsReferral");
		
	DomainFactory factory = getDomainFactory();
	
	//specWork.dateToCollect is null and specWork.ward is null and 
	
	String hql = "from SpecimenWorkListItem specWork where specWork.specimen.id in (select ordInv.specimen.id from CatsReferral as cats join cats.investigationOrders as ord join ord.investigations as ordInv join ordInv.investigation as inv " +
			" where inv.investigationIndex.category = :category and cats.id = :idCatsRef and ordInv.ordInvCurrentStatus.ordInvStatus <> :status)";
	
	List doWorkListItems =  factory.find(hql, new String[]{"category","idCatsRef","status"} , new Object[]{getDomLookup(Category.PATHOLOGY), catsReferral.getID_CatsReferral(), getDomLookup(Status_Reason.CANCELLED)});
	return SpecimenWorkListItemLiteVoAssembler.createSpecimenWorkListItemLiteVoCollectionFromSpecimenWorkListItem(doWorkListItems);
}
 
Example 27
Project: openMAXIMS   File: OcsIfInboundImpl.java   Source Code and License 6 votes vote down vote up
public IfOcsOrderVo getOrderByPlacerOrFiller(String placerOrdNum, String fillerOrdNum, Category category) throws DomainInterfaceException
{
		// If placerOrdNum is not null, we created it, so it should be found
	if (placerOrdNum != null)
	{
		IfOcsOrderVo orderVo = getOrderByPlacerOrdNum(placerOrdNum, category);
		if (orderVo != null)
			return orderVo;
	}
	
	if (fillerOrdNum == null)
		throw new DomainInterfaceException("Filler Order Number cannot be null as Placer Order Number is null");
	
	if (category != null && category.equals(Category.CLINICALIMAGING))
		return this.getOrderByInvFillerOrdNum(fillerOrdNum);
	else
		return this.getOrderBySpecFillerOrdNum(fillerOrdNum);
		
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onFormOpen(Object[] args) throws ims.framework.exceptions.PresentationLogicException
{
	//WDEV-17304
	Object hcp = domain.getHcpLiteUser();
	if (hcp !=null && hcp instanceof HcpLiteVo)
	{
		form.getLocalContext().setLoggedHCP((HcpRefVo) hcp);
	}
	
	initializeControls();
	form.getLocalContext().setTrackingForReferral(domain.getTrackingForReferral(form.getGlobalContext().Emergency.getTracking()));
	form.getLocalContext().setPrimaryIDFromPASProviderSystem(domain.getPrimaryIDFromProviderSystem(Category.PAS));  //WDEV-23527
	open();
	
	if(form.getLocalContext().getSelectedReferralToSpecialty() == null || form.getLocalContext().getSelectedReferralToSpecialty().getCompletionDateTimeIsNotNull() || Boolean.TRUE.equals(form.getLocalContext().getSelectedReferralToSpecialty().getNotAccepted()))
	{
		newInstance();
	}
}
 
Example 29
Project: openMAXIMS   File: TrackingImpl.java   Source Code and License 6 votes vote down vote up
public PatIdType getPrimaryIDFromProviderSystem(Category category)
{
	if(category == null )
		throw new CodingRuntimeException("Cannot get PrimaryIDFromProviderSystem record for a null Category.");
	
	DomainFactory factory = getDomainFactory();
	
	DomainObject providerSystem = factory.findFirst("select ps from ProviderSystem as ps left join ps.primaryPatientId as ppi left join ps.category as cat where cat.id = :categoryID", new String[] {"categoryID"}, new Object[] {category.getID()});
	
	ims.domain.lookups.LookupInstance instancePrimaryID = providerSystem!=null ? ((ProviderSystem)providerSystem).getPrimaryPatientId() : null;
	if (instancePrimaryID !=null) 
	{
		return new ims.core.vo.lookups.PatIdType(instancePrimaryID.getId(),instancePrimaryID.getText(), instancePrimaryID.isActive(), null, null, null);
	}
	
	return null;
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onImbSearchClick() throws ims.framework.exceptions.PresentationLogicException
{
	if(validateUISearchCriteria() == false)
		return;
	
	form.getLocalContext().setPrintingContext(null);
	
	//wdev-11986
	// WDEV-12692 - Pass 'From Date' and 'To Date' as search criteria 
	PathologyOrderVoCollection results = domain.listPathologyOrderInvestigation(form.cmbService().getValue(),form.cmbDepartment().getValue(), Category.PATHOLOGY, form.dteFrom().getValue(), form.dteTo().getValue());
	
	if (results == null || results.size() == 0)
	{
		engine.showMessage("No results found for search criteria.");
	}

	populateOrdersGrid(results);
	//--------
	
	enablePrintButton();
}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadDiscipline(Category value)
{
	form.cmbDiscipline().clear();

	if(value == null)
		return;
	
	ServiceShortVoCollection voCollServiceShort = new ServiceShortVoCollection();
	
	if(form.cmbCategory().getValue().equals(Category.PATHOLOGY))
		voCollServiceShort = domain.listServiceforLocationByType(LocationType.PATHOLOGYLABORATORY);
	else
		voCollServiceShort = domain.listServiceforLocationByType(LocationType.CLINICALIMAGINGDEPARTMENT);
		
	for(int i=0;i<voCollServiceShort.size();i++)
	{
		form.cmbDiscipline().newRow(voCollServiceShort.get(i), voCollServiceShort.get(i).getServiceName());
	}
}
 
Example 32
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-13988
 */
@Override
protected void onCmbCategoryValueChanged() throws PresentationLogicException
{
	// If ClinicalImaging is selected then default to saved values, else clear values
	if (Category.CLINICALIMAGING.equals(form.cmbCategory().getValue()) && form.getLocalContext().getSelectedRecordIsNotNull())
	{
		form.chkAssociateReferralLetter().setValue(Boolean.TRUE.equals(form.getLocalContext().getSelectedRecord().getSendReferralLetter()));
		form.chkAssociateSafetyQuestionnaire().setValue(Boolean.TRUE.equals(form.getLocalContext().getSelectedRecord().getSendQuestionnaire()));
	}
	else
	{
		form.chkAssociateReferralLetter().setValue(null);
		form.chkAssociateSafetyQuestionnaire().setValue(null);
	}
	
	updateControlsState();
}
 
Example 33
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean doesOrderContainInvType(Category category)
{
	if (category == null)
		return false;

	OrderInvestigationVoCollection voCollOrderInvest = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	if (voCollOrderInvest == null)
		return false;

	boolean isClinicalImagingFound = false;
	for (int i = 0; i < voCollOrderInvest.size(); i++)
	{
		if (voCollOrderInvest.get(i).getOrdInvCurrentStatus() == null
				|| (!OrderInvStatus.CANCEL_REQUEST.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus())))
		{
			if (voCollOrderInvest.get(i).getInvestigationIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(category))
			{
				isClinicalImagingFound = true;
				break;
			}
		}
	}

	return isClinicalImagingFound;
}
 
Example 34
Project: openmaxims-linux   File: ClinicalImagingResultsImpl.java   Source Code and License 6 votes vote down vote up
public InvestigationIndexLiteVoCollection listExamsSynonyms(String name,Boolean beginWith) 
{
	
	if(name != null)
	{
		name.replaceAll("%", "");
				
		if(beginWith != null)
			name = (!beginWith ? "%" + name.toUpperCase() + "%" : name.toUpperCase() + "%");
		else
			name = name.toUpperCase() + "%";
				
	}
	return InvestigationIndexLiteVoAssembler.createInvestigationIndexLiteVoCollectionFromInvestigationIndex(
			getDomainFactory().find("select distinct i1_1 from InvestigationIndex as i1_1 left join i1_1.synonyms as i2_1 where (i1_1.category = :cat and ((i2_1.upperName like :name and i2_1.activeStatus = :Active) or i1_1.upperName like :name ) and i1_1.activeStatus = :status and i1_1.isProfile = :isProfile) order by i1_1.upperName", 
					new String[] {"name", "cat", "status", "isProfile", "Active"}, new Object[] {name, getDomLookup(Category.CLINICALIMAGING), getDomLookup(PreActiveActiveInactiveStatus.ACTIVE), Boolean.FALSE, Boolean.TRUE}));
	
}
 
Example 35
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private Boolean changePrioritiesForCategory(Object value, Category category)
{
	if (category == null)
		return Boolean.FALSE;
	
	for (int i = 0; i < form.grdOrderInvestigation().getRows().size(); i++)
	{
		grdOrderInvestigationRow row = form.grdOrderInvestigation().getRows().get(i);
		
		if (row.getParentRow() == null && category.equals(row.getcolComponent().getCategory()) && row.getcolPriority().getValue() == null)
		{
			row.getcolPriority().setValue(value);
		}
	}
	
	return Boolean.TRUE;
}
 
Example 36
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onImbSearchClick()
{
	if(validateUISearchCriteria() == false)
		return;
	
	form.getLocalContext().setPrintingContext(null);
	
	// WDEV-11643
	RadiologyOrderVoCollection listRadOrderInvestigation = domain.listRadOrderInvestigation(form.cmbService().getValue(), form.cmbDepartment().getValue(), Category.CLINICALIMAGING, form.chkCompleted().isVisible() ? form.chkCompleted().getValue() : Boolean.FALSE, form.dteFrom().getValue(), form.dteTo().getValue());
	
	// WDEV-12571 - Show 'No records found' message
	if (listRadOrderInvestigation == null || listRadOrderInvestigation.size() == 0)
	{
		engine.showMessage("No records found to match search criteria.");
	}
	
	populateResultsGrid(listRadOrderInvestigation);
	
	enablePrintButton();
}
 
Example 37
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void doHeaderSelectionChanged()
{
	updateControlsState(form.getLocalContext().getCurrentScreenMode());

	form.getLocalContext().setSelectedInvestigation(domain.getInvestigation(form.lyrInvestigations().tabProvider().grdHeaders().getValue().getID_Investigation()));

	displayInvestigationRecord(form.getLocalContext().getSelectedInvestigation());

	setDetailTabsVisible(true);
	
	//wdev-14252
	if (form.cmbCategory().getValue() != null && form.cmbCategory().getValue().equals(Category.PATHOLOGY) && form.lyrInvestigations().tabGeneralDet().chkAddOn().getValue() == true)
	{
		if (form.lyrInvestigations().tabHelpTexts().isHeaderVisible())
		{
			form.lyrInvestigations().tabPathologyDetails().setHeaderVisible(!form.lyrInvestigations().tabGeneralDet().chkAddOn().getValue());
			form.lyrInvestigations().tabLinkedInvestigations().setHeaderVisible(!form.lyrInvestigations().tabGeneralDet().chkAddOn().getValue());
		}
	}
	//-----------
}
 
Example 38
Project: openMAXIMS   File: PathologyResultsImpl.java   Source Code and License 6 votes vote down vote up
public InvestigationIndexLiteVoCollection listInvestigationTypesSynonyms(String name, Boolean beginWith) 
{
			
	if(name != null)
	{
		name.replaceAll("%", "");
				
		if(beginWith != null)
			name = (!beginWith ? "%" + name.toUpperCase() + "%" : name.toUpperCase() + "%");
		else
			name = name.toUpperCase() + "%";
		
			
	}
	
	return InvestigationIndexLiteVoAssembler.createInvestigationIndexLiteVoCollectionFromInvestigationIndex(
			getDomainFactory().find("select distinct i1_1 from InvestigationIndex as i1_1 left join i1_1.synonyms as i2_1 where (i1_1.category = :category and ((i2_1.upperName like :name and i2_1.activeStatus = :Active) or i1_1.upperName like :name )and i1_1.activeStatus = :status and i1_1.isProfile = :isProfile) order by i1_1.upperName", 
					new String[] {"category", "name", "status", "isProfile", "Active"}, new Object[] {getDomLookup(Category.PATHOLOGY), name, getDomLookup(PreActiveActiveInactiveStatus.ACTIVE), Boolean.FALSE,Boolean.TRUE}));

}
 
Example 39
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadDiscipline(Category value)
{
	form.cmbDiscipline().clear();
	if (value == null)
		return;

	ServiceShortVoCollection voCollServiceShort = new ServiceShortVoCollection();

	//WDEV-17122
	if (form.cmbCategory().getValue().equals(Category.PATHOLOGY))
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.PATHOLOGY_DISCIPLINE);
	else if (Category.CLINICALIMAGING.equals(form.cmbCategory().getValue()))
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.RADIOLOGY_MODALITY);
	else
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.CLINICAL);

	for (int i = 0; i < voCollServiceShort.size(); i++)
	{
		form.cmbDiscipline().newRow(voCollServiceShort.get(i), voCollServiceShort.get(i).getServiceName());
	}

}
 
Example 40
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadDiscipline(Category value)
{
	form.cmbDiscipline().clear();
	if (value == null)
		return;

	ServiceShortVoCollection voCollServiceShort = new ServiceShortVoCollection();

	//WDEV-17122
	if (form.cmbCategory().getValue().equals(Category.PATHOLOGY))
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.PATHOLOGY_DISCIPLINE);
	else if (Category.CLINICALIMAGING.equals(form.cmbCategory().getValue()))
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.RADIOLOGY_MODALITY);
	else
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.CLINICAL);

	for (int i = 0; i < voCollServiceShort.size(); i++)
	{
		form.cmbDiscipline().newRow(voCollServiceShort.get(i), voCollServiceShort.get(i).getServiceName());
	}

}
 
Example 41
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void doHeaderSelectionChanged()
{
	updateControlsState(form.getLocalContext().getCurrentScreenMode());

	form.getLocalContext().setSelectedInvestigation(domain.getInvestigation(form.lyrInvestigations().tabProvider().grdHeaders().getValue().getID_Investigation()));

	displayInvestigationRecord(form.getLocalContext().getSelectedInvestigation());

	setDetailTabsVisible(true);
	
	//wdev-14252
	if (form.cmbCategory().getValue() != null && form.cmbCategory().getValue().equals(Category.PATHOLOGY) && form.lyrInvestigations().tabGeneralDet().chkAddOn().getValue() == true)
	{
		if (form.lyrInvestigations().tabHelpTexts().isHeaderVisible())
		{
			form.lyrInvestigations().tabPathologyDetails().setHeaderVisible(!form.lyrInvestigations().tabGeneralDet().chkAddOn().getValue());
			form.lyrInvestigations().tabLinkedInvestigations().setHeaderVisible(!form.lyrInvestigations().tabGeneralDet().chkAddOn().getValue());
		}
	}
	//-----------
}
 
Example 42
Project: openmaxims-linux   File: OcsIfInboundImpl.java   Source Code and License 6 votes vote down vote up
public IfOcsOrderVo getOrderByPlacerOrFiller(String placerOrdNum, String fillerOrdNum, Category category) throws DomainInterfaceException
{
		// If placerOrdNum is not null, we created it, so it should be found
	if (placerOrdNum != null)
	{
		IfOcsOrderVo orderVo = getOrderByPlacerOrdNum(placerOrdNum, category);
		if (orderVo != null)
			return orderVo;
	}
	
	if (fillerOrdNum == null)
		throw new DomainInterfaceException("Filler Order Number cannot be null as Placer Order Number is null");
	
	if (category != null && category.equals(Category.CLINICALIMAGING))
		return this.getOrderByInvFillerOrdNum(fillerOrdNum);
	else
		return this.getOrderBySpecFillerOrdNum(fillerOrdNum);
		
}
 
Example 43
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private ORDERSTATE getOcsOrderAuthorisingState()
{
	if (doesOrderContainInvType(Category.CLINICALIMAGING))
	{
		boolean canAuthoriseClinImaging = engine.hasRight(AppRight.CAN_AUTHORIZE_CLINICAL_IMAGING_ORDERS);
		if (!canAuthoriseClinImaging)
			return ORDERSTATE.REQUESTING_AUTHORISATION;

	}
	if (doesOrderContainInvType(Category.PATHOLOGY))
	{
		boolean canAuthorisePathology = engine.hasRight(AppRight.CAN_AUTHORIZE_PATHOLOGY_ORDERS);
		if (!canAuthorisePathology)
			return ORDERSTATE.REQUESTING_AUTHORISATION;
	}

	return ORDERSTATE.AUTHORISING;
}
 
Example 44
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean doesOrderContainInvType(Category category)
{
	if (category == null)
		return false;

	OrderInvestigationVoCollection voCollOrderInvest = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	if (voCollOrderInvest == null)
		return false;

	boolean isClinicalImagingFound = false;
	for (int i = 0; i < voCollOrderInvest.size(); i++)
	{
		if (voCollOrderInvest.get(i).getOrdInvCurrentStatus() == null
				|| (!OrderInvStatus.CANCEL_REQUEST.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus())))
		{
			if (voCollOrderInvest.get(i).getInvestigationIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(category))
			{
				isClinicalImagingFound = true;
				break;
			}
		}
	}

	return isClinicalImagingFound;
}
 
Example 45
Project: openMAXIMS   File: ResultCommentsDialogImpl.java   Source Code and License 6 votes vote down vote up
public void removeComment(OcsPathRadResultVo result, ResultCommentsVo comment) throws StaleObjectException, ForeignKeyViolationException
{
	if (result == null)
		throw new DomainRuntimeException("Can not remove comment from null parent.");
	

	if (Category.PATHOLOGY.equals(result.getCategory()))
	{
		removeComentFromOrderSpecimen(result, comment);
		return;
	}
	
	if (Category.CLINICALIMAGING.equals(result.getCategory()))
	{
		removeCommentFromOrderInvestigation(result, comment);
		return;
	}
	
	return;
}
 
Example 46
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	//wdev-11861
	if(formName.equals(form.getForms().OCRR.OrderSummaryDialog))
	{
		if(result.equals(DialogResult.OK) || result.equals(DialogResult.CANCEL))
		{
			if(validateUISearchCriteria() == false)
				return;
			form.getLocalContext().setPrintingContext(null);
			
			
			//wdev-11986
			// WDEV-12692 - Pass 'From Date' and 'To Date' as search criteria
			populateOrdersGrid(domain.listPathologyOrderInvestigation(form.cmbService().getValue(),form.cmbDepartment().getValue(), Category.PATHOLOGY, form.dteFrom().getValue(), form.dteTo().getValue()));
			//-------------
			
			enablePrintButton();
		}
	}
	//----
	
}
 
Example 47
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadDiscipline(Category value)
{
	form.cmbDiscipline().clear();
	if (value == null)
		return;

	ServiceShortVoCollection voCollServiceShort = new ServiceShortVoCollection();

	//WDEV-17122
	if (form.cmbCategory().getValue().equals(Category.PATHOLOGY))
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.PATHOLOGY_DISCIPLINE);
	else if (Category.CLINICALIMAGING.equals(form.cmbCategory().getValue()))
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.RADIOLOGY_MODALITY);
	else
		voCollServiceShort = domain.listServiceforCategoryByType(ServiceCategory.CLINICAL);

	for (int i = 0; i < voCollServiceShort.size(); i++)
	{
		form.cmbDiscipline().newRow(voCollServiceShort.get(i), voCollServiceShort.get(i).getServiceName());
	}

}
 
Example 48
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private boolean doesOrderContainInvType(Category category)
{
	if (category == null)
		return false;

	OrderInvestigationVoCollection voCollOrderInvest = form.getGlobalContext().OCRR.getOrderInvestigationCollection();

	if (voCollOrderInvest == null)
		return false;

	boolean isClinicalImagingFound = false;
	for (int i = 0; i < voCollOrderInvest.size(); i++)
	{
		if (voCollOrderInvest.get(i).getOrdInvCurrentStatus() == null
				|| (!OrderInvStatus.CANCEL_REQUEST.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus()) && !OrderInvStatus.CANCELLED.equals(voCollOrderInvest.get(i).getOrdInvCurrentStatus().getOrdInvStatus())))
		{
			if (voCollOrderInvest.get(i).getInvestigationIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndexIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voCollOrderInvest.get(i).getInvestigation().getInvestigationIndex().getCategory().equals(category))
			{
				isClinicalImagingFound = true;
				break;
			}
		}
	}

	return isClinicalImagingFound;
}
 
Example 49
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private ORDERSTATE getOcsOrderAuthorisingState()
{
	if (doesOrderContainInvType(Category.CLINICALIMAGING))
	{
		boolean canAuthoriseClinImaging = engine.hasRight(AppRight.CAN_AUTHORIZE_CLINICAL_IMAGING_ORDERS);
		if (!canAuthoriseClinImaging)
			return ORDERSTATE.REQUESTING_AUTHORISATION;

	}
	if (doesOrderContainInvType(Category.PATHOLOGY))
	{
		boolean canAuthorisePathology = engine.hasRight(AppRight.CAN_AUTHORIZE_PATHOLOGY_ORDERS);
		if (!canAuthorisePathology)
			return ORDERSTATE.REQUESTING_AUTHORISATION;
	}

	return ORDERSTATE.AUTHORISING;
}
 
Example 50
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdOrderInvestigationMutableComboBoxSelected(int column, grdOrderInvestigationRow row, Object value) throws PresentationLogicException
{
	if (value != null && Category.PATHOLOGY.equals(row.getcolComponent().getCategory()) && Boolean.FALSE.equals(form.getLocalContext().getPathologyChanged()))
	{
		form.getLocalContext().setPathologyChanged(changePrioritiesForCategory(value, Category.PATHOLOGY));
	}
	else if (value != null && Category.CLINICALIMAGING.equals(row.getcolComponent().getCategory()) && Boolean.FALSE.equals(form.getLocalContext().getRadioloyChanged()))
	{
		form.getLocalContext().setRadioloyChanged(changePrioritiesForCategory(value, Category.CLINICALIMAGING));
	}
	else if (value != null && Category.CLINICAL.equals(row.getcolComponent().getCategory()) && Boolean.FALSE.equals(form.getLocalContext().getClinicalChanged()))
	{
		form.getLocalContext().setClinicalChanged(changePrioritiesForCategory(value, Category.CLINICAL));
	}
}
 
Example 51
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadDiscipline(Category value)
{
	form.cmbDiscipline().clear();

	if(value == null)
		return;
	
	ServiceShortVoCollection voCollServiceShort = new ServiceShortVoCollection();
	
	if(form.cmbCategory().getValue().equals(Category.PATHOLOGY))
		voCollServiceShort = domain.listServiceforLocationByType(LocationType.PATHOLOGYLABORATORY);
	else
		voCollServiceShort = domain.listServiceforLocationByType(LocationType.CLINICALIMAGINGDEPARTMENT);
		
	for(int i=0;i<voCollServiceShort.size();i++)
	{
		form.cmbDiscipline().newRow(voCollServiceShort.get(i), voCollServiceShort.get(i).getServiceName());
	}
}
 
Example 52
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getStatusText(OrderInvStatus ordInvStatus)
{
	if(ordInvStatus == null || form.cmbInvestigation().getValue() == null)
		return null;
	OcsPathRadResultVo item = form.cmbInvestigation().getValue();
	
	if(ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("CARE_UK") || ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("UKSH")) //WDEV-11881
	{
		if(item.getCategoryIsNotNull())
		{
			if(item.getCategory().equals(Category.CLINICALIMAGING))
			{
				if(ordInvStatus.equals(ordInvStatus.ORDERED))
				{
					return "Ready";
				}
			}
			else
				ordInvStatus.getText();
		}
	}
	return ordInvStatus.getText();
}
 
Example 53
Project: openMAXIMS   File: ClinicalOrdersResultsOCRRFormImpl.java   Source Code and License 6 votes vote down vote up
/**
 * listInvestigations
 */
public ims.ocrr.vo.InvestigationIndexLiteVoCollection listInvestigations(String name, Boolean beginWith)
{
	if (name != null)
	{
		name.replaceAll("%", "");

		if (beginWith != null)
			name = (!beginWith ? "%" + name.toUpperCase() + "%" : name.toUpperCase() + "%");
		else
			name = name.toUpperCase() + "%";

	}
	return InvestigationIndexLiteVoAssembler.createInvestigationIndexLiteVoCollectionFromInvestigationIndex(getDomainFactory().find("select distinct i1_1 from InvestigationIndex as i1_1 left join i1_1.synonyms as i2_1 where (i1_1.category = :cat and ((i2_1.upperName like :name and i2_1.activeStatus = :Active) or i1_1.upperName like :name ) and i1_1.activeStatus = :status and i1_1.isProfile = :isProfile) order by i1_1.upperName", new String[] { "name", "cat", "status", "isProfile", "Active" }, new Object[] { name, getDomLookup(Category.CLINICAL), getDomLookup(PreActiveActiveInactiveStatus.ACTIVE), Boolean.FALSE, Boolean.TRUE }));

}
 
Example 54
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void loadLocations(Category value)
{
	LocationLiteVo backup = form.lyrInvestigations().tabGeneralDet().cmbProvider().getValue();//WDEV-12979
	
	form.lyrInvestigations().tabGeneralDet().cmbProvider().clear();

	if (value == null)
		return;

	LocationLiteVoCollection coll = domain.listProvidersByCategory(value);
	for (int i = 0; i < coll.size(); i++)
	{
		form.lyrInvestigations().tabGeneralDet().cmbProvider().newRow(coll.get(i), coll.get(i).getName());
	}
	
	form.lyrInvestigations().tabGeneralDet().cmbProvider().setValue(backup);////WDEV-12979
}
 
Example 55
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	if(formName.equals(form.getForms().OCRR.OrderSummaryDialog))
	{
		if(result.equals(DialogResult.OK))
		{
			if(validateUISearchCriteria() == false)
				return;
			
			form.getLocalContext().setPrintingContext(null);
			
			// WDEV-11643
			populateResultsGrid(domain.listRadOrderInvestigation(form.cmbService().getValue(), form.cmbDepartment().getValue(), Category.CLINICALIMAGING, form.chkCompleted().isVisible() ? form.chkCompleted().getValue() : Boolean.FALSE, form.dteFrom().getValue(), form.dteTo().getValue()));
			
			enablePrintButton();
		}
	}
			
}
 
Example 56
Project: openMAXIMS   File: TestEditImpl.java   Source Code and License 6 votes vote down vote up
public LocationLiteVoCollection listProvidersByCategory(Category lookupCategory)
{
	if (lookupCategory == null)
		return null;

	DomainFactory factory = getDomainFactory();

	java.util.List locations = null;
	LookupInstance type = null;

	if (lookupCategory.equals(Category.PATHOLOGY))
		type = getDomLookup(LocationType.PATHOLOGYLABORATORY);
	else if (lookupCategory.equals(Category.CLINICALIMAGING))
		type = getDomLookup(LocationType.CLINICALIMAGINGDEPARTMENT);
	else if (lookupCategory.equals(Category.CLINICAL))
		type = getDomLookup(LocationType.CLINICAL);

	if (type == null)
		throw new DomainRuntimeException("type id not found (listProvidersByCategory method)");

	locations = factory.find("from Location loc where loc.type = :type", new String[]{"type"}, new Object[]{type});

	return LocationLiteVoAssembler.createLocationLiteVoCollectionFromLocation(locations).sort();
}
 
Example 57
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private SpecimenWorkListItemLiteVo isPathologyAndSpecimenWorkListItemExists(ReferralAppointmentDetailsOrderInvestigationVo voOrderInv)
{
	if(voOrderInv == null)
		throw new CodingRuntimeException("voOrderInv is null in method isPathologyAndSpecimenWorkListItemExists");
	
	if(voOrderInv.getInvestigationIsNotNull() && voOrderInv.getInvestigation().getInvestigationIndexIsNotNull() && voOrderInv.getInvestigation().getInvestigationIndex().getCategoryIsNotNull() && voOrderInv.getInvestigation().getInvestigationIndex().getCategory().equals(Category.PATHOLOGY))
	{
		SpecimenWorkListItemLiteVoCollection voCollWorkList = form.getLocalContext().getCollectedWorkListItems();
		if(voCollWorkList != null)
		{
			for (SpecimenWorkListItemLiteVo voSpecimenWorkListItem : voCollWorkList)
			{
				if(voOrderInv.getSpecimenIsNotNull())
					if(voSpecimenWorkListItem.getSpecimenIsNotNull() && voSpecimenWorkListItem.getSpecimen().equals(voOrderInv.getSpecimen()))
						return voSpecimenWorkListItem;
			}
		}
	}
	return null;
}
 
Example 58
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private String getStatusText(OrderInvStatus ordInvStatus)
{
	if(ordInvStatus == null || form.cmbInvestigation().getValue() == null)
		return null;
	OcsPathRadResultVo item = form.cmbInvestigation().getValue();
	
	if(ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("CARE_UK") || ConfigFlag.UI.ORDER_ENTRY_UI_TYPE.getValue().equals("UKSH")) //WDEV-11881
	{
		if(item.getCategoryIsNotNull())
		{
			if(item.getCategory().equals(Category.CLINICALIMAGING))
			{
				if(ordInvStatus.equals(ordInvStatus.ORDERED))
				{
					return "Ready";
				}
			}
			else
				ordInvStatus.getText();
		}
	}
	return ordInvStatus.getText();
}
 
Example 59
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
protected void onFormDialogClosed(FormName formName, DialogResult result) throws PresentationLogicException 
{
	//wdev-11861
	if(formName.equals(form.getForms().OCRR.OrderSummaryDialog))
	{
		if(result.equals(DialogResult.OK) || result.equals(DialogResult.CANCEL))
		{
			if(validateUISearchCriteria() == false)
				return;
			form.getLocalContext().setPrintingContext(null);
			
			
			//wdev-11986
			// WDEV-12692 - Pass 'From Date' and 'To Date' as search criteria
			populateOrdersGrid(domain.listPathologyOrderInvestigation(form.cmbService().getValue(),form.cmbDepartment().getValue(), Category.PATHOLOGY, form.dteFrom().getValue(), form.dteTo().getValue()));
			//-------------
			
			enablePrintButton();
		}
	}
	//----
	
}
 
Example 60
Project: AvoinApotti   File: OcsIfImpl.java   Source Code and License 5 votes vote down vote up
public void updateNextOrder(OcsOrderSessionRefVo lastOrderVo) throws StaleObjectException 
{
	if (lastOrderVo == null)
		return;
	DomainFactory factory = getDomainFactory();
	
	// wdev-2998
	// We should only update the was Processed value if all specimens
	// and investigations for the order have been dealt with
	// Note that this relies on wdev-3000, i.e. that the isAwaitingCollection value
	// is set to false when a specimen has been collected or cancelled
	String hql = " from OcsOrderSession o join o.specimens spc where spc.isAwaitingCollection is true and o.id = :orderId ";
	List pathLst = factory.find(hql, new String[]{"orderId"}, new Object[]{lastOrderVo.getID_OcsOrderSession()});
	if (pathLst != null && pathLst.size() > 0)
		return;  // There are still some outstanding specimens, so we do not mark the order as processed
		
	hql = " from OcsOrderSession o join o.investigations inv " + 
		" where inv.investigation.investigationIndex.category = :category " +
		" and (inv.wasProcessed is false or inv.wasProcessed is null) "  +
		" and (inv.ordInvCurrentStatus.ordInvStatus = :orderStat or inv.ordInvCurrentStatus.ordInvStatus = :authStat) "+
	    " and o.id = :orderId";
	List radLst = factory.find(hql, new String[]{"orderId", "category", "orderStat", "authStat"},
					new Object[]{lastOrderVo.getID_OcsOrderSession(), getDomLookup(Category.CLINICALIMAGING), getDomLookup(OrderInvStatus.ORDERED), getDomLookup(OrderInvStatus.AWAITING_AUTHORISATION)});
	if (radLst != null && radLst.size() > 0)
		return; // There are still some outstanding investigations, so we do not mark the order as processed
	
	OcsOrderSession domOrder = (OcsOrderSession) factory.getDomainObject(OcsOrderSession.class, lastOrderVo.getID_OcsOrderSession());
	domOrder.setWasProcessed(Boolean.TRUE);
	factory.save(domOrder);
}