Closed wanwanland closed 4 years ago
Please bear with me to discuss this in English.
Because after working on the covert tool, I have couple things for you to decide in order to format a correct data.json
.
Feel free to translate my question or discuss in Japanese.
I know you keep change the
lastUpdate
when the data changed.
In the tool it is by default set to 8:00am of the next day.
Do you want to use the time when you create the data.json
?
https://github.com/Code-for-OKINAWA/covid19/blob/9541c28a98d708b6bce13026ff0b8ff1c56b9bb3/data/data.json#L2
The tool uses Xlsx in order to define the data by specify the area in Excel. ex. A2:J100 Would you mind to convert the csv to excel before running the convert script?
Does anyone have the excel file format that Tokyo uses?
It is displaying "-" on the website. Would you show the number from data.json
?
The tool has the processor, too.
Sorry I have so many questions.
I do have one tool that process the file correct. You can try it in my branch https://github.com/amouro/covid19/tree/feature/%23177-csv-to-data
The following steps shows how does it work.
### Step 1: convert csv to Excel
Open CSV with Excel and save it to `/tool/download/沖縄県患者発生発表数-RAW.xlsx`
### Step 2: Add a data update time to the file
This is the 更新時間 of the latest ISCO file.
The place is now in Q2, and the date was designed to a special format, in order to avoid rewrite by excel.
`#2020/04/10 18:00#`
![image](https://user-images.githubusercontent.com/3444618/78997613-de5f3300-7b81-11ea-8df1-790ab64e0ea7.png)
### Step 3: A file called 検査実施サマリ.xlsx
For the 検査実施人数 data and I assume you're going to have more data from issue #92
Please add this file.
[検査実施サマリ.xlsx](https://github.com/Code-for-OKINAWA/covid19/files/4461938/default.xlsx)
### Step 4: Setup tool ( /tool/README.md)
`$ cd tool/`
`$ composer install`
### Step 5: Run the script
`$ php convert.php`
The file `/data/data.json` will be replaced.
https://github.com/amouro/covid19/tree/feature/%23177-csv-to-data
data.json
created by the converter{
"patients": {
"date": "2020\/04\/10 19:00",
"data": [
{
"確定日": "2020-02-14T08:00:00.000Z",
"居住地": "南部保健所管内",
"年代": "60代",
"性別": "女性",
"退院": "入院勧告解除",
"備考": null,
"date": "2020-02-14"
},
{
"...": "...."
},
{
"確定日": "2020-04-10T08:00:00.000Z",
"居住地": "那覇市",
"年代": "40代",
"性別": "男性",
"退院": "入院",
"備考": null,
"date": "2020-04-10"
},
{
"確定日": "2020-04-10T08:00:00.000Z",
"居住地": "那覇市",
"年代": "50代",
"性別": "男性",
"退院": "入院",
"備考": null,
"date": "2020-04-10"
}
]
},
"patients_summary": {
"date": "2020\/04\/10 19:00",
"data": [
{
"日付": "2020-02-14T08:00:00.000Z",
"小計": 1
},
{
"日付": "2020-02-15T08:00:00.000Z",
"小計": 0
},
{
"...": "...."
},
{
"日付": "2020-04-10T08:00:00.000Z",
"小計": 7
}
]
},
"lastUpdate": "2020\/04\/10 22:59",
"main_summary": {
"attr": "検査実施人数",
"value": 333,
"children": [
{
"attr": "陽性患者数(県外感染者含む)",
"value": 50,
"children": [
{
"attr": "入院中(調整中含む)",
"value": 46,
"children": [
{
"attr": "軽症・中等症",
"value": 49
},
{
"attr": "重症",
"value": 0
}
]
},
{
"attr": "退院",
"value": 4
},
{
"attr": "死亡",
"value": 0
}
]
}
]
}
}
Make the convert tool available for CSV file.
tool/downloads/cases.csv
and tool/downloads/summary.csv
-- cases.csv - The CSV file provided by ISCO.
-- summary.csv - The last data update time and 検査実施人数@mami-miyagi I'm not sure if you want to close this issue now before we can get CSV file from ISCO server.
https://isc-okinawa.org/opendata/470007_okinawa_covid19_patients.csv
https://help.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule
https://github.com/marketplace/actions/download-file-to-workspace
@m3n3m 退院状況に「入院調整中」追加(県庁公表資料で確認) 患者_退院済フラグ データないのは入院調整中ですか? 確認お願いします。
@amouro 患者_退院済フラグ データないところは「入院調整中」です。
@m3n3m I've submit a PR to match the rule. #283
In #283 PR I also made the Github Action download the CSV
edited on 4/15
When Ayane Ish notify us that ISCO has update the CSV**
summary.csv
in 更新時間
field. Important: the converter will run only when the summary.csv has been updated.development
branchcases.csv
and data.json
I haven't add scheduled feature. Because I am not sure if we want to update it full automatic. If yes, we can discuss when to update it.
summary.csv
changed. This reduce unnecessary updates and occurrance of conflicts. 0: "入院",
1: "退院",
2: "入院調整中"
NULL: "確認中"
===========
NULL: 調査中
Map column 患者_状態
into data.json.
Reference "患者の状態を次のいずれかの文字列で記載。(不明やその他公開できない場合は空欄とする) {無症状, 軽症, 中等症, 重症, 死亡}"
レビューお願いします
I would like to merge the current feature to development if the converter is good.
And let's discuss if we want to schedule it and run it automatically in specific time.
Converter deployed. @masakifujie please consider close this issue. Thanks
やります
I'm trying to modify the tool first. So you can easily convert the csv into
/data/data.json