Documentation ¶
Overview ¶
Package order provides functionality to generate order and set results.
Index ¶
- type AbnormalFlagConvertor
- type Convertor
- type Generator
- func (g Generator) NewOrder(o *pathway.Order, eventTime time.Time) *ir.Order
- func (g Generator) OrderWithClinicalNote(ctx context.Context, order *ir.Order, n *pathway.ClinicalNote, ...) (*ir.Order, error)
- func (g Generator) SetResults(o *ir.Order, r *pathway.Results, eventTime time.Time) (*ir.Order, error)
- type NotesGenerator
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 ¶
func (c *AbnormalFlagConvertor) ToHL7(f constants.AbnormalFlag) string
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 ¶
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.
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 ¶
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.