tricc-oo 1.0.1__py3-none-any.whl → 1.4.15__py3-none-any.whl

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.
Files changed (66) hide show
  1. tests/build.py +213 -0
  2. tests/test_cql.py +197 -0
  3. tests/to_ocl.py +51 -0
  4. {tricc → tricc_oo}/__init__.py +3 -1
  5. tricc_oo/converters/codesystem_to_ocl.py +169 -0
  6. tricc_oo/converters/cql/cqlLexer.py +822 -0
  7. tricc_oo/converters/cql/cqlListener.py +1632 -0
  8. tricc_oo/converters/cql/cqlParser.py +11204 -0
  9. tricc_oo/converters/cql/cqlVisitor.py +913 -0
  10. tricc_oo/converters/cql_to_operation.py +402 -0
  11. tricc_oo/converters/datadictionnary.py +115 -0
  12. tricc_oo/converters/drawio_type_map.py +222 -0
  13. tricc_oo/converters/tricc_to_xls_form.py +61 -0
  14. tricc_oo/converters/utils.py +65 -0
  15. tricc_oo/converters/xml_to_tricc.py +1003 -0
  16. tricc_oo/models/__init__.py +4 -0
  17. tricc_oo/models/base.py +732 -0
  18. tricc_oo/models/calculate.py +216 -0
  19. tricc_oo/models/ocl.py +281 -0
  20. tricc_oo/models/ordered_set.py +125 -0
  21. tricc_oo/models/tricc.py +418 -0
  22. tricc_oo/parsers/xml.py +138 -0
  23. tricc_oo/serializers/__init__.py +0 -0
  24. tricc_oo/serializers/xls_form.py +745 -0
  25. tricc_oo/strategies/__init__.py +0 -0
  26. tricc_oo/strategies/input/__init__.py +0 -0
  27. tricc_oo/strategies/input/base_input_strategy.py +111 -0
  28. tricc_oo/strategies/input/drawio.py +317 -0
  29. tricc_oo/strategies/output/base_output_strategy.py +148 -0
  30. tricc_oo/strategies/output/spice.py +365 -0
  31. tricc_oo/strategies/output/xls_form.py +697 -0
  32. tricc_oo/strategies/output/xlsform_cdss.py +189 -0
  33. tricc_oo/strategies/output/xlsform_cht.py +200 -0
  34. tricc_oo/strategies/output/xlsform_cht_hf.py +334 -0
  35. tricc_oo/visitors/__init__.py +0 -0
  36. tricc_oo/visitors/tricc.py +2198 -0
  37. tricc_oo/visitors/utils.py +17 -0
  38. tricc_oo/visitors/xform_pd.py +264 -0
  39. tricc_oo-1.4.15.dist-info/METADATA +219 -0
  40. tricc_oo-1.4.15.dist-info/RECORD +46 -0
  41. {tricc_oo-1.0.1.dist-info → tricc_oo-1.4.15.dist-info}/WHEEL +1 -1
  42. tricc_oo-1.4.15.dist-info/top_level.txt +2 -0
  43. tricc/converters/mc_to_tricc.py +0 -542
  44. tricc/converters/tricc_to_xls_form.py +0 -553
  45. tricc/converters/utils.py +0 -44
  46. tricc/converters/xml_to_tricc.py +0 -740
  47. tricc/models/tricc.py +0 -1093
  48. tricc/parsers/xml.py +0 -81
  49. tricc/serializers/xls_form.py +0 -364
  50. tricc/strategies/input/base_input_strategy.py +0 -80
  51. tricc/strategies/input/drawio.py +0 -246
  52. tricc/strategies/input/medalcreator.py +0 -168
  53. tricc/strategies/output/base_output_strategy.py +0 -92
  54. tricc/strategies/output/xls_form.py +0 -194
  55. tricc/strategies/output/xlsform_cdss.py +0 -46
  56. tricc/strategies/output/xlsform_cht.py +0 -106
  57. tricc/visitors/tricc.py +0 -375
  58. tricc_oo-1.0.1.dist-info/LICENSE +0 -78
  59. tricc_oo-1.0.1.dist-info/METADATA +0 -229
  60. tricc_oo-1.0.1.dist-info/RECORD +0 -26
  61. tricc_oo-1.0.1.dist-info/top_level.txt +0 -2
  62. venv/bin/vba_extract.py +0 -78
  63. {tricc → tricc_oo}/converters/__init__.py +0 -0
  64. {tricc → tricc_oo}/models/lang.py +0 -0
  65. {tricc/serializers → tricc_oo/parsers}/__init__.py +0 -0
  66. {tricc → tricc_oo}/serializers/planuml.py +0 -0
