Example #1
0
	///<summary>
	/// Creates a PLN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PLN(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"ID number (ST)");
		data[1] = new IS(message, 0,"Type of ID number (IS)");
		data[2] = new ST(message,"State/other qualifying info");
		data[3] = new DT(message,"Expiration date");
	}
Example #2
0
		public void TestSpecialCharacterEntry()
		{
			PipeParser parser = new PipeParser();
			ORU_R01 oru = new ORU_R01();
			oru.MSH.MessageType.MessageType.Value = "ORU";
			oru.MSH.MessageType.TriggerEvent.Value = "R01";
			oru.MSH.EncodingCharacters.Value = @"^~\&";
			oru.MSH.VersionID.VersionID.Value = "2.3.1";
			oru.GetPATIENT_RESULT(0).GetORDER_OBSERVATION(0).GetOBSERVATION(0).OBX.ValueType.Value = "FT";
			oru.GetPATIENT_RESULT(0).GetORDER_OBSERVATION(0).OBR.SetIDOBR.Value = "1";
			Varies v =
				oru.GetPATIENT_RESULT(0).GetORDER_OBSERVATION(0).GetOBSERVATION(0).OBX.GetObservationValue(0);
			ST text = new ST(oru);
			text.Value = @"This\.br\is\.br\A Test";
			v.Data = text;


			string encodedData = parser.Encode(oru);
			Console.WriteLine(encodedData);
			IMessage msg = parser.Parse(encodedData);
			Console.WriteLine(msg.GetStructureName());
			oru = (ORU_R01) msg;
			FT data = (FT) oru.GetPATIENT_RESULT(0).GetORDER_OBSERVATION(0).GetOBSERVATION(0).OBX.GetObservationValue(0).Data;
			Assert.AreEqual(@"This\.br\is\.br\A Test", data.Value);
		}
Example #3
0
File: RP.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a RP.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public RP(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Pointer");
		data[1] = new HD(message,"Application ID");
		data[2] = new ID(message, 0,"Type of data");
		data[3] = new ID(message, 0,"Subtype");
	}
Example #4
0
	///<summary>
	/// Creates a EI.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public EI(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Entity identifier");
		data[1] = new IS(message, 300,"Namespace ID");
		data[2] = new ST(message,"Universal ID");
		data[3] = new ID(message, 301,"Universal ID type");
	}
Example #5
0
	///<summary>
	/// Creates a DLT.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public DLT(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new NR(message,"Range");
		data[1] = new NM(message,"Numeric threshold");
		data[2] = new ST(message,"Change computation");
		data[3] = new NM(message,"Length of time-days");
	}
Example #6
0
	///<summary>
	/// Creates a ELD.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public ELD(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Segment ID");
		data[1] = new NM(message,"Sequence");
		data[2] = new NM(message,"Field position");
		data[3] = new CE(message,"Code identifying error");
	}
Example #7
0
File: SN.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a SN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public SN(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Comparator");
		data[1] = new NM(message,"Num1");
		data[2] = new ST(message,"Separator or suffix");
		data[3] = new NM(message,"Num2");
	}
Example #8
0
	///<summary>
	/// Creates a SPD.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public SPD(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Specialty name");
		data[1] = new ST(message,"Governing board");
		data[2] = new ID(message, 0,"Eligible or certified");
		data[3] = new DT(message,"Date of certification");
	}
Example #9
0
	///<summary>
	/// Creates a QSC.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public QSC(IMessage message, string description) : base(message, description){
		data = new IType[4];
		data[0] = new ST(message,"Segment field name");
		data[1] = new ID(message, 0,"Relational operator");
		data[2] = new ST(message,"Value");
		data[3] = new ID(message, 0,"Relational conjunction");
	}
Example #10
0
File: ED.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a ED.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public ED(IMessage message, string description) : base(message, description){
		data = new IType[5];
		data[0] = new HD(message,"Source application");
		data[1] = new ID(message, 191,"Type of data");
		data[2] = new ID(message, 291,"Data subtype");
		data[3] = new ID(message, 299,"Encoding");
		data[4] = new ST(message,"Data");
	}
Example #11
0
File: CE.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a CE.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CE(IMessage message, string description) : base(message, description){
		data = new IType[6];
		data[0] = new ST(message,"Identifier");
		data[1] = new ST(message,"Text");
		data[2] = new ST(message,"Name of coding system");
		data[3] = new ST(message,"Alternate identifier");
		data[4] = new ST(message,"Alternate text");
		data[5] = new ST(message,"Name of alternate coding system");
	}
Example #12
0
File: PN.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a PN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PN(IMessage message, string description) : base(message, description){
		data = new IType[6];
		data[0] = new FN(message,"Family+last name");
		data[1] = new ST(message,"Given name");
		data[2] = new ST(message,"Middle initial or name");
		data[3] = new ST(message,"Suffix (e.g., JR or III)");
		data[4] = new ST(message,"Prefix (e.g., DR)");
		data[5] = new IS(message, 0,"Degree (e.g., MD)");
	}
Example #13
0
File: CX.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a CX.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CX(IMessage message, string description) : base(message, description){
		data = new IType[6];
		data[0] = new ST(message,"ID");
		data[1] = new NM(message,"Check digit");
		data[2] = new ID(message, 0,"Code identifying the check digit scheme employed");
		data[3] = new HD(message,"Assigning authority");
		data[4] = new IS(message, 203,"Identifier type code");
		data[5] = new HD(message,"Assigning facility");
	}
Example #14
0
	///<summary>
	/// Creates a CSU.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CSU(IMessage message, string description) : base(message, description){
		data = new IType[7];
		data[0] = new NM(message,"Channel sensitivity");
		data[1] = new ST(message,"Unit of measure identifier");
		data[2] = new ST(message,"Unit of measure description");
		data[3] = new IS(message, 0,"Unit of measure coding system");
		data[4] = new ST(message,"Alternate unit of measure identifier");
		data[5] = new ST(message,"Alternate unit of measure description");
		data[6] = new IS(message, 0,"Alternate unit of measure coding system");
	}
Example #15
0
	///<summary>
	/// Creates a RFR.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public RFR(IMessage message, string description) : base(message, description){
		data = new IType[7];
		data[0] = new NR(message,"Numeric range");
		data[1] = new IS(message, 0,"Administrative sex");
		data[2] = new NR(message,"Age range");
		data[3] = new NR(message,"Gestational age range");
		data[4] = new TX(message,"Species");
		data[5] = new ST(message,"Race/subspecies");
		data[6] = new TX(message,"Conditions");
	}
Example #16
0
	///<summary>
	/// Creates a AD.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public AD(IMessage message, string description) : base(message, description){
		data = new IType[8];
		data[0] = new ST(message,"Street address");
		data[1] = new ST(message,"Other designation");
		data[2] = new ST(message,"City");
		data[3] = new ST(message,"State or province");
		data[4] = new ST(message,"Zip or postal code");
		data[5] = new ID(message, 0,"Country");
		data[6] = new ID(message, 0,"Address type");
		data[7] = new ST(message,"Other geographic designation");
	}
Example #17
0
File: CN.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a CN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CN(IMessage message, string description) : base(message, description){
		data = new IType[9];
		data[0] = new ST(message,"ID number (ST)");
		data[1] = new ST(message,"Family name");
		data[2] = new ST(message,"Given name");
		data[3] = new ST(message,"Middle initial or name");
		data[4] = new ST(message,"Suffix (e.g., JR or III)");
		data[5] = new ST(message,"Prefix (e.g., DR)");
		data[6] = new IS(message, 0,"Degree (e.g., MD)");
		data[7] = new IS(message, 0,"Source table");
		data[8] = new HD(message,"Assigning authority");
	}
Example #18
0
	///<summary>
	/// Creates a CNE.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CNE(IMessage message, string description) : base(message, description){
		data = new IType[9];
		data[0] = new ST(message,"Identifier");
		data[1] = new ST(message,"Text");
		data[2] = new ST(message,"Name of coding system");
		data[3] = new ST(message,"Alternate identifier");
		data[4] = new ST(message,"Alternate text");
		data[5] = new ST(message,"Name of alternate coding system");
		data[6] = new ST(message,"Coding system version ID");
		data[7] = new ST(message,"Alternate coding system version ID");
		data[8] = new ST(message,"Original text");
	}
Example #19
0
	///<summary>
	/// Creates a PL.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public PL(IMessage message, string description) : base(message, description){
		data = new IType[9];
		data[0] = new IS(message, 0,"Point of care");
		data[1] = new IS(message, 0,"Room");
		data[2] = new IS(message, 0,"Bed");
		data[3] = new HD(message,"Facility (HD)");
		data[4] = new IS(message, 0,"Location status");
		data[5] = new IS(message, 0,"Person location type");
		data[6] = new IS(message, 0,"Building");
		data[7] = new IS(message, 0,"Floor");
		data[8] = new ST(message,"Location description");
	}
Example #20
0
	///<summary>
	/// Creates a XTN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public XTN(IMessage message, string description) : base(message, description){
		data = new IType[9];
		data[0] = new TN(message,"[(999)] 999-9999 [X99999][C any text]");
		data[1] = new ID(message, 0,"Telecommunication use code");
		data[2] = new ID(message, 0,"Telecommunication equipment type (ID)");
		data[3] = new ST(message,"Email address");
		data[4] = new NM(message,"Country Code");
		data[5] = new NM(message,"Area/city code");
		data[6] = new NM(message,"Phone number");
		data[7] = new NM(message,"Extension");
		data[8] = new ST(message,"Any text");
	}
Example #21
0
	///<summary>
	/// Creates a XON.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public XON(IMessage message, string description) : base(message, description){
		data = new IType[9];
		data[0] = new ST(message,"Organization name");
		data[1] = new IS(message, 0,"Organization name type code");
		data[2] = new NM(message,"ID number (NM)");
		data[3] = new NM(message,"Check digit");
		data[4] = new ID(message, 0,"Code identifying the check digit scheme employed");
		data[5] = new HD(message,"Assigning authority");
		data[6] = new IS(message, 0,"Identifier type code");
		data[7] = new HD(message,"Assigning facility ID");
		data[8] = new ID(message, 0,"Name Representation code");
	}
Example #22
0
	///<summary>
	/// Creates a CNS.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public CNS(IMessage message, string description) : base(message, description){
		data = new IType[11];
		data[0] = new ST(message,"ID number (ST)");
		data[1] = new ST(message,"Family name");
		data[2] = new ST(message,"Given name");
		data[3] = new ST(message,"Second and further given names or initials thereof");
		data[4] = new ST(message,"Suffix (e.g., JR or III)");
		data[5] = new ST(message,"Prefix (e.g., DR)");
		data[6] = new IS(message, 0,"Degree (e.g., MD)");
		data[7] = new IS(message, 0,"Source table");
		data[8] = new IS(message, 0,"Assigning authority namespace ID");
		data[9] = new ST(message,"Assigning authority universal ID");
		data[10] = new ID(message, 0,"Assigning authority universal ID type");
	}
Example #23
0
	///<summary>
	/// Creates a XAD.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public XAD(IMessage message, string description) : base(message, description){
		data = new IType[11];
		data[0] = new ST(message,"Street address");
		data[1] = new ST(message,"Other designation");
		data[2] = new ST(message,"City");
		data[3] = new ST(message,"State or province");
		data[4] = new ST(message,"Zip or postal code");
		data[5] = new ID(message, 0,"Country");
		data[6] = new ID(message, 0,"Address type");
		data[7] = new ST(message,"Other geographic designation");
		data[8] = new IS(message, 0,"County/parish code");
		data[9] = new IS(message, 0,"Census tract");
		data[10] = new ID(message, 0,"Address representation code");
	}
Example #24
0
	///<summary>
	/// Creates a OSD.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public OSD(IMessage message, string description) : base(message, description){
		data = new IType[11];
		data[0] = new ID(message, 0,"Sequence/results flag");
		data[1] = new ST(message,"Placer order number: entity identifier");
		data[2] = new IS(message, 0,"Placer order number: namespace ID");
		data[3] = new ST(message,"Filler order number: entity identifier");
		data[4] = new IS(message, 0,"Filler order number: namespace ID");
		data[5] = new ST(message,"Sequence condition value");
		data[6] = new NM(message,"Maximum number of repeats");
		data[7] = new ST(message,"Placer order number: universal ID");
		data[8] = new ID(message, 0,"Placer order number; universal ID type");
		data[9] = new ST(message,"Filler order number: universal ID");
		data[10] = new ID(message, 0,"Filler order number: universal ID type");
	}
Example #25
0
File: TQ.cs Project: liddictm/nHapi
	///<summary>
	/// Creates a TQ.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public TQ(IMessage message, string description) : base(message, description){
		data = new IType[12];
		data[0] = new CQ(message,"Quantity");
		data[1] = new RI(message,"Interval");
		data[2] = new ST(message,"Duration");
		data[3] = new TS(message,"Start date/time");
		data[4] = new TS(message,"End date/time");
		data[5] = new ST(message,"Priority");
		data[6] = new ST(message,"Condition");
		data[7] = new ST(message,"Text");
		data[8] = new ST(message,"Conjunction");
		data[9] = new OSD(message,"Order sequencing");
		data[10] = new CE(message,"Occurrence duration");
		data[11] = new NM(message,"Total occurences");
	}
