From 034335c5b58f9d40af97778a8c333e3c8a88df82 Mon Sep 17 00:00:00 2001
From: tm689 <tm689@cam.ac.uk>
Date: Wed, 7 Feb 2024 10:26:40 +0000
Subject: [PATCH] fix: updating api and fixing default values for expected
 diseases.

---
 coordinator/ProcessorSurveysWRT.py | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/coordinator/ProcessorSurveysWRT.py b/coordinator/ProcessorSurveysWRT.py
index f2c87c6..1201838 100644
--- a/coordinator/ProcessorSurveysWRT.py
+++ b/coordinator/ProcessorSurveysWRT.py
@@ -40,10 +40,12 @@ cases_severity = {
 def get_from_WRT(form_credentials: dict, startDate: str, endDate: str):
     '''Make the HTTP request, then checking the status code.'''
     
-    url = f"{form_credentials['url']}WheatRustAPI/api/Survey"
+    url = f"{form_credentials['url']}WheatRustAPI/api/Survey/GetAll"
+    #url = f"{form_credentials['url']}WheatRustAPI/api/Survey/GetByPublishedLevel"
     url += '?strStopDate=' + endDate
     url += '&strStartDate=' + startDate
     url += '&strArrayCountryID='+ form_credentials['countryID']
+    #url += '&strArrayPublishedLevel=Unpubl'
     
     # set up http session
     session = requests.Session()
@@ -137,10 +139,10 @@ def nested_to_flattened(df):
         df[i] = ""
 
     # add dedicated rust columns, with default values
-    NEW_RUST_COLUMNS = {"SR.Incident":"none","SR.Severity":"-9","SR.Reaction":"na",
-                   "LR.Incident":"none","LR.Severity":"-9","LR.Reaction":"na",
-                   "YR.Incident":"none","YR.Severity":"-9","YR.Reaction":"na",
-                   "Septoria.Incident":"none","Septoria.Severity":"0"}
+    NEW_RUST_COLUMNS = {"SR.Incident":"N","SR.Severity":"N","SR.Reaction":"N",
+                   "LR.Incident":"N","LR.Severity":"N","LR.Reaction":"N",
+                   "YR.Incident":"N","YR.Severity":"N","YR.Reaction":"N",
+                   "Septoria.Incident":"N","Septoria.Severity":"N"}
 
     for i in NEW_RUST_COLUMNS.keys():
         df[i] = NEW_RUST_COLUMNS[i]
-- 
GitLab