-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconvert_naracity.py
executable file
·118 lines (107 loc) · 3.49 KB
/
convert_naracity.py
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
#!/usr/bin/env python3
#-*- coding:utf-8 -*-
#
from openpyxl import load_workbook
import glob
from datetime import datetime, date, time, timedelta
import json
from common import excel_date
from pathlib import Path
from processing.patients import parse_nara_patients_list
from processing.dailystatus import parse_nara_dailystatus
#from processing.call_center import parse_call_center
#from processing.inspection_per_date import parse_inspection_per_date
#from processing.querents import parse_querents
#(inspections, inspections_summary_data, inspections_summary_labels), total_count = parse_inspection_per_date()
patients_ldate, patients_list, patients_count, stayed_count, discharge_count, death_count = parse_nara_patients_list()
patients_date, patients_summary, inspections_date, inspections_list, querents_date, querents_list, inspections_total, stayed_count, discharge_count, death_count = parse_nara_dailystatus()
#死亡者を除く
discharge_count-=death_count
# print( patients_date )
# data.json 雛形
data = {
# 陽性患者
"patients": {
"date": patients_ldate,
"data": patients_list
},
"main_summary": {
"date": patients_date,
"attr": "検査実施人数",
"value": inspections_total,
"children": [
{
"attr": "陽性患者数",
"value": patients_count,
"children": [
{
"attr": "入院/入院調整中",
"value": stayed_count,
"children": [
{
"attr": "軽症・中等症",
"value": "-"
},
{
"attr": "重症",
"value": "-"
}
]
},
{
"attr": "退院",
"value": discharge_count
},
{
"attr": "死亡",
"value": death_count
}
]
}
]
},
# 患者数
"patients_summary": {
"date": patients_date,
"data": patients_summary
},
# 検査実施数
"inspections_summary": {
"date": inspections_date,
"data": inspections_list
},
# 相談件数
"querents": {
"date": querents_date,
"data": querents_list
},
"lastUpdate": datetime.now().strftime('%Y/%m/%d %H:%M')
}
print(json.dumps(data, ensure_ascii=False ) )
"""
},
# 奈良市データ: 患者と非患者のサマリ
"patients_and_no_symptoms_summary": {
"date": datetime.now().strftime('%Y/%m/%d %H:%M'),
"data": {
"患者": patients_and_no_symptoms_summary_data_patients,
"無症状病原体保有者": patients_and_no_symptoms_summary_data_no_symptoms
},
"labels": patients_and_no_symptoms_summary_labels
},
# 退院者
"discharges_summary": {
"date": datetime.now().strftime('%Y/%m/%d %H:%M'),
"data": []
},
"discharges": {
"date": datetime.now().strftime('%Y/%m/%d %H:%M'),
"data": []
},
"inspections_summary": {
"date": datetime.now().strftime('%Y/%m/%d %H:%M'),
"data": inspections_summary_data,
"labels": inspections_summary_labels
},
}
"""