Re: [Dhis2-devs] [Dhis2-users] Populating data from Excel to DHIS2 Data Entry Web Form with Internet Explorer

2017-10-26 Thread Damasceno Lopes
Thanks Morten,

After hit the change event on the fields the data values are now
saved/persisted.

*Damasceno Lopes,  MSc*

*Health Information System Officer*

Friends in Global Health, Mozambique

*+258844626770 <+258%2084%20462%206770>*  | *+258829502145
*

[image: FGH]-Mozambique

2017-10-26 16:41 GMT+02:00 Morten Olav Hansen :

> Hi there
>
> To make sure that the data values are saved, you need to trigger the
> "change" event on each field.
>
> https://github.com/dhis2/dhis2-core/blob/master/dhis-2/dhis-
> web/dhis-web-dataentry/src/main/webapp/dhis-web-dataentry
> /javascript/form.js#L538
>
> --
> Morten Olav Hansen
> Senior Engineer, DHIS 2
> University of Oslo
> http://www.dhis2.org
>
> On Thu, Oct 26, 2017 at 9:18 PM, Damasceno Lopes <
> damascenolop...@gmail.com> wrote:
>
>> Hi!
>>
>>
>>
>> I’m trying to populate data from Excel to  DHIS2 Data Entry Web Form
>> using VBA code in Excel with Internet Explorer, the data goes to form but
>> not persisted to database. Anyone already try to do that?
>>
>>
>>
>> The VBA code, tested to fill form in the demo instance:
>>
>>
>>
>> 'Before run this Macro make sure to login into dhis2-demo using Internet
>> Explorer
>>
>> Sub FillInternetForm()
>>
>> Dim IE As Object
>>
>>
>>
>> Set IE = CreateObject("InternetExplorer.Application")
>>
>>
>>
>> IE.Navigate "https://play.dhis2.org/demo/dhis-web-dataentry/index.action;
>>
>> IE.Visible = True
>>
>>
>>
>> While IE.busy
>>
>> DoEvents 'wait until IE is done loading page.
>>
>> Wend
>>
>>
>>
>> 'You have 30 seconds to choose Orgunit, form and period
>>
>> 'Eg. Sierra Leone, Emergency Response, Result
>>
>> Application.Wait Now + TimeValue("00:00:30")
>>
>>
>>
>> 'Populating Data to two first fields
>>
>> IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Focus
>>
>> IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Value = "20"
>>
>> Application.Wait Now + TimeValue("00:00:02")
>>
>> IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Focus
>>
>> IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Value = "30"
>>
>>
>>
>> End Sub
>>
>>
>>
>> The result:
>>
>>
>>
>>
>>
>> The Data goes to the field but not persisted, the field don’t change
>> color.
>>
>> I appreciate your help if you can provide.
>>
>>
>>
>> Thank you
>>
>> *Damasceno Lopes,  MSc*
>>
>> *Health Information System Officer*
>>
>> Friends in Global Health, Mozambique
>>
>> *+258844626770 <+258%2084%20462%206770>*  | *+258829502145
>> *
>>
>> [image: FGH]
>>
>>
>>
>>
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-users
>> Post to : dhis2-us...@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Dhis2-users] Populating data from Excel to DHIS2 Data Entry Web Form with Internet Explorer

2017-10-26 Thread Knut Staring
Given the widespread knowledge of VBA coupled with the huge trove of legacy
data in Excel and the continued use of Excel for offline data collection,
it could be nice to add an appendix to the documentation with code snippets
to import data directly from Excel to the API, in addition to the R
documentation (munging?).

Perhaps it is something you could be interesting in developing and sharing,
Damasceno?

Cheers,
Knut

On Thu, Oct 26, 2017 at 4:55 PM, Jason Pickering <
jason.p.picker...@gmail.com> wrote:

> You may also want to consider just making the HTTP request, instead of
> working with the form itself
>
> https://support.microsoft.com/en-us/help/301102/how-to-make-
> a-get-request-by-using-visual-basic--net-or-visual-basic-2
>
> The DHIS2 dataValue API is documented in here
> 
> in "Section 1.19.7. Sending, reading and deleting individual data values"
>
> Regards,
> Jason
>
>
> On Thu, Oct 26, 2017 at 4:18 PM, Damasceno Lopes <
> damascenolop...@gmail.com> wrote:
>
>> Hi!
>>
>>
>>
>> I’m trying to populate data from Excel to  DHIS2 Data Entry Web Form
>> using VBA code in Excel with Internet Explorer, the data goes to form but
>> not persisted to database. Anyone already try to do that?
>>
>>
>>
>> The VBA code, tested to fill form in the demo instance:
>>
>>
>>
>> 'Before run this Macro make sure to login into dhis2-demo using Internet
>> Explorer
>>
>> Sub FillInternetForm()
>>
>> Dim IE As Object
>>
>>
>>
>> Set IE = CreateObject("InternetExplorer.Application")
>>
>>
>>
>> IE.Navigate "https://play.dhis2.org/demo/dhis-web-dataentry/index.action;
>>
>> IE.Visible = True
>>
>>
>>
>> While IE.busy
>>
>> DoEvents 'wait until IE is done loading page.
>>
>> Wend
>>
>>
>>
>> 'You have 30 seconds to choose Orgunit, form and period
>>
>> 'Eg. Sierra Leone, Emergency Response, Result
>>
>> Application.Wait Now + TimeValue("00:00:30")
>>
>>
>>
>> 'Populating Data to two first fields
>>
>> IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Focus
>>
>> IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Value = "20"
>>
>> Application.Wait Now + TimeValue("00:00:02")
>>
>> IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Focus
>>
>> IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Value = "30"
>>
>>
>>
>> End Sub
>>
>>
>>
>> The result:
>>
>>
>>
>>
>>
>> The Data goes to the field but not persisted, the field don’t change
>> color.
>>
>> I appreciate your help if you can provide.
>>
>>
>>
>> Thank you
>>
>> *Damasceno Lopes,  MSc*
>>
>> *Health Information System Officer*
>>
>> Friends in Global Health, Mozambique
>>
>> *+258844626770 <+258%2084%20462%206770>*  | *+258829502145
>> *
>>
>> [image: FGH]
>>
>>
>>
>>
>>
>> ___
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to : dhis2-devs@lists.launchpad.net
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Jason P. Pickering
> email: jason.p.picker...@gmail.com
> tel:+46764147049 <+46%2076%20414%2070%2049>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-users
> Post to : dhis2-us...@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Knut Staring
Dept. of Informatics, University of Oslo
Norway: +4791880522
Skype: knutstar
http://dhis2.org
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] Populating data from Excel to DHIS2 Data Entry Web Form with Internet Explorer

2017-10-26 Thread Jason Pickering
You may also want to consider just making the HTTP request, instead of
working with the form itself

https://support.microsoft.com/en-us/help/301102/how-to-make-a-get-request-by-using-visual-basic--net-or-visual-basic-2

The DHIS2 dataValue API is documented in here

in "Section 1.19.7. Sending, reading and deleting individual data values"

Regards,
Jason


On Thu, Oct 26, 2017 at 4:18 PM, Damasceno Lopes 
wrote:

> Hi!
>
>
>
> I’m trying to populate data from Excel to  DHIS2 Data Entry Web Form using
> VBA code in Excel with Internet Explorer, the data goes to form but not
> persisted to database. Anyone already try to do that?
>
>
>
> The VBA code, tested to fill form in the demo instance:
>
>
>
> 'Before run this Macro make sure to login into dhis2-demo using Internet
> Explorer
>
> Sub FillInternetForm()
>
> Dim IE As Object
>
>
>
> Set IE = CreateObject("InternetExplorer.Application")
>
>
>
> IE.Navigate "https://play.dhis2.org/demo/dhis-web-dataentry/index.action;
>
> IE.Visible = True
>
>
>
> While IE.busy
>
> DoEvents 'wait until IE is done loading page.
>
> Wend
>
>
>
> 'You have 30 seconds to choose Orgunit, form and period
>
> 'Eg. Sierra Leone, Emergency Response, Result
>
> Application.Wait Now + TimeValue("00:00:30")
>
>
>
> 'Populating Data to two first fields
>
> IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Focus
>
> IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Value = "20"
>
> Application.Wait Now + TimeValue("00:00:02")
>
> IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Focus
>
> IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Value = "30"
>
>
>
> End Sub
>
>
>
> The result:
>
>
>
>
>
> The Data goes to the field but not persisted, the field don’t change color.
>
> I appreciate your help if you can provide.
>
>
>
> Thank you
>
> *Damasceno Lopes,  MSc*
>
> *Health Information System Officer*
>
> Friends in Global Health, Mozambique
>
> *+258844626770 <+258%2084%20462%206770>*  | *+258829502145
> *
>
> [image: FGH]
>
>
>
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-devs
> Post to : dhis2-devs@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>


-- 
Jason P. Pickering
email: jason.p.picker...@gmail.com
tel:+46764147049
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


Re: [Dhis2-devs] [Dhis2-users] Populating data from Excel to DHIS2 Data Entry Web Form with Internet Explorer

2017-10-26 Thread Morten Olav Hansen
Hi there

To make sure that the data values are saved, you need to trigger the
"change" event on each field.

https://github.com/dhis2/dhis2-core/blob/master/dhis-2/
dhis-web/dhis-web-dataentry/src/main/webapp/dhis-web-
dataentry/javascript/form.js#L538

-- 
Morten Olav Hansen
Senior Engineer, DHIS 2
University of Oslo
http://www.dhis2.org

On Thu, Oct 26, 2017 at 9:18 PM, Damasceno Lopes 
wrote:

