Skip to content

Commit 8130f83

Browse files
committed
Make Measure Evaluation Async per Default
Closes: #29
1 parent b6aacd3 commit 8130f83

File tree

5 files changed

+176
-36
lines changed

5 files changed

+176
-36
lines changed

README.md

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66
blazectl is a command line tool to control your FHIR® server. blazectl also works with [Blaze][4].
77

8-
Currently, you can upload transaction bundles from a directory, download and count resources.
8+
Currently, you can do the following:
9+
10+
* upload transaction bundles from a directory
11+
* download resources in NDJSON format
12+
* count all resources by type
13+
* evaluate a measure
914

1015
## Installation
1116

@@ -15,104 +20,103 @@ blazectl is written in Go. All you need is a single binary which is available fo
1520

1621
1. Download the latest release with the command:
1722

18-
```bash
23+
```sh
1924
curl -LO https://github.com/samply/blazectl/releases/download/v0.14.0/blazectl-0.14.0-linux-amd64.tar.gz
2025
```
2126

2227
1. Untar the binary:
2328

24-
```bash
29+
```sh
2530
tar xzf blazectl-0.14.0-linux-amd64.tar.gz
2631
```
2732

2833
1. Move the binary in to your PATH.
2934

30-
```bash
35+
```sh
3136
sudo mv ./blazectl /usr/local/bin/blazectl
3237
```
3338

3439
1. Test to ensure the version you installed is up-to-date:
3540

36-
```bash
41+
```sh
3742
blazectl --version
3843
```
3944

4045
### macOS - Intel
4146

4247
1. Download the latest release with the command:
4348

44-
```bash
49+
```sh
4550
curl -LO https://github.com/samply/blazectl/releases/download/v0.14.0/blazectl-0.14.0-darwin-amd64.tar.gz
4651
```
4752

4853
1. Untar the binary:
4954

50-
```bash
55+
```sh
5156
tar xzf blazectl-0.14.0-darwin-amd64.tar.gz
5257
```
5358

5459
1. Move the binary in to your PATH.
5560

56-
```bash
61+
```sh
5762
sudo mv ./blazectl /usr/local/bin/blazectl
5863
```
5964

6065
1. Test to ensure the version you installed is up-to-date:
6166

62-
```bash
67+
```sh
6368
blazectl --version
6469
```
6570

66-
6771
### macOS - Apple Silicon
6872

6973
1. Download the latest release with the command:
7074

71-
```bash
75+
```sh
7276
curl -LO https://github.com/samply/blazectl/releases/download/v0.14.0/blazectl-0.14.0-darwin-arm64.tar.gz
7377
```
7478

7579
1. Untar the binary:
7680

77-
```bash
81+
```sh
7882
tar xzf blazectl-0.14.0-darwin-arm64.tar.gz
7983
```
8084

8185
1. Move the binary in to your PATH.
8286

83-
```bash
87+
```sh
8488
sudo mv ./blazectl /usr/local/bin/blazectl
8589
```
8690

8791
1. Test to ensure the version you installed is up-to-date:
8892

89-
```bash
93+
```sh
9094
blazectl --version
9195
```
9296

9397
### Linux - arm64
9498

9599
1. Download the latest release with the command:
96100

97-
```bash
101+
```sh
98102
curl -LO https://github.com/samply/blazectl/releases/download/v0.14.0/blazectl-0.14.0-linux-arm64.tar.gz
99103
```
100104

101105
1. Untar the binary:
102106

103-
```bash
107+
```sh
104108
tar xzf blazectl-0.14.0-linux-arm64.tar.gz
105109
```
106110

107111
1. Move the binary in to your PATH.
108112

109-
```bash
113+
```sh
110114
sudo mv ./blazectl /usr/local/bin/blazectl
111115
```
112116

113117
1. Test to ensure the version you installed is up-to-date:
114118

115-
```bash
119+
```sh
116120
blazectl --version
117121
```
118122

@@ -129,11 +133,10 @@ blazectl is written in Go. All you need is a single binary which is available fo
129133
```
130134
blazectl --version
131135
```
132-
136+
133137
## Usage
134138

135139
```
136-
$ blazectl
137140
blazectl is a command line tool to control your FHIR® server.
138141
139142
Currently you can upload transaction bundles from a directory, download
@@ -169,8 +172,8 @@ You can use the upload command to upload transaction bundles to your server. Cur
169172

170173
Assuming the URL of your FHIR server is `http://localhost:8080/fhir`, in order to upload run:
171174

172-
```bash
173-
blazectl --server http://localhost:8080/fhir upload my/bundles
175+
```sh
176+
blazectl upload --server http://localhost:8080/fhir my/bundles
174177
```
175178

176179
You will see a progress bar with an estimated ETA during upload. After the upload, a statistic inspired by [vegeta][6] will be printed:
@@ -205,19 +208,22 @@ You can use the download command to download bundles from the server. Downloaded
205208
Use the download command as follows:
206209

207210
```sh
208-
blazectl --server http://localhost:8080/fhir download Patient \
211+
blazectl download --server http://localhost:8080/fhir Patient \
209212
--query "gender=female" \
210213
--output-file ~/Downloads/Patients.ndjson
211214
```
212215

213-
Next to the mandatory FHIR resource type you can also optionally specify a valid FHIR search query to limit downloaded resources. The query must not start with a `?` char.
216+
If the optional resource-type is given, the corresponding type-level search will be used. Otherwise, the system-level search will be used and all resources of the whole system will be downloaded.
217+
218+
The --query flag will take an optional FHIR search query that will be used to constrain the resources to download.
214219

215220
With the flag --use-post you can ensure that the FHIR search query specified with --query is send as POST request in the body.
216221

217-
Using POST can have two benefits, first if the query string is too large for URL's, it will still fir in the body. Second if the query string contains sensitive information like IDAT's it will be less likely end up in log files, because URL's are often logged but bodies not.
222+
Using POST can have two benefits, first if the query string is too large for URL's, it will still fine in the body. Second if the query string contains sensitive information like IDAT's it will be less likely end up in log files, because URL's are often logged but bodies not.
218223

219224
The next links are still traversed with GET. The FHIR server is supposed to not expose any sensitive query params in the URL and also keep the URL short enough.
220225

226+
Resources will be either streamed to STDOUT, delimited by newline, or stored in a file if the --output-file flag is given.
221227

222228
As soon as the download has finished you will be shown a download statistics overview that looks something like this:
223229

@@ -247,8 +253,8 @@ The count-resources command is useful to see how many resources a FHIR server st
247253

248254
You can run:
249255

250-
```bash
251-
blazectl --server http://localhost:8080/fhir count-resources
256+
```sh
257+
blazectl count-resources --server http://localhost:8080/fhir
252258
```
253259

254260
It will return:
@@ -275,6 +281,18 @@ Practitioner : 52647
275281
Procedure : 418310
276282
```
277283

284+
### Evaluate Measure
285+
286+
Given a measure in YAML form, creates the required FHIR resources, evaluates that measure and returns the measure report.
287+
288+
You can run:
289+
290+
```sh
291+
blazectl evaluate-measure --server "http://localhost:8080/fhir" stratifier-condition-code.yml
292+
```
293+
294+
A more comprehensive documentation can be found in the [Blaze CQL Queries Documentation][9].
295+
278296
## Similar Software
279297

280298
* [VonkLoader][1] - can also upload transaction bundles but needs .NET SDK
@@ -298,3 +316,4 @@ Unless required by applicable law or agreed to in writing, software distributed
298316
[6]: <https://github.com/tsenart/vegeta>
299317
[7]: <https://en.wikipedia.org/wiki/Gzip>
300318
[8]: <https://en.wikipedia.org/wiki/Bzip2>
319+
[9]: <https://github.com/samply/blaze/blob/master/docs/cql-queries/blazectl.md>

cmd/download.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -270,23 +270,26 @@ var resourceTypes = []string{
270270

271271
var downloadCmd = &cobra.Command{
272272
Use: "download [resource-type]",
273-
Short: "Download FHIR resources in NDJSON format",
274-
Long: `Downloads FHIR resources using FHIR search, extracts the resources from
273+
Short: "Download resources in NDJSON format",
274+
Long: `Downloads resources using FHIR search, extracts the resources from
275275
the returned bundles and outputs one resource per line in NDJSON format.
276276
277277
If the optional resource-type is given, the corresponding type-level
278-
search will be used. Otherwise the system-level search will be used and
278+
search will be used. Otherwise, the system-level search will be used and
279279
all resources of the whole system will be downloaded.
280280
281-
The --query flag will take an optional FHIR search query that will used
281+
The --query flag will take an optional FHIR search query that will be used
282282
to constrain the resources to download.
283283
284+
With the flag --use-post you can ensure that the FHIR search query specified
285+
with --query is send as POST request in the body.
286+
284287
Resources will be either streamed to STDOUT, delimited by newline, or
285288
stored in a file if the --output-file flag is given.
286289
287290
Examples:
288-
blazectl download --server http://localhost:8080/fhir Patient > patient.ndjson
289-
blazectl download --server http://localhost:8080/fhir Patient -q "gender=female" -o patient.ndjson
291+
blazectl download --server http://localhost:8080/fhir Patient > all-patients.ndjson
292+
blazectl download --server http://localhost:8080/fhir Patient -q "gender=female" -o female-patients.ndjson
290293
blazectl download --server http://localhost:8080/fhir > all-resources.ndjson`,
291294
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
292295
return resourceTypes, cobra.ShellCompDirectiveNoFileComp

0 commit comments

Comments
 (0)