Java Code Examples for ims.pathways.vo.PatientJourneyVo

The following are top voted examples for showing how to use ims.pathways.vo.PatientJourneyVo. 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: openmaxims-linux   File: SessionAdminImpl.java   View source code 7 votes vote down vote up
public PatientEventVo createAndSaveEvent(Event event, Booking_Appointment doAppt, PatientJourneyVo voJourney) throws DomainInterfaceException, StaleObjectException
{
	PatientEventVo voEvent = new PatientEventVo();
	voEvent.setEventDateTime(new DateTime());
	voEvent.setEvent(new EventRefVo(event.getId(), event.getVersion()));
	voEvent.setScheduledDate(new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())));

	// called from this class
	if (voJourney == null)
	{
		PatientJourneyTargetVo voPatientJourneyTarget = PatientJourneyTargetVoAssembler.create(getFirstPathwayEvent(doAppt.getPathwayEvents()));
		if (voPatientJourneyTarget != null)
		{
			voEvent.setJourney(voPatientJourneyTarget.getPathwayJourney());
			if (voPatientJourneyTarget.getPathwayJourneyIsNotNull())
				voEvent.setPatient(voPatientJourneyTarget.getPathwayJourney().getPatient());

			voEvent.setPatientTarget(voPatientJourneyTarget);
			if (voPatientJourneyTarget.getPathwayJourney().getPathwayIsNotNull())
				voEvent.setSpecialty(voPatientJourneyTarget.getPathwayJourney().getPathway().getSpecialty());
		}
	}
	else
	{
		// called from Booking Screen
		voEvent.setJourney(voJourney);
		voEvent.setPatient(voJourney.getPatient());
		voEvent.setPatientTarget(getPatientTarget(event, voJourney));
		if (voJourney.getPathwayIsNotNull())
			voEvent.setSpecialty(voJourney.getPathway().getSpecialty());
	}

	HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class);
	return impl.instantiatePatientEvent(voEvent);
}
 
Example 2
Project: AvoinApotti   File: PCGVoMapper.java   View source code 6 votes vote down vote up
private PatientJourneyVo recordPatientEvent(MessageEvent messageEvent, GOL gol) throws Exception 
{
	PatientEventVo patEvent = new PatientEventVo();
	patEvent.setActionCode(gol.getActionCode().getValue());
	patEvent.setClinicCode(messageEvent.clinicCode);
	patEvent.setConsultant(messageEvent.eventConsultant);
	patEvent.setDescription(gol.getGoalEvaluationComment(0).getValue());  // GOL-17 Event Description
	patEvent.setEvent(messageEvent.event);
	patEvent.setEventDateTime(messageEvent.eventDateTime);
	patEvent.setExternalEvent(messageEvent.extMap);
	String externalEventId = gol.getGoalID().getIdentifier().getValue();
	if (externalEventId != null && !externalEventId.equals("NA"))
		patEvent.setExternalEventId(new Integer(externalEventId)); // GOL-3 Goal ID = Unique external Id
	patEvent.setJourney(messageEvent.journey);
	patEvent.setMessageId(messageEvent.messageId);
	patEvent.setSpecialty(messageEvent.eventSpecialty);
	patEvent.setRttExternalEvent(messageEvent.rttEvent);
	patEvent.setPatient(messageEvent.patient);
	patEvent.setScheduledDate(messageEvent.scheduleDateTime);
	
	// wdev-8708 return the journey as it may have been updated
	return (hL7PathwayIf.instantiatePatientEvent(patEvent).getJourney());
}
 
Example 3
Project: AvoinApotti   File: CreateNewPathwayImpl.java   View source code 6 votes vote down vote up
/**
 * wdev-7919
 * inNewPathway
 * If the target specified is part of the new pathway, return true, otherwise, return false
 * @param factory
 * @param target
 * @param patientJourney 
 * @return
 */
private boolean inNewPathway(DomainFactory factory, Target target, PatientJourneyVo patientJourney)
{
	String hql=" from PathwayTarget pt where pt.target = :target and pt.pathway = :pathway and pt.status = :status";
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("target");
	labels.add("pathway");
	labels.add("status");
	values.add(target);
	values.add(factory.getDomainObject(Pathway.class, patientJourney.getPathway().getID_Pathway()));
	values.add(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE));
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 0)
		return true;

	return false;
}
 
Example 4
Project: openMAXIMS   File: PCGVoMapper.java   View source code 6 votes vote down vote up
private PatientJourneyVo recordPatientEvent(MessageEvent messageEvent, GOL gol) throws Exception 
{
	PatientEventVo patEvent = new PatientEventVo();
	patEvent.setActionCode(gol.getActionCode().getValue());
	patEvent.setClinicCode(messageEvent.clinicCode);
	patEvent.setConsultant(messageEvent.eventConsultant);
	patEvent.setDescription(gol.getGoalEvaluationComment(0).getValue());  // GOL-17 Event Description
	patEvent.setEvent(messageEvent.event);
	patEvent.setEventDateTime(messageEvent.eventDateTime);
	patEvent.setExternalEvent(messageEvent.extMap);
	String externalEventId = gol.getGoalID().getIdentifier().getValue();
	if (externalEventId != null && !externalEventId.equals("NA"))
		patEvent.setExternalEventId(new Integer(externalEventId)); // GOL-3 Goal ID = Unique external Id
	patEvent.setJourney(messageEvent.journey);
	patEvent.setMessageId(messageEvent.messageId);
	patEvent.setSpecialty(messageEvent.eventSpecialty);
	patEvent.setRttExternalEvent(messageEvent.rttEvent);
	patEvent.setPatient(messageEvent.patient);
	patEvent.setScheduledDate(messageEvent.scheduleDateTime);
	
	// wdev-8708 return the journey as it may have been updated
	return (hL7PathwayIf.instantiatePatientEvent(patEvent).getJourney());
}
 
