← Back to team overview

dhis2-users team mailing list archive

Re: [Dhis2-devs] Program indicators export to another system

 

Elmarie,

The devs might correct me, but I don't think that the code import scheme
would account for different data element ids since the import tool would be
trying to match a code for the programIndicator itself and not the
configured expression or filter.

I ran into this problem last year and did not have the ability to control
the source server, but I had API access to read metadata configuration.  If
you are familiar with a scripting language, you could create a set of
key/value pairs where the key is the existing ID from your source system
and the new ID in the destination system.  Get the programIndicators in
JSON/XML format via the API.  Then for each unique pair, recursively search
through the metadata for the key (source UID) and replace with the value
(destination UID) wherever found using a regex-like function. It can be
slow if you're dealing with a large configuration but ensures that you
don't miss an association somewhere that you forgot to explicitly code.

For just programIndicators, you would want to at least check the expression
and the filter attributes for the IDs in question.  Since it sounds like
you have the same configuration but different ID values, you also would
want to confirm that the programStage IDs are also correctly mapped.  In
the programIndicator construction you would see this as #{programStageId.
dataElementId}.

When I did this, I stored the source server UIDs in the code attribute of
my destination server since we were not using that field as a way to
persist the "map" between the two systems.  As Calle said, this whole
process is certainly an "expert" level approach and can degrade over time
if your source server changes metadata configuration. The proposed
SOURCE/DESTINATION mapping using the existing import tool would be great,
but still would require maintenance if the configuration changes (if you're
trying to maintain a matching configuration).

Otherwise, you would need to replace the references via the UI, but that
probably wouldn't be a great plan if you have to update more than one or
two.

Aaron


--
Aaron C. White
919.522.5585

On Thu, Feb 1, 2018 at 11:07 AM, Knut Staring <knutst@xxxxxxxxx> wrote:

> Hi Elmarie,
>
> This is an important issue, and I expect others will have a better answer,
> but one approach could perhaps be to replace the UID for the Programme
> Indicators with the desired data element UID. I suppose that would have to
> be done either directly in the database or through the API, but if it were
> to be a recommended way to link databases it should also be possibly to do
> this kind of mapping through the user interface
>
> Knut
>
> On Thu, Feb 1, 2018 at 4:59 PM, Elmarie Claasen <elmarie@xxxxxxxx> wrote:
>
>> Hi all,
>>
>> Any response to this question?
>>
>> Regards
>>
>> Elmarie
>>
>> On 30 Jan 2018 12:11, "Elmarie Claasen" <elmarie@xxxxxxxx> wrote:
>>
>>> Hi all,
>>>
>>>
>>>
>>> We create Programme Indicators and would like to export those to other
>>> systems with different data element UIDs than the created Programme
>>> Indicator UID.
>>>
>>> If adding a code to the Programme Indicator which is same as the Data
>>> Element code will this allow matching on import?
>>>
>>>
>>>
>>> Regards,
>>>
>>>
>>>
>>> *Elmarie Claasen*
>>>
>>> [image: Hisp logo]
>>>
>>> Project Manager
>>>
>>> Health Information Systems Program
>>>
>>> Tel:      041-367 1027
>>>
>>> Cell:     082 374 2209
>>>
>>> E-mail: elmarie@xxxxxxxx
>>>
>>> Skype:  elmarie.claasen52
>>>
>>>
>>>
>>
>> *This message and any attachments are subject to a disclaimer published
>> at http://www.hisp.org/policies.html#comms_disclaimer
>> <http://www.hisp.org/policies.html#comms_disclaimer>.  Please read the
>> disclaimer before opening any attachment or taking any other action in
>> terms of this electronic transmission.  If you cannot access the
>> disclaimer, kindly send an email to disclaimer@xxxxxxxx
>> <disclaimer@xxxxxxxx> and a copy will be provided to you. By replying to
>> this e-mail or opening any attachment you agree to be bound by the
>> provisions of the disclaimer.*
>>
>> _______________________________________________
>> 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
>>
>>
>
>
> --
> Knut Staring
>
> Department of Information, Evidence and Research
> World Health Organization, Geneva, Switzerland
> Office: +41 22 791 3683 <+41%2022%20791%2036%2083> Mob1: +33 6 4434 2931
> <+33%206%2044%2034%2029%2031> Mob2: +47 9188 0522
> Skype:     knutstar
>
> _______________________________________________
> 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
>
>

PNG image


References