/** * lists Skin Assessments */ public SkinAssessmentCollection listSkinAssessment(CareContextRefVo voCurrentCareContext) { if ((voCurrentCareContext == null) || (voCurrentCareContext.getID_CareContext() == null)) return null; DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer(" "); String query = "from SkinAssessment sa "; ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); String andStr = " "; hql.append(andStr + " sa.careContext.id = :rcc"); markers.add("rcc"); values.add(voCurrentCareContext.getID_CareContext()); andStr = " and "; if (markers.size() > 0) query += " where "; query += hql.toString(); List skinAssList = factory.find(query, markers, values); return SkinAssessmentAssembler.createSkinAssessmentCollectionFromSkinAssessment(skinAssList).sort(); }
private void populateInstance(CareContextShortVo voCareContext) { clearScreen(); if (voCareContext != null) { SkinAssessmentCollection skinAssVOCollection = domain.listSkinAssessment(voCareContext); if (skinAssVOCollection != null) { skinAssVOCollection = skinAssVOCollection.sort(SortOrder.DESCENDING); form.bNew().setEnabled(false); form.btnNext().setEnabled(false); form.btnPrevious().setEnabled(false); clearCombos(); //String dateTime = ""; form.comboBoxAssessment().clear(); for(int i=0; i<skinAssVOCollection.size(); i++) { if(skinAssVOCollection.get(i).getDateTimeInitiated() != null && skinAssVOCollection.get(i).getDateTimeInitiated().getDate() != null && skinAssVOCollection.get(i).getDateTimeInitiated().getTime() != null) form.comboBoxAssessment().newRow(skinAssVOCollection.get(i), skinAssVOCollection.get(i).getDateTimeInitiated().getDate().toString(DateFormat.STANDARD) + " / " + skinAssVOCollection.get(i).getDateTimeInitiated().getTime().toString(TimeFormat.DEFAULT)); } if(form.comboBoxAssessment().getValues() != null && form.comboBoxAssessment().getValues().size() > 0) { if(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment() != null) form.comboBoxAssessment().setValue(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment()); else form.comboBoxAssessment().setValue((SkinAssessment)form.comboBoxAssessment().getValues().get(0)); refreshAssessment(); } } } else form.getLocalContext().setSkinAssessment(null); }
/** * gets last Skin Assessment */ public SkinAssessment getLastSkinAssessmentByCareContext(CareContextRefVo voCurrentCareContext) { if(voCurrentCareContext == null && voCurrentCareContext.getID_CareContextIsNotNull()) throw new CodingRuntimeException("Current Care Context not available."); DomainFactory factory = getDomainFactory(); String filter = " from SkinAssessment sa "; StringBuffer filterString = new StringBuffer(); ArrayList markerNames = new ArrayList(); ArrayList markerValues = new ArrayList(); filterString.append(" where sa.careContext.id = :rcc"); markerNames.add("rcc"); markerValues.add(voCurrentCareContext.getID_CareContext()); filter += filterString.toString(); filter += " order by sa.dateTimeInitiated desc"; java.util.List skinAssess = factory.find(filter, markerNames, markerValues); SkinAssessmentCollection voSkinAssessColl = SkinAssessmentAssembler.createSkinAssessmentCollectionFromSkinAssessment(skinAssess).sort(SortOrder.DESCENDING); if(voSkinAssessColl.size() > 0) return voSkinAssessColl.get(0); return null; }
public SkinAssessment getLastSkinAssessmentByPatient(Integer idPatient) { if(idPatient == null) throw new CodingRuntimeException("Patient context not available."); DomainFactory factory = getDomainFactory(); String filter = " from SkinAssessment sa "; StringBuffer filterString = new StringBuffer(); ArrayList markerNames = new ArrayList(); ArrayList markerValues = new ArrayList(); filterString.append(" where sa.careContext.episodeOfCare.careSpell.patient.id = :idPat"); markerNames.add("idPat"); markerValues.add(idPatient); filter += filterString.toString(); java.util.List skinAssess = factory.find(filter, markerNames, markerValues); if (skinAssess != null && skinAssess.size() > 0) { SkinAssessmentCollection voSkinAssessColl = SkinAssessmentAssembler.createSkinAssessmentCollectionFromSkinAssessment(skinAssess).sort(SortOrder.DESCENDING); if(voSkinAssessColl!=null && voSkinAssessColl.size()>0) return voSkinAssessColl.get(0); } return null; }
/** * Lists the Skin Assessments */ public SkinAssessmentCollection listSkinAssessment(CareContextRefVo voCurrentCareContext) { SkinBodyChart skinDomain = (SkinBodyChart)getDomainImpl(SkinBodyChartImpl.class); return skinDomain.listSkinAssessment(voCurrentCareContext); }