Java Code Examples for ims.emergency.domain.objects.Tracking

The following are top voted examples for showing how to use ims.emergency.domain.objects.Tracking. 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: BedAwaitingBedAvailableImpl.java   Source Code and License 6 votes vote down vote up
public Boolean isStaleTracking(TrackingForBedAvailabilityVo trackingToSave)
{
	if (trackingToSave == null || trackingToSave.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingForBedAvailabilityVo on null Id ");
	}

	DomainFactory factory = getDomainFactory();
	Tracking domainTracking = (Tracking) factory.getDomainObject(Tracking.class, trackingToSave.getID_Tracking());

	if (domainTracking == null)
	{
		return true;
	}

	if (domainTracking.getVersion() > trackingToSave.getVersion_Tracking())
	{
		return true;
	}

	return false;
}
 
Example 2
Project: AvoinApotti   File: PendingArrivalsImpl.java   Source Code and License 6 votes vote down vote up
public Boolean isStale(TrackingForQuickRegistrationVo trackingToSave)
{
	if (trackingToSave == null || trackingToSave.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingForQuickRegistrationVo on null Id ");
	}

	DomainFactory factory = getDomainFactory();
	Tracking domainTracking = (Tracking) factory.getDomainObject(Tracking.class, trackingToSave.getID_Tracking());

	if (domainTracking == null)
	{
		return true;
	}

	if (domainTracking.getVersion() > trackingToSave.getVersion_Tracking())
	{
		return true;
	}

	return false;
}
 
Example 3
Project: AvoinApotti   File: EDAssessmentComponentImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo saveMedicStartTime(ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo tracking) throws ims.domain.exceptions.StaleObjectException
{
	if(tracking == null)
		throw new CodingRuntimeException("Cannot save a null Tracking record.");
	
	if(!tracking.isValidated())
		throw new CodingRuntimeException("Tracking record is not validated.");
	
	DomainFactory factory = getDomainFactory();
	Tracking doTracking = TrackingForClinicianWorklistAndTriageVoAssembler.extractTracking(factory, tracking);
	if( doTracking != null )
	{
		doTracking.getTriageDetails().setMedicInterventionStartDateTime(tracking.getTriageDetails().getMedicInterventionStartDateTime().getJavaDate());
		factory.save(doTracking);
	}
	
	
	
	return TrackingForClinicianWorklistAndTriageVoAssembler.create(doTracking);
}
 
Example 4
Project: AvoinApotti   File: SendToXRayImpl.java   Source Code and License 6 votes vote down vote up
public SentToXrayVo save(SentToXrayVo sentToXRayToSave, TrackingForSendToXRayVo tracking) throws StaleObjectException
{
	if (sentToXRayToSave == null)
		throw new CodingRuntimeException("Cannot save null SentToXRay ");

	if (!sentToXRayToSave.isValidated())
		throw new DomainRuntimeException("SentToXrayVo Not Validated.");

	DomainFactory factory = getDomainFactory();
	SentToXray domainSentToXRay = SentToXrayVoAssembler.extractSentToXray(factory, sentToXRayToSave);

	factory.save(domainSentToXRay);
	
	if (tracking!=null)
	{
		if (!tracking.isValidated())
			throw new DomainRuntimeException("TrackingForAllocatedMedicVo Not Validated.");

		Tracking domainTracking = TrackingForSendToXRayVoAssembler.extractTracking(factory, tracking);

		factory.save(domainTracking);
	}

	return SentToXrayVoAssembler.create(domainSentToXRay);
}
 
Example 5
Project: AvoinApotti   File: EDSeenByAndCompleteDialogImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.TrackingForSeenByHCPVo getTracking(ims.emergency.vo.TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForSeenByHCPVoAssembler.create((Tracking) list.get(0));
	}

	return null;
}
 
Example 6
Project: AvoinApotti   File: DischargeDetails_OutcomeImpl.java   Source Code and License 6 votes vote down vote up
/**
 *	Function used to retrieve the Tracking record based on CareContext provided (must be equal to Tracking.Attendance.CareContext)
 */
public TrackingAttendanceOutcomeVo getTrackingAttendanceOutcomeVo(CareContextRefVo careContext)
{
	// Check care context parameter
	if (careContext == null || careContext.getID_CareContext() == null)
		return null;
	
	StringBuilder query = new StringBuilder();
	
	query.append("SELECT track FROM Tracking AS track ");
	
	query.append(" LEFT JOIN FETCH track.attendance AS attend ");
	query.append(" LEFT JOIN FETCH attend.careContext as context ");
	query.append(" LEFT JOIN FETCH track.currentStatus ");
	query.append(" LEFT JOIN FETCH attend.emergencyEpisode ");
	query.append(" LEFT JOIN FETCH attend.patient ");
			
	query.append(" WHERE context.id = :CONTEXT_ID ");
	
	return TrackingAttendanceOutcomeVoAssembler.create((Tracking) getDomainFactory().findFirst(query.toString(), "CONTEXT_ID", careContext.getID_CareContext()));
}
 
Example 7
Project: AvoinApotti   File: EDPartialAdmissionDialogImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.TrackingForEDPartialAdmissionVo getTrackingForEdPartialAdmission(ims.emergency.vo.TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForEDPartialAdmissionVoAssembler.create((Tracking) list.get(0));
	}

	return null;
}
 
Example 8
Project: AvoinApotti   File: EDReferralToSpecialtyDialogImpl.java   Source Code and License 6 votes vote down vote up
public TrackingForReferalToSpecialtyVo getTrackingForReferral(TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForReferalToSpecialtyVoAssembler.create((Tracking) list.get(0));
	}

	return null;

}
 
