redmine.tokyo 第20回勉強会にて発表した資料です(一部修正しています)
https://redmine.tokyo/issues/1230
新型コロナウイルス感染者情報管理by Redmineredmine.tokyo 第20回勉強会Ysaku, 2021/5/22
View Slide
自己紹介• 居住地: 山梨県• 業種: 製造業・生産技術• Redmine 使用歴: 約2年• 様々な業務上での課題の進捗管理に活用
目次• サイトの作成経緯• サイトの紹介• 概要• 動作環境• プラグイン• パッチ• 更新の仕組み• 山梨県• 長野県• 課題• 展望
サイトの作成経緯山梨県/新型コロナウイルス感染症に関する発生状況等https://www.pref.yamanashi.jp/koucho/coronavirus/info_coronavirus_prevention.html問題点• 関連情報の追跡が困難• 特定の情報の抽出が困難抜粋Redmine の項目に当てはめれば見やすくなるのでは…?リンクの無い数万行の文字列…ただの文字列
サイトの紹介https://cov19jp.infoTheme:• PurpleMine2Plugins:• redmine_cfreport 0.0.4※• redmine_custom_auto_complete 0.0.1• redmine_issue_title_changer 0.0.1※• redmine_message_customize 0.1.0• redmine_tags 4.0.0※• view_customize 2.7.0Patch:• QA #1192: Redmineの活動画面に、チケットの変更を全て表示する。 - Unofficial RedmineCooking - redmine.tokyo※独自カスタマイズ
サイトの紹介都道府県一覧(プロジェクト一覧)感染者一覧(チケット一覧)感染者情報(チケット)カレンダー表示
動作環境• サーバー:• Conoha VPS(最小構成: 682円/月(1.1円/時))• メモリ: 512MB• CPU: 1Core• OS:• CentOS 8• Redmine:• RedMica version 1.2.0.devel.f2cb1f1 (based on Redmine 4.1.1.devel.20401)• DB:• PostgreSQL 10.14
プラグイン• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger plugin
プラグイン一部抜粋225行のYAMLで管理• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger pluginsource:https://github.com/ishikawa999/redmine_message_customize
プラグイン• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger plugin様々なJavaScript/CSSを適用中source:https://github.com/onozaty/redmine-view-customize
プラグイン• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger plugin感染者一覧表示画面ID列非表示モバイル環境で表示を切り替えIDを題名に置き換えhttps://cov19jp.info/projects/nagano/issuessource:https://github.com/onozaty/redmine-view-customizeタイトル(〇〇例目)をIDのデザインに変更
プラグイン• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger plugin詳細表示画面履歴非表示https://cov19jp.info/issues/5340source:https://github.com/onozaty/redmine-view-customize
プラグイン• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger plugin詳細表示画面(一覧表示画面、カレンダーでも対応)https://cov19jp.info/issues/5849source:https://github.com/onozaty/redmine-view-customize
プラグイン• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger plugin症状等をタグで分類 サマリー表示(独自カスタマイズ)https://cov19jp.info/projects/nagano/issuessource:https://github.com/sk-ys/redmine_tags/tree/test
プラグインor フィルター(標準)and フィルター(独自カスタマイズ)※JavaScript 必須• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger pluginhttps://cov19jp.info/projects/nagano/issuessource:https://github.com/sk-ys/redmine_tags/tree/test
プラグイン• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger pluginテキスト書式カスタムフィールドを検索可能に(View Customize Plugin で暫定カスタマイズ)https://cov19jp.info/projects/yamanashi/issuessource:https://github.com/taikii/redmine_custom_auto_completeViewCustomize#23• 非公開(ソースコードでは確認可能)• 可能であればプラグインへ反映したい…
プラグイン• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger pluginカスタムフィールドをレポート表示…課題https://cov19jp.info/projects/nagano/issues/reportsource:https://github.com/sk-ys/redmine_cfreport
プラグイン• Redmine messagecustomize plugin• View Customize plugin• Redmine Tags• Redmine Custom Auto-Complete plugin• Redmine CFReportplugin• Redmine Issue TitleChanger plugin4031例目 - 長野県 - 新型コロナウイルス感染者情報(非公式)報告 #5340: 4031例目 - 長野県- 新型コロナウイルス感染者情報(非公式)コメント:暫定的に作成したが、汎用性を持たせたプラグインとして公開出来れば…source:https://github.com/sk-ys/redmine_issue_title_changer
パッチ• QA #1192: Redmineの活動画面に、チケットの変更を全て表示する。 -Unofficial Redmine Cooking -redmine.tokyohttps://cov19jp.info/projects/yamanashi/activity?from=2021-05-20カスタムフィールドhttps://redmine.tokyo/issues/1192
更新の仕組み - 山梨県www.pref.yamanashi.jp cov19jp.infoローカル• WEBから感染者情報を取得• 山梨県/新型コロナウイルス感染症に関する発生状況等• https://www.pref.yamanashi.jp/koucho/coronavirus/info_coronavirus_prevention.html差分確認Beautiful Soup• 情報取得経路• で情報取得~Redmineの更新を行う
例 - 山梨県 https://cov19jp.info/issues/5105↓ ※更新がある場合、書き換えとなる
例 - 山梨県 https://cov19jp.info/issues/5105↓ ※更新がある場合、書き換えとなるカテゴリーカスタムフィールド(長いテキスト)開始日期日題名関連するチケットステータス重要度感染, 回復, 死亡,回復または死亡,不明, 取り下げカスタムフィールド説明
更新の仕組み - 長野県• 以下のサイトから情報を取得• 発生状況オープンデータ• https://www.pref.nagano.lg.jp/hoken-shippei/kenko/kenko/kansensho/joho/documents/200000_nagano_covid19_patients.csv• 性別、年代、居住地、職業、感染状況、回復フラグ等• ファイルタイプ: CSV• プレスリリース一覧• https://www.pref.nagano.lg.jp/kansensho-taisaku/happyou/20210210.html• 性別、年代、居住地、職業、症状、経過、行動歴、接触者、市No.等• ファイルタイプ: PDF• データに関して• 公開方法の変更が多い• (以前はWeb、RSSから取得していた時期もあった)• フォーマットの変更が多い• PDFは表記ゆれが多いため、なるべく共通項目はCSVから取得
更新の仕組み - 長野県www.pref.nagano.lg.jpcov19jp.info差分確認長野県長野市松本市オープンデータローカルオープンデータx3PowerQuery• 情報取得経路• で情報取得~Redmineの更新を行う
Pythonでの更新の様子
例 – 長野県(松本市)https://cov19jp.info/issues/5944No 4472都道府県名 長野県市区町村名 松本市事例確定_年月日 2021/5/19患者_居住地 松本市患者_年代 20代患者_性別 女性患者_職業 自営業従業員患者_状態 無症状患者_渡航歴の有無フラグ 0患者_退院等済フラグ 0備考オープンデータPDF
No 4472都道府県名 長野県市区町村名 松本市事例確定_年月日 2021/5/19患者_居住地 松本市患者_年代 20代患者_性別 女性患者_職業 自営業従業員患者_状態 無症状患者_渡航歴の有無フラグ 0患者_退院等済フラグ 0備考例 – 長野県(松本市)https://cov19jp.info/issues/5944オープンデータPDF
課題• 一部が手動対応のまま• 県や市の更新情報の反映 … 突然フォーマットが変更になるため完全自動化が困難• 関連する感染者の追加 … 頑張ればできそう、「100~105例目」等への対応• タグの追加 … 表記ゆれへの対応、Redmine Tags プラグインのAPI対応• サマリー関連• 表示の崩れ、表示速度、モバイル最適化• サーバーが貧弱• 暫定的にJavaScript で書き換えている部分が多い → 本体のカスタマイズが必要• 更新用Python スクリプトが公開できる状態にない
展望• 対応都道府県の追加• サーバー増強• 更新者の追加• (各都道府県市町村担当者に対応いただくのが理想?)• グラフの追加• 統計情報の充実• 関連する感染者のグラフ表示• 地図表示• 新型コロナウイルスの一日も早い収束