Skip to main content

PyTCI

A python package for Target Controlled Infusions.

Spawned from the NHS Hack Day project https://github.com/JMathiszig-Lee/Propofol, this splits out useful code into a package and updates it to python3

Build Status Coverage Status PyPI - Python Version

Installation

if using pip

pip install PyTCI

if using pipenv (you should, it's great)

pipenv install PyTCI

Usage

PyTCI currently supports the following:

Body Mass equations:

  • BMI
  • Ideal body weight (Devine)
  • Adjusted body weight
  • James Equation
  • Boer
  • Hume(1966)
  • Hume(1971)
  • Janmahasation(2005)
  • Al-Sallami

example:

>>> from PyTCI.weights import leanbodymass
>>> leanbodymass.hume66(180, 60 'm')
51.2

Models:

Propofol

  • Schnider
  • Marsh
  • Eleveld
  • Kataria
  • Paedfusor

Remifentanil

  • Minto
  • Eleveld

Alfentanil

  • Maitre

Dexmedetomidine

  • Hannivoort
  • Dyck

example:

>>> from PyTCI.models import propofol
>>> patient = propofol.Schnider(40, 70, 170, 'm')
>>> patient.v2
24

the class methods give_drug and wait_time can he used to model propofol kinetics

example:

>>> from PyTCI.models import propofol
>>> patient = propofol.Marsh(90)
>>> patient.give_drug(200)
>>> patient.x1
9.746588693957115
>>> patient.wait_time(60)
>>> patient.x1
7.438318565317236

Infusions

Infusions are currently only implemented for propofol

The two methods available are effect_bolus and plasma_infusion

Effect bolus returns the bolus (in mg) needed over 10 seconds to achieve the desired effect site concentration. It's input is the desired target in ug/ml and returns the bolus needed in mg

>>> patient = propofol.Schnider(40, 70, 190, 'm')
>>> patient.effect_bolus(6)
95.1

the function uses a simple search to find a dose that gets within 2% of the desired concentration

Plasma_infusion takes desired plasma concentration(ug/ml), desired total time (seconds) and the time period for each segment (seconds) and returns a python list of the required infusions rates from every segment witin the total time specified in mg/sec

>>> pt = propofol.Marsh(70)
>>> pt.plasma_infusion(2, 60)
[3.27269899102373, 0.1453355022895698, 0.14478000490919285, 0.14422948797801816, 0.1436839059972244, 0.143143213884116]
>>> pt.plasma_infusion(2, 60, 30)
[0.1420619352906052, 0.1417017659270992]

The built in models inherit from a parent class. You can define your own models and use the same functions to see how yours performs

class MyNewModel(Propofol):
     def __init__(self, desired, arguments):
        #my custom code to generate volumes and constants
        self.v1 = a_constant * weight
        self.v2 = a_constant * lean_body_mass
        etc... etc...

        #if you want to work with clearances rate constants must be generated
        self.from_clearances(self)

        #finally set up model 
        self.setup(self)

Release files for PyTCI 1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyTCI 1.1
File Size Uploaded
PyTCI-1.1.tar.gz 12.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for PyTCI 1.1
File Interpreter ABI Platform
PyTCI-1.1-py3-none-any.whl Python 3 none any Details

Total release size:27.7 kB

Release files / PyTCI-1.1.tar.gz

Download URL PyTCI-1.1.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
73d4cefd1fe0543c8445bbb124566636eb569b0f58607239ba7c159e27b8a1ee
BLAKE2b-256 checksum
How to use checksums
341eb91e9f86b5ce95bc3bc082167542d517bc41491eccc563853154af2d74cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

Release files / PyTCI-1.1-py3-none-any.whl

Download URL PyTCI-1.1-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2633fa918345baa312b6d904d52bec428f124effa4bfe8b16489f2bfbe4372c
BLAKE2b-256 checksum
How to use checksums
8d66f5e78e2b5c78bb20b04c8c81ca413c19e922c0f5213488c2406c247539b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

Release history Release notifications | RSS feed

This release

1.1 This release

2 release files

1.0.1

2 release files

0.3

2 release files

0.1

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page