Index _qresult 4gl --- _qresult 4gl revision 547 _qresult 4gl working

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
Index: _qresult.4gl
===================================================================
--- _qresult.4gl (revision 547)
+++ _qresult.4gl (working copy)
@@ -5802,6 +5802,7 @@
,s_cnts ARRAY [10] OF INTEGER
,p_cnts ARRAY [10] OF INTEGER
,d_cnts ARRAY [10] OF INTEGER
+ ,osum INTEGER
LET doc_count = InputAnyPeriodDate("Результаты МЭ-контроля")
@@ -5812,7 +5813,7 @@
LET rp_file = SetReportFName()
START REPORT RptReestrPG TO rp_file
- CALL InitProgressBar("Получение результатов медико-экономического контроля", doc_count*10)
+ CALL InitProgressBar("Получение результатов медико-экономического контроля", 10)
LET i = 0
LET p__exit = FALSE
@@ -5843,7 +5844,6 @@
DECLARE d_1028b CURSOR FOR d_1028a
FOREACH d_1028b INTO cnt, col_code
- LET i = i + 1
IF col_code = 1 THEN
# поликлиника
LET p_acc_cnt = cnt
@@ -5861,10 +5861,28 @@
END IF
END IF
END IF
- CALL SetProgressBar(i)
END FOREACH
+
+ CALL SetProgressBar(1)
+
+ # сумма для проверки итога п.2
+ LET sss = "SELECT COUNT(*) FROM diags as d ",
+ " JOIN service AS s ON s.serv_id = d.serv_id ",
+ " JOIN rheader AS r ON r.ree_id = s.ree_id ",
+ " JOIN aitog_header AS a ON a.aitog_id = r.aitog_id ",
+ " WHERE ",
+ " a.pay_date BETWEEN '", date_begin, "' AND '", date_end, "' ",
+ " AND s.dsc_cod != 248"
+
+ LET osum = 0
+ PREPARE d_1030a FROM sss
+ DECLARE d_1030b CURSOR FOR d_1030a
+ OPEN d_1030b
+ FETCH FIRST d_1030b INTO osum
+ CLOSE d_1030b
-
+ CALL SetProgressBar(2)
+
# пункт 2
LET sss = "SELECT rd.code_out, rt.code_out, count(*) ",
" FROM diags AS d ",
@@ -5889,7 +5907,6 @@
END FOR
FOREACH d_1028d INTO row_code, col_code, cnt
- LET i = i + 1
LET j = row_code - 21 # индекс строки в массиве -- код строки - 21
IF col_code = 1 THEN
# поликлиника
@@ -5908,9 +5925,8 @@
END IF
END IF
END IF
- CALL SetProgressBar(i)
END FOREACH
- OUTPUT TO REPORT RptReestrPG(p_acc_cnt, s_acc_cnt, d_acc_cnt,
+ OUTPUT TO REPORT RptReestrPG(osum, p_acc_cnt, s_acc_cnt, d_acc_cnt,
p_cnts[0], p_cnts[1], p_cnts[2], p_cnts[3], p_cnts[4], p_cnts[5], p_cnts[6], p_cnts[7], p_cnts[8], p_cnts[9],
s_cnts[0], s_cnts[1], s_cnts[2], s_cnts[3], s_cnts[4], s_cnts[5], s_cnts[6], s_cnts[7], s_cnts[8], s_cnts[9],
d_cnts[0], d_cnts[1], d_cnts[2], d_cnts[3], d_cnts[4], d_cnts[5], d_cnts[6], d_cnts[7], d_cnts[8], d_cnts[9]
@@ -5928,7 +5944,7 @@
#
# RptReestrPG - Отчет-печаталка отчета по правам граждан
#
-REPORT RptReestrPG(p_acc_cnt, s_acc_cnt, d_acc_cnt,
+REPORT RptReestrPG(osum, p_acc_cnt, s_acc_cnt, d_acc_cnt,
p_cnt1, p_cnt2, p_cnt3, p_cnt4, p_cnt5, p_cnt6, p_cnt7, p_cnt8, p_cnt9, p_cnt10,
s_cnt1, s_cnt2, s_cnt3, s_cnt4, s_cnt5, s_cnt6, s_cnt7, s_cnt8, s_cnt9, s_cnt10,
d_cnt1, d_cnt2, d_cnt3, d_cnt4, d_cnt5, d_cnt6, d_cnt7, d_cnt8, d_cnt9, d_cnt10)
@@ -5946,6 +5962,7 @@
,p_cnt_sum INTEGER
,s_cnt_sum INTEGER
,d_cnt_sum INTEGER
+ ,csum,osum INTEGER
OUTPUT
LEFT MARGIN 0
@@ -5953,96 +5970,125 @@
BOTTOM MARGIN 0
PAGE LENGTH 75
+
+
FORMAT
FIRST PAGE HEADER
LET end_flag = FALSE
+ LET csum = p_cnt1+p_cnt2+p_cnt3+p_cnt4+p_cnt5+p_cnt6+p_cnt7+p_cnt8+p_cnt9+p_cnt10+
+ s_cnt1+s_cnt2+s_cnt3+s_cnt4+s_cnt5+s_cnt6+s_cnt7+s_cnt8+s_cnt9+s_cnt10+
+ d_cnt1+d_cnt2+d_cnt3+d_cnt4+d_cnt5+d_cnt6+d_cnt7+d_cnt8+d_cnt9+d_cnt10
PRINT InitPrinter17(), InitPrinter8Lines()
- PRINT "Результаты медико-экономического контроля за ", DatePeriodStr(), " (", sux.ree_type CLIPPED, ")"
+ PRINT "Результаты медико-экономического контроля за ", DatePeriodStr()
PRINT
- PRINT "+--------------------------------------------------------------------------------+"
- PRINT "| № | Поликлиника | Стационар | Дн. стац. | Всего |"
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 1. Количество актов ",
+ PRINT "+-----------------------------------------------------------------------------------+"
+ PRINT "| № | Поликлиника | Стационар | Дн. стац. | Всего |"
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 1. Количество | | | | |"
+ PRINT "| предъявленных счетов",
" | ", p_acc_cnt USING "############",
" | ", s_acc_cnt USING "############",
" | ", d_acc_cnt USING "###########",
" | ", p_acc_cnt + s_acc_cnt + d_acc_cnt USING "###########",
" |"
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2. Всего нарушений ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2. Всего нарушений, ",
" | ", p_cnt1+p_cnt2+p_cnt3+p_cnt4+p_cnt5+p_cnt6+p_cnt7+p_cnt8+p_cnt9+p_cnt10 USING "###########&",
- " | ", s_cnt1+s_cnt2+s_cnt3+s_cnt4+s_cnt5+s_cnt6+s_cnt7+s_cnt8+s_cnt9+s_cnt10 USING "############",
- " | ", d_cnt1+d_cnt2+d_cnt3+d_cnt4+d_cnt5+d_cnt6+d_cnt7+d_cnt8+d_cnt9+d_cnt10 USING "###########",
- " | ", p_cnt1+p_cnt2+p_cnt3+p_cnt4+p_cnt5+p_cnt6+p_cnt7+p_cnt8+p_cnt9+p_cnt10+
- s_cnt1+s_cnt2+s_cnt3+s_cnt4+s_cnt5+s_cnt6+s_cnt7+s_cnt8+s_cnt9+s_cnt10+
- d_cnt1+d_cnt2+d_cnt3+d_cnt4+d_cnt5+d_cnt6+d_cnt7+d_cnt8+d_cnt9+d_cnt10 USING "###########",
+ " | ", s_cnt1+s_cnt2+s_cnt3+s_cnt4+s_cnt5+s_cnt6+s_cnt7+s_cnt8+s_cnt9+s_cnt10 USING "###########&",
+ " | ", d_cnt1+d_cnt2+d_cnt3+d_cnt4+d_cnt5+d_cnt6+d_cnt7+d_cnt8+d_cnt9+d_cnt10 USING "##########&",
+ " | ", csum USING "##########&",
" | "
+ # проверка, что посчитанная сумма (csum) совпадает с фактической (osum)
+# IF csum <> osum THEN
+ LET tmp_str = "(", osum USING "########&", ")"
+# ELSE
+# LET tmp_str = " "
+# END IF
+ PRINT "| в том числе: | | | | ", tmp_str, " |"
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2.1 ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2.1 Правильность | | | | |"
+ PRINT " оформления реестров | | | | |"
+ PRINT " счетов ",
" | ", p_cnt1 USING "###########&",
- " | ", s_cnt1 USING "############",
- " | ", d_cnt1 USING "###########",
- " | ", p_cnt1 + s_cnt1 + d_cnt1 USING "###########",
+ " | ", s_cnt1 USING "###########&",
+ " | ", d_cnt1 USING "##########&",
+ " | ", p_cnt1 + s_cnt1 + d_cnt1 USING "##########&",
" | "
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2.2 ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2.2 Принадлежность | | | | |"
+ PRINT " застрахованных к СМО",
" | ", p_cnt2 USING "###########&",
- " | ", s_cnt2 USING "############",
- " | ", d_cnt2 USING "###########",
- " | ", p_cnt2 + s_cnt2 + d_cnt2 USING "###########",
+ " | ", s_cnt2 USING "###########&",
+ " | ", d_cnt2 USING "##########&",
+ " | ", p_cnt2 + s_cnt2 + d_cnt2 USING "##########&",
" | "
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2.3 ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2.3 Определения кода | | | | |"
+ PRINT " услуги или шифра МКБ",
" | ", p_cnt3 USING "###########&",
- " | ", s_cnt3 USING "############",
- " | ", d_cnt3 USING "###########",
- " | ", p_cnt3 + s_cnt3 + d_cnt3 USING "###########",
+ " | ", s_cnt3 USING "###########&",
+ " | ", d_cnt3 USING "##########&",
+ " | ", p_cnt3 + s_cnt3 + d_cnt3 USING "##########&",
" | "
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2.4 ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2.4 Включение в реестр | | | | |"
+ PRINT "| счетов услуг, | | | | |"
+ PRINT "| не входящих | | | | |"
+ PRINT "| в территориальную | | | | |"
+ PRINT "| программу ОМС ",
" | ", p_cnt4 USING "###########&",
- " | ", s_cnt4 USING "############",
- " | ", d_cnt4 USING "###########",
- " | ", p_cnt4 + s_cnt4 + d_cnt4 USING "###########",
+ " | ", s_cnt4 USING "###########&",
+ " | ", d_cnt4 USING "##########&",
+ " | ", p_cnt4 + s_cnt4 + d_cnt4 USING "##########&",
" | "
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2.5 ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2.5 Включение в реестр | | | | |"
+ PRINT "| счетов не лицензир. | | | | |"
+ PRINT "| видов медицинской | | | | |"
+ PRINT "| деятельности ",
" | ", p_cnt5 USING "###########&",
- " | ", s_cnt5 USING "############",
- " | ", d_cnt5 USING "###########",
- " | ", p_cnt5 + s_cnt5 + d_cnt5 USING "###########",
+ " | ", s_cnt5 USING "###########&",
+ " | ", d_cnt5 USING "##########&",
+ " | ", p_cnt5 + s_cnt5 + d_cnt5 USING "##########&",
" | "
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2.6 ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2.6 Применение тарифа, | | | | |"
+ PRINT "| не соответствующего | | | | |"
+ PRINT "| утвержденному ",
" | ", p_cnt6 USING "###########&",
- " | ", s_cnt6 USING "############",
- " | ", d_cnt6 USING "###########",
- " | ", p_cnt6 + s_cnt6 + d_cnt6 USING "###########",
+ " | ", s_cnt6 USING "###########&",
+ " | ", d_cnt6 USING "##########&",
+ " | ", p_cnt6 + s_cnt6 + d_cnt6 USING "##########&",
" | "
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2.7 ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2.7 Необоснованное | | | | |"
+ PRINT "| отнесение мед. | | | | |"
+ PRINT "| услуги к более | | | | |"
+ PRINT "| дорогостоящей ",
" | ", p_cnt7 USING "###########&",
- " | ", s_cnt7 USING "############",
- " | ", d_cnt7 USING "###########",
- " | ", p_cnt7 + s_cnt7 + d_cnt7 USING "###########",
+ " | ", s_cnt7 USING "###########&",
+ " | ", d_cnt7 USING "##########&",
+ " | ", p_cnt7 + s_cnt7 + d_cnt7 USING "##########&",
" | "
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2.8 ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2.8 Повторное включение | | | | |"
+ PRINT "| в счет одной и | | | | |"
+ PRINT "| той же мед. услуги ",
" | ", p_cnt8 USING "###########&",
- " | ", s_cnt8 USING "############",
- " | ", d_cnt8 USING "###########",
- " | ", p_cnt8 + s_cnt8 + d_cnt8 USING "###########",
+ " | ", s_cnt8 USING "###########&",
+ " | ", d_cnt8 USING "##########&",
+ " | ", p_cnt8 + s_cnt8 + d_cnt8 USING "##########&",
" | "
- PRINT "|----------------------|--------------|--------------|-------------|-------------|"
- PRINT "| 2.9 ",
+ PRINT "|-------------------------|--------------|--------------|-------------|-------------|"
+ PRINT "| 2.9 Другие нарушения ",
" | ", p_cnt9 USING "###########&",
- " | ", s_cnt9 USING "############",
- " | ", d_cnt9 USING "###########",
- " | ", p_cnt9 + s_cnt9 + d_cnt9 USING "###########",
+ " | ", s_cnt9 USING "###########&",
+ " | ", d_cnt9 USING "##########&",
+ " | ", p_cnt9 + s_cnt9 + d_cnt9 USING "##########&",
" | "
- PRINT "+---------------------------------------------------------------------------------+"
+ PRINT "+-----------------------------------------------------------------------------------+"
{
"+--------------------------------------------------------------------------------+"