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 ADT_A24 message structure (see chapter 3.3.24). This structure contains the
/// following elements:
///<ol>
///<li>0: MSH (Message Header) </li>
///<li>1: SFT (Software Segment) optional repeating</li>
///<li>2: EVN (Event Type) </li>
///<li>3: PID (Patient Identification) </li>
///<li>4: PD1 (Patient Additional Demographic) optional </li>
///<li>5: PV1 (Patient Visit) optional </li>
///<li>6: DB1 (Disability) optional repeating</li>
///<li>7: PID (Patient Identification) </li>
///<li>8: PD1 (Patient Additional Demographic) optional </li>
///<li>9: PV1 (Patient Visit) optional </li>
///<li>10: DB1 (Disability) optional repeating</li>
///</ol>
///</summary>
[Serializable]
public class ADT_A24 : AbstractMessage {
///<summary>
/// Creates a new ADT_A24 Group with custom IModelClassFactory.
///</summary>
public ADT_A24(IModelClassFactory factory) : base(factory){
init(factory);
}
///<summary>
/// Creates a new ADT_A24 Group with DefaultModelClassFactory.
///</summary>
public ADT_A24() : base(new DefaultModelClassFactory()) {
init(new DefaultModelClassFactory());
}
///<summary>
/// initalize method for ADT_A24. 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(EVN), true, false);
this.add(typeof(PID), true, false);
this.add(typeof(PD1), false, false);
this.add(typeof(PV1), false, false);
this.add(typeof(DB1), false, true);
this.add(typeof(PID), true, false);
this.add(typeof(PD1), false, false);
this.add(typeof(PV1), false, false);
this.add(typeof(DB1), false, true);
} catch(HL7Exception e) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected error creating ADT_A24 - 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 EVN (Event Type) - creates it if necessary
///</summary>
public EVN EVN {
get{
EVN ret = null;
try {
ret = (EVN)this.GetStructure("EVN");
} 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 PID (Patient Identification) - creates it if necessary
///</summary>
public PID PID {
get{
PID ret = null;
try {
ret = (PID)this.GetStructure("PID");
} 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 PD1 (Patient Additional Demographic) - creates it if necessary
///</summary>
public PD1 PD1 {
get{
PD1 ret = null;
try {
ret = (PD1)this.GetStructure("PD1");
} 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 PV1 (Patient Visit) - creates it if necessary
///</summary>
public PV1 PV1 {
get{
PV1 ret = null;
try {
ret = (PV1)this.GetStructure("PV1");
} 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 DB1 (Disability) - creates it if necessary
///</summary>
public DB1 GetDB1() {
DB1 ret = null;
try {
ret = (DB1)this.GetStructure("DB1");
} 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 DB1
/// * (Disability) - creates it if necessary
/// throws HL7Exception if the repetition requested is more than one
/// greater than the number of existing repetitions.
///</summary>
public DB1 GetDB1(int rep) {
return (DB1)this.GetStructure("DB1", rep);
}
/**
* Returns the number of existing repetitions of DB1
*/
public int DB1RepetitionsUsed {
get{
int reps = -1;
try {
reps = this.GetAll("DB1").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 PID2 (Patient Identification) - creates it if necessary
///</summary>
public PID PID2 {
get{
PID ret = null;
try {
ret = (PID)this.GetStructure("PID2");
} 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 PD12 (Patient Additional Demographic) - creates it if necessary
///</summary>
public PD1 PD12 {
get{
PD1 ret = null;
try {
ret = (PD1)this.GetStructure("PD12");
} 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 PV12 (Patient Visit) - creates it if necessary
///</summary>
public PV1 PV12 {
get{
PV1 ret = null;
try {
ret = (PV1)this.GetStructure("PV12");
} 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 DB12 (Disability) - creates it if necessary
///</summary>
public DB1 GetDB12() {
DB1 ret = null;
try {
ret = (DB1)this.GetStructure("DB12");
} 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 DB12
/// * (Disability) - creates it if necessary
/// throws HL7Exception if the repetition requested is more than one
/// greater than the number of existing repetitions.
///</summary>
public DB1 GetDB12(int rep) {
return (DB1)this.GetStructure("DB12", rep);
}
/**
* Returns the number of existing repetitions of DB12
*/
public int DB12RepetitionsUsed {
get{
int reps = -1;
try {
reps = this.GetAll("DB12").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;
}
}
}
}
|