<cfcomponent hint="Patient Menu">
	<cffunction name="getPatientMenu" access="public" output="Yes" returnformat="plain" returntype="string">
  		<cfargument name="PatientId" type="string" required="Yes" />
        
		<cfset str = '' />
        
        <cfoutput>
            <div class="btn-group btn-group-circle margin-bottom-15">
            
                <a class="btn <cfif isdefined('url.cat') and url.cat eq 'patient_form'> green<cfelse> btn-default</cfif>" href='/patientadmin_new/index.cfm?page=patient&Id=#PatientId#&cat=patient_form'>
                patient info</a>  
            
				<cfif Session.EmpLevel eq 1 or Session.EmpLevel eq 2 or Session.EmpLevel eq 3 or Session.EmpLevel eq 4 or Session.EmpLevel eq 5 or Session.EmpLevel eq 6 or Session.EmpLevel eq 7 or Session.EmpLevel eq 8 or Session.EmpLevel eq 9 >
                    <cfquery name="Patient" datasource="#Application.DataSrc#">
                        SELECT MenuLevel2Id,MenuNames,DefaultPageUrl FROM #Request.prefix_db_lookup#.homecare_menulevel2 where parentid = 3 
                            <cfif session.EmpLevel eq 1>
                            and Level1Access=1
                            <cfelseif session.EmpLevel eq 2>
                            and Level2Access=1
                            <cfelseif session.EmpLevel eq 3>
                            and Level3Access=1
                            <cfelseif session.EmpLevel eq 4>
                            and Level4Access=1
                            <cfelseif session.EmpLevel eq 5>
                            and Level5Access=1
                            <cfelseif session.EmpLevel eq 6>
                            and Level6Access=1
                            <cfelseif session.EmpLevel eq 7>
                            and Level7Access=1
                            <cfelseif session.EmpLevel eq 8>
                            and Level8Access=1
                            <cfelseif session.EmpLevel eq 9>
                            and Level9Access=1
                            </cfif>
                    </cfquery>
                    
                    <cfset Contacts="0" />
                    <cfset Physician="0" />
                    <cfset Payers="0" />
                    <cfset Medications="0" />
                    <cfset ChartReview="0" />
                    <cfset CarePlan="0" />
                    <cfset AccountHistory="0" />
                    
                    <cfloop query="Patient">
                        <cfif  Patient.MenuNames EQ "Contacts">
                            <cfset Contacts="1" />
                        </cfif>
                        
                        <cfif  Patient.MenuNames EQ "Physicians">
                            <cfset Physician="1" />
                        </cfif>
                        
                        <cfif  Patient.MenuNames EQ "Payers">
                            <cfset Payers="1" />
                        </cfif>
                        
                        <cfif  Patient.MenuNames EQ "Medications">
                            <cfset Medications="1" />
                        </cfif>
                        
                        <cfif  Patient.MenuNames EQ "Chart Review">
                            <cfset ChartReview="1" />
                        </cfif>			
                    </cfloop>
                    
                    <cfif Contacts eq 1>			
                        <a class="btn <cfif isdefined('url.cat') and url.cat eq 'contact_list' and url.cat eq 'contact_form'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=contact_list')">
                        Contact</a>
                    </cfif>
                
                    <cfif Physician eq 1>			
                        <a class="btn <cfif isdefined('url.cat') and url.cat eq 'Patient_PhysicianList'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&id=#PatientId#&cat=Patient_PhysicianList')">
                        Physicians</a>
                    </cfif>
                    
                    <a class="btn btn-default" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&cat=phys_inquiry&id=#PatientId#')">
                    vitals inquiry</a>
                    
                    <cfif Payers eq 1>			
                        <a class="btn <cfif isdefined('url.cat') and url.cat eq 'patient_payers'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=patient_payers')">
                        payers</a>
                    </cfif>
                    
                    <cfif Medications eq 1>
                        <a class="btn <cfif isdefined('url.cat') and url.cat eq 'med_list' or url.cat eq 'med_form'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=med_list')">
                        medications</a>
                    </cfif>
                    
                    <cfif ChartReview eq 1>			
                        <a class="btn <cfif isdefined('url.cat') and url.cat eq 'patient_chart' or url.cat eq 'assessment_form'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=patient_chart')">
                        chart review</a>
                    </cfif>		
                
                    <cfif Session.EmpLevel eq 3 or Session.EmpLevel eq 4 or Session.EmpLevel eq 5>
                        <a class="btn <cfif isdefined('url.cat') and (url.cat eq 'assessment_list' or url.cat eq 'careplan')> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=assessment_list')">
                        care plan</a>
                    </cfif>
                    
                    <cfif  session.eaBilling eq 1>
                        <a class="btn <cfif isdefined('url.cat') and url.cat eq 'patient_accounthistory'> green<cfelse>btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=patient_accounthistory')">
                        account history </a>	
                    </cfif>				  
                </cfif>	 
                       
				<cfif Session.EmpLevel neq 1 and Session.EmpLevel neq 2 and Session.EmpLevel neq 3 and Session.EmpLevel neq 4 and Session.EmpLevel neq 5 and Session.EmpLevel neq 6 and Session.EmpLevel neq 7 and Session.EmpLevel neq 8 and Session.EmpLevel neq 9 >
                    <a class="btn <cfif isdefined('url.cat') and url.cat eq 'contact_list' or url.cat eq 'contact_form'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=contact_list')">
                    Contact</a>
   
                    <a class="btn <cfif isdefined('url.cat') and url.cat eq 'Patient_PhysicianList'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&id=#PatientId#&cat=Patient_PhysicianList')">
                    Physicians</a>

                    <a class="btn btn-default" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&cat=phys_inquiry&id=#PatientId#')">
                    vitals inquiry</a>
			
                    <a class="btn <cfif isdefined('url.cat') and url.cat eq 'patient_payers'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=patient_payers')">
                    payers</a>

                    <a class="btn <cfif isdefined('url.cat') and url.cat eq 'med_list' or url.cat eq 'med_form'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=med_list')">
                    medications</a>
                        
                    <a class="btn <cfif isdefined('url.cat') and url.cat eq 'assessment_form' or url.cat eq 'patient_chart'> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=patient_chart')">
                    chart review</a>
                
                    <a class="btn <cfif isdefined('url.cat') and (url.cat eq 'assessment_list' or url.cat eq 'careplan')> green<cfelse> btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=assessment_list')">
                    care plan</a>

                    <a class="btn <cfif isdefined('url.cat') and url.cat eq 'patient_accounthistory'> green<cfelse>btn-default</cfif>" href="javascript:void(0);" onclick="javascript:secureHREF('index.cfm?page=patient&ID=#PatientId#&cat=patient_accounthistory')">
                    account history </a>
                </cfif>   
            </div>  
        </cfoutput>
        
  		<cfreturn str />
	</cffunction>
</cfcomponent>