Beispiel #1
0
        private object GetField(MessagePartBean messagePartBean)
        {
            object field = messagePartBean.GetField(this.fieldName);

            if (field == null)
            {
                this.errorLogger.LogFieldNotFound(this.log, messagePartBean, this.fieldName);
            }
            return(field);
        }
Beispiel #2
0
        public virtual IList <Realm> GetRealmCode()
        {
            IList <Realm> realm = null;

            if (this.bean is MessagePartBean)
            {
                MessagePartBean partBean = (MessagePartBean)this.bean;
                realm = partBean.GetRealmCode();
            }
            return(realm);
        }
Beispiel #3
0
        private MessagePartBean AsMessagePartBean()
        {
            MessagePartBean messagePartBean = null;

            if (this.bean is MessagePartBean)
            {
                messagePartBean = (MessagePartBean)this.bean;
            }
            else
            {
                this.errorLogger.LogNotMessagePartBean(this.log, this.bean);
            }
            return(messagePartBean);
        }
Beispiel #4
0
            public virtual void LogInvalidFieldType(ILog log, MessagePartBean bean, string fieldName, Type fieldType, bool isCollection
                                                    )
            {
                string message = System.String.Format("Unable to extract HL7 value. The field {0}.{1} is not a {2}{3}", bean.GetType().Name
                                                      , fieldName, fieldType.Name, isCollection ? " (this is possibly an expected situation)" : string.Empty);

                if (isCollection)
                {
                    log.Info(message);
                }
                else
                {
                    log.Warn(message);
                }
            }
Beispiel #5
0
        private NullFlavorSupport AsNullable(string fieldName)
        {
            NullFlavorSupport nullable        = NULL_VALUABLE;
            MessagePartBean   messagePartBean = AsMessagePartBean();

            if (messagePartBean != null)
            {
                object field = GetField(messagePartBean);
                if (field is NullFlavorSupport)
                {
                    nullable = (NullFlavorSupport)field;
                }
            }
            return(nullable);
        }
Beispiel #6
0
 public virtual void LogFieldNotFound(ILog log, MessagePartBean messagePartBean, string fieldName)
 {
     log.Error(System.String.Format("Unable to extract HL7 value. The bean {0} does not have the field {1}", messagePartBean.GetType
                                        ().Name, fieldName));
 }
Beispiel #7
0
        private object Get()
        {
            MessagePartBean messagePartBean = AsMessagePartBean();

            return(messagePartBean != null?GetField(messagePartBean) : null);
        }