Page MenuHomePhabricator

Input fields with unit 'number' in Decision Making accept decimal input
Open, NormalPublic

Description

Steps to reproduce:

  • Run API server with option -d
  • Run dashboard
  • Select DemoPatient
  • Switch to Decision Making view
  • Select node 'Ultrasound examination' -Type a decimal value in field 'Number of Tumors' -Press key 'enter'

The tooltip 'Please select a valid number' appears, but the system accepts the input. If you reload the view, the input of the decimal value is still in the box.

Event Timeline

klinowsk moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.
klinowsk moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

I don't think that we currently model floating point vs integer restrictions at all. It would be very sensible to type check these, but it is probably not a completely simple task.

I added a simple regular expression check in merge b206ce8bf152 . Fields with a number label "#" should now only accept integers and decimals with .0 (1.0, 2.0 etc.). Every other label should accept all floating point input.

Could you perform a quick feasibility test on the ontology? Just to make sure that this doesn't have side-effects that we are unaware of.

It could make some problems with qualities that are not used in the decision tree at the moment (it would have been the same problem with the regular expression that was used before).
Some of them have unit:number as the preferred unitlabel, but are not "number qualities".
I can change the regular expression back to accepting everything. Or maybe we should change the unitlabel of these qualties to "freetext" or something more fitting than number?