Java Code Examples for ims.clinicaladmin.vo.TumourGroupSiteTNMValueListVo

The following are top voted examples for showing how to use ims.clinicaladmin.vo.TumourGroupSiteTNMValueListVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private void addDynamicGridRow(SelectedRecordForOverallStagingDialogVo overall)
{
	if (overall == null)
		return;

	// Create Overall VO to be added to dynamic grid
	TumourGroupSiteOverallStagingVo tumourOverall = new TumourGroupSiteOverallStagingVo();

	// HACK because the TumourGoupOverall Staging is discarding tumour group and tumour site
	tumourOverall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	tumourOverall.setTSite(form.getGlobalContext().ClinicalAdmin.getTumourSite());

	tumourOverall.setIsActive(Boolean.TRUE);

	// Get TNM values
	for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : overall.getTNMValues())
	{
		if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setTVal(tumourGroupSiteTNM);
			continue;
		}

		if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setNVal(tumourGroupSiteTNM);
			continue;
		}

		if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setMVal(tumourGroupSiteTNM);
		}
	}

	// Get Overall Staging
	tumourOverall.setOverallStageDescription(overall.getOverallValue());

	addNewOverallStaging(tumourOverall);
}
 
Example 2
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void addDynamicGridRow(SelectedRecordForOverallStagingDialogVo overall)
{
	if (overall == null)
		return;

	// Create Overall VO to be added to dynamic grid
	TumourGroupSiteOverallStagingVo tumourOverall = new TumourGroupSiteOverallStagingVo();

	// HACK because the TumourGoupOverall Staging is discarding tumour group and tumour site
	tumourOverall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	tumourOverall.setTSite(form.getGlobalContext().ClinicalAdmin.getTumourSite());

	tumourOverall.setIsActive(Boolean.TRUE);

	// Get TNM values
	for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : overall.getTNMValues())
	{
		if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setTVal(tumourGroupSiteTNM);
			continue;
		}

		if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setNVal(tumourGroupSiteTNM);
			continue;
		}

		if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setMVal(tumourGroupSiteTNM);
		}
	}

	// Get Overall Staging
	tumourOverall.setOverallStageDescription(overall.getOverallValue());

	addNewOverallStaging(tumourOverall);
}
 
Example 3
Project: openMAXIMS   File: Logic.java   View source code 5 votes vote down vote up
private void addDynamicGridRow(SelectedRecordForOverallStagingDialogVo overall)
{
	if (overall == null)
		return;

	// Create Overall VO to be added to dynamic grid
	TumourGroupSiteOverallStagingVo tumourOverall = new TumourGroupSiteOverallStagingVo();

	// HACK because the TumourGoupOverall Staging is discarding tumour group and tumour site
	tumourOverall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	tumourOverall.setTSite(form.getGlobalContext().ClinicalAdmin.getTumourSite());

	tumourOverall.setIsActive(Boolean.TRUE);

	// Get TNM values
	for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : overall.getTNMValues())
	{
		if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setTVal(tumourGroupSiteTNM);
			continue;
		}

		if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setNVal(tumourGroupSiteTNM);
			continue;
		}

		if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setMVal(tumourGroupSiteTNM);
		}
	}

	// Get Overall Staging
	tumourOverall.setOverallStageDescription(overall.getOverallValue());

	addNewOverallStaging(tumourOverall);
}
 
Example 4
Project: openmaxims-linux   File: Logic.java   View source code 5 votes vote down vote up
private void addDynamicGridRow(SelectedRecordForOverallStagingDialogVo overall)
{
	if (overall == null)
		return;

	// Create Overall VO to be added to dynamic grid
	TumourGroupSiteOverallStagingVo tumourOverall = new TumourGroupSiteOverallStagingVo();

	// HACK because the TumourGoupOverall Staging is discarding tumour group and tumour site
	tumourOverall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	tumourOverall.setTSite(form.getGlobalContext().ClinicalAdmin.getTumourSite());

	tumourOverall.setIsActive(Boolean.TRUE);

	// Get TNM values
	for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : overall.getTNMValues())
	{
		if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setTVal(tumourGroupSiteTNM);
			continue;
		}

		if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setNVal(tumourGroupSiteTNM);
			continue;
		}

		if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setMVal(tumourGroupSiteTNM);
		}
	}

	// Get Overall Staging
	tumourOverall.setOverallStageDescription(overall.getOverallValue());

	addNewOverallStaging(tumourOverall);
}
 
Example 5
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to populate Pathological Staging TNM Comboboxes
 * Keep this separate from Integrated TNM Comboboxes
 */
