Code Monkey home page Code Monkey logo

covquestions's People

Contributors

alexanderthieme avatar christophwersal avatar danielhabenicht avatar dependabot[bot] avatar ejoebstl avatar github-actions[bot] avatar jnnwnk avatar max-simon avatar restyled-commits avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

covquestions's Issues

Discussion: epoch timestamps

Proposal: Use normal linux timestamps externally instead of custom timestamps. (still use our format internally)

We currently use normal epoch timestamps / 1000 in order to have more bearable date internally and in json logic.
However using them outside, e.g. in forms, you always have to convert between normal stamps and internal stamps.

Proposed Monorepo Structure

📦CovQuestions
 ┣ 📂api
 |  ┣ 📂v1
 |  |  ┣ 📂scripts (e.g. string extractor for translation, generator script for generating static files)
 |  |  ┣ 📂src
 |  |  |  ┣ 📂questionnaires
 |  |  |  |  ┣ 📂<questionnaire-id>
 |  |  |  |  |  ┣ 📂<questionnaire-version>
 |  ┣ 📂translation
 ┣ 📂frontend
 ┣ 📂docs
 ┣ 📂json-logic (the standard)

The static files of the API should be published on the gh-pages branch.

Missing for parity with CovApp

The questionnaireEngine is missing the following functionally:

  • getProgress(): How many steps left / how many already done
  • previousQuestion(): Go back one step

The current app is also persisting the questions to localstorage, this could be done inside our package or via providing functions like:

  • getCurrentAnswers()
  • loadAnswers(answers)

Also Missing is some way to determine if the question is already the last one.

Checks before GO-Live

  • unique Guides or custom ids? (if custom: remove q1 etc.) --> remove q1
  • use unique ids, maybe guid
    - for questions, questionnaires and options (maybe add another field like label or slug for more human friendly way?
  • move language and title from meta to root
  • use expression instead of value
    • variable
    • results
  • enableWhen -> enableWhenExpression
  • use whole numbers for versioning? (or define what is a non-breaking change in the context of a questionnaire)
  • how generate interfaces in openapi? (without JSON logic?)
  • move language and title from meta to root. Use availableLanguages in meta
  • release questionnaire npm package
  • Übersetzungen:
    • über Versionen hinweg gleiche ID
    • Änderungen über Fragebögen hinweg?

Suggestion: Change object key `value` for JsonLogic

Hi all,
I just planned, how the CovQuestions API could be used to generate the questionnaire. I noticed the following and want to propose an alternative:

Current situation

Currently the JsonLogic for variables and riskCategories is stored in the key value. When a variable is read/used it is also referenced via v_variable_name.value. This is a clash of names between the calculation rules and the calculated value.

Proposed Solution

Store the logic for calculating a value in a key named logic (or whatever you prefer) and still use the value key for referencing calculated values. This will avoid the clash.

This change would enable developers to adapt the configuration more easily since:
a) it becomes more clear which values are calculated and what the logic is, therefore it does not need to be distinguished if a value still needs to be calculated
b) The logic for calculating the values is prevented to be accidentally overwritten. This allows easier recalculation of values.
c) It eases the handling of the logic, since the questionnaire configuration can be handled as a more unified object.

Of course the change is not strictly necessary, but it eases the handling/parsing of the configuration a little bit

List of upcoming Breaking Changes

  • Fix the testCases.options.fillInDate to be of type date as the other date fields (fillInDate: '2020-01-01' =>fillInDate: '1577831407')
    • Remove the dateInSecondsTimestamp Function because everything should be a timestamp

Reset/Restart Questionnaire does not reset questionnaire state

Problem:
Resetting/Restarting a questionnaire does not reset the internal state.

Steps to reproduce:

  1. Load Example Questionnaire
  2. Do not answer first question, click directly on Next. An error will occur.
  3. Press Yes (you can do the same experiment with No)
  4. Click Reset Questionnaire
  5. Do not answer first question, click directly on Next. No error will occur and the Current internal state will show the answer given in 3.

Planning (from readme)

Possible candidates to built on: JSON Logic http://jsonlogic.com/ JSL https://www.npmjs.com/package/lib-jsl

Requirements:

MUST:

Website with user interface to select a questionnaire, see questions and rules and try it

API to access questionnaire

questionnaire: - contains questions and logic - is referenced by author and version - versioning has a number scheme, "current" always points to newest questionnaire

questions: - have an order defined by the position in the JSON file - have a unique id (string) - can belong to one or many categories - have a question type, e.g. multiple choice, date question - have an enabled/disabled state

logic: - logic must be readable by non computer scientists (physicians), for example: if (conditions1 or conditions2) and conditions3 then action else nested if clause or action

- conditions:
	- address question by unique id
	- address group of questions by category
		- count number of answers
		- calculate average score
	- supported operations: + - * / && || == !=
- actions:
	- can enable/disable questions by unique id or category
	- can write to interpretation variable (append, clear)

[Evaluation Logic] interpretation -> Risc groups - array of strings ("Stay home", "please visit the local health..."]

IMPORTANT:

multi lingual
NICE TO HAVE:

Conversion of patient answers to space efficient bit string and vice versa

V2

Search for a Way to distribute a KI based model

  • API?
  • Model?

Auswertung der Daten durch Rückkanal

Issues from PR156

  • rename internal function getNextQuestion to tryGetNextQuestion
  • rename currentQuestion to nextUnansweredQuestion to better describe what it does
  • split up the getResults function into different sub functions.

reference #156

Document features for users

Users need to know the existing features and behaviour to interact with the schema and the editor.
Examples: CovScript, printf formatting in results, usage of variables, usage of scores, usage of multiselect values, ...

Idea: create a documentation in Markdown that can either be included in the GUI-Editor or at least linked from there.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.