Example 5
Project: openMAXIMS   File: CreateNewPathwayImpl.java   View source code 6 votes vote down vote up
/**
 * wdev-7919
 * inNewPathway
 * If the target specified is part of the new pathway, return true, otherwise, return false
 * @param factory
 * @param target
 * @param patientJourney 
 * @return
 */
private boolean inNewPathway(DomainFactory factory, Target target, PatientJourneyVo patientJourney)
{
	String hql=" from PathwayTarget pt where pt.target = :target and pt.pathway = :pathway and pt.status = :status";
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("target");
	labels.add("pathway");
	labels.add("status");
	values.add(target);
	values.add(factory.getDomainObject(Pathway.class, patientJourney.getPathway().getID_Pathway()));
	values.add(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE));
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 0)
		return true;

	return false;
}
 
Example 6
Project: openMAXIMS   File: PCGVoMapper.java   View source code 6 votes vote down vote up
private PatientJourneyVo recordPatientEvent(MessageEvent messageEvent, GOL gol) throws Exception 
{
	PatientEventVo patEvent = new PatientEventVo();
	patEvent.setActionCode(gol.getActionCode().getValue());
	patEvent.setClinicCode(messageEvent.clinicCode);
	patEvent.setConsultant(messageEvent.eventConsultant);
	patEvent.setDescription(gol.getGoalEvaluationComment(0).getValue());  // GOL-17 Event Description
	patEvent.setEvent(messageEvent.event);
	patEvent.setEventDateTime(messageEvent.eventDateTime);
	patEvent.setExternalEvent(messageEvent.extMap);
	String externalEventId = gol.getGoalID().getIdentifier().getValue();
	if (externalEventId != null && !externalEventId.equals("NA"))
		patEvent.setExternalEventId(new Integer(externalEventId)); // GOL-3 Goal ID = Unique external Id
	patEvent.setJourney(messageEvent.journey);
	patEvent.setMessageId(messageEvent.messageId);
	patEvent.setSpecialty(messageEvent.eventSpecialty);
	patEvent.setRttExternalEvent(messageEvent.rttEvent);
	patEvent.setPatient(messageEvent.patient);
	patEvent.setScheduledDate(messageEvent.scheduleDateTime);
	
	// wdev-8708 return the journey as it may have been updated
	return (hL7PathwayIf.instantiatePatientEvent(patEvent).getJourney());
}
 
Example 7
Project: openMAXIMS   File: CreateNewPathwayImpl.java   View source code 6 votes vote down vote up
/**
 * wdev-7919
 * inNewPathway
 * If the target specified is part of the new pathway, return true, otherwise, return false
 * @param factory
 * @param target
 * @param patientJourney 
 * @return
 */
private boolean inNewPathway(DomainFactory factory, Target target, PatientJourneyVo patientJourney)
{
	String hql=" from PathwayTarget pt where pt.target = :target and pt.pathway = :pathway and pt.status = :status";
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("target");
	labels.add("pathway");
	labels.add("status");
	values.add(target);
	values.add(factory.getDomainObject(Pathway.class, patientJourney.getPathway().getID_Pathway()));
	values.add(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE));
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 0)
		return true;

	return false;
}
 
Example 8
Project: openmaxims-linux   File: PCGVoMapper.java   View source code 6 votes vote down vote up
private PatientJourneyVo recordPatientEvent(MessageEvent messageEvent, GOL gol) throws Exception 
{
	PatientEventVo patEvent = new PatientEventVo();
	patEvent.setActionCode(gol.getActionCode().getValue());
	patEvent.setClinicCode(messageEvent.clinicCode);
	patEvent.setConsultant(messageEvent.eventConsultant);
	patEvent.setDescription(gol.getGoalEvaluationComment(0).getValue());  // GOL-17 Event Description
	patEvent.setEvent(messageEvent.event);
	patEvent.setEventDateTime(messageEvent.eventDateTime);
	patEvent.setExternalEvent(messageEvent.extMap);
	String externalEventId = gol.getGoalID().getIdentifier().getValue();
	if (externalEventId != null && !externalEventId.equals("NA"))
		patEvent.setExternalEventId(new Integer(externalEventId)); // GOL-3 Goal ID = Unique external Id
	patEvent.setJourney(messageEvent.journey);
	patEvent.setMessageId(messageEvent.messageId);
	patEvent.setSpecialty(messageEvent.eventSpecialty);
	patEvent.setRttExternalEvent(messageEvent.rttEvent);
	patEvent.setPatient(messageEvent.patient);
	patEvent.setScheduledDate(messageEvent.scheduleDateTime);
	
	// wdev-8708 return the journey as it may have been updated
	return (hL7PathwayIf.instantiatePatientEvent(patEvent).getJourney());
}
 
Example 9
Project: openmaxims-linux   File: CreateNewPathwayImpl.java   View source code 6 votes vote down vote up
/**
 * wdev-7919
 * inNewPathway
 * If the target specified is part of the new pathway, return true, otherwise, return false
 * @param factory
 * @param target
 * @param patientJourney 
 * @return
 */
private boolean inNewPathway(DomainFactory factory, Target target, PatientJourneyVo patientJourney)
{
	String hql=" from PathwayTarget pt where pt.target = :target and pt.pathway = :pathway and pt.status = :status";
	
	ArrayList<String> labels = new ArrayList<String>();
	ArrayList<Object> values = new ArrayList<Object>();
	labels.add("target");
	labels.add("pathway");
	labels.add("status");
	values.add(target);
	values.add(factory.getDomainObject(Pathway.class, patientJourney.getPathway().getID_Pathway()));
	values.add(getDomLookup(PreActiveActiveInactiveStatus.ACTIVE));
	
	List lst = factory.find(hql.toString(), labels, values);
	if (lst != null && lst.size() > 0)
		return true;

	return false;
}
 
Example 10
Project: AvoinApotti   File: ClinicListImpl.java   View source code 5 votes vote down vote up
public PatientEventVo createAndSaveEvent(Event event, Booking_Appointment doAppt, PatientJourneyVo voJourney) throws DomainInterfaceException, StaleObjectException
{
	PatientEventVo voEvent = new PatientEventVo();
	voEvent.setEventDateTime(new DateTime());
	voEvent.setEvent(new EventRefVo(event.getId(),event.getVersion()));
	voEvent.setScheduledDate(new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())));
	
	//called from this class
	if(voJourney == null)
	{
		PatientJourneyTargetVo voPatientJourneyTarget =  PatientJourneyTargetVoAssembler.create(getFirstPathwayEvent(doAppt.getPathwayEvents()));
		if(voPatientJourneyTarget != null)
		{
			voEvent.setJourney(voPatientJourneyTarget.getPathwayJourney());
			if(voPatientJourneyTarget.getPathwayJourneyIsNotNull())
				voEvent.setPatient(voPatientJourneyTarget.getPathwayJourney().getPatient());
			
			voEvent.setPatientTarget(voPatientJourneyTarget);
			if(voPatientJourneyTarget.getPathwayJourney().getPathwayIsNotNull())
				voEvent.setSpecialty(voPatientJourneyTarget.getPathwayJourney().getPathway().getSpecialty());
		}
	}
	else
	{
		//called from Booking Screen
		voEvent.setJourney(voJourney);
		voEvent.setPatient(voJourney.getPatient());
		voEvent.setPatientTarget( getPatientTarget(event, voJourney));
		if(voJourney.getPathwayIsNotNull())
			voEvent.setSpecialty(voJourney.getPathway().getSpecialty());
	}

	HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class);
	return impl.instantiatePatientEvent(voEvent);
}
 
Example 11
Project: AvoinApotti   File: ClinicListImpl.java   View source code 5 votes vote down vote up
private PatientJourneyTargetRefVo getPatientTarget(Event event, PatientJourneyVo voJourney)
{
	String hql = "select pjt from PatientJourneyTarget as pjt left join pjt.pathwayTarget as pt left join pt.target as target1 left join pjt.pathwayJourney as pj, EventTarget as et left join et.target as target2 left join et.event as event where " +
	"(pj.id = :idJourney and event.id = :idEvent)";
	
	List pjts = getDomainFactory().find(hql, new String[]{"idJourney","idEvent"}, new Object[]{event.getId(), voJourney.getID_PatientPathwayJourney()});
	if(pjts != null && pjts.size() > 0)
		PatientJourneyTargetVoAssembler.create((PatientJourneyTarget) pjts.get(0));

	return null;
}
 
Example 12
Project: AvoinApotti   File: SessionAdminImpl.java   View source code 5 votes vote down vote up
public PatientEventVo createAndSaveEvent(Event event, Booking_Appointment doAppt, PatientJourneyVo voJourney) throws DomainInterfaceException, StaleObjectException
{
	PatientEventVo voEvent = new PatientEventVo();
	voEvent.setEventDateTime(new DateTime());
	voEvent.setEvent(new EventRefVo(event.getId(), event.getVersion()));
	voEvent.setScheduledDate(new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())));

	// called from this class
	if (voJourney == null)
	{
		PatientJourneyTargetVo voPatientJourneyTarget = PatientJourneyTargetVoAssembler.create(getFirstPathwayEvent(doAppt.getPathwayEvents()));
		if (voPatientJourneyTarget != null)
		{
			voEvent.setJourney(voPatientJourneyTarget.getPathwayJourney());
			if (voPatientJourneyTarget.getPathwayJourneyIsNotNull())
				voEvent.setPatient(voPatientJourneyTarget.getPathwayJourney().getPatient());

			voEvent.setPatientTarget(voPatientJourneyTarget);
			if (voPatientJourneyTarget.getPathwayJourney().getPathwayIsNotNull())
				voEvent.setSpecialty(voPatientJourneyTarget.getPathwayJourney().getPathway().getSpecialty());
		}
	}
	else
	{
		// called from Booking Screen
		voEvent.setJourney(voJourney);
		voEvent.setPatient(voJourney.getPatient());
		voEvent.setPatientTarget(getPatientTarget(event, voJourney));
		if (voJourney.getPathwayIsNotNull())
			voEvent.setSpecialty(voJourney.getPathway().getSpecialty());
	}

	HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class);
	return impl.instantiatePatientEvent(voEvent);
}
 
Example 13
Project: AvoinApotti   File: SessionAdminImpl.java   View source code 5 votes vote down vote up
private PatientJourneyTargetRefVo getPatientTarget(Event event, PatientJourneyVo voJourney)
{
	String hql = "select pjt from PatientJourneyTarget as pjt left join pjt.pathwayTarget as pt left join pt.target as target1 left join pjt.pathwayJourney as pj, EventTarget as et left join et.target as target2 left join et.event as event where " + "(pj.id = :idJourney and event.id = :idEvent)";

	List<?> pjts = getDomainFactory().find(hql, new String[]{"idJourney", "idEvent"}, new Object[]{event.getId(), voJourney.getID_PatientPathwayJourney()});
	if (pjts != null && pjts.size() > 0)
		PatientJourneyTargetVoAssembler.create((PatientJourneyTarget) pjts.get(0));

	return null;
}
 
Example 14
Project: AvoinApotti   File: CreateNewPathwayImpl.java   View source code 5 votes vote down vote up
public PatientJourneyVo getPatientJourney(PatientPathwayJourneyRefVo journey)
{
	if (journey.getID_PatientPathwayJourney() == null)
		throw new CodingRuntimeException("No id provided for PatientJourney in method getPatientJourney");

	return PatientJourneyVoAssembler.create((PatientPathwayJourney) getDomainFactory().getDomainObject(journey));
}
 
Example 15
Project: openMAXIMS   File: ClinicListImpl.java   View source code 5 votes vote down vote up
public PatientEventVo createAndSaveEvent(Event event, Booking_Appointment doAppt, PatientJourneyVo voJourney) throws DomainInterfaceException, StaleObjectException
{
	PatientEventVo voEvent = new PatientEventVo();
	voEvent.setEventDateTime(!Status_Reason.DNA.equals(doAppt.getApptStatus()) ? new DateTime(): new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())));//WDEV-20603
	voEvent.setEvent(new EventRefVo(event.getId(),event.getVersion()));
	voEvent.setScheduledDate(new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())));
	
	//called from this class
	if(voJourney == null)
	{
		PatientJourneyTargetVo voPatientJourneyTarget =  PatientJourneyTargetVoAssembler.create(getFirstPathwayEvent(doAppt.getPathwayEvents()));
		if(voPatientJourneyTarget != null)
		{
			voEvent.setJourney(voPatientJourneyTarget.getPathwayJourney());
			if(voPatientJourneyTarget.getPathwayJourneyIsNotNull())
				voEvent.setPatient(voPatientJourneyTarget.getPathwayJourney().getPatient());
			
			voEvent.setPatientTarget(voPatientJourneyTarget);
			if(voPatientJourneyTarget.getPathwayJourney().getPathwayIsNotNull())
				voEvent.setSpecialty(voPatientJourneyTarget.getPathwayJourney().getPathway().getSpecialty());
		}
	}
	else
	{
		//called from Booking Screen
		voEvent.setJourney(voJourney);
		voEvent.setPatient(voJourney.getPatient());
		voEvent.setPatientTarget( getPatientTarget(event, voJourney));
		if(voJourney.getPathwayIsNotNull())
			voEvent.setSpecialty(voJourney.getPathway().getSpecialty());
	}

	HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class);
	return impl.instantiatePatientEvent(voEvent);
}
 
Example 16
Project: openMAXIMS   File: ClinicListImpl.java   View source code 5 votes vote down vote up
private PatientJourneyTargetRefVo getPatientTarget(Event event, PatientJourneyVo voJourney)
{
	String hql = "select pjt from PatientJourneyTarget as pjt left join pjt.pathwayTarget as pt left join pt.target as target1 left join pjt.pathwayJourney as pj, EventTarget as et left join et.target as target2 left join et.event as event where " +
	"(pj.id = :idJourney and event.id = :idEvent)";
	
	List pjts = getDomainFactory().find(hql, new String[]{"idJourney","idEvent"}, new Object[]{event.getId(), voJourney.getID_PatientPathwayJourney()});
	if(pjts != null && pjts.size() > 0)
		PatientJourneyTargetVoAssembler.create((PatientJourneyTarget) pjts.get(0));

	return null;
}
 
Example 17
Project: openMAXIMS   File: SessionAdminImpl.java   View source code 5 votes vote down vote up
public PatientEventVo createAndSaveEvent(Event event, Booking_Appointment doAppt, PatientJourneyVo voJourney) throws DomainInterfaceException, StaleObjectException
{
	//WDEV-19772 
	if (event == null)
		return null;
	
	PatientEventVo voEvent = new PatientEventVo();
	voEvent.setEventDateTime(new DateTime());
	voEvent.setEvent(new EventRefVo(event.getId(), event.getVersion()));
	voEvent.setScheduledDate(new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())));

	// called from this class
	if (voJourney == null)
	{
		PatientJourneyTargetVo voPatientJourneyTarget = PatientJourneyTargetVoAssembler.create(getFirstPathwayEvent(doAppt.getPathwayEvents()));
		if (voPatientJourneyTarget != null)
		{
			voEvent.setJourney(voPatientJourneyTarget.getPathwayJourney());
			if (voPatientJourneyTarget.getPathwayJourneyIsNotNull())
				voEvent.setPatient(voPatientJourneyTarget.getPathwayJourney().getPatient());

			voEvent.setPatientTarget(voPatientJourneyTarget);
			if (voPatientJourneyTarget.getPathwayJourney().getPathwayIsNotNull())
				voEvent.setSpecialty(voPatientJourneyTarget.getPathwayJourney().getPathway().getSpecialty());
		}
	}
	else
	{
		// called from Booking Screen
		voEvent.setJourney(voJourney);
		voEvent.setPatient(voJourney.getPatient());
		voEvent.setPatientTarget(getPatientTarget(event, voJourney));
		if (voJourney.getPathwayIsNotNull())
			voEvent.setSpecialty(voJourney.getPathway().getSpecialty());
	}

	HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class);
	return impl.instantiatePatientEvent(voEvent);
}
 
