-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathload-cqf-ruler.sh
executable file
·55 lines (44 loc) · 1.47 KB
/
load-cqf-ruler.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
#!/bin/bash
if [ -z "$1" ]
then
echo 'Usage: ./load-cqf-ruler.sh <measure-directory>';
exit 1;
fi
cd $1
BASE_URL="http://localhost:8080/cqf-ruler-r4/fhir"
OUTPUT_DIR="patients-r4"
# In the event that there are multiple results output folders,
# just use the most recent one
# OUTPUT_DIR="$OUTPUT_DIR/output/$(ls -t $OUTPUT_DIR/output | head -1)"
echo "Using directory $OUTPUT_DIR"
check_success() {
if [ $? -ne 0 ]
then
echo "Error.. aborting"
exit 1
fi
}
curl -s -o /dev/null -w "%{http_code}\n" -X POST -H "Content-Type: application/json" --data @$OUTPUT_DIR/population-measure-report.json "$BASE_URL/MeasureReport"
check_success
echo 'Posting ipop patients for:' "$OUTPUT_DIR"
for bundle in ./$OUTPUT_DIR/ipop/*.json;
do
echo 'Posting bundle': "$bundle";
curl -s -o /dev/null -w "%{http_code}\n" -X POST -H "Content-Type: application/json" --data @$bundle $BASE_URL
check_success
done
echo 'Posting numerator patients for:' "$OUTPUT_DIR"
for bundle in ./$OUTPUT_DIR/numerator/*.json;
do
echo 'Posting bundle': "$bundle";
curl -s -o /dev/null -w "%{http_code}\n" -X POST -H "Content-Type: application/json" --data @$bundle $BASE_URL
check_success
done
echo 'Posting denominator patients for:' "$OUTPUT_DIR"
for bundle in ./$OUTPUT_DIR/denominator/*.json;
do
echo 'Posting bundle': "$bundle";
curl -s -o /dev/null -w "%{http_code}\n" -X POST -H "Content-Type: application/json" --data @$bundle $BASE_URL
check_success
done
echo 'Done'