All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ca.uhn.hl7v2.model.v24.segment.NST Maven / Gradle / Ivy

There is a newer version: 2.5.1
Show newest version
/*
 * This class is an auto-generated source file for a HAPI
 * HL7 v2.x standard structure class.
 *
 * For more information, visit: http://hl7api.sourceforge.net/
 * 
 * The contents of this file are subject to the Mozilla Public License Version 1.1 
 * (the "License"); you may not use this file except in compliance with the License. 
 * You may obtain a copy of the License at http://www.mozilla.org/MPL/ 
 * Software distributed under the License is distributed on an "AS IS" basis, 
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the 
 * specific language governing rights and limitations under the License. 
 * 
 * The Original Code is "[file_name]".  Description: 
 * "[one_line_description]" 
 * 
 * The Initial Developer of the Original Code is University Health Network. Copyright (C) 
 * 2002.  All Rights Reserved. 
 * 
 * Contributor(s): ______________________________________. 
 * 
 * Alternatively, the contents of this file may be used under the terms of the 
 * GNU General Public License (the  "GPL"), in which case the provisions of the GPL are 
 * applicable instead of those above.  If you wish to allow use of your version of this 
 * file only under the terms of the GPL and not to allow others to use your version 
 * of this file under the MPL, indicate your decision by deleting  the provisions above 
 * and replace  them with the notice and other provisions required by the GPL License.  
 * If you do not delete the provisions above, a recipient may use your version of 
 * this file under either the MPL or the GPL. 
 * 
 */


package ca.uhn.hl7v2.model.v24.segment;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

// import ca.uhn.hl7v2.model.v24.group.*;
import ca.uhn.hl7v2.model.v24.datatype.*;
import ca.uhn.hl7v2.HL7Exception;
import ca.uhn.hl7v2.parser.ModelClassFactory;
import ca.uhn.hl7v2.parser.DefaultModelClassFactory;
import ca.uhn.hl7v2.model.AbstractMessage;
import ca.uhn.hl7v2.model.Group;
import ca.uhn.hl7v2.model.Type;
import ca.uhn.hl7v2.model.AbstractSegment;
import ca.uhn.hl7v2.model.Varies;

/**
 *

Represents an HL7 NST message segment (Application control level statistics). * This segment has the following fields:

*
    *
  • NST-1: Statistics Available (ID) *
  • NST-2: Source Identifier (ST) optional *
  • NST-3: Source Type (ID) optional *
  • NST-4: Statistics Start (TS) optional *
  • NST-5: Statistics End (TS) optional *
  • NST-6: Receive Character Count (NM) optional *
  • NST-7: Send Character Count (NM) optional *
  • NST-8: Messages Received (NM) optional *
  • NST-9: Messages Sent (NM) optional *
  • NST-10: Checksum Errors Received (NM) optional *
  • NST-11: Length Errors Received (NM) optional *
  • NST-12: Other Errors Received (NM) optional *
  • NST-13: Connect Timeouts (NM) optional *
  • NST-14: Receive Timeouts (NM) optional *
  • NST-15: Application control-level Errors (NM) optional *
*/ @SuppressWarnings("unused") public class NST extends AbstractSegment { /** * Creates a new NST segment */ public NST(Group parent, ModelClassFactory factory) { super(parent, factory); init(factory); } private void init(ModelClassFactory factory) { try { this.add(ID.class, true, 1, 1, new Object[]{ getMessage(), new Integer(136) }, "Statistics Available"); this.add(ST.class, false, 1, 30, new Object[]{ getMessage() }, "Source Identifier"); this.add(ID.class, false, 1, 3, new Object[]{ getMessage(), new Integer(332) }, "Source Type"); this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Statistics Start"); this.add(TS.class, false, 1, 26, new Object[]{ getMessage() }, "Statistics End"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Receive Character Count"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Send Character Count"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Messages Received"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Messages Sent"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Checksum Errors Received"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Length Errors Received"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Other Errors Received"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Connect Timeouts"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Receive Timeouts"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage() }, "Application control-level Errors"); } catch(HL7Exception e) { LoggerFactory.getLogger(getClass()).error("Unexpected error creating NST - this is probably a bug in the source code generator.", e); } } /** * Returns * NST-1: "Statistics Available" - creates it if necessary */ public ID getStatisticsAvailable() { ID ret = null; try { Type t = this.getField(1, 0); ret = (ID)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-1: "Statistics Available" - creates it if necessary */ public ID getNst1_StatisticsAvailable() { ID ret = null; try { Type t = this.getField(1, 0); ret = (ID)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-2: "Source Identifier" - creates it if necessary */ public ST getSourceIdentifier() { ST ret = null; try { Type t = this.getField(2, 0); ret = (ST)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-2: "Source Identifier" - creates it if necessary */ public ST getNst2_SourceIdentifier() { ST ret = null; try { Type t = this.getField(2, 0); ret = (ST)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-3: "Source Type" - creates it if necessary */ public ID getSourceType() { ID ret = null; try { Type t = this.getField(3, 0); ret = (ID)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-3: "Source Type" - creates it if necessary */ public ID getNst3_SourceType() { ID ret = null; try { Type t = this.getField(3, 0); ret = (ID)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-4: "Statistics Start" - creates it if necessary */ public TS getStatisticsStart() { TS ret = null; try { Type t = this.getField(4, 0); ret = (TS)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-4: "Statistics Start" - creates it if necessary */ public TS getNst4_StatisticsStart() { TS ret = null; try { Type t = this.getField(4, 0); ret = (TS)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-5: "Statistics End" - creates it if necessary */ public TS getStatisticsEnd() { TS ret = null; try { Type t = this.getField(5, 0); ret = (TS)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-5: "Statistics End" - creates it if necessary */ public TS getNst5_StatisticsEnd() { TS ret = null; try { Type t = this.getField(5, 0); ret = (TS)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-6: "Receive Character Count" - creates it if necessary */ public NM getReceiveCharacterCount() { NM ret = null; try { Type t = this.getField(6, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-6: "Receive Character Count" - creates it if necessary */ public NM getNst6_ReceiveCharacterCount() { NM ret = null; try { Type t = this.getField(6, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-7: "Send Character Count" - creates it if necessary */ public NM getSendCharacterCount() { NM ret = null; try { Type t = this.getField(7, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-7: "Send Character Count" - creates it if necessary */ public NM getNst7_SendCharacterCount() { NM ret = null; try { Type t = this.getField(7, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-8: "Messages Received" - creates it if necessary */ public NM getMessagesReceived() { NM ret = null; try { Type t = this.getField(8, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-8: "Messages Received" - creates it if necessary */ public NM getNst8_MessagesReceived() { NM ret = null; try { Type t = this.getField(8, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-9: "Messages Sent" - creates it if necessary */ public NM getMessagesSent() { NM ret = null; try { Type t = this.getField(9, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-9: "Messages Sent" - creates it if necessary */ public NM getNst9_MessagesSent() { NM ret = null; try { Type t = this.getField(9, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-10: "Checksum Errors Received" - creates it if necessary */ public NM getChecksumErrorsReceived() { NM ret = null; try { Type t = this.getField(10, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-10: "Checksum Errors Received" - creates it if necessary */ public NM getNst10_ChecksumErrorsReceived() { NM ret = null; try { Type t = this.getField(10, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-11: "Length Errors Received" - creates it if necessary */ public NM getLengthErrorsReceived() { NM ret = null; try { Type t = this.getField(11, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-11: "Length Errors Received" - creates it if necessary */ public NM getNst11_LengthErrorsReceived() { NM ret = null; try { Type t = this.getField(11, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-12: "Other Errors Received" - creates it if necessary */ public NM getOtherErrorsReceived() { NM ret = null; try { Type t = this.getField(12, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-12: "Other Errors Received" - creates it if necessary */ public NM getNst12_OtherErrorsReceived() { NM ret = null; try { Type t = this.getField(12, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-13: "Connect Timeouts" - creates it if necessary */ public NM getConnectTimeouts() { NM ret = null; try { Type t = this.getField(13, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-13: "Connect Timeouts" - creates it if necessary */ public NM getNst13_ConnectTimeouts() { NM ret = null; try { Type t = this.getField(13, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-14: "Receive Timeouts" - creates it if necessary */ public NM getReceiveTimeouts() { NM ret = null; try { Type t = this.getField(14, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-14: "Receive Timeouts" - creates it if necessary */ public NM getNst14_ReceiveTimeouts() { NM ret = null; try { Type t = this.getField(14, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-15: "Application control-level Errors" - creates it if necessary */ public NM getApplicationControlLevelErrors() { NM ret = null; try { Type t = this.getField(15, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-15: "Application control-level Errors" - creates it if necessary */ public NM getNst15_ApplicationControlLevelErrors() { NM ret = null; try { Type t = this.getField(15, 0); ret = (NM)t; } catch (ClassCastException cce) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { LoggerFactory.getLogger(getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** {@inheritDoc} */ protected Type createNewTypeWithoutReflection(int field) { switch (field) { case 0: return new ID(getMessage(), new Integer( 136 )); case 1: return new ST(getMessage()); case 2: return new ID(getMessage(), new Integer( 332 )); case 3: return new TS(getMessage()); case 4: return new TS(getMessage()); case 5: return new NM(getMessage()); case 6: return new NM(getMessage()); case 7: return new NM(getMessage()); case 8: return new NM(getMessage()); case 9: return new NM(getMessage()); case 10: return new NM(getMessage()); case 11: return new NM(getMessage()); case 12: return new NM(getMessage()); case 13: return new NM(getMessage()); case 14: return new NM(getMessage()); default: return null; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy