1
1
#! /bin/sh
2
2
3
+ log_file=" /etc/lantern/populatedb_logs.txt"
4
+ current_datetime=$( date +" %Y-%m-%d %H:%M:%S" )
5
+
3
6
set -e
4
7
5
8
# get endpoint data
6
9
cd cmd/endpointpopulator
7
10
8
11
# Populates the database with State Medicaid endpoints
9
- go run main.go /etc/lantern/resources/MedicaidState_EndpointSources.json Lantern StateMedicaid false StateMedicaid
12
+ go run main.go /etc/lantern/resources/MedicaidState_EndpointSources.json Lantern StateMedicaid false StateMedicaid >> $log_file 2>&1
10
13
11
14
jq -c ' .[]' /etc/lantern/resources/MedicareStateEndpointResourcesList.json | while read endpoint; do
12
15
NAME=$( echo $endpoint | jq -c -r ' .EndpointName' )
@@ -15,7 +18,7 @@ jq -c '.[]' /etc/lantern/resources/MedicareStateEndpointResourcesList.json | whi
15
18
LISTURL=$( echo $endpoint | jq -c -r ' .URL' )
16
19
17
20
if [ -f " /etc/lantern/resources/$FILENAME " ]; then
18
- go run main.go /etc/lantern/resources/$FILENAME $FORMAT " ${NAME} " true $LISTURL
21
+ go run main.go /etc/lantern/resources/$FILENAME $FORMAT " ${NAME} " true $LISTURL >> $log_file 2>&1
19
22
fi
20
23
done
21
24
@@ -25,7 +28,7 @@ jq -c '.[]' /etc/lantern/resources/EndpointResourcesList.json | while read endpo
25
28
FILENAME=$( echo $endpoint | jq -c -r ' .FileName' )
26
29
LISTURL=$( echo $endpoint | jq -c -r ' .URL' )
27
30
28
- go run main.go /etc/lantern/resources/$FILENAME $FORMAT $NAME false $LISTURL
31
+ go run main.go /etc/lantern/resources/$FILENAME $FORMAT $NAME false $LISTURL >> $log_file 2>&1
29
32
done
30
33
31
34
jq -c ' .[]' /etc/lantern/resources/CHPLEndpointResourcesList.json | while read endpoint; do
@@ -35,7 +38,7 @@ jq -c '.[]' /etc/lantern/resources/CHPLEndpointResourcesList.json | while read e
35
38
LISTURL=$( echo $endpoint | jq -c -r ' .URL' )
36
39
37
40
if [ -f " /etc/lantern/resources/$FILENAME " ]; then
38
- go run main.go /etc/lantern/resources/$FILENAME $FORMAT " ${NAME} " true $LISTURL
41
+ go run main.go /etc/lantern/resources/$FILENAME $FORMAT " ${NAME} " true $LISTURL >> $log_file 2>&1
39
42
fi
40
43
done
41
44
46
49
47
50
# get CHPL info into db
48
51
cd chplquerier
49
- go run main.go
52
+ go run main.go >> $log_file 2>&1
50
53
cd ..
51
54
52
55
# get NPPES contact (endpoint) pfile into db
64
67
65
68
# run data validation to ensure number of endpoints does not exceed maximum for query interval
66
69
cd datavalidation
67
- go run main.go
70
+ go run main.go >> $log_file 2>&1
68
71
cd ..
0 commit comments