コード例 #1
0
        private NuGenValidationException[] testAgainstProfile(Message message, System.String id)
        {
            NuGenHL7Exception[] exceptions = null;
            DefaultValidator    val        = new DefaultValidator();

            try
            {
                System.String profileString = ProfileStoreFactory.ProfileStore.getProfile(id);
                if (profileString != null)
                {
                    ProfileParser  profParser = new ProfileParser(true);
                    RuntimeProfile profile    = profParser.parse(profileString);

                    exceptions = val.validate(message, profile.Message);
                }
                else
                {
                    throw new ProfileException("Unable to find the profile " + id);
                }
            }
            catch (System.IO.IOException e)
            {
                throw new ProfileException("Error retreiving profile " + id, e);
            }

            NuGenValidationException[] result = new NuGenValidationException[exceptions.Length];
            for (int i = 0; i < exceptions.Length; i++)
            {
                result[i] = new NuGenValidationException(exceptions[i].Message, exceptions[i]);
            }
            return(result);
        }
コード例 #2
0
		private NuGenValidationException[] testAgainstProfile(Message message, System.String id)
		{
			NuGenHL7Exception[] exceptions = null;
			DefaultValidator val = new DefaultValidator();
			try
			{
				System.String profileString = ProfileStoreFactory.ProfileStore.getProfile(id);
				if (profileString != null)
				{
					ProfileParser profParser = new ProfileParser(true);
					RuntimeProfile profile = profParser.parse(profileString);
					
					exceptions = val.validate(message, profile.Message);
				}
				else
				{
					throw new ProfileException("Unable to find the profile " + id);
				}
			}
			catch (System.IO.IOException e)
			{
				throw new ProfileException("Error retreiving profile " + id, e);
			}
			
			NuGenValidationException[] result = new NuGenValidationException[exceptions.Length];
			for (int i = 0; i < exceptions.Length; i++)
			{
				result[i] = new NuGenValidationException(exceptions[i].Message, exceptions[i]);
			}
			return result;
		}