← Back to team overview

dhis2-users team mailing list archive

Re: What is the recommended way to export facility data from DHIS as XML?

 

Hi Carl,

This is of course going to depend on each implementation and what a
"facility" actually means.

As an example provides us this...

http://apps.dhis2.org/demo/api/organisationUnitLevels.xml

<organisationUnitLevel name="PHU" created="2011-12-24T11:24:22.935+0000"
lastUpdated="2011-12-24T11:24:22.935+0000" level="4"href="
http://apps.dhis2.org/demo/api/organisationUnitLevels/m9lBJogzE95";
id="m9lBJogzE95"/>

which defines the organisation unit levels, and we see "PHU" which I guess
is the equivalent to the facility level.

As an example.

http://apps.dhis2.org/demo/api/organisationUnits/ueuQlqb8ccl.xml shows this
has the attribute level="4".

So, it is just a matter filtering out the orgunits which have a particular
level means "facility" to you

The FRED API of course is the other alternative, but this will only work
currently, if your lowest organisation unit is the facility level. In our
case, the facility level is 4, but our lowest organisation unit is level 6,
so FRED does not work for us. I do think it would be good however to
indicate which level is the facility level, and this would be the level
which is used by FRED. Of course, if you have facilities at different
levels, (health posts for instance, which may be children of health
centers), which could be problematic.But, an orgunit group "Facility" which
would be part of an "Organisationunit group set" such as "Type" would also
do the job, again filtering out the orgunits which are part of the
"Facility" organisation unit group.

Regards,
Jason










On Thu, Aug 15, 2013 at 11:09 AM, Knut Staring <knutst@xxxxxxxxx> wrote:
>
> Hi Carl,
>
> Just forwarding your question to this list, where it is likely to be seen
by more people:
> https://answers.launchpad.net/dhis2/+question/234034
>
>
> We have run across the task of needed to get a list of the facilities in
DHIS2 to export to other systems. My particular use case is with iHRIS,
though I have need to do this for setting up provider registries which need
to reference facility data that DHIS2 is the authoritative source for.
>
> Among several DHIS installations, It does not seem that there is a
consistent way to easily determine which of the organizational units are
facilities. I have been looking in particular at the metadata Export.xml to
try to extract this data and although there are some heuristics that will
get us 90% of what we want, I would like to have something we can
consistently rely on.
>
> A few options come to mind:
>
> 1) request that DHIS2 implementations create an organisationUnitGroup
called "Facility" and add each of the facilities to this group? Presumably
we would request that they would also create additional
organisationUnitGroups for each of the levels of the organizationGroup
hierarchy (e.g. Block, District, State) and put all of this under a
organisationUnitGroupSet called something like "Administrative Hierarchy."
This would require no additional programming to the existing DHIS2 codebase
as I understand.
>
> 2) Ask the DHIS2 developers to add a boolean flag, "Facility," to the
main organisationalUnit record. Presumably this would be relatively quick
to do.
>
> 3) Wait until this issue in FRED:
>    https://github.com/facilityregistry/fred-api/issues/62
> gets resolved and implemented in DHIS? This seems like it would require a
fair amount of developer time and specification that is not yet done.
>
> I don't care to much which of the above options gets implemented (or even
if there is another alternative that works better), but I would like to
have a "best practice" to point to when trying to extract facility
information from DHIS as XML.
>
> Thanks so much!
>
> Cheers.
> -carl
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References