imsweb / mph

Java implementation of the Multiple Primary and Histology Coding Rules.
Other
4 stars 2 forks source link

Null date parts are not properly handled #128

Closed depryf closed 12 months ago

depryf commented 1 year ago

The library is supposed to handle null date parts just like if they contain 9's.

I think that's true for DX month and day, but that's not true for year. The library throws an exception when the year is null.

I think there are a few improvements we need:

  1. Using 9's is a very SEER*DMS-specific thing to do; if it's not too much trouble, I think we should only support null for the missing date parts.
  2. The setter of the input object should do some validation and set to null any invalid values. So blank, empty, just spaces, non-digits, and 9999 would all end up as null in the input objects. And the rest of the library would only expect null (or a legit value).

@bekeles let me know if that makes sense and/or if you want to discuss.