Esempio n. 1
0
	def add_new_holder(self):

		msg = ["Gender(Male / Female): ",
		"Date of Birth (MM/DD/YYYY): ",
		"Social Security Number (XXX-XX-XXXX): ",
		"Smoking status (Y/N): ",
		"Allergies (please input one or more of the options below. Multiple option available with separator '/'.)\n\
		- Drug\n\
		- Food\n\
		- Insect\n\
		- Latex\n\
		- Mold\n\
		- Pet\n\
		- Pollen\n\
		- NA\n:",
		"Medical Conditions (ICD-10 Code). You can iput multiple codes with '/' as a separator.: "]

		try: 
			gender, DOB, SSN, is_smoker, allergies, med_conditions = [str(input(i)) for i in msg]

			holder = model.PolicyHolder(gender, DOB, SSN, is_smoker, allergies, med_conditions)
			self.holder_data = controller.add_new(self.Data, holder)
			self.Data = {"Policy_Holder_Data": self.holder_data, "Claim_Data": self.claim_data}
			PolicyHolderID = sha1(str(SSN).encode("UTF-8")).hexdigest()
			print("Policy holder has been added - Unique ID: {}".format(PolicyHolderID))

		except Exception as e:
			self.err_msg("Wrong Input, check error: " + str(e))


		self.holder_data["Age"] = self.holder_data["Date of Birth"].apply(controller.age_calc)
		controller.save_data(self.holder_data, "Policy_Holder_Data")
		controller.save_data(self.claim_data, "Claim_Data")
Esempio n. 2
0
	def add_new_claim(self):


		msg = ["Social Security Number (XXX-XX-XXXX): ",
		"Date of Incidence (MM/DD/YYYY): ",
		"Type of Issue (please input one or more of the options below. Multiple option available with separator '/'.)\n\
		\t- Hospital stays\n\
		\t- Prescription medications\n\
		\t- Surgeries\n\
		\t- Emergency medical care\n\
		\t- NA\n:",
		"Billed Amount: $", 
		"Covered Amount: $"]


		try:
			SSN, date_of_inc, claim_type, billed_amount, covered_amount = [str(input(i)) for i in msg]
			PolicyHolderID = sha1(str(SSN).encode("UTF-8")).hexdigest()
			billed_amount = billed_amount
			covered_amount = covered_amount
			claim = model.Claim(PolicyHolderID, date_of_inc, claim_type, billed_amount, covered_amount)
			self.claim_data = controller.add_new(self.Data, claim)
			self.Data = {"Policy_Holder_Data": self.holder_data, "Claim_Data": self.claim_data}
			print("Claim successfully added on Unique ID - {}".format(PolicyHolderID))			 

		except Exception as e:
			self.err_msg("Wrong Input, check error: " + str(e))

		self.holder_data["Age"] = self.holder_data["Date of Birth"].apply(controller.age_calc)
		controller.save_data(self.holder_data, "Policy_Holder_Data")
		controller.save_data(self.claim_data, "Claim_Data")
Esempio n. 3
0
def quit_edit():
    new_vehicle_license1 = add_new(new_vehicle_license.get(),
                                   new_vehicle_expiry.get())
    if new_vehicle_license1 is not None:
        messagebox.showinfo("Adding new vehicule", new_vehicle_license1)
Esempio n. 4
0
def quit_edit():
    new_vehicle_license1 = add_new(new_vehicle_license.get(),
                                   new_vehicle_expiry.get())
    if new_vehicle_license1 is not None:
        show_info(new_vehicle_license1)