コード例 #1
0
        public DiagnosisResponse DiagnosePatient(DiagnosisRequest request)
        {
            Infermedica med  = new Infermedica();
            var         read = med.DiagnosePatient(request);

            return(read);
        }
コード例 #2
0
        static InfermedicaSymptom GetSymptom(string symptomId)
        {
            string             appId       = ConfigurationManager.AppSettings["App-Id"];
            string             appKey      = ConfigurationManager.AppSettings["App-Key"];
            Infermedica        infermedica = new Infermedica(new InfermedicaDataCache(new InfermedicaDataProvider(appId, appKey), @"..\..\Cache"));
            InfermedicaSymptom symptom     = infermedica.GetSymptom(symptomId);

            return(symptom);
        }
コード例 #3
0
        static void GetInfoSample()
        {
            string          appId       = ConfigurationManager.AppSettings["App-Id"];
            string          appKey      = ConfigurationManager.AppSettings["App-Key"];
            Infermedica     infermedica = new Infermedica(new InfermedicaDataCache(new InfermedicaDataProvider(appId, appKey), @"..\..\Cache"));
            InfermedicaInfo info        = infermedica.GetInfo();

            Console.WriteLine("Last update model: {0}, Conditions count: {1}", info.LastModelUpdate, info.ConditionsCount);
        }
コード例 #4
0
        static InfermedicaCondition GetCondition(string conditionId)
        {
            string               appId       = ConfigurationManager.AppSettings["App-Id"];
            string               appKey      = ConfigurationManager.AppSettings["App-Key"];
            Infermedica          infermedica = new Infermedica(new InfermedicaDataCache(new InfermedicaDataProvider(appId, appKey), @"..\..\Cache"));
            InfermedicaCondition condition   = infermedica.GetCondition(conditionId);

            return(condition);
        }
コード例 #5
0
        public async Task <Symptom> GetGetSymptomById(string id)
        {
            Infermedica med    = new Infermedica();
            string      result = await med.GetSymptomById(id);

            var Symptom = JsonConvert.DeserializeObject <Symptom>(result);

            return(Symptom);
        }
コード例 #6
0
        static InfermedicaRiskFactor GetRiskFactor(string riskFactorId)
        {
            string                appId       = ConfigurationManager.AppSettings["App-Id"];
            string                appKey      = ConfigurationManager.AppSettings["App-Key"];
            Infermedica           infermedica = new Infermedica(new InfermedicaDataCache(new InfermedicaDataProvider(appId, appKey), @"..\..\Cache"));
            InfermedicaRiskFactor riskFactor  = infermedica.GetRiskFactor(riskFactorId);

            return(riskFactor);
        }
コード例 #7
0
        static InfermedicaLabTest GetLabTest(string labTestId)
        {
            string             appId       = ConfigurationManager.AppSettings["App-Id"];
            string             appKey      = ConfigurationManager.AppSettings["App-Key"];
            Infermedica        infermedica = new Infermedica(new InfermedicaDataCache(new InfermedicaDataProvider(appId, appKey), @"..\..\Cache"));
            InfermedicaLabTest labTest     = infermedica.GetLabTest(labTestId);

            return(labTest);
        }
コード例 #8
0
        public async Task <List <RiskFactor> > GetRiskFactors()
        {
            Infermedica med    = new Infermedica();
            string      result = await med.GetRiskFactors();

            var riskFactors = JsonConvert.DeserializeObject <List <RiskFactor> >(result)
                              ?? new List <RiskFactor>();

            return(riskFactors);
        }
コード例 #9
0
        public async Task <List <Symptom> > GetSymptoms()
        {
            Infermedica med    = new Infermedica();
            string      result = await med.GetSymptoms();

            var Symptoms = JsonConvert.DeserializeObject <List <Symptom> >(result)
                           ?? new List <Symptom>();

            return(Symptoms);
        }
