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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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   View source code 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()));
}