med-cms 1.0.0-beta.2 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/LICENSE.txt +13 -0
  2. package/README.md +117 -0
  3. package/database/config/db-init.js +67 -53
  4. package/database/models/appointments.js +35 -20
  5. package/database/models/clinics.js +25 -13
  6. package/database/models/diseases.js +21 -13
  7. package/database/models/districts.js +55 -0
  8. package/database/models/news.js +25 -0
  9. package/database/models/user-addresses.js +21 -14
  10. package/database/models/users.js +69 -26
  11. package/database/services/admin/create-clinic.js +18 -6
  12. package/database/services/admin/db-analytics.js +42 -16
  13. package/database/services/admin/index.js +6 -6
  14. package/database/services/admin/manage-staff.js +47 -17
  15. package/database/services/doctor/conduct-exam.js +26 -20
  16. package/database/services/doctor/get-schedule.js +26 -18
  17. package/database/services/doctor/index.js +6 -6
  18. package/database/services/doctor/patient-access.js +34 -25
  19. package/database/services/patient/book-appointment.js +37 -17
  20. package/database/services/patient/calc-district.js +70 -21
  21. package/database/services/patient/get-profile.js +49 -21
  22. package/database/services/patient/index.js +5 -5
  23. package/env_init.js +55 -0
  24. package/index.d.ts +38 -24
  25. package/index.js +48 -25
  26. package/migrate-diseases.js +192 -120
  27. package/package.json +3 -3
  28. package/public/css/admin.css +80 -80
  29. package/public/css/auth.css +52 -44
  30. package/public/css/doctor.css +131 -125
  31. package/public/css/home.css +155 -0
  32. package/public/html/dashboard-admin.html +423 -101
  33. package/public/html/dashboard-doctor.html +155 -66
  34. package/public/html/dashboard-patient.html +199 -94
  35. package/public/html/home/about.html +0 -0
  36. package/public/html/home/contact.html +0 -0
  37. package/public/html/home/info.html +0 -0
  38. package/public/html/home.html +159 -0
  39. package/public/html/login.html +73 -43
  40. package/public/js/admin.js +329 -165
  41. package/public/js/auth.js +45 -41
  42. package/public/js/doctor.js +117 -103
  43. package/public/js/home.js +113 -0
  44. package/public/js/patient.js +130 -108
  45. package/server/midleware.js +33 -13
  46. package/server/permissions.js +105 -43
  47. package/server/server.js +517 -176
  48. package/README +0 -161
  49. package/test.js +0 -27
@@ -1,55 +1,63 @@
1
1
  body {
2
- font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
3
- background-color: #f0f4f8;
4
- margin: 0;
5
- display: flex;
6
- justify-content: center;
7
- align-items: center;
8
- height: 100vh;
2
+ font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
3
+ background-color: #f0f4f8;
4
+ margin: 0;
5
+ display: flex;
6
+ justify-content: center;
7
+ align-items: center;
8
+ height: 100vh;
9
9
  }
10
10
  .auth-container {
11
- background: #ffffff;
12
- padding: 30px;
13
- border-radius: 8px;
14
- box-shadow: 0 4px 15px rgba(0,0,0,0.05);
15
- width: 350px;
11
+ background: #ffffff;
12
+ padding: 30px;
13
+ border-radius: 8px;
14
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
15
+ width: 350px;
16
16
  }
17
17
  .form-group {
18
- margin-bottom: 15px;
18
+ margin-bottom: 15px;
19
19
  }
