← Back to team overview

dhis2-devs team mailing list archive

Re: Retrieve previous month data value of a particular element and put it in current month data entry screen

 

Thank you very much.I have written an API and added in the data entry
editor as:

<script type="text/javascript">
 jQuery( document ).ready( function() {
    $.get("
http://103.247.238.67:8080/mishealth/api/dataValueSets.json?dataSet=aglAzf2x2bF&period=201507&orgUnit=NZlRtrITPDc
",function(json){
    json.rows.forEach(function(row){
    var id = row[0];
                var a=$("#SFbW0C3EjCu").html(row[0]);  // just for testing
purpose to get a single element.
               console.log(a);
        });
    });
  });
</script>
Testing data: <label id="SFbW0C3EjCu"> </label>
------------------------------------------
http://103.247.238.67:8080/mishealth/api/dataValueSets.json?dataSet=aglAzf2x2bF&period=201507&orgUnit=NZlRtrITPDc

This line is working fine in cURL and getting data but why i am not getting
data in the same format from data entry screen by ajax request? My script
is wrong or have another process?

Thanks
Julhas


On Tue, Sep 1, 2015 at 1:20 PM, Lars Helge Øverland <larshelge@xxxxxxxxx>
wrote:

> Hi Julhas,
>
> per today your best option is to implement this using javascript i.e. in
> the custom form, where you retrieve this data from the dataValueSets Web
> API resource.
>
> Web API Docs:
> https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s11.html#d5e1433
>
> Scripts in custom forms / callbacks docs:
>
> https://www.dhis2.org/doc/snapshot/en/user/html/ch06s02.html#d5e1408
>
>
>
> regards,
>
> Lars
>
>
> On Mon, Aug 31, 2015 at 12:59 PM, Julhas Sujan <julhaspustcse@xxxxxxxxx>
> wrote:
>
>> Hi Experts,
>>
>> Hope you are doing fine. I am from Bangladesh. I am working on DHIS2 to
>> implement electronic logistics management system(eLMIS) in DHIS2.
>>
>> For implementing eLMIS in DHIS2, we are facing the following challenges -
>>
>> >>Logistics Requirements - Opening Balance Calculation:
>>
>> In logistics data entry screen there is a need of showing  'Opening
>> Balance'  imported from previous month.(Please check the attachment).
>>
>> How can i get the data values of previous month and show it in the
>> current months data entry screen.
>>
>> Waiting for your kind response.
>>
>> Thanks
>> Juhas Sujan
>> Java Consultant
>> Management Science for Health (MSH),
>> Dhaka, Bangladesh
>> Skype: julhas08
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~dhis2-devs
>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~dhis2-devs
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>
>
> --
> Lars Helge Øverland
> Lead developer, DHIS 2
> University of Oslo
> Skype: larshelgeoverland
> http://www.dhis2.org <https://www.dhis2.org>
>
>

Follow ups

References