tricc-oo 1.5.23__tar.gz → 1.5.24__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {tricc_oo-1.5.23/tricc_oo.egg-info → tricc_oo-1.5.24}/PKG-INFO +125 -84
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/README.md +124 -83
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/pyproject.toml +1 -1
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tests/build.py +4 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/datadictionnary.py +6 -1
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/models/tricc.py +1 -1
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/input/drawio.py +2 -2
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/output/base_output_strategy.py +34 -0
- tricc_oo-1.5.24/tricc_oo/strategies/output/fhir_form.py +377 -0
- tricc_oo-1.5.24/tricc_oo/strategies/output/html_form.py +224 -0
- tricc_oo-1.5.24/tricc_oo/strategies/output/openmrs_form.py +647 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/output/xls_form.py +34 -68
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/output/xlsform_cht.py +3 -2
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/visitors/tricc.py +116 -5
- {tricc_oo-1.5.23 → tricc_oo-1.5.24/tricc_oo.egg-info}/PKG-INFO +125 -84
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo.egg-info/SOURCES.txt +3 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo.egg-info/top_level.txt +1 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/LICENSE +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/setup.cfg +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tests/test_cql.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tests/to_ocl.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/__init__.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/__init__.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/codesystem_to_ocl.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/cql/cqlLexer.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/cql/cqlListener.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/cql/cqlParser.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/cql/cqlVisitor.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/cql_to_operation.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/drawio_type_map.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/tricc_to_xls_form.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/utils.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/converters/xml_to_tricc.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/models/__init__.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/models/base.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/models/calculate.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/models/lang.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/models/ocl.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/models/ordered_set.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/parsers/__init__.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/parsers/xml.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/serializers/__init__.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/serializers/planuml.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/serializers/xls_form.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/__init__.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/input/__init__.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/input/base_input_strategy.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/output/spice.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/output/xlsform_cdss.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/strategies/output/xlsform_cht_hf.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/visitors/__init__.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/visitors/utils.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo/visitors/xform_pd.py +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo.egg-info/dependency_links.txt +0 -0
- {tricc_oo-1.5.23 → tricc_oo-1.5.24}/tricc_oo.egg-info/requires.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tricc-oo
|
|
3
|
-
Version: 1.5.
|
|
3
|
+
Version: 1.5.24
|
|
4
4
|
Summary: Python library that converts CDSS L2 in L3
|
|
5
5
|
Project-URL: Homepage, https://github.com/SwissTPH/tricc
|
|
6
6
|
Project-URL: Issues, https://github.com/SwissTPH/tricc/issues
|
|
@@ -26,7 +26,130 @@ Requires-Dist: beautifulsoup4
|
|
|
26
26
|
Requires-Dist: ocldev
|
|
27
27
|
Dynamic: license-file
|
|
28
28
|
|
|
29
|
-
#
|
|
29
|
+
# TRICC-OO
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## Strategy
|
|
33
|
+
|
|
34
|
+
### XLSFormStrategy
|
|
35
|
+
|
|
36
|
+
to use on OKD and clones,
|
|
37
|
+
|
|
38
|
+
### XLSFormCDSSStrategy
|
|
39
|
+
|
|
40
|
+
based on XLSFormStrategy
|
|
41
|
+
to use on OKD and clones,
|
|
42
|
+
support the CDSS specific behaviour such as Classification management
|
|
43
|
+
|
|
44
|
+
### XLSFormCHTStrategy
|
|
45
|
+
|
|
46
|
+
based on XLSFormCDSSStrategy
|
|
47
|
+
to use on medic CHT if the questionnaire is run Patient level
|
|
48
|
+
Support the inputs from patient
|
|
49
|
+
Support the extention libs
|
|
50
|
+
|
|
51
|
+
### XLSFormCHTHFStrategy
|
|
52
|
+
|
|
53
|
+
based on XLSFormCHTStrategy
|
|
54
|
+
to use on medic CHT if the questionnaire is run on Health facility level without selecting a patient
|
|
55
|
+
Support inputs from HF
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
### OpenMRSStrategy
|
|
59
|
+
|
|
60
|
+
(under development)
|
|
61
|
+
|
|
62
|
+
### FhirStrategy
|
|
63
|
+
|
|
64
|
+
(UNTESTED)
|
|
65
|
+
|
|
66
|
+
### HTMLStrategy
|
|
67
|
+
|
|
68
|
+
(UNTESTED)
|
|
69
|
+
|
|
70
|
+
## start nodes
|
|
71
|
+
|
|
72
|
+
### Main start
|
|
73
|
+
|
|
74
|
+
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
|
|
75
|
+
|
|
76
|
+
here is the list of the CPG process, this will be the execution oder too:
|
|
77
|
+
- **registration**,
|
|
78
|
+
- **triage**,
|
|
79
|
+
- **emergency-care**,
|
|
80
|
+
- **local-urgent-care**,
|
|
81
|
+
- **actue-tertiary-care**,
|
|
82
|
+
- **history-and-physical**,
|
|
83
|
+
- **diagnostic-testing**,
|
|
84
|
+
- **determine-diagnosis**,
|
|
85
|
+
- **provide-counseling**,
|
|
86
|
+
- **dispense-medications**,
|
|
87
|
+
- **monitor-and-follow-up-of-patient**,
|
|
88
|
+
- **alerts-reminders-education**,
|
|
89
|
+
- **discharge-referral-of-patient**,
|
|
90
|
+
- **charge-for-service**,
|
|
91
|
+
- **record-and-report**
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
# Note
|
|
97
|
+
|
|
98
|
+
## generation of the expressions
|
|
99
|
+
|
|
100
|
+
### add calcualte:
|
|
101
|
+
|
|
102
|
+
- Non or No in an egde will generate a negate node
|
|
103
|
+
- save adds a calcualte
|
|
104
|
+
- 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])
|
|
105
|
+
|
|
106
|
+
### for calculate
|
|
107
|
+
|
|
108
|
+
Then we calculate based on the previous nodes: [get_prev_node_expression]
|
|
109
|
+
- if a "fake" calculate (Rhombus, exclusion) then get the underlying expression (should not depend of Calcualte = true) [get_calculation_terms]
|
|
110
|
+
- if a Select, manage it as a calculate too (should not depend of Calcualte = true) [get_calculation_terms]
|
|
111
|
+
- else get the expression via [get_calculation_terms] [get_prev_node_expression , calculate = False] -> get_node_expression for the prev node
|
|
112
|
+
|
|
113
|
+
# Running directly
|
|
114
|
+
|
|
115
|
+
`tricc` is technically a python library, but you can run it directly via the [`build.py` script](./tests/build.py).
|
|
116
|
+
|
|
117
|
+
## Running with Docker
|
|
118
|
+
|
|
119
|
+
Alternatively, if you prefer to build/run the project with Docker, you can do the following.
|
|
120
|
+
|
|
121
|
+
Start by building the Docker image:
|
|
122
|
+
|
|
123
|
+
```shell
|
|
124
|
+
git clone https://github.com/SwissTPH/tricc.git
|
|
125
|
+
cd tricc
|
|
126
|
+
|
|
127
|
+
docker build -t tricc .
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
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.)
|
|
131
|
+
|
|
132
|
+
```shell
|
|
133
|
+
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc --help
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
This command will convert all `.drawio` files in the current directory:
|
|
137
|
+
|
|
138
|
+
```shell
|
|
139
|
+
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
You can also convert a single file:
|
|
143
|
+
|
|
144
|
+
```shell
|
|
145
|
+
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj/demo.drawio -o /proj
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Use the `-O` flag to specify the output strategy. For example to generate CHT files:
|
|
149
|
+
|
|
150
|
+
```shell
|
|
151
|
+
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj -O XLSFormCHTStrategy
|
|
152
|
+
```
|
|
30
153
|
|
|
31
154
|
## Nodes
|
|
32
155
|
|
|
@@ -133,90 +256,8 @@ if not a calculate then relevance will be used unless it is "required" then cond
|
|
|
133
256
|
the Rhombus act as an AND between its imputs and its reference BUT it is an OR beween the inputs
|
|
134
257
|
(input1 OR input2 OR input3) AND reference
|
|
135
258
|
|
|
136
|
-
## start nodes
|
|
137
|
-
|
|
138
|
-
### Main start
|
|
139
|
-
|
|
140
|
-
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
|
|
141
|
-
|
|
142
|
-
here is the list of the CPG process, this will be the execution oder too:
|
|
143
|
-
- **registration**,
|
|
144
|
-
- **triage**,
|
|
145
|
-
- **emergency-care**,
|
|
146
|
-
- **local-urgent-care**,
|
|
147
|
-
- **actue-tertiary-care**,
|
|
148
|
-
- **history-and-physical**,
|
|
149
|
-
- **diagnostic-testing**,
|
|
150
|
-
- **determine-diagnosis**,
|
|
151
|
-
- **provide-counseling**,
|
|
152
|
-
- **dispense-medications**,
|
|
153
|
-
- **monitor-and-follow-up-of-patient**,
|
|
154
|
-
- **alerts-reminders-education**,
|
|
155
|
-
- **discharge-referral-of-patient**,
|
|
156
|
-
- **charge-for-service**,
|
|
157
|
-
- **record-and-report**
|
|
158
|
-
|
|
159
|
-
|
|
160
259
|
# READ Xressource
|
|
161
260
|
https://jgraph.github.io/drawio-tools/tools/convert.html
|
|
162
261
|
|
|
163
262
|
option can have only incoming edge from images to be placed as option$
|
|
164
263
|
|
|
165
|
-
|
|
166
|
-
# Note
|
|
167
|
-
|
|
168
|
-
## generation of the expressions
|
|
169
|
-
|
|
170
|
-
### add calcualte:
|
|
171
|
-
|
|
172
|
-
- Non or No in an egde will generate a negate node
|
|
173
|
-
- save adds a calcualte
|
|
174
|
-
- 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])
|
|
175
|
-
|
|
176
|
-
### for calculate
|
|
177
|
-
|
|
178
|
-
Then we calculate based on the previous nodes: [get_prev_node_expression]
|
|
179
|
-
- if a "fake" calculate (Rhombus, exclusion) then get the underlying expression (should not depend of Calcualte = true) [get_calculation_terms]
|
|
180
|
-
- if a Select, manage it as a calculate too (should not depend of Calcualte = true) [get_calculation_terms]
|
|
181
|
-
- else get the expression via [get_calculation_terms] [get_prev_node_expression , calculate = False] -> get_node_expression for the prev node
|
|
182
|
-
|
|
183
|
-
# Running directly
|
|
184
|
-
|
|
185
|
-
`tricc` is technically a python library, but you can run it directly via the [`build.py` script](./tests/build.py).
|
|
186
|
-
|
|
187
|
-
## Running with Docker
|
|
188
|
-
|
|
189
|
-
Alternatively, if you prefer to build/run the project with Docker, you can do the following.
|
|
190
|
-
|
|
191
|
-
Start by building the Docker image:
|
|
192
|
-
|
|
193
|
-
```shell
|
|
194
|
-
git clone https://github.com/SwissTPH/tricc.git
|
|
195
|
-
cd tricc
|
|
196
|
-
|
|
197
|
-
docker build -t tricc .
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
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.)
|
|
201
|
-
|
|
202
|
-
```shell
|
|
203
|
-
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc --help
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
This command will convert all `.drawio` files in the current directory:
|
|
207
|
-
|
|
208
|
-
```shell
|
|
209
|
-
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
You can also convert a single file:
|
|
213
|
-
|
|
214
|
-
```shell
|
|
215
|
-
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj/demo.drawio -o /proj
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
Use the `-O` flag to specify the output strategy. For example to generate CHT files:
|
|
219
|
-
|
|
220
|
-
```shell
|
|
221
|
-
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj -O XLSFormCHTStrategy
|
|
222
|
-
```
|
|
@@ -1,4 +1,127 @@
|
|
|
1
|
-
#
|
|
1
|
+
# TRICC-OO
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
## Strategy
|
|
5
|
+
|
|
6
|
+
### XLSFormStrategy
|
|
7
|
+
|
|
8
|
+
to use on OKD and clones,
|
|
9
|
+
|
|
10
|
+
### XLSFormCDSSStrategy
|
|
11
|
+
|
|
12
|
+
based on XLSFormStrategy
|
|
13
|
+
to use on OKD and clones,
|
|
14
|
+
support the CDSS specific behaviour such as Classification management
|
|
15
|
+
|
|
16
|
+
### XLSFormCHTStrategy
|
|
17
|
+
|
|
18
|
+
based on XLSFormCDSSStrategy
|
|
19
|
+
to use on medic CHT if the questionnaire is run Patient level
|
|
20
|
+
Support the inputs from patient
|
|
21
|
+
Support the extention libs
|
|
22
|
+
|
|
23
|
+
### XLSFormCHTHFStrategy
|
|
24
|
+
|
|
25
|
+
based on XLSFormCHTStrategy
|
|
26
|
+
to use on medic CHT if the questionnaire is run on Health facility level without selecting a patient
|
|
27
|
+
Support inputs from HF
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### OpenMRSStrategy
|
|
31
|
+
|
|
32
|
+
(under development)
|
|
33
|
+
|
|
34
|
+
### FhirStrategy
|
|
35
|
+
|
|
36
|
+
(UNTESTED)
|
|
37
|
+
|
|
38
|
+
### HTMLStrategy
|
|
39
|
+
|
|
40
|
+
(UNTESTED)
|
|
41
|
+
|
|
42
|
+
## start nodes
|
|
43
|
+
|
|
44
|
+
### Main start
|
|
45
|
+
|
|
46
|
+
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
|
|
47
|
+
|
|
48
|
+
here is the list of the CPG process, this will be the execution oder too:
|
|
49
|
+
- **registration**,
|
|
50
|
+
- **triage**,
|
|
51
|
+
- **emergency-care**,
|
|
52
|
+
- **local-urgent-care**,
|
|
53
|
+
- **actue-tertiary-care**,
|
|
54
|
+
- **history-and-physical**,
|
|
55
|
+
- **diagnostic-testing**,
|
|
56
|
+
- **determine-diagnosis**,
|
|
57
|
+
- **provide-counseling**,
|
|
58
|
+
- **dispense-medications**,
|
|
59
|
+
- **monitor-and-follow-up-of-patient**,
|
|
60
|
+
- **alerts-reminders-education**,
|
|
61
|
+
- **discharge-referral-of-patient**,
|
|
62
|
+
- **charge-for-service**,
|
|
63
|
+
- **record-and-report**
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
# Note
|
|
69
|
+
|
|
70
|
+
## generation of the expressions
|
|
71
|
+
|
|
72
|
+
### add calcualte:
|
|
73
|
+
|
|
74
|
+
- Non or No in an egde will generate a negate node
|
|
75
|
+
- save adds a calcualte
|
|
76
|
+
- 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])
|
|
77
|
+
|
|
78
|
+
### for calculate
|
|
79
|
+
|
|
80
|
+
Then we calculate based on the previous nodes: [get_prev_node_expression]
|
|
81
|
+
- if a "fake" calculate (Rhombus, exclusion) then get the underlying expression (should not depend of Calcualte = true) [get_calculation_terms]
|
|
82
|
+
- if a Select, manage it as a calculate too (should not depend of Calcualte = true) [get_calculation_terms]
|
|
83
|
+
- else get the expression via [get_calculation_terms] [get_prev_node_expression , calculate = False] -> get_node_expression for the prev node
|
|
84
|
+
|
|
85
|
+
# Running directly
|
|
86
|
+
|
|
87
|
+
`tricc` is technically a python library, but you can run it directly via the [`build.py` script](./tests/build.py).
|
|
88
|
+
|
|
89
|
+
## Running with Docker
|
|
90
|
+
|
|
91
|
+
Alternatively, if you prefer to build/run the project with Docker, you can do the following.
|
|
92
|
+
|
|
93
|
+
Start by building the Docker image:
|
|
94
|
+
|
|
95
|
+
```shell
|
|
96
|
+
git clone https://github.com/SwissTPH/tricc.git
|
|
97
|
+
cd tricc
|
|
98
|
+
|
|
99
|
+
docker build -t tricc .
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
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.)
|
|
103
|
+
|
|
104
|
+
```shell
|
|
105
|
+
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc --help
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
This command will convert all `.drawio` files in the current directory:
|
|
109
|
+
|
|
110
|
+
```shell
|
|
111
|
+
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
You can also convert a single file:
|
|
115
|
+
|
|
116
|
+
```shell
|
|
117
|
+
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj/demo.drawio -o /proj
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Use the `-O` flag to specify the output strategy. For example to generate CHT files:
|
|
121
|
+
|
|
122
|
+
```shell
|
|
123
|
+
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj -O XLSFormCHTStrategy
|
|
124
|
+
```
|
|
2
125
|
|
|
3
126
|
## Nodes
|
|
4
127
|
|
|
@@ -105,90 +228,8 @@ if not a calculate then relevance will be used unless it is "required" then cond
|
|
|
105
228
|
the Rhombus act as an AND between its imputs and its reference BUT it is an OR beween the inputs
|
|
106
229
|
(input1 OR input2 OR input3) AND reference
|
|
107
230
|
|
|
108
|
-
## start nodes
|
|
109
|
-
|
|
110
|
-
### Main start
|
|
111
|
-
|
|
112
|
-
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
|
|
113
|
-
|
|
114
|
-
here is the list of the CPG process, this will be the execution oder too:
|
|
115
|
-
- **registration**,
|
|
116
|
-
- **triage**,
|
|
117
|
-
- **emergency-care**,
|
|
118
|
-
- **local-urgent-care**,
|
|
119
|
-
- **actue-tertiary-care**,
|
|
120
|
-
- **history-and-physical**,
|
|
121
|
-
- **diagnostic-testing**,
|
|
122
|
-
- **determine-diagnosis**,
|
|
123
|
-
- **provide-counseling**,
|
|
124
|
-
- **dispense-medications**,
|
|
125
|
-
- **monitor-and-follow-up-of-patient**,
|
|
126
|
-
- **alerts-reminders-education**,
|
|
127
|
-
- **discharge-referral-of-patient**,
|
|
128
|
-
- **charge-for-service**,
|
|
129
|
-
- **record-and-report**
|
|
130
|
-
|
|
131
|
-
|
|
132
231
|
# READ Xressource
|
|
133
232
|
https://jgraph.github.io/drawio-tools/tools/convert.html
|
|
134
233
|
|
|
135
234
|
option can have only incoming edge from images to be placed as option$
|
|
136
235
|
|
|
137
|
-
|
|
138
|
-
# Note
|
|
139
|
-
|
|
140
|
-
## generation of the expressions
|
|
141
|
-
|
|
142
|
-
### add calcualte:
|
|
143
|
-
|
|
144
|
-
- Non or No in an egde will generate a negate node
|
|
145
|
-
- save adds a calcualte
|
|
146
|
-
- 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])
|
|
147
|
-
|
|
148
|
-
### for calculate
|
|
149
|
-
|
|
150
|
-
Then we calculate based on the previous nodes: [get_prev_node_expression]
|
|
151
|
-
- if a "fake" calculate (Rhombus, exclusion) then get the underlying expression (should not depend of Calcualte = true) [get_calculation_terms]
|
|
152
|
-
- if a Select, manage it as a calculate too (should not depend of Calcualte = true) [get_calculation_terms]
|
|
153
|
-
- else get the expression via [get_calculation_terms] [get_prev_node_expression , calculate = False] -> get_node_expression for the prev node
|
|
154
|
-
|
|
155
|
-
# Running directly
|
|
156
|
-
|
|
157
|
-
`tricc` is technically a python library, but you can run it directly via the [`build.py` script](./tests/build.py).
|
|
158
|
-
|
|
159
|
-
## Running with Docker
|
|
160
|
-
|
|
161
|
-
Alternatively, if you prefer to build/run the project with Docker, you can do the following.
|
|
162
|
-
|
|
163
|
-
Start by building the Docker image:
|
|
164
|
-
|
|
165
|
-
```shell
|
|
166
|
-
git clone https://github.com/SwissTPH/tricc.git
|
|
167
|
-
cd tricc
|
|
168
|
-
|
|
169
|
-
docker build -t tricc .
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
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.)
|
|
173
|
-
|
|
174
|
-
```shell
|
|
175
|
-
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc --help
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
This command will convert all `.drawio` files in the current directory:
|
|
179
|
-
|
|
180
|
-
```shell
|
|
181
|
-
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
You can also convert a single file:
|
|
185
|
-
|
|
186
|
-
```shell
|
|
187
|
-
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj/demo.drawio -o /proj
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
Use the `-O` flag to specify the output strategy. For example to generate CHT files:
|
|
191
|
-
|
|
192
|
-
```shell
|
|
193
|
-
docker run --rm -v "$PWD":/proj --user $(id -u):$(id -g) tricc -i /proj -o /proj -O XLSFormCHTStrategy
|
|
194
|
-
```
|
|
@@ -3,6 +3,10 @@ from tricc_oo.strategies.output.xlsform_cht_hf import XLSFormCHTHFStrategy
|
|
|
3
3
|
from tricc_oo.strategies.output.xlsform_cht import XLSFormCHTStrategy
|
|
4
4
|
from tricc_oo.strategies.output.xlsform_cdss import XLSFormCDSSStrategy
|
|
5
5
|
from tricc_oo.strategies.output.xls_form import XLSFormStrategy
|
|
6
|
+
from tricc_oo.strategies.output.openmrs_form import OpenMRSStrategy
|
|
7
|
+
from tricc_oo.strategies.output.fhir_form import FHIRStrategy
|
|
8
|
+
from tricc_oo.strategies.output.html_form import HTMLStrategy
|
|
9
|
+
|
|
6
10
|
from tricc_oo.strategies.input.drawio import DrawioStrategy
|
|
7
11
|
import getopt
|
|
8
12
|
import gettext
|
|
@@ -6,9 +6,13 @@ from fhir.resources.codesystem import (
|
|
|
6
6
|
|
|
7
7
|
from fhir.resources.valueset import ValueSet
|
|
8
8
|
import logging
|
|
9
|
+
import uuid
|
|
9
10
|
|
|
10
11
|
logger = logging.getLogger("default")
|
|
11
12
|
|
|
13
|
+
# Namespace for deterministic UUIDs
|
|
14
|
+
UUID_NAMESPACE = uuid.UUID('12345678-1234-5678-9abc-def012345678')
|
|
15
|
+
|
|
12
16
|
|
|
13
17
|
def lookup_codesystems_code(codesystems, ref):
|
|
14
18
|
if ref.startswith("final."):
|
|
@@ -83,7 +87,8 @@ def check_and_add_concept(code_system: CodeSystem, code: str, display: str, attr
|
|
|
83
87
|
new_concept = concept
|
|
84
88
|
if not new_concept:
|
|
85
89
|
# Add the new concept if it does not exist
|
|
86
|
-
|
|
90
|
+
concept_id = str(uuid.uuid5(UUID_NAMESPACE, display))
|
|
91
|
+
new_concept = CodeSystemConcept.construct(code=code, display=display, id=concept_id)
|
|
87
92
|
if not hasattr(code_system, "concept"):
|
|
88
93
|
code_system.concept = []
|
|
89
94
|
code_system.concept.append(new_concept)
|
|
@@ -404,7 +404,7 @@ class TriccNodeSelectYesNo(TriccNodeSelectOne):
|
|
|
404
404
|
pass
|
|
405
405
|
|
|
406
406
|
|
|
407
|
-
class TriccNodeAcceptDiagnostic(
|
|
407
|
+
class TriccNodeAcceptDiagnostic(TriccNodeSelectYesNo):
|
|
408
408
|
severity: Optional[str] = None
|
|
409
409
|
priority: Union[float, int, None] = None
|
|
410
410
|
|
|
@@ -3,7 +3,7 @@ import os
|
|
|
3
3
|
|
|
4
4
|
from tricc_oo.converters.xml_to_tricc import create_activity
|
|
5
5
|
from tricc_oo.visitors.tricc import (
|
|
6
|
-
|
|
6
|
+
load_calculate,
|
|
7
7
|
set_prev_next_node,
|
|
8
8
|
replace_node,
|
|
9
9
|
stashed_node_func,
|
|
@@ -47,7 +47,7 @@ class DrawioStrategy(BaseInputStrategy):
|
|
|
47
47
|
# add save nodes and merge nodes
|
|
48
48
|
stashed_node_func(
|
|
49
49
|
start_page.root,
|
|
50
|
-
|
|
50
|
+
load_calculate,
|
|
51
51
|
used_calculates=used_calculates,
|
|
52
52
|
calculates=calculates,
|
|
53
53
|
recursive=False,
|
|
@@ -83,6 +83,7 @@ class BaseOutPutStrategy:
|
|
|
83
83
|
# node function
|
|
84
84
|
@abc.abstractmethod
|
|
85
85
|
def generate_calculate(self, node, **kwargs):
|
|
86
|
+
# called to generate the calculates on the project
|
|
86
87
|
pass
|
|
87
88
|
|
|
88
89
|
@abc.abstractmethod
|
|
@@ -91,10 +92,14 @@ class BaseOutPutStrategy:
|
|
|
91
92
|
|
|
92
93
|
@abc.abstractmethod
|
|
93
94
|
def generate_relevance(self, node, **kwargs):
|
|
95
|
+
# called to generate the references on the project
|
|
96
|
+
|
|
94
97
|
pass
|
|
95
98
|
|
|
96
99
|
@abc.abstractmethod
|
|
97
100
|
def generate_export(self, node, **kwargs):
|
|
101
|
+
# called to the project export
|
|
102
|
+
|
|
98
103
|
pass
|
|
99
104
|
|
|
100
105
|
@abc.abstractmethod
|
|
@@ -102,87 +107,116 @@ class BaseOutPutStrategy:
|
|
|
102
107
|
pass
|
|
103
108
|
|
|
104
109
|
def tricc_operation_equal(self, ref_expressions):
|
|
110
|
+
# r[0] = r[1]
|
|
105
111
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
106
112
|
|
|
107
113
|
def tricc_operation_not_equal(self, ref_expressions):
|
|
114
|
+
# r[0] != r[1]
|
|
108
115
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
109
116
|
|
|
110
117
|
def tricc_operation_not(self, ref_expressions):
|
|
118
|
+
# !r[0]
|
|
111
119
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
112
120
|
|
|
113
121
|
def tricc_operation_and(self, ref_expressions):
|
|
122
|
+
# r[0] and r[1] ... and r[n]
|
|
114
123
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
115
124
|
|
|
116
125
|
def tricc_operation_or(self, ref_expressions):
|
|
126
|
+
# r[0] or r[1] ... or r[n]
|
|
117
127
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
118
128
|
|
|
119
129
|
def tricc_operation_or_and(self, ref_expressions):
|
|
130
|
+
# (r[0] or r[1] ... or r[n-1]) and r[n]
|
|
120
131
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
121
132
|
|
|
122
133
|
def tricc_operation_native(self, ref_expressions):
|
|
134
|
+
# r[0](*r[1:])
|
|
123
135
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
124
136
|
|
|
125
137
|
def tricc_operation_istrue(self, ref_expressions):
|
|
138
|
+
# r[0] is true
|
|
126
139
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
127
140
|
|
|
128
141
|
def tricc_operation_isfalse(self, ref_expressions):
|
|
142
|
+
# r[0] is false
|
|
129
143
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
130
144
|
|
|
131
145
|
def tricc_operation_selected(self, ref_expressions):
|
|
146
|
+
# for choice question (single or multiple) it returns true if the second reference is selected
|
|
147
|
+
# r[1] in r[0]
|
|
132
148
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
133
149
|
|
|
134
150
|
def tricc_operation_more_or_equal(self, ref_expressions):
|
|
151
|
+
# r[0] >= r[1]
|
|
135
152
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
136
153
|
|
|
137
154
|
def tricc_operation_less_or_equal(self, ref_expressions):
|
|
155
|
+
# r[0] <= r[1]
|
|
138
156
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
139
157
|
|
|
140
158
|
def tricc_operation_more(self, ref_expressions):
|
|
159
|
+
# r[0] > r[1]
|
|
141
160
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
142
161
|
|
|
143
162
|
def tricc_operation_less(self, ref_expressions):
|
|
163
|
+
# r[0] < r[1]
|
|
144
164
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
145
165
|
|
|
146
166
|
def tricc_operation_between(self, ref_expressions):
|
|
167
|
+
# r[0] between r[1] and r[2]
|
|
147
168
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
148
169
|
|
|
149
170
|
def tricc_operation_case(self, ref_expressions):
|
|
171
|
+
# case r[0] when r[1][0] then r[1][1] ... when r[n-1][0] then r[n-1][1] else (r[n] or None)
|
|
150
172
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
151
173
|
|
|
152
174
|
def tricc_operation_if(self, ref_expressions):
|
|
175
|
+
# if r[0][0] then r[0][1] ... elif r[n-1][0] then r[n-1][1] else (r[n] or None)
|
|
153
176
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
154
177
|
|
|
155
178
|
def tricc_operation_contains(self, ref_expressions):
|
|
179
|
+
# r[0] contains r[1]
|
|
156
180
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
157
181
|
|
|
158
182
|
def tricc_operation_exists(self, ref_expressions):
|
|
183
|
+
# r[0] exists
|
|
159
184
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
160
185
|
|
|
161
186
|
def tricc_operation_has_qualifier(self, ref_expressions):
|
|
187
|
+
# r[0] is a class and has r[1] qualifier
|
|
162
188
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
163
189
|
|
|
164
190
|
def tricc_operation_zscore(self, ref_expressions):
|
|
191
|
+
# FIXME zscore((gender=r[0], Xfy=r[1], xfY=r[2])
|
|
165
192
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
166
193
|
|
|
167
194
|
def tricc_operation_datetime_to_decimal(self, ref_expressions):
|
|
195
|
+
# cast r[0] in decimal
|
|
168
196
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
169
197
|
|
|
170
198
|
def tricc_operation_round(self, ref_expressions):
|
|
199
|
+
# round(r[0], r[1])
|
|
171
200
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
172
201
|
|
|
173
202
|
def tricc_operation_izscore(self, ref_expressions):
|
|
203
|
+
# FIXME izscore(gender=r[0], Z=r[1], xfY=r[2])
|
|
174
204
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
175
205
|
|
|
176
206
|
def tricc_operation_age_day(self, ref_expressions):
|
|
207
|
+
# Patient age in day
|
|
177
208
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
178
209
|
|
|
179
210
|
def tricc_operation_age_month(self, ref_expressions):
|
|
211
|
+
# Patient age in Month
|
|
180
212
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
181
213
|
|
|
182
214
|
def tricc_operation_age_year(self, ref_expressions):
|
|
215
|
+
# Patient age in Years
|
|
183
216
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
184
217
|
|
|
185
218
|
def tricc_operation_concatenate(self, ref_expressions):
|
|
219
|
+
# concatenate(*r)
|
|
186
220
|
raise NotImplementedError("This type of opreration is not supported in this strategy")
|
|
187
221
|
|
|
188
222
|
# Utils
|