fhir

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	Type  string
	Total *int
	Entry []BundleEntry
}

Bundle is documented here https://www.hl7.org/fhir/bundle.html

func ReadBundle added in v0.2.0

func ReadBundle(r io.Reader) (Bundle, error)

ReadBundle reads and unmarshals a bundle.

func UnmarshalBundle added in v0.2.0

func UnmarshalBundle(b []byte) (Bundle, error)

UnmarshalBundle unmarshals a bundle.

func (Bundle) MarshalJSON added in v0.2.0

func (b Bundle) MarshalJSON() ([]byte, error)

MarshalJSON marshals the given bundle as JSON into a byte slice

type BundleEntry added in v0.2.0

type BundleEntry struct {
	Resource json.RawMessage      `json:"resource,omitempty"`
	Request  *BundleEntryRequest  `json:"request,omitempty"`
	Response *BundleEntryResponse `json:"response,omitempty"`
}

BundleEntry represents the Bundle.entry BackboneElement

type BundleEntryRequest added in v0.2.0

type BundleEntryRequest struct {
	Method string `json:"method"`
	URL    string `json:"url"`
}

BundleEntryRequest represents the Bundle.entry.request BackboneElement

type BundleEntryResponse added in v0.2.0

type BundleEntryResponse struct {
	Status string `json:"status"`
}

BundleEntryResponse represents the Bundle.entry.response BackboneElement

type CapabilityStatement

type CapabilityStatement struct {
	FhirVersion string
	Rest        []CapabilityStatementRest
}

CapabilityStatement is documented here https://www.hl7.org/fhir/capabilitystatement.html

func ReadCapabilityStatement added in v0.2.0

func ReadCapabilityStatement(r io.Reader) (CapabilityStatement, error)

ReadCapabilityStatement reads and unmarshals a capability statement.

type CapabilityStatementRest

type CapabilityStatementRest struct {
	Mode     string
	Resource []CapabilityStatementRestResource
}

CapabilityStatementRest represents the CapabilityStatement.rest BackboneElement

type CapabilityStatementRestResource

type CapabilityStatementRestResource struct {
	Type        string
	Interaction []CapabilityStatementRestResourceInteraction
}

CapabilityStatementRestResource represents the CapabilityStatement.rest.resource BackboneElement

func (CapabilityStatementRestResource) DoesSupportsInteraction added in v0.2.0

func (r CapabilityStatementRestResource) DoesSupportsInteraction(code string) bool

DoesSupportsInteraction returns true iff the resource supports the given interaction. Possible interactions are defined in https://www.hl7.org/fhir/valueset-type-restful-interaction.html

type CapabilityStatementRestResourceInteraction added in v0.2.0

type CapabilityStatementRestResourceInteraction struct {
	Code string
}

CapabilityStatementRestResourceInteraction represents the CapabilityStatement.rest.resource.interaction BackboneElement

type Client added in v0.2.0

type Client struct {
	HttpClient http.Client
	Base       string
}

A Client is a FHIR client which combines an HTTP client with the base URL of a FHIR server. At minimum, the Base has to be set. HttpClient can be left at its default value.

func (*Client) CloseIdleConnections added in v0.2.0

func (c *Client) CloseIdleConnections()

CloseIdleConnections calls CloseIdleConnections on the HTTP client of the FHIR client.

func (*Client) Do added in v0.2.0

func (c *Client) Do(req *http.Request) (*http.Response, error)

Do calls Do on the HTTP client of the FHIR client.

func (*Client) NewBatchRequest added in v0.2.0

func (c *Client) NewBatchRequest(body io.Reader) (*http.Request, error)

NewBatchRequest creates a new transaction/batch interaction request. Uses the base URL from the FHIR client and sets JSON Accept and Content-Type headers. Otherwise it's identical to http.NewRequest.

func (*Client) NewCapabilitiesRequest added in v0.2.0

func (c *Client) NewCapabilitiesRequest() (*http.Request, error)

NewCapabilitiesRequest creates a new capabilities interaction request. Uses the base URL from the FHIR client and sets JSON Accept header. Otherwise it's identical to http.NewRequest.

func (*Client) NewSearchTypeRequest added in v0.2.0

func (c *Client) NewSearchTypeRequest(resourceType string) (*http.Request, error)

NewSearchTypeRequest creates a new search-type interaction request. Uses the base URL from the FHIR client and sets JSON Accept header. Otherwise it's identical to http.NewRequest.

func (*Client) NewTransactionRequest added in v0.2.0

func (c *Client) NewTransactionRequest(body io.Reader) (*http.Request, error)

NewTransactionRequest creates a new transaction/batch interaction request. Uses the base URL from the FHIR client and sets JSON Accept and Content-Type headers. Otherwise it's identical to http.NewRequest.

func (*Client) SearchTypeURL added in v0.2.0

func (c *Client) SearchTypeURL(resourceType string) string

SearchTypeURL generates the URL for a search-type interaction of the given resource type

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL