← Back to team overview

dhis2-devs team mailing list archive

Re: Getting the OU for items recorded in datavalues table

 

robin

source is the main inception point of DHIS development then period means
time frame then elements means cell then datasets which combines source,
time, elements in unified form. most of the time we are working on data
collection in health domain perhaps this combination has capacity to solve
Nth dimension theorem of Mathematica. The probable reason behind
unification of three independent frames is to understand nature of medium
or you can say like in the form of organizationunit.

bm

On Mon 25 Jun, 2018, 7:42 PM Edward Robinson, <erobinson@xxxxxxxxxxxxxxxxxx>
wrote:

> Ah, got it, makes sense,
>
> Thanks
>
> Ed
>
>
>
> *From:* Knut Staring <knutst@xxxxxxxxx>
> *Sent:* Sunday, 24 June 2018 8:36 PM
> *To:* Edward Robinson <erobinson@xxxxxxxxxxxxxxxxxx>
> *Cc:* David Huser <dhuser@xxxxxxxxxxxxxx>; DHIS 2 developers <
> dhis2-devs@xxxxxxxxxxxxxxxxxxx>
> *Subject:* Re: [Dhis2-devs] Getting the OU for items recorded in
> datavalues table
>
>
>
> This is an unfortunate relic in a few key tables. Dates back to 2005...
>
>
>
> On Tue, Jun 19, 2018, 2:35 PM Edward Robinson <
> erobinson@xxxxxxxxxxxxxxxxxx> wrote:
>
> 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
> 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> 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
> Unsubscribe : https://launchpad.net/~dhis2-devs
> More help   : https://help.launchpad.net/ListHelp
>
>
>
>
> --
>
>
>
> *David Huser*
> DHIS2 Support Specialist
>
> dhuser@xxxxxxxxxxxxxx | https://baosystems.com |  2900 K Street, Suite
> 507, Washington D.C. 20007
>
>
>
> _______________________________________________
> 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
>
> _______________________________________________
> 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
>

References