Exemplo n.º 1
0
        public static ISchema <HL7V26Entity> CreateHL7Version26(this ISchemaFactorySelector selector, Action <IHL7SchemaConfigurator <HL7V26Entity> > configure = null)
        {
            return(selector.CreateHL7 <HL7V26Entity>(x =>
            {
                x.AddFromNamespaceContaining <HL7Version26>();

                configure?.Invoke(x);
            }));
        }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="selector"></param>
        /// <param name="configure"></param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        /// <exception cref="SchemaConfigurationException"></exception>
        public static ISchema <T> CreateX12 <T>(this ISchemaFactorySelector selector, Action <IX12SchemaConfigurator <T> > configure = null)
            where T : X12Entity
        {
            var configurator = new X12SchemaConfigurator <T>();

            configure?.Invoke(configurator);

            configurator.ValidateSpecification();

            try
            {
                return(configurator.Build());
            }
            catch (Exception exception)
            {
                throw new SchemaConfigurationException("The HL7 schema could not be built (see InnerException for details).", exception);
            }
        }