Hi Luis,
As promised I tested the import-script mygh_import_readings.py (more
from a user perspective, not a developer perspective). Test system is
Arch, latest version with Plasma (KDE) running.
Imported values are bp and hr (14 lines): 4 records as of 2020-01-04, 5
records as of 2020-01-05 and 5 records as of 2020-01-06
Preparing Steps:
- Update to version 1.0.2
- Backing up ~/mygh and starting with a fresh config (only user data, no
medical recordings)
Test results:
- When accidentally incorrectly formatting date or time the respective
line is skipped ("Error on the date or time: Skipping...")
- When omitting the date, an error occurred and nothing is imported:
"Error in date: Skipping line x" where "x" is the row that does not
contain a date record
- When (accidentally) inserting an empty row (even at the end of the
csv) an error occurred:
Traceback (most recent call last):
File
"/home/USERNAME/.local/lib/python3.9/site-packages/mygnuhealth/mygh_import_readings.py",
line 146, in <module>
parse_values()
File
"/home/USERNAME/.local/lib/python3.9/site-packages/mygnuhealth/mygh_import_readings.py",
line 100, in parse_values
vdate = line[0]
IndexError: list index out of range
- With correct date and time all 14 bp and hr values are imported
without errors. Sample console log record (last insert):
Inserting into DB <Table name='bloodpressure', total=13,
storage=<tinydb.storages.JSONStorage object at 0x7fdf8f061730>>
{'timestamp': '2020-01-06T21:06:00', 'event_id':
'8680af83-dc55-4b1d-a99d-cc38eade891c', 'systolic': 133, 'diastolic': 88}
Saved event {'timestamp': '2020-01-06T21:06:00', 'event_id':
'8680af83-dc55-4b1d-a99d-cc38eade891c', 'systolic': 133, 'diastolic': 88}
Inserting into DB <Table name='heart_rate', total=13,
storage=<tinydb.storages.JSONStorage object at 0x7fdf8f061730>>
{'timestamp': '2020-01-06T21:06:00', 'event_id':
'8680af83-dc55-4b1d-a99d-cc38eade891c', 'heart_rate': 72}
Saved event {'timestamp': '2020-01-06T21:06:00', 'event_id':
'8680af83-dc55-4b1d-a99d-cc38eade891c', 'heart_rate': 72}
One more little thing:
Typo found in header of sample_reading.csv: date(yyymmdd) - y is missing
Possible issues/problems/limitations:
- The bp/hr card correctly shows the last imported value. However, when
viewing the chart strange x-axis values are shown (screenshot is
available, but I'm unsure if I could attach it here). The result is
unchanged (again strange x-axis values) if import is limited to one
value per day.
Suggestion:
I have a lot of test data that records the values individually per
column (>1500). I know this is a fundamental design aspect and certainly
there are very good reasons for the current design, however would it be
conceivable to separate the two values systolic and diastolic by comma?
Otherwise I need to write a small macro to merge the two columns using
the "/" separator. Possibly not only my import data is stored in
separate columns?
When a decision is made on how to proceed, I prepare the test data
accordingly and test further cases (invalid values etc.)
I hope I was able to support. If there are any questions, please do not
hesitate to contact me.
Best,
Mat