We reserve use of native javascript constructs like input, confirm and alert to development mode. But if you must, you do have option of using ajax or passing the object.
A bigger concern while looking at the patch is you are deleting the Rx record. Considering prescriptions have external aspect (either print or transmission), I would strongly encourage use of delete flag rather than actual deletion. A related benefit of that mechanism is we skip the prompt altogether and replace e.g. fa-trash by fa-undo on the screen. Now user has an option to undo their action in case of a mistake as long as the screen does not transition. Once the screen is changed/refreshed, undo action will not be possible.