Documentation
¶
Overview ¶
Package starter contains functionality to start pathways by an endpoint.
Index ¶
Constants ¶
const ( UnavailableResponse = "" // DefaultPathwayNameFromUI is the default pathway name to be used for pathways that are started without a name. DefaultPathwayNameFromUI = "pathway_started_from_ui" // StartErrPrefix is the prefix for the error message in the response when something went wrong. StartErrPrefix = "Cannot start pathway or send messages" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PathwayStarter ¶
type PathwayStarter struct {
Hospital *hospital.Hospital
Parser *pathway.Parser
PathwayManager pathway.Manager
Sender hl7.Sender
// contains filtered or unexported fields
}
PathwayStarter provides a handler for starting pathways on demand.
func (*PathwayStarter) ServeHTTP ¶
func (ps *PathwayStarter) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServeHTTP handles the requests to start specific pathway. Use a POST request to start a pathway or send HL7v2 messages. The request can have the following formats: * A pathway name, e.g. "aki_scenario_1" * A pathway name plus the MRN of a patient, e.g. "aki_scenario_1: 1234567890" * A pathway name plus the first and last name of a patient, e.g. "aki_scenario_1: Tina Turner" * A pathway in YML format as in the pathway config files * One HL7v2 message where every segment is in a different line (separated by \n) * Multiple HL7v2 messages where messages are separated by blank lines (separated by \n\n) Use a GET request to get the latest response that mentions whether the request was successful.