 
   dateline.factory 'VisitDateline', ['ObjectHelper', 'Chart', (ObjectHelper, Chart) ->
     # A helper function to calculate the effective treatment dates.
-    # If there is not a begin date, then this function returns an
-    # empty array. Otherwise, this function returns a [begin, end]
-    # array, where:
-    # * begin is the moment begin date integer 
+    # This function returns a [start, end] array, where:
+    # * start is the moment start date integer 
     # * end is the moment end date integer
     # The default end date is today.
     #
+    # TODO - depict a treatment with no end date as an arrow.
+    #
     # @param treatment the treatment object
-    # @returns the [begin, end] array
+    # @returns the [start, end] array
     treatmentSpan = (treatment) ->
-      if treatment.start_date?
-        begin = treatment.start_date.valueOf()
-        endDate = treatment.end_date or moment()
-        end = endDate.valueOf()
-        [begin, end]
-      else
-        []
+      start = treatment.start_date.valueOf()
+      endDate = treatment.end_date or moment()
+      end = endDate.valueOf()
+      [start, end]
 
     # Decorates the dateline as follows:
     # * Add the session hyperlinks, encounter dates and treatment
-    #   begin-end bars.
+    #   start-end bars.
     # * Rotate the date x-axis tick labels
     #
     # Note: The session hyperlinks are ui-sref attributes. However,

          p = parent.insert('p', -> svgNode)
          p.text('Treatments: ')
          p.classed({'col-md-offset-5': true, 'font-size: small': true})
          # Sort by begin date.
          sorted = _.sortBy(trts, (trt) -> trt.start_date.valueOf())
          # The treatment labels.
          labels = _.uniq(trt.treatment_type for trt in sorted)

        # The scaling factor.
        factor = dateline.width / (high - low)
        for trt in subject.treatments
          [start, end] = treatmentSpan(trt)
          left = (start - low) * factor
          width = (end - start) * factor
          # Allow for a 6-pixel minimum width.
          if not width
            left = left - 3
            width = 6
          # Place the new bar rectangle element in the DOM
          # before the x axis element.
          bar = parent.insert('svg:rect', -> xAxisNode)
          # Set the bar dimensions.
          bar.attr('height', "#{ TREATMENT_BAR_HEIGHT }em")
          bar.attr('width', width)
          # Set the bar style.
          bar.classed("qi-dateline-#{ trt.treatment_type.toLowerCase() }", true)
          # Position the bar.
          bar.attr('x', left)
          bar.attr('y', "-#{ TREATMENT_BAR_HEIGHT }em")

      # Inserts a marker for each encounter above the timeline.
      #
