Table Of ContentAn Open Source Anaesthesia
Workstation (Linux)
revision09α
Richard W. D. Nickalls
Simon Dales
Adrian K. Nice
ii
The single biggest problem we face is that of visualisation
RichardP.Feynman(1918–1988)1
1TheMathematicalGazette(1996);80,267.
iii
An open source Anaesthesia
Workstation
Richard W. D. Nickalls,
DepartmentofAnaesthesia,
NottinghamUniversityHospitals,
CityHospitalCampus,Nottingham,UK.
[email protected]
http://www.nickalls.org/
Simon Dales,
Purrsoft,Oxford,UK
[email protected]
Adrian K. Nice,
DepartmentofInformationandComputingTechnology,
CityHospital,Nottingham,UK.
[email protected]
iv
Copyright © RWDNickalls,SDales,AKNice,GDean 1994—2009
r w d n
April2009
revision 09α
Preface
Thisdocumentbringstogetherinoneplacemostoftheavailableinformationregarding
thedevelopmentwork,files,programsandscreenshotsrelatingtothecurrentversionof
ouropensourceAnaestheticWorkstationcomputerprogram,whichwasusedinone
ofthethoracicoperatingtheatresduringtheperiod2002–2006. Thisdocumentisstill
‘workinprogress’,andwillthereforebeupdatedperiodically.
ThisprojectstartedwithanMS-DOSprototype(writtenbyRWDNickallsduring
1994-2001) the details of which are also on this website (http://www.nickalls.
org/dick/xenon/rwdnXenon.html).
RWDNickalls(2009)
v
Contents
Preface v
Contents x
I Background 1
1 Ananaesthesiaworkstation 2
1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 DifficultywithfundingandR&D . . . . . . . . . . . . . . . . . . . . 2
1.3 TheLinuxproject . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4.1 Printing&HTMLfront-endmodule . . . . . . . . . . . . . . 4
1.4.2 Dataacquisitionanddisplaymodule . . . . . . . . . . . . . . 4
1.4.3 MACdisplaywidget . . . . . . . . . . . . . . . . . . . . . . 5
1.4.4 Decision-supportmodule . . . . . . . . . . . . . . . . . . . . 6
1.4.5 Adiabetesalertmodule . . . . . . . . . . . . . . . . . . . . 6
1.4.6 Adrug-menumodule . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Theatreandscreenshots . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Dataprocessinginanaesthesia 15
2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2 Historyoftheanaesthesiarecord . . . . . . . . . . . . . . . . . . . . 15
2.2.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.2.2 Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.2.3 Guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
2.3 Theanaesthesiaworkstation . . . . . . . . . . . . . . . . . . . . . . . 17
2.3.1 Databases . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.3.2 Thefuture . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3 TEXintheOperatingTheatre 22
4 TheDatexAS/3anaesthesiamonitor 25
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.1.1 Softwareversion . . . . . . . . . . . . . . . . . . . . . . . . 26
4.1.2 Availablesoftware . . . . . . . . . . . . . . . . . . . . . . . 26
4.2 Serialport . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.2.1 Cableconnections . . . . . . . . . . . . . . . . . . . . . . . . 27
4.2.2 Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
vi
CONTENTS vii
4.3 Commandformat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
4.3.1 Transmissionrequestcommand . . . . . . . . . . . . . . . . 29
4.4 Outputdata-stringformat . . . . . . . . . . . . . . . . . . . . . . . . . 31
4.5 Exampleofdataoutput . . . . . . . . . . . . . . . . . . . . . . . . . 36
4.6 Correspondence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5 InterfacingtheserialportinLinux 45
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.2 Device::SerialPort.pm . . . . . . . . . . . . . . . . . . . . . . . . . . 45
5.3 Sendingprogram(as3sim.pl) . . . . . . . . . . . . . . . . . . . . . 46
5.4 Receivingprogram(dn-getfile2.pl) . . . . . . . . . . . . . . . . 49
6 AgecorrectedMAC 52
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
6.1.1 MACsubroutine(MS-DOS) . . . . . . . . . . . . . . . . . . 54
6.2 AgecorrectedMACcharts . . . . . . . . . . . . . . . . . . . . . . . 56
6.3 Generatingthecharts . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
6.3.1 Adatafileforasingleiso-MACcurve . . . . . . . . . . . . . 58
6.3.2 mathsPICscriptfordrawingthewholegraph . . . . . . . . . 59
6.3.3 FinalmathsPICprogramformakingthecharts . . . . . . . . 72
6.3.4 Outputmac-iso8t.mtcodefromthepreviousmathsPICprogram 77
6.4 References. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
II Thefront-endcoordinatingprogram 90
7 ThePerl/Tkfront-end 91
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
7.2 TheBASHscriptruncamomile . . . . . . . . . . . . . . . . . . . . . 92
7.3 Pressingthe“RUN”button . . . . . . . . . . . . . . . . . . . . . . . 93
7.3.1 Program: tklaunch2.pl . . . . . . . . . . . . . . . . . . . 94
7.4 UsefulLinuxtoolstousewiththelauncher . . . . . . . . . . . . . . 96
8 Thelaunchcam12.plprogram 98
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
8.2 Theprogramlaunchcam12.pl . . . . . . . . . . . . . . . . . . . . 100
III Thedataprogram—Camomile 105
9 Systemoverview 106
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
9.2 Modules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107
9.2.1 Graphicalfront-endmodule . . . . . . . . . . . . . . . . . . .107
9.2.2 Datacollectionanddisplaymodule . . . . . . . . . . . . . . .107
9.2.3 Printingmodule. . . . . . . . . . . . . . . . . . . . . . . . . .107
9.2.4 Epiduraldatabase . . . . . . . . . . . . . . . . . . . . . . . . .107
9.2.5 Helpfiles . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107
9.3 Directorystructure . . . . . . . . . . . . . . . . . . . . . . . . . . . .107
CONTENTS viii
10 TheCamomileprogram 109
10.1 Directorylistingofcamomile.v.0.1−040413b . . . . . . . . . . . 109
11 Configurationfiles 114
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
11.2 c−as3rn.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
11.3 x−configrn.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
11.4 projectdir.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
11.5 w-monitor-datexas3.conf . . . . . . . . . . . . . . . . . . . . . . . . 118
11.6 People.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
11.7 Drugs.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
11.8 x-widgets.conf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
12 Drugdictionary 125
12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
12.2 Initialdruglist. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
12.3 Downloadbundle . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
12.4 VTMFileformat . . . . . . . . . . . . . . . . . . . . . . . . . . . . .127
12.5 Perlprogramdn-dmd5.pl . . . . . . . . . . . . . . . . . . . . . . . 128
12.6 Perlprogramreverse.pl . . . . . . . . . . . . . . . . . . . . . . . .137
12.7 Initialdatalisting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
12.8 Theorderedlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
12.9 Addingdrugstothelist . . . . . . . . . . . . . . . . . . . . . . . . . 139
12.10Perlprogramadd2list.pl . . . . . . . . . . . . . . . . . . . . . . 140
12.11Logfilegeneratedbyadd2list.pl . . . . . . . . . . . . . . . . . . 142
12.12Finallistforpull-downmenu . . . . . . . . . . . . . . . . . . . . . . 143
13 Diabetesdecision-supportsystem 145
13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
13.1.1 KalarmandtheiCalendarstandard . . . . . . . . . . . . . . 145
13.1.2 VALARMspecificationfromtheRFC-2445manual(v:2,Nov
1998) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
13.2 Kalarm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
13.2.1 ToshowKalarmicon . . . . . . . . . . . . . . . . . . . . . . 152
13.2.2 Documentation . . . . . . . . . . . . . . . . . . . . . . . . . 152
13.2.3 Initiatingadiabetesalarm . . . . . . . . . . . . . . . . . . . 154
13.2.4 Displayingafile . . . . . . . . . . . . . . . . . . . . . . . . 155
13.2.5 Currentalarmstatus . . . . . . . . . . . . . . . . . . . . . . 155
13.2.6 Cancellinganalarm . . . . . . . . . . . . . . . . . . . . . . 156
13.3 Alarmwidgetprogram(dn-tkalarm.pl) . . . . . . . . . . . . . . . 156
13.4 Testdemoprograms(dn-alarm-demoRED.pl) . . . . . . . . . . . . 168
13.5 Diabetesalarmprogram(dn-alarm-diabetes3.pl) . . . . . . . . . . 171
13.6 Fileviewerprogram(dn-tkviewer.pl). . . . . . . . . . . . . . . . 178
13.7 Errormessagewidgetprogram(dn-errorbox.pl) . . . . . . . . . . 179
13.8 Screenshots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
CONTENTS ix
14 Datastorage,filesandformats 183
14.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
14.2 Filenames—time/dateencoding . . . . . . . . . . . . . . . . . . . . 183
14.3 D-data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
14.4 binlog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
14.5 Drug-data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
IV Dataprocessing—inlineprintingmodule 186
15 Printingmodule—overview 187
15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187
15.2 Thestart-time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
15.3 RunningtheCamomiledataprogram . . . . . . . . . . . . . . . . . . 189
15.4 AftertheCamomiledataprogramexits. . . . . . . . . . . . . . . . . 189
15.5 Readingthestarttime.datfile. . . . . . . . . . . . . . . . . . . . . 191
15.6 AccessingtheCamomile-storeddata . . . . . . . . . . . . . . . . . . . 191
15.7 WritetheGNUplotscriptsforeachgraph . . . . . . . . . . . . . . . 196
15.8 RunGNUplotonallthe.gnufiles . . . . . . . . . . . . . . . . . . . 199
15.9 Writetheheaderlinefortheprintouts . . . . . . . . . . . . . . . . . 199
15.10TypesetthegraphicpagesusingLATEX2ε . . . . . . . . . . . . . . . 200
15.11TypesetthedrugfileusingLATEX2ε . . . . . . . . . . . . . . . . . . 200
15.12Printingthepapersheets . . . . . . . . . . . . . . . . . . . . . . . . . 201
16 Typesettingprograms 202
16.1 prtanes6.tex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
16.2 prtdrug2.sty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
16.3 prtdrug.tex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
16.4 printall.tex . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
V Dataprocessing—stand-aloneprintingmodule 210
17 Printing—thestand-alone(SA)module 211
17.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
17.2 Runningtheprocessdata.plscript . . . . . . . . . . . . . . . . . 212
17.3 WritetheGNUplotscriptsforeachgraph . . . . . . . . . . . . . . . 222
17.4 RunGNUplotonallthe.gnufiles . . . . . . . . . . . . . . . . . . . 225
17.5 Writetheheaderlinefortheprintouts . . . . . . . . . . . . . . . . . 225
17.6 TypesetthegraphicpagesusingLATEX2ε . . . . . . . . . . . . . . . 225
17.7 TypesetthedrugfileusingLATEX2ε . . . . . . . . . . . . . . . . . . 226
17.8 Printingthepapersheets . . . . . . . . . . . . . . . . . . . . . . . . 226
18 Printing—thestand-alone(SA-06)module 228
18.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
18.2 Runningtheprocessdata.plscript . . . . . . . . . . . . . . . . . 229
18.3 WritetheGNUplotscriptsforeachgraph . . . . . . . . . . . . . . . 239
18.4 RunGNUplotonallthe.gnufiles . . . . . . . . . . . . . . . . . . . 243
18.5 Writetheheaderlinefortheprintouts . . . . . . . . . . . . . . . . . 243
18.6 TypesetthegraphicpagesusingLATEX2ε . . . . . . . . . . . . . . . 243
CONTENTS RWDNickalls x
18.7 TypesetthedrugfileusingLATEX2ε . . . . . . . . . . . . . . . . . . 244
18.8 Printingthepapersheets . . . . . . . . . . . . . . . . . . . . . . . . 244
19 processdata.pl 246
20 fields2PDATA.pl 250
Description:Apr 19, 2009 1.4.2 Data acquisition and display module . Collaboration with Liverpool University — 2002 .. Anesthesia and Analgesia; 65, 288–293.