Custom template changes not recognized when validating (EDI v. 9.8.7.5)
In an attempt to override the TS837P template, I have the following in the sample Validate837P.cs file, being sure to update the assembly string to point to my custom assembly and the generic type to my custom 837P template (see lines in bold).
namespace EdiFabric.Examples.X12.ValidateEDI
{
class Validate837P
{
/// <summary>
/// Validate 837 P
/// </summary>
public static void Run()
{
Debug.WriteLine("******************************");
Debug.WriteLine(MethodBase.GetCurrentMethod().Name);
Debug.WriteLine("******************************");
Stream ediStream = File.OpenRead(Directory.GetCurrentDirectory() + @"\..\..\..\Files\Hipaa\ClaimPayment.txt");
List<IEdiItem> ediItems;
using (var reader = new X12Reader(ediStream, "EdiFabric.Examples.X12.ValidateEDI"))
ediItems = reader.ReadToEnd().ToList();
var claims = ediItems.OfType<CAFRS_EF_HIPAA_005010_837P>();
foreach (var claim in claims)
{
// Validate
if (!claim.IsValid(out var errorContext))
{
// Report it back to the sender, log, etc.
var errors = errorContext.Flatten();
}
else
{
// claim is valid, handle it downstream
}
}
}
}
}
My custom template is as follows where I essentially am attempting to update the StringLength attribute values from the default [StringLength(2, 2)] to [StringLength(1, 5)] (see bolded line in code snippet) on the SV101 - 03 segment element, in order to accommodate accepting more than two characters in that slot (see underlined segment element in image).
namespace EdiFabric.Examples.X12.ValidateEDI
{
/// <summary>
/// Health Care Claim : Professional
/// </summary>
[Serializable]
[DataContract]
[Message("X12", "005010X222A1", "837")]
public class CAFRS_EF_HIPAA_005010_837P : TS837P
{
#region Properties
/// <summary>
/// Loop for Billing Provider Hierarchical Level
/// </summary>
[DataMember]
[Required]
[Pos(4)]
public new List<CAFRS_LOOP_2000A_837P> Loop2000A { get; set; }
#endregion
}
/// <summary>
/// Loop for Billing Provider Hierarchical Level
/// </summary>
[Serializable]
[DataContract]
[Group(typeof(HL_BillingProviderHierarchicalLevel))]
public class CAFRS_LOOP_2000A_837P : Loop_2000A_837P
{
#region Properties
/// <summary>
/// Loop for Subscriber Hierarchical Level
/// </summary>
[Splitter]
[DataMember]
[Required]
[Pos(5)]
public new List<CAFRS_LOOP_2000B_837P> Loop2000B { get; set; }
#endregion
}
/// <summary>
/// Loop for Subscriber Hierarchical Level
/// </summary>
[Serializable]
[DataContract]
[Group(typeof(HL_SubscriberHierarchicalLevel))]
public class CAFRS_LOOP_2000B_837P : Loop_2000B_837P
{
#region Properties
/// <summary>
/// Loop for Claim Information
/// </summary>
[DataMember]
[ListCount(100)]
[Pos(5)]
public new List<CAFRS_LOOP_2300_837P> Loop2300 { get; set; }
#endregion
}
/// <summary>
/// Loop for Claim Information
/// </summary>
[Serializable]
[DataContract]
[Group(typeof(CLM_ClaimInformation_3))]
public class CAFRS_LOOP_2300_837P : Loop_2300_837P
{
#region Properties
/// <summary>
/// Loop for Service Line Number
/// </summary>
[DataMember]
[Required]
[ListCount(50)]
[Pos(16)]
public new List<CAFRS_LOOP_2400_837P> Loop2400 { get; set; }
#endregion
}
/// <summary>
/// Loop for Service Line Number
/// </summary>
[Serializable]
[DataContract]
[Group(typeof(LX_HeaderNumber))]
public class CAFRS_LOOP_2400_837P : Loop_2400_837P
{
#region Properties
/// <summary>
/// Professional Service
/// </summary>
[DataMember]
[Required]
[Pos(2)]
public new SV1_ProfessionalService SV1_ProfessionalService { get; set; }
#endregion
}
/// <summary>
/// Professional Service
/// </summary>
[Serializable]
[DataContract]
[Segment("SV1", typeof(X12_ID_235_6))]
public class CAFRS_SV1_ProfessionalService : SV1_ProfessionalService
{
#region Properties
/// <summary>
/// Composite Medical Procedure Identifier
/// </summary>
[DataMember]
[Required]
[Pos(1)]
public new CAFRS_C003_CompositeMedicalProcedureIdentifier_12 CompositeMedicalProcedureIdentifier_01 { get; set; }
#endregion
}
/// <summary>
/// Composite Medical Procedure Identifier
/// </summary>
[Serializable]
[DataContract]
[Composite("C003")]
public class CAFRS_C003_CompositeMedicalProcedureIdentifier_12 : C003_CompositeMedicalProcedureIdentifier_12
{
#region Properties
/// <summary>
/// Procedure Modifier
/// </summary>
[DataMember]
[StringLength(1, 5)]
[DataElement("1339", typeof(X12_AN))]
[Pos(3)]
public new string ProcedureModifier_03 { get; set; }
#endregion
}
}
However, upon calling IsValid I'm still seeing the following message: "The length of data element 1234 must be 2.". Indicating that it's reading the [StringLength (2, 2)] attribute from the base TS837P template instead of my custom template. Any ideas on what I might be missing?
Thanks
Comments
1 comment
Hi, Bryan. You might have to rebuild the class that contains that rule file. It's possible that the code is pulling from the DLL version before the change. Right-click on the project that contains this rule file and press "Build".
Please sign in to leave a comment.