canonical

package
v0.0.0-...-5b88717 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2024 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoCanonicalURL is an error returned when an API receives a canonical that
	// does not have a specified URL field.
	ErrNoCanonicalURL = errors.New("canonical does not contain url")
)

Functions

func FragmentFromResource

func FragmentFromResource(resource fhir.CanonicalResource) (*dtpb.Canonical, error)

FragmentFromResource creates an R4 FHIR Canonical element from a resource that has a URL, such as a Questionnaire, Device, etc., and will mark it as a fragment-reference.

If the input resource is nil, or if the resource does not have a URL field assigned, this function will return the error `ErrNoCanonicalURL`.

See: https://hl7.org/fhir/R4/datatypes.html#canonical and https://hl7.org/fhir/R4/references.html#canonical

func FromResource

func FromResource(resource fhir.CanonicalResource) (*dtpb.Canonical, error)

FromResource creates an R4 FHIR FromResource element from a resource that has a URL, such as a Questionnaire, Device, etc.

If the input resource is nil, or if the resource does not have a URL field assigned, this function will return the error `ErrNoCanonicalURL`.

See: https://hl7.org/fhir/R4/datatypes.html#canonical and https://hl7.org/fhir/R4/references.html#canonical

func IdentityFromReference

func IdentityFromReference(c *dtpb.Canonical) (*resource.CanonicalIdentity, error)

IdentityFromReference returns an Identity object from a given canonical reference Replaces: ph.ParseCanonical

func IdentityOf

IdentityOf returns a canonicalIdentity representing the given canonical resource

func New

func New(url string, opts ...Option) *dtpb.Canonical

New constructs an R4 FHIR New element from the specified url string and canonical options.

See: http://hl7.org/fhir/R4/datatypes.html#canonical

func VersionedFromResource

func VersionedFromResource(resource fhir.CanonicalResource) (*dtpb.Canonical, error)

VersionedFromResource creates an R4 FHIR Canonical element from a resource that has a URL, such as a Questionnaire, Device, etc, along with a version string.

If the input resource is nil, or if the resource does not have a URL field assigned, this function will return the error `ErrNoCanonicalURL`.

See: https://hl7.org/fhir/R4/datatypes.html#canonical and https://hl7.org/fhir/R4/references.html#canonical

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option is an option interface for constructing canonicals from raw data.

func WithFragment

func WithFragment(frag string) Option

WithFragment adds a "fragment" portion to Canonical references.

func WithVersion

func WithVersion(version string) Option

WithVersion adds a "version" portion to Canonical references.

Jump to

Keyboard shortcuts

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