Java Code Examples for ims.core.vo.AdmissionDetailVo

The following are top voted examples for showing how to use ims.core.vo.AdmissionDetailVo. 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
public void initialize(PatientShort patient, EpisodeofCareShortVo episodeOfCare, CareContextShortVo careContext, AdmissionDetailVo admissionDetail)
{
	form.getLocalContext().setPatient(patient);

	if (careContext != null)
		form.getLocalContext().setCareContext(domain.getCareContext(careContext));

	form.getLocalContext().setCurrentAdmissionDetail(admissionDetail);
	
	form.ccAdmittingConsultant().initialize(null, MedicGrade.CONS);
	form.ccAdmittingConsultant().isRequired(true);

	removeItemsFromReferredAdmittedComboBoxes();
	populateWardsCombo();
	open();
	updateControlsState();

}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateAdmittedFromDetailsFromData(AdmissionDetailVo admissionDetail)
{
	if (admissionDetail.getExtendedDetails() == null)
		return;

	form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType());

	if (admissionDetail.getExtendedDetails().getAdmittedFromIsNotNull())
	{
		ExternalResourceVo admFromDet = admissionDetail.getExtendedDetails().getAdmittedFrom();

		form.txtAdmittedFromName().setValue(admFromDet.getResourcename());
		if (admFromDet.getResourceAddressIsNotNull())
		{
			form.txtAdrAdmittedFromLine1().setValue(admFromDet.getResourceAddress().getLine1());
			form.txtAdrAdmittedFromLine2().setValue(admFromDet.getResourceAddress().getLine2());
			form.txtAdrAdmittedFromLine3().setValue(admFromDet.getResourceAddress().getLine3());
			form.cmbAdmittedCounty().setValue(admFromDet.getResourceAddress().getCounty());
			form.txtTelephoneNr().setValue(admFromDet.getResourceAddress().getPhone());
		}

		form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(admFromDet);
	}

}
 
Example 3
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateReferrerDetailsFromData(AdmissionDetailVo admissionDetail)
{
	if (admissionDetail.getExtendedDetails() == null)
		return;

	form.cmbReferredFrom().setValue(admissionDetail.getExtendedDetails().getReferredFromType());

	if (admissionDetail.getExtendedDetails().getReferrerDetailsIsNotNull())
	{
		ExternalResourceVo referrerDet = admissionDetail.getExtendedDetails().getReferrerDetails();

		form.txtReferrerNameOrganisation().setValue(referrerDet.getResourcename());
		if (referrerDet.getResourceAddressIsNotNull())
		{
			form.txtReferrerAdr1().setValue(referrerDet.getResourceAddress().getLine1());
			form.txtReferrerAdr2().setValue(referrerDet.getResourceAddress().getLine2());
			form.txtReferrerAdr3().setValue(referrerDet.getResourceAddress().getLine3());
			form.cmbReferrerCounty().setValue(referrerDet.getResourceAddress().getCounty());
			form.txtReferrerContactNr().setValue(referrerDet.getResourceAddress().getPhone());
		}
		
		form.getLocalContext().setSelectedExternalResourceForReferredFrom(referrerDet);
	}
}
 
Example 4
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission)
{
	if( adtDiscEp != null )
	{
		form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime());
		form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null);
		form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():"");
	}
	
	if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0)
	{
		for( int i = 0; i < admission.getTransferHistory().size(); i++ )
		{
		
			TransferHistoryVo tempVo = admission.getTransferHistory().get(i);
			grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow();
			rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():"");
			rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():"");
			rowW.setValue(tempVo);
			
		}
	}
	
}
 
Example 5
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdHomeLeaveSelectionChanged() throws PresentationLogicException 
{
	form.getLocalContext().setAdmissionDetail(null);
	clearScreen();
	if(form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue() == null)
		return;

	form.dteHLDateReturn().setEnabled(true);
	form.timHLTimeOfReturn().setEnabled(true);
	form.dteHLDateReturn().setValue(new Date());

	form.getLocalContext().setRecordSelected(true);
	
	InpatientEpisodeLiteVo voInWaiting = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue();
	AdmissionDetailVo voAdmission = domain.getAdmissionDetailByPasEvent(voInWaiting.getPasEvent());
	if(voAdmission == null)
		return;
	
	form.getLocalContext().setAdmissionDetail(voAdmission);
	form.fireCustomControlValueChanged();
}
 
Example 6
Project: AvoinApotti   File: ADTDischargeDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getLastAdmissionForPatient(PatientRefVo parRef)
{
	if( parRef == null )
		throw new CodingRuntimeException("PatientRefVo is null");
	
	DomainFactory factory = getDomainFactory();
	 
	String hql = " select a1_1 from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 left join p1_1.patient as p2_1 where (p2_1.id = :patientId) order by a1_1.admissionDateTime desc";
	List<?> lst = factory.find(hql,new String[]{"patientId"},new Object[]{parRef.getID_Patient()});
	if (lst != null && lst.size() > 0)
	{
		AdmissionDetailVoCollection tempColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(lst) ;
		if(tempColl != null && tempColl.size() > 0)
		{
			return tempColl.get(0);
		}

	}
	return null;
}
 
Example 7
Project: AvoinApotti   File: ADTDischargeDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getAdmissionForSelectedCareContext(CareContextInterfaceVo careContext)
{
	if( careContext == null || careContext.getPasEvent() == null )
		throw new CodingRuntimeException("CareContextInterfaceVo is null");
	
	DomainFactory factory = getDomainFactory();
	 	 
	String hql = " select a1_1	from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 where (p1_1.id = :pasEventId) order by a1_1.admissionDateTime desc";
	List<?> lst = factory.find(hql,new String[]{"pasEventId"},new Object[]{careContext.getPasEvent().getID_PASEvent()});
	if (lst != null && lst.size() > 0)
	{
		AdmissionDetailVoCollection tempColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(lst) ;
		if(tempColl != null && tempColl.size() > 0)
		{
			return tempColl.get(0);
		}

	}
	return null;
}
 
Example 8
Project: AvoinApotti   File: EDischargeSummarySthkComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getAdmissionDetailByCareContext(CareContextRefVo voCC) 
{
	if (voCC == null || voCC.getID_CareContext() == null)
		throw new CodingRuntimeException("careContext is null or id not provided in method getAdmissionDetailByCareContext");
	
	List items = getDomainFactory().find(" select cc.pasEvent.id from CareContext as cc where cc.id = " +  voCC.getID_CareContext());
	if(items != null && items.size() > 0)
	{
		Integer eventId = (Integer) items.get(0);
	
		if(eventId!= null && eventId  > 0)
		{
			List ieItems = getDomainFactory().find(" from AdmissionDetail ad where ad.pasEvent.id = " +  eventId);
			if(ieItems != null && ieItems.size() > 0)
				return AdmissionDetailVoAssembler.create((AdmissionDetail) ieItems.get(0));
		}	
	}
	
	return null;
}
 
Example 9
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void updateAdmissionRecordWithHealthyLodgerDetails(AdmissionDetailVo admissionDetails,	HealthyLodgerVo healthyLodgerDetails)
{
	if (admissionDetails == null)
		return;
	admissionDetails.setHealthyLodgerDetails(healthyLodgerDetails);
	
	String[] errors = admissionDetails.validate();
	
	if (errors != null)
	{
		engine.showErrors(errors);
		return;
	}
	try {
		form.getLocalContext().setAdmissionDetails(domain.updateAdmissionDetailWithHealthyLodgerInfo(admissionDetails, healthyLodgerDetails));
	} 
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		engine.close(DialogResult.OK);
		return;
	}		
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize(PatientShort patient, EpisodeofCareShortVo episodeOfCare, CareContextShortVo careContext, AdmissionDetailVo admissionDetail)
{
	form.getLocalContext().setPatient(patient);

	if (careContext != null)
		form.getLocalContext().setCareContext(domain.getCareContext(careContext));

	form.getLocalContext().setCurrentAdmissionDetail(admissionDetail);
	
	form.ccAdmittingConsultant().initialize(null, MedicGrade.CONS);
	form.ccAdmittingConsultant().isRequired(true);

	removeItemsFromReferredAdmittedComboBoxes();
	populateWardsCombo();
	open();
	updateControlsState();

}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateAdmittedFromDetailsFromData(AdmissionDetailVo admissionDetail)
{
	if (admissionDetail.getExtendedDetails() == null)
		return;

	form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType());

	if (admissionDetail.getExtendedDetails().getAdmittedFromIsNotNull())
	{
		ExternalResourceVo admFromDet = admissionDetail.getExtendedDetails().getAdmittedFrom();

		form.txtAdmittedFromName().setValue(admFromDet.getResourcename());
		if (admFromDet.getResourceAddressIsNotNull())
		{
			form.txtAdrAdmittedFromLine1().setValue(admFromDet.getResourceAddress().getLine1());
			form.txtAdrAdmittedFromLine2().setValue(admFromDet.getResourceAddress().getLine2());
			form.txtAdrAdmittedFromLine3().setValue(admFromDet.getResourceAddress().getLine3());
			form.cmbAdmittedCounty().setValue(admFromDet.getResourceAddress().getCounty());
			form.txtTelephoneNr().setValue(admFromDet.getResourceAddress().getPhone());
		}

		form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(admFromDet);
	}

}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateReferrerDetailsFromData(AdmissionDetailVo admissionDetail)
{
	if (admissionDetail.getExtendedDetails() == null)
		return;

	form.cmbReferredFrom().setValue(admissionDetail.getExtendedDetails().getReferredFromType());

	if (admissionDetail.getExtendedDetails().getReferrerDetailsIsNotNull())
	{
		ExternalResourceVo referrerDet = admissionDetail.getExtendedDetails().getReferrerDetails();

		form.txtReferrerNameOrganisation().setValue(referrerDet.getResourcename());
		if (referrerDet.getResourceAddressIsNotNull())
		{
			form.txtReferrerAdr1().setValue(referrerDet.getResourceAddress().getLine1());
			form.txtReferrerAdr2().setValue(referrerDet.getResourceAddress().getLine2());
			form.txtReferrerAdr3().setValue(referrerDet.getResourceAddress().getLine3());
			form.cmbReferrerCounty().setValue(referrerDet.getResourceAddress().getCounty());
			form.txtReferrerContactNr().setValue(referrerDet.getResourceAddress().getPhone());
		}
		
		form.getLocalContext().setSelectedExternalResourceForReferredFrom(referrerDet);
	}
}
 
