Thom: I created a VB subroutine to build the file (see below). I call that routine via a rule:
[cid:[email protected]] This VB routine: Sub createVIPprocFile() ' This sub will create a unique processing file. Name ' will be based on date and time Dim procVIPFilea As String Dim procVIPFileb Const ForWriting = 2 procTotalNumberRecords = 0 procVIPFilePath = "\\ehfs1\home\bstation\VIP\Process\" newprocVIPFile = "MT_VIP_PROCESS" & Format(Now(), "_yyyy-mm-dd_") & Format(Now(), "hh-mm-ss") & ".txt" procVIPFilea = procVIPFilePath + newprocVIPFile Set lf = CreateObject("Scripting.FileSystemObject") lf.CreateTextFile ("" & procVIPFilea & "") Set procVIPFileb = lf.GetFile("" & procVIPFilea & "") Set procVIPFile = procVIPFileb.OpenAsTextStream(ForWriting, True) procVIPFileRecord = "SourceID|PatientID|UnitNumber|BirthDateTime|VIPName|Sex|Status|" procVIPFile.Writeline (procVIPFileRecord) clearVIPprocFile ' Get ready for the 1st record loadVIPprocFile ' Load up view records into this file End Sub Thanks. Mike Michael H Serafin Exeter Hospital Applications Analyst Sr. 603-580-7646 (Office) 603-369-4292 (Home) 603-361-3053 (Cell) From: [email protected] [mailto:[email protected]] Sent: Friday, January 04, 2013 2:04 PM To: [email protected] Subject: RE:[talkbws] Building a file in a script - want to use it to process - want a status written to it Mike, Think of Rules as something that can call code. All a Rule is, is "when" should I call that code. You mentioned that you are building the file in a sub routine - how exactly are you doing that? Are you using: (this is pseudocode) Open MT_FILE_yyyymmdd.txt for input as #1 To "build" your file? If that's the case, then "file #1" can be written to anywhere within your script. Print #1, "Whatever you want to go to the file" Be sure that the script closes "File #1" using Close #1 at the end! Am I on the right track here? Thom C. Blackwell VP, Technical Services Boston Software Systems, Inc. Phone: 866.653.5105 x807 Mobile: 508.423.8463 Fax: 508.319.3015 www.bostonsoftwaresystems.com<http://www.bostonsoftwaresystems.com/> Healthcare Automation - Revolutionizing How You Work. The information contained in this message may be confidential and legally protected under applicable law. The message is intended solely for the addressee(s). If you are not the intended recipient, you are hereby notified that any use, forwarding, dissemination, or reproduction of this message is strictly prohibited and may be unlawful. If you are not the intended recipient, please contact the sender by return e-mail and destroy all copies of the original message. From: [email protected] [mailto:[email protected]] Sent: Friday, January 04, 2013 1:58 PM To: Talk Subject: [talkbws] Building a file in a script - want to use it to process - want a status written to it Hi: I am using rules-based scripting and am building an ASCII file to contain data from a Meditech View that I run from the script; I want to use this file to "drive" the script. So I build the file in a VB subroutine and I want to build it using a unique name, in this case MT_FILE_yyyymmdd.txt. That part works fine. But I want to use this file in the script AND I would like to write a status back to it. This way I can email my user the file and she can see what was processed and what the status was for that record. I do not know how to open this unique-named file in the rules (maybe this can't be done)?? I also don't know how to write a status back to an ASCII file; I have no trouble opening an existing Excel file in the rules but that is an existing Excel file, not a uniquely named ASCII file. Thanks. Mike Michael H Serafin Exeter Hospital Applications Analyst Sr. 603-580-7646 (Office) 603-369-4292 (Home) 603-361-3053 (Cell) --- To post a message to this list, send mail to: [email protected]<mailto:[email protected]> You are currently subscribed as: [email protected]<mailto:[email protected]> Unsubscribe in the customer center on our website: http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx --- To post a message to this list, send mail to: [email protected] You are currently subscribed as: [email protected] Unsubscribe in the customer center on our website: http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx --- To post a message to this list, send mail to: [email protected] You are currently subscribed as: [email protected] Unsubscribe in the customer center on our website: http://www.bostonworkstation.com/customer_center/virtual_user_group_talk.aspx
<<inline: image003.jpg>>