@@ -1,229 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: tricc-oo
3
- Version: 1.0.1
4
- Summary: Python library that converts CDSS L2 in L3
5
- Home-page: https://github.com/SwissTPH/tricc
6
- Author: DHU SwissTPH httu.admin@swisstph.ch
7
- Project-URL: Homepage, https://github.com/SwissTPH/tricc
8
- Project-URL: Issues, https://github.com/SwissTPH/tricc/issues
9
- Classifier: Programming Language :: Python :: 3
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: >=3.8, <4
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE
14
-
15
- # TRICC
16
-
17
- ## Edges
18
-
19
- the edge are in general labeless unless for :
20
- - after a select multiple: can setup quick rhombus for the number of choice selected, an opperator is required (<>=)
21
- - after a yes/no quesiton: 'Yes', 'No', 'Follow' (translation can be added in the code )
22
- - before a calculate to put weight: integer only
23
-
24
- ## Shape
25
-
26
- tricc_type:
27
-
28
- ### Rhombus
29
-
30
- tricc_type:
31
-
32
- ### calculate
33
-
34
- tricc_type: calculate
35
- ### Negate/Exclusive
36
-
37
- tricc_type:not
38
-
39
- ### Select Multiple
40
-
41
- tricc_type:select_multiple
42
-
43
- #### options
44
-
45
- tricc_type:select_option
46
-
47
- ### Select one
48
-
49
- tricc_type:select_one
50
-
51
-
52
- #### Select YesNo
53
-
54
- Not yet supported
55
- #### options
56
-
57
- tricc_type:select_option
58
- ### Text
59
-
60
- tricc_type:text
61
-
62
- ### Note
63
-
64
- tricc_type:note
65
-
66
- ### Decimal
67
-
68
- tricc_type:decimal
69
-
70
- ### Enrichment
71
-
72
- node that target another node to enrich it
73
-
74
- #### Image
75
-
76
- #### Hint
77
-
78
- tricc_type:hint-message
79
-
80
- #### Help
81
-
82
- Commcare only, not yet supported
83
-
84
- tricc_type:help-message
85
-
86
- #### Not available
87
-
88
- Diplay a checkbox to indicate that the data cannot be capture
89
-
90
- tricc_type:not_available
91
-
92
-
93
- ### Links
94
-
95
- Node that are made to link page of jump witnin a page
96
-
97
- #### Start
98
-
99
- #### Activity Start
100
-
101
- #### activity end
102
-
103
- #### End
104
-
105
- #### Page/Container
106
-
107
-
108
- ## properties
109
-
110
- ### tricc_type
111
-
112
- rhombus: fetch data
113
- goto: start the linked activity within the target activity
114
- start: main start of the algo
115
- activity_start: start of an activity (link in)
116
- link_in
117
- link_out
118
- count: count the number of valid input
119
- add: add counts
120
- (DEPRECATED)container_hint_media:
121
- activity:
122
- #select_yesno:
123
- select_option:
124
- hint:
125
- help:
126
- exclusive:
127
- end:
128
- activity_end:
129
- edge:
130
- page:
131
- note:
132
- calculate:
133
- select_multiple:
134
- select_one:
135
- decimal:
136
- integer:
137
- text:
138
-
139
- ### expression
140
- replace the calcualte deducted by inputs
141
- ### expression_inputs
142
- adds a calcualte to the one deducted by inputs
143
-
144
- ### default
145
- not supported yet
146
-
147
- ### save
148
- will create a calculate with the same name
149
- - obs: observation: save the option as a calcualte obs_[name of the option]
150
- - can be written obs.[othername].[snomedCode]
151
- - diag: diagnostic/classification save the option as a calcualte diag_[name of the option]
152
- - flag: calculate save the option as a calcualte is_[name of the option]
153
-
154
-
155
-
156
- ### name
157
- Mandatory
158
-
159
- ### label
160
- Not a real property to add, it is simply the text display in the boxes
161
-
162
-
163
- # notes
164
-
165
- ## advanced interpretation of the edges:
166
-
167
- 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
168
-
169
- the node folowing an 1+ activity will be display after the activy OR instead of the activity
170
-
171
- Select multiple: if followed by a calculate (rhombus included) the calculate will be equal to the number of selected option BUT opt_none
172
- if not a calculate then relevance will be used unless it is "required" then condition will be at least 1 selection
173
-
174
- the Rhombus act as an AND between its imputs and its reference BUT it is an OR beween the inputs
175
- (input1 OR input2 OR input3) AND reference
176
-
177
- ## start nodes
178
-
179
- ### Main start
180
-
181
- 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
182
-
183
- here is the list of the CPG process, this will be the execution oder too:
184
-
185
- - 'registration',
186
- - 'triage',
187
- - 'emergency-care',
188
- - 'local-urgent-care',
189
- - 'actue-tertiary-care',
190
- - 'history-and-physical',
191
- - 'diagnostic-testing',
192
- - 'determine-diagnosis',
193
- - 'provide-counseling',
194
- - 'dispense-medications',
195
- - 'monitor-and-follow-up-of-patient',
196
- - 'alerts-reminders-education',
197
- - 'discharge-referral-of-patient',
198
- - 'charge-for-service',
199
- - 'record-and-report'
200
-
201
-
202
- # READ Xressource
203
- https://jgraph.github.io/drawio-tools/tools/convert.html
204
-
205
-
206
- option can have only incoming edge from images to be placed as option$
207
-
208
-
209
- # Note
210
-
211
- ## generation of the expressions [get_node_expressions]
212
-
213
- ### add calcualte:
214
-
215
- - Non or No will generate a negate node
216
- - save adds a calcualte
217
- - a rhombus will generate a calcualte in reference unless is is already the case (no left expression too)
218
-
219
- ### if the node is a calculate [get_node_expression, calculate = true]
220
-
221
-
222
- then we calculate based on the previous nodes: [get_prev_node_expression]
223
- - if a "fake" calculate (Rhombus, exclusion) then get the underlying expression (should not depend of Calcualte = true) [get_calculation_terms]
224
- - if a Select, manage it as a calculate too (should not depend of Calcualte = true) [get_calculation_terms]
225
- - else get the expression via [get_calculation_terms] [get_prev_node_expression , calculate = False] -> get_node_expression for the prev node
226
-
227
- ### if the node is NOT a calculate [get_node_expression, calculate = false]
228
-
229
-
@@ -1,26 +0,0 @@
1
- tricc/__init__.py,sha256=rFXWrr-DVhweKzwOLbvwY2tPP6Svz6rN0-3qJihqtLA,196
2
- tricc/converters/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- tricc/converters/mc_to_tricc.py,sha256=oBZkcq1uuXxQ4Rt87hQD9x7t2HtAcFcBQ7HC5ceuhdU,22214
4
- tricc/converters/tricc_to_xls_form.py,sha256=JPptH830EdvRiOQQqBPOLT_6MJcBVgJY9mQ39Z_YRWE,25864
5
- tricc/converters/utils.py,sha256=7TRQVQm8ZWQZdlUgoChuWNWZhpG20PPqUMEwTk2sOqY,1123
6
- tricc/converters/xml_to_tricc.py,sha256=gVLgvToX4GUKEm_XaQLIZS_9XvEf_OWak46Iz4v1ZP0,32274
7
- tricc/models/lang.py,sha256=SwKaoxyRhE7gH_ZlYyFXzGuTQ5RE19y47LWAA35zYxg,2338
8
- tricc/models/tricc.py,sha256=dHZrrRgypkMexVCxC71SozpodpMZbxWzXeEf4jFDs7Q,45837
9
- tricc/parsers/xml.py,sha256=TQiCOg48wjrfsFyUYgUD1SM3lQFBn_gUKL_vOtrBTNE,3023
10
- tricc/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
- tricc/serializers/planuml.py,sha256=a81YKsjgng-h2H_rmFE2J5FeBBUaH8kRGT8YrvzpEKE,455
12
- tricc/serializers/xls_form.py,sha256=qyIriQi9M9gm1EYy3PLQgN7c2TOxiIBcjrO2IFlhrHs,13513
13
- tricc/strategies/input/base_input_strategy.py,sha256=jnCsgTBCarecTmxV_bYqoX0O1u6zmQAnQ7-Nkml9NQE,2866
14
- tricc/strategies/input/drawio.py,sha256=769Hj6Z7OJQewEGsmqXZu-3HJai1elw__1pngkQe-8g,11791
15
- tricc/strategies/input/medalcreator.py,sha256=vUcsYWwv-43plVG5liCBoRfBfdd3nmE6lzoYtLfr3FE,5872
16
- tricc/strategies/output/base_output_strategy.py,sha256=8x8py_wQHc7YmB62B5L8fsGEpKma4SY97DsElzJvt1A,2868
17
- tricc/strategies/output/xls_form.py,sha256=xN0c0jH92o9A2rGiJWMNq1mh8FcSjdUGZELFY-h-WMY,9607
18
- tricc/strategies/output/xlsform_cdss.py,sha256=SNfidxcZ-4_H9zF4um2dOZCunZS-DWZ-h4YMH7R-M_4,2018
19
- tricc/strategies/output/xlsform_cht.py,sha256=Eh6PEkre9i5jrYlT7Ycwxfx4v-g9YQcNgu4B56rgyKk,12616
20
- tricc/visitors/tricc.py,sha256=uSBGVuyMyvtUyMIDBgHL8HcVMQDrjKbHLN-91nI1Q5c,17627
21
- venv/bin/vba_extract.py,sha256=KMzF3yf_vAKvJH8TQM__ZFzYvteoncFKMqVN2W1ISj0,2359
22
- tricc_oo-1.0.1.dist-info/LICENSE,sha256=l5rzR7akZ-4vinVjPeVQM94PlTV87PrkoYdmSjjb9qs,18165
23
- tricc_oo-1.0.1.dist-info/METADATA,sha256=l_Aw5x3e0d_rftF8oxCeSkIoD7CIT7hJRJJtr9cRDv8,5619
24
- tricc_oo-1.0.1.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
25
- tricc_oo-1.0.1.dist-info/top_level.txt,sha256=3Rfxtkxqh1ckPikMYQAetlQDaZx-l1LypgSWFbcnEmw,11
26
- tricc_oo-1.0.1.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- tricc
2
- venv
venv/bin/vba_extract.py DELETED
@@ -1,78 +0,0 @@
1
- #!/home/delcpa/Development/tricc/venv/bin/python
2
-
3
- ##############################################################################
4
- #
5
- # vba_extract - A simple utility to extract a vbaProject.bin binary from an
6
- # Excel 2007+ xlsm file for insertion into an XlsxWriter file.
7
- #
8
- # SPDX-License-Identifier: BSD-2-Clause
9
- # Copyright 2013-2023, John McNamara, jmcnamara@cpan.org
10
- #
11
- import sys
12
- from zipfile import ZipFile
13
- from zipfile import BadZipFile
14
-
15
-
16
- def extract_file(xlsm_zip, filename):
17
- # Extract a single file from an Excel xlsm macro file.
18
- data = xlsm_zip.read("xl/" + filename)
19
-
20
- # Write the data to a local file.
21
- file = open(filename, "wb")
22
- file.write(data)
23
- file.close()
24
-
25
-
26
- # The VBA project file and project signature file we want to extract.
27
- vba_filename = "vbaProject.bin"
28
- vba_signature_filename = "vbaProjectSignature.bin"
29
-
30
- # Get the xlsm file name from the commandline.
31
- if len(sys.argv) > 1:
32
- xlsm_file = sys.argv[1]
33
- else:
34
- print(
35
- "\nUtility to extract a vbaProject.bin binary from an Excel 2007+ "
36
- "xlsm macro file for insertion into an XlsxWriter file.\n"
37
- "If the macros are digitally signed, extracts also a vbaProjectSignature.bin "
38
- "file.\n"
39
- "\n"
40
- "See: https://xlsxwriter.readthedocs.io/working_with_macros.html\n"
41
- "\n"
42
- "Usage: vba_extract file.xlsm\n"
43
- )
44
- exit()
45
-
46
- try:
47
- # Open the Excel xlsm file as a zip file.
48
- xlsm_zip = ZipFile(xlsm_file, "r")
49
-
50
- # Read the xl/vbaProject.bin file.
51
- extract_file(xlsm_zip, vba_filename)
52
- print("Extracted: %s" % vba_filename)
53
-
54
- if "xl/" + vba_signature_filename in xlsm_zip.namelist():
55
- extract_file(xlsm_zip, vba_signature_filename)
56
- print("Extracted: %s" % vba_signature_filename)
57
-
58
-
59
- except IOError as e:
60
- print("File error: %s" % str(e))
61
- exit()
62
-
63
- except KeyError as e:
64
- # Usually when there isn't a xl/vbaProject.bin member in the file.
65
- print("File error: %s" % str(e))
66
- print("File may not be an Excel xlsm macro file: '%s'" % xlsm_file)
67
- exit()
68
-
69
- except BadZipFile as e:
70
- # Usually if the file is an xls file and not an xlsm file.
71
- print("File error: %s: '%s'" % (str(e), xlsm_file))
72
- print("File may not be an Excel xlsm macro file.")
73
- exit()
74
-
75
- except Exception as e:
76
- # Catch any other exceptions.
77
- print("File error: %s" % str(e))
78
- exit()
File without changes
File without changes
File without changes
File without changes