Java Code Examples for ims.core.vo.lookups.Sex

The following are top voted examples for showing how to use ims.core.vo.lookups.Sex. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	PatientAssessmentInfoVo patInfo = form.getLocalContext().getPatientInfo();
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull())
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
			return true;
		else if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex())))
			return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() > question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() < question.getAgeRangeMin()))
		return true;

	return false;
}
 
Example 2
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	PatientAssessmentInfoVo patInfo = form.getLocalContext().getPatientInfo();
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull())
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
			return true;
		else if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex())))
			return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() > question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() < question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 3
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 4
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 5
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 6
Project: AvoinApotti   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	if (patInfo == null)
		return false;
	
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	
	return false;
}
 
Example 7
Project: AvoinApotti   File: Logic.java   View source code 6 votes vote down vote up
private void initialize() 
{
	String query = "";
	
	boolean isFemale = form.getGlobalContext().Core.getPatientShort().getSexIsNotNull() && form.getGlobalContext().Core.getPatientShort().getSex().equals(Sex.FEMALE);

	if(isFemale)
		query = "These investigations have been configured as appropriate for patients of Male gender.\nDo you still wish to include these items in the order for this patient?";
	else
		query = "These investigations have been configured as appropriate for patients of Female gender.\nDo you still wish to include these items in the order for this patient?";
	
	form.lblQuestion().setValue(query);
	form.grdInvestigations().setSelectable(false);
	
	populateInvestigationGrid();
}
 
Example 8
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 9
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 10
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	PatientAssessmentInfoVo patInfo = form.getLocalContext().getPatientInfo();
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull())
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
			return true;
		else if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex())))
			return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() > question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() < question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 11
Project: openMAXIMS   File: BedInfoDialogImpl.java   View source code 6 votes vote down vote up
private Sex getTempGenderToInstateForPreviousBay(WardConfigLiteVo wardConfigLiteVo,BayConfigLiteVo bayConfig)
{
	if (wardConfigLiteVo == null || bayConfig == null)
		return null;
	
	Integer intMales = countMalePatientsOnTheWard(wardConfigLiteVo.getWard(), bayConfig.getBay());
	Integer intFemales = countFemalePatientsOnTheWard(wardConfigLiteVo.getWard(), bayConfig.getBay());
	
	if (bayConfig != null && bayConfig.getNumOfOccupiedBedsIsNotNull() &&  bayConfig.getNumOfOccupiedBeds() > 0)
	{
		if ((intFemales == null || intFemales == 0) && (intMales != null && intMales >= 0 && !Sex.MALE.equals(bayConfig.getTemporaryBayGender())))
			return Sex.MALE;
		if ((intMales == null || intMales == 0) && intFemales != null && intFemales >= 0 && !Sex.FEMALE.equals(bayConfig.getTemporaryBayGender()))
			return Sex.FEMALE;
	}
	return null;			
}
 
Example 12
Project: openMAXIMS   File: BedInfoDialogImpl.java   View source code 6 votes vote down vote up
public Integer countMalePatientsOnTheWard(LocationRefVo ward, LocationRefVo bay)
{
	if (ward == null || ward.getID_Location() == null)
		return 0;
	
	StringBuilder query = new StringBuilder("SELECT COUNT (inpat.id) ");
	query.append(" FROM BedSpaceState as bs LEFT JOIN bs.inpatientEpisode as inpat LEFT JOIN inpat.bed AS bed ");
	query.append(" LEFT JOIN inpat.pasEvent AS pas LEFT JOIN pas.patient AS patient ");
	query.append(" WHERE ");
	query.append(" bs.ward.id = :WARD_ID AND bs.bay.id = :BAY_ID AND bed is not null AND patient.sex.id = :MALE_SEX ");
	
	String[] paramNames = new String[] {"WARD_ID", "BAY_ID", "MALE_SEX" };
	Object[] paramValues = new Object[] {ward.getID_Location(),bay.getID_Location(), Sex.MALE.getID()}; 

	return (int) getDomainFactory().countWithHQL(query.toString(), paramNames, paramValues);
}
 
