<cfparam name="url.text" default="">
<cfquery name="new" datasource="#Application.DataSrc#">
	SELECT Assessment_Completed_M0090 FROM #Request.prefix_db_agency#.Assessment_New where Assessment_ID = '#Session.CS.AssessmentID#'
</cfquery>
<cfset diag = CreateObject("Component", "components.diagnosis") />
<div style="margin:10px">
		<cfif isdefined('url.M1020')>
		<cfoutput>
			<cfquery name="M1012Diagnosis" datasource="#Application.DataSrc#">
				SELECT id,`Procedure` as Diagnosis  FROM #Request.prefix_db_lookup#.surgical_codes WHERE `Procedure` LIKE '%#url.text#%'
			</cfquery>
		</cfoutput>
	    <h4 style="float: left">Inpatient Facilities ICD10 Z-Codes</h4><br>
		<div style="margin-bottom:10px;float:right;">
	    	<img title="Close" 
			name="imgbtnSkinCloseVital" style="border:none;cursor:pointer;" id="imgbtnSkinCloseVital" onclick="ColdFusion.Window.hide('searchFormM1012');" src="../../images/icon_back.gif" width="33" height="35"/>
	    </div>
	    <table class="table table-bordered table-striped table-condensed flip-content">
	        <thead>
	            <tr>
	                <th>Diagnosis</th>
	                <th class="text-center">Action</th>
	            </tr>
	        </thead>
	        <tbody>
		        <cfif isdefined('M1012Diagnosis.recordcount') and  M1012Diagnosis.RecordCount GT 0>
		            <cfloop query="M1012Diagnosis">
		                <tr>
		                    <td>
		                        <cfoutput>#M1012Diagnosis.Diagnosis#</cfoutput>
		                    </td>
		                    <td class="text-center">
		                        <cfoutput>
		                            <input class="btn blue btn-sm" name="Select" type="button" value="select" onClick="return DiagnosislistIDM1020('#M1012Diagnosis.id#');"/>
		                        </cfoutput>
		                    </td>
		                </tr>
		            </cfloop>
		        <cfelse>
		            <tr>
		                <td align="left" valign="middle" colspan="2" height="50px">
		                    No Result Found
		                </td>
		            </tr>
		        </cfif>
	        </tbody>
	    </table>
	</cfif>

	<cfif isdefined('url.M1016')>
		<cfoutput>
			<cfif new.Assessment_Completed_M0090 gt '2015-09-30'>
				<cfquery name="M1016Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message,ICD,Code_Type FROM #Request.prefix_db_lookup#.Dx_list_ICD10 WHERE Diagnosis LIKE '%#url.text#%' Order by ICD 
				</cfquery>
			<cfelse>
				<cfquery name="M1016Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message,ICD,Code_Type FROM #Request.prefix_db_lookup#.diagnosis_list WHERE Diagnosis LIKE '%#url.text#%'
				</cfquery>
			</cfif>
		</cfoutput>

		<h4 style="float: left">Diagnosis requiring treatment change ICD10 Z-Codes</h4>
		<div style="margin-bottom:10px;float:right;">
			<img title="Close" name="imgbtnSkinCloseVital" style="border:none;cursor:pointer;" id="imgbtnSkinCloseVital" onclick="ColdFusion.Window.hide('searchFormM1016');" src="../../images/icon_back.gif" width="33" height="35" />
		</div>
		<table class="table table-bordered table-striped table-condensed flip-content">
			<thead>
				<tr>
					<th>Diagnosis</th>
					<th class="text-center">Action</th>
				</tr>
			</thead>
			<tbody>
				<cfif isdefined('M1016Diagnosis.recordcount') and  M1016Diagnosis.RecordCount GT 0>
					<cfloop query="M1016Diagnosis">
						<tr>
							<td>
								<cfoutput>#M1016Diagnosis.Diagnosis#</cfoutput>
							</td>
							<td class="text-center">
								<cfoutput>
									<input name="Select" class="btn blue btn-sm" type="button" value="select" onClick="return DiagnosislistIDM1016('#M1016Diagnosis.id#','#M1016Diagnosis.Code_Type#','#REPLACE(M1016Diagnosis.Diagnosis,"'","","ALL")#');"/>
								</cfoutput>
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<tr>
						<td align="left" valign="middle" colspan="2" height="50px">
							No Result Found
						</td>
					</tr>
				</cfif>
			</tbody>
		</table>
	</cfif>

	<cfif isdefined('url.M0230') or isdefined('url.PTped') or isdefined('url.PTadult') or isdefined('url.OTped') or isdefined('url.OTadult') OR
	isdefined('url.SNped') or isdefined('url.snadult') or  isdefined('url.stped') or isdefined('url.stadult')  > 
		 <cfoutput>
                <cfif (new.Assessment_Completed_M0090 gt '2019-11-01' OR  session.Display eq 'Melissa Cott') >
				 <cfset M0230Diagnosis = diag.Search_diagnosis('#url.text#') />	
			<cfelse>
				<cfquery name="M0230Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message,Code_Type,ICD FROM #Request.prefix_db_lookup#.Dx_list_ICD10 WHERE Diagnosis LIKE '%#url.text#%' Order by ICD 
				</cfquery>
			</cfif>
		</cfoutput>

		<h4 style="float: left">Diagnosis Select</h4>

		<div style="margin-bottom:10px;float:right;">
			<a data-dismiss="modal" aria-hidden="true"><img title="Close" name="btnCancel" style="border:none;cursor:pointer;" id="imgbtnSkinCloseVital" src="../../images/icon_back.gif" width="33" height="35" /></a>
		</div>

		<table class="table table-bordered table-striped table-condensed flip-content">
			<cfif isdefined('M0230Diagnosis.recordcount') and  M0230Diagnosis.RecordCount GT 0>
				<thead>
					<tr>
						<th>Diagnosis</th>
                         <th>ICD</th>
						<th width="20%" class="text-center">Action</th>
					</tr>
				</thead>
				<tbody>
					<cfloop query="M0230Diagnosis">
						<tr>
							<td>
								<cfoutput>#M0230Diagnosis.Diagnosis#</cfoutput>
							</td>
                              <td><cfoutput>#M0230Diagnosis.ICD#</cfoutput></td>
							<td class="text-center">
								<cfoutput>
									<input name="Select" class="btn blue btn-sm" type="button" value="select" onClick="return DiagnosislistIDM0230A('#M0230Diagnosis.id#','#REPLACE(M0230Diagnosis.Diagnosis,"'","","ALL")#','#M0230Diagnosis.Code_Type#','#M0230Diagnosis.ICD#');"/>
								</cfoutput>
								<br/>
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<tr>
						<td align="left" valign="middle" colspan="2" height="50px">
							No Result Found
						</td>
					</tr>
				</tbody>
			</cfif>
		</table>
	</cfif>

	<cfif isdefined('url.M0230M')>
		<cfoutput>
			<cfif new.Assessment_Completed_M0090 gt '2015-09-30'>
				 <cfset M0230Diagnosis = diag.Search_diagnosis('#url.text#',1) />	
			<cfelse>
				<cfquery name="M0230Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message FROM #Request.prefix_db_lookup#.Dx_list_ICD10 WHERE Diagnosis LIKE '%#url.text#%' and Manfestation='M' and Manfestation is not null Order by ICD 
				</cfquery>
			</cfif>
		</cfoutput>

		<h4 style="float: left">Diagnosis Select</h4>

		<div style="margin-bottom:10px;float:right;">
			<img title="Close" name="btnCancel" style="border:none;cursor:pointer;" onclick="ColdFusion.Window.hide('searchFormM0230M');" src="../../images/icon_back.gif" width="33" height="35" />
		</div>

		<table class="table table-bordered table-striped table-condensed flip-content">
			<cfif isdefined('M0230Diagnosis.recordcount') and  M0230Diagnosis.RecordCount GT 0>
				<thead>
					<tr>
						<th>Diagnosis</th>
						<th class="text-center">Action</th>
					</tr>
				</thead>
				<tbody>
					<cfloop query="M0230Diagnosis">
						<tr>
							<td>
								<cfoutput>#M0230Diagnosis.Diagnosis#</cfoutput>
							</td>
							<td class="text-center">
								<cfoutput>
									<input class="btn blue btn-sm" name="Select" type="button" value="select" onClick="return DiagnosislistIDM0230B('#M0230Diagnosis.id#','#REPLACE(M0230Diagnosis.Diagnosis,"'","","ALL")#');"/>
								</cfoutput>
								
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<tr>
						<td align="left" valign="middle" colspan="2" height="50px">
							No Result Found
						</td>
					</tr>
				</tbody>
			</cfif>
		</table>
	</cfif>

	<cfif isdefined('url.MSearch')>
		<cfoutput>
			<cfquery name="Medslist" datasource="#Application.DataSrc#">
				SELECT Trade_ID,Name FROM #Request.prefix_db_lookup#.Meds_New WHERE Name LIKE '%#url.text#%'
			</cfquery>
		</cfoutput>

		<h4 style="float: left">Medication Search Result</h4>

		<div style="margin-bottom:10px;float:right;">
			<input class="btn btn-sm blue" type="button" name="btnRefresh" value="Refresh" onClick="ColdFusion.Window.hide('searchMedication');" />
			<input class="btn btn-sm blue" type="button" name="TypeOwn1" value="type my own" onClick="TypeOwn();" />
			<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onClick="ColdFusion.Window.hide('searchMedication');" />
		</div>

		<table class="table table-bordered table-striped table-condensed flip-content">
			<thead>
				<tr>
					<th>Diagnosis</th>
					<th width="20%" class="text-center">Action</th>
				</tr>
			</thead>
			<tbody>
				<cfif isdefined('Medslist.recordcount') and  Medslist.RecordCount GT 0>
					<cfloop query="Medslist">
						<tr>
							<td>
								<cfoutput>#Medslist.Name#</cfoutput>
							</td>
							<td class="text-center">
								<cfoutput>
									<input class="btn blue btn-sm" name="submit" type="submit" value="select" onClick="ShowID('#Medslist.Trade_ID#');"/>
								</cfoutput>
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<tr>
						<td align="left" valign="middle" colspan="2" height="50px">
							No Result Found
						</td>
					</tr>
				</cfif>
			</tbody>
		</table>
	</cfif>

	<cfif isdefined('url.MSearch2')>
		<cfoutput>
			<cfquery name="MedsDose" datasource="#Application.DataSrc#">
				select Meds_New_Dose.Dose_ID,Meds_New_Dose.Dose,Meds_New_Dose.Form from #Request.prefix_db_lookup#.Meds_New_Dose where Trade_ID='#url.text#'
			</cfquery>
			<cfquery name="MedsDoseName" datasource="#Application.DataSrc#">
				SELECT Name FROM #Request.prefix_db_lookup#.Meds_New m where Trade_ID='#url.text#'
			</cfquery>
		</cfoutput>

		<h4 style="float: left"><cfoutput>#MedsDoseName.Name#</cfoutput></h4>

		<div style="margin-bottom:10px;float:right;">
			<input class="btn btn-sm blue" type="button" name="TypeOwn2" value="type my own" onClick="TypeOwn2();"/>
			<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onClick="ColdFusion.Window.hide('searchMedication2');" />
		</div>

		<p style="font-size:14px;">available doses/how dispensed*</p>

		<table class="table table-bordered table-striped table-condensed flip-content">
			<thead>
				<tr>
					<th>Meds Dose</th>
					<th width="20%" class="text-center">Action</th>
				</tr>
			</thead>
			<tbody>
				<cfif isdefined('MedsDose.recordcount') and  MedsDose.RecordCount GT 0>
					<cfloop query="MedsDose">
						<tr>
							<td>
								<cfoutput>#MedsDose.Dose#</cfoutput><br>
								<cfoutput>#MedsDose.Form#</cfoutput>
							</td>
							<td class="text-center">
								<cfoutput>
									<input class="btn blue btn-sm" name="submit" type="submit" value="select" onClick="ShowDoseID('#MedsDose.Dose_ID#');"/>
								</cfoutput>
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<tr>
						<td align="left" valign="middle" colspan="2" height="50px">
							No Result Found
						</td>
					</tr>
				</cfif>
			</tbody>
		</table>
	</cfif>

	<cfif isdefined('url.PTAdd1') OR isdefined('url.PEDAdd1') OR isdefined('url.PEDAddForm') OR isdefined('url.PTAddForm') OR isdefined('url.SNAdd1') OR isdefined('url.HSAdd1')OR isdefined('url.HSAddForm')>
		<cfoutput>
			<cfquery name="PTAdd1Surgical" datasource="#Application.DataSrc#">
				SELECT s.id,s.Procedure FROM #Request.prefix_db_lookup#.surgical_codes s WHERE s.Procedure LIKE '%#url.text#%'
			</cfquery>
		</cfoutput>

		<h4 style="float: left">Procedure Search</h4>

		<div style="margin-bottom:10px;float:right;">
			<cfif isdefined('url.PTAdd1')>
				<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onclick="ColdFusion.Window.hide('searchForm');"/>
			<cfelseif isdefined('url.PEDAdd1')>
				<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onclick="ColdFusion.Window.hide('searchForm');"/>
			<cfelseif isdefined('url.PEDAddForm') OR isdefined('url.PTAddForm') OR isdefined('url.HSAddForm')>
				<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onclick="ColdFusion.Window.hide('searchForm');"/>
			<cfelseif isdefined('url.SNAdd1')>
				<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onclick="ColdFusion.Window.hide('searchForm');"/>
			<cfelseif isdefined('url.HSAdd1')>
				<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onclick="ColdFusion.Window.hide('searchForm');"/>
			</cfif>
		</div>

		<table class="table table-bordered table-striped table-condensed flip-content">
			<thead>
				<tr>
					<th>Procedure</th>
					<th width="20%" class="text-center">Action</th>
				</tr>
			</thead>
			<tbody>
				<cfif isdefined('PTAdd1Surgical.recordcount') and  PTAdd1Surgical.RecordCount GT 0>
					<cfloop query="PTAdd1Surgical">
						<tr>
							<td>
								<cfoutput>#PTAdd1Surgical.Procedure#</cfoutput>
							</td>
							<td class="text-center">
								<cfoutput>
									<input class="btn blue btn-sm" name="Select" type="button" value="select" onClick="return PTAdd1SearchClick('#Mid(Trim(PTAdd1Surgical.Procedure),Trim(PTAdd1Surgical.Procedure).lastindexof(' ')+1,Len(Trim(PTAdd1Surgical.Procedure)))#','#Left(PTAdd1Surgical.Procedure,40)#');"/>
								</cfoutput>
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<td align="left" valign="middle" colspan="2" height="50px">
						No Result Found
					</td>
				</cfif>
			</tbody>
		</table>
	</cfif>

	<cfif isdefined('url.PTDia') OR isdefined('url.PEDDia') OR isdefined('url.PEDDiaForm') OR isdefined('url.PTDiaForm') OR isdefined('url.SNDia')>
		<cfoutput>
			<cfif new.Assessment_Completed_M0090 gt '2015-09-30'>
				<cfquery name="M0230Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message FROM #Request.prefix_db_lookup#.Dx_list_ICD10 WHERE Diagnosis LIKE '%#url.text#%'   and Manfestation='M' and Manfestation is not null Order by ICD 
				</cfquery>
			<cfelse>
				<cfquery name="M0230Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message FROM #Request.prefix_db_lookup#.diagnosis_list WHERE Diagnosis LIKE '%#url.text#%' and Manfestation='M' and Manfestation is not null
				</cfquery>
			</cfif>
		</cfoutput>

		<h4 style="float: left">Diagnosis Select</h4>

		<div style="margin-bottom:10px;float:right;">
			<cfif isdefined('url.PTDia')>
				<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onclick="clearSubWindow();ColdFusion.Window.hide('diaSearchForm');" />
			<cfelseif isdefined('url.PEDDia')>
				<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onclick="clearSubWindow();ColdFusion.Window.hide('diaSearchForm');" />
			<cfelseif isdefined('url.PEDDiaForm') OR isdefined('url.PTDiaForm')>
				<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onclick="clearSubWindow();ColdFusion.Window.hide('diaSearchForm');" />
			<cfelseif isdefined('url.SNDia')>
				<input class="btn btn-sm btn-default" type="button" name="btnCancel" value="Cancel" onclick="clearSubWindow();ColdFusion.Window.hide('diaSearchForm');" />
			</cfif>
		</div>

		<table class="table table-bordered table-striped table-condensed flip-content">
			<thead>
				<tr>
					<th>Diagnosis</th>
					<th class="text-center">Action</th>
				</tr>
			</thead>
			<tbody>
				<cfif isdefined('M0230Diagnosis.recordcount') and  M0230Diagnosis.RecordCount GT 0>
					<cfloop query="M0230Diagnosis">
						<tr>
							<td>
								<cfoutput>#M0230Diagnosis.Diagnosis#</cfoutput>
							</td>
							<td class="text-center">
								<cfoutput>
									<input class="btn blue btn-sm" name="Select" type="button" value="select" onClick="return DiagnosislistIDM0230A('#M0230Diagnosis.id#','#REPLACE(M0230Diagnosis.Diagnosis,"'","","ALL")#');"/>
								</cfoutput>
								<br/>
								<cfoutput>#M0230Diagnosis.Case_Mix_Message#</cfoutput>
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<td align="left" valign="middle" colspan="2" height="50px">
						No Result Found
					</td>
				</cfif>
			</tbody>
		</table>
	</cfif>

	<cfif isdefined('url.PTDiaSev') OR isdefined('url.PEDDiaSev') OR isdefined('url.PEDDiaSevForm') OR isdefined('url.PTDiaSevForm')  OR isdefined('url.SNDiaSev') OR isdefined('url.SNDiaSevForm')>
		<cfoutput>
			<cfif new.Assessment_Completed_M0090 gt '2015-09-30'>
				<cfquery name="M0230Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message FROM #Request.prefix_db_lookup#.Dx_list_ICD10 WHERE Diagnosis LIKE '%#url.text#%' Order by ICD 
				</cfquery>
			<cfelse>
				<cfquery name="M0230Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message FROM #Request.prefix_db_lookup#.diagnosis_list WHERE Diagnosis LIKE '%#url.text#%'
				</cfquery>
			</cfif>
		</cfoutput>

		<h4 style="float: left">Diagnosis Select</h4>

		<div style="margin-bottom:10px;float:right;">
			<cfif isdefined('url.PTDiaSev')>
				<img title="Close" name="btnCancel" style="border:none;cursor:pointer;" onclick="clearSubWindow();ColdFusion.Window.hide('searchFormM0230M');"  src="../../images/icon_back.gif" width="33" height="35" />
			<cfelseif isdefined('url.PEDDiaSev')>
				<img title="Close" name="btnCancel" style="border:none;cursor:pointer;" onclick="clearSubWindow();ColdFusion.Window.hide('searchFormM0230M');"  src="../../images/icon_back.gif" width="33" height="35" />
			<cfelseif isdefined('url.PEDDiaSevForm') OR isdefined('url.PTDiaSevForm') OR isdefined('url.SNDiaSevForm')>
				<img title="Close" name="btnCancel" style="border:none;cursor:pointer;" onclick="clearSubWindow();ColdFusion.Window.hide('searchFormM0230M');" src="../../images/icon_back.gif" width="33" height="35" />
			<cfelseif isdefined('url.SNDiaSev')>
				<img title="Close" name="btnCancel" style="border:none;cursor:pointer;" onclick="clearSubWindow();ColdFusion.Window.hide('searchFormM0230M');"  src="../../images/icon_back.gif" width="33" height="35" />
			</cfif>
		</div>

		<table class="table table-bordered table-striped table-condensed flip-content">
			<thead>
				<tr>
					<th>Diagnosis</th>
					<th class="text-center">Action</th>
				</tr>
			</thead>
			<tbody>
				<cfif isdefined('M0230Diagnosis.recordcount') and  M0230Diagnosis.RecordCount GT 0>
					<cfloop query="M0230Diagnosis">
						<tr>
							<td>
								<cfoutput>#M0230Diagnosis.Diagnosis#</cfoutput>
							</td>
							<td class="text-center">
								<cfoutput>
									<input class="btn blue btn-sm"  name="Select" type="button" value="select" onClick="return DiagnosislistIDM0230B('#M0230Diagnosis.id#','#REPLACE(M0230Diagnosis.Diagnosis,"'","","ALL")#');"/>
								</cfoutput>
								<br/>
								<label style="color:#FF0000;"><cfoutput>#M0230Diagnosis.Case_Mix_Message#</cfoutput>
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<td align="left" valign="middle" colspan="2" height="50px">
						No Result Found
					</td>
				</cfif>
			</tbody>
		</table>
	</cfif>

	<cfif <!---isdefined('url.OTped') or isdefined('url.SNped') or  isdefined('url.stped') or isdefined('url.stadult') or isdefined('url.PTped') or isdefined('url.PTadult') or isdefined('url.snadult') or---> isdefined('url.snhospice') or isdefined('url.chaplaincomp') <!---or isdefined('url.OTadult')---> >
		<cfoutput>
			<cfif new.Assessment_Completed_M0090 gt '2015-09-30'>
				<cfquery name="M1010Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message,ICD,Code_Type FROM #Request.prefix_db_lookup#.Dx_list_ICD10 WHERE Diagnosis LIKE '%#url.text#%' Order by ICD 
				</cfquery>
			<cfelse>
				<cfquery name="M1010Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message,ICD,Code_Type FROM #Request.prefix_db_lookup#.diagnosis_list WHERE Diagnosis LIKE '%#url.text#%'
				</cfquery>
			</cfif>
		</cfoutput>

		<h4 style="float: left">Inpatient Facilities ICD10 Z-Codes</h4>

         <div style="margin-bottom:10px;float:right;">
		 
		 <cfif <!---isdefined('url.PTped') or isdefined('url.PTadult') or--->  isdefined('url.OTadult') or isdefined('url.OTped')>
		 <img title="Close" name="btnCancel" style="border:none;cursor:pointer;" onclick="ColdFusion.Window.hide('searchForm');" src="../../images/icon_back.gif" width="33" height="35" />
		<cfelse> 
		 <img title="Close" name="btnCancel" style="border:none;cursor:pointer;" onclick="ColdFusion.Window.hide('searchFormM0230M1');" src="../../images/icon_back.gif" width="33" height="35" />
		 </cfif>
		</div>

		<table class="table table-bordered table-striped table-condensed flip-content">
			<thead>
				<tr>
					<th>Diagnosis</th>
					<th width="20%" class="text-center">Action</th>
				</tr>
			</thead>
			<tbody>
				<cfif isdefined('M1010Diagnosis.recordcount') and  M1010Diagnosis.RecordCount GT 0>
					<cfloop query="M1010Diagnosis">
						<tr>
							<td>
								<cfoutput>#M1010Diagnosis.Diagnosis#</cfoutput>
							</td>
							<td class="text-center">
								<cfoutput>
									<input class="btn blue btn-sm" name="Select" type="button" value="select" onClick="return DiagnosislistID('#M1010Diagnosis.id#','#M1010Diagnosis.Code_Type#','#REPLACE(M1010Diagnosis.Diagnosis,"'","","ALL")#');"/>
								</cfoutput>
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<tr>
						<td align="left" valign="middle" colspan="2" height="50px">
							No Result Found
						</td>
					</tr>
				</cfif>
			</tbody>
		</table>
	</cfif>

	<cfif isdefined('url.M1010')>
		<cfoutput>
			<cfif new.Assessment_Completed_M0090 gt '2015-09-30'>
				<cfquery name="M1010Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message,ICD,Code_Type FROM #Request.prefix_db_lookup#.Dx_list_ICD10 WHERE Diagnosis LIKE '%#url.text#%' Order by ICD 
				</cfquery>
			<cfelse>
				<cfquery name="M1010Diagnosis" datasource="#Application.DataSrc#">
					SELECT id,Diagnosis,Case_Mix_Message,ICD,Code_Type FROM #Request.prefix_db_lookup#.diagnosis_list WHERE Diagnosis LIKE '%#url.text#%'
				</cfquery>
			</cfif>
		</cfoutput>

		<h4 style="float: left">Inpatient Facilities ICD10 Z-Codes</h4>

		<div style="margin-bottom:10px;float:right;">
			<img title="Close" name="btnCancel" style="border:none;cursor:pointer;" onclick="ColdFusion.Window.hide('searchForm');" src="../../images/icon_back.gif" width="33" height="35" />
		</div>

		<table class="table table-bordered table-striped table-condensed flip-content">
			<thead>
				<tr>
					<th>Diagnosis</th>
					<th width="20%" class="text-center">Action</th>
				</tr>
			</thead>
			<tbody>
				<cfif isdefined('M1010Diagnosis.recordcount') and  M1010Diagnosis.RecordCount GT 0>
					<cfloop query="M1010Diagnosis">
						<tr>
							<td>
								<cfoutput>#M1010Diagnosis.Diagnosis#</cfoutput>
							</td>
							<td class="text-center">
								<cfoutput>
									<input class="btn blue btn-sm" name="Select" type="button" value="select" onClick="return DiagnosislistID('#M1010Diagnosis.id#','#M1010Diagnosis.Code_Type#','#REPLACE(M1010Diagnosis.Diagnosis,"'","","ALL")#');"/>
								</cfoutput>
							</td>
						</tr>
					</cfloop>
				<cfelse>
					<tr>
						<td align="left" valign="middle" colspan="2" height="50px">
							No Result Found
						</td>
					</tr>
				</cfif>
			</tbody>
		</table>
	</cfif>
