using System;
using NHapi.Base.Log;
using NHapi.Model.V251.Group;
using NHapi.Model.V251.Segment;
using NHapi.Base;
using NHapi.Base.Parser;
using NHapi.Base.Model;
namespace NHapi.Model.V251.Message{
///<summary>
/// Represents a UDM_Q05 message structure (see chapter [AAA]). This structure contains the
/// following elements:
///<ol>
///<li>0: MSH (Message Header) </li>
///<li>1: SFT (Software Segment) optional repeating</li>
///<li>2: URD (Results/update Definition) </li>
///<li>3: URS (Unsolicited Selection) optional </li>
///<li>4: DSP (Display Data) repeating</li>
///<li>5: DSC (Continuation Pointer) optional </li>
///</ol>
///</summary>
[Serializable]
public class UDM_Q05 : AbstractMessage {
///<summary>
/// Creates a new UDM_Q05 Group with custom IModelClassFactory.
///</summary>
public UDM_Q05(IModelClassFactory factory) : base(factory){
init(factory);
}
///<summary>
/// Creates a new UDM_Q05 Group with DefaultModelClassFactory.
///</summary>
public UDM_Q05() : base(new DefaultModelClassFactory()) {
init(new DefaultModelClassFactory());
}
///<summary>
/// initalize method for UDM_Q05. This does the segment setup for the message.
///</summary>
private void init(IModelClassFactory factory) {
try {
this.add(typeof(MSH), true, false);
this.add(typeof(SFT), false, true);
this.add(typeof(URD), true, false);
this.add(typeof(URS), false, false);
this.add(typeof(DSP), true, true);
this.add(typeof(DSC), false, false);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error creating UDM_Q05 - this is probably a bug in the source code generator.", e);
}
}
///<summary>
/// Returns MSH (Message Header) - creates it if necessary
///</summary>
public MSH MSH {
get{
MSH ret = null;
try {
ret = (MSH)this.GetStructure("MSH");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
}
///<summary>
/// Returns first repetition of SFT (Software Segment) - creates it if necessary
///</summary>
public SFT GetSFT() {
SFT ret = null;
try {
ret = (SFT)this.GetStructure("SFT");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
///<summary>
///Returns a specific repetition of SFT
/// * (Software Segment) - creates it if necessary
/// throws HL7Exception if the repetition requested is more than one
/// greater than the number of existing repetitions.
///</summary>
public SFT GetSFT(int rep) {
return (SFT)this.GetStructure("SFT", rep);
}
/**
* Returns the number of existing repetitions of SFT
*/
public int SFTRepetitionsUsed {
get{
int reps = -1;
try {
reps = this.GetAll("SFT").Length;
} catch (HL7Exception e) {
string message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
HapiLogFactory.getHapiLog(GetType()).error(message, e);
throw new System.Exception(message);
}
return reps;
}
}
///<summary>
/// Returns URD (Results/update Definition) - creates it if necessary
///</summary>
public URD URD {
get{
URD ret = null;
try {
ret = (URD)this.GetStructure("URD");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
}
///<summary>
/// Returns URS (Unsolicited Selection) - creates it if necessary
///</summary>
public URS URS {
get{
URS ret = null;
try {
ret = (URS)this.GetStructure("URS");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
}
///<summary>
/// Returns first repetition of DSP (Display Data) - creates it if necessary
///</summary>
public DSP GetDSP() {
DSP ret = null;
try {
ret = (DSP)this.GetStructure("DSP");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
///<summary>
///Returns a specific repetition of DSP
/// * (Display Data) - creates it if necessary
/// throws HL7Exception if the repetition requested is more than one
/// greater than the number of existing repetitions.
///</summary>
public DSP GetDSP(int rep) {
return (DSP)this.GetStructure("DSP", rep);
}
/**
* Returns the number of existing repetitions of DSP
*/
public int DSPRepetitionsUsed {
get{
int reps = -1;
try {
reps = this.GetAll("DSP").Length;
} catch (HL7Exception e) {
string message = "Unexpected error accessing data - this is probably a bug in the source code generator.";
HapiLogFactory.getHapiLog(GetType()).error(message, e);
throw new System.Exception(message);
}
return reps;
}
}
///<summary>
/// Returns DSC (Continuation Pointer) - creates it if necessary
///</summary>
public DSC DSC {
get{
DSC ret = null;
try {
ret = (DSC)this.GetStructure("DSC");
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error accessing data - this is probably a bug in the source code generator.", e);
throw new System.Exception("An unexpected error ocurred",e);
}
return ret;
}
}
}
}
|