NST.cs :  » Network-Clients » nHapi » NHapi » Model » V251 » Segment » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Network Clients » nHapi 
nHapi » NHapi » Model » V251 » Segment » NST.cs
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 NST message segment. 
/// This segment has the following fields:<ol>
///<li>NST-1: Statistics Available (ID)</li>
///<li>NST-2: Source Identifier (ST)</li>
///<li>NST-3: Source Type (ID)</li>
///<li>NST-4: Statistics Start (TS)</li>
///<li>NST-5: Statistics End (TS)</li>
///<li>NST-6: Receive Character Count (NM)</li>
///<li>NST-7: Send Character Count (NM)</li>
///<li>NST-8: Messages Received (NM)</li>
///<li>NST-9: Messages Sent (NM)</li>
///<li>NST-10: Checksum Errors Received (NM)</li>
///<li>NST-11: Length Errors Received (NM)</li>
///<li>NST-12: Other Errors Received (NM)</li>
///<li>NST-13: Connect Timeouts (NM)</li>
///<li>NST-14: Receive Timeouts (NM)</li>
///<li>NST-15: Application control-level Errors (NM)</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 NST : AbstractSegment  {

  /**
   * Creates a NST (Application control level statistics) segment object that belongs to the given 
   * message.  
   */
  public NST(IGroup parent, IModelClassFactory factory) : base(parent,factory) {
  IMessage message = Message;
    try {
       this.add(typeof(ID), true, 1, 1, new System.Object[]{message, 136}, "Statistics Available");
       this.add(typeof(ST), false, 1, 30, new System.Object[]{message}, "Source Identifier");
       this.add(typeof(ID), false, 1, 3, new System.Object[]{message, 332}, "Source Type");
       this.add(typeof(TS), false, 1, 26, new System.Object[]{message}, "Statistics Start");
       this.add(typeof(TS), false, 1, 26, new System.Object[]{message}, "Statistics End");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Receive Character Count");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Send Character Count");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Messages Received");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Messages Sent");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Checksum Errors Received");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Length Errors Received");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Other Errors Received");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Connect Timeouts");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Receive Timeouts");
       this.add(typeof(NM), false, 1, 10, new System.Object[]{message}, "Application control-level Errors");
    } catch (HL7Exception he) {
        HapiLogFactory.getHapiLog(GetType()).error("Can't instantiate " + GetType().Name, he);
    }
  }

  ///<summary>
  /// Returns Statistics Available(NST-1).
  ///</summary>
  public ID StatisticsAvailable
  {
    get{
      ID ret = null;
      try
      {
      IType t = this.GetField(1, 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 Source Identifier(NST-2).
  ///</summary>
  public ST SourceIdentifier
  {
    get{
      ST ret = null;
      try
      {
      IType t = this.GetField(2, 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 Source Type(NST-3).
  ///</summary>
  public ID SourceType
  {
    get{
      ID ret = null;
      try
      {
      IType t = this.GetField(3, 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 Statistics Start(NST-4).
  ///</summary>
  public TS StatisticsStart
  {
    get{
      TS ret = null;
      try
      {
      IType t = this.GetField(4, 0);
        ret = (TS)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 Statistics End(NST-5).
  ///</summary>
  public TS StatisticsEnd
  {
    get{
      TS ret = null;
      try
      {
      IType t = this.GetField(5, 0);
        ret = (TS)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 Receive Character Count(NST-6).
  ///</summary>
  public NM ReceiveCharacterCount
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(6, 0);
        ret = (NM)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 Send Character Count(NST-7).
  ///</summary>
  public NM SendCharacterCount
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(7, 0);
        ret = (NM)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 Messages Received(NST-8).
  ///</summary>
  public NM MessagesReceived
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(8, 0);
        ret = (NM)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 Messages Sent(NST-9).
  ///</summary>
  public NM MessagesSent
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(9, 0);
        ret = (NM)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 Checksum Errors Received(NST-10).
  ///</summary>
  public NM ChecksumErrorsReceived
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(10, 0);
        ret = (NM)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 Length Errors Received(NST-11).
  ///</summary>
  public NM LengthErrorsReceived
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(11, 0);
        ret = (NM)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 Other Errors Received(NST-12).
  ///</summary>
  public NM OtherErrorsReceived
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(12, 0);
        ret = (NM)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 Connect Timeouts(NST-13).
  ///</summary>
  public NM ConnectTimeouts
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(13, 0);
        ret = (NM)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 Receive Timeouts(NST-14).
  ///</summary>
  public NM ReceiveTimeouts
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(14, 0);
        ret = (NM)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 Application control-level Errors(NST-15).
  ///</summary>
  public NM ApplicationControlLevelErrors
  {
    get{
      NM ret = null;
      try
      {
      IType t = this.GetField(15, 0);
        ret = (NM)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;
  }
  }


}}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.