Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract measurement types of waveforms, group e.g. all Blood Presssures #100

Closed
steph409 opened this issue Feb 2, 2018 · 11 comments
Closed

Comments

@steph409
Copy link

steph409 commented Feb 2, 2018

Hi,

I am using the mimic iii database and it would be useful to have more Mean Arterial Pressure, heartrate and temperature measurements. Hence I want to extract this data from the waveforms. I downloaded the matched waveforms and timestamped the samples using the filename and the frequency fields.get('fs').
My questions are:

  • Is there a rule in which channels I can find this data?
  • I use the signames entries from the fields dictionary to identify which columns of sig I need and the signames vary from one entry to another. Is there an easier way to do this?
  • Is it possible to group all the signals with a similar meaning? For example for the mean arterial pressure I found: ABP, UAP Mean, ABPMean, UAP, PAPMean, UAP MEAN...
    sig, fields = wfdb.srdsamp('/home/matched/p00/p000020/p000020-2183-04-28-17-47n')
    print('Signames:', fields.get('signame'))

    sig, fields = wfdb.srdsamp('/home/matched/p00/p000030/p000030-2172-10-16-12-22n')
    print('Signames:', fields.get('signame'))

gives the following result:

Signames: ['HR', 'ABPSys', 'ABPDias', 'ABPMean', 'PAPSys', 'PAPDias', 'PAPMean', 'CVP', 'PULSE', 'RESP', 'SpO2', 'NBPSys', 'NBPDias', 'NBPMean', 'CO']
Signames: ['HR', 'PULSE', 'RESP', 'SpO2', 'NBPSys', 'NBPDias', 'NBPMean']
@alistairewj
Copy link
Member

alistairewj commented Feb 2, 2018

I'll answer your questions in turn.

  • There is no fixed order to the channels - it depends on the configuration which is done on a patient to patient basis - but you'll still see patterns, for example the first channel is almost always HR
  • A signal dictionary is here: https://physionet.org/physiobank/signals.shtml
  • Yes, but you likely have to do this semi-manually and create a dictionary, referencing the above dictionary

If you do create a signal dictionary, I'm sure we could find a place for it in this repository.

I'll also mention: be very careful combining signals. For example, you mention that you have found a few mean arterial pressure signals, but UAP and PAP are not mean arterial pressures. UAP is an intra-abdominal pressure and PAP is pulmonary artery pressure. They should not be combined with MAP. Note that the signal dictionary mentioned earlier groups these various blood pressures together though clinically they mean very different things (the list of groups is here). You probably need to modify and create your own.

Finally I'll mention that we often call these signals the "numerics" (one value per second), so that we can easily differentiate them from the waveforms (125 Hz signals) - but that's just a convention.

@steph409
Copy link
Author

Hi Alistar,

thank you for your response. I did what you proposed and I will push my dictionary once its finished. I still have some questions:

  • I found that some numerics have strange behavior:
    for example:
    entry = 'p00/p000747/p000747-2147-03-07-13-10n'
    record = wfdb.rdsamp(entry, channels=[0, 1, 2, 3, 4, 5, 6])
    wfdb.plotrec(record, title='Record ' + entry)

gives me the following plot: plot_1.pdf
I also made another plot where I added MIMIC III chartevent values for the specific patient (plot_2.pdf)
I call the numerics "raw data" in plot_2 and chartevent measurements "nurse validated". The nurse-validated data seems to confirm that behavior (or at least, that the measurements are somehow correct).

For me it seems strange that the value is constant for some time (30-60 minutes) and then jumps (not a lot of course). Is there a reason for this kind of behavior?
plot_1.pdf
plot_2.pdf

Then I wonder what else I could push from my code, maybe you can say what you think about the following:

  • I wrote code to extract the numerics, merge columns with similar meaning (using the signal dictionary we talked about) and timestamp it. I save the data for all numeric records in a csv (~ 3GB) with the columns (subject_id, charttime) as well as one column per merged_signal(for instance: systolic pressure, diastolic pressure, mean arterial pressure, heart rate, stroke volume as they are what I needed, but of course this would also work for the other signals). I loaded this csv in my local MIMIC III database so that I can access it easily.
  • As you can see in plot_2.pdf, I am currently flagging the numerics measurements in my csv. Of course this is not precise, it is more of a "outliers highlighting".
  • Do you think either my code for this or the resulting csv could be useful for someone? We needed more vital signs (heart rate, map) as we wanted to see a variation in e.g. the map before/after some interventions

Best regards,
Stephanie

@alistairewj
Copy link
Member

Well, NBP stands for non-invasive blood pressure, which they can measure by having a cuff inflate aperiodically on an automated timer or initiating the measurement themselves. To be honest, I hadn't really realized that non-invasive blood pressures were contained in the numerics, and certainly didn't realize that they were recorded every minute. I think the fastest they would reasonably sample NBPs is every 15 minutes - if resolution is needed any faster than that and they usually resort to invasive arterial blood pressure measurement. It seems that, in the numerics, the last value recorded is held for some time! Your second plot nicely highlights this as well, with the nurse validated measurement preceding the sample and held measures.

