We hope you'll join us for our 4/23 webinar on using data tables to apply reference ranges and AE codes in OC4. For more information and to register, visit https://register.gotowebinar.com/register/2882170018956684555

Has anyone been able to get OC Participate (i.e., OC + Enketo or ODK) working?

24

Comments

  • GerbenRienkGerbenRienk Posts: 808 ✭✭✭
    I must say I have the same experience: no output on formList
    What I did was:
    I added
    portalURL=http://trialdatasolutions.com
    in datainfo.properties
    Then when I opened the build-study-page I had a div "modules" but I could not with this URL "activate" the portal.
    Therefore I manually added in table study_parameter_value
    "participantPortal" "enabled" for my study_id
    I then was able to mark one CRF as "participant form", but then in a browser
    http://localhost:8080/oc36/rest2/openrosa/S_NS/formList
    returns nothing.
    Maybe others were more lucky?
    Gerben Rienk
  • ccollinsccollins Posts: 378 admin
    via Email
    I'm not sure why you're not seeing anything. Anything helpful in the logs?

    Krikor, Joe, or Steve might have some suggestions?

    You should see something like this:
    https://demo2.eclinicalhosting.com/OpenClinica9/rest2/openrosa/S_NCT02438/formList
    On Jul 28, 2015 4:07 PM, "GerbenRienk"
  • sdibonasdibona Posts: 10
    Hello,

    The reason you are unable to generate a form listing is because that service currently checks your registration status with the Participate server before executing. If the status cannot be determined (or if the server cannot be reached), the form listing will not execute. This was done to add some security to this new, and otherwise open, web service. Eventually we will implement an alternative method of securing this service (and the other Participate related services) that doesn't require a connection to Participate. However that is not in place today.

    If you would like to get around this restriction and are comfortable editing some code, commenting out the following lines of code in OpenRosaServices.java will remove the dependency on the Participate server.

    Form listing service:
    https://github.com/OpenClinica/OpenClinica/blob/133d76a141ec52f67a6bf12c337c6253cb0bf83b/web/src/main/java/org/akaza/openclinica/web/pform/OpenRosaServices.java#L83-L84

    Comment out the lines (83-84):
    if (!mayProceedPreview(studyOID))
    return null;

    Keep in mind, however, that commenting out this check means the form listing web service will be completely open and not require any credentials or authorization to use. It will also no longer check other pre-conditions/validations for executing the form listing and could possibly error out.

    I hope this helps. Please let me know if you have any questions.

    Thank you,

    Steve DiBona
  • GerbenRienkGerbenRienk Posts: 808 ✭✭✭
    Great, we'll give that a try. Many thanks.
  • stanncstannc Posts: 7
    Hi All,

    Thank you for the responses and pointers. Here is what I did and got working so far:

    I added portalURL=[local ip address of enketo-express-oc] in datainfo.properties. Manually added in table study_parameter_value "enabled" "participantPortal" for the default study_id.

    After these steps, I am able to get a formList and download a form using ODK Collect but not able to submit it back to OpenClinica (one subject visit scheduled in OC already).

    Here are the issues I am experiencing. I have the participate module listed on the build study page, but status is listed as "Not Found" and the URL is blank. After manually adding the values into the study_parameter_value table, I am not able to get to the edit event page to mark the eCRF as a participant form.

    Thanks,
    Stan
  • lindsay.stevenslindsay.stevens Posts: 404 ✭✭✭
    I tried this today and got the same 204 - No Content response from the formList URL.

    Stan - did you need to do the source code fix for it to work?

    Cal - about your earlier comments: A big encouragement to contributing source code would be to make the full test suite available. There are some tests in the repository, but from speaking to Alicia at OC15, there is a more comprehensive unit / integration suite hiding somewhere.

    I would like to be able to test sqldatamart against the same database that you test with so I can identify and resolve compatibility issues. If the test suites were there it would be possible to start going after the low-hanging fruit in the bug backlog. It's counter-productive to contribute code that introduces regressions, and we can't really know about them otherwise. Even the test suite itself is something that can be collaboratively improved.
  • stanncstannc Posts: 7
    Yes, sorry I forgot to mention this in my presious post, I did do the source code fix.
  • ccollinsccollins Posts: 378 admin
    edited August 2015
    Hi Stan,

    TL-DR: I think you've gotten as far as is currently possible using the current code. However we'll follow up with more info on where certain checks are in the code that, if disabled, would allow you to continue testing/experimenting.

    Longer version:

    There are two basic models for using these tools:

    Model 1 is 'submit-only'. This is the basic use case for the OpenRosa API and most of the OpenRosa tools like ODK Collect. It is great for anonymous surveys and field-based data collection (which is what those tools focus on) but less common for typical clinical study use cases. Its design accepts each new form submission as a new case, but doesn't have any way for it to be associated with an existing study subject, event, and event CRF, which is what OpenClinica expects. We're in the midst of submitting something analogous to this as an 'Anonymous submission' mode (https://jira.openclinica.com/browse/OC-6330), where the form has a static URL, and each time you fill it out it will add a study subject to your study with the associated event.

    Model 2 is the more typical case for us, where you load the form associated with the context of an existing OpenClinica study subject->event->event CRF. This isn't implemented in a sufficiently generic way in the OC codebase yet. It works in Participate but a bunch of the 'glue' code that makes it happen hasn't been abstracted out in a way that will work for local deployment use cases yet. It will be :-)

    In both cases, there are currently various checks within OC code that look for affirmation from the aforementioned 'glue code' and halt the form submission process at various points if it doesn't get them. If you manipulate/disable these checks in the code you should be able to get a form submission working. Note these checks do important stuff (security, configuration management, etc) so proceed at your own risk! But hopefully you can some test submissions working and that will help us figure out how to get to a more out-of-the box toolkit.

    Best,
    Cal
  • kkrumliankkrumlian Posts: 25
    Hi Stan,

    I propose you give https://github.com/OpenClinica/enketo-express-oc another try. As Cal mentioned you will hit a few road blocks , but you might get further and hopefully be able to successfully submit to OC.

    At a high level this is how you could get Model 2 working:
    - We have developed an API that allows you to get an enketo form URL. This API call wraps all ODK api calls so you really don't have to worry about them.
    - Once you have the enketo form URL. You will be able to enter data in the form and submit to OC
    - Now let's break it down because out of the box the above will not work.

    You will need to make modifications to the API that allows you to get an Enketo form URL

    - API url: /pages/study/{studyOid}/studysubject/{studySubjectOid}/events
    - You will need to refactor how you get the Enketo credentials (initially you can hardcode)
    - You will need to refactor some of the mayProceed() methods
    - Once those are done you should be able to get back an enketo form URL
    - If you get to pulling the enketo form URL you are 90% there because this URL will also give you the key to submit the data
    - Here's the code: https://github.com/OpenClinica/OpenClinica/blob/master/web/src/main/java/org/akaza/openclinica/controller/OdmController.java


    You will also need to make modifications to the submission API endpoint

    - The only thing you will have to do here is to refactor some of the mayProceed() methods and you should be good to go
    - Here's the code: https://github.com/OpenClinica/OpenClinica/blob/master/core/src/main/java/org/akaza/openclinica/service/PformSubmissionService.java


    I would suggest forking OC code base that way you could be committing the code you are changing and we can give you feedback throughout the process.

    Krikor
  • toskriptoskrip Posts: 271 ✭✭✭
    Hi Stan,

    You will need to modify more code. I am still experimenting with it but in order to get edit event work again take a look at InitUpdateEventDefinitionServlet.java

    https://github.com/OpenClinica/OpenClinica/blob/759ad7545d216844bc243c04ca8e4431b6beacb1/web/src/main/java/org/akaza/openclinica/control/managestudy/InitUpdateEventDefinitionServlet.java

    there is a method baseUrl()

    it is used to get study url in Participate, which normally is formed as host.portalURL. Host should be unique string identifying participate study. Because you don't have access to Participate. You cant communite with it and

    registrar.getAuthorization(currentStudy.getOid())

    will not give you authorisation object, so you will not be able to obtain a host. For testing you can use some convention e.g. let host be the studyIdentifier.

    Tomas
Sign In or Register to comment.