def __init__(self, db: firestore): super().__init__(db=db, collection=u'prescriptions') self.date = get_fake_datetime() self.description = fake.paragraph() colDoc = get_collection(db, "employees") arr = get_by_condition(colDoc, "employees", "role", "doctor") doctor = choice(arr) self.doctor = doctor colPat = get_collection(db, "patients") patient = choice(colPat) self.patient = patient medList = [] self.med_objs = [] colMed = get_collection(db, "medicines") self.med_objs = sample(colMed, k=randint(1, 3)) for obj in self.med_objs: med = get_dict_by_ref("medicines", obj) obj = { 'name': med['name'], 'price': med['price'], 'quantity': med['quantity'], } medList.append(obj) self.medList = medList self.bills = []
def __init__(self, db): super().__init__(db=db, collection=u'medicines') self.expDate = get_fake_datetime(datetime.now(), datetime.now() + timedelta(days=120)) self.sold = False self.name = choice(medNamed) self.price = medPrice[self.name] self.quantity = str(randint(10, 100)) + ' ' + choice(['ml', 'unit(s)'])
def __init__(self, db: firestore): super().__init__(db=db, collection=u'room_assignment') self.dateAddmitted = get_fake_datetime() self.dateDischarged = self.dateAddmitted + timedelta( days=randint(1, 5)) colPat = get_collection(db, "patients") patient = choice(colPat) self.patient = patient colRoom = get_collection(db, "rooms") room = choice(colRoom) self.room = room
def __init__(self, db): super().__init__(db=db, collection=u'records') colPat = get_collection(db, "patients") patient = choice(colPat) self.patient = patient colDoc = get_collection(db, "employees") arr = get_by_condition(colDoc, "employees", "role", "doctor") doctor = choice(arr) self.doctor = doctor self.description = fake.paragraph() self.date = get_fake_datetime() self.status = choice(statusSlots) self.timeSlot = choice(timeSlots)
def __init__(self, db): super().__init__(db=db, collection=u'patients') profile = fake.simple_profile() self.name = profile['name'] self.contactNumber = fake.phone_number() self.email = profile['mail'] self.gender = profile['sex'] self.address = profile['address'] history = [] for i in range(randint(0, 5)): row = { 'date': get_fake_datetime(), 'note': fake.paragraph(), 'prescription': None, } history.append(row) self.medHistory = history
def __init__(self, db: firestore, med_refs=None, buyer_ref=None): super().__init__(db=db, collection=u'bills') self.date = get_fake_datetime() if buyer_ref is None: colPat = get_collection(db, "patients") patient = choice(colPat) self.buyer = patient else: self.buyer = buyer_ref if med_refs is None: colRoom = get_collection(db, "medicines") meds = [] for i in range(0, randint(1, 3)): meds.append(choice(colRoom)) self.medList = meds else: self.medList = med_refs
def __init__(self, db: firestore): super().__init__(db=db, collection=u'chats') col = get_collection(db, "patients") patient = choice(col) self.patient = patient col = get_collection(db, "employees") arr = get_by_condition(col, "employees", "role", "doctor") doctor = choice(arr) self.doctor = doctor msg = [] for i in range(1, randint(1, 15)): obj = { 'data': get_fake_datetime(), 'tex t': fake.paragraph(), 'sender': choice(["doctor", "patient"]), } msg.append(obj) self.messages = msg
def __init__(self, db: firestore): super().__init__(db=db, collection=u'reports') self.date = get_fake_datetime() self.testResult = choice(["Positive: \n", "Negative: \n" ]) + fake.paragraph() self.testType = choice(testTypes) colLab = get_collection(db, "employees") arr = get_by_condition(colLab, "employees", "role", "laboratorist") lab = choice(arr) self.laboratorist = lab colPat = get_collection(db, "patients") patient = choice(colPat) self.patient = patient colNur = get_collection(db, "employees") arr = get_by_condition(colNur, "employees", "role", "nurse") nurse = choice(arr) self.nurse = nurse