Initializer to download existing concepts as a ready-to-use CSV file

Thanks @bistenes.

Just to give some insight at my POC so far. First I was hoping to use Jackson CSV data formatting tool, however there are limitations with the CSV serializer that do not exist with the core JSON one. It’s being addressed but in the meantime I’m attempting the following approach:

Fetch from API
→ serialize as Map<String, Object>
add + transform + remove entries and end up with a Map<String, String>
→ make a CSV out of the map

Clearly the middle step is the key and complicated one. That’s for instance where any value in the map that extends BaseOpenmrsMetadata is flattened into something like its UUID or its name ; or where a collection of such metadata is flattened into a ";"-separated list of UUIDs or names.

That’s also where concept names have to be handled, that’s quite a special case within Iniz.

Anyway that’s the rough plan.

1 Like