private void createPatientEvent(CatsReferral doCatsReferral, EventLiteVo hardCodedEvent) throws StaleObjectException { PatientPathwayJourney patientJBo = doCatsReferral != null ? doCatsReferral.getJourney() : null; if (patientJBo != null && hardCodedEvent != null) { PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCatsReferral.getPatient())); patEvent.setEvent(hardCodedEvent); patEvent.setEventDateTime(patientJBo.getCurrentClock() != null && patientJBo.getCurrentClock().getCurrentPause() != null && patientJBo.getCurrentClock().getCurrentPause().getPauseStop() != null ? new DateTime( patientJBo.getCurrentClock().getCurrentPause().getPauseStop()) : new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(patientJBo)); HL7PathwayIf implPath = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class); try { implPath.instantiatePatientEvent(patEvent); } catch (DomainInterfaceException e) {throw new DomainRuntimeException("Domain Error occured in save Event " + e.getMessage(), e);} } }
private void createPatientEvent(CatsReferral doCatsReferral, EventLiteVo hardCodedEvent, java.util.Date erodStartDate) throws StaleObjectException { PatientPathwayJourney patientJBo = doCatsReferral != null ? doCatsReferral.getJourney() : null; if (patientJBo != null && hardCodedEvent != null) { PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCatsReferral.getPatient())); patEvent.setEvent(hardCodedEvent); patEvent.setEventDateTime(erodStartDate != null ? new DateTime(erodStartDate) : new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(patientJBo)); HL7PathwayIf implPath = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class); try { implPath.instantiatePatientEvent(patEvent); } catch (DomainInterfaceException e) { throw new DomainRuntimeException("Domain Error occured in save Event " + e.getMessage(), e); } } }
private PatientEventVo createEvent(Booking_Appointment doAppt, CatsReferral doCatsReferral, EventLiteVo event) throws DomainInterfaceException, StaleObjectException { if(event == null) return null; PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCatsReferral.getPatient())); patEvent.setEvent(event); patEvent.setEventDateTime(new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(doCatsReferral.getJourney())); patEvent.setScheduledDate(doAppt != null ? new DateTime(new Date(doAppt.getAppointmentDate()), new Time(doAppt.getApptStartTime())) : null); HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class); // WDEV-23784 pass referral to the method if we have it if (doCatsReferral != null) return impl.instantiatePatientEvent(patEvent, new CatsReferralRefVo(doCatsReferral.getId(), doCatsReferral.getVersion())); else return impl.instantiatePatientEvent(patEvent); }
private void createPatientEvent(CatsReferral doCatsReferral, EventLiteVo hardCodedEvent, Date erodStartDate) throws StaleObjectException, DomainInterfaceException { PatientPathwayJourney patientJBo = doCatsReferral != null ? doCatsReferral.getJourney() : null; if (patientJBo != null && hardCodedEvent != null) { PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo) PatientListVoAssembler.create(doCatsReferral.getPatient())); patEvent.setEvent(hardCodedEvent); patEvent.setEventDateTime(erodStartDate != null ? new DateTime(erodStartDate) : new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(patientJBo)); HL7PathwayIf implPath = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class); implPath.instantiatePatientEvent(patEvent); } }
private void createPatientEvent(CatsReferral doCatsReferral, EventLiteVo hardCodedEvent, java.util.Date erodStartDate) throws StaleObjectException { PatientPathwayJourney patientJBo = doCatsReferral != null ? doCatsReferral.getJourney() : null; if (patientJBo != null && hardCodedEvent != null) { PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCatsReferral.getPatient())); patEvent.setEvent(hardCodedEvent); patEvent.setEventDateTime(erodStartDate != null ? new DateTime(erodStartDate) : new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(patientJBo)); HL7PathwayIf implPath = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class); try { implPath.instantiatePatientEvent(patEvent); } catch (DomainInterfaceException e) {throw new DomainRuntimeException("Domain Error occured in save Event " + e.getMessage(), e);} } }
private void instantiatePatientEvent(CatsReferral doCats, PathwayRTTStatus pathRTTStatDO) throws StaleObjectException, DomainInterfaceException //WDEV-18325 { if (!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue()) return; RTTStatusEventMapVo rttEventMap = null; if (pathRTTStatDO != null) { rttEventMap = getRTTStatusEventMap(pathRTTStatDO.getRTTStatus()); } if (rttEventMap == null || rttEventMap.getEvent() == null) return; PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo) PatientListVoAssembler.create(doCats.getJourney().getPatient())); patEvent.setEvent(rttEventMap.getEvent()); patEvent.setEventDateTime(new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(doCats.getJourney())); try { Class<?> implClass = Class.forName("ims.pathways.domain.impl.HL7PathwayIfImpl"); ims.core.helper.IPathwayPatientEventHelper pathwayImp = (ims.core.helper.IPathwayPatientEventHelper) getDomainImpl(implClass); pathwayImp.instantiatePatientEvent(patEvent); } catch (ClassNotFoundException e) { // You'll have to manage this -log the exception in system log please - but it should be fine createSystemLogEntry(SystemLogType.APPLICATION, SystemLogLevel.ERROR, "Class Cast exception has occured.Please check log file for: " + new DateTime().toString(DateTimeFormat.STANDARD, true) + " timestamp."); } }
private void instantiatePatientEvent(CatsReferral doCats) throws StaleObjectException, DomainInterfaceException //WDEV-18325 { if (!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue()) return; if(doCats == null || doCats.getJourney() == null || doCats.getJourney().getCurrentClock() == null) return; RTTStatusEventMapVo rttEventMap = null; if (doCats.getJourney().getCurrentClock().getCurrentRTTStatus() != null) { rttEventMap = getRTTStatusEventMap(doCats.getJourney().getCurrentClock().getCurrentRTTStatus().getRTTStatus()); } if (rttEventMap == null || rttEventMap.getEvent() == null) return; PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCats.getPatient())); patEvent.setEvent(rttEventMap.getEvent()); patEvent.setEventDateTime(new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(doCats.getJourney())); HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(ims.pathways.domain.impl.HL7PathwayIfImpl.class); impl.instantiatePatientEvent(patEvent); }
public PatientListVo getPatientRef(CatsReferralRefVo catsReferralRef) { DomainFactory factory = getDomainFactory(); if (catsReferralRef != null && catsReferralRef.getID_CatsReferralIsNotNull()) { java.util.List list = factory.find("select patient from CatsReferral cats where cats.id = :catsID", new String[]{"catsID"}, new Object[]{catsReferralRef.getID_CatsReferral()}); if (list != null && list.size() >0) return PatientListVoAssembler.create((Patient)list.get(0)); else return null; } return null; }
private void instantiatePatientEvent(CatsReferral doCats,DateTime apptDateTime, Status_Reason apptStatus) throws StaleObjectException, DomainInterfaceException //WDEV-18325 { if (!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue()) return; if(doCats == null || doCats.getJourney() == null || doCats.getJourney().getCurrentClock() == null) return; RTTStatusEventMapVo rttEventMap = null; if (doCats.getJourney().getCurrentClock().getCurrentRTTStatus() != null) { rttEventMap = getRTTStatusEventMap(doCats.getJourney().getCurrentClock().getCurrentRTTStatus().getRTTStatus()); } if (rttEventMap == null || rttEventMap.getEvent() == null) return; PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCats.getPatient())); patEvent.setEvent(rttEventMap.getEvent()); patEvent.setEventDateTime(getDNAEventDateTime(apptDateTime, apptStatus) != null ? getDNAEventDateTime(apptDateTime, apptStatus):new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(doCats.getJourney())); HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(ims.pathways.domain.impl.HL7PathwayIfImpl.class); impl.instantiatePatientEvent(patEvent); }
private PatientEventVo createPatientEvent(Booking_Appointment doBookAppt, EventLiteVo hardCodedEvent) throws StaleObjectException { CatsReferral catsReferral = getCatsReferralforAppt(doBookAppt); PatientPathwayJourney patientJBo = catsReferral != null ? catsReferral.getJourney() : null; PatientEventVo savedPatEv = null; if (patientJBo != null && hardCodedEvent != null) { DateTime arrivalDateTime = getArrivalDateTime(doBookAppt); PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(catsReferral.getPatient())); patEvent.setEvent(hardCodedEvent); patEvent.setEventDateTime(arrivalDateTime!= null ? arrivalDateTime : new DateTime() );//WDEV-20603- if is not Arrival events the method will return actual date/time patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(patientJBo)); HL7PathwayIf implPath = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class); try { savedPatEv = implPath.instantiatePatientEvent(patEvent); } catch (DomainInterfaceException e) { throw new DomainRuntimeException("Domain Error occured in save Event " + e.getMessage(), e);} } return savedPatEv; }
public PatientListVo getPatientRef(CatsReferralRefVo catsReferralRef) { DomainFactory factory = getDomainFactory(); if (catsReferralRef != null && catsReferralRef.getID_CatsReferralIsNotNull()) { java.util.List list = factory.find("select patient from CatsReferral cats where cats.id = :catsID", new String[] { "catsID" }, new Object[] { catsReferralRef.getID_CatsReferral() }); if (list != null && list.size() > 0) return PatientListVoAssembler.create((Patient) list.get(0)); else return null; } return null; }
private PatientEventVo createPatientEvent(Booking_Appointment doBookAppt, CatsReferral catsReferral, HardCodedEvents event) throws StaleObjectException { PatientPathwayJourney patientJBo = catsReferral != null ? catsReferral.getJourney() : null; EventLiteVo hardCodedEvent = getHardCodedEvent(event.getID()); PatientEventVo savedPatEv = null; DateTime apptDateTime = null; Status_Reason status_Reason = null; if (patientJBo != null && patientJBo.getId() != null && hardCodedEvent != null) { if(doBookAppt!=null ) { status_Reason =(doBookAppt.getApptStatus()!= null ? LookupHelper.getStatus_ReasonInstance(getLookupService(), doBookAppt.getApptStatus().getId()):null); apptDateTime = new DateTime(new Date( doBookAppt.getAppointmentDate()),new Time(doBookAppt.getApptStartTime())); } PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(catsReferral.getPatient())); patEvent.setEvent(hardCodedEvent); patEvent.setEventDateTime(getDNAEventDateTime(apptDateTime, status_Reason) != null ? getDNAEventDateTime(apptDateTime,status_Reason ):new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(patientJBo)); HL7PathwayIf implPath = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class); try { savedPatEv = implPath.instantiatePatientEvent(patEvent); } catch (DomainInterfaceException e) { throw new DomainRuntimeException("Domain Error occured in save Event " + e.getMessage(), e);} } return savedPatEv; }
private PatientEventVo instantiatePatientEvent(CatsReferral doCats, DateTime apptDateTime, Status_Reason apptStatus) throws StaleObjectException, DomainInterfaceException //WDEV-18325 { if (!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue()) return null; if(doCats == null || doCats.getJourney() == null || doCats.getJourney().getCurrentClock() == null) return null; RTTStatusEventMapVo rttEventMap = null; if (doCats.getJourney().getCurrentClock().getCurrentRTTStatus() != null) { rttEventMap = getRTTStatusEventMap(doCats.getJourney().getCurrentClock().getCurrentRTTStatus().getRTTStatus()); } if (rttEventMap == null || rttEventMap.getEvent() == null) return null; PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCats.getPatient())); patEvent.setEvent(rttEventMap.getEvent()); patEvent.setEventDateTime(getDNAEventDateTime(apptDateTime, apptStatus) != null ? getDNAEventDateTime(apptDateTime, apptStatus):new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(doCats.getJourney())); HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(ims.pathways.domain.impl.HL7PathwayIfImpl.class); return impl.instantiatePatientEvent(patEvent); }
private PatientEventVo createPatientEvent(CatsReferralListVo voCatsReferral, EventLiteVo hardCodedEvent,DateTime apptDateTime, Status_Reason apptStatus ) throws StaleObjectException { CatsReferral catsReferral = CatsReferralListVoAssembler.extractCatsReferral(getDomainFactory(), voCatsReferral); PatientPathwayJourney patientJBo = catsReferral != null ? catsReferral.getJourney() : null; PatientEventVo savedPatEv = null; if (patientJBo != null && hardCodedEvent != null) { DateTime arrivalDateTime = getArrivalDateTime(apptDateTime, apptStatus); PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(catsReferral.getPatient())); patEvent.setEvent(hardCodedEvent); patEvent.setEventDateTime(HardCodedEvents.PATHWAYUNPAUSED.equals(hardCodedEvent) && patientJBo.getCurrentClock() != null && patientJBo.getCurrentClock().getCurrentPause() != null && patientJBo.getCurrentClock().getCurrentPause().getPauseStop() != null ? new DateTime( patientJBo.getCurrentClock().getCurrentPause().getPauseStop()) : arrivalDateTime!= null? arrivalDateTime: new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(patientJBo)); HL7PathwayIf implPath = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class); try { savedPatEv = implPath.instantiatePatientEvent(patEvent); } catch (DomainInterfaceException e) { throw new DomainRuntimeException("Domain Error occured in save Event " + e.getMessage(), e);} } return savedPatEv; }
private void instantiatePatientEvent(CatsReferral doCats, DateTime apptDateTime, Status_Reason apptStatus ) throws StaleObjectException, DomainInterfaceException //WDEV-18325 { if (!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue()) return; if(doCats == null || doCats.getJourney() == null || doCats.getJourney().getCurrentClock() == null) return; RTTStatusEventMapVo rttEventMap = null; if (doCats.getJourney().getCurrentClock().getCurrentRTTStatus() != null) { rttEventMap = getRTTStatusEventMap(doCats.getJourney().getCurrentClock().getCurrentRTTStatus().getRTTStatus()); } if (rttEventMap == null || rttEventMap.getEvent() == null) return; DateTime arrivalDateTime = getArrivalDateTime(apptDateTime, apptStatus); PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCats.getPatient())); patEvent.setEvent(rttEventMap.getEvent()); patEvent.setEventDateTime(arrivalDateTime!= null ? arrivalDateTime: null); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(doCats.getJourney())); HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(ims.pathways.domain.impl.HL7PathwayIfImpl.class); impl.instantiatePatientEvent(patEvent); }
private RTTStatusPoint updateRTTStatus(CatsReferral doCats) throws DomainInterfaceException, StaleObjectException { if(!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue()) return null; if(doCats == null) return null; if(doCats.isRTTClockImpact() == null || Boolean.FALSE.equals(doCats.isRTTClockImpact())) return null; PathwayRTTStatus rttStatus = createPathwayRTTStatus(doCats); doCats.setCurrentRTTStatus(rttStatus); RTTStatusEventMapVo rttMap = getRTTStatusEventMap(rttStatus.getRTTStatus()); if (rttMap != null && rttMap.getEvent() != null) { PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient(PatientListVoAssembler.create(doCats.getPatient())); patEvent.setEvent(rttMap.getEvent()); patEvent.setEventDateTime(new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(doCats.getJourney())); try { Class<?> implClass = Class.forName("ims.pathways.domain.impl.HL7PathwayIfImpl"); IPathwayPatientEventHelper pathwayImp = (IPathwayPatientEventHelper) getDomainImpl(implClass); pathwayImp.instantiatePatientEvent(patEvent); } catch (ClassNotFoundException e) { //Log the exception in system, should be fine e.printStackTrace(); } } return rttStatus.getRTTStatus(); }
private void createNewPathwayClock(CatsReferral doCatsReferral, Booking_Appointment doAppt) throws DomainInterfaceException, StaleObjectException //WDEV-18421 { if (doCatsReferral == null || doCatsReferral.getJourney() == null) return; PatientPathwayJourney journeyDO = doCatsReferral.getJourney(); PathwayClock currentClockDO = doCatsReferral.getJourney().getCurrentClock(); if (currentClockDO == null || (currentClockDO != null && currentClockDO.getStopDate() != null)) { int X = getNumberOfClocks(journeyDO.getClockHistory()); PathwayClock newClockDO = new PathwayClock (); newClockDO.setExtClockId("MAXIMS_" + X); newClockDO.setExtClockName("MaximsClock_" + X); newClockDO.setStartDate(doAppt.getAppointmentDate()); journeyDO.setCurrentClock(newClockDO); PathwayRTTStatus rttStatus = createPathwayRTTStatus(doCatsReferral); doCatsReferral.setCurrentRTTStatus(rttStatus); getDomainFactory().save(journeyDO); if(ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue() && rttStatus != null && Boolean.TRUE.equals(doCatsReferral.isRTTClockImpact())) { RTTStatusEventMapVo rttMap = getRTTStatusEventMap(rttStatus.getRTTStatus()); if(rttMap != null && rttMap.getEvent() != null) { PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient((PatientRefVo)PatientListVoAssembler.create(doCatsReferral.getPatient())); patEvent.setEvent(rttMap.getEvent()); patEvent.setEventDateTime(new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(doCatsReferral.getJourney())); HL7PathwayIf impl = (HL7PathwayIf) getDomainImpl(HL7PathwayIfImpl.class); impl.instantiatePatientEvent(patEvent); } } } }
private RTTStatusPoint updateRTTStatus(CatsReferral doCats, Date eventDateTime) throws DomainInterfaceException, StaleObjectException { if(!ConfigFlag.DOM.RTT_STATUS_POINT_FUNCTIONALITY.getValue()) return null; if(doCats == null) return null; if(doCats.isRTTClockImpact() == null || Boolean.FALSE.equals(doCats.isRTTClockImpact())) return null; PathwayRTTStatus rttStatus = createPathwayRTTStatus(doCats, eventDateTime); doCats.setCurrentRTTStatus(rttStatus); RTTStatusEventMapVo rttMap = getRTTStatusEventMap(rttStatus.getRTTStatus()); if (rttMap != null && rttMap.getEvent() != null) { PatientEventVo patEvent = new PatientEventVo(); patEvent.setPatient(PatientListVoAssembler.create(doCats.getPatient())); patEvent.setEvent(rttMap.getEvent()); patEvent.setEventDateTime(new DateTime()); patEvent.setEventStatus(EventStatus.ACTIVE); patEvent.setJourney(PatientJourneyVoAssembler.create(doCats.getJourney())); try { Class<?> implClass = Class.forName("ims.pathways.domain.impl.HL7PathwayIfImpl"); IPathwayPatientEventHelper pathwayImp = (IPathwayPatientEventHelper) getDomainImpl(implClass); pathwayImp.instantiatePatientEvent(patEvent); } catch (ClassNotFoundException e) { //Log the exception in system, should be fine e.printStackTrace(); } } return rttStatus.getRTTStatus(); }