Integrate longitudinal high-dimensional data in a data warehouse using the git commit graph to store temporal information and git annex to store large data in a content-addressable fashion.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- #!/bin/bash
-
- function _completions
- {
- #1 : command
- #2 : current word
- #3 : previous word
- #COMP_WORDS = array of words typed after the name of the program
- #COMP_CWORD = index pointing to the word the cursor is at
- #COMP_LINE = the current command line
- local cur prev words cword
- # _get_comp_words_by_ref -n : cur
- _init_completion -n :
-
- local IFS=$' \t\n'
- local OPTIONS
- local PATIENT
- if [[ "$cword" -eq 1 ]];then
- OPTIONS="add list get"
- elif [[ "$cword" -eq 2 ]];then
- local VERB="${words[1]}"
- case $VERB in
- list) OPTIONS="all " ;&
- add) OPTIONS+="patient sample data result diagnosis" ;;
- get) OPTIONS="prov graph timeline last sparql log file object" ;;
- esac
- elif [[ "$cword" -gt 2 ]];then
- local VERB="${words[1]}"
- local OBJECT="${words[2]}"
-
- if [[ "$COMP_LINE" =~ (-p|--patient)[[:space:]]+([^ ]*) ]];then
- PATIENT="${BASH_REMATCH[2]}"
- fi
-
- case $VERB in
- add)
- case $OBJECT in
- diagnosis|result) OPTIONS+="--use " ;&
- data) OPTIONS+="--revision_of --invalidate " ;&
- sample) OPTIONS+="--patient " ;&
- patient) OPTIONS+="--id --method --provider --date --message ";;
- esac
-
- if [[ $OBJECT == "data" || $OBJECT == "result" ]];then
- OPTIONS+="--sample $(ls)"
- fi
- ;;
- list)
- if [[ $OBJECT != "patient" ]];then
- if [[ "$PATIENT" ]];then
- OPTIONS="$(git ommix list all --patient $PATIENT)"
- else
- OPTIONS="--patient "
- fi
- fi
- ;;
- get)
- if [[ "$PATIENT" ]];then
- OPTIONS="$(git ommix list all --patient $PATIENT) "
- else
- OPTIONS="--patient "
- fi
- ;;
- esac
-
- case "$prev" in
- -p|--patient) OPTIONS="$(git ommix list patient)" ;;
- -s|--sample) OPTIONS="$(git ommix list sample --patient $PATIENT)" ;;
- --use) if [[ "$OBJECT" == "result" ]];then
- OPTIONS="$(git ommix list data --patient $PATIENT)"
- elif [[ "$OBJECT" == "diagnosis" ]];then
- OPTIONS="$(git ommix list result --patient $PATIENT)
- $(git ommix list diagnosis --patient $PATIENT)"
- fi ;;
- --invalidate|--revision_of) OPTIONS="$(git ommix list $OBJECT --patient $PATIENT)" ;;
- esac
- fi
-
- COMPREPLY=($(compgen -W "$OPTIONS" -- "$cur"))
-
- __ltrim_colon_completions "$cur"
- }
-
- complete -F _completions git-ommix
|