Set default item row on Sales Invoice Item

Hi everyone! I’m trying to set a default value on the Sales Invoice Item child table when the patient field change. I wrote the following script:

frappe.ui.form.on("Sales Invoice", "patient", function(frm) {
frappe.ui.form.on('Sales Invoice Item', {
    function(frm) {
	    item_name(frm, cdt, cdn); {
	        let row = frm.add_child('item', {
	        item_name: '400',
	        qty: 1
    }); 
	}
    }
});

});

Can someone please help me to learn what should I change for this to work? Thanks!