private EmergencyEpisodeForQuickRegistrationVo populateDataFromScreen() { EmergencyEpisodeForQuickRegistrationVo voEmergencyEpisode = new EmergencyEpisodeForQuickRegistrationVo(); EmergencyAttendanceForQuickRegistrationVo voEmergencyAttendance = new EmergencyAttendanceForQuickRegistrationVo(); EmergencyAttendanceForQuickRegistrationVoCollection voCollEmergencyAttendance = new EmergencyAttendanceForQuickRegistrationVoCollection(); createNewCareSpell(); // Populate EmergencyDetails voEmergencyEpisode.setInjuryDateTime(form.dtimInjury().getValue()); voEmergencyEpisode.setSourceOfReferral(form.cmbSourceOfReferral().getValue()); voEmergencyEpisode.setEpisodeOfCare(form.getLocalContext().getepisodeToSave()); voEmergencyEpisode.setPatient(form.getLocalContext().getpatientToSave()); // Populate EmergencyAttendance voEmergencyAttendance.setArrivalDateTime(form.dtimArrival().getValue()); voEmergencyAttendance.setRegistrationDateTime(form.dtimArrival().getValue()); voEmergencyAttendance.setEmergencyEpisode(voEmergencyEpisode); voEmergencyAttendance.setCareContext(form.getLocalContext().getcareContextToSave()); voEmergencyAttendance.setEpisode(voEmergencyEpisode); voEmergencyAttendance.setPatient(form.getLocalContext().getpatientToSave()); voEmergencyAttendance.setAttendanceType(AttendanceType.FIRST); voEmergencyAttendance.setAgeAtAttendance(calculateAge()); voEmergencyAttendance.setRegistrationLocation(getLocation()); voEmergencyAttendance.setComments(form.txtComments().getValue()); //wdev-17463 //wdev-16070 if( domain.getMosUser() instanceof MemberOfStaffLiteVo ) { MemberOfStaffLiteVo tempVo = (MemberOfStaffLiteVo) domain.getMosUser(); voEmergencyAttendance.setRegisteringMOS(tempVo); } //WDEV-15959 if (QuickRegistrationType.UNC_UNK_PATIENT.equals(form.cmbRegistrationType().getValue()) ) { voEmergencyAttendance.setIsUnknownPatient(true); } else if (QuickRegistrationType.QUICK_REG.equals(form.cmbRegistrationType().getValue())) { voEmergencyAttendance.setIsQuickRegistration(true); } else if (QuickRegistrationType.EXP_ARRIVAL.equals(form.cmbRegistrationType().getValue())) { voEmergencyAttendance.setExpectedArrivalDateTime(form.dtimArrival().getValue()); voEmergencyAttendance.setIsExpectedArrival(true); } else if (QuickRegistrationType.MAJ_INCIDENT.equals(form.cmbRegistrationType().getValue())) { voEmergencyAttendance.setIsMajorIncident(true); } voCollEmergencyAttendance.add(voEmergencyAttendance); voEmergencyEpisode.setEmergencyAttendances(voCollEmergencyAttendance); form.getLocalContext().setemergencyEpisodeToSave(voEmergencyEpisode); form.getLocalContext().setemergencyAttendanceToSave(voEmergencyAttendance); return voEmergencyEpisode; }
private boolean validateSave() { MemberOfStaffShortVo memberVo = null; if (domain.getMosUser() instanceof MemberOfStaffShortVo) { memberVo = (MemberOfStaffShortVo) domain.getMosUser(); } if (memberVo == null) { engine.showMessage("User must be Member Of Staff."); return false; } if (!validateUIRules()) return false; //WDEV-15958 //PatientLiteVo patient = populatePatient(); PatientLite_IdentifiersVo patient = null; if (form.getGlobalContext().Emergency.getSelectedPatientIsNotNull()) { patient=domain.getPatient(form.getGlobalContext().Emergency.getSelectedPatient()); form.getLocalContext().setpatientToSave(patient); } else { patient = populatePatient(); } String[] patientErrors = patient.validate(); if (patientErrors != null && patientErrors.length > 0) { engine.showErrors(patientErrors); return false; } EmergencyEpisodeForQuickRegistrationVo emergencyEpisode = populateDataFromScreen(); CareSpellVo careSpell = form.getLocalContext().getcareSpellToSave(); String[] careSpellErrors = careSpell.validate(); if (careSpellErrors != null && careSpellErrors.length > 0) { engine.showErrors(careSpellErrors); return false; } String[] emergencyEpisodeErrors = emergencyEpisode.validate(); if (emergencyEpisodeErrors != null && emergencyEpisodeErrors.length > 0) { engine.showErrors(emergencyEpisodeErrors); return false; } return true; }
private EmergencyEpisodeForQuickRegistrationVo populateDataFromScreen() { EmergencyEpisodeForQuickRegistrationVo voEmergencyEpisode = new EmergencyEpisodeForQuickRegistrationVo(); EmergencyAttendanceForQuickRegistrationVo voEmergencyAttendance = new EmergencyAttendanceForQuickRegistrationVo(); EmergencyAttendanceForQuickRegistrationVoCollection voCollEmergencyAttendance = new EmergencyAttendanceForQuickRegistrationVoCollection(); createNewCareSpell(); // Populate EmergencyDetails voEmergencyEpisode.setInjuryDateTime(form.dtimInjury().getValue()); voEmergencyEpisode.setSourceOfReferral(form.cmbSourceOfReferral().getValue()); voEmergencyEpisode.setEpisodeOfCare(form.getLocalContext().getepisodeToSave()); voEmergencyEpisode.setPatient(form.getLocalContext().getpatientToSave()); // Populate EmergencyAttendance voEmergencyAttendance.setArrivalDateTime(form.dtimArrival().getValue()); voEmergencyAttendance.setRegistrationDateTime(form.dtimArrival().getValue()); voEmergencyAttendance.setEndOfRegistrationDateTime(new DateTime()); //WDEV-19984 voEmergencyAttendance.setEmergencyEpisode(voEmergencyEpisode); voEmergencyAttendance.setCareContext(form.getLocalContext().getcareContextToSave()); voEmergencyAttendance.setEpisode(voEmergencyEpisode); voEmergencyAttendance.setPatient(form.getLocalContext().getpatientToSave()); voEmergencyAttendance.setAttendanceType(AttendanceType.FIRST); voEmergencyAttendance.setAgeAtAttendance(calculateAge()); voEmergencyAttendance.setRegistrationLocation(getLocation()); voEmergencyAttendance.setComments(form.txtComments().getValue()); //wdev-17463 //wdev-16070 if( domain.getMosUser() instanceof MemberOfStaffLiteVo ) { MemberOfStaffLiteVo tempVo = (MemberOfStaffLiteVo) domain.getMosUser(); voEmergencyAttendance.setRegisteringMOS(tempVo); } //WDEV-15959 if (QuickRegistrationType.UNC_UNK_PATIENT.equals(form.cmbRegistrationType().getValue()) ) { voEmergencyAttendance.setIsUnknownPatient(true); } else if (QuickRegistrationType.QUICK_REG.equals(form.cmbRegistrationType().getValue())) { voEmergencyAttendance.setIsQuickRegistration(true); } else if (QuickRegistrationType.EXP_ARRIVAL.equals(form.cmbRegistrationType().getValue())) { voEmergencyAttendance.setExpectedArrivalDateTime(form.dtimArrival().getValue()); voEmergencyAttendance.setIsExpectedArrival(true); } else if (QuickRegistrationType.MAJ_INCIDENT.equals(form.cmbRegistrationType().getValue())) { voEmergencyAttendance.setIsMajorIncident(true); } voCollEmergencyAttendance.add(voEmergencyAttendance); voEmergencyEpisode.setEmergencyAttendances(voCollEmergencyAttendance); form.getLocalContext().setemergencyEpisodeToSave(voEmergencyEpisode); form.getLocalContext().setemergencyAttendanceToSave(voEmergencyAttendance); return voEmergencyEpisode; }
private boolean validateSave() { MemberOfStaffShortVo memberVo = null; if (domain.getMosUser() instanceof MemberOfStaffShortVo) { memberVo = (MemberOfStaffShortVo) domain.getMosUser(); } if (memberVo == null) { engine.showMessage("User must be Member Of Staff."); return false; } if (!validateUIRules()) return false; //WDEV-15958 //PatientLiteVo patient = populatePatient(); PatientLiteVo patient = null; if (form.getGlobalContext().Emergency.getSelectedPatientIsNotNull()) { patient=domain.getPatient(form.getGlobalContext().Emergency.getSelectedPatient()); form.getLocalContext().setpatientToSave(patient); } else { patient = populatePatient(); } String[] patientErrors = patient.validate(); if (patientErrors != null && patientErrors.length > 0) { engine.showErrors(patientErrors); return false; } EmergencyEpisodeForQuickRegistrationVo emergencyEpisode = populateDataFromScreen(); CareSpellVo careSpell = form.getLocalContext().getcareSpellToSave(); String[] careSpellErrors = careSpell.validate(); if (careSpellErrors != null && careSpellErrors.length > 0) { engine.showErrors(careSpellErrors); return false; } String[] emergencyEpisodeErrors = emergencyEpisode.validate(); if (emergencyEpisodeErrors != null && emergencyEpisodeErrors.length > 0) { engine.showErrors(emergencyEpisodeErrors); return false; } return true; }