Documentation
¶
Overview ¶
Package output renders results as JSON (for pipes/agents) or aligned tables (for interactive terminals), and writes structured errors to stderr.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Columns = map[string][]Column{
"patient": {
{"UUID", "uuid"}, {"NAME", "person.display"}, {"GENDER", "person.gender"},
{"AGE", "person.age"}, {"BIRTHDATE", "person.birthdate"}, {"ID", "display"},
},
"concept": {
{"UUID", "uuid"}, {"DISPLAY", "display"},
{"DATATYPE", "datatype.display"}, {"CLASS", "conceptClass.display"},
},
"encounter": {
{"UUID", "uuid"}, {"TYPE", "encounterType.display"},
{"DATETIME", "encounterDatetime"}, {"LOCATION", "location.display"},
},
"obs": {
{"UUID", "uuid"}, {"CONCEPT", "concept.display"},
{"VALUE", "value.display|value"}, {"DATETIME", "obsDatetime"},
},
"visit": {
{"UUID", "uuid"}, {"TYPE", "visitType.display"}, {"PATIENT", "patient.display"},
{"START", "startDatetime"}, {"STOP", "stopDatetime"},
},
"location": {
{"UUID", "uuid"}, {"NAME", "name|display"}, {"DESCRIPTION", "description"},
},
"user": {
{"UUID", "uuid"}, {"DISPLAY", "display"}, {"USERNAME", "username"}, {"SYSTEMID", "systemId"},
},
"provider": {
{"UUID", "uuid"}, {"DISPLAY", "display"},
},
}
Columns maps a resource hint to its default table columns.
Functions ¶
func Extract ¶
Extract resolves a dot-path (e.g. "person.age") within a decoded JSON object. Alternate paths may be separated by "|": the first non-empty wins.
func Print ¶
Print renders data. Objects containing a "results" array render as a table in table mode; other objects render as key/value records.
func PrintError ¶
PrintError writes the error to stderr and returns the process exit code. Agents (stderr piped, or --json) get one-line structured JSON; humans at a terminal get plain readable text.
Types ¶
Click to show internal directories.
Click to hide internal directories.