예제 #1
0
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 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}')"
예제 #3
0
파일: models.py 프로젝트: vasusethia1/hms
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
예제 #4
0
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}')"
예제 #5
0
class MedicineIssuedToPatient(db.Model):
    patient_id = db.Column(db.Integer,
                           db.ForeignKey('patient.id'),
                           primary_key=True)
    medicine_id = db.Column(db.Integer,
                            db.ForeignKey('medicine.id'),
                            primary_key=True)
    quantity_issued = db.Column(db.Integer)
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}')"
예제 #7
0
파일: models.py 프로젝트: vasusethia1/hms
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
예제 #8
0
파일: models.py 프로젝트: vasusethia1/hms
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
예제 #9
0
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}')"
예제 #10
0
파일: models.py 프로젝트: vasusethia1/hms
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)
예제 #11
0
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 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 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}')"
예제 #14
0
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)
예제 #15
0
class DiagnosticIssuedToPatient(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    patient_id = db.Column(db.Integer, db.ForeignKey('patient.id'))
    test_id = db.Column(db.Integer, db.ForeignKey('diagnostic.id'))
예제 #16
0
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)
예제 #17
0
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)