← Back to team overview

dhis2-users team mailing list archive

Re: Losing data on same program enrollment

 

Hello Blai,

Someone in our team mentioned me that your question was actually about
attributes, sorry I missed that part. Unfortunately, attribute values are
not unique per enrollment. Data element values are unique as I tried to
explain in my previous mail. You can have the uniqueness you wanted by
going the data elements way, unless there is a particular reason for using
attributes.

---
Thank you,
Abyot.

On Wed, Nov 26, 2014 at 8:01 PM, Blai Samitier <blaisami@xxxxxxxxxxx> wrote:

> Thank you that was really helpful!
>
>
>
> ------------------------------
> Date: Tue, 25 Nov 2014 13:26:04 +0100
>
> Subject: Re: [Dhis2-users] Losing data on same program enrollment
> From: abyota@xxxxxxxxx
> To: blaisami@xxxxxxxxxxx
> CC: dhis2-users@xxxxxxxxxxxxxxxxxxx
>
> Seems you have an interesting use case. It is nice to see DHIS2 being used
> in other areas - keep up the good work and let us know if there is anything
> to guide you.
>
> Coming to your question: if you are doing things from external/custom app,
> then you have everything you need. See the following URLs
>
> 1. api/enrollments.json?trackedEntityInstance=TEI_UID - gives you all
> available enrollments for the specified TEI (TEI_UID)
>
> 2. api/enrollments.json?trackedEntityInstance=TEI_UID&program=PR_UID -
> gives you all available enrollments of the TEI in the specified program
> (PR_UID)
>
> 3.
> api/enrollments.json?trackedEntityInstance=TEI_UID&program=PR_UID&status=ACTIVE
> - gives you only those active enrollments for the selected TEI and program
>
> 4. api/events.json?trackedEntityInstance=TEI_UID&program=ur1Edk5Oe2n -
> gives you data for all the enrollments
>
> 5.
> api/events.json?trackedEntityInstance=TEI_UID&program=ur1Edk5Oe2n&programStatus=ACTIVE
> - gives you data only for active enrollment
>
> also take a look to the documentation
> <https://www.dhis2.org/doc/snapshot/en/developer/html/dhis2_developer_manual.html>for
> more filtering and other issues regarding the web-api.
>
> ---
> Thank you,
> Abyot.
>
> On Tue, Nov 25, 2014 at 12:53 PM, Blai Samitier <blaisami@xxxxxxxxxxx>
> wrote:
>
> Hello,
>
> Thank you for the fast answer! We want to use the programs to keep track
> of the infrastructural state of a building. Each enrollment on the program
> will be a new infrastructure analysis, but we want to still be able to
> access older enrollments to view the progression. We will not modify old
> enrollments, we only want to access them.
>
> We are doing this from an external APP via the web API. The idea was to
> have a "Multiple event with registration" program and, everytime someone
> make a new analysis, we enroll the TEI again into that program, fill the
> data and complete it. Then show a list with all the enrollments of that
> TEI, showing their information when selected.
>
> Thanks!
>
> ------------------------------
> Date: Mon, 24 Nov 2014 13:40:07 +0100
> Subject: Re: [Dhis2-users] Losing data on same program enrollment
> From: abyota@xxxxxxxxx
> To: blaisami@xxxxxxxxxxx
> CC: dhis2-users@xxxxxxxxxxxxxxxxxxx
>
>
> Hi,
>
> Yes there is. Each enrollment and associated data is unique - there is no
> overwriting. To enroll a TEI multiple times in a program, you first need to
> either complete or terminate (in your case complete) previous enrollments.
> I know we have focused only with the "Active" enrollment and haven't
> provided proper interface to deal with historical enrollment data.
>
> Tell us more about your use case - what do you do with previous
> enrollments? how do you want the data to be displayed - in report? do you
> want to edit previous enrollment data?
>
> ---
> Thank you,
> Abyot.
>
> On Mon, Nov 24, 2014 at 1:07 PM, Blai Samitier <blaisami@xxxxxxxxxxx>
> wrote:
>
> Hello,
>
> I would like to know if there is a way to enroll a tracked entity instance
> into the same program multiple times without losing the values of the
> attributes on the old enrollments. Right now, if I enroll a tracked entity
> into a program, all the attributes of older enrollments of that program get
> replaced by the new values.
>
> Thanks!
>
> _______________________________________________
> 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
>
>
>
>

Follow ups

References