@openclinical/proformajs-vue

A library of Vuejs Single File Components (SFC) to support creating webapps for PROformajs

Usage no npm install needed!

<script type="module">
  import openclinicalProformajsVue from 'https://cdn.skypack.dev/@openclinical/proformajs-vue';
</script>

README

PROformajs vue components

Provides vue2 components (using bootstrap 4) for writing and reviewing proformajs protocols.

getting Started

You'll need to have git and node (v12+) installed.

run

you@yourpc:~$ git clone https://issues.openclinical.net/labs/proformajs-vue
you@yourpc:~$ cd proformajs-vue
you@yourpc:~/proformajs-vue$ npm install
you@yourpc:~/proformajs-vue$ npm run serve

  App running at:
  - Local:   http://localhost:8080/
  - Network: http://192.168.1.137:8080/

  Note that the development build is not optimized.
  To create a production build, run npm run build.

build

your@yourpc:~/proformajs-vue$ npm run build

> @openclinical/proformajs-vue@1.0.0 build /home/matt/Software/sfc-init/proformajs-vue
> cross-env NODE_ENV=production rollup --config build/rollup.config.js


src/entry.esm.js → dist/proformajs-vue.esm.js...
created dist/proformajs-vue.esm.js in 2.2s

src/entry.js → dist/proformajs-vue.ssr.js...
created dist/proformajs-vue.ssr.js in 2.2s

src/entry.js → dist/proformajs-vue.min.js...
created dist/proformajs-vue.min.js in 3.2s

use

https://gitlab.com/openclinical/proformajs-demo shows how you can use this project.

notes

vue-sfc-rollop was used to create the skeleton for this project.

TODO

  • vue ace json editor
  • vue task map
    • add decision, enquiry and plan components and make all sub-tasks draggable
    • clickable working breadcrumb and clicking into sub plans
    • create new tasks
    • selectable tasks for component attribute editor
    • draggable temporal dependencies
    • create new temporal dependencies
    • delete task
    • delete temporal dependency
    • show grabbable tasks with grab handle
    • move/delete groups of tasks
    • ctrl-c ctrl-v into sub plan
    • disallow dragging off canvas
    • allow user to change size of canvas
    • add panning and zooming
    • handle protocol without svg positioning meta (i.e. generate it automatically)
    • handle single task protocol
    • show existence of data definitions/sources/candidates and sub-tasks on canvas
    • list available data-definitions to the selected task on the canvas?
    • indicate cyclic / autonomous / triggered / optional tasks on the map
  • vue protocol validation feedback component
  • vue component attribute editor
    • details editor
    • prevent names with incorrect characters
    • cascade name changes appropriately
    • data definitions editor
      • use control to select data type and create a new data definition (named integer0, boolean1 etc)
      • returning from Data Definition editor should go back to Data tab of the Task editor
      • make range editable
        • provide choice of raw or annotated until the first range value is entered, after which this control should be disabled
        • add / edit / delete range values
        • check data types
      • resetting the protocol should return the task editor to the Details tabe, no matter where we are
      • provide mechanism to delete a data definition
      • closing data definition dialogue should set index of the data definition dialogue back to 1 and rangeAnnotation to false and rangeIdx to -1
      • show validation issues for defaultValue, valueCondition and range
      • add help text to fields
      • CRUD Warnings
    • sources editor
      • CRUD sources
      • custom requestCondition editor
    • candidates and arguments editor
      • CRUD candidates
      • CRUD arguments
      • custom recommendCondition editor
      • custom activeCondition editor
    • pre/wait Conditions (which hide scheduling constraints)
    • handle name change of schedule dependency
    • remove data tab for non root plan
    • HTML editing for description
    • cycle / event trigger attributes
  • vue component tree component
    • show clickable tree of components
    • allow sources and candidates to select task
    • allow user to configure what is shown in tree
  • create npm package for vue components
  • favicon / title
  • enactment review
    • add data
      • single raw
      • multi raw
      • single ranged (optional annotations)
      • multi ranged (optional annotations)
      • Integer
      • Float
      • Text
      • Boolean
      • Date
      • handle invalid data via text boxes
      • fix reactivity issues
      • dynamic data: disable input and show valueCondition
      • implement different view in enquiry and data
      • allow metadata to select widget (and implement range widget / buttongroup for select)
      • surface datadef warnings
    • allow cancel tasks / plans
    • two column enquiry sources
    • erase data
      • prevent erase for finished protocol
    • draw decision
    • confirm candidate
    • view expressions/inactive arguments in decision
    • view future and past tasks - prevent interaction in non in_progress tasks
    • show enactment history
    • show active tasks and triggers
    • show existing data / history and allow update of data
    • allow custom enactment view, e.g. for shortness of breath
    • allow runtime expression evaluation in development mode
    • allow search/sort of data definitions in design and runtime interfaces
    • restart enactment
    • handle html descriptions with v-html
    • include proformajs-test
    • reduce delay when doing any action in a big guidelines, e.g. donor pathway
      • completing a task
      • tabbing between Sources
      • selecting a candidate
  • code quality
    • ensure all props are typed