</div>

<cfif isdefined('url.M0230M1')  >
	<cfoutput>
		<cfif new.Assessment_Completed_M0090 gt '2015-09-30'>
		<cfquery name="M1010Diagnosis" datasource="#Application.DataSrc#">
				SELECT id,Diagnosis,Case_Mix_Message,ICD,Code_Type FROM #Request.prefix_db_lookup#.Dx_list_ICD10 WHERE Diagnosis LIKE '%#url.text#%' Order by ICD 
			</cfquery>
		<cfelse>
			<cfquery name="M1010Diagnosis" datasource="#Application.DataSrc#">
				SELECT id,Diagnosis,Case_Mix_Message,ICD,Code_Type FROM #Request.prefix_db_lookup#.diagnosis_list WHERE Diagnosis LIKE '%#url.text#%'
			</cfquery>
		</cfif>
	</cfoutput>

	<h4 style="float: left">Inpatient Facilities ICD10 Z-Codes</h4>

	<div style="margin-bottom:10px;float:right;">
		<img title="Close" name="btnCancel" style="border:none;cursor:pointer;" onclick="ColdFusion.Window.hide('searchFormM0230M1');" src="../../images/icon_back.gif" width="33" height="35" />
	</div>

	<table class="table table-bordered table-striped table-condensed flip-content">
		<thead>
			<tr>
				<th>Diagnosis</th>
				<th width="20%" class="text-center">Action</th>
			</tr>
		</thead>
		<tbody>
			<cfif isdefined('M1010Diagnosis.recordcount') and  M1010Diagnosis.RecordCount GT 0>
				<cfloop query="M1010Diagnosis">
					<tr>
						<td>
							<cfoutput>#M1010Diagnosis.Diagnosis#</cfoutput>
						</td>
						<td class="text-center">
							<cfoutput>
								<input class="btn blue btn-sm" name="Select" type="button" value="select" onClick="return DiagnosislistIDM0230B1('#M1010Diagnosis.id#','#M1010Diagnosis.Code_Type#','#REPLACE(M1010Diagnosis.Diagnosis,"'","","ALL")#');"/>
							</cfoutput>
							<!--- <br>
								<label style="color:#FF0000;"><cfoutput>#M1010Diagnosis.Case_Mix_Message#</cfoutput> --->
						</td>
					</tr>
				</cfloop> 
			<cfelse>
				<tr>
					<td align="left" valign="middle" colspan="2" height="50px">
						No Result Found
					</td>
				</tr>
			</cfif>
		</tbody>
	</table>
</cfif>