Update Mechanisms, Drug Warning, and Drug Indication logic
We need to fix the way Mechanisms of Action, Drug Warnings, and Drug Indications are displayed. It has been decided to follow the same logic for the 3 of them. Group them by parent, and then parents displays all the records in the family, while salts display only the ones that belong to themselves. Additionally, the reference column (blue square in the image) should display them in a similar fashion to the sources section, where if the current report card belongs to the parent, it displays its own first, and then displays additional sources from alternate forms. Also the button "Browse All" needs to be updated using the same filter that will be used for the list (red square in the image).
Fields have been added to elastic search indexes for this purpose.
MECHANISMS: chembl_mechanism_by_parent_target --> chembl_29_mechanism_by_parent_target mechanism_of_action._metadata.all_molecule_chembl_ids <= if a chembl id is in this list this mechanism should appear on that compound report card mechanism_of_action.mechanism_refs_by_molecule <= this field store the refs separating them by molecule to which they belong WARNINGS: chembl_drug_warning_by_parent --> chembl_29_drug_warning_by_parent drug_warning._metadata.all_molecule_chembl_ids <= if a chembl id is in this list this warning should appear on that compound report card drug_warning.warning_refs_by_molecule <= this field store the refs separating them by molecule to which they belong INDICATIONS: chembl_drug_indication_by_parent --> chembl_29_drug_indication_by_parent drug_indication._metadata.all_molecule_chembl_ids <= if a chembl id is in this list this indication should appear on that compound report card drug_indication.indication_refs_by_molecule <= this field store the refs separating them by molecule to which they belong
The queries that should be used, both for displaying in the report card, and in the browse all button are:
MECHANISMS: mechanism_of_action._metadata.all_molecule_chembl_ids:<CURRENT_REPORT_CARD_CHEMBL_ID> WARNINGS: drug_warning._metadata.all_molecule_chembl_ids:<CURRENT_REPORT_CARD_CHEMBL_ID> INDICATIONS: drug_indication._metadata.all_molecule_chembl_ids:<CURRENT_REPORT_CARD_CHEMBL_ID>