Example 9
Project: openMAXIMS   File: EDDischargeDetailsJobImpl.java   Source Code and License 6 votes vote down vote up
private TrackingJobVo saveTracking(TrackingJobVo tracking)	throws StaleObjectException
{
	if(tracking == null)
	{
		trace("Cannot save a null TrackingJobVo.");
		return null;
	}
	
	if(!tracking.isValidated())
	{
		trace("TrackingJobVo is not validated.");
		return null;
	}
	
	DomainFactoryBridge factory = getDomainFactory();
	Tracking doTracking = TrackingJobVoAssembler.extractTracking(factory, tracking);	
	factory.save(doTracking);	
	return TrackingJobVoAssembler.create(doTracking);
}
 
Example 10
Project: openMAXIMS   File: EDEmpDischargeDetailsJobImpl.java   Source Code and License 6 votes vote down vote up
private TrackingJobVo saveTracking(TrackingJobVo tracking)	throws StaleObjectException
{
	if(tracking == null)
	{
		trace("Cannot save a null TrackingJobVo.");
		return null;
	}
	
	if(!tracking.isValidated())
	{
		trace("TrackingJobVo is not validated.");
		return null;
	}
	
	DomainFactoryBridge factory = getDomainFactory();
	Tracking doTracking = TrackingJobVoAssembler.extractTracking(factory, tracking);	
	factory.save(doTracking);	
	return TrackingJobVoAssembler.create(doTracking);
}
 
Example 11
Project: openMAXIMS   File: EDSupplementaryDischargeLetterJobImpl.java   Source Code and License 6 votes vote down vote up
private TrackingJobVo saveTracking(TrackingJobVo tracking)	throws StaleObjectException
{
	if(tracking == null)
	{
		trace("Cannot save a null TrackingJobVo.");
		return null;
	}
	
	if(!tracking.isValidated())
	{
		trace("TrackingJobVo is not validated.");
		return null;
	}
	
	DomainFactoryBridge factory = getDomainFactory();
	Tracking doTracking = TrackingJobVoAssembler.extractTracking(factory, tracking);	
	factory.save(doTracking);	
	return TrackingJobVoAssembler.create(doTracking);
}
 
Example 12
Project: openMAXIMS   File: WardViewPatientListImpl.java   Source Code and License 6 votes vote down vote up
public TrackingRefVo getTrackingForPendingEmergency(PendingEmergencyAdmissionRefVo pendingEmergency)
{
	if (pendingEmergency == null || pendingEmergency.getID_PendingEmergencyAdmission() == null)
		return null;
	
	StringBuilder query = new StringBuilder("SELECT track FROM Tracking AS track LEFT JOIN track.associatedPendingEmergencyAdmission AS pendEmer ");
	query.append(" WHERE ");
	query.append(" pendEmer.id = :EMER_ID ");
	
	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>(); 
	
	paramNames.add("EMER_ID");			paramValues.add(pendingEmergency.getID_PendingEmergencyAdmission());
	
	Tracking tracking = (Tracking) getDomainFactory().findFirst(query.toString(), paramNames, paramValues);
	
	return new TrackingRefVo(tracking.getId(), tracking.getVersion());
}
 
Example 13
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 6 votes vote down vote up
public TrackingRefVo getTrackingForPendingEmergency(PendingEmergencyAdmissionRefVo pendingEmergency)
{
	if (pendingEmergency == null || pendingEmergency.getID_PendingEmergencyAdmission() == null)
		return null;

	StringBuilder query = new StringBuilder("SELECT track FROM Tracking AS track LEFT JOIN track.associatedPendingEmergencyAdmission AS pendEmer ");
	query.append(" WHERE ");
	query.append(" pendEmer.id = :EMER_ID ");

	ArrayList<String> paramNames = new ArrayList<String>();
	ArrayList<Object> paramValues = new ArrayList<Object>(); 

	paramNames.add("EMER_ID");			paramValues.add(pendingEmergency.getID_PendingEmergencyAdmission());

	Tracking tracking = (Tracking) getDomainFactory().findFirst(query.toString(), paramNames, paramValues);

	return new TrackingRefVo(tracking.getId(), tracking.getVersion());
}
 
Example 14
Project: openmaxims-linux   File: DischargeDetails_OutcomeImpl.java   Source Code and License 6 votes vote down vote up
/**
 *	Function used to retrieve the Tracking record based on CareContext provided (must be equal to Tracking.Attendance.CareContext)
 */
public TrackingAttendanceOutcomeVo getTrackingAttendanceOutcomeVo(CareContextRefVo careContext)
{
	// Check care context parameter
	if (careContext == null || careContext.getID_CareContext() == null)
		return null;
	
	StringBuilder query = new StringBuilder();
	
	query.append("SELECT track FROM Tracking AS track ");
	
	query.append(" LEFT JOIN FETCH track.attendance AS attend ");
	query.append(" LEFT JOIN FETCH attend.careContext as context ");
	query.append(" LEFT JOIN FETCH track.currentStatus ");
	query.append(" LEFT JOIN FETCH attend.emergencyEpisode ");
	query.append(" LEFT JOIN FETCH attend.patient ");
			
	query.append(" WHERE context.id = :CONTEXT_ID ");
	
	return TrackingAttendanceOutcomeVoAssembler.create((Tracking) getDomainFactory().findFirst(query.toString(), "CONTEXT_ID", careContext.getID_CareContext()));
}
 
Example 15
Project: openmaxims-linux   File: SendToXRayImpl.java   Source Code and License 6 votes vote down vote up
public SentToXrayVo save(SentToXrayVo sentToXRayToSave, TrackingForSendToXRayVo tracking) throws StaleObjectException
{
	if (sentToXRayToSave == null)
		throw new CodingRuntimeException("Cannot save null SentToXRay ");

	if (!sentToXRayToSave.isValidated())
		throw new DomainRuntimeException("SentToXrayVo Not Validated.");

	DomainFactory factory = getDomainFactory();
	SentToXray domainSentToXRay = SentToXrayVoAssembler.extractSentToXray(factory, sentToXRayToSave);

	factory.save(domainSentToXRay);
	
	if (tracking!=null)
	{
		if (!tracking.isValidated())
			throw new DomainRuntimeException("TrackingForAllocatedMedicVo Not Validated.");

		Tracking domainTracking = TrackingForSendToXRayVoAssembler.extractTracking(factory, tracking);

		factory.save(domainTracking);
	}

	return SentToXrayVoAssembler.create(domainSentToXRay);
}
 
Example 16
Project: openMAXIMS   File: EDPartialAdmissionDialogImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.EDPartialAdmissionVo save(ims.emergency.vo.TrackingForEDPartialAdmissionVo trackingToSave, ims.emergency.vo.EDPartialAdmissionVo edPartialAdmissionToSave) throws ims.domain.exceptions.StaleObjectException
{
	if (edPartialAdmissionToSave == null && trackingToSave == null)
		throw new CodingRuntimeException("Cannot save null EDPartialAdmissionVo or TrackingForEDPartialAdmissionVo ");

	DomainFactory factory = getDomainFactory();

	if (edPartialAdmissionToSave != null && trackingToSave == null)
	{
		if (!edPartialAdmissionToSave.isValidated())
			throw new DomainRuntimeException("EDPartialAdmissionVo Not Validated.");

		EDPartialAdmission domainEDPartialAdmissionToSave = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, edPartialAdmissionToSave);
		factory.save(domainEDPartialAdmissionToSave);

		return EDPartialAdmissionVoAssembler.create(domainEDPartialAdmissionToSave);
	}
	else if (edPartialAdmissionToSave == null && trackingToSave != null)
	{
		if (!trackingToSave.isValidated())
			throw new DomainRuntimeException("TrackingForEDPartialAdmissionVo Not Validated.");

		Tracking domainTrackingforReferral = TrackingForEDPartialAdmissionVoAssembler.extractTracking(factory, trackingToSave);
		factory.save(domainTrackingforReferral);

		TrackingForEDPartialAdmissionVo track = TrackingForEDPartialAdmissionVoAssembler.create(domainTrackingforReferral);

		if (track != null)
			return track.getCurrentPartialAdmission();
	}
	

	return null;
}
 
Example 17
Project: openMAXIMS   File: PendingArrivalsImpl.java   Source Code and License 6 votes vote down vote up
public Boolean isStale(TrackingForQuickRegistrationVo trackingToSave)
{
	if (trackingToSave == null || trackingToSave.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingForQuickRegistrationVo on null Id ");
	}

	DomainFactory factory = getDomainFactory();
	Tracking domainTracking = (Tracking) factory.getDomainObject(Tracking.class, trackingToSave.getID_Tracking());

	if (domainTracking == null)
	{
		return true;
	}

	if (domainTracking.getVersion() > trackingToSave.getVersion_Tracking())
	{
		return true;
	}

	return false;
}
 
Example 18
Project: openMAXIMS   File: EDAssessmentComponentImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo saveMedicStartTime(ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo tracking) throws ims.domain.exceptions.StaleObjectException
{
	if(tracking == null)
		throw new CodingRuntimeException("Cannot save a null Tracking record.");
	
	if(!tracking.isValidated())
		throw new CodingRuntimeException("Tracking record is not validated.");
	
	DomainFactory factory = getDomainFactory();
	Tracking doTracking = TrackingForClinicianWorklistAndTriageVoAssembler.extractTracking(factory, tracking);
	if( doTracking != null )
	{
		doTracking.getTriageDetails().setMedicInterventionStartDateTime(tracking.getTriageDetails().getMedicInterventionStartDateTime().getJavaDate());
		factory.save(doTracking);
	}
	
	
	
	return TrackingForClinicianWorklistAndTriageVoAssembler.create(doTracking);
}
 
Example 19
Project: openmaxims-linux   File: EDReferralToSpecialtyDialogImpl.java   Source Code and License 6 votes vote down vote up
public TrackingForReferalToSpecialtyVo getTrackingForReferral(TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForReferalToSpecialtyVoAssembler.create((Tracking) list.get(0));
	}

	return null;

}
 
Example 20
Project: openmaxims-linux   File: PendingArrivalsImpl.java   Source Code and License 6 votes vote down vote up
public Boolean isStale(TrackingForQuickRegistrationVo trackingToSave)
{
	if (trackingToSave == null || trackingToSave.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingForQuickRegistrationVo on null Id ");
	}

	DomainFactory factory = getDomainFactory();
	Tracking domainTracking = (Tracking) factory.getDomainObject(Tracking.class, trackingToSave.getID_Tracking());

	if (domainTracking == null)
	{
		return true;
	}

	if (domainTracking.getVersion() > trackingToSave.getVersion_Tracking())
	{
		return true;
	}

	return false;
}
 
Example 21
Project: openMAXIMS   File: EDReferralToSpecialtyDialogImpl.java   Source Code and License 6 votes vote down vote up
public TrackingForReferalToSpecialtyVo getTrackingForReferral(TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForReferalToSpecialtyVoAssembler.create((Tracking) list.get(0));
	}

	return null;

}
 
Example 22
Project: openMAXIMS   File: AmendAttendanceTimesDialogImpl.java   Source Code and License 6 votes vote down vote up
public TrackingForTimeAmendmentsVo save(TrackingForTimeAmendmentsVo tracking) throws ims.domain.exceptions.StaleObjectException
{
	if(tracking == null)
		throw new CodingRuntimeException("Cannot save a null TrackingForTimeAmendmentsVo.");
	
	if(!tracking.isValidated())
		throw new CodingRuntimeException("TrackingForTimeAmendmentsVo is not validated.");
	
	DomainFactory factory = getDomainFactory();
	
	Tracking doTracking = TrackingForTimeAmendmentsVoAssembler.extractTracking(factory, tracking);
	
	//WDEV-20089 - MAXIMS.10.1.2
	doTracking.getAttendance().getCareContext().setStartDateTime(doTracking.getAttendance().getRegistrationDateTime());
	doTracking.getEpisode().getEpisodeOfCare().setStartDate(doTracking.getAttendance().getRegistrationDateTime());
	doTracking.getEpisode().getEpisodeOfCare().getCareSpell().setStartDate(doTracking.getAttendance().getRegistrationDateTime());
	doTracking.getAttendance().getCareContext().setEndDateTime(doTracking.getAttendance().getDischargeDateTime());
	
	factory.save(doTracking);
	
	return TrackingForTimeAmendmentsVoAssembler.create(doTracking);
}
 
Example 23
Project: openMAXIMS   File: EDPartialAdmissionDialogImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.TrackingForEDPartialAdmissionVo getTrackingForEdPartialAdmission(ims.emergency.vo.TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForEDPartialAdmissionVoAssembler.create((Tracking) list.get(0));
	}

	return null;
}
 
Example 24
Project: openMAXIMS   File: EmergencyAttendanceTimeAmendmentsImpl.java   Source Code and License 6 votes vote down vote up
public void saveTrackingAndRIECurrentStatus(TrackingRefVo tracking, TrackingAttendanceStatusForEventHistoryVo status, FormName formName, PatientRefVo patient, CareContextRefVo careContext, String rieComment) throws StaleObjectException
{
	if(tracking == null || tracking.getID_Tracking() == null)
		return;
	
	DomainFactory factory = getDomainFactory();
	
	String query = "select attendanceStatus from TrackingAttendanceStatus as attendanceStatus left join attendanceStatus.attendance as contextID where contextID.id = :ContextID and attendanceStatus.id <> :CurrentStatus and (attendanceStatus.isRIE is null or attendanceStatus.isRIE = 0) order by attendanceStatus.systemInformation.creationDateTime desc";
	TrackingAttendanceStatus prevStatus = (TrackingAttendanceStatus) factory.findFirst(query, new String[] {"ContextID", "CurrentStatus"}, new Object[] {careContext.getID_CareContext(), status.getID_TrackingAttendanceStatus()});
	
	if(prevStatus != null)
	{
		Tracking doTracking = (Tracking) factory.getDomainObject(Tracking.class, tracking.getID_Tracking());
		doTracking.setCurrentStatus(prevStatus);
		
		factory.save(doTracking);
		
		markAsRie(status, formName, (patient != null ? patient.getID_Patient() : null), null , (careContext != null ? careContext.getID_CareContext() : null), rieComment);
	}
}
 
Example 25
Project: openMAXIMS   File: EDReferralToSpecialtyDialogImpl.java   Source Code and License 6 votes vote down vote up
public TrackingForReferalToSpecialtyVo getTrackingForReferral(TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForReferalToSpecialtyVoAssembler.create((Tracking) list.get(0));
	}

	return null;

}
 
Example 26
Project: openMAXIMS   File: EDSeenByNurseAndCompleteImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.TrackingForSeenByHCPVo getTracking(ims.emergency.vo.TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForSeenByHCPVoAssembler.create((Tracking) list.get(0));
	}

	return null;
}
 
Example 27
Project: openMAXIMS   File: PendingArrivalsImpl.java   Source Code and License 6 votes vote down vote up
public Boolean isStale(TrackingForQuickRegistrationVo trackingToSave)
{
	if (trackingToSave == null || trackingToSave.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingForQuickRegistrationVo on null Id ");
	}

	DomainFactory factory = getDomainFactory();
	Tracking domainTracking = (Tracking) factory.getDomainObject(Tracking.class, trackingToSave.getID_Tracking());

	if (domainTracking == null)
	{
		return true;
	}

	if (domainTracking.getVersion() > trackingToSave.getVersion_Tracking())
	{
		return true;
	}

	return false;
}
 
Example 28
Project: openmaxims-linux   File: EDAssessmentComponentImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo saveMedicStartTime(ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo tracking) throws ims.domain.exceptions.StaleObjectException
{
	if(tracking == null)
		throw new CodingRuntimeException("Cannot save a null Tracking record.");
	
	if(!tracking.isValidated())
		throw new CodingRuntimeException("Tracking record is not validated.");
	
	DomainFactory factory = getDomainFactory();
	Tracking doTracking = TrackingForClinicianWorklistAndTriageVoAssembler.extractTracking(factory, tracking);
	if( doTracking != null )
	{
		doTracking.getTriageDetails().setMedicInterventionStartDateTime(tracking.getTriageDetails().getMedicInterventionStartDateTime().getJavaDate());
		factory.save(doTracking);
	}
	
	
	
	return TrackingForClinicianWorklistAndTriageVoAssembler.create(doTracking);
}
 
Example 29
Project: openmaxims-linux   File: EDPartialAdmissionDialogImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.EDPartialAdmissionVo save(ims.emergency.vo.TrackingForEDPartialAdmissionVo trackingToSave, ims.emergency.vo.EDPartialAdmissionVo edPartialAdmissionToSave) throws ims.domain.exceptions.StaleObjectException
{
	if (edPartialAdmissionToSave == null && trackingToSave == null)
		throw new CodingRuntimeException("Cannot save null EDPartialAdmissionVo or TrackingForEDPartialAdmissionVo ");

	DomainFactory factory = getDomainFactory();

	if (edPartialAdmissionToSave != null && trackingToSave == null)
	{
		if (!edPartialAdmissionToSave.isValidated())
			throw new DomainRuntimeException("EDPartialAdmissionVo Not Validated.");

		EDPartialAdmission domainEDPartialAdmissionToSave = EDPartialAdmissionVoAssembler.extractEDPartialAdmission(factory, edPartialAdmissionToSave);
		factory.save(domainEDPartialAdmissionToSave);

		return EDPartialAdmissionVoAssembler.create(domainEDPartialAdmissionToSave);
	}
	else if (edPartialAdmissionToSave == null && trackingToSave != null)
	{
		if (!trackingToSave.isValidated())
			throw new DomainRuntimeException("TrackingForEDPartialAdmissionVo Not Validated.");

		Tracking domainTrackingforReferral = TrackingForEDPartialAdmissionVoAssembler.extractTracking(factory, trackingToSave);
		factory.save(domainTrackingforReferral);

		TrackingForEDPartialAdmissionVo track = TrackingForEDPartialAdmissionVoAssembler.create(domainTrackingforReferral);

		if (track != null)
			return track.getCurrentPartialAdmission();
	}
	

	return null;
}
 
Example 30
Project: openMAXIMS   File: SendToXRayImpl.java   Source Code and License 6 votes vote down vote up
public SentToXrayVo save(SentToXrayVo sentToXRayToSave, TrackingForSendToXRayVo tracking) throws StaleObjectException
{
	if (sentToXRayToSave == null)
		throw new CodingRuntimeException("Cannot save null SentToXRay ");

	if (!sentToXRayToSave.isValidated())
		throw new DomainRuntimeException("SentToXrayVo Not Validated.");

	DomainFactory factory = getDomainFactory();
	SentToXray domainSentToXRay = SentToXrayVoAssembler.extractSentToXray(factory, sentToXRayToSave);

	factory.save(domainSentToXRay);
	
	if (tracking!=null)
	{
		if (!tracking.isValidated())
			throw new DomainRuntimeException("TrackingForAllocatedMedicVo Not Validated.");

		Tracking domainTracking = TrackingForSendToXRayVoAssembler.extractTracking(factory, tracking);

		factory.save(domainTracking);
	}

	return SentToXrayVoAssembler.create(domainSentToXRay);
}
 
Example 31
Project: openMAXIMS   File: EDSeenByAndCompleteDialogImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.TrackingForSeenByHCPVo getTracking(ims.emergency.vo.TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForSeenByHCPVoAssembler.create((Tracking) list.get(0));
	}

	return null;
}
 
Example 32
Project: openMAXIMS   File: EDPartialAdmissionDialogImpl.java   Source Code and License 6 votes vote down vote up
public ims.emergency.vo.TrackingForEDPartialAdmissionVo getTrackingForEdPartialAdmission(ims.emergency.vo.TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get TrackingAreaRefVo on null Id for Tracking ");
	}

	DomainFactory factory = getDomainFactory();

	StringBuffer hql = new StringBuffer();
	hql.append("select tracking from Tracking as tracking where tracking.id = :trackingID ");

	List<?> list = factory.find(hql.toString(), new String[] { "trackingID" }, new Object[] { trackingRef.getID_Tracking() });

	if (list!=null && list.size()>0)
	{
		return TrackingForEDPartialAdmissionVoAssembler.create((Tracking) list.get(0));
	}

	return null;
}
 
Example 33
Project: AvoinApotti   File: AssignADTWardAndSpecialtyDialogImpl.java   Source Code and License 5 votes vote down vote up
/**
* savePendingEmergency
*/
public void savePendingEmergency(ims.core.vo.PendingEmergencyAdmissionLiteVo emergency, Boolean hasWardChanged,TrackingForADTWardAndSpecialtyDialogVo tracking) throws ims.domain.exceptions.StaleObjectException
{
	if (hasWardChanged == null)
		throw new CodingRuntimeException("hasWardChanged cannot be null in method savePendingEmergency");
	if (emergency == null)
		throw new CodingRuntimeException("emergency is null in method savePendingEmergency");
	if (!emergency.isValidated())
		throw new CodingRuntimeException("emergency has not been validated in method savePendingEmergency");

	//WDEV-10421
	DomainFactory factory = getDomainFactory();
	PendingEmergencyAdmission doPendingEmergency = PendingEmergencyAdmissionLiteVoAssembler.extractPendingEmergencyAdmission(factory, emergency);
	if(hasWardChanged)
	{
		AllocatedWardHistory doAllocWardHist = new AllocatedWardHistory();
		doAllocWardHist.setAllocatedWard(doPendingEmergency.getAllocatedWard());
		doAllocWardHist.setAllocatedWardDateTime(new Date());		
		if(getLoggedInUser() != null)
			doAllocWardHist.setAllocatingUser((AppUser) getDomainFactory().getDomainObject((AppUserRefVo) getLoggedInUser()));
	
		doPendingEmergency.getAllocatedWardHistory().add(doAllocWardHist);
	}		
	
	factory.save(doPendingEmergency);
	
	//wdev-16866
	if( tracking != null )
	{
		Tracking doTracking =  TrackingForADTWardAndSpecialtyDialogVoAssembler.extractTracking(factory, tracking);
		factory.save(doTracking);		
	}
	//------------
}
 
Example 34
Project: AvoinApotti   File: TrackingImpl.java   Source Code and License 5 votes vote down vote up
public TrackingSaveVo getTracking(TrackingRefVo trackingId) 
{
	if(trackingId == null || trackingId.getID_Tracking() == null)
		throw new CodingRuntimeException("Cannot get Tracking record on null Tracking Id.");
	
	DomainFactory factory = getDomainFactory();
	Tracking doTracking = (Tracking) factory.getDomainObject(Tracking.class, trackingId.getID_Tracking());
	
	return TrackingSaveVoAssembler.create(doTracking);
}
 
Example 35
Project: AvoinApotti   File: TrackingImpl.java   Source Code and License 5 votes vote down vote up
public TrackingSaveVo saveTracking(TrackingSaveVo tracking)	throws StaleObjectException, UniqueKeyViolationException 
{
	if(tracking == null)
		throw new CodingRuntimeException("Cannot save a null tracking record.");
	
	if(!tracking.isValidated())
		throw new CodingRuntimeException("tracking record is not validated.");
	
	DomainFactory factory = getDomainFactory();
	Tracking doTracking = TrackingSaveVoAssembler.extractTracking(factory, tracking);
	
	factory.save(doTracking);
	return TrackingSaveVoAssembler.create(doTracking);
}
 
Example 36
Project: AvoinApotti   File: TrackingImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistAndTriageVo getTrackingForClinicianWorklistAndTriageVo(TrackingRefVo trackingRef)
{
	if(trackingRef == null )
		throw new CodingRuntimeException("TrackingRefVo cannot be null");

	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackingRef.getID_Tracking()));
}
 
Example 37
Project: AvoinApotti   File: TrackingImpl.java   Source Code and License 5 votes vote down vote up
public TrackingVo getTrackingVo(TrackingRefVo trackingRef)
{
	if(trackingRef == null )
		throw new CodingRuntimeException("TrackingRefVo cannot be null");

	return TrackingVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackingRef.getID_Tracking()));
}
 
Example 38
Project: AvoinApotti   File: TrackingImpl.java   Source Code and License 5 votes vote down vote up
public TrackingWithPartialAdmissionVo getTrackingWithEDPartialAdmission(TrackingRefVo trackRef)
{
	if(trackRef == null || trackRef.getID_Tracking() == null)
		throw new CodingRuntimeException("Cannot get Tracking record on null Tracking Id.");
	
	DomainFactory factory = getDomainFactory();
	Tracking doTracking = (Tracking) factory.getDomainObject(Tracking.class, trackRef.getID_Tracking());
	
	return TrackingWithPartialAdmissionVoAssembler.create(doTracking);
}
 
Example 39
Project: AvoinApotti   File: BedAwaitingBedAvailableImpl.java   Source Code and License 5 votes vote down vote up
public BedAvailabilityVo save(BedAvailabilityVo bedAvailabilityToSave, TrackingForBedAvailabilityVo trackingToSave) throws StaleObjectException, UniqueKeyViolationException
{
	if (bedAvailabilityToSave == null && trackingToSave == null)
		throw new CodingRuntimeException("Cannot save null BedAvailability or TrackingForBedAvailability ");

	DomainFactory factory = getDomainFactory();

	if (bedAvailabilityToSave != null && trackingToSave == null)
	{
		if (!bedAvailabilityToSave.isValidated())
			throw new DomainRuntimeException("BedAvailabilityVo Not Validated.");

		BedAvailability domainBedAvailability = BedAvailabilityVoAssembler.extractBedAvailability(factory, bedAvailabilityToSave);
		factory.save(domainBedAvailability);

		return BedAvailabilityVoAssembler.create(domainBedAvailability);
	}
	else if (bedAvailabilityToSave == null && trackingToSave != null)
	{
		if (!trackingToSave.isValidated())
			throw new DomainRuntimeException("TrackingForBedAvailability Not Validated.");

		Tracking domainTracking = TrackingForBedAvailabilityVoAssembler.extractTracking(factory, trackingToSave);
		factory.save(domainTracking);

		TrackingForBedAvailabilityVo track = TrackingForBedAvailabilityVoAssembler.create(domainTracking);

		if (track != null)
			return track.getBedAvailability();
	}

	return null;
}
 
Example 40
Project: AvoinApotti   File: EDAssessmentComponentImpl.java   Source Code and License 5 votes vote down vote up
public ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo getTrackingForTriage(ims.emergency.vo.TrackingRefVo trackingId)
{
	if(trackingId == null || trackingId.getID_Tracking() == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Tracking Id.");
	
	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackingId.getID_Tracking()));
}
 
Example 41
Project: AvoinApotti   File: EDAssessmentComponentImpl.java   Source Code and License 5 votes vote down vote up
public ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo getTrackingForClinicianWorklistByCareContext(ims.core.admin.vo.CareContextRefVo careContext)
{
	if(careContext == null || careContext.getID_CareContext() == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Care Context Id.");
	
	DomainFactory factory = getDomainFactory();
	String query = "select tr from Tracking as tr left join tr.attendance as att left join att.careContext as cc where cc.id = :CareContextId";
	
	List<?> trackingList = factory.find(query, new String[] {"CareContextId"}, new Object[] {careContext.getID_CareContext()});
	
	if(trackingList == null || trackingList.size() == 0)
		return null;
	
	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) trackingList.get(0));
}
 
Example 42
Project: AvoinApotti   File: EDAssessmentComponentImpl.java   Source Code and License 5 votes vote down vote up
public ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo geTrackingForTriageByAttendanceId(ims.core.admin.vo.EmergencyAttendanceRefVo attendanceId)
{
	if(attendanceId == null || attendanceId.getID_EmergencyAttendance() == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Attendance Id.");
	
	DomainFactory factory = getDomainFactory();
	String query = "select tr from Tracking as tr left join tr.attendance as att where att.id = :AttendanceId";
	
	List<?> list = factory.find(query, new String[] {"AttendanceId"}, new Object[] {attendanceId.getID_EmergencyAttendance()});
	
	if(list == null || list.size() == 0)
		return null;
	
	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) list.get(0));
}
 
