Documentation ¶
Index ¶
- Variables
- func FragmentFromResource(resource fhir.CanonicalResource) (*dtpb.Canonical, error)
- func FromResource(resource fhir.CanonicalResource) (*dtpb.Canonical, error)
- func IdentityFromReference(c *dtpb.Canonical) (*resource.CanonicalIdentity, error)
- func IdentityOf(res fhir.CanonicalResource) (*resource.CanonicalIdentity, error)
- func New(url string, opts ...Option) *dtpb.Canonical
- func VersionedFromResource(resource fhir.CanonicalResource) (*dtpb.Canonical, error)
- type Option
Constants ¶
This section is empty.
Variables ¶
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 ¶
func IdentityOf(res fhir.CanonicalResource) (*resource.CanonicalIdentity, error)
IdentityOf returns a canonicalIdentity representing the given canonical resource
func New ¶
New constructs an R4 FHIR New element from the specified url string and canonical options.
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 ¶
WithFragment adds a "fragment" portion to Canonical references.
func WithVersion ¶
WithVersion adds a "version" portion to Canonical references.