using NHapi.Base.Parser;
using NHapi.Base;
using NHapi.Base.Log;
using System;
using NHapi.Model.V251.Segment;
using NHapi.Base.Model;
namespace NHapi.Model.V251.Group{
///<summary>
///Represents the ROR_ROR_DEFINITION Group. A Group is an ordered collection of message
/// segments that can repeat together or be optionally in/excluded together.
/// This Group contains the following elements:
///<ol>
///<li>0: QRD (Original-Style Query Definition) </li>
///<li>1: QRF (Original style query filter) optional </li>
///<li>2: ROR_ROR_PATIENT (a Group object) optional </li>
///<li>3: ROR_ROR_ORDER (a Group object) repeating</li>
///</ol>
///</summary>
[Serializable]
public class ROR_ROR_DEFINITION : AbstractGroup {
///<summary>
/// Creates a new ROR_ROR_DEFINITION Group.
///</summary>
public ROR_ROR_DEFINITION(IGroup parent, IModelClassFactory factory) : base(parent, factory){
try {
this.add(typeof(QRD), true, false);
this.add(typeof(QRF), false, false);
this.add(typeof(ROR_ROR_PATIENT), false, false);
this.add(typeof(ROR_ROR_ORDER), true, true);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error creating ROR_ROR_DEFINITION - this is probably a bug in the source code generator.", e);
}
}
///<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 ROR_ROR_PATIENT (a Group object) - creates it if necessary
///</summary>
public ROR_ROR_PATIENT PATIENT {
get{
ROR_ROR_PATIENT ret = null;
try {
ret = (ROR_ROR_PATIENT)this.GetStructure("PATIENT");
} 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 ROR_ROR_ORDER (a Group object) - creates it if necessary
///</summary>
public ROR_ROR_ORDER GetORDER() {
ROR_ROR_ORDER ret = null;
try {
ret = (ROR_ROR_ORDER)this.GetStructure("ORDER");
} 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 ROR_ROR_ORDER
/// * (a Group object) - creates it if necessary
/// throws HL7Exception if the repetition requested is more than one
/// greater than the number of existing repetitions.
///</summary>
public ROR_ROR_ORDER GetORDER(int rep) {
return (ROR_ROR_ORDER)this.GetStructure("ORDER", rep);
}
/**
* Returns the number of existing repetitions of ROR_ROR_ORDER
*/
public int ORDERRepetitionsUsed {
get{
int reps = -1;
try {
reps = this.GetAll("ORDER").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;
}
}
}
}
|