31 Dec 2018: Thank you to our knowledgeable and friendly forums users for another great year. We are aware of the uptick in spam accounts and are doing our best to ban these at first sight. Thank you for your patience!

Create Subject Group Class with a WebService

LoomisLoomis Posts: 3
edited August 2014 in Web Services & Integration
Hello readers,

i have encountered following problem:
My patient data can be exported to OpenClinica with the create-WebService (Doku).
But with this WebService, it's not possible to set a Subject Group Class (Doku) for the patient.
Is there another WebService or a complete new way to accomplish this task?
Is it possible to manipulate Subject Group Classes with a Webservice?

For example: A study exists with a Subject Group Class "study arms" and the Study groups "placebo" and "treatment".
For every student that i export to this study, i want to set manually if the patient is in "placebo" or "treatment".

Please tell me if you need more information. 


P.S. I am sorry for the doublepost, but OC Forums keep telling me that Service is unavailable...

Comments

  • GerbenRienkGerbenRienk Posts: 799 ✭✭✭
    Hi Loomis,

    In the past I've done this with Selenium, an addOn for Firefox.
    Below is part of a generated script that assigns StudySubject 001 to group Placebo and 002 to Treatment, etc.
    You can do quite sophisticated things with Selenium, as Sander and Lindsay show on https://forums.openclinica.com/discussion/15285/bulk-reassign-crf-to-a-new-version-with-selenium#latest but this is a more basic use of it.
    I hope the example gives you enough to get you started.
    Kind regards,
    Gerben Rienk

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link rel="selenium.base" href="https://your.oc.domain" />
    <title>SG</title>
    </head>
    <body>
    <table cellpadding="1" cellspacing="1" border="1">
    <thead>
    <tr><td rowspan="1" colspan="3">SG</td></tr>
    </thead><tbody>

    <tr><td>clickAndWait</td><td>link=Subject Matrix</td><td></td></tr>
    <tr><td>type</td><td>name=findSubjects_f_studySubject.label</td><td>001</td></tr>
    <tr><td>clickAndWait</td><td>css=input.navSearchButton</td><td></td></tr>
    <tr><td>click</td><td>link=Study Subject Record</td><td></td></tr>
    <tr><td>clickAndWait</td><td>link=Edit Record</td><td></td></tr>
    <tr><td>select</td><td>name=studyGroupId0</td><td>label=Placebo</td></tr>
    <tr><td>clickAndWait</td><td>name=Submit</td><td></td></tr>
    <tr><td>clickAndWait</td><td>name=Submit</td><td></td></tr>

    <tr><td>clickAndWait</td><td>link=Subject Matrix</td><td></td></tr>
    <tr><td>type</td><td>name=findSubjects_f_studySubject.label</td><td>002</td></tr>
    <tr><td>clickAndWait</td><td>css=input.navSearchButton</td><td></td></tr>
    <tr><td>click</td><td>link=Study Subject Record</td><td></td></tr>
    <tr><td>clickAndWait</td><td>link=Edit Record</td><td></td></tr>
    <tr><td>select</td><td>name=studyGroupId0</td><td>label=Treatment</td></tr>
    <tr><td>clickAndWait</td><td>name=Submit</td><td></td></tr>
    <tr><td>clickAndWait</td><td>name=Submit</td><td></td></tr>

    etc.
  • LoomisLoomis Posts: 3
    Thanks for your reply!

    I'm afraid this solution is inappropriate for me, because the StudySubjects must be inserted by different users and I can't assume that the users can work with Selenium.

    But I will look into this program and your code, it seems to be quite interesting, thanks again.
  • lindsay.stevenslindsay.stevens Posts: 404 ✭✭✭
    via Email
    I think the general idea is to make your own api for that action by
    controlling interaction with the HTML pages, or by even looking closer at
    constructing the right posts to make.

    Selenium IDE is a convenient way to do that, but you could use Selenium web
    driver, or any other library designed for handling http requests and
    responses.

    If you've got multiple users of the web service you want to set up, the
    application could use the available SOAP methods, and your custom code for
    setting the group class.

    Or if you want to, contribute a patch with a SOAP method for group class.

    Best regards,
    Lindsay
This discussion has been closed.