transforms

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package transforms provides Dofns for Beam jobs processing CQL.

Index

Constants

View Source
const BeamMetadata = `
library BeamMetadata version '1.0.0'
using FHIR version '4.0.1'
context Patient
define ID: Patient.id.value
`

BeamMetadata produces the ID when running the CQL.

Variables

This section is empty.

Functions

func ErrorsNDJSONSink

func ErrorsNDJSONSink(beamErr *cbpb.BeamError, emitError func(string))

ErrorsNDJSONSink writes processing errors to an NDJSON file for troubleshooting.

func FileToBundle

func FileToBundle(ctx context.Context, file fileio.ReadableFile, emitBundle func(*bpb.Bundle), emitError func(*cbpb.BeamError))

FileToBundle returns a collection of FHIR R4 bundles and a collection of `ProcessingError` protos for files that could not be parsed into a bundle.

func NDJSONSink

func NDJSONSink(ctx context.Context, output *cbpb.BeamResult, emitValue func(string), emitError func(*cbpb.BeamError))

NDJSONSink marshals BeamResult to JSON and writes it to a NDJSON file.

Types

type CQLEvalFn

type CQLEvalFn struct {
	// Only exported fields are serialized.
	CQL                 []string
	ValueSets           []string
	EvaluationTimestamp time.Time
	ReturnPrivateDefs   bool
	// contains filtered or unexported fields
}

CQLEvalFn is a DoFn that parses and evaluates CQL.

func (*CQLEvalFn) ProcessElement

func (fn *CQLEvalFn) ProcessElement(ctx context.Context, bundle *bpb.Bundle, emit func(*cbpb.BeamResult), emitError func(*cbpb.BeamError)) error

func (*CQLEvalFn) Setup

func (fn *CQLEvalFn) Setup() error

Setup parses the CQL and initializes the terminology provider.

Jump to

Keyboard shortcuts

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