Java Code Examples for ims.core.admin.domain.objects.CareContextStatusHistory

The following are top voted examples for showing how to use ims.core.admin.domain.objects.CareContextStatusHistory. 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: ADTImpl.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-7506
 * disconnectFromPasEvent
 * Check if there is a CareConext linked to this PasEvent
 * if there is, remove the link and close the carecontext
 * @param factory
 * @param peDo
 * @throws StaleObjectException 
 */
private void disconnectFromPasEvent(DomainFactory factory, PASEvent peDo) throws StaleObjectException 
{
	if (!(ConfigFlag.HL7.INSTANTIATE_EPISODE_FROM_ADT.getValue()||ConfigFlag.HL7.INPATIENT_EPISODE_MANAGEMENT_FROM_PAS.getValue()||ConfigFlag.UI.MAXIMS_ADT_NO_INTERFACE.getValue()))
		return;
		
	List lst= CareContext.listCareContextByPasEvent(factory, peDo);
	if (lst != null && lst.size() > 0)
	{
		// Only one CareContext per pas event
		CareContext domCareContext = (CareContext) lst.get(0);
		domCareContext.setPasEvent(null);
		domCareContext.setEndDateTime(new java.util.Date());
		//WDEV-10231
		domCareContext.setCurrentStatus(new CareContextStatusHistory());
		domCareContext.getCurrentStatus().setStatusDateTime(new Date());
		domCareContext.getCurrentStatus().setStatus(getDomLookup(CareContextStatus.CANCELLED));
		domCareContext.getStatusHistory().add(domCareContext.getCurrentStatus());
		
		factory.save(domCareContext);
	}
}
 
Example 2
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-7506
 * disconnectFromPasEvent
 * Check if there is a CareConext linked to this PasEvent
 * if there is, remove the link and close the carecontext
 * @param factory
 * @param peDo
 * @throws StaleObjectException 
 */
private void disconnectFromPasEvent(DomainFactory factory, PASEvent peDo) throws StaleObjectException 
{
	if (!(ConfigFlag.HL7.INSTANTIATE_EPISODE_FROM_ADT.getValue()||ConfigFlag.HL7.INPATIENT_EPISODE_MANAGEMENT_FROM_PAS.getValue()||ConfigFlag.UI.MAXIMS_ADT_NO_INTERFACE.getValue()))
		return;
		
	List lst= CareContext.listCareContextByPasEvent(factory, peDo);
	if (lst != null && lst.size() > 0)
	{
		// Only one CareContext per pas event
		CareContext domCareContext = (CareContext) lst.get(0);
		domCareContext.setPasEvent(null);
		domCareContext.setEndDateTime(new java.util.Date());
		//WDEV-10231
		domCareContext.setCurrentStatus(new CareContextStatusHistory());
		domCareContext.getCurrentStatus().setStatusDateTime(new Date());
		domCareContext.getCurrentStatus().setStatus(getDomLookup(CareContextStatus.CANCELLED));
		domCareContext.getStatusHistory().add(domCareContext.getCurrentStatus());
		
		factory.save(domCareContext);
	}
}
 
Example 3
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-7506
 * disconnectFromPasEvent
 * Check if there is a CareConext linked to this PasEvent
 * if there is, remove the link and close the carecontext
 * @param factory
 * @param peDo
 * @throws StaleObjectException 
 */
private void disconnectFromPasEvent(DomainFactory factory, PASEvent peDo) throws StaleObjectException 
{
	if (!(ConfigFlag.HL7.INSTANTIATE_EPISODE_FROM_ADT.getValue()||ConfigFlag.HL7.INPATIENT_EPISODE_MANAGEMENT_FROM_PAS.getValue()||ConfigFlag.UI.MAXIMS_ADT_NO_INTERFACE.getValue()))
		return;
		
	List lst= CareContext.listCareContextByPasEvent(factory, peDo);
	if (lst != null && lst.size() > 0)
	{
		// Only one CareContext per pas event
		CareContext domCareContext = (CareContext) lst.get(0);
		domCareContext.setPasEvent(null);
		domCareContext.setEndDateTime(new java.util.Date());
		//WDEV-10231
		domCareContext.setCurrentStatus(new CareContextStatusHistory());
		domCareContext.getCurrentStatus().setStatusDateTime(new Date());
		domCareContext.getCurrentStatus().setStatus(getDomLookup(CareContextStatus.CANCELLED));
		domCareContext.getStatusHistory().add(domCareContext.getCurrentStatus());
		
		factory.save(domCareContext);
	}
}
 
Example 4
Project: openmaxims-linux   File: ADTImpl.java   Source Code and License 6 votes vote down vote up
/**
 * WDEV-7506
 * disconnectFromPasEvent
 * Check if there is a CareConext linked to this PasEvent
 * if there is, remove the link and close the carecontext
 * @param factory
 * @param peDo
 * @throws StaleObjectException 
 */
private void disconnectFromPasEvent(DomainFactory factory, PASEvent peDo) throws StaleObjectException 
{
	if (!(ConfigFlag.HL7.INSTANTIATE_EPISODE_FROM_ADT.getValue()||ConfigFlag.HL7.INPATIENT_EPISODE_MANAGEMENT_FROM_PAS.getValue()||ConfigFlag.UI.MAXIMS_ADT_NO_INTERFACE.getValue()))
		return;
		
	List lst= CareContext.listCareContextByPasEvent(factory, peDo);
	if (lst != null && lst.size() > 0)
	{
		// Only one CareContext per pas event
		CareContext domCareContext = (CareContext) lst.get(0);
		domCareContext.setPasEvent(null);
		domCareContext.setEndDateTime(new java.util.Date());
		//WDEV-10231
		domCareContext.setCurrentStatus(new CareContextStatusHistory());
		domCareContext.getCurrentStatus().setStatusDateTime(new Date());
		domCareContext.getCurrentStatus().setStatus(getDomLookup(CareContextStatus.CANCELLED));
		domCareContext.getStatusHistory().add(domCareContext.getCurrentStatus());
		
		factory.save(domCareContext);
	}
}
 
