Commit 33c79efc authored by Mathieu Giraud's avatar Mathieu Giraud Committed by Vidjil Team

scripts/links.py: option -c, filter on patient creator id

parent 7c0e6e5c
......@@ -11,6 +11,7 @@ parser.add_argument('--results', '-r', action='store_true', help='link results
parser.add_argument('--diag', '-d', action='store_true', help='link only diagnosis results (first sample per patient)')
parser.add_argument('--analysis', '-a', action='store_true', help='link analysis files (last file per patient)')
parser.add_argument('--filter', '-f', type=str, default='', help='filter on patient name or info (%(default)s), only for -s or -d')
parser.add_argument('--creator', '-c', type=int, default=0, help='filter on patient creator id, only for -s or -d')
parser.add_argument('--raw', '-w', action='store_true', help='do not link, only display the list of raw files')
args = parser.parse_args()
......@@ -34,6 +35,10 @@ if args.sequences:
if not vidjil_utils.advanced_filter([res.patient.first_name,res.patient.last_name,res.patient.info], args.filter):
continue
if args.creator:
if res.patient.creator != args.creator:
continue
our_id += 1
link("%s/%-20s" % (defs.DIR_SEQUENCES, res.sequence_file.data_file),
......@@ -70,6 +75,10 @@ def last_result_by_first_point_by_patient():
if not vidjil_utils.advanced_filter([res.patient.first_name,res.patient.last_name,res.patient.info], args.filter):
continue
if args.creator:
if res.patient.creator != args.creator:
continue
# Remeber only the first element
if not str(res.patient.id) in res_by_pat:
res_by_pat[str(res.patient.id)] = (res, res.sequence_file)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment