testfhir

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: 6 Imported by: 0

Documentation

Overview

Package testfhir contains utilities for testing with FHIR resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReferenceID

func GetReferenceID(ref *pb.Reference) string

GetReferenceID returns the ID embedded in `ref`.

func GetStringValue

func GetStringValue(ext *pb.Extension) string

GetStringValue returns the StringValue from the extension.

Types

type ByteOutput

type ByteOutput struct {
	Bytes *bytes.Buffer
}

ByteOutput is a resource output that writes to a byte buffer.

func (*ByteOutput) New

func (o *ByteOutput) New(_ string) (io.WriteCloser, error)

New returns the ByteWriteCloser.

type Writer

type Writer struct {
	Resources []*ir.PatientInfo
	// contains filtered or unexported fields
}

Writer is a resource writer that exposes the resources it has written to be retrieved by tests.

func NewWriter

func NewWriter() *Writer

NewWriter initialises gob encoders and returns a new TestWriter.

func (*Writer) Close

func (w *Writer) Close() error

Close exists to implement the hospital.ResourceWriter interface and is a no-op.

func (*Writer) Generate

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

Generate appends a copy of `p` to `Resources`.

Jump to

Keyboard shortcuts

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