Example 13
Project: openmaxims-linux   File: ADTDischargeDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getLastAdmissionForPatient(PatientRefVo parRef)
{
	if( parRef == null )
		throw new CodingRuntimeException("PatientRefVo is null");
	
	DomainFactory factory = getDomainFactory();
	 
	String hql = " select a1_1 from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 left join p1_1.patient as p2_1 where (p2_1.id = :patientId) order by a1_1.admissionDateTime desc";
	List<?> lst = factory.find(hql,new String[]{"patientId"},new Object[]{parRef.getID_Patient()});
	if (lst != null && lst.size() > 0)
	{
		AdmissionDetailVoCollection tempColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(lst) ;
		if(tempColl != null && tempColl.size() > 0)
		{
			return tempColl.get(0);
		}

	}
	return null;
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission)
{
	if( adtDiscEp != null )
	{
		form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime());
		form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null);
		form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():"");
	}
	
	if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0)
	{
		for( int i = 0; i < admission.getTransferHistory().size(); i++ )
		{
		
			TransferHistoryVo tempVo = admission.getTransferHistory().get(i);
			grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow();
			rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():"");
			rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():"");
			rowW.setValue(tempVo);
			
		}
	}
	
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private AdmissionDetailVo updateAdmissionRecordWithHealthyLodgerDetails(AdmissionDetailVo admissionDetails,	HealthyLodgerVo healthyLodgerDetails)
{
	if (admissionDetails == null)
		return null;
	
	AdmissionDetailVo admission = null;
	
	admissionDetails.setHealthyLodgerDetails(healthyLodgerDetails);
	
	String[] errors = admissionDetails.validate();
	
	if (errors != null)
	{
		engine.showErrors(errors);
		return null;
	}
	try {
		admission = domain.updateAdmissionDetailWithHealthyLodgerInfo(admissionDetails, healthyLodgerDetails);
	} 
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		return null;
	}		
	return admission;
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private WardMixedSexBreachVo populateWardMixedSexBreach(AdmissionDetailVo admission, BedSpaceStateLiteVo bedSpaceStateLiteVo, AdmissionReasonVo admissionReasonVo, Integer maleCount, Integer femaleCount)
{
	WardMixedSexBreachVo vo = new WardMixedSexBreachVo();

	vo.setWard(bedSpaceStateLiteVo.getWard());
	vo.setBay(bedSpaceStateLiteVo.getBay());
	vo.setFemalePatients(femaleCount);
	vo.setMalePatients(maleCount);
	vo.setAdmissionDateTime(admission.getAdmissionDateTime());
	Object mosUser = domain.getMosUser();
	if (mosUser != null)
		vo.setMemberOfStaff((MemberOfStaffLiteVo) mosUser);
	vo.setReasonForGenderBreach(admissionReasonVo.getReasonForMixingBayGender());
	vo.setReasonForGenderBreachComment(admissionReasonVo.getReasonForMixingBayGenderComment());

	return vo;
}
 
Example 17
Project: openMAXIMS   File: ADTDischargeDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getAdmissionForSelectedCareContext(CareContextInterfaceVo careContext)
{
	if( careContext == null || careContext.getPasEvent() == null )
		throw new CodingRuntimeException("CareContextInterfaceVo is null");
	
	DomainFactory factory = getDomainFactory();
	 	 
	String hql = " select a1_1	from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 where (p1_1.id = :pasEventId) order by a1_1.admissionDateTime desc";
	List<?> lst = factory.find(hql,new String[]{"pasEventId"},new Object[]{careContext.getPasEvent().getID_PASEvent()});
	if (lst != null && lst.size() > 0)
	{
		AdmissionDetailVoCollection tempColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(lst) ;
		if(tempColl != null && tempColl.size() > 0)
		{
			return tempColl.get(0);
		}

	}
	return null;
}
 