> Hi!
>
>
>
> I’m trying to populate data from Excel to  DHIS2 Data Entry Web Form using
> VBA code in Excel with Internet Explorer, the data goes to form but not
> persisted to database. Anyone already try to do that?
>
>
>
> The VBA code, tested to fill form in the demo instance:
>
>
>
> 'Before run this Macro make sure to login into dhis2-demo using Internet
> Explorer
>
> Sub FillInternetForm()
>
> Dim IE As Object
>
>
>
> Set IE = CreateObject("InternetExplorer.Application")
>
>
>
> IE.Navigate "https://play.dhis2.org/demo/dhis-web-dataentry/index.action;
>
> IE.Visible = True
>
>
>
> While IE.busy
>
> DoEvents 'wait until IE is done loading page.
>
> Wend
>
>
>
> 'You have 30 seconds to choose Orgunit, form and period
>
> 'Eg. Sierra Leone, Emergency Response, Result
>
> Application.Wait Now + TimeValue("00:00:30")
>
>
>
> 'Populating Data to two first fields
>
> IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Focus
>
> IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Value = "20"
>
> Application.Wait Now + TimeValue("00:00:02")
>
> IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Focus
>
> IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Value = "30"
>
>
>
> End Sub
>
>
>
> The result:
>
>
>
>
>
> The Data goes to the field but not persisted, the field don’t change color.
>
> I appreciate your help if you can provide.
>
>
>
> Thank you
>
> *Damasceno Lopes,  MSc*
>
> *Health Information System Officer*
>
> Friends in Global Health, Mozambique
>
> *+258844626770 <+258%2084%20462%206770>*  | *+258829502145
> *
>
> [image: FGH]
>
>
>
>
>
> ___
> Mailing list: https://launchpad.net/~dhis2-users
> Post to : dhis2-us...@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>
>
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] Populating data from Excel to DHIS2 Data Entry Web Form with Internet Explorer

2017-10-26 Thread Damasceno Lopes
Hi!



I’m trying to populate data from Excel to  DHIS2 Data Entry Web Form using
VBA code in Excel with Internet Explorer, the data goes to form but not
persisted to database. Anyone already try to do that?



The VBA code, tested to fill form in the demo instance:



'Before run this Macro make sure to login into dhis2-demo using Internet
Explorer

Sub FillInternetForm()

Dim IE As Object



Set IE = CreateObject("InternetExplorer.Application")



IE.Navigate "https://play.dhis2.org/demo/dhis-web-dataentry/index.action;

IE.Visible = True



While IE.busy

DoEvents 'wait until IE is done loading page.

Wend



'You have 30 seconds to choose Orgunit, form and period

'Eg. Sierra Leone, Emergency Response, Result

Application.Wait Now + TimeValue("00:00:30")



'Populating Data to two first fields

IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Focus

IE.document.getElementById("KFnFpbqDqji-bRowv6yZOF2-val").Value = "20"

Application.Wait Now + TimeValue("00:00:02")

IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Focus

IE.document.getElementById("zFFb3bar4Ct-bRowv6yZOF2-val").Value = "30"



End Sub



The result:





The Data goes to the field but not persisted, the field don’t change color.

I appreciate your help if you can provide.



Thank you

*Damasceno Lopes,  MSc*

*Health Information System Officer*

Friends in Global Health, Mozambique

*+258844626770 <+258%2084%20462%206770>*  | *+258829502145
*

[image: FGH]
___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp


[Dhis2-devs] [Bug 1727685] [NEW] Error in user manual - data integrity

2017-10-26 Thread wedwo
Public bug reported:

In the user manual under data integrity, the following subsection has a
heading that contradicts the description:

19.1.2. Data elements without groups
Some Data Elements have been allocated to several Data Element Groups. This is 
currently not allowed, because it will result in duplication of linked data 
records in the analytics record sets that provide aggregated data. Go to 
Maintenance -> Data Element Groups to review each Data Element identified and 
remove the incorrect Group allocations.

This is present in all versions from 2.20 and possibly some prior.  It
is also present behind the ? on the data integrity UI page.

** Affects: dhis2
 Importance: Undecided
 Status: New

-- 
You received this bug notification because you are a member of DHIS 2
developers, which is subscribed to DHIS.
https://bugs.launchpad.net/bugs/1727685

Title:
  Error in user manual - data integrity

Status in DHIS:
  New

Bug description:
  In the user manual under data integrity, the following subsection has
  a heading that contradicts the description:

  19.1.2. Data elements without groups
  Some Data Elements have been allocated to several Data Element Groups. This 
is currently not allowed, because it will result in duplication of linked data 
records in the analytics record sets that provide aggregated data. Go to 
Maintenance -> Data Element Groups to review each Data Element identified and 
remove the incorrect Group allocations.

  This is present in all versions from 2.20 and possibly some prior.  It
  is also present behind the ? on the data integrity UI page.

To manage notifications about this bug go to:
https://bugs.launchpad.net/dhis2/+bug/1727685/+subscriptions

___
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp