using System;
using NHapi.Base;
using NHapi.Base.Parser;
using NHapi.Base.Model;
using NHapi.Model.V251.Datatype;
using NHapi.Base.Log;
namespace NHapi.Model.V251.Segment{
///<summary>
/// Represents an HL7 CSR message segment.
/// This segment has the following fields:<ol>
///<li>CSR-1: Sponsor Study ID (EI)</li>
///<li>CSR-2: Alternate Study ID (EI)</li>
///<li>CSR-3: Institution Registering the Patient (CE)</li>
///<li>CSR-4: Sponsor Patient ID (CX)</li>
///<li>CSR-5: Alternate Patient ID - CSR (CX)</li>
///<li>CSR-6: Date/Time Of Patient Study Registration (TS)</li>
///<li>CSR-7: Person Performing Study Registration (XCN)</li>
///<li>CSR-8: Study Authorizing Provider (XCN)</li>
///<li>CSR-9: Date/time Patient Study Consent Signed (TS)</li>
///<li>CSR-10: Patient Study Eligibility Status (CE)</li>
///<li>CSR-11: Study Randomization Date/time (TS)</li>
///<li>CSR-12: Randomized Study Arm (CE)</li>
///<li>CSR-13: Stratum for Study Randomization (CE)</li>
///<li>CSR-14: Patient Evaluability Status (CE)</li>
///<li>CSR-15: Date/time Ended Study (TS)</li>
///<li>CSR-16: Reason Ended Study (CE)</li>
///</ol>
/// The get...() methods return data from individual fields. These methods
/// do not throw exceptions and may therefore have to handle exceptions internally.
/// If an exception is handled internally, it is logged and null is returned.
/// This is not expected to happen - if it does happen this indicates not so much
/// an exceptional circumstance as a bug in the code for this class.
///</summary>
[Serializable]
public class CSR : AbstractSegment {
/**
* Creates a CSR (Clinical Study Registration) segment object that belongs to the given
* message.
*/
public CSR(IGroup parent, IModelClassFactory factory) : base(parent,factory) {
IMessage message = Message;
try {
this.add(typeof(EI), true, 1, 60, new System.Object[]{message}, "Sponsor Study ID");
this.add(typeof(EI), false, 1, 60, new System.Object[]{message}, "Alternate Study ID");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Institution Registering the Patient");
this.add(typeof(CX), true, 1, 30, new System.Object[]{message}, "Sponsor Patient ID");
this.add(typeof(CX), false, 1, 30, new System.Object[]{message}, "Alternate Patient ID - CSR");
this.add(typeof(TS), true, 1, 26, new System.Object[]{message}, "Date/Time Of Patient Study Registration");
this.add(typeof(XCN), false, 0, 250, new System.Object[]{message}, "Person Performing Study Registration");
this.add(typeof(XCN), true, 0, 250, new System.Object[]{message}, "Study Authorizing Provider");
this.add(typeof(TS), false, 1, 26, new System.Object[]{message}, "Date/time Patient Study Consent Signed");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Patient Study Eligibility Status");
this.add(typeof(TS), false, 3, 26, new System.Object[]{message}, "Study Randomization Date/time");
this.add(typeof(CE), false, 3, 250, new System.Object[]{message}, "Randomized Study Arm");
this.add(typeof(CE), false, 3, 250, new System.Object[]{message}, "Stratum for Study Randomization");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Patient Evaluability Status");
this.add(typeof(TS), false, 1, 26, new System.Object[]{message}, "Date/time Ended Study");
this.add(typeof(CE), false, 1, 250, new System.Object[]{message}, "Reason Ended Study");
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Can't instantiate " + GetType().Name, he);
}
}
///<summary>
/// Returns Sponsor Study ID(CSR-1).
///</summary>
public EI SponsorStudyID
{
get{
EI ret = null;
try
{
IType t = this.GetField(1, 0);
ret = (EI)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns Alternate Study ID(CSR-2).
///</summary>
public EI AlternateStudyID
{
get{
EI ret = null;
try
{
IType t = this.GetField(2, 0);
ret = (EI)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns Institution Registering the Patient(CSR-3).
///</summary>
public CE InstitutionRegisteringThePatient
{
get{
CE ret = null;
try
{
IType t = this.GetField(3, 0);
ret = (CE)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns Sponsor Patient ID(CSR-4).
///</summary>
public CX SponsorPatientID
{
get{
CX ret = null;
try
{
IType t = this.GetField(4, 0);
ret = (CX)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns Alternate Patient ID - CSR(CSR-5).
///</summary>
public CX AlternatePatientIDCSR
{
get{
CX ret = null;
try
{
IType t = this.GetField(5, 0);
ret = (CX)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns Date/Time Of Patient Study Registration(CSR-6).
///</summary>
public TS DateTimeOfPatientStudyRegistration
{
get{
TS ret = null;
try
{
IType t = this.GetField(6, 0);
ret = (TS)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns a single repetition of Person Performing Study Registration(CSR-7).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public XCN GetPersonPerformingStudyRegistration(int rep)
{
XCN ret = null;
try
{
IType t = this.GetField(7, rep);
ret = (XCN)t;
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
///<summary>
/// Returns all repetitions of Person Performing Study Registration (CSR-7).
///</summary>
public XCN[] GetPersonPerformingStudyRegistration() {
XCN[] ret = null;
try {
IType[] t = this.GetField(7);
ret = new XCN[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (XCN)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Person Performing Study Registration (CSR-7).
///</summary>
public int PersonPerformingStudyRegistrationRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(7);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns a single repetition of Study Authorizing Provider(CSR-8).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public XCN GetStudyAuthorizingProvider(int rep)
{
XCN ret = null;
try
{
IType t = this.GetField(8, rep);
ret = (XCN)t;
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
///<summary>
/// Returns all repetitions of Study Authorizing Provider (CSR-8).
///</summary>
public XCN[] GetStudyAuthorizingProvider() {
XCN[] ret = null;
try {
IType[] t = this.GetField(8);
ret = new XCN[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (XCN)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Study Authorizing Provider (CSR-8).
///</summary>
public int StudyAuthorizingProviderRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(8);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns Date/time Patient Study Consent Signed(CSR-9).
///</summary>
public TS DateTimePatientStudyConsentSigned
{
get{
TS ret = null;
try
{
IType t = this.GetField(9, 0);
ret = (TS)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns Patient Study Eligibility Status(CSR-10).
///</summary>
public CE PatientStudyEligibilityStatus
{
get{
CE ret = null;
try
{
IType t = this.GetField(10, 0);
ret = (CE)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns a single repetition of Study Randomization Date/time(CSR-11).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public TS GetStudyRandomizationDateTime(int rep)
{
TS ret = null;
try
{
IType t = this.GetField(11, rep);
ret = (TS)t;
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
///<summary>
/// Returns all repetitions of Study Randomization Date/time (CSR-11).
///</summary>
public TS[] GetStudyRandomizationDateTime() {
TS[] ret = null;
try {
IType[] t = this.GetField(11);
ret = new TS[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (TS)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Study Randomization Date/time (CSR-11).
///</summary>
public int StudyRandomizationDateTimeRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(11);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns a single repetition of Randomized Study Arm(CSR-12).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CE GetRandomizedStudyArm(int rep)
{
CE ret = null;
try
{
IType t = this.GetField(12, rep);
ret = (CE)t;
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
///<summary>
/// Returns all repetitions of Randomized Study Arm (CSR-12).
///</summary>
public CE[] GetRandomizedStudyArm() {
CE[] ret = null;
try {
IType[] t = this.GetField(12);
ret = new CE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Randomized Study Arm (CSR-12).
///</summary>
public int RandomizedStudyArmRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(12);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns a single repetition of Stratum for Study Randomization(CSR-13).
/// throws HL7Exception if the repetition number is invalid.
/// <param name="rep">The repetition number (this is a repeating field)</param>
///</summary>
public CE GetStratumForStudyRandomization(int rep)
{
CE ret = null;
try
{
IType t = this.GetField(13, rep);
ret = (CE)t;
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
///<summary>
/// Returns all repetitions of Stratum for Study Randomization (CSR-13).
///</summary>
public CE[] GetStratumForStudyRandomization() {
CE[] ret = null;
try {
IType[] t = this.GetField(13);
ret = new CE[t.Length];
for (int i = 0; i < ret.Length; i++) {
ret[i] = (CE)t[i];
}
} catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
return ret;
}
///<summary>
/// Returns the total repetitions of Stratum for Study Randomization (CSR-13).
///</summary>
public int StratumForStudyRandomizationRepetitionsUsed
{
get{
try {
return GetTotalFieldRepetitionsUsed(13);
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(this.GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception cce) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", cce);
throw new System.Exception("An unexpected error ocurred", cce);
}
}
}
///<summary>
/// Returns Patient Evaluability Status(CSR-14).
///</summary>
public CE PatientEvaluabilityStatus
{
get{
CE ret = null;
try
{
IType t = this.GetField(14, 0);
ret = (CE)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns Date/time Ended Study(CSR-15).
///</summary>
public TS DateTimeEndedStudy
{
get{
TS ret = null;
try
{
IType t = this.GetField(15, 0);
ret = (TS)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
///<summary>
/// Returns Reason Ended Study(CSR-16).
///</summary>
public CE ReasonEndedStudy
{
get{
CE ret = null;
try
{
IType t = this.GetField(16, 0);
ret = (CE)t;
}
catch (HL7Exception he) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", he);
throw new System.Exception("An unexpected error ocurred", he);
} catch (System.Exception ex) {
HapiLogFactory.getHapiLog(GetType()).error("Unexpected problem obtaining field value. This is a bug.", ex);
throw new System.Exception("An unexpected error ocurred", ex);
}
return ret;
}
}
}}
|