Skip to content

Commit a0bc0fe

Browse files
committed
LUI-136 : trimm off unnecesasry characters from the converted input string
LUI-136 : adding comments
1 parent 521d14f commit a0bc0fe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

omod/src/main/java/org/openmrs/web/dwr/DWRConceptService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,11 @@ public List<Object> findBatchOfConcepts(String phrase, boolean includeRetired, L
236236
* @param conceptId the id to look for
237237
* @return a {@link ConceptListItem} or null if conceptId is not found
238238
*/
239-
public ConceptListItem getConcept(Integer conceptId) {
239+
public ConceptListItem getConcept(String phrase) {
240+
241+
//trimming off unnecesarry characters to remain with a Pure Numeric String that can be converted to ConceptId
242+
String numeric_phrase = phrase.replaceAll("Concept #", "").trim();
243+
Integer conceptId = Integer.valueOf(numeric_phrase);
240244
Locale locale = Context.getLocale();
241245
ConceptService cs = Context.getConceptService();
242246
Concept c = cs.getConcept(conceptId);

0 commit comments

Comments
 (0)