Example 13
Project: openMAXIMS   File: BedInfoDialogImpl.java   View source code 6 votes vote down vote up
public Integer countFemalePatientsOnTheWard(LocationRefVo ward, LocationRefVo bay)
{
	if (ward == null || ward.getID_Location() == null)
		return 0;
	
	StringBuilder query = new StringBuilder("SELECT COUNT (inpat.id) ");
	query.append(" FROM BedSpaceState as bs LEFT JOIN bs.inpatientEpisode as inpat LEFT JOIN inpat.bed AS bed ");
	query.append(" LEFT JOIN inpat.pasEvent AS pas LEFT JOIN pas.patient AS patient ");
	query.append(" WHERE ");
	query.append(" bs.ward.id = :WARD_ID AND bs.bay.id = :BAY_ID AND bed is not null AND patient.sex.id = :FEMALE_SEX ");
			
	String[] paramNames = new String[] {"WARD_ID", "BAY_ID", "FEMALE_SEX" };
	Object[] paramValues = new Object[] {ward.getID_Location(), bay.getID_Location(), Sex.FEMALE.getID()}; 

	return (int) getDomainFactory().countWithHQL(query.toString(), paramNames, paramValues);
}
 
Example 14
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	PatientAssessmentInfoVo patInfo = form.getLocalContext().getPatientInfo();
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull())
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
			return true;
		else if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex())))
			return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() > question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() < question.getAgeRangeMin()))
		return true;

	return false;
}
 
Example 15
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	PatientAssessmentInfoVo patInfo = form.getLocalContext().getPatientInfo();
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull())
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
			return true;
		else if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex())))
			return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() > question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() < question.getAgeRangeMin()))
		return true;

	return false;
}
 
Example 16
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 17
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 18
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	if (patInfo == null)
		return false;
	
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	
	return false;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private void initialize() 
{
	String query = "";
	
	boolean isFemale = form.getGlobalContext().Core.getPatientShort().getSexIsNotNull() && form.getGlobalContext().Core.getPatientShort().getSex().equals(Sex.FEMALE);

	if(isFemale)
		query = "These investigations have been configured as appropriate for patients of Male gender.\nDo you still wish to include these items in the order for this patient?";
	else
		query = "These investigations have been configured as appropriate for patients of Female gender.\nDo you still wish to include these items in the order for this patient?";
	
	form.lblQuestion().setValue(query);
	form.grdInvestigations().setSelectable(false);
	
	populateInvestigationGrid();
}
 
Example 20
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	PatientAssessmentInfoVo patInfo = form.getLocalContext().getPatientInfo();
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull())
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
			return true;
		else if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex())))
			return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() > question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge() < question.getAgeRangeMin()))
		return true;

	return false;
}
 
Example 22
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 23
Project: openMAXIMS   File: Logic.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 24
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(QuestionInformationVo question)
{
	if (patInfo == null)
		return false;
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	return false;
}
 
Example 25
Project: openMAXIMS   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	if (patInfo == null)
		return false;
	
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	
	return false;
}
 
Example 26
Project: openmaxims-linux   File: UserAssessmentInstHelper.java   View source code 6 votes vote down vote up
private boolean isQuestionInvalidForPatient(Question_InformationVo question)
{
	if (patInfo == null)
		return false;
	
	if (question.getGenderSpecificIsNotNull() )
	{
		if (GenderSpecific.MALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.MALE.equals(patInfo.getSex())))
				return true;
		else
		if (GenderSpecific.FEMALE.equals(question.getGenderSpecific()) && (!patInfo.getSexIsNotNull() || !Sex.FEMALE.equals(patInfo.getSex()) ))
				return true;
	}
	
	if (question.getAgeRangeMaxIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()>question.getAgeRangeMax()))
		return true;
	
	if (question.getAgeRangeMinIsNotNull() && (!patInfo.getAgeIsNotNull() || patInfo.getAge()<question.getAgeRangeMin()))
		return true;
	
	return false;
}
 
Example 27
Project: openmaxims-linux   File: Logic.java   View source code 6 votes vote down vote up
private void initialize() 
{
	String query = "";
	
	boolean isFemale = form.getGlobalContext().Core.getPatientShort().getSexIsNotNull() && form.getGlobalContext().Core.getPatientShort().getSex().equals(Sex.FEMALE);

	if(isFemale)
		query = "These investigations have been configured as appropriate for patients of Male gender.\nDo you still wish to include these items in the order for this patient?";
	else
		query = "These investigations have been configured as appropriate for patients of Female gender.\nDo you still wish to include these items in the order for this patient?";
	
	form.lblQuestion().setValue(query);
	form.grdInvestigations().setSelectable(false);
	
	populateInvestigationGrid();
}
 
