@@ -60,9 +60,9 @@ def __getattr__(self, name):
60
60
# pass all attributes on to underlying table
61
61
return getattr (self ._table , name )
62
62
63
- @classmethod
64
- def REQUIRED_FIELDS (cls ):
65
- return list (cls .DEFAULT_MAPPING .keys ())
63
+ @property
64
+ def REQUIRED_FIELDS (self ):
65
+ return list (self .DEFAULT_MAPPING .keys ())
66
66
67
67
@property
68
68
def table (self ):
@@ -240,13 +240,13 @@ class PhenotypeTable(PhenexTable):
240
240
KNOWN_FIELDS = [
241
241
'PERSON_ID' ,
242
242
'BOOLEAN' ,
243
- 'DATE ' ,
243
+ 'EVENT_DATE ' ,
244
244
'VALUE'
245
245
]
246
246
DEFAULT_MAPPING = {
247
247
'PERSON_ID' : "PERSON_ID" ,
248
248
"BOOLEAN" : "BOOLEAN" ,
249
- "DATE " : "DATE " ,
249
+ "EVENT_DATE " : "EVENT_DATE " ,
250
250
"VALUE" : "VALUE"
251
251
}
252
252
@@ -256,35 +256,42 @@ def is_phenex_person_table(table: PhenexTable) -> bool:
256
256
Check if given table is a person table.
257
257
One could check one row per patient?
258
258
"""
259
- return set (table .columns ) >= set (PhenexPersonTable .REQUIRED_FIELDS )
260
-
259
+ return True
261
260
262
261
def is_phenex_code_table (table : PhenexTable ) -> bool :
263
262
"""
264
263
Check if given table is a code table.
265
264
"""
265
+ return True
266
+
266
267
return set (table .columns ) >= set (CodeTable .REQUIRED_FIELDS )
267
268
268
269
269
270
def is_phenex_event_table (table : PhenexTable ) -> bool :
270
271
"""
271
272
Check if given table is a code table.
272
273
"""
274
+ return True
275
+
273
276
return set (table .columns ) >= set (EventTable .REQUIRED_FIELDS )
274
277
275
278
276
279
def is_phenex_phenotype_table (table : PhenexTable ) -> bool :
277
280
"""
278
281
Check if given table is a code table.
279
282
"""
283
+ return True
284
+
280
285
return set (table .columns ) >= set (PhenotypeTable .REQUIRED_FIELDS )
281
286
282
287
283
288
def is_phenex_index_table (table : PhenexTable ) -> bool :
284
289
"""
285
290
Check if given table is a code table.
286
291
"""
292
+ return True
293
+
287
294
return isinstance (table , PhenexIndexTable )
288
295
289
296
290
- PHENOTYPE_TABLE_COLUMNS = PhenotypeTable . REQUIRED_FIELDS
297
+ PHENOTYPE_TABLE_COLUMNS = [ "PERSON_ID" , "BOOLEAN" , "EVENT_DATE" , "VALUE" ]
0 commit comments