-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmrcm-menu.sh
executable file
·70 lines (59 loc) · 1.69 KB
/
mrcm-menu.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/bash
set -e
function findEffectiveTime() {
searchDir=$1
ls -1 ${searchDir}/sct2*Sta*Sn* | sed 's/.*\([0-9]\{8\}\).*/\1/'
}
while getopts ":dsp:" opt
do
case $opt in
d)
debugMode=true
echo "Option set to start API in debug mode."
debugFlags="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 -Djava.compiler=NONE"
;;
s)
skipMode=true
echo "Option set to skip build."
;;
help|\?)
echo -e "Usage: [-d] [-p <port>]"
echo -e "\t d - debug. Starts the program in debug mode, which an IDE can attach to on port 8000"
echo -e "\t s - skip. Skips the build"
exit 0
;;
esac
done
echo
echo "Interactive MRCM"
echo
default="/Users/Peter/tmp/20150731_flat"
read -p "Where are your snapshot SNOMED files (? [${default}] " sourceDir
if [ -z "${sourceDir}" ]
then
sourceDir=${default}
fi
effectiveTime=$(findEffectiveTime ${sourceDir})
if [ -z "${effectiveTime}" ]
then
echo "Failed to find Stated Relationship file with effective time"
exit -1
fi
echo "Loading files from ${sourceDir} with effective time ${effectiveTime}"
if [ -z "${skipMode}" ]
then
mvn clean install -P stand-alone
fi
executable=`ls -1 target/uber*.jar`
if [ -z "${executable}" ]
then
echo "Failed to find executable jar in target directory"
exit -1
fi
#set -x;
today=`date +%Y%m%d`
java -Xms4g -Xmx5g -enableassertions -classpath ${executable} org.ihtsdo.snomed.util.mrcm.MrcmInteractiveMenu \
${sourceDir}/sct2_Concept_Snapshot_INT_${effectiveTime}.txt \
${sourceDir}/sct2_StatedRelationship_Snapshot_INT_${effectiveTime}.txt \
${sourceDir}/sct2_Relationship_Snapshot_INT_${effectiveTime}.txt \
${sourceDir}/sct2_Description_Snapshot-en_INT_${effectiveTime}.txt