nyuvis / patient-viz

Visualization of electronic medical records or other sequence event data.
MIT License
92 stars 29 forks source link

Having trouble viewing patient after apparently successful install #55

Closed rkboyce closed 8 years ago

rkboyce commented 8 years ago

Hi,

Thanks for the great work! I am trying to run patient-viz against an OMOP CDM with simulated CMS data on my own postgres server. The installation went well (Ubuntu 15.04, postgres 9.4, Python 2.7, etc). I can start without any issue (though I need to run on port 2120). However, the default page shows no data or way to select data and when I try to access a specific patient, I get the following error from the UI:

http://localhost:2120/patient-viz/?p=json/123&d=json/dictionary.json

"Failed loading file: json/123. Note: put the file argument as 'p'."

The output on the command line is pasted below. Would you have any suggestions of what I can try? So far I have tried starting the server with "--max-num 10" and changing folder permissions under patient-viz to world read/write:

> quick_server.pyc (745):    4.305ms [2015-12-23 14:32:13] 13.6 kB "GET /patient-viz/?p=json/123&d=json/dictionary.json HTTP/1.1" 304
quick_server.pyc (745):    5.194ms [2015-12-23 14:32:13] 1.36 kB "GET /patient-viz/style.css HTTP/1.1" 304
quick_server.pyc (745):    5.488ms [2015-12-23 14:32:13] 143 kB "GET /patient-viz/lib/jk-js/lib/d3/d3.min.js HTTP/1.1" 304
quick_server.pyc (745):    6.064ms [2015-12-23 14:32:13] 18.5 kB "GET /patient-viz/lib/colorbrewer/colorbrewer.js HTTP/1.1" 304
quick_server.pyc (745):    4.261ms [2015-12-23 14:32:13] 3.49 kB "GET /patient-viz/lib/jk-js/jkjs/busy.js HTTP/1.1" 304
quick_server.pyc (745):    3.114ms [2015-12-23 14:32:13] 107 kB "GET /patient-viz/lib/jk-js/lib/bootstrap/css/bootstrap.min.css HTTP/1.1" 304
quick_server.pyc (745):    5.029ms [2015-12-23 14:32:13] 5.64 kB "GET /patient-viz/lib/jk-js/jkjs/zui.js HTTP/1.1" 304
quick_server.pyc (745):    0.265ms [2015-12-23 14:32:13] 682 B "GET /patient-viz/lib/jk-js/jkjs/time.js HTTP/1.1" 304
quick_server.pyc (745):    2.390ms [2015-12-23 14:32:13] 5.28 kB "GET /patient-viz/lib/jk-js/jkjs/text.js HTTP/1.1" 304
quick_server.pyc (745):    1.419ms [2015-12-23 14:32:13] 2.81 kB "GET /patient-viz/lib/jk-js/jkjs/path.js HTTP/1.1" 304
quick_server.pyc (745):    1.823ms [2015-12-23 14:32:13] 12.3 kB "GET /patient-viz/lib/jk-js/jkjs/util.js HTTP/1.1" 304
quick_server.pyc (745):    3.531ms [2015-12-23 14:32:13] 17.5 kB "GET /patient-viz/lib/jk-js/jkjs/stat.js HTTP/1.1" 304
quick_server.pyc (745):    0.363ms [2015-12-23 14:32:13] 34.2 kB "GET /patient-viz/js/typepool.js HTTP/1.1" 304
quick_server.pyc (745):    0.311ms [2015-12-23 14:32:13] 14.3 kB "GET /patient-viz/js/type.js HTTP/1.1" 304
quick_server.pyc (745):    0.279ms [2015-12-23 14:32:13] 7.65 kB "GET /patient-viz/js/event.js HTTP/1.1" 304
quick_server.pyc (745):    1.996ms [2015-12-23 14:32:13] 2.55 kB "GET /patient-viz/js/overview.js HTTP/1.1" 304
quick_server.pyc (745):    1.766ms [2015-12-23 14:32:13] 4.26 kB "GET /patient-viz/js/eventview.js HTTP/1.1" 304
quick_server.pyc (745):    1.628ms [2015-12-23 14:32:13] 12.6 kB "GET /patient-viz/js/typeview.js HTTP/1.1" 304
quick_server.pyc (745):    0.342ms [2015-12-23 14:32:13] 2.38 kB "GET /patient-viz/js/linechart.js HTTP/1.1" 304
quick_server.pyc (745):    0.280ms [2015-12-23 14:32:13] 4.14 kB "GET /patient-viz/js/histogram.js HTTP/1.1" 304
quick_server.pyc (745):    0.251ms [2015-12-23 14:32:13] 10.6 kB "GET /patient-viz/js/labels.js HTTP/1.1" 304
quick_server.pyc (745):    1.285ms [2015-12-23 14:32:13] 3.26 kB "GET /patient-viz/js/cluster.js HTTP/1.1" 304
quick_server.pyc (745):    1.011ms [2015-12-23 14:32:13] 18 kB "GET /patient-viz/js/shared.js HTTP/1.1" 304
quick_server.pyc (745):    2.025ms [2015-12-23 14:32:13] 1.64 kB "GET /patient-viz/lib/jk-js/jkjs/img/warning.png HTTP/1.1" 304
quick_server.pyc (745):    2.953ms [2015-12-23 14:32:13] 7.19 kB "GET /patient-viz/lib/jk-js/jkjs/img/busy.gif HTTP/1.1" 304
SELECT person_source_value, year_of_birth, gender_source_value FROM public.person WHERE person_id = '123';
SELECT person_source_value, year_of_birth, gender_source_value FROM public.person WHERE person_id = '123';
SELECT
            o.condition_occurrence_id as id_row,
            o.condition_start_date as date_start,
            o.condition_end_date as date_end,
            o.condition_concept_id as d_id,
            o.condition_source_value as d_orig,
            c.domain_id as d_domain,
            c.concept_name as d_name,
            c.vocabulary_id as d_vocab,
            c.concept_code as d_num
           FROM
            public.condition_occurrence as o
           LEFT JOIN public.concept as c ON (
            c.concept_id = o.condition_concept_id
           )
           WHERE
            o.person_id = '123'
        ;
