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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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   Source Code and License 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;
}
 
Example 41
Project: AvoinApotti   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public ReOrderPeriodMessageVoCollection listOrderSetInvestigationsWithinMinReOrderPeriod(OrderSetRefVo orderSet, PatientShort patient, BreachedInvestigationsVoCollection breachedInvestigations) // 	WDEV-16762
{
	if(orderSet == null || patient == null)
		throw new CodingRuntimeException("orderSet or patient is null in method listOrderSetInvestigationsWithinMinReOrderPeriod");
	
	boolean isFemale = patient.getSexIsNotNull() && patient.getSex().equals(Sex.FEMALE);
	
	DomainFactory factory = getDomainFactory();
	OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet);
	
	if(doOrderSet == null || doOrderSet.getComponent() == null)
		return null;
	
	Iterator it = doOrderSet.getComponent().iterator();
	
	ReOrderPeriodMessageVoCollection voCollMessages = new ReOrderPeriodMessageVoCollection();
	
	while(it.hasNext())
	{
		Object comp = it.next();
		if(!(comp instanceof OrderSetComponent))
			continue;
		
		Investigation doInv = ((OrderSetComponent) comp).getInvestigation();
		
		ReOrderPeriodMessageVoCollection profOrderInvMessages = listMessages(doInv, patient, isFemale, breachedInvestigations, null);//WDEV-16762
		
		if(profOrderInvMessages != null)
		{
			for(ReOrderPeriodMessageVo item : profOrderInvMessages)
				voCollMessages.add(item);
		}
	}
	
	return voCollMessages;
}
 
Example 42
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Sex getConfiguredBayGender(BayConfigLiteVo bay)
{
	if (Boolean.TRUE.equals(bay.getMale()) && !Boolean.TRUE.equals(bay.getFemale()))
		 return Sex.MALE;
	if (Boolean.TRUE.equals(bay.getFemale()) && !Boolean.TRUE.equals(bay.getMale()))
		 return Sex.FEMALE;
	return null;
}
 
Example 43
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Sex getSelectedPatientSex()
{
	Sex sex = null;
	if (BedDialogPatientDataTabs.TAB_TRANSFER_IN.equals(form.getLocalContext().getTabFocused()) && form.lyrDetail().tabTransfer().lyrTransfer().tabIn().isVisible())
		sex =  form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getValue() != null && form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getValue().getInpatientEpisodeIsNotNull() && form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getValue().getInpatientEpisode().getPasEventIsNotNull() && form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getValue().getInpatientEpisode().getPasEvent().getPatientIsNotNull() && form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getValue().getInpatientEpisode().getPasEvent().getPatient().getSexIsNotNull() ? form.lyrDetail().tabTransfer().lyrTransfer().tabIn().grdTransferIn().getValue().getInpatientEpisode().getPasEvent().getPatient().getSex() : null;
	return (sex == null || Sex.UNKNOWN.equals(sex)) ? null : sex;	
}
 
Example 44
Project: openmaxims-linux   File: SelectandOrderImpl.java   Source Code and License 5 votes vote down vote up
public ReOrderPeriodMessageVoCollection listOrderSetInvestigationsWithinMinReOrderPeriod(OrderSetRefVo orderSet, PatientShort patient, BreachedInvestigationsVoCollection breachedInvestigations) // 	WDEV-16762
{
	if(orderSet == null || patient == null)
		throw new CodingRuntimeException("orderSet or patient is null in method listOrderSetInvestigationsWithinMinReOrderPeriod");
	
	boolean isFemale = patient.getSexIsNotNull() && patient.getSex().equals(Sex.FEMALE);
	
	DomainFactory factory = getDomainFactory();
	OrderSet doOrderSet = (OrderSet) factory.getDomainObject(orderSet);
	
	if(doOrderSet == null || doOrderSet.getComponent() == null)
		return null;
	
	Iterator it = doOrderSet.getComponent().iterator();
	
	ReOrderPeriodMessageVoCollection voCollMessages = new ReOrderPeriodMessageVoCollection();
	
	while(it.hasNext())
	{
		Object comp = it.next();
		if(!(comp instanceof OrderSetComponent))
			continue;
		
		Investigation doInv = ((OrderSetComponent) comp).getInvestigation();
		
		ReOrderPeriodMessageVoCollection profOrderInvMessages = listMessages(doInv, patient, isFemale, breachedInvestigations, null);//WDEV-16762
		
		if(profOrderInvMessages != null)
		{
			for(ReOrderPeriodMessageVo item : profOrderInvMessages)
				voCollMessages.add(item);
		}
	}
	
	return voCollMessages;
}
 
