Pathway is the base class for most complex forms in Opal applications.
The human readable display name for this pathway. Will be used in the base template for full page pathways.
The slug to use in the URL for accessing an individual pathway, and the string that can
be passed to
Pathway.get() that will return it.
The steps that make up this pathway. A tuple of either
The Service that is used to instantiate the pathway. This should inherit from the Pathway js service.
The name of the class that you're replaceing with the pathway template. You probably shouldn't have to change this.
The name of the pathway template, it must include a div/span with the class .to_append which will be replaced by the wrapped step templates.
If set, this template will be used if your pathway is opened in a modal. If its not set the template attribute will be used.
Pathway.as_menuitem(href=None, activepattern=None, icon=None, display=None, index=None)
Return an instance of
opal.core.menus.MenuItem that will direct the user to this pathway.
Returns a string which should be used as the slug for this Pathway.
Returns a string which is the absolute URL of this Pathway.
Returns a string which is the icon for this pathway. Defaults to None.
Returns a string which is the display name for this pathway. Defaults to None
MyPathway.get_display_name() "The Form"
Pathway.redirect_url(self, patient, episde)
Returns a string that we should redirect to on success. Defaults to an episode detail screen
Pathway.save(user=None, episode=None, patient=None)
Saves a pathway, it removes items that haven't changed and then saves with the Patient.bulk_update method
opal.core.pathway.Pathway, this displays one step per page, with
to navigate through the form.
opal.core.pathway.Pathway, this displays all steps as one long form.
Steps are a single section within a form, and can be instances of either
pathway.Step subclasses. You can use both types of Step in a given Pathway.
More detail on Steps is given in the Guides section on Pathways
A Step subclass with help text to the side of the form.
As arguments these takes either
help_text will be displayed in a side bar next to the step.
help_text_template will completely replace the normal side bar template with the template that you pass in.
A frequent pattern is a form that allows the user to search for a patient at the start. This step includes a widget for searching for patients, then selecting that patient for use in the rest of the form.
After saving, redirect the browser to the patient detail page for the relevant patient.