Schedule csv notes extraction

124»

Comments

  • RCHENURCHENU Posts: 188
    Christian, can you explain what you mean by "make your vm accessible for download?"
    All the other extractions (datasets, audit log, casebook...) seem to work properly.

    Romain.
  • haenselhaensel Posts: 567 ✭✭
    RCHENU said:

    Yes it's a vm with ...

    It sounds like you're using a virtual machine and maybe it is possible to find the error if I can get my hands onto this vm (with pseudo data).

    Regards,
    Christian

  • RCHENURCHENU Posts: 188
    Thank a lot Christian for your help and your proposition.
    I'm gonna try first to reindex the database and then come back to you.
    Thanks again,

    Romain.
  • RCHENURCHENU Posts: 188
    Hello Christian,

    To keep you up-to-date, Reindexing both databases didn't help.
    Gerben found that the issue was already reported on jira https://jira.openclinica.com/browse/OC-7850
    I hope that a solution will comes up very soon !!

    Romain.
  • haenselhaensel Posts: 567 ✭✭
    It looks like the issue is there since OC-3.2.
  • RCHENURCHENU Posts: 188
    Hi Gerben,

    I don't know if you remember but I'm using the vbs script below to extract notes on daily basis. I recently had a case where a note had some russian characters and the following line threw an error:
    objFile.Write objHTTP.responseText

    Do you have any idea what I should add to the script to authorize any characters ?

    Thanks a lot,

    Romain.

    Hi Romain,
    The following vbs-script should do the trick. You can schedule it on a (windows) machine by ceating a scheduled job with two parameters: username and password.
    The main part is of course the URL, for example
    [your domain]//[your oc]/DiscrepancyNoteOutputServlet?fmt=csv&studyIdentifier=[your study]&discNoteType=-1&fileName=dnotes0_defaultstudy
    You can look at the source of the normal dialog window to see which parameters can be set. In general -1 is used for "all".
    Kind regards,
    Gerben Rienk
    ---
    Option explicit
    Dim objHTTP
    Dim strURLStart
    Dim strURL
    Dim strReq

    'the next 3 variables are for writing the output to disk
    Dim outFile
    Dim objFSO
    Dim objFile

    Set objFSO=CreateObject("Scripting.FileSystemObject")
    outFile="c:\temp\my_notes.csv"
    Set objFile = objFSO.CreateTextFile(outFile,True)

    If WScript.Arguments.Count <> 2 then
    WScript.Echo "Missing parameters. This script needs: "_
    & VbNewLine & "username and password "_
    & VbNewLine & "to run correctly."
    Else
    Set objHTTP = CreateObject("MSXML2.XMLHTTP")
    'change this to match your situation
    strURLStart = "http://www.tds-edc.com/oc311/"
    'j_spring_security_check
    strURL = strURLStart & "j_spring_security_check?j_username=" & WScript.Arguments(0)
    strURL = strURL & "&j_password=" & WScript.Arguments(1)
    objHTTP.Open "POST", strURL, False
    objHTTP.send

    'modify the next line for another study or dn_type or status, etc.
    strURL = strURLStart & "DiscrepancyNoteOutputServlet?fmt=csv&studyIdentifier=defaultstudy&discNoteType=-1&fileName=dnotes0_defaultstudy"

    'send the request
    objHTTP.Open "GET", strURL, False
    objHTTP.send
    'and write the result to disk
    objFile.Write objHTTP.responseText
    objFile.Close

    End if

Sign In or Register to comment.