-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] models: Patient Allergy & Disease models
- Loading branch information
Showing
4 changed files
with
135 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2015-TODAY LasLabs Inc. | ||
# License MIT (https://opensource.org/licenses/MIT). | ||
|
||
from carepoint import Carepoint | ||
from sqlalchemy import (Column, | ||
Integer, | ||
String, | ||
DateTime, | ||
ForeignKey, | ||
) | ||
|
||
|
||
class PatientDisease(Carepoint.BASE): | ||
__tablename__ = 'cppat_dx' | ||
__dbname__ = 'cph' | ||
|
||
ptalr_id = Column(Integer, primary_key=True) | ||
pat_id = Column( | ||
Integer, | ||
ForeignKey('cppat.pat_id'), | ||
) | ||
name = Column(String) | ||
hicl_seqno = Column(Integer) | ||
hic = Column(Integer) | ||
dam_agcsp = Column(Integer) | ||
alr_type_cn = Column(Integer) | ||
onset_date = Column(DateTime) | ||
resolution_status_cn = Column(Integer) | ||
resolution_date = Column(DateTime) | ||
screen_yn = Column(Integer) | ||
cmt = Column(String) | ||
status_cn = Column(Integer) | ||
app_flags = Column(Integer) | ||
timestmp = Column(DateTime) | ||
ncd = Column(String) | ||
add_user_id = Column( | ||
Integer, | ||
ForeignKey('csuser.user_id'), | ||
) | ||
add_date = Column(DateTime) | ||
chg_user_id = Column( | ||
Integer, | ||
ForeignKey('csuser.user_id'), | ||
) | ||
chg_date = Column(DateTime) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2015-TODAY LasLabs Inc. | ||
# License MIT (https://opensource.org/licenses/MIT). | ||
|
||
from carepoint import Carepoint | ||
from sqlalchemy import (Column, | ||
Integer, | ||
String, | ||
DateTime, | ||
ForeignKey, | ||
Text, | ||
) | ||
|
||
|
||
class PatientDisease(Carepoint.BASE): | ||
__tablename__ = 'cppat_dx' | ||
__dbname__ = 'cph' | ||
|
||
ptdx_id = Column(Integer, primary_key=True) | ||
pat_id = Column( | ||
Integer, | ||
ForeignKey('cppat.pat_id'), | ||
) | ||
fdbdx = Column(String) | ||
icd9 = Column(String) | ||
name = Column(String) | ||
dx_date = Column(DateTime) | ||
caring_md_id = Column( | ||
Integer, | ||
ForeignKey('cpmd.md_id'), | ||
) | ||
onset_date = Column(DateTime) | ||
resolution_status_cn = Column(Integer) | ||
screen_yn = Column(Integer) | ||
mar_cmt = Column(Text) | ||
cmt = Column(Text) | ||
status_cn = Column(Integer) | ||
app_flags = Column(Integer) | ||
timestmp = Column(DateTime) | ||
primary_yn = Column(Integer) | ||
dxid = Column(Integer) | ||
icd10 = Column(String) | ||
icd10_name = Column(String) | ||
add_user_id = Column( | ||
Integer, | ||
ForeignKey('csuser.user_id'), | ||
) | ||
add_date = Column(DateTime) | ||
chg_user_id = Column( | ||
Integer, | ||
ForeignKey('csuser.user_id'), | ||
) | ||
chg_date = Column(DateTime) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2015-TODAY LasLabs Inc. | ||
# License MIT (https://opensource.org/licenses/MIT). | ||
|
||
import unittest | ||
from sqlalchemy.schema import Table | ||
from carepoint.tests.db.db import DatabaseTest | ||
from carepoint.models.cph.patient_allergy import PatientAllergy | ||
|
||
|
||
class TestModelsCphPatientAllergy(DatabaseTest): | ||
|
||
def test_table_initialization(self, ): | ||
self.assertIsInstance(PatientAllergy.__table__, Table) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# © 2015-TODAY LasLabs Inc. | ||
# License MIT (https://opensource.org/licenses/MIT). | ||
|
||
import unittest | ||
from sqlalchemy.schema import Table | ||
from carepoint.tests.db.db import DatabaseTest | ||
from carepoint.models.cph.patient_disease import PatientDisease | ||
|
||
|
||
class TestModelsCphPatientDisease(DatabaseTest): | ||
|
||
def test_table_initialization(self, ): | ||
self.assertIsInstance(PatientDisease.__table__, Table) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |