# Generated by Django 3.1.5 on 2021-02-24 09:13

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ICD10CMfinal',
            fields=[
                ('ICD9CM_code', models.CharField(db_column='ICD-9-CM代碼', max_length=255, verbose_name='ICD-9-CM代碼')),
                ('ICD9CM_English', models.CharField(db_column='ICD-9-CM英文名稱', max_length=255, verbose_name='ICD-9-CM英文名稱')),
                ('ICD9CM_Chinese', models.CharField(db_column='ICD-9-CM中文名稱', max_length=255, verbose_name='ICD-9-CM中文名稱')),
                ('ICD10CM', models.CharField(db_column='ICD10CM', max_length=8, primary_key=True, serialize=False, verbose_name='ICD-10-CM')),
                ('ICD10CM_English', models.CharField(db_column='ICD-10-CM英文名稱', max_length=255, verbose_name='ICD-10-CM英文名稱')),
                ('ICD10CM_Chinese', models.CharField(db_column='ICD-10-CM中文名稱', max_length=255, verbose_name='ICD-10-CM中文名稱')),
                ('Corresponding', models.CharField(db_column='對應情形', max_length=255, verbose_name='對應情形')),
            ],
            options={
                'db_table': 'ICD10CMfinal',
                'managed': False,
            },
        ),
        migrations.CreateModel(
            name='Activity',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='DiseaseStage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('stage', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='ElectronicMedicalReport',
            fields=[
                ('report_key', models.CharField(max_length=200, primary_key=True, serialize=False)),
                ('report_class', models.CharField(max_length=200)),
                ('check_date', models.DateField(null=True)),
                ('report_date', models.DateField(null=True)),
                ('report_code', models.CharField(max_length=200)),
                ('report', models.TextField(null=True)),
                ('saved', models.DateField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='ICD9Diag',
            fields=[
                ('code', models.CharField(max_length=5, primary_key=True, serialize=False)),
                ('desc', models.CharField(max_length=50)),
            ],
        ),
        migrations.CreateModel(
            name='Lesion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('dimensions', models.CharField(max_length=200)),
                ('volume', models.DecimalField(decimal_places=2, max_digits=9)),
                ('plan_name', models.CharField(blank=True, max_length=200, null=True)),
                ('collimator', models.CharField(max_length=200)),
                ('path_no', models.IntegerField()),
                ('beam_no', models.IntegerField()),
                ('mu_max', models.DecimalField(decimal_places=2, max_digits=9)),
                ('mu_min', models.DecimalField(decimal_places=2, max_digits=9)),
                ('dose', models.IntegerField()),
                ('fractions', models.IntegerField()),
                ('iso_dose_curve', models.IntegerField()),
                ('dmin', models.DecimalField(decimal_places=2, max_digits=9)),
                ('dmax', models.DecimalField(decimal_places=2, max_digits=9)),
                ('coverage', models.DecimalField(decimal_places=2, max_digits=9)),
                ('ci', models.DecimalField(decimal_places=2, max_digits=9)),
                ('nci', models.DecimalField(decimal_places=2, max_digits=9)),
                ('start_date', models.DateField(blank=True, null=True)),
                ('end_date', models.DateField(blank=True, null=True)),
                ('memo', models.CharField(blank=True, max_length=200, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='NHIOrder',
            fields=[
                ('id', models.CharField(max_length=20, primary_key=True, serialize=False)),
                ('ChartNo', models.CharField(max_length=10)),
                ('PatientName', models.CharField(max_length=10)),
                ('ApplyTypeDesc', models.CharField(max_length=10)),
                ('StatusDesc', models.CharField(max_length=10)),
                ('NhiDeptName', models.CharField(max_length=10)),
                ('PackageTime', models.CharField(max_length=10)),
                ('OrderCode', models.CharField(max_length=10)),
                ('OrderName', models.CharField(max_length=10)),
                ('ResultDesc', models.CharField(max_length=10)),
                ('Quantity', models.CharField(max_length=10)),
                ('ExamineQuantity', models.CharField(max_length=10)),
                ('ExamineDate', models.CharField(max_length=10)),
            ],
        ),
        migrations.CreateModel(
            name='Oncologist',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Pathology',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('pathology', models.CharField(max_length=200, unique=True)),
                ('stage', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.diseasestage')),
            ],
        ),
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200, verbose_name='姓名')),
                ('medical_records', models.CharField(max_length=200, unique=True)),
                ('gender', models.IntegerField(choices=[(1, 'Male'), (2, 'Female')])),
                ('birthday', models.DateField()),
                ('address', models.CharField(max_length=200)),
                ('phone', models.CharField(max_length=200)),
                ('id_cards', models.CharField(max_length=200, unique=True)),
                ('memo', models.CharField(blank=True, max_length=200, null=True)),
                ('dead', models.DateField(blank=True, null=True)),
                ('height', models.DecimalField(decimal_places=1, max_digits=4, null=True)),
                ('weight', models.DecimalField(decimal_places=3, max_digits=6, null=True)),
                ('native', models.CharField(blank=True, max_length=200, null=True)),
                ('past_and_family_history', models.TextField(blank=True, null=True)),
                ('timestamp', models.DateTimeField(auto_now=True)),
            ],
        ),
        migrations.CreateModel(
            name='Price',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('code', models.CharField(blank=True, max_length=200, null=True)),
                ('identity', models.IntegerField(choices=[(10, '健保'), (20, '自費'), (30, '內含')])),
                ('name', models.CharField(max_length=200)),
                ('unit', models.CharField(blank=True, max_length=200, null=True)),
                ('address', models.IntegerField(blank=True, null=True)),
            ],
            options={
                'ordering': ['code', 'identity', 'name'],
            },
        ),
        migrations.CreateModel(
            name='PrimaryTumorSite',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('site', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Surgeon',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='TargetLocation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('location', models.CharField(max_length=200)),
            ],
        ),
        migrations.CreateModel(
            name='Treatment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('bed', models.CharField(blank=True, max_length=200, null=True, verbose_name='病床號')),
                ('other_diagnosis', models.CharField(blank=True, max_length=200, null=True, verbose_name='其他診斷')),
                ('tracking_mode', models.IntegerField(blank=True, choices=[(100, '6D Skull'), (200, 'Xsight-Spine'), (210, 'Xsight-Lung'), (300, 'Fiducial'), (400, 'Synchrony')], null=True)),
                ('referral', models.CharField(blank=True, max_length=200, null=True, verbose_name='轉介醫師')),
                ('date_started', models.DateField(blank=True, null=True)),
                ('date_completed', models.DateField(blank=True, null=True)),
                ('accounting', models.IntegerField(blank=True, choices=[(10, '健保'), (20, '自費'), (30, '內含')], null=True, verbose_name='記帳別')),
                ('karnofsky_score', models.IntegerField(blank=True, choices=[(100, '100% - normal, no complaints, no signs of disease'), (90, ' 90% - capable of normal activity, few symptoms or signs of disease'), (80, ' 80% - normal activity with some difficulty, some symptoms or signs'), (70, ' 70% - caring for self, not capable of normal activity or work'), (60, ' 60% - requiring some help, can take care of most personal requirements'), (50, ' 50% - requires help often, requires frequent medical care'), (40, ' 40% - disabled, requires special care and help'), (30, ' 30% - severely disabled, hospital admission indicated but no risk of death'), (20, ' 20% - very ill, urgently requiring admission, requires supportive measures or treatment'), (10, ' 10% - moribund, rapidly progressive fatal disease processes'), (0, '  0% - death')], null=True)),
                ('complications', models.CharField(blank=True, max_length=200, null=True, verbose_name='併發症')),
                ('chief_complaint', models.TextField(blank=True, null=True)),
                ('memo', models.CharField(blank=True, max_length=200, null=True)),
                ('timestamp', models.DateTimeField(auto_now=True)),
                ('disease_stage', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ck.diseasestage')),
                ('icd10cm', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ck.icd10cmfinal', verbose_name='ICD-10-CM')),
                ('icd9', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ck.icd9diag', verbose_name='ICD9診斷')),
                ('input', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='input', to='ck.activity', verbose_name='已')),
                ('oncologist', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ck.oncologist')),
                ('output', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='output', to='ck.activity', verbose_name='待')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.patient')),
                ('primary_tumor_site', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ck.primarytumorsite')),
                ('surgeon', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ck.surgeon')),
            ],
        ),
        migrations.CreateModel(
            name='TreatmentResponse',
            fields=[
                ('treatment', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='ck.treatment')),
                ('time', models.DateField(null=True)),
                ('event', models.NullBooleanField()),
                ('time1y', models.DateField(null=True)),
                ('event1y', models.NullBooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='XrayTextReport',
            fields=[
                ('report_key', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='ck.electronicmedicalreport')),
                ('old_access_no', models.CharField(max_length=200, null=True)),
                ('ioe', models.CharField(max_length=200, null=True)),
                ('refer_dept', models.CharField(max_length=200, null=True)),
                ('status', models.CharField(max_length=200, null=True)),
                ('formal_version', models.CharField(max_length=200, null=True)),
                ('exam_date', models.DateField(null=True)),
                ('order_desc', models.CharField(max_length=200, null=True)),
                ('clean_html', models.TextField(null=True)),
                ('response', models.CharField(max_length=200, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='VEVENT',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('DTSTAMP', models.DateTimeField(auto_now=True)),
                ('DTSTART', models.DateTimeField()),
                ('DTEND', models.TimeField(blank=True)),
                ('DURATION', models.TimeField()),
                ('SUMMARY', models.CharField(blank=True, max_length=200, null=True)),
                ('CLASS', models.CharField(blank=True, max_length=200, null=True)),
                ('CATEGORIES', models.CharField(blank=True, max_length=200, null=True)),
                ('TRANSP', models.CharField(blank=True, max_length=200, null=True)),
                ('RRULE', models.CharField(blank=True, max_length=200, null=True)),
                ('DESCRIPTION', models.CharField(blank=True, max_length=200, null=True)),
                ('mode', models.IntegerField(choices=[(110, 'Fiducial'), (200, '固定器'), (210, 'CT'), (215, 'RT-CT'), (220, 'MRI'), (230, 'Angio'), (300, '預排'), (310, '治療')])),
                ('mode_remark', models.CharField(blank=True, max_length=200, null=True)),
                ('break_frequency', models.IntegerField(blank=True)),
                ('system_err', models.IntegerField(blank=True)),
                ('shift', models.IntegerField(blank=True)),
                ('cone', models.IntegerField(blank=True)),
                ('path', models.IntegerField(blank=True)),
                ('price', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='ck.price')),
                ('treatment', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.treatment')),
            ],
        ),
        migrations.CreateModel(
            name='SubLocation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('group', models.IntegerField()),
                ('sub_location', models.CharField(max_length=200)),
                ('pathology', models.ManyToManyField(to='ck.Pathology')),
                ('target_location', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.targetlocation')),
            ],
        ),
        migrations.CreateModel(
            name='PriorTreatment',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('treatment', models.IntegerField(choices=[(1, 'Surgery'), (2, 'Biopsy'), (3, 'RT'), (4, 'Radiosurgery'), (5, 'Chemotherapy')])),
                ('period', models.IntegerField(blank=True, choices=[(1, 'Before'), (2, 'Concurrent'), (3, 'None')], null=True)),
                ('dose', models.IntegerField(blank=True, null=True)),
                ('memo', models.CharField(blank=True, max_length=200, null=True)),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.patient')),
            ],
        ),
        migrations.CreateModel(
            name='PatientMedicalRecord',
            fields=[
                ('key_code', models.CharField(max_length=200, primary_key=True, serialize=False)),
                ('key_name', models.CharField(max_length=200)),
                ('hosp_name', models.CharField(max_length=200, null=True)),
                ('dept_name', models.CharField(max_length=200, null=True, verbose_name='科')),
                ('in_date', models.DateField(null=True, verbose_name='入')),
                ('out_date', models.DateField(null=True, verbose_name='出')),
                ('ward_name', models.CharField(max_length=200, null=True, verbose_name='房')),
                ('room_name', models.CharField(max_length=200, null=True, verbose_name='室')),
                ('bed_name', models.CharField(max_length=200, null=True, verbose_name='床')),
                ('come_clinic_date', models.DateField(null=True, verbose_name='掛號日')),
                ('discharge_date', models.DateField(null=True, verbose_name='離部日')),
                ('special_cure_name', models.CharField(max_length=200, null=True, verbose_name='行為')),
                ('main_dr_name', models.CharField(max_length=200, null=True, verbose_name='主治')),
                ('main_diagnosis_name', models.CharField(max_length=200, null=True, verbose_name='診斷')),
                ('status_name', models.CharField(max_length=200, null=True, verbose_name='狀態')),
                ('temp_bed_id', models.CharField(max_length=200, null=True, verbose_name='床')),
                ('account_status_name', models.CharField(max_length=200, null=True, verbose_name='狀態')),
                ('func', models.CharField(max_length=200, null=True)),
                ('doc', models.TextField(null=True, verbose_name='摘')),
                ('saved', models.DateField(auto_now=True)),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.patient')),
            ],
        ),
        migrations.CreateModel(
            name='PathExam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('path_code', models.CharField(max_length=200, unique=True, verbose_name='病理號')),
                ('specimen_code', models.CharField(max_length=200, verbose_name='檢體')),
                ('specimen_get_date', models.DateField(verbose_name='收件日')),
                ('report_date', models.DateField(verbose_name='報告日')),
                ('division', models.CharField(max_length=200, verbose_name='科別')),
                ('bed', models.CharField(blank=True, max_length=200, null=True, verbose_name='病床')),
                ('report', models.TextField(blank=True, null=True, verbose_name='檢查報告')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.patient')),
            ],
        ),
        migrations.CreateModel(
            name='PACSImage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('PatChartNo', models.CharField(max_length=200, verbose_name='病歷號')),
                ('RequestSheetNo', models.CharField(max_length=200, verbose_name='單號')),
                ('ExamDate', models.DateField(verbose_name='檢查日')),
                ('LinkOrderName', models.CharField(max_length=200, verbose_name='檢查名稱')),
                ('Modality', models.CharField(max_length=200, verbose_name='儀器')),
                ('VerifiedStateString', models.CharField(max_length=200, verbose_name='狀態')),
                ('Exam', models.TextField(null=True, verbose_name='報告內容')),
                ('Impression', models.TextField(null=True)),
                ('Report', models.TextField(null=True, verbose_name='報告')),
                ('Saved', models.IntegerField(choices=[(0, '待處理'), (10, '有輸入'), (15, '已確認'), (20, '不適用')], verbose_name='保存')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.patient')),
            ],
        ),
        migrations.CreateModel(
            name='OPNote',
            fields=[
                ('key_code', models.CharField(max_length=200, primary_key=True, serialize=False)),
                ('key_name', models.CharField(max_length=200)),
                ('doc', models.TextField(null=True, verbose_name='摘')),
                ('saved', models.DateField(auto_now=True)),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.patient')),
            ],
        ),
        migrations.CreateModel(
            name='MedicalRecord',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Record', models.CharField(max_length=200, null=True)),
                ('HospName', models.CharField(max_length=200, null=True)),
                ('DeptName', models.CharField(max_length=200, null=True, verbose_name='科')),
                ('InDate', models.DateField(verbose_name='入')),
                ('OutDate', models.DateField(null=True, verbose_name='出')),
                ('WardName', models.CharField(max_length=200, null=True, verbose_name='房')),
                ('RoomName', models.CharField(max_length=200, null=True, verbose_name='室')),
                ('BedName', models.CharField(max_length=200, null=True, verbose_name='床')),
                ('MainDrName', models.CharField(max_length=200, null=True, verbose_name='主治')),
                ('MainDiagnosisName', models.CharField(max_length=200, null=True, verbose_name='診斷')),
                ('StatusName', models.CharField(max_length=200, null=True, verbose_name='狀態')),
                ('SpecialCureName', models.CharField(max_length=200, null=True, verbose_name='行為')),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.patient')),
            ],
        ),
        migrations.CreateModel(
            name='LesionFollow',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Date', models.DateField(verbose_name='追蹤日期')),
                ('Volume', models.FloatField(null=True, verbose_name='體積(mm3)')),
                ('A', models.FloatField(null=True, verbose_name='長(mm)')),
                ('B', models.FloatField(null=True, verbose_name='寬(mm)')),
                ('C', models.FloatField(null=True, verbose_name='高(mm)')),
                ('Memo', models.CharField(blank=True, max_length=200, null=True)),
                ('Lesion', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.lesion')),
            ],
        ),
        migrations.AddField(
            model_name='lesion',
            name='pathology',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.pathology'),
        ),
        migrations.AddField(
            model_name='lesion',
            name='sub_location',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.sublocation'),
        ),
        migrations.AddField(
            model_name='lesion',
            name='treatment',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.treatment'),
        ),
        migrations.CreateModel(
            name='Followup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateField()),
                ('memo', models.CharField(blank=True, max_length=200, null=True)),
                ('patient', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.patient')),
            ],
        ),
        migrations.AddField(
            model_name='electronicmedicalreport',
            name='patient',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ck.patient'),
        ),
    ]
