Adding a form to the database after a specific time

Hello,

I have the following use case: when a booking form is filled out, a client
is eligible for their first payment. Then, when either an immunization form
is filled, or 9 months pass since the booking form has been filled, said
client is eligible for a second payment.

What would be the best way to approach handling the 9 months interval and
showing the resulting row (without a real form) on a custom report? One way
to accomplish this that I can think of would be to create a new form for
this specific case, and push it to the database directly from a celery
task, but I would prefer to find a better solution if at all possible. I am
using elasticsearch for the report, so unless I am mistaken, the form would
have to exist in the database in order to be displayed on the report and
for pagination to work properly (as otherwise the row count would not
reflect the real number of rows).

Regards
Lech

Lech,

What are the rows of this report going to represent, users, or forms? Does
the report cover a fixed time period, like a calendar month or week? One
approach would be to check the last form submission of each type for the
appropriate users, then calculate if that should trigger payment for the
report’s datespan. You should be able to have this be a calculated
property without needing to spoof form submissions.

-Ethan

··· On Wed, Apr 16, 2014 at 10:13 AM, Lech Różański wrote:

Hello,

I have the following use case: when a booking form is filled out, a client
is eligible for their first payment. Then, when either an immunization form
is filled, or 9 months pass since the booking form has been filled, said
client is eligible for a second payment.

What would be the best way to approach handling the 9 months interval and
showing the resulting row (without a real form) on a custom report? One way
to accomplish this that I can think of would be to create a new form for
this specific case, and push it to the database directly from a celery
task, but I would prefer to find a better solution if at all possible. I am
using elasticsearch for the report, so unless I am mistaken, the form would
have to exist in the database in order to be displayed on the report and
for pagination to work properly (as otherwise the row count would not
reflect the real number of rows).

Regards
Lech


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Could you just have the rows generated partially out of elastic search and
partially out of some function that has the logic to generate the computed
rows?

··· On Wed, Apr 16, 2014 at 10:13 AM, Lech Różański wrote:

Hello,

I have the following use case: when a booking form is filled out, a client
is eligible for their first payment. Then, when either an immunization form
is filled, or 9 months pass since the booking form has been filled, said
client is eligible for a second payment.

What would be the best way to approach handling the 9 months interval and
showing the resulting row (without a real form) on a custom report? One way
to accomplish this that I can think of would be to create a new form for
this specific case, and push it to the database directly from a celery
task, but I would prefer to find a better solution if at all possible. I am
using elasticsearch for the report, so unless I am mistaken, the form would
have to exist in the database in order to be displayed on the report and
for pagination to work properly (as otherwise the row count would not
reflect the real number of rows).

Regards
Lech


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

I am talking about the ‘mCCT Project Review’ report in custom.m4change.
Each row represents a submitted form. The problem with adding more rows
manually is that it screws with pagination, because those rows do not exist
in elasticsearch.

Regards
Lech

··· On Wednesday, 16 April 2014 16:13:13 UTC+2, Lech Różański wrote: > > Hello, > > I have the following use case: when a booking form is filled out, a client > is eligible for their first payment. Then, when either an immunization form > is filled, or 9 months pass since the booking form has been filled, said > client is eligible for a second payment. > > What would be the best way to approach handling the 9 months interval and > showing the resulting row (without a real form) on a custom report? One way > to accomplish this that I can think of would be to create a new form for > this specific case, and push it to the database directly from a celery > task, but I would prefer to find a better solution if at all possible. I am > using elasticsearch for the report, so unless I am mistaken, the form would > have to exist in the database in order to be displayed on the report and > for pagination to work properly (as otherwise the row count would not > reflect the real number of rows). > > Regards > Lech >

Is it possible to override the pagination to also be aware of these
additional rows?

It doesn’t feel like the type of problem that should be solved by adding
forms to the database.

··· On Thu, Apr 17, 2014 at 7:34 AM, Lech Różański wrote:

I am talking about the ‘mCCT Project Review’ report in custom.m4change.
Each row represents a submitted form. The problem with adding more rows
manually is that it screws with pagination, because those rows do not exist
in elasticsearch.

Regards
Lech

On Wednesday, 16 April 2014 16:13:13 UTC+2, Lech Różański wrote:

Hello,

I have the following use case: when a booking form is filled out, a
client is eligible for their first payment. Then, when either an
immunization form is filled, or 9 months pass since the booking form has
been filled, said client is eligible for a second payment.

