How to prevent cases ID duplication when synchronized

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
lusia
Posts: 49
Joined: March 28th, 2018, 4:56 am

How to prevent cases ID duplication when synchronized

Post by lusia »

Dear CSPro Team,
I have a duplication case when I synchronized the .csdb file, both Bluetooth and csweb synchronization.
Is there a way to prevent that duplication via Logic?

Kindly please help me.
Thank you in advance.

Warm Regards,
lusia
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: How to prevent cases ID duplication when synchronized

Post by josh »

Are you getting duplicates because you have two interviewers entering the same case and then synchronizing or is there only one case but somehow during sync a case is getting copied a second time? The first is the expected behavior of sync. If two interviewers enter the same case ids, sync can't tell which is the correct one so it keeps both. If it is the latter then that sounds like a bug. In that case please tell us more about how you are synchronizing.
lusia
Posts: 49
Joined: March 28th, 2018, 4:56 am

Re: How to prevent cases ID duplication when synchronized

Post by lusia »

Hi Josh,
Sorry for the very late reply.
I had to confirm to all of the interviewers in the county to make sure about it.
So far, the information I got is the duplication in csweb is because of two or more interviewers synchronized the same case ids.
I'll inform you next if there're others information that need your immediate attention.

Thank you for the help.

Warm Regards,
lusia
Yass
Posts: 103
Joined: November 11th, 2017, 1:26 am

Re: How to prevent cases ID duplication when synchronized

Post by Yass »

Hi Cspro
I have the same issue of duplicate coming up after sync with supervisor, in my case the different interviewers used the same ID. How best can one resolve duplicates synced to supervisor via blue tooth. I will suggest future there will be an option among the ellipsis to show duplicates cases on Android like we have in the Data Viewer - view menu.
How best do I have to resolve this since some of the cases are not true duplicates. The team are currently on the filed and it will be best for them to correct it on their device than a batch program to do it. Really want a solution on the side of the field interviewers than central office batch program.

I have like 6000 plus duplicates to correct :( :shock: :?
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: How to prevent cases ID duplication when synchronized

Post by josh »

We generally try to prevent this from happening in the first place by either managing interviewer assignments through a menu program or adding additional variables to the id-items (see http://www.csprousers.org/forum/viewtop ... f=7&t=2629).

Once you have the duplicates it can be difficult to manage. We will add the ability to view duplicates in a future version of CSEntry.
Yass
Posts: 103
Joined: November 11th, 2017, 1:26 am

Re: How to prevent cases ID duplication when synchronized

Post by Yass »

Thanks Josh !!
Monika Walia
Posts: 1
Joined: November 19th, 2019, 1:17 am

Re: How to prevent cases ID duplication when synchronized

Post by Monika Walia »

Dear Josh,

I have the same concern of duplicate cases IDs after synchronization. I understand that on one device there will be no duplication however how can this be dealt with when two Investigators sync the data with same id?

I looked at the link : http://www.csprousers.org/forum/viewtop ... f=7&t=2629. The method suggested in this link will only help in creating a new ID by adding a variable or two. But the issues remains same..the ID won't be duplicate as such but there would be true duplication. Please suggest.

Thank you,
Monika
Enkhbayar
Posts: 68
Joined: November 10th, 2014, 11:48 pm

Re: How to prevent cases ID duplication when synchronized

Post by Enkhbayar »

Enumerator assignment from a menu app is best way to avoid duplication. But if its not possible, you can check duplication in Supervisor app before sync to the server.

Here is small code I use in the agriculture app.

Code: Select all

function op_check_dup()

	close(CHECK_DUP_DICT);

	filecreate("temp\checkdup.dat",create);

	open(CHECK_DUP_DICT);

	k=0;

	forcase PLOT_DICT do

		do varying i = 1 until i> soccurs(PLOT)

			str=concat(edit("999999",PLOT_DICT.IDQUEST),edit("999",PLOT.ID(i)));

			z=loadcase(CHECK_DUP_DICT,str);

			if z=0 then
				DUP_IDQUEST=PLOT_DICT.IDQUEST;
				DUP_PLOT=PLOT.ID(i);
				DUP_ENUM=PLOT_DICT.ENUMERATOR_CODE;
				j=writecase(CHECK_DUP_DICT);

			else
				inc(k);
				case_keys(k,1) = maketext("%d",DUP_IDQUEST);
				case_keys(k,2) = maketext("%d",DUP_PLOT);
				case_keys(k,3) = maketext("%d",DUP_ENUM);
				case_keys(k,4) = maketext("%d",PLOT_DICT.ENUMERATOR_CODE);
			endif;

		enddo;

	endfor;

	if k>0 then

		showarray(case_keys, title("Segment","Plot #","Enum-1","Enum-2"));  //show duplicated cases.

	endif;

end;
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: How to prevent cases ID duplication when synchronized

Post by Gregory Martin »

Indeed, using a menu control application is the best way to avoid duplicates. Alternatively, if you could guarantee Internet access, you could hit a server and check if the ID is used, but that is a bit of work.

If you 100% want to avoid duplicates IDs, you can also use non-traditional IDs. For example, you could use an ID based on the results of the uuid function and then move your geographic IDs to a variable.
Post Reply