I would suggest you look at this and for the second question I would suggest you go with RestApi because it’s the easiest way to extract data from the database…however if you understand the OpenMrs database structure well then you could even write your personal raw SQL code( an example of that is if you use an API in the administrationService.executeSQL See here Nice coding
1 Like