Java Code Examples for ims.core.vo.MedicationLiteVo

The following are top voted examples for showing how to use ims.core.vo.MedicationLiteVo. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private MedicationLiteVo getGenericRowMedicationConfig(boolean bAll)
{
	MedicationLiteVo voMedicationConfig = new MedicationLiteVo();
	
	if (bAll)
	{
		voMedicationConfig.setID_Medication(new Integer(SEARCH_ALL_ITEMS_SELECTED_ID));
		voMedicationConfig.setMedicationName(SEARCH_ALL_ITEM_SELECTED + "Medications");
	}
	else
	{
		voMedicationConfig.setID_Medication(new Integer(NO_CODE_ITEM_SELECTED_ID));
		voMedicationConfig.setMedicationName(NO_CODE_ITEM_SELECTED);
	}
	return voMedicationConfig;
}
 
Example 2
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private MedicationLiteVo getGenericRowMedicationConfig(boolean bAll)
{
	MedicationLiteVo voMedicationConfig = new MedicationLiteVo();
	
	if (bAll)
	{
		voMedicationConfig.setID_Medication(new Integer(SEARCH_ALL_ITEMS_SELECTED_ID));
		voMedicationConfig.setMedicationName(SEARCH_ALL_ITEM_SELECTED + "Medications");
	}
	else
	{
		voMedicationConfig.setID_Medication(new Integer(NO_CODE_ITEM_SELECTED_ID));
		voMedicationConfig.setMedicationName(NO_CODE_ITEM_SELECTED);
	}
	return voMedicationConfig;
}
 
Example 3
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private MedicationLiteVo getGenericRowMedicationConfig(boolean bAll)
{
	MedicationLiteVo voMedicationConfig = new MedicationLiteVo();
	
	if (bAll)
	{
		voMedicationConfig.setID_Medication(new Integer(SEARCH_ALL_ITEMS_SELECTED_ID));
		voMedicationConfig.setMedicationName(SEARCH_ALL_ITEM_SELECTED + "Medications");
	}
	else
	{
		voMedicationConfig.setID_Medication(new Integer(NO_CODE_ITEM_SELECTED_ID));
		voMedicationConfig.setMedicationName(NO_CODE_ITEM_SELECTED);
	}
	return voMedicationConfig;
}
 
Example 4
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private MedicationLiteVo getGenericRowMedicationConfig(boolean bAll)
{
	MedicationLiteVo voMedicationConfig = new MedicationLiteVo();
	
	if (bAll)
	{
		voMedicationConfig.setID_Medication(new Integer(SEARCH_ALL_ITEMS_SELECTED_ID));
		voMedicationConfig.setMedicationName(SEARCH_ALL_ITEM_SELECTED + "Medications");
	}
	else
	{
		voMedicationConfig.setID_Medication(new Integer(NO_CODE_ITEM_SELECTED_ID));
		voMedicationConfig.setMedicationName(NO_CODE_ITEM_SELECTED);
	}
	return voMedicationConfig;
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	IClinicalCodingValue clinicalCoding = form.ccMedication().getValue();
	
	
	if (clinicalCoding == null || clinicalCoding.getIClinicalCodingValueDescription() == null || clinicalCoding.getIClinicalCodingValueDescription().length() == 0)
	{
		engine.showErrors(new String[]{"Clinical Term is mandatory ","Medication Description is mandatory."});
		return;
	}
	
			
	ValueObject medication = clinicalCoding.getIClinicalCodingValue();	
	if(medication != null && medication instanceof MedicationLiteVo)
	{
		if (((MedicationLiteVo) medication).getID_MedicationIsNotNull() && ((MedicationLiteVo) medication).getID_Medication() == -1)
		{
			//MedicationLiteVo med = (MedicationLiteVo) medication;
			//med.setMedicationName(clinicalCoding.getIClinicalCodingValueDescription());
			//med.setIsActive(true);
			
			//form.getGlobalContext().Oncology.setSelectedMedication(med);
			engine.showErrors(new String[]{"Select a medication"});
			form.ccMedication().setValue(null);
			initialise();
			return;
		}
		else
			form.getGlobalContext().Oncology.setSelectedMedication((MedicationLiteVo)clinicalCoding.getIClinicalCodingValue());
		
		engine.close(DialogResult.OK);	
	}
}
 
Example 6
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setInstanceRowDetails(grdMedicationRow row, MedicationLiteVo vo)
{
	row.setcolMedicationName(vo.getMedicationName());
	row.setValue(vo);			
	if (vo.getIsActiveIsNotNull() && !vo.getIsActive().booleanValue())
	{
		row.setBold(false);
		row.setTextColor(Color.Gray);
	}
	else
	{
		row.setBold(true);
		row.setTextColor(Color.Default);
	}	
}
 
Example 7
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addPrescriptionDrug(MedicationLiteVo medicationLiteVo, PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord) 
{			
	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if(row == null)
			row = form.dyngrdPrescription().getSelectedRow();
		
		if (row != null)
		{
			if (newRecord)
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(NewPrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}	
			}
			else
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}
			}

			
			if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionDrug))
			{
				addPrescriptionDrugRow(row.getParent().getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
			}
			row.setExpanded(true);
		}
					
	}
}
 
Example 8
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientMedicationForNursingNotesVo getPatientMedication(MedicationLiteVo value)
{
	PatientMedicationForNursingNotesVo med = new PatientMedicationForNursingNotesVo();
	med.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
	med.setMedication(value);
	med.setOtherMedicationText(value.getMedicationName());
	med.setPatient(form.getGlobalContext().Core.getPatientShort());
	return med;
}
 
Example 9
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addItemRow(Object item) 
{
	if (item instanceof AllergenVo)
	{
		AllergenVo voAllergen = (AllergenVo)item;
		form.qmbCodingItem().newRow(voAllergen, voAllergen.getAllergenName(), voAllergen.getIsActiveIsNotNull() && !voAllergen.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}
	
	else if (item instanceof DiagLiteVo)
	{
		DiagLiteVo voDiagnosis = (DiagLiteVo)item;
		form.qmbCodingItem().newRow(voDiagnosis, voDiagnosis.getDiagnosisName(), voDiagnosis.getIsActiveIsNotNull() && !voDiagnosis.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}								
	
	else if (item instanceof ClinicalProblemShortVo)
	{
		ClinicalProblemShortVo voProblem = (ClinicalProblemShortVo)item;
		form.qmbCodingItem().newRow(voProblem, voProblem.getPCName(), voProblem.getIsActiveIsNotNull() && !voProblem.getIsActive().booleanValue() ? Color.Gray : Color.Default);					
	}
	
	else if (item instanceof ProcedureLiteVo)				
	{				
		ProcedureLiteVo voProcedure = (ProcedureLiteVo)item;
		form.qmbCodingItem().newRow(voProcedure, voProcedure.getProcedureName(), voProcedure.getIsActiveIsNotNull() && !voProcedure.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}
	
	else if (item instanceof MedicationLiteVo)
	{
		MedicationLiteVo voMedication = (MedicationLiteVo)item;
		form.qmbCodingItem().newRow(voMedication, voMedication.getMedicationName(), voMedication.getIsActiveIsNotNull() && !voMedication.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}

	else if (item instanceof CancerImagingEventLiteVo)
	{
		CancerImagingEventLiteVo voCIE = (CancerImagingEventLiteVo)item;
		form.qmbCodingItem().newRow(voCIE, voCIE.getImagingEventName(), voCIE.getIsActiveIsNotNull() && !voCIE.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}
}
 
Example 10
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addGenericRow(boolean bAll) 
{				
	CodingItemType lkpCodingType = form.getLocalContext().getCodingLookupType();
	if (lkpCodingType.equals(CodingItemType.ALLERGY))		
	{
		AllergenVo voAllergen = getGenericRowAllergen(bAll);
		form.qmbCodingItem().newRow(voAllergen, voAllergen.getAllergenName(), Color.Red);												
	}
	else if (lkpCodingType.equals(CodingItemType.DIAGNOSIS) || lkpCodingType.equals(CodingItemType.FAMILY_HISTORY))
	{
		DiagnosisVo voDiagnosis = getGenericRowDiagnosis(bAll);
		form.qmbCodingItem().newRow(voDiagnosis, voDiagnosis.getDiagnosisName(), Color.Red);						
	}
	else if (lkpCodingType.equals(CodingItemType.PROBLEM))		
	{
		ClinicalProblemShortVo voProblem = getGenericRowProblem(bAll);
		form.qmbCodingItem().newRow(voProblem, voProblem.getPCName(), Color.Red);						
	}
	else if (lkpCodingType.equals(CodingItemType.PROCEDURE))
	{
		ProcedureLiteVo voProcedure = getGenericRowProcedure(bAll);
		form.qmbCodingItem().newRow(voProcedure, voProcedure.getProcedureName(), Color.Red);			
	}
	else if (lkpCodingType.equals(CodingItemType.IMAGING_EVENT))
	{
		CancerImagingEventLiteVo voImagingEvent = getGenericRowImagingEvent(bAll);
		form.qmbCodingItem().newRow(voImagingEvent, voImagingEvent.getImagingEventName(), Color.Red);			
	}
	else if (lkpCodingType.getId() == CodingItemType.MEDICATION.getId() && (form.imbSearch().isVisible() || engine.getFormName().getID() == 123215)) //WDEV-13956
	{
		MedicationLiteVo voMedication = getGenericRowMedicationConfig(bAll);
		form.qmbCodingItem().newRow(voMedication, voMedication.getMedicationName(), Color.Red);								
	}
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void checkInstanceType(CodingItemType lkpCodingType, ValueObject vo) throws CodingRuntimeException
{
	if (lkpCodingType == null || vo == null)
		return;

	if (lkpCodingType.equals(CodingItemType.ALLERGY))				
	{
		if (!(vo instanceof AllergenVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Allergen lookup and non AllergenVo");							
	}
	else if (lkpCodingType.equals(CodingItemType.DIAGNOSIS) || lkpCodingType.equals(CodingItemType.FAMILY_HISTORY))  
	{
		if (!(vo instanceof DiagLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Diagnosis lookup and non DiagLiteVo");
					
	}
	else if (lkpCodingType.equals(CodingItemType.PROBLEM))		
	{
		if (!(vo instanceof ClinicalProblemShortVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Problem lookup and non ClinicalProblemShortVo");
	}
	else if (lkpCodingType.equals(CodingItemType.PROCEDURE))
	{
		if (!(vo instanceof ProcedureLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Procedure lookup and non ProcedureLiteVo");
	}
	else if (lkpCodingType.equals(CodingItemType.IMAGING_EVENT))
	{
		if (!(vo instanceof CancerImagingEventLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Cancer Imaging Event lookup and non ProcedureLiteVo");
	}
	else if (lkpCodingType.equals(CodingItemType.MEDICATION)) 
	{
		if (!(vo instanceof MedicationLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Medication lookup and non MedicationLiteVo");
			
	}

}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isMedicationInGrid(MedicationLiteVo medication)
{
	if (medication == null)
		return false;
	DynamicGridRowCollection rows = form.lyrMain().tabDetails().dyngrdMedication().getRows();
	for (int i = 0; i < rows.size(); i++)
	{
		if (medication.equals(rows.get(i).getCellArray()[0].getValue()))
			return true;
	}
	return false;
}
 
Example 13
Project: AvoinApotti   File: EDischargeMedsSthkDialogImpl.java   Source Code and License 5 votes vote down vote up
public MedicationLiteVo getMedicationLiteVo(MedicationRefVo voRef)
{
	if(voRef == null) {
		throw new DomainRuntimeException("Invalid Medication record to get");
	}
	
	return MedicationLiteVoAssembler.create((Medication)getDomainFactory().getDomainObject(Medication.class, voRef.getID_Medication()));
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	IClinicalCodingValue clinicalCoding = form.ccMedication().getValue();
	
	
	if (clinicalCoding == null || clinicalCoding.getIClinicalCodingValueDescription() == null || clinicalCoding.getIClinicalCodingValueDescription().length() == 0)
	{
		engine.showErrors(new String[]{"Clinical Term is mandatory ","Medication Description is mandatory."});
		return;
	}
	
			
	ValueObject medication = clinicalCoding.getIClinicalCodingValue();	
	if(medication != null && medication instanceof MedicationLiteVo)
	{
		if (((MedicationLiteVo) medication).getID_MedicationIsNotNull() && ((MedicationLiteVo) medication).getID_Medication() == -1)
		{
			//MedicationLiteVo med = (MedicationLiteVo) medication;
			//med.setMedicationName(clinicalCoding.getIClinicalCodingValueDescription());
			//med.setIsActive(true);
			
			//form.getGlobalContext().Oncology.setSelectedMedication(med);
			engine.showErrors(new String[]{"Select a medication"});
			form.ccMedication().setValue(null);
			initialise();
			return;
		}
		else
			form.getGlobalContext().Oncology.setSelectedMedication((MedicationLiteVo)clinicalCoding.getIClinicalCodingValue());
		
		engine.close(DialogResult.OK);	
	}
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setInstanceRowDetails(grdMedicationRow row, MedicationLiteVo vo)
{
	row.setcolMedicationName(vo.getMedicationName());
	row.setValue(vo);			
	if (vo.getIsActiveIsNotNull() && !vo.getIsActive().booleanValue())
	{
		row.setBold(false);
		row.setTextColor(Color.Gray);
	}
	else
	{
		row.setBold(true);
		row.setTextColor(Color.Default);
	}	
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addPrescriptionDrug(MedicationLiteVo medicationLiteVo, PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord) 
{			
	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if(row == null)
			row = form.dyngrdPrescription().getSelectedRow();
		
		if (row != null)
		{
			if (newRecord)
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(NewPrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}	
			}
			else
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}
			}

			
			if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionDrug))
			{
				addPrescriptionDrugRow(row.getParent().getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
			}
			row.setExpanded(true);
		}
					
	}
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientMedicationForNursingNotesVo getPatientMedication(MedicationLiteVo value)
{
	PatientMedicationForNursingNotesVo med = new PatientMedicationForNursingNotesVo();
	med.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
	med.setMedication(value);
	med.setOtherMedicationText(value.getMedicationName());
	med.setPatient(form.getGlobalContext().Core.getPatientShort());
	return med;
}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addGenericRow(boolean bAll) 
{				
	CodingItemType lkpCodingType = form.getLocalContext().getCodingLookupType();
	if (lkpCodingType.equals(CodingItemType.ALLERGY))		
	{
		AllergenVo voAllergen = getGenericRowAllergen(bAll);
		form.qmbCodingItem().newRow(voAllergen, voAllergen.getAllergenName(), Color.Red);												
	}
	else if (lkpCodingType.equals(CodingItemType.DIAGNOSIS) || lkpCodingType.equals(CodingItemType.FAMILY_HISTORY))
	{
		DiagnosisVo voDiagnosis = getGenericRowDiagnosis(bAll);
		form.qmbCodingItem().newRow(voDiagnosis, voDiagnosis.getDiagnosisName(), Color.Red);						
	}
	else if (lkpCodingType.equals(CodingItemType.PROBLEM))		
	{
		ClinicalProblemShortVo voProblem = getGenericRowProblem(bAll);
		form.qmbCodingItem().newRow(voProblem, voProblem.getPCName(), Color.Red);						
	}
	else if (lkpCodingType.equals(CodingItemType.PROCEDURE))
	{
		ProcedureLiteVo voProcedure = getGenericRowProcedure(bAll);
		form.qmbCodingItem().newRow(voProcedure, voProcedure.getProcedureName(), Color.Red);			
	}
	else if (lkpCodingType.equals(CodingItemType.IMAGING_EVENT))
	{
		CancerImagingEventLiteVo voImagingEvent = getGenericRowImagingEvent(bAll);
		form.qmbCodingItem().newRow(voImagingEvent, voImagingEvent.getImagingEventName(), Color.Red);			
	}
	else if (lkpCodingType.getId() == CodingItemType.MEDICATION.getId() && (form.imbSearch().isVisible() || engine.getFormName().getID() == 123215)) //WDEV-13956
	{
		MedicationLiteVo voMedication = getGenericRowMedicationConfig(bAll);
		form.qmbCodingItem().newRow(voMedication, voMedication.getMedicationName(), Color.Red);								
	}
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void checkInstanceType(CodingItemType lkpCodingType, ValueObject vo) throws CodingRuntimeException
{
	if (lkpCodingType == null || vo == null)
		return;

	if (lkpCodingType.equals(CodingItemType.ALLERGY))				
	{
		if (!(vo instanceof AllergenVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Allergen lookup and non AllergenVo");							
	}
	else if (lkpCodingType.equals(CodingItemType.DIAGNOSIS) || lkpCodingType.equals(CodingItemType.FAMILY_HISTORY))  
	{
		if (!(vo instanceof DiagLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Diagnosis lookup and non DiagLiteVo");
					
	}
	else if (lkpCodingType.equals(CodingItemType.PROBLEM))		
	{
		if (!(vo instanceof ClinicalProblemShortVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Problem lookup and non ClinicalProblemShortVo");
	}
	else if (lkpCodingType.equals(CodingItemType.PROCEDURE))
	{
		if (!(vo instanceof ProcedureLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Procedure lookup and non ProcedureLiteVo");
	}
	else if (lkpCodingType.equals(CodingItemType.IMAGING_EVENT))
	{
		if (!(vo instanceof CancerImagingEventLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Cancer Imaging Event lookup and non ProcedureLiteVo");
	}
	else if (lkpCodingType.equals(CodingItemType.MEDICATION)) 
	{
		if (!(vo instanceof MedicationLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Medication lookup and non MedicationLiteVo");
			
	}

}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addGenericMedicationRow(boolean canSetValue) {
	if (Boolean.TRUE.equals(form.getLocalContext().getbAllowFreeTextMedication())) //WDEV-18980
	{
		MedicationLiteVo genericMedicationVo = getGenericRowMedicationRecord();
		form.qmbMedication().newRow(genericMedicationVo,genericMedicationVo.getMedicationName(), Color.Red);
		if (canSetValue)
			form.qmbMedication().setValue(genericMedicationVo);
	}
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private MedicationLiteVo getGenericRowMedicationRecord()
{
	MedicationLiteVo voMedicationConfig = new MedicationLiteVo();
	
	voMedicationConfig.setID_Medication(new Integer(NO_CODE_ITEM_SELECTED_ID));
	voMedicationConfig.setMedicationName(NO_CODE_ITEM_SELECTED);
	
	return voMedicationConfig;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isMedicationInGrid(MedicationLiteVo medication)
{
	if (medication == null)
		return false;
	DynamicGridRowCollection rows = form.lyrMain().tabDetails().dyngrdMedication().getRows();
	for (int i = 0; i < rows.size(); i++)
	{
		if (medication.equals(rows.get(i).getCellArray()[0].getValue()))
			return true;
	}
	return false;
}
 
Example 23
Project: openMAXIMS   File: EDischargeMedsSthkDialogImpl.java   Source Code and License 5 votes vote down vote up
public MedicationLiteVo getMedicationLiteVo(MedicationRefVo voRef)
{
	if(voRef == null) {
		throw new DomainRuntimeException("Invalid Medication record to get");
	}
	
	return MedicationLiteVoAssembler.create((Medication)getDomainFactory().getDomainObject(Medication.class, voRef.getID_Medication()));
}
 
Example 24
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	IClinicalCodingValue clinicalCoding = form.ccMedication().getValue();
	
	
	if (clinicalCoding == null || clinicalCoding.getIClinicalCodingValueDescription() == null || clinicalCoding.getIClinicalCodingValueDescription().length() == 0)
	{
		engine.showErrors(new String[]{"Clinical Term is mandatory ","Medication Description is mandatory."});
		return;
	}
	
			
	ValueObject medication = clinicalCoding.getIClinicalCodingValue();	
	if(medication != null && medication instanceof MedicationLiteVo)
	{
		if (((MedicationLiteVo) medication).getID_MedicationIsNotNull() && ((MedicationLiteVo) medication).getID_Medication() == -1)
		{
			//MedicationLiteVo med = (MedicationLiteVo) medication;
			//med.setMedicationName(clinicalCoding.getIClinicalCodingValueDescription());
			//med.setIsActive(true);
			
			//form.getGlobalContext().Oncology.setSelectedMedication(med);
			engine.showErrors(new String[]{"Select a medication"});
			form.ccMedication().setValue(null);
			initialise();
			return;
		}
		else
			form.getGlobalContext().Oncology.setSelectedMedication((MedicationLiteVo)clinicalCoding.getIClinicalCodingValue());
		
		engine.close(DialogResult.OK);	
	}
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setInstanceRowDetails(grdMedicationRow row, MedicationLiteVo vo)
{
	row.setcolMedicationName(vo.getMedicationName());
	row.setValue(vo);			
	if (vo.getIsActiveIsNotNull() && !vo.getIsActive().booleanValue())
	{
		row.setBold(false);
		row.setTextColor(Color.Gray);
	}
	else
	{
		row.setBold(true);
		row.setTextColor(Color.Default);
	}	
}
 
Example 26
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addPrescriptionDrug(MedicationLiteVo medicationLiteVo, PatientMedicationLiteVo patientMedication, DynamicGridRow row, boolean readOnly, boolean newRecord) 
{			
	if (form.dyngrdPrescription().getSelectedRow() != null)
	{
		if(row == null)
			row = form.dyngrdPrescription().getSelectedRow();
		
		if (row != null)
		{
			if (newRecord)
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(NewPrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}	
			}
			else
			{
				if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionRecord))
				{
					addPrescriptionDrugRow(row.getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
				}
			}

			
			if (row.getIdentifier() != null && row.getIdentifier().equals(PrescriptionDrug))
			{
				addPrescriptionDrugRow(row.getParent().getRows().newRow(), medicationLiteVo, patientMedication, readOnly);
			}
			row.setExpanded(true);
		}
					
	}
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private PatientMedicationForNursingNotesVo getPatientMedication(MedicationLiteVo value)
{
	PatientMedicationForNursingNotesVo med = new PatientMedicationForNursingNotesVo();
	med.setCareContext(form.getGlobalContext().Core.getCurrentCareContext());
	med.setMedication(value);
	med.setOtherMedicationText(value.getMedicationName());
	med.setPatient(form.getGlobalContext().Core.getPatientShort());
	return med;
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addItemRow(Object item) 
{
	if (item instanceof AllergenVo)
	{
		AllergenVo voAllergen = (AllergenVo)item;
		form.qmbCodingItem().newRow(voAllergen, voAllergen.getAllergenName(), voAllergen.getIsActiveIsNotNull() && !voAllergen.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}
	
	else if (item instanceof DiagLiteVo)
	{
		DiagLiteVo voDiagnosis = (DiagLiteVo)item;
		form.qmbCodingItem().newRow(voDiagnosis, voDiagnosis.getDiagnosisName(), voDiagnosis.getIsActiveIsNotNull() && !voDiagnosis.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}								
	
	else if (item instanceof ClinicalProblemShortVo)
	{
		ClinicalProblemShortVo voProblem = (ClinicalProblemShortVo)item;
		form.qmbCodingItem().newRow(voProblem, voProblem.getPCName(), voProblem.getIsActiveIsNotNull() && !voProblem.getIsActive().booleanValue() ? Color.Gray : Color.Default);					
	}
	
	else if (item instanceof ProcedureLiteVo)				
	{				
		ProcedureLiteVo voProcedure = (ProcedureLiteVo)item;
		form.qmbCodingItem().newRow(voProcedure, voProcedure.getProcedureName(), voProcedure.getIsActiveIsNotNull() && !voProcedure.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}
	
	else if (item instanceof MedicationLiteVo)
	{
		MedicationLiteVo voMedication = (MedicationLiteVo)item;
		form.qmbCodingItem().newRow(voMedication, voMedication.getMedicationName(), voMedication.getIsActiveIsNotNull() && !voMedication.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}

	else if (item instanceof CancerImagingEventLiteVo)
	{
		CancerImagingEventLiteVo voCIE = (CancerImagingEventLiteVo)item;
		form.qmbCodingItem().newRow(voCIE, voCIE.getImagingEventName(), voCIE.getIsActiveIsNotNull() && !voCIE.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addGenericRow(boolean bAll) 
{				
	CodingItemType lkpCodingType = form.getLocalContext().getCodingLookupType();
	if (lkpCodingType.equals(CodingItemType.ALLERGY))		
	{
		AllergenVo voAllergen = getGenericRowAllergen(bAll);
		form.qmbCodingItem().newRow(voAllergen, voAllergen.getAllergenName(), Color.Red);												
	}
	else if (lkpCodingType.equals(CodingItemType.DIAGNOSIS) || lkpCodingType.equals(CodingItemType.FAMILY_HISTORY))
	{
		DiagnosisVo voDiagnosis = getGenericRowDiagnosis(bAll);
		form.qmbCodingItem().newRow(voDiagnosis, voDiagnosis.getDiagnosisName(), Color.Red);						
	}
	else if (lkpCodingType.equals(CodingItemType.PROBLEM))		
	{
		ClinicalProblemShortVo voProblem = getGenericRowProblem(bAll);
		form.qmbCodingItem().newRow(voProblem, voProblem.getPCName(), Color.Red);						
	}
	else if (lkpCodingType.equals(CodingItemType.PROCEDURE))
	{
		ProcedureLiteVo voProcedure = getGenericRowProcedure(bAll);
		form.qmbCodingItem().newRow(voProcedure, voProcedure.getProcedureName(), Color.Red);			
	}
	else if (lkpCodingType.equals(CodingItemType.IMAGING_EVENT))
	{
		CancerImagingEventLiteVo voImagingEvent = getGenericRowImagingEvent(bAll);
		form.qmbCodingItem().newRow(voImagingEvent, voImagingEvent.getImagingEventName(), Color.Red);			
	}
	else if (lkpCodingType.getId() == CodingItemType.MEDICATION.getId() && (form.imbSearch().isVisible() || engine.getFormName().getID() == 123215)) //WDEV-13956
	{
		MedicationLiteVo voMedication = getGenericRowMedicationConfig(bAll);
		form.qmbCodingItem().newRow(voMedication, voMedication.getMedicationName(), Color.Red);								
	}
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void checkInstanceType(CodingItemType lkpCodingType, ValueObject vo) throws CodingRuntimeException
{
	if (lkpCodingType == null || vo == null)
		return;

	if (lkpCodingType.equals(CodingItemType.ALLERGY))				
	{
		if (!(vo instanceof AllergenVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Allergen lookup and non AllergenVo");							
	}
	else if (lkpCodingType.equals(CodingItemType.DIAGNOSIS) || lkpCodingType.equals(CodingItemType.FAMILY_HISTORY))  
	{
		if (!(vo instanceof DiagLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Diagnosis lookup and non DiagLiteVo");
					
	}
	else if (lkpCodingType.equals(CodingItemType.PROBLEM))		
	{
		if (!(vo instanceof ClinicalProblemShortVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Problem lookup and non ClinicalProblemShortVo");
	}
	else if (lkpCodingType.equals(CodingItemType.PROCEDURE))
	{
		if (!(vo instanceof ProcedureLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Procedure lookup and non ProcedureLiteVo");
	}
	else if (lkpCodingType.equals(CodingItemType.IMAGING_EVENT))
	{
		if (!(vo instanceof CancerImagingEventLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Cancer Imaging Event lookup and non ProcedureLiteVo");
	}
	else if (lkpCodingType.equals(CodingItemType.MEDICATION)) 
	{
		if (!(vo instanceof MedicationLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Medication lookup and non MedicationLiteVo");
			
	}

}
 
Example 31
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isMedicationInGrid(MedicationLiteVo medication)
{
	if (medication == null)
		return false;
	DynamicGridRowCollection rows = form.lyrMain().tabDetails().dyngrdMedication().getRows();
	for (int i = 0; i < rows.size(); i++)
	{
		if (medication.equals(rows.get(i).getCellArray()[0].getValue()))
			return true;
	}
	return false;
}
 
Example 32
Project: openMAXIMS   File: EDischargeMedsSthkDialogImpl.java   Source Code and License 5 votes vote down vote up
public MedicationLiteVo getMedicationLiteVo(MedicationRefVo voRef)
{
	if(voRef == null) {
		throw new DomainRuntimeException("Invalid Medication record to get");
	}
	
	return MedicationLiteVoAssembler.create((Medication)getDomainFactory().getDomainObject(Medication.class, voRef.getID_Medication()));
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onBtnSaveClick() throws ims.framework.exceptions.PresentationLogicException
{
	IClinicalCodingValue clinicalCoding = form.ccMedication().getValue();
	
	
	if (clinicalCoding == null || clinicalCoding.getIClinicalCodingValueDescription() == null || clinicalCoding.getIClinicalCodingValueDescription().length() == 0)
	{
		engine.showErrors(new String[]{"Clinical Term is mandatory ","Medication Description is mandatory."});
		return;
	}
	
			
	ValueObject medication = clinicalCoding.getIClinicalCodingValue();	
	if(medication != null && medication instanceof MedicationLiteVo)
	{
		if (((MedicationLiteVo) medication).getID_MedicationIsNotNull() && ((MedicationLiteVo) medication).getID_Medication() == -1)
		{
			//MedicationLiteVo med = (MedicationLiteVo) medication;
			//med.setMedicationName(clinicalCoding.getIClinicalCodingValueDescription());
			//med.setIsActive(true);
			
			//form.getGlobalContext().Oncology.setSelectedMedication(med);
			engine.showErrors(new String[]{"Select a medication"});
			form.ccMedication().setValue(null);
			initialise();
			return;
		}
		else
			form.getGlobalContext().Oncology.setSelectedMedication((MedicationLiteVo)clinicalCoding.getIClinicalCodingValue());
		
		engine.close(DialogResult.OK);	
	}
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setInstanceRowDetails(grdMedicationRow row, MedicationLiteVo vo)
{
	row.setcolMedicationName(vo.getMedicationName());
	row.setValue(vo);			
	if (vo.getIsActiveIsNotNull() && !vo.getIsActive().booleanValue())
	{
		row.setBold(false);
		row.setTextColor(Color.Gray);
	}
	else
	{
		row.setBold(true);
		row.setTextColor(Color.Default);
	}	
}
 
Example 35
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addItemRow(Object item) 
{
	if (item instanceof AllergenVo)
	{
		AllergenVo voAllergen = (AllergenVo)item;
		form.qmbCodingItem().newRow(voAllergen, voAllergen.getAllergenName(), voAllergen.getIsActiveIsNotNull() && !voAllergen.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}
	
	else if (item instanceof DiagLiteVo)
	{
		DiagLiteVo voDiagnosis = (DiagLiteVo)item;
		form.qmbCodingItem().newRow(voDiagnosis, voDiagnosis.getDiagnosisName(), voDiagnosis.getIsActiveIsNotNull() && !voDiagnosis.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}								
	
	else if (item instanceof ClinicalProblemShortVo)
	{
		ClinicalProblemShortVo voProblem = (ClinicalProblemShortVo)item;
		form.qmbCodingItem().newRow(voProblem, voProblem.getPCName(), voProblem.getIsActiveIsNotNull() && !voProblem.getIsActive().booleanValue() ? Color.Gray : Color.Default);					
	}
	
	else if (item instanceof ProcedureLiteVo)				
	{				
		ProcedureLiteVo voProcedure = (ProcedureLiteVo)item;
		form.qmbCodingItem().newRow(voProcedure, voProcedure.getProcedureName(), voProcedure.getIsActiveIsNotNull() && !voProcedure.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}
	
	else if (item instanceof MedicationLiteVo)
	{
		MedicationLiteVo voMedication = (MedicationLiteVo)item;
		form.qmbCodingItem().newRow(voMedication, voMedication.getMedicationName(), voMedication.getIsActiveIsNotNull() && !voMedication.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}

	else if (item instanceof CancerImagingEventLiteVo)
	{
		CancerImagingEventLiteVo voCIE = (CancerImagingEventLiteVo)item;
		form.qmbCodingItem().newRow(voCIE, voCIE.getImagingEventName(), voCIE.getIsActiveIsNotNull() && !voCIE.getIsActive().booleanValue() ? Color.Gray : Color.Default);
	}
}
 
Example 36
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void addGenericRow(boolean bAll) 
{				
	CodingItemType lkpCodingType = form.getLocalContext().getCodingLookupType();
	if (lkpCodingType.equals(CodingItemType.ALLERGY))		
	{
		AllergenVo voAllergen = getGenericRowAllergen(bAll);
		form.qmbCodingItem().newRow(voAllergen, voAllergen.getAllergenName(), Color.Red);												
	}
	else if (lkpCodingType.equals(CodingItemType.DIAGNOSIS) || lkpCodingType.equals(CodingItemType.FAMILY_HISTORY))
	{
		DiagnosisVo voDiagnosis = getGenericRowDiagnosis(bAll);
		form.qmbCodingItem().newRow(voDiagnosis, voDiagnosis.getDiagnosisName(), Color.Red);						
	}
	else if (lkpCodingType.equals(CodingItemType.PROBLEM))		
	{
		ClinicalProblemShortVo voProblem = getGenericRowProblem(bAll);
		form.qmbCodingItem().newRow(voProblem, voProblem.getPCName(), Color.Red);						
	}
	else if (lkpCodingType.equals(CodingItemType.PROCEDURE))
	{
		ProcedureLiteVo voProcedure = getGenericRowProcedure(bAll);
		form.qmbCodingItem().newRow(voProcedure, voProcedure.getProcedureName(), Color.Red);			
	}
	else if (lkpCodingType.equals(CodingItemType.IMAGING_EVENT))
	{
		CancerImagingEventLiteVo voImagingEvent = getGenericRowImagingEvent(bAll);
		form.qmbCodingItem().newRow(voImagingEvent, voImagingEvent.getImagingEventName(), Color.Red);			
	}
	else if (lkpCodingType.getId() == CodingItemType.MEDICATION.getId() && (form.imbSearch().isVisible() || engine.getFormName().getID() == 123215)) //WDEV-13956
	{
		MedicationLiteVo voMedication = getGenericRowMedicationConfig(bAll);
		form.qmbCodingItem().newRow(voMedication, voMedication.getMedicationName(), Color.Red);								
	}
}
 
Example 37
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void checkInstanceType(CodingItemType lkpCodingType, ValueObject vo) throws CodingRuntimeException
{
	if (lkpCodingType == null || vo == null)
		return;

	if (lkpCodingType.equals(CodingItemType.ALLERGY))				
	{
		if (!(vo instanceof AllergenVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Allergen lookup and non AllergenVo");							
	}
	else if (lkpCodingType.equals(CodingItemType.DIAGNOSIS) || lkpCodingType.equals(CodingItemType.FAMILY_HISTORY))  
	{
		if (!(vo instanceof DiagLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Diagnosis lookup and non DiagLiteVo");
					
	}
	else if (lkpCodingType.equals(CodingItemType.PROBLEM))		
	{
		if (!(vo instanceof ClinicalProblemShortVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Problem lookup and non ClinicalProblemShortVo");
	}
	else if (lkpCodingType.equals(CodingItemType.PROCEDURE))
	{
		if (!(vo instanceof ProcedureLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Procedure lookup and non ProcedureLiteVo");
	}
	else if (lkpCodingType.equals(CodingItemType.IMAGING_EVENT))
	{
		if (!(vo instanceof CancerImagingEventLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Cancer Imaging Event lookup and non ProcedureLiteVo");
	}
	else if (lkpCodingType.equals(CodingItemType.MEDICATION)) 
	{
		if (!(vo instanceof MedicationLiteVo))
			throw new CodingRuntimeException("Lookup Type / Vo Mismatch : Medication lookup and non MedicationLiteVo");
			
	}

}
 
Example 38
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean isMedicationInGrid(MedicationLiteVo medication)
{
	if (medication == null)
		return false;
	DynamicGridRowCollection rows = form.lyrMain().tabDetails().dyngrdMedication().getRows();
	for (int i = 0; i < rows.size(); i++)
	{
		if (medication.equals(rows.get(i).getCellArray()[0].getValue()))
			return true;
	}
	return false;
}
 
Example 39
Project: openmaxims-linux   File: EDischargeMedsSthkDialogImpl.java   Source Code and License 5 votes vote down vote up
public MedicationLiteVo getMedicationLiteVo(MedicationRefVo voRef)
{
	if(voRef == null) {
		throw new DomainRuntimeException("Invalid Medication record to get");
	}
	
	return MedicationLiteVoAssembler.create((Medication)getDomainFactory().getDomainObject(Medication.class, voRef.getID_Medication()));
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private grdMedicationRow newInstanceRow(MedicationLiteVo vo)
{
	return newInstanceRow(vo, false);
}