Adding filter from backend

How to add a filter for Drug Code in Medication Table inside Patient encounter doctype ? I would like filter Drugs as Item Group wise. Is it possible ??

follow this comment

@OmarJaber Thanks for the reply. But iā€™m not able to see drug_description.js inside drug_description folder. Should i create one corresponding .js file in this folder ??
Please guide me on this as I am a newbie to this erpnext code stuff and all.

No, you can write this code inside parent doctype
write your code in Patient Encounter doctype files

1 Like

Thanks for the reply. I fixed it, wrote this code inside patient_encounter.js file:

frm.set_query("drug_code", "drug_prescription", function() {
			return {
				filters: {
					//is_stock_item:'0'
					item_group:'Services'
				}
			};
		});