private int getAndRetursValue(PainSeverity value) { if (value == null) return -1; if (value.equals(PainSeverity.NO_PAIN_AT_ALL)) return 0; else if (value.equals(PainSeverity.NORMAL_ACTIVITIES)) return 1; else if (value.equals(PainSeverity.MILD_STINGING)) return 2; else if (value.equals(PainSeverity.FEW_PROBLEMS)) return 3; else if (value.equals(PainSeverity.NOT_BAD)) return 4; else if (value.equals(PainSeverity.QUITE_BAD)) return 5; else if (value.equals(PainSeverity.CAUSES_DIFICULTIES)) return 6; else if (value.equals(PainSeverity.VERY_BAD)) return 7; else if (value.equals(PainSeverity.DISABLING)) return 9; else if (value.equals(PainSeverity.EXCRUITIATING)) return 9; else if (value.equals(PainSeverity.NO_CONTROL)) return 10; else return -1; }
private String getAndRetursTips(PainSeverity value) { if (value == null) return ""; if (value.equals(PainSeverity.NO_PAIN_AT_ALL)) return "No pain at all"; else if (value.equals(PainSeverity.NORMAL_ACTIVITIES)) return "Normal activities"; else if (value.equals(PainSeverity.MILD_STINGING)) return "Mild stinging"; else if (value.equals(PainSeverity.FEW_PROBLEMS)) return "Few problems, Do most things"; else if (value.equals(PainSeverity.NOT_BAD)) return "Moderate"; else if (value.equals(PainSeverity.QUITE_BAD)) return "Quite bad, Moderate"; else if (value.equals(PainSeverity.CAUSES_DIFICULTIES)) return "Causes difficulties, stops some things"; else if (value.equals(PainSeverity.VERY_BAD)) return "Very bad, Severe"; else if (value.equals(PainSeverity.DISABLING)) return "Disabling, Stops normal activities"; else if (value.equals(PainSeverity.EXCRUITIATING)) return "Excruciating, Worst ever"; else if (value.equals(PainSeverity.NO_CONTROL)) return "No control"; else return ""; }
protected void onImb1Click() throws PresentationLogicException { setSeverity(PainSeverity.NO_PAIN_AT_ALL); }
protected void onImb2Click() throws PresentationLogicException { setSeverity(PainSeverity.NORMAL_ACTIVITIES); }
protected void onImb3Click() throws PresentationLogicException { setSeverity(PainSeverity.MILD_STINGING); }
protected void onImb4Click() throws PresentationLogicException { setSeverity(PainSeverity.FEW_PROBLEMS); }
protected void onImb5Click() throws PresentationLogicException { setSeverity(PainSeverity.NOT_BAD); }
protected void onImb6Click() throws PresentationLogicException { setSeverity(PainSeverity.QUITE_BAD); }
protected void onImb7Click() throws PresentationLogicException { setSeverity(PainSeverity.CAUSES_DIFICULTIES); }
protected void onImb8Click() throws PresentationLogicException { setSeverity(PainSeverity.VERY_BAD); }
protected void onImb9Click() throws PresentationLogicException { setSeverity(PainSeverity.EXCRUITIATING); }
protected void onImb10Click() throws PresentationLogicException { setSeverity(PainSeverity.NO_CONTROL); }
protected void onImb11Click() throws PresentationLogicException { setSeverity(PainSeverity.DISABLING); }
private void setSeverity(PainSeverity severity) { form.txtSeverity().setValue(severity.toString()); form.getLocalContext().setSeverity(severity); }
private void listPain() { VitalSignsVoCollection voCollVitals = null; String subTitle ="", tips=""; CareContextShortVo currentCareContext = form.getGlobalContext().Core.getCurrentCareContext(); if(form.grpShowBy().getValue().equals(GenForm.grpShowByEnumeration.rdoDay)) { voCollVitals = domain.listPain(form.dteDay().getValue(),currentCareContext); subTitle = "Pain Score for " + form.dteDay().getValue().toString(DateFormat.STANDARD); } else { voCollVitals = domain.listPain(form.dteFrom().getValue(),form.dteTo().getValue(),currentCareContext); subTitle = "Pain Score between " + form.dteFrom().getValue().toString(DateFormat.STANDARD) + " - " + form.dteTo().getValue().toString(DateFormat.STANDARD); } if(voCollVitals != null) { form.grhPain().clear(); form.grhPain().setTitle(""); //form.grhPain().setSubTitle(subTitle); form.lblPainLadder().setValue(subTitle); form.grhPain().showYAxisValues(); GraphingGroup group = new GraphingGroup("Pain Score", Color.Blue, GraphicLineStyle.SOLID, form.getImages().Core.RedCircle); int nIndex = voCollVitals.size() - 1; for(int x = 0; x < voCollVitals.size(); x++) { VitalSignsVo record = voCollVitals.get(x); if (record.getPainIsNotNull()) { PainSeverity pain = record.getPain().getPain(); if (getAndRetursValue(pain) != -1) { tips = "<b>Pain Score </b>" + "<br><br>"+"<b>Date and Time:</b> "+record.getVitalsTakenDateTime()+"<br><b>"+getAndRetursTips(pain)+"<br>"+"Score = </b>"+getAndRetursValue(pain); GraphingCustomOneValue point = new GraphingCustomOneValue(group, record.getVitalsTakenDateTime(), new Float (getAndRetursValue(pain)), record, tips); form.grhPain().addPoint(point); form.grhPain().addLabelY(getAndRetursValue(pain), pain.getText()); if(form.getGlobalContext().Core.getVitalSignIsNotNull() && //WDEV-12943 form.getGlobalContext().Core.getVitalSign().getID_VitalSignsIsNotNull() &&//WDEV-12943 record.getID_VitalSigns().intValue() == form.getGlobalContext().Core.getVitalSign().getID_VitalSigns().intValue()) nIndex = x; } } } form.getLocalContext().setPains(voCollVitals); form.getLocalContext().setCurrentIndex(new Integer(nIndex)); displayCurrentPain(); } else { form.btnNext().setEnabled(false); form.btnPrev().setEnabled(false); form.getLocalContext().setPains(null); form.btnUpdate().setEnabled(false); } }
protected void onImb9Click() throws PresentationLogicException { setSeverity(PainSeverity.DISABLING); }
protected void onImb10Click() throws PresentationLogicException { setSeverity(PainSeverity.EXCRUITIATING); }
protected void onImb11Click() throws PresentationLogicException { setSeverity(PainSeverity.NO_CONTROL); }
private void setSeverity(PainSeverity severity) { form.lyrVSigns().tabSection1().lblScore().setValue("Score = " + severity.toString()); form.getLocalContext().setSeverity(severity); }