private BradenScale copyBradenScale(BradenScale bradenScale) { if (bradenScale == null) return null; bradenScale.clearIDAndVersion(); bradenScale.setCareContext(form.getGlobalContext().Core.getCurrentCareContext()); bradenScale.setClinicalContact(form.getGlobalContext().Core.getCurrentClinicalContact()); bradenScale.setHcpInitiated(domain.getHcpLiteUser() instanceof HcpLiteVo ? (HcpLiteVo)domain.getHcpLiteUser() : null); bradenScale.setDateTimeInitiated(new DateTime()); bradenScale.setAssessmentDetails(copyBradenScaleDetails(bradenScale.getAssessmentDetails())); return bradenScale; }
private void populateBradenScaleRecord() { CareContextRefVo careContextRefVo = form.getGlobalContext().Core.getCurrentCareContext(); BradenScale bradenScaleVo = domain.getLastCompletedBradenScale(careContextRefVo); if (bradenScaleVo != null) { addNewAssessmentRow(bradenScaleVo, "Braden Scale", bradenScaleVo.getDateTimeInitiated()); } }
private void viewAssessmentRecord() { Object value = form.grdSummary().getValue(); if (value instanceof BradenScale) { engine.open(form.getForms().Nursing.BradenScaleVIEW); } if (value instanceof MUSTVo) { engine.open(form.getForms().Nursing.MUST); } if (value instanceof PatientAssessmentListVo) { PatientAssessmentListVo voPatAsssess = (PatientAssessmentListVo) value; UserDefinedAssessmentType userDefinedAssessmentType = null; if (voPatAsssess.getAssessmentDataIsNotNull() && voPatAsssess.getAssessmentData().getGraphicIsNotNull()) userDefinedAssessmentType = voPatAsssess.getAssessmentData().getGraphic().getAssessmentType(); if (userDefinedAssessmentType != null) { if (userDefinedAssessmentType.equals(UserDefinedAssessmentType.PAINASSESSMENT)) engine.open(form.getForms().Assessment.PatientGraphicStagesPain); else if (userDefinedAssessmentType.equals(UserDefinedAssessmentType.SKINASSESSMENT)) engine.open(form.getForms().Assessment.PatientGraphicStages); } } if(value instanceof RepositioningPlanVo) { engine.open(form.getForms().Nursing.RepositioningPlan); } }
public BradenScale getLastCompletedBradenScale(CareContextRefVo voCareContextRef) { DomainFactory factory = getDomainFactory(); StringBuffer hql = new StringBuffer("from BradenScale bs"); ArrayList markers = new ArrayList(); ArrayList values = new ArrayList(); if (voCareContextRef != null) { hql.append(" where "); hql.append(" bs.careContext.id = :cc"); markers.add("cc"); values.add(voCareContextRef.getID_CareContext()); } hql.append(" order by bs.dateTimeInitiated desc "); List list = factory.find(hql.toString(), markers, values); //Get only the first record (to optimise the work of the assembler) if(list != null && list.size() > 1) { Object firstItem = list.get(0); list.removeAll(list); list.add(firstItem); } BradenScaleCollection voBradenScaleColl = BradenScaleAssembler.createBradenScaleCollectionFromBradenScale(list); if (voBradenScaleColl != null && voBradenScaleColl.size() > 0) return voBradenScaleColl.get(0); return null; }
private void printReport() { BradenScale braden = form.cmbRecordToUpdate().getValue(); if (braden == null) return; int nCol = -1; ArrayList ids = form.getLocalContext().getBradenIds(); for (int i = 0; i < ids.size(); i++) { if (braden.getID_Assessment().equals(ids.get(i))) { nCol = i; break; } } if (nCol == -1) { engine.showMessage("Internal error, could not find the Braden record to print !"); return; } String urlQueryServer = ConfigFlag.GEN.QUERY_SERVER_URL.getValue(); String urlReportServer = ConfigFlag.GEN.REPORT_SERVER_URL.getValue(); String[] obj = null; try { obj = domain.getReportAndTemplate(form.getGlobalContext().Core.getReportID(), form.getGlobalContext().Core.getTemplateID()); } catch (DomainInterfaceException e) { engine.showMessage("Error retrieving report template !\r\n" + e.getMessage()); return; } if (obj == null || obj.length == 0) { engine.showMessage("I could not get the report and template !"); return; } PatientShort ps = form.getGlobalContext().Core.getPatientShort(); QueryBuilderClient client = new QueryBuilderClient(urlQueryServer, engine.getSessionId()); client.addSeed(new SeedValue("BRADEN_ID", braden.getID_Assessment(), Integer.class)); if (ps != null) { // client.addSeed(new SeedValue("PID", ps.getHospnum().getValue(), // String.class)); ims.core.vo.PatientId id = ps.getDisplayId(); if (id != null) { client.addSeed(new SeedValue("PID", id.getValue(), String.class)); } client.addSeed(new SeedValue("AGE", ps.getAge(), Integer.class)); } addExtraSeeds(nCol, client, ps.getAge()); String resultUrl = ""; try { resultUrl = client.buildReportAsUrl(obj[0], obj[1], urlReportServer, QueryBuilderClient.PDF, "", 1); } catch (QueryBuilderClientException e1) { engine.showMessage("Error creating report: " + e1.getMessage()); return; } engine.openUrl(resultUrl); }
public Boolean isPartOfSkinAssessment(BradenScale bradenRecord) throws DomainInterfaceException { BradenScaleDialog impl = (BradenScaleDialog) getDomainImpl(BradenScaleDialogImpl.class); return impl.isPartOfSkinAssessment(bradenRecord); }
public BradenScale getLastCompletedBradenScale(CareContextRefVo careContextRefVo) { DailyPatientProgress impl = (DailyPatientProgress) getDomainImpl(DailyPatientProgressImpl.class); return impl.getLastCompletedBradenScale(careContextRefVo); }
public BradenScale getLastCompletedBradenScale(CareContextRefVo careContextRefVo) { BradenScaleVIEW BradenScaleViewImpl = (BradenScaleVIEW) getDomainImpl(BradenScaleVIEWImpl.class); return BradenScaleViewImpl.getLastCompletedBradenScale(careContextRefVo); }