Example 18
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 6 votes vote down vote up
private BayTimesAdmissionBreachedVo populateBayTimesBreachedRecord(AdmissionDetailVo admissionDetail, BedSpaceStateLiteVo voBedSpaceStateLite, AdmissionReasonVo admissionReasonVo)
{
	BayTimesAdmissionBreachedVo voBreach = new BayTimesAdmissionBreachedVo();

	voBreach.setAdmissionDateTime(admissionDetail.getAdmissionDateTime());
	voBreach.setWard(admissionDetail.getWard());
	if (voBedSpaceStateLite != null)
		voBreach.setBay(voBedSpaceStateLite.getBay());
	//WDEV-22353
	Object mosUser = getMosUser();
	if (mosUser != null)
		voBreach.setMemberOfStaff((MemberOfStaffLiteVo) mosUser);
	voBreach.setReasonForAdmissionOutOfOpeningHours(admissionReasonVo.getReasonForAdmissionOutOfOpeningHours());
	voBreach.setReasonForAdmissionOutOfOpeningHoursComment(admissionReasonVo.getReasonForAdmissionOohComment());

	return voBreach;
}
 
Example 19
Project: openMAXIMS   File: EDischargeSummarySthkComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getAdmissionDetailByCareContext(CareContextRefVo voCC) 
{
	if (voCC == null || voCC.getID_CareContext() == null)
		throw new CodingRuntimeException("careContext is null or id not provided in method getAdmissionDetailByCareContext");
	
	List items = getDomainFactory().find(" select cc.pasEvent.id from CareContext as cc where cc.id = " +  voCC.getID_CareContext());
	if(items != null && items.size() > 0)
	{
		Integer eventId = (Integer) items.get(0);
	
		if(eventId!= null && eventId  > 0)
		{
			List ieItems = getDomainFactory().find(" from AdmissionDetail ad where ad.pasEvent.id = " +  eventId);
			if(ieItems != null && ieItems.size() > 0)
				return AdmissionDetailVoAssembler.create((AdmissionDetail) ieItems.get(0));
		}	
	}
	
	return null;
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize(PatientShort patient, EpisodeofCareShortVo episodeOfCare, CareContextShortVo careContext, AdmissionDetailVo admissionDetail)
{
	form.getLocalContext().setPatient(patient);

	if (careContext != null)
		form.getLocalContext().setCareContext(domain.getCareContext(careContext));

	form.getLocalContext().setCurrentAdmissionDetail(admissionDetail);
	
	form.ccAdmittingConsultant().initialize(null, MedicGrade.CONS);
	form.ccAdmittingConsultant().isRequired(true);

	removeItemsFromReferredAdmittedComboBoxes();
	populateWardsCombo();
	open();
	updateControlsState();

}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateAdmittedFromDetailsFromData(AdmissionDetailVo admissionDetail)
{
	if (admissionDetail.getExtendedDetails() == null)
		return;

	form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType());

	if (admissionDetail.getExtendedDetails().getAdmittedFromIsNotNull())
	{
		ExternalResourceVo admFromDet = admissionDetail.getExtendedDetails().getAdmittedFrom();

		form.txtAdmittedFromName().setValue(admFromDet.getResourcename());
		if (admFromDet.getResourceAddressIsNotNull())
		{
			form.txtAdrAdmittedFromLine1().setValue(admFromDet.getResourceAddress().getLine1());
			form.txtAdrAdmittedFromLine2().setValue(admFromDet.getResourceAddress().getLine2());
			form.txtAdrAdmittedFromLine3().setValue(admFromDet.getResourceAddress().getLine3());
			form.cmbAdmittedCounty().setValue(admFromDet.getResourceAddress().getCounty());
			form.txtTelephoneNr().setValue(admFromDet.getResourceAddress().getPhone());
		}

		form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(admFromDet);
	}

}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateReferrerDetailsFromData(AdmissionDetailVo admissionDetail)
{
	if (admissionDetail.getExtendedDetails() == null)
		return;

	form.cmbReferredFrom().setValue(admissionDetail.getExtendedDetails().getReferredFromType());

	if (admissionDetail.getExtendedDetails().getReferrerDetailsIsNotNull())
	{
		ExternalResourceVo referrerDet = admissionDetail.getExtendedDetails().getReferrerDetails();

		form.txtReferrerNameOrganisation().setValue(referrerDet.getResourcename());
		if (referrerDet.getResourceAddressIsNotNull())
		{
			form.txtReferrerAdr1().setValue(referrerDet.getResourceAddress().getLine1());
			form.txtReferrerAdr2().setValue(referrerDet.getResourceAddress().getLine2());
			form.txtReferrerAdr3().setValue(referrerDet.getResourceAddress().getLine3());
			form.cmbReferrerCounty().setValue(referrerDet.getResourceAddress().getCounty());
			form.txtReferrerContactNr().setValue(referrerDet.getResourceAddress().getPhone());
		}
		
		form.getLocalContext().setSelectedExternalResourceForReferredFrom(referrerDet);
	}
}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission)
{
	if( adtDiscEp != null )
	{
		form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime());
		form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null);
		form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():"");
	}
	
	if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0)
	{
		for( int i = 0; i < admission.getTransferHistory().size(); i++ )
		{
		
			TransferHistoryVo tempVo = admission.getTransferHistory().get(i);
			grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow();
			rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():"");
			rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():"");
			rowW.setValue(tempVo);
			
		}
	}
	
}
 
Example 24
Project: openmaxims-linux   File: EDischargeSummarySthkComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getAdmissionDetailByCareContext(CareContextRefVo voCC) 
{
	if (voCC == null || voCC.getID_CareContext() == null)
		throw new CodingRuntimeException("careContext is null or id not provided in method getAdmissionDetailByCareContext");
	
	List items = getDomainFactory().find(" select cc.pasEvent.id from CareContext as cc where cc.id = " +  voCC.getID_CareContext());
	if(items != null && items.size() > 0)
	{
		Integer eventId = (Integer) items.get(0);
	
		if(eventId!= null && eventId  > 0)
		{
			List ieItems = getDomainFactory().find(" from AdmissionDetail ad where ad.pasEvent.id = " +  eventId);
			if(ieItems != null && ieItems.size() > 0)
				return AdmissionDetailVoAssembler.create((AdmissionDetail) ieItems.get(0));
		}	
	}
	
	return null;
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdHomeLeaveSelectionChanged() throws PresentationLogicException 
{
	form.getLocalContext().setAdmissionDetail(null);
	clearScreen();
	if(form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue() == null)
		return;

	form.dteHLDateReturn().setEnabled(true);
	form.timHLTimeOfReturn().setEnabled(true);
	form.dteHLDateReturn().setValue(new Date());

	form.getLocalContext().setRecordSelected(true);
	
	InpatientEpisodeLiteVo voInWaiting = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue();
	AdmissionDetailVo voAdmission = domain.getAdmissionDetailByPasEvent(voInWaiting.getPasEvent());
	if(voAdmission == null)
		return;
	
	form.getLocalContext().setAdmissionDetail(voAdmission);
	form.fireCustomControlValueChanged();
}
 
Example 26
Project: openMAXIMS   File: ADTDischargeDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getLastAdmissionForPatient(PatientRefVo parRef)
{
	if( parRef == null )
		throw new CodingRuntimeException("PatientRefVo is null");
	
	DomainFactory factory = getDomainFactory();
	 
	String hql = " select a1_1 from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 left join p1_1.patient as p2_1 where (p2_1.id = :patientId) order by a1_1.admissionDateTime desc";
	List<?> lst = factory.find(hql,new String[]{"patientId"},new Object[]{parRef.getID_Patient()});
	if (lst != null && lst.size() > 0)
	{
		AdmissionDetailVoCollection tempColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(lst) ;
		if(tempColl != null && tempColl.size() > 0)
		{
			return tempColl.get(0);
		}

	}
	return null;
}
 
Example 27
Project: openMAXIMS   File: ADTDischargeDetailsComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getAdmissionForSelectedCareContext(CareContextInterfaceVo careContext)
{
	if( careContext == null || careContext.getPasEvent() == null )
		throw new CodingRuntimeException("CareContextInterfaceVo is null");
	
	DomainFactory factory = getDomainFactory();
	 	 
	String hql = " select a1_1	from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 where (p1_1.id = :pasEventId) order by a1_1.admissionDateTime desc";
	List<?> lst = factory.find(hql,new String[]{"pasEventId"},new Object[]{careContext.getPasEvent().getID_PASEvent()});
	if (lst != null && lst.size() > 0)
	{
		AdmissionDetailVoCollection tempColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(lst) ;
		if(tempColl != null && tempColl.size() > 0)
		{
			return tempColl.get(0);
		}

	}
	return null;
}
 
Example 28
Project: openMAXIMS   File: EDischargeSummarySthkComponentImpl.java   Source Code and License 6 votes vote down vote up
public AdmissionDetailVo getAdmissionDetailByCareContext(CareContextRefVo voCC) 
{
	if (voCC == null || voCC.getID_CareContext() == null)
		throw new CodingRuntimeException("careContext is null or id not provided in method getAdmissionDetailByCareContext");
	
	List items = getDomainFactory().find(" select cc.pasEvent.id from CareContext as cc where cc.id = " +  voCC.getID_CareContext());
	if(items != null && items.size() > 0)
	{
		Integer eventId = (Integer) items.get(0);
	
		if(eventId!= null && eventId  > 0)
		{
			List ieItems = getDomainFactory().find(" from AdmissionDetail ad where ad.pasEvent.id = " +  eventId);
			if(ieItems != null && ieItems.size() > 0)
				return AdmissionDetailVoAssembler.create((AdmissionDetail) ieItems.get(0));
		}	
	}
	
	return null;
}
 
Example 29
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
public void initialize(PatientShort patient, EpisodeofCareShortVo episodeOfCare, CareContextShortVo careContext, AdmissionDetailVo admissionDetail)
{
	form.getLocalContext().setPatient(patient);

	if (careContext != null)
		form.getLocalContext().setCareContext(domain.getCareContext(careContext));

	form.getLocalContext().setCurrentAdmissionDetail(admissionDetail);
	
	form.ccAdmittingConsultant().initialize(null, MedicGrade.CONS);
	form.ccAdmittingConsultant().isRequired(true);

	removeItemsFromReferredAdmittedComboBoxes();
	populateWardsCombo();
	open();
	updateControlsState();

}
 
Example 30
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateAdmittedFromDetailsFromData(AdmissionDetailVo admissionDetail)
{
	if (admissionDetail.getExtendedDetails() == null)
		return;

	form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType());

	if (admissionDetail.getExtendedDetails().getAdmittedFromIsNotNull())
	{
		ExternalResourceVo admFromDet = admissionDetail.getExtendedDetails().getAdmittedFrom();

		form.txtAdmittedFromName().setValue(admFromDet.getResourcename());
		if (admFromDet.getResourceAddressIsNotNull())
		{
			form.txtAdrAdmittedFromLine1().setValue(admFromDet.getResourceAddress().getLine1());
			form.txtAdrAdmittedFromLine2().setValue(admFromDet.getResourceAddress().getLine2());
			form.txtAdrAdmittedFromLine3().setValue(admFromDet.getResourceAddress().getLine3());
			form.cmbAdmittedCounty().setValue(admFromDet.getResourceAddress().getCounty());
			form.txtTelephoneNr().setValue(admFromDet.getResourceAddress().getPhone());
		}

		form.getLocalContext().setSelectedExternalResourceForAdmittedFrom(admFromDet);
	}

}
 
Example 31
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateReferrerDetailsFromData(AdmissionDetailVo admissionDetail)
{
	if (admissionDetail.getExtendedDetails() == null)
		return;

	form.cmbReferredFrom().setValue(admissionDetail.getExtendedDetails().getReferredFromType());

	if (admissionDetail.getExtendedDetails().getReferrerDetailsIsNotNull())
	{
		ExternalResourceVo referrerDet = admissionDetail.getExtendedDetails().getReferrerDetails();

		form.txtReferrerNameOrganisation().setValue(referrerDet.getResourcename());
		if (referrerDet.getResourceAddressIsNotNull())
		{
			form.txtReferrerAdr1().setValue(referrerDet.getResourceAddress().getLine1());
			form.txtReferrerAdr2().setValue(referrerDet.getResourceAddress().getLine2());
			form.txtReferrerAdr3().setValue(referrerDet.getResourceAddress().getLine3());
			form.cmbReferrerCounty().setValue(referrerDet.getResourceAddress().getCounty());
			form.txtReferrerContactNr().setValue(referrerDet.getResourceAddress().getPhone());
		}
		
		form.getLocalContext().setSelectedExternalResourceForReferredFrom(referrerDet);
	}
}
 
Example 32
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void populateScreenFromData( DischargedEpisodeVo adtDiscEp, ims.core.vo.AdmissionDetailVo admission)
{
	if( adtDiscEp != null )
	{
		form.dtimDischargeDateTime().setValue(adtDiscEp.getDischargeDateTime());
		form.cmbDischargeReason().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getDischargeReason():null);
		form.txtCauseOfDeath().setValue(adtDiscEp.getExtendedDetailsIsNotNull() ? adtDiscEp.getExtendedDetails().getCauseOfDeath():"");
	}
	
	if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0)
	{
		for( int i = 0; i < admission.getTransferHistory().size(); i++ )
		{
		
			TransferHistoryVo tempVo = admission.getTransferHistory().get(i);
			grdWardTransferHistoryRow rowW = form.grdWardTransferHistory().getRows().newRow();
			rowW.setColumnWard(tempVo.getTransferringFromWardIsNotNull() ? tempVo.getTransferringFromWard().getName():"");
			rowW.setColumnDateOfTransfer(tempVo.getAcceptTransferDateTimeIsNotNull() ? tempVo.getAcceptTransferDateTime().toString():"");
			rowW.setValue(tempVo);
			
		}
	}
	
}
 
Example 33
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
@Override
protected void onGrdHomeLeaveSelectionChanged() throws PresentationLogicException 
{
	form.getLocalContext().setAdmissionDetail(null);
	clearScreen();
	if(form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue() == null)
		return;

	form.dteHLDateReturn().setEnabled(true);
	form.timHLTimeOfReturn().setEnabled(true);
	form.dteHLDateReturn().setValue(new Date());

	form.getLocalContext().setRecordSelected(true);
	
	InpatientEpisodeLiteVo voInWaiting = form.lyrAdmission().tabHomeLeave().grdHomeLeave().getValue();
	AdmissionDetailVo voAdmission = domain.getAdmissionDetailByPasEvent(voInWaiting.getPasEvent());
	if(voAdmission == null)
		return;
	
	form.getLocalContext().setAdmissionDetail(voAdmission);
	form.fireCustomControlValueChanged();
}
 
