/// <summary>
        /// 创建fieldtype,如CE,XCN等
        /// </summary>
        /// <param name="parent"></param>
        /// <param name="product"></param>
        /// <param name="name"></param>
        /// <returns></returns>
        public override abstractType Create(compositeType parent, Enum product, string name)
        {
            abstractType tmp = null;

            switch (product)
            {
            case enumField.CE: tmp = new CE(parent, name); break;

            case enumField.CM: tmp = new CM(parent, name); break;

            case enumField.CWE: tmp = new CWE(parent, name); break;

            case enumField.CX: tmp = new CX(parent, name); break;

            case enumField.DLN: tmp = new DLN(parent, name); break;

            case enumField.EI: tmp = new EI(parent, name); break;

            case enumField.ELD: tmp = new ELD(parent, name); break;

            case enumField.FN: tmp = new FN(parent, name); break;

            case enumField.HD: tmp = new HD(parent, name); break;

            case enumField.MSG: tmp = new MSG(parent, name); break;

            case enumField.PT: tmp = new PT(parent, name); break;

            case enumField.VID: tmp = new VID(parent, name); break;

            case enumField.XAD: tmp = new XAD(parent, name); break;

            case enumField.XCN: tmp = new XCN(parent, name); break;

            case enumField.XPN: tmp = new XPN(parent, name); break;

            case enumField.XTN: tmp = new XTN(parent, name); break;

            case enumField.ERL: tmp = new ERL(parent, name); break;

            case enumField.FC: tmp = new FC(parent, name); break;

            case enumField.XON: tmp = new XON(parent, name); break;

            case enumField.PL: tmp = new PL(parent, name); break;

            case enumField.CP: tmp = new CP(parent, name); break;

            case enumField.JCC: tmp = new JCC(parent, name); break;

            case enumField.TQ: tmp = new TQ(parent, name); break;

            case enumField.CQ: tmp = new CQ(parent, name); break;

            default: throw new NotSupportedException();
            }
            return(tmp);
        }
Example #2
0
        ///<summary>
        /// Returns a single repetition of Error Location(ERR-2).
        /// throws HL7Exception if the repetition number is invalid.
        /// <param name="rep">The repetition number (this is a repeating field)</param>
        ///</summary>
        public ERL GetErrorLocation(int rep)
        {
            ERL ret = null;

            try
            {
                IType t = this.GetField(2, rep);
                ret = (ERL)t;
            } catch (System.Exception ex) {
                HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", ex);
                throw new System.Exception("An unexpected error ocurred", ex);
            }
            return(ret);
        }
Example #3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="v"></param>
        /// <returns></returns>
        private string EnumToArg(ERL v)
        {
            switch (v)
            {
            case ERL.ERL_verbose: return("--verbose");

            case ERL.ERL_veryverbose: return("--very-verbose");

            case ERL.ERL_release: return("--release-version");

            case ERL.ERL_empty:
            default: return("");
            }
        }
Example #4
0
        /// <summary> Returns a single repetition of Error Location (ERR-2).</summary>
        /// <param name="rep">the repetition number (this is a repeating field)
        /// </param>
        /// <throws>  HL7Exception if the repetition number is invalid. </throws>
        public virtual ERL getErrorLocation(int rep)
        {
            ERL ret = null;

            try
            {
                Type t = this.getField(2, rep);
                ret = (ERL)t;
            }
            catch (System.InvalidCastException)
            {
                throw new Exception();
            }
            return(ret);
        }
Example #5
0
 ///<summary>
 /// Returns all repetitions of Error Location (ERR-2).
 ///</summary>
 public ERL[] GetErrorLocation()
 {
     ERL[] ret = null;
     try {
         IType[] t = this.GetField(2);
         ret = new ERL[t.Length];
         for (int i = 0; i < ret.Length; i++)
         {
             ret[i] = (ERL)t[i];
         }
     } catch (HL7Exception he) {
         HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", he);
         throw new System.Exception("An unexpected error ocurred", he);
     } catch (System.Exception cce) {
         HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value.  This is a bug.", cce);
         throw new System.Exception("An unexpected error ocurred", cce);
     }
     return(ret);
 }
Example #6
0
 /// <summary> Returns all repetitions of Error Location (ERR-2).</summary>
 public virtual ERL[] getErrorLocation()
 {
     ERL[] ret = null;
     try
     {
         Type[] t = this.getField(2);
         ret = new ERL[t.Length];
         for (int i = 0; i < ret.Length; i++)
         {
             ret[i] = (ERL)t[i];
         }
     }
     catch (System.InvalidCastException)
     {
         throw new Exception();
     }
     catch (NuGenHL7Exception)
     {
         throw new Exception();
     }
     return(ret);
 }
Example #7
0
		/// <summary> Returns all repetitions of Error Location (ERR-2).</summary>
		public virtual ERL[] getErrorLocation()
		{
			ERL[] ret = null;
			try
			{
				Type[] t = this.getField(2);
				ret = new ERL[t.Length];
				for (int i = 0; i < ret.Length; i++)
				{
					ret[i] = (ERL) t[i];
				}
			}
			catch (System.InvalidCastException )
			{
				throw new Exception();
			}
			catch (NuGenHL7Exception)
			{
				throw new Exception();
			}
			return ret;
		}