Jump to content

IE functions, somethings not right


Recommended Posts

Hello everyone its me again!

I've been struggling for few days with my script, managed to solve most of the problems with the help of this lovely community, now I'm facing one last problem.

Part of my script selects an option from a drop down list, my problem is that sometimes the page updates the results according to that selection, and most of the times it selects the value then removes it, completely ignoring it, I can't share the information of the website I work on, but I made a video of the script in action, I will post it once its done uploading, in the meanwhile here is the full script.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <GUIEdit.au3>
#include <Clipboard.au3>
#Region ### START Koda GUI section ### Form=
$IMC = GUICreate("IMC", 125, 505, 1202, 93, BitOR($WS_SYSMENU,$WS_POPUP), BitOR($WS_EX_TOPMOST,$WS_EX_TRANSPARENT,$WS_EX_WINDOWEDGE))
GUISetIcon("C:\Users\Palestinian\AppData\Roaming\KoshyJohn.com\neoSearch\neoSearch.exe", -1)
GUISetFont(8, 400, 0, "Century Schoolbook")
GUISetBkColor(0xDBECF9)
$Label1 = GUICtrlCreateLabel("Select Service Type:", 8, 24, 107, 19)
GUICtrlSetColor(-1, 0x0066CC)
$GP = GUICtrlCreateButton("GP", 24, 48, 75, 25)
$Internist = GUICtrlCreateButton("Internist", 24, 80, 75, 25)
$HE = GUICtrlCreateButton("HE", 24, 112, 75, 25)
$Dental = GUICtrlCreateButton("Dental", 24, 144, 75, 25)
$OBG = GUICtrlCreateButton("OBG", 24, 176, 75, 25)
$Optha = GUICtrlCreateButton("Optha", 24, 208, 75, 25)
$Pediatric = GUICtrlCreateButton("Pediatric", 24, 240, 75, 25)
$Date = GUICtrlCreateLabel("Date", 48, 280, 28, 19)
GUICtrlSetColor(-1, 0x0066CC)
$Dates = GUICtrlCreateInput("", 24, 304, 73, 23)
GUICtrlSetColor(-1, 0x0066CC)
$MC = GUICtrlCreateLabel("Medical Code:", 24, 336, 75, 19)
GUICtrlSetColor(-1, 0x0066CC)
$Medical = GUICtrlCreateInput("", 24, 360, 20, 23)
GUICtrlSetColor(-1, 0x0066CC)
GUICtrlSetLimit(-1, 1)
$Medical3 = GUICtrlCreateInput("", 50, 360, 46, 23)
GUICtrlSetColor(-1, 0x0066CC)
$MP = GUICtrlCreateLabel("Money Paid:", 32, 400, 67, 19)
GUICtrlSetColor(-1, 0x0066CC)
$Money = GUICtrlCreateInput("", 24, 424, 73, 23)
GUICtrlSetColor(-1, 0x0066CC)
$EXIT = GUICtrlCreateButton("EXIT", 24, 464, 75, 25)
GUISetState(@SW_SHOW)
 GuiCtrlSetState($Dates,$GUI_FOCUS)
#EndRegion ### END Koda GUI section ###

while 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
         Case $GP
         Local $title = WinGetTitle("Health Assistance - Windows Internet Explorer")
             Local $date = GUICtrlRead($Dates)
             Local $medical1 = GUICtrlRead($Medical)
             Local $medical2 = GUICtrlRead($Medical3)
             Local $money1 = GUICtrlRead($Money)
             Local $fulldate = "1/" & $date & "/2014"
             _ClipBoard_SetData($fulldate)
         $oIE = _IEAttach("Health Assistance")
         $oForm = _IEFormGetObjByName($oIE, "aspnetForm")
         $providedthrough = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListProvidedThrough")
         $provide = _IEFormElementOptionSelect($providedthrough, 10108, 1, "ByValue")
$funded = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListFundedBy")
$fund = _IEFormElementOptionSelect($funded, 10074, 1, "ByValue")
$procedures = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListProcedures")
$procedure = _IEFormElementOptionSelect($procedures, 1, 1, "ByValue")
$places = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListPlace")
$place = _IEFormElementOptionSelect($places, 10108, 1, "ByValue")
$speciality = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListSpeciality")
$special = _IEFormElementOptionSelect($speciality, 43, 1, "ByValue")
$paymentt = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListPaymentType")
$payment = _IEFormElementOptionSelect($paymentt, 2, 1, "ByValue")




Local $inputdate = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$txtDateProvided")
         _IEFormElementSetValue($inputdate, $fulldate)


Local $inputmoney = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$TextBoxAmount")
         _IEFormElementSetValue($inputmoney, $money1)


