Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

What this module does

Exposes the reporting module's functionality via REST web services

Documentation / How-To

Modules Required

  1. Reporting
  2. REST web services

The Reporting REST module (http://svn.openmrs.org/openmrs-modules/reportingrest/trunk/) lets you do this:

And you get back this (this is an old description, it has changed since then, see below for examples):

     {
        "metadata": {
            "columns":[
                {"name":"OpenMRS Identification Number", "label":"OpenMRS Identification Number","datatype":"java.lang.String"},

                {"name":"gender","label":"gender","datatype":"java.lang.String"},

                {"name":"age","label":"age","datatype":"java.lang.Integer"}
            ]},

        "rows":[
            {"OpenMRS Identification Number":"101-6","age":70,"gender":"M"},
            {"OpenMRS Identification Number":"100-8","age":37,"gender":"M"}
        ],
        ...
    }

Here are a few examples with their respective outputs

  • GET http://localhost:8080/midoctor/ws/rest/reporting/cohortdefinition
    {"results":[{"uuid":"72f39b6d-2ad2-4b85-8cc4-88bd292d9fb9","display":"Todos los pacientes - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/72f39b6d-2ad2-4b85-8cc4-88bd292d9fb9","rel":"self"}]},
    {"uuid":"f99c6456-1673-4fe2-b91d-4d8f4a8541e3","display":"Pacientes que escogieron track de Alimentacion - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/f99c6456-1673-4fe2-b91d-4d8f4a8541e3","rel":"self"}]},
    {"uuid":"6b2511be-b66e-4980-bf84-ae0817997bce","display":"Pacientes ingresados el ultimo dia - Pacientes ingresados el ultimo dia","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/6b2511be-b66e-4980-bf84-ae0817997bce","rel":"self"}]},
    {"uuid":"7c45ebbc-2b5d-47b7-bc08-378c598ec904","display":"Ningun paciente - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/7c45ebbc-2b5d-47b7-bc08-378c598ec904","rel":"self"}]},
    {"uuid":"3c0c4052-3d95-4fe0-9e45-474629118eb0","display":"SMS pacientes que pidieron ayuda - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/3c0c4052-3d95-4fe0-9e45-474629118eb0","rel":"self"}]},
    {"uuid":"ea359508-84f5-42e0-8128-8ab9bf3e943f","display":"SMS paciente que recibieron ayuda - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/ea359508-84f5-42e0-8128-8ab9bf3e943f","rel":"self"}]},
    {"uuid":"909989f0-dae7-494c-bd55-e428a7bd5d99","display":"Pacientes que quieren ayuda con SMS - Pacientes que quieren ayuda con SMS y no la han recibido","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/909989f0-dae7-494c-bd55-e428a7bd5d99","rel":"self"}]},
    {"uuid":"09cacab3-31c4-4926-94a9-606eeab0fed2","display":"Pacientes que escogieron track de Actividad Fisica - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/09cacab3-31c4-4926-94a9-606eeab0fed2","rel":"self"}]},
    {"uuid":"857658df-930e-453e-8458-bcf421990252","display":"Llamadas que no son la persona - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/857658df-930e-453e-8458-bcf421990252","rel":"self"}]},
    {"uuid":"a0ea0a00-0d8c-4502-9e82-fd345d4f85e3","display":"Pacientes que no asistiran a su cita - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/a0ea0a00-0d8c-4502-9e82-fd345d4f85e3","rel":"self"}]},
    {"uuid":"f2747a05-1790-428b-ae2d-f71eafff4da0","display":"Meds No tiene medicamentos - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/f2747a05-1790-428b-ae2d-f71eafff4da0","rel":"self"}]},
    {"uuid":"41bda2f2-8738-4f03-9a5e-c2543a6be91f","display":"Meds llamada realizada efectiva - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/41bda2f2-8738-4f03-9a5e-c2543a6be91f","rel":"self"}]},
    {"uuid":"5fe08129-925d-49e9-be96-e6f751b8b7eb","display":"Pacientes que no retiraron medicamentos - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/5fe08129-925d-49e9-be96-e6f751b8b7eb","rel":"self"}]},
    {"uuid":"fac4fe52-b853-42fa-80ea-d220141e7246","display":"Meds dudas sobre meds - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/fac4fe52-b853-42fa-80ea-d220141e7246","rel":"self"}]},
    {"uuid":"cdee9b23-7205-46c3-9a22-7564f6f73def","display":"Pacientes con dudas sobre medicamentos - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/cdee9b23-7205-46c3-9a22-7564f6f73def","rel":"self"}]},
    {"uuid":"47cc0d48-80c4-4df6-8f56-764e11195681","display":"Meds olvidado de tomar - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/47cc0d48-80c4-4df6-8f56-764e11195681","rel":"self"}]},
    {"uuid":"059a109c-4e07-44d5-afb6-27428caee6d6","display":"Pacientes con problemas de adherencia - ","links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/059a109c-4e07-44d5-afb6-27428caee6d6","rel":"self"}]}]}
  • GET http://localhost:8080/midoctor/ws/rest/reporting/cohort/cdee9b23-7205-46c3-9a22-7564f6f73def (cohort with no patients)
    {"uuid":"cdee9b23-7205-46c3-9a22-7564f6f73def","definition":{"uuid":"cdee9b23-7205-46c3-9a22-7564f6f73def","name":"Pacientes con dudas sobre medicamentos","description":"","parameters":[],"links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/cdee9b23-7205-46c3-9a22-7564f6f73def","rel":"self"},
    {"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/cdee9b23-7205-46c3-9a22-7564f6f73def?v=full","rel":"full"}],"resourceVersion":"1.8"},"members":[],"links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohort/cdee9b23-7205-46c3-9a22-7564f6f73def","rel":"self"}]}
  • GET http://localhost:8080/midoctor/ws/rest/reporting/cohort/857658df-930e-453e-8458-bcf421990252 (cohort with 4 patients)
    {"uuid":"857658df-930e-453e-8458-bcf421990252","definition":{"uuid":"857658df-930e-453e-8458-bcf421990252","name":"Llamadas que no son la persona","description":"","parameters":[],"links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/857658df-930e-453e-8458-bcf421990252","rel":"self"},
    {"uri":"NEED-TO-CONFIGURE/ws/reporting/cohortDefinition/857658df-930e-453e-8458-bcf421990252?v=full","rel":"full"}],"resourceVersion":"1.8"},
    "members":[{"uuid":"eeef3ef2-6307-43de-a016-9d8661efd2bb","display":"11111222-3 - Nicolas Fuentes","links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/patient/eeef3ef2-6307-43de-a016-9d8661efd2bb","rel":"self"}]},
    {"uuid":"ffc49df0-3d83-4df8-85ab-7b9cf7d8841a","display":"16859632-7 - Prueba Prueba","links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/patient/ffc49df0-3d83-4df8-85ab-7b9cf7d8841a","rel":"self"}]},
    {"uuid":"6603aa11-b3ad-46fc-aa16-8b7b1d021467","display":"844543-2 - Maria Paredes","links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/patient/6603aa11-b3ad-46fc-aa16-8b7b1d021467","rel":"self"}]},
    {"uuid":"1f83093d-3238-4a70-aacb-069c13caaed5","display":"1213-2 - Test asdsd","links":[{"uri":"NEED-TO-CONFIGURE/ws/rest/v1/patient/1f83093d-3238-4a70-aacb-069c13caaed5","rel":"self"}]}],
    "links":[{"uri":"NEED-TO-CONFIGURE/ws/reporting/cohort/857658df-930e-453e-8458-bcf421990252","rel":"self"}]}

Downloads

http://modules.openmrs.org/modules/view.jsp?module=reportingrest

Screenshots

Release Notes

Developer Notes

In 1.3 you could build the module from the code, but it would give the following error, during compiling. Darius mentioned that you should ignore all com.mchange. error messages.

ERROR - SchemaExport.execute(202) |2013-01-29 17:01:32,694| schema export unsuccessful
java.sql.SQLException: com.mchange.v2.c3p0.PoolBackedDataSource@29d9b607

  • No labels