Example 28
Project: AvoinApotti   File: PatientListsImpl.java   View source code 5 votes vote down vote up
private void populatePasContactFromDtoOutpatient(PasContactVo voPasContact, OutpatientlistRecord dtoOutpatient)
{
	String extSystem = ConfigFlag.DOM.DEMOGRAPHICS_EXT_SYSTEM.getValue();			
	LocShortVo voLoc = new LocShortVo();		
	OrganisationAndLocation locImpl = (OrganisationAndLocation)getDomainImpl(OrganisationAndLocationImpl.class);
	
	voLoc = locImpl.getLocationByLocalCode(dtoOutpatient.Cliniccode,LocationType.CLINIC);
	voPasContact.setLocation(voLoc);
					
	HcpAdmin hcpAdmin = (HcpAdmin)getDomainImpl(HcpAdminImpl.class);
	
	MedicWithMappingsLiteVo voMedicWithMappingsLite = hcpAdmin.getMedicMedicMappingsByPasCode(dtoOutpatient.Hcpcode);
	voPasContact.setConsultant(voMedicWithMappingsLite == null ? null : voMedicWithMappingsLite);
			

	Specialty specialty = (Specialty)getLookupService().getLocalLookup(Specialty.class, Specialty.TYPE_ID, extSystem, dtoOutpatient.Specialty);			
	
	voPasContact.setSpecialty(specialty);			
	
	//Contact Number
	voPasContact.setContactNumber(dtoOutpatient.Contactno);
	try {
		voPasContact.setAppointmentDateTime(new DateTime (dtoOutpatient.Apptdate, "1000"));
	} catch (ParseException e) {
		voPasContact.setAppointmentDateTime(null);
	}
					
	PatientShort voPatientShort = new PatientShort();
	voPatientShort.setName(dtoOutpatient.Snm, dtoOutpatient.Fnm1, null);	

	voPatientShort.addId(PatIdType.HOSPNUM, dtoOutpatient.Hospnum);						
	voPatientShort.addId(PatIdType.CHARTNUM, dtoOutpatient.Chartnum);						

	if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
		voPatientShort.setDob(new PartialDate(dtoOutpatient.Dob));	
	else
		voPatientShort.setDob(null);
	
	if(dtoOutpatient.Dod != null && dtoOutpatient.Dod != "")
	{
		try {voPatientShort.setDod(new Date(dtoOutpatient.Dod,DateFormat.ISO));
		} catch (ParseException e2) {
			e2.printStackTrace();
		}
	}
	
	if(dtoOutpatient.Dob != null && dtoOutpatient.Dob != "")
		voPatientShort.calculateAge();
	
	voPatientShort.setWard(voPasContact.getLocation());		
	voPatientShort.setSex((Sex)getLookupService().getLocalLookup(Sex.class, Sex.TYPE_ID, extSystem, dtoOutpatient.Sex));
	voPasContact.setPatient(voPatientShort);			
	voPasContact.setGPCode(dtoOutpatient.Gpcode);

	if (dtoOutpatient.Documentstatus != ""  && Integer.valueOf(dtoOutpatient.Documentstatus).intValue() == DocumentStatus.LETTERREQUIRED.getId())
	{ 
		voPasContact.setDocumentStatus((DocumentStatus)getLookupService().getLookupInstance(DocumentStatus.class,Integer.valueOf(dtoOutpatient.Documentstatus).intValue()));
	}
	else				
	{
		if (isLetterRequired(voMedicWithMappingsLite, specialty ,null, null) == Boolean.FALSE)
			voPasContact.setDocumentStatus(DocumentStatus.NOLETTERREQUIRED);
		else
			voPasContact.setDocumentStatus(DocumentStatus.LETTERREQUIRED);
	}		
}
 
