<%@ CodePage="1252" LCID="1046" %> <% Response.Buffer = EW_RESPONSE_BUFFER %> <% Session.Timeout = 20 %> <% Call ew_Header(False, EW_CHARSET) %> <% ' Define page object Dim receptor_list Set receptor_list = New creceptor_list Set Page = receptor_list ' Page init processing Call receptor_list.Page_Init() ' Page main processing Call receptor_list.Page_Main() %> <% If receptor.Export = "" Then %> <% End If %> <% If (receptor.Export = "") Or (EW_EXPORT_MASTER_RECORD And receptor.Export = "print") Then %> <% End If %> <% receptor_list.ShowPageHeader() %> <% ' Load recordset Set receptor_list.Recordset = receptor_list.LoadRecordset() receptor_list.TotalRecs = receptor_list.Recordset.RecordCount receptor_list.StartRec = 1 If receptor_list.DisplayRecs <= 0 Then ' Display all records receptor_list.DisplayRecs = receptor_list.TotalRecs End If If Not (receptor.ExportAll And receptor.Export <> "") Then receptor_list.SetUpStartRec() ' Set up start record position End If %>

<%= Language.Phrase("TblTypeTABLE") %><%= receptor.TableCaption %>   <% receptor_list.ExportOptions.Render "body", "" %>

<% If receptor.Export = "" And receptor.CurrentAction = "" Then %>  <%= Language.Phrase("Search") %>
    
<% End If %> <% receptor_list.ShowMessage %>
<% If receptor.Export = "" Then %>
<% If receptor.CurrentAction <> "gridadd" And receptor.CurrentAction <> "gridedit" Then %>
<% If Not IsObject(receptor_list.Pager) Then Set receptor_list.Pager = ew_NewPrevNextPager(receptor_list.StartRec, receptor_list.DisplayRecs, receptor_list.TotalRecs) %> <% If receptor_list.Pager.RecordCount > 0 Then %> <% If receptor_list.Pager.FirstButton.Enabled Then %> <% Else %> <% End If %> <% If receptor_list.Pager.PrevButton.Enabled Then %> <% Else %> <% End If %> <% If receptor_list.Pager.NextButton.Enabled Then %> <% Else %> <% End If %> <% If receptor_list.Pager.LastButton.Enabled Then %> <% Else %> <% End If %>
<%= Language.Phrase("Page") %>  <%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"> <%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"> <%= Language.Phrase("Of") %> <%= receptor_list.Pager.PageCount %>
     <%= Language.Phrase("Record") %> <%= receptor_list.Pager.FromIndex %> <%= Language.Phrase("To") %> <%= receptor_list.Pager.ToIndex %> <%= Language.Phrase("Of") %> <%= receptor_list.Pager.RecordCount %> <% Else %> <% If receptor_list.SearchWhere = "0=101" Then %> <%= Language.Phrase("EnterSearchCriteria") %> <% Else %> <%= Language.Phrase("NoRecord") %> <% End If %> <% End If %>
<% End If %> <%= Language.Phrase("AddLink") %>   <% If mapa_transfusional.DetailAdd Then %> "><%= Language.Phrase("AddLink") %> <%= receptor.TableCaption %>/<%= mapa_transfusional.TableCaption %>   <% End If %> <% If provas_cruzadas.DetailAdd Then %> "><%= Language.Phrase("AddLink") %> <%= receptor.TableCaption %>/<%= provas_cruzadas.TableCaption %>   <% End If %> <% If receptor_list.TotalRecs > 0 Then %> <%= Language.Phrase("DeleteSelectedLink") %>   <% End If %>
<% End If %>
<% If receptor_list.TotalRecs > 0 Then %> <%= receptor.TableCustomInnerHTML %> <% Call receptor_list.RenderListOptions() ' Render list options (header, left) receptor_list.ListOptions.Render "header", "left" %> <% If receptor.ID.Visible Then ' ID %> <% If receptor.SortUrl(receptor.ID) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.REGISTRO_GERAL.Visible Then ' REGISTRO_GERAL %> <% If receptor.SortUrl(receptor.REGISTRO_GERAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.NOME_PACIENTE.Visible Then ' NOME_PACIENTE %> <% If receptor.SortUrl(receptor.NOME_PACIENTE) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.IDADE_PACIENTE.Visible Then ' IDADE_PACIENTE %> <% If receptor.SortUrl(receptor.IDADE_PACIENTE) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.PESO_PACIENTE.Visible Then ' PESO_PACIENTE %> <% If receptor.SortUrl(receptor.PESO_PACIENTE) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.SEXO_PACIENTE.Visible Then ' SEXO_PACIENTE %> <% If receptor.SortUrl(receptor.SEXO_PACIENTE) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.NACIONALIDADE.Visible Then ' NACIONALIDADE %> <% If receptor.SortUrl(receptor.NACIONALIDADE) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.LOCAL.Visible Then ' LOCAL %> <% If receptor.SortUrl(receptor.LOCAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.QUARTO.Visible Then ' QUARTO %> <% If receptor.SortUrl(receptor.QUARTO) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.LEITO.Visible Then ' LEITO %> <% If receptor.SortUrl(receptor.LEITO) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.HIPOTESE_DIAGNOSTICA.Visible Then ' HIPOTESE_DIAGNOSTICA %> <% If receptor.SortUrl(receptor.HIPOTESE_DIAGNOSTICA) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.HISTORICO_TRANSFUCIONAL.Visible Then ' HISTORICO_TRANSFUCIONAL %> <% If receptor.SortUrl(receptor.HISTORICO_TRANSFUCIONAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.REACAO_TRANSFUCIONAL.Visible Then ' REACAO_TRANSFUCIONAL %> <% If receptor.SortUrl(receptor.REACAO_TRANSFUCIONAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.QUAL.Visible Then ' QUAL %> <% If receptor.SortUrl(receptor.QUAL) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.GESTACAO_ABORTOS.Visible Then ' GESTACAO_ABORTOS %> <% If receptor.SortUrl(receptor.GESTACAO_ABORTOS) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.QUANTOS.Visible Then ' QUANTOS %> <% If receptor.SortUrl(receptor.QUANTOS) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.ABO.Visible Then ' ABO %> <% If receptor.SortUrl(receptor.ABO) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.RH.Visible Then ' RH %> <% If receptor.SortUrl(receptor.RH) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.SENSIBILIDADE.Visible Then ' SENSIBILIDADE %> <% If receptor.SortUrl(receptor.SENSIBILIDADE) = "" Then %> <% Else %> <% End If %> <% End If %> <% If receptor.FONTE_PAGA.Visible Then ' FONTE_PAGA %> <% If receptor.SortUrl(receptor.FONTE_PAGA) = "" Then %> <% Else %> <% End If %> <% End If %> <% ' Render list options (header, right) receptor_list.ListOptions.Render "header", "right" %> <% If (receptor.ExportAll And receptor.Export <> "") Then receptor_list.StopRec = receptor_list.TotalRecs Else ' Set the last record to display If receptor_list.TotalRecs > receptor_list.StartRec + receptor_list.DisplayRecs - 1 Then receptor_list.StopRec = receptor_list.StartRec + receptor_list.DisplayRecs - 1 Else receptor_list.StopRec = receptor_list.TotalRecs End If End If ' Move to first record receptor_list.RecCnt = receptor_list.StartRec - 1 If Not receptor_list.Recordset.Eof Then receptor_list.Recordset.MoveFirst If receptor_list.StartRec > 1 Then receptor_list.Recordset.Move receptor_list.StartRec - 1 ElseIf Not receptor.AllowAddDeleteRow And receptor_list.StopRec = 0 Then receptor_list.StopRec = receptor.GridAddRowCount End If ' Initialize Aggregate receptor.RowType = EW_ROWTYPE_AGGREGATEINIT Call receptor.ResetAttrs() Call receptor_list.RenderRow() receptor_list.RowCnt = 0 ' Output date rows Do While CLng(receptor_list.RecCnt) < CLng(receptor_list.StopRec) receptor_list.RecCnt = receptor_list.RecCnt + 1 If CLng(receptor_list.RecCnt) >= CLng(receptor_list.StartRec) Then receptor_list.RowCnt = receptor_list.RowCnt + 1 ' Set up key count receptor_list.KeyCount = receptor_list.RowIndex Call receptor.ResetAttrs() receptor.CssClass = "" If receptor.CurrentAction = "gridadd" Then Else Call receptor_list.LoadRowValues(receptor_list.Recordset) ' Load row values End If receptor.RowType = EW_ROWTYPE_VIEW ' Render view receptor.RowAttrs.AddAttributes Array(Array("onmouseover", "ew_MouseOver(event, this);"), Array("onmouseout", "ew_MouseOut(event, this);"), Array("onclick", "ew_Click(event, this);")) ' Render row Call receptor_list.RenderRow() ' Render list options Call receptor_list.RenderListOptions() %> > <% ' Render list options (body, left) receptor_list.ListOptions.Render "body", "left" %> <% If receptor.ID.Visible Then ' ID %> > ><%= receptor.ID.ListViewValue %> " id="<%= receptor_list.PageObjName & "_row_" & receptor_list.RowCnt %>"> <% End If %> <% If receptor.REGISTRO_GERAL.Visible Then ' REGISTRO_GERAL %> > ><%= receptor.REGISTRO_GERAL.ListViewValue %> <% End If %> <% If receptor.NOME_PACIENTE.Visible Then ' NOME_PACIENTE %> > ><%= receptor.NOME_PACIENTE.ListViewValue %> <% End If %> <% If receptor.IDADE_PACIENTE.Visible Then ' IDADE_PACIENTE %> > ><%= receptor.IDADE_PACIENTE.ListViewValue %> <% End If %> <% If receptor.PESO_PACIENTE.Visible Then ' PESO_PACIENTE %> > ><%= receptor.PESO_PACIENTE.ListViewValue %> <% End If %> <% If receptor.SEXO_PACIENTE.Visible Then ' SEXO_PACIENTE %> > ><%= receptor.SEXO_PACIENTE.ListViewValue %> <% End If %> <% If receptor.NACIONALIDADE.Visible Then ' NACIONALIDADE %> > ><%= receptor.NACIONALIDADE.ListViewValue %> <% End If %> <% If receptor.LOCAL.Visible Then ' LOCAL %> > ><%= receptor.LOCAL.ListViewValue %> <% End If %> <% If receptor.QUARTO.Visible Then ' QUARTO %> > ><%= receptor.QUARTO.ListViewValue %> <% End If %> <% If receptor.LEITO.Visible Then ' LEITO %> > ><%= receptor.LEITO.ListViewValue %> <% End If %> <% If receptor.HIPOTESE_DIAGNOSTICA.Visible Then ' HIPOTESE_DIAGNOSTICA %> > ><%= receptor.HIPOTESE_DIAGNOSTICA.ListViewValue %> <% End If %> <% If receptor.HISTORICO_TRANSFUCIONAL.Visible Then ' HISTORICO_TRANSFUCIONAL %> > ><%= receptor.HISTORICO_TRANSFUCIONAL.ListViewValue %> <% End If %> <% If receptor.REACAO_TRANSFUCIONAL.Visible Then ' REACAO_TRANSFUCIONAL %> > ><%= receptor.REACAO_TRANSFUCIONAL.ListViewValue %> <% End If %> <% If receptor.QUAL.Visible Then ' QUAL %> > ><%= receptor.QUAL.ListViewValue %> <% End If %> <% If receptor.GESTACAO_ABORTOS.Visible Then ' GESTACAO_ABORTOS %> > ><%= receptor.GESTACAO_ABORTOS.ListViewValue %> <% End If %> <% If receptor.QUANTOS.Visible Then ' QUANTOS %> > ><%= receptor.QUANTOS.ListViewValue %> <% End If %> <% If receptor.ABO.Visible Then ' ABO %> > ><%= receptor.ABO.ListViewValue %> <% End If %> <% If receptor.RH.Visible Then ' RH %> > ><%= receptor.RH.ListViewValue %> <% End If %> <% If receptor.SENSIBILIDADE.Visible Then ' SENSIBILIDADE %> > ><%= receptor.SENSIBILIDADE.ListViewValue %> <% End If %> <% If receptor.FONTE_PAGA.Visible Then ' FONTE_PAGA %> > ><%= receptor.FONTE_PAGA.ListViewValue %> <% End If %> <% ' Render list options (body, right) receptor_list.ListOptions.Render "body", "right" %> <% End If If receptor.CurrentAction <> "gridadd" Then receptor_list.Recordset.MoveNext() End If Loop %>
<%= receptor.ID.FldCaption %>
<%= receptor.ID.FldCaption %><% If receptor.ID.Sort = "ASC" Then %><% ElseIf receptor.ID.Sort = "DESC" Then %><% End If %>
<%= receptor.REGISTRO_GERAL.FldCaption %>
<%= receptor.REGISTRO_GERAL.FldCaption %><% If receptor.REGISTRO_GERAL.Sort = "ASC" Then %><% ElseIf receptor.REGISTRO_GERAL.Sort = "DESC" Then %><% End If %>
<%= receptor.NOME_PACIENTE.FldCaption %>
<%= receptor.NOME_PACIENTE.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.NOME_PACIENTE.Sort = "ASC" Then %><% ElseIf receptor.NOME_PACIENTE.Sort = "DESC" Then %><% End If %>
<%= receptor.IDADE_PACIENTE.FldCaption %>
<%= receptor.IDADE_PACIENTE.FldCaption %><% If receptor.IDADE_PACIENTE.Sort = "ASC" Then %><% ElseIf receptor.IDADE_PACIENTE.Sort = "DESC" Then %><% End If %>
<%= receptor.PESO_PACIENTE.FldCaption %>
<%= receptor.PESO_PACIENTE.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.PESO_PACIENTE.Sort = "ASC" Then %><% ElseIf receptor.PESO_PACIENTE.Sort = "DESC" Then %><% End If %>
<%= receptor.SEXO_PACIENTE.FldCaption %>
<%= receptor.SEXO_PACIENTE.FldCaption %><% If receptor.SEXO_PACIENTE.Sort = "ASC" Then %><% ElseIf receptor.SEXO_PACIENTE.Sort = "DESC" Then %><% End If %>
<%= receptor.NACIONALIDADE.FldCaption %>
<%= receptor.NACIONALIDADE.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.NACIONALIDADE.Sort = "ASC" Then %><% ElseIf receptor.NACIONALIDADE.Sort = "DESC" Then %><% End If %>
<%= receptor.LOCAL.FldCaption %>
<%= receptor.LOCAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.LOCAL.Sort = "ASC" Then %><% ElseIf receptor.LOCAL.Sort = "DESC" Then %><% End If %>
<%= receptor.QUARTO.FldCaption %>
<%= receptor.QUARTO.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.QUARTO.Sort = "ASC" Then %><% ElseIf receptor.QUARTO.Sort = "DESC" Then %><% End If %>
<%= receptor.LEITO.FldCaption %>
<%= receptor.LEITO.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.LEITO.Sort = "ASC" Then %><% ElseIf receptor.LEITO.Sort = "DESC" Then %><% End If %>
<%= receptor.HIPOTESE_DIAGNOSTICA.FldCaption %>
<%= receptor.HIPOTESE_DIAGNOSTICA.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.HIPOTESE_DIAGNOSTICA.Sort = "ASC" Then %><% ElseIf receptor.HIPOTESE_DIAGNOSTICA.Sort = "DESC" Then %><% End If %>
<%= receptor.HISTORICO_TRANSFUCIONAL.FldCaption %>
<%= receptor.HISTORICO_TRANSFUCIONAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.HISTORICO_TRANSFUCIONAL.Sort = "ASC" Then %><% ElseIf receptor.HISTORICO_TRANSFUCIONAL.Sort = "DESC" Then %><% End If %>
<%= receptor.REACAO_TRANSFUCIONAL.FldCaption %>
<%= receptor.REACAO_TRANSFUCIONAL.FldCaption %><% If receptor.REACAO_TRANSFUCIONAL.Sort = "ASC" Then %><% ElseIf receptor.REACAO_TRANSFUCIONAL.Sort = "DESC" Then %><% End If %>
<%= receptor.QUAL.FldCaption %>
<%= receptor.QUAL.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.QUAL.Sort = "ASC" Then %><% ElseIf receptor.QUAL.Sort = "DESC" Then %><% End If %>
<%= receptor.GESTACAO_ABORTOS.FldCaption %>
<%= receptor.GESTACAO_ABORTOS.FldCaption %><% If receptor.GESTACAO_ABORTOS.Sort = "ASC" Then %><% ElseIf receptor.GESTACAO_ABORTOS.Sort = "DESC" Then %><% End If %>
<%= receptor.QUANTOS.FldCaption %>
<%= receptor.QUANTOS.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.QUANTOS.Sort = "ASC" Then %><% ElseIf receptor.QUANTOS.Sort = "DESC" Then %><% End If %>
<%= receptor.ABO.FldCaption %>
<%= receptor.ABO.FldCaption %><% If receptor.ABO.Sort = "ASC" Then %><% ElseIf receptor.ABO.Sort = "DESC" Then %><% End If %>
<%= receptor.RH.FldCaption %>
<%= receptor.RH.FldCaption %><% If receptor.RH.Sort = "ASC" Then %><% ElseIf receptor.RH.Sort = "DESC" Then %><% End If %>
<%= receptor.SENSIBILIDADE.FldCaption %>
<%= receptor.SENSIBILIDADE.FldCaption %><%= Language.Phrase("SrchLegend") %><% If receptor.SENSIBILIDADE.Sort = "ASC" Then %><% ElseIf receptor.SENSIBILIDADE.Sort = "DESC" Then %><% End If %>
<%= receptor.FONTE_PAGA.FldCaption %>
<%= receptor.FONTE_PAGA.FldCaption %><% If receptor.FONTE_PAGA.Sort = "ASC" Then %><% ElseIf receptor.FONTE_PAGA.Sort = "DESC" Then %><% End If %>
<% End If %>
<% ' Close recordset and connection receptor_list.Recordset.Close Set receptor_list.Recordset = Nothing %> <% If receptor_list.TotalRecs > 0 Then %> <% If receptor.Export = "" Then %>
<% If receptor.CurrentAction <> "gridadd" And receptor.CurrentAction <> "gridedit" Then %>
<% If Not IsObject(receptor_list.Pager) Then Set receptor_list.Pager = ew_NewPrevNextPager(receptor_list.StartRec, receptor_list.DisplayRecs, receptor_list.TotalRecs) %> <% If receptor_list.Pager.RecordCount > 0 Then %> <% If receptor_list.Pager.FirstButton.Enabled Then %> <% Else %> <% End If %> <% If receptor_list.Pager.PrevButton.Enabled Then %> <% Else %> <% End If %> <% If receptor_list.Pager.NextButton.Enabled Then %> <% Else %> <% End If %> <% If receptor_list.Pager.LastButton.Enabled Then %> <% Else %> <% End If %>
<%= Language.Phrase("Page") %>  <%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"> <%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"><%= Language.Phrase(" width="16" height="16" border="0"> <%= Language.Phrase("Of") %> <%= receptor_list.Pager.PageCount %>
     <%= Language.Phrase("Record") %> <%= receptor_list.Pager.FromIndex %> <%= Language.Phrase("To") %> <%= receptor_list.Pager.ToIndex %> <%= Language.Phrase("Of") %> <%= receptor_list.Pager.RecordCount %> <% Else %> <% If receptor_list.SearchWhere = "0=101" Then %> <%= Language.Phrase("EnterSearchCriteria") %> <% Else %> <%= Language.Phrase("NoRecord") %> <% End If %> <% End If %>
<% End If %> <%= Language.Phrase("AddLink") %>   <% If mapa_transfusional.DetailAdd Then %> "><%= Language.Phrase("AddLink") %> <%= receptor.TableCaption %>/<%= mapa_transfusional.TableCaption %>   <% End If %> <% If provas_cruzadas.DetailAdd Then %> "><%= Language.Phrase("AddLink") %> <%= receptor.TableCaption %>/<%= provas_cruzadas.TableCaption %>   <% End If %> <% If receptor_list.TotalRecs > 0 Then %> <%= Language.Phrase("DeleteSelectedLink") %>   <% End If %>
<% End If %> <% End If %>
<% If receptor.Export = "" And receptor.CurrentAction = "" Then %> <% End If %> <% receptor_list.ShowPageFooter() If EW_DEBUG_ENABLED Then Response.Write ew_DebugMsg() %> <% If receptor.Export = "" Then %> <% End If %> <% ' Drop page object Set receptor_list = Nothing %> <% ' ----------------------------------------------------------------- ' Page Class ' Class creceptor_list ' Page ID Public Property Get PageID() PageID = "list" End Property ' Table Name Public Property Get TableName() TableName = "receptor" End Property ' Page Object Name Public Property Get PageObjName() PageObjName = "receptor_list" End Property ' Page Name Public Property Get PageName() PageName = ew_CurrentPage() End Property ' Page Url Public Property Get PageUrl() PageUrl = ew_CurrentPage() & "?" If receptor.UseTokenInUrl Then PageUrl = PageUrl & "t=" & receptor.TableVar & "&" ' add page token End Property ' Common urls Dim AddUrl Dim EditUrl Dim CopyUrl Dim DeleteUrl Dim ViewUrl Dim ListUrl ' Export urls Dim ExportPrintUrl Dim ExportHtmlUrl Dim ExportExcelUrl Dim ExportWordUrl Dim ExportXmlUrl Dim ExportCsvUrl ' Inline urls Dim InlineAddUrl Dim InlineCopyUrl Dim InlineEditUrl Dim GridAddUrl Dim GridEditUrl Dim MultiDeleteUrl Dim MultiUpdateUrl ' Message Public Property Get Message() Message = Session(EW_SESSION_MESSAGE) End Property Public Property Let Message(v) Dim msg msg = Session(EW_SESSION_MESSAGE) Call ew_AddMessage(msg, v) Session(EW_SESSION_MESSAGE) = msg End Property Public Property Get FailureMessage() FailureMessage = Session(EW_SESSION_FAILURE_MESSAGE) End Property Public Property Let FailureMessage(v) Dim msg msg = Session(EW_SESSION_FAILURE_MESSAGE) Call ew_AddMessage(msg, v) Session(EW_SESSION_FAILURE_MESSAGE) = msg End Property Public Property Get SuccessMessage() SuccessMessage = Session(EW_SESSION_SUCCESS_MESSAGE) End Property Public Property Let SuccessMessage(v) Dim msg msg = Session(EW_SESSION_SUCCESS_MESSAGE) Call ew_AddMessage(msg, v) Session(EW_SESSION_SUCCESS_MESSAGE) = msg End Property ' Show Message Public Sub ShowMessage() Dim sMessage sMessage = Message Call Message_Showing(sMessage, "") If sMessage <> "" Then Response.Write "

" & sMessage & "

" Session(EW_SESSION_MESSAGE) = "" ' Clear message in Session ' Success message Dim sSuccessMessage sSuccessMessage = SuccessMessage Call Message_Showing(sSuccessMessage, "success") If sSuccessMessage <> "" Then Response.Write "

" & sSuccessMessage & "

" Session(EW_SESSION_SUCCESS_MESSAGE) = "" ' Clear message in Session ' Failure message Dim sErrorMessage sErrorMessage = FailureMessage Call Message_Showing(sErrorMessage, "failure") If sErrorMessage <> "" Then Response.Write "

" & sErrorMessage & "

" Session(EW_SESSION_FAILURE_MESSAGE) = "" ' Clear message in Session End Sub Dim PageHeader Dim PageFooter ' Show Page Header Public Sub ShowPageHeader() Dim sHeader sHeader = PageHeader Call Page_DataRendering(sHeader) If sHeader <> "" Then ' Header exists, display Response.Write "

" & sHeader & "

" End If End Sub ' Show Page Footer Public Sub ShowPageFooter() Dim sFooter sFooter = PageFooter Call Page_DataRendered(sFooter) If sFooter <> "" Then ' Footer exists, display Response.Write "

" & sFooter & "

" End If End Sub ' ----------------------- ' Validate Page request ' Public Function IsPageRequest() If receptor.UseTokenInUrl Then IsPageRequest = False If Not (ObjForm Is Nothing) Then IsPageRequest = (receptor.TableVar = ObjForm.GetValue("t")) End If If Request.QueryString("t").Count > 0 Then IsPageRequest = (receptor.TableVar = Request.QueryString("t")) End If Else IsPageRequest = True End If End Function ' ----------------------------------------------------------------- ' Class initialize ' - init objects ' - open ADO connection ' Private Sub Class_Initialize() If IsEmpty(StartTimer) Then StartTimer = Timer ' Init start time ' Initialize language object If IsEmpty(Language) Then Set Language = New cLanguage Call Language.LoadPhrases() End If ' Initialize table object If IsEmpty(receptor) Then Set receptor = New creceptor Set Table = receptor ' Initialize urls ExportPrintUrl = PageUrl & "export=print" ExportExcelUrl = PageUrl & "export=excel" ExportWordUrl = PageUrl & "export=word" ExportHtmlUrl = PageUrl & "export=html" ExportXmlUrl = PageUrl & "export=xml" ExportCsvUrl = PageUrl & "export=csv" AddUrl = "receptoradd.asp?" & EW_TABLE_SHOW_DETAIL & "=" InlineAddUrl = PageUrl & "a=add" GridAddUrl = PageUrl & "a=gridadd" GridEditUrl = PageUrl & "a=gridedit" MultiDeleteUrl = "receptordelete.asp" MultiUpdateUrl = "receptorupdate.asp" ' Initialize other table object If IsEmpty(mapa_transfusional) Then Set mapa_transfusional = New cmapa_transfusional ' Initialize other table object If IsEmpty(provas_cruzadas) Then Set provas_cruzadas = New cprovas_cruzadas ' Initialize form object Set ObjForm = Nothing ' Intialize page id (for backward compatibility) EW_PAGE_ID = "list" ' Initialize table name (for backward compatibility) EW_TABLE_NAME = "receptor" ' Open connection to the database If IsEmpty(Conn) Then Call ew_Connect() ' Initialize list options Set ListOptions = New cListOptions ' Export options Set ExportOptions = New cListOptions ExportOptions.Tag = "span" ExportOptions.Separator = "  " End Sub ' ----------------------------------------------------------------- ' Subroutine Page_Init ' - called before page main ' - check Security ' - set up response header ' - call page load events ' Sub Page_Init() ' Get export parameters If Request.QueryString("export").Count > 0 Then receptor.Export = Request.QueryString("export") ElseIf Request.ServerVariables("HTTP_CONTENT_TYPE") = "application/x-www-form-urlencoded" Then If Request.Form("exporttype").Count > 0 Then receptor.Export = Request.Form("exporttype") End If Else receptor.ExportReturnUrl = ew_CurrentUrl() End If gsExport = receptor.Export ' Get export parameter, used in header gsExportFile = receptor.TableVar ' Get export file, used in header Dim Charset ' Charset used in header If EW_CHARSET <> "" Then Charset = ";charset=" & EW_CHARSET Else Charset = "" End If If receptor.Export = "excel" Then Response.ContentType = "application/vnd.ms-excel" & Charset Response.AddHeader "Content-Disposition", "attachment; filename=" & gsExportFile & ".xls" End If If receptor.Export = "csv" Then Response.ContentType = "application/csv" & Charset Response.AddHeader "Content-Disposition:", "attachment; filename=" & gsExportFile & ".csv" End If ' Get grid add count Dim gridaddcnt gridaddcnt = Request.QueryString(EW_TABLE_GRID_ADD_ROW_COUNT) If IsNumeric(gridaddcnt) Then If gridaddcnt > 0 Then receptor.GridAddRowCount = gridaddcnt End If End If ' Set up list options SetupListOptions() ' Setup export options SetupExportOptions() ' Global page loading event (in userfn7.asp) Call Page_Loading() ' Page load event, used in current page Call Page_Load() End Sub ' ----------------------------------------------------------------- ' Class terminate ' - clean up page object ' Private Sub Class_Terminate() Call Page_Terminate("") End Sub ' ----------------------------------------------------------------- ' Subroutine Page_Terminate ' - called when exit page ' - clean up ADO connection and objects ' - if url specified, redirect to url ' Sub Page_Terminate(url) ' Page unload event, used in current page Call Page_Unload() ' Global page unloaded event (in userfn60.asp) Call Page_Unloaded() Dim sRedirectUrl sReDirectUrl = url Call Page_Redirecting(sReDirectUrl) If Not (Conn Is Nothing) Then Conn.Close ' Close Connection Set Conn = Nothing Set receptor = Nothing Set ListOptions = Nothing Set ObjForm = Nothing ' Go to url if specified If sReDirectUrl <> "" Then If Response.Buffer Then Response.Clear Response.Redirect sReDirectUrl End If End Sub ' ' Subroutine Page_Terminate (End) ' ---------------------------------------- Dim DisplayRecs ' Number of display records Dim StartRec, StopRec, TotalRecs, RecRange Dim SearchWhere Dim RecCnt Dim EditRowCnt Dim RowCnt, RowIndex Dim RecPerRow, ColCnt Dim KeyCount Dim RowAction Dim RowOldKey ' Row old key (for copy) Dim DbMasterFilter, DbDetailFilter Dim MasterRecordExists Dim ListOptions Dim ExportOptions Dim MultiSelectKey Dim RestoreSearch Dim Recordset, OldRecordset ' ----------------------------------------------------------------- ' Page main processing ' Sub Page_Main() DisplayRecs = 20 RecRange = 10 RecCnt = 0 ' Record count KeyCount = 0 ' Key count ' Search filters Dim sSrchAdvanced, sSrchBasic, sFilter sSrchAdvanced = "" ' Advanced search filter sSrchBasic = "" ' Basic search filter SearchWhere = "" ' Search where clause sFilter = "" ' Master/Detail DbMasterFilter = "" ' Master filter DbDetailFilter = "" ' Detail filter If IsPageRequest Then ' Validate request ' Handle reset command ResetCmd() ' Hide all options If receptor.Export <> "" Or receptor.CurrentAction = "gridadd" Or receptor.CurrentAction = "gridedit" Then ListOptions.HideAllOptions() ExportOptions.HideAllOptions() End If ' Get basic search values Call LoadBasicSearchValues() ' Restore search parms from Session Call RestoreSearchParms() ' Call Recordset SearchValidated event Call receptor.Recordset_SearchValidated() ' Set Up Sorting Order SetUpSortOrder() ' Get basic search criteria If gsSearchError = "" Then sSrchBasic = BasicSearchWhere() End If End If ' End Validate Request ' Restore display records If receptor.RecordsPerPage <> "" Then DisplayRecs = receptor.RecordsPerPage ' Restore from Session Else DisplayRecs = 20 ' Load default End If ' Load Sorting Order LoadSortOrder() ' Build search criteria Call ew_AddFilter(SearchWhere, sSrchAdvanced) Call ew_AddFilter(SearchWhere, sSrchBasic) ' Call Recordset Searching event Call receptor.Recordset_Searching(SearchWhere) ' Save search criteria If SearchWhere <> "" Then If sSrchBasic = "" Then Call ResetBasicSearchParms() receptor.SearchWhere = SearchWhere ' Save to Session If Not RestoreSearch Then StartRec = 1 ' Reset start record counter receptor.StartRecordNumber = StartRec End If Else SearchWhere = receptor.SearchWhere End If sFilter = "" Call ew_AddFilter(sFilter, DbDetailFilter) Call ew_AddFilter(sFilter, SearchWhere) ' Set up filter in Session receptor.SessionWhere = sFilter receptor.CurrentFilter = "" ' Export Data only If receptor.Export = "html" Or receptor.Export = "csv" Or receptor.Export = "word" Or receptor.Export = "excel" Or receptor.Export = "xml" Then Call ExportData() Call Page_Terminate("") ' Clean up Response.End ' Terminate response ElseIf receptor.Export = "email" Then Call ExportData() Response.End End If End Sub ' ----------------------------------------------------------------- ' Return Basic Search sql ' Function BasicSearchSQL(Keyword) Dim sWhere sWhere = "" Call BuildBasicSearchSQL(sWhere, receptor.NOME_PACIENTE, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.PESO_PACIENTE, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.SEXO_PACIENTE, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.NACIONALIDADE, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.LOCAL, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.QUARTO, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.LEITO, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.HIPOTESE_DIAGNOSTICA, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.HISTORICO_TRANSFUCIONAL, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.REACAO_TRANSFUCIONAL, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.QUAL, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.GESTACAO_ABORTOS, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.QUANTOS, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.ABO, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.RH, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.SENSIBILIDADE, Keyword) Call BuildBasicSearchSQL(sWhere, receptor.FONTE_PAGA, Keyword) BasicSearchSQL = sWhere End Function ' ----------------------------------------------------------------- ' Build basic search sql ' Sub BuildBasicSearchSql(Where, Fld, Keyword) Dim sFldExpression, lFldDataType Dim sWrk If Fld.FldVirtualExpression <> "" Then sFldExpression = Fld.FldVirtualExpression Else sFldExpression = Fld.FldExpression End If lFldDataType = Fld.FldDataType If Fld.FldIsVirtual Then lFldDataType = EW_DATATYPE_STRING If lFldDataType = EW_DATATYPE_NUMBER Then sWrk = sFldExpression & " = " & ew_QuotedValue(Keyword, lFldDataType) Else sWrk = sFldExpression & ew_Like(ew_QuotedValue("%" & Keyword & "%", lFldDataType)) End If If Where <> "" Then Where = Where & " OR " Where = Where & sWrk End Sub ' ----------------------------------------------------------------- ' Return Basic Search Where based on search keyword and type ' Function BasicSearchWhere() Dim sSearchStr, sSearchKeyword, sSearchType Dim sSearch, arKeyword, sKeyword sSearchStr = "" sSearchKeyword = receptor.BasicSearchKeyword sSearchType = receptor.BasicSearchType If sSearchKeyword <> "" Then sSearch = Trim(sSearchKeyword) If sSearchType <> "" Then While InStr(sSearch, " ") > 0 sSearch = Replace(sSearch, " ", " ") Wend arKeyword = Split(Trim(sSearch), " ") For Each sKeyword In arKeyword If sSearchStr <> "" Then sSearchStr = sSearchStr & " " & sSearchType & " " sSearchStr = sSearchStr & "(" & BasicSearchSQL(sKeyword) & ")" Next Else sSearchStr = BasicSearchSQL(sSearch) End If End If If sSearchKeyword <> "" then receptor.SessionBasicSearchKeyword = sSearchKeyword receptor.SessionBasicSearchType = sSearchType End If BasicSearchWhere = sSearchStr End Function ' ----------------------------------------------------------------- ' Clear all search parameters ' Sub ResetSearchParms() ' Clear search where SearchWhere = "" receptor.SearchWhere = SearchWhere ' Clear basic search parameters Call ResetBasicSearchParms() End Sub ' ----------------------------------------------------------------- ' Clear all basic search parameters ' Sub ResetBasicSearchParms() ' Clear basic search parameters receptor.SessionBasicSearchKeyword = "" receptor.SessionBasicSearchType = "" End Sub ' ----------------------------------------------------------------- ' Restore all search parameters ' Sub RestoreSearchParms() Dim bRestore bRestore = True If receptor.BasicSearchKeyword & "" <> "" Then bRestore = False RestoreSearch = bRestore If bRestore Then ' Restore basic search values receptor.BasicSearchKeyword = receptor.SessionBasicSearchKeyword receptor.BasicSearchType = receptor.SessionBasicSearchType End If End Sub ' ----------------------------------------------------------------- ' Set up Sort parameters based on Sort Links clicked ' Sub SetUpSortOrder() Dim sOrderBy Dim sSortField, sLastSort, sThisSort Dim bCtrl ' Check for an Order parameter If Request.QueryString("order").Count > 0 Then receptor.CurrentOrder = Request.QueryString("order") receptor.CurrentOrderType = Request.QueryString("ordertype") ' Field ID Call receptor.UpdateSort(receptor.ID) ' Field REGISTRO_GERAL Call receptor.UpdateSort(receptor.REGISTRO_GERAL) ' Field NOME_PACIENTE Call receptor.UpdateSort(receptor.NOME_PACIENTE) ' Field IDADE_PACIENTE Call receptor.UpdateSort(receptor.IDADE_PACIENTE) ' Field PESO_PACIENTE Call receptor.UpdateSort(receptor.PESO_PACIENTE) ' Field SEXO_PACIENTE Call receptor.UpdateSort(receptor.SEXO_PACIENTE) ' Field NACIONALIDADE Call receptor.UpdateSort(receptor.NACIONALIDADE) ' Field LOCAL Call receptor.UpdateSort(receptor.LOCAL) ' Field QUARTO Call receptor.UpdateSort(receptor.QUARTO) ' Field LEITO Call receptor.UpdateSort(receptor.LEITO) ' Field HIPOTESE_DIAGNOSTICA Call receptor.UpdateSort(receptor.HIPOTESE_DIAGNOSTICA) ' Field HISTORICO_TRANSFUCIONAL Call receptor.UpdateSort(receptor.HISTORICO_TRANSFUCIONAL) ' Field REACAO_TRANSFUCIONAL Call receptor.UpdateSort(receptor.REACAO_TRANSFUCIONAL) ' Field QUAL Call receptor.UpdateSort(receptor.QUAL) ' Field GESTACAO_ABORTOS Call receptor.UpdateSort(receptor.GESTACAO_ABORTOS) ' Field QUANTOS Call receptor.UpdateSort(receptor.QUANTOS) ' Field ABO Call receptor.UpdateSort(receptor.ABO) ' Field RH Call receptor.UpdateSort(receptor.RH) ' Field SENSIBILIDADE Call receptor.UpdateSort(receptor.SENSIBILIDADE) ' Field FONTE_PAGA Call receptor.UpdateSort(receptor.FONTE_PAGA) receptor.StartRecordNumber = 1 ' Reset start position End If End Sub ' ----------------------------------------------------------------- ' Load Sort Order parameters ' Sub LoadSortOrder() Dim sOrderBy sOrderBy = receptor.SessionOrderBy ' Get order by from Session If sOrderBy = "" Then If receptor.SqlOrderBy <> "" Then sOrderBy = receptor.SqlOrderBy receptor.SessionOrderBy = sOrderBy receptor.REGISTRO_GERAL.Sort = "DESC" End If End If End Sub ' ----------------------------------------------------------------- ' Reset command based on querystring parameter cmd= ' - RESET: reset search parameters ' - RESETALL: reset search & master/detail parameters ' - RESETSORT: reset sort parameters ' Sub ResetCmd() Dim sCmd ' Get reset cmd If Request.QueryString("cmd").Count > 0 Then sCmd = Request.QueryString("cmd") ' Reset search criteria If LCase(sCmd) = "reset" Or LCase(sCmd) = "resetall" Then Call ResetSearchParms() End If ' Reset Sort Criteria If LCase(sCmd) = "resetsort" Then Dim sOrderBy sOrderBy = "" receptor.SessionOrderBy = sOrderBy receptor.ID.Sort = "" receptor.REGISTRO_GERAL.Sort = "" receptor.NOME_PACIENTE.Sort = "" receptor.IDADE_PACIENTE.Sort = "" receptor.PESO_PACIENTE.Sort = "" receptor.SEXO_PACIENTE.Sort = "" receptor.NACIONALIDADE.Sort = "" receptor.LOCAL.Sort = "" receptor.QUARTO.Sort = "" receptor.LEITO.Sort = "" receptor.HIPOTESE_DIAGNOSTICA.Sort = "" receptor.HISTORICO_TRANSFUCIONAL.Sort = "" receptor.REACAO_TRANSFUCIONAL.Sort = "" receptor.QUAL.Sort = "" receptor.GESTACAO_ABORTOS.Sort = "" receptor.QUANTOS.Sort = "" receptor.ABO.Sort = "" receptor.RH.Sort = "" receptor.SENSIBILIDADE.Sort = "" receptor.FONTE_PAGA.Sort = "" End If ' Reset start position StartRec = 1 receptor.StartRecordNumber = StartRec End If End Sub ' Set up list options Sub SetupListOptions() Dim item ListOptions.Add("edit") ListOptions.GetItem("edit").CssStyle = "white-space: nowrap;" ListOptions.GetItem("edit").Visible = True ListOptions.GetItem("edit").OnLeft = True ListOptions.Add("detail_mapa_transfusional") ListOptions.GetItem("detail_mapa_transfusional").CssStyle = "white-space: nowrap;" ListOptions.GetItem("detail_mapa_transfusional").Visible = True ListOptions.GetItem("detail_mapa_transfusional").OnLeft = True ListOptions.Add("detail_provas_cruzadas") ListOptions.GetItem("detail_provas_cruzadas").CssStyle = "white-space: nowrap;" ListOptions.GetItem("detail_provas_cruzadas").Visible = True ListOptions.GetItem("detail_provas_cruzadas").OnLeft = True ListOptions.Add("checkbox") ListOptions.GetItem("checkbox").CssStyle = "white-space: nowrap;" ListOptions.GetItem("checkbox").Visible = True ListOptions.GetItem("checkbox").OnLeft = True ListOptions.MoveItem "checkbox", 0 ' Move to first column ListOptions.GetItem("checkbox").Header = "" Call ListOptions_Load() End Sub ' Render list options Sub RenderListOptions() Dim item, links ListOptions.LoadDefault() If ListOptions.GetItem("edit").Visible Then Set item = ListOptions.GetItem("edit") item.Body = "" & Language.Phrase("EditLink") & "" End If If True Then Set item = ListOptions.GetItem("detail_mapa_transfusional") item.Body = Language.Phrase("DetailLink") & Language.TablePhrase("mapa_transfusional", "TblCaption") item.Body = "" & item.Body & "" links = "" If mapa_transfusional.DetailEdit Then links = links & "" & Language.Phrase("EditLink") & " " End If If links <> "" Then item.Body = item.Body & "
" & links End If If True Then Set item = ListOptions.GetItem("detail_provas_cruzadas") item.Body = Language.Phrase("DetailLink") & Language.TablePhrase("provas_cruzadas", "TblCaption") item.Body = "" & item.Body & "" links = "" If provas_cruzadas.DetailEdit Then links = links & "" & Language.Phrase("EditLink") & " " End If If links <> "" Then item.Body = item.Body & "
" & links End If If ListOptions.GetItem("checkbox").Visible Then ListOptions.GetItem("checkbox").Body = "" End If Call RenderListOptionsExt() Call ListOptions_Rendered() End Sub Function RenderListOptionsExt() End Function Dim Pager ' ----------------------------------------------------------------- ' Set up Starting Record parameters based on Pager Navigation ' Sub SetUpStartRec() Dim PageNo ' Exit if DisplayRecs = 0 If DisplayRecs = 0 Then Exit Sub If IsPageRequest Then ' Validate request ' Check for a START parameter If Request.QueryString(EW_TABLE_START_REC).Count > 0 Then StartRec = Request.QueryString(EW_TABLE_START_REC) receptor.StartRecordNumber = StartRec ElseIf Request.QueryString(EW_TABLE_PAGE_NO).Count > 0 Then PageNo = Request.QueryString(EW_TABLE_PAGE_NO) If IsNumeric(PageNo) Then StartRec = (PageNo-1)*DisplayRecs+1 If StartRec <= 0 Then StartRec = 1 ElseIf StartRec >= ((TotalRecs-1)\DisplayRecs)*DisplayRecs+1 Then StartRec = ((TotalRecs-1)\DisplayRecs)*DisplayRecs+1 End If receptor.StartRecordNumber = StartRec End If End If End If StartRec = receptor.StartRecordNumber ' Check if correct start record counter If Not IsNumeric(StartRec) Or StartRec = "" Then ' Avoid invalid start record counter StartRec = 1 ' Reset start record counter receptor.StartRecordNumber = StartRec ElseIf CLng(StartRec) > CLng(TotalRecs) Then ' Avoid starting record > total records StartRec = ((TotalRecs-1)\DisplayRecs)*DisplayRecs+1 ' Point to last page first record receptor.StartRecordNumber = StartRec ElseIf (StartRec-1) Mod DisplayRecs <> 0 Then StartRec = ((StartRec-1)\DisplayRecs)*DisplayRecs+1 ' Point to page boundary receptor.StartRecordNumber = StartRec End If End Sub ' ----------------------------------------------------------------- ' Load basic search values ' Function LoadBasicSearchValues() receptor.BasicSearchKeyword = Request.QueryString(EW_TABLE_BASIC_SEARCH) receptor.BasicSearchType = Request.QueryString(EW_TABLE_BASIC_SEARCH_TYPE) End Function ' ----------------------------------------------------------------- ' Load recordset ' Function LoadRecordset() ' Call Recordset Selecting event Dim sFilter sFilter = receptor.CurrentFilter Call receptor.Recordset_Selecting(sFilter) receptor.CurrentFilter = sFilter ' Load list page sql Dim sSql sSql = receptor.ListSQL Call ew_SetDebugMsg("LoadRecordset: " & sSql) ' Show SQL for debugging ' Load recordset Dim RsRecordset Set RsRecordset = ew_LoadRecordset(sSql) ' Call Recordset Selected event Call receptor.Recordset_Selected(RsRecordset) Set LoadRecordset = RsRecordset End Function ' ----------------------------------------------------------------- ' Load row based on key values ' Function LoadRow() Dim RsRow, sSql, sFilter sFilter = receptor.KeyFilter ' Call Row Selecting event Call receptor.Row_Selecting(sFilter) ' Load sql based on filter receptor.CurrentFilter = sFilter sSql = receptor.SQL Call ew_SetDebugMsg("LoadRow: " & sSql) ' Show SQL for debugging Set RsRow = ew_LoadRow(sSql) If RsRow.Eof Then LoadRow = False Else LoadRow = True RsRow.MoveFirst Call LoadRowValues(RsRow) ' Load row values End If RsRow.Close Set RsRow = Nothing End Function ' ----------------------------------------------------------------- ' Load row values from recordset ' Sub LoadRowValues(RsRow) Dim sDetailFilter If RsRow.Eof Then Exit Sub ' Call Row Selected event Call receptor.Row_Selected(RsRow) receptor.ID.DbValue = RsRow("ID") receptor.REGISTRO_GERAL.DbValue = RsRow("REGISTRO_GERAL") receptor.NOME_PACIENTE.DbValue = RsRow("NOME_PACIENTE") receptor.IDADE_PACIENTE.DbValue = RsRow("IDADE_PACIENTE") receptor.PESO_PACIENTE.DbValue = RsRow("PESO_PACIENTE") receptor.SEXO_PACIENTE.DbValue = RsRow("SEXO_PACIENTE") receptor.NACIONALIDADE.DbValue = RsRow("NACIONALIDADE") receptor.LOCAL.DbValue = RsRow("LOCAL") receptor.QUARTO.DbValue = RsRow("QUARTO") receptor.LEITO.DbValue = RsRow("LEITO") receptor.HIPOTESE_DIAGNOSTICA.DbValue = RsRow("HIPOTESE_DIAGNOSTICA") receptor.HISTORICO_TRANSFUCIONAL.DbValue = RsRow("HISTORICO_TRANSFUCIONAL") receptor.REACAO_TRANSFUCIONAL.DbValue = RsRow("REACAO_TRANSFUCIONAL") receptor.QUAL.DbValue = RsRow("QUAL") receptor.GESTACAO_ABORTOS.DbValue = RsRow("GESTACAO_ABORTOS") receptor.QUANTOS.DbValue = RsRow("QUANTOS") receptor.ABO.DbValue = RsRow("ABO") receptor.RH.DbValue = RsRow("RH") receptor.SENSIBILIDADE.DbValue = RsRow("SENSIBILIDADE") receptor.FONTE_PAGA.DbValue = RsRow("FONTE_PAGA") End Sub ' Load old record Function LoadOldRecord() ' Load key values from Session Dim bValidKey bValidKey = True If receptor.GetKey("ID")&"" <> "" Then receptor.ID.CurrentValue = receptor.GetKey("ID") ' ID Else bValidKey = False End If ' Load old recordset If bValidKey Then receptor.CurrentFilter = receptor.KeyFilter Dim sSql sSql = receptor.SQL Set OldRecordset = ew_LoadRecordset(sSql) Call LoadRowValues(OldRecordset) ' Load row values Else OldRecordset = Null End If LoadOldRecord = bValidKey End Function ' ----------------------------------------------------------------- ' Render row values based on field settings ' Sub RenderRow() ' Initialize urls ViewUrl = receptor.ViewUrl EditUrl = receptor.EditUrl("") InlineEditUrl = receptor.InlineEditUrl CopyUrl = receptor.CopyUrl("") InlineCopyUrl = receptor.InlineCopyUrl DeleteUrl = receptor.DeleteUrl ' Call Row Rendering event Call receptor.Row_Rendering() ' --------------------------------------- ' Common render codes for all row types ' --------------------------------------- ' ID ' REGISTRO_GERAL ' NOME_PACIENTE ' IDADE_PACIENTE ' PESO_PACIENTE ' SEXO_PACIENTE ' NACIONALIDADE ' LOCAL ' QUARTO ' LEITO ' HIPOTESE_DIAGNOSTICA ' HISTORICO_TRANSFUCIONAL ' REACAO_TRANSFUCIONAL ' QUAL ' GESTACAO_ABORTOS ' QUANTOS ' ABO ' RH ' SENSIBILIDADE ' FONTE_PAGA ' ----------- ' View Row ' ----------- If receptor.RowType = EW_ROWTYPE_VIEW Then ' View row ' ID receptor.ID.ViewValue = receptor.ID.CurrentValue receptor.ID.CssStyle = "text-align:center;" receptor.ID.ViewCustomAttributes = "" ' REGISTRO_GERAL receptor.REGISTRO_GERAL.ViewValue = receptor.REGISTRO_GERAL.CurrentValue receptor.REGISTRO_GERAL.CssStyle = "text-align:center;" receptor.REGISTRO_GERAL.ViewCustomAttributes = "" ' NOME_PACIENTE receptor.NOME_PACIENTE.ViewValue = receptor.NOME_PACIENTE.CurrentValue receptor.NOME_PACIENTE.CssStyle = "text-align:center;" receptor.NOME_PACIENTE.ViewCustomAttributes = "" ' IDADE_PACIENTE receptor.IDADE_PACIENTE.ViewValue = receptor.IDADE_PACIENTE.CurrentValue receptor.IDADE_PACIENTE.CssStyle = "text-align:center;" receptor.IDADE_PACIENTE.ViewCustomAttributes = "" ' PESO_PACIENTE receptor.PESO_PACIENTE.ViewValue = receptor.PESO_PACIENTE.CurrentValue receptor.PESO_PACIENTE.CssStyle = "text-align:center;" receptor.PESO_PACIENTE.ViewCustomAttributes = "" ' SEXO_PACIENTE If Not IsNull(receptor.SEXO_PACIENTE.CurrentValue) Then Select Case receptor.SEXO_PACIENTE.CurrentValue Case "MASCULINO" receptor.SEXO_PACIENTE.ViewValue = ew_IIf(receptor.SEXO_PACIENTE.FldTagCaption(1) <> "", receptor.SEXO_PACIENTE.FldTagCaption(1), "MASCULINO") Case "FEMININO" receptor.SEXO_PACIENTE.ViewValue = ew_IIf(receptor.SEXO_PACIENTE.FldTagCaption(2) <> "", receptor.SEXO_PACIENTE.FldTagCaption(2), "FEMININO") Case Else receptor.SEXO_PACIENTE.ViewValue = receptor.SEXO_PACIENTE.CurrentValue End Select Else receptor.SEXO_PACIENTE.ViewValue = Null End If receptor.SEXO_PACIENTE.CssStyle = "text-align:center;" receptor.SEXO_PACIENTE.ViewCustomAttributes = "" ' NACIONALIDADE receptor.NACIONALIDADE.ViewValue = receptor.NACIONALIDADE.CurrentValue receptor.NACIONALIDADE.CssStyle = "text-align:center;" receptor.NACIONALIDADE.ViewCustomAttributes = "" ' LOCAL receptor.LOCAL.ViewValue = receptor.LOCAL.CurrentValue receptor.LOCAL.CssStyle = "text-align:center;" receptor.LOCAL.ViewCustomAttributes = "" ' QUARTO receptor.QUARTO.ViewValue = receptor.QUARTO.CurrentValue receptor.QUARTO.CssStyle = "text-align:center;" receptor.QUARTO.ViewCustomAttributes = "" ' LEITO receptor.LEITO.ViewValue = receptor.LEITO.CurrentValue receptor.LEITO.CssStyle = "text-align:center;" receptor.LEITO.ViewCustomAttributes = "" ' HIPOTESE_DIAGNOSTICA receptor.HIPOTESE_DIAGNOSTICA.ViewValue = receptor.HIPOTESE_DIAGNOSTICA.CurrentValue receptor.HIPOTESE_DIAGNOSTICA.CssStyle = "text-align:center;" receptor.HIPOTESE_DIAGNOSTICA.ViewCustomAttributes = "" ' HISTORICO_TRANSFUCIONAL receptor.HISTORICO_TRANSFUCIONAL.ViewValue = receptor.HISTORICO_TRANSFUCIONAL.CurrentValue receptor.HISTORICO_TRANSFUCIONAL.CssStyle = "text-align:center;" receptor.HISTORICO_TRANSFUCIONAL.ViewCustomAttributes = "" ' REACAO_TRANSFUCIONAL If Not IsNull(receptor.REACAO_TRANSFUCIONAL.CurrentValue) Then Select Case receptor.REACAO_TRANSFUCIONAL.CurrentValue Case "NÃO" receptor.REACAO_TRANSFUCIONAL.ViewValue = ew_IIf(receptor.REACAO_TRANSFUCIONAL.FldTagCaption(1) <> "", receptor.REACAO_TRANSFUCIONAL.FldTagCaption(1), "NÃO") Case "SIM" receptor.REACAO_TRANSFUCIONAL.ViewValue = ew_IIf(receptor.REACAO_TRANSFUCIONAL.FldTagCaption(2) <> "", receptor.REACAO_TRANSFUCIONAL.FldTagCaption(2), "SIM") Case Else receptor.REACAO_TRANSFUCIONAL.ViewValue = receptor.REACAO_TRANSFUCIONAL.CurrentValue End Select Else receptor.REACAO_TRANSFUCIONAL.ViewValue = Null End If receptor.REACAO_TRANSFUCIONAL.CssStyle = "text-align:center;" receptor.REACAO_TRANSFUCIONAL.ViewCustomAttributes = "" ' QUAL receptor.QUAL.ViewValue = receptor.QUAL.CurrentValue receptor.QUAL.CssStyle = "text-align:center;" receptor.QUAL.ViewCustomAttributes = "" ' GESTACAO_ABORTOS If Not IsNull(receptor.GESTACAO_ABORTOS.CurrentValue) Then Select Case receptor.GESTACAO_ABORTOS.CurrentValue Case "NÃO" receptor.GESTACAO_ABORTOS.ViewValue = ew_IIf(receptor.GESTACAO_ABORTOS.FldTagCaption(1) <> "", receptor.GESTACAO_ABORTOS.FldTagCaption(1), "NÃO") Case "SIM" receptor.GESTACAO_ABORTOS.ViewValue = ew_IIf(receptor.GESTACAO_ABORTOS.FldTagCaption(2) <> "", receptor.GESTACAO_ABORTOS.FldTagCaption(2), "SIM") Case Else receptor.GESTACAO_ABORTOS.ViewValue = receptor.GESTACAO_ABORTOS.CurrentValue End Select Else receptor.GESTACAO_ABORTOS.ViewValue = Null End If receptor.GESTACAO_ABORTOS.CssStyle = "text-align:center;" receptor.GESTACAO_ABORTOS.ViewCustomAttributes = "" ' QUANTOS receptor.QUANTOS.ViewValue = receptor.QUANTOS.CurrentValue receptor.QUANTOS.CssStyle = "text-align:center;" receptor.QUANTOS.ViewCustomAttributes = "" ' ABO If Not IsNull(receptor.ABO.CurrentValue) Then Select Case receptor.ABO.CurrentValue Case "A" receptor.ABO.ViewValue = ew_IIf(receptor.ABO.FldTagCaption(1) <> "", receptor.ABO.FldTagCaption(1), "A") Case "B" receptor.ABO.ViewValue = ew_IIf(receptor.ABO.FldTagCaption(2) <> "", receptor.ABO.FldTagCaption(2), "B") Case "AB" receptor.ABO.ViewValue = ew_IIf(receptor.ABO.FldTagCaption(3) <> "", receptor.ABO.FldTagCaption(3), "AB") Case "O" receptor.ABO.ViewValue = ew_IIf(receptor.ABO.FldTagCaption(4) <> "", receptor.ABO.FldTagCaption(4), "O") Case Else receptor.ABO.ViewValue = receptor.ABO.CurrentValue End Select Else receptor.ABO.ViewValue = Null End If receptor.ABO.CssStyle = "font-weight:bold;text-align:center;" receptor.ABO.ViewCustomAttributes = "" ' RH If Not IsNull(receptor.RH.CurrentValue) Then Select Case receptor.RH.CurrentValue Case "NEG" receptor.RH.ViewValue = ew_IIf(receptor.RH.FldTagCaption(1) <> "", receptor.RH.FldTagCaption(1), "NEG") Case "POS" receptor.RH.ViewValue = ew_IIf(receptor.RH.FldTagCaption(2) <> "", receptor.RH.FldTagCaption(2), "POS") Case Else receptor.RH.ViewValue = receptor.RH.CurrentValue End Select Else receptor.RH.ViewValue = Null End If receptor.RH.CssStyle = "font-weight:bold;text-align:center;" receptor.RH.ViewCustomAttributes = "" ' SENSIBILIDADE receptor.SENSIBILIDADE.ViewValue = receptor.SENSIBILIDADE.CurrentValue receptor.SENSIBILIDADE.CssStyle = "text-align:center;" receptor.SENSIBILIDADE.ViewCustomAttributes = "" ' FONTE_PAGA If Not IsNull(receptor.FONTE_PAGA.CurrentValue) Then Select Case receptor.FONTE_PAGA.CurrentValue Case "SUS" receptor.FONTE_PAGA.ViewValue = ew_IIf(receptor.FONTE_PAGA.FldTagCaption(1) <> "", receptor.FONTE_PAGA.FldTagCaption(1), "SUS") Case "CONVÊNIO" receptor.FONTE_PAGA.ViewValue = ew_IIf(receptor.FONTE_PAGA.FldTagCaption(2) <> "", receptor.FONTE_PAGA.FldTagCaption(2), "CONVÊNIO") Case "PARTICULAR" receptor.FONTE_PAGA.ViewValue = ew_IIf(receptor.FONTE_PAGA.FldTagCaption(3) <> "", receptor.FONTE_PAGA.FldTagCaption(3), "PARTICULAR") Case Else receptor.FONTE_PAGA.ViewValue = receptor.FONTE_PAGA.CurrentValue End Select Else receptor.FONTE_PAGA.ViewValue = Null End If receptor.FONTE_PAGA.CssStyle = "text-align:center;" receptor.FONTE_PAGA.ViewCustomAttributes = "" ' View refer script ' ID receptor.ID.LinkCustomAttributes = "" receptor.ID.HrefValue = "" receptor.ID.TooltipValue = "" ' REGISTRO_GERAL receptor.REGISTRO_GERAL.LinkCustomAttributes = "" receptor.REGISTRO_GERAL.HrefValue = "" receptor.REGISTRO_GERAL.TooltipValue = "" ' NOME_PACIENTE receptor.NOME_PACIENTE.LinkCustomAttributes = "" receptor.NOME_PACIENTE.HrefValue = "" receptor.NOME_PACIENTE.TooltipValue = "" ' IDADE_PACIENTE receptor.IDADE_PACIENTE.LinkCustomAttributes = "" receptor.IDADE_PACIENTE.HrefValue = "" receptor.IDADE_PACIENTE.TooltipValue = "" ' PESO_PACIENTE receptor.PESO_PACIENTE.LinkCustomAttributes = "" receptor.PESO_PACIENTE.HrefValue = "" receptor.PESO_PACIENTE.TooltipValue = "" ' SEXO_PACIENTE receptor.SEXO_PACIENTE.LinkCustomAttributes = "" receptor.SEXO_PACIENTE.HrefValue = "" receptor.SEXO_PACIENTE.TooltipValue = "" ' NACIONALIDADE receptor.NACIONALIDADE.LinkCustomAttributes = "" receptor.NACIONALIDADE.HrefValue = "" receptor.NACIONALIDADE.TooltipValue = "" ' LOCAL receptor.LOCAL.LinkCustomAttributes = "" receptor.LOCAL.HrefValue = "" receptor.LOCAL.TooltipValue = "" ' QUARTO receptor.QUARTO.LinkCustomAttributes = "" receptor.QUARTO.HrefValue = "" receptor.QUARTO.TooltipValue = "" ' LEITO receptor.LEITO.LinkCustomAttributes = "" receptor.LEITO.HrefValue = "" receptor.LEITO.TooltipValue = "" ' HIPOTESE_DIAGNOSTICA receptor.HIPOTESE_DIAGNOSTICA.LinkCustomAttributes = "" receptor.HIPOTESE_DIAGNOSTICA.HrefValue = "" receptor.HIPOTESE_DIAGNOSTICA.TooltipValue = "" ' HISTORICO_TRANSFUCIONAL receptor.HISTORICO_TRANSFUCIONAL.LinkCustomAttributes = "" receptor.HISTORICO_TRANSFUCIONAL.HrefValue = "" receptor.HISTORICO_TRANSFUCIONAL.TooltipValue = "" ' REACAO_TRANSFUCIONAL receptor.REACAO_TRANSFUCIONAL.LinkCustomAttributes = "" receptor.REACAO_TRANSFUCIONAL.HrefValue = "" receptor.REACAO_TRANSFUCIONAL.TooltipValue = "" ' QUAL receptor.QUAL.LinkCustomAttributes = "" receptor.QUAL.HrefValue = "" receptor.QUAL.TooltipValue = "" ' GESTACAO_ABORTOS receptor.GESTACAO_ABORTOS.LinkCustomAttributes = "" receptor.GESTACAO_ABORTOS.HrefValue = "" receptor.GESTACAO_ABORTOS.TooltipValue = "" ' QUANTOS receptor.QUANTOS.LinkCustomAttributes = "" receptor.QUANTOS.HrefValue = "" receptor.QUANTOS.TooltipValue = "" ' ABO receptor.ABO.LinkCustomAttributes = "" receptor.ABO.HrefValue = "" receptor.ABO.TooltipValue = "" ' RH receptor.RH.LinkCustomAttributes = "" receptor.RH.HrefValue = "" receptor.RH.TooltipValue = "" ' SENSIBILIDADE receptor.SENSIBILIDADE.LinkCustomAttributes = "" receptor.SENSIBILIDADE.HrefValue = "" receptor.SENSIBILIDADE.TooltipValue = "" ' FONTE_PAGA receptor.FONTE_PAGA.LinkCustomAttributes = "" receptor.FONTE_PAGA.HrefValue = "" receptor.FONTE_PAGA.TooltipValue = "" End If ' Call Row Rendered event If receptor.RowType <> EW_ROWTYPE_AGGREGATEINIT Then Call receptor.Row_Rendered() End If End Sub ' Set up export options Sub SetupExportOptions() Dim item ' Printer friendly ExportOptions.Add("print") Set item = ExportOptions.GetItem("print") item.Body = "" & Language.Phrase("PrinterFriendly") & "" item.Visible = True ' Export to Excel ExportOptions.Add("excel") Set item = ExportOptions.GetItem("excel") item.Body = "" & Language.Phrase("ExportToExcel") & "" item.Visible = True ' Export to Word ExportOptions.Add("word") Set item = ExportOptions.GetItem("word") item.Body = "" & Language.Phrase("ExportToWord") & "" item.Visible = False ' Export to Html ExportOptions.Add("html") Set item = ExportOptions.GetItem("html") item.Body = "" & Language.Phrase("ExportToHtml") & "" item.Visible = False ' Export to Xml ExportOptions.Add("xml") Set item = ExportOptions.GetItem("xml") item.Body = "" & Language.Phrase("ExportToXml") & "" item.Visible = False ' Export to Csv ExportOptions.Add("csv") Set item = ExportOptions.GetItem("csv") item.Body = "" & Language.Phrase("ExportToCsv") & "" item.Visible = True ' Export to Email ExportOptions.Add("email") Set item = ExportOptions.GetItem("email") item.Body = "" & Language.Phrase("ExportToEmail") & "" item.Visible = False ' Hide options for export/action If receptor.Export <> "" Or receptor.CurrentAction <> "" Then ExportOptions.HideAllOptions() End If End Sub ' ----------------------------------------------------------------- ' Export data in HTML/CSV/Word/Excel/XML/Email format ' Sub ExportData() Dim XmlDoc Dim ExportDoc Dim ExportStyle ' Default export style ExportStyle = "h" ' Load recordset Set Rs = LoadRecordset() TotalRecs = Rs.RecordCount StartRec = 1 ' Export all If receptor.ExportAll Then StopRec = TotalRecs ' Export 1 page only Else SetUpStartRec() ' Set Up Start Record Position ' Set the last record to display If DisplayRecs < 0 Then StopRec = TotalRecs Else StopRec = StartRec + DisplayRecs - 1 End If End If If receptor.Export = "xml" Then Set XmlDoc = New cXMLDocument Else Set ExportDoc = New cExportDocument Set ExportDoc.Table = receptor Call ExportDoc.ChangeStyle("h") End If Dim ParentTable ParentTable = "" If receptor.Export = "xml" Then Call receptor.ExportXmlDocument(XmlDoc, (ParentTable <> ""), rs, StartRec, StopRec, "") Else Dim sHeader sHeader = PageHeader Call Page_DataRendering(sHeader) ExportDoc.Text = ExportDoc.Text & sHeader Call receptor.ExportDocument(ExportDoc, rs, StartRec, StopRec, "") Dim sFooter sFooter = PageFooter Call Page_DataRendered(sFooter) ExportDoc.Text = ExportDoc.Text & sFooter End If ' Close recordset and connection Rs.Close Set Rs = Nothing ' Export header and footer If receptor.Export <> "xml" Then Call ExportDoc.ExportHeaderAndFooter() End If If receptor.Export = "xml" Then XmlDoc.Output Set XmlDoc = Nothing Else If receptor.Export = "email" Then Call ExportEmail(ExportDoc.Text) Call Page_Terminate(receptor.ExportReturnUrl) Else Response.Write ExportDoc.Text End If Set ExportDoc = Nothing End If End Sub ' Page Load event Sub Page_Load() 'Response.Write "Page Load" End Sub ' Page Unload event Sub Page_Unload() 'Response.Write "Page Unload" End Sub ' Page Redirecting event Sub Page_Redirecting(url) 'url = newurl End Sub ' Message Showing event ' typ = ""|"success"|"failure" Sub Message_Showing(msg, typ) ' Example: 'If typ = "success" Then msg = "your success message" End Sub ' Page Data Rendering event Sub Page_DataRendering(header) ' Example: 'header = "your header" End Sub ' Page Data Rendered event Sub Page_DataRendered(footer) ' Example: 'footer = "your footer" End Sub ' Form Custom Validate event Function Form_CustomValidate(CustomError) 'Return error message in CustomError Form_CustomValidate = True End Function ' ListOptions Load event Sub ListOptions_Load() 'Example: ' Dim opt ' Set opt = ListOptions.Add("new") ' opt.OnLeft = True ' Link on left ' opt.MoveTo 0 ' Move to first column End Sub ' ListOptions Rendered event Sub ListOptions_Rendered() 'Example: 'ListOptions.GetItem("new").Body = "xxx" End Sub End Class %>