Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            string username  = ConfigurationManager.AppSettings["username"];
            string password  = ConfigurationManager.AppSettings["password"];
            string authUrl   = ConfigurationManager.AppSettings["priaid_authservice_url"];
            string healthUrl = ConfigurationManager.AppSettings["priaid_healthservice_url"];
            string language  = ConfigurationManager.AppSettings["language"];

            CheckRequiredArgs(username, password, authUrl, healthUrl, language);

            _diagnosisClient = new DiagnosisClient(username, password, authUrl, language, healthUrl);

            Simulate();

            Exit();
        }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {
            string username = ConfigurationManager.AppSettings["username"];
            string password = ConfigurationManager.AppSettings["password"];
            string authUrl = ConfigurationManager.AppSettings["priaid_authservice_url"];
            string healthUrl = ConfigurationManager.AppSettings["priaid_healthservice_url"];
            string language = ConfigurationManager.AppSettings["language"];

            CheckRequiredArgs(username, password, authUrl, healthUrl, language);

            _diagnosisClient = new DiagnosisClient(username, password, authUrl, language, healthUrl);

            Simulate();

            Exit();
        }
Ejemplo n.º 3
0
        private List <HealthDiagnosis> GetDiseases(string[] symptoms)
        {
            string username  = ConfigurationManager.AppSettings["username"];
            string password  = ConfigurationManager.AppSettings["password"];
            string authUrl   = ConfigurationManager.AppSettings["priaid_authservice_url"];
            string healthUrl = ConfigurationManager.AppSettings["priaid_healthservice_url"];
            string language  = ConfigurationManager.AppSettings["language"];

            var _diagnosisClient = new DiagnosisClient(username, password, authUrl, language, healthUrl);

            var allIssues = _diagnosisClient.LoadSymptoms();

            var matchedIssues = new List <HealthItem>();

            foreach (var symtom in symptoms)
            {
                matchedIssues.AddRange(allIssues.Where(x => x.Name.ToLower().Contains(symtom.ToLower())));
            }

            var symtomIds = new List <int>();

            foreach (var issue in matchedIssues)
            {
                symtomIds.Add(issue.ID);
            }

            var diseases = new List <HealthDiagnosis>();

            if (symtomIds != null && symtomIds.Count > 0)
            {
                diseases = _diagnosisClient.LoadDiagnosis(symtomIds.Take(1).ToList(), Gender.Male, 1977);
            }


            return(diseases);
        }