What would be the best way to approach handling the 9 months interval and
showing the resulting row (without a real form) on a custom report? One way
to accomplish this that I can think of would be to create a new form for
this specific case, and push it to the database directly from a celery
task, but I would prefer to find a better solution if at all possible. I am
using elasticsearch for the report, so unless I am mistaken, the form would
have to exist in the database in order to be displayed on the report and
for pagination to work properly (as otherwise the row count would not
reflect the real number of rows).

Regards
Lech


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Can you use the old booking form to represent this event in your
elasticsearch query? When selecting forms, you could do something like:
“filter by forms submitted in the report date range or submitted in the
report date range minus 9 months”, then go through and turn those old
reports into whatever’s appropriate for the second payment row.

··· On Thu, Apr 17, 2014 at 6:11 AM, Cory Zue wrote:

Is it possible to override the pagination to also be aware of these
additional rows?

It doesn’t feel like the type of problem that should be solved by adding
forms to the database.

On Thu, Apr 17, 2014 at 7:34 AM, Lech Różański lrozanski@soldevelo.comwrote:

I am talking about the ‘mCCT Project Review’ report in custom.m4change.
Each row represents a submitted form. The problem with adding more rows
manually is that it screws with pagination, because those rows do not exist
in elasticsearch.

Regards
Lech

On Wednesday, 16 April 2014 16:13:13 UTC+2, Lech Różański wrote:

Hello,

I have the following use case: when a booking form is filled out, a
client is eligible for their first payment. Then, when either an
immunization form is filled, or 9 months pass since the booking form has
been filled, said client is eligible for a second payment.

What would be the best way to approach handling the 9 months interval
and showing the resulting row (without a real form) on a custom report? One
way to accomplish this that I can think of would be to create a new form
for this specific case, and push it to the database directly from a celery
task, but I would prefer to find a better solution if at all possible. I am
using elasticsearch for the report, so unless I am mistaken, the form would
have to exist in the database in order to be displayed on the report and
for pagination to work properly (as otherwise the row count would not
reflect the real number of rows).

Regards
Lech


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


You received this message because you are subscribed to the Google Groups
"CommCare Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to commcare-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Hello Cory,

I haven’t yet been able to figure out a way to do this easily, as we are
using the default pagination mechanism with elasticsearch, and
additional rows would somewhat mess with page numbering and sorting. Do
you have any suggestions on how best to approach this?

Regards
Lech

··· On 04/17/2014 12:11 PM, Cory Zue wrote: > Is it possible to override the pagination to also be aware of these > additional rows? > > It doesn't feel like the type of problem that should be solved by > adding forms to the database. > > > On Thu, Apr 17, 2014 at 7:34 AM, Lech Różański <lrozanski@soldevelo.com > wrote: > > I am talking about the 'mCCT Project Review' report in > custom.m4change. Each row represents a submitted form. The problem > with adding more rows manually is that it screws with pagination, > because those rows do not exist in elasticsearch. > > Regards > Lech > > > On Wednesday, 16 April 2014 16:13:13 UTC+2, Lech Różański wrote: > > Hello, > > I have the following use case: when a booking form is filled > out, a client is eligible for their first payment. Then, when > either an immunization form is filled, or 9 months pass since > the booking form has been filled, said client is eligible for > a second payment. > > What would be the best way to approach handling the 9 months > interval and showing the resulting row (without a real form) > on a custom report? One way to accomplish this that I can > think of would be to create a new form for this specific case, > and push it to the database directly from a celery task, but I > would prefer to find a better solution if at all possible. I > am using elasticsearch for the report, so unless I am > mistaken, the form would have to exist in the database in > order to be displayed on the report and for pagination to work > properly (as otherwise the row count would not reflect the > real number of rows). > > Regards > Lech > > -- > > --- > You received this message because you are subscribed to the Google > Groups "CommCare Developers" group. > To unsubscribe from this group and stop receiving emails from it, > send an email to commcare-developers+unsubscribe@googlegroups.com > . > For more options, visit https://groups.google.com/d/optout. > > > -- > > --- > You received this message because you are subscribed to the Google > Groups "CommCare Developers" group. > To unsubscribe from this group and stop receiving emails from it, send > an email to commcare-developers+unsubscribe@googlegroups.com > . > For more options, visit https://groups.google.com/d/optout.