Example 34
Project: AvoinApotti   File: ClinicalAdmissionImpl.java   Source Code and License 5 votes vote down vote up
public AdmissionDetailVo getAdmissionDetail(Integer pasEventId) 
{
	if(pasEventId == null)
		return null;

	if(pasEventId != null)
	{
		DomainFactory factory = getDomainFactory();
		StringBuffer hql = new StringBuffer(" select a1_1 from AdmissionDetail as a1_1 left join a1_1.pasEvent as p1_1 where  "); 
		String andStr = " ";
	
		ArrayList<String> markers = new ArrayList<String>();
		ArrayList<Serializable> values = new ArrayList<Serializable>();
	
		hql.append(andStr + " p1_1.id = :pasEventId");
			markers.add("pasEventId");
		values.add(pasEventId);
		andStr = " and ";	

		List list = factory.find(hql.toString(), markers,values);
		if(list != null && list.size() > 0)
		{ 
			AdmissionDetailVoCollection voColl = AdmissionDetailVoAssembler.createAdmissionDetailVoCollectionFromAdmissionDetail(list);
			if(voColl != null && voColl.size() > 0)
				return voColl.get(0);
		}
	}
	return null;
}
 
Example 35
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateScreenFromData(AdmissionDetailVo admissionDetail)
{
	clearInstanceControls();

	if (admissionDetail == null)
		return;

	form.dtimAdmissionDateTime().setValue(admissionDetail.getAdmissionDateTime());
	if (form.getLocalContext().getCurrentAdmissionDetailIsNotNull() && form.getLocalContext().getCurrentAdmissionDetail().getPasEventIsNotNull())
	{
		form.cmbAdmissionWard().setValue(domain.getAdmissionWard(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));

		if (!domain.isPatientDischarged(form.getLocalContext().getCurrentAdmissionDetail()))
			form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromInpatientEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));
		else
			form.cmbAdmissionType().setValue(domain.getAdmissionTypeFromDischargedEpisode(form.getLocalContext().getCurrentAdmissionDetail().getPasEvent()));
	}

	form.ccAdmittingConsultant().setValue(admissionDetail.getConsultant());
	form.cmbSpecialty().setValue(admissionDetail.getSpecialty());

	form.intBedNumber().setValue(admissionDetail.getExtendedDetails() != null ? admissionDetail.getExtendedDetails().getBedNumber() : null);

	populateReferrerDetailsFromData(admissionDetail);

	if (admissionDetail.getExtendedDetails()!=null && ExternalResourceType.ERT_HOMEADDRESS.equals(admissionDetail.getExtendedDetails().getAdmittedFromType()))
	{
		form.cmbAdmittedFrom().setValue(admissionDetail.getExtendedDetails().getAdmittedFromType());
		populateAdmittedDetailsWithPatientAddress(form.getGlobalContext().Core.getPatientShort().getAddress());
	}
	else
	{
		populateAdmittedFromDetailsFromData(admissionDetail);
	}
}
 
Example 36
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
public void initialize(ims.core.vo.PatientShort patient, ims.core.vo.EpisodeofCareShortVo episodeofcare, ims.core.vo.CareContextShortVo careContext, ims.core.vo.AdmissionDetailVo admission, Boolean isOpenedFromInpatientListForm)
{
	form.getLocalContext().setConfimUndoDischargeMsgBoxId(null);
	
	form.getLocalContext().setIsOpenedFromInpatientListForm(isOpenedFromInpatientListForm);
	form.getLocalContext().setAdmissionDetail(admission);
	form.getLocalContext().setCareContextShortVo(careContext);
	if( careContext != null)
	{
		form.getLocalContext().setCareContext(domain.getCareContextById(careContext));
		
	}
	form.getLocalContext().setPatientShort(patient);
	
	if( form.getLocalContext().getCareContextIsNotNull() && form.getLocalContext().getCareContext().getPasEventIsNotNull() )
	{
		AdmissionDetailVo lastAdmission = domain.getLastAdmissionForPatient(patient);
		AdmissionDetailVo careContextAdmission = domain.getAdmissionForSelectedCareContext(form.getLocalContext().getCareContext());
		if( lastAdmission != null && careContextAdmission != null && lastAdmission.getID_AdmissionDetail().equals(careContextAdmission.getID_AdmissionDetail()))
			form.getLocalContext().setShowUndoDischargeButton(true);
		else
			form.getLocalContext().setShowUndoDischargeButton(false);
	}
	else
		form.getLocalContext().setShowUndoDischargeButton(false);
	
	open();
	
	updateControlsState();
	
}
 
Example 37
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private DateTime getTheLastWardTransferDateTime(ims.core.vo.AdmissionDetailVo admission)
{
	if( admission != null && admission.getTransferHistoryIsNotNull() && admission.getTransferHistory().size() > 0)
	{
		admission.getTransferHistory().sort(new DateTimeWardComparator(SortOrder.DESCENDING));
		return admission.getTransferHistory().get(0).getAcceptTransferDateTime();
	}
	return null;
}
 
Example 38
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void open()
{		
	PatientShort patient = domain.getPatient(form.getGlobalContext().Core.getPatientShort());
	form.getGlobalContext().Core.setPatientShort(patient);
	
	AdmissionDetailVo currentAdmissionDet =null;
	CareContextVo tempCareContext = (form.getGlobalContext().Core.getCurrentCareContextIsNotNull() ? domain.getCareContextByCareContextRef(form.getGlobalContext().Core.getCurrentCareContext()) :null );
	
	if (tempCareContext!=null && tempCareContext.getPasEventIsNotNull() && tempCareContext.getCurrentStatusIsNotNull() && CareContextStatus.OPEN.equals(tempCareContext.getCurrentStatus().getStatus()) ) 
	{
		currentAdmissionDet=domain.getAdmissionDetailByPasEvent(form.getGlobalContext().Core.getCurrentCareContext().getPasEvent());
	}
	else if (patient.getWardIsNotNull())
	{
		currentAdmissionDet = domain.getAdmissionDetail(patient);
		
		if (currentAdmissionDet!=null && currentAdmissionDet.getPasEventIsNotNull())
		{
			form.getGlobalContext().Core.setCurrentCareContext(domain.getCareContext(currentAdmissionDet.getPasEvent()));
		}
	}
	
	EpisodeofCareShortVo episodeOfCare = form.getGlobalContext().Core.getEpisodeofCareShort();
	CareContextShortVo careContext = form.getGlobalContext().Core.getCurrentCareContext();
	
	form.lyrADT().tabAdmissionDetails().ccAdmissionDetails().initialize(patient, episodeOfCare, careContext, currentAdmissionDet);
	form.lyrADT().tabDischargeDetails().ccDischargeDetails().initialize(patient, episodeOfCare, careContext, currentAdmissionDet,form.getLocalContext().getIsOpenedFromInpatientListForm()); //wdev-16427
	
	if( form.getLocalContext().getIsOpenedFromInpatientListFormIsNotNull() && Boolean.TRUE.equals(form.getLocalContext().getIsOpenedFromInpatientListForm())) //wdev-16427
	{
		form.lyrADT().tabDischargeDetails().ccDischargeDetails().setMode(FormMode.EDIT);
		form.lyrADT().showtabDischargeDetails();
		form.setMode(FormMode.EDIT);
		
	}
	else
	
		form.setMode(FormMode.VIEW);
	
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private CatsReferralEmergencyAdmissionVo createNewCatsReferralForAdmission(PatientShort patientShort, PatientWithGPForCCGVo patient, CareSpellVo careSpell, AdmissionDetailVo admission, ContractConfigShortVo contract)
{
	CatsReferralEmergencyAdmissionVo referral = new CatsReferralEmergencyAdmissionVo();
	
	referral.setPatient(patientShort);
	referral.setCareContext(careSpell.getEpisodes().get(0).getCareContexts().get(0));
	
	CatsReferralStatusVo referralStatus = new CatsReferralStatusVo();
	referralStatus.setReferralStatus(ReferralApptStatus.REFERRAL_ACCEPTED);
	referralStatus.setStatusDateTime(new DateTime());
	referralStatus.setAuthoringUser((MemberOfStaffRefVo) domain.getMosUser());
	referral.setCurrentStatus(referralStatus);
	referral.setStatusHistory(new CATSReferralStatusRefVoCollection());
	referral.getStatusHistory().add(referralStatus);

	String codeCCG = getCCGCode(patient);
	referral.setContract(contract);
	referral.setHasAppointments(false);
	
	referral.setAdmissions(new AdmissionDetailVoCollection());
	referral.getAdmissions().add(admission);
	
		ReferralDetailsEmergencyAdmissionVo referralDetails = new ReferralDetailsEmergencyAdmissionVo();
		referralDetails.setService(form.cmbService().getValue());
		referralDetails.setConsultant(domain.getHcpFromIMos(form.ccConsultant().getValue()));
		referralDetails.setAuthoringUser((MemberOfStaffRefVo) domain.getMosUser());
		referralDetails.setAuthoringDateTime(new DateTime());
		referralDetails.setDateReferralReceived(new Date());
		referralDetails.setDateOfReferral(new Date());
		referralDetails.setEnd18WW(calculateEnd18WW(contract));
		referralDetails.setPCT(codeCCG);
		referralDetails.setGPName(patient.getGp());
		referralDetails.setPractice(getPatientGpDefaultPractice(patient));
	
	referral.setReferralDetails(referralDetails);
	
	return referral;
}
 
Example 40
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
public AdmissionDetailVo getAdmissionDetailByPasEvent(PASEventRefVo pasEvent)
{
	if (pasEvent == null || pasEvent.getID_PASEvent() == null)
		throw new CodingRuntimeException("pasEvent is null or id not provided in method getAdmissionDetailByPasEvent");
	
	BedAdmissionComponent impl = (BedAdmissionComponent) getDomainImpl(BedAdmissionComponentImpl.class);
	return impl.getAdmissionDetailByPasEvent(pasEvent);
}