Senegal DHIS2

Hi Jason

I see where this is at. Unfortunately I really have so many
priorities on my plate right now to actually take this one on, but I
can provide some possible pointers for the moment. Copying to devs
list .. perhaps you or someone else might take it forward.

Hi Bob,
Two files here. The facilities file, which contains coordinates and a parent
name, and the Admin2 for Senegal from Jan. I transformed the facilities from
the WHO global health facility database, assigning them to the district
which they are contained by. Not all of them matched due to some issues with
the Admin2 file. Anyway, you should get the point however of the parent
child relationship. This is never going to be a 100% clean process I am
afraid.
GML itself is never hierarchical in the sense which DXF is. Attributes are
self-contained within a <gml:featureMember> block. So, ideally, we would
need to generate the parent-child relationship though
1) Auto-assignment through a spatial function (likely using something like
this http://docs.geotools.org/latest/javadocs/org/opengis/filter/spatial/Contains.html\)

This id certainly possible. It is really quite trivial to call out to
a java class method from within an xslt processor. See for example
http://xml.apache.org/xalan-j/extensions.html\. So with an input gml
file of polygons for an admin district and an input gml file of
facilities with point co-ordinates, you could produce a dxf file with
the orgunit relationships.

Of course it could potentially be quite slow but I don't think speed
is a major concern. Though possibly it would make more sense to run
the transform as a separate tool outside of dhis. You would obviously
be a bit smart and geo-search for your facilities in the top level
polygons first and gradually descend to the lowest level.

2) Alternatively, through an attribute which would need to match something
in another layer, i.e. the lowest available polygon layer.

Yes that would of course be useful. I guess the implication being
that you first populate your dhis hierarchy with the upper orgunit
levels, including the attribute/code to match on. One approach would
be to then export that hierarchy as dxf. And use that plus your gml
file as inputs to a transform which would link up the hierarchy. This
would be asier than using the contains function. otoh it might be
quite powerful to be able to invoke opengis functions whilst
processing GML files anyway.

Sorry got to go into my workshop session now ...

Cheers
Bob

···

On 14 June 2011 03:09, Jason Pickering <jason.p.pickering@gmail.com> wrote:

Regards,
Jason

On Mon, Jun 13, 2011 at 9:40 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

On 13 June 2011 10:23, Jason Pickering <jason.p.pickering@gmail.com> >> wrote:
> My understanding is that there is not (I checked) and no easy way to get
> it
> really, as it is a seperate stanza in DHIS which specifies the orgunit
> child-parent relationships, which implies that we would need to generate
> this prior to import. If we could import with the parent name somehow
> and
> then have DHIS make the parent-child assignment, it would make things
> much
> easier.

Yes dxf does not do hierarchy in a very xml-centric way. But
certainly we could extend the gml2dxf transform to automatically
create the parent-child relations in the "separate stanza". Sorry I'm
not really a gml expert - can someone show me a really simple example
of such a hierarchical GML to transform?