Example 18
Project: openMAXIMS   File: SessionAdminImpl.java   View source code 5 votes vote down vote up
private PatientJourneyTargetRefVo getPatientTarget(Event event, PatientJourneyVo voJourney)
{
	String hql = "select pjt from PatientJourneyTarget as pjt left join pjt.pathwayTarget as pt left join pt.target as target1 left join pjt.pathwayJourney as pj, EventTarget as et left join et.target as target2 left join et.event as event where " + "(pj.id = :idJourney and event.id = :idEvent)";

	List<?> pjts = getDomainFactory().find(hql, new String[]{"idJourney", "idEvent"}, new Object[]{event.getId(), voJourney.getID_PatientPathwayJourney()});
	if (pjts != null && pjts.size() > 0)
		PatientJourneyTargetVoAssembler.create((PatientJourneyTarget) pjts.get(0));

	return null;
}
 
Example 19
Project: openMAXIMS   File: CreateNewPathwayImpl.java   View source code 5 votes vote down vote up
public PatientJourneyVo getPatientJourney(PatientPathwayJourneyRefVo journey)
{
	if (journey.getID_PatientPathwayJourney() == null)
		throw new CodingRuntimeException("No id provided for PatientJourney in method getPatientJourney");

	return PatientJourneyVoAssembler.create((PatientPathwayJourney) getDomainFactory().getDomainObject(journey));
}
 
Example 20
Project: openMAXIMS   File: PatientJourneyCommentImpl.java   View source code 5 votes vote down vote up
public PatientJourneyVo save(PatientJourneyInterfaceVo recordVo, PathwayLiteVo pathway, Date nextValidationDate,PatientJourneyCommentVo commentVo, Boolean validationMode, Date previousNextValidationDate) throws DomainInterfaceException,	StaleObjectException
{
	if (recordVo == null)
		throw new CodingRuntimeException("The PatientJourneyInterfaceVo argument is null.Cannot update a null patient journey");
	if (pathway == null)
		throw new CodingRuntimeException("The PathwayLiteVo argument is null.Cannot save a null pathway argument for the patient journey.");
	if (commentVo == null)
		throw new CodingRuntimeException("The PatientJourneyCommentVo argument is null.Cannot commit.");
	if (!commentVo.isValidated())
		throw new CodingRuntimeException("The PatientJourneyCommentVo argument is not validated.Cannot commit.");
	
	PatientJourneyVo journeyVo = getJourney(recordVo);
	
	if (journeyVo.getLinkedComments() == null)
		journeyVo.setLinkedComments(new PatientJourneyCommentVoCollection());
	
	journeyVo.getLinkedComments().add(commentVo);
	journeyVo.setNextValidationDate(nextValidationDate);
	
	if (Boolean.TRUE.equals(validationMode) && previousNextValidationDate != null) //WDEV-19604 
	{
		journeyVo.setLastValidationDate(previousNextValidationDate);
	}

	ims.pathways.domain.HL7PathwayIf impl = (ims.pathways.domain.HL7PathwayIf ) getDomainImpl(HL7PathwayIfImpl.class);
	
	return impl.updatePatientJourney(journeyVo, pathway);
}
 
Example 21
Project: openMAXIMS   File: PatientJourneyCommentImpl.java   View source code 5 votes vote down vote up
public PatientJourneyVo getJourney(PatientPathwayJourneyRefVo refVo)
{
	if (refVo == null)
		throw new CodingRuntimeException("Cannot retrieve argument for a null PatientPathwayJourneyRefVo argument.");

	return PatientJourneyVoAssembler.create((PatientPathwayJourney) getDomainFactory().getDomainObject(PatientPathwayJourney.class, refVo.getID_PatientPathwayJourney()));
}
 
Example 22
Project: openMAXIMS   File: ReferralTriageImpl.java   View source code 5 votes vote down vote up
private PatientJourneyVo getPatientJourney(CatsReferralRefVo catsReferral)
{
	if(catsReferral == null || catsReferral.getID_CatsReferral() == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	CatsReferral doCatsReferral = (CatsReferral) factory.getDomainObject(CatsReferral.class, catsReferral.getID_CatsReferral());
	
	return PatientJourneyVoAssembler.create(doCatsReferral.getJourney());
}
 
Example 23
Project: openMAXIMS   File: ReferralWizardImpl.java   View source code 5 votes vote down vote up
private PatientJourneyVo getPatientJourney(CatsReferralRefVo catsReferral)
{
	if(catsReferral == null || catsReferral.getID_CatsReferral() == null)
		return null;
	
	DomainFactory factory = getDomainFactory();
	CatsReferral doCatsReferral = (CatsReferral) factory.getDomainObject(CatsReferral.class, catsReferral.getID_CatsReferral());
	
	return PatientJourneyVoAssembler.create(doCatsReferral.getJourney());
}
 
Example 24
Project: openMAXIMS   File: ClinicListImpl.java   View source code 5 votes vote down vote up
public PatientEventVo createAndSaveEvent(Event event, Booking_Appointment doAppt, PatientJourneyVo voJourney) throws DomainInterfaceException, StaleObjectException
{
	PatientEventVo voEvent = new PatientEventVo();
	voEvent.setEventDateTime(new DateTime());
	voEvent.setEvent(new EventRefVo(event.getId(),event.getVersion()));
	voEvent.setScheduledDate(new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())));
	
	//called from this class
	if(voJourney == null)
	{
		PatientJourneyTargetVo voPatientJourneyTarget =  PatientJourneyTargetVoAssembler.create(getFirstPathwayEvent(doAppt.getPathwayEvents()));
		if(voPatientJourneyTarget != null)
		{
			voEvent.setJourney(voPatientJourneyTarget.getPathwayJourney());
			if(voPatientJourneyTarget.getPathwayJourneyIsNotNull())
				voEvent.setPatient(voPatientJourneyTarget.getPathwayJourney().getPatient());
			
			voEvent.setPatientTarget(voPatientJourneyTarget);
			if(voPatientJourneyTarget.getPathwayJourney().getPathwayIsNotNull())
				voEvent.setSpecialty(voPatientJourneyTarget.getPathwayJourney().getPathway().getSpecialty());
		}
	}
	else
	{
		//called from Booking Screen
		voEvent.setJourney(voJourney);
		voEvent.setPatient(voJourney.getPatient());
		voEvent.setPatientTarget( getPatientTarget(event, voJourney));
		if(voJourney.getPathwayIsNotNull())
			voEvent.setSpecialty(voJourney.getPathway().getSpecialty());
	}

	HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class);
	return impl.instantiatePatientEvent(voEvent);
}
 
Example 25
Project: openMAXIMS   File: ClinicListImpl.java   View source code 5 votes vote down vote up
private PatientJourneyTargetRefVo getPatientTarget(Event event, PatientJourneyVo voJourney)
{
	String hql = "select pjt from PatientJourneyTarget as pjt left join pjt.pathwayTarget as pt left join pt.target as target1 left join pjt.pathwayJourney as pj, EventTarget as et left join et.target as target2 left join et.event as event where " +
	"(pj.id = :idJourney and event.id = :idEvent)";
	
	List pjts = getDomainFactory().find(hql, new String[]{"idJourney","idEvent"}, new Object[]{event.getId(), voJourney.getID_PatientPathwayJourney()});
	if(pjts != null && pjts.size() > 0)
		PatientJourneyTargetVoAssembler.create((PatientJourneyTarget) pjts.get(0));

	return null;
}
 
Example 26
Project: openMAXIMS   File: SessionAdminImpl.java   View source code 5 votes vote down vote up
public PatientEventVo createAndSaveEvent(Event event, Booking_Appointment doAppt, PatientJourneyVo voJourney) throws DomainInterfaceException, StaleObjectException
{
	PatientEventVo voEvent = new PatientEventVo();
	voEvent.setEventDateTime(new DateTime());
	voEvent.setEvent(new EventRefVo(event.getId(), event.getVersion()));
	voEvent.setScheduledDate(new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())));

	// called from this class
	if (voJourney == null)
	{
		PatientJourneyTargetVo voPatientJourneyTarget = PatientJourneyTargetVoAssembler.create(getFirstPathwayEvent(doAppt.getPathwayEvents()));
		if (voPatientJourneyTarget != null)
		{
			voEvent.setJourney(voPatientJourneyTarget.getPathwayJourney());
			if (voPatientJourneyTarget.getPathwayJourneyIsNotNull())
				voEvent.setPatient(voPatientJourneyTarget.getPathwayJourney().getPatient());

			voEvent.setPatientTarget(voPatientJourneyTarget);
			if (voPatientJourneyTarget.getPathwayJourney().getPathwayIsNotNull())
				voEvent.setSpecialty(voPatientJourneyTarget.getPathwayJourney().getPathway().getSpecialty());
		}
	}
	else
	{
		// called from Booking Screen
		voEvent.setJourney(voJourney);
		voEvent.setPatient(voJourney.getPatient());
		voEvent.setPatientTarget(getPatientTarget(event, voJourney));
		if (voJourney.getPathwayIsNotNull())
			voEvent.setSpecialty(voJourney.getPathway().getSpecialty());
	}

	HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class);
	return impl.instantiatePatientEvent(voEvent);
}
 
Example 27
Project: openMAXIMS   File: SessionAdminImpl.java   View source code 5 votes vote down vote up
private PatientJourneyTargetRefVo getPatientTarget(Event event, PatientJourneyVo voJourney)
{
	String hql = "select pjt from PatientJourneyTarget as pjt left join pjt.pathwayTarget as pt left join pt.target as target1 left join pjt.pathwayJourney as pj, EventTarget as et left join et.target as target2 left join et.event as event where " + "(pj.id = :idJourney and event.id = :idEvent)";

	List<?> pjts = getDomainFactory().find(hql, new String[]{"idJourney", "idEvent"}, new Object[]{event.getId(), voJourney.getID_PatientPathwayJourney()});
	if (pjts != null && pjts.size() > 0)
		PatientJourneyTargetVoAssembler.create((PatientJourneyTarget) pjts.get(0));

	return null;
}
 
Example 28
Project: openMAXIMS   File: CreateNewPathwayImpl.java   View source code 5 votes vote down vote up
public PatientJourneyVo getPatientJourney(PatientPathwayJourneyRefVo journey)
{
	if (journey.getID_PatientPathwayJourney() == null)
		throw new CodingRuntimeException("No id provided for PatientJourney in method getPatientJourney");

	return PatientJourneyVoAssembler.create((PatientPathwayJourney) getDomainFactory().getDomainObject(journey));
}
 
