class User(db.Model): username = db.Column(db.String(20), primary_key=True) password = db.Column(db.String(50), nullable=False) role = db.Column(db.String(10), nullable=False) def __repr__(self): return f"User('{self.username}', '{self.password}', '{self.role}')"
class userstore(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(20), nullable=False, unique=True) password = db.Column(db.String(40), nullable=False) def __repr__(): Message = self.id + " " + self.username return Message
class Patient(db.Model): id = db.Column(db.Integer, primary_key=True) pname = db.Column(db.String(30), nullable=False) pdob = db.Column(db.DateTime, nullable=False) page = db.Column(db.Integer, nullable=False) ptob = db.Column(db.String(20), nullable=False) padd = db.Column(db.String(20), nullable=False) pcity = db.Column(db.String(20), nullable=False) pstate = db.Column(db.String(20), nullable=False)
class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(20), unique=True, nullable=False) email = db.Column(db.String(120), unique=True, nullable=False) image_file = db.Column(db.String(32), nullable=False, default='default.jpg') password = db.Column(db.String(60), nullable=False) posts = db.relationship('Post', backref='author', lazy=True) def __repr__(self): Message = self.username + " " + self.email + " " + self.image_file return Message
class Diagnostic(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(20), unique=True, nullable=False) charge = db.Column(db.Integer(), nullable=False) def __repr__(self): return f"Test('{self.name}')"
class Patient(db.Model): id = db.Column(db.Integer, primary_key=True) ssn = db.Column(db.Integer, unique=True, nullable=False) name = db.Column(db.String(20), nullable=False) age = db.Column(db.Integer, nullable=False) date_of_joining = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) room_type = db.Column(db.String(10), nullable=False) address = db.Column(db.Text, nullable=False) state = db.Column(db.String(20), nullable=False) city = db.Column(db.String(20), nullable=False) status = db.Column(db.String(20), nullable=False, default='Active') def __repr__(self): return f"Patient('{self.name}')"
class Medicine(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(20), unique=True, nullable=False) quantity_available = db.Column(db.Integer, nullable=False) rate = db.Column(db.Integer, nullable=False) def __repr__(self): return f"Medicine('{self.name}')"
class Patient(db.Model): id = db.Column(db.Integer, primary_key=True) ssn = db.Column(db.Integer, unique=True, nullable=False) name = db.Column(db.String(20), nullable=False) age = db.Column(db.Integer, nullable=False) date_of_joining = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) room_type = db.Column(db.String(10), nullable=False) address = db.Column(db.Text, nullable=False) state = db.Column(db.String(20), nullable=False) city = db.Column(db.String(20), nullable=False) status = db.Column(db.String(20), nullable=False, default='Active') # medicines = db.relationship(MedicineIssuedToPatient, backref=db.backref('patients')) # diagnostics = db.relationship(DiagnosticIssuedToPatient, backref=db.backref('patients')) def __repr__(self): return f"User('{self.name}')"
class Diagnostics(db.Model): diagnostics_id = db.Column(db.Integer, primary_key=True) diagnostics_name = db.Column(db.String(20), nullable=False) diagnostics_amount = db.Column(db.Float, nullable=False) patient_id = db.Column(db.Integer, db.ForeignKey('patient.patient_id'), nullable=False) def __repr__(self): return f"Diagnostics('{self.diagnostics_name}', '{self.diagnostics_amount}, '{self.patient_id}')"
class Medicine(db.Model): medicine_id = db.Column(db.Integer, primary_key=True) medicine_name = db.Column(db.String(20), nullable=False) medicine_quantity = db.Column(db.Integer, nullable=False) medicine_rate = db.Column(db.Float, nullable=False) medicine_amount = db.Column(db.Float, nullable=False) patient_id = db.Column(db.Integer, db.ForeignKey('patient.patient_id'), nullable=False) def __repr__(self): return f"Medicine('{self.medicine_name}', '{self.medicine_quantity}', '{self.medicine_amount}, '{self.patient_id}')"
class Post(db.Model): id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String(100), nullable=False) data_posted = db.Column(db.DateTime, nullable=False, default=datetime.utcnow) content = db.Column(db.Text, nullable=False) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) def __repr__(self): Message = self.title + " " + self.data_posted return Message
class Patient(db.Model): ssn = db.Column(db.Integer, nullable=False) patient_id = db.Column(db.Integer, primary_key=True) patient_name = db.Column(db.String(20), nullable=False) patient_address = db.Column(db.String(100), nullable=False) patient_age = db.Column(db.Integer, nullable=False) patient_DOJ = db.Column(db.Date, nullable=False) patient_DOD = db.Column(db.Date, nullable=True) patient_room_type = db.Column(db.String(10), nullable=False) patient_state = db.Column(db.String(20), nullable=False) patient_city = db.Column(db.String(20), nullable=False) patient_status = db.Column(db.String(10), nullable=False) medicines = db.relationship('Medicine', backref='patient', lazy=True) diagnostics = db.relationship('Diagnostics', backref='patient', lazy=True) def __repr__(self): return f"User('{self.patient_name}', '{self.patient_age}', '{self.patient_room_type}, '{self.patient_status}')"
class Diagnostic(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(20), unique=True, nullable=False) charge = db.Column(db.Integer(), nullable=False)
class Medicine(db.Model): id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String(20), unique=True, nullable=False) quantity_available = db.Column(db.Integer, nullable=False) rate = db.Column(db.Integer, nullable=False)
class UserStore(db.Model, UserMixin): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(20), nullable=False) password = db.Column(db.String(60), nullable=False)