The below query returns the form elements which have concepts with answers, but their data type is not Coded in "calcutta kids" organisation. One of the form elements the query returns 'Current medications' is used in "Calcutta Kids Registration Form". This was breaking the loading the form, which was fixed by making a fix in avni-server.
select * from form_element where concept_id in(select concept_id from concept_answer where concept_id in
(select id from concept where organisation_id=1 and data_type != 'Coded')) and organisation_id in (1, 19);
Acceptance criteria:
The data in the db(for all organisations where such inconsistency is present) should be moved to a consistent state. Either the data type should be changed to 'Coded' or the answers for such concepts should be removed, based on what is expected.
Also, needs to be identified how the data got corrupted.
Current status:
The below query returns the form elements which have concepts with answers, but their data type is not Coded in "calcutta kids" organisation. One of the form elements the query returns 'Current medications' is used in "Calcutta Kids Registration Form". This was breaking the loading the form, which was fixed by making a fix in avni-server.
Acceptance criteria: