Skip to main content

Python library that converts CDSS L2 in L3

Project description

design rules tricc_oo

Nodes

Node Types and Properties

Start Node This node type represents the beginning of a process. It requires a label and can have attributes like process, parent, and form_id.

Activity Start Node Marking the start of an activity, this node type needs both a label and a name. It can have attributes such as parent and instance.

Note Nodes This node type are used for providing information. Note nodes require both a label and a name,.

Selection Nodes There are three types of selection nodes:

  • Select One: For single-choice selections
  • Select Multiple: For multiple-choice selections
  • Select Yes/No: For binary choices

All these nodes require a label, name, and list_name. They can have attributes like required, save, filter, constraint, and constraint_message.

Numeric Input Nodes Decimal and Integer nodes are used for numeric input. They require a label and name, and can have attributes like min, max, constraint, save, constraint_message, and required.

Text and Date Nodes These nodes are for text input and date selection. Both require a label and name.

Calculation Nodes Add, Count, and Calculate nodes are used for various calculations. They require a label and name, and can have save and expression attributes

Flow Control Nodes Rhombus and Wait nodes are used for flow control. They require a reference, name, and label, and can have save and expression attributes.

Exclusive Node This node type doesn't have any mandatory attributes or specific attributes defined.

Not Available Node Used to indicate unavailability, this node requires a label, name, and list_name.

Link Nodes Link Out and Link In nodes are used for creating connections. Link Out requires a reference, label, and name, while Link In only needs a label and name.

Go To Node This node is used for navigation. It requires a link, label, and name, and can have an instance attribute.

End Nodes End and Activity End nodes mark the conclusion of processes or activities.

Bridge Node This node can have a label attribute but doesn't have any mandatory attributes.

Diagnosis Node Used for diagnostic purposes, this node requires a name and label

Enrichment

Node can be enriched with message and media, simply add the media on the draw.io andlink them with an edge

Image Node Used to add image to a question

Hint Message Node Used to add an hint message to a question, need a label

Help Message Node Used to add an help message to a question, need a label

Attributes

expression replace the calcualte deducted by inputs

default not supported yet

save will create a calculate with the same name

  • obs: observation: save the option as a calcualte obs_[name of the option]
    • can be written obs.[othername].[snomedCode]
  • diag: diagnostic/classification save the option as a calcualte diag_[name of the option]
  • flag: calculate save the option as a calcualte is_[name of the option]

Edges

The edge are in general labeless unless for : - after a select multiple: can setup quick rhombus for the number of choice selected, an opperator is required (<>=) in the edge label - after a yes/no quesiton: 'Yes', 'No', 'Follow' (translation can be added in the code ) - before a calculate to put weight: integer only

notes

advanced interpretation of the edges:

Activity instances: if there is more that 1 instance of a single actity then the 1+ activity will be displayed only if the previous one were not, to do that the GoTO node are replaced by a path and a rombhus, the path got to the activitvy and rhombus and the next node (if any) are attached to the rhombus that is use to wait that the activity

the node following an 1+ activity will be display after the activy OR instead of the activity

Select multiple: if followed by a calculate (rhombus included) the calculate will be equal to the number of selected option BUT opt_none if not a calculate then relevance will be used unless it is "required" then condition will be at least 1 selection

the Rhombus act as an AND between its imputs and its reference BUT it is an OR beween the inputs (input1 OR input2 OR input3) AND reference

start nodes

Main start

the flow required at least 1 main start node, but in case of cdss output strategy , several could be used given that they have a 'process' atrribute

here is the list of the CPG process, this will be the execution oder too:

  • registration,
  • triage,
  • emergency-care,
  • local-urgent-care,
  • actue-tertiary-care,
  • history-and-physical,
  • diagnostic-testing,
  • determine-diagnosis,
  • provide-counseling,
  • dispense-medications,
  • monitor-and-follow-up-of-patient,
  • alerts-reminders-education,
  • discharge-referral-of-patient,
  • charge-for-service,
  • record-and-report

READ Xressource

https://jgraph.github.io/drawio-tools/tools/convert.html

option can have only incoming edge from images to be placed as option$

Note

generation of the expressions

add calcualte:

  • Non or No in an egde will generate a negate node
  • save adds a calcualte
  • a rhombus will generate a calcualte using the reference (can you the label as a test, either with comparaisin or option selected with [option label])

for calculate

Then we calculate based on the previous nodes: [get_prev_node_expression] - if a "fake" calculate (Rhombus, exclusion) then get the underlying expression (should not depend of Calcualte = true) [get_calculation_terms] - if a Select, manage it as a calculate too (should not depend of Calcualte = true) [get_calculation_terms] - else get the expression via [get_calculation_terms] [get_prev_node_expression , calculate = False] -> get_node_expression for the prev node

Running directly

tricc is technically a python library, but you can run it directly via the build.py script.

Running with Docker

Alternatively, if you prefer to build/run the project with Docker, you can do the following.

Start by building the Docker image:

git clone https://github.com/SwissTPH/tricc.git
cd tricc

docker build -t tricc .

Once you have the image built you can use it to convert local .drawio files by mapping the local directory to the docker run command. (Note that --user is specified to make sure the current host user has write access to the output files.)

docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc --help

This command will convert all .drawio files in the current directory:

docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj

You can also convert a single file:

docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj/demo.drawio -o /proj

Use the -O flag to specify the output strategy. For example to generate CHT files:

docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj -O XLSFormCHTStrategy

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tricc_oo-1.5.21.tar.gz (146.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tricc_oo-1.5.21-py3-none-any.whl (155.8 kB view details)

Uploaded Python 3

File details

Details for the file tricc_oo-1.5.21.tar.gz.

File metadata

  • Download URL: tricc_oo-1.5.21.tar.gz
  • Upload date:
  • Size: 146.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tricc_oo-1.5.21.tar.gz
Algorithm Hash digest
SHA256 2d2fbe280c2a0ee8933aa2084f83352a5c28b09d198cf192e2e2ee62f50976df
MD5 92ac04f6925a7d78f66dd07b51761a87
BLAKE2b-256 327a6218e099017c84a44b5c92305c384fbae3d52874a2fa62349bf90c8bdf01

See more details on using hashes here.

File details

Details for the file tricc_oo-1.5.21-py3-none-any.whl.

File metadata

  • Download URL: tricc_oo-1.5.21-py3-none-any.whl
  • Upload date:
  • Size: 155.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tricc_oo-1.5.21-py3-none-any.whl
Algorithm Hash digest
SHA256 0a7a349938156ffcca47a224ff460b13a71c0b9cd171d4450ecc73be64f732d6
MD5 3fb23b9516ec74ffb13f3b7c5a0ba63f
BLAKE2b-256 ff11733220f83315b7948c22361b82f617f5064eda0a5604de75b272eede449b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page