Importing from IBM AS/400 to Synapse?

Discussion in 'Synapse' started by Jerry, May 17, 2008.

  1. Jerry

    Jerry Administrator Staff Member

    My employer, US HealthWorks uses an IBM AS/400 network for PMS. The company has about 114 clinics, so it's a sizable system. Recently, management decided that the "Activity Prescription Form" used for all work comp cases cannot be faxed or sent hand written from the clinics (as they heretofore have always been). Docs are being strongly encouraged to fill out the form on AS/400 -- much more efficient. The clinics run AS/400 emulator clients on Windows PC's. Very DOS/console looking stuff.


    I figured out to use xtn5250, an open source java AS/400 client on Puppy Linux along with Synapse. For a long time I have pondered the possibility of "screen scaping" patient demographics from the AS/400 client screen and dumping them somehow into Synapse. I want to keep other notes and fax in prescriptions for patients using Synapse as well as generate required forms.


    Today I figured out how to drag and paste patient demographics out of AS/400. Here's a sample -- I just changed the real name, address, and phone:


    BAAD, BOBBY S
    2218 E BAD RD
    MEAD St WA Zip 99208
    509 9999999 Cell 000 0000000

    Any specific ideas as to how to import this into Synapse?
  2. Graham

    Graham Developer Staff Member

    If it's an open source client perhaps you could alter this to dump the demographics into a CSV file ... using the Synapse CSV import format as previously documented.

  3. Jason

    Jason Developer / Handyman Staff Member

    Or use AutoHotKey to "pull" the data right from the screen and either (1) place it directly into Synapse or (2) generate a .csv file (to import as you suggest).

    I think this would be an easy script to make.

    If, all the information was on "one screen", and you could TAB to each field, that would make it easier. Essentially the script would systematically Tab across the screen, collecting the data as it went to the needed fields and saving them as needed.

    I could certainly generate the data going the other way.

    A good AHK scripter (not me really) could do this in 5 minutes.

    Rebol isn't 100% AHK friendly, but this script is easily doable.
  4. Graham

    Graham Developer Staff Member

    Don't think that this will work under PuppyLinux
  5. Jason

    Jason Developer / Handyman Staff Member

    Another method would be to use something like SnagIt - to "Screen OCR" the Text on the screen.

    Or there is another program called "ScreenOCR" [:)]

    Attached Files:

  6. Jerry

    Jerry Administrator Staff Member

    Jason,

    Fortunately, I don't need to OCR the text. I can use the "hold left mouse" button in conjunction with a rectangleto define an area in the AS/400 console window to drag, and paste the results from the clipboard directly in a word processor. That's what I did the example demographic. Worked fine on Puppy Linux. It works pretty much exactly like dragging and pasting text from a Command Console window in Windows.

    I like your idea of using a "SendKeys" type of script to advance the cursor to each datafield I want it to go to, harvest the data and do something with it. The IBM AS/400 Client on Windows can use VBScript or it's own internal script to run macros, which would do exactly what you are suggesting. IBM hasa free version of their AS/400 Clients available for Linux, which I wasn't able to get working yet. VBScript wouldn't work on Linux, but I bet the internal macro language would work.

    I wonder, thoughas to the relative advantage of harvesting the data one field at a time vs using a parser to reformat the data into a CSV file. I know how to use Tcl/Tk to reformat the data. Would I be able to use REBOL to do that, and would there be any relative advantage? Maybe better able to hook up the script to Synapse?

  7. Graham

    Graham Developer Staff Member

    Grabbing data by one field at a time sounds no better than just retyping the data.

    I would modify the OS java client to grab the data and save it as a CSV file.

  8. Jason

    Jason Developer / Handyman Staff Member

    Except that it would scripted and the computer can "Tab, Copy, Save to file, ..... Tab, Copy, Save to file ..... repeat until done " 1000x faster than a human :)
  9. Graham

    Graham Developer Staff Member

    I now have a working solution for this.

    Jerry can save the screen to a text file, and then paste the contents into a webform.

    The form then parses the relevant data out and inserts the patient into Synapse. Pretty painless.

    The work only took a few hours to write [H] and now we have to do some testing.
  10. Jason

    Jason Developer / Handyman Staff Member

    Nice !

    Did Jerry still want this ?

  11. Graham

    Graham Developer Staff Member

    Sure ... he commissioned it!

    He was entering the demographics by hand which of course slowed him down.
  12. Jason

    Jason Developer / Handyman Staff Member

    Screengrab of this webform ?
  13. Graham

    Graham Developer Staff Member

    I've got one but it's got confidential patient data on it ...
  14. Jerry

    Jerry Administrator Staff Member

    Graham and I worked through a couple of problems this evening and got the new Urgent Care Import script that is part of the new Synapse Physicians Web Interface working on my LAN.
    • IBM's AS400 client has a select all screen dump to clipboard. Takes 2 clicks to do it.
    • It also has a macro recorder that uses either "macro script" or VBScript.
    • Naturally, I will try to automate the import into Synapse into as few clicks as possible, preferably one click!
    Here's a sample screen dump from a private patient screen that I have sanitized. The worker comp screen is different. I will put them to a bigger test in the next few days, but worked great (and fast) this evening. Cheers for Graham!


    Private Patient Demographics

    Name DOE, JOHN Fac 688 First Visit 091108 1330

    Has Patient Moved from Current Address? Case Number 688-999999

    ------ Current Address ------- ------ Previous Address ------
    1234 N ANYWHERE
    SPOKANE&

Share This Page