blob: 0f5728de9aa64ee419967cc3fdfb7bd1412bff5a [file] [log] [blame]
Shivam Mishra8cdcb962020-05-06 15:19:22 +05301# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
2# License: GNU General Public License v3. See license.txt
3
4import frappe
5import json
6
7
8def get_data():
9 return frappe._dict({
10 "dashboards": get_dashboards(),
11 "charts": get_charts(),
12 })
13
14def get_dashboards():
15 return [{
16 "name": "Healthcare",
17 "dashboard_name": "Healthcare",
18 "charts": [
Rucha Mahabalfb297142020-05-18 16:28:11 +053019 { "chart": "Patient Appointments", "width": "Full"},
20 { "chart": "In-Patient Status", "width": "Half"},
21 { "chart": "Clinical Procedures Status", "width": "Half"},
22 { "chart": "Symptoms", "width": "Half"},
23 { "chart": "Diagnoses", "width": "Half"},
24 { "chart": "Department wise Patient Appointments", "width": "Full"},
25 { "chart": "Lab Tests", "width": "Full"},
Shivam Mishra8cdcb962020-05-06 15:19:22 +053026 ]
27 }]
28
29def get_charts():
30 return [
31 {
32 "doctype": "Dashboard Chart",
33 "time_interval": "Daily",
Shivam Mishra41616d42020-05-06 20:21:05 +053034 "name": "Patient Appointments",
Shivam Mishra8cdcb962020-05-06 15:19:22 +053035 "chart_name": "Patient Appointments",
36 "timespan": "Last Month",
Shivam Mishra8cdcb962020-05-06 15:19:22 +053037 "filters_json": json.dumps({}),
38 "chart_type": "Count",
39 "timeseries": 1,
40 "based_on": "appointment_datetime",
41 "owner": "Administrator",
42 "document_type": "Patient Appointment",
43 "type": "Line",
44 "width": "Half"
Rucha Mahabalfb297142020-05-18 16:28:11 +053045 },
46 {
47 "doctype": "Dashboard Chart",
48 "name": "Department wise Patient Appointments",
49 "chart_name": "Department wise Patient Appointments",
50 "chart_type": "Group By",
51 "document_type": "Patient Appointment",
52 "group_by_type": "Count",
53 "group_by_based_on": "department",
54 'is_public': 1,
55 "owner": "Administrator",
56 "type": "Bar",
57 "width": "Full",
58 "color": "#5F62F6"
59 },
60 {
61 "doctype": "Dashboard Chart",
62 "name": "Lab Tests",
63 "chart_name": "Lab Tests",
64 "chart_type": "Group By",
65 "document_type": "Lab Test",
66 "group_by_type": "Count",
67 "group_by_based_on": "template",
68 'is_public': 1,
69 "owner": "Administrator",
70 "type": "Bar",
71 "width": "Full",
72 "color": "#8548EB"
73 },
74 {
75 "doctype": "Dashboard Chart",
76 "name": "In-Patient Status",
77 "chart_name": "In-Patient Status",
78 "chart_type": "Group By",
79 "document_type": "Inpatient Record",
80 "group_by_type": "Count",
81 "group_by_based_on": "status",
82 'is_public': 1,
83 "owner": "Administrator",
84 "type": "Bar",
85 "width": "Half",
86 },
87 {
88 "doctype": "Dashboard Chart",
89 "name": "Clinical Procedures Status",
90 "chart_name": "Clinical Procedure Status",
91 "chart_type": "Group By",
92 "document_type": "Clinical Procedure",
93 "group_by_type": "Count",
94 "group_by_based_on": "status",
95 'is_public': 1,
96 "owner": "Administrator",
97 "type": "Pie",
98 "width": "Half",
99 },
100 {
101 "doctype": "Dashboard Chart",
102 "name": "Symptoms",
103 "chart_name": "Symptoms",
104 "chart_type": "Group By",
105 "document_type": "Patient Encounter Symptom",
106 "group_by_type": "Count",
107 "group_by_based_on": "complaint",
108 'is_public': 1,
109 "owner": "Administrator",
110 "type": "Percentage",
111 "width": "Half",
112 },
113 {
114 "doctype": "Dashboard Chart",
115 "name": "Diagnoses",
116 "chart_name": "Diagnoses",
117 "chart_type": "Group By",
118 "document_type": "Patient Encounter Diagnosis",
119 "group_by_type": "Count",
120 "group_by_based_on": "diagnosis",
121 'is_public': 1,
122 "owner": "Administrator",
123 "type": "Percentage",
124 "width": "Half",
Shivam Mishra8cdcb962020-05-06 15:19:22 +0530125 }
126 ]