<cfcomponent hint="Schedule Edit Pathways">
  <cffunction name="getPathwayInterventions" access="public" output="Yes" returnformat="plain" returntype="string">
    <cfargument name="note" type="string" required="Yes" />
    <cfargument name="div_id" type="string" required="Yes" />
    <cfargument name="PathwayId" type="string" required="Yes" />
    <cfargument name="Skill" type="string" required="Yes" />
    <cfargument name="Type" type="string" required="Yes" />
    <cfset str = '' />

    <cfquery name='gp' datasource='#Application.DataSrc#'>
      SELECT Item_Id, CopyIntoProgressNote, Description
      FROM   #Request.prefix_db_lookup#.pathway_list
      WHERE  Pathway_Id = '#PathwayId#'
      AND    Skill = '#Skill#'
      AND    Type = '#Type#'
      ORDER BY Item_Id
    </cfquery>

    <cfif gp.RecordCount gt 0>
      <cfset str = "<div id='" & div_id & "' style='display: none; padding: 10px; background: ##f4f4e7;' />" />
      <cfset dblQuote = '"' />
      <cfset space = '"; "' />

      <cfoutput query='gp'>
        <cfset link = true />
        <cfset d = Description />

        <cfif Find('-------------------------------------------------------------------------------------------------', d) gt 0>
          <cfset link = false />
          <cfset d = '<b />' & Replace(Description, '-------------------------------------------------------------------------------------------------', '', 'ALL') & '</b>' />
        </cfif>

        <cfset e = '"#Replace(CopyIntoProgressNote, '"', '', 'ALL')#"' />

        <cfif link eq true>
          <cfset d = "<a id='LeftMenuSubItemLink' title='Click to Copy to Notes' href='javascript: void(0);' onclick='javascript: this.style.color = #dblQuote#0a0#dblQuote#; if(#note#.value == #dblQuote##dblQuote#) { #note#.value = #e#; } else { #note#.value = #note#.value + #space# + #e#; }' />#d#</a>" />
        </cfif>

        <cfset str = str & "<div style='margin: 0px 10px 8px 10px;' />" & d & "</div>" />
      </cfoutput>

      <cfset str = str & "</div />" />
    </cfif>

    <cfreturn str />
  </cffunction>
</cfcomponent>