Page 1 of 1

duplicate case_Ids

Posted: January 27th, 2020, 12:55 pm
by AriSilva
I´m having trouble with the case ids of some interviews.
These attached files are a snipped (only 3 cases each), specifically the ones that are causing the problem.
The 22.csdb was generated downloading the file from the server on 2020.01.22. The interviews are OK.
The 24.csdb was generated downloading the file from the server on 2020.01.24. The interviews are bad. It seems that the control program that we have produced a new interview to be done, with the same logical identification, but what I do not understand is that the interviews on both files have the same case_id, that is, considering the logical key. If the system generates an unique case_id, how come the interviews have the same "unique" key.

Re: duplicate case_Ids

Posted: January 27th, 2020, 8:56 pm
by josh
Are these cases from one interviewer or did they come from two different interviewers who both sent the same cases?

Re: duplicate case_Ids

Posted: January 28th, 2020, 12:00 pm
by AriSilva
Same interviewer, same device-id.
The interviewer id is the last 11 positions of the questionnaire id.

Re: duplicate case_Ids

Posted: January 28th, 2020, 2:22 pm
by htuser
Ari,
To avoid this you can add UUID as an ID item to avoid duplication. There's other option that Greg help me years ago. But the using UUID as a part of the ID item is an easy way.
Best,

Re: duplicate case_Ids

Posted: January 29th, 2020, 6:51 am
by josh
Is the case also empty on the interviewers tablet or is filled in there and blank on the server?

Re: duplicate case_Ids

Posted: January 29th, 2020, 8:43 am
by AriSilva
Good question. I´ll try to get my hands on the interviewers tablet, the survey is not finished yet, but I´ll see if s/he can send me the .csdb by email.

Re: duplicate case_Ids

Posted: February 2nd, 2020, 3:11 pm
by AriSilva
Another question related to this problem:
When the program is creating a new record in an external file with the writecase instruction, how the software behaves as far as the uuid generation is concerned? What does the program do? Does it check to see if the file already has a questionnaire withe this "new" case id, and then uses this case id and overwrites the existing case in the file, updating it? Or the program, when processing the writecase, does not care about the existence of the same case in the file and generates another instance of the same key with a different uuid?
I´m talking about a data entry program.

Re: duplicate case_Ids

Posted: February 3rd, 2020, 8:19 am
by josh
In an external file (or a main data file in data entry for that matter) you cannot create two cases with the same caseids. So if you do a writecase and there is already a case with the same case id, you will overwrite that case. The ONLY way you can get duplicate caseids is through sync.