Shivam Mishra | 8cdcb96 | 2020-05-06 15:19:22 +0530 | [diff] [blame] | 1 | # Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors |
| 2 | # License: GNU General Public License v3. See license.txt |
| 3 | |
| 4 | import frappe |
| 5 | import json |
| 6 | |
| 7 | |
| 8 | def get_data(): |
| 9 | return frappe._dict({ |
| 10 | "dashboards": get_dashboards(), |
| 11 | "charts": get_charts(), |
| 12 | }) |
| 13 | |
| 14 | def get_dashboards(): |
| 15 | return [{ |
| 16 | "name": "Healthcare", |
| 17 | "dashboard_name": "Healthcare", |
| 18 | "charts": [ |
| 19 | { "chart": "Patient Appointments" } |
| 20 | ] |
| 21 | }] |
| 22 | |
| 23 | def get_charts(): |
| 24 | return [ |
| 25 | { |
| 26 | "doctype": "Dashboard Chart", |
| 27 | "time_interval": "Daily", |
Shivam Mishra | 41616d4 | 2020-05-06 20:21:05 +0530 | [diff] [blame] | 28 | "name": "Patient Appointments", |
Shivam Mishra | 8cdcb96 | 2020-05-06 15:19:22 +0530 | [diff] [blame] | 29 | "chart_name": "Patient Appointments", |
| 30 | "timespan": "Last Month", |
| 31 | "color": "#77ecca", |
| 32 | "filters_json": json.dumps({}), |
| 33 | "chart_type": "Count", |
| 34 | "timeseries": 1, |
| 35 | "based_on": "appointment_datetime", |
| 36 | "owner": "Administrator", |
| 37 | "document_type": "Patient Appointment", |
| 38 | "type": "Line", |
| 39 | "width": "Half" |
| 40 | } |
| 41 | ] |