SELECT
            o.procedure_occurrence_id as id_row,
            o.procedure_date as p_date,
            o.procedure_concept_id as p_id,
            o.procedure_source_value as p_orig,
            c.domain_id as p_domain,
            c.concept_name as p_name,
            c.vocabulary_id as p_vocab,
            c.concept_code as p_num,
            p.total_paid as p_cost
           FROM
            public.procedure_occurrence as o
           LEFT JOIN public.concept as c ON (
            c.concept_id = o.procedure_concept_id
           )
           LEFT OUTER JOIN public.procedure_cost as p ON (
            p.procedure_occurrence_id = o.procedure_occurrence_id
           )
           WHERE
            o.person_id = '123'
        ;
SELECT
            o.drug_exposure_id as id_row,
            o.drug_exposure_start_date as date_start,
            o.drug_exposure_end_date as date_end,
            o.drug_concept_id as m_id,
            o.drug_source_value as m_orig,
            c.domain_id as m_domain,
            c.concept_name as m_name,
            c.vocabulary_id as m_vocab,
            c.concept_code as m_num,
            p.total_paid as m_cost
           FROM
            public.drug_exposure as o
           LEFT JOIN public.concept as c ON (
            c.concept_id = o.drug_concept_id
           )
           LEFT OUTER JOIN public.drug_cost as p ON (
            p.drug_exposure_id = o.drug_exposure_id
           )
           WHERE
            o.person_id = '123'
        ;
SELECT
            o.measurement_id as id_row,
            o.measurement_date as m_date,
            o.measurement_concept_id as m_id,
            o.measurement_source_value as m_orig,
            o.value_source_value as m_orig_value,
            o.value_as_number as m_value,
            o.range_low as m_low,
            o.range_high as m_high,
            c.domain_id as m_domain,
            c.concept_name as m_name,
            c.vocabulary_id as m_vocab,
            c.concept_code as m_num
           FROM
            public.measurement as o
           LEFT JOIN public.concept as c ON (
            c.concept_id = o.measurement_concept_id
           )
           WHERE
            o.person_id = '123'
        ;
SELECT
             v.visit_start_date as date_start,
             v.visit_end_date as date_end,
             c.concept_name as c_name
            FROM
             public.visit_occurrence as v
            LEFT JOIN public.concept as c ON (
             v.visit_concept_id = c.concept_id
            ) WHERE
             v.person_id = '123'
             AND c.concept_name IN ( 'Inpatient Visit','in_hospital','occurrence','professional' )
        ;
SELECT
                 c.concept_id as c_id,
                 c.domain_id as c_domain,
                 c.concept_name as c_name,
                 c.vocabulary_id as c_vocab,
                 c.concept_code as c_num,
                 ca.min_levels_of_separation as c_distance,
                 ca.descendant_concept_id as c_desc_id,
                 cc.domain_id as c_desc_domain,
                 cc.vocabulary_id as c_desc_vocab
                FROM
                 public.concept_ancestor as ca
                LEFT JOIN public.concept as c ON (
                 c.concept_id = ca.ancestor_concept_id
                ) LEFT JOIN public.concept as cc ON (
                 cc.concept_id = ca.descendant_concept_id
                ) WHERE
                 ca.descendant_concept_id != 0
                 AND ca.ancestor_concept_id != 0
                 AND ca.descendant_concept_id IN ( 1000560,1186087,1195498,1322199,132736,132797,1328691,1332419,133364,133444,133711,133727,134159,1344905,136198,136932,137809,137829,1383952,139179,140648,140673,140708,1502856,1539411,1551192,1707687,19007332,19017068,19018811,19019117,19019239,19019412,19019418,19024060,19034269,19037684,19046742,19049335,19049378,19049684,19049904,19067080,19077684,19078924,19123951,192279,192673,193020,193322,193782,194306,194403,195306,195309,195847,196523,196991,197320,198307,198464,198700,198803,198985,2001430,2002189,200219,200445,201826,2100959,2105850,2108115,2108119,2108190,2108887,2108894,2109134,2211327,2211353,2211359,2211361,2211378,2211379,2211420,2211491,2211509,2211585,2211669,2211737,2211742,2211783,2211809,2211814,2211869,2213283,2313827,2313870,2313879,2313881,2313973,2314047,2314056,2314262,2314275,2314284,2314331,2414390,2414395,2414396,2414397,2414398,24909,2514399,2514407,2514408,2514409,2514414,2514422,2514423,2514424,2514433,2514436,2514437,2514442,2514457,2514458,2514459,253797,254061,254761,255573,255848,256451,257004,258780,259852,261687,2617289,261880,261883,26823,30770,312327,312437,312648,312922,313217,313878,314054,314658,314666,314971,315078,315832,316429,316995,316999,317000,317002,317009,317109,317576,319034,319049,319835,319843,320128,321041,321052,321318,372887,373425,374009,374375,375791,376229,376713,378256,378419,381832,40161825,40163312,40167196,40167213,40171751,40172592,40173888,40175182,40175218,40182064,40223187,40224320,40231932,40233964,40239501,40480128,40480429,40480555,40480602,40481042,40481852,40483189,40483287,40483538,40484013,4091464,4091467,4091469,4110192,4119158,4151250,4157333,4167696,4168222,4245252,42708386,42708401,42872402,4288310,43011816,43020432,4308509,432867,432937,432961,433168,433596,433736,433813,433968,433985,434374,434376,434500,434787,434810,434894,435082,435515,435517,435718,435739,435796,435928,436070,436075,436222,436230,436339,436375,436659,436665,437246,437247,437264,437521,437579,437643,437677,437688,437827,437904,438170,438178,438383,438438,438557,438720,438791,439697,439727,439777,439838,439846,440216,440276,440320,440383,440417,440846,441182,441258,441415,441417,441829,442011,442077,442147,442181,442306,442308,442427,443211,443430,443597,443614,444118,444406,72266,723013,72990,72994,74138,74174,749933,75860,76388,77670,77819,778296,78097,80180,80502,80809,80951,81611,81902,836719,906933,920757,932777,942384,957136,961269,992613 )
            ;
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Condition << Measurement
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Measurement << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Measurement << Procedure
WARNING: intra group inheritance: Measurement << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Measurement
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Measurement << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Measurement << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Measurement << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Measurement << Condition
WARNING: intra group inheritance: Measurement << Procedure
WARNING: intra group inheritance: Observation << Procedure
WARNING: intra group inheritance: Measurement << Procedure
quick_server.pyc (517): Traceback (most recent call last):
quick_server.pyc (517):   File "lib/quick_server/quick_server.py", line 619, in do_GET
quick_server.pyc (517):     if self.handle_special(True, 'GET'):
quick_server.pyc (517):   File "lib/quick_server/quick_server.py", line 392, in handle_special
quick_server.pyc (517):     f = method(self, args)
quick_server.pyc (517):   File "lib/quick_server/quick_server.py", line 990, in send_json
quick_server.pyc (517):     obj = json_producer(drh, rem_path)
quick_server.pyc (517):   File "./server.py", line 112, in get_patient
quick_server.pyc (517):     with open(cache_file, 'w') as pf:
quick_server.pyc (517): IOError: [Errno 2] No such file or directory: u'json/123'
JosuaKrause commented 8 years ago

Thanks for the bug report. Is there a folder json in your patient-viz folder? If not does creating one fix the problem?

rkboyce commented 8 years ago

Adding a 'json' folder did the trick! Thank you.

JosuaKrause commented 8 years ago

I fixed the server implementation to automatically create the json/ folder if needed. Thanks for the report :)