Java Code Examples for ims.core.domain.Demographics

The following are top voted examples for showing how to use ims.core.domain.Demographics. 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: BedAdmissionComponentImpl.java   Source Code and License 6 votes vote down vote up
public Patient getPatient(PatientShort patient) throws StaleObjectException, DomainInterfaceException
{
	Demographics demographicsImpl = (Demographics) getDomainImpl(DemographicsImpl.class);
	
	Patient pat = null;
	try
	{
		pat = demographicsImpl.getPatient(patient);
	}
	catch (DomainRuntimeException e)
	{
		throw new DomainInterfaceException(e.getMessage());
	}

	return pat;
}
 
Example 2
Project: openmaxims-linux   File: BedAdmissionComponentImpl.java   Source Code and License 6 votes vote down vote up
public Patient getPatient(PatientShort patient) throws StaleObjectException, DomainInterfaceException
{
	Demographics demographicsImpl = (Demographics) getDomainImpl(DemographicsImpl.class);
	
	Patient pat = null;
	try
	{
		pat = demographicsImpl.getPatient(patient);
	}
	catch (DomainRuntimeException e)
	{
		throw new DomainInterfaceException(e.getMessage());
	}

	return pat;
}
 
Example 3
Project: openMAXIMS   File: PdsRelatedPersonDialogImpl.java   Source Code and License 6 votes vote down vote up
@Override
public Patient getPatient(PatientShort patient) throws DomainInterfaceException, StaleObjectException
{
	Demographics demographicsImpl = (Demographics) getDomainImpl(DemographicsImpl.class);
	
	Patient pat = null;
	try
	{
		pat = demographicsImpl.getPatient(patient);
	}
	catch (DomainRuntimeException e)
	{
		throw new DomainInterfaceException(e.getMessage());
	}

	return pat;
}
 
Example 4
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 6 votes vote down vote up
public Patient getPatient(PatientShort patient) throws StaleObjectException, DomainInterfaceException
{
	Demographics demographicsImpl = (Demographics) getDomainImpl(DemographicsImpl.class);

	Patient pat = null;
	try
	{
		pat = demographicsImpl.getPatient(patient);
	}
	catch (DomainRuntimeException e)
	{
		throw new DomainInterfaceException(e.getMessage());
	}

	return pat;
}
 
Example 5
Project: openMAXIMS   File: TransportImpl.java   Source Code and License 6 votes vote down vote up
public Patient getPatient(PatientShort patient) throws StaleObjectException, DomainInterfaceException
{
	Demographics demographicsImpl = (Demographics) getDomainImpl(DemographicsImpl.class);
	
	Patient pat = null;
	try
	{
		pat = demographicsImpl.getPatient(patient);
	}
	catch (DomainRuntimeException e)
	{
		throw new DomainInterfaceException(e.getMessage());
	}

	return pat;
}
 
Example 6
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 6 votes vote down vote up
public Patient getPatient(PatientShort patient) throws StaleObjectException, DomainInterfaceException
{
	Demographics demographicsImpl = (Demographics) getDomainImpl(DemographicsImpl.class);
	
	Patient pat = null;
	try
	{
		pat = demographicsImpl.getPatient(patient);
	}
	catch (DomainRuntimeException e)
	{
		throw new DomainInterfaceException(e.getMessage());
	}

	return pat;
}
 
Example 7
Project: AvoinApotti   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getPatientForEpisodeOfCare(ValueObjectRef refVo)
{
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, refVo.getBoId());
	if (epis == null)
		throw new DomainRuntimeException("Invalid EpisodeOfCare refVo passed into getPatientForEpisodeOfCare. ");
	
	PatientRefVo patRef = new PatientRefVo(epis.getCareSpell().getPatient().getId(), epis.getCareSpell().getPatient().getVersion());
	Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
	return demog.getPatient(patRef);			
}
 
Example 8
Project: AvoinApotti   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void execute(ValueObjectRef refVo) 
{	
	SessionData sessData = getSessionData();
	ims.core.vo.Patient voPat = null;
	
	if (refVo != null)
	{
		Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
		voPat = demog.getPatient((PatientRefVo)refVo);			
	}
	
	if (refVo == null || (sessData.patientId.get() != null && (voPat.getID_Patient() !=  sessData.patientId.get())))
	{		
		ArrayList<Integer> urlsID = sessData.urlToClose.get();		
	    if(urlsID == null)
	      	urlsID = new ArrayList<Integer>();
	  
	    ArrayList<Integer> urlsToCloseOnContextChanged = sessData.urlToCloseOnContextChanged.get();
	    if (urlsToCloseOnContextChanged != null && urlsToCloseOnContextChanged.size() > 0)
	    {
	    	for (int i = 0; i < urlsToCloseOnContextChanged.size(); i++) 
	    	{
	    		urlsID.add(urlsToCloseOnContextChanged.get(i));
			}
	    	 
	    	sessData.urlToClose.set(urlsID);
	    }
	}
}
 
Example 9
Project: AvoinApotti   File: DomainHelper.java   Source Code and License 5 votes vote down vote up
public Patient getPatient(PatientShort patient) throws StaleObjectException {
	
	Demographics demographicsImpl = (Demographics)getDomainImpl(DemographicsImpl.class);
	Patient pt= demographicsImpl.getPatient(patient);
	
	Transaction transaction = this.getDomainFactory().getTransaction();

	if (transaction != null)
	{
		transaction.commit();
		boolean wasRolledBack = transaction.wasRolledBack();
		boolean wasCommitted = transaction.wasCommitted();
		// commit
		if ( !wasRolledBack && ! wasCommitted ) {
			if (LOG.isDebugEnabled())
				LOG.debug("commited method patient save");
			if (getSessLogger() != null)
			{
				getSessLogger().warn("commited method patient save");
			}
		}
		else {
			if (LOG.isDebugEnabled())
				LOG.debug("method save patient"+", wasRolledBack="+wasRolledBack+", wasCommitted="+wasCommitted);
			if (getSessLogger() != null)
			{
				getSessLogger().warn("method save patient"+", wasRolledBack="+wasRolledBack+", wasCommitted="+wasCommitted);
			}
		}	
		this.getDomainFactory().setTransaction(null);
	}
	this.free();		
	return pt;
}
 
Example 10
Project: AvoinApotti   File: OcrrContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void execute(ValueObjectRef refVo) 
{	
	SessionData sessData = getSessionData();
	ims.core.vo.Patient voPat = null;
	
	if (refVo != null)
	{
		Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
		voPat = demog.getPatient((PatientRefVo)refVo);			
	}
	
	if (refVo == null || (sessData.patientId.get() != null && (voPat.getID_Patient() !=  sessData.patientId.get())))
	{		
		ArrayList<Integer> urlsID = sessData.urlToClose.get();		
	    if(urlsID == null)
	      	urlsID = new ArrayList<Integer>();
	  
	    ArrayList<Integer> urlsToCloseOnContextChanged = sessData.urlToCloseOnContextChanged.get();
	    if (urlsToCloseOnContextChanged != null && urlsToCloseOnContextChanged.size() > 0)
	    {
	    	for (int i = 0; i < urlsToCloseOnContextChanged.size(); i++) 
	    	{
	    		urlsID.add(urlsToCloseOnContextChanged.get(i));
			}
	    	 
	    	sessData.urlToClose.set(urlsID);
	    }
	}
}
 
Example 11
Project: AvoinApotti   File: CustomListMaintenanceImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatient(PatientShort patient)throws DomainInterfaceException, StaleObjectException 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	
	try
	{
		return impl.getPatient(patient);
	}
	catch (DomainRuntimeException e) //WDEV-11223
	{
		throw new DomainInterfaceException(e.getMessage());
	}
}
 
Example 12
Project: AvoinApotti   File: TransfersImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 13
Project: AvoinApotti   File: STHKCurrentInpatientListComponentImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 14
Project: AvoinApotti   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 15
Project: AvoinApotti   File: PendingEmergencyAdmissionsImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 16
Project: AvoinApotti   File: MDTListImpl.java   Source Code and License 5 votes vote down vote up
/**
* A list of MDT appointments
*/
public ims.clinical.vo.MDTListAndDatesVoCollection listMDT(ims.clinical.vo.MDTListAndDatesVo voMDTList)
{
	DomainFactory factory = getDomainFactory();
	List MDTList = factory.find(" from MDTListandDates mdtlist where mdtlist.careContext.endDateTime is null " +
			"and mdtlist.careContext.context = :context " + 
			"and mdtlist.listPatientisOn = :listPatient",
			new String[]{"context", "listPatient"},
			new Object[]{getDomLookup(voMDTList.getCareContext().getContext()), getDomLookup(voMDTList.getListPatientisOn())});

	MDTListAndDatesVoCollection voMDTNoContactColl = new MDTListAndDatesVoCollection();
	for (int x = 0; x < MDTList.size(); x++)
	{
		MDTListandDates domMDTListAndDates = (MDTListandDates) MDTList.get(x);

		MDTListAndDatesVo voMDTListAndDates = MDTListAndDatesVoAssembler.create(domMDTListAndDates);
		voMDTListAndDates.setPatient(PatientShortAssembler.create(domMDTListAndDates.getPatient()));

		Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
		voMDTListAndDates.getPatient().setHasAlerts(impl.hasAlerts(domMDTListAndDates.getPatient().getId()));
		voMDTListAndDates.getPatient().setHasAllergies(impl.hasAllergy(domMDTListAndDates.getPatient().getId()));

		voMDTNoContactColl.add(voMDTListAndDates);
	}

	return voMDTNoContactColl.sort();
}
 
Example 17
Project: AvoinApotti   File: MDTListImpl.java   Source Code and License 5 votes vote down vote up
/**
* List of Clinical Contacts with no MDT list type
*/
public ims.clinical.vo.MDTListAndDatesVoCollection listCareContextsWithNoMDTList(ims.clinical.vo.MDTListAndDatesVo voMDTList)
{
	DomainFactory factory = getDomainFactory();
	List contextList = factory.find(" from CareContext r where r.endDateTime is null and r.context = :context and r.id not in " + 
			"( select careContext.id from MDTListandDates)",
			new String[]{"context"},
			new Object[]{getDomLookup(ContextType.INPATIENT)});

	MDTListAndDatesVoCollection voMDTNoContactColl = new MDTListAndDatesVoCollection();
	for (int x = 0; x < contextList.size(); x++)
	{
		CareContext domCareContext = (CareContext) contextList.get(x);

		CareContextShortVo voCareContext = CareContextShortVoAssembler.create(domCareContext);
		
		Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
		
		MDTListAndDatesVo mdt = new MDTListAndDatesVo();
		mdt.setPatient(PatientShortAssembler.create(domCareContext.getEpisodeOfCare().getCareSpell().getPatient()));
		mdt.getPatient().setHasAlerts(impl.hasAlerts(mdt.getPatient().getID_Patient()));
		mdt.getPatient().setHasAllergies(impl.hasAllergy(mdt.getPatient().getID_Patient()));
		mdt.setCareContext(voCareContext);
		voMDTNoContactColl.add(mdt);
	}

	return voMDTNoContactColl.sort();
}
 
Example 18
Project: openMAXIMS   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public boolean hasAlertsForViewOrEdit(ims.core.vo.Patient voPat)
{
	IAppRole role = getSessionData().role.get();
	IAlertsAccess[] alertsAccessList = role.getAlertsAccessList();
	
	AlertTypeCollection alertCategoryColl = new AlertTypeCollection();
	
	for(int i=0; i<alertsAccessList.length; i++)
	{
		IAlertsAccess alertAccess = alertsAccessList[i];
		
		if(alertAccess == null)
			continue;
		
		if(!(alertAccess.getIAlertType() instanceof AlertType) || !(alertAccess.getIAccess() instanceof AlertAccessRights))
			continue;
		
		AlertType alertType = (AlertType) alertAccess.getIAlertType();
		AlertAccessRights access = (AlertAccessRights) alertAccess.getIAccess();
		
		if(AlertAccessRights.READ_ONLY.equals(access) || AlertAccessRights.READ_WRITE.equals(access))
		{
			alertCategoryColl.add(alertType);
		}
	}
	
	if(alertCategoryColl == null || alertCategoryColl.size() == 0)
		return false;
	
	Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
	return demog.hasAlertsForViewOrEdit(voPat, alertCategoryColl);
}
 
