<commit_before>from __future__ import unicode_literals

from django.db import models

# Create your models here.<commit_msg>model prototype<commit_after>from __future__ import unicode_literals

from django.db import models


class Patient(models.Model):
    # basic
    name = models.CharField(max_length=256)
    age = models.PositiveSmallIntegerField()
    gender = models.CharField(max_length=1)
    phone = models.CharField(max_length=32)

    # relation
    prescription = models.ManyToManyField(Prescription)


class Doctor(models.Model):
    # basic
    name = models.CharField(max_length=256)
    age = models.PositiveSmallIntegerField()
    gender = models.CharField(max_length=1)
    phone = models.CharField(max_length=32)
    specialty = models.CharField(max_length=1024)

    # relation
    prescription = models.ManyToManyField(Prescription)


class Prescription(models.Model):
    # basic
    content = models.CharField(max_length=32768)
    date = models.DateTimeField()

    # relation
    doctor = models.ForeignKey(Doctor)
    patient = models.ForeignKey(Patient)
    symptoms = models.ManyToManyField(Symptom)
    diseases = models.ManyToManyField(Disease)
    medicine = models.ManyToManyField(Medicine)


class Symptom(models.Model):
    # basic
    name = models.CharField(256)
    category = models.CharField(256)
    description = models.CharField(32768)

    # relation
    diseases = models.ManyToManyField(Disease)
    medicine = models.ManyToManyField(Medicine)

    # extra
    causes = models.CharField(32768)


class Disease(models.Model):
    # basic
    name = models.CharField(256)
    category = models.CharField(256)
    description = models.CharField(32768)

    # relation
    symptoms = models.ManyToManyField(Symptom)
    medicine = models.ManyToManyField(Medicine)

    # extra
    causes = models.CharField(max_length=32768)
    management = models.CharField(max_length=32768)
    prevention = models.CharField(max_length=32768)
    mechanism = models.CharField(max_length=32768)
    epidemiology = models.CharField(max_length=32768)
    diagnosis = models.CharField(max_length=32768)
    prognosis = models.CharField(max_length=32768)


class Medicine(models.Model):
    # basic
    name = models.CharField(256)
    category = models.CharField(256)
    description = models.CharField(32768)

    # relation
    diseases = models.ManyToManyField(Disease)
    symptoms = models.ManyToManyField(Symptom)
    incompatible_with = models.ManyToManyField("self")

    # extra
    property = models.CharField(max_length=32768)
    adverse_effect = models.CharField(max_length=32768)
    mechanism = models.CharField(max_length=32768)
    pharmacokinetics = models.CharField(max_length=32768)
{'fraction_non_alphanumeric': 0.09314264759809314, 'fraction_numerical': 0.041804180418041806, 'mean_word_length': 4.206106870229007, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3923467', 'n_tokens_mistral': 923, 'n_tokens_neox': 846, 'n_words': 139}