Skip to content

Commit 9ee804f

Browse files
committed
Add Basic Evaluate Measure Functionality
1 parent c8dc01d commit 9ee804f

File tree

11 files changed

+365
-34
lines changed

11 files changed

+365
-34
lines changed

DEVELOPMENT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ go get github.com/vbauerster/mpb/v7
2121
## Build Releases
2222

2323
```sh
24-
VERSION=0.10.1 ./build-releases.sh
24+
VERSION=0.11.0 ./build-releases.sh
2525
```

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ blazectl is written in Go. All you need is a single binary which is available fo
1616
1. Download the latest release with the command:
1717

1818
```bash
19-
curl -LO https://github.com/samply/blazectl/releases/download/v0.10.1/blazectl-0.10.1-linux-amd64.tar.gz
19+
curl -LO https://github.com/samply/blazectl/releases/download/v0.11.0/blazectl-0.11.0-linux-amd64.tar.gz
2020
```
2121

2222
1. Untar the binary:
2323

2424
```bash
25-
tar xzf blazectl-0.10.1-linux-amd64.tar.gz
25+
tar xzf blazectl-0.11.0-linux-amd64.tar.gz
2626
```
2727

2828
1. Move the binary in to your PATH.
@@ -42,13 +42,13 @@ blazectl is written in Go. All you need is a single binary which is available fo
4242
1. Download the latest release with the command:
4343

4444
```bash
45-
curl -LO https://github.com/samply/blazectl/releases/download/v0.10.1/blazectl-0.10.1-darwin-amd64.tar.gz
45+
curl -LO https://github.com/samply/blazectl/releases/download/v0.11.0/blazectl-0.11.0-darwin-amd64.tar.gz
4646
```
4747

4848
1. Untar the binary:
4949

5050
```bash
51-
tar xzf blazectl-0.10.1-darwin-amd64.tar.gz
51+
tar xzf blazectl-0.11.0-darwin-amd64.tar.gz
5252
```
5353

5454
1. Move the binary in to your PATH.
@@ -69,13 +69,13 @@ blazectl is written in Go. All you need is a single binary which is available fo
6969
1. Download the latest release with the command:
7070

7171
```bash
72-
curl -LO https://github.com/samply/blazectl/releases/download/v0.10.1/blazectl-0.10.1-darwin-arm64.tar.gz
72+
curl -LO https://github.com/samply/blazectl/releases/download/v0.11.0/blazectl-0.11.0-darwin-arm64.tar.gz
7373
```
7474

7575
1. Untar the binary:
7676

7777
```bash
78-
tar xzf blazectl-0.10.1-darwin-arm64.tar.gz
78+
tar xzf blazectl-0.11.0-darwin-arm64.tar.gz
7979
```
8080

8181
1. Move the binary in to your PATH.
@@ -95,13 +95,13 @@ blazectl is written in Go. All you need is a single binary which is available fo
9595
1. Download the latest release with the command:
9696

9797
```bash
98-
curl -LO https://github.com/samply/blazectl/releases/download/v0.10.1/blazectl-0.10.1-linux-arm64.tar.gz
98+
curl -LO https://github.com/samply/blazectl/releases/download/v0.11.0/blazectl-0.11.0-linux-arm64.tar.gz
9999
```
100100

101101
1. Untar the binary:
102102

103103
```bash
104-
tar xzf blazectl-0.10.1-linux-arm64.tar.gz
104+
tar xzf blazectl-0.11.0-linux-arm64.tar.gz
105105
```
106106

107107
1. Move the binary in to your PATH.
@@ -136,17 +136,19 @@ blazectl is written in Go. All you need is a single binary which is available fo
136136
$ blazectl
137137
blazectl is a command line tool to control your FHIR® server.
138138
139-
Currently you can upload transaction bundles from a directory, download and count resources.
139+
Currently you can upload transaction bundles from a directory, download
140+
and count resources and evaluate measures.
140141
141142
Usage:
142143
blazectl [command]
143144
144145
Available Commands:
145-
completion Generate the autocompletion script for the specified shell
146-
count-resources Counts all resources by type
147-
download Download FHIR resources into an NDJSON file
148-
help Help about any command
149-
upload Upload transaction bundles
146+
completion Generate the autocompletion script for the specified shell
147+
count-resources Counts all resources by type
148+
download Download FHIR resources into an NDJSON file
149+
evaluate-measure Evaluates a Measure
150+
help Help about any command
151+
upload Upload transaction bundles
150152
151153
Flags:
152154
-h, --help help for blazectl
@@ -288,7 +290,7 @@ Unless required by applicable law or agreed to in writing, software distributed
288290

289291
[1]: <http://docs.simplifier.net/vonkloader/>
290292
[2]: <https://github.com/synthetichealth/uploader>
291-
[3]: <https://github.com/samply/blazectl/releases/download/v0.10.1/blazectl-0.10.1-windows-amd64.zip>
293+
[3]: <https://github.com/samply/blazectl/releases/download/v0.11.0/blazectl-0.11.0-windows-amd64.zip>
292294
[4]: <https://github.com/samply/blaze>
293295
[5]: <https://github.com/synthetichealth/synthea>
294296
[6]: <https://github.com/tsenart/vegeta>

cmd/download.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
fm "github.com/samply/golang-fhir-models/fhir-models/fhir"
2626
"github.com/spf13/cobra"
2727
"io"
28-
"io/ioutil"
2928
"net/http"
3029
"net/http/httptrace"
3130
"net/url"
@@ -400,7 +399,7 @@ func downloadResources(client *fhir.Client, resourceType string, fhirSearchQuery
400399
}
401400

402401
if response.StatusCode != http.StatusOK {
403-
responseBody, err := ioutil.ReadAll(response.Body)
402+
responseBody, err := io.ReadAll(response.Body)
404403
if err != nil {
405404
resChannel <- downloadBundleError("request to FHIR server with URL %s had a non-ok response status (%d) but its body could not be read: %v",
406405
request.URL, response.StatusCode, err)
@@ -428,7 +427,7 @@ func downloadResources(client *fhir.Client, resourceType string, fhirSearchQuery
428427
return
429428
}
430429

431-
responseBody, err := ioutil.ReadAll(response.Body)
430+
responseBody, err := io.ReadAll(response.Body)
432431
if err != nil {
433432
resChannel <- downloadBundleError("could not read FHIR server response after request to URL %s: %v\n", request.URL, err)
434433
return

cmd/download_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import (
2121
"github.com/samply/blazectl/fhir"
2222
fm "github.com/samply/golang-fhir-models/fhir-models/fhir"
2323
"github.com/stretchr/testify/assert"
24-
"io/ioutil"
24+
"io"
2525
"net"
2626
"net/http"
2727
"net/http/httptest"
@@ -310,7 +310,7 @@ func TestDownloadResources(t *testing.T) {
310310

311311
func TestWriteResource(t *testing.T) {
312312
t.Run("EmptyRawData", func(t *testing.T) {
313-
resources, outcomes, err := writeResources(&[]byte{}, ioutil.Discard)
313+
resources, outcomes, err := writeResources(&[]byte{}, io.Discard)
314314

315315
assert.Nil(t, err)
316316
assert.Equal(t, 0, resources)
@@ -319,7 +319,7 @@ func TestWriteResource(t *testing.T) {
319319

320320
t.Run("InvalidBundleData", func(t *testing.T) {
321321
invalidData := []byte("{\"invalid\": \"data\"}")
322-
resources, outcomes, err := writeResources(&invalidData, ioutil.Discard)
322+
resources, outcomes, err := writeResources(&invalidData, io.Discard)
323323

324324
assert.NotNil(t, err)
325325
assert.Equal(t, 0, resources)
@@ -336,7 +336,7 @@ func TestWriteResource(t *testing.T) {
336336
}
337337

338338
bundleRawJSON, _ := json.Marshal([]fm.BundleEntry{bundle})
339-
resources, outcomes, err := writeResources(&bundleRawJSON, ioutil.Discard)
339+
resources, outcomes, err := writeResources(&bundleRawJSON, io.Discard)
340340

341341
assert.Nil(t, err)
342342
assert.Equal(t, 1, resources)
@@ -362,7 +362,7 @@ func TestWriteResource(t *testing.T) {
362362
}
363363

364364
bundleRawJSON, _ := json.Marshal([]fm.BundleEntry{bundle})
365-
resources, outcomes, err := writeResources(&bundleRawJSON, ioutil.Discard)
365+
resources, outcomes, err := writeResources(&bundleRawJSON, io.Discard)
366366

367367
assert.Nil(t, err)
368368
assert.Equal(t, 0, resources)
@@ -384,7 +384,7 @@ func TestWriteResource(t *testing.T) {
384384
}
385385

386386
bundleRawJSON, _ := json.Marshal([]fm.BundleEntry{bundleA, bundleB})
387-
resources, outcomes, err := writeResources(&bundleRawJSON, ioutil.Discard)
387+
resources, outcomes, err := writeResources(&bundleRawJSON, io.Discard)
388388

389389
assert.Nil(t, err)
390390
assert.Equal(t, 2, resources)
@@ -415,7 +415,7 @@ func TestWriteResource(t *testing.T) {
415415
}
416416

417417
bundleRawJSON, _ := json.Marshal([]fm.BundleEntry{bundleA, bundleB})
418-
resources, outcomes, err := writeResources(&bundleRawJSON, ioutil.Discard)
418+
resources, outcomes, err := writeResources(&bundleRawJSON, io.Discard)
419419

420420
assert.Nil(t, err)
421421
assert.Equal(t, 1, resources)

0 commit comments

Comments
 (0)