Automatic StudySubjectID generation - strange behaviour

Hi Everybody,

I noticed very strange behaviour on one of my production servers. For some studies we use the autogenerated StudySubjectID option in study setup. This was working fine for years but last week for some reason there was a huge jump in this autogenerated index (the patient with StudySubjectID of 590 was followed with new patient with StudySubjectID 160079 ... and the following patients are 160080, 160081 ...).

I was in an impression that OC uses study_subject_study_subject_id_seq sequence to generate these IDs but this does not seem to be true, because when I look into a current value of this sequence it correspond to last primary key from study_subject table. So this one cannot be used to generate StudySubjectID attribute (which is represented with label column in stud_subject table).

Actually I did not find any sequence in OC database that would correspond to my new patients StudySubjectIDs. Does anybody has an idea how OC actually handles this autogeneration of StudySubjectIDs? Eventually I would also welcome some feedback regarding how can I set this counter to some reasonably smaller numbers.

thanks

Tomas

Comments

  • kristiakkristiak Posts: 1,249 ✭✭✭
    via Email
    Hi Tomas,

    No I have never seen anything like this. Which version of OC did you use?

    Chers

    Krister
  • toskriptoskrip Posts: 249 ✭✭
    This behaviour occurred on OC 3.4. For the beginning I would just like to understand how OC does the SSID generation, because obviously the sequence is used only for the primary key and not for the SSID.

    T
  • GerbenRienkGerbenRienk Posts: 748 ✭✭✭
    Hi Tomas,
    I think that the maximum StudySubjectID is taken, as far as it concerns integers. The new ID will be the max plus 1. And the maximum is per instance, so across all Studies.
    Kind regards,
    Gerben Rienk
  • toskriptoskrip Posts: 249 ✭✭
    edited January 2016
    Hi Gerben,

    Yeah it looks like you are right. In one study with manual StudySubjectID the data entry used wrong value. I corrected it but obviously OC generated oc_oid which (SS_.....) which is fixed. Could it be that OC looks for maximum id within oc_oid column?

    Tomas
  • toskriptoskrip Posts: 249 ✭✭
    Ahh no... I see now. I corrected the wrong one but than I already had another with plus 1 in a table.....

    thanks Gerben
Sign In or Register to comment.