Добавлена БД Реестра Лекарственных Средств с сайта Мин.Здрав-а
This commit is contained in:
parent
2c01fb6fd2
commit
0948284f8a
31
mods/db.py
31
mods/db.py
|
@ -38,7 +38,38 @@ class Diag(DiagBaseModel):
|
||||||
category = ForeignKeyField(DiagCategory, backref='diagnosis')
|
category = ForeignKeyField(DiagCategory, backref='diagnosis')
|
||||||
code = CharField(32)
|
code = CharField(32)
|
||||||
title = TextField()
|
title = TextField()
|
||||||
|
####################################################################
|
||||||
|
rls_db_file = os.path.join(init_db_dir, 'rls.db')
|
||||||
|
rls_db = CSqliteExtDatabase(rls_db_file, pragmas={
|
||||||
|
'foreign_keys': 'on',
|
||||||
|
'ignore_check_constraints': 'off'})
|
||||||
|
|
||||||
|
class RlsBaseModel(Model):
|
||||||
|
'Базовая таблица'
|
||||||
|
class Meta:
|
||||||
|
database = rls_db
|
||||||
|
|
||||||
|
class RlsInitPharmacoTherapeuticGroup(RlsBaseModel):
|
||||||
|
id = AutoIncrementField()
|
||||||
|
title = TextField(null=True)
|
||||||
|
class RlsInitCountry(RlsBaseModel):
|
||||||
|
id = AutoIncrementField()
|
||||||
|
title = TextField(null=True)
|
||||||
|
class RlsInit(RlsBaseModel):
|
||||||
|
id = AutoIncrementField()
|
||||||
|
regnumber = TextField(null=True)
|
||||||
|
regdate = DateField(null=True)
|
||||||
|
enddate = DateField(null=True)
|
||||||
|
cancellationdate = DateField(null=True)
|
||||||
|
nameregcertificate = TextField(null=True)
|
||||||
|
country = ForeignKeyField(RlsInitCountry, backref='rlsinit')
|
||||||
|
tradename = TextField(null=True)
|
||||||
|
internationalname = TextField(null=True)
|
||||||
|
formrelease = TextField(null=True)
|
||||||
|
stages = TextField(null=True)
|
||||||
|
barcodes = TextField(null=True)
|
||||||
|
normativedocumentation = TextField(null=True)
|
||||||
|
pharmacotherapeuticgroup = ForeignKeyField(RlsInitPharmacoTherapeuticGroup, backref='rlsinit')
|
||||||
####################################################################
|
####################################################################
|
||||||
|
|
||||||
db = CSqliteExtDatabase(db_file, pragmas={
|
db = CSqliteExtDatabase(db_file, pragmas={
|
||||||
|
|
|
@ -40,7 +40,7 @@ if not len(q):
|
||||||
s_set_reception_list([8,0], [17,0], 30)
|
s_set_reception_list([8,0], [17,0], 30)
|
||||||
##########################
|
##########################
|
||||||
# Загрузка диагнозов МКБ 10
|
# Загрузка диагнозов МКБ 10
|
||||||
q = Diagnosis.select()
|
q = Diagnosis.select().limit(10)
|
||||||
if not len(q):
|
if not len(q):
|
||||||
diag_db.connect()
|
diag_db.connect()
|
||||||
__root_cat_map_ = {}
|
__root_cat_map_ = {}
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue