%@ LANGUAGE = "VBScript" %>
SELECCIÓN DE LA PATOLOGÍA
<%
Historia_Actual=cstr(Session("Historia_Actual"))
Const AdopenKeyset = 1
Const adLockOptimistic = 3
SQL5= "SELECT * FROM HISTORIA_SINTOMA where IDENTIFICADOR_HISTORIA = " & Historia_Actual
Set rs5 = CreateObject("ADODB.Recordset")
rs5.CursorType = AdopenKeyset
rs5.LockType = adLockOptimistic
rs5.Open SQL5, "DSN=SEX"
IF RS5.EOF=TRUE THEN
Response.write "
Este caso no tiene registrado ningún síntoma. Por favor introduzca previamente los síntomas.
"
rs5.CLOSE
ELSE
rs5.CLOSE
SQL5= "SELECT IDENTIFICADOR_HISTORIA FROM HISTORIA_PATOLOGIA where IDENTIFICADOR_HISTORIA = " & Historia_Actual
Set rs5 = CreateObject("ADODB.Recordset")
rs5.CursorType = AdopenKeyset
rs5.LockType = adLockOptimistic
rs5.Open SQL5, "DSN=SEX"
IF RS5.EOF=false THEN
Response.write "
Este caso ya está diagnosticado
"
else
'**************************inicio algoritmo***********
IDENTIFICADOR_HISTORIA_ACTUAL = session("HISTORIA_ACTUAL")
dim NSintoma
NSintoma = 0
redim Sintoma(0)
dim NPosiblePatologia
NPosiblePatologia = 0
redim PosiblePatologia(0)
redim OrdenadaPosiblePatologia(0)
redim PesoPosiblePatologia(0)
'**** Prepara la conexion
'Const AdopenKeyset = 1
'Const adLockOptimistic = 3
'********************************************
'**** Busca los sintomas del caso actual
'********************************************
SQL= "SELECT nombre_sintoma FROM historia_sintoma WHERE identificador_historia = " + cstr(IDENTIFICADOR_HISTORIA_ACTUAL)
Set rs1 = CreateObject("ADODB.Recordset")
rs1.CursorType = AdopenKeyset
rs1.LockType = adLockOptimistic
rs1.Open SQL, "DSN=SEX"
J=0
while rs1.eof = false
ReDim Preserve Sintoma(J)
Sintoma(J) = rs1.fields(0)
NSintoma = NSintoma + 1
rs1.movenext
J=J+1
wend
rs1.Close
'*******************************************************
'**** Busca las posibles patologias del caso actual
'*******************************************************
SQL= "SELECT DISTINCT nombre_patologia FROM diagnostico_base"
SQL = SQL + " WHERE nombre_sintoma IN ('"
FOR I = 0 TO NSintoma - 1
SQL = SQL + Sintoma(I)
IF I < NSintoma - 1 THEN
SQL = SQL + "','"
END IF
NEXT
SQL = SQL + "') ORDER BY nombre_patologia ASC"
Set rs1 = CreateObject("ADODB.Recordset")
rs1.CursorType = AdopenKeyset
rs1.LockType = adLockOptimistic
rs1.Open SQL, "DSN=SEX"
J=0
while rs1.eof = false
NPosiblePatologia = NPosiblePatologia + 1
redim preserve PosiblePatologia(J)
PosiblePatologia(J) = rs1.fields(0)
rs1.movenext
J=J+1
wend
Dim NumeroPatologiasDescarte
rs1.movefirst
NumeroPatologiasDescarte=rs1.recordcount
rs1.Close
'**************************fin algoritmo*************+
Dim l
'PatologiasDescarte=Session("PatologiasDescarte")
'NumeroPatologiasDescarte=Session("NumeroPatologiasDescarte")
%>
"
end if
END IF
%>
e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.