Example 43
Project: AvoinApotti   File: EDAssessmentComponentImpl.java   Source Code and License 5 votes vote down vote up
public ims.emergency.vo.TrackingForClinicianWorklistAndTriageVo getTrackingForClinicianByActiveCareContext(ims.core.patient.vo.PatientRefVo patientRef)
{
	if(patientRef == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Patient Id.");
	
	DomainFactory factory = getDomainFactory();
	String query = "select tr from Tracking as tr left join tr.attendance as att left join att.careContext as cc left join cc.episodeOfCare as EOC left join EOC.careSpell as CS  left join CS.patient as PAT where cc.endDateTime is null and PAT.id = :PatientId";
	
	List<?> trackingList = factory.find(query, new String[] {"PatientId"}, new Object[] {patientRef.getID_Patient()});
	
	if(trackingList == null || trackingList.size() == 0)
		return null;
	
	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) trackingList.get(0));
}
 
Example 44
Project: AvoinApotti   File: EDAssessmentComponentImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistAndTriageVo getTrackingForClinicianWorklistAndTriageVo(TrackingRefVo trackingRef)
{
	if(trackingRef == null )
		throw new CodingRuntimeException("TrackingRefVo cannot be null");

	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackingRef.getID_Tracking()));

}
 
Example 45
Project: AvoinApotti   File: TriageImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForTriageVo getTrackingForTriage(TrackingRefVo trackingId) 
{
	if(trackingId == null || trackingId.getID_Tracking() == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Tracking Id.");
	
	return TrackingForTriageVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackingId.getID_Tracking()));
}
 
Example 46
Project: AvoinApotti   File: TriageImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForTriageVo saveTracking(TrackingForTriageVo tracking, SeenByHCPVo seenByHCP) throws StaleObjectException     //wdev-15930  //WDEV-16816
{
	if(tracking == null)
		throw new CodingRuntimeException("Cannot save a null Tracking record.");
	
	if(!tracking.isValidated())
		throw new CodingRuntimeException("Tracking record is not validated.");
	
	DomainFactory factory = getDomainFactory();
	//wdev-15930
	//WDEV-16816
	SeenByHCP doSeenBy = null;
	if( seenByHCP != null ) 
	{
		doSeenBy = SeenByHCPVoAssembler.extractSeenByHCP(factory, seenByHCP);
		if( doSeenBy != null )
		{
			factory.save(doSeenBy);
			
		}
	}
		
	//-------------wdev-15930------------
	
	Tracking doTracking = TrackingForTriageVoAssembler.extractTracking(factory, tracking);
	if( doSeenBy != null ) //wdev-15930 //WDEV-16816
	{
		doTracking.setSeenBy(doSeenBy); //WDEV-16816
	}
	
	factory.save(doTracking);
	
	return TrackingForTriageVoAssembler.create(doTracking);
}
 
Example 47
Project: AvoinApotti   File: TriageImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForTriageVo geTrackingForTriageByAttendanceId(EmergencyAttendanceRefVo attendanceId) 
{
	if(attendanceId == null || attendanceId.getID_EmergencyAttendance() == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Attendance Id.");
	
	DomainFactory factory = getDomainFactory();
	String query = "select tr from Tracking as tr left join tr.attendance as att where att.id = :AttendanceId";
	
	List<?> list = factory.find(query, new String[] {"AttendanceId"}, new Object[] {attendanceId.getID_EmergencyAttendance()});
	
	if(list == null || list.size() == 0)
		return null;
	
	return TrackingForTriageVoAssembler.create((Tracking) list.get(0));
}
 
Example 48
Project: AvoinApotti   File: TriageImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForTriageVo getTrackingForTriageByCareContext(CareContextRefVo careContext) 
{
	if(careContext == null || careContext.getID_CareContext() == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Care Context Id.");
	
	DomainFactory factory = getDomainFactory();
	String query = "select tr from Tracking as tr left join tr.attendance as att left join att.careContext as cc where cc.id = :CareContextId";
	
	List<?> trackingList = factory.find(query, new String[] {"CareContextId"}, new Object[] {careContext.getID_CareContext()});
	
	if(trackingList == null || trackingList.size() == 0)
		return null;
	
	return TrackingForTriageVoAssembler.create((Tracking) trackingList.get(0));
}
 
Example 49
Project: AvoinApotti   File: TriageImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForTriageVo getTrackingForTriageByActiveCareContext(PatientRefVo patientRef)
{
	if(patientRef == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Patient Id.");
	
	DomainFactory factory = getDomainFactory();
	String query = "select tr from Tracking as tr left join tr.attendance as att left join att.careContext as cc left join cc.episodeOfCare as EOC left join EOC.careSpell as CS  left join CS.patient as PAT where cc.endDateTime is null and PAT.id = :PatientId";
	
	List<?> trackingList = factory.find(query, new String[] {"PatientId"}, new Object[] {patientRef.getID_Patient()});
	
	if(trackingList == null || trackingList.size() == 0)
		return null;
	
	return TrackingForTriageVoAssembler.create((Tracking) trackingList.get(0));
}
 
Example 50
Project: AvoinApotti   File: TriageImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistAndTriageVo getTrckinGForClonicianWorklosAndTriage(TrackingRefVo trackingRef)
{
	if(trackingRef == null || trackingRef.getID_Tracking() == null)
		throw new CodingRuntimeException("Cannnot get Tracking for a null Id.");
	
	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackingRef.getID_Tracking()));

}
 
Example 51
Project: AvoinApotti   File: ClinicianAssessmentWorklistImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistVo getTrackingForTriage(ims.emergency.vo.TrackingRefVo trackingId)
{
	if(trackingId == null || trackingId.getID_Tracking() == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Tracking Id.");
	
	return TrackingForClinicianWorklistVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackingId.getID_Tracking()));
}
 
