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.