covopen / covquestions Goto Github PK
View Code? Open in Web Editor NEWA web service to interactively create and evaluate SARS-CoV-2 related questionnaires and an API to provide questions and logic for frontends.
License: Apache License 2.0
A web service to interactively create and evaluate SARS-CoV-2 related questionnaires and an API to provide questions and logic for frontends.
License: Apache License 2.0
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.
Hint:
The options attribute is not removed, thus the json validator says its invalid.
Calling the function with an invalid object results in a undefined state of the questionnaireEngine.
Also, it might be easier to have the version and time Of Execution as function arguments instead of inside or left out if they are not used anyway.
📦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.
If a multiselect question is not touched at all, the answer provided for setAnswer can be false.
Steps to reproduce:
Possible solution
https://github.com/alexanderthieme/CovQuestions/blob/3ffb8170e2e592e65e9400c440df85377f02fa9a/react-with-json-logic/src/logic/questionnaire.ts#L92
Change to let array = (value || []) as Array<Primitive>;
to make sure it is an array.
FreeBSD
PostgreSQL or MongoDB?
JSDoc?
Something auto generated with examples...
The questionnaireEngine is missing the following functionally:
getProgress()
: How many steps left / how many already donepreviousQuestion()
: Go back one stepThe 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.
q1
etc.) --> remove q1expression
instead of value
language
and title
from meta to root. Use availableLanguages
in metaHi 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:
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.
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
It should allow providing a new questionnaire (same logic) but with other language strings.
With the creation of the API, I am currently creating an OpenAPI file. In order to only have one single source of truth, I would like auto-generate the typescript classes in your Frontend. Is the generator linked working for you? (Just an example, I will go forward and create a PR as soon as the OpenAPI file is finished.
Variables should be able to depend on each other - no matter in which order they are defined. (Only circular dependencies are not supported.)
testCases.options.fillInDate
to be of type date as the other date fields (fillInDate: '2020-01-01' =>fillInDate: '1577831407'
)
dateInSecondsTimestamp
Function because everything should be a timestampProblem:
Resetting/Restarting a questionnaire does not reset the internal state.
Steps to reproduce:
e.g.
{
"answers": {
"answerid": "answer"
},
"results": [],
"questionnaireId": "covapp",
"version": 2
}
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
Search for a Way to distribute a KI based model
Auswertung der Daten durch Rückkanal
If the last question is not shown because of the enableWhenExpression, the progress never reaches 1. If progress === 1 is used to display the result this will never succeed.
setAnswer should fail if an invalid answer was set.,
e,g. invalid value of the mutiselect
Otherwise the score is set to "null", and "null+1 => NaN"
getNextQuestion
to tryGetNextQuestion
currentQuestion
to nextUnansweredQuestion
to better describe what it doesreference #156
e.g. plz which is a text currently.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.