Exercise 10-6 Patient Charges
class Patient:
def __init__(self, first, middle, last, address, city,
state, zip_code, phone, em_contact, em_phone):
self.__first = first
self.__middle = middle
self.__last = last
self.__address = address
self.__city = city
self.__state = state
self.__zip_code = zip_code
self.__phone = phone
self.__em_contact = em_contact
self.__em_phone = em_phone
def set_first(self, first):
self.__first = first
def set_middle(self, middle):
self.__middle = middle
def set_last(self, last):
self.__last = last
def set_address(self, address):
self.__address = address
def set_city(self, city):
self.__city = city
def set_state(self, state):
self.__state = state
def set_zip_code(self, zip_code):
self.__zip_code = zip_code
def set_phone(self, phone):
self.__phone = phone
def set_em_contact(self, em_contact):
self.__em_contact = em_contact
def set_em_phone(self, em_phone):
self.__em_phone = em_phone
def get_first(self):
return self.__first
def get_middle(self):
return self.__middle
def get_last(self):
return self.__last
def get_address(self):
return self.__address
def get_city(self):
return self.__city
def get_state(self):
return self.__state
def get_zip_code(self):
return self.__zip_code
def get_phone(self):
return self.__phone
def get_em_contact(self):
return self.__em_contact
def get_em_phone(self):
return self.__em_phone
def __str__(self):
return ‘First Name: ‘ + self.__first + ‘\nMiddle Name: ‘ + self.__middle + \
‘\nLast Name: ‘ + self.__last + ‘\nAddress: ‘ + self.__address + \
‘\nCity: ‘ + self.__city + ‘\nState: ‘ + self.__state + \
‘\nZIP: ‘ + self.__zip_code + ‘\nPhone: ‘ + self.__phone + \
‘\nEmergency Contact: ‘ + self.__em_contact + \
‘\nEmergency Phone: ‘ + self.__em_phone + ‘\n’
class Procedure:
def __init__(self, name, date, practitioner, charge):
self.__name = name
self.__date = date
self.__practitioner = practitioner
self.__charge = charge
def set_name(self, name):
self.__name = name
def set_date(self, date):
self.__date = date
def set_practitioner(self, practitioner):
self.__practitioner = practitioner
def set_charge(self, charge):
self.__charge = charge
def get_name(self):
return self.__name
def get_date(self):
return self.__date
def get_practitioner(self):
return self.__practitioner
def get_charge(self):
return self.__charge
def __str__(self):
return ‘Procedure: ‘ + self.__name + ‘\nDate: ‘ + self.__date + \
‘\nPractitioner: ‘ + self.__practitioner + ‘\nCharge: ‘ + \
format(self.__charge, ‘,.2f’) + ‘\n’
import procedure
import patient
def main():
procedure_1 = procedure.Procedure(‘Physical Exam’, ‘8-24-2019’,
‘Dr. Irvine’, 250.0)
procedure_2 = procedure.Procedure(‘X-ray’, ‘8-24-2019’,
‘Dr. Jamison’, 500.0)
procedure_3 = procedure.Procedure(‘Blood Test’, ‘8-24-2019’,
‘Dr. Smith’, 200.0)
pat = patient.Patient(‘James’, ‘Edward’, ‘Jones’, ‘123 Main Street’,
‘Billings’, ‘Montana’, ‘59000’, ‘406-555-1212’,
‘Jenny Jones’, ‘406-555-1213’)
print(pat)
print(procedure_1)
print(procedure_2)
print(procedure_3)
main()