コード例 #1
0
        public static void  Main(System.String[] args)
        {
            if (args.Length != 2)
            {
                System.Console.Out.WriteLine("Usage: DefaultValidator message_file profile_file");
                System.Environment.Exit(1);
            }

            NuGenDefaultValidator val = new NuGenDefaultValidator();

            try
            {
                System.String msgString = loadFile(args[0]);
                NuGenParser   parser    = new NuGenGenericParser();
                Message       message   = parser.parse(msgString);

                System.String  profileString = loadFile(args[1]);
                ProfileParser  profParser    = new ProfileParser(true);
                RuntimeProfile profile       = profParser.parse(profileString);

                NuGenHL7Exception[] exceptions = val.validate(message, profile.Message);

                System.Console.Out.WriteLine("Exceptions: ");
                for (int i = 0; i < exceptions.Length; i++)
                {
                    System.Console.Out.WriteLine((i + 1) + ". " + exceptions[i].Message);
                }
            }
            catch (System.Exception e)
            {
                SupportClass.WriteStackTrace(e, Console.Error);
            }
        }
コード例 #2
0
		public static void  Main(System.String[] args)
		{
			
			if (args.Length != 2)
			{
				System.Console.Out.WriteLine("Usage: DefaultValidator message_file profile_file");
				System.Environment.Exit(1);
			}
			
			NuGenDefaultValidator val = new NuGenDefaultValidator();
			try
			{
				System.String msgString = loadFile(args[0]);
				NuGenParser parser = new NuGenGenericParser();
				Message message = parser.parse(msgString);
				
				System.String profileString = loadFile(args[1]);
				ProfileParser profParser = new ProfileParser(true);
				RuntimeProfile profile = profParser.parse(profileString);
				
				NuGenHL7Exception[] exceptions = val.validate(message, profile.Message);
				
				System.Console.Out.WriteLine("Exceptions: ");
				for (int i = 0; i < exceptions.Length; i++)
				{
					System.Console.Out.WriteLine((i + 1) + ". " + exceptions[i].Message);
				}
			}
			catch (System.Exception e)
			{
				SupportClass.WriteStackTrace(e, Console.Error);
			}
		}