Example 45
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
@Override
protected void onBtnCalculateULNAClick() throws PresentationLogicException
{
	if (form.lyrVital().tabPageBaseline().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.lyrVital().tabPageBaseline().decUlna().setValue(null);
		return;
	}
	
	if (form.lyrVital().tabPageBaseline().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.lyrVital().tabPageBaseline().decUlna().getValue().toString(), patAge, patSex);

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

		form.lyrVital().tabPageBaseline().decHeight().setValue(heights);

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

}
 
Example 46
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void setSexForSelectedpatient(PatientLite_IdentifiersVo patient)
{
	if (patient != null && patient.getSexIsNotNull() && !Sex.UNKNOWN.equals(patient.getSex()))
		form.getLocalContext().setlcPatientSex(patient.getSex());
	else
		form.getLocalContext().setlcPatientSex(null);		
}
 
Example 47
Project: openmaxims-linux   File: BedInfoDialogImpl.java   Source Code and License 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 48
Project: openMAXIMS   File: Logic.java   Source Code and License 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 49
Project: openMAXIMS   File: WardViewPatientSummaryComponentImpl.java   Source Code and License 5 votes vote down vote up
public Integer countMalePatientsOnTheWard(LocationRefVo ward, LocationRefVo bay)
{
	if (ward == null || ward.getID_Location() == null)
		return 0;
	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();
	
	StringBuilder query = new StringBuilder("SELECT COUNT (inpat.id) ");
	query.append(" FROM PendingTransfers AS pendTrans RIGHT JOIN pendTrans.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(" bed is not null AND bed.ward.id = :WARD_ID "); 
	
	paramNames.add("WARD_ID");
	paramValues.add(ward.getID_Location());
	
	if (bay != null)
	{
		query.append(" AND bed.bay.id = :BAY_ID ");
		paramNames.add("BAY_ID");
		paramValues.add(bay.getID_Location());
	}				
	query.append(" AND patient.sex.id = :MALE_SEX ");
	
	paramNames.add("MALE_SEX");
	paramValues.add(Sex.MALE.getID());
			

	return (int) getDomainFactory().countWithHQL(query.toString(), paramNames.toArray(new String[paramNames.size()]), paramValues.toArray(new Object[paramValues.size()]));
}
 
Example 50
Project: openMAXIMS   File: WardViewPatientSummaryComponentImpl.java   Source Code and License 5 votes vote down vote up
public Integer countFemalePatientsOnTheWard(LocationRefVo ward, LocationRefVo bay)
{
	if (ward == null || ward.getID_Location() == null)
		return 0;
	
	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>();
	
	StringBuilder query = new StringBuilder("SELECT COUNT (inpat.id) ");
	query.append(" FROM PendingTransfers AS pendTrans RIGHT JOIN pendTrans.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(" bed is not null AND bed.ward.id = :WARD_ID "); 
	
	paramNames.add("WARD_ID");
	paramValues.add(ward.getID_Location());
	
	if (bay != null)
	{
		query.append(" AND bed.bay.id = :BAY_ID ");
		paramNames.add("BAY_ID");
		paramValues.add(bay.getID_Location());
	}				
	query.append(" AND patient.sex.id = :FEMALE_SEX ");
	
	paramNames.add("FEMALE_SEX");
	paramValues.add(Sex.FEMALE.getID());				

	return (int) getDomainFactory().countWithHQL(query.toString(), paramNames.toArray(new String[paramNames.size()]), paramValues.toArray(new Object[paramValues.size()]));
}
 
Example 51
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
private void checkAndUpdatePreviousBayConfig(DomainFactory factory, BedSpaceStateLiteVo voBedSpacState, Sex tempGenderToSet) throws StaleObjectException
{
	if (voBedSpacState.getBay() == null || voBedSpacState.getWard() == null)
		return;

	WardConfigLiteVo wardConfigLiteVo = getWardConfig(voBedSpacState.getWard());
	BayConfigLiteVo bayConfig = getBayConfig(voBedSpacState.getBay(), wardConfigLiteVo);		
	boolean wasConfigChanged = false;

	if (bayConfig != null && bayConfig.getTemporaryBayGenderIsNotNull())
	{
		if (bayConfig.getNumOfOccupiedBeds() == null || bayConfig.getNumOfOccupiedBeds() == 0)
		{	
			bayConfig.setTemporaryBayGender(null);
			wasConfigChanged = true;
		}	
		if (tempGenderToSet != null)
		{	
			Sex tempGender = getTempGenderToInstateForPreviousBay(wardConfigLiteVo, bayConfig);
			if (tempGender != null)
			{	
				bayConfig.setTemporaryBayGender(tempGender);
				wasConfigChanged = true;
				if (wasConfigChanged)
				{	
					BayConfig bayConfigDO = BayConfigLiteVoAssembler.extractBayConfig(factory, bayConfig);
					factory.save(bayConfigDO);
				}
			}
		}
	}
}
 
Example 52
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
private boolean allPatientsGenderMatchBayGender(BayConfigLiteVo bayConfig)
{
	Sex genderToCheck = bayConfig.getTemporaryBayGender();
	
	if (genderToCheck != null)
	{		
		String hql = "select count(bedspacest.id) from BedSpaceState as bedspacest left join bedspacest.inpatientEpisode as inpat left join inpat.pasEvent as pasEv left join pasEv.patient as pat where bedspacest.bay.id = :BAY and pat.sex.id = :GENDER";
			
		long count = getDomainFactory().countWithHQL(hql, new String[]{"BAY", "GENDER"}, new Object[] {bayConfig.getBay().getID_Location(), genderToCheck.getID()});
			
		return (bayConfig.getNumOfOccupiedBedsIsNotNull() && new Integer((int)count).equals(bayConfig.getNumOfOccupiedBeds()));			
	}
	return false;
}
 
Example 53
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 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 54
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
private void checkAndUpdateBayConfig(DomainFactory factory, BedSpaceStateLiteVo voBedSpacState, Sex tempGenderToSet) throws StaleObjectException
{
	if (voBedSpacState.getBay() == null || voBedSpacState.getWard() == null)
		return;

	BayConfigLiteVo bayConfig =  getBayConfig(voBedSpacState.getBay());		

	if (bayConfig != null && bayConfig.getTemporaryBayGenderIsNotNull())
	{
		if (bayConfig.getNumOfOccupiedBeds() == null || bayConfig.getNumOfOccupiedBeds() == 0)
			bayConfig.setTemporaryBayGender(null);

		else if (allPatientsGenderMatchBayGender(bayConfig))
		{
			bayConfig.setTemporaryBayGender(Sex.MALE.equals(tempGenderToSet) ? Sex.FEMALE : Sex.MALE);				
		}
		else if (!tempGenderToSet.equals(bayConfig.getTemporaryBayGender()))
		{
			bayConfig.setTemporaryBayGender(tempGenderToSet);
		}
		if (!bayConfig.isValidated())
		{
			String[] err = bayConfig.validate();
			if (err != null)
			{	
				BayConfig bayConfigDO = BayConfigLiteVoAssembler.extractBayConfig(factory, bayConfig);				
				factory.save(bayConfigDO);
			}
		}			
	}
}
 
Example 55
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
private boolean allPatientsGenderMatchBayGender(BayConfigLiteVo bayConfig)
{
	Sex genderToCheck = bayConfig.getTemporaryBayGender();

	if (genderToCheck != null)
	{		
		String hql = "select count(bedspacest.id) from BedSpaceState as bedspacest left join bedspacest.inpatientEpisode as inpat left join inpat.pasEvent as pasEv left join pasEv.patient as pat where bedspacest.bay.id = :BAY and pat.sex.id = :GENDER";

		long count = getDomainFactory().countWithHQL(hql, new String[]{"BAY", "GENDER"}, new Object[] {bayConfig.getBay().getID_Location(), genderToCheck.getID()});

		return (bayConfig.getNumOfOccupiedBedsIsNotNull() && new Integer((int)count).equals(bayConfig.getNumOfOccupiedBeds()));			
	}
	return false;
}
 
Example 56
Project: openmaxims-linux   File: VitalSignsImpl.java   Source Code and License 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 57
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean showHCGMessage(Integer patAge)
{
	if(form.getGlobalContext().Core.getPatientShortIsNotNull() && patAge != null &&
		ConfigFlag.GEN.HCG_TEST_LOWER_AGE_LIMIT.getValue() <= patAge &&
		ConfigFlag.GEN.HCG_TEST_UPPER_AGE_LIMIT.getValue() >= patAge &&
		Sex.FEMALE.equals(form.getGlobalContext().Core.getPatientShort().getSex()) &&
		( TriageAssessmentAction.ADD.equals(form.getLocalContext().getTriageAssessmentAction()) ||
		  TriageAssessmentAction.RETRIAGE.equals(form.getLocalContext().getTriageAssessmentAction())) &&
		domain.isAbdominalPainProtocol(form.getGlobalContext().Emergency.getTriage()) )
			return true;
	
	return false;
}
 
Example 58
Project: openMAXIMS   File: Logic.java   Source Code and License 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 59
Project: openMAXIMS   File: Logic.java   Source Code and License 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 60
Project: openMAXIMS   File: Logic.java   Source Code and License 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);
}