Skip to content
/ BP-SIM Public

Simulation of BP measurements taken within a monitoring program

License

Notifications You must be signed in to change notification settings

Siella/BP-SIM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BP-SIM

Simulation of blood pressure (BP) measurements taken within a monitoring program.

Quick Start

Initialize a patient via passing a path to data which contains series of systolic BP (SBP), diastolic BP (DBP), and datetime. A CSV file should be tab-separated (see examples). Specify columns to use in a config file.

p = Patient('PATH-TO-DATA')

If you change the attribute path_to_file, other attributes of the instance p will be changed automatically.

print(p.sbp_mean)  # one value
p.path_to_file = 'NEW-PATH-TO-FILE'
print(p.sbp_mean)  # another value

Next, pass the patient to Simulator and run simulation.

sim = Simulator(p)
sim.run_simulation(100)  # 100 days

The result of simulation is stored in measurements attribute.

for meas in sim.measurements:
    print(meas.sbp, meas.dbp)

Reset results of simulation and run another one.

sim.reset_simulation()
sim.run_simulation(100)

To perform information filtering, create rules for measurement processing and initialize Filter object.

data = sim.measurements
f = Filter([
            base_rule,
            sd_rule,
            arv_rule,
           ])
f.fit(data)
print(f.apply(data))  # whether an event is a false alert (False) or normal one (True)

There are some prepared rules but you can write your own (see examples).

References

  • Nikolaeva K., Elkhovskaya L., Kovalchuk S. Patient measurements simulation and event processing in telemedicine systems // Procedia Computer Science - 2021, Vol. 193, pp. 122-130. https://doi.org/10.1016/j.procs.2021.10.012.