コード例 #10
0
        static void GetAllRiskFactors()
        {
            string      appId       = ConfigurationManager.AppSettings["App-Id"];
            string      appKey      = ConfigurationManager.AppSettings["App-Key"];
            Infermedica infermedica = new Infermedica(new InfermedicaDataCache(new InfermedicaDataProvider(appId, appKey), @"..\..\Cache"));
            List <InfermedicaRiskFactor> riskFactors = infermedica.GetRiskFactors();

            Console.WriteLine("Risk factors count: {0}", riskFactors.Count);
            InfermedicaExport.ToCsvFile(@"riskFactors.csv", riskFactors);
        }
コード例 #11
0
        static void GetAllLabTests()
        {
            string      appId                  = ConfigurationManager.AppSettings["App-Id"];
            string      appKey                 = ConfigurationManager.AppSettings["App-Key"];
            Infermedica infermedica            = new Infermedica(new InfermedicaDataCache(new InfermedicaDataProvider(appId, appKey), @"..\..\Cache"));
            List <InfermedicaLabTest> labTests = infermedica.GetLabTests();

            Console.WriteLine("Lab tests count: {0}", labTests.Count);
            InfermedicaExport.ToCsvFile(@"labTests.csv", labTests);
        }
コード例 #12
0
        static void GetAllConditions()
        {
            string      appId       = ConfigurationManager.AppSettings["App-Id"];
            string      appKey      = ConfigurationManager.AppSettings["App-Key"];
            Infermedica infermedica = new Infermedica(new InfermedicaDataCache(new InfermedicaDataProvider(appId, appKey), @"..\..\Cache"));
            List <InfermedicaCondition> conditions = infermedica.GetConditions();

            Console.WriteLine("Conditions count: {0}", conditions.Count);
            InfermedicaExport.ToCsvFile(@"conditions.csv", conditions);
        }
コード例 #13
0
        public async Task <FullCondition> GetCondition()
        {
            var         conditionId = HttpContext.Current.Request.QueryString["conId"];
            Infermedica med         = new Infermedica();
            string      result      = await med.GetConditionById(conditionId);

            var condition = JsonConvert.DeserializeObject <FullCondition>(result)
                            ?? new FullCondition();

            return(condition);
        }
コード例 #14
0
        static List <InfermedicaSearchResponseItem> GetSearch(string phrase, Sex sex, int maxResults)
        {
            // samples
            //https://api.infermedica.com/v2/search?phrase=headache&max_results=8&type=risk_factor
            //https://api.infermedica.com/v2/search?phrase=headache&sex=male&max_results=8&type=risk_factor

            string      appId       = ConfigurationManager.AppSettings["App-Id"];
            string      appKey      = ConfigurationManager.AppSettings["App-Key"];
            Infermedica infermedica = new Infermedica(new InfermedicaDataCache(new InfermedicaDataProvider(appId, appKey), @"..\..\Cache"));

            return(infermedica.GetSearch(phrase, sex, maxResults));
        }
コード例 #15
0
        public async Task <List <Symptom> > GetFiveRandomSymptoms()
        {
            Infermedica med    = new Infermedica();
            string      result = await med.GetSymptoms();

            var Symptoms = JsonConvert.DeserializeObject <List <Symptom> >(result)
                           ?? new List <Symptom>();

            List <Symptom> sympt = new List <Symptom>();

            for (int i = 0; i < 5; i++)
            {
                sympt.Add(GetSymptom(Symptoms));
            }

            return(sympt);
        }
コード例 #16
0
        public static void TestPost()
        {
            Infermedica      med      = new Infermedica();
            DiagnosisRequest dRequest = new DiagnosisRequest();

            dRequest.age      = "25";
            dRequest.sex      = Sex.male.ToString();
            dRequest.evidence = new List <Evidence>();
            dRequest.evidence.Add(new Evidence()
            {
                id = "s_721", choice_id = ChoiceId.present.ToString()
            });
            dRequest.evidence.Add(new Evidence()
            {
                id = "s_16", choice_id = ChoiceId.present.ToString()
            });
            dRequest.evidence.Add(new Evidence()
            {
                id = "s_661", choice_id = ChoiceId.present.ToString()
            });
            //["s_721", "s_661"]
            DiagnosisResponse res = med.DiagnosePatient(dRequest);
        }
コード例 #17
0
 public static async void Fire()
 {
     Infermedica med  = new Infermedica();
     var         hold = await med.GetConditionById("c_10");
 }