Created
August 20, 2016 06:19
-
-
Save ppazos/a6047f5a7c54db69f63519b3db5b4847 to your computer and use it in GitHub Desktop.
Groovy DSL test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// testing groovy DSL | |
// http://docs.groovy-lang.org/docs/latest/html/documentation/core-domain-specific-languages.html | |
COMPOSITION = 'COMPOSITION' | |
// constructor for patient's stuff | |
def create( what ) | |
{ | |
[to: { patient -> | |
switch (what) { | |
case COMPOSITION: | |
println 'creating composition for patient '+ patient | |
[uid:123123, patient: patient] | |
break | |
default: | |
println what +' not supported' | |
} | |
}] | |
} | |
def c = create COMPOSITION to '12313' | |
// set data to compo | |
// save compo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment