1. EPMO Open Source Coordination Office Redaction File Detail Report

Produced by Araxis Merge on 4/16/2019 12:20:42 PM Central Daylight Time. See www.araxis.com for information about Merge. This report uses XHTML and CSS2, and is best viewed with a modern standards-compliant browser. For optimum results when printing this report, use landscape orientation and enable printing of background images and colours in your browser.

1.1 Files compared

# Location File Last Modified
1 C:\AraxisMergeCompare\Pri_un\CPRS_32_P2_PCE\OR_30_405V60_SRC\10_2\508\VA 508 JAWS Framework\Scripts CAPRI.JSS Wed Dec 12 14:05:04 2018 UTC
2 C:\AraxisMergeCompare\Pri_re\CPRS v32 P2 PCE Standardization-redacted\CPRS_32_P2_PCE\OR_30_405V60_SRC\10_2\508\VA 508 JAWS Framework\Scripts CAPRI.JSS Tue Apr 16 13:36:01 2019 UTC

1.2 Comparison summary

Description Between
Files 1 and 2
Text Blocks Lines
Unchanged 2 1900
Changed 1 2
Inserted 0 0
Removed 0 0

1.3 Comparison options

Whitespace
Character case Differences in character case are significant
Line endings Differences in line endings (CR and LF characters) are ignored
CR/LF characters Not shown in the comparison detail

1.4 Active regular expressions

No regular expressions were active.

1.5 Comparison detail

  1   ; Scripts  for CAPRI  Version 2. 7.190.4 
  2   ; Departme nt of Vete rans Affai rs Feb 23,  2016 
  3   ; Author:  Jonathan C ohn  PII                  )
  4   ; Script v ersion 4
  5   ; CAPRI Ve rsion 2.7. 190.4 
  6   ;Jaws Vers ion: Writt en with JA WS 17 
  7   ; Revision  History
  8   ; Version  4
  9   ; Updated  code to wo rk with cu rrent DELP HI Framewo rk and jsh /jsm files .
  10  
  11  
  12   /* 
  13    This is u sed for cu stom appli cation cod e and allo ws sites t o load sit e specific  code 
  14  
  15  
  16   Written fo r the VA50 8 Script p roject
  17   Original s cripts by:  CBell
  18   Updated: M ay, 2014 b y Chris Be ll
  19   */
  20  
  21   /********* ********** ********** ********** ********** ********** ****
  22   To add sit e specific  code, Fol low the in structions  in file n ame 
  23   VA508JAWS_ SiteCode.j ss. 
  24   ********** ********** ********** ********** ********** ********** ***/
  25   include "C APRI.jsh"
  26   include "C APRI.jsm"
  27   include "h jConst.jsh " ; Standa rd constan ts 
  28   include "h jglobal.js h" 
  29  
  30   include "M SAAconst.j sh"
  31   include "c ommon.jsm"   ;  cscNu ll and csc Space alon g with oth er standar d messages  
  32  
  33   use "VA508 JAWS.jsb"  ; import D ELPHI fram ework 
  34  
  35   ;import "v a508jaws.j sd" ; impo rt functio n declarat ions  from  documenta tion file  (help comp ile and co ntrol+I to  work.
  36  
  37  
  38  
  39  
  40   ; constant s are diff erentiated  by unders cores betw een words,
  41   Const   
  42   ; Not used  by any co de in this  file, but  read by J AWS.SR fro m this fil e to deter mine if th e script f ile should  be update d with a n ewer versi on
  43           VA 508_Script _Version =  4
  44   /* 
  45   ;Below is  the Applic ation spec ific code  (Code writ ten by SRA  )
  46   ********** ********** ********** ********** ********** ********** ***/
  47  
  48   Function A utoStartEv ent () ; S et globals  used for  determinei ng specifi c applicat ion being  run
  49   gs_DelphiA pplication Name  = "c apri" 
  50   ; initiali ze customi zed handle rs 
  51   SiteCodeIn itialize   ()
  52   ; Call sta ndard 
  53   VA508JAWS: :AutoStart Event()
  54   EndFunctio n
  55  
  56   Function A utoFinishE vent () ;  Set global s used for  determine ing specif ic applica tion being  run
  57  
  58   gs_DelphiA pplication Name  = cs cNull
  59   SiteCodeCl ear()
  60  
  61   ; Call sta ndard 
  62   VA508JAWS: :AutoFinis hEvent ()
  63   EndFunctio n
  64   ;****
  65  
  66   Script Hot KeyHelp ()
  67   var String  HelpText 
  68  
  69           He lpText = m sg_HotKey
  70  
  71   if UserBuf ferIsActiv e () Then
  72           Us erBufferDe activate ( )
  73   EndIf
  74   SayFormatt edMessage  (OT_USER_B UFFER, Hel pText 
  75   )
  76   EndScript
  77  
  78   ; Control  tab 
  79  
  80  
  81   ; control+ shift+tab 
  82  
  83  
  84   Script Con trolEnter  ()
  85   ; Double c lick on cu rrent spot  when  win dow class  is  CAPTIO N_LISTBOX
  86   var
  87           in t hItem,
  88           ha ndle hWnd
  89  
  90   sayCurrent ScriptKeyL abel()
  91   let hwnd =  getFocus( )
  92   if getWind owClass(hW nd) == WC_ CAPTION_LI STBOX then
  93           sa veCursor()   JAWSCurs or()  save Cursor()
  94           ro uteJAWSToP C()
  95           le ftMouseBut ton()
  96           Le ftMouseBut ton ()
  97           re turn
  98   endIf
  99   typeCurren tScriptKey () ; Pass  key to app lication 
  100   EndScript
  101  
  102   Script Ent erKey ()
  103   ; InC and  p exam req uests allo w enter ke y to move  focus appr opriately  and also u se mouse t o click.
  104   ; override s behaviou r in the t ree view a nd in the  body parts  button.
  105   var 
  106           ha ndle hFocu sWindow  =  GetFocus( ),
  107           st ring sFocu sName = Ge tWindowNam e (hFocusW indow),
  108           ha ndle hAppM ainWindow  = GetAppMa inWindow ( hFocusWind ow),
  109           st ring sAppM ainClass =  GetWindow Class (hAp pMainWindo w )
  110  
  111   if  sAppMa inClass ==   "TfrmVie wExam" The
  112           if  sFocusNam e== "Find  by Body Sy stem"   Th en 
  113                    Save Cursor() J awsCursor( ) SaveCurs or()
  114                    Rout eJAWSToPc  ()
  115                    Dela y (1, true )
  116                    Left MouseButto n () 
  117                    Dela y (2, True )
  118                    Rest oreCursor  () Restore Cursor ()
  119                    ; No w that cli ck has bee n performe d, set foc us on the  list of bo dy parts 
  120                    var 
  121                             handle  hPanel =  FindWindow (FindWindo w(hAppMain Window,  " TPanel", c scNull ),  "TPanel",  cscNull ),
  122                             handle  hDest = F indWindow  (hPanel, " TTreeView" , cscNull)
  123                    if h Dest Then 
  124                             SetFoc us( hDest  )
  125                    EndI f
  126           el if  GetWin dowClass(h FocusWindo w) == "TTr eeView" Th en 
  127                    Save Cursor() J awsCursor( ) SaveCurs or()
  128                    Rout eJAWSToPc  ()
  129                    Dela y (1, true )
  130                    Left MouseButto n ()   Lef tMouseButt on ()
  131                    Dela y (1, True )
  132                    Rest oreCursor  () Restore Cursor ()
  133                    ; No w that dou ble click  has been p erformed,  set focus  on exam th e list 
  134                    hPan el = FindW indow(Find Window(hAp pMainWindo w,  "TPane l", cscNul l ), "TPan el", cscNu ll )
  135                    hDes t = FindWi ndow (hPan el, "TChec kListBox",  cscNull)
  136                    if h Dest Then 
  137                             SetFoc us( hDest  )
  138                    EndI f
  139           El se
  140                    type CurrentScr iptKey() ;  Pass key  to applica tion 
  141           En dIf
  142   EndIf
  143  
  144   typeCurren tScriptKey () ; Pass  key to app lication 
  145   EndScript
  146  
  147   ; ***
  148   ; HandleCu stomAppWin dows 
  149   ; Paramete r 1 handle  of window  to provid e custom s peaking.
  150   ; returns  boolean  t rue to sto p addition al process ing.
  151   ; When the  TfrmMain  real windo w becomes  active mov e focus to  the TabBa r.
  152  
  153  
  154  
  155  
  156  
  157   ; Special  handling o f control- tab and co ntrol-shif t-tab
  158   ; TabBarCh ange()
  159   ; returns  true when  tabTabBar  was found
  160   ; Put focu s on TabBa r if in ma in window  =  TfrmMai nClass  an d then run  script ke y.
  161  
  162  
  163   ;---***---
  164   ; Start of  Code for  CAPRI 
  165   ;---***---
  166  
  167   Int Functi on HandleC ustomWindo ws (handle  FocusWind ow)
  168   var
  169           st ring Focus Name = Get WindowName  (FocusWin dow),
  170           st ring Focus Class = Ge tWindowCla ss(FocusWi ndow ),
  171           In t FocusSub Type = Get WindowSubt ypeCode (F ocusWindow ) ,
  172           St ring sGrou pName,
  173           ha ndle AppWi ndow = Get AppMainWin dow (Focus Window),
  174           St ring AppCl ass = GetW indowClass  (AppWindo w),
  175           st ring sTabN ame = GetD ialogPageN ame (),
  176           st ring sValu e,
  177           in t iResult 
  178  
  179   if FocusCl ass == WC_ MSAATabCon trol  Then  
  180           re turn  SayC ontrolEx ( FocusWindo w, sTabNam e)
  181   Elif AppCl ass == WC_ PatientLis tAppWindow  then 
  182           ;  Issue 2 /  20116 bett er handlin g of patie nt list ch anges 
  183           if  FocusClas s == WC_Pa tientListB ox  Then 
  184   SayMessage (OT_JAWS_M ESSAGE , m sgPatientL istUpdated )     
  185   Return tru
  186           el if focuscl ass == "te dit" then 
  187           En dIf
  188   Elif AppCl ass == WC_ MainAppWin dow  Then 
  189           If   StringCo mpare (sTa bName, WN_ MAIN_Repor tsTab ) ==  0 Then
  190                    if F ocusSubTyp e == WT_LI STBOX  The
  191                             return  SayContro lEx(FocusW indow, msg WinodwRepo rtList)
  192                    ElIf  FocusSubT ype == WT_ READONLYED IT 
  193                             sValue  =  GetWin dowText (F ocusWindow , False)
  194                             if  St ringLength (sValue)   == 0  Then  
  195                                      sValue =  msg_Blank Field
  196                             Else
  197                                      sValue =  GetLine()
  198                             EndIf
  199                             return  SayContro lEx (Focus Window, ms gWinodwRep ortOutput,  cscNull,  cscNUll, c scNull, cs cNull, sVa lue)
  200                    EndI f
  201           El If  String Compare (s TabName, W N_MAIN_Add ressTab )  == 0 Then
  202                    if ( GetWindowH ierarchyX  (FocusWind ow)< 25 
  203                       & & GetWindo wHierarchy X (FocusWi ndow) > 13  )
  204                     ||  (GetWindow HierarchyX  (FocusWin dow) < 7  
  205                       & & GetWindo wHierarchy X (FocusWi ndow) > 1 
  206                    Then  
  207                    sGro upName = " Temporary  Address" 
  208                             sValue  =  GetWin dowText (F ocusWindow , False)
  209                             if  St ringLength (sValue)   == 0  Then  
  210                                      sValue =  msg_Blank Field
  211                             EndIf
  212  
  213                             if Get WindowName (FocusWind ow) == "En d Date:" T hen
  214                                      if GetWi ndowHierar chyX (Focu sWindow) = = 21 Then
  215                                               FocusName  = "Address  line 3"
  216                                      Elif Get WindowHier archyX (Fo cusWindow)  == 22 The n
  217                                               FocusName  = "Address  line 2" 
  218                                      EndIf
  219                             EndIf
  220                             return  SayContro lEx (Focus Window, Fo cusName, c scNull, cs cNull, sGr oupName ,  cscNull, s Value)
  221                    EndI f
  222           El If InClini calTabs ()  Then 
  223                    var  string sCu rrentSecti on =  Clin icalSectio nName()
  224  
  225                    if   FocusSubTy pe == WT_E XTENDEDSEL ECT_LISTBO X Then 
  226                             return  SayContro lEx(FocusW indow, "Se lect "+ sC urrentSect ion )
  227                    ElIf  FocusSubT ype== WT_R EADONLYEDI T Then 
  228                             return  SayContro lEx(FocusW indow, sCu rrentSecti on)
  229                    EndI f
  230           El If sTabNam e == "Loca l"
  231      && Focu sSubType = = WT_READO NLYEDIT Th en 
  232                    retu rn SayCont rolEx(Focu sWindow, " Health Sum mary Compo nent Repor t" )
  233           En dIf
  234   Elif AppCl ass == "Tf rmAddress"  then
  235           If   GetWindo wTypeCode   (FocusWin dow)== WT_ EDIT Then 
  236                    Save Cursor()   InvisibleC ursor() Sa veCursor()  
  237                    SetR estriction  (Restrict AppWindow)
  238                    Move ToWindow ( AppWindow  )
  239                    JAWS TopOfFile  ()
  240                    Find String (Ap pWindow, " Temporary" , S_TOP, S _RESTRICTE D , False  )
  241                    var  int iTempo raryColumn  = GetCurs orCol ( )
  242   RestoreCur sor ()Rest oreCursor  ()
  243                    if G etWindowLe ft (FocusW indow )>=  iTemporary Column The n
  244                             sGroup Name = "Te mporary"
  245                    Else
  246                             sGroup Name = "Pe rmanent"
  247                    EndI f
  248           re turn SayCo ntrolEx (F ocusWindow , cscNull,  cscNull,  cscNull, s GroupName)
  249           En dIf
  250   elif AppCl ass == "Tf rmNewExam"   
  251      || AppC lass == "T frmViewExa m"
  252   then 
  253           if  FocusSubT ype == WT_ LISTBOX  T hen 
  254                    if F ocusName   == "More"   Then 
  255                                      return S ayControlE x(FocusWin dow, "Cons iderations  Select on e or more"
  256                    ElIf  FocusClas s == "TChe ckListBox"
  257                       & & GetWindo wClass (Ge tNextWindo w (FocusWi ndow)) ==  "TTreeView "
  258                       & & GetWindo wName (Get Parent (Ge tParent (F ocusWindow ))) == "Ex ams Reques ted:"
  259                    Then
  260                             return  SayContro lEx(FocusW indow , "S elect Exam s To Add:" )                         
  261                    EndI f
  262           EL If FocusSu bType == W T_EDITCOMB
  263              && StringC ompare(Foc usName, WN _CP_ClaimR equired )  == 0  then  
  264                    retu rn SayCont rolEx (Foc usWindow,  msg_ClaimF ileRequire d)
  265           El If StringC ompare(Foc usName, WN _CP_LastRa tingExamDa te) == 0 T hen 
  266                    retu rn SayCont rolEx (Foc usWindow,  FocusName,  cscNull,  cscNull, c scNull, cs cNull, Get ObjectName  (True, 0) )
  267           En dIf
  268   ElIf  AppC lass ==  " TfrmExamRe questTempl ate" Then 
  269           if  FocusSubT ype == WT_ LISTBOX
  270               && GetDia logPageNam e() == "SC /Increased  Eval"
  271           th en 
  272                    retu rn SayCont rolEx (Foc usWindow,  "Veteran c laims incr eased disa bilities:" )
  273           El If FocusSu bType  ==  WT_BUTTON 
  274               && GetWin dowName (G etNextWind ow (FocusW indow)) ==  "Add New  Medical Co ndition To  List"
  275           Th en
  276                    retu rn SayCont rolEx (Foc usWindow,  cscNull, c scNull, cs cNull, "Ad d conditio n")
  277           En dIf   
  278   elif AppCl ass == "Tf rmReportsA dhocSubIte m1" Then 
  279           if  focusClas s == "TORC omboEdit"  Then
  280                    Focu sName = "F ile Select ions:"
  281                    Save Cursor() I nvisibleCu rsor() Sav eCursor()
  282                    Move ToWindow ( GetPriorWi ndow (GetP riorWindow  (GetParen t(FocusWin dow))))
  283                    sGro upName = G etChunk ()
  284                    Rest oreCursor  ()RestoreC ursor ()
  285                    retu rn SayCont rolEx (Foc usWindow,  FocusName,  cscNull,  cscNull, s GroupName)
  286           El if FocusCl ass == "TO RListBox"  Then 
  287                    retu rn SayCont rolEx(Focu sWindow, " File Entri es Selecte d:")
  288           En dIf
  289   elif AppCl ass == "TF ormReportB uilder" 
  290      && Focu sSubType = = WT_LISTB OX 
  291   Then
  292           re turn sayCo ntrolEx(Fo cusWindow,  "List of  sections")
  293   elif AppCl ass == "Tf rmPNCSSand box" Then
  294           ;  this windo w locks us  in templa tes and do es nothing  just clos e it.
  295           Ty peKey ("AL T-F4" )
  296   EndIf
  297  
  298   ; Now hand le general ized over  rides for  the CAPRI  applicatio n.
  299   if GetWind owClass (F ocusWindow  )== "TChe ckListBox"  Then 
  300   ;       Sa yString("P lease Veri fy List Ch eck Box")
  301           iR esult = VA 508getComp onentProp( FocusWindo w , VA508_ FieldName_ Caption ,  0 , FocusN ame ) ; 0  = Get from  cache 
  302           if  ! iResult  Then
  303                    Focu sName = Ge tWindowNam e (FocusWi ndow )
  304           En dIf
  305           Sa y(FocusNam e , OT_CON TROL_NAME  )
  306           iR esult =        CAPRI_ _SpeakSele ctedCheckB ox()
  307           if  ! iResult  Then 
  308                    SayO bjectActiv eItem (Fal se)
  309           En dIf
  310            r eturn true  
  311   Elif Focus SubType ==  WT_READON LYEDIT  
  312      && Stri ngLength ( GetWindowT ext (Focus Window, Fa lse))== 0 
  313   Then
  314           sa y(sGroupNa me , OT_CO NTROL_GROU P_NAME)
  315           Sa y(FocusNam e, OT_WIND OW_NAME)
  316           sa yMessage ( OT_LINE, " Empty or u navailable  field", c scSpace )
  317           re turn true 
  318   ElIf Focus Class  ==  "TTab95Con trol"
  319           Sa yControlEx (FocusWind ow, FocusN ame  )
  320   Elif Strin gCompare ( FocusClass  , "TButto n" )== 0 T hen
  321   ; Speak  b uttons for  selection  panels (b uttons wit h Names "< " , ">", " <<"  and " >>"  #20
  322           if  StringCom pare(Focus Name, ">"  ) == 0 The n
  323                    retu rn SayCont rolEx (Foc usWindow,  "Add selec ted compon ent")
  324           El if StringC ompare(Foc usName, "< " ) == 0 T hen
  325                    retu rn SayCont rolEx (Foc usWindow,  "Remove se lected com ponent")
  326           El if StringC ompare(Foc usName, "> >" ) == 0  Then
  327                    retu rn SayCont rolEx (Foc usWindow,  "Add all c omponents" )
  328           El if StringC ompare(Foc usName, "< <" ) == 0  Then
  329                    retu rn SayCont rolEx (Foc usWindow,  "Remove al l componen ts")
  330           En dIf
  331   EndIf
  332   return Han dleCustomW indows( Fo cusWindow)  
  333   EndFunctio n
  334  
  335   Int Functi on HandleC ustomAppWi ndows (han dle hAppMa inWindow )
  336   var
  337           Ha ndle hMemo Window,
  338           st ring sAppM ainClass =  GetWindow Class (hAp pMainWindo w )
  339   if sAppMai nClass ==  "TMessageF orm" Then 
  340           Sa y (GetWind owTextEx ( hAppMainWi ndow , Fal se, False) , OT_SCREE N_MESSAGE)
  341           re turn(True  )
  342   elif sAppM ainClass = = "TfrmErr Msg"  
  343      && GetW indowClass ( GetFirst Child (hAp pMainWindo w ))  ==   "TMemo"
  344   Then 
  345           be ep()
  346           Sp eakWindowI nformation  (hAppMain Window )
  347           Sa y (GetWind owTextEx ( GetFirstCh ild (hAppM ainWindow  ), False,  False, Tru e), OT_ERR OR, False)
  348           Re turn( True
  349   elif sAppM ainClass = = "TFrmDis playHelp"   
  350   Then 
  351           hM emoWindow  = FindWind ow (hAppMa inWindow ,  "TMemo",  cscNull)
  352           if  hMemoWind ow Then 
  353                    Spea kWindowInf ormation ( hAppMainWi ndow )
  354                    Say  (GetWindow TextEx (hM emoWindow  , False, F alse, True ), OT_ERRO R, False)
  355                    Retu rn( True) 
  356           En dIf
  357   elif sAppM ainClass = = "TFrmDis playError"   
  358   Then 
  359           hM emoWindow  = FindWind ow (hAppMa inWindow ,  "TMemo",  cscNull)
  360           if  hMemoWind ow Then 
  361                    beep ()
  362                    Spea kWindowInf ormation ( hAppMainWi ndow )
  363                    Say  (GetWindow TextEx (hM emoWindow  , False, F alse, True ), OT_ERRO R, False)
  364                    Retu rn( True) 
  365           En dIF
  366   EndIf 
  367   return Han dleCustomA ppWindows(  hAppMainW indow )  ;  call defa ult 
  368   EndFunctio n
  369  
  370   string fun ction GetC ustomTutor Message()
  371   ; don't at tempt to p rocess spe cial windo ws.
  372   if  isSpec ialFocus (  False ) T hen
  373           Re turn False  
  374   EndIf
  375  
  376   var
  377           ha ndle Focus Window =   getFocus() ,
  378           Ha ndle AppWi ndow = Get AppMainWin dow (Focus Window),
  379           in t FocusTyp e = GetWin dowSubtype Code (Focu sWindow, T rue),
  380           St ring Focus Name = Get WindowName ( FocusWin dow ),
  381           St ring AppCl ass = GetW indowClass  (AppWindo w)
  382  
  383   if AppClas s == "Tfrm Address"   && FocusTy pe == WT_B UTTON Then  
  384           re turn Forma tString( " Use Virtul ize Window  %keyfor(V irtualizeW indow ) to  review th e address. ")
  385   ElIf AppCl ass == WC_ PatientLis tAppWindow && FocusNa me==  "Mor e" && Focu sType ==WT _BUTTON Th en
  386           Re turn "type  space to  expand lis t of patie nts."
  387   elif AppCl ass == "TF ormReportB uilder" 
  388      && Focu sType == W T_Button
  389   Then
  390           If  FocusName  == "Add S elected" T hen 
  391                    retu rn "add it ems select ed in the  clinical d ocuments s creen" 
  392           El If FocusNa me == "Add  All" Then  
  393                    retu rn "Add al l items in  the clini cal docume nts screen ."
  394           En dIf
  395   elif AppCl ass == "TL istForm" 
  396     && GetWi ndowName(  AppWindow  ) == "Fiel d Selector " Then
  397           if  FocusType   == WT_ED IT Then
  398                    retu rn "enter  a search t erm and th en select  from the b elow list.
  399           En dIf
  400   EndIf
  401  
  402   if InClini calTabs ()  Then
  403           if   FocusTyp e  == WT_B UTTON Then  
  404                    if F ocusName = = "Report  Builder" T hen 
  405                             return  "Use the  Select " +  ClinicalS ectionName () + " bef ore this b utton."
  406                    ElIf  FocusName  == "100 D ocuments"  Then 
  407                             Return  "Adjust p arameters  for select ed section
  408                    EndI f
  409           El If FocusTy pe  == WT_ EXTENDEDSE LECT_LISTB OX Then 
  410                    Retu rn "Select  items wit h the spac e bar." 
  411           En dIf
  412   EndIf
  413  
  414   if GetWind owClass(Fo cusWindow)  == WC_Dat eTimePicke r  Then
  415           re turn"Type  alt-downar row to ope n the cale ndar"
  416   EndIf
  417  
  418   EndFunctio n
  419  
  420  
  421   Int Functi on CAPRI__ SpeakSelec tedCheckBo x ()
  422   var
  423           in t cid,
  424           ob ject o = g etFocusObj ect(cid),
  425   int fLeft,  int fTop,  int  fRig ht, int fB ottom,
  426           in t iMSAATop , int iMSA AHeight, i nt iMSAALe ft, int iM SAAWidth 
  427   if o then
  428  
  429           o. accLocatio n(intRef(i MSAALeft ) , intRef(i MSAATop),  intRef(iMS AAWidth),  intRef(iMS AAHeight),  cID)
  430   if !iMSAAL eft && !iM SAATop &&  !iMSAAWidt h && !iMSA AHeight th en
  431           re turn  Fals
  432   EndIf
  433           fT op = iMSAA top + 1 
  434           fB ottom = fT op + iMSAA Height 
  435   fLeft = iM SAALeft + 
  436   fRight = f Left + iMS AAWidth  
  437   Say(GetTex tInRect (f Left, fTop , fRight ,  fBottom,  0, IgnoreC olor, Igno reColor, t rue ), OT_ SELECTED)
  438   return tru
  439   endIf
  440   EndFunctio n
  441   Script Vir tualizeWin dow()
  442   var
  443           st ring AppCl ass = GetW indowClass  (GetAppMa inWindow ( GetCurrent Window ()) )
  444  
  445   if  String Compare("c apri", gs_ DelphiAppl icationNam e , True)  == 0   
  446      && AppC lass == "T frmAddress
  447   then
  448           CA PRI__Virtu alizeAddre ssPanel()
  449   else 
  450           Pe rformScrip t Virtuali zeWindow()
  451   EndIf
  452   EndScript 
  453  
  454  
  455   void funct ion CAPRI_ _Virtualiz eAddressPa nel ()
  456   var
  457           in t iTempAdd ressStart,
  458           ha ndle Testi ngWindow ,
  459           ha ndle AppWi ndow = Get AppMainWin dow (GetFo cus()),
  460           st ring sKey,  string sV alue, 
  461           co llection A ddressInfo rmation 
  462  
  463   AddressInf ormation =  new colle ction 
  464   SaveCursor ()  Invisi bleCursor( ) SaveCurs or() 
  465           Se tRestricti on (Restri ctAppWindo w)
  466   MoveToWind ow (AppWin dow )
  467   JAWSTopOfF ile ()
  468   FindString  (AppWindo w, "Tempor ary", S_TO P, S_RESTR ICTED , Fa lse )
  469   iTempAddre ssStart =  GetCursorC ol ( )
  470   RestoreCur sor ()Rest oreCursor  ()
  471   TestingWin dow  = Get FirstChild (AppWindow  )
  472   while Test ingWindow   
  473           sV alue = Get WindowText  (TestingW indow , Fa lse)
  474  
  475           if  sValue Th en
  476                    if G etWindowLe ft (Testin gWindow )  > iTempAdd ressStart   Then 
  477                             sKey =  "t" + Get WindowName  (TestingW indow )
  478                    Else
  479                             sKey =  "permanen t" + GetWi ndowName ( TestingWin dow )
  480                    EndI f
  481                    Addr essInforma tion[ sKey  ] = sValu
  482           En dIf
  483           Te stingWindo w  = GetNe xtWindow ( TestingWin dow )
  484   EndWhile 
  485  
  486   ; Now prin t out addr ess inform ation.
  487   UserBuffer Deactivate  ()
  488   UserBuffer Clear ()
  489   SayMessage (OT_USER_B UFFER, "Ad dress Veri fication\n \nVerify t he below a ddress inf ormation.\ n")
  490   if Collect ionItemExi sts (Addre ssInformat ion, "tStr eet:") The n
  491           Sa yMessage ( OT_USER_BU FFER, "\nT emporary A ddress:" )
  492           Sa yMessage(O T_USER_BUF FER, Addre ssInformat ion["tStre et:"] )
  493           if  Collectio nItemExist s (Address Informatio n, "perman entAddress  (line 2): ")
  494                    SayM essage(OT_ USER_BUFFE R, Address Informatio n["tAddres s (line 2) :"])
  495           En dIf
  496  
  497           if  Collectio nItemExist s (Address Informatio n, "tAddre ss (line 3 ):")
  498                    SayM essage(OT_ USER_BUFFE R, Address Informatio n["tAddres s (line 3) :"])
  499           En dIf
  500           Us erBufferAd dFormatted Message (  "%1, %2  % 3 %4 \nCou nty: %5",  "%1, %2  % 3 %4 \nCou nty: %5",  AddressInf ormation[" tCity:"],  AddressInf ormation[" tState:"],  AddressIn formation[ "tZip+4:"] , AddressI nformation ["tCountry :"], Addre ssInformat ion["tCoun ty:"])
  501           Us erBufferAd dFormatted Message (  "Primary P hone: %1       Office  Phone: %2 ", "Primar y Phone: % 1   Office  Phone: %2 ",AddressI nformation ["tPhone:" ], Address Informatio n["tOffice  Phone:" ]  )
  502   EndIf
  503   SayMessage (OT_USER_B UFFER, "Pe rmanent Ad rss:")
  504   SayMessage (OT_USER_B UFFER, Add ressInform ation["per manentAddr ess (line  1):"])
  505   if Collect ionItemExi sts (Addre ssInformat ion, "perm anentAddre ss (line 2 ):")
  506           Sa yMessage(O T_USER_BUF FER, Addre ssInformat ion["perma nentAddres s (line 2) :"])
  507   EndIf
  508  
  509   if Collect ionItemExi sts (Addre ssInformat ion, "perm anentAddre ss (line 3 ):")
  510           Sa yMessage(O T_USER_BUF FER, Addre ssInformat ion["perma nentAddres s (line 3) :"])
  511   EndIf
  512   UserBuffer AddFormatt edMessage  ( "%1, %2   %3 %4 \nC ounty: %5" , "%1, %2   %3 %4 \nC ounty: %5" , AddressI nformation ["permanen tCity:"],  AddressInf ormation[" permanentS tate:"], A ddressInfo rmation["p ermanentZi p+4:"], Ad dressInfor mation["pe rmanentCou ntry:"], A ddressInfo rmation["p ermanentCo unty:"])
  513   UserBuffer AddFormatt edMessage  ( "Primary  Phone: %1       Offi ce Phone:  %2", "Prim ary Phone:  %1   Offi ce Phone:  %2",Addres sInformati on["perman entPhone:" ], Address Informatio n["permane ntOffice P hone:" ] )
  514   UserBuffer AddText (" \nAddress  informatio n is corre ct", "Capr i_ClickAdd ressButton (1)", "Con tinue to f orm", "Cou rier", 15)
  515   UserBuffer AddText (" Edit addre ss informa tion", "Ca pri_ClickA ddressButt on(2)", "E dit addres s", "Couri er", 15)
  516   UserBuffer Activate ( False)
  517   JAWSPageUp  () SayLin e()
  518  
  519   EndFunctio n
  520  
  521   const CAPR I_AddressB uttons = " OK|Edit Ad dress Now"
  522    
  523  
  524   Void Funct ion Capri_ ClickAddre ssButton ( int iButto n)
  525   UserBuffer Deactivate  ()
  526   var string  sObjectNa me = Strin gSegment ( CAPRI_Addr essButtons , "|", iBu tton)
  527   var handle  myButton  = FindWind ow (GetApp MainWindow  (GetFocus ()), cscNu ll, sObjec tName )
  528   if myButto n Then 
  529           Se tFocus (my Button)
  530           de lay(1)
  531           Ty peKey ("sp ace")
  532   EndIf
  533   EndFunctio n
  534  
  535   Void Funct ion Active ItemChange dEvent (ha ndle curHw nd, int cu rObjectId,  int curCh ildId,
  536           ha ndle prevH wnd, int p revObjectI d, int pre vChildId)
  537   if FixChec kBoxList()  Then
  538            i f CAPRI__S peakSelect edCheckBox  () Then 
  539                    retu rn 
  540           En dIf
  541   Endif
  542   va508jaws: :ActiveIte mChangedEv ent (curHw nd, curObj ectId, cur ChildId,pr evHwnd, pr evObjectId , prevChil dId)
  543   EndFunctio
  544  
  545   Void Funct ion activs ayObjectAc tiveItem(i nt speakPo sitionInfo )
  546   if GetWind owClass (G etFocus()) == "TCheck ListBox" T hen 
  547           CA PRI__Speak SelectedCh eckBox ()
  548           if  speakPosi tionInfo T hen 
  549                    Say( PositionIn Group(),   OT_POSITIO N)
  550           En dIf
  551   Else 
  552   va508jaws: :sayObject ActiveItem (speakPosi tionInfo)
  553   EndIf
  554   EndFunctio
  555  
  556  
  557  
  558  
  559  
  560   Object Fun ction oMSA AGetSelect edTab (int  ByRef cID )
  561   var
  562           ob ject o,
  563           in t count,
  564           st ring wcTTa bControl   = "TTabPag e"
  565  
  566           le t o = getF ocusObject (cid) ; fu ll child c ontrol
  567           le t count =  1
  568           wh ile o && c ount < 10  && o.accRo le(CHILDID _SELF ) !=  role_syst em_pagetab list
  569                    let  o = o.accP arent() ;  window
  570                    let  count = co unt + 1
  571           En dWhile
  572  
  573           if  o && o.ac cRole(chil dId_self)  == role_sy stem_paget ablist the n
  574                    let  count = 1
  575                    whil e count <=  o.accChil dCount()
  576                             if o.a ccState(co unt) & sta te_system_ selected t hen
  577           cI D = count 
  578                                      return o
  579                             endif
  580                             let co unt = coun t + 1
  581                    EndW hile
  582           en dif
  583   EndFunctio n
  584  
  585   String Fun ction GetD ialogPageN ame()
  586   var 
  587           ob ject o,
  588           in t cID ,
  589           St ring sTabN ame 
  590  
  591   o = oMSAAG etSelected Tab (cID)
  592   sTabName =  o.AccName (cID) 
  593   sTabName =   stringCh opLeft (sT abName,            St ringContai ns (sTabNa me, ")"))
  594   sTabName =  StringTri mLeadingBl anks (sTab Name)
  595   return sTa bName 
  596   EndFunctio n
  597  
  598   Void Funct ion MSAASe lectTab(in t directio n)
  599   var
  600           ob ject o,
  601           in t cid
  602  
  603   o = oMSAAG etSelected Tab( cID) 
  604   if Cid  ==  0 then 
  605           be ep()
  606           re turn 
  607   EndIf 
  608   if directi on == 1 th en
  609           if  o.accRole (cid+1) !=  role_syst em_pagetab  then
  610                    let  cid = 0
  611           en dif ; role  page tab
  612           o. accSelect( selflag_ta keSelectio n| SELFLAG _TAKEFOCUS  ,cid+1)
  613   elif direc tion == 0  then
  614           if  cid > 1 t hen
  615                    o.ac cSelect(se lflag_take Selection  | SELFLAG_ TAKEFOCUS  ,cid-1)
  616           El If o.accRo le( o.accC hildCount( )) == role _system_pa getab then
  617                    o.ac cSelect(se lflag_take Selection|  SELFLAG_T AKEFOCUS,o .accChildC ount())
  618           el se ; just  sit on fir st tab
  619           be ep()
  620                    retu rn 
  621           en dif
  622   Endif ; di rection
  623   EndFunctio n
  624  
  625   int Functi on IsMulti PageDialog  ()
  626   if GetDial ogPageName ()
  627           Re turn True
  628   Else
  629           Re turn False
  630   EndIf
  631   EndFunctio
  632  
  633  
  634  
  635   script Nex tDocumentW indow ()
  636   MSAASelect Tab   (1)
  637   EndScript
  638  
  639   script Pre viousDocum entWindow  ()
  640   MSAASelect Tab   (0 )
  641   EndScript
  642  
  643  
  644  
  645  
  646   Script Alt X ()
  647   var
  648           ha ndle hFocu sWindow  =  GetFocus( ),
  649           ha ndle hAppM ainWindow  = GetAppMa inWindow ( hFocusWind ow),
  650           st ring sAppM ainClass =  GetWindow Class (hAp pMainWindo w )
  651  
  652   TypeCurren tScriptKey  ()
  653   if sAppMai nClass ==   "TfrmView Exam"  The
  654           de lay(1)
  655           va
  656           ha ndle hPane l = FindWi ndow(FindW indow(hApp MainWindow ,  "TPanel ", cscNull  ), "TPane l", cscNul l ),
  657   handle hLi stExams =  FindWindow  (hPanel,  "TCheckLis tBox", csc Null)
  658           if  hListExam s Then 
  659                    SetF ocus( hLis tExams)
  660           En dIf
  661   EndIf
  662   ;TCheckLis tBox
  663   ;
  664  
  665  
  666  
  667   EndScript
  668  
  669  
  670  
  671  
  672  
  673  
  674  
  675   Messages
  676   @CAPRI__Cl inicalTabs  
  677   1)  Notes
  678   2)  Discha rge Summar ies
  679   3)  Consul ts
  680   4)  Vitals
  681   5)  Meds
  682   6)  Labs
  683   7)  Imagin g
  684   8)  Diet
  685   9)  Nutrit ional Asse ssment
  686   U)  Order  Summary
  687   Y)  Proced ures
  688   Z)  Proble m List
  689   @@
  690  
  691   @CAPRI__Cl inicalSect ion 
  692   Notes
  693   Discharge  Summaries
  694   Consults
  695   Vitals
  696   Medication s
  697   Lab report s
  698   Imaging
  699   Dietetics  Profile
  700   Nutritiona l Assessme nts
  701   Orders
  702   Procedures
  703   Problems
  704   @@
  705   EndMessage
  706           
  707   Int Functi on InClini calTabs ()
  708   var
  709           ha ndle hAppM ainWindow  = GetAppMa inWindow ( GetFocus ( )),
  710           st ring sAppM ainClass =   GetWindo wClass (hA ppMainWind ow )
  711  
  712   if sAppMai nClass ==   "TfrmMain "  Then
  713           re turn   Str ingSegment Index (CAP RI__Clinic alTabs , " \n", GetDi alogPageNa me (), Tru e)
  714   EndIf
  715  
  716   return Fal se 
  717   EndFunctio n
  718  
  719  
  720  
  721   string Fun ction Clin icalSectio nName ()
  722   var int iP osition =  InClinical Tabs ()
  723  
  724   if iPositi on Then 
  725           re turn Strin gSegment ( CAPRI__Cli nicalSecti on , "\n",  iPosition )
  726   EndIf
  727  
  728   return csc NUll 
  729   EndFunctio n
  730  
  731  
  732  
  733  
  734  
  735  
  736   script tab ()
  737   var
  738           ha ndle hFocu sWindow =  GetFocus() ,
  739   handle hAp pWindow =  GetAppMain Window (hF ocusWindow ),
  740   string sAp pClass = G etWindowCl ass (hAppW indow)
  741  
  742   If sAppCla ss == "TPN CSForm" Th en
  743           va
  744                    hand le  hPrevi ewWindow =  FindWindo w (hAppWin dow , "TTa bControl") ,
  745                    hand le hYesWin dow  =  Fi ndWindow ( hAppWindow  , cscNull  , "Yes -  Save and E xit")
  746           if  IsWindowV isible (Ge tParent (h YesWindow) ) Then 
  747                    If G etNextWind ow (hYesWi ndow) == h FocusWindo w  Then 
  748                             SetFoc us( hYesWi ndow ) 
  749                    else  ; if hYes Window ==  hFocusWind ow Then 
  750                             SetFoc us (GetNex tWindow (h YesWindow) )
  751                    EndI f
  752                    Retu rn
  753           El if hPrevie wWindow  & & GetWindo wName( hPr eviewWindo w) == "FUL L REPORT"  Then             
  754                    if     GetParen t (hFocusW indow) ==  hPreviewWi ndow  Then  
  755                             SetFoc us( FindWi ndow (GetP arent (hPr eviewWindo w), cscNul l, "OK"))
  756                             return
  757                    EndI f
  758           el se
  759           En dIf
  760   EndIf
  761   PerformScr ipt Tab()
  762   EndScript
  763  
  764   script Shi ftTab()
  765   var
  766           ha ndle hFocu sWindow =  GetFocus() ,
  767   handle hAp pWindow =  GetAppMain Window (hF ocusWindow ),
  768   string sAp pClass = G etWindowCl ass (hAppW indow)
  769  
  770   If sAppCla ss == "TPN CSForm" Th en
  771           va
  772                    hand le  hPrevi ewWindow =  FindWindo w (hAppWin dow , "TTa bControl") ,
  773                    hand le hYesWin dow  =  Fi ndWindow ( hAppWindow  , cscNull  , "Yes -  Save and E xit")
  774  
  775           if  IsWindowV isible (Ge tParent (h YesWindow) ) Then 
  776                    Say( GetWindowT extEx (Get Parent (hY esWindow),  False, Tr ue , False  ) , OT_SC REEN_MESSA GE)
  777                    If G etNextWind ow (hYesWi ndow) == h FocusWindo w  Then 
  778                             SetFoc us( hYesWi ndow ) 
  779                             SetFoc us (GetNex tWindow (h YesWindow) )
  780                    EndI f
  781                    Retu rn
  782           El if hPrevie wWindow  & & GetWindo wName( hPr eviewWindo w) == "FUL L REPORT"  Then             
  783                    if     GetWindo wName(hFoc usWindow)  == "OK" Th en 
  784                             SetFoc us( GetFir stChild (h PreviewWin dow ))
  785                             return
  786                    EndI f
  787           el se
  788           En dIf
  789   EndIf
  790   PerformScr ipt ShiftT ab()
  791   EndScript
  792  
  793   int functi on  Should ShowUnknow nFunctionC allStack()
  794           re turn false  
  795   EndFunctio
  796  
  797   int functi on GetMenu Mode()
  798   var 
  799           St ring sAppM ainClass =  GetWindow Class (Get AppMainWin dow (GetFo cus())),
  800           St ring sFocu sClass = G etWindowCl ass (GetFo cus())
  801  
  802   if ( sAppM ainClass = = "Tfrmrep orts" 
  803        || sA ppMainClas s == "Tfrm reports" )
  804      && (sFo cusClass = = "TGroupB utton" 
  805        || sF ocusClass  == "TCheck Box" 
  806        || sF ocusClass  == "TRadio Button" )
  807   Then
  808  
  809           re turn 0 
  810   ElIf sAppM ainClass = = "TMessag eForm" 
  811      || sApp MainClass  == "#32770 "
  812      || sApp MainClass  == "TfrmSp ecialRepor t"
  813      || sApp MainClass  == "TfrmRO Finder"
  814      || sApp MainClass  == "TfrmVR EReportSet up"
  815      || sApp MainClass  == "TfrmFo rwardingAd dress"
  816      || sApp MainClass  == "TfrmVl erGetExams "
  817   Then 
  818           Re turn 0 
  819   EndIF
  820  
  821   return Get MenuMode()
  822   EndFunctio n
  823  
  824  
  825   void funct ion SayLin e()
  826   if FixChec kBoxList()  Then
  827            i f CAPRI__S peakSelect edCheckBox  () Then 
  828                    retu rn 
  829           En dIf
  830   Endif
  831   va508jaws: :SayLine()
  832   EndFunctio n
  833  
  834  
  835  
  836   int Functi on FixChec kBoxList ( )
  837   if GetWind owClass (G etFocus())  == "TChec kListBox"  then
  838           if  GetWindow Class(GetA ppMainWind ow(GetFocu s( ))) ==  "TfrmSpeci alReport"   Then 
  839                    retu rn true
  840           En dIf
  841   EndIF
  842  
  843   return fal se 
  844   EndFunctio n
  845  
  846  
  847   int functi on Process SpaceBarKe yPressed(i nt nKey, s tring strK eyName, in t nIsBrail leKey, int  nIsScript Key)
  848   If !KeyIsS pacebar(nK ey,strKeyN ame,nIsBra illeKey) t hen
  849           re turn false
  850   EndIf
  851  
  852   if FixChec kBoxList()  Then 
  853           De lay (1)
  854           Sa veCursor()  Invisible Cursor() S aveCursor( )
  855           Ro uteInvisib leToPc ()
  856           Pr iorChunk ( )
  857           Sa yChunk ()
  858           Re storeCurso r ()Restor eCursor ()
  859           re turn true 
  860   Else
  861   return Pro cessSpaceB arKeyPress ed(nKey, s trKeyName,  nIsBraill eKey, nIsS criptKey)
  862   EndIf
  863   EndFunctio
  864  
  865   Void Funct ion SiteCo deInitiali ze ()
  866   Delphi_App Defined  =  new colle ction 
  867  
  868   EndFunctio n
  869  
  870   void funct ion SiteCo deClear()
  871   Collection RemoveAll  (Delphi_Ap pDefined   )
  872   EndFunctio
  873  
  874  
  875   int functi on GetWind owSubtypeC ode (handl e hWnd)
  876   var
  877           in t iSubType  = va508ja ws::GetWin dowSubtype Code (hWnd ),
  878           in t iParentS ubType = v a508jaws:: GetWindowS ubtypeCode  (GetParen t (hWnd) )
  879  
  880   if iSubTyp e == WT_ED IT 
  881      && iPar entSubType  == WT_EDI TCOMBO 
  882   Then
  883           iS ubType = W T_EDITCOMB O
  884   EndIF
  885   return iSu bType
  886   EndFunctio
  887  
  888   globals   
  889           st ring gsVA5 08cacheCap tion, 
  890           st ring gsVA5 08cacheVal ue, 
  891           st ring gsVA5 08CacheCon trolType,
  892           in t giVA508c acheDataSt atus 
  893  
  894   void Funct ion SpeakP atientList Updates ()
  895   Say("Patie nt List up dated pres s tab to s elect a pa tient", OT _JAWS_MESS AGE)
  896   EndFunctio n
  897  
  898  
  899   Script Ope nListBox()
  900   TypeCurren tScriptKey  ()
  901   delay(1)
  902   SayLine()
  903   SayMessage (OT_HELP,  "Use arrow s to pick  a date", " Navigate w ith arrows ")
  904   EndScript
  905  
  906  
  907  
  908   Void Funct ion VA508C acheUpdate  (handle h wnd)
  909   var 
  910           st ring Windo wClass,
  911           in t iFieldPo sition,
  912           in t iValuePo sition ,
  913           in t iMaxLeng th 
  914  
  915   ; In CAPRI , the           field s with cla ss TVA508S taticText  set the Ca ption / Na me to a si ngle space  and put e xtra data  into the v alue.
  916   ; so if Na me is leng ht 1 and C lass is ap propriate  and Value  contains R eadOnly th en put eve rything be fore ReadO nly into N ame and pu t everythi ng after R eadOnly in to Value 
  917  
  918  
  919   ; First ca ll the sta ndard fram ework then  correct f or the lab el we have  issues wi th.
  920  
  921   VA508Cache Update (hw nd)
  922  
  923  
  924   ; Was a Ca ption / Na me length  1? and we  have a cac hed value 
  925   if giVA508 cacheDataS tatus & VA 508_QueryC ode_Captio
  926     && giVA5 08cacheDat aStatus &  VA508_Quer yCode_Valu
  927     && Strin gLength (g sVA508cach eCaption )  == 1 
  928   then
  929           iM axLength =  StringLen gth(gsVA50 8CacheValu e )
  930           iF ieldPositi on = Strin gContains( gsVA508cac heValue ,  VA508Frame Work_ReadO nlyLabel)  -1 
  931           iV aluePositi on = Strin gContains( gsVA508cac heValue ,  VA508Frame Work_Value Label ) +  StringLeng th( VA508F rameWork_V alueLabel)  -1 
  932  
  933           if  iFieldPos ition  > 0  Then 
  934                    gsVA 508cacheCa ption  = S ubString ( gsVA508Cac heValue, 1 , iFieldPo sition)
  935                    gsVA 508CacheVa lue = SubS tring (gsV A508CacheV alue, iVal uePosition , iMaxLeng th)
  936                    gsVA 508CacheCo ntrolType=   VA508Fra meWork_Rea dOnlyLabel  
  937           el if StringC ontains(gs VA508cache Value , VA 508FrameWo rk_Disable dLabel) Th en 
  938                    iFie ldPosition  = StringC ontains(gs VA508cache Value , VA 508FrameWo rk_Disable dLabel)  -  1 
  939                    iVal uePosition  = iFieldP osition +  StringLeng th(VA508Fr ameWork_Di sabledLabe l)
  940                    gsVA 508cacheCa ption  = S ubString ( gsVA508Cac heValue, 1 , iFieldPo sition)
  941                    gsVA 508CacheVa lue = SubS tring (gsV A508CacheV alue, iVal uePosition , iMaxLeng th)
  942                    gsVA 508CacheCo ntrolType=   VA508Fra meWork_Dis abledLabel  
  943           En dIf
  944  
  945           if  StringLen gth (gsVA5 08CacheVal ue ) <  1 
  946     || Strin gCompare (  gsVA508Ca cheValue,  cscSpace )  == 0 
  947    Then  
  948                    gsVA 508CacheVa lue = msg_ BlankField
  949           En dIf
  950   EndIf
  951   EndFunctio n