Errors with ODKmeta STATA do file for CommCare data

Hi all,

I’ve been using the ODKmeta STATA do file to create a clean CommCare data file after exporting data out of CommCare. I’m getting a few errors and was hoping someone could offer assistance on these.
(1) False assertion: When trying to import ODK characteristics from my CommCare CSV data file, I received the following error which I can’t seem to find a fix for:

  • Import ODK attributes as characteristics… * - constraint message will
    be imported to the characteristic Odk_constraint_message… * - media:audio
    will be imported to the characteristic Odk_media_audio… .

insheet using data.csv, comma nonames clear.
local fields.

foreach var of
varlist _all { 2. local field = trim(var’[1]) 3. assert:list sizeof field’ == 1 4. assert !`:list field in fields’
5. local fields : list fields | field 6. }

assertion is false
r(9);end of do-filer(9);

(2) Variable name length: Some of my variable names are too long because once I import my data files using the ODKmeta command, the group names remain even if I try to remove them using a simple find/replace function on the CSV file before importing. I have found some discussions on this on GitHub and have reviewed the help file here to try to resolve this. However, even after embedding the code on variable name shortening that is mentioned in the help file, I’m still facing issues. In fact, I run into issues way earlier at the variable characterization stage, I get errors that my variable names are too long.

Here is an example error:

. * begin group ownership_type
. * private_foreign
. char ownershipownership_typeprivate_f[Odk_name] private_foreign
variable ownershipownership_typeprivate_f not found

I should also note that early on in the Do File, I add in a line (renpfix form) to remove the prefix “form” from all the variable names. This is because with CommCare CSV data exports, the term “form” is automatically included.

If anyone has experience with using ODKmeta for CommCare data, I would really appreciate assistance on this as I’m still quite new to ODKmeta.