Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LUI-136 : trimm off unnecesasry characters from the converted input s… #103

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mozzy11
Copy link
Member

@mozzy11 mozzy11 commented Feb 12, 2019

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

@@ -236,7 +236,11 @@
* @param conceptId the id to look for
* @return a {@link ConceptListItem} or null if conceptId is not found
*/
public ConceptListItem getConcept(Integer conceptId) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason behind changing from the integer conceptId to string phrase as the method parameter?

Copy link
Member Author

@mozzy11 mozzy11 Mar 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@mozzy11
Copy link
Member Author

mozzy11 commented Mar 15, 2019

hello @dkayiwa , made a change in the PR, i think this is a better way

@@ -76,6 +77,10 @@

})

function convert(conc){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this function doing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it converts the string(concept object) eg "concept #12" to a numeric string (concept id) eg "12"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants