How to increase the max size of the derived field ?
I have been asked to display the label text in the medication record on the Patients|Medical Records screen.
I have the necessary expression as follows:
concat(openvpms:get(.,'product.entity.name'), ' - Qty: ',/details/quantity,expr:if(boolean(/details/label),concat('\n',/details/label/,'\n'),''),' Expiry: ', expr:if(boolean(/activityEndTime), date:formatDate(/activityEndTime), 'None'),expr:if(count(openvpms:get(.,'prescription.source.dispensing'))>0,' *P'))
However, the system bitches "Failed to validate Derived Value of Node: Field must contain at most 255 characters".
No sweat, I thought - just adjust the underlying archetype - so I found descriptor.node and pushed the max length of the derivedValue node to 511, and restarted Tomcat.
However, this didn't work - I am getting a 'could not update' error when I edit act.patientMedication to change the derivedValue expression - and drilling down, it is due to SQL returning a com.mysql.jdbc.MysqlDataTruncation error.
Is it possible to increase the size of the derivedValue node?
Note that the expansion of the JxPath functions to add things like expr:if and date:formatDate functions means that there is scope to do sexy things but these require a bigger derivedValue field to fit in complex expressions like the one above.
Regards, Tim G
Re: How to increase the max size of the derived field - FIXED
I fixed it - you also need to increase the size of the derived_value column in the node_descriptors table.
Tim A - would you like me to Jira this - ie adjust things so that one can use long derivedValue expressions (it would also require a small migration script). Or am I an extreme user who should not be catered for in the standard product?
Re: How to increase the max size of the derived field - FIXED
Stick in a JIRA; it will probably be scheduled for 1.8 however as I intend to implement better schema migration support in that release.
-Tim A