order

package
v0.0.0-...-a467797 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package order provides functionality to generate order and set results.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AbnormalFlagConvertor

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

AbnormalFlagConvertor converts abnormal flag values.

func NewAbnormalFlagConvertor

func NewAbnormalFlagConvertor(c *config.HL7Config) AbnormalFlagConvertor

NewAbnormalFlagConvertor returns a new abnormalFlagConvertor based on the HL7 abnormal flag values provided in the HL7Config.

func (*AbnormalFlagConvertor) ToHL7

ToHL7 returns an HL7 value of the abnormal flag value provided.

type Convertor

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

Convertor converts between the HL7 and FHIR representations of a result status.

func NewConvertor

func NewConvertor(c *config.HL7Config) Convertor

NewConvertor returns a new result status Convertor based on the HL7Config. Full set of codes can be found at https://www.hl7.org/fhir/codesystem-observation-status.html.

func (Convertor) HL7ToFHIR

func (c Convertor) HL7ToFHIR(status string) cpb.ObservationStatusCode_Value

HL7ToFHIR returns the FHIR representation for the given HL7 result status.

type Generator

type Generator struct {
	MessageConfig         *config.HL7Config
	OrderProfiles         *orderprofile.OrderProfiles
	NoteGenerator         NotesGenerator
	PlacerGenerator       id.Generator
	FillerGenerator       id.Generator
	AbnormalFlagConvertor AbnormalFlagConvertor
	Doctors               *doctor.Doctors
}

Generator is a generator of orders and results.

func (Generator) NewOrder

func (g Generator) NewOrder(o *pathway.Order, eventTime time.Time) *ir.Order

NewOrder returns a new order based on order information from the pathway and eventTime.

func (Generator) OrderWithClinicalNote

func (g Generator) OrderWithClinicalNote(ctx context.Context, order *ir.Order, n *pathway.ClinicalNote, eventTime time.Time) (*ir.Order, error)

OrderWithClinicalNote updates an order with a Clinical Note. If the supplied order is nil, a new order is created. This order will contain a single result with the Clinical Note generated/updated based on the pathway. The DiagnosticServID section is set to DiagnosticServIDMDOC, which indicates that the corresponding HL7 is a Clinical Note.

func (Generator) SetResults

func (g Generator) SetResults(o *ir.Order, r *pathway.Results, eventTime time.Time) (*ir.Order, error)

SetResults sets results on an existing Order. If order is nil, this first creates an Order using details in pathway.Result.

If the results are explicitly specified in the pathway, only those results are included. If the results are not set explicitly, the results for each TestType for the given OrderProfile are included,

If the Order already has the Results, they are replaced with Results from the pathway as the corrected results, unless another status is explicitly specified in the pathway. In the case of correction, only results specified in the pathway are included.

type NotesGenerator

type NotesGenerator interface {
	// RandomNotesForResult generates textual notes for a Result, to be set in NTE segments related to the result.
	RandomNotesForResult() []string
	// RandomDocumentForClinicalNote generates a document that contains a clinical note.
	RandomDocumentForClinicalNote(context.Context, *pathway.ClinicalNote, *ir.ClinicalNote, time.Time) (*ir.ClinicalNote, error)
}

NotesGenerator is an interface to generate notes for results and clinical notes.

Jump to

Keyboard shortcuts

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