private void checkIfCheckBoxShouldBeDisplayedAnyway(DischargeReadyToLeaveVo voReady) { GP voGP = domain.getPatientsGP(form.getGlobalContext().Core.getPatientShort()); boolean hasEmail = false; if (voGP != null && voGP.getCommChannel(ChannelType.EMAIL) != null) hasEmail = true; DischargeDetailsVo volocalDD = domain.getDischargeDetails(form.getGlobalContext().Core.getCurrentCareContext()); form.getLocalContext().setCurrentDischargeDetailsVo(volocalDD); if ( !hasEmail && volocalDD != null && volocalDD.getDischargeLetterStatusIsNotNull() && volocalDD.getDischargeLetterStatus().equals(DischargeLetterStatus.GENERATED) && (voReady.getHasPatientReceivedCopyOfDischarge() == null || (voReady.getHasPatientReceivedCopyOfDischargeIsNotNull() && ! voReady.getHasPatientReceivedCopyOfDischarge()) ) ) { form.chkLetterGiven().setVisible(true); form.lblLetterGiven().setVisible(true); if (form.getMode().equals(FormMode.EDIT)) form.chkLetterGiven().setEnabled(true); } }
public DischargeReadyToLeaveVo saveReadyToLeave(DischargeReadyToLeaveVo voReady, RTLSummaryVo rTLSummaryVo) throws DomainInterfaceException, StaleObjectException { if(voReady == null) throw new CodingRuntimeException("DischargeReadyToLeaveVo is null"); if(!voReady.isValidated()) throw new CodingRuntimeException("DischargeReadyToLeaveVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); ReadyToLeave doRTL = DischargeReadyToLeaveVoAssembler.extractReadyToLeave(factory, voReady); RTLSummary doRTLSummary = RTLSummaryVoAssembler.extractRTLSummary(factory, rTLSummaryVo); //WDEV-18622 factory.save(doRTL); factory.save(doRTLSummary); //WDEV-18622 return DischargeReadyToLeaveVoAssembler.create(doRTL); }
private void populateScreenFromData(DischargeReadyToLeaveVo voReady) { if (voReady == null) return; //-- form.txtNurseEnabledDischargeInstruction().setValue((voReady.getDischargeDetailsIsNotNull()&& voReady.getDischargeDetails().getNurseEnabledInstructionsIsNotNull())? voReady.getDischargeDetails().getNurseEnabledInstructions().getNurseEnabledInstructions() : null); //--- form.txtNurseEnabledConfirmation().setValue(voReady.getNurseEnabledDischargeConfirmation()); form.dtimDODisch().setValue(voReady.getCompletedOnIsNotNull() ? voReady.getCompletedOn() : null); form.ccAuthoring().setValue(voReady.getAuthoringInfoIsNotNull() ? voReady.getAuthoringInfo() : null); if (voReady.getHasPatientReceivedCopyOfDischargeIsNotNull()) { form.chkLetterGiven().setValue(voReady.getHasPatientReceivedCopyOfDischarge()); manageCheckBox(true, false); } //check if the gps have email and if letter status is IN_PROGRESS / GENERATED and HasPatientReceivedCopyOfDischarge == null checkIfCheckBoxShouldBeDisplayedAnyway(voReady); if (voReady.getDischargeDetailsIsNotNull()) { DischargeDetailsVo voDisch = voReady.getDischargeDetails(); form.ccDischCons().setValue(voDisch.getDischargingConsultantIsNotNull() ? voDisch.getDischargingConsultant() : null); form.cmbDischSpec().setValue(voDisch.getDischargingSpecialtyIsNotNull() ? voDisch.getDischargingSpecialty() : null); form.dtimDODisch().setValue(voDisch.getDateOfDischargeIsNotNull() ? voDisch.getDateOfDischarge() : null); form.cmbDischMethod().setValue(voDisch.getDischargeMethodIsNotNull() ? voDisch.getDischargeMethod() : null); form.cmbDischDest().setValue(voDisch.getDischargeDestinationIsNotNull() ? voDisch.getDischargeDestination() : null); form.cmbDischWard().setValue(voDisch.getDischargingWardIsNotNull() ? voDisch.getDischargingWard() : null); if (voDisch.getDischargingWardIsNotNull() && form.cmbDischWard().getValue() == null) { form.cmbDischWard().newRow(voDisch.getDischargingWard(), voDisch.getDischargingWard().getName()); form.cmbDischWard().setValue(voDisch.getDischargingWard()); } } }
public DischargeReadyToLeaveVo saveReadyToLeave(DischargeReadyToLeaveVo voReady, SummaryRefVo voSummary) throws DomainInterfaceException, StaleObjectException { if(voReady == null) throw new CodingRuntimeException("DischargeReadyToLeaveVo is null"); if(!voReady.isValidated()) throw new CodingRuntimeException("DischargeReadyToLeaveVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); //There is a situation where is possible that the scheduled jobs have run while you //are editing the ready to leave record. This should be dealt with by throwing a StaleObjectException String hql = "select count(summa.id) from Summary as summa where (summa.id=:sumId and (summa.dischargeLetterStatus.id =:dischLettId or summa.dischargeSupplementaryLetterStatus.id = :dischSuppLettId))"; long isCompleted = factory.countWithHQL(hql, new String[]{"sumId","dischLettId","dischSuppLettId"}, new Object[]{voSummary.getID_Summary(),DischargeLetterStatus.GENERATED.getId(),DischargeSupplementaryLetterStatus.GENERATED.getID()}); if (isCompleted > 0) { throw new StaleObjectException(null); } ReadyToLeave doRTL = DischargeReadyToLeaveVoAssembler.extractReadyToLeave(factory, voReady); factory.save(doRTL); //updating summary WDEV-11348 IEDischargeHelper impl = (IEDischargeHelper) getDomainImpl(EDischargeHelper.class); impl.updateSummaryIfRequired(voReady, voSummary, factory); return DischargeReadyToLeaveVoAssembler.create(doRTL); }
public DischargeReadyToLeaveVo getReadyToLeave(CareContextRefVo careContextRefvo) { if(careContextRefvo == null) throw new CodingRuntimeException("careContextRefVo Filter not provided for list call. "); if(careContextRefvo != null) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" from ReadyToLeave rtl where "); String andStr = " "; ArrayList<String> markers = new ArrayList<String>(); ArrayList<Serializable> values = new ArrayList<Serializable>(); hql.append(andStr + " rtl.careContext.id = :careContextId"); markers.add("careContextId"); values.add(careContextRefvo.getID_CareContext()); andStr = " and "; List list = factory.find(hql.toString(), markers,values); if(list != null && list.size() > 0) { DischargeReadyToLeaveVoCollection voColl = DischargeReadyToLeaveVoAssembler.createDischargeReadyToLeaveVoCollectionFromReadyToLeave(list); if(voColl != null && voColl.size() > 0) return voColl.get(0); } } return null; }
public DischargeReadyToLeaveVo saveReadyToLeave(DischargeReadyToLeaveVo voReady) throws DomainInterfaceException, StaleObjectException { if(voReady == null) throw new CodingRuntimeException("DischargeReadyToLeaveVo is null"); if(!voReady.isValidated()) throw new CodingRuntimeException("DischargeReadyToLeaveVo Value Object has not been validated"); DomainFactory factory = getDomainFactory(); ReadyToLeave doRTL = DischargeReadyToLeaveVoAssembler.extractReadyToLeave(factory, voReady); factory.save(doRTL); return DischargeReadyToLeaveVoAssembler.create(doRTL); }
public DischargeReportDetailVo saveDischargeReportDetail(DischargeReportDetailVo record, DischargeReadyToLeaveVo voReady) throws StaleObjectException { if (record != null) { if (!record.isValidated()) throw new DomainRuntimeException("PatientDocumentVo not validated"); } DomainFactory factory = getDomainFactory(); if (!record.getID_DischargeReportDetailIsNotNull()) { List<?> dischargeDetails = factory.find("select dd from DischargeReportDetail as dd left join dd.careContext as cc where cc.id = :idCareContext and dd.isRIE is null ", new String[]{"idCareContext"}, new Object[]{record.getCareContext().getID_CareContext()}); if (dischargeDetails != null && dischargeDetails.size()>0) { throw new StaleObjectException(null); } } DischargeReportDetail dom = DischargeReportDetailVoAssembler.extractDischargeReportDetail(factory, record); factory.save(dom); if (voReady != null) { ReadyToLeave domReady = DischargeReadyToLeaveVoAssembler.extractReadyToLeave(factory, voReady); factory.save(domReady); } return DischargeReportDetailVoAssembler.create(dom); }
public DischargeReportDetailVo saveDischargeReportDetail(DischargeReportDetailVo record, DischargeReadyToLeaveVo voReady, RTLSummaryVo rTLSummaryVo, PatientNoDiagInfoForCCVo patientNoDiagInfo) throws StaleObjectException { if (record != null) { if (!record.isValidated()) throw new DomainRuntimeException("PatientDocumentVo not validated"); } DomainFactory factory = getDomainFactory(); if (!record.getID_DischargeReportDetailIsNotNull()) { List<?> dischargeDetails = factory.find("select dd from DischargeReportDetail as dd left join dd.careContext as cc where cc.id = :idCareContext and dd.isRIE is null ", new String[]{"idCareContext"}, new Object[]{record.getCareContext().getID_CareContext()}); if (dischargeDetails != null && dischargeDetails.size()>0) { throw new StaleObjectException(null); } } DischargeReportDetail dom = DischargeReportDetailVoAssembler.extractDischargeReportDetail(factory, record); RTLSummary doRTLSummary = RTLSummaryVoAssembler.extractRTLSummary(factory, rTLSummaryVo); //WDEV-18622 factory.save(dom); factory.save(doRTLSummary); //WDEV-18622 //WDEV-18627 if (patientNoDiagInfo != null) { PatientNoDiagInfoForCC patientNoDiagInfoDo = PatientNoDiagInfoForCCVoAssembler.extractPatientNoDiagInfoForCC(factory, patientNoDiagInfo); factory.save(patientNoDiagInfoDo); } if (voReady != null) { ReadyToLeave domReady = DischargeReadyToLeaveVoAssembler.extractReadyToLeave(factory, voReady); factory.save(domReady); } return DischargeReportDetailVoAssembler.create(dom); }
private void checkIfCheckBoxShouldBeDisplayedAnyway(DischargeReadyToLeaveVo voReady) { DischargeReportDetailVo voDischReport = domain.getDischargeReportDetailsForCareContext(form.getGlobalContext().Core.getCurrentCareContext()); form.getLocalContext().setCurrentDischargeReportDetailVo(voDischReport); boolean hasEmail = false; if (voDischReport != null && voDischReport.getGpRecipientsIsNotNull()) { for (int j = 0; j < voDischReport.getGpRecipients().size(); j++) { GPLiteWithCommChannelsVoCollection gps = voDischReport.getGpRecipients(); if (gps != null && gps.size() > 0) { for (int k = 0; k < gps.size() ; k++) { if (gps.get(k).getCommChannelsIsNotNull() && gps.get(k).getCommChannels().size() > 0) { for (int l = 0; l < gps.get(k).getCommChannels().size(); l++) { if (gps.get(k).getCommChannels().get(l).getChannelTypeIsNotNull() && gps.get(k).getCommChannels().get(l).getChannelType().equals(ChannelType.EMAIL)) { hasEmail = true; } } } } } } } DischargeDetailsVo volocalDD = domain.getDischargeDetails(form.getGlobalContext().Core.getCurrentCareContext()); form.getLocalContext().setCurrentDischargeDetailsVo(volocalDD); if ( !hasEmail && voDischReport != null && volocalDD != null && volocalDD.getDischargeLetterStatusIsNotNull() && volocalDD.getDischargeLetterStatus().equals(DischargeLetterStatus.GENERATED) && (voReady.getHasPatientReceivedCopyOfDischarge() == null || (voReady.getHasPatientReceivedCopyOfDischargeIsNotNull() && ! voReady.getHasPatientReceivedCopyOfDischarge()) ) ) { form.chkLetterGiven().setVisible(true); form.lblLetterGiven().setVisible(true); if (form.getMode().equals(FormMode.EDIT)) form.chkLetterGiven().setEnabled(true); } }
private void populateScreenFromData(DischargeReadyToLeaveVo voReady) { if (voReady == null) return; form.txtNurseEnabledDischargeInstruction().setValue((voReady.getDischargeDetailsIsNotNull()&& voReady.getDischargeDetails().getNurseEnabledInstructionsIsNotNull())? voReady.getDischargeDetails().getNurseEnabledInstructions().getNurseEnabledInstructions() : null); form.txtNurseEnabledConfirmation().setValue(voReady.getNurseEnabledDischargeConfirmation()); form.txtCommentsfromPatient().setValue(voReady.getCommentsFromPatient()); //WDEV-12797 form.dtimAdmission().setValue(voReady.getAdmittedOnIsNotNull() && voReady.getAdmittedTimeIsNotNull()? new DateTime(voReady.getAdmittedOn(), voReady.getAdmittedTime()) : null); form.dtimDODisch().setValue(voReady.getCompletedOnIsNotNull() ? voReady.getCompletedOn() : null); form.dtimDischMidf().setValue(voReady.getClinicalDischargeDateTimeIsNotNull() ? voReady.getClinicalDischargeDateTime() : null); form.ccDischNurseorMidwife().setValue(voReady.getDischargingNurseIsNotNull() ? voReady.getDischargingNurse() : null); form.cmbDischMethod().setValue(voReady.getDischargeDetailsIsNotNull() ? voReady.getDischargeDetails().getMethodOfDischarge() : null); form.cmbDischDest().setValue(voReady.getDischargeDetailsIsNotNull() ? voReady.getDischargeDetails().getDischargeDestination() : null); if (voReady.getHasPatientReceivedCopyOfDischargeIsNotNull()) { form.chkLetterGiven().setValue(voReady.getHasPatientReceivedCopyOfDischarge()); manageCheckBox(true, false); } form.chkComplete().setValue(voReady.getIsComplete()); //check if the gps have email and if letter status is IN_PROGRESS / GENERATED and HasPatientReceivedCopyOfDischarge == null checkIfCheckBoxShouldBeDisplayedAnyway(voReady); if (voReady.getDischargeDetailsIsNotNull()) { DischargeDetailsVo voDisch = voReady.getDischargeDetails(); if (voDisch.getDischargingConsultantIsNotNull()) { form.cmbDischCons().newRow(voDisch.getDischargingConsultant(), voDisch.getDischargingConsultant().getName().toString()); form.cmbDischCons().setValue(voDisch.getDischargingConsultant()); } form.cmbDischSpec().setValue(voDisch.getDischargingSpecialtyIsNotNull() ? voDisch.getDischargingSpecialty() : null); form.dtimDODisch().setValue(voDisch.getDateOfDischargeIsNotNull() ? voDisch.getDateOfDischarge() : null); form.cmbDischMethod().setValue(voDisch.getMethodOfDischargeIsNotNull() ? voDisch.getMethodOfDischarge() : null); form.cmbDischDest().setValue(voDisch.getDischargeDestinationIsNotNull() ? voDisch.getDischargeDestination() : null); if (voDisch.getDischargingWardIsNotNull()) { form.cmbDischWard().newRow(voDisch.getDischargingWard(), voDisch.getDischargingWard().getName()); form.cmbDischWard().setValue(voDisch.getDischargingWard()); } } }
private boolean SaveUndo() { DischargeReportDetailVo record = domain.getDischargeReportDetailsForCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if(record != null) { record.setIsClinicalDetailsComplete(false); record.setDateOfCompletion(null); record.setCompletingHCP(null); String[] errors = record.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } DischargeDetailsVo details = populateDataFromScreen(domain.getDischargeDetailsForCareContext(form.getGlobalContext().Core.getCurrentCareContext())); details.setDischargeLetterStatus(DischargeLetterStatus.IN_PROGRESS); errors = details.validate(); if (errors != null && errors.length>0) { throw new CodingRuntimeException("Discharge Details should be valid !"); } DischargeReadyToLeaveVo recordReady = domain.getReadyToLeave(form.getGlobalContext().Core.getCurrentCareContext()); if (recordReady != null && recordReady.getHasPatientReceivedCopyOfDischargeIsNotNull()) { recordReady.setHasPatientReceivedCopyOfDischarge(null); errors = recordReady.validate(); if (errors != null && errors.length > 0) { throw new CodingRuntimeException("Discharge Ready To Leave should be valid !"); } } else recordReady = null; try { record = domain.saveDischargeReportDetail(record, recordReady); domain.saveDischargeDetails(details); } catch (StaleObjectException e) { engine.showMessage(e.getMessage()); return true; //e.printStackTrace(); } isComplete = true; form.getLocalContext().setEditedRecord(record); //-------------------- if(record.getIsClinicalDetailsComplete() == false) { setReadOnly(); form.getGlobalContext().Clinical.seteDischargeClinicalComplete(false); } //------------------------ } return true; }
public DischargeReadyToLeaveVo getReadyToLeave(CareContextRefVo careContextRefvo) { EDischargePatientReadyToLeaveSTHKComponent impl = (EDischargePatientReadyToLeaveSTHKComponent) getDomainImpl(EDischargePatientReadyToLeaveSTHKComponentImpl.class); return impl.getReadyToLeave(careContextRefvo); }
public DischargeReadyToLeaveVo getReadyToLeave(CareContextRefVo careContextRefvo) { EDischargePatientReadyToLeaveComponent impl = (EDischargePatientReadyToLeaveComponent) getDomainImpl(EDischargePatientReadyToLeaveComponentImpl.class); return impl.getReadyToLeave(careContextRefvo); }
public DischargeReadyToLeaveVo saveReadyToLeave(DischargeReadyToLeaveVo voReady) throws DomainInterfaceException, StaleObjectException { // TODO Auto-generated method stub return null; }
public DischargeReadyToLeaveVo getReadyToLeave(CareContextRefVo careContextRefvo) { EDischargePatientReadyToLeaveComponent impl = (EDischargePatientReadyToLeaveComponent)getDomainImpl(EDischargePatientReadyToLeaveComponentImpl.class); return impl.getReadyToLeave(careContextRefvo); }
private boolean SaveUndo() { DischargeReportDetailVo record = domain.getDischargeReportDetailsForCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if(record != null) { record.setIsClinicalDetailsComplete(false); record.setDateOfCompletion(null); record.setCompletingHCP(null); String[] errors = record.validate(); if (errors != null && errors.length > 0) { engine.showErrors(errors); return false; } DischargeDetailsVo details = populateDataFromScreen(domain.getDischargeDetailsForCareContext(form.getGlobalContext().Core.getCurrentCareContext())); RTLSummaryVo rTLSummary = populateRTLSummary(form.getGlobalContext().Core.getCurrentCareContext(), record); //WDEV-18622 details.setDischargeLetterStatus(DischargeLetterStatus.IN_PROGRESS); errors = details.validate(); if (errors != null && errors.length>0) { throw new CodingRuntimeException("Discharge Details should be valid !"); } DischargeReadyToLeaveVo recordReady = domain.getReadyToLeave(form.getGlobalContext().Core.getCurrentCareContext()); if (recordReady != null && recordReady.getHasPatientReceivedCopyOfDischargeIsNotNull()) { recordReady.setHasPatientReceivedCopyOfDischarge(null); errors = recordReady.validate(); if (errors != null && errors.length > 0) { throw new CodingRuntimeException("Discharge Ready To Leave should be valid !"); } } else recordReady = null; try { record = domain.saveDischargeReportDetail(record, recordReady, rTLSummary, null); //WDEV-18622 domain.saveDischargeDetails(details); } catch (StaleObjectException e) { engine.showMessage(e.getMessage()); return true; //e.printStackTrace(); } isComplete = true; form.getLocalContext().setEditedRecord(record); //-------------------- if(record.getIsClinicalDetailsComplete() == false) { setReadOnly(); form.getGlobalContext().Clinical.seteDischargeClinicalComplete(false); } //------------------------ } return true; }