Documentation ¶
Index ¶
- Constants
- Variables
- func Nget(node *xmlx.Node, args ...string) *xmlx.Node
- func Nsget(node *xmlx.Node, args ...string) *xmlx.Node
- func ParseHL7Time(value string) (time.Time, error)
- type Address
- type Allergy
- type CCD
- type Code
- type Diagnosis
- type Encounter
- type Immunization
- type Location
- type Medication
- type MedicationDose
- type MedicationReason
- type Name
- type ParseFunc
- type ParseType
- type Parser
- type Parsers
- type Patient
- type Performer
- type Problem
- type Result
- type ResultObservation
- type ResultRange
- type ResultRanges
- type ResultValue
- type SocialHistory
- type Telecom
- type Time
- type TimeType
- type VitalSign
- type VitalSignObservation
- type VitalSignResult
Constants ¶
const ( // Found both these formats in the wild TimeDecidingIndex = 14 TimeFormat = "20060102150405-0700" TimeFormat2 = "20060102150405.000-0700" )
const ( // represents a single point in time TIME_SINGLE TimeType = "TS" // interval of time TIME_INTERVAL = "IVL_TS" // periodic interval of time TIME_PERIODIC = "PIVL_TS" // event based time interval TIME_EVENT = "EIVL_TS" // represents an probabilistic time interval and is used to represent dosing frequencies like q4-6h TIME_PROBABILISTIC = "PIVL_PPD_TS" // represents a parenthetical set of time expressions TIME_PARENTHETICAL = "SXPR_TS" )
Variables ¶
var ( AllergiesTid = []string{"2.16.840.1.113883.10.20.1.2", "2.16.840.1.113883.10.20.22.2.6.1"} AllergiesParser = Parser{ Type: PARSE_SECTION, Values: AllergiesTid, Priority: 0, Func: parseAllergies, } )
var ( TidEncounters = []string{"2.16.840.1.113883.10.20.22.2.22.1", "2.16.840.1.113883.10.20.22.4.49"} EncountersParser = Parser{ Type: PARSE_SECTION, Values: TidEncounters, Priority: 0, Func: parseEncounters, } //The following TemplateID constants are used to find specific sections inside of an encounter. TidSDL = "2.16.840.1.113883.10.20.22.4.32" //TemplateID of the Service Delivery Location TidEncounterDx = "2.16.840.1.113883.10.20.22.4.80" //TemplateID of the Encounter Diagnosis TidIndication = "2.16.840.1.113883.10.20.22.4.19" )
var ( ImmunizationsTid = []string{"2.16.840.1.113883.10.20.1.6", "2.16.840.1.113883.10.20.22.2.2.1"} ImmunizationsParser = Parser{ Type: PARSE_SECTION, Values: ImmunizationsTid, Priority: 0, Func: parseImmunizations, } )
var ( MedicationsTid = []string{"2.16.840.1.113883.10.20.1.8", "2.16.840.1.113883.10.20.22.2.1.1"} MedicationsParser = Parser{ Type: PARSE_SECTION, Values: MedicationsTid, Priority: 0, Func: parseMedications, } )
var ( ProblemsTid = []string{"2.16.840.1.113883.10.20.1.11", "2.16.840.1.113883.10.20.22.2.5.1"} ProblemsParser = Parser{ Type: PARSE_SECTION, Values: ProblemsTid, Priority: 0, Func: parseProblems, } )
var ( ResultsTid = []string{"2.16.840.1.113883.10.20.1.14", "2.16.840.1.113883.10.20.22.2.3.1"} ResultsParser = Parser{ Type: PARSE_SECTION, Values: ResultsTid, Priority: 0, Func: parseResults, } RANGE_SPLIT_RE = regexp.MustCompile(`\s*(;|,|\|)\s*`) RANGE_RE = regexp.MustCompile(`(?P<text>[a-zA-Z\s]*?)\s*\(?(?P<low>[\d.]+)\s*[-–]\s*(?P<high>[\d.]+).*?\)?`) RANGE_MATH_RE = regexp.MustCompile(`(?P<text>[a-zA-Z\s]*?)\s*\(?(?P<symbol>[<>=]+)\s*(?P<value>[\d.]+).*?\)?`) )
var ( SocialHistoryTid = []string{"2.16.840.1.113883.10.20.1.15", "2.16.840.1.113883.10.20.22.2.17"} SocialHistoryParser = Parser{ Type: PARSE_SECTION, Values: SocialHistoryTid, Priority: 0, Func: parseSocialHistory, } )
var ( VitalSignsTid = []string{"2.16.840.1.113883.10.20.1.16", "2.16.840.1.113883.10.20.22.2.4.1"} VitalSignsParser = Parser{ Type: PARSE_SECTION, Values: VitalSignsTid, Priority: 0, Func: parseVitalSigns, } )
var ( DefaultParsers = []Parser{ PatientParser, AllergiesParser, ImmunizationsParser, MedicationsParser, ProblemsParser, ResultsParser, VitalSignsParser, SocialHistoryParser, EncountersParser, } )
var ( PatientParser = Parser{ Type: PARSE_DOC, Priority: 0, Func: parsePatient, } )
Functions ¶
func Nget ¶
func Nget(node *xmlx.Node, args ...string) *xmlx.Node
Node get. helper function to continually transverse down the xml nodes in args, and return the last one.
Types ¶
type Address ¶
type CCD ¶
type CCD struct { Patient Patient Immunizations []Immunization Medications []Medication Problems []Problem Results []Result VitalSigns []VitalSign Allergies []Allergy SocialHistory []SocialHistory Encounters []Encounter // contains filtered or unexported fields }
func NewCCD ¶
func NewCCD() *CCD
New CCD object with no parsers. Use NewDefaultCCD() or add your own parsers with AddParsers() if you want to actually parse anything.
func (*CCD) AddParsers ¶
type Code ¶
type Code struct { CodeSystemName string Type string CodeSystem string Code string DisplayName string OriginalText string Translations []Code Qualifiers []Code }
Code is a "Coded With Equivalents Value" there are many similar types that inherit from "Concept Descriptor", this tries to support all of them. See https://www.hl7.org/documentcenter/public_temp_950A80AE-1C23-BA17-0C003CDA0019BD2E/wg/inm/datatypes-its-xml20050714.htm#dtimpl-CE
type Encounter ¶
type Encounter struct { Performers []Performer Code Code Time Time //CCD calls this a 'participant', but we only use it for Service Delivery Locations Locations []Location /*List of problems found as a result of this visit*/ Diagnosis []Diagnosis /*List of problems that caused the visit to happen*/ Indications []Problem }
Encounter describes any interaction with the patient and healthcare provider. See: http://www.cdatools.org/infocenter/index.jsp?topic=%2Forg.openhealthtools.mdht.uml.cda.consol.doc%2Fclasses%2FEncounterDiagnosis.html
type Immunization ¶
type Medication ¶
type Medication struct { Name string Administration string Dose MedicationDose // Active, On Hold, Prior History, No Longer Active // http://motorcycleguy.blogspot.com/2011/03/medication-status-in-ccd.html Status string // Document HL7 ActStatus: aborted / active / cancelled / completed / held / new / suspended StatusCode string StartDate time.Time StopDate time.Time Period time.Duration Code Code Reason *MedicationReason }
type MedicationDose ¶
func (MedicationDose) String ¶
func (m MedicationDose) String() string
func (MedicationDose) ValueUnit ¶
func (m MedicationDose) ValueUnit() (string, string)
type MedicationReason ¶
type Name ¶
type Problem ¶
type Problem struct { Name string Time Time // Duration time.Duration Status string ProblemType string Code Code }
Problem represents an Observation Problem (templateId: 2.16.840.1.113883.10.20.22.4.4)
type ResultObservation ¶
type ResultObservation struct { Date time.Time Code Code Value ResultValue InterpretationCodes []string Ranges []ResultRange }
type ResultRange ¶
type ResultRange struct { Gender *string // M or F AgeLow *float64 AgeHigh *float64 Low *float64 High *float64 Text *string OriginalText string }
func (ResultRange) IsZero ¶
func (r ResultRange) IsZero() bool
type ResultRanges ¶
type ResultRanges []ResultRange
func (*ResultRanges) Parse ¶
func (r *ResultRanges) Parse(s string)
type ResultValue ¶
type SocialHistory ¶
type Time ¶
type VitalSign ¶
type VitalSign struct { Date time.Time Observations []VitalSignObservation }
type VitalSignObservation ¶
type VitalSignObservation struct { Date time.Time Code Code Result VitalSignResult }