How would you design a tool to specify deeply nested forms, basically a complex decision tree, eg for medical diagnosis or complex tax stuff etc, where future form elements can dependent on a previously specified one, but statically ie chosen from few option not generated via a function so that all options and branches are known without executing code. The form specification should just be declarative, data. What data structure would you use to represent that form (I think it would basically be a DAG)? What language would you write it in? How would you generate a graphical representation (eg converting to .dot)? How would you generate a fillable form from it?

  • reasoner@lemmy.one
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    1 year ago

    You’re describing what Oracle Intelligent Advisor (OIA) tries to deliver with their interviews. After you write your code, an interview can be automatically generated which collects data and infers which questions need to be asked based on previous answers. For data representation, it is unfortunately either captured in Microsoft Word or within their interview screens as logic, which does not meet your graphical representation needs. It seemed to be close enough that I thought it worth mentioning. It’s original use case was for tax purposes but I use it professionally to determine eligibility to public assistance programs.

    Similar to @steph’s answer ErgoAI is a prolog derivative with a syntax rather similar to .dot (from what I gather). This tool would capture the data in a format you like, but does not generate a fillable form for you, but I believe it could be made to do so in a manner similar to OIA above.