How to use vScription Upload with Winscribe System

How to use vScription Upload with Winscribe System

If you are using a Winscribe dictation system and want to send some of your work to vScription Transcribe for transcription services, there are a few ways;

Have a workstation dedicated to vScription Upload

With this option, you woudl have one workstation that has the vScription Upload installed and configured on it that would take all of the dictations from any configured removable device and send to vScription Transcribe

Manually upload dictations

If the volume isn't that large, you can upload the files manually to your account through the Upload Job module on the vScription Transcribe site. 

 Configure Winscribe Importer to work with vScription Upload

In this scenario, we are assuming you will be sending dictations to Winscribe and some to vScription Transcribe. This is the case where you have a single docking station used with multiple portable recorders and users.
The basic workflow will be that you need to setup a new Destination that will output to a local folder and you configure the vScription Upload to monitor that folder for dictations and then upload them to vScription Transcribe.  It is a bit more work than that though as you need to create your rules and a custom script that will generate the demographic file that vScription Upload needs to upload. The script also does a job lookup in Winscribe to try and get the WS Job Number to insert into the vScription Transcribe job and also updates the WS job notes to say the file has been uploaded to vScription Transcribe;

1. Configure Winscribe Importer
- Create a new Destination: Choose output files to a folder and set the output folder to the Monitor folder of vScription Upload
- Create new script: Create a new script and copy the following script into that file;
  1. Option Explicit
    ' You will need to create an SQL user with the following rights; Select from job table and Update J_NOTES column.
    sub main()

    Dim objText
    Dim lngPos
    Dim strDSSData
    Dim strDSSLength
    Dim strDPMAuthorID
    Dim strMappedAuthorID
    Dim strDPMWorktype
    Dim strMappedWorkType
    Dim Fso
    Dim origFileName
    Dim sOutFileName
    Dim sOutFullNameandPath
    Dim objFileToWrite
    Dim strDPMJobLength
    Dim strDateDict
    Dim dtDateForSQL
    Dim sJobLengthInSecs
    Dim sJobLengthMin
    Dim sJobLengthMax
    'DB Lookup variables
    Const adOpenStatic = 3
    Const adLockReadOnly = 1
    Const adCmdText = &H0001
    Dim ConnString  'Database connection string
    Dim myRs  'ADODB.Recordset Object
    Dim MyConn  ' ADODB.Connection Object
    Dim strSQL1   'SQL String
    Dim strSQL2
    Dim sWsJobNumber
    Dim data

    'We need to get the data for the job lookup first

    ' Open the DSS source file to get the file date dictated which we can't seem to get from the objRule object
    Set Fso = CreateObject("Scripting.FileSystemObject")  
    Set objText = Fso.OpenTextFile (objrule.Folder & "\" & objRule.FileName, 1)
    ' Read at least 900 bytes of the beginning of the DSS file, to ensure it gets the entire header:
    strDSSData = objText.Read(900)
    objText.Close
    ' Extract the Date Dictated When dictation was completed. We know excatly where it is and how long
    ' Note this is the date "closed" so when they actually press the EOL button
    strDateDict= Mid(strDSSData, 51, 12)

    'Get length used for SQL lookup
    strDPMJobLength = Mid(strDSSData, 63, 6)

    ' Map Authors
    'Note: If Author ID is padded with leading zeros it won't strip them
    strDPMAuthorID = objRule.AuthorID
    Select Case strDPMAuthorID
        Case "7777": strMappedAuthorID = "VTEX Support Test"
        Case "9501": strMappedAuthorID = "Jason Test"
        Case "9502": strMappedAuthorID = "Jordan Test"
        Case "1944": strMappedAuthorID = "Dr Karuppan Muthiah"
        Case "1508": strMappedAuthorID = "Dr. A. Benzaglam"
        Case "7059": strMappedAuthorID = "Dr. Abej Esmail"
        Case Else:strMappedAuthorID = "Not Configured"
    End Select

    ' Map Work Types
    ' Note: Looks if we want to use Alpha, we have to extract from DSS header
    strDPMWorkType = stripNULL(Trim(Mid(strDSSData,667,30)))
    Select Case strDPMWorkType
        Case "OFFICE VISIT": strMappedWorkType = "Office Visit"
        Case "CON REPLY": strMappedWorkType = "Consult Reply"
        Case "Con Reply": strMappedWorkType = "Consult Reply"
        Case "CON_REQUEST": strMappedWorkType = "Consult Request"
        Case Else: strMappedWorkType = "Other"
    End Select

    'Now we can do a job lookup
    'Note: We are using a varience for the length by a second up and down since during testing it was found that sometimes the WS Job Length is off by a second
    dtDateForSQL = formatDPMDateForSQL(strDateDict)
    sJobLengthInSecs = convertLengthToSecs(strDPMJobLength)
    sJobLengthMin = CInt(sJobLengthInSecs) - 1
    sJobLengthMax = CInt(sJobLengthInSecs) + 1
    ConnString = "Driver={SQL Server Native Client 11.0};Server=WINSCRIBE\SQLEXPRESS;Database=Winscribe;Uid=<sqlUserID>;Pwd=<sqlUserPassword>;"
    Set myConn = CreateObject("ADODB.Connection")
    Set myRs = CreateObject("ADODB.Recordset")
    myConn.Open ConnString, "", ""
    strSQL1 = "SELECT J_JNUMBER from job WHERE J_AUTHOR = " & strDPMAuthorID & " AND J_LENGTH BETWEEN " & sJobLengthMin & _
    " AND " & sJobLengthMax & "  AND J_CRDATE = CAST('" & dtDateForSQL & "' AS smalldatetime)"
    myConn.Execute strSQL1
    myRs.Open strSQL1, myConn
    If myRs.BOF then
        sWsJobNumber = "Not Found"
    else
        myRs.MoveFirst
        sWsJobNumber =myRs.Fields.item(0)
        'msgbox sWsJobNumber,, "Winscribe Job Number"
    End if
    ' Update the WS Job Notes
    if sWsJobNumber <> "Not Found" then
        strSQL2 = "UPDATE job SET J_NOTES = 'Uploaded to vScription Transcribe' WHERE J_JNUMBER = " & sWsJobNumber
        myConn.Execute strSQL2
    end if
    myRs.close
    myConn.close
    set myRS = Nothing
    set myConn = Nothing

    'Generate demographic text file
    data = "[CMP DESC]" & vbCrLf
    data = data & "Author Name = " & strMappedAuthorID & vbCrLf
    data = data & "Work Type Description = " & strMappedWorkType & vbCrLf
    'data = data & "Work Type Description = " & stripNULL(strDPMWorkType) & vbCrLf
    'data = data & "Author Time = " & MyDateFormat(formatDateTime(now(),2)) & " " & formatDateTime(now(),3) & vbCrLf
    data = data & "Author Time = " & formatDPMDate(strDateDict) & vbCrLf
    data = data & "User Field1 = " & sWsJobNumber  & vbCrLf
    data = data & "Department = 10" & vbCrLf
    data = data & "Debug1 = SQL Date Searched is " & dtDateForSQL  & vbCrLf
    data = data & "Debug2 = SQL Author Searched is " & strDPMAuthorID  & vbCrLf
    data = data & "Debug3 = SQL LengthSearched is " & sJobLengthInSecs   & vbCrLf
    data = data & "Debug4 = SQL lookup query is " & strSQL1   & vbCrLf
    data = data & "Debug5 = SQL update query is " & strSQL2

    ' Get ds2 filename
    origFileName = objRule.FileName
    ' Demographic filename must match ds2
    sOutFileName= Mid(origFileName,1,len(origFileName)-4) & ".txt"
    'sOutFullNameandPath = "C:\Users\dictation\Desktop\Script Testing\txt\" & sOutFileName
    sOutFullNameandPath = "\\WINSCRIBE\VSPT_Upload\" & sOutFileName
    Set objFileToWrite = CreateObject("Scripting.FileSystemObject").CreateTextFile(sOutFullNameandPath,2,true)
    objFileToWrite.WriteLine(data)
    objFileToWrite.Close
    Set objFileToWrite = Nothing
    Set Fso = Nothing
    end sub

    Function MyDateFormat(TheDate)
        dim m, d, y
        If Not IsDate(TheDate) Then
            MyDateFormat = TheDate '- if input isn't a date, don't do anything
        Else
            m = Right(100 + Month(TheDate),2) '- pad month with a zero if needed
            d = Right(100 + Day(TheDate),2) '- ditto for the day
            y = Right(Year(TheDate),2)
            MyDateFormat = m & "/" & d & "/" & y
        End If
    End Function

    Function RemoveTrailingNulls(strData)
                dim x
                dim Char
                for x = 1 to len(strData)    
                    Char = Mid(strData,x,1)
                       if Asc(Char) > 31 then
                                RemoveTrailingNulls = RemoveTrailingNulls & Char
                       else
                                exit function                                
                      end if
                next
    end function

    ' Format DSS dictation date
    ' Incoming date format will be as follows
    ' 21060110520
    ' yymmddhhmmS
    ' yy is the 2 digit year and S is 1/10 of a minute convert to seconds. We will disregard this
    ' Needs to be in period format (AM/PM)
    Function formatDPMDate(strDPMDate)
        Dim yy,mm,dd,hh,mi, period, outDate
        yy = "20" & Mid(strDPMDate,1,2)
        mm = Mid(strDPMDate,3,2)
        dd = Mid(strDPMDate, 5,2)
        hh = Mid(strDPMDate,7,2)
        mi = Mid(strDPMDate,9,2)
        if CInt(hh) >=12 Then
            period = " PM"
            hh = CInt(hh) - 12
        Else
            period = " AM"
        End if
        formatDPMDate = mm & "/" & dd & "/" & yy & " " & hh & ":" & mi & ":00" & period

    End Function

    ' Format DSS dictation date for WS job lookujp
    ' Incoming date format will be as follows
    ' 21060110520
    ' yymmddhhmmS
    ' yy is the 2 digit year and S is 1/10 of a minute convert to seconds.
    ' Needs to be in miltary format (24HR clock)
    Function formatDPMDateForSQL(strDPMDate)
        Dim yy,mm,dd,hh,mi, ss,period, outDate
        yy = "20" & Mid(strDPMDate,1,2)
        mm = Mid(strDPMDate,3,2)
        dd = Mid(strDPMDate, 5,2)
        hh = Mid(strDPMDate,7,2)
        mi = Mid(strDPMDate,9,2)
        ss = Mid(strDPMDate,11,1)
        ss = (ss / 10) * 60
        if len(ss) < 2 then
            ss = "0" & ss
        end if
        formatDPMDateForSQL = yy & "-" & mm & "-" & dd & " " & hh & ":" & mi & ":" & ss

    End Function

    Function StripNULL(s)
      Dim re
      Set re = New RegExp
      re.Global = True
      re.Pattern = "[\0]"   ' should see backslash zero inside the square braces
      StripNULL= re.Replace(s,"")
      Set re = Nothing
    End Function

    Function convertLengthToSecs(t)
       Dim hour
       Dim min
       Dim sec
       hour = Mid(t,1,2)
       min = Mid(t,3,2)
       sec = Mid(t,5,2)
       convertLengthToSecs = CInt(hour)*60*60 + CInt(min)*60 + CInt(sec)
    End Function


  1. NOTE: You can tweak this as necessary. You can get the Job Type and Author from the device and format as needed. Make sure that you configure the sOutFullNameandPath to the same location you are outputting the files to in the Destination
- Create a new rule(s): Add the author (as found on the portable) for the rule, set the destination to the one you created in step 1, make sure the choose the script you created in the previous step.

2. Configure vScription Upload
- If not installed, you can get it from the Download page from vScription Upload
- If multiple users log into the workstation, you may want to change the install location to ensure all users have access to the program and folders
- Configure the directories and settings as needed. Most likely this is what you will need to change;
      - Mode - Set to Aud/txt mode
      - Audio types: add "ds2"
      - username/password,smtp etc...... - As normal

3. Start the Importer and the Upload up and test.
    • Related Articles

    • Using vScription Controller with Winscribe Client

      If you need to do transcription using vScription and Winscribe at the same time, you can have both applications running at the same time and switch between them as needed and your foot control will work with both at the same time. In order to do ...
    • Getting Started with vScription Mobile

      To Login To login, launch the app and enter you vScription Transcribe credentials. Note: Currently you must have a role of Organization Administrator or Author to be able to use vScription Mobile The screenshots shown here are with an iPhone in Dark ...
    • How to re process failed files in vScription Upload

      For day to day use, you shouldn't have any issues with failed files but sometimes it does happen. Maybe there is a temporary network issue, the internet is down, system maintenance happening etc.. which could cause a file to fail processing. Although ...
    • When Launching vScription Controller, App Seems To Hang and Won't Respond

      This has been fixed in Version 1.9 of the Controller which is available on the Download Page This was identified in vScription Controller version 1.8. Although the App seems unresponsive, it will still connect to the transcribe page and you can use ...
    • Getting Started with vScription Assist

      What is vScription Assist? vScription Assist is a companion app for the nVoq Cloud Based Medical speech recognition engine and was designed to be used in place of the discontinued Transcription Assist feature previously available in the nVoq Wireless ...