コード例 #1
0
        private static string GetNewPatientRecord()
        {
            // Get new Patient record
            var client = new HttpClient()
            {
                Timeout = TimeSpan.FromSeconds(5)
            };

            try
            {
                var MRSteamDetailsJson = client.GetStringAsync(FIR_Base_URL + "Patient?_sort=-_id&&_count=1").GetAwaiter().GetResult();
                // Deserialize MR response
                PatientDetails = JsonConvert.DeserializeObject <PatientRoot>(MRSteamDetailsJson);
                if (PatientDetails.entry == null)
                {
                    return(String.Empty);
                }
                return(PatientDetails.entry[0].resource.id);
            }
            catch (Exception)
            {
                return(String.Empty);
            }
        }
コード例 #2
0
        private static bool GetPatientRecord(string PatientId)
        {
            // Get patient inforamtion
            var client = new HttpClient()
            {
                Timeout = TimeSpan.FromSeconds(5)
            };

            try
            {
                var MRSteamDetailsJson = client.GetStringAsync(FIR_Base_URL + "Patient?_id=" + PatientId).GetAwaiter().GetResult();
                // Deserialize MR response
                PatientDetails = JsonConvert.DeserializeObject <PatientRoot>(MRSteamDetailsJson);
                if (PatientDetails.entry == null)
                {
                    return(false);
                }
                return(true);
            }
            catch (Exception)
            {
                return(false);
            }
        }