Test plan

  • Create new plan. use editor to edit plan attributes. check that edited attributes can be seen in code view. edit attributes in code view. check that the new edits can be seen in the editor view.
  • create a nested set of tasks that includes every task type. navigate around. move tasks around.
  • create temporal constraints. remove tasks with upstream and downstream constraints.
  • Add an integer data definition: ok, "Are you ok?" with an annotated range of 1 - "Yes" and 0 - "No". Add a text data definition: fruit, "What fruit do you like" with a range of fruit of your choice. remove fruit. edit fruit. Check that your changes are reflected in the code. Edit some of the fruit in the code. Check that those changes are reflected in the editor. Delete fruit items in code and editor. Delete one of the data definitions.
  • create a new decision. add candidates "one" and "two". for each candidate add an argument "yes" and "no"
  • cut and paste a new protocol into the code view. Check that new protocol is visible in the editor and that the root plan is selected.
  • start from a new plan. add a new enquiry and plan. double click on plan and add a decision. click on the root plan in breadcrumb. You should see two issues (missing sources and candidates). If you click on the decision path it should be selected and the parent plan changed in the map.
  • create a new plan. add a new task. make it cyclic with a cycleUntil of "index('plan:taskA')==2" and a caption of "Task A ${index('plan:taskA')}". Review an enactment. In the history you should see "Task A 0", "Task A 1" and "Task A 2"

Issues

task editor

  • adding a space to a task name should be handled better
  • fix tabIndex issues:
    • a new enquiry opens on the sources tab when there are no other sub tasks
    • a new enquiry opens on the constraints tab when there other sub tasks
  • changing a name should change references to that name too and (maybe) automatically update the caption
  • deleting a task in a sub-plan moves focus to root plan (should move to the parent)

code editor

  • cant edit name attribute - the editor reacts by removing attribute all together

component tree

  • needs to be open automatically

cyclic tasks

more work needed here. a single cyclic task limited to two iterations that shows the index in the caption ...

  • cycleUntil example needs updating
  • review map doesnt show task as finished at the end (maybe it isnt?)
  • review map shows raw caption and not the runtime caption
  • review history shows three "Task B (2)" where it should show "Task B (0)" then "Task B (1)" then "Task B (2)"

selection

  • selected task isnt highlighted when walking through an enactment

enquiry

  • adding an annotated range to gender throws up two issues:
    • value is added as string not integer
    • values are shown as json

mobile view

  • needs work

touch screen issues

  • cannot see a task being dragged (ipad safari / edge)
  • cannot descend by double tapping into sub plan in compose view (ipad safari)
  • ipad automatically capitalises the first letter for data definitions / candidates (ipad)
  • cannot open/close tree view node
  • cannot delete task
  • cannot delete temporal constraint
  • cannot search in the code view

review

  • map not synced with selected task
  • cannot descend into sub plan from review map
  • single task view (decision) doesnt need to show parent caption and description
  • integers should have integer data entry boxes etc
  • disable the select tab for a completed enactment
  • needs to show html content