22using NHapi . Base . Model ;
33using NHapi . Base . Log ;
44using NHapi . Base ;
5- using NHapi . Base . Model . Primitive ;
6-
7- namespace NHapi . Model . V22 . Datatype
8- {
9-
10- ///<summary>
11- /// <p>The HL7 CM_PARENT_RESULT (Undefined CM data type) data type. Consists of the following components: </p><ol>
12- /// <li>observation identifier (OBX-3) of parent result (CE)</li>
13- /// <li>sub-ID (OBX-4) of parent result (ST)</li>
14- /// <li>result (OBX-5) from parent (CE)</li>
15- /// </ol>
16- ///</summary>
17- [ Serializable ]
18- public class CM_PARENT_RESULT : AbstractType , IComposite {
19- private IType [ ] data ;
20-
21- ///<summary>
22- /// Creates a CM_PARENT_RESULT .
23- /// <param name="message">The Message to which this Type belongs</param>
24- ///</summary>
25- public CM_PARENT_RESULT ( IMessage message ) : this ( message , null ) { }
26-
27- ///<summary>
28- /// Creates a CM_PARENT_RESULT .
29- /// <param name="message">The Message to which this Type belongs</param>
30- /// <param name="description">The description of this type</param>
31- ///</summary>
32- public CM_PARENT_RESULT ( IMessage message , string description ) : base ( message , description ) {
33- data = new IType [ 3 ] ;
34- data [ 0 ] = new CE ( message , "Observation identifier (OBX-3) of parent result" ) ;
35- data [ 1 ] = new ST ( message , "Sub-ID (OBX-4) of parent result" ) ;
36- data [ 2 ] = new CE ( message , "Result (OBX-5) from parent" ) ;
37- }
38-
39- ///<summary>
40- /// Returns an array containing the data elements.
41- ///</summary>
42- public IType [ ] Components
43- {
44- get {
45- return this . data ;
46- }
47- }
48-
49- ///<summary>
50- /// Returns an individual data component.
51- /// @throws DataTypeException if the given element number is out of range.
52- ///<param name="index">The index item to get (zero based)</param>
53- ///<returns>The data component (as a type) at the requested number (ordinal)</returns>
54- ///</summary>
55- public IType this [ int index ] {
56-
57- get {
58- try {
59- return this . data [ index ] ;
60- } catch ( System . ArgumentOutOfRangeException ) {
61- throw new DataTypeException ( "Element " + index + " doesn't exist in 3 element CM_PARENT_RESULT composite" ) ;
62- }
63- }
64- }
65- ///<summary>
66- /// Returns observation identifier (OBX-3) of parent result (component #0). This is a convenience method that saves you from
67- /// casting and handling an exception.
68- ///</summary>
69- public CE ObservationIdentifierOBX3OfParentResult {
70- get {
71- CE ret = null ;
72- try {
73- ret = ( CE ) this [ 0 ] ;
74- } catch ( DataTypeException e ) {
75- HapiLogFactory . GetHapiLog ( this . GetType ( ) ) . Error ( "Unexpected problem accessing known data type component - this is a bug." , e ) ;
76- throw new System . Exception ( "An unexpected error ocurred" , e ) ;
77- }
78- return ret ;
79- }
80-
81- }
82- ///<summary>
83- /// Returns sub-ID (OBX-4) of parent result (component #1). This is a convenience method that saves you from
84- /// casting and handling an exception.
85- ///</summary>
86- public ST SubIDOBX4OfParentResult {
87- get {
88- ST ret = null ;
89- try {
90- ret = ( ST ) this [ 1 ] ;
91- } catch ( DataTypeException e ) {
92- HapiLogFactory . GetHapiLog ( this . GetType ( ) ) . Error ( "Unexpected problem accessing known data type component - this is a bug." , e ) ;
93- throw new System . Exception ( "An unexpected error ocurred" , e ) ;
94- }
95- return ret ;
96- }
97-
98- }
99- ///<summary>
100- /// Returns result (OBX-5) from parent (component #2). This is a convenience method that saves you from
101- /// casting and handling an exception.
102- ///</summary>
103- public CE ResultOBX5FromParent {
104- get {
105- CE ret = null ;
106- try {
107- ret = ( CE ) this [ 2 ] ;
108- } catch ( DataTypeException e ) {
109- HapiLogFactory . GetHapiLog ( this . GetType ( ) ) . Error ( "Unexpected problem accessing known data type component - this is a bug." , e ) ;
110- throw new System . Exception ( "An unexpected error ocurred" , e ) ;
111- }
112- return ret ;
113- }
114-
115- }
5+ using NHapi . Base . Model . Primitive ;
6+
7+ namespace NHapi . Model . V22 . Datatype
8+ {
9+
10+ ///<summary>
11+ /// <p>The HL7 CM_UNDEFINED (Undefined CM data type) data type. Consists of the following components: </p><ol>
12+ /// <li>observation identifier (OBX-3) of parent result (CE)</li>
13+ /// <li>sub-ID (OBX-4) of parent result (ST)</li>
14+ /// <li>result (OBX-5) from parent (CE)</li>
15+ /// </ol>
16+ ///</summary>
17+ [ Serializable ]
18+ public class CM_UNDEFINED : AbstractType , IComposite {
19+ private IType [ ] data ;
20+
21+ ///<summary>
22+ /// Creates a CM_UNDEFINED .
23+ /// <param name="message">The Message to which this Type belongs</param>
24+ ///</summary>
25+ public CM_UNDEFINED ( IMessage message ) : this ( message , null ) { }
26+
27+ ///<summary>
28+ /// Creates a CM_UNDEFINED .
29+ /// <param name="message">The Message to which this Type belongs</param>
30+ /// <param name="description">The description of this type</param>
31+ ///</summary>
32+ public CM_UNDEFINED ( IMessage message , string description ) : base ( message , description ) {
33+ data = new IType [ 3 ] ;
34+ data [ 0 ] = new CE ( message , "Observation identifier (OBX-3) of parent result" ) ;
35+ data [ 1 ] = new ST ( message , "Sub-ID (OBX-4) of parent result" ) ;
36+ data [ 2 ] = new CE ( message , "Result (OBX-5) from parent" ) ;
37+ }
38+
39+ ///<summary>
40+ /// Returns an array containing the data elements.
41+ ///</summary>
42+ public IType [ ] Components
43+ {
44+ get {
45+ return this . data ;
46+ }
47+ }
48+
49+ ///<summary>
50+ /// Returns an individual data component.
51+ /// @throws DataTypeException if the given element number is out of range.
52+ ///<param name="index">The index item to get (zero based)</param>
53+ ///<returns>The data component (as a type) at the requested number (ordinal)</returns>
54+ ///</summary>
55+ public IType this [ int index ] {
56+
57+ get {
58+ try {
59+ return this . data [ index ] ;
60+ } catch ( System . ArgumentOutOfRangeException ) {
61+ throw new DataTypeException ( "Element " + index + " doesn't exist in 3 element CM_UNDEFINED composite" ) ;
62+ }
63+ }
64+ }
65+ ///<summary>
66+ /// Returns observation identifier (OBX-3) of parent result (component #0). This is a convenience method that saves you from
67+ /// casting and handling an exception.
68+ ///</summary>
69+ public CE ObservationIdentifierOBX3OfParentResult {
70+ get {
71+ CE ret = null ;
72+ try {
73+ ret = ( CE ) this [ 0 ] ;
74+ } catch ( DataTypeException e ) {
75+ HapiLogFactory . GetHapiLog ( this . GetType ( ) ) . Error ( "Unexpected problem accessing known data type component - this is a bug." , e ) ;
76+ throw new System . Exception ( "An unexpected error ocurred" , e ) ;
77+ }
78+ return ret ;
79+ }
80+
81+ }
82+ ///<summary>
83+ /// Returns sub-ID (OBX-4) of parent result (component #1). This is a convenience method that saves you from
84+ /// casting and handling an exception.
85+ ///</summary>
86+ public ST SubIDOBX4OfParentResult {
87+ get {
88+ ST ret = null ;
89+ try {
90+ ret = ( ST ) this [ 1 ] ;
91+ } catch ( DataTypeException e ) {
92+ HapiLogFactory . GetHapiLog ( this . GetType ( ) ) . Error ( "Unexpected problem accessing known data type component - this is a bug." , e ) ;
93+ throw new System . Exception ( "An unexpected error ocurred" , e ) ;
94+ }
95+ return ret ;
96+ }
97+
98+ }
99+ ///<summary>
100+ /// Returns result (OBX-5) from parent (component #2). This is a convenience method that saves you from
101+ /// casting and handling an exception.
102+ ///</summary>
103+ public CE ResultOBX5FromParent {
104+ get {
105+ CE ret = null ;
106+ try {
107+ ret = ( CE ) this [ 2 ] ;
108+ } catch ( DataTypeException e ) {
109+ HapiLogFactory . GetHapiLog ( this . GetType ( ) ) . Error ( "Unexpected problem accessing known data type component - this is a bug." , e ) ;
110+ throw new System . Exception ( "An unexpected error ocurred" , e ) ;
111+ }
112+ return ret ;
113+ }
114+
115+ }
116116} }
0 commit comments