Skip to content

Bug: Toggling AnyOf/AllOf in the Synthea Customizer doesn't update state until a new criteria is added #19

@Dtphelan1

Description

@Dtphelan1

To Reproduce:

  • Start with the ALL OF / ANY OF toggle set to ALL OF.
  • Define some set of Keep Module Builder criteria (e.g. add some active conditions)
  • Download the Keep.json file and inspect it: default state should have states.Initial.conditional_transition[0].condition.condition_type == 'And'
  • Return to the Keep Module Builder and toggle the ALL OF / ANY OF to the ANY OF state.
  • Download the Keep.json file and inspect it: states.Initial.conditional_transition[0].condition.condition_type should still be incorrectly And'
  • Return to the Keep Module Builder and this time add a new criteria
  • Download the Keep.json file and inspect it: states.Initial.conditional_transition[0].condition.condition_type should now correctly be Or

Looks like the culprit is here: While addCurrrent will update the Keep state and keep module string, setAny does have the same side-effect.. Simplest fix would probably be to create a similar updateAnyAndKeeps method that gets called onClick of the toggle. You might want to debounce this as well - can be very addictive to click a toggle over and over again - to prevent the app slowing down.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions