0.1.14 • Published 4 years ago

@artezio/models v0.1.14

Weekly downloads
7
License
MIT
Repository
github
Last release
4 years ago

@artezio/models

FHIR compatible observable models.

Installation

Using npm:

$ npm install -D @artezio/models

Using yarn:

$ yarn add -D @artezio/models

Library has peer dependency which you should know about. Install it with following command:

$ npm install @artezio/observable

 

Example

This models are mostly used with designer and player so it's enough to use it like this:

import { Questionnaire, QuestionnaireResponse } from '@artezio/models';

const questionnaire = new Questionnaire(/*initial questionnaire in JSON format, if needed*/);
const questionnaireResponse = new QuestionnaireResponse(questionnaire, /*initial questionnaireResponse in JSON format, if needed*/);

Then you should pass them straight to QuestionnaireDesigner and QuestionnairePlayer components.

 

Diagrams

Questionnaire

uml diagram

QuestionnaireResponse

uml diagram

Detailed description for models

Table of content

Questionnaire model

NamerequiredtypeDescription
idtruestringQuestionnaire identifier. Must be uniq among all questionnaires
titlefalsestringQuestionnaire title
descriptionfalsestringDescription for questionnaire
itemsfalsearrayEach element is Item model

Item model

NamerequiredtypeDescription
idtruestringItem identifier. Must be uniq among all Items within the questionnaire
typetruestringShould be imported as variable from @artezio/models. Variable names: STRING, ATTACHMENT, OPEN_CHOICE, CHOICE, TEXT, TIME, DATE_TIME, DATE, DECIMAL, BOOLEAN, MULTI_CHOICE.
textfalsestringQuestion
requiredfalsebooleanWhether item required or not
enableWhenfalsearrayEach element is Enable When
enableBehaviorfalsestringShould be imported as variable from @artezio/models. Variable names are: OR, AND
initialAnswersfalsearrayEach element is Initial answer
multipleFilesfalsebooleanSpecific parametr especially for attachment items; Define whether user can apply multiple files(true) or single(false)
optionsfalsearrayEach element is Answer option

Initial answer

NamerequiredtypeDescription
idtruestringInitial answers identifier. Must be uniq within the item
valuefalseanyInitial answers value

Enable when

NamerequiredtypeDescription
idtruestringEnableWhen identifier. Must be uniq within the item
operatortruestringShould be imported as variable from @artezio/models. Variable names are: EXISTS, EQUAL, NOT_EQUAL, MORE, LESS, MORE_OR_EQUAL, LESS_OR_EQUAL.
questionIdfalsestringid of the particular item
answerfalseanyexpected answer fro particular question

Answer option

NamerequiredtypeDescription
idtruestringAnswerOption identifier. Must be uniq within the item
valuefalseanyOption value
defaultSelectedfalsebooleanWhether option must be selected by default( in items like choice and openChoice only one option should have this property set to true )

Questionnaire response model

NamerequiredtypeDescription
idtruestringQuestionnaireResponse identifier. Must be uniq amon all QuestionnaireResponses
questionnaireIdtruestringid of particular questionnaire for which this response is referenced
itemsfalsearrayEach element is Questionnaire response item model

Questionnaire response item model

NamerequiredtypeDescription
idtruestringQuestionnaireResponseItem identifier. Must be uniq amon all QuestionnaireResponseItems within QuestionnaireResponse
questionIdtruestringid of particular item
textfalsestringQuestion
answersfalsearrayEach element is Questionnaire response answer

Questionnaire response item answer

NamerequiredtypeDescription
idtruestringid must be uniq within QuestionnaireResponseItem
valuefalseanyAnswer value
itemsfalsearrayEach element is Questionnaire response item model
0.1.14

4 years ago

0.1.13

4 years ago

0.1.10

4 years ago

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago