public SeenByHCPVo getFirstSeenByHCP(CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get SeenByHCPVoCollection on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select allSeenBy from SeenByHCP as allSeenBy where (allSeenBy.attendance.id = :attID and allSeenBy.allocatedMedic is not null) order by allSeenBy.seenDateTime asc"); List<?> list = factory.find(hql.toString(), new String[] { "attID" }, new Object[] { careContextRef.getID_CareContext() }); if( list != null && list.size() > 0) { return SeenByHCPVoAssembler.create((SeenByHCP) list.get(0)); } return null; }
public ims.emergency.vo.SeenByHCPVoCollection getAllSeenByHCP(ims.core.admin.vo.CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get SeenByHCPVoCollection on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select allSeenBy from SeenByHCP as allSeenBy where allSeenBy.attendance.id = :attID order by allSeenBy.allocatedDateTime desc "); List<?> list = factory.find(hql.toString(), new String[] { "attID" }, new Object[] { careContextRef.getID_CareContext() }); return SeenByHCPVoAssembler.createSeenByHCPVoCollectionFromSeenByHCP(list); }
public SeenByHCPVo getUncompletedSeenByHCPCareContext(CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get SeenByHCPVoCollection on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select allSeenBy from SeenByHCP as allSeenBy where allSeenBy.attendance.id = :attID and allSeenBy.completedDateTime is null order by allSeenBy.allocatedDateTime desc "); List<?> list = factory.find(hql.toString(), new String[] { "attID" }, new Object[] { careContextRef.getID_CareContext() }); if (list!=null && list.size()>0) return SeenByHCPVoAssembler.create((SeenByHCP)list.get(0)); return null; }
public ims.emergency.vo.SeenByHCPVoCollection getAllSeenByHCP(ims.core.admin.vo.CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get SeenByHCPVoCollection on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select allSeenBy from SeenByHCP as allSeenBy where ( allSeenBy.attendance.id = :attID and allSeenBy.allocatedMedic is not null ) order by allSeenBy.allocatedDateTime desc "); List<?> list = factory.find(hql.toString(), new String[] { "attID" }, new Object[] { careContextRef.getID_CareContext() }); return SeenByHCPVoAssembler.createSeenByHCPVoCollectionFromSeenByHCP(list); }
public SeenByHCPVo getUncompletedSeenByHCPCareContext(CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get SeenByHCPVoCollection on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select allSeenBy from SeenByHCP as allSeenBy where allSeenBy.attendance.id = :attID and allSeenBy.allocatedMedic is not null and allSeenBy.completedDateTime is null order by allSeenBy.allocatedDateTime desc "); List<?> list = factory.find(hql.toString(), new String[] { "attID" }, new Object[] { careContextRef.getID_CareContext() }); if (list!=null && list.size()>0) return SeenByHCPVoAssembler.create((SeenByHCP)list.get(0)); return null; }
public ims.emergency.vo.SeenByHCPVoCollection getAllSeenByHCP(ims.core.admin.vo.CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get SeenByHCPVoCollection on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select allSeenBy from SeenByHCP as allSeenBy where (allSeenBy.attendance.id = :attID and allSeenBy.allocatedNurse is not null ) order by allSeenBy.allocatedDateTime desc "); List<?> list = factory.find(hql.toString(), new String[] { "attID" }, new Object[] { careContextRef.getID_CareContext() }); return SeenByHCPVoAssembler.createSeenByHCPVoCollectionFromSeenByHCP(list); }
public SeenByHCPVo getUncompletedSeenByHCPCareContext(CareContextRefVo careContextRef) { if (careContextRef == null || careContextRef.getID_CareContext() == null) { throw new CodingRuntimeException("Cannot get SeenByHCPVoCollection on null Id for CareContext "); } DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(); hql.append("select allSeenBy from SeenByHCP as allSeenBy where allSeenBy.attendance.id = :attID and allSeenBy.allocatedNurse is not null and allSeenBy.completedDateTime is null order by allSeenBy.allocatedDateTime desc "); List<?> list = factory.find(hql.toString(), new String[] { "attID" }, new Object[] { careContextRef.getID_CareContext() }); if (list!=null && list.size()>0) return SeenByHCPVoAssembler.create((SeenByHCP)list.get(0)); return null; }
public TrackingForTriageVo saveTracking(TrackingForTriageVo tracking, SeenByHCPVo seenByHCP) throws StaleObjectException //wdev-15930 //WDEV-16816 { if(tracking == null) throw new CodingRuntimeException("Cannot save a null Tracking record."); if(!tracking.isValidated()) throw new CodingRuntimeException("Tracking record is not validated."); DomainFactory factory = getDomainFactory(); //wdev-15930 //WDEV-16816 SeenByHCP doSeenBy = null; if( seenByHCP != null ) { doSeenBy = SeenByHCPVoAssembler.extractSeenByHCP(factory, seenByHCP); if( doSeenBy != null ) { factory.save(doSeenBy); } } //-------------wdev-15930------------ Tracking doTracking = TrackingForTriageVoAssembler.extractTracking(factory, tracking); if( doSeenBy != null ) //wdev-15930 //WDEV-16816 { doTracking.setSeenBy(doSeenBy); //WDEV-16816 } factory.save(doTracking); return TrackingForTriageVoAssembler.create(doTracking); }
public ims.emergency.vo.SeenByHCPVo getSeenByHCP(ims.emergency.vo.SeenByHCPRefVo seenByHCP) { if (seenByHCP == null || seenByHCP.getID_SeenByHCP() == null) { throw new CodingRuntimeException("Cannot get SeenByHCPVo on null Id "); } DomainFactory factory = getDomainFactory(); SeenByHCP domainSeenBy = (SeenByHCP) factory.getDomainObject(SeenByHCP.class, seenByHCP.getID_SeenByHCP()); return SeenByHCPVoAssembler.create(domainSeenBy); }
public AttendanceClinicalNotesVo save(AttendanceClinicalNotesVo attendanceClinicalNoteToSave, ValueObject parentRecord) throws StaleObjectException { if (attendanceClinicalNoteToSave == null) throw new CodingRuntimeException("Cannot save null AttendanceClinicalNotesVo "); if (!attendanceClinicalNoteToSave.isValidated()) throw new DomainRuntimeException("AttendanceClinicalNotesVo Not Validated."); DomainFactory factory = getDomainFactory(); AttendanceClinicalNotes domainAttClinicalNote = AttendanceClinicalNotesVoAssembler.extractAttendanceClinicalNotes(factory, attendanceClinicalNoteToSave); factory.save(domainAttClinicalNote); AttendanceClinicalNotesVo attendanceClinicalNoteSaved = AttendanceClinicalNotesVoAssembler.create(domainAttClinicalNote); if (parentRecord!=null && parentRecord instanceof ReferralToSpecialtyTeamVo) { ReferralToSpecialtyTeamVo referralToSpecialtyToSave = (ReferralToSpecialtyTeamVo)parentRecord; referralToSpecialtyToSave=ReferralToSpecialtyTeamVoAssembler.create((ReferralToSpecTeam) factory.getDomainObject(ReferralToSpecTeam.class, referralToSpecialtyToSave.getID_ReferralToSpecTeam())); referralToSpecialtyToSave.setComments(populateCollComments(referralToSpecialtyToSave.getComments(),attendanceClinicalNoteSaved)); //save referralToSpecialty ReferralToSpecTeam domainReferralToSave = ReferralToSpecialtyTeamVoAssembler.extractReferralToSpecTeam(factory, referralToSpecialtyToSave); factory.save(domainReferralToSave); } else if (parentRecord!=null && parentRecord instanceof SeenByHCPVo) { SeenByHCPVo seenByHcpToSave = (SeenByHCPVo)parentRecord; seenByHcpToSave=SeenByHCPVoAssembler.create((SeenByHCP) factory.getDomainObject(SeenByHCP.class, seenByHcpToSave.getID_SeenByHCP())); seenByHcpToSave.setSeenByHCPNotes(populateCollComments(seenByHcpToSave.getSeenByHCPNotes(),attendanceClinicalNoteSaved)); //save referralToSpecialty SeenByHCP domainSeenByHcpToSave = SeenByHCPVoAssembler.extractSeenByHCP(factory, seenByHcpToSave); factory.save(domainSeenByHcpToSave); } return attendanceClinicalNoteSaved; }
public TrackingForClinicianWorklistAndTriageVo saveTrackingSeenByHcp(TrackingForClinicianWorklistAndTriageVo tracking, SeenByHCPVo seenByHcp) throws StaleObjectException { if (tracking == null || tracking.getID_Tracking() == null) throw new CodingRuntimeException("Major logical erros - tracking record can not be null"); DomainFactory factory = getDomainFactory(); // Get latest tracking domain object Tracking doTracking = (Tracking) factory.getDomainObject(Tracking.class, tracking.getID_Tracking()); if (doTracking == null || doTracking.getSeenBy() != null) { throw new StaleObjectException(doTracking); } // Create status for the Tracking bo TrackingAttendanceStatusVo updatedStatus = new TrackingAttendanceStatusVo(); updatedStatus.setPatient(seenByHcp.getPatient()); updatedStatus.setEpisode(seenByHcp.getEpisode()); updatedStatus.setAttendance(seenByHcp.getAttendance()); if (seenByHcp.getAllocatedMedic()!=null ) { updatedStatus.setCreatedBy(seenByHcp.getAllocatedMedic().getMos()); } else if (seenByHcp.getAllocatedNurse()!=null) { updatedStatus.setCreatedBy(seenByHcp.getAllocatedNurse().getMos()); } updatedStatus.setTrackingArea(seenByHcp.getTrackingArea()); updatedStatus.setStatusDatetime(new DateTime()); updatedStatus.setStatus(TrackingStatus.BEING_ATTENDED_TO); // Extract domain object for Tracking status TrackingAttendanceStatus doStatus = TrackingAttendanceStatusVoAssembler.extractTrackingAttendanceStatus(factory, updatedStatus); // Extract domain object for Current Allocated status SeenByHCP doSeenBy = SeenByHCPVoAssembler.extractSeenByHCP(factory, seenByHcp); doTracking.setCurrentStatus(doStatus); doTracking.setSeenBy(doSeenBy); factory.save(doTracking); return TrackingForClinicianWorklistAndTriageVoAssembler.create(doTracking); }
public TrackingForClinicianWorklistAndTriageVo saveTracking(TrackingForClinicianWorklistAndTriageVo tracking, SeenByHCPVo seenByHcp, PatientMedsVo patmed) throws StaleObjectException { if(tracking == null) throw new CodingRuntimeException("Cannot save a null Tracking record."); if(!tracking.isValidated()) throw new CodingRuntimeException("Tracking record is not validated."); DomainFactory factory = getDomainFactory(); //wdev-15930 SeenByHCP doSeenBy = null; if( seenByHcp != null ) { doSeenBy = SeenByHCPVoAssembler.extractSeenByHCP(factory, seenByHcp); if( doSeenBy != null ) { factory.save(doSeenBy); } } //-------------wdev-15930------------ TriageForClinicianWorklistVo triagedetails = tracking.getTriageDetails(); ims.emergency.domain.objects.Triage doTriage = TriageForClinicianWorklistVoAssembler.extractTriage(factory, triagedetails); if( doTriage != null ) { factory.save(doTriage); } Tracking doTracking = TrackingForClinicianWorklistAndTriageVoAssembler.extractTracking(factory, tracking); if( doSeenBy != null ) { doTracking.setSeenBy(doSeenBy); } else if (seenByHcp == null && patmed==null && tracking.getCurrentStatusIsNotNull() && TrackingStatus.WAITING_TO_BE_SEEN_BY_A_MEDIC.equals(tracking.getCurrentStatus().getStatus()))//WDEV-18278 { //on Move,when setting the status to WAITING_TO_BE_SEEN_BY_A_MEDIC, mark currentSeenByAsCompleted and set SeenBy from Tracking to null SeenByHCP doSeenByHcp = doTracking.getSeenBy(); if (doSeenByHcp!=null) { doSeenByHcp.setCompletedDateTime(new Date()); factory.save(doSeenByHcp); doTracking.setSeenBy(null); } } if( doTriage != null) { doTracking.setTriageDetails(doTriage); } factory.save(doTracking); //wdev-17825 if( patmed != null) { PatientMedicationOnAttendance doPatientMedicationOnAttendance = PatientMedsVoAssembler.extractPatientMedicationOnAttendance(factory, patmed); if( doPatientMedicationOnAttendance != null ) factory.save(doPatientMedicationOnAttendance); } return TrackingForClinicianWorklistAndTriageVoAssembler.create(doTracking); }
public TrackingForClinicianWorklistVo saveTrackingSeenByHcp(TrackingForClinicianWorklistVo tracking, SeenByHCPVo seenByHcp) throws StaleObjectException { if (tracking == null || tracking.getID_Tracking() == null) throw new CodingRuntimeException("Major logical erros - tracking record can not be null"); DomainFactory factory = getDomainFactory(); // Get latest tracking domain object Tracking doTracking = (Tracking) factory.getDomainObject(Tracking.class, tracking.getID_Tracking()); if (doTracking == null || doTracking.getSeenBy() != null) { throw new StaleObjectException(doTracking); } // Create status for the Tracking bo TrackingAttendanceStatusVo updatedStatus = new TrackingAttendanceStatusVo(); updatedStatus.setPatient(seenByHcp.getPatient()); updatedStatus.setEpisode(seenByHcp.getEpisode()); updatedStatus.setAttendance(seenByHcp.getAttendance()); //updatedStatus.setCreatedBy(allocatedMedic.getAllocatedBy()); if (seenByHcp.getAllocatedMedic()!=null ) { updatedStatus.setCreatedBy(seenByHcp.getAllocatedMedic().getMos()); } else if (seenByHcp.getAllocatedNurse()!=null) { updatedStatus.setCreatedBy(seenByHcp.getAllocatedNurse().getMos()); } updatedStatus.setTrackingArea(seenByHcp.getTrackingArea()); updatedStatus.setStatusDatetime(new DateTime()); updatedStatus.setStatus(TrackingStatus.BEING_ATTENDED_TO); // Extract domain object for Tracking status TrackingAttendanceStatus doStatus = TrackingAttendanceStatusVoAssembler.extractTrackingAttendanceStatus(factory, updatedStatus); // Extract domain object for Current Allocated status SeenByHCP doSeenBy = SeenByHCPVoAssembler.extractSeenByHCP(factory, seenByHcp); doTracking.setCurrentStatus(doStatus); doTracking.setSeenBy(doSeenBy); factory.save(doTracking); return TrackingForClinicianWorklistVoAssembler.create(doTracking); }