Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. javascript:(function() { pharmacyInfo = JSON.parse(document.getElementById("Calcs")[0].value); pharmacyName = pharmacyInfo["name"]; pharmacyAddress = pharmacyInfo["address"]; pharmacyCity = pharmacyInfo["city"]; pharmacyProvince = pharmacyInfo["province"].slice(-2); pharmacyWebsite = pharmacyInfo["notes"]; if (pharmacyName == "" || pharmacyAddress == "" || pharmacyCity == "" || pharmacyProvince == "OT" || pharmacyWebsite == "") { alert("Watch out, one of the pharmacy fields isn't set!") } name = document.getElementById("main-table").rows[0].innerText; name = name.substring(name.lastIndexOf("NAME:") + 6, name.lastIndexOf("AGE")).split(" ")[0]; firstName = name.charAt(0).toUpperCase() + name.slice(1).toLowerCase(); providerName = "Anra Clark, NP"; introMessage = "Hi " + firstName + ",\n\n" + providerName + " reviewed and approved your prescription refill. The prescription has been faxed to the " + pharmacyName + " near you at " + pharmacyAddress + ", " + pharmacyCity + ", " + pharmacyProvince + ". You can pick it up at any time.\n\nMore info on the pharmacy can be found here: " + pharmacyWebsite + "\n\n"; drugsDict = { "02238213": "finasteride 1mg (90 day supply)", "02447541": "finasteride 5mg (1/4 tab a day - 90 day supply)", "02010909": "finasteride 5mg (1/4 tab a day - 90 day supply)", "02247813": "dutasteride 0.5mg (90 day supply)", "02421712": "dutasteride 0.5mg (90 day supply)" }; prescriptionMessage = "The prescription is for "; rogainePrescribed = false; rows = document.getElementsByClassName("data-drug-table")[0].rows; mostRecentDate = rows[1].cells[0].textContent; for (var i = 1, row; row = rows[i]; i++) { datePrescribed = rows[i].cells[0].textContent; if (mostRecentDate === datePrescribed) { drugCode = rows[i].cells[5].textContent; if (drugCode != "null") { prescriptionMessage += drugsDict[drugCode]; } } } prescriptionMessage += ".\n\n"; endOfMessage = "If you have any questions regarding your treatment or want to make any changes to your prescription, just let us know anytime.\n\n\--\nBest Regards,\nEssential Clinic\n1-833-668-3763\n"; email = introMessage + prescriptionMessage + endOfMessage; var dummy = document.createElement("textarea"); document.body.appendChild(dummy); dummy.value = email; dummy.select(); document.execCommand("copy"); document.body.removeChild(dummy); function getProviderName() { var provider; var input = prompt("1 for Umer\n2 for Anra\n3 for Rahul",""); if (input == null || input == "") { return getProviderName() } else if (input == 1) { provider = "Dr. Omer Chaudhary"; } else if (input == 2) { provider = "Anra Clark, NP"; } else if (input == 3) { provider = "Rahul Sukumariamma, NP" } return provider; } })()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement