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

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

There is a newer version: 2.3
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/
 */

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

// import ca.uhn.hl7v2.model.v21.group.*;
import ca.uhn.hl7v2.model.v21.datatype.*;
import ca.uhn.log.HapiLogFactory;
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 (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: NETWORK ERRORS (NM) optional *
*/ 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() }, "STATISTICS AVAILABLE"); this.add(ST.class, false, 1, 30, new Object[]{ getMessage(), new Integer(0) }, "SOURCE IDENTIFIER"); this.add(ID.class, false, 1, 3, new Object[]{ getMessage() }, "SOURCE TYPE"); this.add(TS.class, false, 1, 19, new Object[]{ getMessage(), new Integer(0) }, "STATISTICS START"); this.add(TS.class, false, 1, 19, new Object[]{ getMessage(), new Integer(0) }, "STATISTICS END"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "RECEIVE CHARACTER COUNT"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "SEND CHARACTER COUNT"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "MESSAGES RECEIVED"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "MESSAGES SENT"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "CHECKSUM ERRORS RECEIVED"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "LENGTH ERRORS RECEIVED"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "OTHER ERRORS RECEIVED"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "CONNECT TIMEOUTS"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "RECEIVE TIMEOUTS"); this.add(NM.class, false, 1, 10, new Object[]{ getMessage(), new Integer(0) }, "NETWORK ERRORS"); } catch(HL7Exception e) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-15: "NETWORK ERRORS" - creates it if necessary */ public NM getNETWORKERRORS() { NM ret = null; try { Type t = this.getField(15, 0); ret = (NM)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", he); throw new RuntimeException(he); } return ret; } /** * Returns * NST-15: "NETWORK ERRORS" - creates it if necessary */ public NM getNst15_NETWORKERRORS() { NM ret = null; try { Type t = this.getField(15, 0); ret = (NM)t; } catch (ClassCastException cce) { HapiLogFactory.getHapiLog(this.getClass()).error("Unexpected problem obtaining field value. This is a bug.", cce); throw new RuntimeException(cce); } catch (HL7Exception he) { HapiLogFactory.getHapiLog(this.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( 0 )); case 1: return new ST(getMessage()); case 2: return new ID(getMessage(), new Integer( 0 )); 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