Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lint:
golangci-lint run

test:
go test ./...

.PHONY: lint test
18 changes: 12 additions & 6 deletions cmd/download.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,7 @@ package cmd
import (
"bufio"
"bytes"
"encoding/json"
"fmt"
"github.com/samply/blazectl/fhir"
"github.com/samply/blazectl/util"
fm "github.com/samply/golang-fhir-models/fhir-models/fhir"
"github.com/spf13/cobra"
"io"
"net/http"
"net/http/httptrace"
Expand All @@ -31,6 +26,12 @@ import (
"sort"
"strings"
"time"

"github.com/goccy/go-json"
"github.com/samply/blazectl/fhir"
"github.com/samply/blazectl/util"
fm "github.com/samply/golang-fhir-models/fhir-models/fhir"
"github.com/spf13/cobra"
)

var outputFile string
Expand Down Expand Up @@ -508,8 +509,13 @@ func createOutputFileOrDie(filepath string) *os.File {
return outputFile
}

type bundleEntry struct {
Resource json.RawMessage `bson:"resource,omitempty" json:"resource,omitempty"`
Search *fm.BundleEntrySearch `bson:"search,omitempty" json:"search,omitempty"`
}

type entryBundle struct {
Entry []fm.BundleEntry `bson:"entry,omitempty" json:"entry,omitempty"`
Entry []bundleEntry `bson:"entry,omitempty" json:"entry,omitempty"`
}

// writeOutResources takes a raw set of FHIR bundle entries and writes the resource part of each of them to the given
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.24
toolchain go1.24.6

require (
github.com/goccy/go-json v0.10.5
github.com/goccy/go-yaml v1.18.0
github.com/google/uuid v1.6.0
github.com/samply/golang-fhir-models/fhir-models v0.3.2
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d/go.mod h1:asat6
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/goccy/go-json v0.10.5 h1:Fq85nIqj+gXn/S5ahsiTlK3TmC85qgirsdTP/+DeaC4=
github.com/goccy/go-json v0.10.5/go.mod h1:oq7eo15ShAhp70Anwd5lgX2pLfOS3QCiwU/PULtXL6M=
github.com/goccy/go-yaml v1.18.0 h1:8W7wMFS12Pcas7KU+VVkaiCng+kG8QiFeFwzFb+rwuw=
github.com/goccy/go-yaml v1.18.0/go.mod h1:XBurs7gK8ATbW4ZPGKgcbrY1Br56PdM69F7LkFRi1kA=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
Expand Down