7
十二月

Ex1: CD Reader for COPD

   Posted by: admin   in 104(上)

using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int count = 0;
            string filename = args[0];
            StreamReader sr = new StreamReader(filename);
 
            string line = sr.ReadLine();
            while (line != null && line.Length > 10)
            {
                string ID = line.Substring(91, 32);
                string ICD9_1 = line.Substring(131, 5);
                string ICD9_2 = line.Substring(136, 5);
                string ICD9_3 = line.Substring(141, 5);
                string ICD9_T1 = ICD9_1.Substring(0, 3);
                string ICD9_T2 = ICD9_2.Substring(0, 3);
                string ICD9_T3 = ICD9_3.Substring(0, 3);
                if (ICD9_T1 == "491" || ICD9_T1 == "492" || ICD9_T1 == "496" ||
                    ICD9_T2 == "491" || ICD9_T2 == "492" || ICD9_T2 == "496" ||
                    ICD9_T3 == "491" || ICD9_T3 == "492" || ICD9_T3 == "496")
                {
                    Console.WriteLine("ID="+ ID+ "ICD(1)=" + ICD9_1 + ",ICD(2)=" + ICD9_2 + ",ICD(3)=" + ICD9_3);
                    count++;
                }
                line = sr.ReadLine();
            }
            Console.WriteLine("Number=" + count);
        }
    }
}

bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Tags: , , ,

This entry was posted on 星期一, 十二月 7th, 2015 at 04:12:12 and is filed under 104(上). You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a reply

Name (*)
Mail (will not be published) (*)
URI
Comment