FHS.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 » FHS.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 FHS message segment. 
/// This segment has the following fields:<ol>
///<li>FHS-1: File Field Separator (ST)</li>
///<li>FHS-2: File Encoding Characters (ST)</li>
///<li>FHS-3: File Sending Application (HD)</li>
///<li>FHS-4: File Sending Facility (HD)</li>
///<li>FHS-5: File Receiving Application (HD)</li>
///<li>FHS-6: File Receiving Facility (HD)</li>
///<li>FHS-7: File Creation Date/Time (TS)</li>
///<li>FHS-8: File Security (ST)</li>
///<li>FHS-9: File Name/ID (ST)</li>
///<li>FHS-10: File Header Comment (ST)</li>
///<li>FHS-11: File Control ID (ST)</li>
///<li>FHS-12: Reference File Control ID (ST)</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 FHS : AbstractSegment  {

  /**
   * Creates a FHS (File Header) segment object that belongs to the given 
   * message.  
   */
  public FHS(IGroup parent, IModelClassFactory factory) : base(parent,factory) {
  IMessage message = Message;
    try {
       this.add(typeof(ST), true, 1, 1, new System.Object[]{message}, "File Field Separator");
       this.add(typeof(ST), true, 1, 4, new System.Object[]{message}, "File Encoding Characters");
       this.add(typeof(HD), false, 1, 227, new System.Object[]{message}, "File Sending Application");
       this.add(typeof(HD), false, 1, 227, new System.Object[]{message}, "File Sending Facility");
       this.add(typeof(HD), false, 1, 227, new System.Object[]{message}, "File Receiving Application");
       this.add(typeof(HD), false, 1, 227, new System.Object[]{message}, "File Receiving Facility");
       this.add(typeof(TS), false, 1, 26, new System.Object[]{message}, "File Creation Date/Time");
       this.add(typeof(ST), false, 1, 40, new System.Object[]{message}, "File Security");
       this.add(typeof(ST), false, 1, 20, new System.Object[]{message}, "File Name/ID");
       this.add(typeof(ST), false, 1, 80, new System.Object[]{message}, "File Header Comment");
       this.add(typeof(ST), false, 1, 20, new System.Object[]{message}, "File Control ID");
       this.add(typeof(ST), false, 1, 20, new System.Object[]{message}, "Reference File Control ID");
    } catch (HL7Exception he) {
        HapiLogFactory.getHapiLog(GetType()).error("Can't instantiate " + GetType().Name, he);
    }
  }

  ///<summary>
  /// Returns File Field Separator(FHS-1).
  ///</summary>
  public ST FileFieldSeparator
  {
    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 File Encoding Characters(FHS-2).
  ///</summary>
  public ST FileEncodingCharacters
  {
    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 File Sending Application(FHS-3).
  ///</summary>
  public HD FileSendingApplication
  {
    get{
      HD ret = null;
      try
      {
      IType t = this.GetField(3, 0);
        ret = (HD)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 File Sending Facility(FHS-4).
  ///</summary>
  public HD FileSendingFacility
  {
    get{
      HD ret = null;
      try
      {
      IType t = this.GetField(4, 0);
        ret = (HD)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 File Receiving Application(FHS-5).
  ///</summary>
  public HD FileReceivingApplication
  {
    get{
      HD ret = null;
      try
      {
      IType t = this.GetField(5, 0);
        ret = (HD)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 File Receiving Facility(FHS-6).
  ///</summary>
  public HD FileReceivingFacility
  {
    get{
      HD ret = null;
      try
      {
      IType t = this.GetField(6, 0);
        ret = (HD)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 File Creation Date/Time(FHS-7).
  ///</summary>
  public TS FileCreationDateTime
  {
    get{
      TS ret = null;
      try
      {
      IType t = this.GetField(7, 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 File Security(FHS-8).
  ///</summary>
  public ST FileSecurity
  {
    get{
      ST ret = null;
      try
      {
      IType t = this.GetField(8, 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 File Name/ID(FHS-9).
  ///</summary>
  public ST FileNameID
  {
    get{
      ST ret = null;
      try
      {
      IType t = this.GetField(9, 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 File Header Comment(FHS-10).
  ///</summary>
  public ST FileHeaderComment
  {
    get{
      ST ret = null;
      try
      {
      IType t = this.GetField(10, 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 File Control ID(FHS-11).
  ///</summary>
  public ST FileControlID
  {
    get{
      ST ret = null;
      try
      {
      IType t = this.GetField(11, 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 Reference File Control ID(FHS-12).
  ///</summary>
  public ST ReferenceFileControlID
  {
    get{
      ST ret = null;
      try
      {
      IType t = this.GetField(12, 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;
  }
  }


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