Example 19
Project: openMAXIMS   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getPatientForEpisodeOfCare(ValueObjectRef refVo)
{
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, refVo.getBoId());
	if (epis == null)
		throw new DomainRuntimeException("Invalid EpisodeOfCare refVo passed into getPatientForEpisodeOfCare. ");
	
	PatientRefVo patRef = new PatientRefVo(epis.getCareSpell().getPatient().getId(), epis.getCareSpell().getPatient().getVersion());
	Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
	return demog.getPatient(patRef);			
}
 
Example 20
Project: openMAXIMS   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void execute(ValueObjectRef refVo) 
{	
	SessionData sessData = getSessionData();
	ims.core.vo.Patient voPat = null;
	
	if (refVo != null)
	{
		Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
		voPat = demog.getPatient((PatientRefVo)refVo);			
	}
	
	if (refVo == null || voPat == null || (sessData.patientId.get() != null && (voPat.getID_Patient() !=  sessData.patientId.get())))
	{		
		ArrayList<Integer> urlsID = sessData.urlToClose.get();		
	    if(urlsID == null)
	      	urlsID = new ArrayList<Integer>();
	  
	    ArrayList<Integer> urlsToCloseOnContextChanged = sessData.urlToCloseOnContextChanged.get();
	    if (urlsToCloseOnContextChanged != null && urlsToCloseOnContextChanged.size() > 0)
	    {
	    	for (int i = 0; i < urlsToCloseOnContextChanged.size(); i++) 
	    	{
	    		urlsID.add(urlsToCloseOnContextChanged.get(i));
			}
	    	 
	    	sessData.urlToClose.set(urlsID);
	    }
	}
}
 
Example 21
Project: openMAXIMS   File: DomainHelper.java   Source Code and License 5 votes vote down vote up
public Patient getPatient(PatientShort patient) throws StaleObjectException {
	
	Demographics demographicsImpl = (Demographics)getDomainImpl(DemographicsImpl.class);
	Patient pt= demographicsImpl.getPatient(patient);
	
	Transaction transaction = this.getDomainFactory().getTransaction();

	if (transaction != null)
	{
		transaction.commit();
		boolean wasRolledBack = transaction.wasRolledBack();
		boolean wasCommitted = transaction.wasCommitted();
		// commit
		if ( !wasRolledBack && ! wasCommitted ) {
			if (LOG.isDebugEnabled())
				LOG.debug("commited method patient save");
			if (getSessLogger() != null)
			{
				getSessLogger().warn("commited method patient save");
			}
		}
		else {
			if (LOG.isDebugEnabled())
				LOG.debug("method save patient"+", wasRolledBack="+wasRolledBack+", wasCommitted="+wasCommitted);
			if (getSessLogger() != null)
			{
				getSessLogger().warn("method save patient"+", wasRolledBack="+wasRolledBack+", wasCommitted="+wasCommitted);
			}
		}	
		this.getDomainFactory().setTransaction(null);
	}
	this.free();		
	return pt;
}
 
Example 22
Project: openMAXIMS   File: OcrrContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void execute(ValueObjectRef refVo) 
{	
	SessionData sessData = getSessionData();
	ims.core.vo.Patient voPat = null;
	
	if (refVo != null)
	{
		Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
		voPat = demog.getPatient((PatientRefVo)refVo);			
	}
	
	if (refVo == null || voPat == null || (sessData.patientId.get() != null && (voPat.getID_Patient() !=  sessData.patientId.get())))
	{		
		ArrayList<Integer> urlsID = sessData.urlToClose.get();		
	    if(urlsID == null)
	      	urlsID = new ArrayList<Integer>();
	  
	    ArrayList<Integer> urlsToCloseOnContextChanged = sessData.urlToCloseOnContextChanged.get();
	    if (urlsToCloseOnContextChanged != null && urlsToCloseOnContextChanged.size() > 0)
	    {
	    	for (int i = 0; i < urlsToCloseOnContextChanged.size(); i++) 
	    	{
	    		urlsID.add(urlsToCloseOnContextChanged.get(i));
			}
	    	 
	    	sessData.urlToClose.set(urlsID);
	    }
	}
}
 
Example 23
Project: openMAXIMS   File: CustomListMaintenanceImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatient(PatientShort patient)throws DomainInterfaceException, StaleObjectException 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	
	try
	{
		return impl.getPatient(patient);
	}
	catch (DomainRuntimeException e) //WDEV-11223
	{
		throw new DomainInterfaceException(e.getMessage());
	}
}
 
Example 24
Project: openMAXIMS   File: TransfersImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 25
Project: openMAXIMS   File: DemographicsComponentImpl.java   Source Code and License 5 votes vote down vote up
/**
* Get's a specific Patient
 * @throws UniqueKeyViolationException 
*/
public ims.core.vo.Patient getPatient(PatientShort patient) throws StaleObjectException, UniqueKeyViolationException
{
	ims.core.domain.Demographics impl = (ims.core.domain.Demographics) getDomainImpl(DemographicsImpl.class);
	
	return impl.getPatient(patient);
}
 
Example 26
Project: openmaxims-linux   File: CustomListMaintenanceImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatient(PatientShort patient)throws DomainInterfaceException, StaleObjectException 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	
	try
	{
		return impl.getPatient(patient);
	}
	catch (DomainRuntimeException e) //WDEV-11223
	{
		throw new DomainInterfaceException(e.getMessage());
	}
}
 
Example 27
Project: openmaxims-linux   File: TransfersImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 28
Project: openMAXIMS   File: MDTListImpl.java   Source Code and License 5 votes vote down vote up
/**
* A list of MDT appointments
*/
public ims.clinical.vo.MDTListAndDatesVoCollection listMDT(ims.clinical.vo.MDTListAndDatesVo voMDTList)
{
	DomainFactory factory = getDomainFactory();
	List MDTList = factory.find(" from MDTListandDates mdtlist where mdtlist.careContext.endDateTime is null " +
			"and mdtlist.careContext.context = :context " + 
			"and mdtlist.listPatientisOn = :listPatient",
			new String[]{"context", "listPatient"},
			new Object[]{getDomLookup(voMDTList.getCareContext().getContext()), getDomLookup(voMDTList.getListPatientisOn())});

	MDTListAndDatesVoCollection voMDTNoContactColl = new MDTListAndDatesVoCollection();
	for (int x = 0; x < MDTList.size(); x++)
	{
		MDTListandDates domMDTListAndDates = (MDTListandDates) MDTList.get(x);

		MDTListAndDatesVo voMDTListAndDates = MDTListAndDatesVoAssembler.create(domMDTListAndDates);
		voMDTListAndDates.setPatient(PatientShortAssembler.create(domMDTListAndDates.getPatient()));

		Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
		voMDTListAndDates.getPatient().setHasAlerts(impl.hasAlerts(domMDTListAndDates.getPatient().getId()));
		voMDTListAndDates.getPatient().setHasAllergies(impl.hasAllergy(domMDTListAndDates.getPatient().getId()));

		voMDTNoContactColl.add(voMDTListAndDates);
	}

	return voMDTNoContactColl.sort();
}
 
Example 29
Project: openmaxims-linux   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 30
Project: openmaxims-linux   File: MDTListImpl.java   Source Code and License 5 votes vote down vote up
/**
* A list of MDT appointments
*/
public ims.clinical.vo.MDTListAndDatesVoCollection listMDT(ims.clinical.vo.MDTListAndDatesVo voMDTList)
{
	DomainFactory factory = getDomainFactory();
	List MDTList = factory.find(" from MDTListandDates mdtlist where mdtlist.careContext.endDateTime is null " +
			"and mdtlist.careContext.context = :context " + 
			"and mdtlist.listPatientisOn = :listPatient",
			new String[]{"context", "listPatient"},
			new Object[]{getDomLookup(voMDTList.getCareContext().getContext()), getDomLookup(voMDTList.getListPatientisOn())});

	MDTListAndDatesVoCollection voMDTNoContactColl = new MDTListAndDatesVoCollection();
	for (int x = 0; x < MDTList.size(); x++)
	{
		MDTListandDates domMDTListAndDates = (MDTListandDates) MDTList.get(x);

		MDTListAndDatesVo voMDTListAndDates = MDTListAndDatesVoAssembler.create(domMDTListAndDates);
		voMDTListAndDates.setPatient(PatientShortAssembler.create(domMDTListAndDates.getPatient()));

		Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
		voMDTListAndDates.getPatient().setHasAlerts(impl.hasAlerts(domMDTListAndDates.getPatient().getId()));
		voMDTListAndDates.getPatient().setHasAllergies(impl.hasAllergy(domMDTListAndDates.getPatient().getId()));

		voMDTNoContactColl.add(voMDTListAndDates);
	}

	return voMDTNoContactColl.sort();
}
 
Example 31
Project: openMAXIMS   File: ContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public ValueObjectRef getPatientForEpisodeOfCare(ValueObjectRef refVo)
{
	EpisodeOfCare epis = (EpisodeOfCare)this.getDomainFactory().getDomainObject(EpisodeOfCare.class, refVo.getBoId());
	if (epis == null)
		throw new DomainRuntimeException("Invalid EpisodeOfCare refVo passed into getPatientForEpisodeOfCare. ");
	
	PatientRefVo patRef = new PatientRefVo(epis.getCareSpell().getPatient().getId(), epis.getCareSpell().getPatient().getVersion());
	Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
	return demog.getPatient(patRef);			
}
 
Example 32
Project: openmaxims-linux   File: STHKCurrentInpatientListComponentImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 33
Project: openMAXIMS   File: DomainHelper.java   Source Code and License 5 votes vote down vote up
public Patient getPatient(PatientShort patient) throws StaleObjectException {
	
	Demographics demographicsImpl = (Demographics)getDomainImpl(DemographicsImpl.class);
	Patient pt= demographicsImpl.getPatient(patient);
	
	Transaction transaction = this.getDomainFactory().getTransaction();

	if (transaction != null)
	{
		transaction.commit();
		boolean wasRolledBack = transaction.wasRolledBack();
		boolean wasCommitted = transaction.wasCommitted();
		// commit
		if ( !wasRolledBack && ! wasCommitted ) {
			if (LOG.isDebugEnabled())
				LOG.debug("commited method patient save");
			if (getSessLogger() != null)
			{
				getSessLogger().warn("commited method patient save");
			}
		}
		else {
			if (LOG.isDebugEnabled())
				LOG.debug("method save patient"+", wasRolledBack="+wasRolledBack+", wasCommitted="+wasCommitted);
			if (getSessLogger() != null)
			{
				getSessLogger().warn("method save patient"+", wasRolledBack="+wasRolledBack+", wasCommitted="+wasCommitted);
			}
		}	
		this.getDomainFactory().setTransaction(null);
	}
	this.free();		
	return pt;
}
 
Example 34
Project: openMAXIMS   File: OcrrContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void execute(ValueObjectRef refVo) 
{	
	SessionData sessData = getSessionData();
	ims.core.vo.Patient voPat = null;
	
	if (refVo != null)
	{
		Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
		voPat = demog.getPatient((PatientRefVo)refVo);			
	}
	
	if (refVo == null || (sessData.patientId.get() != null && (voPat.getID_Patient() !=  sessData.patientId.get())))
	{		
		ArrayList<Integer> urlsID = sessData.urlToClose.get();		
	    if(urlsID == null)
	      	urlsID = new ArrayList<Integer>();
	  
	    ArrayList<Integer> urlsToCloseOnContextChanged = sessData.urlToCloseOnContextChanged.get();
	    if (urlsToCloseOnContextChanged != null && urlsToCloseOnContextChanged.size() > 0)
	    {
	    	for (int i = 0; i < urlsToCloseOnContextChanged.size(); i++) 
	    	{
	    		urlsID.add(urlsToCloseOnContextChanged.get(i));
			}
	    	 
	    	sessData.urlToClose.set(urlsID);
	    }
	}
}
 
