From a0bc0fe505ec6edbf735bb9744f0140a1e678419 Mon Sep 17 00:00:00 2001 From: mozzy11 Date: Tue, 12 Feb 2019 17:43:04 +0300 Subject: [PATCH] LUI-136 : trimm off unnecesasry characters from the converted input string LUI-136 : adding comments --- .../main/java/org/openmrs/web/dwr/DWRConceptService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/omod/src/main/java/org/openmrs/web/dwr/DWRConceptService.java b/omod/src/main/java/org/openmrs/web/dwr/DWRConceptService.java index 1b5b0c41..97965360 100644 --- a/omod/src/main/java/org/openmrs/web/dwr/DWRConceptService.java +++ b/omod/src/main/java/org/openmrs/web/dwr/DWRConceptService.java @@ -236,7 +236,11 @@ public List findBatchOfConcepts(String phrase, boolean includeRetired, L * @param conceptId the id to look for * @return a {@link ConceptListItem} or null if conceptId is not found */ - public ConceptListItem getConcept(Integer conceptId) { + public ConceptListItem getConcept(String phrase) { + + //trimming off unnecesarry characters to remain with a Pure Numeric String that can be converted to ConceptId + String numeric_phrase = phrase.replaceAll("Concept #", "").trim(); + Integer conceptId = Integer.valueOf(numeric_phrase); Locale locale = Context.getLocale(); ConceptService cs = Context.getConceptService(); Concept c = cs.getConcept(conceptId);