taskGNU Health - Tasks: task #12878, Include the EKG model to core


You are not allowed to post comments on this tracker with your current authentication level.

task #12878: Include the EKG model to core

Submitter:  Luis Falcon <meanmicio>
Submitted:  Wed 02 Oct 2013 09:15:41 PM UTC
Should Start On:  Wed 02 Oct 2013 12:00:00 AM UTC Should be Finished on:  Wed 01 Jul 2015 12:00:00 AM UTC
Category:  Functionality Priority:  5 - Normal
Status:  Ready For Test Privacy:  Public
Assigned to:  meanmicio Percent Complete:  100%
Open/Closed:  Open Release:  2.9.0
Module:  inpatient Component:  None

Jump to the original submission

Wed 10 Jun 2015 06:55:03 AM UTC, comment #7: 
Cédric Krier <cedk>
Tue 09 Jun 2015 11:48:53 PM UTC, comment #6: 

@Cédric: Yeah, that restriction on SQLite is annoying. If it were a static value to update, then I think a subquery could work. It's not a static update value though, so I don't actually know how to do it cleanly. However, from what I gather, every Health user should be running postgresql (!). So... maybe that's ok. =-) I updated it with your table suggestion. Thanks!

@Luis: Please do! I know I must've missed and/or broken something. Hehe.

Chris Zimmerman <teffalump>
Tue 09 Jun 2015 07:55:52 PM UTC, comment #5: 

Wonderful, Chris !

Thanks a lot. I'll be testing during the week.


Luis Falcon <meanmicio>
Group administrator
Tue 09 Jun 2015 07:07:14 AM UTC, comment #4: 

> a = Table('gnuhealth.patient.ecg')

is not correct. You should write:

> ECG = pool.get('gnuhealth.patient.ecg')
> a = ECG.__table__()

SQLite doesn't support the UPDATE/FROM so your query will fail on it.

PS: it will be easier if we were using a codereview tool.

Cédric Krier <cedk>
Tue 09 Jun 2015 04:42:23 AM UTC, comment #3: 

Thanks Cédric!

I just updated the code, using your suggestions.

Here it is:


I think I fixed the constraint naming in this commit (?!):


Chris Zimmerman <teffalump>
Mon 08 Jun 2015 06:17:09 AM UTC, comment #2: 

You should not write raw SQL queries in _register_
To add column, you shoud use the TableHandler.add_raw_column.
For update query, you should write a python-sql query.
To drop constraint, you should use Table.Handler.drop_constraint.

Otherwise the code will not work independently of the database backend.

Cédric Krier <cedk>
Sun 07 Jun 2015 11:07:16 PM UTC, comment #1: 

I just commited a pretty hefty patch to move the ECG class to the core. I've tested it but I would definitely like some double-checking.


The re-design is basically this:

- Move the class to the core (including xml files, etc)
- The required field is the patient, not an inpatient registration
- The health_inpatient module adds the optional inpatient_registration field

Now, ecgs can be used outpatient. I haven't added anything fundamentally new, just migrated the existing functionality.

I would definitely appreciate some more testing, especially on upgrading. The __register__ function should migrate the inpatient registration codes, deduce and update the patient info, but I'm worried. Hehe.

Chris Zimmerman <teffalump>
Wed 02 Oct 2013 09:15:41 PM UTC, original submission:  

The electrocardiogram class in currently on the ICU module.

Although is the right place to be, EKGs are also taken in an outpatient basis and for checkups.

We should include the EKG in the core.

Luis Falcon <meanmicio>
Group administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by cedk (Posted a comment)
  • -email is unavailable- added by teffalump (Posted a comment)
  • -email is unavailable- added by meanmicio (Submitted the item)

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-06-07 teffalump Should be Finished on2013-11-24 2015-07-01
        StatusNone Ready For Test
        Percent Complete0% 100%
        Release2.3.0 2.9.0
    2013-10-03 meanmicio Assigned toNone meanmicio
    2013-10-02 meanmicio Should be Finished on2013-10-02 2013-11-24
        ReleaseNone 2.3.0

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code