Script to catch previous period value

Dear all,

Can someone give an idea or example of a script which can get value from previous period and put into some field in my form while filling current period? This is because we have a data entry form with some values depending on data from previous periods.

Kind regards

Melhores Cumprimentos

João Gabriel Mazuze

National Database Manager

CHASS-SMT Project

Abt Associates Inc.

Av. Marginal nº 4067

Maputo - Mozambique

Fax: (+ 258) 21493525/6/8

Tel: (+ 258) 21486767

Cell: (+258) 824236279

www.chasssmt.com

Description: Description: Description: Description: Description: Description: Description: Description: Logotipo CHASS-SMT

We are a project founded by PEPFAR-II through USAID to strengthen the Health System in Sofala, Manica and Tete Provinces.

  • Our aim is to improve linkages and integration of HIV to primary health care and other related services in coordination with the Provincial Health Directorates and partners.*

Through CHASS-SMT project, the US Government supports the Mozambican Governament to improve quality of health care services in the country.

Dear João,

I’m not sure if there is not already a way to do this. If you want to implement something like this yourself i assume you can do a jQuery call to load the previous values.

Take a look at the following section in the documentation that explains how to get data values for a dataset in a given period. I’m not exactly sure how you can easily get a hold of the parameters, but you could try to figure that out. If you don’t manage to do that let me know and i’ll have a look.

https://www.dhis2.org/doc/snapshot/en/developer/html/dhis2_developer_manual_full.html#d4719e1262

Does this help you any further?

Kind regards,

Mark Polak
mark@thedutchies.com
markpo@ifi.uio.no
+47 970 36 752

···

On 10 Dec 2014, at 08:31, Joao Mazuze <Joao_Mazuze@chasssmt.com> wrote:

Dear all,
Can someone give an idea or example of a script which can get value from previous period and put into some field in my form while filling current period? This is because we have a data entry form with some values depending on data from previous periods.

Kind regards

Melhores Cumprimentos

João Gabriel Mazuze
National Database Manager
CHASS-SMT Project
Abt Associates Inc.
Av. Marginal nº 4067
Maputo - Mozambique
Fax: (+ 258) 21493525/6/8
Tel: (+ 258) 21486767
Cell: (+258) 824236279
www.chasssmt.com

<image001.jpg>
We are a project founded by PEPFAR-II through USAID to strengthen the Health System in Sofala, Manica and Tete Provinces.
Our aim is to improve linkages and integration of HIV to primary health care and other related services in coordination with the Provincial Health Directorates and partners.
Through CHASS-SMT project, the US Government supports the Mozambican Governament to improve quality of health care services in the country.

This message may contain privileged and confidential information intended solely for the addressee. Please do not read, disseminate or copy it unless you are the intended recipient. If this message has been received in error, we kindly ask that you notify the sender immediately by return email and delete all copies of the message from your system. _______________________________________________
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

Hi Mark,

I am now having a look at the link bellow, but unfortunately I am still having problems in how to integrate parameters there.

Kind regards

···

From: Mark Polak [mailto:markpo@ifi.uio.no]

Sent: 10 December 2014 11:13

To: Joao Mazuze

Cc: DHIS 2 developers

Subject: Re: [Dhis2-devs] Script to catch previous period value

Dear João,

I’m not sure if there is not already a way to do this. If you want to implement something like this yourself i assume you can do a jQuery call to load the previous values.

Take a look at the following section in the documentation that explains how to get data values for a dataset in a given period. I’m not exactly sure how you can easily get a hold of the parameters, but you could try to figure that out. If you don’t manage to do that let me know and i’ll have a look.

https://www.dhis2.org/doc/snapshot/en/developer/html/dhis2_developer_manual_full.html#d4719e1262

Does this help you any further?

Kind regards,

Mark Polak

mark@thedutchies.com

markpo@ifi.uio.no

+47 970 36 752

On 10 Dec 2014, at 08:31, Joao Mazuze Joao_Mazuze@chasssmt.com wrote:

Dear all,

Can someone give an idea or example of a script which can get value from previous period and put into some field in my form while filling current period? This is because we have a data entry form with some values depending on data from previous periods.

Kind regards

Melhores Cumprimentos


João Gabriel Mazuze

National Database Manager

CHASS-SMT Project

Abt Associates Inc.

Av. Marginal nº 4067

Maputo - Mozambique

Fax: (+ 258) 21493525/6/8

Tel: (+ 258) 21486767

Cell: (+258) 824236279

www.chasssmt.com

<image001.jpg>

We are a project founded by PEPFAR-II through USAID to strengthen the Health System in Sofala, Manica and Tete Provinces.

  • Our aim is to improve linkages and integration of HIV to primary health care and other related services in coordination with the Provincial Health Directorates and partners.*

Through CHASS-SMT project, the US Government supports the Mozambican Governament to improve quality of health care services in the country.


This message may contain privileged and confidential information intended solely for the addressee. Please do not read, disseminate or copy it unless you are the intended recipient. If this message has been received in error, we kindly ask that you notify the sender immediately by return email and delete all copies of the message from your system. _______________________________________________

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

Hey João,

Please find the attached JS file to help you a bit further. (Sorry had to zip it as UIO doesn’t seem to allow .js file attachments) It should do what you want sort of. I quickly threw it together so you might need to modify it a bit.