Documentation ¶
Overview ¶
Package resource contains functionality for generating resources from PatientInfo.
Index ¶
Constants ¶
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 DirectoryOutput ¶
type DirectoryOutput struct {
// contains filtered or unexported fields
}
DirectoryOutput is a resource output that stores information in multiple files in the same directory. Each file stores resources for a single patient at a specific point in time. Files are never updated.
func NewDirectoryOutput ¶
func NewDirectoryOutput(path string) (*DirectoryOutput, error)
NewDirectoryOutput returns a new DirectoryOutput based on the given path.
func (*DirectoryOutput) New ¶
func (o *DirectoryOutput) New(p *ir.PatientInfo) (io.WriteCloser, error)
New returns a new file as a writer for the given patient. It generates filenames as the concatenation of the person's full name and MRN (to avoid the slim possibility of collisions). If resources are generated more than once for the same Patient, a suffix is added. Consecutive writes will append to the file.
type FHIRWriter ¶
type FHIRWriter struct {
// contains filtered or unexported fields
}
FHIRWriter generates FHIR resources as protocol buffers, and writes them to writer.
func NewFHIRWriter ¶
func NewFHIRWriter(cfg GeneratorConfig) (*FHIRWriter, error)
NewFHIRWriter constructs and returns a new FHIRWriter.
func (*FHIRWriter) Generate ¶
func (w *FHIRWriter) Generate(p *ir.PatientInfo) error
Generate generates FHIR resources from PatientInfo.
type GeneratorConfig ¶
type GeneratorConfig struct { Writer io.Writer HL7Config *config.HL7Config IDGenerator id.Generator Output Output Marshaller Marshaller // BundleType is the type of bundle to generate, and defaults to Batch if unspecified. BundleType string }
GeneratorConfig is the configuration for resource generators.
type JSONMarshaller ¶
type JSONMarshaller struct {
// contains filtered or unexported fields
}
JSONMarshaller is a resource.Marshaller that wraps jsonformat.Marshaller.
func NewJSONMarshaller ¶
func NewJSONMarshaller() (*JSONMarshaller, error)
NewJSONMarshaller creates and returns a new JSONMarshaller.
type Marshaller ¶
Marshaller defines an object that can marshal a protocol buffer message.
type Output ¶
type Output interface {
New(*ir.PatientInfo) (io.WriteCloser, error)
}
Output defines an object which returns a writer that resource are written to.
type StdOutput ¶
type StdOutput struct{}
StdOutput is a resource output that wraps stdout.
func (*StdOutput) New ¶
func (o *StdOutput) New(*ir.PatientInfo) (io.WriteCloser, error)
New just returns os.Stdout.