private void populateTNMComboboxes(TumourGroupSiteTNMValueListVoCollection tnmValues)
{
	// Clear Pathological TNM Comboboxes
	form.lyrMain().tabTumourDetails().cmbPTValue().clear();
	form.lyrMain().tabTumourDetails().cmbPNValue().clear();
	form.lyrMain().tabTumourDetails().cmbPMValue().clear();
	
	form.lyrMain().tabTumourDetails().cmbTValue().clear();
	form.lyrMain().tabTumourDetails().cmbNValue().clear();
	form.lyrMain().tabTumourDetails().cmbMValue().clear();
	
	// If the TNM values collection passed is null - terminate the function
	if (tnmValues == null)
		return;
	
	for (TumourGroupSiteTNMValueListVo tnmValue : tnmValues)
	{
		boolean noType = !tnmValue.getClinicalPathologicalIsNotNull();
		boolean bothTypes = TNMClinicalpathological.BOTH.equals(tnmValue.getClinicalPathological());
		boolean clinicalType = TNMClinicalpathological.CLINICALONLY.equals(tnmValue.getClinicalPathological());
		boolean pathologicalType = TNMClinicalpathological.PATHOLOGICALONLY.equals(tnmValue.getClinicalPathological());
		
		if (TNMType.T.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPTValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbTValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
		else if (TNMType.N.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPNValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbNValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
		else if (TNMType.M.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPMValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbMValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to populate the Overall Prognostic Grouping values to dynamic grid cell
 * based on the parameters provided
 * 
 * If not all parameters needed are present or the Tumour Group is missing the function will exit
 */
private void setOverallPrognosticValues(TumourGroupListForPrimaryTumourDetailsVo selectedGroup, TumourGroupSiteTNMValueListVo valueT, TumourGroupSiteTNMValueListVo valueN, TumourGroupSiteTNMValueListVo valueM,
													TumourHistologyLiteVo histologyType, HistopathologicGradeVo histologyGrade, PrognosticLocationConfigVo location, PrognosticRiskConfigVo risk, PSAConfigVo psa, GleasonConfigLiteVo gleason)
{
	// Get cell for Overall Prognostic records
	DynamicGridRow row = getPrognosticRowByIdentifier(ROW_IDENTIF_PROGNOSTIC_OVERALL_PROGNOSTIC);
	DynamicGridColumn column = getPrognosticColumnByIdentifier(COLTYPE_VALUE);
	DynamicGridCell cell = getColumnCellFromRow(row, column);
	
	if (cell == null)
		return;
	
	// Clear cell previous Prognostic Value records
	cell.getItems().clear();
	cell.setValue(null);
	
	// Check if group is not null, requires prognostic grouping and prognostic grouping configuration is present
	if (selectedGroup == null || !Boolean.TRUE.equals(selectedGroup.getIsPrognosticGroupingRelevant()) || !selectedGroup.getPrognosticGroupingConfigIsNotNull())
		return;
	
	// Set a reference to prognostic reference
	PrognosticGroupingCongfigVo prognosticConfig = selectedGroup.getPrognosticGroupingConfig();

	// Set boolean values for requiring parameters 
	boolean requiresTValue			= Boolean.TRUE.equals(prognosticConfig.getUseTValues());
	boolean requiresNValue			= Boolean.TRUE.equals(prognosticConfig.getUseNValues());
	boolean requiresMValue			= Boolean.TRUE.equals(prognosticConfig.getUseMValues());
	boolean requiresLocation		= Boolean.TRUE.equals(prognosticConfig.getIsTumourLocationPertinent());
	boolean requiresRiskCategory	= Boolean.TRUE.equals(prognosticConfig.getIsRiskCategoryPertinent());
	boolean requiresPSA				= Boolean.TRUE.equals(prognosticConfig.getIsPSAPertinent());
	boolean requiresGleason			= Boolean.TRUE.equals(prognosticConfig.getIsGleasonPertinent());
	boolean requiresHistologyType	= Boolean.TRUE.equals(prognosticConfig.getIsHistologicalTypePertinent());
	boolean requiresHistologyGrade	= Boolean.TRUE.equals(prognosticConfig.getIsHistologicalGradePertinent());
	
	
	// Check parameters needed for Overall Prognostic
	if ((requiresTValue && valueT == null) || (requiresNValue && valueN == null) || (requiresMValue && valueM == null)														// Check T, N, M values
			|| (requiresLocation && location == null) || (requiresRiskCategory && risk == null) || (requiresPSA && psa == null)	|| (requiresGleason && gleason == null)		// Check location, risk, PSA and gleason
			|| (requiresHistologyType && histologyType == null) || (requiresHistologyGrade && histologyGrade == null))														// Check histology type, histology grade
		return;
	
	// Get data from domain (for the values not relevant for prognostic grouping pass null - or else the query will fail)
	OverallPrognosticGroupingLiteVoCollection overallPrognostic = domain.getOverallPrognostic(selectedGroup,
			requiresTValue ? valueT : null,
			requiresNValue ? valueN : null,
			requiresMValue ?	valueM : null,
			requiresHistologyType ? histologyType : null,
			requiresHistologyGrade ? histologyGrade : null,
			requiresLocation ? location : null,
			requiresRiskCategory ? risk : null,
			requiresPSA ? psa : null,
			requiresGleason ? gleason : null);
	
	// Check Overall Prognostic records
	if (overallPrognostic != null)
	{
		for (OverallPrognosticGroupingLiteVo prognostic : overallPrognostic)
		{
			cell.getItems().newItem(prognostic, prognostic.toString());
		}
		
		if (overallPrognostic.size() == 1)
		{
			cell.setValue(overallPrognostic.get(0));
		}
	}
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to retrieve Overall Prognostic 
 * @return
 */
private OverallPrognosticData getPrognosticDataFromScreen()
{
	OverallPrognosticData result = new OverallPrognosticData();
	
	result.setHistologyType(form.lyrMain().tabTumourDetails().cmbTumourHistologyType().getValue());
	result.setHistopatologyGrade(form.lyrMain().tabTumourDetails().cmbTumourHistologyGrade().getValue());
	
	DynamicGrid prognosticDynamicGrid = form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabPrognosticTab().dyngrdPrognosticPreTreatment();
	DynamicGridColumn column = prognosticDynamicGrid.getColumns().getByIdentifier(COLTYPE_VALUE);

	for (int i = 0; i < prognosticDynamicGrid.getRows().size(); i++)
	{
		DynamicGridRow row = prognosticDynamicGrid.getRows().get(i);
		DynamicGridCell cell = row.getCells().get(column);

		// Keep this check - Exception crash to force 
		// setting an identifier to a row when it's created
		if (!(row.getIdentifier() instanceof Integer))
			throw new CodingRuntimeException("Logical error - Make sure to set an Integer identifier to prognostic rows in dynamic grid");

		switch ((Integer)row.getIdentifier())
		{
			case ROW_IDENTIF_TNM_T:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setTValue((TumourGroupSiteTNMValueListVo) cell.getValue());

				break;
				
			case ROW_IDENTIF_TNM_N:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setNValue((TumourGroupSiteTNMValueListVo) cell.getValue());
				
				break;

			case ROW_IDENTIF_TNM_M:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setMValue((TumourGroupSiteTNMValueListVo) cell.getValue());

				break;
				
			case ROW_IDENTIF_PROGNOSTIC_LOCATION:
				// Set prognostic location value to record to save
				if (cell.getValue() instanceof PrognosticLocationConfigVo)
					result.setPrognosticLocation((PrognosticLocationConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_RISK:
				// Set prognostic risk value to record to save
				if (cell.getValue() instanceof PrognosticRiskConfigVo)
					result.setPrognosticRisk((PrognosticRiskConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_PSA:
				// Set Prognostic PSA
				if (cell.getValue() instanceof PSAConfigVo)
					result.setPrognosticPSA((PSAConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_GLEASON:
				// Set Prognostic Gleason
				if (cell.getValue() instanceof GleasonConfigLiteVo)
					result.setPrognosticGleason((GleasonConfigLiteVo) cell.getValue());
				
				break;
			}
		}
	
	return result;
}
 
Example 8
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private void generateDefaultRecords(TumourGroupVo group, TumourSiteVo site)
{
	// Check group parameter
	if (site == null)
		return;

	// Separate T, N and M collection values
	TumourGroupSiteTNMValueListVoCollection TValues = new TumourGroupSiteTNMValueListVoCollection();
	TumourGroupSiteTNMValueListVoCollection NValues = new TumourGroupSiteTNMValueListVoCollection();
	TumourGroupSiteTNMValueListVoCollection MValues = new TumourGroupSiteTNMValueListVoCollection();

	if (site.getTNMValuesIsNotNull())
	{
		for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : site.getTNMValues())
		{
			// WDEV-13259
			// Pathological T, N, M values are not used for OverallStaging so exclude them
			if (TNMClinicalpathological.PATHOLOGICALONLY.equals(tumourGroupSiteTNM.getClinicalPathological()))
				continue;
			
			if (!Boolean.TRUE.equals(tumourGroupSiteTNM.getIsActive()))
				continue;

			if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
			{
				TValues.add(tumourGroupSiteTNM);
				continue;
			}

			if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
			{
				NValues.add(tumourGroupSiteTNM);
				continue;
			}

			if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
			{
				MValues.add(tumourGroupSiteTNM);
			}
		}
	}

	// Check T values
	if (TValues == null || TValues.size() == 0)
	{
		engine.showMessage("No TNM T Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}
	// Check N values
	if (NValues == null || NValues.size() == 0)
	{
		engine.showMessage("No TNM N Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}
	// Check M values
	if (MValues == null || MValues.size() == 0)
	{
		engine.showMessage("No TNM M Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}

	for (int indexTVal = 0; indexTVal < TValues.size(); indexTVal++)
	{
		for (int indexNVal = 0; indexNVal < NValues.size(); indexNVal++)
		{
			for (int indexMVal = 0; indexMVal < MValues.size(); indexMVal++)
			{
				addOverallStagingRow(TValues.get(indexTVal), NValues.get(indexNVal), MValues.get(indexMVal));
			}
		}
	}
}
 
Example 9
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private void addOverallStagingRow(TumourGroupSiteTNMValueListVo tValue, TumourGroupSiteTNMValueListVo nValue, TumourGroupSiteTNMValueListVo mValue)
{
	// Create new row
	DynamicGridRow overallRow = form.dyngrdOverall().getRows().newRow();

	// Create overall value
	TumourGroupSiteOverallStagingVo overall = new TumourGroupSiteOverallStagingVo();

	// Create cell for T value
	DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_T_VALUE);
	DynamicGridCell cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(tValue != null ? tValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setTVal(tValue);

	// Create cell for N value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_N_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(nValue != null ? nValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setNVal(nValue);

	// Create cell for M value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_M_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(mValue != null ? mValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setMVal(mValue);

	// WDEV-13091
	// Only T, N, M values are relevant for an Overall Staging recorded at Tumour Site level
	// The rest of the values were removed

	// Create cell for Overall Staging value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
	cell = overallRow.getCells().newCell(column, DynamicCellType.ENUMERATION);
	cell.setAutoPostBack(true);

	bindOverallValue(cell);
	cell.setValue(LookupHelper.getTumourOverallStage(domain.getLookupService()));
	cell.setIdentifier(LookupHelper.getTumourOverallStage(domain.getLookupService()));

	overall.setIsActive(Boolean.TRUE);
	overall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	overall.setTSite(form.getGlobalContext().ClinicalAdmin.getTumourSite());

	overallRow.setValue(overall);
}
 
Example 10
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function that will check if the combination is unique (has not been recorded or at least is not active)
 * Re-written in WDEV-12152
 */
private boolean checkIfIsUnique(SelectedRecordForOverallStagingDialogVo record) 
{
	if (!form.getGlobalContext().Oncology.getOverallStagingDynamicGridCollectionIsNotNull())
		return true;
	
	TumourGroupSiteForOverallStagingDialogVo tumourGroup = form.getLocalContext().getSelectedGroup();
	TumourSiteVo tumourSite = form.getLocalContext().getSelectedSite();
	
	// WDEV-13091
	// Histology Type, Histology Grade, Serum Marker and Over 45 are required only for Overall Staging recorded at Tumour Group level
	// They should be ignored for Overall Staging records at Tumour Site level
	boolean requiredHistologyType = Boolean.TRUE.equals(tumourGroup.getTnmRequiresHisto()) && tumourSite == null;
	boolean requiredHistologyGrade = Boolean.TRUE.equals(tumourGroup.getTnmRequiresDiff()) && tumourSite == null;
	boolean requiredSerumMarker = Boolean.TRUE.equals(tumourGroup.getTnmRequiresSMarkers() && tumourSite == null);
	boolean requiredOver45 = Boolean.TRUE.equals(tumourGroup.getTnmRequiresOver45()) && tumourSite == null;
	
	for (TumourGroupSiteOverallStagingVo overallStaging : form.getGlobalContext().Oncology.getOverallStagingDynamicGridCollection())
	{
		if (!Boolean.TRUE.equals(overallStaging.getIsActive()))
			continue;
		
		boolean matchTVal = false;
		boolean matchNVal = false;
		boolean matchMVal = false;
		boolean matchHistologyType = false;
		boolean matchHistologyGrade = false;
		boolean matchSerumMarker = false;
		boolean matchOver45 = false;
		
		for (TumourGroupSiteTNMValueListVo valueTNM : record.getTNMValues())
		{
			if (TNMType.T.equals(valueTNM.getTNMType()) && overallStaging.getTVal() != null && overallStaging.getTVal().equals(valueTNM))	//wdev-13091
				matchTVal = true;
			
			if (TNMType.N.equals(valueTNM.getTNMType()) && overallStaging.getNVal() != null && overallStaging.getNVal().equals(valueTNM))	//wdev-13091
				matchNVal = true;
			
			if (TNMType.M.equals(valueTNM.getTNMType()) && overallStaging.getMVal() != null && overallStaging.getMVal().equals(valueTNM))	//wdev-13091
				matchMVal = true;
		}
		
		if (requiredHistologyType && overallStaging.getHistVal() != null && overallStaging.getHistVal().equals(record.getHistologyValue()))	//wdev-13091
			matchHistologyType = true;
		
		if (requiredHistologyGrade && overallStaging.getDiffVal() != null && overallStaging.getDiffVal().equals(record.getDifferentationValue())) //wdev-13091
			matchHistologyGrade = true;
		
		if (requiredSerumMarker && overallStaging.getSerumMarkerVal() != null && overallStaging.getSerumMarkerVal().equals(record.getSerumMarker()))  //wdev-13091
			matchSerumMarker = true;
		
		if (requiredOver45)			// This is because someone never heard of Boolean and uses string "Y" or "N" :))
		{							// And it's too much of a hassle to change it - maybe someday
			if (overallStaging.getO45() != null && overallStaging.getO45().toUpperCase().equals("Y") && Boolean.TRUE.equals(record.getOver45()))   //wdev-13091
				matchOver45 = true;
			
			if (overallStaging.getO45() != null && overallStaging.getO45().toUpperCase().equals("N") && Boolean.FALSE.equals(record.getOver45()))	//wdev-13091
				matchOver45 = true;
		}
		
		if (matchTVal && matchNVal && matchMVal && (requiredHistologyType ? matchHistologyType : true)
				&& (requiredHistologyGrade ? matchHistologyGrade : true) && (requiredSerumMarker ? matchSerumMarker : true)
				&& (requiredOver45 ? matchOver45 : true))
			return false;
	}
	
	return true;
}
 
Example 11
Project: AvoinApotti   File: Logic.java   View source code 4 votes vote down vote up
private void addDynamicGridRow(SelectedRecordForOverallStagingDialogVo overall)
{
	if (overall == null)
		return;

	// Create Overall VO to be added to dynamic grid
	TumourGroupSiteOverallStagingVo tumourOverall = new TumourGroupSiteOverallStagingVo();

	// HACK because the TumourGoupOverall Staging is discarding tumour group and tumour site
	tumourOverall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	tumourOverall.setTSite(null);
	
	tumourOverall.setIsActive(Boolean.TRUE);

	// Get TNM values
	for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : overall.getTNMValues())
	{
		if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setTVal(tumourGroupSiteTNM);
			continue;
		}
		
		if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setNVal(tumourGroupSiteTNM);
			continue;
		}
		
		if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setMVal(tumourGroupSiteTNM);
		}
	}
	
	// Get Histology Type
	tumourOverall.setHistVal(overall.getHistologyValue());
	// Get Histology Grade
	tumourOverall.setDiffVal(overall.getDifferentationValue());
	// Get Serum Marker
	tumourOverall.setSerumMarkerVal(overall.getSerumMarker());
	// Get Over 45
	tumourOverall.setO45(Boolean.TRUE.equals(overall.getOver45()) ? "Y" : "N");
	
	// Get Overall Staging
	tumourOverall.setOverallStageDescription(overall.getOverallValue());
	
	addNewOverallStaging(tumourOverall);
}
 
Example 12
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to populate Pathological Staging TNM Comboboxes
 * Keep this separate from Integrated TNM Comboboxes
 */
private void populateTNMComboboxes(TumourGroupSiteTNMValueListVoCollection tnmValues)
{
	// Clear Pathological TNM Comboboxes
	form.lyrMain().tabTumourDetails().cmbPTValue().clear();
	form.lyrMain().tabTumourDetails().cmbPNValue().clear();
	form.lyrMain().tabTumourDetails().cmbPMValue().clear();
	
	form.lyrMain().tabTumourDetails().cmbTValue().clear();
	form.lyrMain().tabTumourDetails().cmbNValue().clear();
	form.lyrMain().tabTumourDetails().cmbMValue().clear();
	
	// If the TNM values collection passed is null - terminate the function
	if (tnmValues == null)
		return;
	
	for (TumourGroupSiteTNMValueListVo tnmValue : tnmValues)
	{
		boolean noType = !tnmValue.getClinicalPathologicalIsNotNull();
		boolean bothTypes = TNMClinicalpathological.BOTH.equals(tnmValue.getClinicalPathological());
		boolean clinicalType = TNMClinicalpathological.CLINICALONLY.equals(tnmValue.getClinicalPathological());
		boolean pathologicalType = TNMClinicalpathological.PATHOLOGICALONLY.equals(tnmValue.getClinicalPathological());
		
		if (TNMType.T.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPTValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbTValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
		else if (TNMType.N.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPNValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbNValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
		else if (TNMType.M.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPMValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbMValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
	}
}
 
Example 13
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to populate the Overall Prognostic Grouping values to dynamic grid cell
 * based on the parameters provided
 * 
 * If not all parameters needed are present or the Tumour Group is missing the function will exit
 */
private void setOverallPrognosticValues(TumourGroupListForPrimaryTumourDetailsVo selectedGroup, TumourGroupSiteTNMValueListVo valueT, TumourGroupSiteTNMValueListVo valueN, TumourGroupSiteTNMValueListVo valueM,
													TumourHistologyLiteVo histologyType, HistopathologicGradeVo histologyGrade, PrognosticLocationConfigVo location, PrognosticRiskConfigVo risk, PSAConfigVo psa, GleasonConfigLiteVo gleason)
{
	// Get cell for Overall Prognostic records
	DynamicGridRow row = getPrognosticRowByIdentifier(ROW_IDENTIF_PROGNOSTIC_OVERALL_PROGNOSTIC);
	DynamicGridColumn column = getPrognosticColumnByIdentifier(COLTYPE_VALUE);
	DynamicGridCell cell = getColumnCellFromRow(row, column);
	
	if (cell == null)
		return;
	
	// Clear cell previous Prognostic Value records
	cell.getItems().clear();
	cell.setValue(null);
	
	// Check if group is not null, requires prognostic grouping and prognostic grouping configuration is present
	if (selectedGroup == null || !Boolean.TRUE.equals(selectedGroup.getIsPrognosticGroupingRelevant()) || !selectedGroup.getPrognosticGroupingConfigIsNotNull())
		return;
	
	// Set a reference to prognostic reference
	PrognosticGroupingCongfigVo prognosticConfig = selectedGroup.getPrognosticGroupingConfig();

	// Set boolean values for requiring parameters 
	boolean requiresTValue			= Boolean.TRUE.equals(prognosticConfig.getUseTValues());
	boolean requiresNValue			= Boolean.TRUE.equals(prognosticConfig.getUseNValues());
	boolean requiresMValue			= Boolean.TRUE.equals(prognosticConfig.getUseMValues());
	boolean requiresLocation		= Boolean.TRUE.equals(prognosticConfig.getIsTumourLocationPertinent());
	boolean requiresRiskCategory	= Boolean.TRUE.equals(prognosticConfig.getIsRiskCategoryPertinent());
	boolean requiresPSA				= Boolean.TRUE.equals(prognosticConfig.getIsPSAPertinent());
	boolean requiresGleason			= Boolean.TRUE.equals(prognosticConfig.getIsGleasonPertinent());
	boolean requiresHistologyType	= Boolean.TRUE.equals(prognosticConfig.getIsHistologicalTypePertinent());
	boolean requiresHistologyGrade	= Boolean.TRUE.equals(prognosticConfig.getIsHistologicalGradePertinent());
	
	
	// Check parameters needed for Overall Prognostic
	if ((requiresTValue && valueT == null) || (requiresNValue && valueN == null) || (requiresMValue && valueM == null)														// Check T, N, M values
			|| (requiresLocation && location == null) || (requiresRiskCategory && risk == null) || (requiresPSA && psa == null)	|| (requiresGleason && gleason == null)		// Check location, risk, PSA and gleason
			|| (requiresHistologyType && histologyType == null) || (requiresHistologyGrade && histologyGrade == null))														// Check histology type, histology grade
		return;
	
	// Get data from domain (for the values not relevant for prognostic grouping pass null - or else the query will fail)
	OverallPrognosticGroupingLiteVoCollection overallPrognostic = domain.getOverallPrognostic(selectedGroup,
			requiresTValue ? valueT : null,
			requiresNValue ? valueN : null,
			requiresMValue ?	valueM : null,
			requiresHistologyType ? histologyType : null,
			requiresHistologyGrade ? histologyGrade : null,
			requiresLocation ? location : null,
			requiresRiskCategory ? risk : null,
			requiresPSA ? psa : null,
			requiresGleason ? gleason : null);
	
	// Check Overall Prognostic records
	if (overallPrognostic != null)
	{
		for (OverallPrognosticGroupingLiteVo prognostic : overallPrognostic)
		{
			cell.getItems().newItem(prognostic, prognostic.toString());
		}
		
		if (overallPrognostic.size() == 1)
		{
			cell.setValue(overallPrognostic.get(0));
		}
	}
}
 
Example 14
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to retrieve Overall Prognostic 
 * @return
 */
private OverallPrognosticData getPrognosticDataFromScreen()
{
	OverallPrognosticData result = new OverallPrognosticData();
	
	result.setHistologyType(form.lyrMain().tabTumourDetails().cmbTumourHistologyType().getValue());
	result.setHistopatologyGrade(form.lyrMain().tabTumourDetails().cmbTumourHistologyGrade().getValue());
	
	DynamicGrid prognosticDynamicGrid = form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabPrognosticTab().dyngrdPrognosticPreTreatment();
	DynamicGridColumn column = prognosticDynamicGrid.getColumns().getByIdentifier(COLTYPE_VALUE);

	for (int i = 0; i < prognosticDynamicGrid.getRows().size(); i++)
	{
		DynamicGridRow row = prognosticDynamicGrid.getRows().get(i);
		DynamicGridCell cell = row.getCells().get(column);

		// Keep this check - Exception crash to force 
		// setting an identifier to a row when it's created
		if (!(row.getIdentifier() instanceof Integer))
			throw new CodingRuntimeException("Logical error - Make sure to set an Integer identifier to prognostic rows in dynamic grid");

		switch ((Integer)row.getIdentifier())
		{
			case ROW_IDENTIF_TNM_T:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setTValue((TumourGroupSiteTNMValueListVo) cell.getValue());

				break;
				
			case ROW_IDENTIF_TNM_N:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setNValue((TumourGroupSiteTNMValueListVo) cell.getValue());
				
				break;

			case ROW_IDENTIF_TNM_M:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setMValue((TumourGroupSiteTNMValueListVo) cell.getValue());

				break;
				
			case ROW_IDENTIF_PROGNOSTIC_LOCATION:
				// Set prognostic location value to record to save
				if (cell.getValue() instanceof PrognosticLocationConfigVo)
					result.setPrognosticLocation((PrognosticLocationConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_RISK:
				// Set prognostic risk value to record to save
				if (cell.getValue() instanceof PrognosticRiskConfigVo)
					result.setPrognosticRisk((PrognosticRiskConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_PSA:
				// Set Prognostic PSA
				if (cell.getValue() instanceof PSAConfigVo)
					result.setPrognosticPSA((PSAConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_GLEASON:
				// Set Prognostic Gleason
				if (cell.getValue() instanceof GleasonConfigLiteVo)
					result.setPrognosticGleason((GleasonConfigLiteVo) cell.getValue());
				
				break;
			}
		}
	
	return result;
}
 
Example 15
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void generateDefaultRecords(TumourGroupVo group, TumourSiteVo site)
{
	// Check group parameter
	if (site == null)
		return;

	// Separate T, N and M collection values
	TumourGroupSiteTNMValueListVoCollection TValues = new TumourGroupSiteTNMValueListVoCollection();
	TumourGroupSiteTNMValueListVoCollection NValues = new TumourGroupSiteTNMValueListVoCollection();
	TumourGroupSiteTNMValueListVoCollection MValues = new TumourGroupSiteTNMValueListVoCollection();

	if (site.getTNMValuesIsNotNull())
	{
		for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : site.getTNMValues())
		{
			// WDEV-13259
			// Pathological T, N, M values are not used for OverallStaging so exclude them
			if (TNMClinicalpathological.PATHOLOGICALONLY.equals(tumourGroupSiteTNM.getClinicalPathological()))
				continue;
			
			if (!Boolean.TRUE.equals(tumourGroupSiteTNM.getIsActive()))
				continue;

			if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
			{
				TValues.add(tumourGroupSiteTNM);
				continue;
			}

			if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
			{
				NValues.add(tumourGroupSiteTNM);
				continue;
			}

			if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
			{
				MValues.add(tumourGroupSiteTNM);
			}
		}
	}

	// Check T values
	if (TValues == null || TValues.size() == 0)
	{
		engine.showMessage("No TNM T Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}
	// Check N values
	if (NValues == null || NValues.size() == 0)
	{
		engine.showMessage("No TNM N Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}
	// Check M values
	if (MValues == null || MValues.size() == 0)
	{
		engine.showMessage("No TNM M Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}

	for (int indexTVal = 0; indexTVal < TValues.size(); indexTVal++)
	{
		for (int indexNVal = 0; indexNVal < NValues.size(); indexNVal++)
		{
			for (int indexMVal = 0; indexMVal < MValues.size(); indexMVal++)
			{
				addOverallStagingRow(TValues.get(indexTVal), NValues.get(indexNVal), MValues.get(indexMVal));
			}
		}
	}
}
 
Example 16
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void addOverallStagingRow(TumourGroupSiteTNMValueListVo tValue, TumourGroupSiteTNMValueListVo nValue, TumourGroupSiteTNMValueListVo mValue)
{
	// Create new row
	DynamicGridRow overallRow = form.dyngrdOverall().getRows().newRow();

	// Create overall value
	TumourGroupSiteOverallStagingVo overall = new TumourGroupSiteOverallStagingVo();

	// Create cell for T value
	DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_T_VALUE);
	DynamicGridCell cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(tValue != null ? tValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setTVal(tValue);

	// Create cell for N value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_N_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(nValue != null ? nValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setNVal(nValue);

	// Create cell for M value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_M_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(mValue != null ? mValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setMVal(mValue);

	// WDEV-13091
	// Only T, N, M values are relevant for an Overall Staging recorded at Tumour Site level
	// The rest of the values were removed

	// Create cell for Overall Staging value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
	cell = overallRow.getCells().newCell(column, DynamicCellType.ENUMERATION);
	cell.setAutoPostBack(true);

	bindOverallValue(cell);
	cell.setValue(LookupHelper.getTumourOverallStage(domain.getLookupService()));
	cell.setIdentifier(LookupHelper.getTumourOverallStage(domain.getLookupService()));

	overall.setIsActive(Boolean.TRUE);
	overall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	overall.setTSite(form.getGlobalContext().ClinicalAdmin.getTumourSite());

	overallRow.setValue(overall);
}
 
Example 17
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function that will check if the combination is unique (has not been recorded or at least is not active)
 * Re-written in WDEV-12152
 */
private boolean checkIfIsUnique(SelectedRecordForOverallStagingDialogVo record) 
{
	if (!form.getGlobalContext().Oncology.getOverallStagingDynamicGridCollectionIsNotNull())
		return true;
	
	TumourGroupSiteForOverallStagingDialogVo tumourGroup = form.getLocalContext().getSelectedGroup();
	TumourSiteVo tumourSite = form.getLocalContext().getSelectedSite();
	
	// WDEV-13091
	// Histology Type, Histology Grade, Serum Marker and Over 45 are required only for Overall Staging recorded at Tumour Group level
	// They should be ignored for Overall Staging records at Tumour Site level
	boolean requiredHistologyType = Boolean.TRUE.equals(tumourGroup.getTnmRequiresHisto()) && tumourSite == null;
	boolean requiredHistologyGrade = Boolean.TRUE.equals(tumourGroup.getTnmRequiresDiff()) && tumourSite == null;
	boolean requiredSerumMarker = Boolean.TRUE.equals(tumourGroup.getTnmRequiresSMarkers() && tumourSite == null);
	boolean requiredOver45 = Boolean.TRUE.equals(tumourGroup.getTnmRequiresOver45()) && tumourSite == null;
	
	for (TumourGroupSiteOverallStagingVo overallStaging : form.getGlobalContext().Oncology.getOverallStagingDynamicGridCollection())
	{
		if (!Boolean.TRUE.equals(overallStaging.getIsActive()))
			continue;
		
		boolean matchTVal = false;
		boolean matchNVal = false;
		boolean matchMVal = false;
		boolean matchHistologyType = false;
		boolean matchHistologyGrade = false;
		boolean matchSerumMarker = false;
		boolean matchOver45 = false;
		
		for (TumourGroupSiteTNMValueListVo valueTNM : record.getTNMValues())
		{
			if (TNMType.T.equals(valueTNM.getTNMType()) && overallStaging.getTVal() != null && overallStaging.getTVal().equals(valueTNM))	//wdev-13091
				matchTVal = true;
			
			if (TNMType.N.equals(valueTNM.getTNMType()) && overallStaging.getNVal() != null && overallStaging.getNVal().equals(valueTNM))	//wdev-13091
				matchNVal = true;
			
			if (TNMType.M.equals(valueTNM.getTNMType()) && overallStaging.getMVal() != null && overallStaging.getMVal().equals(valueTNM))	//wdev-13091
				matchMVal = true;
		}
		
		if (requiredHistologyType && overallStaging.getHistVal() != null && overallStaging.getHistVal().equals(record.getHistologyValue()))	//wdev-13091
			matchHistologyType = true;
		
		if (requiredHistologyGrade && overallStaging.getDiffVal() != null && overallStaging.getDiffVal().equals(record.getDifferentationValue())) //wdev-13091
			matchHistologyGrade = true;
		
		if (requiredSerumMarker && overallStaging.getSerumMarkerVal() != null && overallStaging.getSerumMarkerVal().equals(record.getSerumMarker()))  //wdev-13091
			matchSerumMarker = true;
		
		if (requiredOver45)			// This is because someone never heard of Boolean and uses string "Y" or "N" :))
		{							// And it's too much of a hassle to change it - maybe someday
			if (overallStaging.getO45() != null && overallStaging.getO45().toUpperCase().equals("Y") && Boolean.TRUE.equals(record.getOver45()))   //wdev-13091
				matchOver45 = true;
			
			if (overallStaging.getO45() != null && overallStaging.getO45().toUpperCase().equals("N") && Boolean.FALSE.equals(record.getOver45()))	//wdev-13091
				matchOver45 = true;
		}
		
		if (matchTVal && matchNVal && matchMVal && (requiredHistologyType ? matchHistologyType : true)
				&& (requiredHistologyGrade ? matchHistologyGrade : true) && (requiredSerumMarker ? matchSerumMarker : true)
				&& (requiredOver45 ? matchOver45 : true))
			return false;
	}
	
	return true;
}
 
Example 18
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void addDynamicGridRow(SelectedRecordForOverallStagingDialogVo overall)
{
	if (overall == null)
		return;

	// Create Overall VO to be added to dynamic grid
	TumourGroupSiteOverallStagingVo tumourOverall = new TumourGroupSiteOverallStagingVo();

	// HACK because the TumourGoupOverall Staging is discarding tumour group and tumour site
	tumourOverall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	tumourOverall.setTSite(null);
	
	tumourOverall.setIsActive(Boolean.TRUE);

	// Get TNM values
	for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : overall.getTNMValues())
	{
		if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setTVal(tumourGroupSiteTNM);
			continue;
		}
		
		if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setNVal(tumourGroupSiteTNM);
			continue;
		}
		
		if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setMVal(tumourGroupSiteTNM);
		}
	}
	
	// Get Histology Type
	tumourOverall.setHistVal(overall.getHistologyValue());
	// Get Histology Grade
	tumourOverall.setDiffVal(overall.getDifferentationValue());
	// Get Serum Marker
	tumourOverall.setSerumMarkerVal(overall.getSerumMarker());
	// Get Over 45
	tumourOverall.setO45(Boolean.TRUE.equals(overall.getOver45()) ? "Y" : "N");
	
	// Get Overall Staging
	tumourOverall.setOverallStageDescription(overall.getOverallValue());
	
	addNewOverallStaging(tumourOverall);
}
 
Example 19
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to populate Pathological Staging TNM Comboboxes
 * Keep this separate from Integrated TNM Comboboxes
 */
private void populateTNMComboboxes(TumourGroupSiteTNMValueListVoCollection tnmValues)
{
	// Clear Pathological TNM Comboboxes
	form.lyrMain().tabTumourDetails().cmbPTValue().clear();
	form.lyrMain().tabTumourDetails().cmbPNValue().clear();
	form.lyrMain().tabTumourDetails().cmbPMValue().clear();
	
	form.lyrMain().tabTumourDetails().cmbTValue().clear();
	form.lyrMain().tabTumourDetails().cmbNValue().clear();
	form.lyrMain().tabTumourDetails().cmbMValue().clear();
	
	// If the TNM values collection passed is null - terminate the function
	if (tnmValues == null)
		return;
	
	for (TumourGroupSiteTNMValueListVo tnmValue : tnmValues)
	{
		boolean noType = !tnmValue.getClinicalPathologicalIsNotNull();
		boolean bothTypes = TNMClinicalpathological.BOTH.equals(tnmValue.getClinicalPathological());
		boolean clinicalType = TNMClinicalpathological.CLINICALONLY.equals(tnmValue.getClinicalPathological());
		boolean pathologicalType = TNMClinicalpathological.PATHOLOGICALONLY.equals(tnmValue.getClinicalPathological());
		
		if (TNMType.T.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPTValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbTValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
		else if (TNMType.N.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPNValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbNValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
		else if (TNMType.M.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPMValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbMValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
	}
}
 
Example 20
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to populate the Overall Prognostic Grouping values to dynamic grid cell
 * based on the parameters provided
 * 
 * If not all parameters needed are present or the Tumour Group is missing the function will exit
 */
private void setOverallPrognosticValues(TumourGroupListForPrimaryTumourDetailsVo selectedGroup, TumourGroupSiteTNMValueListVo valueT, TumourGroupSiteTNMValueListVo valueN, TumourGroupSiteTNMValueListVo valueM,
													TumourHistologyLiteVo histologyType, HistopathologicGradeVo histologyGrade, PrognosticLocationConfigVo location, PrognosticRiskConfigVo risk, PSAConfigVo psa, GleasonConfigLiteVo gleason)
{
	// Get cell for Overall Prognostic records
	DynamicGridRow row = getPrognosticRowByIdentifier(ROW_IDENTIF_PROGNOSTIC_OVERALL_PROGNOSTIC);
	DynamicGridColumn column = getPrognosticColumnByIdentifier(COLTYPE_VALUE);
	DynamicGridCell cell = getColumnCellFromRow(row, column);
	
	if (cell == null)
		return;
	
	// Clear cell previous Prognostic Value records
	cell.getItems().clear();
	cell.setValue(null);
	
	// Check if group is not null, requires prognostic grouping and prognostic grouping configuration is present
	if (selectedGroup == null || !Boolean.TRUE.equals(selectedGroup.getIsPrognosticGroupingRelevant()) || !selectedGroup.getPrognosticGroupingConfigIsNotNull())
		return;
	
	// Set a reference to prognostic reference
	PrognosticGroupingCongfigVo prognosticConfig = selectedGroup.getPrognosticGroupingConfig();

	// Set boolean values for requiring parameters 
	boolean requiresTValue			= Boolean.TRUE.equals(prognosticConfig.getUseTValues());
	boolean requiresNValue			= Boolean.TRUE.equals(prognosticConfig.getUseNValues());
	boolean requiresMValue			= Boolean.TRUE.equals(prognosticConfig.getUseMValues());
	boolean requiresLocation		= Boolean.TRUE.equals(prognosticConfig.getIsTumourLocationPertinent());
	boolean requiresRiskCategory	= Boolean.TRUE.equals(prognosticConfig.getIsRiskCategoryPertinent());
	boolean requiresPSA				= Boolean.TRUE.equals(prognosticConfig.getIsPSAPertinent());
	boolean requiresGleason			= Boolean.TRUE.equals(prognosticConfig.getIsGleasonPertinent());
	boolean requiresHistologyType	= Boolean.TRUE.equals(prognosticConfig.getIsHistologicalTypePertinent());
	boolean requiresHistologyGrade	= Boolean.TRUE.equals(prognosticConfig.getIsHistologicalGradePertinent());
	
	
	// Check parameters needed for Overall Prognostic
	if ((requiresTValue && valueT == null) || (requiresNValue && valueN == null) || (requiresMValue && valueM == null)														// Check T, N, M values
			|| (requiresLocation && location == null) || (requiresRiskCategory && risk == null) || (requiresPSA && psa == null)	|| (requiresGleason && gleason == null)		// Check location, risk, PSA and gleason
			|| (requiresHistologyType && histologyType == null) || (requiresHistologyGrade && histologyGrade == null))														// Check histology type, histology grade
		return;
	
	// Get data from domain (for the values not relevant for prognostic grouping pass null - or else the query will fail)
	OverallPrognosticGroupingLiteVoCollection overallPrognostic = domain.getOverallPrognostic(selectedGroup,
			requiresTValue ? valueT : null,
			requiresNValue ? valueN : null,
			requiresMValue ?	valueM : null,
			requiresHistologyType ? histologyType : null,
			requiresHistologyGrade ? histologyGrade : null,
			requiresLocation ? location : null,
			requiresRiskCategory ? risk : null,
			requiresPSA ? psa : null,
			requiresGleason ? gleason : null);
	
	// Check Overall Prognostic records
	if (overallPrognostic != null)
	{
		for (OverallPrognosticGroupingLiteVo prognostic : overallPrognostic)
		{
			cell.getItems().newItem(prognostic, prognostic.toString());
		}
		
		if (overallPrognostic.size() == 1)
		{
			cell.setValue(overallPrognostic.get(0));
		}
	}
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to retrieve Overall Prognostic 
 * @return
 */
private OverallPrognosticData getPrognosticDataFromScreen()
{
	OverallPrognosticData result = new OverallPrognosticData();
	
	result.setHistologyType(form.lyrMain().tabTumourDetails().cmbTumourHistologyType().getValue());
	result.setHistopatologyGrade(form.lyrMain().tabTumourDetails().cmbTumourHistologyGrade().getValue());
	
	DynamicGrid prognosticDynamicGrid = form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabPrognosticTab().dyngrdPrognosticPreTreatment();
	DynamicGridColumn column = prognosticDynamicGrid.getColumns().getByIdentifier(COLTYPE_VALUE);

	for (int i = 0; i < prognosticDynamicGrid.getRows().size(); i++)
	{
		DynamicGridRow row = prognosticDynamicGrid.getRows().get(i);
		DynamicGridCell cell = row.getCells().get(column);

		// Keep this check - Exception crash to force 
		// setting an identifier to a row when it's created
		if (!(row.getIdentifier() instanceof Integer))
			throw new CodingRuntimeException("Logical error - Make sure to set an Integer identifier to prognostic rows in dynamic grid");

		switch ((Integer)row.getIdentifier())
		{
			case ROW_IDENTIF_TNM_T:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setTValue((TumourGroupSiteTNMValueListVo) cell.getValue());

				break;
				
			case ROW_IDENTIF_TNM_N:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setNValue((TumourGroupSiteTNMValueListVo) cell.getValue());
				
				break;

			case ROW_IDENTIF_TNM_M:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setMValue((TumourGroupSiteTNMValueListVo) cell.getValue());

				break;
				
			case ROW_IDENTIF_PROGNOSTIC_LOCATION:
				// Set prognostic location value to record to save
				if (cell.getValue() instanceof PrognosticLocationConfigVo)
					result.setPrognosticLocation((PrognosticLocationConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_RISK:
				// Set prognostic risk value to record to save
				if (cell.getValue() instanceof PrognosticRiskConfigVo)
					result.setPrognosticRisk((PrognosticRiskConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_PSA:
				// Set Prognostic PSA
				if (cell.getValue() instanceof PSAConfigVo)
					result.setPrognosticPSA((PSAConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_GLEASON:
				// Set Prognostic Gleason
				if (cell.getValue() instanceof GleasonConfigLiteVo)
					result.setPrognosticGleason((GleasonConfigLiteVo) cell.getValue());
				
				break;
			}
		}
	
	return result;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void generateDefaultRecords(TumourGroupVo group, TumourSiteVo site)
{
	// Check group parameter
	if (site == null)
		return;

	// Separate T, N and M collection values
	TumourGroupSiteTNMValueListVoCollection TValues = new TumourGroupSiteTNMValueListVoCollection();
	TumourGroupSiteTNMValueListVoCollection NValues = new TumourGroupSiteTNMValueListVoCollection();
	TumourGroupSiteTNMValueListVoCollection MValues = new TumourGroupSiteTNMValueListVoCollection();

	if (site.getTNMValuesIsNotNull())
	{
		for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : site.getTNMValues())
		{
			// WDEV-13259
			// Pathological T, N, M values are not used for OverallStaging so exclude them
			if (TNMClinicalpathological.PATHOLOGICALONLY.equals(tumourGroupSiteTNM.getClinicalPathological()))
				continue;
			
			if (!Boolean.TRUE.equals(tumourGroupSiteTNM.getIsActive()))
				continue;

			if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
			{
				TValues.add(tumourGroupSiteTNM);
				continue;
			}

			if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
			{
				NValues.add(tumourGroupSiteTNM);
				continue;
			}

			if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
			{
				MValues.add(tumourGroupSiteTNM);
			}
		}
	}

	// Check T values
	if (TValues == null || TValues.size() == 0)
	{
		engine.showMessage("No TNM T Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}
	// Check N values
	if (NValues == null || NValues.size() == 0)
	{
		engine.showMessage("No TNM N Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}
	// Check M values
	if (MValues == null || MValues.size() == 0)
	{
		engine.showMessage("No TNM M Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}

	for (int indexTVal = 0; indexTVal < TValues.size(); indexTVal++)
	{
		for (int indexNVal = 0; indexNVal < NValues.size(); indexNVal++)
		{
			for (int indexMVal = 0; indexMVal < MValues.size(); indexMVal++)
			{
				addOverallStagingRow(TValues.get(indexTVal), NValues.get(indexNVal), MValues.get(indexMVal));
			}
		}
	}
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void addOverallStagingRow(TumourGroupSiteTNMValueListVo tValue, TumourGroupSiteTNMValueListVo nValue, TumourGroupSiteTNMValueListVo mValue)
{
	// Create new row
	DynamicGridRow overallRow = form.dyngrdOverall().getRows().newRow();

	// Create overall value
	TumourGroupSiteOverallStagingVo overall = new TumourGroupSiteOverallStagingVo();

	// Create cell for T value
	DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_T_VALUE);
	DynamicGridCell cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(tValue != null ? tValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setTVal(tValue);

	// Create cell for N value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_N_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(nValue != null ? nValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setNVal(nValue);

	// Create cell for M value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_M_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(mValue != null ? mValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setMVal(mValue);

	// WDEV-13091
	// Only T, N, M values are relevant for an Overall Staging recorded at Tumour Site level
	// The rest of the values were removed

	// Create cell for Overall Staging value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
	cell = overallRow.getCells().newCell(column, DynamicCellType.ENUMERATION);
	cell.setAutoPostBack(true);

	bindOverallValue(cell);
	cell.setValue(LookupHelper.getTumourOverallStage(domain.getLookupService()));
	cell.setIdentifier(LookupHelper.getTumourOverallStage(domain.getLookupService()));

	overall.setIsActive(Boolean.TRUE);
	overall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	overall.setTSite(form.getGlobalContext().ClinicalAdmin.getTumourSite());

	overallRow.setValue(overall);
}
 
Example 24
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function that will check if the combination is unique (has not been recorded or at least is not active)
 * Re-written in WDEV-12152
 */
private boolean checkIfIsUnique(SelectedRecordForOverallStagingDialogVo record) 
{
	if (!form.getGlobalContext().Oncology.getOverallStagingDynamicGridCollectionIsNotNull())
		return true;
	
	TumourGroupSiteForOverallStagingDialogVo tumourGroup = form.getLocalContext().getSelectedGroup();
	TumourSiteVo tumourSite = form.getLocalContext().getSelectedSite();
	
	// WDEV-13091
	// Histology Type, Histology Grade, Serum Marker and Over 45 are required only for Overall Staging recorded at Tumour Group level
	// They should be ignored for Overall Staging records at Tumour Site level
	boolean requiredHistologyType = Boolean.TRUE.equals(tumourGroup.getTnmRequiresHisto()) && tumourSite == null;
	boolean requiredHistologyGrade = Boolean.TRUE.equals(tumourGroup.getTnmRequiresDiff()) && tumourSite == null;
	boolean requiredSerumMarker = Boolean.TRUE.equals(tumourGroup.getTnmRequiresSMarkers() && tumourSite == null);
	boolean requiredOver45 = Boolean.TRUE.equals(tumourGroup.getTnmRequiresOver45()) && tumourSite == null;
	
	for (TumourGroupSiteOverallStagingVo overallStaging : form.getGlobalContext().Oncology.getOverallStagingDynamicGridCollection())
	{
		if (!Boolean.TRUE.equals(overallStaging.getIsActive()))
			continue;
		
		boolean matchTVal = false;
		boolean matchNVal = false;
		boolean matchMVal = false;
		boolean matchHistologyType = false;
		boolean matchHistologyGrade = false;
		boolean matchSerumMarker = false;
		boolean matchOver45 = false;
		
		for (TumourGroupSiteTNMValueListVo valueTNM : record.getTNMValues())
		{
			if (TNMType.T.equals(valueTNM.getTNMType()) && overallStaging.getTVal() != null && overallStaging.getTVal().equals(valueTNM))	//wdev-13091
				matchTVal = true;
			
			if (TNMType.N.equals(valueTNM.getTNMType()) && overallStaging.getNVal() != null && overallStaging.getNVal().equals(valueTNM))	//wdev-13091
				matchNVal = true;
			
			if (TNMType.M.equals(valueTNM.getTNMType()) && overallStaging.getMVal() != null && overallStaging.getMVal().equals(valueTNM))	//wdev-13091
				matchMVal = true;
		}
		
		if (requiredHistologyType && overallStaging.getHistVal() != null && overallStaging.getHistVal().equals(record.getHistologyValue()))	//wdev-13091
			matchHistologyType = true;
		
		if (requiredHistologyGrade && overallStaging.getDiffVal() != null && overallStaging.getDiffVal().equals(record.getDifferentationValue())) //wdev-13091
			matchHistologyGrade = true;
		
		if (requiredSerumMarker && overallStaging.getSerumMarkerVal() != null && overallStaging.getSerumMarkerVal().equals(record.getSerumMarker()))  //wdev-13091
			matchSerumMarker = true;
		
		if (requiredOver45)			// This is because someone never heard of Boolean and uses string "Y" or "N" :))
		{							// And it's too much of a hassle to change it - maybe someday
			if (overallStaging.getO45() != null && overallStaging.getO45().toUpperCase().equals("Y") && Boolean.TRUE.equals(record.getOver45()))   //wdev-13091
				matchOver45 = true;
			
			if (overallStaging.getO45() != null && overallStaging.getO45().toUpperCase().equals("N") && Boolean.FALSE.equals(record.getOver45()))	//wdev-13091
				matchOver45 = true;
		}
		
		if (matchTVal && matchNVal && matchMVal && (requiredHistologyType ? matchHistologyType : true)
				&& (requiredHistologyGrade ? matchHistologyGrade : true) && (requiredSerumMarker ? matchSerumMarker : true)
				&& (requiredOver45 ? matchOver45 : true))
			return false;
	}
	
	return true;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   View source code 4 votes vote down vote up
private void addDynamicGridRow(SelectedRecordForOverallStagingDialogVo overall)
{
	if (overall == null)
		return;

	// Create Overall VO to be added to dynamic grid
	TumourGroupSiteOverallStagingVo tumourOverall = new TumourGroupSiteOverallStagingVo();

	// HACK because the TumourGoupOverall Staging is discarding tumour group and tumour site
	tumourOverall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	tumourOverall.setTSite(null);
	
	tumourOverall.setIsActive(Boolean.TRUE);

	// Get TNM values
	for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : overall.getTNMValues())
	{
		if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setTVal(tumourGroupSiteTNM);
			continue;
		}
		
		if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setNVal(tumourGroupSiteTNM);
			continue;
		}
		
		if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setMVal(tumourGroupSiteTNM);
		}
	}
	
	// Get Histology Type
	tumourOverall.setHistVal(overall.getHistologyValue());
	// Get Histology Grade
	tumourOverall.setDiffVal(overall.getDifferentationValue());
	// Get Serum Marker
	tumourOverall.setSerumMarkerVal(overall.getSerumMarker());
	// Get Over 45
	tumourOverall.setO45(Boolean.TRUE.equals(overall.getOver45()) ? "Y" : "N");
	
	// Get Overall Staging
	tumourOverall.setOverallStageDescription(overall.getOverallValue());
	
	addNewOverallStaging(tumourOverall);
}
 
Example 26
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to populate Pathological Staging TNM Comboboxes
 * Keep this separate from Integrated TNM Comboboxes
 */
private void populateTNMComboboxes(TumourGroupSiteTNMValueListVoCollection tnmValues)
{
	// Clear Pathological TNM Comboboxes
	form.lyrMain().tabTumourDetails().cmbPTValue().clear();
	form.lyrMain().tabTumourDetails().cmbPNValue().clear();
	form.lyrMain().tabTumourDetails().cmbPMValue().clear();
	
	form.lyrMain().tabTumourDetails().cmbTValue().clear();
	form.lyrMain().tabTumourDetails().cmbNValue().clear();
	form.lyrMain().tabTumourDetails().cmbMValue().clear();
	
	// If the TNM values collection passed is null - terminate the function
	if (tnmValues == null)
		return;
	
	for (TumourGroupSiteTNMValueListVo tnmValue : tnmValues)
	{
		boolean noType = !tnmValue.getClinicalPathologicalIsNotNull();
		boolean bothTypes = TNMClinicalpathological.BOTH.equals(tnmValue.getClinicalPathological());
		boolean clinicalType = TNMClinicalpathological.CLINICALONLY.equals(tnmValue.getClinicalPathological());
		boolean pathologicalType = TNMClinicalpathological.PATHOLOGICALONLY.equals(tnmValue.getClinicalPathological());
		
		if (TNMType.T.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPTValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbTValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
		else if (TNMType.N.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPNValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbNValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
		else if (TNMType.M.equals(tnmValue.getTNMType()))
		{
			if (noType || bothTypes || pathologicalType)
			{
				form.lyrMain().tabTumourDetails().cmbPMValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
			
			if (noType || bothTypes || clinicalType)
			{
				form.lyrMain().tabTumourDetails().cmbMValue().newRow(tnmValue, tnmValue.getTNMValue());
			}
		}
	}
}
 
Example 27
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to populate the Overall Prognostic Grouping values to dynamic grid cell
 * based on the parameters provided
 * 
 * If not all parameters needed are present or the Tumour Group is missing the function will exit
 */
private void setOverallPrognosticValues(TumourGroupListForPrimaryTumourDetailsVo selectedGroup, TumourGroupSiteTNMValueListVo valueT, TumourGroupSiteTNMValueListVo valueN, TumourGroupSiteTNMValueListVo valueM,
													TumourHistologyLiteVo histologyType, HistopathologicGradeVo histologyGrade, PrognosticLocationConfigVo location, PrognosticRiskConfigVo risk, PSAConfigVo psa, GleasonConfigLiteVo gleason)
{
	// Get cell for Overall Prognostic records
	DynamicGridRow row = getPrognosticRowByIdentifier(ROW_IDENTIF_PROGNOSTIC_OVERALL_PROGNOSTIC);
	DynamicGridColumn column = getPrognosticColumnByIdentifier(COLTYPE_VALUE);
	DynamicGridCell cell = getColumnCellFromRow(row, column);
	
	if (cell == null)
		return;
	
	// Clear cell previous Prognostic Value records
	cell.getItems().clear();
	cell.setValue(null);
	
	// Check if group is not null, requires prognostic grouping and prognostic grouping configuration is present
	if (selectedGroup == null || !Boolean.TRUE.equals(selectedGroup.getIsPrognosticGroupingRelevant()) || !selectedGroup.getPrognosticGroupingConfigIsNotNull())
		return;
	
	// Set a reference to prognostic reference
	PrognosticGroupingCongfigVo prognosticConfig = selectedGroup.getPrognosticGroupingConfig();

	// Set boolean values for requiring parameters 
	boolean requiresTValue			= Boolean.TRUE.equals(prognosticConfig.getUseTValues());
	boolean requiresNValue			= Boolean.TRUE.equals(prognosticConfig.getUseNValues());
	boolean requiresMValue			= Boolean.TRUE.equals(prognosticConfig.getUseMValues());
	boolean requiresLocation		= Boolean.TRUE.equals(prognosticConfig.getIsTumourLocationPertinent());
	boolean requiresRiskCategory	= Boolean.TRUE.equals(prognosticConfig.getIsRiskCategoryPertinent());
	boolean requiresPSA				= Boolean.TRUE.equals(prognosticConfig.getIsPSAPertinent());
	boolean requiresGleason			= Boolean.TRUE.equals(prognosticConfig.getIsGleasonPertinent());
	boolean requiresHistologyType	= Boolean.TRUE.equals(prognosticConfig.getIsHistologicalTypePertinent());
	boolean requiresHistologyGrade	= Boolean.TRUE.equals(prognosticConfig.getIsHistologicalGradePertinent());
	
	
	// Check parameters needed for Overall Prognostic
	if ((requiresTValue && valueT == null) || (requiresNValue && valueN == null) || (requiresMValue && valueM == null)														// Check T, N, M values
			|| (requiresLocation && location == null) || (requiresRiskCategory && risk == null) || (requiresPSA && psa == null)	|| (requiresGleason && gleason == null)		// Check location, risk, PSA and gleason
			|| (requiresHistologyType && histologyType == null) || (requiresHistologyGrade && histologyGrade == null))														// Check histology type, histology grade
		return;
	
	// Get data from domain (for the values not relevant for prognostic grouping pass null - or else the query will fail)
	OverallPrognosticGroupingLiteVoCollection overallPrognostic = domain.getOverallPrognostic(selectedGroup,
			requiresTValue ? valueT : null,
			requiresNValue ? valueN : null,
			requiresMValue ?	valueM : null,
			requiresHistologyType ? histologyType : null,
			requiresHistologyGrade ? histologyGrade : null,
			requiresLocation ? location : null,
			requiresRiskCategory ? risk : null,
			requiresPSA ? psa : null,
			requiresGleason ? gleason : null);
	
	// Check Overall Prognostic records
	if (overallPrognostic != null)
	{
		for (OverallPrognosticGroupingLiteVo prognostic : overallPrognostic)
		{
			cell.getItems().newItem(prognostic, prognostic.toString());
		}
		
		if (overallPrognostic.size() == 1)
		{
			cell.setValue(overallPrognostic.get(0));
		}
	}
}
 
Example 28
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function used to retrieve Overall Prognostic 
 * @return
 */
private OverallPrognosticData getPrognosticDataFromScreen()
{
	OverallPrognosticData result = new OverallPrognosticData();
	
	result.setHistologyType(form.lyrMain().tabTumourDetails().cmbTumourHistologyType().getValue());
	result.setHistopatologyGrade(form.lyrMain().tabTumourDetails().cmbTumourHistologyGrade().getValue());
	
	DynamicGrid prognosticDynamicGrid = form.lyrMain().tabTumourDetails().lyrPrognosticTNM().tabPrognosticTab().dyngrdPrognosticPreTreatment();
	DynamicGridColumn column = prognosticDynamicGrid.getColumns().getByIdentifier(COLTYPE_VALUE);

	for (int i = 0; i < prognosticDynamicGrid.getRows().size(); i++)
	{
		DynamicGridRow row = prognosticDynamicGrid.getRows().get(i);
		DynamicGridCell cell = row.getCells().get(column);

		// Keep this check - Exception crash to force 
		// setting an identifier to a row when it's created
		if (!(row.getIdentifier() instanceof Integer))
			throw new CodingRuntimeException("Logical error - Make sure to set an Integer identifier to prognostic rows in dynamic grid");

		switch ((Integer)row.getIdentifier())
		{
			case ROW_IDENTIF_TNM_T:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setTValue((TumourGroupSiteTNMValueListVo) cell.getValue());

				break;
				
			case ROW_IDENTIF_TNM_N:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setNValue((TumourGroupSiteTNMValueListVo) cell.getValue());
				
				break;

			case ROW_IDENTIF_TNM_M:
				if (cell.getValue() instanceof TumourGroupSiteTNMValueListVo)
					result.setMValue((TumourGroupSiteTNMValueListVo) cell.getValue());

				break;
				
			case ROW_IDENTIF_PROGNOSTIC_LOCATION:
				// Set prognostic location value to record to save
				if (cell.getValue() instanceof PrognosticLocationConfigVo)
					result.setPrognosticLocation((PrognosticLocationConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_RISK:
				// Set prognostic risk value to record to save
				if (cell.getValue() instanceof PrognosticRiskConfigVo)
					result.setPrognosticRisk((PrognosticRiskConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_PSA:
				// Set Prognostic PSA
				if (cell.getValue() instanceof PSAConfigVo)
					result.setPrognosticPSA((PSAConfigVo) cell.getValue());
				
				break;
				
			case ROW_IDENTIF_PROGNOSTIC_GLEASON:
				// Set Prognostic Gleason
				if (cell.getValue() instanceof GleasonConfigLiteVo)
					result.setPrognosticGleason((GleasonConfigLiteVo) cell.getValue());
				
				break;
			}
		}
	
	return result;
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private void generateDefaultRecords(TumourGroupVo group, TumourSiteVo site)
{
	// Check group parameter
	if (site == null)
		return;

	// Separate T, N and M collection values
	TumourGroupSiteTNMValueListVoCollection TValues = new TumourGroupSiteTNMValueListVoCollection();
	TumourGroupSiteTNMValueListVoCollection NValues = new TumourGroupSiteTNMValueListVoCollection();
	TumourGroupSiteTNMValueListVoCollection MValues = new TumourGroupSiteTNMValueListVoCollection();

	if (site.getTNMValuesIsNotNull())
	{
		for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : site.getTNMValues())
		{
			// WDEV-13259
			// Pathological T, N, M values are not used for OverallStaging so exclude them
			if (TNMClinicalpathological.PATHOLOGICALONLY.equals(tumourGroupSiteTNM.getClinicalPathological()))
				continue;
			
			if (!Boolean.TRUE.equals(tumourGroupSiteTNM.getIsActive()))
				continue;

			if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
			{
				TValues.add(tumourGroupSiteTNM);
				continue;
			}

			if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
			{
				NValues.add(tumourGroupSiteTNM);
				continue;
			}

			if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
			{
				MValues.add(tumourGroupSiteTNM);
			}
		}
	}

	// Check T values
	if (TValues == null || TValues.size() == 0)
	{
		engine.showMessage("No TNM T Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}
	// Check N values
	if (NValues == null || NValues.size() == 0)
	{
		engine.showMessage("No TNM N Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}
	// Check M values
	if (MValues == null || MValues.size() == 0)
	{
		engine.showMessage("No TNM M Type values exist and they are required to create Overall Staging values.", "Missing data", MessageButtons.OK, MessageIcon.WARNING);
		form.chkDefault().setValue(false);
		return;
	}

	for (int indexTVal = 0; indexTVal < TValues.size(); indexTVal++)
	{
		for (int indexNVal = 0; indexNVal < NValues.size(); indexNVal++)
		{
			for (int indexMVal = 0; indexMVal < MValues.size(); indexMVal++)
			{
				addOverallStagingRow(TValues.get(indexTVal), NValues.get(indexNVal), MValues.get(indexMVal));
			}
		}
	}
}
 
Example 30
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private void addOverallStagingRow(TumourGroupSiteTNMValueListVo tValue, TumourGroupSiteTNMValueListVo nValue, TumourGroupSiteTNMValueListVo mValue)
{
	// Create new row
	DynamicGridRow overallRow = form.dyngrdOverall().getRows().newRow();

	// Create overall value
	TumourGroupSiteOverallStagingVo overall = new TumourGroupSiteOverallStagingVo();

	// Create cell for T value
	DynamicGridColumn column = form.dyngrdOverall().getColumns().getByIdentifier(COL_T_VALUE);
	DynamicGridCell cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(tValue != null ? tValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setTVal(tValue);

	// Create cell for N value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_N_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(nValue != null ? nValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setNVal(nValue);

	// Create cell for M value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_M_VALUE);
	cell = overallRow.getCells().newCell(column, DynamicCellType.STRING);
	cell.setValue(mValue != null ? mValue.getTNMValue() : "");
	cell.setReadOnly(true);
	overall.setMVal(mValue);

	// WDEV-13091
	// Only T, N, M values are relevant for an Overall Staging recorded at Tumour Site level
	// The rest of the values were removed

	// Create cell for Overall Staging value
	column = form.dyngrdOverall().getColumns().getByIdentifier(COL_OVERALL);
	cell = overallRow.getCells().newCell(column, DynamicCellType.ENUMERATION);
	cell.setAutoPostBack(true);

	bindOverallValue(cell);
	cell.setValue(LookupHelper.getTumourOverallStage(domain.getLookupService()));
	cell.setIdentifier(LookupHelper.getTumourOverallStage(domain.getLookupService()));

	overall.setIsActive(Boolean.TRUE);
	overall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	overall.setTSite(form.getGlobalContext().ClinicalAdmin.getTumourSite());

	overallRow.setValue(overall);
}
 
Example 31
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
/**
 * Function that will check if the combination is unique (has not been recorded or at least is not active)
 * Re-written in WDEV-12152
 */
private boolean checkIfIsUnique(SelectedRecordForOverallStagingDialogVo record) 
{
	if (!form.getGlobalContext().Oncology.getOverallStagingDynamicGridCollectionIsNotNull())
		return true;
	
	TumourGroupSiteForOverallStagingDialogVo tumourGroup = form.getLocalContext().getSelectedGroup();
	TumourSiteVo tumourSite = form.getLocalContext().getSelectedSite();
	
	// WDEV-13091
	// Histology Type, Histology Grade, Serum Marker and Over 45 are required only for Overall Staging recorded at Tumour Group level
	// They should be ignored for Overall Staging records at Tumour Site level
	boolean requiredHistologyType = Boolean.TRUE.equals(tumourGroup.getTnmRequiresHisto()) && tumourSite == null;
	boolean requiredHistologyGrade = Boolean.TRUE.equals(tumourGroup.getTnmRequiresDiff()) && tumourSite == null;
	boolean requiredSerumMarker = Boolean.TRUE.equals(tumourGroup.getTnmRequiresSMarkers() && tumourSite == null);
	boolean requiredOver45 = Boolean.TRUE.equals(tumourGroup.getTnmRequiresOver45()) && tumourSite == null;
	
	for (TumourGroupSiteOverallStagingVo overallStaging : form.getGlobalContext().Oncology.getOverallStagingDynamicGridCollection())
	{
		if (!Boolean.TRUE.equals(overallStaging.getIsActive()))
			continue;
		
		boolean matchTVal = false;
		boolean matchNVal = false;
		boolean matchMVal = false;
		boolean matchHistologyType = false;
		boolean matchHistologyGrade = false;
		boolean matchSerumMarker = false;
		boolean matchOver45 = false;
		
		for (TumourGroupSiteTNMValueListVo valueTNM : record.getTNMValues())
		{
			if (TNMType.T.equals(valueTNM.getTNMType()) && overallStaging.getTVal() != null && overallStaging.getTVal().equals(valueTNM))	//wdev-13091
				matchTVal = true;
			
			if (TNMType.N.equals(valueTNM.getTNMType()) && overallStaging.getNVal() != null && overallStaging.getNVal().equals(valueTNM))	//wdev-13091
				matchNVal = true;
			
			if (TNMType.M.equals(valueTNM.getTNMType()) && overallStaging.getMVal() != null && overallStaging.getMVal().equals(valueTNM))	//wdev-13091
				matchMVal = true;
		}
		
		if (requiredHistologyType && overallStaging.getHistVal() != null && overallStaging.getHistVal().equals(record.getHistologyValue()))	//wdev-13091
			matchHistologyType = true;
		
		if (requiredHistologyGrade && overallStaging.getDiffVal() != null && overallStaging.getDiffVal().equals(record.getDifferentationValue())) //wdev-13091
			matchHistologyGrade = true;
		
		if (requiredSerumMarker && overallStaging.getSerumMarkerVal() != null && overallStaging.getSerumMarkerVal().equals(record.getSerumMarker()))  //wdev-13091
			matchSerumMarker = true;
		
		if (requiredOver45)			// This is because someone never heard of Boolean and uses string "Y" or "N" :))
		{							// And it's too much of a hassle to change it - maybe someday
			if (overallStaging.getO45() != null && overallStaging.getO45().toUpperCase().equals("Y") && Boolean.TRUE.equals(record.getOver45()))   //wdev-13091
				matchOver45 = true;
			
			if (overallStaging.getO45() != null && overallStaging.getO45().toUpperCase().equals("N") && Boolean.FALSE.equals(record.getOver45()))	//wdev-13091
				matchOver45 = true;
		}
		
		if (matchTVal && matchNVal && matchMVal && (requiredHistologyType ? matchHistologyType : true)
				&& (requiredHistologyGrade ? matchHistologyGrade : true) && (requiredSerumMarker ? matchSerumMarker : true)
				&& (requiredOver45 ? matchOver45 : true))
			return false;
	}
	
	return true;
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   View source code 4 votes vote down vote up
private void addDynamicGridRow(SelectedRecordForOverallStagingDialogVo overall)
{
	if (overall == null)
		return;

	// Create Overall VO to be added to dynamic grid
	TumourGroupSiteOverallStagingVo tumourOverall = new TumourGroupSiteOverallStagingVo();

	// HACK because the TumourGoupOverall Staging is discarding tumour group and tumour site
	tumourOverall.setTGroup(form.getGlobalContext().ClinicalAdmin.getTumourGroup());
	tumourOverall.setTSite(null);
	
	tumourOverall.setIsActive(Boolean.TRUE);

	// Get TNM values
	for (TumourGroupSiteTNMValueListVo tumourGroupSiteTNM : overall.getTNMValues())
	{
		if (TNMType.T.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setTVal(tumourGroupSiteTNM);
			continue;
		}
		
		if (TNMType.N.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setNVal(tumourGroupSiteTNM);
			continue;
		}
		
		if (TNMType.M.equals(tumourGroupSiteTNM.getTNMType()))
		{
			tumourOverall.setMVal(tumourGroupSiteTNM);
		}
	}
	
	// Get Histology Type
	tumourOverall.setHistVal(overall.getHistologyValue());
	// Get Histology Grade
	tumourOverall.setDiffVal(overall.getDifferentationValue());
	// Get Serum Marker
	tumourOverall.setSerumMarkerVal(overall.getSerumMarker());
	// Get Over 45
	tumourOverall.setO45(Boolean.TRUE.equals(overall.getOver45()) ? "Y" : "N");
	
	// Get Overall Staging
	tumourOverall.setOverallStageDescription(overall.getOverallValue());
	
	addNewOverallStaging(tumourOverall);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   View source code votes vote down vote up
public TumourGroupSiteTNMValueListVo getTValue()	{ return tValue; } 
Example 34
Project: AvoinApotti   File: Logic.java   View source code votes vote down vote up
public void setTValue(TumourGroupSiteTNMValueListVo tValue)	{ this.tValue = tValue; } 
Example 35
Project: AvoinApotti   File: Logic.java   View source code votes vote down vote up
public TumourGroupSiteTNMValueListVo getNValue()	{ return nValue; } 
Example 36
Project: AvoinApotti   File: Logic.java   View source code votes vote down vote up
public void setNValue(TumourGroupSiteTNMValueListVo nValue)	{ this.nValue = nValue; } 
Example 37
Project: AvoinApotti   File: Logic.java   View source code votes vote down vote up
public TumourGroupSiteTNMValueListVo getMValue()	{ return mValue; } 
Example 38
Project: AvoinApotti   File: Logic.java   View source code votes vote down vote up
public void setMValue(TumourGroupSiteTNMValueListVo mValue)	{ this.mValue = mValue; } 
Example 39
Project: openMAXIMS   File: Logic.java   View source code votes vote down vote up
public TumourGroupSiteTNMValueListVo getTValue()	{ return tValue; } 
Example 40
Project: openMAXIMS   File: Logic.java   View source code votes vote down vote up
public void setTValue(TumourGroupSiteTNMValueListVo tValue)	{ this.tValue = tValue; }