Regarding your point 2, I don't see any flagged measurements in that plot, so unfortunately I'm not sure what you are referring to.

Absolutely this code would be useful. We can find a place for it in the repo for sure, perhaps in a folder dedicated for working with the matched waveforms. It would also be nice to start creating some collaborative documentation around the waveforms, which describes situations like this sample and hold to help other researchers.

@steph409
Copy link
Author

Hi Alistar,
thank you so much for your help. there are just few questions left:
according to the waveform signal list, we encounter some signals we
couldn't define or find out what kind of value was actually measured.
Perhaps you can help us with following signals:

Signalname: SV Count
Does it mean stroke volume or "super ventricular"? if not are there signals which represent
stroke volume?

What kind of Blood pressure type do the different signals P1 to P4 and [62130] with
each type (1/3:systolic, 2/3:diastolic, 3/3:mean) represent?

Then there are statistical curiosities: e.g. PAP is different from pap mean and ABP as well is different from ABP_mean. What is the difference between the signal with and without "mean"?
We made some statistics and e.g. ABP seems to be higher than other mean arterial pressure measurements (BP MEAN. ABP Mean, ART mean, ABPMEAN, NBP...) which range from median:75-82.

ABP (median:107, mean:113)
ABP MEAN (median: 78, mean:79)
Do you have an explanation why ABP is higher?

The same behavior shows the signal PAP:
Pap: median 50,
PAP Mean, PAP MEAN, PAPMean: 25-28.

Many thanks in advance,
Stephi

@alistairewj
Copy link
Member

SV Count: probably count of the number of supraventricular beats.. for the other measures, I'm not really sure. It could be that different areas of the hospital use different colloquialisms, e.g. CCU uses PAP while MICU uses PAP mean (this you can check as I think the comments have the unit).. or it could be a different device is used for the measurement.. or ABP mean could be derived using the 2/3rds 1/3rd equation while ABP is calculated from the area of the waveform. I don't really have answers, sorry!

@waqaraziz123
Copy link

Hi Stephanie,

Are you still working with matched waveform data ?

Thanks

@Yanjiayork
Copy link

I try to understand what ART BP systolic mean in the dataset, especially what ART mean here? Any idea?
Thanks.
Yan

@qinfeng
Copy link

qinfeng commented Jan 31, 2019

@Yanjiayork

I try to understand what ART BP systolic mean in the dataset, especially what ART mean here? Any idea?
Thanks.
Yan

Refer to this link: https://physionet.org/physiobank/signals.shtml

ART BP : arterial blood pressure

@peiyaoli
Copy link

peiyaoli commented Jan 31, 2019 via email

@Yanjiayork
Copy link

@qinfeng @peiyaoli Thanks both. The link is very helpful.

@vinay-hebb
Copy link

iving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or mute the thread.

https://archive.physionet.org/physiobank/signals.shtml
I could not understand difference between (ABP, BP) and (ART, BP). Both have description as arterial blood pressure. In which way, these are different