Example 5
Project: AvoinApotti   File: BedAdmissionComponentImpl.java   Source Code and License 4 votes vote down vote up
private void createOrSaveCareSpell(DomainFactory factory, AdmissionDetail doAdmissionDetail) throws StaleObjectException
{
	//WDEV-13001 //5) b) Use Selected Episode
	EpisodeOfCare doEpisode = new EpisodeOfCare();
	CareSpell doCareSpell = new CareSpell();
	if(ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
	{
		if(doAdmissionDetail.getAdmissionEpisode() != null)
			doEpisode = doAdmissionDetail.getAdmissionEpisode();
		
		if(doEpisode.getCareSpell() != null)
			doCareSpell = doEpisode.getCareSpell();
	}
	
	doCareSpell.setPatient(doAdmissionDetail.getPasEvent().getPatient());
	
	//WDEV-13001
	if(!ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
	{	
		doCareSpell.setStartDate(doAdmissionDetail.getAdmissionDateTime());

		doEpisode.setCareSpell(doCareSpell);
		
		//wdev-14309
		doEpisode.setResponsibleHCP(doAdmissionDetail.getConsultant());
		
		doEpisode.setRelationship(getDomLookup(CareSpelltoEpisodeRelationship.PRIMARY));
		doEpisode.setSpecialty(doAdmissionDetail.getPasEvent().getSpecialty());
		doEpisode.setStartDate( doAdmissionDetail.getAdmissionDateTime());
		//wdev-14309
	}
	
	//WDEV-13001
	if(!ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
		doCareSpell.getEpisodes().add(doEpisode);
	
	CareContext doCareContext = new CareContext();
	doCareContext.setEpisodeOfCare(doEpisode);
	doCareContext.setContext(getDomLookup(ContextType.INPATIENT));
	doCareContext.setStartDateTime(doAdmissionDetail.getAdmissionDateTime());
	doCareContext.setPasEvent(doAdmissionDetail.getPasEvent());
	doCareContext.setResponsibleHCP(doEpisode.getResponsibleHCP());
	doCareContext.setEstimatedDischargeDate(doAdmissionDetail.getEstDischargeDate()); //WDEV-11438
	
	doCareContext.setCurrentStatus(new CareContextStatusHistory());
	doCareContext.getCurrentStatus().setStatus(getDomLookup(CareContextStatus.OPEN));
	doCareContext.getCurrentStatus().setStatusDateTime(new java.util.Date());
	
	doEpisode.getCareContexts().add(doCareContext);
	factory.save(doCareSpell);
}
 
Example 6
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 4 votes vote down vote up
private void createOrSaveCareSpell(DomainFactory factory, AdmissionDetail doAdmissionDetail) throws StaleObjectException
{
	//WDEV-13001 //5) b) Use Selected Episode
	EpisodeOfCare doEpisode = new EpisodeOfCare();
	CareSpell doCareSpell = new CareSpell();
	if(ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
	{
		if(doAdmissionDetail.getAdmissionEpisode() != null)
			doEpisode = doAdmissionDetail.getAdmissionEpisode();

		if(doEpisode.getCareSpell() != null)
			doCareSpell = doEpisode.getCareSpell();
	}

	doCareSpell.setPatient(doAdmissionDetail.getPasEvent().getPatient());

	//WDEV-13001
	if(!ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
	{	
		doCareSpell.setStartDate(doAdmissionDetail.getAdmissionDateTime());

		doEpisode.setCareSpell(doCareSpell);

		//wdev-14309
		doEpisode.setResponsibleHCP(doAdmissionDetail.getConsultant());

		doEpisode.setRelationship(getDomLookup(CareSpelltoEpisodeRelationship.PRIMARY));
		doEpisode.setSpecialty(doAdmissionDetail.getPasEvent().getSpecialty());
		doEpisode.setStartDate( doAdmissionDetail.getAdmissionDateTime());
		//wdev-14309
	}

	//WDEV-13001
	if(!ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
		doCareSpell.getEpisodes().add(doEpisode);

	CareContext doCareContext = new CareContext();
	doCareContext.setEpisodeOfCare(doEpisode);
	doCareContext.setContext(getDomLookup(ContextType.INPATIENT));
	doCareContext.setStartDateTime(doAdmissionDetail.getAdmissionDateTime());
	doCareContext.setPasEvent(doAdmissionDetail.getPasEvent());
	doCareContext.setResponsibleHCP(doEpisode.getResponsibleHCP());
	doCareContext.setEstimatedDischargeDate(doAdmissionDetail.getEstDischargeDate()); //WDEV-11438

	doCareContext.setCurrentStatus(new CareContextStatusHistory());
	doCareContext.getCurrentStatus().setStatus(getDomLookup(CareContextStatus.OPEN));
	doCareContext.getCurrentStatus().setStatusDateTime(new java.util.Date());

	doEpisode.getCareContexts().add(doCareContext);
	factory.save(doCareSpell);
}
 
Example 7
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 4 votes vote down vote up
private void createOrSaveCareSpell(DomainFactory factory, AdmissionDetail doAdmissionDetail) throws StaleObjectException
{
	//WDEV-13001 //5) b) Use Selected Episode
	EpisodeOfCare doEpisode = new EpisodeOfCare();
	CareSpell doCareSpell = new CareSpell();
	if(ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
	{
		if(doAdmissionDetail.getAdmissionEpisode() != null)
			doEpisode = doAdmissionDetail.getAdmissionEpisode();
		
		if(doEpisode.getCareSpell() != null)
			doCareSpell = doEpisode.getCareSpell();
	}
	
	doCareSpell.setPatient(doAdmissionDetail.getPasEvent().getPatient());
	
	//WDEV-13001
	if(!ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
	{	
		doCareSpell.setStartDate(doAdmissionDetail.getAdmissionDateTime());

		doEpisode.setCareSpell(doCareSpell);
		
		//wdev-14309
		doEpisode.setResponsibleHCP(doAdmissionDetail.getConsultant());
		
		doEpisode.setRelationship(getDomLookup(CareSpelltoEpisodeRelationship.PRIMARY));
		doEpisode.setSpecialty(doAdmissionDetail.getPasEvent().getSpecialty());
		doEpisode.setStartDate( doAdmissionDetail.getAdmissionDateTime());
		//wdev-14309
	}
	
	//WDEV-13001
	if(!ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
		doCareSpell.getEpisodes().add(doEpisode);
	
	CareContext doCareContext = new CareContext();
	doCareContext.setEpisodeOfCare(doEpisode);
	doCareContext.setContext(getDomLookup(ContextType.INPATIENT));
	doCareContext.setStartDateTime(doAdmissionDetail.getAdmissionDateTime());
	doCareContext.setPasEvent(doAdmissionDetail.getPasEvent());
	doCareContext.setResponsibleHCP(doEpisode.getResponsibleHCP());
	doCareContext.setEstimatedDischargeDate(doAdmissionDetail.getEstDischargeDate()); //WDEV-11438
	
	doCareContext.setCurrentStatus(new CareContextStatusHistory());
	doCareContext.getCurrentStatus().setStatus(getDomLookup(CareContextStatus.OPEN));
	doCareContext.getCurrentStatus().setStatusDateTime(new java.util.Date());
	
	doEpisode.getCareContexts().add(doCareContext);
	factory.save(doCareSpell);
}
 
Example 8
Project: openmaxims-linux   File: BedAdmissionComponentImpl.java   Source Code and License 4 votes vote down vote up
private void createOrSaveCareSpell(DomainFactory factory, AdmissionDetail doAdmissionDetail) throws StaleObjectException
{
	//WDEV-13001 //5) b) Use Selected Episode
	EpisodeOfCare doEpisode = new EpisodeOfCare();
	CareSpell doCareSpell = new CareSpell();
	if(ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
	{
		if(doAdmissionDetail.getAdmissionEpisode() != null)
			doEpisode = doAdmissionDetail.getAdmissionEpisode();
		
		if(doEpisode.getCareSpell() != null)
			doCareSpell = doEpisode.getCareSpell();
	}
	
	doCareSpell.setPatient(doAdmissionDetail.getPasEvent().getPatient());
	
	//WDEV-13001
	if(!ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
	{	
		doCareSpell.setStartDate(doAdmissionDetail.getAdmissionDateTime());

		doEpisode.setCareSpell(doCareSpell);
		
		//wdev-14309
		doEpisode.setResponsibleHCP(doAdmissionDetail.getConsultant());
		
		doEpisode.setRelationship(getDomLookup(CareSpelltoEpisodeRelationship.PRIMARY));
		doEpisode.setSpecialty(doAdmissionDetail.getPasEvent().getSpecialty());
		doEpisode.setStartDate( doAdmissionDetail.getAdmissionDateTime());
		//wdev-14309
	}
	
	//WDEV-13001
	if(!ConfigFlag.DOM.ADT_LINK_ADMISSION_TO_EPISODE.getValue())
		doCareSpell.getEpisodes().add(doEpisode);
	
	CareContext doCareContext = new CareContext();
	doCareContext.setEpisodeOfCare(doEpisode);
	doCareContext.setContext(getDomLookup(ContextType.INPATIENT));
	doCareContext.setStartDateTime(doAdmissionDetail.getAdmissionDateTime());
	doCareContext.setPasEvent(doAdmissionDetail.getPasEvent());
	doCareContext.setResponsibleHCP(doEpisode.getResponsibleHCP());
	doCareContext.setEstimatedDischargeDate(doAdmissionDetail.getEstDischargeDate()); //WDEV-11438
	
	doCareContext.setCurrentStatus(new CareContextStatusHistory());
	doCareContext.getCurrentStatus().setStatus(getDomLookup(CareContextStatus.OPEN));
	doCareContext.getCurrentStatus().setStatusDateTime(new java.util.Date());
	
	doEpisode.getCareContexts().add(doCareContext);
	factory.save(doCareSpell);
}