20
20
  .form-group label {
21
- display: block;
22
- margin-bottom: 5px;
23
- font-size: 14px;
24
- color: #4a5568;
25
- }
26
- .form-group input, textarea, select {
27
- width: 100%;
28
- padding: 10px;
29
- border: 1px solid #cbd5e1;
30
- border-radius: 4px;
31
- box-sizing: border-box;
32
- }
33
- .btn, .btn-save, button[type="submit"] {
34
- width: 100%;
35
- padding: 11px;
36
- background-color: #2563eb;
37
- color: white;
38
- border: none;
39
- border-radius: 4px;
40
- font-weight: bold;
41
- cursor: pointer;
42
- }
43
- .btn:hover { background-color: #1d4ed8; }
44
- .hidden { display: none !important; }
21
+ display: block;
22
+ margin-bottom: 5px;
23
+ font-size: 14px;
24
+ color: #4a5568;
25
+ }
26
+ .form-group input,
27
+ textarea,
28
+ select {
29
+ width: 100%;
30
+ padding: 10px;
31
+ border: 1px solid #cbd5e1;
32
+ border-radius: 4px;
33
+ box-sizing: border-box;
34
+ }
35
+ .btn,
36
+ .btn-save,
37
+ button[type="submit"] {
38
+ width: 100%;
39
+ padding: 11px;
40
+ background-color: #2563eb;
41
+ color: white;
42
+ border: none;
43
+ border-radius: 4px;
44
+ font-weight: bold;
45
+ cursor: pointer;
46
+ }
47
+ .btn:hover {
48
+ background-color: #1d4ed8;
49
+ }
50
+ .hidden {
51
+ display: none !important;
52
+ }
45
53
  .toggle-text {
46
- font-size: 13px;
47
- text-align: center;
48
- color: #64748b;
49
- margin-top: 15px;
54
+ font-size: 13px;
55
+ text-align: center;
56
+ color: #64748b;
57
+ margin-top: 15px;
50
58
  }
51
59
  .toggle-text span {
52
- color: #2563eb;
53
- cursor: pointer;
54
- text-decoration: underline;
60
+ color: #2563eb;
61
+ cursor: pointer;
62
+ text-decoration: underline;
55
63
  }
@@ -1,204 +1,210 @@
1
1
  /* Общие настройки интерфейса врача */
2
2
  body {
3
- font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
4
- background-color: #f1f5f9;
5
- color: #0f172a;
6
- margin: 0;
7
- padding: 0;
3
+ font-family:
4
+ "Segoe UI",
5
+ system-ui,
6
+ -apple-system,
7
+ sans-serif;
8
+ background-color: #f1f5f9;
9
+ color: #0f172a;
10
+ margin: 0;
11
+ padding: 0;
8
12
  }
9
13
 
10
14
  .dashboard {
11
- max-width: 1200px;
12
- margin: 0 auto;
13
- padding: 20px;
15
+ max-width: 1200px;
16
+ margin: 0 auto;
17
+ padding: 20px;
14
18
  }
15
19
 
16
20
  /* Шапка АРМ Врача */
17
21
  header {
18
- display: flex;
19
- justify-content: space-between;
20
- align-items: center;
21
- background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
22
- color: white;
23
- padding: 20px 30px;
24
- border-radius: 12px;
25
- box-shadow: 0 4px 15px rgba(30, 58, 138, 0.15);
26
- margin-bottom: 25px;
22
+ display: flex;
23
+ justify-content: space-between;
24
+ align-items: center;
25
+ background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
26
+ color: white;
27
+ padding: 20px 30px;
28
+ border-radius: 12px;
29
+ box-shadow: 0 4px 15px rgba(30, 58, 138, 0.15);
30
+ margin-bottom: 25px;
27
31
  }
28
32
 
29
33
  header h1 {
30
- margin: 0;
31
- font-size: 22px;
32
- font-weight: 600;
33
- letter-spacing: 0.5px;
34
+ margin: 0;
35
+ font-size: 22px;
36
+ font-weight: 600;
37
+ letter-spacing: 0.5px;
34
38
  }
35
39
 
36
40
  .btn-logout {
37
- background-color: rgba(255, 255, 255, 0.2);
38
- color: white;
39
- border: 1px solid rgba(255, 255, 255, 0.4);
40
- padding: 8px 18px;
41
- border-radius: 6px;
42
- font-weight: bold;
43
- cursor: pointer;
44
- transition: all 0.2s;
41
+ background-color: rgba(255, 255, 255, 0.2);
42
+ color: white;
43
+ border: 1px solid rgba(255, 255, 255, 0.4);
44
+ padding: 8px 18px;
45
+ border-radius: 6px;
46
+ font-weight: bold;
47
+ cursor: pointer;
48
+ transition: all 0.2s;
45
49
  }
46
50
 
47
51
  .btn-logout:hover {
48
- background-color: #ef4444;
49
- border-color: #ef4444;
52
+ background-color: #ef4444;
53
+ border-color: #ef4444;
50
54
  }
51
55
 
52
56
  /* Главный рабочий контент (Сетка) */
53
57
  .main-content {
54
- display: grid;
55
- grid-template-columns: 1fr 2fr;
56
- gap: 25px;
57
- align-items: start;
58
+ display: grid;
59
+ grid-template-columns: 1fr 2fr;
60
+ gap: 25px;
61
+ align-items: start;
58
62
  }
59
63
 
60
64
  /* Секция расписания и очереди */
61
65
  .schedule-section {
62
- background: white;
63
- padding: 20px;
64
- border-radius: 12px;
65
- box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
66
- border-top: 4px solid #3b82f6;
66
+ background: white;
67
+ padding: 20px;
68
+ border-radius: 12px;
69
+ box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
70
+ border-top: 4px solid #3b82f6;
67
71
  }
68
72
 
69
- .schedule-section h3, .exam-section h3 {
70
- margin-top: 0;
71
- margin-bottom: 15px;
72
- color: #1e3a8a;
73
- font-size: 18px;
73
+ .schedule-section h3,
74
+ .exam-section h3 {
75
+ margin-top: 0;
76
+ margin-bottom: 15px;
77
+ color: #1e3a8a;
78
+ font-size: 18px;
74
79
  }
75
80
 
76
81
  .patient-list {
77
- list-style: none;
78
- padding: 0;
79
- margin: 0;
82
+ list-style: none;
83
+ padding: 0;
84
+ margin: 0;
80
85
  }
81
86
 
82
87
  .patient-list li {
83
- display: flex;
84
- justify-content: space-between;
85
- align-items: center;
86
- padding: 12px 15px;
87
- background: #f8fafc;
88
- border: 1px solid #e2e8f0;
89
- border-radius: 8px;
90
- margin-bottom: 10px;
91
- font-size: 14px;
88
+ display: flex;
89
+ justify-content: space-between;
90
+ align-items: center;
91
+ padding: 12px 15px;
92
+ background: #f8fafc;
93
+ border: 1px solid #e2e8f0;
94
+ border-radius: 8px;
95
+ margin-bottom: 10px;
96
+ font-size: 14px;
92
97
  }
93
98
 
94
99
  .patient-list li b {
95
- color: #2563eb;
96
- background: #eff6ff;
97
- padding: 2px 6px;
98
- border-radius: 4px;
100
+ color: #2563eb;
101
+ background: #eff6ff;
102
+ padding: 2px 6px;
103
+ border-radius: 4px;
99
104
  }
100
105
 
101
106
  .btn-action {
102
- background-color: #10b981;
103
- color: white;
104
- border: none;
105
- padding: 6px 12px;
106
- border-radius: 6px;
107
- cursor: pointer;
108
- font-weight: 600;
109
- font-size: 13px;
110
- transition: background 0.2s;
107
+ background-color: #10b981;
108
+ color: white;
109
+ border: none;
110
+ padding: 6px 12px;
111
+ border-radius: 6px;
112
+ cursor: pointer;
113
+ font-weight: 600;
114
+ font-size: 13px;
115
+ transition: background 0.2s;
111
116
  }
112
117
 
113
118
  .btn-action:hover {
114
- background-color: #059669;
119
+ background-color: #059669;
115
120
  }
116
121
 
117
122
  /* Секция интерактивного осмотра */
118
123
  .exam-section {
119
- background: white;
120
- padding: 25px;
121
- border-radius: 12px;
122
- box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
123
- border-top: 4px solid #10b981;
124
+ background: white;
125
+ padding: 25px;
126
+ border-radius: 12px;
127
+ box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
128
+ border-top: 4px solid #10b981;
124
129
  }
125
130
 
126
131
  .exam-section h3 span {
127
- color: #059669;
128
- text-decoration: underline;
132
+ color: #059669;
133
+ text-decoration: underline;
129
134
  }
130
135
 
131
136
  /* Стилизация медицинских текстовых полей */
132
137
  .form-group {
133
- margin-bottom: 20px;
138
+ margin-bottom: 20px;
134
139
  }
135
140
 
136
141
  .form-group label {
137
- display: block;
138
- font-weight: 600;
139
- margin-bottom: 8px;
140
- font-size: 14px;
141
- color: #334155;
142
+ display: block;
143
+ font-weight: 600;
144
+ margin-bottom: 8px;
145
+ font-size: 14px;
146
+ color: #334155;
142
147
  }
143
148
 
144
149
  .form-group textarea {
145
- width: 100%;
146
- height: 90px;
147
- padding: 12px;
148
- border: 1px solid #cbd5e1;
149
- border-radius: 8px;
150
- font-family: inherit;
151
- font-size: 14px;
152
- box-sizing: border-box;
153
- resize: vertical;
154
- background-color: #f8fafc;
155
- }
156
-
157
- .form-group textarea:focus, .form-group select:focus {
158
- border-color: #10b981;
159
- outline: none;
160
- background-color: #fff;
161
- box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
150
+ width: 100%;
151
+ height: 90px;
152
+ padding: 12px;
153
+ border: 1px solid #cbd5e1;
154
+ border-radius: 8px;
155
+ font-family: inherit;
156
+ font-size: 14px;
157
+ box-sizing: border-box;
158
+ resize: vertical;
159
+ background-color: #f8fafc;
160
+ }
161
+
162
+ .form-group textarea:focus,
163
+ .form-group select:focus {
164
+ border-color: #10b981;
165
+ outline: none;
166
+ background-color: #fff;
167
+ box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
162
168
  }
163
169
 
164
170
  .form-group select {
165
- width: 100%;
166
- padding: 12px;
167
- border: 1px solid #cbd5e1;
168
- border-radius: 8px;
169
- font-size: 14px;
170
- background-color: #f8fafc;
171
- box-sizing: border-box;
172
- cursor: pointer;
171
+ width: 100%;
172
+ padding: 12px;
173
+ border: 1px solid #cbd5e1;
174
+ border-radius: 8px;
175
+ font-size: 14px;
176
+ background-color: #f8fafc;
177
+ box-sizing: border-box;
178
+ cursor: pointer;
173
179
  }
174
180
 
175
181
  /* Кнопка сохранения осмотра в статистику */
176
182
  .btn-save {
177
- width: 100%;
178
- padding: 14px;
179
- background: #10b981;
180
- color: white;
181
- border: none;
182
- border-radius: 8px;
183
- font-weight: bold;
184
- font-size: 15px;
185
- cursor: pointer;
186
- transition: background 0.2s;
187
- box-shadow: 0 2px 5px rgba(16, 185, 129, 0.2);
183
+ width: 100%;
184
+ padding: 14px;
185
+ background: #10b981;
186
+ color: white;
187
+ border: none;
188
+ border-radius: 8px;
189
+ font-weight: bold;
190
+ font-size: 15px;
191
+ cursor: pointer;
192
+ transition: background 0.2s;
193
+ box-shadow: 0 2px 5px rgba(16, 185, 129, 0.2);
188
194
  }
189
195
 
190
196
  .btn-save:hover {
191
- background: #059669;
197
+ background: #059669;
192
198
  }
193
199
 
194
200
  /* Служебные классы */
195
201
  .hidden {
196
- display: none !important;
202
+ display: none !important;
197
203
  }
198
204
 
199
205
  /* Адаптивность для небольших экранов */
200
206
  @media (max-width: 768px) {
201
- .main-content {
202
- grid-template-columns: 1fr;
203
- }
207
+ .main-content {
208
+ grid-template-columns: 1fr;
209
+ }
204
210
  }
@@ -0,0 +1,155 @@
1
+ /* Стили главной страницы медицинского портала */
2
+
3
+ body {
4
+ display: block;
5
+ height: auto;
6
+ margin: 0;
7
+ background-color: #f8fafc;
8
+ }
9
+
10
+ .main-header {
11
+ display: flex;
12
+ justify-content: space-between;
13
+ align-items: center;
14
+ background: white;
15
+ padding: 15px 40px;
16
+ box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
17
+ }
18
+
19
+ .logo {
20
+ font-size: 22px;
21
+ font-weight: bold;
22
+ color: #1e3a8a;
23
+ font-family: monospace;
24
+ }
25
+
26
+ .btn-login {
27
+ background-color: #2563eb;
28
+ color: white;
29
+ padding: 8px 20px;
30
+ border-radius: 6px;
31
+ text-decoration: none;
32
+ font-weight: bold;
33
+ font-size: 14px;
34
+ transition: background-color 0.2s;
35
+ }
36
+
37
+ .btn-login:hover {
38
+ background-color: #1d4ed8;
39
+ }
40
+
41
+ .nav-container {
42
+ display: flex;
43
+ justify-content: center;
44
+ gap: 15px;
45
+ margin: 25px 0;
46
+ }
47
+
48
+ .nav-btn {
49
+ background: #e2e8f0;
50
+ border: 1px solid #cbd5e1;
51
+ padding: 10px 20px;
52
+ border-radius: 6px;
53
+ cursor: pointer;
54
+ font-weight: 600;
55
+ font-size: 14px;
56
+ color: #334155;
57
+ transition: all 0.2s;
58
+ }
59
+
60
+ .nav-btn:hover {
61
+ background: #cbd5e1;
62
+ }
63
+
64
+ .nav-btn.active {
65
+ background: #2563eb;
66
+ color: white;
67
+ border-color: #2563eb;
68
+ }
69
+
70
+ .content-wrapper {
71
+ max-width: 900px;
72
+ margin: 0 auto;
73
+ padding: 0 20px;
74
+ }
75
+
76
+ .info-card {
77
+ background: white;
78
+ padding: 30px;
79
+ border-radius: 12px;
80
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
81
+ min-height: 200px;
82
+ margin-bottom: 30px;
83
+ border-left: 5px solid #2563eb;
84
+ box-sizing: border-box;
85
+ }
86
+
87
+ .info-card h2 {
88
+ margin-top: 0;
89
+ color: #1e3a8a;
90
+ }
91
+
92
+ .interactive-zone {
93
+ background: white;
94
+ padding: 25px;
95
+ border-radius: 12px;
96
+ box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
97
+ border: 2px dashed #cbd5e1;
98
+ margin-bottom: 40px;
99
+ text-align: center;
100
+ }
101
+
102
+ .interactive-zone h3 {
103
+ margin-top: 0;
104
+ color: #0f172a;
105
+ }
106
+
107
+ .interactive-zone input {
108
+ width: 80%;
109
+ max-width: 400px;
110
+ padding: 10px;
111
+ border: 1px solid #cbd5e1;
112
+ border-radius: 6px;
113
+ text-align: center;
114
+ font-size: 14px;
115
+ margin-top: 10px;
116
+ }
117
+
118
+ .interactive-zone input:focus {
119
+ border-color: #2563eb;
120
+ outline: none;
121
+ box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
122
+ }
123
+
124
+ .btn-ok {
125
+ background-color: #10b981;
126
+ color: white;
127
+ border: none;
128
+ padding: 12px 40px;
129
+ border-radius: 6px;
130
+ font-weight: bold;
131
+ cursor: pointer;
132
+ font-size: 15px;
133
+ margin-top: 15px;
134
+ transition: background-color 0.2s;
135
+ }
136
+
137
+ .btn-ok:hover {
138
+ background-color: #059669;
139
+ }
140
+
141
+ .result-box {
142
+ margin-top: 15px;
143
+ font-weight: bold;
144
+ color: #2563eb;
145
+ line-height: 1.5;
146
+ }
147
+
148
+ .main-footer {
149
+ background: #1e293b;
150
+ color: #94a3b8;
151
+ padding: 20px;
152
+ text-align: center;
153
+ font-size: 14px;
154
+ margin-top: 50px;
155
+ }