- Timestamp:
- 05/09/08 00:12:00 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
openmrs/trunk/src/web/org/openmrs/web/taglib/ConceptTag.java
r4113 r4150 36 36 // Properties accessible through tag attributes 37 37 private Integer conceptId; 38 private String conceptName; 38 39 private String var; 39 40 private String nameVar; … … 46 47 47 48 // 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 } 49 54 if (c == null) { 50 55 if (conceptId != null && conceptId > 0) 51 56 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 + "'"); 52 59 return SKIP_BODY; 53 60 } … … 66 73 } 67 74 } 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 } 71 80 72 pageContext.setAttribute(numericVar, cs.getConceptNumeric(conceptId)); 81 if (numericVar != null) { 82 pageContext.setAttribute(numericVar, cs.getConceptNumeric(conceptId)); 83 } 73 84 74 85 // If the Concept is a Set, get members of that Set … … 109 120 this.conceptId = conceptId; 110 121 } 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 } 111 136 112 137 /**