Example 29
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
@Override
protected void onBtnCalculateHeightClick() throws PresentationLogicException
{
	if (form.decHeight().getValue()!=null)
	{
		engine.showMessage("A value for Height already exist.\nHeight field should be empty to be able to calculate it using ULNA radius.");
		form.decUlna().setValue(null);
		return;
	}
	
	if (form.decUlna().getValue() == null)
	{
		engine.showMessage("Please enter the value for ULNA to calculate the Height");
		return;
	}

	Integer patAge = form.getGlobalContext().Core.getPatientShort().getAge();
	Sex patSex = form.getGlobalContext().Core.getPatientShort().getSex();

	if (patAge != null && patSex != null && (patSex.equals(ims.core.vo.lookups.Sex.MALE) || patSex.equals(ims.core.vo.lookups.Sex.FEMALE)))
	{
		Float heights = domain.getHeight(form.decUlna().getValue().toString(), patAge, patSex);

		if (heights == null)
		{
			engine.showMessage("Please enter a valid value for ULNA");
			return;
		}

		form.decHeight().setValue(heights);

	}
	else
	{
		engine.showMessage("When calculating the Height using ULNA radius the patient age and sex are mandatory!");
	}

}
 
Example 30
Project: AvoinApotti   File: VitalSignsImpl.java   View source code 5 votes vote down vote up
public Float getHeight(String ulnaValue, Integer age, Sex sex)
{
	
	StringBuffer hql = new StringBuffer();
	
	DomainFactory factory = getDomainFactory();
	
	if (age<65)
	{
		if (sex.equals(ims.core.vo.lookups.Sex.MALE))
		{
			hql.append("select patHeights.menUnder65HeightM ");
		}
		else if (sex.equals(ims.core.vo.lookups.Sex.FEMALE))
		{
			hql.append("select patHeights.womenUnder65HeightM ");
		}
	}
	else
	{
		if (sex.equals(ims.core.vo.lookups.Sex.MALE))
		{
			hql.append("select patHeights.menOver65HeightM");
		}
		else if (sex.equals(ims.core.vo.lookups.Sex.FEMALE))
		{
			hql.append("select patHeights.womenOver65HeightM ");
		}
	}
	
	hql.append(" from PatientHeightEstimationULNAConfig patHeights where patHeights.uLNALengthCM = " + ulnaValue);	
	
	List <?> list = factory.find(hql.toString());
	
	if (list!=null && list.size()>0)
		return  (Float)list.get(0);
	
	return null;
	
}
 
Example 31
Project: AvoinApotti   File: BedInfoDialogImpl.java   View source code 5 votes vote down vote up
private void copyHomeleaveToDto(Homeleave homeLeaveRec, HomeLeaveVo voHomeLeave, InPatientEpisodeADTVo inpatientEpisode)
{
	HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);
 	
	hlRec.Pkey = getPatientIdValue(inpatientEpisode, PatIdType.PKEY);
	hlRec.Hospnum = getPatientIdValue(inpatientEpisode, PatIdType.HOSPNUM);

	InpatientEpisode doInpat = InPatientEpisodeADTVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatientEpisode);
	hlRec.Rescode = doInpat.getPasEvent() != null && doInpat.getPasEvent().getLocation() != null ? doInpat.getPasEvent().getLocation().getExtCode(TaxonomyType.PAS.getID()) : null;
	hlRec.Mors = DTOHelper.getPasMapping(doInpat.getWardType());

	hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
	hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

	hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
	hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";
	if(hlRec.Mors.equals("M"))
	{
		if(doInpat.getPasEvent().getPatient().getSex() != null)
		{
			if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
				hlRec.Btyp = "M";
			else if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
				hlRec.Btyp = "F";
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";
		}
		else
			//defaulting Male for unknown sex
			hlRec.Btyp = "M";	
	}
	else if(hlRec.Mors.equals("S"))
		hlRec.Btyp = "S";


	hlRec.Hlfl = "Y"; //"Y" on an insert
	
	hlRec.Webadt = "Y";				
}
 
Example 32
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private MyOrderQuestionsPopulation getMyOrderQuestionPopulationHelperFactory()
{
	PatientShort voPatShort = form.getGlobalContext().Core.getPatientShort();
	Integer age = voPatShort != null ? voPatShort.calculateAge() : null;
	Sex sex = voPatShort != null ? voPatShort.getSex() : null;

	return new MyOrderQuestionsPopulation(form.lyrTemplates().tabPreview().lyrPreview().tabQuestions().dynGrdQuestions(), form.getImages().OCRR.Question, form.getImages().OCRR.Information, form.getImages().Core.MandatoryQuestion, form.getImages().OCRR.Investigation, age, sex);
}
 
