Compare commits
2 commits
54608f4523
...
3276552ca4
Author | SHA1 | Date | |
---|---|---|---|
3276552ca4 | |||
7208d5e4be |
635 changed files with 83887 additions and 0 deletions
113
.gitignore
vendored
Normal file
113
.gitignore
vendored
Normal file
|
@ -0,0 +1,113 @@
|
|||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
|
||||
# C extensions
|
||||
*.so
|
||||
|
||||
# Distribution / packaging
|
||||
.Python
|
||||
build/
|
||||
develop-eggs/
|
||||
dist/
|
||||
downloads/
|
||||
eggs/
|
||||
.eggs/
|
||||
lib/
|
||||
lib64/
|
||||
parts/
|
||||
sdist/
|
||||
var/
|
||||
wheels/
|
||||
*.egg-info/
|
||||
.installed.cfg
|
||||
*.egg
|
||||
MANIFEST
|
||||
|
||||
# PyInstaller
|
||||
# Usually these files are written by a python script from a template
|
||||
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
||||
*.manifest
|
||||
*.spec
|
||||
|
||||
# Installer logs
|
||||
pip-log.txt
|
||||
pip-delete-this-directory.txt
|
||||
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage.*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
*.cover
|
||||
.hypothesis/
|
||||
|
||||
# Translations
|
||||
*.mo
|
||||
*.pot
|
||||
|
||||
# Django stuff:
|
||||
*.log
|
||||
.static_storage/
|
||||
.media/
|
||||
local_settings.py
|
||||
|
||||
# Flask stuff:
|
||||
instance/
|
||||
.webassets-cache
|
||||
|
||||
# Scrapy stuff:
|
||||
.scrapy
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
|
||||
# PyBuilder
|
||||
target/
|
||||
|
||||
# Jupyter Notebook
|
||||
.ipynb_checkpoints
|
||||
|
||||
# pyenv
|
||||
.python-version
|
||||
|
||||
# celery beat schedule file
|
||||
celerybeat-schedule
|
||||
|
||||
# SageMath parsed files
|
||||
*.sage.py
|
||||
|
||||
# Environments
|
||||
.env
|
||||
.venv
|
||||
env/
|
||||
venv/
|
||||
ENV/
|
||||
env.bak/
|
||||
venv.bak/
|
||||
|
||||
# Spyder project settings
|
||||
.spyderproject
|
||||
.spyproject
|
||||
|
||||
# Rope project settings
|
||||
.ropeproject
|
||||
|
||||
# mkdocs documentation
|
||||
/site
|
||||
|
||||
# mypy
|
||||
.mypy_cache/
|
||||
|
||||
.vscode
|
||||
components
|
||||
|
||||
*.pdf
|
||||
*.sql
|
||||
*.xls
|
||||
*.xlsx
|
||||
|
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
[submodule "mysite/submodule/ck-ntuh-net"]
|
||||
path = mysite/submodule/ck-ntuh-net
|
||||
url = ssh://git@forgejo.mdi.bar:2401/xfr/ck-ntuh-net.git
|
||||
[submodule "mysite/submodule/ntuhgov"]
|
||||
path = mysite/submodule/ntuhgov
|
||||
url = ssh://git@forgejo.mdi.bar:2401/xfr/ntuhgov.git
|
2
README
Executable file
2
README
Executable file
|
@ -0,0 +1,2 @@
|
|||
this is a test
|
||||
this is also a test
|
1
awstats/awstats012010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats012010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats012010.ck.ntuh.net.txt
|
1
awstats/awstats012011.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats012011.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats012011.ck.ntuh.net.txt
|
1
awstats/awstats022010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats022010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats022010.ck.ntuh.net.txt
|
1
awstats/awstats022011.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats022011.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats022011.ck.ntuh.net.txt
|
1
awstats/awstats032010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats032010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats032010.ck.ntuh.net.txt
|
1
awstats/awstats032011.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats032011.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats032011.ck.ntuh.net.txt
|
1
awstats/awstats042009.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats042009.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats042009.ck.ntuh.net.txt
|
1
awstats/awstats042010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats042010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats042010.ck.ntuh.net.txt
|
1
awstats/awstats042011.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats042011.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats042011.ck.ntuh.net.txt
|
1
awstats/awstats052009.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats052009.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats052009.ck.ntuh.net.txt
|
1
awstats/awstats052010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats052010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats052010.ck.ntuh.net.txt
|
1
awstats/awstats062010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats062010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats062010.ck.ntuh.net.txt
|
1
awstats/awstats072009.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats072009.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats072009.ck.ntuh.net.txt
|
1
awstats/awstats072010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats072010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats072010.ck.ntuh.net.txt
|
1
awstats/awstats082009.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats082009.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats082009.ck.ntuh.net.txt
|
1
awstats/awstats082010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats082010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats082010.ck.ntuh.net.txt
|
1
awstats/awstats092009.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats092009.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats092009.ck.ntuh.net.txt
|
1
awstats/awstats092010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats092010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats092010.ck.ntuh.net.txt
|
1
awstats/awstats102009.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats102009.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats102009.ck.ntuh.net.txt
|
1
awstats/awstats102010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats102010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats102010.ck.ntuh.net.txt
|
1
awstats/awstats112009.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats112009.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats112009.ck.ntuh.net.txt
|
1
awstats/awstats112010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats112010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats112010.ck.ntuh.net.txt
|
1
awstats/awstats122009.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats122009.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats122009.ck.ntuh.net.txt
|
1
awstats/awstats122010.www.ck.ntuh.net.txt
Symbolic link
1
awstats/awstats122010.www.ck.ntuh.net.txt
Symbolic link
|
@ -0,0 +1 @@
|
|||
awstats122010.ck.ntuh.net.txt
|
10750
cgi-bin/awstats.pl
Executable file
10750
cgi-bin/awstats.pl
Executable file
File diff suppressed because it is too large
Load diff
1
cgi-bin/lang
Symbolic link
1
cgi-bin/lang
Symbolic link
|
@ -0,0 +1 @@
|
|||
/usr/share/awstats/lang
|
1
cgi-bin/lib
Symbolic link
1
cgi-bin/lib
Symbolic link
|
@ -0,0 +1 @@
|
|||
/usr/share/awstats/lib
|
1
cgi-bin/plugins
Symbolic link
1
cgi-bin/plugins
Symbolic link
|
@ -0,0 +1 @@
|
|||
/usr/share/awstats/plugins
|
107
check_file.py
Executable file
107
check_file.py
Executable file
|
@ -0,0 +1,107 @@
|
|||
import fnmatch
|
||||
import glob
|
||||
import os
|
||||
import struct
|
||||
|
||||
MAX = 100
|
||||
|
||||
|
||||
def isDCM(filename):
|
||||
with open(filename, 'rb') as infile:
|
||||
header = infile.read(132)
|
||||
if ord(header[0]) == 8:
|
||||
return True
|
||||
if header[-4:] == 'DICM':
|
||||
return True
|
||||
print ":".join("{:02x}".format(ord(c)) for c in header), filename
|
||||
print header[-4:]
|
||||
exit()
|
||||
|
||||
|
||||
|
||||
def check_accuray():
|
||||
ACCURAY_PATIENTS = '/shares/mnt/ntuh-cks/accuray/database/patients/'
|
||||
count = 0
|
||||
for patient in glob.glob("%s/*" % ACCURAY_PATIENTS):
|
||||
print patient
|
||||
for ct in glob.glob("%s/ct/patient/*" % patient):
|
||||
for CTMR in glob.glob("%s/*" % ct):
|
||||
for fullpath in glob.glob("%s/*" % CTMR):
|
||||
if fullpath.endswith('import.list'):
|
||||
continue
|
||||
if isDCM(fullpath):
|
||||
continue
|
||||
count += 1
|
||||
exit()
|
||||
|
||||
if count >= MAX:
|
||||
exit()
|
||||
# break
|
||||
|
||||
|
||||
def isNII(filename):
|
||||
with open(filename, 'rb') as infile:
|
||||
header = infile.read(132)
|
||||
|
||||
sizeof_hdr = struct.unpack('i', header[0:4])[0]
|
||||
|
||||
if sizeof_hdr == 348:
|
||||
return True
|
||||
|
||||
|
||||
print ":".join("{:02x}".format(ord(c)) for c in header), filename
|
||||
print sizeof_hdr
|
||||
exit()
|
||||
|
||||
|
||||
def check_accuray_nii():
|
||||
CONVERTED_PATIENTS = '/shares/mnt/ntuh-cks/accuray_nii/'
|
||||
count = 0
|
||||
for patient in glob.glob("%s/*" % CONVERTED_PATIENTS):
|
||||
print patient
|
||||
for ct in glob.glob("%s/*.nii" % patient):
|
||||
if isNII(ct):
|
||||
# print("%s OK" % ct)
|
||||
continue
|
||||
count += 1
|
||||
exit()
|
||||
|
||||
if count >= MAX:
|
||||
exit()
|
||||
# break
|
||||
|
||||
def isISO(filename):
|
||||
with open(filename, 'rb') as infile:
|
||||
header = infile.read(32774)
|
||||
|
||||
if header[-5:] in ('BEA01', 'CD001'):
|
||||
return True
|
||||
|
||||
print ":".join("{:02x}".format(ord(c)) for c in header[-5:]), filename
|
||||
# exit()
|
||||
|
||||
|
||||
def check_iso():
|
||||
ISO_PATIENTS = '/shares/mnt/ntuh-cks/ISO/'
|
||||
count = 0
|
||||
|
||||
for path, dirs, files in os.walk(os.path.abspath(ISO_PATIENTS)):
|
||||
for filename in fnmatch.filter(files, '*.iso'):
|
||||
if 'RECYCLE' in path:
|
||||
continue
|
||||
# print os.path.join(path, filename)
|
||||
if isISO(os.path.join(path, filename)):
|
||||
continue
|
||||
count += 1
|
||||
# exit()
|
||||
|
||||
if count >= MAX:
|
||||
exit()
|
||||
# break
|
||||
|
||||
|
||||
# check_accuray()
|
||||
# check_accuray_nii()
|
||||
# check_iso()
|
||||
# print isDCM('/shares/mnt/ntuh-cks/accuray/database/patients/JOU_1920628/ct/patient/case2011.10.18.12.54.38/MR/IM1')
|
||||
|
BIN
datetimepick.zip
Executable file
BIN
datetimepick.zip
Executable file
Binary file not shown.
0
etc/dav.digest.passwd
Executable file
0
etc/dav.digest.passwd
Executable file
1
etc/php.ini
Symbolic link
1
etc/php.ini
Symbolic link
|
@ -0,0 +1 @@
|
|||
php5/php.ini
|
1853
etc/php5/php.ini
Executable file
1853
etc/php5/php.ini
Executable file
File diff suppressed because it is too large
Load diff
8
fcgi-bin/php5.fcgi
Executable file
8
fcgi-bin/php5.fcgi
Executable file
|
@ -0,0 +1,8 @@
|
|||
#!/bin/bash
|
||||
PHPRC=$PWD/../etc/php5
|
||||
export PHPRC
|
||||
umask 022
|
||||
export PHP_FCGI_CHILDREN
|
||||
SCRIPT_FILENAME=$PATH_TRANSLATED
|
||||
export SCRIPT_FILENAME
|
||||
exec /usr/bin/php5-cgi
|
7
gunicorn.sh
Executable file
7
gunicorn.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
export PATH="/usr/local/bin:$PATH"
|
||||
|
||||
#cd /home/ntuh/domains/ck.ntuh.net/mysite
|
||||
cd "$(dirname "$0")/mysite"
|
||||
/home/cks/.conda/envs/django3/bin/gunicorn -b 0.0.0.0:8114 -D mysite.wsgi
|
363
impax_moved.py
Executable file
363
impax_moved.py
Executable file
|
@ -0,0 +1,363 @@
|
|||
import glob
|
||||
import re
|
||||
|
||||
"""
|
||||
def parse_z1(s):
|
||||
'''
|
||||
0008 0005 10 | specific_character_set | CS | 1-n | "ISO_IR 192"
|
||||
|
||||
'''
|
||||
pattern = '(?P<Grp>\d{4}) (?P<Elmt>\d{4})\s+(?P<Length>\d+) \|\s+(?P<Description>[^|]+?)\s+\| (?P<VR>..) \|\s+(?P<VM>\S+)\s+\|\s*(?P<Value>"[^|]*?"|\*[\s\S]+?Seq|[^\r]*)'
|
||||
|
||||
r = re.compile(pattern)
|
||||
|
||||
return [m.groupdict() for m in r.finditer(s)]
|
||||
|
||||
|
||||
|
||||
def parse_z2(s):
|
||||
'''
|
||||
[ object, original_order ] = 1 ( 4, 4 )
|
||||
'''
|
||||
|
||||
pattern = '\[ (.+?), (.+?) \] = (.+?) \( (.+?), (.+?) \)'
|
||||
|
||||
return re.findall(pattern, s, re.MULTILINE)
|
||||
|
||||
|
||||
def parse_z(s):
|
||||
|
||||
pattern = '(?P<Grp>\d{4}) (?P<Elmt>\d{4})\s+(?P<Length>\d+) \|\s+(?P<Description>[^|]+?)\s+\| (?P<VR>..) \|\s+(?P<VM>\S+)\s+\|\s*(?P<Value>"[^|]*?"|\*[\s\S]+?Seq|[^\r]*)'
|
||||
r = re.compile(pattern)
|
||||
ret1 = [m.groupdict() for m in r.finditer(s)]
|
||||
|
||||
pattern = '\[ (.+?), (.+?) \] = (.+?) \( (.+?), (.+?) \)'
|
||||
ret2 = re.findall(pattern, s, re.MULTILINE)
|
||||
|
||||
return ret1, ret2
|
||||
"""
|
||||
|
||||
|
||||
class IMPAX_Description:
|
||||
def __init__(self, s):
|
||||
pattern = '(?P<Grp>\d{4}) (?P<Elmt>\d{4})\s+(?P<Length>\d+) \|\s+(?P<Description>[^|]+?)\s+\| (?P<VR>..) \|\s+(?P<VM>\S+)\s+\|\s*(?P<Value>"[^|]*?"|\*[\s\S]+?Seq|[^\r]*)'
|
||||
r = re.compile(pattern)
|
||||
self.data1 = [m.groupdict() for m in r.finditer(s)]
|
||||
|
||||
pattern = '\[ (.+?), (.+?) \] = (.+?) \( (.+?), (.+?) \)'
|
||||
self.data2 = re.findall(pattern, s, re.MULTILINE)
|
||||
|
||||
self.data = {}
|
||||
|
||||
for elm in self.data2:
|
||||
self.data[elm[1]] = elm[2].replace('"', '')
|
||||
|
||||
for elm in self.data1:
|
||||
if '...' not in elm['Value']:
|
||||
self.data[elm['Description']] = elm['Value'].replace('"', '')
|
||||
|
||||
# print self.data
|
||||
# exit()
|
||||
|
||||
def dump(self):
|
||||
return self.data1, self.data2
|
||||
|
||||
def get_old(self, s):
|
||||
for elm in self.data2:
|
||||
if elm[1] == s:
|
||||
return elm[2].replace('"', '')
|
||||
|
||||
for elm in self.data1:
|
||||
if elm['Description'] == s:
|
||||
return elm['Value'].replace('"', '')
|
||||
|
||||
raise NameError('%s not found' % s)
|
||||
|
||||
def get(self, s):
|
||||
if s in self.data:
|
||||
# print s, self.data[s]
|
||||
return self.data[s]
|
||||
|
||||
raise NameError('%s not found' % s)
|
||||
|
||||
def keys(self):
|
||||
return self.data.keys()
|
||||
|
||||
def __sub__(self, other):
|
||||
sdata = {}
|
||||
for k in self.data:
|
||||
if k not in other.data:
|
||||
# sdata[k] = (self.data[k], None)
|
||||
pass
|
||||
elif self.data[k] != other.data[k]:
|
||||
sdata[k] = (self.data[k], other.data[k])
|
||||
|
||||
for k in other.data:
|
||||
if k not in self.data:
|
||||
# sdata[k] = (None, other.data[k])
|
||||
pass
|
||||
|
||||
return sdata
|
||||
|
||||
class IMPAX_Series_one:
|
||||
def __init__(self, path):
|
||||
self.path = path
|
||||
ztxt = '%s/z.txt' % (path)
|
||||
with open(ztxt, 'r') as myfile:
|
||||
data=myfile.read()
|
||||
self.Description = IMPAX_Description(data)
|
||||
|
||||
def direction(self):
|
||||
import numpy as np
|
||||
|
||||
image_orientation_patient = self.Description.get('image_orientation_patient').split('\\')
|
||||
image_position_patient = self.Description.get('image_position_patient').split('\\')
|
||||
|
||||
dir = [round(float(a)) for a in image_orientation_patient]
|
||||
|
||||
pos = map(float, image_position_patient)
|
||||
|
||||
dir2 = (abs(np.array(dir[:3])+np.array(dir[3:]))-1)*pos
|
||||
dir2 = dir2 / np.linalg.norm(dir2)
|
||||
|
||||
print self.path
|
||||
print image_orientation_patient
|
||||
print image_position_patient
|
||||
print dir
|
||||
print dir2
|
||||
|
||||
return dir + dir2.tolist()
|
||||
|
||||
|
||||
def write(self, filename):
|
||||
import SimpleITK
|
||||
|
||||
print self.Description.get('image_number')
|
||||
# print self.Description.get('referenced_image_sequence')
|
||||
# print self.Description.get('source_image_sequence')
|
||||
|
||||
files = glob.glob("%s/*.jpg" % self.path)
|
||||
files.sort()
|
||||
|
||||
sreader1 = SimpleITK.ImageSeriesReader()
|
||||
sreader1.SetFileNames(files)
|
||||
img = sreader1.Execute()
|
||||
|
||||
pixel_spacing = self.Description.get('pixel_spacing').split('\\')
|
||||
|
||||
try:
|
||||
slice_spacing = float(self.Description.get('slice_spacing'))
|
||||
except:
|
||||
slice_spacing = float(self.Description.get('slice_thickness'))
|
||||
|
||||
img.SetDirection(self.direction())
|
||||
|
||||
img.SetSpacing((float(pixel_spacing[0]), float(pixel_spacing[1]), slice_spacing))
|
||||
|
||||
SimpleITK.WriteImage(img, filename)
|
||||
|
||||
print img.GetDirection()
|
||||
print
|
||||
|
||||
class IMPAX_Series:
|
||||
def __init__(self, path):
|
||||
self.DescriptionOrder = {}
|
||||
self.path = path
|
||||
files = glob.glob("%s/z*.txt" % self.path)
|
||||
|
||||
for filename in files:
|
||||
# print filename
|
||||
m = re.search('z(.+).txt', filename)
|
||||
if m is None:
|
||||
continue
|
||||
f_number = int(m.group(1))
|
||||
print filename, f_number
|
||||
with open(filename, 'r') as myfile:
|
||||
data=myfile.read()
|
||||
|
||||
d = IMPAX_Description(data)
|
||||
print d.get('image_number')
|
||||
|
||||
d_number = int(d.get('image_number'))
|
||||
if d_number != f_number:
|
||||
raise NameError('File name: %s, Description: %d' % (filename, d_number))
|
||||
|
||||
self.DescriptionOrder[f_number] = d
|
||||
|
||||
self.images = sorted(self.DescriptionOrder.keys())
|
||||
self.Description = self.DescriptionOrder[self.images[0]]
|
||||
|
||||
|
||||
def direction_old(self):
|
||||
import numpy as np
|
||||
|
||||
pos_a = np.array(map(float, self.DescriptionOrder[self.images[0]].get('image_position_patient').split('\\')))
|
||||
pos_z = np.array(map(float, self.DescriptionOrder[self.images[-1]].get('image_position_patient').split('\\')))
|
||||
# dir2 = pos_z - pos_a
|
||||
# print pos_a, pos_z, dir2
|
||||
# dir2 = dir2 / np.linalg.norm(dir2)
|
||||
# dir2 = [round(a) for a in dir2]
|
||||
|
||||
image_orientation_patient = self.Description.get('image_orientation_patient').split('\\')
|
||||
image_position_patient = self.Description.get('image_position_patient').split('\\')
|
||||
|
||||
dir = [round(float(a)) for a in image_orientation_patient]
|
||||
|
||||
pos = map(float, image_position_patient)
|
||||
|
||||
dir2 = (abs(np.array(dir[:3])+np.array(dir[3:]))-1)*(pos_a - pos_z)
|
||||
dir2 = dir2 / np.linalg.norm(dir2)
|
||||
|
||||
print self.path
|
||||
print image_orientation_patient
|
||||
print image_position_patient
|
||||
print dir
|
||||
print dir2
|
||||
|
||||
return dir + dir2.tolist()
|
||||
|
||||
|
||||
def direction_old2(self):
|
||||
import numpy as np
|
||||
|
||||
# print self.DescriptionOrder[self.images[0]].get('image_number'), self.DescriptionOrder[self.images[0]].get('image_position_patient')
|
||||
# print self.DescriptionOrder[self.images[-1]].get('image_number'), self.DescriptionOrder[self.images[-1]].get('image_position_patient')
|
||||
|
||||
pos_a = np.array(map(float, self.DescriptionOrder[self.images[0]].get('image_position_patient').split('\\')))
|
||||
pos_z = np.array(map(float, self.DescriptionOrder[self.images[-1]].get('image_position_patient').split('\\')))
|
||||
|
||||
image_orientation_patient = self.Description.get('image_orientation_patient').split('\\')
|
||||
image_position_patient = self.Description.get('image_position_patient').split('\\')
|
||||
|
||||
dir = [float(a) for a in image_orientation_patient]
|
||||
|
||||
pos = map(float, image_position_patient)
|
||||
|
||||
# dir2 = (pos_z - pos_a) * [1, -1, 1]/ (self.images[-1] - self.images[0])
|
||||
dir2 = (pos_z - pos_a) / (self.images[-1] - self.images[0])
|
||||
|
||||
dir3 = np.array(dir+dir2.tolist())
|
||||
dir3 = dir3 / np.linalg.norm(dir3)
|
||||
|
||||
print self.path
|
||||
print image_orientation_patient
|
||||
print pos_a, pos_z
|
||||
print self.images
|
||||
print dir
|
||||
print dir2
|
||||
print dir3
|
||||
|
||||
return dir3.tolist()
|
||||
|
||||
|
||||
def direction(self):
|
||||
import numpy as np
|
||||
|
||||
# print self.DescriptionOrder[self.images[0]].get('image_number'), self.DescriptionOrder[self.images[0]].get('image_position_patient')
|
||||
# print self.DescriptionOrder[self.images[-1]].get('image_number'), self.DescriptionOrder[self.images[-1]].get('image_position_patient')
|
||||
|
||||
pos_a = np.array(map(float, self.DescriptionOrder[self.images[0]].get('image_position_patient').split('\\')))
|
||||
pos_z = np.array(map(float, self.DescriptionOrder[self.images[-1]].get('image_position_patient').split('\\')))
|
||||
|
||||
image_orientation_patient = self.Description.get('image_orientation_patient').split('\\')
|
||||
image_position_patient = self.Description.get('image_position_patient').split('\\')
|
||||
|
||||
dir = [round(float(a)) for a in image_orientation_patient]
|
||||
# dir = [float(a) for a in image_orientation_patient]
|
||||
|
||||
pos = map(float, image_position_patient)
|
||||
|
||||
# dir2 = (pos_z - pos_a) * [1, -1, 1]/ (self.images[-1] - self.images[0])
|
||||
dir2 = (pos_z - pos_a) / (self.images[-1] - self.images[0])
|
||||
|
||||
dir2 = dir2 / np.linalg.norm(dir2)
|
||||
dir2 = [round(a) for a in dir2]
|
||||
# dir2 = [a for a in dir2]
|
||||
|
||||
|
||||
dir3 = np.array(dir+dir2)
|
||||
|
||||
dir4 = np.linalg.inv(dir3.reshape(3,3))
|
||||
dir4 = np.transpose(dir3.reshape(3,3))
|
||||
|
||||
print self.path
|
||||
print image_orientation_patient
|
||||
print pos_a, pos_z
|
||||
print self.images
|
||||
print dir
|
||||
print dir2
|
||||
print dir3
|
||||
print dir4
|
||||
|
||||
print list(dir4.flat)
|
||||
|
||||
return list(dir4.flat)
|
||||
|
||||
# return dir3.tolist()
|
||||
|
||||
|
||||
def write(self, filename):
|
||||
import SimpleITK
|
||||
|
||||
print self.Description.get('image_number')
|
||||
# print self.Description.get('referenced_image_sequence')
|
||||
# print self.Description.get('source_image_sequence')
|
||||
|
||||
files = glob.glob("%s/*.jpg" % self.path)
|
||||
files.sort()
|
||||
|
||||
sreader1 = SimpleITK.ImageSeriesReader()
|
||||
sreader1.SetFileNames(files)
|
||||
img = sreader1.Execute()
|
||||
|
||||
pixel_spacing = self.Description.get('pixel_spacing').split('\\')
|
||||
|
||||
try:
|
||||
slice_spacing = float(self.Description.get('slice_spacing'))
|
||||
except:
|
||||
slice_spacing = float(self.Description.get('slice_thickness'))
|
||||
|
||||
img.SetDirection(self.direction())
|
||||
|
||||
img.SetSpacing((float(pixel_spacing[0]), float(pixel_spacing[1]), slice_spacing))
|
||||
|
||||
SimpleITK.WriteImage(img, filename)
|
||||
|
||||
print img.GetDirection()
|
||||
print
|
||||
|
||||
def get_description(self):
|
||||
return self.Description
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
series = IMPAX_Series('/shares/mnt/ntuh-cks/impax/2671292/20130417')
|
||||
series.write('/tmp/20130417.nii.gz')
|
||||
|
||||
series = IMPAX_Series('/shares/mnt/ntuh-cks/impax/2671292/20130417C')
|
||||
series.write('/tmp/20130417C.nii.gz')
|
||||
|
||||
|
||||
|
||||
# series = IMPAX_Series('/shares/mnt/ntuh-cks/impax/0397533/20120815')
|
||||
# series.write('/tmp/20120815.nii.gz')
|
||||
# d1 = series.get_description()
|
||||
#
|
||||
# series = IMPAX_Series('/shares/mnt/ntuh-cks/impax/0397533/20120815C')
|
||||
# series.write('/tmp/20120815C.nii.gz')
|
||||
#
|
||||
# series = IMPAX_Series('/shares/mnt/ntuh-cks/impax/0397533/20160216')
|
||||
# series.write('/tmp/20160216.nii.gz')
|
||||
#
|
||||
# series = IMPAX_Series('/shares/mnt/ntuh-cks/impax/0397533/20160216C')
|
||||
# series.write('/tmp/20160216C.nii.gz')
|
||||
# d2 = series.get_description()
|
||||
#
|
||||
# import pprint
|
||||
# pp = pprint.PrettyPrinter(indent=4)
|
||||
|
||||
# print d1-d2
|
||||
# pp.pprint(d1-d2)
|
||||
|
||||
|
||||
|
0
logs/.nodelete
Executable file
0
logs/.nodelete
Executable file
1
logs/access_log
Symbolic link
1
logs/access_log
Symbolic link
|
@ -0,0 +1 @@
|
|||
/var/log/virtualmin/ck.ntuh.net_access_log
|
1
logs/error_log
Symbolic link
1
logs/error_log
Symbolic link
|
@ -0,0 +1 @@
|
|||
/var/log/virtualmin/ck.ntuh.net_error_log
|
36
mysite/ai_clinic.py
Executable file
36
mysite/ai_clinic.py
Executable file
|
@ -0,0 +1,36 @@
|
|||
#!/usr/bin/python
|
||||
# coding=utf-8
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import re
|
||||
|
||||
import django
|
||||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
|
||||
# os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mysite.settings")
|
||||
django.setup()
|
||||
|
||||
# from mechanize import Browser
|
||||
# br = Browser()
|
||||
# br.set_handle_robots(False)
|
||||
|
||||
from ck.models import *
|
||||
# from ntuhgov import intra
|
||||
from ntuhgov.portal_selenium import *
|
||||
|
||||
def AI_CLINIC():
|
||||
# print(type(Patient))
|
||||
for mrn in OpenClinics('2019-3-22', '2', 10):
|
||||
try:
|
||||
p = Patient.objects.get(medical_records=mrn)
|
||||
print('%s %s' % (mrn, p.name))
|
||||
except:
|
||||
# print(mrn)
|
||||
continue
|
||||
|
||||
if __name__ == "__main__":
|
||||
AI_CLINIC()
|
||||
# PatientsRefresh()
|
0
mysite/calculator/__init__.py
Normal file
0
mysite/calculator/__init__.py
Normal file
3
mysite/calculator/admin.py
Normal file
3
mysite/calculator/admin.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
5
mysite/calculator/apps.py
Normal file
5
mysite/calculator/apps.py
Normal file
|
@ -0,0 +1,5 @@
|
|||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class CalculatorConfig(AppConfig):
|
||||
name = 'calculator'
|
11
mysite/calculator/forms.py
Normal file
11
mysite/calculator/forms.py
Normal file
|
@ -0,0 +1,11 @@
|
|||
from django import forms
|
||||
|
||||
class PresciptionForm(forms.Form):
|
||||
volume = forms.FloatField(required=False)
|
||||
# num2 = forms.IntegerField(required=False)
|
||||
|
||||
class CIForm(forms.Form):
|
||||
Px = forms.IntegerField(label='Px(cGy)' , required=False)
|
||||
Coverage = forms.FloatField (label='Coverage(%)', required=False)
|
||||
TV = forms.FloatField (label='TV(cc)' , required=False)
|
||||
PIV = forms.FloatField (label='PIV(cc)' , required=False)
|
0
mysite/calculator/migrations/__init__.py
Normal file
0
mysite/calculator/migrations/__init__.py
Normal file
3
mysite/calculator/models.py
Normal file
3
mysite/calculator/models.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.db import models
|
||||
|
||||
# Create your models here.
|
3
mysite/calculator/tests.py
Normal file
3
mysite/calculator/tests.py
Normal file
|
@ -0,0 +1,3 @@
|
|||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
11
mysite/calculator/urls.py
Executable file
11
mysite/calculator/urls.py
Executable file
|
@ -0,0 +1,11 @@
|
|||
from django.urls import path
|
||||
|
||||
from . import views
|
||||
|
||||
app_name = 'polls'
|
||||
urlpatterns = [
|
||||
|
||||
path('prescription/', views.PresciptionView.as_view(), name='prescription'),
|
||||
path('ci/', views.CIView.as_view(), name='ci'),
|
||||
|
||||
]
|
132
mysite/calculator/views.py
Normal file
132
mysite/calculator/views.py
Normal file
|
@ -0,0 +1,132 @@
|
|||
from math import exp, log
|
||||
|
||||
|
||||
from django.shortcuts import render
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
from scipy import stats
|
||||
|
||||
import numpy as np
|
||||
|
||||
|
||||
from .forms import *
|
||||
|
||||
# Create your views here.
|
||||
|
||||
diameter = [12.5, 15.0, 17.5, 20.0, 22.5, 25.0, 27.5, 30.0, 32.5]
|
||||
volume = [1.02, 1.77, 2.81, 4.19, 5.96, 8.18, 10.9, 14.1, 18.0]
|
||||
|
||||
# Flickinger, John C., et al. "Dose selection in stereotactic radiosurgery." Radiosurgery and Pathological Fundamentals 20 (2007): 28-42.
|
||||
# https://doi.org/10.1159/000100093
|
||||
Kjellberg = [27.5, 25.0, 22.5, 20.0, 18.7, 17.5, 16.5, 15.0, 14.0]
|
||||
ILF = [34.0, 29.0, 23.0, 18.0, 16.5, 14.5, 13.5, 13.0, 12.5]
|
||||
RTOG = [24.0, 24.0, 24.0, 24.0, 18.0, 18.0, 18.0, 18.0, 15.0]
|
||||
|
||||
NCT02353000 = [24.0, 21.0, 21.0, 21.0, 21.0, 21.0, 18.0, 18.0, 15.0] # https://doi.org/10.1186/s12885-017-3494-z
|
||||
|
||||
# http://www.aboutcancer.com/gk_doses.htm
|
||||
Pit = [20.0, 20.0, 20.0, 20.0, 16.0, 16.0, 15.0, 15.0, 14.0] # U Pitt
|
||||
Other = [24.0, 24.0, 24.0, 24.0, 24.0, 24.0, 22.0, 22.0, 16.0] # Other sites (e.g. Cleveland Clinic) Too high?
|
||||
Karolinska = [25.0, 25.0, 22.5, 20.0, 20.0, 20.0, 18.0, 18.0, 18.0] # Karolinska Policy on Brain Mets
|
||||
ACOSOG_Z0300 = [24.0, 24.0, 24.0, 20.0, 20.0, 20.0, 20.0, 18.0, 18.0] # ACOSOG Z0300
|
||||
|
||||
|
||||
def log_regression(func, v):
|
||||
|
||||
# print func
|
||||
|
||||
# dose = map(func, Kjellberg, ILF, RTOG)
|
||||
# dose = [func([Kjellberg[i], ILF[i], RTOG[i]]) for i in range(len(volume))]
|
||||
# dose = [func([Kjellberg[i], ILF[i], RTOG[i], NCT02353000[i]]) for i in range(len(volume))]
|
||||
|
||||
dose = [func([
|
||||
Kjellberg[i],
|
||||
ILF[i],
|
||||
RTOG[i],
|
||||
|
||||
# NCT02353000[i],
|
||||
|
||||
# Pit[i],
|
||||
# Other[i],
|
||||
# Karolinska[i],
|
||||
# ACOSOG_Z0300[i],
|
||||
|
||||
]) for i in range(len(volume))]
|
||||
|
||||
# print dose
|
||||
|
||||
logv = list(map(log, volume))
|
||||
logd = list(map(log, dose))
|
||||
|
||||
# print(logv)
|
||||
|
||||
gradient, intercept, r_value, p_value, std_err = stats.linregress(logv, logd)
|
||||
# print "Gradient and intercept", gradient, intercept
|
||||
return exp(log(v) * gradient + intercept)
|
||||
|
||||
|
||||
def solve_d(d1, n, ab = 2.0):
|
||||
coeff = [n/ab, n, -d1*(1+d1/ab)]
|
||||
d = np.roots(coeff)[1]
|
||||
return n*d
|
||||
|
||||
|
||||
def fraction_string(d):
|
||||
return (d,
|
||||
solve_d(d, 2),
|
||||
solve_d(d, 3),
|
||||
solve_d(d, 4),
|
||||
solve_d(d, 5),
|
||||
)
|
||||
|
||||
|
||||
class PresciptionView(TemplateView):
|
||||
template_name = 'calculator/prescription.html'
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
form = PresciptionForm()
|
||||
return render(request,self.template_name, {'form':form})
|
||||
|
||||
def post(self,request):
|
||||
form = PresciptionForm(request.POST)
|
||||
if form.is_valid():
|
||||
v = form.cleaned_data['volume']
|
||||
result = {}
|
||||
|
||||
result['min'] = fraction_string(log_regression(min , v))
|
||||
result['mean'] = fraction_string(log_regression(np.mean , v))
|
||||
result['median'] = fraction_string(log_regression(np.median, v))
|
||||
result['max'] = fraction_string(log_regression(max , v))
|
||||
|
||||
form = PresciptionForm()
|
||||
#return redirect ('home:home')
|
||||
|
||||
args = {'form': form , 'result': result}
|
||||
return render(request, self.template_name, args )
|
||||
|
||||
class CIView(TemplateView):
|
||||
template_name = 'calculator/ci.html'
|
||||
|
||||
def get(self, request, *args, **kwargs):
|
||||
form = CIForm()
|
||||
return render(request,self.template_name, {'form':form})
|
||||
|
||||
def post(self,request):
|
||||
form = CIForm(request.POST)
|
||||
if form.is_valid():
|
||||
Px = form.cleaned_data['Px']
|
||||
Coverage = form.cleaned_data['Coverage']
|
||||
TV = form.cleaned_data['TV']
|
||||
PIV = form.cleaned_data['PIV']
|
||||
result = {}
|
||||
|
||||
TVPIV = Coverage*TV/100
|
||||
result['TVPIV'] = Coverage*TV/100
|
||||
result['CI'] = PIV/TVPIV
|
||||
result['nCI'] = (PIV/TVPIV)*(TV/TVPIV)
|
||||
|
||||
form = CIForm()
|
||||
#return redirect ('home:home')
|
||||
|
||||
args = {'form': form , 'result': result}
|
||||
return render(request, self.template_name, args )
|
6
mysite/ck/0.py
Executable file
6
mysite/ck/0.py
Executable file
|
@ -0,0 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
from intra import *
|
||||
|
||||
print HeightWeight('D120264406')
|
||||
#print ReportResult('D120264406')
|
0
mysite/ck/__init__.py
Executable file
0
mysite/ck/__init__.py
Executable file
3
mysite/ck/admin.py
Executable file
3
mysite/ck/admin.py
Executable file
|
@ -0,0 +1,3 @@
|
|||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
32
mysite/ck/autocomplete_light_registry.py
Executable file
32
mysite/ck/autocomplete_light_registry.py
Executable file
|
@ -0,0 +1,32 @@
|
|||
import autocomplete_light.shortcuts as al
|
||||
from models import ICD10CMfinal
|
||||
|
||||
# This will generate a PersonAutocomplete class
|
||||
al.register(ICD10CMfinal,
|
||||
# Just like in ModelAdmin.search_fields
|
||||
search_fields=[
|
||||
'^ICD9CM_code',
|
||||
'ICD9CM_English',
|
||||
'^ICD10CM',
|
||||
'ICD10CM_English',
|
||||
],
|
||||
attrs={
|
||||
# This will set the input placeholder attribute:
|
||||
# 'placeholder': 'Other model name ?',
|
||||
# This will set the yourlabs.Autocomplete.minimumCharacters
|
||||
# options, the naming conversion is handled by jQuery
|
||||
'data-autocomplete-minimum-characters': 1,
|
||||
},
|
||||
# This will set the data-widget-maximum-values attribute on the
|
||||
# widget container element, and will be set to
|
||||
# yourlabs.Widget.maximumValues (jQuery handles the naming
|
||||
# conversion).
|
||||
widget_attrs={
|
||||
'data-widget-maximum-values': 4,
|
||||
# Enable modern-style widget !
|
||||
'class': 'modern-style',
|
||||
|
||||
# 'style': "background-color: yellow; width: 375px; display: inline-block;",
|
||||
'style': "width: 576px; display: inline-block;",
|
||||
},
|
||||
)
|
331
mysite/ck/common.py
Normal file
331
mysite/ck/common.py
Normal file
|
@ -0,0 +1,331 @@
|
|||
import datetime
|
||||
|
||||
from django.db.models import Q
|
||||
from django.utils import timezone
|
||||
|
||||
import zeep
|
||||
|
||||
from .models import *
|
||||
|
||||
import ntuhgov.portal_selenium as portal
|
||||
|
||||
def UpdateNHICase(case):
|
||||
|
||||
# print(case)
|
||||
|
||||
if 'PackageTime' not in case:
|
||||
case['PackageTime'] = case['ApplyDate']
|
||||
|
||||
if 'ApplyQty' in case:
|
||||
case['ResultDesc'] = case['ApplyQty']
|
||||
|
||||
if case['PackageTime'] is not None:
|
||||
case['PackageTime']=case['PackageTime'].replace('/','-')
|
||||
|
||||
if 'ExamineDate' in case and case['ExamineDate'] is not None:
|
||||
case['ExamineDate']=case['ExamineDate'].replace('/','-')
|
||||
if 'ApplyDate' in case and case['ApplyDate'] is not None:
|
||||
case['ApplyDate']=case['ApplyDate'].replace('/','-')
|
||||
|
||||
if 'ApplyDoctor' in case and case['ApplyDoctor'] is not None:
|
||||
case['ApplyDoctor']=case['ApplyDoctor'].replace('\ue09b', '峯') #'許峯銘'
|
||||
|
||||
if case['PackageTime'] is None:
|
||||
return
|
||||
|
||||
# id = case['ChartNo']+'_'+case['PackageTime'][:4]
|
||||
id = case['ChartNo']+'_'+case['PackageTime'][:7]
|
||||
|
||||
order = NHIOrder.objects.filter(id=id).first()
|
||||
|
||||
if order == None:
|
||||
order = NHIOrder(id=id)
|
||||
|
||||
# print(order)
|
||||
# exit()
|
||||
# order, created = NHIOrder.objects.get_or_create(id=id)
|
||||
|
||||
for k, v in case.items():
|
||||
# order[k] = v
|
||||
# print(k,v)
|
||||
if v is not None:
|
||||
setattr(order, k, v)
|
||||
|
||||
if order.Priority is None:
|
||||
if order.Quantity == '同意備查':
|
||||
order.Priority = 1
|
||||
|
||||
order.save()
|
||||
|
||||
FirstPriority = 900
|
||||
LastPriority = 100
|
||||
def SortNHI(CheckTreated=True):
|
||||
|
||||
for v in NHIOrder.objects.values('ApplyDoctor').distinct():
|
||||
|
||||
if v['ApplyDoctor'] is None:
|
||||
continue
|
||||
|
||||
print(v)
|
||||
|
||||
q = NHIOrder.objects.filter(ApplyDoctor=v['ApplyDoctor'],Priority__gt=0).order_by('-Priority', 'PackageTime')
|
||||
total = len(q)
|
||||
print(v['ApplyDoctor'], total)
|
||||
|
||||
if total < 1:
|
||||
continue
|
||||
|
||||
|
||||
priority = FirstPriority
|
||||
d = (FirstPriority-LastPriority)/total
|
||||
for order in q:
|
||||
|
||||
# check if treated
|
||||
# patient = Patient.objects.get(medical_records=order.ChartNo)
|
||||
|
||||
if CheckTreated:
|
||||
patient = Patient.objects.filter(medical_records=order.ChartNo).first()
|
||||
if patient is not None:
|
||||
print(patient, patient.medical_records)
|
||||
for t in patient.treatment_set.all():
|
||||
print(t.date_started, order.ExamineDate)
|
||||
if (t.date_started is not None) and (order.ExamineDate is not None) and t.date_started > order.ExamineDate:
|
||||
order.Priority = -1
|
||||
|
||||
# if v['ApplyDoctor'] is not None and order.Priority > 0:
|
||||
if order.Priority > 0:
|
||||
order.Priority = priority
|
||||
priority -= d
|
||||
order.save()
|
||||
|
||||
def AddPatient(d, force=True):
|
||||
# r = portal.QueryModifyPatBase({'IdNo': idcode,
|
||||
# 'ChartNo': chartno,
|
||||
# })
|
||||
|
||||
p = None
|
||||
r = portal.QueryModifyPatBase(d)
|
||||
|
||||
if r:
|
||||
r['name'] = r['ChtName']
|
||||
r['medical_records'] = r['ChartNo']
|
||||
r['gender'] = r['Sex']
|
||||
r['birthday'] = r['Birth']
|
||||
r['address'] = r['AddressControl1']
|
||||
r['phone'] = r['ContTel']
|
||||
r['id_cards'] = r['IdNo']
|
||||
|
||||
result = [r]
|
||||
else:
|
||||
result = []
|
||||
|
||||
if force and len(result)>0:
|
||||
r=result[0]
|
||||
|
||||
if r['gender'] == 'M':
|
||||
r['gender'] = 1
|
||||
else:
|
||||
r['gender'] = 2
|
||||
# hw = intra.HeightWeight(r['id_cards'])
|
||||
# hw = ntuhgov.portal.HeightWeight(r['id_cards'])
|
||||
hw = portal.BriefHistoryLink(r['id_cards'])
|
||||
p = Patient(name = r['name'],
|
||||
medical_records = r['medical_records'],
|
||||
gender = r['gender'],
|
||||
birthday = r['birthday'],
|
||||
address = r['address'],
|
||||
phone = r['phone'],
|
||||
id_cards = r['id_cards'],
|
||||
# height = hw['Height'],
|
||||
weight = hw['Weight'],
|
||||
)
|
||||
|
||||
try:
|
||||
p.height = int(hw['Height'])
|
||||
except:
|
||||
pass
|
||||
p.save()
|
||||
|
||||
return p
|
||||
|
||||
def QueryMS():
|
||||
import mssql_ntuh.models as mssql
|
||||
|
||||
tzinfo=timezone.get_default_timezone()
|
||||
|
||||
# time_threshold = datetime.datetime.now() - datetime.timedelta(weeks=4)
|
||||
# DateTimeField Treatment.timestamp received a naive datetime while time zone support is active.
|
||||
time_threshold = timezone.now() - datetime.timedelta(weeks=4)
|
||||
|
||||
# qs = mssql.PatientAppointmentSchedule.objects.using('mssql-ntuh').all()
|
||||
qs = mssql.PatientAppointmentSchedule.objects.using('mssql-ntuh').filter(appointment_date__gt=time_threshold)
|
||||
|
||||
for s in qs:
|
||||
appointment_time = s.appointment_date.replace(tzinfo=tzinfo, hour=int(s.appointment_hour), minute=int(s.appointment_minutes))
|
||||
|
||||
if s.treatment_start_datetime:
|
||||
start_time = s.treatment_start_datetime.replace(tzinfo=tzinfo)
|
||||
elif s.checkin_datetime :
|
||||
start_time = s.checkin_datetime.replace(tzinfo=tzinfo)
|
||||
else:
|
||||
start_time = s.appointment_date.replace(tzinfo=tzinfo, hour=int(s.appointment_hour), minute=int(s.appointment_minutes))
|
||||
|
||||
if s.treatment_complete_datetime:
|
||||
end_time = s.treatment_complete_datetime.replace(tzinfo=tzinfo)
|
||||
else:
|
||||
end_time = start_time + datetime.timedelta(hours=1)
|
||||
|
||||
if s.treatment_room == 'MR':
|
||||
end_time = max(end_time, start_time + datetime.timedelta(hours=1))
|
||||
|
||||
# start_time = timezone.make_aware(datetime.datetime.now(),timezone.get_default_timezone())
|
||||
# start_time = timezone.get_default_timezone().localize(start_time)
|
||||
# start_time = start_time.replace(tzinfo=tzinfo)
|
||||
|
||||
print(s.mapping_patient, s.treatment_room, s.appointment_date, s.checkin_datetime, s.queue_datetime, s.treatment_start_datetime, s.treatment_complete_datetime, s.fallrisktime, s.willtime)
|
||||
mapping_patient = mssql.Patient.objects.using('mssql-ntuh').filter(id=s.mapping_patient).first()
|
||||
# print(p.name)
|
||||
# try:
|
||||
# print(s.mapping_patient.name)
|
||||
# except:
|
||||
# #no patient found
|
||||
# continue
|
||||
print(s.id, s.main_diagnose, s.treatment_room, start_time, end_time)
|
||||
# chartno = s.mapping_patient.record_no
|
||||
patient = Patient.objects.filter(medical_records=s.record_no).first()
|
||||
# print(patient)
|
||||
if patient is None:
|
||||
print('AddPatient', s.record_no, mapping_patient.name)
|
||||
patient = AddPatient({'ChartNo': s.record_no})
|
||||
|
||||
if patient is None:
|
||||
# false patient
|
||||
continue
|
||||
|
||||
# print(patient.name)
|
||||
treatment = patient.treatment_set.filter(Q(creation__gt=time_threshold) | Q(timestamp__gt=time_threshold)).order_by('-id').first()
|
||||
|
||||
if treatment is None:
|
||||
print('Add Treatment', mapping_patient.record_no, mapping_patient.name)
|
||||
treatment = Treatment(patient=patient)
|
||||
treatment.save()
|
||||
|
||||
if treatment.surgeon is None and s.main_doctor:
|
||||
treatment.surgeon = Surgeon.objects.filter(name=s.main_doctor).first()
|
||||
if treatment.oncologist is None and s.rt_doctor:
|
||||
treatment.oncologist = Oncologist.objects.filter(name=s.rt_doctor).first()
|
||||
if treatment.other_diagnosis is None and s.main_diagnose:
|
||||
treatment.other_diagnosis = s.main_diagnose
|
||||
|
||||
|
||||
if s.treatment_room == 'CK':
|
||||
if treatment.date_started is None or treatment.date_started > start_time.date():
|
||||
treatment.date_started = start_time
|
||||
if treatment.date_completed is None or treatment.date_completed < end_time.date():
|
||||
treatment.date_completed = end_time
|
||||
if treatment.bed is None and s.hospitalized_status:
|
||||
treatment.bed = s.hospitalized_status
|
||||
|
||||
if treatment.icd10cm is None: # 找之前的健保申請
|
||||
order = NHIOrder.objects.filter(ChartNo=s.record_no).order_by('-id').first()
|
||||
if order is not None and order.ExamineDate is not None:
|
||||
treatment.icd10cm = ICD10CMfinal.objects.filter(ICD10CM=order.Diagnosis).first()
|
||||
count = patient.treatment_set.filter(Q(creation__gt=order.ExamineDate)).count()
|
||||
if count <= 1:
|
||||
treatment.accounting = 10
|
||||
|
||||
timestamp = max(treatment.creation, treatment.timestamp)
|
||||
print(patient.name, treatment, timestamp)
|
||||
|
||||
print()
|
||||
treatment.save()
|
||||
|
||||
|
||||
vevent = treatment.vevent_set.filter(DESCRIPTION=s.id).first()
|
||||
if vevent is None:
|
||||
vevent = VEVENT(treatment=treatment,DESCRIPTION=s.id)
|
||||
|
||||
vevent.DTSTART = start_time
|
||||
vevent.DURATION = str(end_time-start_time)
|
||||
# print(vevent.DURATION, type(vevent.DURATION))
|
||||
|
||||
print(s.treatment_room)
|
||||
if s.treatment_room == 'CK':
|
||||
vevent.mode = 310
|
||||
vevent.SUMMARY = patient.name+'治療'
|
||||
elif s.treatment_room == 'MR':
|
||||
vevent.mode = 220
|
||||
vevent.SUMMARY = patient.name+'MRI'
|
||||
elif s.treatment_room == 'HE':
|
||||
vevent.mode = 100
|
||||
vevent.SUMMARY = patient.name+'衛教'
|
||||
elif s.treatment_room.startswith('CT'):
|
||||
vevent.mode = 210
|
||||
vevent.SUMMARY = patient.name+s.treatment_room
|
||||
|
||||
vevent.save()
|
||||
|
||||
print(len(qs))
|
||||
|
||||
def UpdateNHICase2(case):
|
||||
|
||||
print(case)
|
||||
case = zeep.helpers.serialize_object(case)
|
||||
|
||||
if 'PackageTime' not in case:
|
||||
case['PackageTime'] = case['ApplyDate']
|
||||
|
||||
if 'ApplyQty' in case:
|
||||
case['ResultDesc'] = case['ApplyQty']
|
||||
|
||||
if 'ApplyDoctor' in case and case['ApplyDoctor'] is not None:
|
||||
case['ApplyDoctor']=case['ApplyDoctor'].replace('\ue09b', '峯') #'許峯銘'
|
||||
|
||||
if case['PackageTime'] is None:
|
||||
return
|
||||
|
||||
case['Quantity'] = case['ResultDesc']
|
||||
case['ResultDesc'] = 1
|
||||
case['ExamineQuantity'] = 1
|
||||
|
||||
case['NhiDeptName'] = case['NhiDept']
|
||||
case['Diagnosis'] = case['DiagnosisCode']
|
||||
|
||||
# id = case['ChartNo']+'_'+case['PackageTime'][:4]
|
||||
# print(case['PackageTime'].strftime('%Y-%m'))
|
||||
id = case['ChartNo']+'_'+case['PackageTime'].strftime('%Y-%m')
|
||||
|
||||
order = NHIOrder.objects.filter(id=id).first()
|
||||
|
||||
if order == None:
|
||||
order = NHIOrder(id=id)
|
||||
|
||||
# print(order)
|
||||
# exit()
|
||||
# order, created = NHIOrder.objects.get_or_create(id=id)
|
||||
|
||||
for k, v in case.items():
|
||||
# order[k] = v
|
||||
# print(k,v)
|
||||
if v is not None:
|
||||
setattr(order, k, v)
|
||||
|
||||
if order.Priority is None:
|
||||
if order.Quantity == '同意備查':
|
||||
order.Priority = 1
|
||||
|
||||
order.save()
|
||||
|
||||
|
||||
def GetCaseForCyberKnifeList(days=30):
|
||||
|
||||
eDate = datetime.date.today()
|
||||
sDate = eDate + datetime.timedelta(days=-days)
|
||||
|
||||
settings = zeep.Settings(strict=False, xml_huge_tree=True)
|
||||
client = zeep.Client('https://converws.ntuh.gov.tw/WebApplication/NtuhACEService/CyberKnifeService.asmx?WSDL', settings=settings)
|
||||
# client = zeep.Client('https://tconverws.ntuh.gov.tw/WebApplication/NtuhACEService/CyberKnifeService.asmx?WSDL', settings=settings)
|
||||
result = client.service.GetCaseForCyberKnifeList('T0', sDate, eDate)
|
||||
# print(len(result))
|
||||
# exit()
|
||||
return result
|
78
mysite/ck/forms.py
Executable file
78
mysite/ck/forms.py
Executable file
|
@ -0,0 +1,78 @@
|
|||
#coding=utf-8
|
||||
|
||||
#from django import newforms as forms
|
||||
from django import forms
|
||||
from django_measurement.forms import MeasurementField
|
||||
#from django.newforms import form_for_model
|
||||
from django.forms import ModelForm
|
||||
from .models import *
|
||||
# import autocomplete_light
|
||||
from dal import autocomplete
|
||||
|
||||
#PatientForm = form_for_model(Patient)
|
||||
|
||||
class PatientForm(forms.Form):
|
||||
ChartNo = forms.CharField()
|
||||
Name = forms.CharField()
|
||||
idcode = forms.CharField()
|
||||
|
||||
#TreatmentForm = form_for_model(Treatment)
|
||||
|
||||
class TreatmentForm(ModelForm):
|
||||
# class TreatmentForm(autocomplete_light.ModelForm):
|
||||
def clean(self):
|
||||
cleaned_data = super(TreatmentForm, self).clean()
|
||||
if cleaned_data['icd10cm']:
|
||||
cleaned_data['icd9'] = ICD9Diag.objects.get(pk=cleaned_data['icd10cm'].ICD9CM_code.replace('.', ''))
|
||||
|
||||
class Meta:
|
||||
model = Treatment
|
||||
fields = '__all__'
|
||||
widgets = {
|
||||
'icd10cm': autocomplete.ModelSelect2(url='icd10-autocomplete')
|
||||
}
|
||||
|
||||
|
||||
class LesionForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = Lesion
|
||||
fields = [
|
||||
'calibration_table',
|
||||
'density_correction',
|
||||
|
||||
# 'treatment',
|
||||
'sub_location',
|
||||
'pathology',
|
||||
'dimensions',
|
||||
|
||||
# 'volume',
|
||||
'volume_measure',
|
||||
|
||||
'plan_name',
|
||||
|
||||
'collimator_type',
|
||||
'collimator',
|
||||
|
||||
'path_no',
|
||||
'beam_no',
|
||||
|
||||
'mu_max',
|
||||
'mu_min',
|
||||
|
||||
'dose',
|
||||
'fractions',
|
||||
'iso_dose_curve',
|
||||
|
||||
'dmin',
|
||||
'dmax',
|
||||
'dmean',
|
||||
|
||||
'coverage',
|
||||
'ci',
|
||||
'nci',
|
||||
|
||||
'start_date',
|
||||
'end_date',
|
||||
|
||||
'memo',
|
||||
]
|
512
mysite/ck/migrations.bak/0001_initial.py
Executable file
512
mysite/ck/migrations.bak/0001_initial.py
Executable file
|
@ -0,0 +1,512 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Activity',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('title', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='DiseaseStage',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('stage', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ElectronicMedicalReport',
|
||||
fields=[
|
||||
('report_key', models.CharField(max_length=200, serialize=False, primary_key=True)),
|
||||
('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)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Followup',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('date', models.DateField()),
|
||||
('memo', models.CharField(max_length=200, null=True, blank=True)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='ICD9Diag',
|
||||
fields=[
|
||||
('code', models.CharField(max_length=5, serialize=False, primary_key=True)),
|
||||
('desc', models.CharField(max_length=50)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Lesion',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('dimensions', models.CharField(max_length=200)),
|
||||
('volume', models.DecimalField(max_digits=9, decimal_places=2)),
|
||||
('plan_name', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('collimator', models.CharField(max_length=200)),
|
||||
('path_no', models.IntegerField()),
|
||||
('beam_no', models.IntegerField()),
|
||||
('mu_max', models.DecimalField(max_digits=9, decimal_places=2)),
|
||||
('mu_min', models.DecimalField(max_digits=9, decimal_places=2)),
|
||||
('dose', models.IntegerField()),
|
||||
('fractions', models.IntegerField()),
|
||||
('iso_dose_curve', models.IntegerField()),
|
||||
('dmin', models.DecimalField(max_digits=9, decimal_places=2)),
|
||||
('dmax', models.DecimalField(max_digits=9, decimal_places=2)),
|
||||
('coverage', models.DecimalField(max_digits=9, decimal_places=2)),
|
||||
('ci', models.DecimalField(max_digits=9, decimal_places=2)),
|
||||
('nci', models.DecimalField(max_digits=9, decimal_places=2)),
|
||||
('start_date', models.DateField(null=True, blank=True)),
|
||||
('end_date', models.DateField(null=True, blank=True)),
|
||||
('memo', models.CharField(max_length=200, null=True, blank=True)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='LesionFollow',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('Date', models.DateField(verbose_name=b'\xe8\xbf\xbd\xe8\xb9\xa4\xe6\x97\xa5\xe6\x9c\x9f')),
|
||||
('Volume', models.FloatField(null=True, verbose_name=b'\xe9\xab\x94\xe7\xa9\x8d(mm3)')),
|
||||
('A', models.FloatField(null=True, verbose_name=b'\xe9\x95\xb7(mm)')),
|
||||
('B', models.FloatField(null=True, verbose_name=b'\xe5\xaf\xac(mm)')),
|
||||
('C', models.FloatField(null=True, verbose_name=b'\xe9\xab\x98(mm)')),
|
||||
('Memo', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('Lesion', models.ForeignKey(to='ck.Lesion')),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='MedicalRecord',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('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=b'\xe7\xa7\x91')),
|
||||
('InDate', models.DateField(verbose_name=b'\xe5\x85\xa5')),
|
||||
('OutDate', models.DateField(null=True, verbose_name=b'\xe5\x87\xba')),
|
||||
('WardName', models.CharField(max_length=200, null=True, verbose_name=b'\xe6\x88\xbf')),
|
||||
('RoomName', models.CharField(max_length=200, null=True, verbose_name=b'\xe5\xae\xa4')),
|
||||
('BedName', models.CharField(max_length=200, null=True, verbose_name=b'\xe5\xba\x8a')),
|
||||
('MainDrName', models.CharField(max_length=200, null=True, verbose_name=b'\xe4\xb8\xbb\xe6\xb2\xbb')),
|
||||
('MainDiagnosisName', models.CharField(max_length=200, null=True, verbose_name=b'\xe8\xa8\xba\xe6\x96\xb7')),
|
||||
('StatusName', models.CharField(max_length=200, null=True, verbose_name=b'\xe7\x8b\x80\xe6\x85\x8b')),
|
||||
('SpecialCureName', models.CharField(max_length=200, null=True, verbose_name=b'\xe8\xa1\x8c\xe7\x82\xba')),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Oncologist',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='OPNote',
|
||||
fields=[
|
||||
('key_code', models.CharField(max_length=200, serialize=False, primary_key=True)),
|
||||
('key_name', models.CharField(max_length=200)),
|
||||
('doc', models.TextField(null=True, verbose_name=b'\xe6\x91\x98')),
|
||||
('saved', models.DateField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PACSImage',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('PatChartNo', models.CharField(max_length=200, verbose_name=b'\xe7\x97\x85\xe6\xad\xb7\xe8\x99\x9f')),
|
||||
('RequestSheetNo', models.CharField(max_length=200, verbose_name=b'\xe5\x96\xae\xe8\x99\x9f')),
|
||||
('ExamDate', models.DateField(verbose_name=b'\xe6\xaa\xa2\xe6\x9f\xa5\xe6\x97\xa5')),
|
||||
('LinkOrderName', models.CharField(max_length=200, verbose_name=b'\xe6\xaa\xa2\xe6\x9f\xa5\xe5\x90\x8d\xe7\xa8\xb1')),
|
||||
('Modality', models.CharField(max_length=200, verbose_name=b'\xe5\x84\x80\xe5\x99\xa8')),
|
||||
('VerifiedStateString', models.CharField(max_length=200, verbose_name=b'\xe7\x8b\x80\xe6\x85\x8b')),
|
||||
('Exam', models.TextField(null=True, verbose_name=b'\xe5\xa0\xb1\xe5\x91\x8a\xe5\x85\xa7\xe5\xae\xb9')),
|
||||
('Impression', models.TextField(null=True)),
|
||||
('Report', models.TextField(null=True, verbose_name=b'\xe5\xa0\xb1\xe5\x91\x8a')),
|
||||
('Saved', models.IntegerField(verbose_name=b'\xe4\xbf\x9d\xe5\xad\x98', choices=[(0, b'\xe5\xbe\x85\xe8\x99\x95\xe7\x90\x86'), (10, b'\xe6\x9c\x89\xe8\xbc\xb8\xe5\x85\xa5'), (15, b'\xe5\xb7\xb2\xe7\xa2\xba\xe8\xaa\x8d'), (20, b'\xe4\xb8\x8d\xe9\x81\xa9\xe7\x94\xa8')])),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PathExam',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('path_code', models.CharField(unique=True, max_length=200, verbose_name=b'\xe7\x97\x85\xe7\x90\x86\xe8\x99\x9f')),
|
||||
('specimen_code', models.CharField(max_length=200, verbose_name=b'\xe6\xaa\xa2\xe9\xab\x94')),
|
||||
('specimen_get_date', models.DateField(verbose_name=b'\xe6\x94\xb6\xe4\xbb\xb6\xe6\x97\xa5')),
|
||||
('report_date', models.DateField(verbose_name=b'\xe5\xa0\xb1\xe5\x91\x8a\xe6\x97\xa5')),
|
||||
('division', models.CharField(max_length=200, verbose_name=b'\xe7\xa7\x91\xe5\x88\xa5')),
|
||||
('bed', models.CharField(max_length=200, null=True, verbose_name=b'\xe7\x97\x85\xe5\xba\x8a', blank=True)),
|
||||
('report', models.TextField(null=True, verbose_name=b'\xe6\xaa\xa2\xe6\x9f\xa5\xe5\xa0\xb1\xe5\x91\x8a', blank=True)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Pathology',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('pathology', models.CharField(unique=True, max_length=200)),
|
||||
('stage', models.ForeignKey(to='ck.DiseaseStage')),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Patient',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=200, verbose_name=b'\xe5\xa7\x93\xe5\x90\x8d')),
|
||||
('medical_records', models.CharField(unique=True, max_length=200)),
|
||||
('gender', models.IntegerField(choices=[(1, b'Male'), (2, b'Female')])),
|
||||
('birthday', models.DateField()),
|
||||
('address', models.CharField(max_length=200)),
|
||||
('phone', models.CharField(max_length=200)),
|
||||
('id_cards', models.CharField(unique=True, max_length=200)),
|
||||
('memo', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('dead', models.DateField(null=True, blank=True)),
|
||||
('height', models.DecimalField(null=True, max_digits=4, decimal_places=1)),
|
||||
('weight', models.DecimalField(null=True, max_digits=6, decimal_places=3)),
|
||||
('native', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('past_and_family_history', models.TextField(null=True, blank=True)),
|
||||
('timestamp', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PatientMedicalRecord',
|
||||
fields=[
|
||||
('key_code', models.CharField(max_length=200, serialize=False, primary_key=True)),
|
||||
('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=b'\xe7\xa7\x91')),
|
||||
('in_date', models.DateField(null=True, verbose_name=b'\xe5\x85\xa5')),
|
||||
('out_date', models.DateField(null=True, verbose_name=b'\xe5\x87\xba')),
|
||||
('ward_name', models.CharField(max_length=200, null=True, verbose_name=b'\xe6\x88\xbf')),
|
||||
('room_name', models.CharField(max_length=200, null=True, verbose_name=b'\xe5\xae\xa4')),
|
||||
('bed_name', models.CharField(max_length=200, null=True, verbose_name=b'\xe5\xba\x8a')),
|
||||
('come_clinic_date', models.DateField(null=True, verbose_name=b'\xe6\x8e\x9b\xe8\x99\x9f\xe6\x97\xa5')),
|
||||
('discharge_date', models.DateField(null=True, verbose_name=b'\xe9\x9b\xa2\xe9\x83\xa8\xe6\x97\xa5')),
|
||||
('special_cure_name', models.CharField(max_length=200, null=True, verbose_name=b'\xe8\xa1\x8c\xe7\x82\xba')),
|
||||
('main_dr_name', models.CharField(max_length=200, null=True, verbose_name=b'\xe4\xb8\xbb\xe6\xb2\xbb')),
|
||||
('main_diagnosis_name', models.CharField(max_length=200, null=True, verbose_name=b'\xe8\xa8\xba\xe6\x96\xb7')),
|
||||
('status_name', models.CharField(max_length=200, null=True, verbose_name=b'\xe7\x8b\x80\xe6\x85\x8b')),
|
||||
('temp_bed_id', models.CharField(max_length=200, null=True, verbose_name=b'\xe5\xba\x8a')),
|
||||
('account_status_name', models.CharField(max_length=200, null=True, verbose_name=b'\xe7\x8b\x80\xe6\x85\x8b')),
|
||||
('func', models.CharField(max_length=200, null=True)),
|
||||
('doc', models.TextField(null=True, verbose_name=b'\xe6\x91\x98')),
|
||||
('saved', models.DateField(auto_now=True)),
|
||||
('patient', models.ForeignKey(to='ck.Patient')),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Price',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('code', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('identity', models.IntegerField(choices=[(10, b'\xe5\x81\xa5\xe4\xbf\x9d'), (20, b'\xe8\x87\xaa\xe8\xb2\xbb'), (30, b'\xe5\x85\xa7\xe5\x90\xab')])),
|
||||
('name', models.CharField(max_length=200)),
|
||||
('unit', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('address', models.IntegerField(null=True, blank=True)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PrimaryTumorSite',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('site', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PriorTreatment',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('date', models.DateField()),
|
||||
('treatment', models.IntegerField(choices=[(1, b'Surgery'), (2, b'Biopsy'), (3, b'RT'), (4, b'Radiosurgery'), (5, b'Chemotherapy')])),
|
||||
('period', models.IntegerField(blank=True, null=True, choices=[(1, b'Before'), (2, b'Concurrent'), (3, b'None')])),
|
||||
('dose', models.IntegerField(null=True, blank=True)),
|
||||
('memo', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('patient', models.ForeignKey(to='ck.Patient')),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='SubLocation',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('group', models.IntegerField()),
|
||||
('sub_location', models.CharField(max_length=200)),
|
||||
('pathology', models.ManyToManyField(to='ck.Pathology')),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Surgeon',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('name', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TargetLocation',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('location', models.CharField(max_length=200)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='Treatment',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('bed', models.CharField(max_length=200, null=True, verbose_name=b'\xe7\x97\x85\xe5\xba\x8a\xe8\x99\x9f', blank=True)),
|
||||
('other_diagnosis', models.CharField(max_length=200, null=True, verbose_name=b'\xe5\x85\xb6\xe4\xbb\x96\xe8\xa8\xba\xe6\x96\xb7', blank=True)),
|
||||
('tracking_mode', models.IntegerField(blank=True, null=True, choices=[(100, b'6D Skull'), (200, b'Xsight-Spine'), (210, b'Xsight-Lung'), (300, b'Fiducial'), (400, b'Synchrony')])),
|
||||
('referral', models.CharField(max_length=200, null=True, verbose_name=b'\xe8\xbd\x89\xe4\xbb\x8b\xe9\x86\xab\xe5\xb8\xab', blank=True)),
|
||||
('date_started', models.DateField(null=True, blank=True)),
|
||||
('date_completed', models.DateField(null=True, blank=True)),
|
||||
('accounting', models.IntegerField(blank=True, null=True, verbose_name=b'\xe8\xa8\x98\xe5\xb8\xb3\xe5\x88\xa5', choices=[(10, b'\xe5\x81\xa5\xe4\xbf\x9d'), (20, b'\xe8\x87\xaa\xe8\xb2\xbb'), (30, b'\xe5\x85\xa7\xe5\x90\xab')])),
|
||||
('karnofsky_score', models.IntegerField(blank=True, null=True, choices=[(100, b'100% - normal, no complaints, no signs of disease'), (90, b' 90% - capable of normal activity, few symptoms or signs of disease'), (80, b' 80% - normal activity with some difficulty, some symptoms or signs'), (70, b' 70% - caring for self, not capable of normal activity or work'), (60, b' 60% - requiring some help, can take care of most personal requirements'), (50, b' 50% - requires help often, requires frequent medical care'), (40, b' 40% - disabled, requires special care and help'), (30, b' 30% - severely disabled, hospital admission indicated but no risk of death'), (20, b' 20% - very ill, urgently requiring admission, requires supportive measures or treatment'), (10, b' 10% - moribund, rapidly progressive fatal disease processes'), (0, b' 0% - death')])),
|
||||
('complications', models.CharField(max_length=200, null=True, verbose_name=b'\xe4\xbd\xb5\xe7\x99\xbc\xe7\x97\x87', blank=True)),
|
||||
('chief_complaint', models.TextField(null=True, blank=True)),
|
||||
('memo', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('timestamp', models.DateTimeField(auto_now=True)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='TreatmentResponse',
|
||||
fields=[
|
||||
('treatment', models.ForeignKey(primary_key=True, serialize=False, to='ck.Treatment')),
|
||||
('time', models.DateField(null=True)),
|
||||
('event', models.NullBooleanField()),
|
||||
('time1y', models.DateField(null=True)),
|
||||
('event1y', models.NullBooleanField()),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='VEVENT',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('DTSTAMP', models.DateTimeField(auto_now=True)),
|
||||
('DTSTART', models.DateTimeField()),
|
||||
('DTEND', models.TimeField(blank=True)),
|
||||
('DURATION', models.TimeField()),
|
||||
('SUMMARY', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('CLASS', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('CATEGORIES', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('TRANSP', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('RRULE', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('DESCRIPTION', models.CharField(max_length=200, null=True, blank=True)),
|
||||
('mode', models.IntegerField(choices=[(110, b'Fiducial'), (200, b'\xe5\x9b\xba\xe5\xae\x9a\xe5\x99\xa8'), (210, b'CT'), (220, b'MRI'), (230, b'Angio'), (310, b'\xe6\xb2\xbb\xe7\x99\x82')])),
|
||||
('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, to='ck.Price', null=True)),
|
||||
('treatment', models.ForeignKey(to='ck.Treatment')),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='XrayTextReport',
|
||||
fields=[
|
||||
('report_key', models.ForeignKey(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)),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='disease_stage',
|
||||
field=models.ForeignKey(blank=True, to='ck.DiseaseStage', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='icd9',
|
||||
field=models.ForeignKey(verbose_name=b'ICD9\xe8\xa8\xba\xe6\x96\xb7', blank=True, to='ck.ICD9Diag', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='input',
|
||||
field=models.ForeignKey(related_name='input', verbose_name=b'\xe5\xb7\xb2', blank=True, to='ck.Activity', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='oncologist',
|
||||
field=models.ForeignKey(blank=True, to='ck.Oncologist', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='output',
|
||||
field=models.ForeignKey(related_name='output', verbose_name=b'\xe5\xbe\x85', blank=True, to='ck.Activity', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='patient',
|
||||
field=models.ForeignKey(to='ck.Patient'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='primary_tumor_site',
|
||||
field=models.ForeignKey(blank=True, to='ck.PrimaryTumorSite', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='surgeon',
|
||||
field=models.ForeignKey(blank=True, to='ck.Surgeon', null=True),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='sublocation',
|
||||
name='target_location',
|
||||
field=models.ForeignKey(to='ck.TargetLocation'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='pathexam',
|
||||
name='patient',
|
||||
field=models.ForeignKey(to='ck.Patient'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='pacsimage',
|
||||
name='patient',
|
||||
field=models.ForeignKey(to='ck.Patient'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='opnote',
|
||||
name='patient',
|
||||
field=models.ForeignKey(to='ck.Patient'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='medicalrecord',
|
||||
name='patient',
|
||||
field=models.ForeignKey(to='ck.Patient'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='lesion',
|
||||
name='pathology',
|
||||
field=models.ForeignKey(to='ck.Pathology'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='lesion',
|
||||
name='sub_location',
|
||||
field=models.ForeignKey(to='ck.SubLocation'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='lesion',
|
||||
name='treatment',
|
||||
field=models.ForeignKey(to='ck.Treatment'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='followup',
|
||||
name='patient',
|
||||
field=models.ForeignKey(to='ck.Patient'),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='electronicmedicalreport',
|
||||
name='patient',
|
||||
field=models.ForeignKey(to='ck.Patient'),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
39
mysite/ck/migrations.bak/0002_auto_20160113_0821.py
Executable file
39
mysite/ck/migrations.bak/0002_auto_20160113_0821.py
Executable file
|
@ -0,0 +1,39 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='ICD10CMfinal',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('ICD9CM_code', models.CharField(max_length=255, verbose_name='ICD-9-CM\u4ee3\u78bc', db_column='ICD-9-CM\u4ee3\u78bc')),
|
||||
('ICD9CM_English', models.CharField(max_length=255, verbose_name='ICD-9-CM\u82f1\u6587\u540d\u7a31', db_column='ICD-9-CM\u82f1\u6587\u540d\u7a31')),
|
||||
('ICD9CM_Chinese', models.CharField(max_length=255, verbose_name='ICD-9-CM\u4e2d\u6587\u540d\u7a31', db_column='ICD-9-CM\u4e2d\u6587\u540d\u7a31')),
|
||||
('ICD10CM', models.CharField(max_length=255, verbose_name='ICD-10-CM', db_column='ICD-10-CM')),
|
||||
('ICD10CM_English', models.CharField(max_length=255, verbose_name='ICD-10-CM\u82f1\u6587\u540d\u7a31', db_column='ICD-10-CM\u82f1\u6587\u540d\u7a31')),
|
||||
('ICD10CM_Chinese', models.CharField(max_length=255, verbose_name='ICD-10-CM\u4e2d\u6587\u540d\u7a31', db_column='ICD-10-CM\u4e2d\u6587\u540d\u7a31')),
|
||||
('Corresponding', models.CharField(max_length=255, verbose_name='\u5c0d\u61c9\u60c5\u5f62', db_column='\u5c0d\u61c9\u60c5\u5f62')),
|
||||
],
|
||||
options={
|
||||
'db_table': 'ICD10CMfinal',
|
||||
},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='price',
|
||||
options={'ordering': ['code', 'identity', 'name']},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='icd10cm',
|
||||
field=models.ForeignKey(verbose_name=b'ICD-10-CM', blank=True, to='ck.ICD10CMfinal', null=True),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations.bak/0003_auto_20160113_0830.py
Executable file
18
mysite/ck/migrations.bak/0003_auto_20160113_0830.py
Executable file
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0002_auto_20160113_0821'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='icd10cmfinal',
|
||||
options={'managed': False},
|
||||
),
|
||||
]
|
18
mysite/ck/migrations.bak/0004_remove_treatment_icd10cm.py
Executable file
18
mysite/ck/migrations.bak/0004_remove_treatment_icd10cm.py
Executable file
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0003_auto_20160113_0830'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='treatment',
|
||||
name='icd10cm',
|
||||
),
|
||||
]
|
19
mysite/ck/migrations.bak/0005_treatment_icd10cm.py
Executable file
19
mysite/ck/migrations.bak/0005_treatment_icd10cm.py
Executable file
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0004_remove_treatment_icd10cm'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='icd10cm',
|
||||
field=models.ForeignKey(verbose_name=b'ICD-10-CM', blank=True, to='ck.ICD10CMfinal', null=True),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations.bak/0006_auto_20160114_0438.py
Executable file
18
mysite/ck/migrations.bak/0006_auto_20160114_0438.py
Executable file
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0005_treatment_icd10cm'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='icd10cmfinal',
|
||||
options={},
|
||||
),
|
||||
]
|
18
mysite/ck/migrations.bak/0007_auto_20160114_0512.py
Executable file
18
mysite/ck/migrations.bak/0007_auto_20160114_0512.py
Executable file
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0006_auto_20160114_0438'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='icd10cmfinal',
|
||||
options={'managed': False},
|
||||
),
|
||||
]
|
18
mysite/ck/migrations.bak/0008_remove_treatment_icd10cm.py
Executable file
18
mysite/ck/migrations.bak/0008_remove_treatment_icd10cm.py
Executable file
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0007_auto_20160114_0512'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='treatment',
|
||||
name='icd10cm',
|
||||
),
|
||||
]
|
19
mysite/ck/migrations.bak/0009_treatment_icd10cm.py
Executable file
19
mysite/ck/migrations.bak/0009_treatment_icd10cm.py
Executable file
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0008_remove_treatment_icd10cm'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='icd10cm',
|
||||
field=models.ForeignKey(verbose_name=b'ICD-10-CM', blank=True, to='ck.ICD10CMfinal', null=True),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations.bak/0010_auto_20160114_0544.py
Executable file
18
mysite/ck/migrations.bak/0010_auto_20160114_0544.py
Executable file
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0009_treatment_icd10cm'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='icd10cmfinal',
|
||||
options={},
|
||||
),
|
||||
]
|
27
mysite/ck/migrations.bak/0011_auto_20160114_0544.py
Executable file
27
mysite/ck/migrations.bak/0011_auto_20160114_0544.py
Executable file
|
@ -0,0 +1,27 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0010_auto_20160114_0544'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RemoveField(
|
||||
model_name='icd10cmfinal',
|
||||
name='id',
|
||||
),
|
||||
migrations.RemoveField(
|
||||
model_name='treatment',
|
||||
name='icd10cm',
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='icd10cmfinal',
|
||||
name='ICD10CM',
|
||||
field=models.CharField(max_length=8, serialize=False, verbose_name='ICD-10-CM', primary_key=True, db_column='ICD-10-CM'),
|
||||
),
|
||||
]
|
19
mysite/ck/migrations.bak/0012_treatment_icd10cm.py
Executable file
19
mysite/ck/migrations.bak/0012_treatment_icd10cm.py
Executable file
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0011_auto_20160114_0544'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='treatment',
|
||||
name='icd10cm',
|
||||
field=models.ForeignKey(verbose_name=b'ICD-10-CM', blank=True, to='ck.ICD10CMfinal', null=True),
|
||||
),
|
||||
]
|
19
mysite/ck/migrations.bak/0013_auto_20160114_0555.py
Executable file
19
mysite/ck/migrations.bak/0013_auto_20160114_0555.py
Executable file
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0012_treatment_icd10cm'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='icd10cmfinal',
|
||||
name='ICD10CM',
|
||||
field=models.CharField(max_length=8, serialize=False, verbose_name='ICD10CM', primary_key=True, db_column='ICD-10-CM'),
|
||||
),
|
||||
]
|
19
mysite/ck/migrations.bak/0014_auto_20160114_0556.py
Executable file
19
mysite/ck/migrations.bak/0014_auto_20160114_0556.py
Executable file
|
@ -0,0 +1,19 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0013_auto_20160114_0555'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='icd10cmfinal',
|
||||
name='ICD10CM',
|
||||
field=models.CharField(max_length=8, serialize=False, verbose_name='ICD-10-CM', primary_key=True, db_column='ICD10CM'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations.bak/0015_auto_20160114_0729.py
Executable file
18
mysite/ck/migrations.bak/0015_auto_20160114_0729.py
Executable file
|
@ -0,0 +1,18 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0014_auto_20160114_0556'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='icd10cmfinal',
|
||||
options={'managed': False},
|
||||
),
|
||||
]
|
36
mysite/ck/migrations.bak/0016_auto_20190102_0835.py
Normal file
36
mysite/ck/migrations.bak/0016_auto_20190102_0835.py
Normal file
|
@ -0,0 +1,36 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# Generated by Django 1.11.6 on 2019-01-02 08:35
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0015_auto_20160114_0729'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='vevent',
|
||||
name='mode_remark',
|
||||
field=models.CharField(blank=True, max_length=200, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='treatmentresponse',
|
||||
name='treatment',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='ck.Treatment'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='vevent',
|
||||
name='mode',
|
||||
field=models.IntegerField(choices=[(110, b'Fiducial'), (200, b'\xe5\x9b\xba\xe5\xae\x9a\xe5\x99\xa8'), (210, b'CT'), (220, b'MRI'), (230, b'Angio'), (300, b'\xe9\xa0\x90\xe6\x8e\x92'), (310, b'\xe6\xb2\xbb\xe7\x99\x82')]),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='xraytextreport',
|
||||
name='report_key',
|
||||
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='ck.ElectronicMedicalReport'),
|
||||
),
|
||||
]
|
0
mysite/ck/migrations.bak/__init__.py
Executable file
0
mysite/ck/migrations.bak/__init__.py
Executable file
404
mysite/ck/migrations/0001_initial.py
Normal file
404
mysite/ck/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,404 @@
|
|||
# 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'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0002_auto_20210224_0919.py
Normal file
18
mysite/ck/migrations/0002_auto_20210224_0919.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-24 09:19
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='OrderName',
|
||||
field=models.CharField(max_length=20),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0003_auto_20210224_0920.py
Normal file
18
mysite/ck/migrations/0003_auto_20210224_0920.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-24 09:20
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0002_auto_20210224_0919'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='Quantity',
|
||||
field=models.CharField(max_length=10, null=True),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0004_auto_20210224_0921.py
Normal file
18
mysite/ck/migrations/0004_auto_20210224_0921.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-24 09:21
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0003_auto_20210224_0920'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineDate',
|
||||
field=models.CharField(max_length=10, null=True),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0005_auto_20210224_0922.py
Normal file
18
mysite/ck/migrations/0005_auto_20210224_0922.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-24 09:22
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0004_auto_20210224_0921'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='PatientName',
|
||||
field=models.CharField(max_length=20),
|
||||
),
|
||||
]
|
78
mysite/ck/migrations/0006_auto_20210224_1038.py
Normal file
78
mysite/ck/migrations/0006_auto_20210224_1038.py
Normal file
|
@ -0,0 +1,78 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-24 10:38
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0005_auto_20210224_0922'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ApplyDoctor',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='申請醫師'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ApplyTypeDesc',
|
||||
field=models.CharField(max_length=10, verbose_name='申請類別'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ChartNo',
|
||||
field=models.CharField(max_length=10, verbose_name='病歷號'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineDate',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='核定日期'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineQuantity',
|
||||
field=models.CharField(max_length=10, verbose_name='核定數量'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='NhiDeptName',
|
||||
field=models.CharField(max_length=10, verbose_name='科別'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='OrderCode',
|
||||
field=models.CharField(max_length=10, verbose_name='申請項目'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='OrderName',
|
||||
field=models.CharField(max_length=20, verbose_name='項目名稱'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='PackageTime',
|
||||
field=models.CharField(max_length=10, verbose_name='送案日期'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='PatientName',
|
||||
field=models.CharField(max_length=20, verbose_name='病患姓名'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='Quantity',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='核定結果'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ResultDesc',
|
||||
field=models.CharField(max_length=10, verbose_name='申請數量'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='StatusDesc',
|
||||
field=models.CharField(max_length=10, verbose_name='案件狀態'),
|
||||
),
|
||||
]
|
25
mysite/ck/migrations/0007_auto_20210224_1134.py
Normal file
25
mysite/ck/migrations/0007_auto_20210224_1134.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-24 11:34
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.utils.timezone
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0006_auto_20210224_1038'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='timestamp',
|
||||
field=models.DateTimeField(auto_now_add=True, default=django.utils.timezone.now),
|
||||
preserve_default=False,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='updated',
|
||||
field=models.DateTimeField(auto_now=True),
|
||||
),
|
||||
]
|
33
mysite/ck/migrations/0008_auto_20210224_1139.py
Normal file
33
mysite/ck/migrations/0008_auto_20210224_1139.py
Normal file
|
@ -0,0 +1,33 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-24 11:39
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0007_auto_20210224_1134'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineDate',
|
||||
field=models.DateField(null=True, verbose_name='核定日期'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineQuantity',
|
||||
field=models.IntegerField(verbose_name='核定數量'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='PackageTime',
|
||||
field=models.DateField(verbose_name='送案日期'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ResultDesc',
|
||||
field=models.IntegerField(verbose_name='申請數量'),
|
||||
),
|
||||
]
|
23
mysite/ck/migrations/0009_auto_20210226_0406.py
Normal file
23
mysite/ck/migrations/0009_auto_20210226_0406.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-26 04:06
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0008_auto_20210224_1139'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='treatmentresponse',
|
||||
name='event',
|
||||
field=models.BooleanField(null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='treatmentresponse',
|
||||
name='event1y',
|
||||
field=models.BooleanField(null=True),
|
||||
),
|
||||
]
|
93
mysite/ck/migrations/0010_auto_20210226_0444.py
Normal file
93
mysite/ck/migrations/0010_auto_20210226_0444.py
Normal file
|
@ -0,0 +1,93 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-26 04:44
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0009_auto_20210226_0406'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='AnticancerMedicine',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='抗癌藥物'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ApplyDate',
|
||||
field=models.DateField(null=True, verbose_name='申請日期'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ApplyPart',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='申請部位'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ApplyQty',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='申請量'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ApplyType',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='申請類別'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='Diagnosis',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='疾病分類號'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='EmrDateStr',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='緊急通報日'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineDateStr',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='核定日期'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineReason1',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='核定原因1'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineReason2',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='核定原因2'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineReasonDesc',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='核定原因說明'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='NhiDept',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='申請科別'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='Phone',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='聯絡分機'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='Reason',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='申請原因'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='PackageTime',
|
||||
field=models.DateField(null=True, verbose_name='送案日期'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ResultDesc',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='核定結果'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0011_auto_20210226_0445.py
Normal file
18
mysite/ck/migrations/0011_auto_20210226_0445.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-26 04:45
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0010_auto_20210226_0444'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ResultDesc',
|
||||
field=models.IntegerField(verbose_name='申請數量'),
|
||||
),
|
||||
]
|
28
mysite/ck/migrations/0012_auto_20210226_0459.py
Normal file
28
mysite/ck/migrations/0012_auto_20210226_0459.py
Normal file
|
@ -0,0 +1,28 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-26 04:59
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0011_auto_20210226_0445'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='ErrorMsg',
|
||||
field=models.CharField(max_length=10, null=True),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='Status',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='目前狀態'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='SuccessMsg',
|
||||
field=models.CharField(max_length=10, null=True),
|
||||
),
|
||||
]
|
23
mysite/ck/migrations/0013_auto_20210226_0513.py
Normal file
23
mysite/ck/migrations/0013_auto_20210226_0513.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-26 05:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0012_auto_20210226_0459'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ApplyQty',
|
||||
field=models.IntegerField(null=True, verbose_name='申請量'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='PackageTime',
|
||||
field=models.DateField(verbose_name='送案日期'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0014_auto_20210226_1526.py
Normal file
18
mysite/ck/migrations/0014_auto_20210226_1526.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-26 15:26
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0013_auto_20210226_0513'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='Reason',
|
||||
field=models.TextField(null=True, verbose_name='申請原因'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0015_auto_20210226_1534.py
Normal file
18
mysite/ck/migrations/0015_auto_20210226_1534.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-26 15:34
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0014_auto_20210226_1526'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineReasonDesc',
|
||||
field=models.TextField(null=True, verbose_name='核定原因說明'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0016_nhiorder_maindrnames.py
Normal file
18
mysite/ck/migrations/0016_nhiorder_maindrnames.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-26 23:13
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0015_auto_20210226_1534'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='MainDrNames',
|
||||
field=models.TextField(null=True, verbose_name='主治'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0017_auto_20210226_2346.py
Normal file
18
mysite/ck/migrations/0017_auto_20210226_2346.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-26 23:46
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0016_nhiorder_maindrnames'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.RenameField(
|
||||
model_name='nhiorder',
|
||||
old_name='MainDrNames',
|
||||
new_name='MainDrName',
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0018_nhiorder_priority.py
Normal file
18
mysite/ck/migrations/0018_nhiorder_priority.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-02-27 08:28
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0017_auto_20210226_2346'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='Priority',
|
||||
field=models.IntegerField(null=True, verbose_name='優先'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0019_nhiorder_memo.py
Normal file
18
mysite/ck/migrations/0019_nhiorder_memo.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-03-09 15:58
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0018_nhiorder_priority'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='Memo',
|
||||
field=models.TextField(null=True, verbose_name='備忘'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0020_auto_20210311_0908.py
Normal file
18
mysite/ck/migrations/0020_auto_20210311_0908.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-03-11 09:08
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0019_nhiorder_memo'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ExamineQuantity',
|
||||
field=models.IntegerField(null=True, verbose_name='核定數量'),
|
||||
),
|
||||
]
|
23
mysite/ck/migrations/0021_auto_20210315_0917.py
Normal file
23
mysite/ck/migrations/0021_auto_20210315_0917.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
# Generated by Django 3.1.5 on 2021-03-15 09:17
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0020_auto_20210311_0908'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='nhiorder',
|
||||
name='num_sessions',
|
||||
field=models.IntegerField(null=True, verbose_name='預計分次'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='ResultDesc',
|
||||
field=models.IntegerField(default=1, verbose_name='申請數量'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0022_auto_20210317_1643.py
Normal file
18
mysite/ck/migrations/0022_auto_20210317_1643.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-03-17 08:43
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0021_auto_20210315_0917'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='nhiorder',
|
||||
name='num_sessions',
|
||||
field=models.CharField(max_length=10, null=True, verbose_name='預計分次'),
|
||||
),
|
||||
]
|
20
mysite/ck/migrations/0023_lesion_volume_measure.py
Normal file
20
mysite/ck/migrations/0023_lesion_volume_measure.py
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Generated by Django 3.1.5 on 2021-03-17 15:21
|
||||
|
||||
from django.db import migrations
|
||||
import django_measurement.models
|
||||
import measurement.measures.volume
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0022_auto_20210317_1643'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='lesion',
|
||||
name='volume_measure',
|
||||
field=django_measurement.models.MeasurementField(measurement=measurement.measures.volume.Volume, null=True),
|
||||
),
|
||||
]
|
40
mysite/ck/migrations/0024_auto_20210318_1142.py
Normal file
40
mysite/ck/migrations/0024_auto_20210318_1142.py
Normal file
|
@ -0,0 +1,40 @@
|
|||
# Generated by Django 3.1.5 on 2021-03-18 03:42
|
||||
|
||||
from django.db import migrations, models
|
||||
import django_measurement.models
|
||||
import measurement.measures.volume
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0023_lesion_volume_measure'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='lesion',
|
||||
name='iso_dose_curve',
|
||||
field=models.DecimalField(decimal_places=1, max_digits=9),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='lesion',
|
||||
name='mu_max',
|
||||
field=models.DecimalField(decimal_places=2, max_digits=9, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='lesion',
|
||||
name='mu_min',
|
||||
field=models.DecimalField(decimal_places=2, max_digits=9, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='lesion',
|
||||
name='volume',
|
||||
field=models.DecimalField(decimal_places=2, max_digits=9, null=True, verbose_name='Target Volume(mm3)'),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='lesion',
|
||||
name='volume_measure',
|
||||
field=django_measurement.models.MeasurementField(measurement=measurement.measures.volume.Volume, null=True, verbose_name='Target Volume'),
|
||||
),
|
||||
]
|
18
mysite/ck/migrations/0025_lesion_collimator_type.py
Normal file
18
mysite/ck/migrations/0025_lesion_collimator_type.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.1.5 on 2021-03-18 03:57
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ck', '0024_auto_20210318_1142'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='lesion',
|
||||
name='collimator_type',
|
||||
field=models.IntegerField(choices=[(10, 'fixed'), (20, 'Iris'), (30, 'MLC')], default=10),
|
||||
),
|
||||
]
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue