using System;
using NHapi.Base;
using NHapi.Base.Parser;
using NHapi.Base.Model;
using NHapi.Model.V251.Datatype;
using NHapi.Base.Log;
namespace NHapi.Model.V251.Segment{
///<summary>
/// Represents an HL7 RQ1 message segment.
/// This segment has the following fields:<ol>
///<li>RQ1-1: Anticipated Price (ST)</li>
///<li>RQ1-2: Manufacturer Identifier (CE)</li>
///<li>RQ1-3: Manufacturer's Catalog (ST)</li>
///<li>RQ1-4: Vendor ID (CE)</li>
///<li>RQ1-5: Vendor Catalog (ST)</li>
///<li>RQ1-6: Taxable (ID)</li>
///<li>RQ1-7: Substitute Allowed (ID)</li>
///</ol>
/// The get...() methods return data from individual fields. These methods
/// do not throw exceptions and may therefore have to handle exceptions internally.
/// If an exception is handled internally, it is logged and null is returned.
/// This is not expected to happen - if it does happen this indicates not so much
/// an exceptional circumstance as a bug in the code for this class.
///</summary>
[Serializable]
public class RQ1 : AbstractSegment {
/**
* Creates a RQ1 (Requisition Detail-1) segment object that belongs to the given
* message.
*/
public RQ1(IGroup parent, IModelClassFactory factory) : base(parent,factory) {
IMessage message = Message;
try {
this.add(typeof(ST), false, 1, 10, new System.Object[]{message}, "Anticipated Price");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Manufacturer Identifier");
this.add(typeof(ST), false, 1, 16, new System.Object[]{message}, "Manufacturer's Catalog");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Vendor ID");
this.add(typeof(ST), false, 1, 16, new System.Object[]{message}, "Vendor Catalog");
this.add(typeof(ID), false, 1, 1, new System.Object[]{message, 136}, "Taxable");
this.add(typeof(ID), false, 1, 1, new System.Object[]{message, 136}, "Substitute Allowed");
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Can't instantiate " + GetType().Name, he);
}
}
///<summary>
/// Returns Anticipated Price(RQ1-1).
///</summary>
public ST AnticipatedPrice
{
get{
ST ret = null;
try
{
IType t = this.GetField(1, 0);
ret = (ST)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} 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;
}
}
///<summary>
/// Returns Manufacturer Identifier(RQ1-2).
///</summary>
public CE ManufacturerIdentifier
{
get{
CE ret = null;
try
{
IType t = this.GetField(2, 0);
ret = (CE)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} 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;
}
}
///<summary>
/// Returns Manufacturer's Catalog(RQ1-3).
///</summary>
public ST ManufacturerSCatalog
{
get{
ST ret = null;
try
{
IType t = this.GetField(3, 0);
ret = (ST)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} 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;
}
}
///<summary>
/// Returns Vendor ID(RQ1-4).
///</summary>
public CE VendorID
{
get{
CE ret = null;
try
{
IType t = this.GetField(4, 0);
ret = (CE)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} 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;
}
}
///<summary>
/// Returns Vendor Catalog(RQ1-5).
///</summary>
public ST VendorCatalog
{
get{
ST ret = null;
try
{
IType t = this.GetField(5, 0);
ret = (ST)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} 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;
}
}
///<summary>
/// Returns Taxable(RQ1-6).
///</summary>
public ID Taxable
{
get{
ID ret = null;
try
{
IType t = this.GetField(6, 0);
ret = (ID)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} 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;
}
}
///<summary>
/// Returns Substitute Allowed(RQ1-7).
///</summary>
public ID SubstituteAllowed
{
get{
ID ret = null;
try
{
IType t = this.GetField(7, 0);
ret = (ID)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} 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;
}
}
}}
|