Example 29
Project: openmaxims-linux   File: ClinicListImpl.java   View source code 5 votes vote down vote up
public PatientEventVo createAndSaveEvent(Event event, Booking_Appointment doAppt, PatientJourneyVo voJourney) throws DomainInterfaceException, StaleObjectException
{
	PatientEventVo voEvent = new PatientEventVo();
	voEvent.setEventDateTime(new DateTime());
	voEvent.setEvent(new EventRefVo(event.getId(),event.getVersion()));
	voEvent.setScheduledDate(new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())));
	
	//called from this class
	if(voJourney == null)
	{
		PatientJourneyTargetVo voPatientJourneyTarget =  PatientJourneyTargetVoAssembler.create(getFirstPathwayEvent(doAppt.getPathwayEvents()));
		if(voPatientJourneyTarget != null)
		{
			voEvent.setJourney(voPatientJourneyTarget.getPathwayJourney());
			if(voPatientJourneyTarget.getPathwayJourneyIsNotNull())
				voEvent.setPatient(voPatientJourneyTarget.getPathwayJourney().getPatient());
			
			voEvent.setPatientTarget(voPatientJourneyTarget);
			if(voPatientJourneyTarget.getPathwayJourney().getPathwayIsNotNull())
				voEvent.setSpecialty(voPatientJourneyTarget.getPathwayJourney().getPathway().getSpecialty());
		}
	}
	else
	{
		//called from Booking Screen
		voEvent.setJourney(voJourney);
		voEvent.setPatient(voJourney.getPatient());
		voEvent.setPatientTarget( getPatientTarget(event, voJourney));
		if(voJourney.getPathwayIsNotNull())
			voEvent.setSpecialty(voJourney.getPathway().getSpecialty());
	}

	HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class);
	return impl.instantiatePatientEvent(voEvent);
}
 
Example 30
Project: openmaxims-linux   File: ClinicListImpl.java   View source code 5 votes vote down vote up
private PatientJourneyTargetRefVo getPatientTarget(Event event, PatientJourneyVo voJourney)
{
	String hql = "select pjt from PatientJourneyTarget as pjt left join pjt.pathwayTarget as pt left join pt.target as target1 left join pjt.pathwayJourney as pj, EventTarget as et left join et.target as target2 left join et.event as event where " +
	"(pj.id = :idJourney and event.id = :idEvent)";
	
	List pjts = getDomainFactory().find(hql, new String[]{"idJourney","idEvent"}, new Object[]{event.getId(), voJourney.getID_PatientPathwayJourney()});
	if(pjts != null && pjts.size() > 0)
		PatientJourneyTargetVoAssembler.create((PatientJourneyTarget) pjts.get(0));

	return null;
}
 
Example 31
Project: openmaxims-linux   File: SessionAdminImpl.java   View source code 5 votes vote down vote up
private PatientJourneyTargetRefVo getPatientTarget(Event event, PatientJourneyVo voJourney)
{
	String hql = "select pjt from PatientJourneyTarget as pjt left join pjt.pathwayTarget as pt left join pt.target as target1 left join pjt.pathwayJourney as pj, EventTarget as et left join et.target as target2 left join et.event as event where " + "(pj.id = :idJourney and event.id = :idEvent)";

	List<?> pjts = getDomainFactory().find(hql, new String[]{"idJourney", "idEvent"}, new Object[]{event.getId(), voJourney.getID_PatientPathwayJourney()});
	if (pjts != null && pjts.size() > 0)
		PatientJourneyTargetVoAssembler.create((PatientJourneyTarget) pjts.get(0));

	return null;
}
 
Example 32
Project: openmaxims-linux   File: CreateNewPathwayImpl.java   View source code 5 votes vote down vote up
public PatientJourneyVo getPatientJourney(PatientPathwayJourneyRefVo journey)
{
	if (journey.getID_PatientPathwayJourney() == null)
		throw new CodingRuntimeException("No id provided for PatientJourney in method getPatientJourney");

	return PatientJourneyVoAssembler.create((PatientPathwayJourney) getDomainFactory().getDomainObject(journey));
}
 
Example 33
Project: AvoinApotti   File: HL7PathwayIfImpl.java   View source code 4 votes vote down vote up
public PatientJourneyVo getPatientJourney(ReferralLiteVo referral) throws DomainInterfaceException
{
	return PatientJourneyVoAssembler.create(PatientPathwayJourney.getPatientPathwayJourneyFromExtReferralKey(getDomainFactory(), referral.getExtReferralKey()));
}
 
Example 34
Project: AvoinApotti   File: HL7PathwayIfImpl.java   View source code 4 votes vote down vote up
public PatientJourneyVo updatePatientJourney(PatientJourneyVo patientJourney, PathwayLiteVo pathway) throws DomainInterfaceException, StaleObjectException
{
	CreateNewPathway newImpl = (CreateNewPathway) getDomainImpl(CreateNewPathwayImpl.class);
	return newImpl.updatePatientJourney(patientJourney, pathway, null);
	
}
 
Example 35
Project: openMAXIMS   File: HL7PathwayIfImpl.java   View source code 4 votes vote down vote up
public PatientJourneyVo getPatientJourney(ReferralLiteVo referral) throws DomainInterfaceException
{
	return PatientJourneyVoAssembler.create(PatientPathwayJourney.getPatientPathwayJourneyFromExtReferralKey(getDomainFactory(), referral.getExtReferralKey()));
}
 
Example 36
Project: openMAXIMS   File: HL7PathwayIfImpl.java   View source code 4 votes vote down vote up
public PatientJourneyVo updatePatientJourney(PatientJourneyVo patientJourney, PathwayLiteVo pathway) throws DomainInterfaceException, StaleObjectException
{
	CreateNewPathway newImpl = (CreateNewPathway) getDomainImpl(CreateNewPathwayImpl.class);
	return newImpl.updatePatientJourney(patientJourney, pathway, null);
	
}
 
