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 SPM message segment.
/// This segment has the following fields:<ol>
///<li>SPM-1: Set ID - SPM (SI)</li>
///<li>SPM-2: Specimen ID (EIP)</li>
///<li>SPM-3: Specimen Parent IDs (EIP)</li>
///<li>SPM-4: Specimen Type (CWE)</li>
///<li>SPM-5: Specimen Type Modifier (CWE)</li>
///<li>SPM-6: Specimen Additives (CWE)</li>
///<li>SPM-7: Specimen Collection Method (CWE)</li>
///<li>SPM-8: Specimen Source Site (CWE)</li>
///<li>SPM-9: Specimen Source Site Modifier (CWE)</li>
///<li>SPM-10: Specimen Collection Site (CWE)</li>
///<li>SPM-11: Specimen Role (CWE)</li>
///<li>SPM-12: Specimen Collection Amount (CQ)</li>
///<li>SPM-13: Grouped Specimen Count (NM)</li>
///<li>SPM-14: Specimen Description (ST)</li>
///<li>SPM-15: Specimen Handling Code (CWE)</li>
///<li>SPM-16: Specimen Risk Code (CWE)</li>
///<li>SPM-17: Specimen Collection Date/Time (DR)</li>
///<li>SPM-18: Specimen Received Date/Time (TS)</li>
///<li>SPM-19: Specimen Expiration Date/Time (TS)</li>
///<li>SPM-20: Specimen Availability (ID)</li>
///<li>SPM-21: Specimen Reject Reason (CWE)</li>
///<li>SPM-22: Specimen Quality (CWE)</li>
///<li>SPM-23: Specimen Appropriateness (CWE)</li>
///<li>SPM-24: Specimen Condition (CWE)</li>
///<li>SPM-25: Specimen Current Quantity (CQ)</li>
///<li>SPM-26: Number of Specimen Containers (NM)</li>
///<li>SPM-27: Container Type (CWE)</li>
///<li>SPM-28: Container Condition (CWE)</li>
///<li>SPM-29: Specimen Child Role (CWE)</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 SPM : AbstractSegment {
/**
* Creates a SPM (Specimen) segment object that belongs to the given
* message.
*/
public SPM(IGroup parent, IModelClassFactory factory) : base(parent,factory) {
IMessage message = Message;
try {
this.add(typeof(SI), false, 1, 4, new System.Object[]{message}, "Set ID - SPM");
this.add(typeof(EIP), false, 1, 80, new System.Object[]{message}, "Specimen ID");
this.add(typeof(EIP), false, 0, 80, new System.Object[]{message}, "Specimen Parent IDs");
this.add(typeof(CWE), true, 1, 250, new System.Object[]{message}, "Specimen Type");
this.add(typeof(CWE), false, 0, 250, new System.Object[]{message}, "Specimen Type Modifier");
this.add(typeof(CWE), false, 0, 250, new System.Object[]{message}, "Specimen Additives");
this.add(typeof(CWE), false, 1, 250, new System.Object[]{message}, "Specimen Collection Method");
this.add(typeof(CWE), false, 1, 250, new System.Object[]{message}, "Specimen Source Site");
this.add(typeof(CWE), false, 0, 250, new System.Object[]{message}, "Specimen Source Site Modifier");
this.add(typeof(CWE), false, 1, 250, new System.Object[]{message}, "Specimen Collection Site");
this.add(typeof(CWE), false, 0, 250, new System.Object[]{message}, "Specimen Role");
this.add(typeof(CQ), false, 1, 20, new System.Object[]{message}, "Specimen Collection Amount");
this.add(typeof(NM), false, 1, 6, new System.Object[]{message}, "Grouped Specimen Count");
this.add(typeof(ST), false, 0, 250, new System.Object[]{message}, "Specimen Description");
this.add(typeof(CWE), false, 0, 250, new System.Object[]{message}, "Specimen Handling Code");
this.add(typeof(CWE), false, 0, 250, new System.Object[]{message}, "Specimen Risk Code");
this.add(typeof(DR), false, 1, 26, new System.Object[]{message}, "Specimen Collection Date/Time");
this.add(typeof(TS), false, 1, 26, new System.Object[]{message}, "Specimen Received Date/Time");
this.add(typeof(TS), false, 1, 26, new System.Object[]{message}, "Specimen Expiration Date/Time");
this.add(typeof(ID), false, 1, 1, new System.Object[]{message, 136}, "Specimen Availability");
this.add(typeof(CWE), false, 0, 250, new System.Object[]{message}, "Specimen Reject Reason");
this.add(typeof(CWE), false, 1, 250, new System.Object[]{message}, "Specimen Quality");
this.add(typeof(CWE), false, 1, 250, new System.Object[]{message}, "Specimen Appropriateness");
this.add(typeof(CWE), false, 0, 250, new System.Object[]{message}, "Specimen Condition");
this.add(typeof(CQ), false, 1, 20, new System.Object[]{message}, "Specimen Current Quantity");
this.add(typeof(NM), false, 1, 4, new System.Object[]{message}, "Number of Specimen Containers");
this.add(typeof(CWE), false, 1, 250, new System.Object[]{message}, "Container Type");
this.add(typeof(CWE), false, 1, 250, new System.Object[]{message}, "Container Condition");
this.add(typeof(CWE), false, 1, 250, new System.Object[]{message}, "Specimen Child Role");
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Can't instantiate " + GetType().Name, he);
}
}
///<summary>
/// Returns Set ID - SPM(SPM-1).
///</summary>
public SI SetIDSPM
{
get{
SI ret = null;
try
{
IType t = this.GetField(1, 0);
ret = (SI)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 Specimen ID(SPM-2).
///</summary>
public EIP SpecimenID
{
get{
EIP ret = null;
try
{
IType t = this.GetField(2, 0);
ret = (EIP)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 a single repetition of Specimen Parent IDs(SPM-3).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public EIP GetSpecimenParentIDs(int rep)
{
EIP ret = null;
try
{
IType t = this.GetField(3, rep);
ret = (EIP)t;
} 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 all repetitions of Specimen Parent IDs (SPM-3).
///</summary>
public EIP[] GetSpecimenParentIDs() {
EIP[] ret = null;
try {
IType[] t = this.GetField(3);
ret = new EIP[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (EIP)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Parent IDs (SPM-3).
///</summary>
public int SpecimenParentIDsRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(3);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns Specimen Type(SPM-4).
///</summary>
public CWE SpecimenType
{
get{
CWE ret = null;
try
{
IType t = this.GetField(4, 0);
ret = (CWE)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 a single repetition of Specimen Type Modifier(SPM-5).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CWE GetSpecimenTypeModifier(int rep)
{
CWE ret = null;
try
{
IType t = this.GetField(5, rep);
ret = (CWE)t;
} 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 all repetitions of Specimen Type Modifier (SPM-5).
///</summary>
public CWE[] GetSpecimenTypeModifier() {
CWE[] ret = null;
try {
IType[] t = this.GetField(5);
ret = new CWE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CWE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Type Modifier (SPM-5).
///</summary>
public int SpecimenTypeModifierRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(5);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns a single repetition of Specimen Additives(SPM-6).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CWE GetSpecimenAdditives(int rep)
{
CWE ret = null;
try
{
IType t = this.GetField(6, rep);
ret = (CWE)t;
} 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 all repetitions of Specimen Additives (SPM-6).
///</summary>
public CWE[] GetSpecimenAdditives() {
CWE[] ret = null;
try {
IType[] t = this.GetField(6);
ret = new CWE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CWE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Additives (SPM-6).
///</summary>
public int SpecimenAdditivesRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(6);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns Specimen Collection Method(SPM-7).
///</summary>
public CWE SpecimenCollectionMethod
{
get{
CWE ret = null;
try
{
IType t = this.GetField(7, 0);
ret = (CWE)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 Specimen Source Site(SPM-8).
///</summary>
public CWE SpecimenSourceSite
{
get{
CWE ret = null;
try
{
IType t = this.GetField(8, 0);
ret = (CWE)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 a single repetition of Specimen Source Site Modifier(SPM-9).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CWE GetSpecimenSourceSiteModifier(int rep)
{
CWE ret = null;
try
{
IType t = this.GetField(9, rep);
ret = (CWE)t;
} 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 all repetitions of Specimen Source Site Modifier (SPM-9).
///</summary>
public CWE[] GetSpecimenSourceSiteModifier() {
CWE[] ret = null;
try {
IType[] t = this.GetField(9);
ret = new CWE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CWE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Source Site Modifier (SPM-9).
///</summary>
public int SpecimenSourceSiteModifierRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(9);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns Specimen Collection Site(SPM-10).
///</summary>
public CWE SpecimenCollectionSite
{
get{
CWE ret = null;
try
{
IType t = this.GetField(10, 0);
ret = (CWE)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 a single repetition of Specimen Role(SPM-11).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CWE GetSpecimenRole(int rep)
{
CWE ret = null;
try
{
IType t = this.GetField(11, rep);
ret = (CWE)t;
} 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 all repetitions of Specimen Role (SPM-11).
///</summary>
public CWE[] GetSpecimenRole() {
CWE[] ret = null;
try {
IType[] t = this.GetField(11);
ret = new CWE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CWE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Role (SPM-11).
///</summary>
public int SpecimenRoleRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(11);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns Specimen Collection Amount(SPM-12).
///</summary>
public CQ SpecimenCollectionAmount
{
get{
CQ ret = null;
try
{
IType t = this.GetField(12, 0);
ret = (CQ)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 Grouped Specimen Count(SPM-13).
///</summary>
public NM GroupedSpecimenCount
{
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 a single repetition of Specimen Description(SPM-14).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public ST GetSpecimenDescription(int rep)
{
ST ret = null;
try
{
IType t = this.GetField(14, rep);
ret = (ST)t;
} 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 all repetitions of Specimen Description (SPM-14).
///</summary>
public ST[] GetSpecimenDescription() {
ST[] ret = null;
try {
IType[] t = this.GetField(14);
ret = new ST[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (ST)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Description (SPM-14).
///</summary>
public int SpecimenDescriptionRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(14);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns a single repetition of Specimen Handling Code(SPM-15).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CWE GetSpecimenHandlingCode(int rep)
{
CWE ret = null;
try
{
IType t = this.GetField(15, rep);
ret = (CWE)t;
} 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 all repetitions of Specimen Handling Code (SPM-15).
///</summary>
public CWE[] GetSpecimenHandlingCode() {
CWE[] ret = null;
try {
IType[] t = this.GetField(15);
ret = new CWE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CWE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Handling Code (SPM-15).
///</summary>
public int SpecimenHandlingCodeRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(15);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns a single repetition of Specimen Risk Code(SPM-16).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CWE GetSpecimenRiskCode(int rep)
{
CWE ret = null;
try
{
IType t = this.GetField(16, rep);
ret = (CWE)t;
} 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 all repetitions of Specimen Risk Code (SPM-16).
///</summary>
public CWE[] GetSpecimenRiskCode() {
CWE[] ret = null;
try {
IType[] t = this.GetField(16);
ret = new CWE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CWE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Risk Code (SPM-16).
///</summary>
public int SpecimenRiskCodeRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(16);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns Specimen Collection Date/Time(SPM-17).
///</summary>
public DR SpecimenCollectionDateTime
{
get{
DR ret = null;
try
{
IType t = this.GetField(17, 0);
ret = (DR)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 Specimen Received Date/Time(SPM-18).
///</summary>
public TS SpecimenReceivedDateTime
{
get{
TS ret = null;
try
{
IType t = this.GetField(18, 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 Specimen Expiration Date/Time(SPM-19).
///</summary>
public TS SpecimenExpirationDateTime
{
get{
TS ret = null;
try
{
IType t = this.GetField(19, 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 Specimen Availability(SPM-20).
///</summary>
public ID SpecimenAvailability
{
get{
ID ret = null;
try
{
IType t = this.GetField(20, 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 a single repetition of Specimen Reject Reason(SPM-21).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CWE GetSpecimenRejectReason(int rep)
{
CWE ret = null;
try
{
IType t = this.GetField(21, rep);
ret = (CWE)t;
} 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 all repetitions of Specimen Reject Reason (SPM-21).
///</summary>
public CWE[] GetSpecimenRejectReason() {
CWE[] ret = null;
try {
IType[] t = this.GetField(21);
ret = new CWE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CWE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Reject Reason (SPM-21).
///</summary>
public int SpecimenRejectReasonRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(21);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns Specimen Quality(SPM-22).
///</summary>
public CWE SpecimenQuality
{
get{
CWE ret = null;
try
{
IType t = this.GetField(22, 0);
ret = (CWE)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 Specimen Appropriateness(SPM-23).
///</summary>
public CWE SpecimenAppropriateness
{
get{
CWE ret = null;
try
{
IType t = this.GetField(23, 0);
ret = (CWE)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 a single repetition of Specimen Condition(SPM-24).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CWE GetSpecimenCondition(int rep)
{
CWE ret = null;
try
{
IType t = this.GetField(24, rep);
ret = (CWE)t;
} 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 all repetitions of Specimen Condition (SPM-24).
///</summary>
public CWE[] GetSpecimenCondition() {
CWE[] ret = null;
try {
IType[] t = this.GetField(24);
ret = new CWE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CWE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Specimen Condition (SPM-24).
///</summary>
public int SpecimenConditionRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(24);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns Specimen Current Quantity(SPM-25).
///</summary>
public CQ SpecimenCurrentQuantity
{
get{
CQ ret = null;
try
{
IType t = this.GetField(25, 0);
ret = (CQ)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 Number of Specimen Containers(SPM-26).
///</summary>
public NM NumberOfSpecimenContainers
{
get{
NM ret = null;
try
{
IType t = this.GetField(26, 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 Container Type(SPM-27).
///</summary>
public CWE ContainerType
{
get{
CWE ret = null;
try
{
IType t = this.GetField(27, 0);
ret = (CWE)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 Container Condition(SPM-28).
///</summary>
public CWE ContainerCondition
{
get{
CWE ret = null;
try
{
IType t = this.GetField(28, 0);
ret = (CWE)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 Specimen Child Role(SPM-29).
///</summary>
public CWE SpecimenChildRole
{
get{
CWE ret = null;
try
{
IType t = this.GetField(29, 0);
ret = (CWE)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;
}
}
}}
|