LUI-136 : trimm off unnecesasry characters from the converted input s…#103
LUI-136 : trimm off unnecesasry characters from the converted input s…#103mozzy11 wants to merge 1 commit intoopenmrs:masterfrom
Conversation
| * @param conceptId the id to look for | ||
| * @return a {@link ConceptListItem} or null if conceptId is not found | ||
| */ | ||
| public ConceptListItem getConcept(Integer conceptId) { |
There was a problem hiding this comment.
What is the reason behind changing from the integer conceptId to string phrase as the method parameter?
There was a problem hiding this comment.
the issue is that, the cause of the error was arising from the fact that the value to be taken as a conceptId here getConcept(Integer conceptId) was in the form say "Concept #33" for id 33, "Concept #6" for id 6, "Concept #10" for id 10. hence say "Concept #66" couldnt be taken directly as an Integer conceptid ,thats why it was throwing the javascript error described in the ticket.
So i changed it from integer to string , so that the value eg "Concept #66" be recieved as a string , then i trimm off the "Concept #" to remain with a Numeric string "66" , and then i convert it back to a concept id .which worked fine and the Javascript error is no longer thrown
|
hello @dkayiwa , made a change in the PR, i think this is a better way |
|
|
||
| }) | ||
|
|
||
| function convert(conc){ |
There was a problem hiding this comment.
it converts the string(concept object) eg "concept #12" to a numeric string (concept id) eg "12"
Ticket : https://issues.openmrs.org/browse/LUI-136
in this commit , i trimmed off unnecesary characters , so that the converted input value can remain a pure Numeric string that can be converted to a conceptId