Troubleshooting 837P Errors

Aug 9, 2013 at 7:26 PM
I am getting an error when I try to parse an 837 file, and it gives me an error about Date formatting: "When converting a string to DateTime, parse the string to take the date...."

I've looked through the file and can find any invalid formatting.

It fails at ClaimDocument.cs, when it tries to Deserialize:
   public static ClaimDocument Deserialize(string xml)
        XmlSerializer serializer = new XmlSerializer(typeof(ClaimDocument));
        return (ClaimDocument)serializer.Deserialize(new StringReader(xml));

Any ideas how to troubleshoot this further. I copied the xml string to Notepad++, but I cannot find anything wrong.

Aug 23, 2013 at 3:18 AM
You have a field somewhere in your x12 that expected to be a date format but it is not. This is usually a problem with test data when they might do something like replace a date such as 20130822 with 99999999 which can't be parsed. I will probably working on changing the xslt so that it will skip these invalid dates, but I need to add another property where you can get the original string from the file in the case that they can't get serialized into one of the DateTime properties on the ClaimDocument object.
There are x12 validators that should catch these errors and reject the file as invalid so that you don't necessary have to attempt a parse on an invalid file.