Import previous data from server to CAPI application for selected fields

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Post Reply
CMH
Posts: 31
Joined: April 1st, 2022, 1:54 am

Import previous data from server to CAPI application for selected fields

Post by CMH »

Hi Experts

We have to collect data from several villages through CAPI application. There is a unique ID for each village and villages will appear in CAPI application through load case function along with province and districts. We will use Dropbox for data synchronization.

We need to collect data from each village at 3 stages - beginning, mid, and completion of activity. We want that CAPI application should fetch information from server to know enumerator either it’s his first visit, or second or third one. In case of second or third visit, CAPI application also inform that on what date first or second visit was conducted.

Can you please guide how we can place such system of CAPI application?
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Import previous data from server to CAPI application for selected fields

Post by justinlakier »

Hi,

You can record the unique village ID and the unique enumerator ID to an external dictionary/lookup file synced with the server. If you can't load a case with that enumerator and village, it's your first visit, and you write a corresponding record case into the lookup for your 1st visit. If you can load the case, you've visited there before, and can then increment case fields to count visits and last date of visit. Here's an example, where NEWCASE_DICT has village/enumerator as ID items and visits/newDate as record items.

PROC DATE
postproc
if loadcase(NEWCASE_DICT, VILLAGE_ID, ENUMERATOR_ID) then
errmsg("Had %v visits, last one on %v", VISITS, NEW_DATE);
NEW_DATE = DATE;
VISITS = VISITS + 1;
writecase(NEWCASE_DICT)
else
NEW_VILLAGE_ID = VILLAGE_ID;
NEW_ENUMERATOR_ID = ENUMERATOR_ID;
NEW_DATE = DATE;
VISITS = 1;
writecase(NEWCASE_DICT)
endif;

Hope that helps,
Justin La Kier
Post Reply