Example #26
0
  ///<summary>
  /// Returns all repetitions of R/U Where Subject Definition (URS-1).
   ///</summary>
  public ST[] GetRUWhereSubjectDefinition() {
     ST[] ret = null;
    try {
        IType[] t = this.GetField(1);  
        ret = new ST[t.Length];
        for (int i = 0; i < ret.Length; i++) {
            ret[i] = (ST)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 #27
0
	///<summary>
	/// Creates a XCN.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public XCN(IMessage message, string description) : base(message, description){
		data = new IType[15];
		data[0] = new ST(message,"ID number (ST)");
		data[1] = new FN(message,"Family+last name");
		data[2] = new ST(message,"Given name");
		data[3] = new ST(message,"Middle initial or name");
		data[4] = new ST(message,"Suffix (e.g., JR or III)");
		data[5] = new ST(message,"Prefix (e.g., DR)");
		data[6] = new IS(message, 0,"Degree (e.g., MD)");
		data[7] = new IS(message, 0,"Source table");
		data[8] = new HD(message,"Assigning authority");
		data[9] = new ID(message, 0,"Name type code");
		data[10] = new ST(message,"Identifier check digit");
		data[11] = new ID(message, 0,"Code identifying the check digit scheme employed");
		data[12] = new IS(message, 0,"Identifier type code");
		data[13] = new HD(message,"Assigning facility");
		data[14] = new ID(message, 0,"Name Representation code");
	}
Example #28
0
	///<summary>
	/// Creates a LA2.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public LA2(IMessage message, string description) : base(message, description){
		data = new IType[16];
		data[0] = new IS(message, 0,"Point of care (IS)");
		data[1] = new IS(message, 0,"Room");
		data[2] = new IS(message, 0,"Bed");
		data[3] = new HD(message,"Facility (HD)");
		data[4] = new IS(message, 0,"Location status");
		data[5] = new IS(message, 0,"Person location type");
		data[6] = new IS(message, 0,"Building");
		data[7] = new IS(message, 0,"Floor");
		data[8] = new ST(message,"Street address");
		data[9] = new ST(message,"Other designation");
		data[10] = new ST(message,"City");
		data[11] = new ST(message,"State or province");
		data[12] = new ST(message,"Zip or postal code");
		data[13] = new ID(message, 0,"Country");
		data[14] = new ID(message, 0,"Address type");
		data[15] = new ST(message,"Other geographic designation");
	}
Example #29
0
	///<summary>
	/// Creates a TS.
	/// <param name="message">The Message to which this Type belongs</param>
	/// <param name="description">The description of this type</param>
	///</summary>
	public TS(IMessage message, string description) : base(message, description){
		data = new IType[2];
		data[0] = new TSComponentOne(message,"Time of an event");
		data[1] = new ST(message,"Degree of precision");
	}
Example #30
0
		public void TestValidHl7Data()
		{
			PipeParser parser = new PipeParser();
			ORU_R01 oru = new ORU_R01();
			oru.MSH.MessageType.MessageType.Value = "ORU";
			oru.MSH.MessageType.TriggerEvent.Value = "R01";
			oru.MSH.EncodingCharacters.Value = @"^~\&";
			oru.MSH.VersionID.VersionID.Value = "2.3.1";
			oru.GetPATIENT_RESULT(0).GetORDER_OBSERVATION(0).GetOBSERVATION(0).OBX.ValueType.Value = "FT";
			oru.GetPATIENT_RESULT(0).GetORDER_OBSERVATION(0).OBR.SetIDOBR.Value = "1";
			Varies v =
				oru.GetPATIENT_RESULT(0).GetORDER_OBSERVATION(0).GetOBSERVATION(0).OBX.GetObservationValue(0);
			ST text = new ST(oru);
			text.Value = @"Th&is\.br\is\.br\A T|est\";
			v.Data = text;


			string encodedData = parser.Encode(oru);

			//Console.WriteLine(encodedData);
			string[] segs = encodedData.Split('\r');
			string[] fields = segs[2].Split('|');
			string data = fields[5];

			Assert.AreEqual(@"Th\T\is\.br\is\.br\A T\F\est\E\", data);
		}