Example 52
Project: AvoinApotti   File: ClinicianAssessmentWorklistImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistVo saveMedicStartTime(TrackingForClinicianWorklistVo tracking) throws StaleObjectException 
{
	if(tracking == null)
		throw new CodingRuntimeException("Cannot save a null Tracking record.");
	
	if(!tracking.isValidated())
		throw new CodingRuntimeException("Tracking record is not validated.");
	
	DomainFactory factory = getDomainFactory();
	Tracking doTracking = TrackingForClinicianWorklistVoAssembler.extractTracking(factory, tracking);
	
	factory.save(doTracking);
	
	return TrackingForClinicianWorklistVoAssembler.create(doTracking);
}
 
Example 53
Project: AvoinApotti   File: ClinicianAssessmentWorklistImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistVo getTrackingForClinicianWorklistByCareContext(CareContextRefVo careContext) 
{
	if(careContext == null || careContext.getID_CareContext() == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Care Context Id.");
	
	DomainFactory factory = getDomainFactory();
	String query = "select tr from Tracking as tr left join tr.attendance as att left join att.careContext as cc where cc.id = :CareContextId";
	
	List<?> trackingList = factory.find(query, new String[] {"CareContextId"}, new Object[] {careContext.getID_CareContext()});
	
	if(trackingList == null || trackingList.size() == 0)
		return null;
	
	return TrackingForClinicianWorklistVoAssembler.create((Tracking) trackingList.get(0));
}
 
Example 54
Project: AvoinApotti   File: ClinicianAssessmentWorklistImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistVo geTrackingForTriageByAttendanceId(EmergencyAttendanceRefVo attendanceId) 
{
	if(attendanceId == null || attendanceId.getID_EmergencyAttendance() == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Attendance Id.");
	
	DomainFactory factory = getDomainFactory();
	String query = "select tr from Tracking as tr left join tr.attendance as att where att.id = :AttendanceId";
	
	List<?> list = factory.find(query, new String[] {"AttendanceId"}, new Object[] {attendanceId.getID_EmergencyAttendance()});
	
	if(list == null || list.size() == 0)
		return null;
	
	return TrackingForClinicianWorklistVoAssembler.create((Tracking) list.get(0));
}
 
Example 55
Project: AvoinApotti   File: ClinicianAssessmentWorklistImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistVo getTrackingForClinicianByActiveCareContext(PatientRefVo patientRef)
{
	if(patientRef == null)
		throw new CodingRuntimeException("Cannot get Tracking record for a null Patient Id.");
	
	DomainFactory factory = getDomainFactory();
	String query = "select tr from Tracking as tr left join tr.attendance as att left join att.careContext as cc left join cc.episodeOfCare as EOC left join EOC.careSpell as CS  left join CS.patient as PAT where cc.endDateTime is null and PAT.id = :PatientId";
	
	List<?> trackingList = factory.find(query, new String[] {"PatientId"}, new Object[] {patientRef.getID_Patient()});
	
	if(trackingList == null || trackingList.size() == 0)
		return null;
	
	return TrackingForClinicianWorklistVoAssembler.create((Tracking) trackingList.get(0));
}
 
Example 56
Project: AvoinApotti   File: ClinicianAssessmentWorklistImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistAndTriageVo getTrackingForClinicianWorklistAndTriageVo(TrackingRefVo trackingRef)
{
	if(trackingRef == null || trackingRef.getID_Tracking() == null)
		throw new CodingRuntimeException("Cannnot get Tracking for a null Id.");
	
	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackingRef.getID_Tracking()));

}
 
Example 57
Project: AvoinApotti   File: DischargeDetails_OutcomeImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistAndTriageVo getTrackingForClinicianWorklistAndTriageVo(TrackingRefVo trackRef) 
{
	if(trackRef == null )
		throw new CodingRuntimeException("TrackingRefVo cannot be null");

	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackRef.getID_Tracking()));

}
 
Example 58
Project: AvoinApotti   File: TrackingStatusDialogImpl.java   Source Code and License 5 votes vote down vote up
public void saveTracking(ims.emergency.vo.TrackingForTrackingStatusVo trackingToSave) throws ims.domain.exceptions.StaleObjectException
{
	if (trackingToSave == null)
		throw new CodingRuntimeException("Cannot save null TrackingForTrackingStatusVo ");

	if (!trackingToSave.isValidated())
		throw new DomainRuntimeException("TrackingForTrackingStatusVo Not Validated.");

	DomainFactory factory = getDomainFactory();
	Tracking domainTrackingStatus = TrackingForTrackingStatusVoAssembler.extractTracking(factory, trackingToSave);

	factory.save(domainTrackingStatus);
}
 
Example 59
Project: AvoinApotti   File: EDWhiteBoardEditDialogImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistAndTriageVo getTracking(TrackingRefVo trackingRef)
{
	if (trackingRef == null || trackingRef.getID_Tracking() == null)
	{
		throw new CodingRuntimeException("Cannot get Tracking by null Id ");
	}

	DomainFactory factory = getDomainFactory();

	Tracking domainTracking = (Tracking) factory.getDomainObject(Tracking.class, trackingRef.getID_Tracking());

	return TrackingForClinicianWorklistAndTriageVoAssembler.create(domainTracking);
}
 
Example 60
Project: AvoinApotti   File: TrackingAndAttendanceWorklistsImpl.java   Source Code and License 5 votes vote down vote up
public TrackingForClinicianWorklistAndTriageVo getTrackingForClinicianWorklistAndTriageVo(TrackingRefVo trackingRef)
{
	if(trackingRef == null )
		throw new CodingRuntimeException("TrackingRefVo cannot be null");

	return TrackingForClinicianWorklistAndTriageVoAssembler.create((Tracking) getDomainFactory().getDomainObject(Tracking.class, trackingRef.getID_Tracking()));
}