Chicago / lead-safe-api-docs

http://dev.cityofchicago.org/docs/lead-safe/
1 stars 1 forks source link

Constraints for past BLL levels #51

Closed geneorama closed 6 years ago

geneorama commented 6 years ago

Currently we have no constraints around the BLL submissions.

If we're going to reliably determine if the patient already has a high BLL (a feature request for v1.0.0-rc.5) then we will need to impose constraints on this field and add those to the input checker part of the runner. Otherwise we risk telling doctors that the patient does / doesn't have a high BLL when in fact they don't / do have a high BLL.

From the entry about lab results in api.md:

Field Format Constraints Notes
lab.result Text <N/A> Several values are possible; integer, non-integer numeric, ranges indicated by alphanumeric text.

In the past we were going to use this part of the submission for post hoc analysis / model improvement, which did not necessitate checking the inputs in a real time basis.

geneorama commented 6 years ago

@RaedMan The two main ways that I can do doing this are:

  1. Require the submission to be numeric
  2. Define a series of regular expressions that are considered acceptable to convert text to numbers

For the second option some examples are things like "when a '-' is present, interpret this as a range and take the maximum of the range as the input", or "when a '<' appears assume this means 'less than' and simply drop the less than sign". I would assume that greater than signs shouldn't appear in the return value.

Let me know and I can start working on tests, in accordance with the test driven approach we're using for the API development on this project.

I can propose error messages, and start to put those into the test suite.

geneorama commented 6 years ago

We have decided not to do this now because of the data issues referenced, see the issue in gitlab for more information.