Hanging Screen Scrap
Hanging Screen Scrap
(OP)
I’m new to the posting in the form community and hesitant to insult the talent
I have seen posted here and interested in learning to help others in the process.
My background is not coding and I have learned to code by observing the work and like
of this of this community.
Attachmate Reflection Suite for X 14.0.6029
Reflection for UNIX and OpenVMS
Version 14.0.6 build 687 32-bit
'For purpose of Chronic Pain Management
Working Date Range Calculator within Reflections- with following result.
Selected 30 Day
Original [11/04-12/3/2014 Inclusive]
Rf x 4 [11/06-12/05; 12/06-01/04; 01/05-02/03; 02/04-03/05; 03/06-4/4/2015]
Objective-Parse Number of Refills and Day Supply from screen
Start Date 'CurDat ‘Current Date by Default or users own.
Dim numRefills As String '’ Number of Refills Defaults to 30 Day;
Dim daySupply As String ‘ Default to 30 ‘for Class II Narcotics or User Defined.
This side of having a dynamic screen scrapping table this is my attempt to find an answer.
'==================================Screen Data===========================================
(8) Days Supply: 30 '8 not univeral; may change based on screen edits
(10) # of Refills: 5 (11) Routing: MAIL '10 not univerasl
'==================================Code Below============================================
I have seen posted here and interested in learning to help others in the process.
My background is not coding and I have learned to code by observing the work and like
of this of this community.
Attachmate Reflection Suite for X 14.0.6029
Reflection for UNIX and OpenVMS
Version 14.0.6 build 687 32-bit
'For purpose of Chronic Pain Management
Working Date Range Calculator within Reflections- with following result.
Selected 30 Day
Original [11/04-12/3/2014 Inclusive]
Rf x 4 [11/06-12/05; 12/06-01/04; 01/05-02/03; 02/04-03/05; 03/06-4/4/2015]
Objective-Parse Number of Refills and Day Supply from screen
Start Date 'CurDat ‘Current Date by Default or users own.
Dim numRefills As String '’ Number of Refills Defaults to 30 Day;
Dim daySupply As String ‘ Default to 30 ‘for Class II Narcotics or User Defined.
This side of having a dynamic screen scrapping table this is my attempt to find an answer.
'==================================Screen Data===========================================
(8) Days Supply: 30 '8 not univeral; may change based on screen edits
(10) # of Refills: 5 (11) Routing: MAIL '10 not univerasl
'==================================Code Below============================================
CODE -->
Sub gNumRef_Test() 'Get Number of Refills - daySupply Dim numRefills As Integer Dim daySupply As Integer Dim Found As Integer Dim numLine As Integer Dim arraySrchNumRefill(1 To 2) As String 'Case Select for status of "of Refills: " arraySrchNumRefill(1) = "Enter RETURN to continue:" arraySrchNumRefill(2) = "? Yes//" Dim LF As String ' Chr(rcLF) = Chr(10) = Control-J Dim CR As String ' Chr(rcCR) = Chr(13) = Control-M LF = Chr(Reflection2.ControlCodes.rcLF) CR = Chr(Reflection2.ControlCodes.rcCR) Const NEVER_TIME_OUT = 0 'prevents macro Endless Loop On Error GoTo ErrorHandler With Session .CapsLock = True numRefills = 0 daySupply = 0 Found = 0 numLine = 0 '********* Macro searches for 'of Refills: ' and makes sure its on the screen ****************** .Wait "00:00:01" .StatusBar = "searching list for Number of Refills" .Transmit "SL" & CR 'search list .Transmit "of Refills: " & CR Select Case .Parent.Application.WaitForStrings(arraySrchNumRefill) Case (1) .Transmit "+" & CR 'Press Return to continue Case (2) .Transmit "N" & CR 'Refill Found; Find Next? No 'A...... N and CR is ignored 'LEAVING PROMPT ON SCREEN ......................................> 'B...... ACTIVE SCREEN PROMPT: "Find Next "of Refills: '? Yes//" .............................> '............................................................> GoTo C............................> End Select '********* Screenscraping for 'of Refills: '****************************************************** .Wait "00:00:01" Found = .FindText("of Refills: ", 0, 0) MsgBox Found 'C....> Found = -1 'Value of Found 'D....> Macro Terminates here '.............................. GoTo to Line Before.............>E If Not Found Then '# of Refills MsgBox "Number of Refills Not Found, exiting macro." Exit Sub Else 'found # of Refills numLine = .GetText(.FoundTextRow, 0, .FoundTextRow, 1) 'captures the line# 'E....> Macro Terminates here MsgBox numLine numRefills = .GetText(.FoundTextRow, 74, .FoundTextRow, 75)'captures refills remaining MsgBox numRefills daySupply = .GetText(.FoundTextRow, 78, .FoundTextRow, 79) 'captures days supply MsgBox daySupply End If End With Exit Sub ErrorHandler: Session.MsgBox Err.description, vbExclamation + vbOKOnly 'G....> Error Type Mismatch End Sub
RE: Hanging Screen Scrap
Is it true that the specific data you are searching for is not located in specific rows/columns?
I've always worked with transactions that returned data in a specified format. For instance, I constructed a table that described the data contained on each transaction/screen. I would grab ALL data from the screen, parse it and write it into an Excel sheet, driven by a list of key lookup values in Excel as well. I might get thousands of screens of data in just a few minutes.
So I'm wondering WHAT you're trying to accomplish rather than HOW you're going about doing it.
RE: Hanging Screen Scrap
Forty-Eight years ago a TV series called Star Trek created in the public mind a fantasy of technology that seems so far out there it would take light years to reach our desktop... No one would have believed that communicators would become everyday cell phones and star ship voice navigation would be common place in our cars or on our phones.
The administrative side of the Department of Veteran Affairs is doing their best to dot every “i” and cross every “t” for patient safety. But there is a serious lag it the software tools needed by those on the front lines to accomplish the task. Society has a right to expect care for those who have served to preserve our freedom. We must however match the need with our priorities and the political will to accomplish the task.
The pharmacy software in current use looks like it came right out of a time capsule from mid 1980’s. The sad part is that it’s basic function is no better than an electric typewriter on top of a file cabinet of data from 1986.
VistA emulation with Attachmate Reflections VBA is a door that few front-line users have known was there. The problem is how to open the door. If we fail to recognize appropriate channels politics, bureaucracy and fear will masquerade as progress.
The software for pharmacy software is in the public domain and may be found with a web search : ehealth va.gov VistA Monograph.
VISTA is built on a client-server architecture, which ties together workstations and personal computers with graphical user interfaces at Veterans Health Administration (VHA) facilities, as well as software developed by local medical facility staff. VISTA also includes the links that allow commercial off-the-shelf software and products to be used with existing and future technologies.
That may look really good on paper but it means nothing if on the front lines if the mindset is business as usual. The demand on those on the front lines of patient care is going through the roof; Outsourcing care to the private sector where needed will do nothing to resolve the crisis of on IT resources without the tools to keep up with the need.
Specific Data = X is variable; Y is variable; occasionally parked at specific col, row for easy GetText use.
The efficiency of time would merit universal code that with index management could more easily adapt to a given need.
The real answer to-
I'm wondering WHAT you're trying to accomplish
Unless the steps to accomplish the goal are small enough in the beginning to demonstrate to one and all, this is not vapor ware, it working….dumb as a rock to claim otherwise.
I began experimenting with VBA screen scrapping in May. With some assistance in those early days from Attachmate I was able to piece together code to pull the SSN from the screen, remove the dashes and call the website for postal tracking (in less than 10 seconds).
The manual time required is nothing less than 30 seconds. That is more than 2 wasted hours per day.
(No extra cost for equipment, just better utilization of time, better tools to call center, better patient care)
Regardless of who has the opportunity to solve these problems;
Simple cookbook 'like' database look-up automated could significantly improve resources for patient care.
Liver patient These drugs Specific Labs, in real time.
Cancer patient These drugs Green Light/Red Light
Chronic Pain 6 month Get Morphine Equivalents/Day over last 6 months.
(80% time of clinical pharmacist is spent looks stuff up- the then becomes, can it be user friendly and why not sooner than later.)
RE: Hanging Screen Scrap
I still need to know if a specified screen has a fixed structure, or will you find, for instance, Days Supply: or # of Refills: in various places? As I previously stated, my experience is the former, and the parsing technique might vary based on this fact.
RE: Hanging Screen Scrap
'Row containing Rx# below Start Page 1 - May not be first line of Page 1
' Drug Interaction Warning may bump Rx# multiple lines
'
'Label Names for fields of interest will precede colon col, = 21
'Line containing "# of Refills" may not always be Edit Line (11)
'
' Sample Pages 1 to 3 Follow 'Similar screens found in public domain cited above
'>>>>>>>>Start Page 1 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
CODE -->
' NOT TO EXCEED THREE (3) GRAMS OF ACETAMINOPHEN PER DAY.
' {6/22-7/21; 7/22-8/20; 8/21-9/19; 9/20-10/19/14}
' (5) Patient Status: OPT NSC
' (6) Issue Date: 06/14/14 (7) Fill Date: 06/16/14
' Last Fill Date: 06/16/14 (Mail, Released)
' Last Release Date: 06/16/14 (8) Lot #:
' Expires: 06/15/15 MFG:
'(9) Days Supply: 30 (10) QTY (TAB): 120
'(11) # of Refills: 3 Remaining: 3
'(13) Routing: MAIL (14) Copies: 1
'(15) Clinic: PDICC POST DEPLOYMENT NEW
'(16) Division: VAMC XXX-OUTPTRX (000) '
'>>>>>>>>Start Page 3 >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
'(17) Pharmacist:
'(18) Remarks: 1000000D FILLED 6 TIMES FIRST MAIL OUT ON 01/20/2014
'(19) Counseling: NO
'(20) Refill Data
' Last Fill Date: 06/16/14 (Mail, Released)
Screen Spacing may be lost in posting- Text File Attached shows accurate spacing
RE: Hanging Screen Scrap
CODE -->
RE: Hanging Screen Scrap
BTW, could not get response from ehealthva.gov.
So what's the objective here?
Given a single RX#, print out the screens?
Given a list of RX#, print out screens for each?
Or only print out selected data, rather than entire screens?
I take it you only have Attachmate' Extra Basic, and not Excel on your PC, where VBA might be used?
RE: Hanging Screen Scrap
RE: Hanging Screen Scrap
I am particularly interested in how Page 2 is structured as empty.
RE: Hanging Screen Scrap
CODE -->