CommCare Queries

93 views
Skip to first unread message

Jeffrey Jose

unread,
Mar 17, 2013, 10:52:37 AM3/17/13
to commcar...@googlegroups.com
Hi,
 
Greetings!!!
 
Kindly request your support in helping me to undersand the following:
 
  1. Can my SQL server read data from my commcare application?  This would help us to have online customized reporting dashboards.  This would also help us to fetch the data to make the same available to other tools and dashboards that we use.  If this is available, please guide us as to how to configure this.  If not available, is there a roadmap for this feature?
  2. Does the system allow the data cleaning that would reflect the changes directly to the database.  For example, if a field staff reports that he/she has entered the data incorrectl for a particular field, can we correct that data?  Exporting the data and correcting it would reflect the changes only to the exported file and during next export from application would still show the old data.
  3. If we have some existing data that are available and would like to import the same to the existing application, can we do that using excel files?  If we present the data in the excel file (with the same column names and data), can the system import it?  If no, are there any work-arounds?
Thanks in advance for your quick guidence and support.
 
Warm Regards,
Jeffrey

Cory Zue

unread,
Mar 17, 2013, 4:54:25 PM3/17/13
to commcar...@googlegroups.com
Hi Jeffrey,

Welcome! Answers below.

On Sun, Mar 17, 2013 at 10:52 AM, Jeffrey Jose <jeffr...@gmail.com> wrote:

  1. Can my SQL server read data from my commcare application?  This would help us to have online customized reporting dashboards.  This would also help us to fetch the data to make the same available to other tools and dashboards that we use.  If this is available, please guide us as to how to configure this.  If not available, is there a roadmap for this feature?
This is not something that is supported today but is something we're working on. Look for announcements coming soon.

For now your options are to use the exports to get the data in csv or excel format and then import it into SQL from there, or write a script to hit our APIs and automate the process.
  1. Does the system allow the data cleaning that would reflect the changes directly to the database.  For example, if a field staff reports that he/she has entered the data incorrectl for a particular field, can we correct that data?  Exporting the data and correcting it would reflect the changes only to the exported file and during next export from application would still show the old data.
You can use forms to update / overwrite data in a case, but there is currently no way to edit existing data in a form. 
  1. If we have some existing data that are available and would like to import the same to the existing application, can we do that using excel files?  If we present the data in the excel file (with the same column names and data), can the system import it?  If no, are there any work-arounds?
The excel import feature currently does not allow you to create new cases, though this feature has been requested a few times and is on the roadmap. The easiest workaround is to use the submission API to submit XML that will create the data for you, but this would require a bit of scripting. Others on the list might have example scripts to get you started.

best,
Cory

Sarah Bird

unread,
Mar 18, 2013, 9:03:03 PM3/18/13
to commcar...@googlegroups.com
Hi Jeffry,

We (www.aptivate.org) have just written a django application that sounds like it does something pretty similar. 

We have a standalone python library that talks to the commcare api and then a django app that talks to the api wrapper and saves it in a mysql database (or whatever django db backend you'd want to use). 

If its of use to you, we should be open sourcing the code. 

Sincerely,

Sarah Bird

--
You received this message because you are subscribed to the Google Groups "commcare-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to commcare-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
skype: birdsarah
email: sb...@alum.mit.edu
web: www.sarahbird.org | www.bonvaya.com

Latika Sb

unread,
Mar 19, 2013, 4:14:50 AM3/19/13
to commcar...@googlegroups.com
Hi Cory,
We are doing study for Nutritionin community! In that we are taking Anthropometry of Family member for eg. height & weight , date of birth etc..

we create module for that, but we want data as in row and once we done antho for one member next time that member will not shown in mobile it must be hide from mobile and who is pending that will be shown only pl help us how to do this?

sincerely,
latika

Sarah Bird

unread,
May 9, 2013, 9:38:20 AM5/9/13
to Jeffrey Jose, commcar...@googlegroups.com
Hi all,

Sorry for the long delay in replying. I have pushed our commcare api wrapper to our github - https://github.com/aptivate/commcare-api-wrapper. This is not supported, so don't expect miracles :D, just public for others to be able to see what we have done. We are using it in a live project though so we're fairly confident it works and it has some tests.

The biggest problem we needed to solve was that we didn't just want the data, we wanted to be able to display the "rich" data - turning answer & question codes into their human readable form and presenting the data in the same order as the questions were in the form.

To do this required using some unsupported API which thanks to help from Danny & Cory at Dimagi we were able to do successfully.

We used this library with django where we store and process the data further.

Best,

Bird

On Sun, Apr 14, 2013 at 1:13 AM, Jeffrey Jose <jeffr...@gmail.com> wrote:
Dear Sarah,

I am sorry for the late reply to your mail.

Thanks for your reply and feedback.  We shall try this and let you know.  Can you send me the links and documentations, using which I could try it in a test environment.  I plan to try this during early May and can I seek your help, in case I am stuck.

Warm Regards,
Jeffrey



On Tue, Mar 19, 2013 at 6:33 AM, Sarah Bird <sb...@alum.mit.edu> wrote:

Cory Zue

unread,
May 9, 2013, 9:45:45 AM5/9/13
to commcar...@googlegroups.com, Jeffrey Jose
Hey Sarah,

Very cool! Apologies if this is a dumb question, but do you have an example of the output that this tool produces?

thanks,
Cory

Sarah Bird

unread,
May 9, 2013, 9:55:18 AM5/9/13
to commcar...@googlegroups.com
Very basically, after you get the data out of the api, there's just a bunch of properties on a form/case and a make_human_readable method (which we took from commcare corehq).

Beyond that, I'm going to have to give a super-lame-nerd answer which is can you take a look at the tests and see if you still have questions, they're relatively well organized like "test_resource_response_contains_a_list_of_dicts_with_valid_cases" "test_get_xmlns_id_returns_correct_id" so should go through all the different helper methods we've written so we could easily access the things we were trying to.

Hope this helps.

Sorry for my brevity.

Cheers,

bird

Latika Sb

unread,
May 13, 2013, 5:05:56 AM5/13/13
to commcar...@googlegroups.com
Decimal question Type for baby Weight ----- We need 4 digit answer, for e.g 2.350  

Now suggest what & how to do???

Thanks
Regards
Latika
SNEHA, Mumbai
Reply all
Reply to author
Forward
0 new messages