<cfset AssForm.Assessment_ID='#Session.CS.AssessmentID#' />

<cfquery name="GetP" datasource="#Application.DataSrc#">
	SELECT Patient_ID, Last_Name_M0040 AS Last_Name, First_Name_M0040 AS First_Name, Middle_Initial_M0040 AS Middle
		  ,Payer_ID
	FROM  #Request.prefix_db_agency#.patient
	WHERE Patient_Id = '#session.cs.patientid#'
	AND   Agency_Id = '#session.AgencyId#'
</cfquery>

<cfquery name="AssForm" datasource="#Application.DataSrc#">
	select
	Assessment_ID,
	Start_of_Care_M0030,
	Cog_Function_M0560,
	Urinary_INcont_M0520,
	Eating_M0710,
	Eating_M0710p,
	ASSESSMENT_NOTE,
    Record_Created_By,
	Transmission_status
    FROM #Request.prefix_db_agency#.Assessment_New
	where Assessment_ID='#session.cs.AssessmentId#'
</cfquery>
<cfquery name="Createdby" datasource="#Application.DataSrc#">
	select Last_Name,First_Name from #Request.prefix_db_lookup#.Employee where Employee_ID = '#AssForm.Record_Created_By#'
</cfquery>

<div class="portlet box blue">
    <div class="portlet-title">
        <div class="caption">
            <i class="fa fa-gear"></i> <cfoutput> #DateFormat(AssForm.Start_of_Care_M0030,'mm/dd/yyyy')# - Chaplain Comprehensive Form </cfoutput>
        </div>
		<div class="tools">
			<a href="javascript:;" class="collapse"></a>
		</div>
    </div>
    <div class="portlet-body form">
	  <cfform name="chaplaincompupdate" action="index.cfm?a=1&a=1&px=y&page=patient&px=y&cat=chaplaincompformupdate" method="post" id="chaplaincompupdate">
        	<div class="form-body">
			 <div class="well">
				<div class="row">
					<div class="col-md-6">
						<div class="form-group">
							<label>Other Services Involved (By Current Agency)</label>
							<textarea class="form-control" style="width:100%;max-width:100%;height:80px;" name="Cog_Function_M0560" id="Cog_Function_M0560" onBlur="ChangeBlur('chaplaincompupdate','Cog_Function_M0560')"><cfoutput>#AssForm.Cog_Function_M0560#</cfoutput></textarea>
						</div>
					</div>
					<div class="col-md-6">
						<div class="form-group">
							<label>Other Agencies Involved</label>
							<textarea class="form-control" style="width:100%;max-width:100%;height:80px;" name="Urinary_INcont_M0520" id="Urinary_INcont_M0520" onBlur="ChangeBlur('chaplaincompupdate','Urinary_INcont_M0520')"><cfoutput>#AssForm.Urinary_INcont_M0520#</cfoutput></textarea>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label>Medical Diagnosis (Diagnosis lookup) <img name="imgbtnadd" id="imgbtnadd" src="../../images/icon_add.png" style="cursor:pointer" /></label>
				</div>
				<div  class="well" id="DivSS" style="display:none;">
					<div class="form-group">
						<label>Inpatient Facilities ICD10 Codes</label>
						<textarea name="searchfield" type="text" value=" " class="form-control"></textarea>
					</div>
					<input class="btn btn-sm blue" name="Search" type="button" value="Search" onClick="SearchClick();"  />
					<input class="btn btn-sm blue" name="btnSev" type="button" value="Redo Find" />
					<input class="btn btn-sm btn-default" name="btncancel" id="btncancel" type="button" value="Cancel" />
				</div>
				<input name="tinput1" type="text" style="display:none" value="Test">
				<!---<cfdiv bind="url:#Application.siteURL#/patientadmin_new/chaplaincompgrid.cfm?InputText={tinput1}" ID="theDiv"></cfdiv>--->
				<cfdiv bind="url:#Application.siteURL#/patientadmin_new/M0230Grid.cfm?InputText={tinput1}" ID="theDiv"></cfdiv>
				
				<div class="hidden">
				<div class="form-group">
					<label>Use Coding Expert? <img src="../../images/icon_help.png" alt="top" style="cursor:pointer" onClick="help();" /></label><br>
					<div class="label-stable">
						<div id="chkM1010YesColor1" class="checkbox-list">
							<label>
							<input type="checkbox" name="chkM1010Yes" onclick="chkReflect('1')" value="1"> Yes</label>
						</div>
					</div>
				</div>
				</div>
				
				<div class="row">
					<div class="col-md-6">
						<div class="form-group">
							<label>Bereavement</label><br>
							<div class="label-stable">
								<div id="Bereavdiv" class="checkbox-list">
									<label>
									<input type="checkbox" name="Bereav"  value="Patient has dependent family members" <cfif #AssForm.Eating_M0710# contains 'Patient has dependent family members'>checked</cfif>  /> Patient has dependent family members</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient does not have dependent family members" <cfif #AssForm.Eating_M0710# contains 'Patient does not have dependent family members'>checked</cfif>  /> Patient does not have dependent family members</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family/Caregiver does not have other important Relationships" <cfif #AssForm.Eating_M0710# contains 'Patient Family/Caregiver does not have other important Relationships'>checked</cfif>  /> Patient Family/Caregiver does not have other important Relationships</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family/Caregiver has other important Relationships" <cfif #AssForm.Eating_M0710# contains 'Patient Family/Caregiver has other important Relationships'>checked</cfif>  /> Patient Family/Caregiver has other important Relationships</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family/Caregiver predicted coping is POOR" <cfif #AssForm.Eating_M0710# contains 'Patient Family/Caregiver predicted coping is POOR'>checked</cfif>  /> Patient Family/Caregiver predicted coping is POOR</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family/Caregiver predicted coping is Good" <cfif #AssForm.Eating_M0710# contains 'Patient Family/Caregiver predicted coping is Good'>checked</cfif>  /> Patient Family/Caregiver predicted coping is Good</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Death will result in Financial Hardship" <cfif #AssForm.Eating_M0710# contains 'Patient Death will result in Financial Hardship'>checked</cfif>  /> Patient Death will result in Financial Hardship</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Death will not result in Financial Hardship" <cfif #AssForm.Eating_M0710# contains 'Patient Death will not result in Financial Hardship'>checked</cfif>  /> Patient Death will not result in Financial Hardship</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family does not have Previous Experience dealing with loss" <cfif #AssForm.Eating_M0710# contains 'Patient Family does not have Previous Experience dealing with loss'>checked</cfif>  /> Patient Family does not have Previous Experience dealing with loss</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family has Previous Experience dealing with loss" <cfif #AssForm.Eating_M0710# contains 'Patient Family has Previous Experience dealing with loss'>checked</cfif>  /> Patient Family has Previous Experience dealing with loss</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family has History of Alcohol/Drug abuse" <cfif #AssForm.Eating_M0710# contains 'Patient Family has History of Alcohol/Drug abuse'>checked</cfif>  /> Patient Family has History of Alcohol/Drug abuse</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family does not have History of Alcohol/Drug abuse" <cfif #AssForm.Eating_M0710# contains 'Patient Family does not have History of Alcohol/Drug abuse'>checked</cfif>  /> Patient Family does not have History of Alcohol/Drug abuse</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family has History of Physical/Emotional abuse" <cfif #AssForm.Eating_M0710# contains 'Patient Family has History of Physical/Emotional abuse'>checked</cfif>  /> Patient Family has History of Physical/Emotional abuse</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family does not have History Physical/Emotional abuse" <cfif #AssForm.Eating_M0710# contains 'Patient Family does not have History Physical/Emotional abuse'>checked</cfif>  /> Patient Family does not have History Physical/Emotional abuse</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family is not involved with Care of Patient" <cfif #AssForm.Eating_M0710# contains 'Patient Family is not involved with Care of Patient'>checked</cfif>  /> Patient Family is not involved with Care of Patient</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Family is involved with Care of Patient" <cfif #AssForm.Eating_M0710# contains 'Patient Family is involved with Care of Patient'>checked</cfif>  /> Patient Family is involved with Care of Patient</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Death is not Prepared for" <cfif #AssForm.Eating_M0710# contains 'Patient Death is not Prepared for'>checked</cfif>  /> Patient Death is not Prepared for</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Patient Death is Prepared for" <cfif #AssForm.Eating_M0710# contains 'Patient Death is Prepared for'>checked</cfif>  /> Patient Death is Prepared for</label>
									<label>
									<input type="checkbox" name="Bereav"  value="Other" <cfif #AssForm.Eating_M0710# contains 'Other'>checked</cfif>  /> Other</label>
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-6">
						<div class="form-group">
							<label>Spiritual</label><br>
							<div class="label-stable">
								<div id="Spiritdiv" class="checkbox-list">
									<label>
									<input type="checkbox" name="Spirit"  value="Spiritual Questioning" <cfif #AssForm.Eating_M0710p# contains 'Spiritual Questioning'>checked</cfif>  /> Spiritual Questioning</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Recent Loss/Grief" <cfif #AssForm.Eating_M0710p# contains 'Recent Loss/Grief'>checked</cfif>  /> Recent Loss/Grief</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Patient is Suicidal" <cfif #AssForm.Eating_M0710p# contains 'Patient is Suicidal'>checked</cfif>  /> Patient is Suicidal</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Patient is Depressed" <cfif #AssForm.Eating_M0710p# contains 'Patient is Depressed'>checked</cfif>  /> Patient is Depressed</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Patient is Angry" <cfif #AssForm.Eating_M0710p# contains 'Patient is Angry'>checked</cfif>  /> Patient is Angry</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Patient has Shame" <cfif #AssForm.Eating_M0710p# contains 'Patient has Shame'>checked</cfif>  /> Patient has Shame</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Patient has Guilt" <cfif #AssForm.Eating_M0710p# contains 'Patient has Guilt'>checked</cfif>  /> Patient has Guilt</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Isolation/Withdrawal" <cfif #AssForm.Eating_M0710p# contains 'Isolation/Withdrawal'>checked</cfif>  /> Isolation/Withdrawal</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Feelings of Abandonment" <cfif #AssForm.Eating_M0710p# contains 'Feelings of Abandonment'>checked</cfif>  /> Feelings of Abandonment</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Expresses Unfinished Business" <cfif #AssForm.Eating_M0710p# contains 'Expresses Unfinished Business'>checked</cfif>  /> Expresses Unfinished Business</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Concern with Death and Dying" <cfif #AssForm.Eating_M0710p# contains 'Concern with Death and Dying'>checked</cfif>  /> Concern with Death and Dying</label>
									<label>
									<input type="checkbox" name="Spirit"  value="Other" <cfif #AssForm.Eating_M0710p# contains 'Other'>checked</cfif>  /> Other</label>
								</div>
							</div>
						</div>
					</div>
				</div>
				<div class="form-group">
					<label>Comments</label>
					<textarea class="form-control" style="width:100%;max-width:100%;height:80px;" name="txtComment" id="txtComment" onBlur="ChangeBlur('chaplaincompupdate','txtComment')"><cfoutput>#AssForm.Assessment_note#</cfoutput></textarea>
				</div>
            </div>
            <div class="form-actions">
				<cfoutput>
                    <input type="hidden" id="M1010Diagnosisid" name="M1010Diagnosisid" value=""/>
                    <input type="hidden" id="txtAssId" name="txtAssId" value="#AssForm.Assessment_ID#"/>
                    <input type="hidden" id="M1010updateF" name="M1010updateF" value=""/>
                    <input type="hidden" id="codetype" name="codetype" value=""/>
                </cfoutput>
                <cfset Transmission_status=AssForm.Transmission_status />
                <cfif #UCASE(Transmission_status)# neq "DATASET HAS BEEN TRANSMITTED." AND #UCASE(Transmission_status)# neq "READY TO TRANSMIT">
                    <input class="btn blue" type="submit" name="Submit" value="Update" onClick="return check();">
                </cfif>
                <input class="btn default" type="button" name="Cancel" value="Cancel" onClick="window.location='index.cfm?page=patient&ID=<cfoutput>#Session.CS.PatientID#</cfoutput>&cat=Patient'" />
			</div>
			</div>
        </cfform>
	</div>
</div>

<cfwindow
    name="searchForm"
    title=""
    height="500"
    width="800"
    resizable="false"
    center="true"
    closable="false"
    draggable="true"
    modal="true"
    bodystyle="background-color:white;"
	initshow="false"
	refreshOnShow = "true"
	source="#Application.siteURL#/patientadmin_new/AddSearchValue.cfm?text={chaplaincompupdate:searchfield}&chaplaincomp=search">
</cfwindow>

<cfinclude template="/Scripts/assessment_form/chaplaincompform.cfm">