Select
Case $medical1 = "a"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 2, 1, "ByValue")
Case $medical1 = "b"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 2, 1, "ByValue")
Case $medical1 = "c"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 3, 1, "ByValue")
Case $medical1 = "d0"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 3, 1, "ByValue")
Case $medical1 = "d"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 4, 1, "ByValue")
Case $medical1 = "e"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 5, 1, "ByValue")
Case $medical1 = "f"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 6, 1, "ByValue")
Case $medical1 = "g"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 7, 1, "ByValue")
Case $medical1 = "h"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 8, 1, "ByValue")
Case $medical1 = "h0"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 9, 1, "ByValue")
Case $medical1 = "i"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 10, 1, "ByValue")
Case $medical1 = "j"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 11, 1, "ByValue")
Case $medical1 = "k"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 12, 1, "ByValue")
Case $medical1 = "l"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 13, 1, "ByValue")
Case $medical1 = "m"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 14, 1, "ByValue")
Case $medical1 = "n"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 15, 1, "ByValue")
Case $medical1 = "o"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 16, 1, "ByValue")
Case $medical1 = "p"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 17, 1, "ByValue")
Case $medical1 = "q"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 18, 1, "ByValue")
Case $medical1 = "r"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 19, 1, "ByValue")
Case $medical1 = "s"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 20, 1, "ByValue")
Case $medical1 = "t"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 20, 1, "ByValue")
Case $medical1 = "v"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "w"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "y"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "v"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "z"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 22, 1, "ByValue")
EndSelect

Local $inputgroup = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
         _IEFormElementSetValue($inputgroup, $medical1)
Sleep(400)

Local $checksum = PixelChecksum(53,512,94,538)

While $checksum = PixelChecksum(53,512,94,538)
    Sleep(50)
WEnd

         Local $inputcode = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiagnosisCode")
         _IEFormElementSetValue($inputcode, $medical1 & $medical2)

Local $checksum = PixelChecksum(53,512,94,538)

While $checksum = PixelChecksum(53,512,94,538)
    Sleep(50)
WEnd

Local $codeenter = _IEGetObjById($oForm, "ctl00_ContentPlaceHolder1_btnAddDiagnosis")
_IEAction($codeenter, "click")
Sleep(400)

Local $checksum = PixelChecksum(53,512,94,538)

While $checksum = PixelChecksum(53,512,94,538)
    Sleep(50)
WEnd



Local $payday = _IEGetObjByName($oForm, "ctl00$ContentPlaceHolder1$btnAddPayment")
_IEAction($payday, "click")
Sleep(400)

Local $checksum = PixelChecksum(53,512,94,538)

While $checksum = PixelChecksum(53,512,94,538)
    Sleep(50)
WEnd


Local $payday = _IEGetObjByName($oForm, "ctl00$ContentPlaceHolder1$btnAddSpeciality")
_IEAction($payday, "click")
Sleep(400)

Local $checksum = PixelChecksum(53,512,94,538)

While $checksum = PixelChecksum(53,512,94,538)
    Sleep(50)
WEnd

Local $payday = _IEGetObjByName($oForm, "ctl00$ContentPlaceHolder1$btnAddProcedure")
_IEAction($payday, "click")
Sleep(400)

Local $checksum = PixelChecksum(53,512,94,538)

While $checksum = PixelChecksum(53,512,94,538)
    Sleep(50)
WEnd








Case $EXIT
   Exit
EndSwitch
    If _GUICtrlEdit_LineLength($Dates) = 2 and _GUICtrlEdit_GetModify($Dates) > 0 Then
        GuiCtrlSetState($Medical,$GUI_FOCUS)
        _GUICtrlEdit_SetModify($Dates,false)
     EndIf
    If _GUICtrlEdit_LineLength($Medical) = 1 and _GUICtrlEdit_GetModify($Medical) > 0 Then
        GuiCtrlSetState($Medical3,$GUI_FOCUS)
        _GUICtrlEdit_SetModify($Medical,false)
     EndIf
    If _GUICtrlEdit_LineLength($Medical3) = 2 and _GUICtrlEdit_GetModify($Medical3) > 0 Then
        GuiCtrlSetState($Money,$GUI_FOCUS)
        _GUICtrlEdit_SetModify($Medical3,false)
    EndIf
WEnd

Removing this part of the script makes it select the disease group and update the diagnosis code list properly, but it won't send the rest of the code to the diagnosis code list

;~ Local $inputgroup = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
;~          _IEFormElementSetValue($inputgroup, $medical1)
;~ Sleep(400)

;~ Local $checksum = PixelChecksum(53,512,94,538)

;~ While $checksum = PixelChecksum(53,512,94,538)
;~     Sleep(50)
;~ WEnd

         Local $inputcode = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiagnosisCode")
         _IEFormElementSetValue($inputcode, $medical1 & $medical2)

Local $checksum = PixelChecksum(53,512,94,538)

While $checksum = PixelChecksum(53,512,94,538)
    Sleep(50)
WEnd

If someone could just point out what I'm doing wrong here it would be much appreciated

Edited by Palestinian
Link to comment
Share on other sites

This section of code:

Select
Case $medical1 = "a"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 2, 1, "ByValue")
Case $medical1 = "b"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 2, 1, "ByValue")
Case $medical1 = "c"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 3, 1, "ByValue")
Case $medical1 = "d0"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 3, 1, "ByValue")
Case $medical1 = "d"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 4, 1, "ByValue")
Case $medical1 = "e"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 5, 1, "ByValue")
Case $medical1 = "f"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 6, 1, "ByValue")
Case $medical1 = "g"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 7, 1, "ByValue")
Case $medical1 = "h"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 8, 1, "ByValue")
Case $medical1 = "h0"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 9, 1, "ByValue")
Case $medical1 = "i"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 10, 1, "ByValue")
Case $medical1 = "j"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 11, 1, "ByValue")
Case $medical1 = "k"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 12, 1, "ByValue")
Case $medical1 = "l"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 13, 1, "ByValue")
Case $medical1 = "m"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 14, 1, "ByValue")
Case $medical1 = "n"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 15, 1, "ByValue")
Case $medical1 = "o"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 16, 1, "ByValue")
Case $medical1 = "p"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 17, 1, "ByValue")
Case $medical1 = "q"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 18, 1, "ByValue")
Case $medical1 = "r"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 19, 1, "ByValue")
Case $medical1 = "s"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 20, 1, "ByValue")
Case $medical1 = "t"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 20, 1, "ByValue")
Case $medical1 = "v"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "w"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "y"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "v"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "z"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 22, 1, "ByValue")
EndSelect

could likely be rewritten as follows:

$deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
$desease = _IEFormElementOptionSelect($deseaseg, Asc($medical1) - 96, 1, "ByValue")

This assumes that you had a typo in your code because you were selecting the 2nd entry for both "a" and "b" values.

Link to comment
Share on other sites

This section of code:

Select
Case $medical1 = "a"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 2, 1, "ByValue")
Case $medical1 = "b"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 2, 1, "ByValue")
Case $medical1 = "c"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 3, 1, "ByValue")
Case $medical1 = "d0"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 3, 1, "ByValue")
Case $medical1 = "d"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 4, 1, "ByValue")
Case $medical1 = "e"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 5, 1, "ByValue")
Case $medical1 = "f"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 6, 1, "ByValue")
Case $medical1 = "g"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 7, 1, "ByValue")
Case $medical1 = "h"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 8, 1, "ByValue")
Case $medical1 = "h0"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 9, 1, "ByValue")
Case $medical1 = "i"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 10, 1, "ByValue")
Case $medical1 = "j"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 11, 1, "ByValue")
Case $medical1 = "k"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 12, 1, "ByValue")
Case $medical1 = "l"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 13, 1, "ByValue")
Case $medical1 = "m"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 14, 1, "ByValue")
Case $medical1 = "n"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 15, 1, "ByValue")
Case $medical1 = "o"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 16, 1, "ByValue")
Case $medical1 = "p"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 17, 1, "ByValue")
Case $medical1 = "q"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 18, 1, "ByValue")
Case $medical1 = "r"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 19, 1, "ByValue")
Case $medical1 = "s"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 20, 1, "ByValue")
Case $medical1 = "t"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 20, 1, "ByValue")
Case $medical1 = "v"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "w"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "y"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "v"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 21, 1, "ByValue")
Case $medical1 = "z"
   $deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
   $desease = _IEFormElementOptionSelect($deseaseg, 22, 1, "ByValue")
EndSelect

could likely be rewritten as follows:

$deseaseg = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiseaseGroupCode")
$desease = _IEFormElementOptionSelect($deseaseg, Asc($medical1) - 96, 1, "ByValue")

This assumes that you had a typo in your code because you were selecting the 2nd entry for both "a" and "b" values.

 

A and B fall under the same category, they are included in one entry, having the same value in the group drop list.

I got it to work right before I left work and didn't have the chance to post it, sorry ^.^

   $deseasege = _IEFormElementGetObjByName($oForm, "ctl00$ContentPlaceHolder1$DropDownListDiagnosisCode")
   _IEAction($deseasege, "focus")
   Sleep(100)
    _IEFormElementOptionSelect($deseasege, $medical1 & $medical2, 1, "byText")
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...