← Back to team overview

dhis2-devs team mailing list archive

Re: What you export should be similar to what you import

 

Hi Prosper

I am guessing that what is important that the user may be creating these in
excel or openoffice calc rather than authoring a csv file directly in a
text editor.

In which case your best approach might be to create a macro in VBA (or
python, java on openoffice) to render the spreadsheet data as json or xml.
There was a post recently for example about using VBA macros to make rest
api calls.  I suspect using python on openoffice would be even neater.
Either way, some work required (and not the work you could expect users to
do), but it may be more likely that you can meet your use cases this way
than waiting for dhis2 to be able to consume every kind of csv,

There are also other ways to process a spreadsheet (many libraries, xslt
etc) but having the functionality as builtin macros would be the most user
friendly.

Bob

On 26 June 2015 at 09:43, Prosper BT <ptb3000@xxxxxxxxx> wrote:

> Thanks Mortem,
>
> User may not use XML or Json for the reason that he/she may not be
> familiar with them. Creating import files from scratch.
>
> Secondary you want to create new tracked entity attributes through import,
> just like a CSV file attached for creating new data elements for both
> tracker and aggregate.
>
> Regards
>
>
>
> On Fri, Jun 26, 2015 at 11:29 AM, Morten Olav Hansen <mortenoh@xxxxxxxxx>
> wrote:
>
>> And to clarify, do you want to create/update TrackedEntity Attributes, or
>> do you want to attach a TrackedEntity Attribute to a Program (it then by
>> definition becomes a Program Attribute)
>>
>> --
>> Morten
>>
>> On Fri, Jun 26, 2015 at 3:28 PM, Morten Olav Hansen <mortenoh@xxxxxxxxx>
>> wrote:
>>
>>> Ok, is there any reason why you can't just use JSON or XML?
>>>
>>> --
>>> Morten
>>>
>>> On Fri, Jun 26, 2015 at 3:25 PM, Prosper BT <ptb3000@xxxxxxxxx> wrote:
>>>
>>>> Thanks Bob and Morten,
>>>>
>>>> Just like we import data elements we would also like to import Program
>>>> tracker attributes in CSV format.
>>>>
>>>> [image: Inline image 1]
>>>> Regards
>>>>
>>>> On Fri, Jun 26, 2015 at 11:18 AM, Bob Jolliffe <bobjolliffe@xxxxxxxxx>
>>>> wrote:
>>>>
>>>>> Prosper I don't think that we will ever hope to have the CSV export as
>>>>> complete as the xml/json variant.  I see two reasons:
>>>>>
>>>>> 1.  the flat csv data model makes it more work to map to complex
>>>>> objects
>>>>> 2.  the xml and json mappings are bound in the source code (using
>>>>> annotations) whereas csv rendering always has to be done a s separate
>>>>> process.
>>>>>
>>>>> So it is unreasonable to expect we will have a csv expression of our
>>>>> entire data model in the same way we have with xml/json.   Pieces may be
>>>>> added over time to satisfy particular use cases.
>>>>>
>>>>> Of course your original question about importing/exporting attributes
>>>>> is different. Can you elaborate more on that?
>>>>>
>>>>> On 26 June 2015 at 08:50, Prosper BT <ptb3000@xxxxxxxxx> wrote:
>>>>>
>>>>>> Thanks Ola,
>>>>>>
>>>>>> First of all there is no export of Meta data in CSV format
>>>>>>
>>>>>> Secondly see all the meta data export options compared to what you
>>>>>> can import using CSV
>>>>>>
>>>>>> [image: Inline image 2]
>>>>>>
>>>>>> [image: Inline image 1]
>>>>>>
>>>>>> On Fri, Jun 26, 2015 at 10:19 AM, Ola Hodne Titlestad <
>>>>>> olati@xxxxxxxxxx> wrote:
>>>>>>
>>>>>>> Hi Prosper,
>>>>>>>
>>>>>>> Could you elaborate a bit more on this?
>>>>>>>
>>>>>>> Are you suggesting to put options in the import user interface to
>>>>>>> select/filter what parts of a file to import?
>>>>>>>
>>>>>>> Or are you saying that the import process doesn't support importing
>>>>>>> attributes at all, even when it's an option to export attributes?
>>>>>>>
>>>>>>> Ola
>>>>>>> -------
>>>>>>>
>>>>>>> On Thu, 25 Jun 2015 08:37 Prosper BT <ptb3000@xxxxxxxxx> wrote:
>>>>>>>
>>>>>>>> Dear Team,
>>>>>>>>
>>>>>>>> It seems the lists of Meta data  importation and exportation
>>>>>>>> options. I would assume we should have same options on what you can import
>>>>>>>> and export as far as meta data is concerned.
>>>>>>>>
>>>>>>>> Like I can export attributes, but I cant import attributes
>>>>>>>>
>>>>>>>> Regards
>>>>>>>>
>>>>>>>> --
>>>>>>>> Prosper Behumbiize, MPH
>>>>>>>> Global HISP| University Of Oslo/HISP Uganda
>>>>>>>> +256 751 751 776 | +256 776 139 139
>>>>>>>> ptb3000@xxxxxxxxx | prosper@xxxxxxxxx | Skype: prospertb
>>>>>>>>
>>>>>>>>  _______________________________________________
>>>>>>>> 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
>>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Prosper Behumbiize, MPH
>>>>>> Global HISP| University Of Oslo/HISP Uganda
>>>>>> +256 751 751 776 | +256 776 139 139
>>>>>> ptb3000@xxxxxxxxx | prosper@xxxxxxxxx | Skype: prospertb
>>>>>>
>>>>>>
>>>>>> _______________________________________________
>>>>>> 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
>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Prosper Behumbiize, MPH
>>>> Global HISP| University Of Oslo/HISP Uganda
>>>> +256 751 751 776 | +256 776 139 139
>>>> ptb3000@xxxxxxxxx | prosper@xxxxxxxxx | Skype: prospertb
>>>>
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>>
>>
>
>
> --
> Prosper Behumbiize, MPH
> Global HISP| University Of Oslo/HISP Uganda
> +256 751 751 776 | +256 776 139 139
> ptb3000@xxxxxxxxx | prosper@xxxxxxxxx | Skype: prospertb
>
>

PNG image

PNG image

PNG image


References