Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d6462a1

Browse files
committed
BREAKING CHANGES v22
Add missing datatypes 'CM_UNDEFINED', 'COMP_ID_DIGIT' and 'CQ_COMP_QUANT' based off their old jury-rigged implementations Add missing ADR_A19 message and groups Regenerate segments to use updated / new datatypes
1 parent 40772a1 commit d6462a1

14 files changed

Lines changed: 1125 additions & 156 deletions

File tree

NHapi20/NHapi.Model.V22/Datatype/CM_RANGE.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ namespace NHapi.Model.V22.Datatype
99

1010
///<summary>
1111
/// <p>The HL7 CM_RANGE (Wertebereich) data type. Consists of the following components: </p><ol>
12-
/// <li>Low Value (CE)</li>
13-
/// <li>High Value (CE)</li>
12+
/// <li>Low Value (NM)</li>
13+
/// <li>High Value (NM)</li>
1414
/// </ol>
1515
///</summary>
1616
[Serializable]
@@ -30,8 +30,8 @@ public CM_RANGE(IMessage message) : this(message, null){}
3030
///</summary>
3131
public CM_RANGE(IMessage message, string description) : base(message, description){
3232
data = new IType[2];
33-
data[0] = new CE(message,"Low Value");
34-
data[1] = new CE(message,"High Value");
33+
data[0] = new NM(message,"Low Value");
34+
data[1] = new NM(message,"High Value");
3535
}
3636

3737
///<summary>
@@ -64,11 +64,11 @@ public IType this[int index] {
6464
/// Returns Low Value (component #0). This is a convenience method that saves you from
6565
/// casting and handling an exception.
6666
///</summary>
67-
public CE LowValue {
67+
public NM LowValue {
6868
get{
69-
CE ret = null;
69+
NM ret = null;
7070
try {
71-
ret = (CE)this[0];
71+
ret = (NM)this[0];
7272
} catch (DataTypeException e) {
7373
HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem accessing known data type component - this is a bug.", e);
7474
throw new System.Exception("An unexpected error ocurred",e);
@@ -81,11 +81,11 @@ public CE LowValue {
8181
/// Returns High Value (component #1). This is a convenience method that saves you from
8282
/// casting and handling an exception.
8383
///</summary>
84-
public CE HighValue {
84+
public NM HighValue {
8585
get{
86-
CE ret = null;
86+
NM ret = null;
8787
try {
88-
ret = (CE)this[1];
88+
ret = (NM)this[1];
8989
} catch (DataTypeException e) {
9090
HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem accessing known data type component - this is a bug.", e);
9191
throw new System.Exception("An unexpected error ocurred",e);

NHapi20/NHapi.Model.V22/Datatype/CM_PARENT_RESULT.cs renamed to NHapi20/NHapi.Model.V22/Datatype/CM_UNDEFINED.cs

Lines changed: 111 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -2,115 +2,115 @@
22
using NHapi.Base.Model;
33
using NHapi.Base.Log;
44
using 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

Comments
 (0)