public void open() { form.grdDiagnosisComplications().getRows().clear(); //First list Diagnosis records that were created in this care context, not marked as PRD or Co-Mordidity PatientDiagnosisEDischargeListVoCollection voPatDiagColl = domain.listDiagnosisComplicationsByPatient(form.getGlobalContext().Core.getPatientShort(), form.getGlobalContext().Core.getEpisodeofCareShort(), false, null , false); populateCurrentDiagnosisGrid(voPatDiagColl); clearInstanceControls(); //form.ctnDetails().setCollapsed(true); form.setMode(FormMode.VIEW); enableDisableInstanceControls(false); reselectSavedRecord(); //Now list all Diagnoses for Previous Care Contexts for the bottom grid. PatientDiagnosisEDischargeListVoCollection voPreviousColl = domain.listDiagnosisComplicationsByPatient(form.getGlobalContext().Core.getPatientShort(), null, Boolean.TRUE, form.getGlobalContext().Core.getEpisodeofCareShort().getStartDate(), Boolean.FALSE); populatePreviousDiagnosisGrid(voPreviousColl); updateContextMenus(); }
private void populatePreviousDiagnosisGrid(PatientDiagnosisEDischargeListVoCollection voPreviousColl) { form.grdPrevoiusDiagnosesCoMorbidites().getRows().clear(); if (voPreviousColl != null) { for (int i = 0; i < voPreviousColl.size(); i++) { boolean bAddrow = false; for (int j = 0 ; j < form.grdDiagnosisComplications().getRows().size() ; j++) { if (form.grdDiagnosisComplications().getRows().get(j).getValue().equals(voPreviousColl.get(i))) bAddrow = true; } if ( !bAddrow) { grdPrevoiusDiagnosesCoMorbiditesRow row = form.grdPrevoiusDiagnosesCoMorbidites().getRows().newRow(); PatientDiagnosisEDischargeListVo patientDiagnosisListVo = voPreviousColl.get(i); setPreviousPatientDiagnosisRowData(row, patientDiagnosisListVo); } } } }
private void constructIgnored(StringBuilder ignored, PatientDiagnosisEDischargeListVoCollection voPatDiagColl)//WDEV-12105 { if (voPatDiagColl !=null && voPatDiagColl.size()>0) { for (int i = 0 ; i < voPatDiagColl.size() ; i++) { if (voPatDiagColl.get(i)!= null && voPatDiagColl.get(i).getID_PatientDiagnosisIsNotNull()) { ignored.append(comma); comma=" ,"; ignored.append(voPatDiagColl.get(i).getID_PatientDiagnosis()); } } } }
private void populateComorbidityGrid(PatientDiagnosisEDischargeListVoCollection voPatComorbColl) { form.getLocalContext().setbExistingPrimaryComMorbidity(Boolean.FALSE); if (voPatComorbColl != null) { for (int i = 0; i < voPatComorbColl.size(); i++) { grdComorbidityRow row = form.ctnCurrentDiagnoses().grdComorbidity().getRows().newRow(); PatientDiagnosisEDischargeListVo patientComorbidListVo = voPatComorbColl.get(i); setPatientComorbRowData(row, patientComorbidListVo); } } }
private boolean isAtLeastOneComorbRelevant(PatientDiagnosisEDischargeListVoCollection collComorbidities, CareContextRefVo careContextRef) { if (collComorbidities == null) return false; for (PatientDiagnosisEDischargeListVo comorbidity : collComorbidities) { if (comorbidity.getCoMorbidityForEpisodeOfCares() != null) { for (EpisodeOfCareCoMorbidityVo episodeComorbidity : comorbidity.getCoMorbidityForEpisodeOfCares()) { if (episodeComorbidity.getIsActive() && episodeComorbidity.getCareContext().getID_CareContext().equals(careContextRef.getID_CareContext())) //WDEV-20265 return true; } } } return false; }
private void populateCurrentDiagnosisGrid(PatientDiagnosisEDischargeListVoCollection voPatDiagColl) { if (voPatDiagColl != null) { for (int i = 0; i < voPatDiagColl.size(); i++) { grdDiagnosisComplicationsRow row = form.grdDiagnosisComplications().getRows().newRow(); PatientDiagnosisEDischargeListVo patientDiagnosisListVo = voPatDiagColl.get(i); setPatientDiagnosisRowData(row, patientDiagnosisListVo); } } }
private void populateDiagnosisGrid(PatientDiagnosisEDischargeListVoCollection voPatDiagColl) { form.getLocalContext().setbExistingPrimaryDiagnosis(Boolean.FALSE); if (voPatDiagColl != null) { for (int i = 0; i < voPatDiagColl.size(); i++) { grdDiagnosesRow row = form.ctnCurrentDiagnoses().grdDiagnoses().getRows().newRow(); PatientDiagnosisEDischargeListVo patientDiagnosisListVo = voPatDiagColl.get(i); setPatientDiagnosisRowData(row, patientDiagnosisListVo); } } }
private void populateComplicationsGrid(PatientDiagnosisEDischargeListVoCollection voPatComorbColl) { if (voPatComorbColl != null) { for (int i = 0; i < voPatComorbColl.size(); i++) { grdComplicationsRow row = form.ctnCurrentDiagnoses().grdComplications().getRows().newRow(); PatientDiagnosisEDischargeListVo patientCompListVo = voPatComorbColl.get(i); setPatientComplicationRowData(row, patientCompListVo); } } }
private void updateThickBoxNosState() { if (form.chkNoComorbidities().getValue()) { form.chkNoComorbidities().setEnabled(false); } else { PatientDiagnosisEDischargeListVoCollection listComor = domain.listComorbidity(form.getGlobalContext().Core.getEpisodeofCareShort()); if (listComor == null || listComor.size()==0) { form.chkNoComorbidities().setEnabled(!form.getLocalContext().getisReadonly()&&form.getMode().equals(FormMode.EDIT)); } else { form.chkNoComorbidities().setEnabled(false); } } if (form.chkNoComplications().getValue()) { form.chkNoComplications().setEnabled(false); } else { PatientDiagnosisEDischargeListVoCollection listComp = domain.listComplications(form.getGlobalContext().Core.getEpisodeofCareShort()); if (listComp==null || listComp.size()==0) { form.chkNoComplications().setEnabled(!form.getLocalContext().getisReadonly()&&form.getMode().equals(FormMode.EDIT)); } else { form.chkNoComplications().setEnabled(false); } } }
public PatientDiagnosisEDischargeListVoCollection listComorbidity(EpisodeOfCareRefVo episodeOfCareRefVo) { DomainFactory factory = getDomainFactory(); String hql = new String(); hql = " select patdiag from PatientDiagnosis patdiag "; StringBuffer condStr = new StringBuffer(); ArrayList<String> markers = new ArrayList<String>(); ArrayList<Object> values = new ArrayList<Object>(); String andStr = " "; if (episodeOfCareRefVo != null) { condStr.append(andStr + " patdiag.careContext.episodeOfCare.id = :epsId"); markers.add("epsId"); values.add(episodeOfCareRefVo.getID_EpisodeOfCare()); andStr = " and "; condStr.append(andStr + " ( patdiag.isComorbidity = :notCommorb) "); markers.add("notCommorb"); values.add(new Boolean(true)); condStr.append(andStr + " ( patdiag.isComplication = :complication or patdiag.isComplication is null) "); markers.add("complication"); values.add(new Boolean(false)); } hql += " where "; hql += condStr.toString(); return PatientDiagnosisEDischargeListVoAssembler.createPatientDiagnosisEDischargeListVoCollectionFromPatientDiagnosis(factory.find(hql,markers,values)).sort(); }
public Boolean hasDiagnosis(EpisodeOfCareRefVo episodeOfCareRefVo) { EDischargeDiagnosisEtcComponent impl = (EDischargeDiagnosisEtcComponent) getDomainImpl(EDischargeDiagnosisEtcComponentImpl.class); PatientDiagnosisEDischargeListVoCollection coll = impl.listDiagnosis(episodeOfCareRefVo); if(coll==null || coll.size()==0) return false; return true; }
public Boolean hasComorbidity(EpisodeOfCareRefVo episodeOfCareRefVo) { EDischargeDiagnosisEtcComponent impl = (EDischargeDiagnosisEtcComponent) getDomainImpl(EDischargeDiagnosisEtcComponentImpl.class); PatientDiagnosisEDischargeListVoCollection coll = impl.listComorbidity(episodeOfCareRefVo); if(coll==null || coll.size()==0) return false; return true; }
public Boolean hasComplications(EpisodeOfCareRefVo episodeOfCareRefVo) { EDischargeDiagnosisEtcComponent impl = (EDischargeDiagnosisEtcComponent) getDomainImpl(EDischargeDiagnosisEtcComponentImpl.class); PatientDiagnosisEDischargeListVoCollection coll = impl.listComplications(episodeOfCareRefVo); if(coll==null || coll.size()==0) return false; return true; }
private RTLSummaryVo populateRTLSummary(CareContextShortVo careContext, PatientDiagnosisEDischargeListVo temp) { if (careContext == null) return null; //WDEV-19856 PatientDiagnosisEDischargeListVoCollection gridDiagnosesColl = form.ctnCurrentDiagnoses().grdDiagnoses().getValues(); if (form.getLocalContext().getWhatsBeingEditedIsNotNull() && form.getLocalContext().getWhatsBeingEdited() == ITS_DIAGNOSIS) { if (temp != null && Boolean.TRUE.equals(temp.getIsComorbidity()) && gridDiagnosesColl.contains(temp)) gridDiagnosesColl.remove(temp); } boolean wereDiagnosisDetailsEntered = Boolean.TRUE.equals(form.ctnCurrentDiagnoses().chkNoDiagnosis().getValue()) || (gridDiagnosesColl != null && gridDiagnosesColl.size() >0) || (temp!=null && !Boolean.TRUE.equals(temp.getIsComorbidity()) && !Boolean.TRUE.equals(temp.getIsComplication())); //WDEV-19856 ----ends here //WDEV-20098 //boolean wereCoMorbiditiesEntered = (form.ctnCurrentDiagnoses().grdComorbidity().getValues() != null && isAtLeastOneCoMorbidityIncluded(form.ctnCurrentDiagnoses().grdComorbidity().getValues()) || Boolean.TRUE.equals(form.ctnCurrentDiagnoses().chkNoComor().getValue()) || (temp!=null && Boolean.TRUE.equals(temp.getIsComorbidity()))); //WDEV-19820 boolean wereCoMorbiditiesEntered = (form.ctnCurrentDiagnoses().grdComorbidity().getValues() != null && isAtLeastOneCoMorbidityRelevant() || Boolean.TRUE.equals(form.ctnCurrentDiagnoses().chkNoComor().getValue()) || (temp!=null && Boolean.TRUE.equals(temp.getIsComorbidity()))); //WDEV-20282 //------------------- boolean wereComplicationsEntered = Boolean.TRUE.equals(form.ctnCurrentDiagnoses().chkNoComp().getValue()) || form.ctnCurrentDiagnoses().grdComplications().getValues() != null && form.ctnCurrentDiagnoses().grdComplications().getValues().size() > 0 || (temp!=null && Boolean.TRUE.equals(temp.getIsComplication())); RTLSummaryVo rTLSummary = domain.getRTLSummaryForCareContext(form.getGlobalContext().Core.getCurrentCareContext()); if (rTLSummary == null) { rTLSummary = new RTLSummaryVo(); } rTLSummary.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); rTLSummary.setWereDiagnosisDetailsEntered(wereDiagnosisDetailsEntered); rTLSummary.setWereCoMorbiditiesEntered(wereCoMorbiditiesEntered); rTLSummary.setWereComplicationsEntered(wereComplicationsEntered); return rTLSummary; }
private boolean isAtLeastOneCoMorbidityIncluded(PatientDiagnosisEDischargeListVoCollection values) { int rowCount = values.size(); if (rowCount == 0) return false; for (int i=0;i<rowCount;i++) { if (values.get(i) == null) continue; if (form.ctnCurrentDiagnoses().grdComorbidity().getRowByValue(values.get(i)).getColInclude()) return true; } return false; }
private void addRelevant(PatientDiagnosisEDischargeListVoCollection toSave) { if (toSave == null) throw new CodingRuntimeException("Add Relevant to what ? Null collection!"); for (int i = 0; i < form.ctnCurrentDiagnoses().grdComorbidity().getRows().size(); i++) { PatientDiagnosisEDischargeListVo voPatientComorb = form.ctnCurrentDiagnoses().grdComorbidity().getRows().get(i).getValue(); // Get value from toSave int index = toSave.indexOf(voPatientComorb); if (index != -1) voPatientComorb = toSave.get(index); voPatientComorb = relevant(voPatientComorb, form.ctnCurrentDiagnoses().grdComorbidity().getRows().get(i).getColRelevantForEpisode()); if (voPatientComorb != null) { if (index == -1) { toSave.add(voPatientComorb); } else { toSave.set(index, voPatientComorb); } } } }
public DischargeDetailsVo save(DischargeDetailsVo dd, PatientDiagnosisEDischargeListVoCollection diags, SummaryRefVo summary, RTLSummaryVo rTLSummaryVo, PatientNoDiagInfoForCCVo patientNoDiagInfo) throws DomainInterfaceException, StaleObjectException, UniqueKeyViolationException { if (diags!=null) { for (int i = 0 ; i < diags.size() ; i++) { saveDiagnosisVo(diags.get(i),summary); } } return saveDischargeDetails(dd, summary,rTLSummaryVo, patientNoDiagInfo); //WDEV-18622 }
private PatientNoDiagInfoForCCVo populatePatientNoDiagInfo(CareContextRefVo careContext, EpisodeofCareShortVo episodeOfCare, PatientRefVo patientRef) { if (careContext == null) return null; PatientDiagnosisEDischargeListVoCollection collDiagnosis = domListAll(null, episodeOfCare, false, false, null, null); if (collDiagnosis != null && collDiagnosis.size() > 0) // check if there are other dignoses recorded left return null; PatientNoDiagInfoForCCVo patientNoDiagInfo = getPatientNoDiagInfoForCareContext(careContext); if (patientNoDiagInfo != null) { AuthoringInformationVo authoringInformation = new AuthoringInformationVo(); authoringInformation.setAuthoringHcp((HcpLiteVo) getHcpLiteUser()); authoringInformation.setAuthoringDateTime(new DateTime()); patientNoDiagInfo.setAuthoringInformation(authoringInformation); patientNoDiagInfo.setCareContext(careContext); patientNoDiagInfo.setPatient(patientRef); patientNoDiagInfo.setDiagnosisStatus(PatientDiagnosisStatus.NOLONGERRELEVANT); } return patientNoDiagInfo; }
private RTLSummaryVo populateRTLSummary(PatientRefVo patientRef, CareContextRefVo careContextRef, EpisodeofCareShortVo episodeOfCare, Integer whatsBeingRecordedInError) { DischargeDetailsVo voDD = getDischargeDetails(careContextRef); RTLSummaryVo rTLSummary = getRTLSummaryForCareContext(careContextRef); if (rTLSummary==null) { rTLSummary=new RTLSummaryVo(); rTLSummary.setCareContext(careContextRef); //WDEV-19216 } else rTLSummary=(RTLSummaryVo) rTLSummary.clone(); if (whatsBeingRecordedInError== -1) //DIAGNOSIS { PatientDiagnosisEDischargeListVoCollection collDiagnosis = domListAll(null , episodeOfCare, false, false, null,null); rTLSummary.setWereDiagnosisDetailsEntered(Boolean.TRUE.equals(voDD.getHasNoDiagnosis()) || (collDiagnosis!=null && collDiagnosis.size()>0)); } else if (whatsBeingRecordedInError== -2) //COMPLICATIONS { PatientDiagnosisEDischargeListVoCollection collComplications = domListAll(null , episodeOfCare, true, false, episodeOfCare!=null ? episodeOfCare.getStartDate() : null,null); //WDEV-19845 rTLSummary.setWereComplicationsEntered(Boolean.TRUE.equals(voDD.getHasNoComplications()) || (collComplications!=null && collComplications.size()>0)); } else if (whatsBeingRecordedInError== -3) //COMORBIDITY { PatientDiagnosisEDischargeListVoCollection collComorbidities = domListAll(patientRef , null, false, true, episodeOfCare!=null ? episodeOfCare.getStartDate() : null,null); rTLSummary.setWereCoMorbiditiesEntered(Boolean.TRUE.equals(voDD.getHasNoComorbidities()) || isAtLeastOneComorbRelevant(collComorbidities, careContextRef)); //WDEV-20240 } return rTLSummary; }
public PatientDiagnosisEDischargeListVoCollection listComorbidity( EpisodeOfCareRefVo episodeofCareRefVo, CareContextRefVo careContextRefVo) { EDischargeDiagnosisEtcComponent impl = (EDischargeDiagnosisEtcComponent)getDomainImpl(EDischargeDiagnosisEtcComponentImpl.class); //return impl.listComorbidity(episodeofCareRefVo); return impl.listIncludedComorbidities(episodeofCareRefVo, careContextRefVo); //WDEV-19820 }