The link to concept 'Xray, Date of Other Test' was removed in Release 1.5.1 . This problem happens only if data before the upgrade had only 'Xray, Date of Other Test' filled but other two Radiological Tests fields were left empty. Hence this error will not be there in any fresh 1.5.1 installations. |
Below is the sql query to be run on Bahmni openmrs mysql database. |
UPDATE obs SET voided = 1 WHERE concept_id = 1607 AND obs_id IN (SELECT childCounts.obs_id FROM ( SELECT po.obs_id, COUNT(co.obs_id) AS count FROM obs AS po LEFT OUTER JOIN obs AS co ON co.obs_group_id = po.obs_id AND co.voided = 0 WHERE po.concept_id = 1607 AND po.voided = 0 GROUP BY po.obs_id ) AS childCounts WHERE childCounts.count = 0 ) |