Odkmeta error when char note variables and repeat variables

1. What is the problem? Be very detailed.

  1. When I used odkmeta to create data for stata from the attachedPNG_Syndromic_Surveillance_Report_2019_survey.csv , the .do file was created without any message of error. however, when i run the .do file, it said
    . * forward
    . char forward[Odk_name] forward
    variable forward not found
    r(111);
  2. When I used odkmeta to create data for stata from the attachedPNG_Syndromic_Surveillance_Report_2019_surveyold.csv , the .do file was created without any message of error. however, when i run the .do file, it said
  • SET-OF-casereport-immediately-casebriefrepeat
    . char SETOFcasereportimmediatelycasebr[Odk_name] SET-OF-casereport-immediately-casebriefrepeat
    variable SETOFcasereportimmediatelycasebr not found
    r(111);
    I run odkmeta example and encountered not problem. but found there is no repeat in the survey form of the example.
    So my question is if odkmeta can be used to create data from ODK repeat? if yes, how to fix the problem?

2. What app or server are you using and on what device and operating system? Include version numbers.
I used Ona.oi to store an downloaded ODK dataset and used Stata/SE 15/.0 to run the odkmeta.
3. What you have you tried to fix the problem?
i tried to delete SET-OF- and SETOF in the .do file and run but it did not work.
4. What steps can we take to reproduce the problem?

  1. use the attached file to run to reproduce the first problem
    odkmeta using ss.do, csv(PNG_Syndromic_Surveillance_Report_2019_data.csv) survey(PNG_Syndromic_Surveillance_Report_2019_survey.csv) cho(PNG_Syndromic_Surveillance_Report_2019_choices.csv)
    then
    do ss.do

  2. use the attached file to run to reproduce the second problem
    odkmeta using ssold.do, csv(PNG_Syndromic_Surveillance_Report_2019_data.csv) survey(PNG_Syndromic_Surveillance_Report_2019_surveyold.csv) cho(PNG_Syndromic_Surveillance_Report_2019_choices.csv)
    then
    do ssold.do
    5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
    I attached the csv file i used.
    PNG_Syndromic_Surveillance_Report_2019_choices.csv (561.9 KB) PNG_Syndromic_Surveillance_Report_2019_data.csv (45.2 KB) PNG_Syndromic_Surveillance_Report_2019_survey.csv (5.6 KB)
    PNG_Syndromic_Surveillance_Report_2019_surveyold.csv (5.4 KB)

Hi @ZHANG_ZAIXING!

I'm actually having trouble reproducing this issue. When I run this odkmeta command, the resulting ss.do does not contain the command char forward[Odk_name] forward (or the word "forward" at all).

The odkmeta do-file will include a char command like this for each field of your survey sheet. However, PNG_Syndromic_Surveillance_Report_2019_survey.csv does not contain a field named forward, which I think is why when I run odkmeta, ss.do does not contain the word "forward". Are you sure that you ran odkmeta and/or the odkmeta do-file with the correct CSV files?

I also wanted to note that when you run odkmeta, it does not validate your submission data CSV file. You actually do not need to have any data in order to run odkmeta: you only need your XLSForm. If there are any issues with your data or a mismatch between your data and your XLSForm, then those issues will arise when you run the odkmeta do-file, not when you run odkmeta.

odkmeta definitely supports repeat groups! I'm not sure, but I suspect that the issue here has to do with differing CSV formats. odkmeta is designed to work with submission CSV data that matches the ODK Briefcase export CSV format. I think that when you download CSV data from the Ona website, the CSV format differs from this. However, you should be able to download your data from Ona using ODK Briefcase, then run the odkmeta do-file with that data.

Hope this helps!

2 Likes

Thanks so much Mathew. Will relook into the data and. Form. And try.
Best