private PatientLiteVo populatePatient() { PatientLiteVo patient = new PatientLiteVo(); PersonName name = new PersonName(); name.setSurname(form.txtSurname().getValue()); name.setForename(form.txtForename().getValue()); name.setUppers(); patient.setName(name); patient.setSex(form.cmbGender().getValue()); patient.setDob(form.pdtDOB().getValue()); patient.setIsActive(true); form.getLocalContext().setpatientToSave(patient); return patient; }
@Override protected void onBtnSelectClick() throws PresentationLogicException { PatientLiteVo sel = form.grdPatients().getValue(); if(sel == null) { engine.showMessage("Please select a patient record !"); return; } PatientLiteVoCollection selColl = new PatientLiteVoCollection(); selColl.add(sel); //DuplicatedPatients global context is used for selected patient ! form.getGlobalContext().Core.setDuplicatedPatients(selColl); engine.close(DialogResult.OK); }
/** * getPatientList * This method will return an active patient, either the patient matching * the search criteria provided, or it's equivalent new merged patient * Used by HL7engine. */ public PatientLiteVo getPatientLite(PatientShort patVo) { ims.core.patient.domain.objects.Patient domPatient = getDomPatient(patVo); if (domPatient != null) { // Check associated value if not null, then get this patient while(domPatient.getAssociatedPatient() != null) { domPatient = domPatient.getAssociatedPatient(); } } return PatientLiteVoAssembler.create(domPatient); }
public PatientLiteVo getPatient(PatientRefVo patientRef) { if (patientRef == null || patientRef.getID_Patient()==null) throw new CodingRuntimeException("Patient not provided"); DomainFactory factory = getDomainFactory(); Patient doPatient = (Patient) factory.getDomainObject(Patient.class, patientRef.getID_Patient()); return PatientLiteVoAssembler.create(doPatient); }
public PatientLiteVo getPatientByCareContext(CareContextRefVo careContext) { if(careContext == null || careContext.getID_CareContext() == null) { throw new CodingRuntimeException("CareContextRefVo is null"); } if(careContext.getID_CareContext() == null) { throw new CodingRuntimeException("CareContextRefVo id is null"); } DomainFactory factory = getDomainFactory(); List domainObjectList = factory.find("select p from CareContext as cc left join cc.episodeOfCare as eoc left join eoc.careSpell as cs left join cs.patient as p where (cc.id = :idCareContext)", new String[]{"idCareContext"}, new Object[]{careContext.getID_CareContext()}); PatientLiteVoCollection patient = PatientLiteVoAssembler.createPatientLiteVoCollectionFromPatient(domainObjectList); return patient != null && patient.size() > 0 ? (patient.get(0) != null ? patient.get(0) : null) : null; }
private boolean hasSealedEnvelope(PatientLiteVo patient) { if (patient == null || patient.getID_Patient() == null) return false; StringBuilder query = new StringBuilder("SELECT COUNT (patAlert.id) FROM PatientAlert AS patAlert LEFT JOIN patAlert.patient AS pat LEFT JOIN patAlert.alertType AS type "); query.append("WHERE pat.id = :PAT_ID AND type.id = :ALERT_TYPE AND patAlert.isCurrentlyActiveAlert = 1"); long count = getDomainFactory().countWithHQL(query.toString(), new String[] {"PAT_ID", "ALERT_TYPE"}, new Object[] {patient.getID_Patient(), AlertType.SEALED_ENVELOPE_PATIENT.getID()}); if (count > 0) return true; return false; }
private PatientDocumentVo populatePatientDocumentVo(ServerDocumentVo serverDocumentVo, EDischargeSTHKSummaryVo summaryVo, String docName, DocumentCategory category) { if (summaryVo != null) { if (summaryVo.getCareContextIsNotNull()) { PatientLiteVo patient = getPatientByCareContext(summaryVo.getCareContext()); if (patient != null) { PatientDocumentVo vo = new PatientDocumentVo(); vo.setPatient(patient); vo.setCareContext(summaryVo.getCareContext()); vo.setName(docName); vo.setServerDocument(serverDocumentVo); vo.setCreationType(DocumentCreationType.GENERATED); vo.setCategory(category); vo.setRecordingUser(getMosUser() != null ? (MemberOfStaffLiteVo) getMosUser() : null); vo.setRecordingDateTime(new DateTime()); vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE); return vo; } } } return null; }
public PatientLiteVo getPatientLite(PatientShort patVo) throws UniqueKeyViolationException { ims.core.domain.Demographics impl = (ims.core.domain.Demographics) getDomainImpl(DemographicsImpl.class); return impl.getPatientLite(patVo); }
private boolean save() { TrackingForQuickRegistrationVo tracking = null; //wdev-17110 if( form.getLocalContext().getpatientToSaveIsNotNull()) { //wdev-17293 if (form.getGlobalContext().Emergency.getSelectedPatient() == null) form.getLocalContext().getpatientToSave().setIsQuickRegistrationPatient(Boolean.TRUE); else form.getLocalContext().getpatientToSave().setIsQuickRegistrationPatient(Boolean.FALSE); PatientLiteVo patient = form.getLocalContext().getpatientToSave(); String[] patientErrors = patient.validate(); if (patientErrors != null && patientErrors.length > 0) { engine.showErrors(patientErrors); return false; } } //-------------- if (!QuickRegistrationType.EXP_ARRIVAL.equals(form.cmbRegistrationType().getValue()))//WDEV-15959 { tracking = populateTracking(); String[] trackingErrors = tracking.validate(); if (trackingErrors != null && trackingErrors.length > 0) { engine.showErrors(trackingErrors); return false; } } try { domain.save(form.getLocalContext().getpatientToSave(), form.getLocalContext().getcareSpellToSave(), form.getLocalContext().getemergencyEpisodeToSave(), tracking, form.getLocalContext().getcareContextToSave(), form.getLocalContext().getemergencyAttendanceToSave()); } catch (StaleObjectException e) { engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue()); return false; } form.getGlobalContext().Emergency.setSelectedPatient(null); return true; }
private PatientCaseNoteRequestVoCollection saveAutomatedCaseNoteRequest(PatientLiteVo patient, MemberOfStaffLiteVo mos, LocationLiteVo location, DateTime requiredByDate, PatientElectiveListTCIVo tci) throws StaleObjectException, DomainInterfaceException, UniqueKeyViolationException { PatientCaseNotes impl = (PatientCaseNotes) getDomainImpl(PatientCaseNotesImpl.class); return impl.saveAutomaticCaseNoteRequests(patient, mos, location, requiredByDate, null, tci); }
private PatientDocumentVo populatePatientDocumentVo(ServerDocumentVo serverDocumentVo, DischargeReportDetailVo reportDetails, String docName, DocumentCategory category) { if (reportDetails != null) { if (reportDetails.getCareContextIsNotNull()) { PatientLiteVo patient = getPatientByCareContext(reportDetails.getCareContext()); if (patient != null) { PatientDocumentVo vo = new PatientDocumentVo(); vo.setPatient(patient); vo.setCareContext(reportDetails.getCareContext()); //WDEV-12352 - starts here if(reportDetails.getCareContext() != null) { EpisodeOfCareInterfaceVo ep = getEpisodeOfCare(reportDetails.getCareContext()); vo.setEpisodeofCare(ep); vo.setSpecialty(ep != null ? ep.getSpecialty() : null); vo.setResponsibleHCP(ep.getResponsibleHCP());//WDEV-14258 CareContextForDischargeSummarySchedulerVo cc = getCareContext(reportDetails.getCareContext());//WDEV-14258 //WDEV-14258 if(cc != null && cc.getStartDateTimeIsNotNull()) { vo.setDocumentDate(cc.getStartDateTime().getDate()); } } //WDEV-14258 if(vo.getDocumentDate() == null) { vo.setDocumentDate(new ims.framework.utils.Date()); } ////WDEV-12352 - ends here vo.setName(docName); vo.setServerDocument(serverDocumentVo); vo.setCreationType(DocumentCreationType.GENERATED); vo.setCategory(category); vo.setRecordingUser(getMosUser() != null ? (MemberOfStaffLiteVo) getMosUser() : null); vo.setRecordingDateTime(new DateTime()); vo.setStatus(PreActiveActiveInactiveStatus.ACTIVE); //WDEV-14258 vo.setResponsibleHCP(getResponsibleHCPForCareContext(reportDetails.getCareContext()));//wdev-13102 return vo; } } } return null; }
private PatientCaseNoteRequestVoCollection saveAutomatedCaseNoteRequest(PatientLiteVo patient, MemberOfStaffLiteVo mos, LocationLiteVo location, DateTime requiredByDate, TCIForReferralBookingVo tci) throws StaleObjectException, DomainInterfaceException, UniqueKeyViolationException { PatientCaseNotes impl = (PatientCaseNotes) getDomainImpl(PatientCaseNotesImpl.class); return impl.saveAutomaticCaseNoteRequests(patient, mos, location, requiredByDate, null, tci); }
public PatientCaseNoteRequestVoCollection saveAutomatedCaseNoteRequest(PatientLiteVo patient, MemberOfStaffLiteVo mos, Booking_AppointmentVo appointment, DateTime requiredByDate) throws StaleObjectException, DomainInterfaceException, UniqueKeyViolationException { PatientCaseNotes impl = (PatientCaseNotes) getDomainImpl(PatientCaseNotesImpl.class); return impl.saveAutomaticCaseNoteRequests(patient, mos, appointment.getSession().getCaseNoteFolderLocation(), requiredByDate, appointment, null); }
private PatientCaseNoteRequestVoCollection saveAutomatedCaseNoteRequest(PatientLiteVo patient, MemberOfStaffLiteVo mos, Booking_AppointmentVo appointment, DateTime requiredByDate, ElectiveTCIForReferralDetailsVo tci, LocationLiteVo caseNoteFolderLoc) throws StaleObjectException, DomainInterfaceException, UniqueKeyViolationException // WDEV-20064 { PatientCaseNotes impl = (PatientCaseNotes) getDomainImpl(PatientCaseNotesImpl.class); return impl.saveAutomaticCaseNoteRequests(patient, mos, caseNoteFolderLoc, requiredByDate, null, tci); // WDEV-20064 }
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; }
private PatientCaseNoteListVoCollection getCaseNotesForPatient(PatientLiteVo patient) { if(patient == null) return null; DomainFactory factory = getDomainFactory(); String query = "select patCaseNote from PatientCaseNote as patCaseNote where patCaseNote.patient.id = :PatId"; List<?> listCaseNote = factory.find(query, new String[] {"PatId"}, new Object[] {patient.getID_Patient()}); return PatientCaseNoteListVoAssembler.createPatientCaseNoteListVoCollectionFromPatientCaseNote(listCaseNote); }