Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register
Show
Ignore:
Timestamp:
05/09/08 00:12:00 (8 months ago)
Author:
djazayeri
Message:

Reorganized options in Data Export simple column to order suggested by Cheryl and Ada. You may now pick any program, workflow, or drug set, instead of just the PIH ones. (PIH-specific hackiness still remains for relationships.)

Added BMI to patient dashboard. This should work with weights in kg/lb and heights in cm/m/in, although I've only tried for kg & cm. Make sure to set the global properties for concept.weight and concept.height.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • openmrs/trunk/src/web/org/openmrs/web/taglib/ConceptTag.java

    r4113 r4150  
    3636        // Properties accessible through tag attributes 
    3737        private Integer conceptId; 
     38        private String conceptName; 
    3839        private String var; 
    3940        private String nameVar; 
     
    4647                 
    4748                // Search for a concept by id 
    48                 c = cs.getConcept(conceptId); 
     49                if (conceptId != null) { 
     50                        c = cs.getConcept(conceptId); 
     51                } else if (conceptName != null) { 
     52                        c = cs.getConceptByName(conceptName); 
     53                } 
    4954                if (c == null) { 
    5055                        if (conceptId != null && conceptId > 0) 
    5156                                log.warn("ConceptTag is unable to find a concept with conceptId '" + conceptId + "'"); 
     57                        if (conceptName != null) 
     58                                log.warn("ConceptTag is unable to find a concept with conceptName '" + conceptName + "'"); 
    5259                        return SKIP_BODY; 
    5360                } 
     
    6673                        } 
    6774                } 
    68                 ConceptName cName = c.getName(loc); 
    69                 pageContext.setAttribute(nameVar, cName); 
    70                 log.debug("Retrieved name " + cName.getName() + ", set to variable: " + nameVar); 
     75                if (nameVar != null) { 
     76                        ConceptName cName = c.getName(loc); 
     77                        pageContext.setAttribute(nameVar, cName); 
     78                        log.debug("Retrieved name " + cName.getName() + ", set to variable: " + nameVar); 
     79                } 
    7180                 
    72                 pageContext.setAttribute(numericVar, cs.getConceptNumeric(conceptId)); 
     81                if (numericVar != null) { 
     82                        pageContext.setAttribute(numericVar, cs.getConceptNumeric(conceptId)); 
     83                } 
    7384         
    7485        // If the Concept is a Set, get members of that Set 
     
    109120                this.conceptId = conceptId; 
    110121        } 
     122 
     123        /** 
     124     * @return the conceptName 
     125     */ 
     126    public String getConceptName() { 
     127        return conceptName; 
     128    } 
     129 
     130        /** 
     131     * @param conceptName the conceptName to set 
     132     */ 
     133    public void setConceptName(String conceptName) { 
     134        this.conceptName = conceptName; 
     135    } 
    111136 
    112137        /**