Example 37
Project: openMAXIMS   File: ClinicListImpl.java   View source code 4 votes vote down vote up
private void createRttStatusAndEvent(CatsReferral doCatsReferral, Booking_Appointment doAppt, Boolean isFirstApptActivityforDNA, Boolean isUndoArrival, java.util.Date eventDateTime) throws DomainInterfaceException, StaleObjectException //WDEV-18421 
{
	if (doCatsReferral == null || doCatsReferral.getJourney() == null)
		return;	
	
	DomainFactory factory = getDomainFactory();
	PatientPathwayJourney journeyDO = doCatsReferral.getJourney();
	boolean isRTTApplicable = ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue() && Boolean.TRUE.equals(doCatsReferral.isRTTClockImpact());
	
	PathwayRTTStatus rttStatus = null;
	PatientEventVo savedPatEv = null;
	if (isFirstApptActivityforDNA && isRTTApplicable)
	{			
		rttStatus = createPathwayRTTStatus(doCatsReferral, true, eventDateTime);
		if(rttStatus != null)
		{				
			doCatsReferral.setCurrentRTTStatus(rttStatus);
			savedPatEv = createPatientEvent (doAppt, doCatsReferral, HardCodedEvents.APPOINTMENTDNA);
		}
	}
	
	//WDEV-19772 
	if(ConfigFlag.DOM.PATHWAY_ENTITY_EVENT_FUNCTIONALITY.getValue() && doAppt.getActivity().isFirstAppointment())
	{
		if(doAppt.getApptStatus() != null && doAppt.getApptStatus().equals(getDomLookup(Status_Reason.DNA)) && savedPatEv == null )
		{ 
			PatientJourneyVo patJ = PatientJourneyVoAssembler.create(doCatsReferral.getJourney());					
			if (patJ == null)
				return; 									
			savedPatEv = createPatientEvent (doAppt, doCatsReferral, HardCodedEvents.APPOINTMENTDNA);				
		}					
		else if(doAppt.getApptStatus() != null && doAppt.getApptStatus().equals(getDomLookup(Status_Reason.ARRIVAL)))
		{
			savedPatEv = createPatientEvent(doAppt, doCatsReferral, HardCodedEvents.APPOINTMENTATTENDED);
		}					
		else if(doAppt.getApptStatus() != null && doAppt.getApptStatus().equals(getDomLookup(Status_Reason.BOOKED)) && isUndoArrival)
		{
			savedPatEv = createPatientEvent(doAppt, doCatsReferral, HardCodedEvents.APPOINTMENTUNARRIVED);
		}
	}
	
	if (isFirstApptActivityforDNA && isRTTApplicable)
	{
		DateTime apptDateTime = null;
		Status_Reason status_Reason = null;
		rttStatus = createPathwayRTTStatus(doCatsReferral, false, eventDateTime);
		if (savedPatEv == null)
		{
			if(doAppt!=null )
			{
				status_Reason =(doAppt.getApptStatus()!= null ? LookupHelper.getStatus_ReasonInstance(getLookupService(), doAppt.getApptStatus().getId()):null);
				apptDateTime = new DateTime(new Date( doAppt.getAppointmentDate()),new Time(doAppt.getApptStartTime()));
			}
			savedPatEv = instantiatePatientEvent(doCatsReferral, apptDateTime,status_Reason);
		}
	}

	if (savedPatEv != null)
	{
		doAppt.getPathwayEvents().add(PatientEventVoAssembler.extractPatientEvent(factory, savedPatEv));		
		factory.save(doAppt);
	}
	
	if (rttStatus != null)
	{
		PatientPathwayJourney refreshedJouney = (PatientPathwayJourney) factory.getDomainObject(PatientPathwayJourney.class, journeyDO.getId());
		refreshedJouney.getCurrentClock().setCurrentRTTStatus(rttStatus);
		refreshedJouney.getCurrentClock().getRTTStatusHistory().add(rttStatus);		
		factory.save(refreshedJouney);
	}
}
 
Example 38
Project: openMAXIMS   File: HL7PathwayIfImpl.java   View source code 4 votes vote down vote up
public PatientJourneyVo getPatientJourney(ReferralLiteVo referral) throws DomainInterfaceException
{
	return PatientJourneyVoAssembler.create(PatientPathwayJourney.getPatientPathwayJourneyFromExtReferralKey(getDomainFactory(), referral.getExtReferralKey()));
}
 
Example 39
Project: openMAXIMS   File: HL7PathwayIfImpl.java   View source code 4 votes vote down vote up
public PatientJourneyVo updatePatientJourney(PatientJourneyVo patientJourney, PathwayLiteVo pathway) throws DomainInterfaceException, StaleObjectException
{
	CreateNewPathway newImpl = (CreateNewPathway) getDomainImpl(CreateNewPathwayImpl.class);
	return newImpl.updatePatientJourney(patientJourney, pathway, null);
	
}
 
Example 40
Project: openmaxims-linux   File: HL7PathwayIfImpl.java   View source code 4 votes vote down vote up
public PatientJourneyVo getPatientJourney(ReferralLiteVo referral) throws DomainInterfaceException
{
	return PatientJourneyVoAssembler.create(PatientPathwayJourney.getPatientPathwayJourneyFromExtReferralKey(getDomainFactory(), referral.getExtReferralKey()));
}