コード例 #1
0
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}')"
コード例 #2
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
コード例 #3
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)
コード例 #4
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
コード例 #5
0
ファイル: models.py プロジェクト: nikhilarora068/hms
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}')"
コード例 #6
0
ファイル: models.py プロジェクト: nikhilarora068/hms
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}')"
コード例 #7
0
ファイル: models.py プロジェクト: nikhilarora068/hms
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}')"
コード例 #8
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}')"
コード例 #9
0
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}')"
コード例 #10
0
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}')"
コード例 #11
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
コード例 #12
0
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}')"
コード例 #13
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)
コード例 #14
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)
コード例 #15
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)