tricc-oo 1.4.15__py3-none-any.whl → 1.4.21__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.
- tests/build.py +2 -1
- tricc_oo/converters/cql_to_operation.py +24 -4
- tricc_oo/converters/datadictionnary.py +4 -0
- tricc_oo/converters/drawio_type_map.py +2 -2
- tricc_oo/converters/tricc_to_xls_form.py +4 -4
- tricc_oo/converters/xml_to_tricc.py +3 -1
- tricc_oo/models/base.py +25 -19
- tricc_oo/models/tricc.py +5 -2
- tricc_oo/serializers/xls_form.py +11 -119
- tricc_oo/strategies/input/base_input_strategy.py +24 -23
- tricc_oo/strategies/input/drawio.py +1 -1
- tricc_oo/strategies/output/xls_form.py +10 -7
- tricc_oo/strategies/output/xlsform_cdss.py +0 -4
- tricc_oo/strategies/output/xlsform_cht.py +309 -27
- tricc_oo/strategies/output/xlsform_cht_hf.py +3 -294
- tricc_oo/visitors/tricc.py +226 -173
- {tricc_oo-1.4.15.dist-info → tricc_oo-1.4.21.dist-info}/METADATA +2 -1
- {tricc_oo-1.4.15.dist-info → tricc_oo-1.4.21.dist-info}/RECORD +20 -20
- {tricc_oo-1.4.15.dist-info → tricc_oo-1.4.21.dist-info}/WHEEL +1 -1
- {tricc_oo-1.4.15.dist-info → tricc_oo-1.4.21.dist-info}/top_level.txt +0 -0
|
@@ -32,44 +32,326 @@ class XLSFormCHTStrategy(XLSFormCDSSStrategy):
|
|
|
32
32
|
self.df_survey = pd.concat([cht_input_df, self.df_survey ,self.get_cht_summary() ], ignore_index=True)
|
|
33
33
|
|
|
34
34
|
def get_cht_input(self, start_pages, **kwargs):
|
|
35
|
+
empty = langs.get_trads('', force_dict =True)
|
|
35
36
|
df_input = pd.DataFrame(columns=SURVEY_MAP.keys())
|
|
36
37
|
#[ #type, '',#name ''#label, '',#hint '',#help '',#default '',#'appearance', '',#'constraint', '',#'constraint_message' '',#'relevance' '',#'disabled' '',#'required' '',#'required message' '',#'read only' '',#'expression' '',#'repeat_count' ''#'image' ],
|
|
37
|
-
df_input.loc[len(df_input)] = [
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
df_input.loc[len(df_input)] = [
|
|
39
|
+
'begin_group', 'inputs',
|
|
40
|
+
*list(langs.get_trads('NO_LABEL', force_dict = True).values()),
|
|
41
|
+
*list(empty.values()),
|
|
42
|
+
*list(empty.values()),
|
|
43
|
+
'', 'field-list', '',
|
|
44
|
+
*list(empty.values()),
|
|
45
|
+
'./source = "user"', '','',
|
|
46
|
+
*list(empty.values())
|
|
47
|
+
,'', '', '', '' ,''
|
|
48
|
+
]
|
|
49
|
+
df_input.loc[len(df_input)] = [
|
|
50
|
+
'hidden', 'source',
|
|
51
|
+
*list(langs.get_trads('Source', force_dict = True).values()),
|
|
52
|
+
*list(empty.values()),
|
|
53
|
+
*list(empty.values()),
|
|
54
|
+
'user', 'hidden', '',
|
|
55
|
+
*list(empty.values()),
|
|
56
|
+
'', '','',
|
|
57
|
+
*list(empty.values())
|
|
58
|
+
,'', '', '', '' ,''
|
|
59
|
+
]
|
|
60
|
+
df_input.loc[len(df_input)] = [
|
|
61
|
+
'hidden', 'source_id',
|
|
62
|
+
*list(langs.get_trads('Source ID', force_dict = True).values()),
|
|
63
|
+
*list(empty.values()),
|
|
64
|
+
*list(empty.values()),
|
|
65
|
+
'', 'hidden', '',
|
|
66
|
+
*list(empty.values()),
|
|
67
|
+
'', '','',
|
|
68
|
+
*list(empty.values())
|
|
69
|
+
,'', '', '', '' ,''
|
|
70
|
+
]
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
df_input.loc[len(df_input)] = [
|
|
74
|
+
'begin_group', 'user',
|
|
75
|
+
*list(langs.get_trads('NO_LABEL', force_dict = True).values()),
|
|
76
|
+
*list(empty.values()),
|
|
77
|
+
*list(empty.values()),
|
|
78
|
+
'', 'field-list', '',
|
|
79
|
+
*list(empty.values()),
|
|
80
|
+
'', '','',
|
|
81
|
+
*list(empty.values())
|
|
82
|
+
,'', '', '', '' ,''
|
|
83
|
+
]
|
|
84
|
+
df_input.loc[len(df_input)] = [
|
|
85
|
+
'string', 'contact_id',
|
|
86
|
+
*list(langs.get_trads('NO_LABEL', force_dict = True).values()),
|
|
87
|
+
*list(empty.values()),
|
|
88
|
+
*list(empty.values()),
|
|
89
|
+
'', 'hidden', '',
|
|
90
|
+
*list(empty.values()),
|
|
91
|
+
'', '','',
|
|
92
|
+
*list(empty.values())
|
|
93
|
+
,'', '', '', '' ,''
|
|
94
|
+
]
|
|
95
|
+
df_input.loc[len(df_input)] = [
|
|
96
|
+
'string', 'facility_id',
|
|
97
|
+
*list(langs.get_trads('NO_LABEL', force_dict = True).values()),
|
|
98
|
+
*list(empty.values()),
|
|
99
|
+
*list(empty.values()),
|
|
100
|
+
'', 'hidden', '',
|
|
101
|
+
*list(empty.values()),
|
|
102
|
+
'', '','',
|
|
103
|
+
*list(empty.values())
|
|
104
|
+
,'', '', '', '' ,''
|
|
105
|
+
]
|
|
106
|
+
df_input.loc[len(df_input)] = [
|
|
107
|
+
'string', 'name',
|
|
108
|
+
*list(langs.get_trads('NO_LABEL', force_dict = True).values()),
|
|
109
|
+
*list(empty.values()),
|
|
110
|
+
*list(empty.values()),
|
|
111
|
+
'', 'hidden', '',
|
|
112
|
+
*list(empty.values()),
|
|
113
|
+
'', '','',
|
|
114
|
+
*list(empty.values())
|
|
115
|
+
,'', '', '', '' ,''
|
|
116
|
+
]
|
|
117
|
+
df_input.loc[len(df_input)] = [
|
|
118
|
+
'end_group', 'user end' ,
|
|
119
|
+
*list(empty.values()),
|
|
120
|
+
*list(empty.values()),
|
|
121
|
+
*list(empty.values()),
|
|
122
|
+
'', '', '',
|
|
123
|
+
*list(empty.values()),
|
|
124
|
+
'', '', '',
|
|
125
|
+
*list(empty.values()),
|
|
126
|
+
'', '', '', '',''
|
|
127
|
+
]
|
|
128
|
+
df_input.loc[len(df_input)] = [
|
|
129
|
+
'begin_group', 'contact',
|
|
130
|
+
*list(langs.get_trads('NO_LABEL', force_dict = True).values()),
|
|
131
|
+
*list(empty.values()),
|
|
132
|
+
*list(empty.values()),
|
|
133
|
+
'', 'field-list', '',
|
|
134
|
+
*list(empty.values()),
|
|
135
|
+
'', '','',
|
|
136
|
+
*list(empty.values())
|
|
137
|
+
,'', '', '', '' ,''
|
|
138
|
+
]
|
|
139
|
+
self.get_contact_inputs(df_input)
|
|
40
140
|
inputs = self.export_inputs( start_pages[self.processes[0]], **kwargs)
|
|
41
141
|
for input in inputs:
|
|
42
142
|
df_input.loc[len(df_input)] = get_input_line(input)
|
|
43
143
|
df_input.loc[len(df_input)] = [
|
|
44
|
-
'hidden', '
|
|
144
|
+
'hidden', 'external_id',
|
|
45
145
|
*list(langs.get_trads('NO_LABEL', force_dict = True).values()),
|
|
46
|
-
*list(
|
|
47
|
-
*list(
|
|
146
|
+
*list(empty.values()),
|
|
147
|
+
*list(empty.values()),
|
|
48
148
|
'', 'hidden', '',
|
|
49
|
-
*list(
|
|
149
|
+
*list(empty.values()),
|
|
50
150
|
'', '','',
|
|
51
|
-
*list(
|
|
52
|
-
,'', '', '', ''
|
|
151
|
+
*list(empty.values())
|
|
152
|
+
,'', '', '', '' ,''
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
df_input.loc[len(df_input)] = [
|
|
156
|
+
'string', '_id',
|
|
157
|
+
*list(langs.get_trads('NO_LABEL', force_dict = True).values()),
|
|
158
|
+
*list(empty.values()),
|
|
159
|
+
*list(empty.values()),
|
|
160
|
+
'', 'hidden', '',
|
|
161
|
+
*list(empty.values()),
|
|
162
|
+
'', '','',
|
|
163
|
+
*list(empty.values())
|
|
164
|
+
,'', '', '', '' ,''
|
|
53
165
|
]
|
|
54
|
-
|
|
55
|
-
df_input.loc[len(df_input)] = [
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
166
|
+
|
|
167
|
+
df_input.loc[len(df_input)] = [
|
|
168
|
+
'end_group', 'contact end' ,
|
|
169
|
+
*list(empty.values()),
|
|
170
|
+
*list(empty.values()),
|
|
171
|
+
*list(empty.values()),
|
|
172
|
+
'', '', '',
|
|
173
|
+
*list(empty.values()),
|
|
174
|
+
'', '', '',
|
|
175
|
+
*list(empty.values()),
|
|
176
|
+
'', '', '', '',''
|
|
177
|
+
]
|
|
178
|
+
|
|
179
|
+
df_input.loc[len(df_input)] = [
|
|
180
|
+
'end_group', 'input end' ,
|
|
181
|
+
*list(empty.values()),
|
|
182
|
+
*list(empty.values()),
|
|
183
|
+
*list(empty.values()),
|
|
184
|
+
'', '', '',
|
|
185
|
+
*list(empty.values()),
|
|
186
|
+
'', '', '',
|
|
187
|
+
*list(empty.values()),
|
|
188
|
+
'', '', '', '',''
|
|
189
|
+
]
|
|
190
|
+
df_input.loc[len(df_input)] = [
|
|
191
|
+
'calculate',
|
|
192
|
+
'created_by_person_uuid',
|
|
193
|
+
*list(empty.values()) ,
|
|
194
|
+
*list(empty.values()) ,#hint
|
|
195
|
+
*list(empty.values()) ,#help
|
|
196
|
+
'',#default
|
|
197
|
+
'',#'appearance', clean_name
|
|
198
|
+
'',#'constraint',
|
|
199
|
+
*list(empty.values()) ,#'constraint_message'
|
|
200
|
+
'',#'relevance'
|
|
201
|
+
'',#'disabled'
|
|
202
|
+
'',#'required'
|
|
203
|
+
*list(empty.values()) ,#'required message'
|
|
204
|
+
'',#'read only'
|
|
205
|
+
'../inputs/user/contact_id',#'expression'
|
|
206
|
+
'',#'repeat_count'
|
|
207
|
+
'',#'image'
|
|
208
|
+
'' # choice filter
|
|
209
|
+
]
|
|
210
|
+
df_input.loc[len(df_input)] = [
|
|
211
|
+
'calculate',
|
|
212
|
+
'created_by_place_uuid_user',
|
|
213
|
+
*list(empty.values()) ,
|
|
214
|
+
*list(empty.values()) ,#hint
|
|
215
|
+
*list(empty.values()) ,#help
|
|
216
|
+
'',#default
|
|
217
|
+
'',#'appearance', clean_name
|
|
218
|
+
'',#'constraint',
|
|
219
|
+
*list(empty.values()) ,#'constraint_message'
|
|
220
|
+
'',#'relevance'
|
|
221
|
+
'',#'disabled'
|
|
222
|
+
'',#'required'
|
|
223
|
+
*list(empty.values()) ,#'required message'
|
|
224
|
+
'',#'read only'
|
|
225
|
+
'../inputs/user/facility_id',#'expression'
|
|
226
|
+
'',#'repeat_count'
|
|
227
|
+
'',#'image'
|
|
228
|
+
'' # choice filter
|
|
229
|
+
]
|
|
230
|
+
df_input.loc[len(df_input)] = [
|
|
231
|
+
'calculate',
|
|
232
|
+
'created_by',
|
|
233
|
+
*list(empty.values()) ,
|
|
234
|
+
*list(empty.values()) ,#hint
|
|
235
|
+
*list(empty.values()) ,#help
|
|
236
|
+
'',#default
|
|
237
|
+
'',#'appearance', clean_name
|
|
238
|
+
'',#'constraint',
|
|
239
|
+
*list(empty.values()) ,#'constraint_message'
|
|
240
|
+
'',#'relevance'
|
|
241
|
+
'',#'disabled'
|
|
242
|
+
'',#'required'
|
|
243
|
+
*list(empty.values()) ,#'required message'
|
|
244
|
+
'',#'read only'
|
|
245
|
+
'../inputs/user/name',#'expression'
|
|
246
|
+
'',#'repeat_count'
|
|
247
|
+
'',#'image'
|
|
248
|
+
'' # choice filter
|
|
249
|
+
]
|
|
250
|
+
df_input.loc[len(df_input)] = [
|
|
251
|
+
'calculate',
|
|
252
|
+
'created_by_place_uuid',
|
|
253
|
+
*list(empty.values()) ,
|
|
254
|
+
*list(empty.values()) ,#hint
|
|
255
|
+
*list(empty.values()) ,#help
|
|
256
|
+
'',#default
|
|
257
|
+
'',#'appearance', clean_name
|
|
258
|
+
'',#'constraint',
|
|
259
|
+
*list(empty.values()) ,#'constraint_message'
|
|
260
|
+
'',#'relevance'
|
|
261
|
+
'',#'disabled'
|
|
262
|
+
'',#'required'
|
|
263
|
+
*list(empty.values()) ,#'required message'
|
|
264
|
+
'',#'read only'
|
|
265
|
+
'../inputs/contact/_id',#'expression'
|
|
266
|
+
'',#'repeat_count'
|
|
267
|
+
'',#'image'
|
|
268
|
+
'' # choice filter
|
|
269
|
+
]
|
|
66
270
|
|
|
67
|
-
df_input.loc[len(df_input)] = [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
271
|
+
df_input.loc[len(df_input)] = [
|
|
272
|
+
'calculate',
|
|
273
|
+
'source_id',
|
|
274
|
+
*list(empty.values()) ,
|
|
275
|
+
*list(empty.values()) ,#hint
|
|
276
|
+
*list(empty.values()) ,#help
|
|
277
|
+
'',#default
|
|
278
|
+
'',#'appearance', clean_name
|
|
279
|
+
'',#'constraint',
|
|
280
|
+
*list(empty.values()) ,#'constraint_message'
|
|
281
|
+
'',#'relevance'
|
|
282
|
+
'',#'disabled'
|
|
283
|
+
'',#'required'
|
|
284
|
+
*list(empty.values()) ,#'required message'
|
|
285
|
+
'',#'read only'
|
|
286
|
+
'../inputs/source_id',#'expression'
|
|
287
|
+
'',#'repeat_count'
|
|
288
|
+
'',#'image'
|
|
289
|
+
'' # choice filter
|
|
290
|
+
]
|
|
291
|
+
df_input.loc[len(df_input)] = [
|
|
292
|
+
'calculate',
|
|
293
|
+
'patient_uuid',
|
|
294
|
+
*list(empty.values()) ,
|
|
295
|
+
*list(empty.values()) ,#hint
|
|
296
|
+
*list(empty.values()) ,#help
|
|
297
|
+
'',#default
|
|
298
|
+
'',#'appearance', clean_name
|
|
299
|
+
'',#'constraint',
|
|
300
|
+
*list(empty.values()) ,#'constraint_message'
|
|
301
|
+
'',#'relevance'
|
|
302
|
+
'',#'disabled'
|
|
303
|
+
'',#'required'
|
|
304
|
+
*list(empty.values()) ,#'required message'
|
|
305
|
+
'',#'read only'
|
|
306
|
+
'../inputs/user/facility_id',#'expression'
|
|
307
|
+
'',#'repeat_count'
|
|
308
|
+
'',#'image'
|
|
309
|
+
'' # choice filter
|
|
310
|
+
]
|
|
311
|
+
df_input.loc[len(df_input)] = [
|
|
312
|
+
'string', 'data_load',
|
|
313
|
+
*list(langs.get_trads('NO_LABEL', force_dict = True).values()),
|
|
314
|
+
*list(empty.values()),
|
|
315
|
+
*list(empty.values()),
|
|
316
|
+
'', 'hidden', '',
|
|
317
|
+
*list(empty.values()),
|
|
318
|
+
'', '','',
|
|
319
|
+
*list(empty.values())
|
|
320
|
+
,'', '', '', '' ,''
|
|
321
|
+
]
|
|
322
|
+
|
|
323
|
+
for input in inputs:
|
|
324
|
+
df_input.loc[len(df_input)] = get_input_calc_line(input)
|
|
325
|
+
|
|
326
|
+
|
|
327
|
+
|
|
328
|
+
return df_input
|
|
329
|
+
|
|
330
|
+
def get_contact_inputs(self, df_input):
|
|
331
|
+
empty = langs.get_trads('', force_dict =True)
|
|
72
332
|
|
|
333
|
+
df_input.loc[len(df_input)] = [
|
|
334
|
+
'calculate', 'patient_sex',
|
|
335
|
+
*list(langs.get_trads('Sex', force_dict = True).values()),
|
|
336
|
+
*list(empty.values()),
|
|
337
|
+
*list(empty.values()),
|
|
338
|
+
'', 'hidden', '',
|
|
339
|
+
*list(empty.values()),
|
|
340
|
+
'', '','',
|
|
341
|
+
*list(empty.values())
|
|
342
|
+
,'', '../inputs/contact/sex', '', '' ,''
|
|
343
|
+
]
|
|
344
|
+
df_input.loc[len(df_input)] = [
|
|
345
|
+
'calculate', 'patient_dob',
|
|
346
|
+
*list(langs.get_trads('Date of birth', force_dict = True).values()),
|
|
347
|
+
*list(empty.values()),
|
|
348
|
+
*list(empty.values()),
|
|
349
|
+
'', 'hidden', '',
|
|
350
|
+
*list(empty.values()),
|
|
351
|
+
'', '','',
|
|
352
|
+
*list(empty.values())
|
|
353
|
+
,'', 'date(../inputs/contact/date_of_birth)', '', '' ,''
|
|
354
|
+
]
|
|
73
355
|
|
|
74
356
|
return df_input
|
|
75
357
|
|
|
@@ -117,7 +399,7 @@ class XLSFormCHTStrategy(XLSFormCDSSStrategy):
|
|
|
117
399
|
# pause
|
|
118
400
|
ends = []
|
|
119
401
|
for p in self.project.pages.values():
|
|
120
|
-
p_ends = list(filter(lambda x: issubclass(x.__class__, TriccNodeEnd) and getattr(x, '
|
|
402
|
+
p_ends = list(filter(lambda x: issubclass(x.__class__, TriccNodeEnd) and getattr(x, 'process', '') == 'pause', p.nodes.values() ))
|
|
121
403
|
if p_ends:
|
|
122
404
|
ends += p_ends
|
|
123
405
|
if ends:
|