← Back to team overview

dhis2-devs team mailing list archive

Re: Generating Facility Codes for a Facility Registry in Sierra Leone

 

Second approach sounds most painless to me.

A 3rd approach (shooting from the hip) is to create a postgres trigger
function to generate codes on insert.

On 24 November 2015 at 15:27, Carl Leitner <litlfred@xxxxxxxxxxx> wrote:
> Hi all,
> We are looking at using DHIS2 to manage facilities for a Facility Registry
> in Sierra Leone.  One of the requirements is that they have a facility code
> that combines:
>
> an sub-code to indicate the region the facility is in
> an incremental counter of the region
>
> These codes don’t need to be immediately available. On a routine basis (e.g.
> nightly) the facility list will be sent to the InterLinked Registry /
> OpenInfoMan for wider sharing for example with mHero.
>
> I don’t think that there is anything to automatically generate codes codes
> for facilities in DHIS2 using rules like the above.   I am looking for some
> suggestions.  A couple of (half-baked) ideas include:
>
> create a DHIS2 Web App to create new facilities with the logic implemented
> above
> create a script that runs on a cron job that will look for any facilities
> without a code and modify their records to add the code based on the rules
> above
>
> I think the second possibilities would be the simplest to implement.
>
>
> Cheers,
> -carl
>
>
> _______________________________________________
> 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