Example 33
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private MyOrderQuestionsPopulation getMyOrderQuestionPopulationHelperFactory()
{
	PatientShort voPatShort = form.getGlobalContext().OCRR.getQuestionsNotes().getPatient();
	Integer age = voPatShort != null ? voPatShort.calculateAge() : null;
	Sex sex = voPatShort != null ? voPatShort.getSex() : null;

	return new MyOrderQuestionsPopulation(form.lyrDisplay().tabQuestionsNotes().dyngrdQuestions(), form.getImages().OCRR.Question, form.getImages().OCRR.Information, form.getImages().Core.MandatoryQuestion, form.getImages().OCRR.Investigation, age, sex, engine);
}
 
Example 34
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private MyOrderQuestionsPopulation getMyOrderQuestionPopulationHelperFactory()
{
	PatientShort voPatShort = form.getGlobalContext().Core.getPatientShort();
	Integer age = voPatShort != null ? voPatShort.calculateAge() : null;
	Sex sex = voPatShort != null ? voPatShort.getSex() : null;

	return new MyOrderQuestionsPopulation(form.lyrDetails().tabClinicalNotes().dyngrdQuestions(), form.getImages().OCRR.Question, form.getImages().OCRR.Information, form.getImages().Core.MandatoryQuestion, form.getImages().OCRR.Investigation, age, sex);
}
 
Example 35
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean selectedPatientSexIsKnown()
{
	if(form.getLocalContext().getPatientShort() == null)
		return false;
	if(form.getLocalContext().getPatientShort().getSex() == null)
		return false;
	if(form.getLocalContext().getPatientShort().getSex().equals(Sex.MALE))
		return true;
	if(form.getLocalContext().getPatientShort().getSex().equals(Sex.FEMALE))
		return true;
	
	return false;
}
 
Example 36
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private Boolean selectedPatientIsMale()
{
	if(!selectedPatientSexIsKnown())
		return null;
	
	if(form.getLocalContext().getPatientShort().getSex().equals(Sex.MALE))
		return Boolean.TRUE;
	
	return Boolean.FALSE;
}
 
Example 37
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private boolean selectedPatientSexIsKnown()
{
	if (form.getGlobalContext().Core.getPatientShort() == null)
		return false;
	if (form.getGlobalContext().Core.getPatientShort().getSex() == null)
		return false;
	if (form.getGlobalContext().Core.getPatientShort().getSex().equals(Sex.MALE))
		return true;
	if (form.getGlobalContext().Core.getPatientShort().getSex().equals(Sex.FEMALE))
		return true;

	return false;
}
 
Example 38
Project: AvoinApotti   File: Logic.java   View source code 5 votes vote down vote up
private Boolean selectedPatientIsMale()
{
	if (!selectedPatientSexIsKnown())
		return null;

	if (form.getGlobalContext().Core.getPatientShort().getSex().equals(Sex.MALE))
		return Boolean.TRUE;

	return Boolean.FALSE;
}
 
Example 39
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 5 votes vote down vote up
public MyOrderQuestionsPopulation(DynamicGrid gridQuestions, Image questionImage, Image infoImage, Image mandatoryQuestionImage, Image investigationImage, Integer age, Sex sex)	
{
	this.gridQuestions = gridQuestions;
	this.questionImage = questionImage;
	this.infoImage = infoImage;
	this.mandatoryQuestionImage = mandatoryQuestionImage;
	this.investigationImage = investigationImage;
	setAge(age);
	setSex(sex);
}
 
Example 40
Project: AvoinApotti   File: MyOrderQuestionsPopulation.java   View source code 5 votes vote down vote up
public MyOrderQuestionsPopulation(DynamicGrid gridQuestions, Image questionImage, Image infoImage, Image mandatoryQuestionImage, Image investigationImage, Integer age, Sex sex, UIEngine uiEngine)	
{
	this.gridQuestions = gridQuestions;
	this.questionImage = questionImage;
	this.infoImage = infoImage;
	this.mandatoryQuestionImage = mandatoryQuestionImage;
	this.investigationImage = investigationImage;
	setAge(age);
	setSex(sex);
	engine = uiEngine;
}