← Back to team overview

dhis2-devs team mailing list archive

Re: 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.

On 14 June 2011 03:09, Jason Pickering <jason.p.pickering@xxxxxxxxx> 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.

> 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

> Regards,
> Jason
>
>
>
>
> On Mon, Jun 13, 2011 at 9:40 PM, Bob Jolliffe <bobjolliffe@xxxxxxxxx> wrote:
>>
>> On 13 June 2011 10:23, Jason Pickering <jason.p.pickering@xxxxxxxxx>
>> 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. :)
>> >
>> >
>> > On Mon, Jun 13, 2011 at 11:15 AM, Jan Henrik Øverland
>> > <janhenrik.overland@xxxxxxxxx> 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@xxxxxxxxx>
>> >>>
>> >>> 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@xxxxxxxxx>
>> >>>>
>> >>>> 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@xxxxxxxxx>
>> >>>>>
>> >>>>> Actually, this is probably not allowed, but WHO has never taken it
>> >>>>> down, so maybe best to keep it to ourselves. :) 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@xxxxxxxxx>
>> >>>>>>
>> >>>>>> 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@xxxxxxxxx> 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@xxxxxxxxx> wrote:
>> >>>>>>>>
>> >>>>>>>> Try these.
>> >>>>>>>>
>> >>>>>>>> On Sun, Jun 12, 2011 at 18:35, Jan Henrik Øverland
>> >>>>>>>> <janhenrik.overland@xxxxxxxxx> 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@xxxxxxxxx>
>> >>>>>>>>> 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@xxxxxxxxx <
>> >>>>>>>>> > jason.p.pickering@xxxxxxxxx> wrote:
>> >>>>>>>>> >
>> >>>>>>>>> >> Do you have an orgunit hierarchy for Senegal?
>> >>>>>>>>> >>
>> >>>>>>>>> >> Sent from my HTC
>> >>>>>>>>> >>
>> >>>>>>>>> >>
>> >>>>>>>>> >
>> >>>>>>>>> >
>> >>>>>>>>> > --
>> >>>>>>>>> > Cheers,
>> >>>>>>>>> > Knut Staring
>> >>>>>>>>
>> >>>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>>
>> >>>>>> --
>> >>>>>> Cheers,
>> >>>>>> Knut Staring
>> >>>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> --
>> >>>> Cheers,
>> >>>> Knut Staring
>> >>>
>> >>
>> >
>> >
>
>


Follow ups