diff --git a/site/common/database.php b/site/common/database.php index 9cc314e..fa054a0 100644 --- a/site/common/database.php +++ b/site/common/database.php @@ -337,7 +337,7 @@ function getRegions($dbh, &$output, $userID) { if(getEpiweekInfo($dbh, $temp) !== 1) { return getResult($temp); } - $result = $dbh->query("SELECT r.`id`, r.`name`, r.`states`, r.`population`, CASE WHEN s.`user_id` IS NULL THEN FALSE ELSE TRUE END `completed` FROM ec_fluv_regions r LEFT JOIN ec_fluv_submissions s ON s.`user_id` = {$userID} AND s.`region_id` = r.`id` AND s.`epiweek_now` = {$temp['epiweek']['round_epiweek']} ORDER BY r.`id` ASC"); + $result = $dbh->query("SELECT r.`id`, r.`fluview_name`, r.`name`, r.`states`, r.`population`, CASE WHEN s.`user_id` IS NULL THEN FALSE ELSE TRUE END `completed` FROM ec_fluv_regions r LEFT JOIN ec_fluv_submissions s ON s.`user_id` = {$userID} AND s.`region_id` = r.`id` AND s.`epiweek_now` = {$temp['epiweek']['round_epiweek']} ORDER BY r.`id` ASC"); $regions = array(); while($row = $result->fetch_assoc()) { if ($row['name'] == "ny_minus_jfk") { @@ -347,7 +347,8 @@ function getRegions($dbh, &$output, $userID) { } $region = array( - 'id' => intval($row['id']), + 'id' => intval($row['id']), + 'fluview_name' => $row['fluview_name'], 'name' => $region_name, 'states' => $row['states'], 'population' => intval($row['population']), diff --git a/site/common/header.php b/site/common/header.php index 9fec30c..27d1d96 100644 --- a/site/common/header.php +++ b/site/common/header.php @@ -52,7 +52,7 @@ <COVID-19 Edition> -
Epidemiological Forecasting by DELPHI
+
Epidemiological Forecasting by DELPHI
'); - createLink('DELPHI', 'https://delphi.midas.cs.cmu.edu/', true, 'delphi'); + createLink('DELPHI', 'https://delphi.cmu.edu/', true, 'delphi'); print(''); ?> diff --git a/site/css/style.php b/site/css/style.php index 49ecdc0..d50d355 100644 --- a/site/css/style.php +++ b/site/css/style.php @@ -351,6 +351,11 @@ padding-top: 10px; float: right; } + +div.sidebar_entry i.fa {margin-right:5px} +div.sidebar_region {margin-left:15px} +div.sidebar_region i.fa {margin-right:5px} + div.box_scroll_test { width: 100%; height: 100%; diff --git a/site/forecast.php b/site/forecast.php index 4d671ba..5f5f909 100644 --- a/site/forecast.php +++ b/site/forecast.php @@ -1,5 +1,5 @@ 201020) { - $maxRegionalWILI = max($maxRegionalWILI, $region['history']['wili'][$i]); - $minRegionalWILI = min($minRegionalWILI, $region['history']['wili'][$i]); - } -} -max($region['history']['wili']); // what is this for? -kmm -$target = $seasonStart; -$seasonOffsets = array(); -$seasonYears = array(); -for($i = count($region['history']['date']) - 1; $i >= 0; $i--) { - if($region['history']['date'][$i] <= $target) { - array_push($seasonOffsets, $i); - array_push($seasonYears, intval($target / 100)); - $target -= 100; - } -} -if($seasonOffsets[count($seasonOffsets) - 1] != 0) { - array_push($seasonOffsets, 0); - array_push($seasonYears, intval($target / 100)); -} -$seasonOffsets = array_reverse($seasonOffsets); -$seasonYears = array_reverse($seasonYears); -// okay for international and COVID-19 data, we're going to treat them -// as magic additional seasons with years that start with some absurd -// number (maybe we have a limited number of other sources and each -// source can get its own absurd prefix e.g. 9xxx=COVID-19, 8xxx=ECDC, -// etc). These will be added after the year-based calculations from -// the block above. -// -// We also want to make sure the not-actually-WILI data shakes out in -// the correct order for when we fill the `pastWili` javascript array -// with it in a minute. -// -// Maybe we want to make the set of additional data selectable in the -// future, but for now it has to be hard-coded. - -// A rough sketch: -// sources = { -// "COVID-19":{"Italy":9001, "Spain":9002, "France":9003, "USA":9010}, -// "ECDC":{"Italy":80012019, "Spain":80022019, "France":80032019}, #ECDC publishes the last two seasons, for now we just want 2019-2020 but maybe we'll want both later? Will SK and UK have multiple seasons of ILI data too? -// "SKorea":{"South Korea":70002019}, -// "UK":{"UK":60002019} -// } - - - -$sources = array( - "ECDC" => array( - "fn" => "getECDCILI", - "key" => "ecdc", - "members" => array( - //"Italy" => 8001, - //"Spain" => 8002, - //"France" => 8003, - //"Netherlands" => 8004, - //"Ireland" => 8005, - //"UK - Scotland" => 8006, - //"Belgium" => 8007, - ))); -$sourceIDs = array(); -foreach($sources["ECDC"]["members"] as $country => $cid) { - $sourceIDs[$cid] = $country.", ECDC"; -} - - -// $lastOffset = $seasonOffsets[end] -// for $src,$map in $sources { -// for $name,$rid in $map { -// push $output['regions'][$rid]['history'] onto the end of $region['history'] -// push $lastOffset + count($output['regions'][$rid]['history']['date'] onto the end of $seasonOffsets -// push $rid onto the end of $seasonYears -// } -// } - - -$lastOffset_i = count($seasonOffsets); -$currentYear = $seasonYears[$lastOffset_i-1]; -$lastHistory_i = count($region['history']['date']); -$nextOffset = $lastHistory_i; -foreach ($sources as $src => $meta) { - $fn = $meta["fn"]; - foreach ($meta["members"] as $name => $rid) { - $fn($dbh, $output, $rid, $seasonStart+5); // hard-coded for now; ECDC counts seasons from epiweek 40 - - $n = count($output[$meta["key"]][$rid]["date"]); -?> - -  You can edit any part of your forecast by redrawing just that part.
   You can adjust a single point by dragging it up or down.
The animation below demonstrates these actions. - (If you don't see the animation, click here.) + (If you don't see the animation, click here.)