Example 35
Project: openMAXIMS   File: CustomListMaintenanceImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatient(PatientShort patient)throws DomainInterfaceException, StaleObjectException 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	
	try
	{
		return impl.getPatient(patient);
	}
	catch (DomainRuntimeException e) //WDEV-11223
	{
		throw new DomainInterfaceException(e.getMessage());
	}
}
 
Example 36
Project: openMAXIMS   File: TransfersImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 37
Project: openmaxims-linux   File: OcrrContextEvalProvider.java   Source Code and License 5 votes vote down vote up
public void execute(ValueObjectRef refVo) 
{	
	SessionData sessData = getSessionData();
	ims.core.vo.Patient voPat = null;
	
	if (refVo != null)
	{
		Demographics demog = (Demographics)getDomainImpl(DemographicsImpl.class);
		voPat = demog.getPatient((PatientRefVo)refVo);			
	}
	
	if (refVo == null || (sessData.patientId.get() != null && (voPat.getID_Patient() !=  sessData.patientId.get())))
	{		
		ArrayList<Integer> urlsID = sessData.urlToClose.get();		
	    if(urlsID == null)
	      	urlsID = new ArrayList<Integer>();
	  
	    ArrayList<Integer> urlsToCloseOnContextChanged = sessData.urlToCloseOnContextChanged.get();
	    if (urlsToCloseOnContextChanged != null && urlsToCloseOnContextChanged.size() > 0)
	    {
	    	for (int i = 0; i < urlsToCloseOnContextChanged.size(); i++) 
	    	{
	    		urlsID.add(urlsToCloseOnContextChanged.get(i));
			}
	    	 
	    	sessData.urlToClose.set(urlsID);
	    }
	}
}
 
Example 38
Project: openMAXIMS   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 39
Project: openMAXIMS   File: PendingEmergencyAdmissionsImpl.java   Source Code and License 5 votes vote down vote up
public PatientShort getPatientShort(PatientRefVo patientRefVo) 
{
	Demographics impl = (Demographics) getDomainImpl(DemographicsImpl.class);
	Patient voPat = impl.getPatient(patientRefVo);		

	if (voPat != null)
		return (PatientShort)voPat;
	else
		return null;
}
 
Example 40
Project: openmaxims-linux   File: DomainHelper.java   Source Code and License 5 votes vote down vote up
public Patient getPatient(PatientShort patient) throws StaleObjectException {
	
	Demographics demographicsImpl = (Demographics)getDomainImpl(DemographicsImpl.class);
	Patient pt= demographicsImpl.getPatient(patient);
	
	Transaction transaction = this.getDomainFactory().getTransaction();

	if (transaction != null)
	{
		transaction.commit();
		boolean wasRolledBack = transaction.wasRolledBack();
		boolean wasCommitted = transaction.wasCommitted();
		// commit
		if ( !wasRolledBack && ! wasCommitted ) {
			if (LOG.isDebugEnabled())
				LOG.debug("commited method patient save");
			if (getSessLogger() != null)
			{
				getSessLogger().warn("commited method patient save");
			}
		}
		else {
			if (LOG.isDebugEnabled())
				LOG.debug("method save patient"+", wasRolledBack="+wasRolledBack+", wasCommitted="+wasCommitted);
			if (getSessLogger() != null)
			{
				getSessLogger().warn("method save patient"+", wasRolledBack="+wasRolledBack+", wasCommitted="+wasCommitted);
			}
		}	
		this.getDomainFactory().setTransaction(null);
	}
	this.free();		
	return pt;
}