> Right now, I have almost finished with importing the Senegal Adm1 and
> Adm2
> with the facilities from WHO, but had to resort to some SQL black magic,
> which we surely would not want to publicly admit or document. :slight_smile:
>
>
> On Mon, Jun 13, 2011 at 11:15 AM, Jan Henrik Øverland >> > <janhenrik.overland@gmail.com> wrote:
>>
>> Bob, is there currently a GML hierarchy/parent tag? Or is DXF needed to
>> import orgunit hierarchies?
>>
>> 2011/6/13 Jason Pickering <jason.p.pickering@gmail.com>
>>>
>>> Thanks for this. I managed with the Admin1 , but not the trick is, how
>>> to
>>> I assign the parent unit to the Admin2? This seems to be in a field
>>> <ogr:CTRY_AD1_A> but not a clue how to get DHIS2 to use it??
>>>
>>>
>>> 2011/6/12 Knut Staring <knutst@gmail.com>
>>>>
>>>> It is for that kind of server side processing that I have advocated
>>>> looking at e.g. Geotools on several occasions (another important need
>>>> for
>>>> this is for reports with map images).
>>>>
>>>> 2011/6/12 Jason Pickering <jason.p.pickering@gmail.com>
>>>>>
>>>>> Actually, this is probably not allowed, but WHO has never taken it
>>>>> down, so maybe best to keep it to ourselves. :slight_smile: Kathy changed her
>>>>> mind some
>>>>> time ago about releasing the dataset. It is there on the Geoserver,
>>>>> but it
>>>>> is not available through the Geonetwork, and supposedly you need
>>>>> permission
>>>>> to get the data, but anyway..it is there. Best to keep quiet about
>>>>> it
>>>>> though. FYI, Admin1/2/3/4 are also available through similar URLs.
>>>>> Good point about the "parent" admin unit. Theoretically, this should
>>>>> be
>>>>> the lowest available admin polygon unit, but would require some
>>>>> processing
>>>>> obviously. I will do this in ArcGIS and re-export the GML for import
>>>>> into
>>>>> DHIS2. Sounds like another blueprint.
>>>>> Regards,
>>>>> Jason
>>>>>
>>>>> 2011/6/12 Knut Staring <knutst@gmail.com>
>>>>>>
>>>>>> I actually didn't realize the facilities were available this way -
>>>>>> very cool.
>>>>>> But then the question comes on how to assign them to Admin 3 or 4
>>>>>> or
>>>>>> whatever - which I suppose is easy enough in a desktop GIS tool
>>>>>> where you
>>>>>> could add an additional attribute based on which polygon the point
>>>>>> falls
>>>>>> under (right?). Or you could do it in PostGIS. Would be awsome if
>>>>>> DHIS2
>>>>>> could assign them automatically, though.
>>>>>> k
>>>>>>
>>>>>> On Sun, Jun 12, 2011 at 8:09 PM, Jason Pickering >> >>>>>> <jason.p.pickering@gmail.com> wrote:
>>>>>>>
>>>>>>> Thanks for this.
>>>>>>> This URL should provide some facilities as GML.
>>>>>>>
>>>>>>>
>>>>>>> World Health Organization (WHO);
>>>>>>> Very likely not up to date, but perhaps a starting point.
>>>>>>>
>>>>>>> Regards,
>>>>>>> Jason
>>>>>>>
>>>>>>> On Sun, Jun 12, 2011 at 7:44 PM, Jan Henrik Øverland >> >>>>>>> <janhenrik.overland@gmail.com> wrote:
>>>>>>>>
>>>>>>>> Try these.
>>>>>>>>
>>>>>>>> On Sun, Jun 12, 2011 at 18:35, Jan Henrik Øverland >> >>>>>>>> <janhenrik.overland@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>> On my way to the airport. I'll send what I can find in my Ubuntu
>>>>>>>>> One account when I'm there. No specific files for Senegal I
>>>>>>>>> think, but I
>>>>>>>>> know I have simplified adm1 and adm2 GML files for WAHO.
>>>>>>>>>
>>>>>>>>> On Jun 12, 2011 6:00 PM, "Knut Staring" <knutst@gmail.com> >> >>>>>>>>> wrote:
>>>>>>>>> > Hi, I think Jan has at least the top levels (admin1 and
>>>>>>>>> > admin2)
>>>>>>>>> > for all West
>>>>>>>>> > Africa
>>>>>>>>> >
>>>>>>>>> > Knut
>>>>>>>>> >
>>>>>>>>> > On Sun, Jun 12, 2011 at 2:15 PM, jason.p.pickering@gmail.com < >> >>>>>>>>> > jason.p.pickering@gmail.com> wrote:
>>>>>>>>> >
>>>>>>>>> >> Do you have an orgunit hierarchy for Senegal?
>>>>>>>>> >>
>>>>>>>>> >> Sent from my HTC
>>>>>>>>> >>
>>>>>>>>> >>
>>>>>>>>> >
>>>>>>>>> >
>>>>>>>>> > --
>>>>>>>>> > Cheers,
>>>>>>>>> > Knut Staring
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Cheers,
>>>>>> Knut Staring
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Cheers,
>>>> Knut Staring
>>>
>>
>
>

Hi Bob,

Not a huge deal for me. I can get around it. It is really more of something to think about for the future, and whether it is really a priority and worth the effort. I am not 100% sure it is, and think that other tools and documentation of processes may be much better.

Lets at least record this as a blueprint and see where it goes.

Regards,

Jason

···

On Tue, Jun 14, 2011 at 8:05 AM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Jason

I see where this is at. Unfortunately I really have so many

priorities on my plate right now to actually take this one on, but I

can provide some possible pointers for the moment. Copying to devs

list … perhaps you or someone else might take it forward.

On 14 June 2011 03:09, Jason Pickering jason.p.pickering@gmail.com wrote:

Hi Bob,

Two files here. The facilities file, which contains coordinates and a parent

name, and the Admin2 for Senegal from Jan. I transformed the facilities from

the WHO global health facility database, assigning them to the district

which they are contained by. Not all of them matched due to some issues with

the Admin2 file. Anyway, you should get the point however of the parent

child relationship. This is never going to be a 100% clean process I am

afraid.

GML itself is never hierarchical in the sense which DXF is. Attributes are

self-contained within a gml:featureMember block. So, ideally, we would

need to generate the parent-child relationship though

  1. Auto-assignment through a spatial function (likely using something like

this http://docs.geotools.org/latest/javadocs/org/opengis/filter/spatial/Contains.html)

This id certainly possible. It is really quite trivial to call out to

a java class method from within an xslt processor. See for example

http://xml.apache.org/xalan-j/extensions.html. So with an input gml

file of polygons for an admin district and an input gml file of

facilities with point co-ordinates, you could produce a dxf file with

the orgunit relationships.

Of course it could potentially be quite slow but I don’t think speed

is a major concern. Though possibly it would make more sense to run

the transform as a separate tool outside of dhis. You would obviously

be a bit smart and geo-search for your facilities in the top level

polygons first and gradually descend to the lowest level.

  1. Alternatively, through an attribute which would need to match something

in another layer, i.e. the lowest available polygon layer.

Yes that would of course be useful. I guess the implication being

that you first populate your dhis hierarchy with the upper orgunit

levels, including the attribute/code to match on. One approach would

be to then export that hierarchy as dxf. And use that plus your gml

file as inputs to a transform which would link up the hierarchy. This

would be asier than using the contains function. otoh it might be

quite powerful to be able to invoke opengis functions whilst

processing GML files anyway.

Sorry got to go into my workshop session now …

Cheers

Bob

Regards,

Jason

On Mon, Jun 13, 2011 at 9:40 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

On 13 June 2011 10:23, Jason Pickering jason.p.pickering@gmail.com > > >> wrote:

My understanding is that there is not (I checked) and no easy way to get

it

really, as it is a seperate stanza in DHIS which specifies the orgunit

child-parent relationships, which implies that we would need to generate

this prior to import. If we could import with the parent name somehow

and

then have DHIS make the parent-child assignment, it would make things

much

easier.

Yes dxf does not do hierarchy in a very xml-centric way. But

certainly we could extend the gml2dxf transform to automatically

create the parent-child relations in the “separate stanza”. Sorry I’m

not really a gml expert - can someone show me a really simple example

of such a hierarchical GML to transform?

Right now, I have almost finished with importing the Senegal Adm1 and

Adm2

with the facilities from WHO, but had to resort to some SQL black magic,

which we surely would not want to publicly admit or document. :slight_smile:

On Mon, Jun 13, 2011 at 11:15 AM, Jan Henrik Øverland > > >> > janhenrik.overland@gmail.com wrote:

Bob, is there currently a GML hierarchy/parent tag? Or is DXF needed to

import orgunit hierarchies?

2011/6/13 Jason Pickering jason.p.pickering@gmail.com

Thanks for this. I managed with the Admin1 , but not the trick is, how

to

I assign the parent unit to the Admin2? This seems to be in a field

ogr:CTRY_AD1_A but not a clue how to get DHIS2 to use it??

2011/6/12 Knut Staring knutst@gmail.com

It is for that kind of server side processing that I have advocated

looking at e.g. Geotools on several occasions (another important need

for

this is for reports with map images).

2011/6/12 Jason Pickering jason.p.pickering@gmail.com

Actually, this is probably not allowed, but WHO has never taken it

down, so maybe best to keep it to ourselves. :slight_smile: Kathy changed her

mind some

time ago about releasing the dataset. It is there on the Geoserver,

but it

is not available through the Geonetwork, and supposedly you need

permission

to get the data, but anyway…it is there. Best to keep quiet about

it

though. FYI, Admin1/2/3/4 are also available through similar URLs.

Good point about the “parent” admin unit. Theoretically, this should

be

the lowest available admin polygon unit, but would require some

processing

obviously. I will do this in ArcGIS and re-export the GML for import

into

DHIS2. Sounds like another blueprint.

Regards,

Jason

2011/6/12 Knut Staring knutst@gmail.com

I actually didn’t realize the facilities were available this way -

very cool.

But then the question comes on how to assign them to Admin 3 or 4

or

whatever - which I suppose is easy enough in a desktop GIS tool

where you

could add an additional attribute based on which polygon the point

falls

under (right?). Or you could do it in PostGIS. Would be awsome if

DHIS2

could assign them automatically, though.

k

On Sun, Jun 12, 2011 at 8:09 PM, Jason Pickering > > >> >>>>>> jason.p.pickering@gmail.com wrote:

Thanks for this.

This URL should provide some facilities as GML.

http://apps.who.int/tools/geoserver/wfs?version=1.0.0&request=GetFeature&service=WFS&typename=WHO:v_unit_h&outputformat=GML2&CQL_FILTER=iso_ctry='SN

Very likely not up to date, but perhaps a starting point.

Regards,

Jason

On Sun, Jun 12, 2011 at 7:44 PM, Jan Henrik Øverland > > >> >>>>>>> janhenrik.overland@gmail.com wrote:

Try these.

On Sun, Jun 12, 2011 at 18:35, Jan Henrik Øverland > > >> >>>>>>>> janhenrik.overland@gmail.com wrote:

On my way to the airport. I’ll send what I can find in my Ubuntu

One account when I’m there. No specific files for Senegal I

think, but I

know I have simplified adm1 and adm2 GML files for WAHO.

On Jun 12, 2011 6:00 PM, “Knut Staring” knutst@gmail.com > > >> >>>>>>>>> wrote:

Hi, I think Jan has at least the top levels (admin1 and

admin2)

for all West

Africa

Knut

On Sun, Jun 12, 2011 at 2:15 PM, jason.p.pickering@gmail.com < > > >> >>>>>>>>> > jason.p.pickering@gmail.com> wrote:

Do you have an orgunit hierarchy for Senegal?

Sent from my HTC

Cheers,

Knut Staring

Cheers,

Knut Staring

Cheers,

Knut Staring