← Back to team overview

dhis2-devs team mailing list archive

Re: [Blueprint patient-datavalue-archive] Patient datavalue archive

 

Hi Tran,
On Fri, Oct 22, 2010 at 10:28 AM, Chau Thu Tran
<tran.hispvietnam@xxxxxxxxx>wrote:

> Hi Abyot,
>
> As your idea, we only archive PatientDataValues with completed
> ProgramInstances. Is it right, sir ?
>

Yes, that is what I am suggesting.


>
> But we have interval parameters to choose data values to archive ? And you
> think what the interval is based on ?
>

DATA values or DATE value? I suppose you are talking about date values.

Yes we can take date intervals (startDate and endDate). Once we have such an
interval, then we can look for programInstances who are completed/terminated
within the specified time frame. It is these programInsances that we should
archive.

foreach( programStageInstance that got completed/terminated in the given
time frame)
{

 Collection<ProgramStageInstance> programStageInstances =
programStageInstance.getProgramStageInstance();

Collection<PatientDataValue> patientDataValuesToArchive =
patientDataValueService.getPatientDataValues( programStageInstances );

//do the archive ....

}

hope this helps

Abyot.



>
>  Best regards,
> ------------------------------------------------
> Châu Thu Trân
> HISP Viet Nam
> Email: tran.hispvietnam@xxxxxxxxx
> Cell phone: +84 97 324 1542
>
>
>   On Fri, Oct 22, 2010 at 3:09 PM, Abyot Gizaw <abyota@xxxxxxxxx> wrote:
>
>> Hi Tran,
>>
>> Archiving is good idea. And I would suggest archiving based on the status
>> of the programInstance not programStageInstance. For example, to generate
>> visit plans we will rely on previously completed programStageInstances,
>> therefore better if we could keep completed programStageInstances as long as
>> their parent programInstance is active. If we want to play around with
>> history (within the current programInstance at least), then we will
>> definately need completed programStageInstances of the current
>> programInstance.
>>
>> If a programInstance is successfully completeed (or terminated for some
>> reason), we will always start a new cycle of programInstance by keepin aside
>> the previous programInstance.
>>
>> Abyot.
>>  On Fri, Oct 22, 2010 at 9:29 AM, Chau Thu Tran <
>> tran.hispvietnam@xxxxxxxxx> wrote:
>>
>>> Hi all,
>>>
>>> How do you think if we archive data values according to DueDate and
>>> Completed property of ProgramStageInstance ?
>>>
>>> Use choose interval, the system will check DueDate and the status of
>>> ProgramStageInstance, if DueDate is ok and status is completed, then archive
>>> all of data values of the instance.
>>>
>>> Best regards,
>>> ------------------------------------------------
>>> Châu Thu Trân
>>> HISP Viet Nam
>>> Email: tran.hispvietnam@xxxxxxxxx
>>> Cell phone: +84 97 324 1542
>>>
>>>
>>> 2010/10/21 Lars Helge Øverland <larshelge@xxxxxxxxx>
>>>
>>>> Blueprint changed by Lars Helge Øverland:
>>>>
>>>>    Assignee: (none) => Thu Tran
>>>>
>>>> --
>>>> Patient datavalue archive
>>>> https://blueprints.launchpad.net/dhis2/+spec/patient-datavalue-archive
>>>>
>>>
>>>
>>
>

References