consected / restructure

Structure, track, recruit, screen, navigate and review human subjects research studies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add dynamic model options to _override: and _merge: similar to _default:

philayres opened this issue · comments

These options would allow the config libraries used for Redcap much more flexibility. _default: is effectively overriden by default: currently. There is no way within the libraries of saying what can override default:, making it hard to apply changes that are autogenerated by the Redcap setup.

The new options would have the following meaning:

_merge: would merge entries for each top level key, retaining any entries in the _default: or default: top level keys not set in the _merge:

_override: would simply follow on from the settings of default, overriding the top level keys

They would be processed in this order:

  • _default: sets the defaults
  • default: overrides previous top level keys
  • _merge: merges into any existing top level keys' hashes, adding new top level keys if needed
  • _override: just overwrites everything previously set

This would allow the following:

_default:
  label: A default label

_override:
  show_if:
    field:
     never: true

_merge:
  caption_before:
    field2: A new field caption

default:
  show_if:
    field:
      always: true
    field2:
      always: true

  caption_before:
    field: A caption
    field2: Another caption

The result would be equivalent to:

default:
  label: A default label
  show_if:
    field:
     never: true
  caption_before:
    field: A caption
    field2: A new field caption