← Back to team overview

dhis2-devs team mailing list archive

Re: Cannot create new program stage reminder template

 

Hi Knut (and Lars),

Knut, many thanks for your reply.  All of the tables with ‘message’ in the name seem to relate to the new in-instance messaging system (which has a nice, tight naming convention), but you prompted me to do another schema search, and it looks like the following table holds the program and programstage reminders I’ve been looking for:
trackedentityinstancereminder
(Despite the name, this table doesn’t seem to have anything to do with tracked entity instances.)

When I compare 2.21 with the 2.24 Play demo, the table schema for trackedentityinstancereminder appears to have changed in 2.24/2.25 – the column order has been moved around.  (Note that I’ve only been able to do this comparison with a DHIS2 ‘SQL view’, since I don’t have access to the database.)

Play demo 2.24 instance (using DHIS2 ‘SQL view’ to view the table):
Trackedentityinstancereminderid
name
Daysallowedsendmessage
Templatemessage
Programstageid
Datetocompare
Programid
Sendto
Whentosend
Usergroupid
Messagetype
Uid
Code
Created
lastupdated

2.21 instance (using DHIS2 ‘SQL view’ to view the table) and my 2.24 instance upgraded from 2.21:
trackedentityinstancereminderid
uid
code
created
lastupdated
name
daysallowedsendmessage
templatemessage
datetocompare
sendto
whentosend
messagetype
usergroupid
programstageid
programid

My 2.24 instance has been upgraded from 2.21 to 2.24, and seems to have the 2.21 version of this table schema, rather than the 2.24/2.25 version – could this change in the order of the columns between DHIS2 versions be causing my bug?  (ie does the DHIS2 application include SQL statements that rely on column order, rather than explicitly naming columns?)

Many thanks,

Sam.


From: Knut Staring <knutst@xxxxxxxxx>
Date: Sunday, 9 October 2016 at 19:56
To: Sam Johnson <samuel.johnson@xxxxxxxxxx>
Cc: DHIS2 Developers <dhis2-devs@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Dhis2-devs] Cannot create new program stage reminder template

I don't think so, unfortunately. Perhaps the programmessage table?

On Sun, Oct 9, 2016 at 6:55 PM, Sam Johnson <samuel.johnson@xxxxxxxxxx<mailto:samuel.johnson@xxxxxxxxxx>> wrote:
Hi all,

Still banging my head against the wall with this one.  Is there any schema documentation available for DHIS2?

Cheers, Sam.


From: Dhis2-devs <dhis2-devs-bounces+samuel.johnson=qebo.co.uk@xxxxxxxxxxxxxxxxxxx<mailto:qebo.co.uk@xxxxxxxxxxxxxxxxxxx>> on behalf of Sam Johnson <samuel.johnson@xxxxxxxxxx<mailto:samuel.johnson@xxxxxxxxxx>>
Date: Friday, 7 October 2016 at 15:11
To: DHIS2 Developers <dhis2-devs@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>>

Subject: Re: [Dhis2-devs] Cannot create new program stage reminder template

Hi all,

Am still struggling with this missing UID bug on my own instance.  Does anyone know the name of the table into which these ProgramStage reminder templates are persisted?  (Is there any schema documentation available for DHIS2?)

Cheers, Sam.


From: Dhis2-devs <dhis2-devs-bounces+samuel.johnson=qebo.co.uk@xxxxxxxxxxxxxxxxxxx<mailto:qebo.co.uk@xxxxxxxxxxxxxxxxxxx>> on behalf of Sam Johnson <samuel.johnson@xxxxxxxxxx<mailto:samuel.johnson@xxxxxxxxxx>>
Date: Thursday, 6 October 2016 at 13:48
To: Lars Helge Øverland <lars@xxxxxxxxx<mailto:lars@xxxxxxxxx>>, Knut Staring <knutst@xxxxxxxxx<mailto:knutst@xxxxxxxxx>>
Cc: DHIS2 Developers <dhis2-devs@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>>
Subject: Re: [Dhis2-devs] Cannot create new program stage reminder template

Hi Knut and Lars,

Many thanks for such a prompt response.

Knut, thanks for the reminder about the upgrade notes; apologies, I should have been clearer: I did actually follow these upgrade instructions, noting the one SQL script (which I didn’t bother running, as at the time I hadn’t created any program rule variables, and was only using programs-with-registration anyway).  But I was wondering if any further scripts were required for the updates that have been done to 2.24, since I started with a very early release of 2.24?

Lars, I’ve unfortunately developed a proof-of-concept which I need to demonstrate in the next day or two, and I’m guessing that 2.25 isn’t yet stable enough for a client-facing demo?  (I’d need to be sure that all aspects of a complex Tracker program would run smoothly!)

In the meantime, do you have any idea why I’m getting this UID error?  What seems to be missing from that failed row?

Cheers, Sam.


From: Lars Helge Øverland <lars@xxxxxxxxx<mailto:lars@xxxxxxxxx>>
Date: Thursday, 6 October 2016 at 12:47
To: Sam Johnson <samuel.johnson@xxxxxxxxxx<mailto:samuel.johnson@xxxxxxxxxx>>
Cc: DHIS2 Developers <dhis2-devs@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>>
Subject: Re: [Dhis2-devs] Cannot create new program stage reminder template

Hi Sam,

okay. You would probably like to know that for 2.25, the "reminder message template" functionality has been replaced by a new version referred to as "program notifications" and "program stage notifications". This is a better implementation of the notifications system and is mostly equivalent in terms of features.

https://www.dhis2.org/225-upgrade

Are you able to upgrade to 2.25 snapshot?

best regards,

Lars





On Thu, Oct 6, 2016 at 1:26 PM, Sam Johnson <samuel.johnson@xxxxxxxxxx<mailto:samuel.johnson@xxxxxxxxxx>> wrote:
Hi all,

I’m using a 2.24 instance which I’ve just updated to 704143a, and am attempting to create reminder templates on a repeatable program stage.  I can successfully use the front end to create this reminder on one of the program stages on play.dhis2.org/demo<http://play.dhis2.org/demo>, but when I attempt it in my own instance, I get the ‘An exception occurred’ page, with the following log entries:
Caused by: org.postgresql.util.PSQLException: ERROR: null value in column "uid" violates not-null constraint
Detail: Failing row contains (1190, null, null, null, null, ANCReminder, -1, This is a reminder that you are due to come to the clinic for a ..., null, 1, 2, 1, null, null, null).

Why would my instance not be populating this uid column?  (I’ve tested this same reminder on other program stages and on the program itself, and all attempts at saving return the same error.)

A couple of notes:

•         My instance was originally installed as 2.21, and upgraded to 2.22, 2.23 and then 2.24.

•         My user has a role with ‘ALL’ and every other authority in it, and has all programs assigned to it.

•         I’ve done all updates to 2.24 by simply replacing the .war file – were any database scripts required for any updates?

Many thanks for any help you can give, as I’m currently stuck and unable to create reminders!

Cheers, Sam.


_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp



--
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
lars@xxxxxxxxx<mailto:lars@xxxxxxxxx>
http://www.dhis2.org<https://www.dhis2.org/>


_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx<mailto:dhis2-devs@xxxxxxxxxxxxxxxxxxx>
Unsubscribe : https://launchpad.net/~dhis2-devs
More help   : https://help.launchpad.net/ListHelp



--
Knut Staring
Dept. of Informatics, University of Oslo
Norway: +4791880522
Skype: knutstar
http://dhis2.org

References