Hi Germine,
If you want to bulk complete dataset for data already in database you can use this. Please adapt for your needs.
DELETE FROM completedatasetregistration where datasetid = 9923;
–Set to 15 days after the end date of the period
INSERT INTO completedatasetregistration
SELECT DISTINCT 9923::integer as datasetid,a.periodid, a.sourceid, (b.enddate+‘15 days’::interval)::date as date,‘admin’::character varying(255) as storedby from datavalue a
INNER JOIN period b on a.periodid = b.periodid
where a.dataelementid
IN (SELECT DISTINCT dataelementid from datasetmembers where datasetid =9923);
Regards,
Paulo Grácio
···
From: Dhis2-devs [mailto:dhis2-devs-bounces+pgracio=criticalsoftware.com@lists.launchpad.net] On Behalf Of Seide, Germine
Sent: quinta-feira, 16 de Janeiro de 2014 09:05
To: Jason Pickering
Cc: dhis2-devs
Subject: Re: [Dhis2-devs] About dataset completeness
Thank you Jason !
Germine
From: Jason Pickering [mailto:jason.p.pickering@gmail.com]
Sent: Wednesday, January 15, 2014 10:55 PM
To: Seide, Germine
Cc: dhis2-devs
Subject: Re: [Dhis2-devs] About dataset completeness
Hi Germine,
This can be done either with XML or SQL. From the documents, you can see how it can be done with XML during the import process.
If you want to do it with SQL, you will need to look at the “completedatasetregistration” table. Be sure all the fields are present, in spite of the schema not requiring the date (which is a timestamp) and the “storedby” attribute, which should be a username.
Regards,
Jason
On Wed, Jan 15, 2014 at 10:45 PM, Seide, Germine GSeide@futuresgroup.com wrote:
Good Morning All,
I am dealing with a big issue on DHIS 2.
I have done a data import from another program to DHIS2 by using XML. All data displayed pretty well in data entry forms but the forms are not complete. Is there any way I can mark as complete after importing data from XML file all the data entry forms for all the facilities at the same? Do anyone has done that with a SQL query directly in the database. If yes can you please provide us some assistance. We have data from 2006 to 2012.
Regards,
Germine SEIDE, M. Sc. A.
HMIS Advisor
Futures Group International
125, Rue Faubert, Pétion-Ville
HT6140, Haiti
Cell : (509) 4408-1567
Off : (509) 2816-1434/ Skype ID : imergen
Email : GSeide@futuresgroup.com
website : www.futuresgroup.com
One Thomas Circle NW Suite 200 Washington DC 20005 USA
Insight for a better world
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