# Getting Summary information for patients, appointments & others

**URL:** <https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114>\
**Category:** Development\
**Tags:** cohort, reporting\
**Created:** [October 17, 2019, 3:24pm UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114 "2019-10-17T15:24:12Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrameshbtech](https://talk.openmrs.org/letter_avatar/rrameshbtech/32/5_5575768a8748004e209b776fc1b2916d.png) [@rrameshbtech](https://talk.openmrs.org/u/rrameshbtech)\
**Post date:** [October 17, 2019, 3:24pm UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/1 "2019-10-17T15:24:13Z")

</div>

Hi All,

We are creating a user based custom dashboard (React based). It needs to show summary informations like number of patients registered per month, Number of missed appointments per month & other reports.

These information will be show in dashboard as line charts & summary tables.

To get those summary information, we are creating custom reports (using SQL dataset) and consuming them using rest APIs. We want to know is there any other better OpenMRS way to get summary information like this.

@mksd, @angshuonline, @wyclif

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [October 17, 2019, 6:02pm UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/2 "2019-10-17T18:02:43Z")

</div>

Hi @mseaton, would you have a sample report definition somewhere that does something like that? Like each row would be the count of the same cohort but for a different period?

The final output would be something like that:

| Period | Count |
| --- | --- |
| December | 23 |
| November | 17 |
| October | 34 |
| … | … |

---

<div class="post-metadata">

**Author:** ![dkayiwa](https://talk.openmrs.org/user_avatar/talk.openmrs.org/dkayiwa/32/179_2.png) [@dkayiwa](https://talk.openmrs.org/u/dkayiwa)\
**Post date:** [October 17, 2019, 8:34pm UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/3 "2019-10-17T20:34:48Z")

</div>

> [@rrameshbtech](#):
>
> To get those summary information, we are creating custom reports (using SQL dataset) and consuming them using rest APIs. We want to know is there any other better OpenMRS way to get summary information like this.

Did you consider this? [Reporting REST Web Services - Documentation - OpenMRS Wiki](https://wiki.openmrs.org/display/docs/Reporting+REST+Web+Services)

---

<div class="post-metadata">

**Author:** ![rrameshbtech](https://talk.openmrs.org/letter_avatar/rrameshbtech/32/5_5575768a8748004e209b776fc1b2916d.png) [@rrameshbtech](https://talk.openmrs.org/u/rrameshbtech)\
**Post date:** [October 18, 2019, 12:45am UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/4 "2019-10-18T00:45:21Z")

</div>

@dkayiwa Yes. We are already using reportingrest API for consuming the custom report we have created.

---

<div class="post-metadata">

**Author:** ![mseaton](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mseaton/32/8088_2.png) [@mseaton](https://talk.openmrs.org/u/mseaton)\
**Post date:** [October 18, 2019, 4:06pm UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/5 "2019-10-18T16:06:13Z")

</div>

@mksd, I can check but it’s possible the existing RepeatPerTimePeriodDataSetDefinition will provide what you are looking for

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [October 18, 2019, 6:38pm UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/6 "2019-10-18T18:38:11Z")

</div>

If this can be used with [`EncounterCohortDefinition`](https://github.com/openmrs/openmrs-module-reporting/blob/55b3c0f5e6bb8a0a712049a0ba3d710ab5aa12d9/api/src/main/java/org/openmrs/module/reporting/cohort/definition/EncounterCohortDefinition.java#L29) then it looks like it could be it.

@rrameshbtech I think you should stick to the SQL-based report definition for now, as long as it is tested it will be straightforward to change the implementation later on. Unless of course you have some room now to try out `RepeatPerTimePeriodDataSetDefinition` with `EncounterCohortDefinition`.

---

<div class="post-metadata">

**Author:** ![rrameshbtech](https://talk.openmrs.org/letter_avatar/rrameshbtech/32/5_5575768a8748004e209b776fc1b2916d.png) [@rrameshbtech](https://talk.openmrs.org/u/rrameshbtech)\
**Post date:** [October 19, 2019, 2:54am UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/7 "2019-10-19T02:54:59Z")

</div>

Thanks @mseaton & @mksd.

I have tried using `RepeatPerTimePeriodDataSetDefinition`. But I am unable to continue as I was not able to find any result (Shows server error in demo website when try to run a sample dataset definition ) and I unable to find any documentation to know how to use it. Is there any document which I missed?

Yes @mksd. I also hope, we can stick to SQL based report definition. It can be tested only through integration tests. Let’s check.

---

<div class="post-metadata">

**Author:** ![mksd](https://talk.openmrs.org/user_avatar/talk.openmrs.org/mksd/32/11729_2.png) [@mksd](https://talk.openmrs.org/u/mksd)\
**Post date:** [October 19, 2019, 7:11am UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/8 "2019-10-19T07:11:50Z")

</div>

By integration test you mean Spring context sensitive test? If yes then that’s fine.

For the record there’s an example here: [https://github.com/PIH/openmrs-module-mirebalaisreports/blob/8b217a270bc63909e8d7c441d334409f0fa1e3b6/api/src/main/java/org/openmrs/module/mirebalaisreports/definitions/InpatientStatsMonthlyReportManager.java#L129](https://github.com/PIH/openmrs-module-mirebalaisreports/blob/8b217a270bc63909e8d7c441d334409f0fa1e3b6/api/src/main/java/org/openmrs/module/mirebalaisreports/definitions/InpatientStatsMonthlyReportManager.java#L129)

But again we don’t have to dive into it now, we can look at this after the Spring tests are in place.

---

<div class="post-metadata">

**Author:** ![k.joseph](https://talk.openmrs.org/user_avatar/talk.openmrs.org/k.joseph/32/8097_2.png) [@k.joseph](https://talk.openmrs.org/u/k.joseph)\
**Post date:** [October 20, 2019, 12:48pm UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/9 "2019-10-20T12:48:43Z")

</div>

> [@rrameshbtech](#):
>
> We want to know is there any other better OpenMRS way to get summary information like this

are u asking if there’s any other way besides using the reporting framework?

---

<div class="post-metadata">

**Author:** ![judeniroshan](https://talk.openmrs.org/user_avatar/talk.openmrs.org/judeniroshan/32/4503_2.png) [@judeniroshan](https://talk.openmrs.org/u/judeniroshan)\
**Post date:** [October 21, 2019, 8:06am UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/10 "2019-10-21T08:06:01Z")

</div>

@rrameshbtech I guess you are looking for

> **[openmrs/openmrs-owa-builtinreports](https://github.com/openmrs/openmrs-owa-builtinreports)**
>
> Open Web App: built-in reports for OpenMRS Reference Application - openmrs/openmrs-owa-builtinreports

I would encourage, if the required reports aren’t available, we can discuss further on implementing in this existing module.

---

<div class="post-metadata">

**Author:** ![rrameshbtech](https://talk.openmrs.org/letter_avatar/rrameshbtech/32/5_5575768a8748004e209b776fc1b2916d.png) [@rrameshbtech](https://talk.openmrs.org/u/rrameshbtech)\
**Post date:** [October 21, 2019, 12:28pm UTC](https://talk.openmrs.org/t/getting-summary-information-for-patients-appointments-others/25114/11 "2019-10-21T12:28:37Z")

</div>

Yes. If any thing better & quick.
