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 DG1 message segment.
/// This segment has the following fields:<ol>
///<li>DG1-1: Set ID - DG1 (SI)</li>
///<li>DG1-2: Diagnosis Coding Method (ID)</li>
///<li>DG1-3: Diagnosis Code - DG1 (CE)</li>
///<li>DG1-4: Diagnosis Description (ST)</li>
///<li>DG1-5: Diagnosis Date/Time (TS)</li>
///<li>DG1-6: Diagnosis Type (IS)</li>
///<li>DG1-7: Major Diagnostic Category (CE)</li>
///<li>DG1-8: Diagnostic Related Group (CE)</li>
///<li>DG1-9: DRG Approval Indicator (ID)</li>
///<li>DG1-10: DRG Grouper Review Code (IS)</li>
///<li>DG1-11: Outlier Type (CE)</li>
///<li>DG1-12: Outlier Days (NM)</li>
///<li>DG1-13: Outlier Cost (CP)</li>
///<li>DG1-14: Grouper Version And Type (ST)</li>
///<li>DG1-15: Diagnosis Priority (ID)</li>
///<li>DG1-16: Diagnosing Clinician (XCN)</li>
///<li>DG1-17: Diagnosis Classification (IS)</li>
///<li>DG1-18: Confidential Indicator (ID)</li>
///<li>DG1-19: Attestation Date/Time (TS)</li>
///<li>DG1-20: Diagnosis Identifier (EI)</li>
///<li>DG1-21: Diagnosis Action Code (ID)</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 DG1 : AbstractSegment {
/**
* Creates a DG1 (Diagnosis) segment object that belongs to the given
* message.
*/
public DG1(IGroup parent, IModelClassFactory factory) : base(parent,factory) {
IMessage message = Message;
try {
this.add(typeof(SI), true, 1, 4, new System.Object[]{message}, "Set ID - DG1");
this.add(typeof(ID), false, 1, 2, new System.Object[]{message, 53}, "Diagnosis Coding Method");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Diagnosis Code - DG1");
this.add(typeof(ST), false, 1, 40, new System.Object[]{message}, "Diagnosis Description");
this.add(typeof(TS), false, 1, 26, new System.Object[]{message}, "Diagnosis Date/Time");
this.add(typeof(IS), true, 1, 2, new System.Object[]{message, 52}, "Diagnosis Type");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Major Diagnostic Category");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Diagnostic Related Group");
this.add(typeof(ID), false, 1, 1, new System.Object[]{message, 136}, "DRG Approval Indicator");
this.add(typeof(IS), false, 1, 2, new System.Object[]{message, 56}, "DRG Grouper Review Code");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Outlier Type");
this.add(typeof(NM), false, 1, 3, new System.Object[]{message}, "Outlier Days");
this.add(typeof(CP), false, 1, 12, new System.Object[]{message}, "Outlier Cost");
this.add(typeof(ST), false, 1, 4, new System.Object[]{message}, "Grouper Version And Type");
this.add(typeof(ID), false, 1, 2, new System.Object[]{message, 359}, "Diagnosis Priority");
this.add(typeof(XCN), false, 0, 250, new System.Object[]{message}, "Diagnosing Clinician");
this.add(typeof(IS), false, 1, 3, new System.Object[]{message, 228}, "Diagnosis Classification");
this.add(typeof(ID), false, 1, 1, new System.Object[]{message, 136}, "Confidential Indicator");
this.add(typeof(TS), false, 1, 26, new System.Object[]{message}, "Attestation Date/Time");
this.add(typeof(EI), false, 1, 427, new System.Object[]{message}, "Diagnosis Identifier");
this.add(typeof(ID), false, 1, 1, new System.Object[]{message, 206}, "Diagnosis Action Code");
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Can't instantiate " + GetType().Name, he);
}
}
///<summary>
/// Returns Set ID - DG1(DG1-1).
///</summary>
public SI SetIDDG1
{
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 Diagnosis Coding Method(DG1-2).
///</summary>
public ID DiagnosisCodingMethod
{
get{
ID ret = null;
try
{
IType t = this.GetField(2, 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 Diagnosis Code - DG1(DG1-3).
///</summary>
public CE DiagnosisCodeDG1
{
get{
CE ret = null;
try
{
IType t = this.GetField(3, 0);
ret = (CE)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 Diagnosis Description(DG1-4).
///</summary>
public ST DiagnosisDescription
{
get{
ST ret = null;
try
{
IType t = this.GetField(4, 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 Diagnosis Date/Time(DG1-5).
///</summary>
public TS DiagnosisDateTime
{
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 Diagnosis Type(DG1-6).
///</summary>
public IS DiagnosisType
{
get{
IS ret = null;
try
{
IType t = this.GetField(6, 0);
ret = (IS)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 Major Diagnostic Category(DG1-7).
///</summary>
public CE MajorDiagnosticCategory
{
get{
CE ret = null;
try
{
IType t = this.GetField(7, 0);
ret = (CE)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 Diagnostic Related Group(DG1-8).
///</summary>
public CE DiagnosticRelatedGroup
{
get{
CE ret = null;
try
{
IType t = this.GetField(8, 0);
ret = (CE)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 DRG Approval Indicator(DG1-9).
///</summary>
public ID DRGApprovalIndicator
{
get{
ID ret = null;
try
{
IType t = this.GetField(9, 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 DRG Grouper Review Code(DG1-10).
///</summary>
public IS DRGGrouperReviewCode
{
get{
IS ret = null;
try
{
IType t = this.GetField(10, 0);
ret = (IS)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 Outlier Type(DG1-11).
///</summary>
public CE OutlierType
{
get{
CE ret = null;
try
{
IType t = this.GetField(11, 0);
ret = (CE)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 Outlier Days(DG1-12).
///</summary>
public NM OutlierDays
{
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 Outlier Cost(DG1-13).
///</summary>
public CP OutlierCost
{
get{
CP ret = null;
try
{
IType t = this.GetField(13, 0);
ret = (CP)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 Grouper Version And Type(DG1-14).
///</summary>
public ST GrouperVersionAndType
{
get{
ST ret = null;
try
{
IType t = this.GetField(14, 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 Diagnosis Priority(DG1-15).
///</summary>
public ID DiagnosisPriority
{
get{
ID ret = null;
try
{
IType t = this.GetField(15, 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 Diagnosing Clinician(DG1-16).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public XCN GetDiagnosingClinician(int rep)
{
XCN ret = null;
try
{
IType t = this.GetField(16, rep);
ret = (XCN)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 Diagnosing Clinician (DG1-16).
///</summary>
public XCN[] GetDiagnosingClinician() {
XCN[] ret = null;
try {
IType[] t = this.GetField(16);
ret = new XCN[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (XCN)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 Diagnosing Clinician (DG1-16).
///</summary>
public int DiagnosingClinicianRepetitionsUsed
{
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 Diagnosis Classification(DG1-17).
///</summary>
public IS DiagnosisClassification
{
get{
IS ret = null;
try
{
IType t = this.GetField(17, 0);
ret = (IS)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 Confidential Indicator(DG1-18).
///</summary>
public ID ConfidentialIndicator
{
get{
ID ret = null;
try
{
IType t = this.GetField(18, 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 Attestation Date/Time(DG1-19).
///</summary>
public TS AttestationDateTime
{
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 Diagnosis Identifier(DG1-20).
///</summary>
public EI DiagnosisIdentifier
{
get{
EI ret = null;
try
{
IType t = this.GetField(20, 0);
ret = (EI)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 Diagnosis Action Code(DG1-21).
///</summary>
public ID DiagnosisActionCode
{
get{
ID ret = null;
try
{
IType t = this.GetField(21, 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;
}
}
}}
|