fhir

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Overview

Package fhir provides a library for working with R4 Google FHIR protos: https://github.com/google/fhir.

This provides various quality-of-life utilities over the base FHIR definitions, such as:

- Defining abstract base resources as their respective interfaces - Creation functions for Elements - Access utilities for ContainedResources and References - etc.

Index

Constants

View Source
const SearchSpecialChars = `\,$|`

These characters have special meaning in FHIR Search queries

Variables

View Source
var (
	// ErrIntegerDataLoss is an error raised in APIs that might unintentionally
	// truncate integral values that the user wouldn't expect.
	ErrIntegerDataLoss = errors.New("data-loss occurred during integer conversion")
)

Functions

func Annotation

func Annotation(text, author string, when time.Time) *dtpb.Annotation

Annotation creates an R4 FHIR Annotation element with the specified text, author, and time of creation.

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

func AnnotationReference

func AnnotationReference(text string, author *dtpb.Reference, when time.Time) *dtpb.Annotation

AnnotationReference creates an R4 FHIR Annotation element with the specified text, a reference to the author, and the time of creation.

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

func Base64Binary

func Base64Binary(value []byte) *dtpb.Base64Binary

Base64Binary creates an R4 FHIR Base64Binary element the specified bytes.

See: https://hl7.org/fhir/R4/datatypes.html#base64Binary

func Boolean

func Boolean(value bool) *dtpb.Boolean

Boolean creates a Boolean proto from a primitive value.

See: https://hl7.org/fhir/R4/datatypes.html#boolean

func Code

func Code(value string) *dtpb.Code

Code creates an R4 FHIR Code element from a string value.

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

func CodeableConcept

func CodeableConcept(text string, coding ...*dtpb.Coding) *dtpb.CodeableConcept

CodeableConcept creates an R4 FHIR CodeableConcept with the specified codings, and with the Text element if the given text argument is non-empty.

Providing a non-empty Text element is good practice but not required. See: http://hl7.org/fhir/R4/datatypes.html#codeableconcept

func Coding

func Coding(system, code string) *dtpb.Coding

Coding creates an R4 FHIR Coding element with the provided system and code.

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

func CodingWithVersion

func CodingWithVersion(system, code, version string) *dtpb.Coding

CodingWithVersion creates an R4 FHIR Coding element with the provided system, code, and version.

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

func ContactDetail

func ContactDetail(name string, telecom ...*dtpb.ContactPoint) *dtpb.ContactDetail

ContactDetail creates an R4 FHIR ContactDetail element from a string value and the specified contact-points.

See: http://hl7.org/fhir/R4/metadatatypes.html#ContactDetail

func ContactPoint

func ContactPoint(system cpb.ContactPointSystemCode_Value, value string) *dtpb.ContactPoint

ContactPoint creates an R4 FHIR ContactPoint element from the system and value.

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

func Date

func Date(t time.Time) *dtpb.Date

Date creates an R4 FHIR Date element from a Time value, accurate to a given day.

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

func DateNow

func DateNow() *dtpb.Date

DateNow creates an R4 FHIR Date element at the current time using the highest available precision.

func DateTime

func DateTime(t time.Time) *dtpb.DateTime

DateTime creates an R4 FHIR DateTime element from a Time value, accurate to the microsecond.

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

func DateTimeNow

func DateTimeNow() *dtpb.DateTime

DateTimeNow creates an R4 FHIR DateTime element at the current time using the highest available precision.

func Days

func Days(value time.Duration) *dtpb.Duration

Days creates a Duration proto with the specified time value, rounded to day-accuracy.

func Decimal

func Decimal(value float64) *dtpb.Decimal

Decimal creates an R4 FHIR Decimal element from a float64 (double) value.

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

func Duration

func Duration(d time.Duration) *dtpb.Duration

Duration creates a Duration proto with the provided value, computing the largest whole-unit of time that can be used to represent the time.

func DurationFromTime

func DurationFromTime(t *dtpb.Time) *dtpb.Duration

DurationFromTime converts an R4 FHIR Time Element into an R4 FHIR Duration value.

If the underlying time has Second-based precision, the returned Duration will also have seconds precision; otherwise this will fallback into nanosecond precision.

func EmailContactPoint

func EmailContactPoint(value string) *dtpb.ContactPoint

EmailContactPoint creates an R4 FHIR ContactPoint element for the Email system given a value.

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

func EscapeSearchParam

func EscapeSearchParam(value string) string

Escape values intended for use as a parameter in a FHIR Search.

These characters have special meaning in Search queries and must be backslash escaped:

`\`, `|`, `,`, `$`

This function assumes that URL-encoding is performed later. (Percent encoding is automatically handled by the healthcare client library when query params are passed as a map.)

For example, `foo,bar` becomes `foo\,bar`

func FaxContactPoint

func FaxContactPoint(value string) *dtpb.ContactPoint

FaxContactPoint creates an R4 FHIR ContactPoint element for the Fax system given a value.

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

func Hours

func Hours(value time.Duration) *dtpb.Duration

Hours creates a Duration proto with the specified time value, rounded to hour-accuracy.

func ID

func ID(value string) *dtpb.Id

ID creates an R4 FHIR ID element from a string value.

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

func Identifier

func Identifier(system, value string) *dtpb.Identifier

Identifier creates an R4 FHIR Identifier element with the provided system and value.

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

func Instant

func Instant(t time.Time) *dtpb.Instant

Instant creates an R4 FHIR Instant element from a Time value, accurate to the microsecond.

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

func InstantNow

func InstantNow() *dtpb.Instant

InstantNow creates an R4 FHIR Instant element at the current time using the highest available precision.

func Integer

func Integer(value int32) *dtpb.Integer

Integer creates an R4 FHIR Integer element from an int32 value.

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

func IntegerFromInt

func IntegerFromInt(value int) (*dtpb.Integer, error)

IntegerFromInt creates an R4 FHIR Integer element from an int value.

Go's int type is architecture dependent, values greater than int32 will be truncated, as described in the go tour: https://tour.golang.org/basics/11 If this occurs, this function returns an error.

func IntegerFromPositiveInt

func IntegerFromPositiveInt(value *dtpb.PositiveInt) (*dtpb.Integer, error)

IntegerFromPositiveInt attempts to create an R4 FHIR Integer element from a PositiveInt value. This function may fail of the value stored in the PositiveInt exceeds the cardinality of Integer, which may cause a signed integer overflow.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func IntegerFromUnsignedInt

func IntegerFromUnsignedInt(value *dtpb.UnsignedInt) (*dtpb.Integer, error)

IntegerFromUnsignedInt attempts to create an R4 FHIR Integer element from an UnsignedInt value. This function may fail of the value stored in the UnsignedInt exceeds the cardinality of Integer, which may cause a signed integer overflow.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func IsID

func IsID(id string) bool

IsID returns true if the given string a valid FHIR ID. See http://hl7.org/fhir/R4/datatypes.html#id.

func Markdown

func Markdown(value string) *dtpb.Markdown

Markdown creates an R4 FHIR Markdown element from a string value.

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

func Microseconds

func Microseconds(value time.Duration) *dtpb.Duration

Microseconds creates a Duration proto with the specified time value, rounded to microsecond accuracy.

func Milliseconds

func Milliseconds(value time.Duration) *dtpb.Duration

Milliseconds creates a Duration proto with the specified time value, rounded to millisecond accuracy.

func Minutes

func Minutes(value time.Duration) *dtpb.Duration

Minutes creates a Duration proto with the specified time value, rounded to minute accuracy.

func Money

func Money(value float64) *dtpb.Money

Money creates an R4 FHIR Money element from the money value.

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

func MoneyQuantity

func MoneyQuantity(value float64, unit string) *dtpb.MoneyQuantity

MoneyQuantity creates an R4 FHIR MoneyQuantity element from the value and units.

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

func MustParseDate

func MustParseDate(value string) *dtpb.Date

MustParseDate parses a date as according to ParseDate, but panics if the date is invalid.

func MustParseDateTime

func MustParseDateTime(value string) *dtpb.DateTime

MustParseDateTime parses a date as according to ParseDateTime, but panics if the date is invalid.

func MustParseInstant

func MustParseInstant(value string) *dtpb.Instant

MustParseInstant parses a date as according to ParseInstant, but panics if the time is invalid.

func MustParseTime

func MustParseTime(time string) *dtpb.Time

MustParseTime parses a date as according to ParseTime, but panics if the time is invalid.

func Nanoseconds

func Nanoseconds(value time.Duration) *dtpb.Duration

Nanoseconds creates a Duration proto with the specified time value, rounded to nanosecond accuracy.

func Narrative

func Narrative(value string) *dtpb.Narrative

Narrative creates a R4 FHIR Narrative element from a string value.

See: http://hl7.org/fhir/R4/narrative.html

func OID

func OID(value string) *dtpb.Oid

OID creates an R4 FHIR OID element from a OID-string value, prepending the necessary "urn:oid:" to the value.

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

func OtherContactPoint

func OtherContactPoint(value string) *dtpb.ContactPoint

OtherContactPoint creates an R4 FHIR ContactPoint element for the Other system given a value.

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

func PagerContactPoint

func PagerContactPoint(value string) *dtpb.ContactPoint

PagerContactPoint creates an R4 FHIR ContactPoint element for the Pager system given a value.

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

func ParseDate

func ParseDate(value string) (*dtpb.Date, error)

ParseDate converts the input string into a FHIR Date element. The format of the input string must follow the FHIR Date format as defined in http://hl7.org/fhir/R4/datatypes.html#date, e.g.

  • YYYY,
  • YYYY-MM, or
  • YYYY-MM-DD

The returned Date will have a precision equal to what was specified in the input string.

func ParseDateTime

func ParseDateTime(value string) (*dtpb.DateTime, error)

ParseDateTime converts the input string into a FHIR DateTime element. The format of the input string must follow the FHIR DateTime format as defined in http://hl7.org/fhir/R4/datatypes.html#datetime, e.g.

  • YYYY,
  • YYYY-MM,
  • YYYY-MM-DD, or
  • YYYY-MM-DDThh:mm:ss+zz:zz (with optional milli/micro precision)

The returned DateTime will have a precision equal to what was specified in the input string.

func ParseInstant

func ParseInstant(value string) (*dtpb.Instant, error)

ParseInstant converts the input string into a FHIR Instant element. The format of the input string must follow the FHIR Instant format as defined in http://hl7.org/fhir/R4/datatypes.html#instant, e.g.

  • yyyy-mm-ddThh:mm:ss+zz:zz,
  • yyyy-mm-ddThh:mm:ss.000+zz:zz, or
  • yyyy-mm-ddThh:mm:ss.000000+zz:zz,

The returned Instant will have a precision equal to what was specified in the input string.

func ParseTime

func ParseTime(value string) (*dtpb.Time, error)

ParseTime converts the input string into a FHIR Time element. The format of the input string must follow the FHIR Time format as defined in http://hl7.org/fhir/R4/datatypes.html#time, e.g.

  • hh:mm:ss,
  • hh:mm:ss.000, or
  • hh:mm:ss.000000,

The returned Time will have a precision equal to what was specified in the input string.

func Period

func Period(start, end time.Time) *dtpb.Period

Period creates an R4 FHIR Period element with the provided start and end times.

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

func PhoneContactPoint

func PhoneContactPoint(value string) *dtpb.ContactPoint

PhoneContactPoint creates an R4 FHIR ContactPoint element for the Phone system given a value.

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

func PositiveInt

func PositiveInt(value uint32) *dtpb.PositiveInt

PositiveInt creates an R4 FHIR PositiveInt element from a uint32 value.

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

func Quantity

func Quantity(value float64, unit string) *dtpb.Quantity

Quantity creates an R4 FHIR Quantity element from the given value and units.

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

func QuantityFromDuration

func QuantityFromDuration(value *dtpb.Duration) *dtpb.Quantity

QuantityFromDuration is a convenience utility for converting a Duration to its base-class definition of Quantity. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func QuantityFromMoneyQuantity

func QuantityFromMoneyQuantity(value *dtpb.MoneyQuantity) *dtpb.Quantity

QuantityFromMoneyQuantity is a convenience utility for converting a MoneyQuantity to its base-class definition of Quantity. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func QuantityFromSimpleQuantity

func QuantityFromSimpleQuantity(value *dtpb.SimpleQuantity) *dtpb.Quantity

QuantityFromSimpleQuantity is a convenience utility for converting a SimpleQuantity to its base-class definition of Quantity. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func RandomID

func RandomID() *dtpb.Id

RandomID generates a new random R4 FHIR ID element.

func RandomUUID

func RandomUUID() *dtpb.Uuid

RandomUUID generates a random new UUID.

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

func Range

func Range(low, high float64, unit string) *dtpb.Range

Range creates an R4 FHIR Range element with the given low and high end of the range, using the specified units.

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

func Ratio

func Ratio(numerator, denominator float64) *dtpb.Ratio

Ratio creates an R4 FHIR Ratio element with the given numerator and denominator.

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

func Seconds

func Seconds(value time.Duration) *dtpb.Duration

Seconds creates a Duration proto with the specified time value, rounded to second accuracy.

func SimpleQuantity

func SimpleQuantity(value float64, unit string) *dtpb.SimpleQuantity

SimpleQuantity creates an R4 FHIR SimpleQuantity element from the given value and units.

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

func SmsContactPoint

func SmsContactPoint(value string) *dtpb.ContactPoint

SmsContactPoint creates an R4 FHIR ContactPoint element for the SMS system given a value.

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

func String

func String(value string) *dtpb.String

String creates an R4 FHIR String element from a string value.

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

func StringFromCode

func StringFromCode(code *dtpb.Code) *dtpb.String

StringFromCode is a convenience utility for converting a Code to its base-class definition of String. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func StringFromID

func StringFromID(id *dtpb.Id) *dtpb.String

StringFromID is a convenience utility for converting an Id to its base-class definition of String. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func StringFromMarkdown

func StringFromMarkdown(markdown *dtpb.Markdown) *dtpb.String

StringFromMarkdown is a convenience utility for converting Markdown to its base-class definition of String. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func Strings

func Strings(values ...string) []*dtpb.String

Strings creates an array of R4 FHIR String elements from a string value. This is offered as a convenience function, since many FHIR protos have arrays of FHIR string types, and converting between Go strings and FHIR strings is a common and repetitive process for some types.

func Time

func Time(t time.Time) *dtpb.Time

Time creates an R4 FHIR Time element from a Time value.

FHIR Time elements represent a time of day, disconnected from any date. As a result, the value stored in this proto will be modulo 24-hours to keep it within that 1 day time. Put differently, this will only ever be populated with the number of microseconds since the start of the unix epoch, modulo one day in microseconds.

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

func TimeNow

func TimeNow() *dtpb.Time

TimeNow creates an R4 FHIR Time element at the current time using the highest available precision.

func TimeOfDay

func TimeOfDay(hour, minute, second, micros int64) (*dtpb.Time, error)

TimeOfDay creates a Time proto at the specified time.

This function will return an error if any of the values exceed the valid range for their time unit (e.g. if 'hour' exceeds 24, or minute exceeds 60, etc).

The precision is determine by the value set for the micro second parameter; if the value is 0, the precision is set to seconds. If the value is a multiple of 1000, the value is set to millisecond precision; otherwise, its set to microsecond precision.

func Timing

func Timing(times ...time.Time) *dtpb.Timing

Timing creates an R4 FHIR Timing element observing the events specified in `times`.

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

func UCUMQuantity

func UCUMQuantity(value float64, unit string) *dtpb.Quantity

UCUMQuantity creates an R4 FHIR Quantity element representing a value and UCUM unit.

See: http://hl7.org/fhir/R4/datatypes.html#quantity TODO(PHP-9521): Add a unit package to validate against UCUM units.

func URI

func URI(value string) *dtpb.Uri

URI creates an R4 FHIR URI element from a string value.

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

func URIFromCanonical

func URIFromCanonical(canonical *dtpb.Canonical) *dtpb.Uri

URIFromCanonical is a convenience utility for converting a canonical to its base-class definition of URI. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func URIFromOID

func URIFromOID(oid *dtpb.Oid) *dtpb.Uri

URIFromOID is a convenience utility for converting an OID to its base-class definition of URI. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func URIFromURL

func URIFromURL(url *dtpb.Url) *dtpb.Uri

URIFromURL is a convenience utility for converting a URL to its base-class definition of URI. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func URIFromUUID

func URIFromUUID(uuid *dtpb.Uuid) *dtpb.Uri

URIFromUUID is a convenience utility for converting a UUID to its base-class definition of URI. If the input is nil, this returns nil.

For more information, see the diagram for Primitive Types here: https://www.hl7.org/fhir/datatypes.html

func URL

func URL(value string) *dtpb.Url

URL creates an R4 FHIR URL element from a string value.

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

func UUID

func UUID(value string) *dtpb.Uuid

UUID creates an R4 FHIR UUID element from a uuid-string value, prepending the necessary "urn:uuid:" to the value.

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

func UnsignedInt

func UnsignedInt(value uint32) *dtpb.UnsignedInt

UnsignedInt creates an R4 FHIR UnsignedInt element from a uint32 value.

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

func XHTML

func XHTML(value string) *dtpb.Xhtml

XHTML creates an R4 FHIR XHTML element from a string value.

See: http://hl7.org/fhir/R4/narrative.html#xhtml

Types

type BackboneElement

type BackboneElement interface {
	GetModifierExtension() []*dtpb.Extension
	Element
}

BackboneElement is the base definition for all elements that are defined inside a resource - but not those in a data type.

See https://www.hl7.org/fhir/r4/backboneelement.html for more details.

This interface is defined by embedding the proto.Message interface, since all FHIR backbone elements in this library must also be proto.Message types.

type BackboneType

BackboneType is a constraint-definition of FHIR backbone element, which all support ID, Extension, and modifier-extension fields, in addition to their base values.

Note: "BackboneType" is also an "BackboneElement", so these interfaces are logically equivalent -- and so this is represented as a constraint of valid datatypes.

The R4 spec doesn't explicitly refer to "BackboneType" as a distinction from "BackboneElement", but the R5 spec does, and its definition is compatible with R4. This is retained here so that we can have a proper vernacular and mechanism for referring to these types in generic ways through constraints.

See https://www.hl7.org/fhir/r5/types.html#BackboneType for more details.

type Base

type Base interface {
	proto.Message
}

Base is the interface-definition of the FHIR abstract base type which is the ancestor of all FHIR objects (both resources and elements).

Represented in Go, this simply embeds the proto.Message interface, since this is a utility for the google/fhir proto definitions.

func UnwrapValueX

func UnwrapValueX(element Base) Base

UnwrapValueX obtains the underlying Message for oneof ValueX elements, which use a nested Choice field. Returns nil if the input message doesn't have a Choice field, or if the Oneof descriptor is unpopulated. See wrapped implementation for more information.

type CanonicalResource

type CanonicalResource interface {
	GetUrl() *dtpb.Uri
	GetIdentifier() []*dtpb.Identifier
	GetVersion() *dtpb.String
	GetName() *dtpb.String
	GetTitle() *dtpb.String
	GetExperimental() *dtpb.Boolean
	GetDate() *dtpb.DateTime
	GetPublisher() *dtpb.String
	GetContact() []*dtpb.ContactDetail
	GetDescription() *dtpb.Markdown
	GetUseContext() []*dtpb.UsageContext
	GetJurisdiction() []*dtpb.CodeableConcept
	GetPurpose() *dtpb.Markdown
	GetCopyright() *dtpb.Markdown

	DomainResource
}

CanonicalResource represents resources that have a canonical URL:

  • They have a canonical URL (note: all resources with a canonical URL are specializations of this type)
  • They have version, status, and data properties to help manage their publication
  • They carry some additional metadata about their use, including copyright information

CanonicalResource objects may be the logical target of Canonical references.

Note: This is technically an "R5" interface type that is not officially part of the R4 spec, however its definition is still applicable and applies to "R4" resource types. Using this still provides us with a proper vernacular for referring to these resources.

See https://www.hl7.org/fhir/r5/canonicalresource.html for more details.

type DataType

type DataType interface {
	Element
	primitiveDataType | complexDataType | metaDataType | specialPurposeDataType
}

DataType is an constraint-definition of FHIR datatypes, which all support ID and Extension fields, in addition to their base values.

Note: "DataType" is also an "Element", so these interfaces are logically equivalent -- and so this is represented as a constraint of valid datatypes.

The R4 spec doesn't explicitly refer to "DataType" as a distinction from "Element", but the R5 spec does, and its definition is compatible with R4. This is retained here so that we can have a proper vernacular and mechanism for referring to these types in generic ways through constraints.

See https://www.hl7.org/fhir/r5/types.html#DataType for more details.

type DomainResource

type DomainResource interface {
	GetText() *dtpb.Narrative
	GetContained() []*anypb.Any
	GetModifierExtension() []*dtpb.Extension
	Extendable
	Resource
}

DomainResource is the interface-definition of the FHIR Abstract base type which is the ancestor of all FHIR domain resource objects (effectively everything that is not a datatype or bundle/contained-resource). See https://www.hl7.org/fhir/r4/domainresource.html for more details.

This interface extends from the `Resource` interface by embedding it. Any `DomainResource` is also a `Resource`.

type Element

type Element interface {
	GetId() *dtpb.String
	Extendable
	Base
}

Element is the base definition for all elements in a resource.

See https://www.hl7.org/fhir/r4/element.html for more details.

This interface is defined by embedding the proto.Message interface, since all FHIR elements in this library must also be proto.Message types.

type Extendable

type Extendable interface {
	GetExtension() []*dtpb.Extension
	Base
}

Extendable is an interface for abstraction resources or data-types that have extension properties.

This is not an official FHIR abstract class; this is something simply named here for the general convenience, since not all FHIR types are extendable.

This embeds the proto.Message interface into this interface to help distinguish that this still refers to protos in the process.

type MetadataResource

type MetadataResource interface {
	GetApprovalDate() *dtpb.Date
	GetLastReviewDate() *dtpb.Date
	GetEffectivePeriod() *dtpb.Period
	GetTopic() []*dtpb.CodeableConcept
	GetAuthor() []*dtpb.ContactDetail
	GetEditor() []*dtpb.ContactDetail
	GetReviewer() []*dtpb.ContactDetail
	GetEndorser() []*dtpb.ContactDetail
	GetRelatedArtifact() []*dtpb.RelatedArtifact

	CanonicalResource
}

MetadataResource represents resources that carry additional publication metadata over other CanonicalResources, describing their review and use in more details.

As an interface, this type is never created directly.

Note: This is technically an "R5" interface type that is not officially part of the R4 spec, however its definition is still applicable and applies to "R4" resource types. Using this still provides us with a proper vernacular for referring to these resources.

See https://www.hl7.org/fhir/r5/metadataresource.html for more details.

type PrimitiveType

type PrimitiveType interface {
	Element
	// contains filtered or unexported methods
}

PrimitiveType is a constraint-definition of FHIR datatypes, which all support ID and Extension fields, in addition to their base values.

Note: "DataType" is also an "Element", so these interfaces are logically equivalent -- and so this is represented as a constraint of valid datatypes.

The R4 spec doesn't explicitly refer to "PrimitiveType" as a distinction from "Element", but the R5 spec does, and its definition is compatible with R4. This is retained here so that we can have a proper vernacular and mechanism for referring to these types in generic ways through constraints.

See https://www.hl7.org/fhir/types.html#PrimitiveType for more details.

type Resource

type Resource interface {
	GetId() *dtpb.Id
	GetImplicitRules() *dtpb.Uri
	GetMeta() *dtpb.Meta
	GetLanguage() *dtpb.Code
	Base
}

Resource is the interface-definition of the FHIR Abstract base type which is the ancestor of all FHIR resources. See https://www.hl7.org/fhir/r4/resource.html#Resource for more details.

This interface is defined by embedding the proto.Message interface, since all FHIR resources in this library must also be proto.Message types

Jump to

Keyboard shortcuts

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