Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LINST] Remove '_date' only for Standard Format (#6923)
This fixes the removal of '_date' by only doing it for Standard Date formats. Currently, all date elements (standard, basic, and month/year) in linst instruments have their field names redefined as the substring appearing before '_date'. For example, if a date element is called 'enrolment_date_v2', the instrument field name becomes enrolment. This results in the save function trying to update a field called 'enrolment' in the instrument table which does not exist. The reason why this functionality existed is because the Standard Date format requires a field name ending with '_date'. Linst Standard Date formats are created by calling the NDB_BVL_Instrument class addDateElement() function which auto appends '_date' to the date element name. In order to avoid '_date' appearing twice, the NDB_BVL_Instrument_LINST class removes '_date' from the element name before calling addDateElement(). Basic Date and Month/Year formats call the NDB_Page class addBasicDate() function and the NDB_BVL_Instrument class addMonthYear) function respectively, both of which do not seem to auto append '_date' to the field name. With this change, if a Standard Date format field name does not already end with '_date' , a LorisException is thrown.
- Loading branch information