Exemplo n.º 1
0
    public static void Main(string[] args)
    {
        //REGISTRO DE DOENÇAS E SINTOMAS
        Doença dengue = new Doença("1", "dengue", "sintDengue");
        Doença rinite = new Doença("2", "rinite", "sintRinite");
        Doença virose = new Doença("3", "virose", "sintVirose");

        //CADASTRO PACIENTE
        Paciente paciente = new Paciente();

        paciente = CadastrarPaciente();

        //COMPARAR SINTOMAS DO PACIENTE COM SINTOMAS DE TODAS AS DOENÇAS CADASTRADAS
        string[] sintPaciente = paciente.getSintomas();

        string[] sintDengue = dengue.getSintomas();
        int      numDengue  = CompararSintomas(sintPaciente, sintDengue);

        string[] sintRinite = rinite.getSintomas();
        int      numRinite  = CompararSintomas(sintPaciente, sintRinite);

        string[] sintVirose = virose.getSintomas();
        int      numVirose  = CompararSintomas(sintPaciente, sintVirose);

        //VERIFICAR QUAIS DOENÇAS POSSUEM MAIS SINTOMAS EM COMUM
        Console.WriteLine("Sintomas Dengue: " + numDengue);
        Console.WriteLine("Sintomas Rinite: " + numRinite);
        Console.WriteLine("Sintomas Virose: " + numVirose);

        //MOSTRAR AS DOENÇAS MAIS PROVÁVEIS DE O PACIENTE TER
        int[] teste = new int[3] {
            numDengue, numRinite, numVirose
        };
        if (numDengue == teste.Max())
        {
            Console.WriteLine("É mais provavél que o paciente tenha Dengue!\n");
            string       leitura;
            FileStream   arquivo = new FileStream("orientDengue.txt", FileMode.Open, FileAccess.Read);
            StreamReader lendo   = new StreamReader(arquivo, Encoding.UTF8);
            while (!lendo.EndOfStream)
            {
                leitura = lendo.ReadLine();
                Console.WriteLine(leitura);
            }
            lendo.Close();
            arquivo.Close();
        }
        else if (numRinite == teste.Max())
        {
            Console.WriteLine("É mais provavél que o paciente tenha Rinite!\n");
            string       leitura;
            FileStream   arquivo = new FileStream("orientRinite.txt", FileMode.Open, FileAccess.Read);
            StreamReader lendo   = new StreamReader(arquivo, Encoding.UTF8);
            while (!lendo.EndOfStream)
            {
                leitura = lendo.ReadLine();
                Console.WriteLine(leitura);
            }
            lendo.Close();
            arquivo.Close();
        }
        else if (numVirose == teste.Max())
        {
            Console.WriteLine("É mais provavél que o paciente tenha Virose!\n");
            string       leitura;
            FileStream   arquivo = new FileStream("orientVirose.txt", FileMode.Open, FileAccess.Read);
            StreamReader lendo   = new StreamReader(arquivo, Encoding.UTF8);
            while (!lendo.EndOfStream)
            {
                leitura = lendo.ReadLine();
                Console.WriteLine(leitura);
            }
            lendo.Close();
            arquivo.Close();
        }
    }