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

Tracing Realism: A-Fib & A-Flutter #189

Open
1 of 2 tasks
tanjera opened this issue Jun 10, 2023 · 1 comment
Open
1 of 2 tasks

Tracing Realism: A-Fib & A-Flutter #189

tanjera opened this issue Jun 10, 2023 · 1 comment

Comments

@tanjera
Copy link
Owner

tanjera commented Jun 10, 2023

Needs realistic update to tracing algorithms for atrial fibrillation and atrial flutter. Current tracings have unrealistic outcomes.

  • Atrial fibrillation: baseline atrial activity too "sawtooth" (predictable)
  • Atrial flutter: atrial activity sawteeth slightly out of phase with RR phase... align phase for realistic synchronicity
@tanjera
Copy link
Owner Author

tanjera commented Jun 10, 2023

Atrial fibrillation isoelectric drawing updated to:

public static List<PointD> ECG_Isoelectric__Atrial_Fibrillation (Physiology? _P, Lead? _L) {
            if (_P is null || _L is null)
                return new ();

            int Fibrillations = (int)System.Math.Ceiling (_P.GetHR_Seconds / 0.08);
            List<PointD> thisBeat = new ();
            for (int i = 1; i < Fibrillations; i++)
                thisBeat = Plotting.Concatenate (thisBeat, ECG_P (_P, _L,
                    Math.RandomDbl (0.04d, 0.12d),                                                                          // fibrillatory wave interval
                    (Math.RandomInt (0, 3) == 0 ? Math.RandomDbl (-0.04d, -0.02d) : Math.RandomDbl (0.02d, 0.06d)),         // fibrillation amplitude
                    0d, Plotting.Last (thisBeat)));

            return thisBeat;
        }
  • Wave interval randomized around 0.08 sec (0.04 - 0.12 sec)
  • Fibrillatory amplitude switched to be 33% negative deflection, 66% positive inflection
    • No actual clinical basis for this, but visually examining fibrillatory waveforms, this seems to give a more accurate rendition
  • Fibrillatory amplitudes set to -0.04 - -0.02 for negative deflections, 0.02 - 0.06 for positive inflections
    • Again, no actual clinical basis, but this most accurately simulates the variety of rhythms examined in my clinical experience and in reference materials

Overall, a huge improvement in clinical realism for atrial fibrillation's isoelectric drawing!

tanjera added a commit that referenced this issue Jun 11, 2023
- Atrial fibrillation ECG drawing improved (#189)
- Tracing Replace() function expanded to ReplaceAtOver()
  - Allows splices to replace once they supercede existing Y-values
  - Fixes unrealistic drops on tracing replacement (closes #190)
  - *Not* implemented in IABP tracings (ABP, balloon) d/t important deflections!
- Implemented DampenAmplitude_DiastolicFillTime()
  - If Actual HR > Set HR, Lerp's a dampened amplitude
  - Uses i - 2 Actual HR (from PhysiologyEvents) d/t electromechanical delay
    - i - 1 (Last()) is data used for forthcoming pulsatile beat!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant