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 PPR_PC1_PROBLEM 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: PRB (Problem Details) </li>
///<li>1: NTE (Notes and Comments) optional repeating</li>
///<li>2: VAR (Variance) optional repeating</li>
///<li>3: PPR_PC1_PROBLEM_ROLE (a Group object) </li>
///<li>4: PPR_PC1_PATHWAY (a Group object) </li>
///<li>5: PPR_PC1_PROBLEM_OBSERVATION (a Group object) </li>
///<li>6: PPR_PC1_GOAL (a Group object) </li>
///<li>7: PPR_PC1_ORDER (a Group object) </li>
///</ol>
///</summary>
[Serializable]
public class PPR_PC1_PROBLEM : AbstractGroup {
///<summary>
/// Creates a new PPR_PC1_PROBLEM Group.
///</summary>
public PPR_PC1_PROBLEM(IGroup parent, IModelClassFactory factory) : base(parent, factory){
try {
this.add(typeof(PRB), true, false);
this.add(typeof(NTE), false, true);
this.add(typeof(VAR), false, true);
this.add(typeof(PPR_PC1_PROBLEM_ROLE), true, false);
this.add(typeof(PPR_PC1_PATHWAY), true, false);
this.add(typeof(PPR_PC1_PROBLEM_OBSERVATION), true, false);
this.add(typeof(PPR_PC1_GOAL), true, false);
this.add(typeof(PPR_PC1_ORDER), true, false);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error creating PPR_PC1_PROBLEM - this is probably a bug in the source code generator.", e);
}
}
///<summary>
/// Returns PRB (Problem Details) - creates it if necessary
///</summary>
public PRB PRB {
get{
PRB ret = null;
try {
ret = (PRB)this.GetStructure("PRB");
} 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 NTE (Notes and Comments) - creates it if necessary
///</summary>
public NTE GetNTE() {
NTE ret = null;
try {
ret = (NTE)this.GetStructure("NTE");
} 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 NTE
/// * (Notes and Comments) - creates it if necessary
/// throws HL7Exception if the repetition requested is more than one
/// greater than the number of existing repetitions.
///</summary>
public NTE GetNTE(int rep) {
return (NTE)this.GetStructure("NTE", rep);
}
/**
* Returns the number of existing repetitions of NTE
*/
public int NTERepetitionsUsed {
get{
int reps = -1;
try {
reps = this.GetAll("NTE").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 first repetition of VAR (Variance) - creates it if necessary
///</summary>
public VAR GetVAR() {
VAR ret = null;
try {
ret = (VAR)this.GetStructure("VAR");
} 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 VAR
/// * (Variance) - creates it if necessary
/// throws HL7Exception if the repetition requested is more than one
/// greater than the number of existing repetitions.
///</summary>
public VAR GetVAR(int rep) {
return (VAR)this.GetStructure("VAR", rep);
}
/**
* Returns the number of existing repetitions of VAR
*/
public int VARRepetitionsUsed {
get{
int reps = -1;
try {
reps = this.GetAll("VAR").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 PPR_PC1_PROBLEM_ROLE (a Group object) - creates it if necessary
///</summary>
public PPR_PC1_PROBLEM_ROLE PROBLEM_ROLE {
get{
PPR_PC1_PROBLEM_ROLE ret = null;
try {
ret = (PPR_PC1_PROBLEM_ROLE)this.GetStructure("PROBLEM_ROLE");
} 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 PPR_PC1_PATHWAY (a Group object) - creates it if necessary
///</summary>
public PPR_PC1_PATHWAY PATHWAY {
get{
PPR_PC1_PATHWAY ret = null;
try {
ret = (PPR_PC1_PATHWAY)this.GetStructure("PATHWAY");
} 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 PPR_PC1_PROBLEM_OBSERVATION (a Group object) - creates it if necessary
///</summary>
public PPR_PC1_PROBLEM_OBSERVATION PROBLEM_OBSERVATION {
get{
PPR_PC1_PROBLEM_OBSERVATION ret = null;
try {
ret = (PPR_PC1_PROBLEM_OBSERVATION)this.GetStructure("PROBLEM_OBSERVATION");
} 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 PPR_PC1_GOAL (a Group object) - creates it if necessary
///</summary>
public PPR_PC1_GOAL GOAL {
get{
PPR_PC1_GOAL ret = null;
try {
ret = (PPR_PC1_GOAL)this.GetStructure("GOAL");
} 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 PPR_PC1_ORDER (a Group object) - creates it if necessary
///</summary>
public PPR_PC1_ORDER ORDER {
get{
PPR_PC1_ORDER ret = null;
try {
ret = (PPR_PC1_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;
}
}
}
}
|