Wiki Spaces


Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack


Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


Code Block
	// pass a list of names fromof adiagnoses listnames into a javascriptMethod
    javascriptMethod javascript Method, i use '|s|' as my splitter and then remove empty splittions
		javascriptFunction("<% listpatientSummary.diagnoses.each { d -> %>$%>|s|${}<% } %>".split(",|s|").filter(v=>v!=''));

You may be wondering what Groovy code is like. 99% of legal Java code is also legal Groovy code, but Groovy gives you a bunch of extra language constructs which allow the code to be a lot cleaner and shorter.