dhis2-devs team mailing list archive
-
dhis2-devs team
-
Mailing list archive
-
Message #51404
Re: Getting the OU for items recorded in datavalues table
-
To:
David Huser <dhuser@xxxxxxxxxxxxxx>
-
From:
Edward Robinson <erobinson@xxxxxxxxxxxxxxxxxx>
-
Date:
Tue, 19 Jun 2018 12:35:41 +0000
-
Accept-language:
en-US
-
Authentication-results:
spf=none (sender IP is ) smtp.mailfrom=erobinson@xxxxxxxxxxxxxxxxxx;
-
Cc:
DHIS 2 Developers list <dhis2-devs@xxxxxxxxxxxxxxxxxxx>
-
In-reply-to:
<CAK5GCp3_0XFaoB9XQcM8k+9m=41G04yjSnc_+XtMDbEWk9630w@mail.gmail.com>
-
Spamdiagnosticmetadata:
NSPM
-
Spamdiagnosticoutput:
1:99
-
Thread-index:
AdQHx6T8kwj1iO6PR5KBitefX5AwEAAAgOsAAAAL8DA=
-
Thread-topic:
[Dhis2-devs] Getting the OU for items recorded in datavalues table
Oh wow, that simple? Sourceid = organisationunitid?
Thanks for the quick response David. For some reason I was expecting organisationunitid to be present in the datavalue table. Do you know the reason it’s called sourceid?
Ed
From: David Huser <dhuser@xxxxxxxxxxxxxx>
Sent: Tuesday, 19 June 2018 2:33 PM
To: Edward Robinson <erobinson@xxxxxxxxxxxxxxxxxx>
Cc: DHIS 2 Developers list <dhis2-devs@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Dhis2-devs] Getting the OU for items recorded in datavalues table
Hi Ed,
This should get you started:
SELECT dv.dataelementid, dv.value, ou.name<http://ou.name>
FROM datavalue dv
JOIN organisationunit ou
ON ou.organisationunitid = dv.sourceid;
Best,
David
On Tue, Jun 19, 2018 at 2:21 PM Edward Robinson <erobinson@xxxxxxxxxxxxxxxxxx<mailto:erobinson@xxxxxxxxxxxxxxxxxx>> wrote:
How can the OU be determined for the data in the datavalues table?
The fields are dataelementid, periodid, sourceid, categoryoptioncomboid, attributeoptioncomboid, value, storedby, created, lastupdated, comment, followup, deleted
I’m guessing it involves the sourceid field (and possibly others) but I’m having a hard time figuring it out at the moment.
Thanks in advance!
Ed
_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp
--
[https://docs.google.com/uc?export=download&id=0B3FU6Lx45t71cUgwM0swdzZOcUk&revid=0B3FU6Lx45t71VGRUVElxbzIxM2VsOXVqN0hZUFRtMk1ZaXcwPQ]
David Huser
DHIS2 Support Specialist
dhuser@xxxxxxxxxxxxxx<mailto:dhuser@xxxxxxxxxxxxxx> | https://baosystems.com | 2900 K Street, Suite 507, Washington D.C. 20007
Follow ups
References