mdsol / rwslib

Provide a (programmer) friendly client library to Rave Web Services (RWS).
MIT License
31 stars 13 forks source link

How to get StudyEventRepeatKey for subevents #124

Closed vagarwal77 closed 3 years ago

vagarwal77 commented 3 years ago

Hello,

We are able to POST clinical data which are associated with screen event. when the study event visit has subfolders like, cycle1 -> Cycle1Day1 / Cycle1Day3, CRF submission has been failing with .

Looking further, by quering StudyDatasetRequest for already submitted manual crfs, realized that it also needs a StudyEventRepeatKey but i am not sure from where i can get value for StudyEventRepeatKey

I had tried version_folder_request endpoint but can get only reference of C1D01 as below - ![image](https://user-images.githubusercontent.com/46463536/124773997-71188a00-df0b-11eb-848e-57f22770c074.png) ODM file also don't have any reference of it so, bit lost. Any help would be appreciated.
isparks commented 3 years ago

You have nested folders which are a bit tricky with RWS. Here's an example that is putting some data into an AE form inside a top-level VISIT1 folder (repeat 1 of that folder) and AE_FOLDER[4] inside that visit1 so a structure like this:

\VISIT1\
              \AE_FOLDER[1]\AE...
              \AE_FOLDER[2]\AE...
              \AE_FOLDER[3]\AE...
              \AE_FOLDER[4]\AE...  <-- Updating this one

As I said, nested folders are not easy to deal with but I hope this helps.

<?xml version="1.0" encoding="UTF-8"?>
<ODM xmlns="http://www.cdisc.org/ns/odm/v1.3" xmlns:mdsol="http://www.mdsol.com/ns/odm/metadata" ODMVersion="1.3" FileType="Transactional" CreationDateTime="2020-10-02T17:12:29" Originator="TrialGrid" FileOID="9b6d9518-5e77-409b-a8db-206a39092b3c" Granularity="AllClinicalData">
  <ClinicalData MetaDataVersionOID="1" StudyOID="TG_TEST (Dev)">
    <SubjectData SubjectKey="a0422cea-4715-4089-b4d0-dccff9193f9b" mdsol:SubjectKeyType="SubjectUUID" TransactionType="Update">
      <SiteRef LocationOID="CM100"/>
      <StudyEventData StudyEventOID="AE_FOLDER" TransactionType="Update" StudyEventRepeatKey="VISIT1[1]/AE_FOLDER[4]">
        <FormData FormOID="AE" TransactionType="Update" FormRepeatKey="1">
          <ItemGroupData ItemGroupOID="AE" TransactionType="Upsert" ItemGroupRepeatKey="1" mdsol:Submission="WholeItemGroup"/>
          <ItemGroupData ItemGroupOID="AE" ItemGroupRepeatKey="1" mdsol:Submission="WholeItemGroup">
            <ItemData ItemOID="AETERM" TransactionType="Update" Value="HEADACHE"/>
          </ItemGroupData>
        </FormData>
      </StudyEventData>
    </SubjectData>
  </ClinicalData>
</ODM>
vagarwal77 commented 3 years ago

Thanks @isparks for your all the guidance.

How i know this indexing (1 and 4) - VISIT1[1]/AE_FOLDER[4] ?

I still feel that version_folder_request endpoint should provide this information.

glow-mdsol commented 3 years ago

This is partly the fault of the ODM itself. Version 1 can't be nested and there's no complementary structure to a folder. We've added StudyEventGroup to the ODM v2 version (that can be nested). Things like the version_folder_request dataset were created for a reasonably constrained set of use cases so there's likely to be some edges there. It's a case of knowing the pattern and how it's adopted and working around it.

glow-mdsol commented 3 years ago

Closing this.