fhir

package
v0.0.0-...-3cb445a Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2023 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Overview

Package fhir contains functionality for generating FHIR resources from PatientInfo.

Index

Constants

View Source
const (
	// Batch denotes the transaction bundle type: intended to be processed by a server as a group of
	// independent actions.
	// Reference: http://hl7.org/fhir/valueset-bundle-type.html
	Batch = "BATCH"
	// Collection denotes the collection bundle type: a set of resources collected into a single
	// document for ease of distribution.
	// Reference: http://hl7.org/fhir/valueset-bundle-type.html
	Collection = "COLLECTION"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundler

type Bundler struct {
	// contains filtered or unexported fields
}

Bundler generates FHIR resources as protocol buffers.

func NewBundler

func NewBundler(cfg BundlerConfig) (*Bundler, error)

NewBundler constructs and returns a new Bundler.

func (*Bundler) Generate

func (b *Bundler) Generate(p *ir.PatientInfo) (*r4pb.Bundle, error)

Generate generates FHIR resources from PatientInfo.

type BundlerConfig

type BundlerConfig struct {
	HL7Config   *config.HL7Config
	IDGenerator id.Generator
	// BundleType is the type of bundle to generate, and defaults to Batch if unspecified.
	BundleType string
}

BundlerConfig is the configuration for resource generators.

type Marshaller

type Marshaller interface {
	Marshal(proto.Message) ([]byte, error)
}

Marshaller defines an object that can marshal a protocol buffer message.

type Output

type Output interface {
	New(string) (io.WriteCloser, error)
}

Output defines an object which returns a writer that resources are written to.

type Writer

type Writer struct {
	Bundler *Bundler

	Output     Output
	Marshaller Marshaller
	// contains filtered or unexported fields
}

Writer writes FHIR resources protocol buffers.

func (*Writer) Close

func (w *Writer) Close() error

Close closes the Writer.

func (*Writer) Generate

func (w *Writer) Generate(p *ir.PatientInfo) error

Generate generates FHIR resources from PatientInfo.

Directories

Path Synopsis
Package cloud contains functionality to write to a Cloud FHIR store.
Package cloud contains functionality to write to a Cloud FHIR store.

Jump to

Keyboard shortcuts

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