Shahar was born and raised in Jerusalem, Israel. He studied for an M.D. degree at the Hebrew University, Jerusalem , while taking also courses in mathematics and computer science, and after an internship in the Soroka Medical Center, served as a physician in the Israeldefense forces Medical Corps. He was the head of the Medical Corps' Medical Informatics Section, and founded its Medical Informatics Branch. During that time, he pursued graduate studies in Mathematics and Computer Sciences at Bar-Ilan University . Shahar headed a 50-person team that, among other tasks, designed the Medical Corps' emergency-situations strategic decision-support system connecting 32 hospitals, and an early version of the IDF electronic medical record. Shahar was the recipient of the 1988 US-Israel Fulbright Fellowship in the Natural Sciences area. He then traveled to Yale University, New Haven, CT, US, joining the Computer Science department, which was chaired by Roger Schank, the head of Yale's Artificial Intelligence group, in which he had worked on mobile-robot planning with Drew McDermott and received an M.Sc. in Computer Science. Shahar then moved to Stanford University, CA, USA, where he obtained a Ph.D. in the Medical Information Sciences program, founded and led by Edward H. Shortliffe; his thesis advisor was , and his committee included also Barbara Hayes-Roth and Richard E. Fikes. Following a short post-doctoral period at Stanford, Shahar stayed there as a Senior Research Scientist, and then as an Assistant Professor of Medicine and as an Assistant Professor of Computer Science. After a decade at Stanford's BioMedical Informatics program, working mostly on temporal reasoning and planning in medical domains, Shahar has returned to Israel in 2000 and joined BGU, to found and head its Medical Informatics Research Center, and serve as the second chair of the newly founded Department of Information Systems Engineering, at BGU's Faculty of Engineering.
Shahar served as the Chair of the BGU Department of Information and Software Engineering, and as the Deputy Dean for . Since 2000, he is the head of the BGU Medical Informatics Research Center, which he had founded. In 2014, he was nominated as the J at Ben Gurion University. Since 1996, Shahar has served on the editorial boards of , , Methods of Information in Medicine, , and . He was the Scientific co-Chair of the internationalArtificial Intelligence in Medicine in 1999 and in 2009. Among multiple awards, Prof. Shahar was and an to explore the theoretical and practical implications of the temporal-reasoning methodology he had developed; , and in 2008 an HP Worldwide Innovation Program award. During 2004 to 2007, He was the of an IBM Shared University Research equipment, software, and technical support award for academic centers of excellence, in collaboration with Prof. Shimon Slavin of the Department of Bone-Marrow Transplantation, Hadassa Medical Center. In 2005, Prof. Shahar was elected as an International Fellow of the American College of Medical Informatics. In 2015, he was awarded a Special Merit Award from the Israeli Chamber of Information Systems Analysts, for overall unique contributions to the Medical Informatics Field in Israel. In 2017, Prof. Shahar was elected, through a worldwide voting process, as one of the 100 founding members of the InternationalAcademy of Health Sciences Informatics.