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

Get subjects and visits via APIs

To integrate with OpenSpecimen, for a given study, we would like to fetch the subjects and events from OpenClinica.

This will be done on an hourly or nightly basis.

Is there a way to fetch this only for new objects added since the last fetch? E.g. all new subjects added or edited since the last run. Can this be fetched via the Audit information?



  • mvirtosumvirtosu Posts: 276 ✭✭

    I would just keep a list somewhere in a database with the subjects and events already fetched and when I need to fetch more, I would just compare against this list.

  • sadigasadiga Posts: 17
    via Email
    My question precisely is: Does OC audit have APIs?

    @ Mihai,

    My use case is as follows:

    If fetch 1: Subject A, Subject B is added
    If fetch 2: Subject B is edited, Subject C is added
    So in fetch two, I only want data for Subject B and Subject C.

  • GerbenRienkGerbenRienk Posts: 827 ✭✭✭
    Hi Sri,
    You can not give a filter if that is what you mean. However you can request the audit trail with the data, like [your_oc_name]/rest/clinicaldata/xml/view/[your_study_oid]/*/*/*?includeAudits=y
    Your subjects will be in nodes SubjectData where SubjectKey holds the StudySubjectOID and OpenClinica:StudySubjectID holds the StudySubjectID (no surprises there). Then look for each SubjectData for the child node OpenClinica:AuditLogs with attribute EntityID=[StudySubjectOID]
    See the attached screenshot, where I collapsed the StudyEventData. At the receiving end you would have to do the filtering.
    Hope this helps,
    Gerben Rienk
    api.PNG 88.4K
Sign In or Register to comment.