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 SQM_S25 message structure (see chapter 10.5.3). This structure contains the
/// following elements:
///<ol>
///<li>0: MSH (Message Header) </li>
///<li>1: QRD (Original-Style Query Definition) </li>
///<li>2: QRF (Original style query filter) optional </li>
///<li>3: SQM_S25_REQUEST (a Group object) optional </li>
///<li>4: DSC (Continuation Pointer) optional </li>
///</ol>
///</summary>
[Serializable]
public class SQM_S25 : AbstractMessage {
///<summary>
/// Creates a new SQM_S25 Group with custom IModelClassFactory.
///</summary>
public SQM_S25(IModelClassFactory factory) : base(factory){
init(factory);
}
///<summary>
/// Creates a new SQM_S25 Group with DefaultModelClassFactory.
///</summary>
public SQM_S25() : base(new DefaultModelClassFactory()) {
init(new DefaultModelClassFactory());
}
///<summary>
/// initalize method for SQM_S25. This does the segment setup for the message.
///</summary>
private void init(IModelClassFactory factory) {
try {
this.add(typeof(MSH), true, false);
this.add(typeof(QRD), true, false);
this.add(typeof(QRF), false, false);
this.add(typeof(SQM_S25_REQUEST), false, false);
this.add(typeof(DSC), false, false);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error creating SQM_S25 - 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 QRD (Original-Style Query Definition) - creates it if necessary
///</summary>
public QRD QRD {
get{
QRD ret = null;
try {
ret = (QRD)this.GetStructure("QRD");
} 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 QRF (Original style query filter) - creates it if necessary
///</summary>
public QRF QRF {
get{
QRF ret = null;
try {
ret = (QRF)this.GetStructure("QRF");
} 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 SQM_S25_REQUEST (a Group object) - creates it if necessary
///</summary>
public SQM_S25_REQUEST REQUEST {
get{
SQM_S25_REQUEST ret = null;
try {
ret = (SQM_S25_REQUEST)this.GetStructure("REQUEST");
} 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 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;
}
}
}
}
|