Beispiel #1
0
    IEnumerator FetchDiagnosisData()
    {
        // we fetch first the patients.
        UnityWebRequest www  = UnityWebRequest.Get(apiURL + "diagnosis");
        var             resp = www.SendWebRequest();

        yield return(resp);

        if (string.IsNullOrEmpty(www.error))
        {
            //Success
        }
        if (www.isNetworkError || www.isHttpError)
        {
            Debug.Log(www.error);
        }
        else
        {
            // Show results as text
            string response = www.downloadHandler.text;
            Debug.Log(response);

            // save data into patientData.json
            FileManager.SaveFile(Diagnostic.fileName, response);
            Diagnostic.All();

            // Or retrieve results as binary data
            //byte[] results = www.downloadHandler.data;
        }
    }
Beispiel #2
0
    void Start()
    {
        foreach (KeyValuePair <string, Diagnostic> k_d in Diagnostic.All())
        {
            Debug.Log(k_d.Value);
        }

        foreach (PatientDiagnosis p_d in PatientDiagnosis.All())
        {
            Debug.Log(p_d);
        }
        Patient.getAll();
    }