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 RRA_O18_RESPONSE 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: RRA_O18_PATIENT (a Group object) optional </li>
///<li>1: RRA_O18_ORDER (a Group object) repeating</li>
///</ol>
///</summary>
[Serializable]
public class RRA_O18_RESPONSE : AbstractGroup {
///<summary>
/// Creates a new RRA_O18_RESPONSE Group.
///</summary>
public RRA_O18_RESPONSE(IGroup parent, IModelClassFactory factory) : base(parent, factory){
try {
this.add(typeof(RRA_O18_PATIENT), false, false);
this.add(typeof(RRA_O18_ORDER), true, true);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error creating RRA_O18_RESPONSE - this is probably a bug in the source code generator.", e);
}
}
///<summary>
/// Returns RRA_O18_PATIENT (a Group object) - creates it if necessary
///</summary>
public RRA_O18_PATIENT PATIENT {
get{
RRA_O18_PATIENT ret = null;
try {
ret = (RRA_O18_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 RRA_O18_ORDER (a Group object) - creates it if necessary
///</summary>
public RRA_O18_ORDER GetORDER() {
RRA_O18_ORDER ret = null;
try {
ret = (RRA_O18_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 RRA_O18_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 RRA_O18_ORDER GetORDER(int rep) {
return (RRA_O18_ORDER)this.GetStructure("ORDER", rep);
}
/**
* Returns the number of existing repetitions of RRA_O18_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;
}
}
}
}
|