tompollard added a commit that referenced this issue Jan 22, 2024
…ocs (#477)

Bumps
[readthedocs-sphinx-search](https://github.com/readthedocs/readthedocs-sphinx-search)
from 0.1.1 to 0.3.2.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a
href="https://github.com/readthedocs/readthedocs-sphinx-search/blob/main/CHANGELOG.rst">readthedocs-sphinx-search's
changelog</a>.</em></p>
<blockquote>
<h2>Version 0.3.2</h2>
<p>:Date: Jan 15, 2024</p>
<ul>
<li><a href="https://github.com/stsewd"><code>@​stsewd</code></a>:
Security fix, more information in <code>GHSA-xgfm-fjx6-62mj
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/security/advisories/GHSA-xgfm-fjx6-62mj&gt;</code>__.</li>
</ul>
<h2>Version 0.3.1</h2>
<p>:Date: Mar 27, 2023</p>
<ul>
<li><a href="https://github.com/stsewd"><code>@​stsewd</code></a>: Add
missing static file (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/135">#135</a>)</li>
</ul>
<h2>Version 0.3.0</h2>
<p>:Date: Mar 27, 2023</p>
<ul>
<li><a href="https://github.com/stsewd"><code>@​stsewd</code></a>: Use
the search API V3 and add support for custom filters (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/132">#132</a>)</li>
</ul>
<h2>Version 0.2.0</h2>
<p>:Date: Jan 24, 2023</p>
<p>This version adds support for sphinx 6.x,
and makes JQuery optional for animations.</p>
<ul>
<li><a href="https://github.com/stsewd"><code>@​stsewd</code></a>: CI:
fix tests (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/127">#127</a>)</li>
<li><a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]:
Bump decode-uri-component from 0.2.0 to 0.2.2 (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/120">#120</a>)</li>
<li><a
href="https://github.com/dependabot"><code>@​dependabot</code></a>[bot]:
Bump minimatch and gulp (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/119">#119</a>)</li>
<li><a href="https://github.com/stsewd"><code>@​stsewd</code></a>:
Refactor: don't depend on underscore.js (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/116">#116</a>)</li>
<li><a href="https://github.com/stsewd"><code>@​stsewd</code></a>:
Remove usage of jquery (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/115">#115</a>)</li>
</ul>
<h2>Version 0.1.2</h2>
<p>:Date: May 11, 2022</p>
<ul>
<li><code>@ericholscher
&lt;https://github.com/ericholscher&gt;</code><strong>: Improve SEO of
README &amp; docs index
(<code>[#111](readthedocs/readthedocs-sphinx-search#111)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/111&gt;</code></strong>)</li>
<li><code>@dependabot[bot]
&lt;https://github.com/dependabot[bot]&gt;</code><strong>: Bump moment
from 2.29.1 to 2.29.2
(<code>[#110](readthedocs/readthedocs-sphinx-search#110)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/110&gt;</code></strong>)</li>
<li><code>@stsewd &lt;https://github.com/stsewd&gt;</code><strong>: Test
with sphinx 4 and python 3.10
(<code>[#109](readthedocs/readthedocs-sphinx-search#109)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/109&gt;</code></strong>)</li>
<li><code>@stsewd &lt;https://github.com/stsewd&gt;</code><strong>: Add
sphinx metadata
(<code>[#108](readthedocs/readthedocs-sphinx-search#108)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/108&gt;</code></strong>)</li>
<li><code>@dependabot[bot]
&lt;https://github.com/dependabot[bot]&gt;</code><strong>: Bump minimist
from 1.2.5 to 1.2.6
(<code>[#107](readthedocs/readthedocs-sphinx-search#107)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/107&gt;</code></strong>)</li>
<li><code>@stsewd &lt;https://github.com/stsewd&gt;</code><strong>:
Rename master -&gt; main
(<code>[#106](readthedocs/readthedocs-sphinx-search#106)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/106&gt;</code></strong>)</li>
<li><code>@stsewd &lt;https://github.com/stsewd&gt;</code><strong>:
Docs: use sphinx 4.x
(<code>[#105](readthedocs/readthedocs-sphinx-search#105)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/105&gt;</code></strong>)</li>
<li><code>@astrojuanlu
&lt;https://github.com/astrojuanlu&gt;</code><strong>: Fix docs
(<code>[#102](readthedocs/readthedocs-sphinx-search#102)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/102&gt;</code></strong>)</li>
<li><code>@dependabot[bot]
&lt;https://github.com/dependabot[bot]&gt;</code><strong>: Bump postcss
from 7.0.35 to 7.0.39
(<code>[#100](readthedocs/readthedocs-sphinx-search#100)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/100&gt;</code></strong>)</li>
<li><code>@dependabot[bot]
&lt;https://github.com/dependabot[bot]&gt;</code><strong>: Bump
path-parse from 1.0.6 to 1.0.7
(<code>[#99](readthedocs/readthedocs-sphinx-search#99)
&lt;https://github.com/readthedocs/readthedocs-sphinx-search/pull/99&gt;</code></strong>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/c485b81f6015e4867bb01e600d031dc402500b39"><code>c485b81</code></a>
Release 0.3.2</li>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/8c6f6d01e88e72ef32ed0c220b6c19d1e1121c73"><code>8c6f6d0</code></a>
Merge pull request from GHSA-xgfm-fjx6-62mj</li>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/1608743622df0883b785a2ce07c587f146f2102b"><code>1608743</code></a>
Release 0.3.1 (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/136">#136</a>)</li>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/25673a35b661a6a5dbc82d26c44998028dd61cc0"><code>25673a3</code></a>
Release 0.3.0 (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/135">#135</a>)</li>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/ca36a1566296fe79926e838d9771ec0b7a1a27a8"><code>ca36a15</code></a>
Use API V3 (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/132">#132</a>)</li>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/c8cb91264db65ff64f93d9cdf95eec75159f2ea1"><code>c8cb912</code></a>
Release 0.2.0 (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/128">#128</a>)</li>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/5432999e4689970f22275c833aa65e41e4f8b1e3"><code>5432999</code></a>
CI: fix tests (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/127">#127</a>)</li>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/fa7e607f98bd697f9b4b6af6d3cd7de6d5e39117"><code>fa7e607</code></a>
Bump decode-uri-component from 0.2.0 to 0.2.2 (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/120">#120</a>)</li>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/225353f6be04f2fa178ec2350e3c27599b6b2ea1"><code>225353f</code></a>
Refactor: don't depend on underscore.js (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/116">#116</a>)</li>
<li><a
href="https://github.com/readthedocs/readthedocs-sphinx-search/commit/5880a64bc514fef99a083c40f2dadc3e939cdc88"><code>5880a64</code></a>
Remove usage of jquery (<a
href="https://redirect.github.com/readthedocs/readthedocs-sphinx-search/issues/115">#115</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/readthedocs/readthedocs-sphinx-search/compare/0.1.1...0.3.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=readthedocs-sphinx-search&package-manager=pip&previous-version=0.1.1&new-version=0.3.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/MIT-LCP/wfdb-python/network/alerts).

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants