fhirutil

package
v0.0.0-...-d6db04b Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteResource

func DeleteResource(host, resourceType, resourceID string) error

DeleteResource DELETEs a FHIR resource of a specified resourceType on the host provided.

func DeleteResourceByURL

func DeleteResourceByURL(resourceURL string) error

DeleteResourceByURL DELETEs a FHIR resource at the specified URL.

func GetResource

func GetResource(host, resourceType, resourceID string) (resource interface{}, err error)

GetResource GETs a FHIR resource of a specified resourceType from the host provided.

func GetResourceByURL

func GetResourceByURL(resourceType, resourceURL string) (resource interface{}, err error)

GetResourceByURL GETs a FHIR resource from it's specified URL.

func GetResourceID

func GetResourceID(resource interface{}) string

GetResourceID returns the string equivalent of a FHIR resource ID.

func GetResourceType

func GetResourceType(resource interface{}) string

GetResourceType returns the string equivalent of a FHIR resource type.

func JSONGetResourceType

func JSONGetResourceType(obj []byte) string

JSONGetResourceType gets the string equivalent of a FHIR resource type from the JSON byte string of that resource.

func LoadAndPostResource

func LoadAndPostResource(host, resourceType, filepath string) (created interface{}, err error)

LoadAndPostResource loads a resource from a fixture and immediately POSTs it, returning the resource that was created.

func LoadResource

func LoadResource(resourceType, filepath string) (resource interface{}, err error)

LoadResource returns a resource-appropriate struct for the unmarshaled file.

func OperationOutcome

func OperationOutcome(targetResourceType, targetResourceID string, conflictPaths []string) (oo *models.OperationOutcome)

OperationOutcome creates a new OperatioOutcome detailing all conflicts in the target resource, identified by its targetResourceID.

func PostResource

func PostResource(host, resourceType string, resource interface{}) (created interface{}, err error)

PostResource POSTs a FHIR resource of a specified resourceType to the host provided.

func ResponseBundle

func ResponseBundle(statusCode string, resources []interface{}) (bundle *models.Bundle)

ResponseBundle returns a new response bundle. Status codes may be either 200 Ok when responding with a bundle that didn't require creating any host resources, or 201 Created if host resources were also created (e.g. OperationOutcomes).

func SetResourceID

func SetResourceID(resource interface{}, newID string)

SetResourceID sets or updates the Id for a FHIR resource.

func TransactionBundle

func TransactionBundle(resources []interface{}) (bundle *models.Bundle)

TransactionBundle creates a new Bundle of resources for transaction with the host FHIR server.

func UpdateResource

func UpdateResource(host, resourceType string, resource interface{}) (updatedResource interface{}, err error)

UpdateResource PUTs a FHIR resource of a specified resourceType on the host provided, updating the resource.

Types

This section is empty.

Jump to

Keyboard shortcuts

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