CommCareHQ Time Stamp

Hi Unathi

The forms do have a metadata section that contains ‘timeStart’ and
’timeEnd’ fields. It would help if you could explain how your integration
is working (how are you getting the data from commcare).

Simon

··· On Fri, Jun 14, 2013 at 11:10 AM, Unathi Mcube wrote:

Hi Simon,

We sent you an email a while ago asking you about available links and web
services at CommCareHQ for data exporting. We managed to get a web service
running to decode the xml forms form your cloud to our database, now we
would like you to help us on something else. We want to have a start and
end rime field on our database and we would like to retrieve the start and
end time from the phone but we do not know how to get those fields from the
phone.We are looking at something like a time stamp…please help us.

Thank you
Kind Regards
Unathi.M


Simon Kelly
Senior Engineer | Dimagi South Africa

If you’re using the data integration as described here:
https://confluence.dimagi.com/display/commcarepublic/Enabling+Data+Integration
then
you should have access to all the information you need. The forms that you
are receiving are XML so you can parse them and extract the information
that you need. Here is some basic info about XForms:
https://bitbucket.org/javarosa/javarosa/wiki/buildxforms (the Reference
Material for XForms section).

You can find more detailed information about the structure of the forms on
this page: https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaAPI, in
particular the page on MetaData:
https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaMetaDataSchema

Let me now if you have any other questions.
Simon

··· On Fri, Jun 14, 2013 at 11:39 AM, Unathi Mcube wrote:

Thanks for replying so fast.

We have a publicly accessible web service hosted by our university’s ICT
service, what this service does is that it forwards the data from CommCare
cloud to our database but currently it just takes the whole form that was
submitted to the cloud and stores that data to our database in one table.
What we want to do is to get the data and decipher it into separate tables
and put each field to its relevant table. For example we want to be able to
have the patient name field put in the patient table in our database that
we have created.The web service so far only has a method for encoding the
whole xml form into a string a single string for inserting into the
database.

Thank you we were able to find the start and end time metadata.

From: Simon Kelly skelly@dimagi.com
To: Unathi Mcube umcube@yahoo.com;
commcare-developers@googlegroups.com
Sent: Friday, June 14, 2013 10:19 AM
Subject: Re: CommCareHQ Time Stamp

Hi Unathi

The forms do have a metadata section that contains ‘timeStart’ and
’timeEnd’ fields. It would help if you could explain how your integration
is working (how are you getting the data from commcare).

Simon

On Fri, Jun 14, 2013 at 11:10 AM, Unathi Mcube umcube@yahoo.com wrote:

Hi Simon,

We sent you an email a while ago asking you about available links and web
services at CommCareHQ for data exporting. We managed to get a web service
running to decode the xml forms form your cloud to our database, now we
would like you to help us on something else. We want to have a start and
end rime field on our database and we would like to retrieve the start and
end time from the phone but we do not know how to get those fields from the
phone.We are looking at something like a time stamp…please help us.

Thank you
Kind Regards
Unathi.M


Simon Kelly
Senior Engineer | Dimagi South Africa


Simon Kelly
Senior Engineer | Dimagi South Africa

Hi Unathi

Firstly, please would you rather email the
commcare-developers@googlegroups.com list than me directly.

Regarding your problem I am happy to point you in the right direction but I
won’t be able to write the code for you. If you use Google you will be able
to find examples of the separate pieces (parsing the XML, inserting into DB
etc).
e.g https://www.google.co.za/search?q=xml+processing+java+example
https://www.google.co.za/search?q=java+mysql

What language are you guys writing this in?

Simon

··· On Fri, Jun 14, 2013 at 5:48 PM, Unathi Mcube wrote:

Hi Simon

We checked out the links and they were quite helpful we were able to get a
better understanding of how the xforms work and how they work.Our biggest
problem right now is separating the data from the tags so that it can be
stored in separate tables in the database.We know that we are supposed to
do this by using some methods in the web service but we are not sure about
this whole methods thing, could you be kind enough to show us just an
example where data is being taken out from a single tag of the xform or xml
form then enter as a single field in a table in a database.

Thank you
Kind Regards
Unathi


From: Simon Kelly skelly@dimagi.com
To: Unathi Mcube umcube@yahoo.com;
commcare-developers@googlegroups.com
Sent: Friday, June 14, 2013 11:00 AM

Subject: Re: CommCareHQ Time Stamp

If you’re using the data integration as described here:
https://confluence.dimagi.com/display/commcarepublic/Enabling+Data+Integration then
you should have access to all the information you need. The forms that you
are receiving are XML so you can parse them and extract the information
that you need. Here is some basic info about XForms:
https://bitbucket.org/javarosa/javarosa/wiki/buildxforms (the Reference
Material for XForms section).

You can find more detailed information about the structure of the forms on
this page: https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaAPI, in
particular the page on MetaData:
https://bitbucket.org/javarosa/javarosa/wiki/OpenRosaMetaDataSchema

Let me now if you have any other questions.
Simon

On Fri, Jun 14, 2013 at 11:39 AM, Unathi Mcube umcube@yahoo.com wrote:

Thanks for replying so fast.

We have a publicly accessible web service hosted by our university’s ICT
service, what this service does is that it forwards the data from CommCare
cloud to our database but currently it just takes the whole form that was
submitted to the cloud and stores that data to our database in one table.
What we want to do is to get the data and decipher it into separate tables
and put each field to its relevant table. For example we want to be able to
have the patient name field put in the patient table in our database that
we have created.The web service so far only has a method for encoding the
whole xml form into a string a single string for inserting into the
database.

Thank you we were able to find the start and end time metadata.

From: Simon Kelly skelly@dimagi.com
To: Unathi Mcube umcube@yahoo.com;
commcare-developers@googlegroups.com
Sent: Friday, June 14, 2013 10:19 AM
Subject: Re: CommCareHQ Time Stamp

Hi Unathi

The forms do have a metadata section that contains ‘timeStart’ and
’timeEnd’ fields. It would help if you could explain how your integration
is working (how are you getting the data from commcare).

Simon

On Fri, Jun 14, 2013 at 11:10 AM, Unathi Mcube umcube@yahoo.com wrote:

Hi Simon,

We sent you an email a while ago asking you about available links and web
services at CommCareHQ for data exporting. We managed to get a web service
running to decode the xml forms form your cloud to our database, now we
would like you to help us on something else. We want to have a start and
end rime field on our database and we would like to retrieve the start and
end time from the phone but we do not know how to get those fields from the
phone.We are looking at something like a time stamp…please help us.

Thank you
Kind Regards
Unathi.M


Simon Kelly
Senior Engineer | Dimagi South Africa


Simon Kelly
Senior Engineer | Dimagi South Africa


Simon Kelly
Senior Engineer | Dimagi South Africa