ProgramInstance + wish we had more code comments

Hi Devs,

Please can anyone kindly clarify what a ProgramInstance is? I see that it is different from instances of Program or TEI which are quite well described.
I've missed where ProgramInstance is described in the manual.
For example, a new test database we've been using has 333 ProgramInstance instances and 233 TrackedEntityInstances.
Since TEIs have a set of ProgramInstances, I am guessing that it is the number of enrollments by a TEI to a program or programstageinstance?

Also, I've tried to look at the javadoc and the code, but I noticed there's less comments these days for base domain/POJOs like these.

You can compare code comments from dhis2-core/dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java at master · dhis2/dhis2-core · GitHub to what we have for https://github.com/dhis2/dhis2-core/blob/master/dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java
In the old part of the core, the entities have top level comments that one can really use to understand what is happening.

This can help a lot, since there's no dhis2 database schema document developed.

Would be so grateful.
Thanks so much.

Ime

Hi Ime

You are right, basically:

a) ProgramInstance = enrollment

b) ProgramStageInstance = event

I know it can be confusing as we are exposing the internals with different names, but its a bigger task of renaming it internally (sql tables etc) then externally.

For sure everyone on the team know we are not the best at code documentation, but we will try and improve.

···

On Wed, Mar 15, 2017 at 3:25 PM, Ime Asangansi imeasangansi@gmail.com wrote:

Hi Devs,

Please can anyone kindly clarify what a ProgramInstance is? I see that it is different from instances of Program or TEI which are quite well described.

I’ve missed where ProgramInstance is described in the manual.

For example, a new test database we’ve been using has 333 ProgramInstance instances and 233 TrackedEntityInstances.

Since TEIs have a set of ProgramInstances, I am guessing that it is the number of enrollments by a TEI to a program or programstageinstance?

Also, I’ve tried to look at the javadoc and the code, but I noticed there’s less comments these days for base domain/POJOs like these.

You can compare code comments from https://github.com/dhis2/dhis2-core/blob/master/dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java to what we have for https://github.com/dhis2/dhis2-core/blob/master/dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java

In the old part of the core, the entities have top level comments that one can really use to understand what is happening.

This can help a lot, since there’s no dhis2 database schema document developed.

Would be so grateful.

Thanks so much.

Ime


Mailing list: https://launchpad.net/~dhis2-devs

Post to : dhis2-devs@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-devs

More help : https://help.launchpad.net/ListHelp

Morten Olav Hansen

Senior Engineer, DHIS 2

University of Oslo

http://www.dhis2.org

Hi Ime,

you are right to assume that ProgramInstance is an enrollment.

My way of looking at the Program/ProgramStage/TrackedEntity and their instances is like this:

Assume we have a TrackedEntity “Person”, a Program “Life” and two ProgramStages “Birth” and “Death”. All these objects tells us how we describe them. A Person has a name, age and more.

When creating an actual Person, we use to TrackedEntity Person to know how to desribe this new Person. The result is a TEI, which is the actual description on the Person. Similary, when this TEI is enrolled in the Life program we create a new ProgramInstance for the TEI. This ProgramInstance is the description of the TEI’s enrollment in the Life Program. And finally, when the Person is born, we add the Birth ProgramStage to the Program, giving us a ProgramStageInstance (Also described as an event in the UI). This is then a description of the actual birth event for the TEI. The same goes for the Death ProgramStage.

I hope this clears it up somewhat. If you still have questions let me know.

···

——

Stian Sandvold

Software developer, DHIS 2

University of Oslo

http://www.dhis2.org

On 15 Mar 2017, at 09:25, Ime Asangansi imeasangansi@gmail.com wrote:

Hi Devs,

Please can anyone kindly clarify what a ProgramInstance is? I see that it is different from instances of Program or TEI which are quite well described.
I’ve missed where ProgramInstance is described in the manual.
For example, a new test database we’ve been using has 333 ProgramInstance instances and 233 TrackedEntityInstances.
Since TEIs have a set of ProgramInstances, I am guessing that it is the number of enrollments by a TEI to a program or programstageinstance?

Also, I’ve tried to look at the javadoc and the code, but I noticed there’s less comments these days for base domain/POJOs like these.

You can compare code comments from https://github.com/dhis2/dhis2-core/blob/master/dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataelement/DataElement.java to what we have for https://github.com/dhis2/dhis2-core/blob/master/dhis-2/dhis-api/src/main/java/org/hisp/dhis/program/ProgramInstance.java
In the old part of the core, the entities have top level comments that one can really use to understand what is happening.

This can help a lot, since there’s no dhis2 database schema document developed.

Would be so grateful.
Thanks so much.

Ime


Mailing list: https://launchpad.net/~dhis2-devs
Post to : dhis2-devs@lists.launchpad.net
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp