Documentation ¶
Index ¶
- func DeleteResource(host, resourceType, resourceID string) error
- func DeleteResourceByURL(resourceURL string) error
- func GetResource(host, resourceType, resourceID string) (resource interface{}, err error)
- func GetResourceByURL(resourceType, resourceURL string) (resource interface{}, err error)
- func GetResourceID(resource interface{}) string
- func GetResourceType(resource interface{}) string
- func JSONGetResourceType(obj []byte) string
- func LoadAndPostResource(host, resourceType, filepath string) (created interface{}, err error)
- func LoadResource(resourceType, filepath string) (resource interface{}, err error)
- func OperationOutcome(targetResourceType, targetResourceID string, conflictPaths []string) (oo *models.OperationOutcome)
- func PostResource(host, resourceType string, resource interface{}) (created interface{}, err error)
- func ResponseBundle(statusCode string, resources []interface{}) (bundle *models.Bundle)
- func SetResourceID(resource interface{}, newID string)
- func TransactionBundle(resources []interface{}) (bundle *models.Bundle)
- func UpdateResource(host, resourceType string, resource interface{}) (updatedResource interface{}, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteResource ¶
DeleteResource DELETEs a FHIR resource of a specified resourceType on the host provided.
func DeleteResourceByURL ¶
DeleteResourceByURL DELETEs a FHIR resource at the specified URL.
func GetResource ¶
GetResource GETs a FHIR resource of a specified resourceType from the host provided.
func GetResourceByURL ¶
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 ¶
JSONGetResourceType gets the string equivalent of a FHIR resource type from the JSON byte string of that resource.
func LoadAndPostResource ¶
LoadAndPostResource loads a resource from a fixture and immediately POSTs it, returning the resource that was created.
func LoadResource ¶
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 ¶
PostResource POSTs a FHIR resource of a specified resourceType to the host provided.
func ResponseBundle ¶
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 ¶
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.