How to handle events overlapping for a particular questionnaire and a single patient?

lulzimfazlijalulzimfazlija Posts: 14
Hi Everyone,

I hope this finds out to help other ppl too.
Suppose there is a questionnaire to be filled from different patients in different time intervals and these patients have to fill the same questionnare multiple times ( ps: I am using Google Form as a questionnaire and I am submitting these info to OC using the Web service import data using google apps script), It's all fine till here.

Let's hypothetically say there will be 4 events (1m,3m,9m,12m) for a questionnaire in OC and my question is how do I handle the overlapping/overwriting of the events, let say the first event (1m) is today and the next event is scheduled to be after 3 month, how do I make sure I am not overwriting the previous event (1m) when the time comes to submit the event after 3 month and so on?

I was thinking if there is an Endpoint using SOAP Web Service for getting the patient history including events: completed, not completed for each events and so on, so this way I can check what patient submitted what events earlier and the dates, so I can accordingly add the new events without overlapping them.

So all I need is some kind of Web Service endpoind to get the details/history of a patient, so I can pass the Subject Id of patient like a parameter.

One solution for this to handle is to use my own db which could be alot of work for me, but would have been happier if I can handle this using OC Web Services.

I hope I was clear what I want to do!

Thanks,
/Luli
«1

Comments

  • kristiakkristiak Posts: 1,238 ✭✭✭
    Hi Luli.

    This is very simple. In your WEB service XML file you have to use four specific OID's to make sure your questionaire is stored in the database correctly.
    STUDY_OID, FORM_OID, EVENT_OID, SUBJECT_OID It is the EVENT_OID that keeps the various visits appart by assigning a different event OID for each vistt e.g. in your case the event OID's will be 1mo_OID. 3mo_OID, 9mo_OID and 12mo_OID
    while STUDY_OID, FORM_OID and SUBJECT_OID will be the same for all four visits.

    Best regards

    Krister
  • lulzimfazlijalulzimfazlija Posts: 14
    edited May 25
    Hi Krister,

    Thanks a lot for taking ur time and replying on my question.
    My question actually is more specific in this case, I am saying how do I know which Event OIDs I will have to assign so everytime a patient submits the form a corresponding event has to be assigned on that submission.

    I would also like to limit the submissions of the events based on some time interval, for ex: If a patient submitted 1m Form today, and he would go and try to submit the 3m after a week, I would like to prevent that form from being submitted and show some error message that says "Hey you cannot submit 3m Form at this moment, try after x months".. So that's why I kinda need some Patient Details Endpoint. ( that list all the events with some details for each patient).

    Let say a Patient is submitting the form for the third time which will be after 9 month, how do I know what event OID I have to put in this case? I am thinking more like a dynamic way of being able to use the corresponding Event OID based on the previous patient submissions including time also.

    Therefor, without having some Web Service that shows all information regarding events for a specific Patient, like events completed, date of event completed and so on, there is no way that I can handle the overlapping of forms unless I go to script and manually change the Event OID for every patient and for every event, that I cannot do cz I never know who is when filling the form as the patients will not fill at the same time the form.

    I haven't yet looked at the Rules, maybe I can handle this using those Rules, I have only seen them but couldn't pay too much attention into it.

    Thanks,
    /Lulzim



    Post edited by lulzimfazlija on
  • GerbenRienkGerbenRienk Posts: 737 ✭✭✭
    Hi Lulzim,
    Are you using OC-Enterprise? I ask because you mention patients submitting forms, which sounds like Participate.
    With the Community version it is not possible to let patients enter data.
    Kind regards,
    Gerben Rienk
  • lulzimfazlijalulzimfazlija Posts: 14
    @GerbenRienk I am not using OC-Entreprese, when I say patients submitting forms I mean patient uploading a CRF for a certain questionnaire. I am looking for some specific Endpoint like patient details and all his events completed. It is impossible for me to handle overwriting of events if I dont know what patient has uploaded previously, what events he has uploaded previously.

    so, everytime a crg upload/import happens, I have to check his previous events and see what events have patient previously filled.
  • kristiakkristiak Posts: 1,238 ✭✭✭
    Hi Lulzim,
    Do you mean to say that you have an external application where the patients can enter responses to a questionnaire and the this data is send to OC using SOAP WEB services? If this is your mode of operation why can't your application use some logic to only allow data for each event to be entered once and if the patient sends data again with the same time frame simply reject it. No knowing what application you use it is difficult to give you any concrete advice. You can obviously look i OC to check the status if you can't keep track of it in your app.

    Best

    Krister
  • GerbenRienkGerbenRienk Posts: 737 ✭✭✭
    Hi Lulzim,
    Sorry, I didn't read your initial question properly: you are planning to use google forms.
    In that case your data will be in csv, right? And you will want to import these data into OC as a datamanager.
    Can you explain a bit more about how in google forms you will
    - identify your participants?
    - control that they can only submit their own data?
    - control that they can not change submitted data?
    - distinguish between different time-points in your form(s)?

    Depending on your answers to these questions you would have to write a tool that:
    - takes the google-forms-ID and associates that with an OC-ID, with soap and/or rest
    - finds the OC-OID to use for data import
    - finds the associated StudyEvent and if necessary schedules it, using soap
    - requests the data already in OC using rest
    - compares that with the google-forms-csv-data and using some algoritm decides to import it or not, using soap

    This all can be done, but it's not an easy task.
    Regards,
    Gerben Rienk
  • lulzimfazlijalulzimfazlija Posts: 14
    @kristiak
    Yes I have an exernal app that is comunicating with OC via REST Webservices, and would have made abit easier my solution if there were some endpoint that tells me the history of patient, like showing all completed events for one patient, the date completed events etc, are there any webservice for this? If not, than I have to handle all this on my own from my app, which is fine but still that endpoint would have saved me lots of time.

    @GerbenRienk yes I am using Google Form and google apps script to import the questionare into OC via webservice import data.
    All fine till now, I am getting the patient id from google form as every patient will enter their patient id when the fill the form, once they submit the data are directly going to OC, so there is no way for the data to be changed.

    Seems like I have to manage all this from my application side, handling events on different time points.

    Thanks for your help
  • lulzimfazlijalulzimfazlija Posts: 14
    edited May 31
    So to make it simpler, is there any endpoint web service that displays all the activity of a single patient, like previous completed events, event dates completed etc...
  • kristiakkristiak Posts: 1,238 ✭✭✭
    See Gerben's responses above

    Regards

    Krister
  • GerbenRienkGerbenRienk Posts: 737 ✭✭✭
    Yes, that would be:
    OpenClinica/rest/clinicaldata/xml/view/S_STUDYOID/SS_SUBJECTOID/*/*
    or for json:
    OpenClinica/rest/clinicaldata/json/view/S_STUDYOID/SS_SUBJECTOID/*/*
    Pretty much everything is there.
    Alternatively you can use your StudySubjectID in stead of the OID, but then you must encode it if there are spaces etc.
Sign In or Register to comment.