Skip to content

Commit f715b54

Browse files
committed
Adds some missing IN1, IN2 changes that werent added for #191
1 parent b555007 commit f715b54

File tree

3 files changed

+975
-194
lines changed

3 files changed

+975
-194
lines changed

src/NHapi.Model.V23/Segment/IN1.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ public IN1(IGroup parent, IModelClassFactory factory) : base(parent,factory) {
7777
IMessage message = Message;
7878
try {
7979
this.add(typeof(SI), true, 1, 4, new System.Object[]{message}, "Set ID - Insurance");
80-
this.add(typeof(CE), false, 1, 8, new System.Object[]{message}, "Insurance Plan ID");
80+
this.add(typeof(CE), true, 1, 8, new System.Object[]{message}, "Insurance Plan ID");
8181
this.add(typeof(CX), true, 0, 59, new System.Object[]{message}, "Insurance Company ID");
8282
this.add(typeof(XON), false, 0, 130, new System.Object[]{message}, "Insurance Company Name");
8383
this.add(typeof(XAD), false, 0, 106, new System.Object[]{message}, "Insurance Company Address");

src/NHapi.Model.V23/Segment/IN2.cs

Lines changed: 118 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ public IN2(IGroup parent, IModelClassFactory factory) : base(parent,factory) {
123123
this.add(typeof(XPN), false, 0, 48, new System.Object[]{message}, "Special Coverage Approval Name");
124124
this.add(typeof(ST), false, 1, 30, new System.Object[]{message}, "Special Coverage Approval Title");
125125
this.add(typeof(IS), false, 0, 8, new System.Object[]{message}, "Non-Covered Insurance Code");
126-
this.add(typeof(CX), false, 1, 59, new System.Object[]{message}, "Payor ID");
127-
this.add(typeof(CX), false, 1, 59, new System.Object[]{message}, "Payor Subscriber ID");
126+
this.add(typeof(CX), false, 0, 59, new System.Object[]{message}, "Payor ID");
127+
this.add(typeof(CX), false, 0, 59, new System.Object[]{message}, "Payor Subscriber ID");
128128
this.add(typeof(IS), false, 1, 1, new System.Object[]{message, 144}, "Eligibility Source");
129129
this.add(typeof(CM_RMC), false, 0, 25, new System.Object[]{message}, "Room Coverage Type/Amount");
130130
this.add(typeof(CM_PTA), false, 0, 25, new System.Object[]{message}, "Policy Type/Amount");
@@ -1240,6 +1240,7 @@ public int NonCoveredInsuranceCodeRepetitionsUsed
12401240
///<summary>
12411241
/// Returns Payor ID(IN2-25).
12421242
///</summary>
1243+
[Obsolete("Use 'GetPayorID(int rep)' instead.")]
12431244
public CX PayorID
12441245
{
12451246
get{
@@ -1259,10 +1260,68 @@ public CX PayorID
12591260
return ret;
12601261
}
12611262
}
1263+
///<summary>
1264+
/// Returns a single repetition of Payor ID(IN2-25).
1265+
/// throws HL7Exception if the repetition number is invalid.
1266+
/// <param name="rep">The repetition number (this is a repeating field)</param>
1267+
///</summary>
1268+
public CX GetPayorID(int rep)
1269+
{
1270+
CX ret = null;
1271+
try
1272+
{
1273+
IType t = this.GetField(25, rep);
1274+
ret = (CX)t;
1275+
} catch (System.Exception ex) {
1276+
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", ex);
1277+
throw new System.Exception("An unexpected error occurred", ex);
1278+
}
1279+
return ret;
1280+
}
1281+
1282+
///<summary>
1283+
/// Returns all repetitions of Payor ID (IN2-25).
1284+
///</summary>
1285+
public CX[] GetPayorID() {
1286+
CX[] ret = null;
1287+
try {
1288+
IType[] t = this.GetField(25);
1289+
ret = new CX[t.Length];
1290+
for (int i = 0; i < ret.Length; i++) {
1291+
ret[i] = (CX)t[i];
1292+
}
1293+
} catch (HL7Exception he) {
1294+
HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem obtaining field value. This is a bug.", he);
1295+
throw new System.Exception("An unexpected error occurred", he);
1296+
} catch (System.Exception cce) {
1297+
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", cce);
1298+
throw new System.Exception("An unexpected error occurred", cce);
1299+
}
1300+
return ret;
1301+
}
12621302

1303+
///<summary>
1304+
/// Returns the total repetitions of Payor ID (IN2-25).
1305+
///</summary>
1306+
public int PayorIDRepetitionsUsed
1307+
{
1308+
get{
1309+
try {
1310+
return GetTotalFieldRepetitionsUsed(25);
1311+
}
1312+
catch (HL7Exception he) {
1313+
HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem obtaining field value. This is a bug.", he);
1314+
throw new System.Exception("An unexpected error occurred", he);
1315+
} catch (System.Exception cce) {
1316+
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", cce);
1317+
throw new System.Exception("An unexpected error occurred", cce);
1318+
}
1319+
}
1320+
}
12631321
///<summary>
12641322
/// Returns Payor Subscriber ID(IN2-26).
12651323
///</summary>
1324+
[Obsolete("Use 'GetPayorSubscriberID(int rep)' instead.")]
12661325
public CX PayorSubscriberID
12671326
{
12681327
get{
@@ -1282,7 +1341,64 @@ public CX PayorSubscriberID
12821341
return ret;
12831342
}
12841343
}
1344+
///<summary>
1345+
/// Returns a single repetition of Payor Subscriber ID(IN2-26).
1346+
/// throws HL7Exception if the repetition number is invalid.
1347+
/// <param name="rep">The repetition number (this is a repeating field)</param>
1348+
///</summary>
1349+
public CX GetPayorSubscriberID(int rep)
1350+
{
1351+
CX ret = null;
1352+
try
1353+
{
1354+
IType t = this.GetField(26, rep);
1355+
ret = (CX)t;
1356+
} catch (System.Exception ex) {
1357+
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", ex);
1358+
throw new System.Exception("An unexpected error occurred", ex);
1359+
}
1360+
return ret;
1361+
}
1362+
1363+
///<summary>
1364+
/// Returns all repetitions of Payor Subscriber ID (IN2-26).
1365+
///</summary>
1366+
public CX[] GetPayorSubscriberID() {
1367+
CX[] ret = null;
1368+
try {
1369+
IType[] t = this.GetField(26);
1370+
ret = new CX[t.Length];
1371+
for (int i = 0; i < ret.Length; i++) {
1372+
ret[i] = (CX)t[i];
1373+
}
1374+
} catch (HL7Exception he) {
1375+
HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem obtaining field value. This is a bug.", he);
1376+
throw new System.Exception("An unexpected error occurred", he);
1377+
} catch (System.Exception cce) {
1378+
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", cce);
1379+
throw new System.Exception("An unexpected error occurred", cce);
1380+
}
1381+
return ret;
1382+
}
12851383

1384+
///<summary>
1385+
/// Returns the total repetitions of Payor Subscriber ID (IN2-26).
1386+
///</summary>
1387+
public int PayorSubscriberIDRepetitionsUsed
1388+
{
1389+
get{
1390+
try {
1391+
return GetTotalFieldRepetitionsUsed(26);
1392+
}
1393+
catch (HL7Exception he) {
1394+
HapiLogFactory.GetHapiLog(this.GetType()).Error("Unexpected problem obtaining field value. This is a bug.", he);
1395+
throw new System.Exception("An unexpected error occurred", he);
1396+
} catch (System.Exception cce) {
1397+
HapiLogFactory.GetHapiLog(GetType()).Error("Unexpected problem obtaining field value. This is a bug.", cce);
1398+
throw new System.Exception("An unexpected error occurred", cce);
1399+
}
1400+
}
1401+
}
12861402
///<summary>
12871403
/// Returns Eligibility Source(IN2-27).
12881404
///</summary>

0 commit comments

Comments
 (0)