Guest User

Groovy Logic Rule for format dd.mm.yyyy

a guest
Aug 8th, 2016
58
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def patient = context.getPatient(patientId)
  2.  
  3. def year = patient.getBirthdate().getYear() + 1900
  4.  
  5. def yearString = year + ""
  6.  
  7. def month = patient.getBirthdate().getMonth() + 1
  8.  
  9. def monthString
  10.  
  11. if(month < 10)
  12. monthString = "0" + month + ""
  13. else
  14. monthString = month + ""
  15.  
  16. def day = patient.getBirthdate().getDay()
  17. def dayString
  18.  
  19. if(day < 10)
  20. dayString = "0"+ day + "";
  21.  
  22. else
  23. dayString = day + ""
  24.  
  25. def res = dayString + "." + monthString + "." + yearString
  26.  
  27. return new Result(res)
RAW Paste Data