Home

revision 2014b

image

Contents

1. Figure 1 12 Screen showing showing a help file viewed using the KDE web browser ANAESTHETIC SHEET City Metal Naas UK Dm mm FE Patient dd ANAESTHETISTS RWD LT s aa o S vapour CO2 exp 46 Vap exp CO2 insp 00 Vap MAC RR 12 Total MAC TV exp 72 1130 mm 1 0 E MVol 66 HR ecg 110 HR sat 113 BP 127 56 us nua EI re NIBP Tempi Temp2 _ vet xx eade ge oPeooo edes aep ttti al 1130 mr 1500 BA aar vom Z BO S amp B AT JE anomie 8 ttesmomerdick mn dckeocahos 15 xavi tiep Em 15 08 IE Figure 1 13 Screen showing real time data plus preview of printout CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 14 D x Location Edit View Go Bookmarks Tools Settings Window Help jaana OG OS muc RO a main index Xenon5 Anaesthesia Workstation home page Antibiotic website Blood loss guide BP high 1 BP high 2 Drugs Diabetes CHN Guidelines calcium low calcium high 1 calcium high 2 MAC Malignant hyperpyrexia Pulse Oximetry Sepsis Tracheostomy Thoracic notes Background This project started life in about 1992 or so in the form of a series of small projects directed towards writing interfacing software
2. HHH process the baselog data file system perl base2texd pl HEK EK EA dk kk kk now latex the prtdrug file system latex prtdrug tex HEK EE KAK dk dk copy the dvi file to have a anes drug dvi filename system cp v prtdrug dvi anes drug dvi Hpk kk kk CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 298 THEHBE make the PS version of the dvi file to printer system dvips anes drug dvi o anes drug ps THE k k kkk kkk kk make the pdf file system pdflatex prtdrug tex copy the pdf file to have a gnn pdf filename system cp v prtdrug pdf anes drug pdf view the output ps graphs system gv anes drug ps print out system dvips anes drug dvi close printlog LASTLINE OUTLINE close di 2 2 gUBS 2 sub gnnmax returns total number of hours gnnMax by scanning the file lt timefile dat gt the lt timefile dat gt file is made by the SUB makegnnfiles in prog cam2gnnH pl gnnmax 0 iHt open the file for input open timefile lt timefile dat die ERROR can t open file timefile dat n LINE while lt timefile gt next LINE if skip comments next LINE if 4 skip 4 comments next LINE if skip blank lines grab the whole line as a string hour unixtime gmtime gnnfilename dataline _ chomp dataline removes the line ending print printlog SU
3. QUIT HOWTO use VIEW logfile VIEW calfile c Diabetes widget The buttons on the right offer preset time delays in the range 20 60 mins 185 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 186 14 1 1 Kalarm and the iCalendar standard Kalarm data is written to a text file encoded using the iCalendar Syntax Reference Stan dard 2445 RFC 2445 which uses a number of nested so called V items e g Valarm Vevent etc The following extract is from the Wikipedia entry for iCalendar http en wikipedia org wiki ICalendar iCalendar is a standard RFC 2445 or RFC2445 Syntax Reference for calendar data exchange The standard is also known as iCal which is the name of the Apple Computer calendar program that was the first software implementation of the standard iCalendar allows users to send meeting requests and tasks to other users through emails Recipients of the iCalendar email with supported software can respond to the sender easily or counter propose another meeting date time It is imple mented supported by a large number of products including 30Boxes Google Calendar Apple iCal application and iPod Chandler Lotus Notes ScheduleWorld KOrganizer Lovento Mozilla Calendar including Mozilla Sunbird Mulberry Novell Evolution Kronolith Simple Groupware Windows Calendar Nuvvo Up coming org and to some extent Microsoft Outlook iCalendar data
4. 14 8 Screenshots e as bh 4 oe ue gre re usse gos dq rts 15 Data storage files and formats 15 1 Inroducion llle 15 2 Filenames time date encoding len 15 3 Dedatf o oko Ro RE eR RR RE UR ARCA RD ni e Je ed 15 4 binl g slm o ko EER RS ok ch o mox Re De a Rx 15 5 Drug data 2 25 sss oe RR RR R IV Data processing inline printing module 16 Printing module overview 16 1 Introduction ia ER E e o Room m RR UR RR RR RR 16 2 The start time so EER RE omo om m ee mn 16 3 Running the Camomile data program les 16 4 After the Camomile data programexits 16 5 Readingthestarttime datfile clle 16 6 Accessing the Camomile stored data 16 7 Write the GNUplot scripts for each graph 16 8 Run GNUPplot on all the gnu files SS SS SE 16 9 Write the header line for the printouts 16 10 Typeset the graphic pages using ATEX 2e 2 2 ee 16 11 Typeset the drug file using MIBX2 2 2 llle 16 12Printing the paper sheets llle 17 Typesetting programs V ILl prtanes6 tex ena o om OS EUROS RE OS OU RUE 17 2 prtdrug2 Sty nc ER bo o Roy ow RR V S YU EN e y 17 3 pEtdr g tex uem e om ome m RS RR ee e ER 174 printall tex amp N eA Ri RE ey RR yy Rr RS Data processing stand alone printing module 18 Printing the stand alone SA module 18 1 Introduction lle
5. N20 label 208 200 2 ETN2O 100 End Tidal N20 conc 66 210 211 2 FIN20 100 Frac Insp N20 conc 63 212 215 4 AAstatus Anaesthetic agent status 216 217 2 AAlabel Anaesthetic agent label 218 219 2 ETAA 100 End Tidal Anaes agent 1 65 220 221 2 FIAA 100 Frac Insp Anaes agent 1 65 222 223 2 MAC 100 MAC total 1 25 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 40 Table 4 7 Parameter definitions for Datex AS 3 Position bytes Name Unit Div Description 224 227 4 FLOWVOLstatus Flow volume status 228 229 2 FLOWVOLIabel Flow volume label 230 231 2 RR min 1 Resp rate 12 232 233 2 Ppeak cmH20 100 Peak Pressure 30 234 235 2 PEEP cmH20 100 PEEP 5 236 237 2 Pplat cmH20 100 Plateau pressure 12 238 239 2 TVinsp ml 10 Inspiratory Tidal volume 653 240 241 2 TVexp ml 10 Expiratory Tidal volume 653 242 243 2 compliance ml cmH20 100 compliance 23 244 245 2 MVexp ml 100 Inspiratory Tidal volume 653 246 249 4 COstatus Cardiac output status 250 251 4 COlabel Cardiac output label 252 253 2 CO ml min 1 cardiac output 5000 254 255 2 BLOODtemp degC 100 Blood temperature 37 4 256 257 2 EJfrac 1 Right heart ejection fraction 54 258 259 2 pcwp mmHg 100 Pulm cap wedge pressure 12 260 263 4 NMjstatus Neuromus
6. camel logo button usr lib perl5 vendor_perl 5 8 1 i386 linux thread multi Tk camelimage topwindow gt Photo file gt home dick allfiles camomiletop datexsim anim gif topwindow gt Button relief gt flat image gt camelimage gt place relx gt 0 rely gt 0 THE project team button topwindow gt Button text gt c The CAMOMILE project team 2004 padx gt 30 pady gt 20 relief gt flat background gt LightGrey activebackground gt Grey foreground gt Blue command gt amp projectteam gt pack side gt bottom expand gt 1 THE RUN button topwindow gt Button text gt RUN padx gt 50 pady gt 90 relief gt raised background gt SeaGreen1 activebackground gt SeaGreen2 command gt amp launch pack side gt left expand gt 1 THE CHAPTER 8 THE PERL TK FRONT END RWD Nickalls 139 QUIT button topwindow gt Button text gt QUIT padx gt 20 pady gt 20 relief gt raised background gt LightBluel activebackground gt LightBlue2 command gt amp quit gt place relx gt 0 rely 70 1 gt pack side gt left expand gt 1 it EPIDURAL button topwindow gt
7. 19 1 Introduction Although the automated in line printing module described in chapter X worked well in processing the data immediately at the end of an operation by clicking on the print last case button on the launcher widget it was difficult to implement retrospectively for example when wanting to re processing a different database of binlog files typically placed in the fields subdirectory The pdata sub directory contains the original output of processed data A typical directory structure of an operation database which for example started at 13 42 hrs on September 23 2005 is as follows camomiletop theatredata 2005 8ep 23 1342 camomiletop theatredata 2005 Sep 23 1342 fields camomiletop theatredata 2005 Sep 23 1342 pdata A new stand alone printing module was therefore developed which a was simpler i e did not use Simon Dales camomilefields2tex C program or need to read the starttime dat file and b could be pointed at a particular fields subdirectory to generate the full printable anaesthesia record in the usual way The output of all data processed by this SA module is stored in a separate PDATA sub directory i e we preserve the original pdata sub directory as follows camomiletop theatredata 2005 8ep 23 1342 camomiletop theatredata 2005 8ep 23 1342 fields camomiletop theatredata 2005 8ep 23 1342 pdata camomiletop theatredata 2005 Sep 23 1342 PDAT
8. dname dmd dname n tsleep 1 THE CHAPTER 13 DRUG DICTIONARY RWD Nickalls 178 close END 13 6 Perl program reverse pl Wl usr bin perl w THE reverse pl RWD Nickalls 2005 to reverse a string of n names with my instring A1A1 A2A2 clcl c2c2 RIR1 R2R2 my pz 7 3 replace with just instring s p put the words into an array if instring m print YES the string has a n THE make array of words separated by space my words split instring clean out remove leading and trailing white space from each string my clean_words foreach element words element s s remove leading white space element s s trailing space push clean_words element my w1 w2 w3 w4 w5 w6 w7 clean words my n clean_words 1 print n n n print string instring n if n 2 print REVstring w2 p w1 n elsif n 3 print REVstring w1 9p w3 p w2 Wn print REVstring w2 9p w1 p w3 Wn print REVstring w2 9p w3 p w1 Wn print REVstring w3 p w1 p w2 Wn print REVstring w3 9p w2 p w1 Wn elsif n 4 print first w1 n print seconds w2 An print third w3 n print 4th w4 n else print ERROR string NOT
9. 0000000 DO Ln m m m m EN AEN N anes 10 dvi system dvips anes 10 dvi else anes 09 dvi system dvips anes 09 dvi else anes 08 dvi system dvips anes 08 dvi else anes 07 dvi system dvips anes 07 dvi else anes 06 dvi system dvips anes 06 dvi else anes 05 dvi system dvips anes 05 dvi else anes 04 dvi system dvips anes 04 dvi else anes 03 dvi system dvips anes 03 dvi else anes 02 dvi system dvips anes 02 dvi else anes O1 dvi system dvips anes 01 dvi else print the drug sheet last on top if e anes drug dvi system dvips anes drug dvi else Chapter 17 Typesetting programs 17 1 ch prtanes tex prtanes6 tex Ndocumentclass a4paper article usepackage dvips color graphicx ANusepackage pdftex color graphicx usepackage times usepackage latexsym 44 for Box symbol hhhh usepackage graphicx 4 for rotate in dvips pdf only usepackage prtdrug2 usepackage miscrwdn needed for cupBOX and cupframebox redefine the tenrm command output by GNUplot newcommand tenrm rmfamily normalsize newcommand jotwo ensuremath mbox scriptsize 0 2 newcommand jcotwo ensuremath mbox scriptsize CO _2 newcommand etcotwo ET ensuremath _ jcotwo newcommand fiotwo F ensuremath mbox textsc i _ jotwo newcommand ntwoo ensuremath mbox N
10. m50m55 1 033679 m55m60 1 002157 m60m65 9715963 m65m70 9419674 m70m75 9132419 m75m80 8853925 m80m85 8583924 m85m90 8322156 m90m95 end of file lt isomdata dat gt thickline inputfile isokdata dat 0 8 start of file lt isokdata dat gt k mac40 iso 8 point k5 5 1 162588 5 1 162588 manual point k10 10 1 127135 10 1 127135 point k15 15 1 092763 15 1 092763 point k20 20 1 059439 20 1 059439 point k25 25 1 027131 25 1 027131 point k30 30 9958085 30 9958085 point k35 35 9654412 35 9654412 point k40 40 936 40 936 point k45 45 9074566 45 9074566 point k50 50 8797836 50 8797836 point k55 55 8529544 55 8529544 point k60 60 8269435 60 8269435 point k65 65 8017257 65 8017257 point k70 70 7772771 70 7772771 point k75 75 7535739 75 7535739 point k80 80 7305936 80 7305936 point k85 85 708314 85 708314 point k90 90 6867139 90 6867139 point k95 95 6657725 95 6657725 drawline k5k10k15k20k25k30k35k40k45k50k55k60k65k70k75k80k85k90k95 plot 5 1 162588 10 1 127135 k5k10 plot plot plot plot plot plot plot plot plot plot plot plot plot plot plot 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 1 127135 1 092763 1 0594
11. text mybottom 46 0 15 put mybottom at 46 15 otext copyright RWD Nickalls 2001 22 0 5 text large ISOFLURANE 46 2 7 80 put large ISOFLURANE at 46 2 7 draw horizontal dashed lines linethickness 0 4pt equivalent to tiny linethickness 0 6pt half way between tiny and normalsize setdashes variable x5 5 5 Left X value variable x6 100 100 Right X value variable y16 2 3523 2 3523 variable y14 2 1523 2 1523 variable y12 1 9523 1 9523 variable y10 1 7523 1 7523 variable y08 1 5523 1 5523 variable y06 1 3523 1 3523 variable y04 1 1523 1 1523 variable y02 0 9523 9523 0 7523 0 2 variable y00 0 7523 7523 0 7523 point L16 x5 y16 5 2 3523 point R16 x6 y16 100 2 3523 point L14 x5 y14 5 2 1523 point R14 x6 y14 100 2 1523 point L12 x5 y12 5 1 9523 point R12 x6 y12 100 1 9523 point L10 x5 y10 5 1 7523 point R10 x6 y10 100 1 7523 point L08 x5 y08 5 1 5523 point R08 x6 y08 100 1 5523 point L06 x5 y06 5 1 3523 point R06 x6 y06 100 1 3523 point L04 x5 y04 5 1 1523 point R04 x6 y04 100 1 1523 point L02 x5 y02 5 9523 point R02 x6 y02 100 9523 point L00 x5 y00 5 7523 point R00 x6 y00 100 7523 draw the dashes from Left to Rig
12. at 4 217 4 717 5 217 5 717 6 217 6 717 7 217 7 717 8 217 ONT EO oti HO 2E VOE aly ail wily HE GIE 1E 2 RIA Ff hh extra right axis 50 N20 hh as acis off graph then need new paper command hipapertunits mm 3 5294cm arange 5 117 yrange 0 8653 3 465 hh papertunits 2cm 1 3cm wrange 34 40 75 yrange 3 142 y2 44 use offset 50 setcoordinatesystem units lt 2cm 1 3cm gt setplotarea x from 34 00000 to 40 75000 y from 3 14200 to 13 00000 axis right Z4 second right acis for 50 oxygen Offset 3 142 ticks withvalues 0 0 5 1 0 1 5 2 0 2 5 3 0 3 5 4 0 4 5 5 0 5 5 6 0 6 5 7 0 7 5 8 0 8 5 9 0 9 5 at 3 147 3 647 4 147 4 647 5 147 5 647 6 147 6 647 7 147 7 647 8 147 8 647 9 147 9 647 10 147 10 647 11 147 11 647 12 147 12 647 hh initial conditions hh Linethickness 1pt Z linethickness 1 00000pt Linethickness 1 00000pt font CM cmr10 at 9 97226pt setplotsymbol CM hh draw vertical T37 line hh make top end half way between top and MAC1 6 line hh var y22 y2 y2 k2 2 hh y22 12 8019037071788 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 109 hh point T137 137 922 T137 37 00000 12 80190 hh point B137 137 y1 B137 37 00000 2 50000 hh drawline T137 B137 44 vertical T 37 line putrule from 37 00000 12 80190 to 37 00000 2 50000 Z4 T137B137 hh point Q1 34 y2t A44 top left corner Q1 34 00000 13 00000 hh text sf Huge DESFLURA
13. click on RUN button perl launchcami2 pl runs the Camomile program at end of operation terminate program click on QUIT menu option gt closes down screen and generates the widget again click on PRINT LAST CASE button generates the paper and HTML Anaesthetic Record After the anaesthetic operation we terminate the 1aunchcamXX pl program and control reverts to the launching widget from which we can then start the post processing of the collected data and hence generate the printed Anaesthesia Record More recently the Anaesthesia Record data and graphs have been conveniently coordinated via a HTML frontend which allows all the data programs and graphs to be viewed easily The buttons are mapped to programs as follows e RUN camomile launchcam12 pl e EPIDURAL database epidural pl e PROJECT TEAM camteanabdvi dvi e QUIT gt exit e PRINT LAST CASE not active just gives help message 135 CHAPTER 8 THE PERL TK FRONT END RWD Nickalls 136 CAMOMILE Tauncher V Z e Peri dick on the RUN button to start the Sum CAMOMILE anaesthesia program EPIDURAL and DOUBLE LUMEN TUBE c The CAMOMILE project team 2004 Figure 8 1 Screen showing the initial graphic front end loader widget lt tklaunch2 pl1 gt which allows the user to either start the Camomile program or access other utilities e g process the data from last case or run the Tube amp EPIDural da
14. n5n10 plot 10 1 690702 15 1 639144 n10n15 plot 15 1 639144 20 1 589158 n15n20 plot 20 1 589158 25 1 540697 n20n25 plot 25 1 540697 30 1 493713 n25n30 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 70 plot 30 1 493713 35 1 448162 n30n35 plot 35 1 448162 40 1 404 n35n40 plot 40 1 404 45 1 361185 n40n45 plot 45 1 361185 50 1 319675 n45n50 plot 50 1 319675 55 1 279432 n50n55 plot 55 1 279432 60 1 240415 n55n60 plot 60 1 240415 65 1 202589 n60n65 plot 65 1 202589 70 1 165916 n65n70 plot 70 1 165916 75 1 130361 n70n75 plot 75 1 130361 80 1 09589 n75n80 plot 80 1 09589 85 1 062471 n80n85 plot 85 1 062471 90 1 030071 n85n90 plot 90 1 030071 95 9986587 n90n95 drawpoint n10n20n30n40n50n60n70n80n90 put bullet at 10 1 690702 n10 put bullet at 20 1 589158 n20 put bullet at 30 1 493713 n30 put bullet at 40 1 404 n40 put bullet at 50 1 319675 n50 put bullet at 60 1 240415 n60 put bullet at 70 1 165916 n70 put bullet at 80 1 09589 n80 put bullet at 90 1 030071 n90 end of file lt isondata dat gt thinline inputfile isomdata dat 1 Start of file lt isomdata dat gt m mac40 iso 1 point m5 5 1 453235 5 1 453235 point m10 10 1 408918 10 1 408918 point m15 15 1 365953 15 1 3659
15. now split the time hh mm ss gt hh mm only my sthhmmss split st my hh sthhmmss 0 my mm sthhmmss 1 ss sthhmmss 2 not used print the gmt part is day month date st year n print logg the gmt part is day month date st year n but Kalarm requires that the month and date is in numerals if month eq Jan month 01 if month eq Feb month 02 if month eq Mar month 03 if month eq Apr month 04 if month eq May month 05 if month eq Jun month 06 if month eq Jul month 07 if month eq Aug month 08 if month eq Sep month 09 if month eq Oct month 10 if month eq Nov month 11 if month eq Dec month 12 my ymdhm year month date hh mm return ymdhm Htend of sub THE close END 14 6 File viewer program dn tkviewer pl CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 214 usr bin perl RN tkviewer pl modified from RNtkview pl my thisprog dn tkviewer pl used in error messages HH RWD Nickalls Dec 16 2005 a simple TK fileviewer takes filename as argument THE d now make the widget TH BOOK Mastering Perl Tk by Lidie 5 and Walsh N O Reilly 2002 to get FullScreen mode at startup p 307 geometry widthXheight Xoffs
16. print string number eventnumber Wn process the event string to locate begin and end codes get the index positions for UID and SEQUENCE uid1 index dataline lt VTM gt uid2 index dataline lt VTM gt print uid1 uid1 An print uid2 uid2 An uid substr dataline uid1 uid2 6 uid1 print this string to outfile print UID uid n dissect out the front middle end parts of the string uid f1 index uid lt VIM gt lt VTMID gt m1 index uid lt VIMID gt lt NM gt el index uid lt NM gt lt VIM gt CHAPTER 13 DRUG DICTIONARY RWD Nickalls 173 detect the INVALID tag Sinvalid index uid lt INVALID gt if find INVALID then remove the current string segment and get next line if Sinvalid gt 1 invalidflag ON print CINVALID tag found n print invalid FLAG ONNn goto REMOVE drugcode substr uid 12 m1 12 OK print drugcode lt drugcode gt n drugname substr uid m1 12 e1 m1 12 OK print drugname lt drugname gt n print new format to outfile this is actual Unordered contents of VTM file print outfile eventnumber drugname drugcode gt n collect all the drugname s into an Unsorted array so we can sort it later push udrugname drugnam
17. text mybottom 46 0 12 0 15 put mybottom at 46 000000 0 120000 text footnotesize copyright RWD Nickalls 2003 19 0 5 put footnotesize copyright RWD Nickalls 2003 at 19 000000 0 500000 text Marge ISOFLURANE 46 2 8 80 put Marge ISOFLURANE at 46 000000 2 800000 draw horizontal dashed lines linethickness 0 4pt equivalent to tiny linethickness 0 6pt half way between tiny and normalsize setdashes var x5 5 Left X value x5 2 5 var x6 100 Right X value x6 100 var y16 2 3523 y16 2 3523 var y14 2 1523 y14 2 1523 var y12 1 9523 y12 1 9523 var y10 1 7523 y10 1 7523 var y08 1 5523 y08 1 5523 var y06 1 3523 y06 1 3523 var y04 1 1523 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 89 y04 1 1523 var y02 0 9523 0 7523 0 2 y02 0 9523 var y00 0 7523 0 7523 y00 0 7523 point L16 x5 y16 L16 5 00000 2 35230 point R16 x6 y16 R16 100 00000 2 35230 point L14 x5 y14 L14 5 00000 2 15230 point R14 x6 y14 R14 100 00000 2 15230 point L12 x5 y12 L12 5 00000 1 95230 point R12 x6 y12 R12 100 00000 1 95230 point L10 x5 y10 L10 5 00000 1 75230 point R10 x6 y10 R10 100 00000 1 75230 point L08 x5 y08 L08 5 00000 1 55230 point R08 x6
18. var y12 j1 0 5 0 5V 76 now do the paper command only for axes B here as no decimals paper units 2cm 1 3cm xrange 34 40 yrange y1 y2 axes B ticks 1 0 5 left axis 100 oxygen axis left left axis for 100 oxygen string100a string100b modified from mac des7 m Waxisright 67 N2O scale offset for 67 4 22 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 2770 271 272 273 274 275 276 271 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 98 string67a string67b modified from mac des7 m extra right axis 50 N2O as axis off graph then need new paper command paper units mm 3 5294cm xrange 5 117 yrange 0 8653 3 465 paper units 2cm 1 3cm xrange 34 40 75 yrange 3 142 y2 use offset 50 axis right second right axis for 50 oxygen Offset 3 142 string50a string50b initial conditions linethickness 1pt draw vertical T37 line make top end half way between top and MAC1 6 line var y22 y2 y2 k2 2 point T137 37 y22 point B137 37 y1 drawline T137 B137 vertical T 37 line point Q1 34 y2 top left corner text sf Huge DESFLURA
19. BeginLog 2004 09 23 14 38 16 VersionStamp Camomile 0 1 _040413b Apr 15 2004 12 10 32 4 TruncateLog 0 Note 192 opened logfile home dick allfiles camomiletop theatredata 2004 8ep 23 1438 base log Mark 2004 09 23 14 38 16 EntryDevice 2004 09 23 14 38 16 project start Mark 2004 09 23 14 39 34 NEntryAnaesthetist E 2004 09 23 14 39 26HDr R W D Nickalls et al Marki2004 09 23 14 44 24Y EntryDevice 2004 09 23 14 44 24 datex as3 bad checksum 204 172 Mark 2004 09 23 14 44 29 NEntryDevice 2004 09 23 14 44 29 4datex as3 bad checksum 204 172 Mark 2004 09 23 15 16 313 EntryDrug 2004 09 23 15 16 25 Morphine 2 Mark 2004 09 23 15 17 23 EntryDrug 2004 09 23 15 16 33 Epidural marcain 0 25 5mls Mark 2004 09 23 15 17 34 EntryAlarm E 2004 09 23 15 17 34 Alarm Off BP 160 75 Mark 2004 09 23 15 17 35 EntryDrug 2004 09 23 15 17 24 Epidural fentanyl 100 mcg Mark 2004 09 23 15 34 49 EntryDrug 2004 09 23 15 34 38 Gelofusin 500 IN Mark 2004 09 23 16 32 33 VEntryDrug12004 09 23 16 32 28 Neostigmine Glycopyrrolate 1 Mark 2004 09 23 16 32 35 EntryDevice 2004 09 23 16 32 35 project stop Note 205 closing logfile EndLog 2004 09 23 16 32 35 Aheof Part IV Data processing inline printing module Chapter 16 Printing module overview December 13 2014 allfiles camomi
20. bullet at 39 00000 6 02791 4 E39 hh tezt Vturnboz110 5817540253587 boldmath 0 8 E37 polar r9 10 5817540253587 t9 deg put turnbox 10 5817540253587 boldmath 0 8 at 37 126995 5 634426 hh var m 0 6 ZA4MAC A4 m 0 6 hh point F34 134 25 m m40 10 0 00269 34 40 1 0 05 S 7 34 25 F34 34 25000 3 54482 hh point F35 135 mkm40 10 0 00269 34 40 1 F35 35 00000 3 69894 hh point F36 136 m m40 10 0 00269 34 40 1 F36 36 00000 3 90444 hh point F37 137 m m40 10x 0 00269 34 40 1 F37 37 00000 4 10994 hh point F38 138 m m40 10 0 00269 34 40 1 F38 38 00000 4 31543 hh point F39 139 m m40 10x 0 00269 34 40 1 F39 39 00000 4 52093 0 05 37 0 05 37 0 05 37 0 05 37 0 05 37 35 36 37 38 39 hh point F40 39 75 m m40 10 0 00269 34 40 1 0 05 37 39 75 F40 39 75000 4 67505 color blue hh drawline F34 F37 plot 34 25000 3 54482 37 00000 4 10994 F34F37 color red hh drawline F37 F40 plot 37 00000 4 10994 39 75000 4 67505 Z4 F37F40 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 114 color black hh draupoint F35 put bullet put bullet put bullet put bullet put bullet hh text turnboxt7 97587571582933 1 boldmath 0 6
21. grab current time my time now unix time seconds my time_now string localtime time_now_unix print logg rnalarm log time_now string Unix time now unix Wn print logg log of my Perl rnalarm3 pl program W set up the in and out files open my infile lt test vtm23 txt die ERROR can t open INfile Nn fHHtopen my infile lt dn fotm2xml txt die ERROR can t open INfile Nn w50 2005 CHAPTER 13 DRUG DICTIONARY RWD Nickalls 171 open my infile vtm23 w19y2006xml txt die ERROR can t open INfile week19 n d open my outfile gt test out vtm txt die ERROR can t open OUTfile An open my outfile2 gt test outsorted txt die ERROR can t open OUTsortedfile Xn TE now read each line in the file and place parameters into an array print reading the infile file line by lineWn print logg reading the infile file line by lineWn set the eventFLAG my eventnumber 0 counts the number of durg value pairs in the dictionary my eventFLAG OFF initialise variables my uid1 0 my uid2 0 my Suid us my begincode VTM my endcode VTM my len 0 my f1 0 my m1 0 my e1 0 my invalid 0 my Sinvalidflag OFF Hn my dataline my newline my pz s nn my drugcode HH
22. print waiting for data lt CTRL C gt to quit n print total chars sumpb Wn while portbuffer ob gt input ne buffer portbuffer ie buffer buffer portbuffer Lcr index buffer 1f length to next LF Leof index buffer EOF detect EOF character sumpb sumpb length portbuffer if Lcr gt 1 detects LF character and prints line data substr buffer 0 Lcr print LOG data n buffer substr buffer Lcr 1 1 remove the LF as well as CI print LOG remaining buffer buffer n print LOG total portbuffer chars sumpb n print LOG n elsif Leof gt DI detects EOF char and prints out last line data substr buffer 0 Leof print LOG data n print LOG total portbuffer chars sumpb n print LOG eof An pass ob gt write thank you works OK last INPUT else no LF or EOF found next skip the printing to the file use this for diagnostics CHAPTER 5 INTERFACING THE SERIAL PORT USING PERL RWD Nickalls 55 print LOG NO LF NO EOF An print LOG buffer print LOG portbuffer buffer n portbuffer n print LOG Lcr Lcr Mn print LOG Leof ki end of while2 end of whilel close LOG now close the serial port ob gt close croa
23. use Fatal use Carp use I0 Handle for autoflush page 224 226 use prompt module use commandline stuff my COM1 dev ttySO my ob Device SerialPort gt new COM1 croak Can t open COM1 ob error msg 1 use built in error messages ob user msg 1 setup the COM port ob baudrate 19200 croak fail setting baudrate 19200 ob parity none croak fail setting parity ob databits 8 croak fail setting databits ob stopbits 1 croak fail setting stopbits ob gt handshake none croak fail setting handshake ob write settings croak no settings FE ase ee my pass use a while loop to send output data via the serial port PHa test pulses works OK print testing RTS on off n ob gt pulse_rts_on 1000 100 ms ob gt pulse_rts_off 1000 if MS_RTS_ON 1 print RTS ON n else print RTS OFF n if MS_CTS_ON 0 print CTS ON n else print CTS OFF n CHAPTER 5 INTERFACING THE SERIAL PORT USING PERL RWD Nickalls 51 my rtsval 0 rtsval MS RTS ON O print RTSval rtsval n my ctsval 0 ctsval MS CTS ONO print CTSval ctsval n my ringval 0 ringval MS RING ONO print RIval ringval n o0b gt dtr_active F O red 1 green OK ob rts active 0 O red 1 green OK sleep 2 Hd i a LA ans Ee an ee a a EE EE ma dm
24. writes to screen thisdir cwd print logfile thisdir n CHAPTER 20 PROCESSDATA PL RWD Nickalls 285 now we can start crunching the Field files now call fields2PDATA pl perlprog fields2PDATA pl print logfile CALLing program perlprog if e perlprog print Nn CALLing program perlprog n print logfile OK done n system perl perlprog else print ERROR can t find file lt perlprog gt n print logfile ERROR can t find file lt perlprog gt n print logfile line n dp 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 return to orig directory print returning to original directory n print logfile returning to original DIR n chdir check the dir print logfile the current dir is n system pwd writes to screen thisdir cwd print logfile thisdir n print logfile line n close logfile END Chapter 21 fields2PDATA pl December 13 2014 allfiles book xenon ch fields2PDATA tex usr bin perl fields2PDATA pl w turned off for the moment camomiletop datexsim printfiles fields2PDATA pl orig from plotgnnK2 p1 for gnuplot graphs with right side y2labels prog for plotting Gnn files from binlog files cam2 Dick Nickalls October 16 2005 reminder remember to use latest version of files cam2gnnH pl plotgnnK2 pl prtane
25. 0 5614 since this axis is off the graph then need new paper command but do not use axis option paper units 0 7mm 3 818181cm xrange 8 121 yrange 0 5614 2 3614 setcoordinatesystem units lt 7mm 3 818181cm gt note xunits amp yunits are different setplotarea x from 8 to 121 y from 5614 to 2 3614 axis right seconds right axis for 50 oxygen shift 0 5614 ticks withvalues 0 O cdot 2 0 cdot 4 O cdot 6 0 cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 1 cdot 8 at 0 5614 0 7614 0 9614 1 1614 1 3614 1 5614 1 7614 1 9614 2 1614 2 3614 beginSKIP newcommand thickline setplotsymbol Large newcommand thinline setplotsymbol tiny thickline inputfile isoqdata dat 1 6 start of file lt isoqdata dat gt q mac40 iso 1 6 point q5 5 2 325176 5 2 325176 manual point q10 10 2 25427 10 2 25427 point q15 15 2 185525 15 2 185525 point q20 20 2 118877 20 2 118877 point q25 25 2 054262 25 2 054262 point q30 30 1 991617 30 1 991617 point q35 35 1 930882 35 1 930882 point q40 40 1 872 40 1 872 point q45 45 1 814913 45 1 814913 point q50 50 1 759567 50 1 759567 point q55 55 1 705909 55 1 705909 point q60 60 1 653887 60 1 653887 point q65 65 1 603451 65 1 603451 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 68
26. An Open Source Anaesthesia Workstation Linux revision 20148 o X i u ERE EE ANAESTHETIC SHEET ingham UK EE Ee m 5 m wm 27 Tu Ee amome 01 8 ie mmejde E actetocamcs 5 xavi fepna m 15 08 Richard W D Nickalls Simon Dales Adrian K Nice The single biggest problem we face is that of visualisation Richard P Feynman 1918 1988 VThe Mathematical Gazette 1996 80 267 lil An open source Anaesthesia Workstation Richard W D Nickalls formerly Department of Anaesthesia Nottingham University Hospitals City Hospital Campus Nottingham UK dick nickalls org http www nickalls org Simon Dales Purrsoft Oxford UK simond purrsoft co uk Adrian K Nice Department of Information and Computing Technology City Hospital Nottingham UK anice ncht co uk Copyright C RWD Nickalls S Dales AK Nice G Dean 1994 2014 zw d n December 2014 revision 20146 Contents Contents Background An anaesthesia workstation 1 1 Introduction see ee aia RR ER ER EE oe OE We 1 2 Difficulty with fundingandR amp D 2 SS se 1 3 The Linux project 2 22 14 Modules sec Rm RR RET E non EROR ee 1 4 1 Printing archiving module os ss SS SS s
27. Finally we generate the associated pdf files using the epstopdf utility Note that the particular mathsPIC program used at that time was actually an early B version of the final mathsPIC program Syropoulos A and Nickalls RWD 2005 so that the following mathsPIC script contains instances of the old variable commands which were still being used eventually changed to the Perl like format War C mac iso7 m modified from mac iso5 m Feb 1st 2003 final graph chart for the bja wih decimals cdot and fbox new curves for anaesthesia mathsPIC documentclass a4paper 12pt article usepackage pictexwd begin document thispagestyle empty to avoid page nos oddsidemargin 17mm framebox beginpicture CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 63 use sf font for figures for BJA Montfamily cmss selectfont normalsize linethickness 0 9pt 2 normalsize my manual p 23 structure copied from mac des m ISOflurane Delta for N2O 0 75 66 6666 104 1 17 pointnumber 200 y units 12cm 2 2 5 454545 Jopaper units mm 5 454545cm xrange 5 100 yrange 0 4 2 6 axes L ticks 10 0 2 paper units 0 7mm 3 818181cm xrange 8 100 yrange 0 4 2 6 axes T want to print only some of the L axis scale 0 6 2 4 so do it manually Vaxis left ticks withvalues 0 cdot 6 O cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 1 c
28. NIBP mean 90 130 131 2 HRnibp min 1 NIBP heart rate 63 132 135 4 TEMPIstatus Temp status 136 137 2 TEMPllabel Templ label 138 139 2 TEMPI degC 100 Templ 37 5 140 143 4 TEMP2status Temp status 144 145 2 TEMP2label Temp2 label 146 147 2 TEMP2 degC 100 Temp2 37 5 148 151 4 TEMP3status Temp3 status 152 153 2 TEMP3label Temp3 label 154 155 2 TEMP3 degC 100 Temp3 37 5 156 159 4 TEMP4status Temp4 status 160 161 2 TEMP4label Temp4 label 162 163 2 TEMP4 degC 100 Temp4 37 5 164 167 4 SATstatus Saturation status 168 169 2 SATlabel Saturation label 170 171 2 SAT 100 Saturation 95 172 173 2 HRsat min 1 Saturation heart rate 174 175 2 SATamp 1 Plethysmograph IR amplitude 176 177 2 SATloc 100 Sat probe location ven art 178 181 4 CO2status CO2 status 182 183 2 CO2label CO2 label 184 185 2 ETCO2 100 End Tidal CO2 conc 4 6 186 187 2 FICO2 100 Frac Insp CO2 conc 1 3 188 189 2 RRCO2 min 1 Resp Rate CO2 12 190 191 2 AMBPCO2 mmHg 10 Ambient pressure 192 195 4 O2status Oxygen status 196 197 2 O2label Oxygen label 198 199 2 ETO2 100 End Tidal oxygen conc 37 200 201 2 FIO2 100 Frac Insp oxygen conc 28 202 205 4 N2Ostatus N2O status 206 207 2 N2Olabel
29. calendar ics and carp could not run Perl dn tkviewer pl thisprog OS ERROR system perl dn tkalarm pl geometry 320x380 50 300 else print ERROR Wn print can t find file dn calendar ics gt n n system perl dn tkalarm pl geometry 320x380 50 300 end of the sub sub help HHH this displays the main diabetes help file topwindow gt bell result dialog2 gt Show topwindow gt destroy if Tk Exists topwindow if e camteama5dvi dvi if e diabetes diabetes intro html first remove the Tk screen topwindow destroy if Tk Exists topwindow topwindow gt bell beeps if click window p 296 1t system xdvi camteamaSdvi dvi paper a5 geometry 4204207 system konqueror diabetes intro html if use Simon s Konquered utility then it needs the FULL path system konquered geometry 500x550 20 100 home dick allfiles akalarm diabetes diabetes intro html system perl dn tkalarm pl geometry 320x380 50 300 else print ERROR W print can t find program lt camteama5dvi dvi gt n n system perl dn tkalarm pl geometry 320x380 50 300 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 204 E end of sub sub showhelp opens the small help window create the array of help contents to pass to the help module
30. camomiletop tarballs inc port datex as3 h camomiletop theatredata camomiletop theatredata 2004 Mar 05 1027 l bin runcamomile l bin camomilefield2tex Chapter 11 The Camomile program December 13 2014 oAHOUSE book xenon ch camomile tex 11 1 Directory listing of camomile v 0 1 040413b This is the directory listing of the final working version of the Camomile program written by Simon Dales compiled April 15 2004 dir listing of camomile v 0 1_040413b c Apr 15 2004 camomile 1279 Nov 20 2003 bell off xpm 1263 Nov 20 2003 bell on xpm 408 Feb 17 2003 browser back xpm 411 Feb 17 2003 browser exit xpm 409 Feb 17 2003 browser frwd xpm 424 Feb 17 2003 browser home xpm 408 Jun 17 2003 browser reload xpm 443496 Apr 13 2004 camomile 40924 Apr 11 2004 camomile cpp 1843 Apr 11 2004 camomiledoc cpp 1646 Feb 17 2003 camomiledoc h 7422 Dec 8 2003 camomile h 1518 Apr 11 2004 camomileview cpp 1472 Feb 17 2003 camomileview h 1279 Feb 17 2003 camomile xpm 4879 Apr 11 2004 dAboutBox cpp 1349 Apr 11 2004 dAboutBox h 12749 Jun 15 2003 dAboutBox ui 3199 Apr 11 2004 dDisplayDial cpp 929 Apr 11 2004 dDisplayDial h 7T631 May 28 2003 dDisplayDial ui 1561 Apr 11 2004 dDisplayGraph cpp 803 Apr 11 2004 dDisplayGraph h 2066 May 29 2003 dDisplayGraph ui 1776 Apr 11 2004 dDisplayNow cpp 151 CHAPTER 11 THE CAMOMILE PROGRAM RWD Nickalls 152 850 Apr 11 2004 dDisplayNow h 6610 Apr 11 2004 dDrugs cpp 1437 Apr
31. gnn files as described in the next section c Generate 1 hr gnn files with subroutine nakegnnfiles This role of this subroutine is to generate from the above parameter data file which may contain many hours of data a series of 1 hour gnn files suitable for use by the GNUplot graphing program The makegnnfiles subroutine is part of the Perl program cam2gnnh p1 which is itself called by the co ordinating Perl program plotgnnk2 pl The subroutine is called with the field parameter name as follows makegnnfiles paramname j Calling the subroutine makennnfiles converts each of the raw output parameter data files data files into a series of 1 hour two column space separated data files suitable for accessing by gnuplot For example a 4 hr sat data file would be converted into four 1 hour files as follows sat g01 sat g02 sat g03 sat g04 The makegnnfiles subroutine also makes the elapsed time for each file relative to the beginning of each hour by using the new computed start time for each file as the zero time i e elapsed time within a gnn file will run from 0 3599 secs i e just 1 hour We have three space delimited fields namely elapsed time local parameter unix time The subroutine figures out how to split up the data file into 1 hour chunks by comparing the difference between the operation start time and the unix time on each line Note that both the unix time and gmt ti
32. q90 end of file lt isoqdata dat gt thinline inputfile isopdata dat 1 4 start of file lt isopdata dat gt p mac40 iso 1 4 point p5 5 2 084529 5 2 034529 manual point p10 10 1 972486 10 1 972486 point p15 15 1 912335 15 1 912335 point p20 20 1 854018 20 1 854018 point p25 25 1 797479 25 1 797479 point p30 30 1 742665 30 1 742665 point p35 35 1 689522 35 1 689522 point p40 40 1 638 40 1 638 point p45 45 1 588049 45 1 588049 point p50 50 1 539621 50 1 539621 point p55 55 1 49267 55 1 49267 point p60 60 1 447151 60 1 447151 point p65 65 1 40302 65 1 40302 point p70 70 1 360235 70 1 360235 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 69 point p75 75 1 318754 75 1 318754 point p80 80 1 278539 80 1 278539 point p85 85 1 23955 85 1 23955 point p90 90 1 201749 90 1 201749 point p95 95 1 165102 95 1 165102 drawline p5p10p15p20p25p30p35p40p45p50p55p60p65p70p75p80p85p90p95 plot 5 2 034529 10 1 972486 p5p10 plot 10 1 972486 15 1 912335 p10p15 plot 15 1 912335 20 1 854018 p15p20 plot 20 1 854018 25 1 797479 p20p25 plot 25 1 797479 30 1 742665 p25p30 plot 30 1 742665 35 1 689522 p30p35 plot 35 1 689522 40 1 638 p35p40 plot 40 1 638 45 1 588049 p40p45 plot 45 1 588049 50 1 539
33. relief gt flat background gt LightGrey activebackground gt Grey foreground gt Blue activeforeground gt Red command gt amp help gt place relx gt 0 rely gt 0 9 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 201 my diabetes error message ERROR running dn alarm diabetes2 thisprog MainLoop HE SUBS sub quit clear the command line terminal window and then exit system clear exit sub diabetes20 topwindow gt bell result dialog1 Show if result eq OK topwindow gt destroy if Tk Exists topwindow system perl dn alarm diabetes3 pl t 20 and carp diabetes error message system perl dn tkalarm pl geometry 320x380 50 300 sub diabetes30 topwindow gt bell result dialog1 Show if result eg OK y topwindow gt destroy if Tk Exists topwindow system perl dn alarm diabetes3 pl t 30 and carp diabetes error message system perl dn tkalarm pl geometry 320x380 50 300 sub diabetes40 topwindow gt bell result dialog1 Show if result eg OK Y topwindow gt destroy if Tk Exists topwindow system perl dn alarm diabetes3 pl t 40 and carp diabetes error message system
34. starttimeunix ARGV 0 passing only one name into array my file _ print processing parameter file Wn add the file ending dat infilename file data print the input filename is infilename Wn open infile infilename die ERROR can t find file infilename Mn now make time dependent out filename start with hour set to zero hour 0 start inputting lines of data need to get the time associated with line 1 interval 45 secs oldelapsedtime 0 LINE while lt infile gt next LINE if skip comments CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 256 next LINE if 4 skip comments next LINE if skip blank lines grab the whole line as a string dataline _ place the params into an array value split dataline print value 0 value 1 value 2 n assign the elapsedtime and param values unixtime value 0 gmtime value 1 GMT yyyy mm dd hh mm ss elapsedtime value 2 elapsed time secs paramvalue value 3 chomp paramvalue remove the line ending to help maths multiply the rr values by 50 to make them fit range 0 1000 if file eq co2 rr paramvalue paramvalue 50 save data only every interval secs elapsedtime unixtime starttimeunix determine true elapsedtime if elapsedtime lt oldelapsedtime interval next LINE else oldelapsedtime e
35. udrugname drugname add to the Unsorted drugname array dmd dmd drugname drugcode add new name code pair to the hash elsif n 4 THE no strings with 3 as yet print first w1 An print seconds w2 An print third w3 n print 4th w4 n j else croak ERROR string NOT processed as n n n else carp ERROR string NOT processed as n n Wn print ERROR string NOT processed as n n n else print NO the string has no Nn Y REMOVE remove last string from the current dataline dataline substr dataline uid2 6 length dataline length uid print uid if invalid tag found if invalidflag eq ON print string not processed Wn Sinvalidflag OFF print invalid FLAG OFF n print dataline dataline Nn sleep 1 now look for next string pair print looking for the next event n goto LINEA when fall off end of string then look for next string print ERROR looking for new line string n warn ERROR must have a problem here as should not get here n THHE must have a problem here as should not get here next LINE THE CHAPTER 13 DRUG DICTIONARY RWD Nickalls 175 finally dump the event string and start again Y end of looking for the endcode if when fall off end of string while still looking for th
36. x v9 00000000 Oo ET iso age 40 temp 34 macFrac 0 6 n20 0 0 5967 ET iso age 40 temp 37 macFrac 0 6 n20 0 0 7020 ET iso age 40 temp 40 macFrac 0 6 n20 0 0 8073 ET iso age 40 temp 34 macFrac 1 6 n20 50 1 0312 ET iso age 40 temp 37 macFrac 1 6 n20 50 1 3120 ET iso age 40 temp 40 macFrac 1 6 n20 50 1 5928 ET iso age 40 temp 34 macFrac 1 6 n20 67 0 8412 ET iso age 40 temp 37 macFrac 1 6 n20 67 1 1220 ET iso age 40 temp 40 macFrac 1 6 n20 67 1 4028 ET sevo age 40 temp 34 macFrac 0 6 n20 0 0 9180 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 131 ET sevo age 40 temp 37 macFrac 0 6 n20 0 1 0800 ET sevo age 40 temp 40 macFrac 0 6 n20 0 1 2420 ET sevo age 40 temp 34 macFrac 1 6 n20 50 1 5880 ET sevo age 40 temp 37 macFrac 1 6 n20 50 2 0200 ET sevo age 40 temp 40 macFrac 1 6 n20 50 2 4520 ET sevo age 40 temp 34 macFrac 1 6 n20 67 1 2880 ET sevo age 40 temp 37 macFrac 1 6 n20 67 1 7200 ET sevo age 40 temp 40 macFrac 1 6 n20 67 2 1520 ET des age 40 temp 34 macFrac 0 6 n20 0 3 3660 ET des age 40 temp 37 macFrac 0 6 n20 0 3 9600 ET des age 40 temp 40 macFrac 0 6 n20 0 4 5540 ET des age 40 temp 34 macFrac 1 6 n20 50 5 8260 ET des age 40 temp 37 macFrac 1 6 n20 50 7 4100 ET des age 40 temp 40 macFrac 1 6 n20 50 8 9940 ET des age 40 temp 34 macFrac 1 6 n20 67 4 7560 ET des ag
37. 87 88 89 90 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 94 number d dx d page 190 does not work OK number 2 Nd N Nd Nd S Nd Ee d page 190 not work THE print enter AGE yrs q to quit age lt STDIN gt chomp age gage s s age s s clean leading and trailing white space if Ic age eq q print quitting program now n n exit if Sage number o else print Wn print ERROR value must be a decimal number 1 120 n print quitting program now nn exit final check that all input parameters were OK else quit at this stage if Sage gt 1 and age lt 120 do nothing else print Wn print ERROR entered inappropriate age age n print must be in range 1 120 n print quitting program now n n exit ii agef sprintf 3u Sage basename macdes mfilename basename agef m mtfilename basename agef mt psfilename basename agef ps pdffilename basename agef pdf dvifilename basename agef dvi use DVI filename to show that it has been printed on the fly filename dvifilename THE create the output file open outfile gt mfilename die ERROR can t create file mfilename Wn do some initi
38. Cefuroxime add drugname Cisatracurium add drugname Dexamethasone add drugname Dextrose 5 add drugname Diamorphine add drugname Digoxin add drugname Ephedrine add drugname Erythromycin add drugname Etomidate add drugname Fentany1 add drugname FFP add drugname Frusemide add drugname Gelofusin add drugname Glycopyrollate add drugname GTN add drugname Hartmans solution add drugname Heparin add drugname HESPAN add drugname Hydrocortisone add drugname Isoprenaline add drugname Metariminol add drugname Methoxamine add drugname Metronidazole add drugname Morphine add drugname Noradrenaline add drugname Normal Saline add drugname Phenylephrine add drugname Potassium add drugname Propofol add drugname Protamine add drugname Remifentanil add drugname Rocuronium add drugname Salbutamol add drugname Saline 0 9 add drugname SNP add drugname Suxamethonium CHAPTER 13 DRUG DICTIONARY RWD Nickalls 169 add drugname Thiopentone add drugname Vancomycin add drugname Vecuronium hheot However I started writing some Perl programs to extract and process the NHS listing whch could be downloaded from the DM D website 13 3 Download bundle Each download bundle had a filename something like week192006 r2_3 zip ie the bundle for week 19 2006 consisting of the following files amp_v2_3 xsd amp_v2_3 xsd BNF f amp
39. F37 polar r9 7 97587571582933 t9 deg put turnbox 7 97587571582933 boldmath 0 6 at 37 133889 4 258513 F36 F37 F38 F39 at 35 at 36 at 37 at 38 at 39 00000 3 69894 Z4 F35 00000 3 90444 Z4 F36 00000 4 10994 Z4 F37 00000 4 31543 Z4 F38 00000 4 52093 Z4 F39 hh nou draw all the horizontal dashed lines setdashes hh Vlinethickness 0 4pt linethickness 0 40000pt Linethickness 0 40000pt 7 font CM cmri0 at 3 98890pt setplotsymbol hh var w1 34 1 A4 wi 34 1 hh var w2 39 85 44 right end of dashed lines hh w2 39 85 hh point L16 w1 hh point R16 w2 hh point L14 w1 hh point R14 w2 hh point L12 w1 hh point R12 w2 hh point L10 tw1 hh point R10 w2 hh point LO8 tw1 hh point R08 w2 hh point L06 tul NOM DA 44 left end of dashed lines ycoord A37 L16 34 10000 10 95983 ycoord A37 R16 39 85000 10 95983 ycoord B37 L14 34 10000 9 58985 ycoord B37 R14 39 85000 9 58985 ycoord C37 L12 34 10000 8 21987 ycoord C37 R12 39 85000 8 21987 ycoord D37 L10 34 10000 6 84990 ycoord D37 R10 39 85000 6 84990 ycoord E37 L08 34 10000 5 47992 ycoord E37 R08 39 85000 5 47992 ycoord F37 L06 34 10000 4 10994 hh point RO6 u2 ycoord F37 R06 39 85000 4 10994 hh drawlime L16 R16 L14 R14 L12 R12 L10 R10 LO8 RO8 LOG R06 putrule putrule putrule putrule putrule putrule f
40. allfiles book xenon ch processdata tex usr bin perl w processdata pl RWD Nickalls Oct 30 2005 e Carp better error messages e File Copy for copying files e Cwd for grabbing current directory name e FindBin gets name of perl program processdata pl RWD Nickalls a module for coordinating the processing of all fields data to PDATA and which DOES NOT USE Simon Dales camomilefiles2tex program this module runs from the time encoded dir itself and processes all the Field files to final anes charts without needing to use the lt starttime dat file since the prog lt fields2PDATA pl gt reads all the binlog files to determine the earliest start time This program creates the PCOPY subdir copies across the necessary printfiles and then CALLS the program fields2PDATA pl 1 remember to change the path of the printfiles when using in theatre 2 need to delete part which copies this prog back to printfiles etc processdata pl from printlast pl October 16 2005 to process all the data as a standalone file 1 read the starttime dat if it exists else read all the fields files to 282 CHAPTER 20 PROCESSDATA PL RWD Nickalls 283 get earliest UNIX time open logfile gt processdata log die ERROR can t open file lt processdata log gt n 1inesz Ne get progName and its base dir name1 FindBin Bin programn
41. co2file ymin 2 ymax 10 n print co2file plot xmin xmax ymin ymax n print co2file 4 with lines 1 n print co2file 6 with lines 1 n print co2file 8 with lines 1 n co2expfilename co2 exp g gnn rrfilename co2 rr g gnn plot rr here also if e co2expfilename print co2file co2expfilename using 1 2 with linespoints 4 1 n else print printlog no co2 exp gnn files n we also plot the rr here to catch values gt 20 if e rrfilename print co2file rrfilename using 1 2 with linespoints 4 10 n else print printlog no rr gnn files n print co2file dummyline Mn close co2file print printlog C02 gnu doneNn now create the TV file tv rr open tvfile gt plot tv gnu die ERROR can t open plot tv gnu file n CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 295 print tvfile usr bin gnuplot n print tvfile plot tv gnu script made by plotg01a plNn print tvfile set terminal latex n print tvfile set output plot tv pic Mn print tvfile set size 1 415 smallheight n print tvfile set xtics timeline n print tvfile set noytics n print tvfile set y2tics 0 250 500 750 1000 n y2label qq Z Sat circ FIO _2 bullet print tvfile set y2label hello hello n print tvfile set noke
42. cvpfilename using 1 2 with lines 1 n else print printlog no cvp gnn files n need to use a dummyline to allow the graph frame to appear even if no data points and so allow the last line to have a comma if the following line gets ommitted so we make the dummyline have no final comma we do this by drawing a line below the graph ie it does not appear dummyline 20 with lines 1 dummy line print bpfile dummyline Mn close bpfile print printlog BP gnu done n p now create the sat file open satfile gt plot sat gnu die ERROR can t open plot sat gnu file n print satfile usr bin gnuplot n print satfile plot sat gnu script made by plotgnnk2 pl n print satfile set terminal latex n print satfile set output plot sat pic Mn print satfile set size 1 40 smallheight Wn print satfile set xtics timeline Wn print satfile set ytics 80 90 100 n print satfile set y2tics 80 90 100 n y2label qq Sat circ FIO _2 bullet print satfile set y2label Sat circ WW FIO _2 bullet 1 n print satfile set nokey n print satfile set grid n print satfile xmin 0 xmax 3600 n print satfile ymin 80 ymax 100 n print satfile plot xmin xmax ymin ymax n satfilename sat g gnn fo2filename o2 insp g gnn
43. deltahminusqqqq t2 hminus1 15 deltahminusqqq t3 hminus1 30 deltahminusqq t4 hminus1 45 deltahminusq t5 h 00 deltah t6 h 15 deltahplusq t7 h 30 deltahplusqq t8 h 45 deltahplusqqq t9 hplusi 00 deltahplusqqqq timeline t1 t2 t3 9t4 t5 9 t6 t7 9 t8 t9 Armed with the time base we can start making write to the gnu files In the following we illustrate the code for writing the sat gnu script file which will be processed by the GNUplot program eventually First we check that the hour value incorporated into the gnn string always has two digits i e 4 04 and hence we obtain g04 and defining the graph height to be used we then open the output file and proceed it plotgnnk2 p1 first make sure the gnn string has three characters if gnn lt 10 gnn 0 gnn define the graph heights smallheight 0 43 for all other graphs now create the sat file open satfile gt plot sat gnu Idie ERROR can t open plot sat gnu file n print satfile usr bin gnuplot n print satfile plot sat gnu script made by plotgnnk2 pl n print satfile set terminal latex n print satfile set output plot sat pic Mn print satfile set size 1 40 smallheight n print satfile set xtics timeline n print satfile set ytics 80 90 100 n print satfil
44. done n now make the pdf files system pdflatex prtanes6 tex pdffilename anes gnn pdf copy the pdf file to include a gnn pdf filename system cp v prtanes6 pdf pdffilename 18 7 Typeset the drug file using IATFX 2e Processing the drug file log file is slightly more complicated owing to the fact that the typesetting is done using IATEX 2g Consequently since the anaesthetists can enter data using the keyboard we need to filter out all non TEX material essentially to escape certain ASCII characters for example we would modify rightarrow etc This conversion is currently done by the Perl program base2texd pl which processes the original log file baselog data to the filtered file baselognew data We now typeset the filtered drug file and create the output formats dvi ps and pdf on the fly as before The TEX file for the graphs is prtdrug tex The style option is prtdrug2 sty We create the PostScript files using dvips We create the pdf files using pdflatex process the baselog data file system perl base2texd pl now latex the prtdrug file system latex prtdrug tex copy the dvi file to have a anes drug dvi filename system cp v prtdrug dvi anes drug dvi make the PS version of the dvi file system dvips anes drug dvi o anes drug ps make the pdf file system pdflatex prtdrug tex copy the pdf file to have a gnn pdf filename s
45. draw vertical T37 line make top end half way between top and MAC1 6 line var y22 y2 y2 k2 2 point T137 37 y22 point B137 37 y1 drawline T137 B137 vertical T 37 line point Q1 34 y2 top left corner text Vsf Huge DESFLURANE 37 y2 0 7 def theage jj text sf large AGE jj O1 shift 0 2 0 7 1 amp theage amp age point Q2 40 y1 bottom right corner text sf copyright RWD Nickalls 2005 Q2 shift 0 2 0 35 r text sf mathsPIC perl 1 O2 shift 0 2 0 7 Mr point Q3 35 y1 bottom left side text sf macdes034 dvi Q3 shift 0 0 35 1 define the polar rr tt for the urnbox MAC labels var r9 0 2 var t9 40 degrees text sf Temperature ycirc C 37 y1 0 7 text sf Large Age amp temperature corrected iso MAC chart 37 y1 1 4 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 104 refs newcommand refs begin minipage textwidth V sf Eger EI 2001 Anesthesiology underline 93 947 953 newline sf Nickalls RWD and Mapleson WW 2003 Br J Anaesthesia underline 91 170 174 end minipage text refs 34 yl 2 35 1 newcommand ylegend sf End tidal Desflurane in 100 oxygen air determine string length gt Yunits etc newlength ylength settowidth ylength ylegend text answer numb
46. fields tv insp binlog fields vap code binlog fields vap exp binlog fields vap insp binlog get each binlog file in turn and read the first line for UNIXtime for j 0 j lt fieldfilename j j 1 ifile fieldfilename j if e ifile open fieldsfile lt ifile die ERROR can t open file ifile n else print printlog ifile does NOT exist n next CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 288 print reading the fields file lt bp d binlog gt to access UNIX time n n 0 counter LINE while lt fieldsfile gt next LINE if t skip comments next LINE if 4 skip 4 comments next LINE if skip blank lines grab the whole line as a string dataline _ n n 1 increment counter chomp dataline removes the line ending print the line to the log file print printlog dataline filename ifile n print the line is dataline n place the two params into an array value split dataline get no of items should be only two items nitems value 1 print no of items in the line nitems n time value 0 parametervalue value 1 determine the least time J file counter if j 1 starttimeunix time else if time lt starttimeunix starttimeunix time only require the first UNIXtime from this file if n 1 last n is line counter end of line loop end
47. g gnn n2ofilename n2o exp g gnn pplatfilename pplat g gnn if e fo2filename print fo2file fo2filename using 1 2 with linespoints 4 10 n else print printlog no fo2 gnn files n if e n2ofilename print fo2file V n2ofilenameN using 1 2 with linespoints 4 3 n else print printlog no n20 gnn files n using diamonds as for MAC if e pplatfilename CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 294 print fo2file pplatfilename using 1 2 with linespoints 4 8 n else print printlog no pplat gnn files n print fo2file dummyline in close fo2file print printlog F02 gnu done n now create the C02 file open co2file gt plot co2 gnu die ERROR can t open plot co2 gnu file n print co2file usr bin gnuplot n print co2file plot co2 gnu script made by plotgOla pl n print co2file set terminal latex n print co2file set output plot co2 pic n print co2file set size 1 387 smallheight n was 1 4 print co2file set xtics timeline n print co2file set noytics n print co2file set y2tics 2 4 6 8 10 n ylabel qq Sat circ FIO _2 bullet print co2file set y2label hello hello n print co2file set nokey n print co2file set grid n print co2file xmin 0 xmax 3600 n print
48. hh for the ticks to work nicely we want left Yaris to be an hh exact multiple of tick interval hh therefore we addsome extra and adjust with 0 2 increments for sevo hh top right use t 40 and MAC 1 6 hh var k2 1 6 m40 10 0 00269 34 40 1 0 05 37 40 j2 int k2 0 25 0 5 hh k2 12 6038074143575 hh j2 25 hh var y2 j2 0 5 0 5 hh y2 13 hh bottom left use t 34 and MAC 0 6 hh var ki 0 6 m40 10 0 00269 34 40 1 0 05 37 34 ji int k1 0 25 0 5 4 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 108 Uh ki 3 49344662028388 hh 11 6 hh var yi1 j1 0 5 0 57 hh yl 2 5 4 now do the paper command only for aves B here as no decimals hh papertunits 2cm 1 3cm arange 34 40 yrange y1 y2 axes B LackslGiOn5 tae setcoordinatesystem units lt 2cm 1 3cm gt setplotarea x from 34 00000 to 40 00000 y from 2 50000 to 13 00000 axis bottom ticks numbered from 34 to 40 by 1 hh left acis 1004 oxygen axis left 7 left axis for 100 oxygen ticks withvalues 2 5 3 0 3 5 4 0 4 5 5 0 5 5 6 0 6 5 7 0 7 5 8 0 8 5 9 0 9 5 10 0 10 5 11 0 11 5 12 0 12 5 13 0 me 2 5 6 pLa 4 2 5 amp 6 5 G5 7 A 8 eS PSA wo 10 5 413 dil 12 42 5 de 7 7 axis right 67 N20 scale hh offset for 674 4 22 ticks withvalues 0 0 5 1 0 1 5 2 0 2 5 3 0 3 5 4 0 4 5 5 0 5 5 6 0 6 5 7 0 7 5 8 0 8 5
49. j 0 j lt paramname j j 1 ifile paramname j NO binlog file extension here system perl binlog2data pl ifile A typical example of the sat data file is as follows Note that the elapsed time parameter on the first line is zero and that both the unix time and the elapsed times increase in steps of 5 seconds data is output from the Datex monitor every 5 seconds it sat data 1071580231 2003 12 16 13 10 31 0 92 000000 1071580236 2003 12 16 13 10 36 5 92 000000 1071580241 2003 12 16 13 10 41 10 93 000000 1071580246 2003 12 16 13 10 46 15 93 500000 1071580251 2003 12 16 13 10 51 20 93 000000 1071580256 2003 12 16 13 10 56 25 93 000000 1071580261 2003 12 16 13 11 1 30 92 500000 1071580266 2003 12 16 13 11 6 35 92 000000 Armed with the above data file for a given parameter then we proceed to generate from this a series of 1 page gnn files each typically of 1 hour duration as described in the next section g Generate 1 page gnn files with subroutine nakegnnfiles This role of this subroutine is to generate from the new parameter data file which may contain many hours of data since it contains all the data held in the original binlog file a series of 1 page gnn files suitable for use by the GNUplot graphing program each gnn file generating a single page of the typeset Anaesthetic Record The makegnnfiles subroutine is part of the Perl program binlo
50. logg sending Kalarm string out n system qq out and croak could not run out OS ERROR Perl best practice p 280 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 207 HHHH SUBS THE ymdhm time string need to determine the until time in the correct format for kalarm sub ymdhm THE format yyyy mm dd hh hh passing only one time string into array my time string _ print processing parameter time string Nn THE now get the until time as yyy mm dd hh mm from the time string routine modified from fields2PDATA pl note the main items are lt space gt separated except hh mm ss THE format is Sun Jan 25 13 24 35 2004 format is Sun Jan 5 13 24 35 2004 THE note x get two spaces after the Month if days 10 see SUB tedname in launchcam12 pl TE if Fwo spaces in posn 8 and 9 then remove one space if substr time string 7 2 eq substr time string 7 2 replace spaces with commas time string tr THE make an array my stgmt split time string THE day stgmt 0 not used here my month stgmt 1 my date stgmt 2 my st stgmt 3 my year stgmt 4 noitems stgmt 1 not used here now split the time hh mm ss gt hh mm only my sthhmmss split st my hh sthhmmss 0 my mm sthhmmss 1 ss sthhmmss 2 not used here
51. mand which in this case takes a complicated parameter which is the string timeline In practice for each hour the particular time base used will be the same for all graphs drawn using parameters values from files having the same gnn value say g02 files for example The following code determines this string for each hour tailoring it to accomodate the time interval associated with each gnn value so as we move from one hour to the next then the time associated with each hour increases accordingly fields2PDATA p1 determine the earliest start time from GO1 files in timefile dat put the start time GMT year month day hrs mins sec into an array then determine how many hours worth of Gnn files there are s tex file st is the start time hh mm ss from the lt starttime dat gt file see above JJ gnnmax 01 returns gnnMax print printlog start time st in Not to be confused with the gnn data files CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 259 print printlog GnnMax gnnmax M extract the separate hh mm ss values start times split st starthour start time 0 startminute start time 1 startsecond start time 2 now print all the graphs for all Gnn files from O1 to GnnMax for gnn 1 gnn lt gnnmax gnn gnn 1 1 first determine time in secs to the begining of next full hour deltah 3600 startminute 60 starts
52. message eq croak ERROR message not specified thisprog Ht write the word ERROR underlined my error ERROR MESSAGE n n n n CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 216 my boxmessage error message THE topwindow MainWindow gt new topwindow gt title XENON topwindow gt Label text gt boxmessage wraplength gt 200 padx gt 10 background gt Yellow foreground gt Black height gt 10 width gt 35 gt place anchor gt n gt pack gt pack side gt top t expand gt 1 MainLoop L2 end CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 217 14 8 Screenshots Session Edit View Bookmarks Settings Help JOTABETES event found mj idi 48 Ajuid2 73 UI Alarm 800162303 363 ENON A EEr Ee d Altext textz 409 TEXT DIABETES repeat blood sugar EIE EDE EER cb cancelling existing DIABETES alarm sending command kalarm cancelEvent KAlarm ick on a 8001627303 363 QuiT diabetes button to set an alarm looking for the next event Ino more events found termating now hd DIABETES 20 mins setting new DIABETES alarm TEST sending Kalarm string kalarm b c red t 2006 04 22 16 53 i 0005 u 2006 04 23 16 33 DIABETES 30 mins n DIABETES repeat blood suga
53. month date st year year2 n print printlog extracted starttime hh mm ss st n print starttime starttimegmt n print no of gmt items ngmtitems Wn print the gmt part is day month date st year Wn RR Se need to include some error checking ie abort if probem with the times THHHHBHI goto LASTLINE abort program now run cam2gnnH pl to process all the X binlog files gt X data files print printlog running command perl cam2gnnH pl starttimeunix projdir n we pass both starttimeunix and the path projdir as well to lt cam2gnnh gt but these are needed only by Simon s THB EK kkk system perl cam2gnnH2 pl starttimeunix projdir system perl binlog2gnn pl starttimeunix print printlog OK n print printlog ss ssssssssssssssssssssssssssssssssssssssssssssssss n A now establish the x axis time scale xtics string need start time determine the earliest start time from GO1 files in timefile dat file put the start time GMT year month day hrs mins sec into an array B determine how many hours worth of Gnn files there are JJ gnnmax 01 returns gnnMax print printlog 2 2 c c c c cc cc cc c An print printlog start time st Nn print printlog GnnMax gnnmax Mn st is the start time hh mm ss from the lt starttime dat gt file see above CHAPTER 21 FIELDS2PDATA PL RWD Ni
54. my drug1 drug2 clean_drugs addname ucfirst drug1 force Uppercase first letter ucfirst THE if a synonym drug is given for existing drug using sign drug2 then THE grab the correct snomed code for drug2 and use it with the synonym if clean_drugs 1 gt 1 drug2 ucfirst drug2 force first letter to be Ucase THE ie at least two drugs in the input line print logg drugl drug1 drug2 drug2 n check we can actually find the snomed code if exists dmd drug2 1 addnamecode dmd drug2 else print logg can t find synonym drug2 Wn addnamecode ERROR j j if only single name given then just add it to list without snomed code use code lt gt so we can see which entries are added by us if exists dmd addname print logg dmd addname dmd addname n print logg Saddname is ALREADY on the VIM list n print ses dmd addname n print logg drugname xxx is ALREADY on the VTM listNn print Saddname xxx is ALREADY on the VIM list n else dmd dmd addname addnamecode add new drugname drugcode pair to the hash push udrugname addname add new drug only to the Unsorted drugname array print logg Saddname has been put on the list just now n print Saddname has been put on th
55. my drugname my delement my REVstring define the Unsorted drugname array my udrugname define the hash for drugname drugcode pairs my dmd LINE while lt infile gt next LINE if skip comments next LINE if skip comments next LINE if skip blank lines 3 grab the whole line as a string newline _ append the newline string to any remaining dataline fragment when we start a new line CHAPTER 13 DRUG DICTIONARY RWD Nickalls 172 dataline dataline newline chomp dataline removes the line ending reset variables to zero uid1 0 uid2 0 uid f1 0 m1 0 e1 0 THHHE value split dataline print dataline replace CR LF space with visible chars newbuffer Sdatalines s r lt CR gt dataline s n lt LF gt dataline s lt SPACE gt print dataline n LINEA if dataline m lt VTM gt if SeventFLAG eq ON print FLAG is still ON n else eventFLAG ON print FLAG ON n Y if dataline m endcode eventFLAG OFF print FLAG OFF Wn now analyse the event string to find UID and TEXT print NEW endcode found starting to extract the name SNOMED code pair Wn THE increment event counter eventnumber eventnumber 1 len length dataline print len dataline len Wn print dataline dataline Nn
56. projdir pdata and is used to facilitate data processing and printing 141 CHAPTER 9 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 142 Note that we have to wait until Camomile terminates since the starttime and project directoryname are determined immediately before starting Cammomile see A The time written to the lt starttime dat gt file then indicates the zero time reference for all subsequent data processing and graphs open outfilei destinationfilename1 die ERROR can t create file lt starttime dat gt n print outfilei A file name startfile dat created timenowgmt n print outfilel file generated by lt launchcam pl gt RWD Nickalls n print outfilel 4 file read by lt plotgnnk2 pl gt in print outfilel projectdir projdir n use commas no spaces print outfilel starttime timenowunix timenowgmt n no spaces close outfilei1 D We now copy all the print tools utility files to the project pdata directory in preparation for data processing and printing system cp v printfiles projpdatadir E We now process all the output files from camomile by calling the utility program plotgnnk pl chdir projpdatadir system perl plotgnnk2 pl F we now print out all the dvi files in reverse order by calling the utility printall pl these constitute the printed Anaesthesia Record if e printall
57. skip comments next LINE if 4 skip comments next LINE if skip blank lines grab the whole line as a string dataline _ place the params into an array value split dataline print value 0 value 1 value 2 n assign the elapsedtime and param values unixtime value 0 gmtime value 1 GMT yyyy mm dd hh mm ss elapsedtime value 2 elapsed time secs paramvalue value 3 chomp paramvalue remove the line ending to help maths multiply the rr values by 50 to make them fit range 0 1000 if file eq co2 rr paramvalue paramvalue 50 save data only every interval secs elapsedtime unixtime starttimeunix determine true elapsedtime if elapsedtime lt oldelapsedtime interval next LINE else oldelapsedtime elapsedtime CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 231 TES now print data into 1 hr files make NewElapsed time relative to begining of new hour hour 1 first real hour hour will be zero on first run thro algorithm so goes to else if elapsedtime hour 3600 space calculate new elapsed time from begining of new hour newet elapsedtime 3600 hour 1 print outfile newet space paramvalue space unixtime n elsel close existing gnn file and open a new one gnn 1 close outfile hour hour 1 use two digits for the filename extension eg g04 if hour lt 10 hour 0 h
58. 00000 0 85839 95 00000 0 83222 m90m95 end of file lt isomdata8 dat gt loop 1 thickline inputfile isokdata8 dat 0 8 start of file lt isokdata8 dat gt loop 1 269696 Iteration number 1 k mac40 iso 8 point k5 5 1 162588 manual k5 5 00000 1 16259 point k10 10 1 127135 point k15 15 1 092763 point k20 20 1 059439 point k25 25 1 027131 point k30 30 0 9958085 point k35 35 0 9654412 point k40 40 0 936 point k45 45 0 9074566 point k50 50 0 8797836 point k55 55 0 8529544 point k60 60 0 8269435 point k65 65 0 8017257 point k70 70 0 7772771 point k75 75 0 7535739 point k80 80 0 7305936 point k85 85 0 708314 point k90 90 0 6867139 point k95 95 0 6657725 k10 10 00000 1 12713 k15 15 00000 1 09276 k20 20 00000 1 05944 k25 25 00000 1 02713 k30 30 00000 0 99581 k35 35 00000 0 96544 k40 40 00000 0 93600 k45 45 00000 0 90746 k50 50 00000 0 87978 k55 55 00000 0 85295 k60 60 00000 0 82694 k65 65 00000 0 80173 k70 70 00000 0 77728 k75 75 00000 0 75357 k80 80 00000 0 73059 k85 85 00000 0 70831 k90 90 00000 0 68671 k95 95 00000 0 66577 drawline k5 k10 k15 k20 k25 k30 k35 k40 k45 k50 k55 k60 k65 k70 k75 k80 k85 k90 k95 plot 5 00000 1 16259 10 00000 1 12713 k5k10 plot 10 00000 1 12713 15 00000 1
59. 081 000 072 126 A8300 14 40 24 23 09 2004 d m y Datex AS 3 monitor A8301 126 062 001 004 005 000 000 004 223 082 065 000 000 000 000 000 000 000 15 4 binlog The Camomile data program stores the comma separated lt UnixTime gt lt parameter value pairs see example below for each parameter in a separate file a single file for the whole operation for example the file for the systolic blood pressure is named bp s binlog These files are stored in the fields subdirectory as follows allfiles camomiletop theatredata 2001 Nov 26 1434 fields bp s binlog 1095947414 145 43 1095947419 144 38 1095947424 143 66 1095947429 142 75 1095947434 149 07 1095947439 140 99 1095947444 140 4 1095947449 147 14 1095947454 146 62 1095947459 138 84 1095947464 138 61 Later each file is broken down into separate 1 hour files called gnn files eg bp s g01 bp s g02 etc preparatory to printing 15 5 Drug data The Camomile data program keeps a log of the operation start time end time keyboard entries entries from the pull down menus drugs anaesthetists surgeons and details of Alarms ON and OFF and bad checksums as shown in the example below This entry CHAPTER 15 DATA STORAGE FILES AND FORMATS RWD Nickalls 221 is written in a TEX format and is further processed to obtain the printed out form of the drug log which is placed in the patients notes 4 amp camomile Camomile v 0 1 040413b c Apr 15 2004012 10 32
60. 1 6 ETdesflurane age 37 67 1 6 ETdesflurane age 40 67 1 6 age 40 print n ETisoflurane age 34 0 0 6 ETisoflurane age 37 0 0 6 ETisoflurane age 40 0 0 6 ETisoflurane age 34 50 1 6 ETisoflurane age 37 50 1 6 ETisoflurane age 40 50 1 6 ETisoflurane age 34 67 1 6 ETisoflurane age 37 67 1 6 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 127 ETisoflurane age 40 67 1 6 print Wn ETsevoflurane age 34 0 0 6 ETsevoflurane age 37 0 0 6 ETsevoflurane age 40 0 0 6 ETsevoflurane age 34 50 1 6 ETsevoflurane age 37 50 1 6 ETsevoflurane age 40 50 1 6 ETsevoflurane age 34 67 1 6 ETsevoflurane age 37 67 1 6 ETsevoflurane age 40 67 1 6 print Wn ETdesflurane age 34 0 0 6 ETdesflurane age 37 0 0 6 ETdesflurane age 40 0 0 6 ETdesflurane age 34 50 1 6 ETdesflurane age 37 50 1 6 ETdesflurane age 40 50 1 6 ETdesflurane age 34 67 1 6 ETdesflurane age 37 67 1 6 ETdesflurane age 40 67 1 6 age 80 print n ETisoflurane age 34 0 0 6 ETisoflurane age 37 0 0 6 ETisoflurane age 40 0 0 6 ETisoflurane age 34 50 1 6 ETisoflurane age 37 50 1 6 ETisoflurane age 40 50 1 6 ETisoflurane age 34 67 1 6 ETisoflurane age 37 67 1 6 ETisoflurane age 40 67
61. 11 19 2004 unix 1076587879 anes 04 dvi This is written to a file header dat as follows and then read back when needed for printing fields2PDATA pl print writing the lt gnnheader dat gt file to contain header for Anes record n open outfile5 gt gnnheader dat die ERROR can t create file lt gnnheader dat gt n timenow localtime print outfile5 gnnheader dat created timenow n print outfile5 4 file generated by lt plotgnnk2 pl gt RWD Nickalls n fname anes gnn dvi print outfile5 header starttimeunix originalgmt fname n close outfile5 print ges eis lt gnnheader dat gt done n 19 6 Typeset the graphic pages using IATEX 2e We now typeset the graph pages and create the output formats dvi ps and pdf on the fly The TEX file for the graphs is prtanes6 tex The style option is prtdrug2 sty We create the PostScript files using dvips We create the pdf files using pdflatex print printlog running LATEX on prtanes6 tex n system pslatex prtanes6 tex dvifilename anes gnn dvi CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 280 copy the dvi file to have a gnn dvi filename system cp v prtanes6 dvi dvifilename make the ps files psfilename anes gnn ps system dvips dvifilename o psfilename print printlog LATEX done n now make the pdf files system pd
62. 125 80 128 126 01 001 127 80 128 128 01 001 129 80 128 130 01 001 131 80 128 132 03 003 133 00 000 134 00 000 135 00 000 136 0B 011 137 00 000 138 D2 210 139 0D 013 140 03 003 141 00 000 142 00 000 143 00 000 144 0C 012 145 00 000 146 04 004 147 80 128 148 00 000 149 00 000 150 00 000 151 00 000 152 0D 013 153 00 000 154 01 001 155 80 128 156 00 000 157 00 000 158 00 000 159 00 000 160 0E 014 161 00 000 162 01 001 163 80 128 164 03 003 165 00 000 166 00 000 167 00 000 168 00 000 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 45 169 00 000 170 DE 222 171 26 038 172 44 068 173 00 000 174 6C 108 175 00 000 176 01 001 177 80 128 178 03 003 179 00 000 180 00 000 181 00 000 182 09 009 183 00 000 184 8A 138 185 01 001 186 00 000 187 00 000 188 0C 012 189 00 000 190 66 102 191 1D 029 192 03 003 193 00 000 194 00 000 195 00 000 196 00 000 197 00 000 198 71 113 199 0E 014 200 A5 165 201 0F 015 202 03 003 203 00 000 204 00 000 205 00 000 206 00 000 207 00 000 208 07 007 209 17 023 210 F1 241 211 16 022 212 03 003 213 00 000 214 00 000 215 00 000 216 04 004 217 00 000 218 00 000 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 46 219 00 000 220 00 000 221 00 000 222 3A 058 223 00 000 224 03 003 225 00 000 226 00 000 227 00 000 228 00 000 229 00 000 230 0C 012 231 00 000 232 0A 010 233 0F 015 234 08 008 235 02 002 236 C0 192 23
63. 135 m m40 10 0 00269 34 40 1 0 05 37 35 C35 35 00000 7 39789 hh point C36 136 m m40 10 0 00269 34 40 1 0 05 37 36 C36 36 00000 7 80888 hh point C37 37 m m40 10 0 00269 34 400 1 0 05 37 37 C37 37 00000 8 21987 hh point C38 138 m m40 10 0 00269 34 40 1 0 05 37 38 C38 38 00000 8 63087 hh point C39 39 m m40 10 0 00269 34 40 1 0 05 37 39 C39 39 00000 9 04186 hh point C40 139 775 m m40 10 0 00269 34 40 1 0 05 37 39 75 CLO 39 75000 9 35011 color blue hh adrawline C34 C37 plot 34 25000 7 08964 37 00000 8 21987 C34C37 color red hh drawline C37 C40 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 112 plot 37 00000 8 color black hh Grawpoint C35 put bullet put bullet put bullet put bullet put bullet hh text turndor 15 hh var m 1 0 ZA4MAC 44 m 1 0 21987 39 75000 9 35011 Z4 C37C40 C36 C37 C38 C39 at at at at at 35 00000 7 39789 Z4 C35 36 00000 7 80888 C36 37 00000 8 21987 C37 38 00000 8 63087 C38 39 00000 9 04186 Z4 C39 6540933594647 Vboldmath 1 2 C37 polar r9 15 6540933594647 t9 deg put turnbox 15 6540933594647 boldmath 1 2 at 37 112838 8 384999 hh point D34 34 25 m m40 10 0 00269 34 40 1 0 05 37
64. 18 2 Running the processdata pl script 18 3 Write the GNUplot scripts for each graph ls 184 Run GNUplot on all the gnu files llle 18 5 Write the header line for the printouts 18 6 Typeset the graphic pages using ATRX2g llle 18 7 Typeset the drug file using MIBX2 llle 18 8 Printing the paper sheets 000 viii 196 196 205 208 213 215 217 219 219 219 219 220 220 222 223 223 224 225 225 227 227 232 235 235 236 236 237 238 238 242 244 245 CONTENTS RWD Nickalls ix 19 Printing the stand alone SA 06 module 19 1 Introduction 19 2 Running the processdata pl script 19 3 Write the GNUplot scripts for each graph 19 4 Run GNUplot on all the gnu files 19 5 Write the header line for the printouts 19 6 Typeset the graphic pages using IATEX 2g 19 7 Typeset the drug file using IATEX 2e 19 8 Printing the paper sheets 20 processdata pl 21 fieldsZ2PDATA pl Part I Background Chapter 1 An anaesthesia workstation ch intro 1 1 Introduction Since 1994 I have run an on going research project to develop an open source anaesthe sia workstation for free use by the NHS in the operating theatre What started as a small project to automate the production of the anaesthetic record has since developed into a clinically useful support tool for anaesthetists During the period 1996 2001 I developed a wo
65. 19 2003 wRelaxants ui 2558 Apr 11 2004 wRunClock cpp 937 Apr 11 2004 wRunClock h 5374 Jun 11 2003 wRunClock ui 4267 Apr 11 2004 wToolsA cpp 781 Apr 11 2004 wToolsA h 10811 Feb 17 2003 wToolsA ui 5689 Apr 11 2004 wTools cpp 926 Apr 11 2004 wTools h 16180 Apr 9 2003 wTools ui Chapter 12 Configuration files ch config tex 12 1 Introduction All the configuration files are placed in the directory camomiletop conf2 At present the hospital program uses only the customised RN configuration files e g c as3rn conf The order that the configuration files are input is as follows c_as3rn conf x configrn conf projectdir conf x widgets conf w monitor datexas3 conf x displays conf The list of configuration files is as follows camomile sty c_as3 conf c_as3rn conf c_g3400_ro conf c g3400 rwO conf projectdir conf u drugs conf u drugsrn conf u people conf u peoplern conf u pumpable conf w display relaxant conf w monitor datexas3 conf w pumpcontroller bozo conf w pumpcontroller nickalls conf w pump graseby3400 conf x config conf x configrn conf x displays conf 156 CHAPTER 12 CONFIGURATION FILES RWD Nickalls 157 x displaysrn conf x set alarms conf x set alarmsrn conf x widgets conf xx lst 12 2 c as3rn conf A amp LaTeX camomile 4 40n0ff beginCamomileConfig endCamomileConfig V EndCamomileComments documentclass a4paper article usepackage geometry geometry hscale 0
66. 2 Modules 10 2 1 Graphical front end module The graphical front end launcher tklaunch2 pl is a Perl Tk program which is itself launched by typing the command runcamomile in a BASH terminal window Once launched the Tk widget shows a number of buttons each of which will launch an application for example the Camomile anaesthesia program an epidural database program a collection of help files and an on line user manual 148 CHAPTER 10 SYSTEM OVERVIEW RWD Nickalls 149 10 2 2 Data collection and display module This is the heart of the Camomile system It accesses data from the keyboard mouse and the Datex AS 3 anaesthesia monitor Raw data is accessed every 5 seconds from the Datex monitor via the serial port and saved to the hard drive The data is displayed in trend format one screen width shows 30 mins of data and processed in the form of alarms log entries and age corrected MAC At the end of the anaesthetic the program is terminated by clicking on the exit option from a pull down menu whereupon the graphical front end is returned 10 2 3 Printing module At the end of the anaesthetic all the relevant data the Anaesthetic Record is printed out in a form suitable for inclusion in the patient notes The printing process is initiated by clicking on the relevant button on the graphical front end 10 2 4 Epidural database This is accessed from the fornt end by clicking on the relevant button
67. 20 00000 2 11888 plot 25 00000 2 05426 plot 30 00000 1 99162 plot 35 00000 1 93088 plot 40 00000 1 87200 plot 45 00000 1 81491 plot 55 00000 1 70591 plot 60 00000 1 65389 plot 65 00000 1 60345 plot 70 00000 1 55455 plot 75 00000 1 50715 plot 80 00000 1 46119 plot 85 00000 1 41663 plot 90 00000 1 37343 plot 5 00000 2 32518 10 00000 2 25427 q5q10 15 00000 2 18553 q10q15 20 00000 2 11888 q15q20 25 00000 2 05426 q20q25 30 00000 1 99162 q25q30 35 00000 1 93088 q30q35 40 00000 1 87200 q35q40 45 00000 1 81491 q40q45 50 00000 1 75957 q45q50 plot 50 00000 1 75957 55 00000 1 70591 q50q55 60 00000 1 65389 q55q60 65 00000 1 60345 q60q65 70 00000 1 55455 q65q70 75 00000 1 50715 q70q75 80 00000 1 46119 q75q80 85 00000 1 41663 q80q85 90 00000 1 37343 q85q90 95 00000 1 33154 q90q95 drawline q5 q10 q15 q20 q25 q30 q35 q40 q45 q50 q55 q60 q65 q70 q75 q80 q85 drawpoint q10 q20 q30 q40 q50 q60 q70 q80 q90 thinline 969596 Iteration number 1 p mac40 iso 1 4 point p10 10 1 972486 point p15 15 1 912335 point p20 20 1 854018 point p25 25 1 797479 point p30 30 1 742665 point p35 35 1 689522 point p40 40 1 638 point p45 45 1 588049 point p50 50 1 539621 point p55 55 1 49267 point p60 60 1 447151 point p65 65 1 40302 point p70 70 1 360235 point p7
68. 27638005 gt lt 40 gt lt Alverine gt lt 349818006 gt lt 41 gt lt Amantadine gt lt 51361008 gt lt 42 gt lt Amifostine gt lt 108823002 gt lt 1837 gt lt Levoglutamide gt lt 10276011000001106 gt lt 1838 gt lt Normal immunoglobulin human gt lt 10284111000001108 gt lt 1839 gt lt Protein C human gt lt 391874000 gt lt 1840 gt lt Fibrinogen human Thrombin human gt lt 10284211000001102 gt lt 1841 gt lt Interferon gamma gt lt 10284311000001105 gt lt 1842 gt lt Cerium nitrate Sulfadiazine silver gt lt 10303711000001103 gt 13 8 The ordered list lt 0001 gt lt Abacavir gt lt 116084008 gt lt 0002 gt lt Abacavir Lamivudine gt lt 9726111000001103 gt lt 0003 gt lt Abciximab gt lt 108974006 gt lt 0004 gt lt Acacia gt lt 9810011000001108 gt CHAPTER 13 DRUG DICTIONARY RWD Nickalls 180 lt 0005 gt lt Acacia Starch Tragacanth gt lt 10043511000001103 gt lt 0006 gt lt Acamprosate gt lt 9809711000001100 gt lt 0007 gt lt Acarbose gt lt 109077006 gt lt 0008 gt lt Acebutolol gt lt 68088000 gt lt 0009 gt lt Acebutolol Hydrochlorothiazide gt lt 398910009 gt lt 0010 gt lt Aceclofenac gt lt 329923004 gt lt 0011 gt lt Acemetacin gt lt 329906008 gt 0012 Acenocoumarol 79356008 lt 0013 gt lt Acetarsol gt lt 9824411000001102 gt lt 0014 gt lt Acetazolamide gt lt 33664007 gt lt 0015 gt lt Acetic acid gt lt 326289007 gt lt 0016 gt lt Acetic acid Hone
69. 40 1 A37 37 00000 10 95983 hh point A38 138 mkm40 10 0 00269 34 40 1 438 38 00000 11 50782 hh point A39 139 m m40 10x 0 00269 34 40 1 A39 39 00000 12 05582 11 point A40 139 775 m m40 10 0 00269 34 40 1 0 05 37 39 75 440 39 775000 12 46681 color blue hh drawline A34 437 plot 34 25000 9 45286 37 00000 10 95983 A34A37 Ncolor red hh drawline A37 ALO plot 37 00000 10 95983 39 75000 12 46681 437440 color black hh drawpoint A35 A36 A37 A38 A439 put bullet at 35 00000 9 86385 44 435 put bullet at 36 00000 10 41184 A36 put bullet at 37 00000 10 95983 44 A37 put bullet at 38 00000 11 50782 Z4 A38 put bullet at 39 00000 12 05582 44 439 hh test Vturnboz120 4872294273676 H boldmath 1 6 A37 polar r9 20 4872294273676 t9 deg put turnbox 20 4872294273676 boldmath 1 6 at 37 098524 11 133879 hh MACage label Adef macage jj text sf large MAC _ jj A37 shift 0 12 0 8 2 V 4 hh text sf large MAC _ 34 A37 shift 0 12 0 8 1 put sf large MAC _ 34 1 at 37 120000 11 759830 0 05 37 35 0 05 37 36 0 05 37 37 0 05 37 38 0 05 37 39 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 111 hh var m i 4 4A4MAC A4 m 9 1 4 hh point B34 34 25 m m40 10 0 00269 34 40 1 0 05 37 34 25 B34 3
70. 5 value50b value50b 0 5 if j eq 0 value50b offset50y format values to 1 decimal place vv sprintf o 1f value50a if vv 0 07 vv 0 string50a string50a vv string50b string50b value50b y string50a string50a string50b string50b print outfile lt lt EOF mathsPIC macDes1 m for Desflurane to create temp and age MAC chart corrections May 01 2005 documentclass a4paper article usepackage mathspic color usepackage decimal rotating setlength textheight 30cm setlength oddsidemargin 0cm begin document beginpicture DES MAC40 6 6 agent specific adjustments need to adjust Xunits Yunits MAC zero offset for N2O 50 and 67 the Ytick interval 0 5 for des as well as the space above and below the line space def age age AGE CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 119 var m40 6 6 desflurane MAC40 def agecorr 10 0 00269 amp age 40 agecorr def etdes t m m40 amp agecorr 1 0 05 37 t etdes determine the X and Y axes lengths age dependent want to make the Y axis just longer than the line space for the ticks to work nicely we want left Yaxis to be an exact multiple of tick interval therefore we addsome extra and adjust wit
71. 72 73 2 BPim mmHg 100 Inv Press 1 mean 90 74 75 2 HRbp1 min 1 Inv Press 1 heart rate 63 76 79 4 BP2status Inv Press 2 status 80 81 2 BP2label Inv Press 2 label 82 83 2 BP2s mmHg 100 Inv Press 2 systolic 120 84 85 2 BP2d mmHg 100 Inv Press 2 diastolic 80 86 87 2 BP2m mmHg 100 Inv Press 2 mean 90 88 89 2 HRbp2 min 1 Inv Press 2 heart rate 63 90 93 4 BP3status Inv Press 3 status 94 95 2 BP3label Inv Press 3 label 96 97 2 BP3s mmHg 100 Inv Press 3 systolic 120 98 99 2 BP3d mmHg 100 Inv Press 3 diastolic 80 100 101 2 BP3m mmHg 100 Inv Press 3 mean 90 102 103 2 HRbp3 min 1 Inv Press 3 heart rate 63 104 107 4 BP4status Inv Press 4 status 108 109 2 BP4label Inv Press 4 label 110 111 2 BP4s mmHg 100 Inv Press 4 systolic 120 112 113 2 BP4d mmHg 100 Inv Press 4 diastolic 80 114 115 2 BP4m mmHg 100 Inv Press 4 mean 90 116 117 2 HRbp4 min 1 Inv Press 4 heart rate 63 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 39 Table 4 6 Parameter definitions for Datex AS 3 Position bytes Name Unit Div Description 118 121 4 NIBPstatus NIBP status 122 123 2 NIBPlabel NIBP label 124 125 2 NIBPs mmHg 100 NIBP systolic 120 126 127 2 NIBPd mmHg 100 NIBP diastolic 80 128 129 2 NIBPm mmHg 100
72. 80 1 09589 point n85 85 1 062471 point n90 90 1 030071 point n95 95 0 9986587 n10 10 00000 1 69070 n15 15 00000 1 63914 n20 20 00000 1 58916 n25 25 00000 1 54070 n30 30 00000 1 49371 n35 35 00000 1 44816 n40 40 00000 1 40400 n45 45 00000 1 36119 n50 50 00000 1 31967 n55 55 00000 1 27943 n60 60 00000 1 24042 n65 65 00000 1 20259 n70 70 00000 1 16592 n75 75 00000 1 13036 n80 80 00000 1 09589 n85 85 00000 1 06247 n90 90 00000 1 03007 n95 95 00000 0 99866 drawline n5 n10 n15 n20 n25 n30 n35 n40 n45 n50 n55 n60 n65 n70 n75 n80 n85 n90 n95 plot 5 00000 1 74388 10 00000 1 69070 n5n10 plot 10 00000 1 69070 15 00000 1 63914 n10n15 plot 15 00000 1 63914 20 00000 1 58916 n15n20 plot 20 00000 1 58916 25 00000 1 54070 n20n25 plot 25 00000 1 54070 30 00000 1 49371 n25n30 plot 30 00000 1 49371 35 00000 1 44816 n30n35 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 84 plot 35 00000 1 44816 40 00000 1 40400 n35n40 plot 40 00000 1 40400 45 00000 1 36119 n40n45 plot 45 00000 1 36119 50 00000 1 31967 n45n50 plot 50 00000 1 31967 55 00000 1 27943 n50n55 plot 55 00000 1 27943 60 00000 1 24042 n55n60 plot 60 00000 1 24042 65 00000 1 20259 n60n65 plot 65 00000 1 20259 70 00000 1 16592 n65n70 plot 70 00000 1 16592 75 00000 1 13036 n70n75
73. Aheof 12 6 People conf hh people add anaesthetist Dick Nickalls add anaesthetist Ken Alagesan add anaesthetist Pam Wade add anaesthetist Ndu Okonkwo add anaesthetist Janet Latter add surgeon Ellis Morgan add surgeon David Beggs add surgeon John Duffy A eof 12 7 Drugs conf 4 drugs conf add drugname Asprin add drugname Ephedrine add drugname Frusemide add drugname Morphine add drugname Propofol add drugname Remifentanil add drugname Vecuronium CHAPTER 12 CONFIGURATION FILES eof 12 8 x widgets conf hh 4 x widgets conf Ahhhhhhhhhhhhhhhhhh comment Nnewpage SSS Widgets This file should be largely static for a site Draws the window widgets Ahhhhhhhhhhhhhhhhhhh newdict 4xh set logfiles projects apple2 camomile 4x set app name Camomile Data Display set display period 10001 update every 10s 4 set display period 10000 update every 10s 4 set display period 3000 update every 10s 4 set display period 200 update every 10s 4 set display period 2000 update every 10s set display period 1000 update every 1s 4 set display period 100 update every 100ms set pixel size x 3 1234 7 set pixel size y 2 418 set pixel offset x 0 set pixel offset y 517 set widget x 0 set widget y 0 set font size 10 set widget w 1015 set widget h 700 set clas
74. B37 B40 color black drawpoint B35 B36 B37 B38 B39 text turnbox 18 1039569311426 boldmath 1 4 B37 polar r9 18 1039569311426 t9 deg var m 1 2 MAC point C34 34 25 amp etdes 34 25 point C35 35 amp etdes 35 point C36 36 amp etdes 36 point C37 37 etdes 37 point C38 38 amp etdes 38 point C39 39 amp etdes 39 point C40 39 75 amp etdes 39 75 color blue drawline C34 C37 color red drawline C37 C40 color black drawpoint C35 C36 C37 C38 C39 text turnbox 15 6540933594647 boldmath 1 2 C37 polar r9 15 6540933594647 t9 deg var m 1 0 MAC point D34 34 25 amp etdes 34 25 point D35 35 amp etdes 35 point D36 36 amp etdes 36 point D37 37 amp etdes 37 point D38 38 amp etdes 38 point D39 39 amp etdes 39 point D40 39 75 amp etdes 39 75 color blue drawline D34 D37 color red drawline D37 D40 color black drawpoint D35 D36 D37 D38 D39 text turnbox 13 1441191824082 boldmath 1 0 D37 polar r9 13 1441191824082 t9 deg get slope of line var s direction D35 D40 radians var r14 atan 5 2 x tan s def r2d 180 pi var d14 r14 amp r2d var m 0 8 MAC point E34 34 25 etdes 34 25 point E35 35 amp etdes 35 point E36 36 amp etdes 36 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 106 point E37 37 amp etdes 37 point E38 38 amp et
75. DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 42 019 00 000 020 01 001 021 00 000 022 4A 074 023 FF 255 024 61 097 025 DC 220 026 2C 044 027 00 000 028 00 000 029 00 000 030 2C 044 031 00 000 032 00 000 033 00 000 034 BD 189 035 BD 189 036 20 032 037 00 000 038 BD 189 039 BD 189 040 20 032 041 00 000 042 46 166 043 34 052 044 F1 241 045 34 058 046 13 019 047 30 048 048 00 000 049 00 000 050 00 000 051 22 034 052 43 067 053 00 000 054 15 021 055 00 000 056 01 001 057 80 128 058 01 001 059 80 128 060 01 001 061 80 128 062 03 003 063 00 000 064 00 000 065 00 000 066 01 001 067 00 000 068 3E 062 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 43 069 3A 058 070 E7 231 071 1C 028 072 31 049 073 29 041 074 43 067 075 00 000 076 03 003 077 00 000 078 00 000 079 00 000 080 02 002 081 00 000 082 FT 247 083 08 008 084 F4 244 085 05 005 086 2C 044 087 07 007 088 43 067 089 00 000 090 00 000 091 00 000 092 00 000 093 00 000 094 0B 011 095 00 000 096 02 002 097 80 128 098 02 002 099 80 128 100 02 002 101 80 128 102 01 001 103 80 128 104 00 000 105 00 000 106 00 000 107 00 000 108 03 003 109 00 000 110 02 002 111 80 128 112 02 002 113 80 128 114 02 002 115 80 128 116 01 001 117 80 128 118 03 003 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 44 119 00 000 120 00 000 121 00 000 122 03 003 123 01 001 124 01 001
76. ENF THEN mac40 1 63 IF v SEV THEN mac40 1 8 IF v DES THEN mac40 6 6 REM mac40 for N2O 104 REM REM do N2O calculation first REM restrict n20 to zero or above IF n20 lt 0 THEN n20 0 REM eqn mac mac40 10 0 00269 deltaage macn2o 104 10 BB deltaage IF macn20 lt 0 THEN Fmacn2o 01 REM changed from 0 to 01 check ELSE Fmacn2o n20 macn2o END IF REM REM do VAPOUR calc next REM eqn mac mac40 10 0 00269 deltaage macvapour mac40 10 BB deltaage IF macvapour lt 0 THEN totalFmac Fmacn2o0 ELSE Fmacvapour vap macvapour totalFmac Fmacvapour Fmacn20 END IF REM REM do not print to screen if printing last 20 mins fast data IF pl20mf on THEN GOTO MAClastline REM A Fmacn20 B Fmacvapour c totalFmac REM COLOR green screenbackcolour REM cannot print digits with PRINT USING and REM strings in same PRINT statement so therefore REM we have to print them separately red if vap mac 0 LOCATE 18 68 PRINT SPACE 11 LOCATE 18 68 PRINT MAC IF B 20 THEN COLOR red screenbackcolour PRINT USING B COLOR green screenbackcolour ELSE PRINT USING B END IF PRINT CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 59 PRINT USING 1 HE A REM print in red if bigmac less than 86 IFc lt 0 86 THEN COLOR red screenbackcolour ELSE COLOR green screenbackcolour END IF LOCATE 19 68
77. It is a database incorporating epidural and double lumen tube collected since 1995 and allows the anaesthetist to estimate for a given height and weight of a patient a the midline epidural depth and b length of the double lumen tube 10 2 5 Help files This is a collection of HTML help files of information useful to the anaesthetist Much of the information is is the form of City Hospital guidelines but guidelines from other sources are included 10 3 Directory structure The directory structure for Camomile is as follows home camomile home camomile docs home camomiletop home camomiletop aneshelp home camomiletop conf2 home camomiletop datexsim home camomiletop datexsim printfiles home camomiletop tarballs home camomiletop tarballs camomile 0 1 040411 home camomiletop tarballs camomile 0 1 040411 admin home camomiletop tarballs camomile 0 1 040411 camomile home camomiletop tarballs camomile 0 1_040411 camomile docs home camomiletop tarballs camomile 0 1_040411 camomile docs en home camomiletop tarballs camomilefield2tex 0 1_040411 camomile home camomiletop tarballs camomilefield2tex 0 1_040411 camomile docs CHAPTER 10 SYSTEM OVERVIEW RWD Nickalls 150 home docs en home home home home usr loca usr loca camomiletop tarballs camomilefield2tex 0 1 040411 camomile camomiletop tarballs inc
78. MAC o PNE FEES EED TE SAAI EES A ASA AS ASA ASA SS Ay 09 30 09 45 10 00 10 15 Figure 3 1 Example of the graphics section of a typical Anaesthesia Record The six graphs are output by GNUPLOT in LIATEX picture format The record shows blood pressure BP heart rate HR central venous pressure CVP oxygen saturation of haemoglobin Sat inspired oxygen O inspired nitrous oxide N20 expired carbon dioxide CO tidal volume respiration rate isoflurane and MAC Chapter 4 The Datex AS 3 anaesthesia monitor ch dxmon02 tex 4 1 Introduction The Datex Ohmeda AS 3 and CS 3 monitors are versatile modular anaesthesia moni toring systems which have an asynchronous serial interface for data acquisition The various modules access a comprehenensive range of physiological parameters Note that the technical latest manual regarding the serial interface is AS 3 and CS 3 Monitor Product specification computer information v 3 4 March 1999 G version update by Rene Coffeng 23 Nov 1998 The electrical safety Type classifications of the various Applied Parts e g NIBP cuff temperature probe are shown in Table 4 1 Table 4 1 Applied Parts and their Types Applied Part Type ECG CF NIBP BF Invasive BP CVP PA CF Temperature probe CF Cardiac output Datex Ohmeda Division Instrumentarium Corp P O Box 900 FIN 00031 Datex Engstrom Finland Tel 4358 9 39411 FAX 4358 9 146 331
79. MAC value and implements an alerting colour change to red to warn the anaesthetists of an out of range value and hence greatly facilitates the avoidance of inadvertent awareness of the patient under anaesthesia N2O exp 40 01 Vap exp 2 62 N20 MAC 0 39 Vap MAC 148 Figure 1 1 Total MAC bud Example of the real time age corrected MAC widget dis vapour age 43 played by the anaesthesia workstation software Nick alls RWD and Dales S 1996 2009 interfaced to the Datex S 5 monitor If the corrected MAC is too low or too high as shown in this case total MAC 1 87 then in addition to sounding an audible alarm the dial of the MAC widget turns red 0 2 Total MAC The development of this displayed real time MAC data follows from our earlier work on developing charts facilitating the determination of age corrected MAC for anaesthetists Nickalls and Mapleson 2003 These charts are also included in a widely used anaesthesia handbook Nickalls 2006 1 4 4 Decision support module This is an HTML information system offering decision support information on relevant drugs medical conditions etc for anaesthetists in the operating theatre The emphasis is on an intuitive well structured menuing system to enable items to be found easily and quickly We hope to include suitable commercially available HTML texts as they come available 1 4 5 A diabetes alert module This is a program in Perl which makes use of the
80. Nickalls 80 Command line usr local bin mpic100 pl mac iso8t m x Input filename mac iso8t m 6 Output filename mac iso8t mt x Date amp time 2006 01 13 09 19 33 o mac iso8T m TEST version modified from mac iso8 m Jan 10 2006 mathsPICperl version final graph chart for the bja wih decimals cdot and fbox new curves for anaesthesia mathsPIC to test rotation legend on axes N for percent enter the Y2 Y1 values in ET units adjust oddsidemargin adjust linethickness adjust minipage gt 3 6cm adjust possn of MAC remove isoflurane word from ylegend push Isoflutane title up push age down documentclass a4paper 12pt article usepackage mathspic usepackage decimal rotating begin document Noddsidemargin 17mm framebox beginpicture use sf font for figures for BJA fontfamily cmss selectfont normalsize linethickness 1 1pt normalsize was 0 9 for BJA my manual p 23 structure copied from mac des m ISOflurane Delta for N2O 0 75 66 6666 104 1 17 y units 12cm 2 2 5 454545 paper units mm 5 454545cm xrange 5 100 yrange 0 4 2 6 axes L ticks 10 0 2 paper units 0 7mm 3 818181cm xrange 8 100 yrange 0 4 2 6 setcoordinatesystem units lt 0 7mm 3 818181cm gt setplotarea x from 8 00000 to 100 00000 y f
81. PRINT SPACE 10 LOCATE 19 68 PRINT bigMAC PRINT USING c REM REM now return to normal screen colours COLOR screenforecolour screenbackcolour MAClastline bmac c END SUB 6 2 Age corrected MAC charts Sometime during the next couple of years I started wondering how I could create a paper nomogram type chart for determining age corrected MAC for use when I did lists at the QMC since I was unable then to use my computer program based in the thoracic theatre at the City Hospital The main problem was figuring out how best to incorporate the optional and flexible use of nitrous oxide since the charts would not be particularly useful clinically unless they easily allowed for the effect of nitrous oxide The design of such a chart was not at all straightforward and it was quite a long time before I formulated a suitable design which allowed nitrous oxide use see Figure 6 3 Eventually a single chart for each inhalational agent was generated using Perl and mathsPIC Nickalls 1999 2000 Syropoulos and Nickalls 2000 and this was then tested clinically over a period of time End expired in ISOFLURANE 67 509 N20 1 8 1 6 1 4 End expired 96 in 10096 oxygen 1 2 1 0 0 8 0 6 0 4 0 2 0 0 10 20 30 40 50 60 70 80 90 100 Age years Figure 6 2 One of the first age corrected iso MAC charts drawn using mathsPIC CHAPTER 6 AGE CORRECTED MAC RWD Nickall
82. QBASIC 1 1 cannot be used to program the Datex AS3 serial interface PowerBASIC 3 5 FirstB ASIC PB1 0 and VisualBASIC can all handle 11 bit character frames Note that the recent 3 15 version of KERMIT 1998 also accomodates the 11 bit character frame see the SET PARITY HARDWARE command and so can be used to access data from the Datex AS 3 monitor Table 4 4 Serial protocol for the Datex AS 3 amp CS 3 monitors Bit rate 19200 Start bits 1 Data bits 8 Parity Even Stop bits 1 4 3 Transmission Request string Unlike the earlier Ultima or Capnomac monitors the AS 3 series of monitors on startup do not by default output any data via the serial port on startup In order to get the monitor to output data digital or waveform data one has to first send a Transmission Request message in which one specifies among other things the required data frequency say every 10 seconds The complete output data string is 321 bytes and is very comprehensive It is well documented in Datex Ohmeda S 5 Computer Interface Record Specification Document No 8005313 1 October 2003 The monitor is able to output data in a number of modes either a only the current displayed measurement values b values averaged over the last 10 seconds c values averaged over the last 60 seconds See the Datex manual for full details Datex Ohmeda S 5 Computer Interface Specification Document No M1017617 01 March 2004 4 3 1 Form
83. S Dales amp A Nice 1994 2004 sc an Naejsthesia record systen newline sc email textit dicknickalls compuserve com end document CHAPTER 17 TYPESETTING PROGRAMS RWD Nickalls 242 17 3 prtdrug2 sty Ahhhhhhhhhhhhhhhhhhhhh prtdrug2 sty rwd nickalls April 15 2004 LaTeX version modifiction of Simon s Camomile record sty Ahrne nn Ntypeout TERRE KERE KERKE REK REK RE RE dk EER RE kkk kkk kk y typeout This is prtdrug2 sty 04 Feb 2004 gt typeout Copyright c Camomile Group 2003 4 4 typeout Written by RWD Nickalls amp Simon Dales Ntypeout TERRE KERE KERKE RR EER EK KERK ER RE RE dek Rek newcommand VersionStamp 3 do nothing hh 1 2 3 Camomile 0 1 _040120 Feb 3 2004015 53 15 A NnewcommandiNersionStamp 3 Nnoindent Nbfseries Computer Program 1 Version 4 url 2 3 newcommand EntryAlarm 5 noindent 2 myspace bfseries Alarm 4 5 n newcommand EntryAlarm 5 do nothing LLELH2H3H4H5 E time alarmon off alarm value newcommand EntryDrug 4 noindent bfseries Drug 1 2 3 n def EntryDrug l 2 3 4 time drug qty comment newcommand EntryDrug 4 noindent 1 myspace bfseries Drug 2 3 n newcommand EntryTimer 4 4 count30 3 44 seconds see Knuth p 118 divide count30 by 60 gives the minutes noindent 1 myspace bfseries Timer interval set to the count30 mins 4 d
84. TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 107 7 4 TX file macdes034 mt The following TEX file generated by the above mathsPIC script is processed by pdfIATEX to generate the final pdf version for printing A o 2 A mathspic Perl version 1 10 Feb 18 2007 4 A filter program for use with PiCTeX 4 Copyright c 2005 A Syropoulos amp RWD Nickalls A4 Command line usr local bin mpic110 pl macdes034 m A Input filename macdes034 m 4 Output filename macdes034 mt Date amp time 2008 10 07 17 42 11 Ax o 2 hh mathsPIC A4 macDesi m AA for Desflurane 4 to create temp and age MAC chart corrections A4 April 13 2005 documentclass a4paper article usepackage mathspic color usepackage decimal rotating setlength textheight 30cm setlength oddsidemargin 0cm begin document beginpicture hh DES MAC40 6 6 hh agent specific adjustments hh need to adjust Xunits Yunits MAC zero offset for N20 50 and 67 hh the Ytick interval 0 5 for des hh as well as the space above and below the line space def ageO 344 AGE hh var m40 6 6Zdesflurane MAC40 hh m40 6 6 def agecorr O 10 0 00269 amp age 40 agecorr def etdes t m m40 amp agecorr 1 0 05 37 t 4 etdes hh determine the X and Y axes lengths age dependent hh want to make the Y axis just longer than the line space
85. The REPEAT property specifies the number of additional repetitions that the alarm will triggered This repitition count is in addition to the initial triggering of the alarm Both of these properties MUST be present in order to specify a repeating alarm If one of these two properties is absent then the alarm will not repeat beyond the initial trigger The ACTION property is used within the VALARM calendar component to specify the type of action invoked when the alarm is triggered The VALARM properties provide enough information for a specific action to be invoked It is typically the responsibility of a Calendar User Agent CUA to deliver the alarm in the specified fashion An ACTION property value of AUDIO specifies an alarm that causes a sound to be played to alert the user DISPLAY specifies an alarm that causes a text message to be displayed to the user EMAIL Specifies an alarm that causes an electronic email message to be delivered to one or more email addresses and PROCEDURE specifies an alarm that causes a procedure to be executed The ACTION property MUST specify one and only one of these values In an AUDIO alarm if the optional ATTACH property is included it MUST specify an audio sound resource The intention is that the sound will be played as the alarm effect If an ATTACH property is Specified that does not refer to a sound resource or if the Specified sound resource cannot be rendered because its format is
86. Tk Exists topwindow now launch the program system perl launchcam12 pl reinstate the widget when the program terminates system perl tklaunch2 pl geometry 300x400 50 300 else print ERROR W print can t find program launchcam12 pl WW exit 8 3 1 Program tklaunch2 pl The widget program uses the perl Tk module and the associated Tk DialogBox Note that the nice Perl5 Tk logo is the image anim gif which can be found at the following direcctory usr lib per15 vendor_per1 5 8 1 i386 linux thread multi Tk CHAPTER 8 THE PERL TK FRONT END RWD Nickalls 138 usr bin perl w allfiles camomiletop datexsim thlaunch2 pl RWD Nickalls April 5 2004 to get FullScreen mode at startup p 307 use Tk use Tk DialogBox topwindow MainWindow gt new dialog1 topwindow gt DialogBox title gt STATUS buttons gt OK dialog1 gt add Label text gt The PRINT option is not enabled just now However in due course the PRINT button will coordinate printing out of all the sheets from the last operation wraplength gt 400 gt pack THE topwindow gt title Launch CAMOMILE topwindow gt Label text gt Click on the RUN button to start the CAMOMILE anaesthesia program wraplength gt 130 padx gt 250 height gt 10 gt pack
87. _2 mbox 0 voffset 1 75cm oddsidemargin 11mm textwidth 20cm textheight 25cm was 25 5 begin document note that all the empty lines are essential for the layout as vspace requires a preceeding emptyline 238 CHAPTER 17 TYPESETTING PROGRAMS RWD Nickalls 239 thispagestyle empty vspace 1 8cm newcommand patientlabel framebox rule 10mm Ocm 3 3cm hspace 2 2cm Patient label hspace 2 2cm noindent hspace 10 1cm patientlabel vspace 3 5cm noindent hspace 2 3cm color blue LARGE AN AE STHESIA RECORD vspace 3mm noindent hspace 5 2cm textsf Nottingham City Hospital 44 2 3cm noindent hspace 5 0cm hspace 2 27cm color blue textsf NHS Trust aes vspace 1 7cm i date t ime f ile222222222222 2 input gnnheader dat contains starttime data for header the input file contains a line with 3 parameters starttimeunix starttimegmt gnn dvi filename vspace 2mm noindent input plot bp pic hfill d okokokokokokokokeokokokeolokeokolokokookelokelolok poaa k kkk kkk vspace 4mm noindent input plot sat pic hfill d okokokokokokeokokokokokokeokookookek d okokokokokokeokokokookeolokelokolokokeokelokelolok Vvspacef Amm 4 20 noindent input plot fo2 pic hfill d okokokokokokokokokokekokokoekeolek d okokokokekokokokeokokokookeookolokokookelokelolok vspace 4mm noindent input plot co2 pic hfill YR RR k kkk KK
88. and SEQUENCE uid1 index event UID KAlarm uid2 index event SEQUENCE print uid1 uid1 An print uid2 uid2 An uid substr event uid1 45 uid2 uid1 5 print UID uid n Pa get the index positions for TEXT and ACTION text1 index event TEXT text2 index event ACTION print text1 text1 An print text2 text2 An text substr event text1 5 text2 text14 5 print TEXT text n HH cancel the event my cancel kalarm cancelEvent uid print cancelling existing DIABETES alarm n print sending command cancel Wn print logg cancelling existing DIABETES alarm Wn print logg sending command cancel n if more than one DIABETES event to cancel then need to pause slightly as it takes time for each cancel to take effect if Seventnumber 1 sleep 2 system qq cancel and croak could not run cancel OS ERROR Perl best practice p 280 now look at next event print Wn Sevent clear the event string print looking for the next event n next LINE end of if contains word DIABETES conditional else print NEW event found checking for word DIABETESNn CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 211 print NO DIABETES word in this event so looking for next event
89. at 34 000000 0 150000 newcommand ylegend sf End tidal MV Desflurane in 100 ozygen air 4 A4 determine string length gt Yunits etc AV newlength ylength 4 settowidth ylength ylegend Z 4 test answer number ylength 37 1 hh halflength 1 5 2 2223 y units hh text turnbor 90 ylegend 33 3 y1 y2 y1 2 2 2223 4 put turnbox 90 ylegend at 33 300000 5 527700 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 110 4 labels at top hh text sf N 2 0 0140 25 y2 0 7 put sf N _2 0 at 40 250000 13 700000 hh text sf N _2 0 40 98 y2 0 7 put sf N _2 0 at 40 980000 13 700000 hh text sf 67V 2140 25 y2 0 7 0 35 put sf 67N NZ7 at 40 250000 13 350000 hh text sf 50 40 98 y2 0 7 0 35 put sf 50N NZ7 at 40 980000 13 350000 p newcommand rightylegend sf End tidal Desflurane in N 2 074 hh text turndorl 270 rightylegend 41 4 y1 y2 y1 2 1 66 put turnbox 270 rightylegend at 41 400000 9 410000 AK MAC 1 6 normalcolor hh var m 1 6 ZA4MAC A4 m 1 6 hh point A34 134 25 m m40 10 0 00269 34 40 1 0 05 37 25 225 A34 34 25000 9 45286 hh point A35 135 m m40 10x 0 00269 34 40 1 A35 35 00000 9 86385 hh point A36 136 m m40 10x 0 00269 34 40 1 A36 36 00000 10 41184 hh point A37 137 m m40 10 0 00269 34
90. bytes 8 11 encodes for the time in seconds since 1970 00 yrs Reversing the the byte order i e having bit O on the right hand side gives the double word lt 33F2CFCBh gt which is 871550923 seconds 10087 days 27 July 1997 e Each funtional grouping what Datex calles a sub record has a group of status bytes usually 4 bytes and a group of label bytes usually two bytes These status and label bytes are mostly bit encoded to indicate such things as the source of the particular measurement or the existance of an error state etc some of the encodings for the more important parameters are included in this list but it is not comprehensive just now see the Datex Record Specification manual for full details START OF HEADER 2 3 SE lt 01 gt Total no of bytes in transmission lt 01h gt lt 3eh gt 318d 318 bytes header data Total bytes 321 1 start 318 ichecksum 1 stop 4 lt 94 gt 5 lt 03 gt Interface version supported by device 0 3 see version code Table 6 00 7 00 8 11 CB CF F2 33 Time in secs since 1970 00 yrs 33 f2 cf cb 871550923 secs 10087 days 27yrs 7 months 22 days 27 July 1997 12 15 lt 00 gt 00 00 00 16 17 lt 00 gt 00 18 20 lt 00 gt 00 01 The 1 here is sr type for output data 1 4 p 10 21 23 BD BD ff the ff indicating no more subrecords 24 26 BD BD BD why are these f
91. care and safety For example Kennedy ef al 1976 showed that anaesthetists commonly spend 10 15 of their time producing the handwritten record Similarly Smith 1997 pointed out that about 10 of the anaesthetists time was related to record keeping and that if this were to increase then this would likely be to the patient s detriment A similar study by Wong et al 2003 showed that an ICU information system reduced the time spent by nurses on documentation by 31 with the significant benefit being that almost half of the time saved was transferred to patient assessment and direct patient care Secondary data processing by anaesthetists in the UK is well behind other countries in this regard with electronic data collection being actively supported by foreign health organisations For example in 2001 a special newsletter issue of the Anesthesia Patient Safety Foundation APSF was devoted to Information systems in anaesthesia APSF 2001 In 2002 the APSF formally endorsed the use of automated anesthesia information management systems AIMS as the following quote indicates see also www gasnet org societies apsf In this context it is heartening that the APSF has recently endorsed the use of automated anesthesia information management systems AIMS The Anesthesia Patient Safety Foundation endorses and advocates the use of automated record keeping in the perioperative period and the subsequent retrieval and analysis of that data to
92. drawline E34 E37 color red drawline E37 E40 color black drawpoint E35 E36 E37 E38 E39 text turnbox s08deg boldmath 0 8 E37 polar r9 s08deg t9 deg var m 0 6 MAC point F34 34 25 amp etdes 34 25 point F35 35 amp etdes 35 point F36 36 amp etdes 36 point F37 37 amp etdes 37 point F38 38 amp etdes 38 point F39 39 amp etdes 39 point F40 39 75 amp etdes 39 75 color blue drawline F34 F37 color red drawline F37 F40 color black drawpoint F35 F36 F37 F38 F39 text turnbox s06deg boldmath 0 6 F37 polar r9 s06deg t9 deg now draw all the horizontal dashed lines setdashes linethickness 0 4pt var w1 34 1 left end of dashed lines var w2 39 85 right end of dashed lines point L16 w1 ycoord A37 point R16 w2 ycoord A37 point L14 w1 ycoord B37 point R14 w2 ycoord B37 point L12 w1 ycoord C37 point R12 w2 ycoord C37 point L10 w1 ycoord D37 point R10 w2 ycoord D37 point L08 w1 ycoord E37 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 123 point R08 w2 ycoord E37 point L06 w1 ycoord F37 point R06 w2 ycoord F37 drawline L16 R16 L14 R14 L12 R12 L10 R10 L08 R08 L06 R06 linethickness 1pt setsolid normalcolor endpicture end document EOF close outfile system mathsp
93. fields2PDATA pl copy fromdir filei PDATA if eq print logfile filei file copied OK n else print logfile file1 COPY ERROR n After copying all the files currently six files we then have everything in place for processing the data so we now move to the pdata directory in preparation for the next phase data processing and call the Perl coordinating program fields2PDATA pl as follows processdata p1 PDATAdir PDATA chdir PDATAdir b Data processing launch program fields2PDATA pl The data processing is coordinated by the Perl script fie1ds2PDATA pl so the next thing is a first check we are in the correct directory PDATA and if so then to launch CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 250 the program using the system command writing appropriate comments to the logfile as we go processdata p1 check we are in the correct directory print logfile the current dir is n thisdir cwd grab the current working dir print logfile thisdir n now call fields2PDATA pl perlprog fields2PDATA pl print logfile CALLing program lt perlprog gt if e perlprog print Nn CALLing program perlprog n print logfile OK doneM system perl perlprog else print ERROR can t find file lt perlprog gt n print logfile ERR
94. gt Medium chain triglycerides Soyaoil lt NM gt lt VTM gt lt VIM gt lt VTMID gt 9835911000001106 lt VIMID gt lt NM gt Dornase alfa NM VTM lt VIM gt lt VTMID gt 9836011000001103 lt VIMID gt lt NM gt Drotrecogin alfa NM VTM lt VIM gt lt VIMID gt 9837611000001107 lt VIMID gt lt NM gt Homeopathic cocculus indicus NM VTM lt VIRTUAL_THERAPEUTIC_MOIETIES gt 13 5 Perl program dn dmd5 pl usr bin perl dn dmd5 pl modified from dn dmd4 pl to accommodate the lt INVALID gt tag RWDN May 14 2006 to read the xml VTM files to extract the drug names and codes T lt VIRTUAL_THERAPEUTIC_MOIETIES gt file f vtmz2 xml week50 2005 vtm_v2_2 xsd T TO DO search the otm XSD file for all the key TAGS and then extract these from the VTM xml file search for the other possible key words search for the INVALID INVALID done search for the lt ABBREVNM gt lt ABBREVNM gt T set up commandline flags in etc so user can specify input and output filenames etc T use strict use warnings use Carp allows croak and warn warn always gt to STDERR use Fatal qw open close f for errors use Perl6 Builtins qu system use Getopt Long for commandline stuff use version HE create a printer log file open my logg gt dn dmdlog log die ERROR can t open dn dmdlog log file n
95. if e satfilename CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 293 print satfile satfilename using 1 2 with linespoints 4 8 n else print printlog no sat gnn files n if e fo2filename print satfile fo2filename using 1 2 with linespoints 4 10 n else print printlog no fo2 gnn files n print satfile dummyline Mn close satfile print printlog SAT gnu done n now create the F02 file FI02 N20 open fo2file gt plot fo2 gnu die ERROR can t open plot fo2 gnu file n print fo2file usr bin gnuplot n print fo2file plot fo2 gnu script made by plotgOla pl n print fo2file set terminal latex n print fo2file set output plot fo2 pic n print fo2file set size 1 388 smallheight n was 1 4 print fo2file set xtics timeline n print fo2file set noytics n print fo2file set y2tics 10 30 50 70 n print satfile set ytics 10 30 50 70 n ylabel qq Sat circ FIO _2 bullet print fo2file set y2label hello hello n print fo2file set nokey n print fo2file set grid n print fo2file xmin 0 xmax 3600 n print fo2file ymin 10 ymax 70 n print fo2file plot xmin xmax ymin ymax n print fo2file 30 with lines 1 n print fo2file 50 with lines 1 n fo2filename o2 insp
96. improve patient safety Gage 2002 Anaesthetists urgently need to harness the power of computing technology in a way which can help them both in the operating theatre and in the clinic most likely via some form of anaesthesia workstation While such systems will probably be commercial this is not necessarily the only route Providing anaesthetists take some interest in the details it not impossible to imagine useful systems being developed along the Open Source model cf the immensely successful Linux operating system The emphasis for such a workstation needs to be on helping the anaesthetist give a safe anaesthetic during difficult circumstances It would access data from various sources via the Medical Interface Bus e g anaesthesia monitors HIS and then process the data in various ways for example data storage making the anaesthesia record smart alarms decision support data export emergency communications It is important that such workstations are developed separately from the commercial anaesthesia monitors and anaesthesia machines rather than being integrated with them Even at a basic level computers in the operating theatre already offer significant advantages over and above creating good anaesthesia records For a long time now it has been relatively straight forward to access data from anaesthesia monitors Nickalls and Ramasubranian 1995 Nickalls 1998 and display warnings information and value CHAPTER 2 DATA PROCE
97. is typically exchanged using traditional email but the standard is designed to be independent of the transport protocol For example it can also be shared and edited by using a WebDav server Simple web servers using just the HTTP protocol are often used to distribute iCalendar data about an event and to publish busy times of an individual Event sites on the web are embedding iCalendar data in web pages using hCalendar a 1 1 representation of iCalendar in semantic XHTML 14 1 2 VALARM specification from the RFC 2445 manual v 2 Nov 1998 Internet Calendaring and Scheduling Core Object Specification iCalendar Copyright C The Internet Society 1998 A11 Rights Reserved 4 6 6 Alarm Component Component Name VALARM Purpose Provide a grouping of component properties that define an alarm Formal Definition A VALARM calendar component is defined by the following notation alarmc BEGIN VALARM CRLF audioprop dispprop emailprop procprop END VALARM CRLF audioprop 2 action and trigger are both REQUIRED but MUST NOT occur more than once action trigger CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 187 duration and repeat are both optional and MUST NOT occur more than once each but if one occurs so MUST the other duration repeat the following is optional but MUST NOT occur more than once attach the following is option
98. iso age 22 temp 34 macFrac 0 6 n20 0 0 6671 ET iso age 22 temp 37 macFrac 0 6 n20 0 0 7848 ET iso age 22 temp 40 macFrac 0 6 n20 0 0 9025 ET iso age 22 temp 34 macFrac 1 6 n20 50 1 2189 ET iso age 22 temp 37 macFrac 1 6 n20 50 1 5328 ET iso age 22 temp 40 macFrac 1 6 n20 50 1 8467 ET iso age 22 temp 34 macFrac 1 6 n20 67 1 0289 ET iso age 22 temp 37 macFrac 1 6 n20 67 1 3428 ET iso age 22 temp 40 macFrac 1 6 n20 67 1 6567 ET sevo age 22 temp 34 macFrac 0 6 n20 0 1 0263 ET sevo age 22 temp 37 macFrac 0 6 n20 0 1 2074 ET sevo age 22 temp 40 macFrac 0 6 n20 0 1 3885 ET sevo age 22 temp 34 macFrac 1 6 n20 50 1 8767 ET sevo age 22 temp 37 macFrac 1 6 n20 50 2 3597 ET sevo age 22 temp 40 macFrac 1 6 n20 50 2 8426 ET sevo age 22 temp 34 macFrac 1 6 n20 67 1 5767 ET sevo age 22 temp 37 macFrac 1 6 n20 67 2 0597 ET sevo age 22 temp 40 macFrac 1 6 n20 67 2 5426 n20 0 3 7630 n20 0 4 4271 n20 0 5 0911 n20 50 6 8847 n20 50 8 6555 n20 50 10 4263 n20 67 5 8147 n20 67 7 5855 n20 67 9 3563 ET des age 22 temp 34 macFrac 0 ET des age 22 temp 37 macFrac 0 ET des age 22 temp 40 macFrac 0 ET des age 22 temp 34 macFrac 1 ET des age 22 temp 37 macFrac 1 ET des age 22 temp 40 macFrac 1 ET des age 22 temp 34 macFrac 1 ET des age 22 temp 37 macFrac 1 ET des age 22 temp 40 macFrac 1 v9
99. m variable x 1 variable x2 x advance 2 point h x2 2 475 text MAC h vertical diff 0 29 units 0 28 variable d 0 29 variable h6 0 88 0 9 text fbox 0 cdot 6 x h6 variable h8 h6 advance d text fbox 0 cdot 8 x h8 variable h10 h8 advance d text fbox 1 cdot 0 x h10 variable h12 h10 advance d text fbox 1 cdot 2 x h12 variable h14 h12 advance d text fbox 1 cdot 4 x h14 variable h16 h14 advance d text fbox 1 cdot 6 x h16 newcommand myleft framebox begin minipage 29mm Vcentering V End expired in 100 oxygen end minipage text myleft 45 2 0 newcommand myrightb 96 fbox V begin minipage 4cm CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 65 V End expired in V 67 hspace 8mm 50 V N 2 Ohspace 7 5mm N 2 O V end minipage 96 V end of newcommand text myrightb 102 2 657 I was 2 6 newcommand mybottom Age years text mybottom 46 0 15 otext copyright RWD Nickalls 2001 22 0 5 text large ISOFLURANE 46 2 7 80 draw horizontal dashed lines linethickness 0 4pt equivalent to tiny linethickness 0 6pt half way between tiny and normalsize setdashes variable x5 5 Left X value variable x6 100 Right X value variable y16 2 3523 variable y14 2
100. m y Datex AS 3 monitor A8301 126 062 001 003 005 000 000 255 222 082 065 000 000 000 000 000 000 000 A8302 000 001 000 189 255 097 220 044 000 000 000 189 189 000 000 189 189 032 A8303 000 189 189 032 000 255 222 082 065 051 058 000 000 000 034 002 128 001 A8304 128 001 128 001 128 001 128 003 000 000 000 001 000 051 029 031 029 035 219 CHAPTER 15 DATA STORAGE FILES AND FORMATS RWD Nickalls 220 A8305 029 000 000 001 000 000 000 002 000 002 128 002 128 002 128 001 128 000 A8306 000 000 000 011 000 002 128 002 128 002 128 001 128 000 000 000 000 003 A8307 000 002 128 002 128 002 128 001 128 003 000 000 000 003 001 001 128 001 A8308 128 001 128 001 128 003 000 000 000 011 000 004 128 003 000 000 000 012 A8309 000 004 128 000 000 000 000 013 000 001 128 000 000 000 000 014 000 001 A8310 128 003 000 000 000 000 000 001 128 002 128 002 128 001 128 007 000 000 A8311 000 009 000 000 000 000 000 000 000 111 029 003 000 000 000 000 000 188 A8312 037 188 037 003 000 000 000 000 000 014 000 014 000 003 000 000 000 006 A8313 000 000 000 000 000 000 000 003 000 000 000 000 000 000 000 246 255 246 A8314 255 001 128 001 128 001 128 001 128 001 128 000 000 000 000 007 000 001 A8315 128 001 128 001 128 001 128 032 000 000 000 000 000 001 128 001 128 255 A8316 141 001 128 001 128 001 128 000 000 000 000 189 189 001 128 000 000 000 A8317 000 013 000 002 128 002 128 002 128 001 128 000 000 000 000 014 000 002 A8318 128 002 128 002 128 001 128 000 000 000 064
101. m460 h h 1 if h gt 23 h h 24 m substr 00 m 2 h substr 00 h 2 ts tst 60 t4 qq h m ts m m 1 if m gt 59 m m460 h h 1 if h gt 23 h h 24 m substr 00 m 2 h substr 00 h 2 ts tst 60 t5 qq h m ts m m 1 if m gt 59 m m460 h h 1 if h gt 23 h h 24 m substr 00 m 2 h substr 00 h 2 ts tst 60 t6 qq h m ts m m 1 if m gt 59 m m 60 h h 1 if h gt 23 h h7Z 24 m substr 00 m 2 h substr 00 h 2 ts tst 60 t7 qq h m ts m m 1 if m gt 59 m m460 h h 1 if h gt 23 h h 24 m substr 00 m 2 h substr 00 h 2 ts tst 60 t8 qq h n ts timeline t1 t2 t3 t4 t5 t6 t7 t8 print printlog set xtics timeline n Armed with the time base we can start making write to the gnu files In the following we illustrate the code for writing the sat gnu script file which will be processed by the GNUplot program eventually First we check that the hour value incorporated into the gnn string always has two digits i e 4 04 and hence we obtain g04 and defining the graph height to be used we then open the output file and proceed fields2PDATA p1 CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 278 first make sure the gnn string has three c
102. mls 6 mlshr since 30 mins ago 2004 04 29 Drug Gelofusin 1500 IN 2004 04 29 Drug Hartmans solution 1000 set UP 2004 04 29 Comment Temp 37 2C 2004 04 29 Comment wash out 2004 04 29 Comment end of surgery 2004 04 29 Drug Atracurium 30 2004 04 29 Comment moving on to bed 2004 04 2004 04 29 Comment changing ett to single lumen Drug Propofol 20 Figure 1 7 Anaesthetic record drug record CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 11 ETE E IIO GEORGIO ok NOTTINGHAM EPIDURAL AND DOUBLE LUMEN TUBE DATABASE OROS RE HOE oook enter GENDER M F q to qui lick on the RUN enter HEIGHT cms q to qui button to start the enter WEIGHT kg q to qui CAMOMILE enter RANGE default 7 anaesthesia program Female Ht 155 cm Wt 56 6 kg pm 7 5 pm 7 5 RESULTS midline data male female combined 6 n 1 PRINT LAST CASE 5 n 1 midline 4 75 range midline 4 59 range T9 10 midline 4 17 range T10 11 mean midline 4 01 range BS 4 T11 12 mean midline 5 nel RESULTS Double li mean length 83 range 25 30 n 15 mean length 185 range 23 5 28 8 n 13 mean length 15 range 24 5 28 n 15 c The CAMOMILE project team 2004 mean length 5 net mean length 78 range 24 28 n 7 database numbers total no of entries in database n midline epidural entries in database male female combined tube Female entri
103. my helparray title gt n HOWTO use Ww header gt text gt This is a description of my application for the help text gt Click on the headings title gt Overview header gt nThis widget is an aid for use when anaesthetising a diabetic patient n nIt uses the well established Linux KDE Kalarm Open Source alarm utility www astrojar org uk linux nkalarm htm1 n nOnce a diabetes alert is set a red alert window reminding you to take a blood sugar will open after the set elapsed time n nTest the diabetes alert by first clicking on the green TEST d button which will generate a demo red alert simulating the red DIABETES alert To trigger the TRUE diabetes alert system just click on one of the blue DIABETES buttons n nlIf you are too busy to do a blood sugar when the red alert window appears just close the window and the alert will continue to recur at 5 min intervals until you set a new alert text gt Y title gt Setting an alert header gt nSimply click on one of the blue DIABETES buttons This will automatically set a new alert and delete any previous alert n nThe new alert will appear after the specified time and then recur every 5 mins until a new blue DIABETES alert is set or until the existing alert is cancelled text gt title gt Cancelling an alert header gt
104. my text Hn my dataline Hn my event LINE while lt calfile gt next LINE if skip comments next LINE if skip comments next LINE if skip blank lines grab the whole line as a string dataline _ chomp dataline removes the line ending reset variables to zero uid1 0 uid2 0 uid text1 0 text2 0 text THHHE value split dataline print dataline replace CR LF space with visible chars newbuffer Sdataline s r lt CR gt Sdataline s n lt LF gt dataline s lt SPACE gt print dataline n if dataline m BEGIN VEVENT eventFLAG ON print FLAG ONNn Sevent Sevent event dataline next LINE if eventFLAG eq ON event event dataline CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 210 THE print events event Nn if dataline m END VEVENT eventFLAG OFF print FLAG OFF Wn now analyse the event string to find UID and TEXT print NEW event found checking for word DIABETES n if event m DIABETES i increment event counter eventnumber eventnumber 1 xx DIABETES_event DIABETES _event event get UID print DIABETES event found Wn print event event n process the event string to get UID and TEXT get the index positions for UID
105. nClick on the clock icon on the icon bar at the bottom of the sceeen typically on the RHS This will display all the current alarms alerts n nNow select the alarm to be cancelled by right clicking on it and then click on the delete button and close the window text gt Y title gt Testing header gt nClick on the green TEST butons n nTEST c nThis is generates a demo COFFEE break reminder yellow n nTEST d nThis generates a RED coffee break alert beep to simulate the red DIABETES alert text gt CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 205 title gt Author header gt nRWD Nickalls nXenon project team nDepartment of Anaesthesia nCity Hospital nNottingham nUK n nemail dicknickalls compuserve com text gt Y title gt Version date header gt nVersion 1 1 April 24 2006 nFixed red diabetes demo alertn Wn Version 1 0 n December 18 2005 text gt Y title gt DIABETES HELP header gt text gt This is only a mini help n for a detailed help page click on the HELP on diabetes button at the bottom of the parent widget 1 title gt Sliding scale header gt w ITU Sliding Scale n n Run 5 Dextrose at 60 mls hr n Run insulin actrapid 1Unit ml at 0 5 Units hr n nGl
106. next section cam2gnnh p1 get each parameter in turn for j 0 j lt paramname j j 1 ffile paramname j ofile projdir pdata paramname j data system camomilefield2tex p projdir f ffile now create all the gnn files for the parameter makegnnfiles paramname j o ofile nibp d s gnuplot CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 229 The above camomilefield2tex command outputs all the stored parameter data for a given parameter into a file consisting of the following four comma separated fields on each line into the specified output file unix time gmt time elapsed time parameter value A typical example of the sat data file is as follows Note that the elapsed time parameter on the first line is zero and that both the unix time and the elapsed times increase in steps of 5 seconds data is output from the Datex monitor every 5 seconds sat data 1071580231 2003 12 16 13 10 31 0 92 000000 1071580236 2003 12 16 13 10 36 5 92 000000 1071580241 2003 12 16 13 10 41 10 93 000000 1071580246 2003 12 16 13 10 46 15 93 500000 1071580251 2003 12 16 13 10 51 20 93 000000 1071580256 2003 12 16 13 10 56 25 93 000000 1071580261 2003 12 16 13 11 1 30 92 500000 1071580266 2003 12 16 13 11 6 35 92 000000 Armed with the above data file for a given parameter then we proceed to generate from this a series of 1 hour
107. ng 2 44 ae fo E a ee lr 6 5 3s Le m 8 904 5 0 6 0 3 854 42 45 5 amp NEM een ANODE ON RE 4 E gt 80 4 50 ge 3 H 8 5 5 9 7 T54 45 g a 4 0 F 4 0 40 S 704 5 2 Mc ae ID eT eee MEE ee ae he MS AE 5 3 r2 5 3 5 Li a 6 54 ES i F20 30 z 604 2 8 Ls ro Im 5 5 9 1 5 2 5 5 5qg c L 1 0 5 04 2 0 r 0 5 15 d oi r 0 Fe eee NG 1 0 3 55 di mathsPIC 0 07 macdes034 ps RWD Nickalls 2005 25 34 35 36 37 38 39 40 Temperature C Age amp temperature corrected iso MAC chart Eger El 2001 Anesthesia and Analgesia 93 947 953 Nickalls RWD and Mapleson WW 2003 Br J Anaesthesia 91 170 174 Figure 7 2 View of a typical age amp temperature corrected MAC chart for desflu rane generated by the Perl program macatdes2 pl Part II The front end coordinating program Chapter 8 The Perl Tk front end December 13 2014 aHOUSE book xenon ch tklauncher 8 1 Introduction The camomile program is currently launched by a Perl Tk program which allows the user to launch the main camomile program as well as the other associated components of the system e g access the epidural and double lumen tube database print out the anaesthesia record etc Clicking on the run camomile button launches the co ordinating program launchcam12 p1 which launches the Camomile program itself bash runcamomile sh generates the widget tklaunch2 pl
108. of file loop close fieldsfile print printlog finished reading all the binlog files n starttimeunix has been determned above starttimegmt localtime starttimeunix originalgmt starttimegmt needed for printing header on anaes sheet below print printlog starttimeunix starttimeunix n print printlog starttimegmt starttimegmt n print printlog Nn now put the starttimeGMT into an array EER EE Sr ER mm note the main items are space separated except hh mm ss format is Sun Jan 25 13 24 35 2004 format is Sun Jan 5 13 24 35 2004 note get two spaces after the Month if days 10 see SUB tedname in launchcam12 pl CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 289 LI mmm CM ERR RM CL CE M i M RM DR Ee if two spaces in posn 8 and 9 then remove one if substr starttimegmt 7 2 eq substr starttimegmt 7 2 print tr string startgmtstring Wn replace spaces with commas starttimegmt tr make an array stgmt split starttimegmt day stgmt 0 nonth stgmt 1 date stgmt 2 st stgmt 3 year stgmt 4 noitems stgmt 1 print printlog extracted starttimeUNIX starttimeunix n print printlog extracted starttimeGMT starttimegmt n print printlog extracted no of gmt items ngmtitems corr in print printlog extracted gmt part is day
109. parameter inside it All this is coordinated by the Perl program plotgnnk 2 pl and so we will look in more detail how this is done Each parameter to be plotted has its own gnn parameter file not absolutely necessary but very convenient in practice see previous section To facilitate this we Not to be confused with the gnn data files s tex CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 233 arrange that each 1 hour gnn file has its elapsed time starting from zero which greatly simplifies the plotting process The most difficult part of generating the gnu files one file per graph is to construct the time base such that all g01 parameter files are plotted on graphs showing the start and end times of the first hour and also of the 15 minute vertical lines which are also drawn The timebase parameter timeline The time markings along the x axis are drawn using the GNUplot set xtics com mand which in this case takes a complicated parameter which is the string timeline In practice for each hour the particular time base used will be the same for all graphs drawn using parameters values from files having the same gnn value say g02 files for example The following code determines this string for each hour tailoring it to accomodate the time interval associated with each gnn value so as we move from one hour to the next then the time associated with each hour increases accordingly
110. perl dn tkalarm pl geometry 320x380 50 300 j sub diabetes50 topwindow bell result dialog1 Show if result eg OK Y topwindow gt destroy if Tk Exists topwindow system perl dn alarm diabetes3 pl t 50 and carp diabetes error message system perl dn tkalarm pl geometry 320x380 50 300 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 202 sub diabetes60 topwindow gt bell result dialog1 Show if result eg OK topwindow gt destroy if Tk Exists topwindow system perl dn alarm diabetes3 pl t 60 and carp diabetes error message system perl dn tkalarm pl geometry 320x380 50 300 end of sub sub testcoffee5 THE test use only 1 min test u 1 i 1 as this will totally clear after 1 min system perl dn alarm coffee3 pl u 1 system perl dn tkalarm pl geometry 320x380 50 300 sub testdiabetes THE if use parameters u 1 only then instant and no repeat THE test use only 1 min test u 1 i 1 as this will totally clear after 1 min system perl dn alarm coffeeRED pl u 1 system perl dn alarm demoRED pl system kwrite anes files induction txt geometry 350x380 600 3007 system perl dn tkalarm pl geometry 320x38
111. plot 75 00000 1 13036 80 00000 1 09589 n75n80 plot 80 00000 1 09589 85 00000 1 06247 n80n85 plot 85 00000 1 06247 90 00000 1 03007 n85n90 plot 90 00000 1 03007 95 00000 0 99866 n90n95 drawpoint n10 n20 n30 n40 n50 n60 n70 n80 n90 put bullet at 10 00000 1 69070 n10 put bullet at 20 00000 1 58916 n20 put bullet at 30 00000 1 49371 n30 put bullet at 40 00000 1 40400 n40 put bullet at 50 00000 1 31967 n50 put bullet at 60 00000 1 24042 n60 put bullet at 70 00000 1 16592 n70 put bullet at 80 00000 1 09589 n80 put bullet at 90 00000 1 03007 n90 end of file lt isondata8 dat gt loop 1 thinline inputfile isomdata8 dat 1 start of file lt isomdata8 dat gt loop 1 Iteration number 1 m mac40 iso 1 point m5 5 1 453235 m5 5 00000 1 45324 point m10 10 1 408918 m10 10 00000 1 40892 point m15 15 1 365953 m15 15 00000 1 36595 point m20 20 1 324298 m20 20 00000 1 32430 point m25 25 1 283914 m25 25 00000 1 28391 point m30 30 1 244761 m30 30 00000 1 24476 point m35 35 1 206802 m35 35 00000 1 20680 point m40 40 1 17 m40 40 00000 1 17000 point m45 45 1 134321 m45 45 00000 1 13432 point m50 50 1 099729 m50 50 00000 1 09973 point m55 55 1 066193 m55 55 00000 1 06619 point m60 6
112. print EThal ethalN n print test program Perl5 Linux for MAC age amp temp correction charts Wn print c RWD Nickalls October 2008 n print filename MACsolver pl n print Uses MAC and temp correction data from Nickalls amp Mapleson 2003 and Eger 2001 n print agecorr 10 0 00269 thisage 40 Wn print ETdesflurane macfrac m40desxagecorr myage 1 0 05 37 temp nitrousoffset n my age 0 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 126 age 22 print n ETisoflurane age 34 0 0 6 ETisoflurane age 37 0 0 6 ETisoflurane age 40 0 0 6 ETisoflurane age 34 50 1 6 ETisoflurane age 37 50 1 6 ETisoflurane age 40 50 1 6 ETisoflurane age 34 67 1 6 ETisoflurane age 37 67 1 6 ETisoflurane age 40 67 1 6 print Wn ETsevoflurane age 34 0 0 6 ETsevoflurane age 37 0 0 6 ETsevoflurane age 40 0 0 6 ETsevoflurane age 34 50 1 6 ETsevoflurane age 37 50 1 6 ETsevoflurane age 40 50 1 6 ETsevoflurane age 34 67 1 6 ETsevoflurane age 37 67 1 6 ETsevoflurane age 40 67 1 6 print Wn ETdesflurane age 34 0 0 6 ETdesflurane age 37 0 0 6 ETdesflurane age 40 0 0 6 ETdesflurane age 34 50 1 6 ETdesflurane age 37 50 1 6 ETdesflurane age 40 50 1 6 ETdesflurane age 34 67
113. refers to as follows Record start time Thu Feb 12 12 11 19 2004 unix 1076587879 anes 04 dvi This is written to a file header dat as follows and then read back when needed for printing fields2PDATA pl print writing the lt gnnheader dat gt file to contain header for Anes record n open outfile5 gt gnnheader dat die ERROR can t create file lt gnnheader dat gt n timenow localtime print outfile5 gnnheader dat created timenow n print outfile5 4 file generated by lt plotgnnk2 pl gt RWD Nickalls n fname anes gnn dvi print outfile5 header starttimeunix originalgmt fname n close outfile5 print ge eis lt gnnheader dat gt done n 18 6 Typeset the graphic pages using IATEX 2e We now typeset the graph pages and create the output formats dvi ps and pdf on the fly The TEX file for the graphs is prtanes6 tex The style option is prtdrug2 sty We create the PostScript files using dvips We create the pdf files using pdflatex print printlog running LATEX on prtanes6 tex n system pslatex prtanes6 tex dvifilename anes gnn dvi CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 262 copy the dvi file to have a gnn dvi filename system cp v prtanes6 dvi dvifilename make the ps files psfilename anes gnn ps system dvips dvifilename o psfilename print printlog LATEX
114. shift 0 5614 since this axis is off the graph then need new paper command but do not use axis option paper units 0 7mm 3 818181cm xrange 8 121 yrange 0 5614 2 3614 axis right seconds right axis for 50 oxygen shift 0 5614 ticks withvalues 0 O cdot 2 O cdot 4 0 cdot 6 0 cdot 8 V 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 1 cdot 8 at 0 5614 0 7614 0 9614 1 1614 1 3614 1 5614 1 7614 1 9614 2 1614 2 3614 beginSKIP newcommand thickline setplotsymbol Large newcommand thinline setplotsymbol tiny BJA graphs make thin line a bit thicker for the OUP graphs newcommand thinline setplotsymbol large thickline inputfile isoqdata8 dat 1 6 thinline inputfile isopdata8 dat 1 4 thickline inputfile isondata8 dat 1 2 thinline inputfile isomdata8 dat 1 thickline CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 77 inputfile isokdata8 dat 0 8 thinline inputfile isojdata8 dat 0 6 endSKIP from mac des m var x 1 var x2 x 2 point h x2 2 55 2 475 text MAC h vertical diff 0 29 units 0 28 var d 0 29 var h6 0 88 text fbox 0 cdot 6 x h6 var h8 h6 d text fbox 0 cdot 8 x h8 var h10 h8 d text fbox 1 cdot 0 x h10 var h12 h10 d text fbox 1 cdot 2 x h12 var h14 h12 d text fbox 1 cdot 4 x h14 var hl6 h14 d text fbox 1 cdo
115. string100b string100b Ht desflurane for scale 67 get offset from file mac des7 m offset67 4 217 y67 y2 offset67 k int y67 0 5 make string A string67a ticks withvalues string67b at value67b offset67 for j 0 j lt k j value67a j 0 5 value67b value67b 0 5 if j eq 0 value67b offset67Y format values to 1 decimal place vv sprintf o 1f value67a if vv 0 0 vv 0 string67a string67a vv string67b string67b value67b y string67a string67a string67b string67b for scale 50 get offset from file mac des7 m offset50 3 147 y50 y2 Soffset50 k int y50 0 5 make strings A and B string50a ticks withvalues string50b at value50b offset50 for j 0 j lt k j value50a j 0 5 value50b value50b 0 5 if j eq 0 value50b offset50 format values to 1 decimal place vv sprintf 1f value50a if vv OOS 0 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 97 string50a string50a vv st
116. the alarm scheduling daemon Audio file to play Stop the alarm scheduling daemon Trigger alarm at time yyyy lmm dd hh mm or date yyyy mm dd Display system tray icon Repeat until time yyyy lmm dd hh mm or date yyyy mm dd Obsolete use triggerEvent instead triggerEvent lt eventID gt Trigger alarm with the specified event ID Arguments message Message text to display 14 2 3 Initiating a diabetes alarm An example of the command line case sensitive code for initiating a red alarm to prompt the user to repeat a blood sugar measurement for a diabetic patient with a pop up window beep repeating at 30 mins intervals is as follows b beep c colour u until hh mm i interval mmmm In Mandrake Linux the details of the alarm are written to the file home dick kde share apps kalarm calendar ics The default empty file ie with no alarms pending is as follows BEGIN VCALENDAR PRODID K Desktop Environment NONSGML KAlarm 1 2 10 EN VERSION 2 0 END VCALENDAR 20 21 22 23 24 25 26 27 28 29 30 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 195 An example of the command line case sensitive code for initiating a red alarm to prompt the user to repeat a blood sugar measurement for a diabetic patient with a pop up window beep repeating at 30 mins intervals is as follows b beep c colour t trigger time yyyy mm dd hh mm u until hh mm i interval mmmm kalar
117. the end of the dir so Camomile makes the fields dir as a subdirectory projdir projdir print time encoded directory made OK projdir n THE print unixtime timenowunix gmt timenowgmt n print projdir name tedname projdir Wn THHHHHHEZ for testing THHHHHHE use this for testing with the dir cam1404fields HEHEHEH for 1240 test THHHHHHBistarttimeunix 1075984828 Thu Feb 5 12 40 28 2004 projdir home dick allfiles camomiletop theatredata cam1240 timenowunix 1075984828 timenowgmt Thu Feb 5 12 40 28 2004 camomile starts here print 4n Miles start of camomile program n THE run camomile here from camomiletop datexsim keep everything on single line campath tarballs camomile 0 1_040411 camomile camomile CHAPTER 9 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 144 system campath A 1 P projdir c conf2 c_as3rn conf Camomile has terminated so we tidy up process all the data make new directory etc and return control to launch widget print 4n Mn ass end of camomile program n flush the buffers after Camomile just to be sure system sync return to lt launchcam gt print returning to lt launchcam pl gt n n now create and write the lt starttime dat gt file since the base dir project dir for output is created
118. the voltage status of the Datex AS3 CTS line Data output is enabled only if its CTS is held HIGH positive BUT in my experience data output was only stopped by setting the datex RTS line LOW However if it is necessary to use hardware handshaking to control data output then it is probably best to connect the Datex monitor s CTS line to the computer s RTS line which can then be used to control data output by setting the status of the computer s RTS line HIGH or LOW as necessary see Section 5 16 in Nickalls amp Ramasubramanian 1995 e RTS The Datex AS3 s RTS line is held HIGH on power up Holding the Datex RTS line LOW will stop all data output until it is pulled HIGH again Consequently it is usual to connect this line to the computer s CTS line to enable the computer program to control data output from the Datex monitor Datex AS 3 9 pin Computer 9 pin pin 3 TxD c pin 2 RxD pin 2 RxD pin 3 TxD pin 5 GND pin 5 GND pin 8 CTS e a pin 7 RTS pin 7 RTS pin 8 CTS Figure 4 1 Wiring configuration for the Datex AS 3 amp CS 3 monitors 4 2 3 Protocol The serial protocol is shown in Table 4 4 Note that this protocol is slightly unusual in that it uses an 11 bit character frame 1 start bit 8 data bits EVEN parity bit 1 stop bit Consequently some older software which uses a ten bit character frame CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 29 e g QuickBASIC 4 5
119. time date info to the log file my timenow localtime print LOG the time is timenow Mn ob error msg 1 use built in error messages ob user msg 1 setup the COM port ob baudrate 19200 croak fail setting baudrate 19200 ob parity none croak fail setting parity ob databits 8 croak fail setting databits ob stopbits 1 croak fail setting stopbits ob gt handshake none croak fail setting handshake ob gt write_settings croak no settings aan a la my dump my portbuffer my Ld my Lb EO Aa a a ES DE rae A flush out the buffer before collecting data ob lookclear flush buffers goto JUMP print Nn flushing the buffer Wn print LOG n flushing the buffer n while portbuffer ob gt input ne CHAPTER 5 INTERFACING THE SERIAL PORT USING PERL RWD Nickalls 54 dump dump portbuffer Lb length portbuffer Ld length dump print LOG UART buffer length Lb software buffer length Ld 1 h JUMP print LOG n flush done WM print LOG n starting collecting data n my EOF chr 26 EOF character my Leof 1 my Lcr char length to the CR my buffer the string buffer my data my sumpb 0 use a while loop to read the input data from the serial port my crlf r n my 1f n my j 0 INPUT while 1
120. to download data from the various anaesthesia devices The information learned during this period was eventually collected together and was published as the book Interfacing the IBM PC to Medical Equipment Nickalls and Ramasubramanian 1995 The following RAH EER Interfacing dovricoded ron the uem the IBM PC internet E to medical Royal Adelaide Hospital equipment anaesthetic handbook 2004 Om B o L The art of serial K al B si Figure 1 14 Screen showing help desk home page 268 Location Edit View Go Bookmarks Tools Settings Window Help 93 58 99 HS mum uos E Location file home dick allfiles atest helpdesk helpdesk html is Drug index Calcium backto main index INDICATIONS Correction of hypocalcaemia antagonism of hyperkalaemia post op maintenance following total thyroidectomy as in laryngo pharyngo oesophagectomy cardiac resuscitation Amiodarone nde nero T Aprotinin DOSE Atropine Acute 2 25mMol SLOWLY over 10 mins approximately C Maintenance 9mMol day approximately in divided doses 40 mls IV 10 Ca gluconate 24hrs e Desflurane Typical adult IV bolus dose 10 mls Ca Gluconate 1096 SLOWLY over 10mins via CVP line if possible as is irritant to Erythromycin veins else dilute to 50 100 mls in 5 dextrose or dextrose saline via peripheral vein e Isoflurane o Potasstunn PREPARATIONS Sevofluran
121. unsupported or because it cannot be retrieved then the CUA or other entity responsible for playing the sound may choose a fallback action such as playing a built in default sound or playing no sound at all In a DISPLAY alarm the intended alarm effect is for the text value of the DESCRIPTION property to be displayed to the user In an EMAIL alarm the intended alarm effect is for an email message to be composed and delivered to all the addresses specified by the ATTENDEE properties in the VALARM calendar component The DESCRIPTION property of the VALARM calendar component MUST be used as the body text of the message and the SUMMARY property MUST be used as the subject text Any ATTACH properties in the VALARM calendar component SHOULD be sent as attachments to the message In a PROCEDURE alarm the ATTACH property in the VALARM calendar component MUST specify a procedure or program that is intended to be invoked as the alarm effect If the procedure or program is in a format that cannot be rendered then no procedure alarm will be invoked If the DESCRIPTION property is present its value Specifies the argument string to be passed to the procedure or program Calendar User Agents that receive an iCalendar object with this category of alarm can disable or allow the Calendar User to CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 191 disable or otherwise ignore this type of alarm While a very
122. valuable for anaes thetists and needs to be developed fur ther at some stage For example it could usefully incorporate comprehensive algo rithms similar to those described recently by Mraz et al 2008 e Mraz M Kopecky P Hovorka R and Haluzik M 2008 Intensive insulin therapy in the ICU the use of com puter algorithms British Journal of intensive Care 18 129 134 Kalarm is a well established and so phisticated calendar alarm system and the version described here relates to Kalarm 1 8 10 vers 2 as used with Mandriva Linux 2006 0 official Kalarm is capa ble of sending emails displaying text files triggering an audible voice message as well as displaying a coloured alert banner following a specified alarm interval or at a specified date time The Kalarm system allows input either via a form or via the command line However the form input method mouse amp keyboard is too com plicated and time consuming for reliable use in an anaesthesia setting It was there fore decided to write a Perl Tk program to generate a more convenient and intuitive widget system which would allow a dia betes alert to be set quickly and reliably simply by clicking on an appropriate wid get button 396 Aaz c The XENON project team ick on a diabetes button to set an alarm DIABETES 20 mins DIABETES 30 mins DIABETES 40 mins DIABETES 50 mins DIABETES 60 mins HELP on diabetes
123. y08 R08 100 00000 1 55230 point L06 x5 y06 L06 5 00000 1 35230 point R06 x6 y06 R06 100 00000 1 35230 point L04 x5 y04 L04 5 00000 1 15230 point R04 x6 y04 R04 100 00000 1 15230 point L02 x5 y02 L02 5 00000 0 95230 point R02 x6 y02 R02 100 00000 0 95230 point L00 x5 y00 LOO 5 00000 0 75230 point R00 x6 y00 ROO 100 00000 0 75230 draw the dashes from Left to Right so have small gap at right axis drawline L16R16 L14R14 L12R12 L10R10 L08R08 LO6RO6 LO4RO4 LO2RO2 LOOROO putrule from 5 00000 2 35230 to 100 00000 2 35230 L16R16 putrule from 5 00000 2 15230 to 100 00000 2 15230 L14R14 putrule from 5 00000 1 95230 to 100 00000 1 95230 L12R12 putrule from 5 00000 1 75230 to 100 00000 1 75230 L10R10 putrule from 5 00000 1 55230 to 100 00000 1 55230 LO8R08 putrule from 5 00000 1 35230 to 100 00000 1 35230 LO6R06 putrule from 5 00000 1 15230 to 100 00000 1 15230 LO4RO4 putrule from 5 00000 0 95230 to 100 00000 0 95230 LO2R02 putrule from 5 00000 0 75230 to 100 00000 0 75230 LOOROO Vendpicture 9oframebox end document 6 4 References e Allman KG and Wilson IH Eds 2006 Oxford Handbook of Anaesthesia 2nd ed 1160 1162 e Eger EI 1974 Anesthetic uptake and action Williams and Wilkins Company Baltimore USA p 12 e Eger EI 2001 Age minimum alveolar a
124. 0 50 300 sub errorbox THE testing area topwindow gt bell result dialog1 Show if result eg OK Y topwindow gt destroy if Tk Exists topwindow print beep system qq perl dn errorbox pl in testing the message box now reinstate the Tk diabetes alarm widget system perl dn tkalarm pl geometry 320x380 50 300 sub viewlog topwindow gt destroy if Tk Exists topwindow if e dnalarm log use my dn tkviewer pl utility to view the file system perl dn tkviewer pl in dnalarm log system perl dn tkalarm pl geometry 320x380 50 300 else carp ERROR can t find file dnalarm log dn tkalarm pl CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 203 system perl dn tkalarm pl geometry 320x380 50 300 F end of the sub sub viewcal topwindow gt destroy if Tk Exists topwindow copy latest instance of the file this is a significant error if the copy fails my Sthisdir cwd my copy string cp kalarm calendar path thisdir dn calendar ics system copy string and carp could not run copy string OS ERROR Perl best practice p 280 THE now view the copied file if e dn calendar ics use my dn tkviewer pl utility to view the file system perl dn tkviewer pl in dn
125. 0 Datex Ohmeda 71 Great North Road Hatfield Hertfordshire AL9 5EN UK Tel 01707 263 570 FAX 01707 260 065 26 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 27 4 1 1 Software version Software is frequently revised and different monitors may have different software versions The software version is displayed on the screen when the monitor is switched on and is also indicated as a 1 byte code the 5 byte in the 40 byte header which precedes all data output via the serial port The 1 byte software version codes are shown in Table 4 2 Table 4 2 Software versions and their Datex Read Interface codes r dri level Software version code S STD93 0 S STD94 S ARK94 1 S STD95 S ARK95 S STD96 S ARK96 2 S ANE97 S ARK97 S ICU97 3 4 1 3 Available software A program for PCs called COLLECT EXE which saves data from the Datex AS 3 monitor is available from Datex This program is known as the AS 3 PC Data Collection Software The program collects the data strings output by the monitor and saves them to the hard disk of the PC either as an ASCII file a binary file or in a form compatible with LOTUS 1 2 3 The package consistes of three program files as follows COLLECT EXE COLLECT CER used for storing setup information AUTOFILE CFR used for writing an automatic date dependent filename The Collect program is also available for the S 5 monitor see Datex Ohmeda S 5 Collect Users R
126. 0 oxygen LHS scale k int y2 0 5 make string A string100a ticks withvalues string100b at for j y1 j lt y2 0 15 j j 0 5 problem with j lt y2 looses last cycle hence use fix j lt y2 0 15 print j jNn format values to 1 decimal place vv sprintf 6 1f j if vv 0 0 vv 0 string100a string100a vv string100b string100b j E string100a string100a string100b string100b 8 desflurane for scale 67 get offset from file mac des7 m offset67 4 217 y67 y2 Soffset67 k int y67 0 5 make string A string67a ticks withvalues string67b at value67b offset67 for j 0 j lt k j value67a j 0 5 value67b value67b 0 5 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 118 if j eq 0 value67b offset67Y format values to 1 decimal place vv sprintf o 1f value67a if vv 0 0 vv 0 Y string67a string67a vv string67b string67b value67b E string67a string67a string67b string67b for scale 50 get offset from file mac des7 m offset50 3 147 y50 y2 Soffset50 k int y50 0 5 make strings A and B string50a ticks withvalues string50b at value50b offset50 for j 0 j lt k j value50a j 0
127. 0 plot 45 00000 0 68059 plot 50 00000 0 65984 plot 55 00000 0 63972 plot 60 00000 0 62021 plot 65 00000 0 60129 plot 70 00000 0 58296 15 00000 0 81957 j10j15 20 00000 0 79458 j15j20 25 00000 0 77035 j20j25 30 00000 0 74686 j25j30 35 00000 0 72408 j30j35 40 00000 0 70200 j35j40 45 00000 0 68059 j40j45 50 00000 0 65984 j45j50 55 00000 0 63972 j50j55 60 00000 0 62021 j55j60 65 00000 0 60129 j60j65 70 00000 0 58296 j65j70 75 00000 0 56518 j70j75 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 87 plot 75 00000 0 56518 80 00000 0 54795 j75j80 plot 80 00000 0 54795 85 00000 0 53124 j80j85 plot 85 00000 0 53124 90 00000 0 51504 j85j90 plot 90 00000 0 51504 95 00000 0 49933 j90j95 end of file lt isojdata8 dat gt loop 1 endSKIP from mac des m var x 1 96960 x 2 1 var x2 x 2 x2 1 point h x2 2 55 2 475 h 1 00000 2 55000 o text MAC h put MAC at 1 000000 2 550000 vertical diff 0 29 units 0 28 var d 0 29 d 0 29 var h6 0 88 h6 0 88 text fbox 0 cdot 6 x h6 put fbox 0 cdot 6 at 1 000000 0 880000 var h8 h6 d h8 1 17 text fbox 0 cdot 8 x h8 put fbox 0 cdot 8 at 1 000000 1 170000 var h10 h8 d h10 1 46 text fbox 1 cdot 0 x h10 put fbox 1 cdot 0 at 1 000000 1 4
128. 0 1 033679 m60 60 00000 1 03368 point m65 65 1 002157 m65 65 00000 1 00216 point m70 70 0 9715963 m70 70 00000 0 97160 point m75 75 0 9419674 m75 75 00000 0 94197 point m80 80 0 9132419 m80 80 00000 0 91324 point m85 85 0 8853925 m85 85 00000 0 88539 point m90 90 0 8583924 m90 90 00000 0 85839 point m95 95 0 8322156 m95 95 00000 0 83222 drawline m5 m10 m15 m20 m25 m30 m35 m40 m45 m50 m55 m60 m65 m70 m75 m80 m85 m90 m95 plot 5 00000 1 45324 10 00000 1 40892 m5m10 plot 10 00000 1 40892 15 00000 1 36595 m10m15 plot 15 00000 1 36595 20 00000 1 32430 m15m20 plot 20 00000 1 32430 25 00000 1 28391 m20m25 plot 25 00000 1 28391 30 00000 1 24476 m25m30 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 85 plot 30 00000 1 24476 35 00000 1 20680 m30m35 plot 35 00000 1 20680 40 00000 1 17000 m35m40 plot 40 00000 1 17000 45 00000 1 13432 m40m45 plot 45 00000 1 13432 50 00000 1 09973 m45m50 plot 50 00000 1 09973 55 00000 1 06619 m50m55 plot 55 00000 1 06619 60 00000 1 03368 m55m60 plot 60 00000 1 03368 65 00000 1 00216 m60m65 plot 65 00000 1 00216 70 00000 0 97160 m65m70 plot 70 00000 0 97160 75 00000 0 94197 m70m75 plot 75 00000 0 94197 80 00000 0 91324 m75m80 plot 80 00000 0 91324 85 00000 0 88539 m80m85 plot 85 00000 0 88539 90 00000 0 85839 m85m90 plot 90
129. 0 111 2 80 Sys x100 112 113 2 80 diast x100 114 115 2 80 mean x100 116 117 1 80 heart rate min NIBP subrecord 118 121 3 0 0 0 status 122 123 3 1 label bit 8 gt 1 after 60 secs 124 125 1 80 sys x100 126 127 1 80 diast x100 128 129 1 80 mean x100 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 35 130 131 1 lt 80 gt HR min Temp 1 subrecord 132 135 3 0 0 0 status 136 137 B 0 label 138 139 1 80 deg C x100 Temp 2 subrecord 140 143 3 0 0 0 status 144 145 C 0 label 146 147 1 80 deg C x100 Temp 3 subrecord 148 151 0 0 0 0 status 152 153 D 0 label 154 155 1 80 deg C x100 Temp 4 subrecord 156 159 0 0 0 0 status 160 161 E 0 label 162 163 1 80 deg C x100 Saturation Sp02 subrecord 164 167 3 0 0 0 status 168 169 0 0 label 00 Sa02 01 Sv02 10 error 170 171 1 80 SATA 100 172 173 1 80 HR 174 175 2 80 IR amp infra red amplitude 176 177 1 80 label for Sa02 1 Sv02 2 SO2 0 3 not used Carbon dioxide C02 subrecord 178 181 47 0 0 0 status 182 183 1 0 label source 01 C02 10 ECG 184 185 1 80 ET 4 x100 186 187 1 80 FI 4 x100 188 189 1 80 RR 190 191 28 1D amb P x10 mmHg amb
130. 0 6 start of file lt isojdata8 dat gt loop 1 Iteration number 1 j mac40 iso 6 point j5 5 0 871941 manual point j10 10 0 8453511 point j15 15 0 819572 point j20 20 0 794579 point j25 25 0 7703483 point j30 30 0 7468564 point j35 35 0 7240809 point j40 40 0 702 point j45 45 0 6805924 point j50 50 0 6598377 point j55 55 0 6397159 point j60 60 0 6202077 point j65 65 0 6012943 point j70 70 0 5829578 point j75 75 0 5651804 point j80 80 0 5479452 point j85 85 0 5312355 point j90 90 0 5150355 point j95 95 0 4993294 j10 10 00000 0 84535 j15 15 00000 0 81957 j20 20 00000 0 79458 j25 25 00000 0 77035 j30 30 00000 0 74686 j35 85 00000 0 72408 j40 40 00000 0 70200 j45 45 00000 0 68059 j50 50 00000 0 65984 j55 55 00000 0 63972 j60 60 00000 0 62021 j65 65 00000 0 60129 j70 70 00000 0 58296 j75 75 00000 0 56518 j80 80 00000 0 54795 j85 85 00000 0 53124 j90 90 00000 0 51504 j95 95 00000 0 49933 j5 5 00000 0 87194 drawline j5 j10 j15 j20 j25 j30 j35 j40 j45 j50 j55 j60 j65 j70 j75 j80 j85 j90 j95 plot 5 00000 0 87194 10 00000 0 84535 j5j10 plot 10 00000 0 84535 plot 15 00000 0 81957 plot 20 00000 0 79458 plot 25 00000 0 77035 plot 30 00000 0 74686 plot 35 00000 0 72408 plot 40 00000 0 7020
131. 004 Typically a page contains 1 hour of data sampled at 45 second intervals but it is useful to be able to devote single pages to a shorter period of time in order to view the data in greater resolution say every 5 seconds having only 6 minutes of data per page CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 270 note get two spaces after the Month if days 10 modified from SUB tedname in launchcam12 pl dei ER OO ER RE if two spaces in posn 8 and 9 then remove one if substr starttimegmt 7 2 eq substr starttimegmt 7 2 print tr string startgmtstring n replace spaces with commas starttimegmt tr make an array stgmt split starttimegmt day stgmt 0 month stgmt 1 date stgmt 2 st stgmt 3 year stgmt 4 noitems stgmt 1 print printlog extracted starttimeUNIX starttimeunix n print printlog extracted starttimeGMT starttimegmt n print printlog extracted no of gmt items ngmtitems corr in print printlog extracted gmt part is day month date st year year2 n print printlog extracted starttime hh mm ss st n print starttime starttimegmt n print no of gmt items ngmtitems n print the gmt part is day month date st year n need to include some error checking ie abort if probem with the times HHHHHH goto LASTLINE abort pro
132. 09276 k10k15 plot 15 00000 1 09276 20 00000 1 05944 k15k20 plot 20 00000 1 05944 25 00000 1 02713 k20k25 plot 25 00000 1 02713 30 00000 0 99581 k25k30 plot 30 00000 0 99581 35 00000 0 96544 k30k35 plot 35 00000 0 96544 40 00000 0 93600 K35k40 plot 40 00000 0 93600 45 00000 0 90746 k40k45 plot 45 00000 0 90746 50 00000 0 87978 k45k50 plot 50 00000 0 87978 55 00000 0 85295 k50k55 plot 55 00000 0 85295 60 00000 0 82694 k55k60 plot 60 00000 0 82694 65 00000 0 80173 k60k65 plot 65 00000 0 80173 70 00000 0 77728 k65k70 plot 70 00000 0 77728 75 00000 0 75357 k70k75 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 86 plot 75 00000 0 75357 80 00000 0 73059 k75k80 plot 80 00000 0 73059 85 00000 0 70831 k80k85 plot 85 00000 0 70831 90 00000 0 68671 k85k90 plot 90 00000 0 68671 95 00000 0 66577 k90k95 drawpoint k10 k20 k30 k40 k50 k60 k70 k80 k90 put bullet at 10 00000 1 12713 k10 put bullet at 20 00000 1 05944 k20 put bullet at 30 00000 0 99581 K30 put bullet at 40 00000 0 93600 k40 put bullet at 50 00000 0 87978 k50 put bullet at 60 00000 0 82694 k60 put bullet at 70 00000 0 77728 k70 put bullet at 80 00000 0 73059 k80 put bullet at 90 00000 0 68671 k90 end of file lt isokdata8 dat gt loop 1 thinline inputfile isojdata8 dat
133. 1 6 print Wn ETsevoflurane age 34 0 0 6 ETsevoflurane age 37 0 0 6 ETsevoflurane age 40 0 0 6 ETsevoflurane age 34 50 1 6 ETsevoflurane age 37 50 1 6 ETsevoflurane age 40 50 1 6 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 128 ETsevoflurane age 34 67 1 6 ETsevoflurane age 37 67 1 6 ETsevoflurane age 40 67 1 6 print Wn ETdesflurane age 34 0 0 6 ETdesflurane age 37 0 0 6 ETdesflurane age 40 0 0 6 ETdesflurane age 34 50 1 6 ETdesflurane age 37 50 1 6 ETdesflurane age 40 50 1 6 ETdesflurane age 34 67 1 6 ETdesflurane age 37 67 1 6 ETdesflurane age 40 67 1 6 print n sub EThalothane calculate et halothane from age macfrac temp my myage temp macfrac 9 print mac temp mac tempNn my m40hal 0 75 my EThalothane string ethal4dp EThalothane macfrac m40hal agecorr myage 1 0 05 37 temp ethal4dp sprintf 4f EThalothane string age myage temp temp macFrac macfrac print ET hal string ethalddp n return EThalothane sub ETisoflurane calculate et isoflurane from age macfrac temp my myage temp nitrous macfrac _ print mac temp mac tempNn my m40iso 1 17 my nitrousoffset50iso 0 56 my nitrousoffset67iso 0 75 my E
134. 11 2004 dDrugs h 20122 Aug 8 2003 dDrugs ui 6507 Apr 11 2004 dDude cpp 1342 Apr 11 2004 dDude h 18533 Jun 30 2003 dDude ui 3631 Apr 11 2004 dHelpBrowser cpp 1099 Apr 11 2004 dHelpBrowser h 6584 Feb 17 2003 dHelpBrowser ui 4096 Apr 13 2004 docs 6571 Apr 11 2004 dPatient cpp 1491 Apr 11 2004 dPatient h 16147 Jun 19 2003 dPatient ui 7125 Apr 11 2004 dPort_Datex_AS3 cpp 1566 Apr 11 2004 dPort Datex AS3 h 20554 Apr 11 2004 dPort_Datex_AS3 ui 13874 Apr 11 2004 dPort_Graseby3400 cpp 2397 Apr 11 2004 dPort_Graseby3400 h 44245 Apr 11 2004 dPort_Graseby3400 ui 4029 Apr 11 2004 dProject cpp 1112 Apr 11 2004 dProject h 6625 Apr 11 2004 dProjectNew cpp 1309 Apr 11 2004 dProjectNew h 8467 Jun 19 2003 dProject ui 8940 Apr 11 2004 dPumpController cpp 1890 Apr 11 2004 dPumpController h 6725 Apr 11 2004 dPumpController_Nickalls cpp 1615 Apr 11 2004 dPumpController Nickalls h 17823 Aug 22 2003 dPumpController Nickalls ui 24388 Apr 11 2004 dPumpController ui 4428 Apr 11 2004 dSplash cpp 925 Apr 11 2004 dSplash h 7790 Feb 17 2003 dSplash ui 1979 Apr 11 2004 dTestABC 863 Apr 11 2004 dTestABC h 4683 Mar 5 2003 dTestListView ui 5074 Apr 11 2004 dTextWindow cpp 1346 Apr 11 2004 dTextWindow h 14654 Nov 24 2003 dTextWindow ui 7969 Apr 11 2004 dTimer cpp 1574 Apr 11 2004 dTimer h 22117 Jun 19 2003 dTimer ui 1273 Mar 5 2003 dude anaesthetist xpm 1283 Mar 5 2003 dude patient xpm 1298 Mar 6 2003 dude surgeon xpm 422 Jul 3 2003 entry comment xpm 450 Feb 17 2003
135. 1523 variable y12 1 9523 variable y10 1 7523 variable y08 1 5523 variable y06 1 3523 variable y04 1 1523 variable y02 0 9523 0 7523 0 2 variable y00 0 7523 0 7523 point L16 x5 y16 point R16 x6 y16 point L14 x5 y14 point R14 x6 y14 point L12 x5 y12 point R12 x6 y12 point L10 x5 y10 point R10 x6 y10 point L08 x5 y08 point R08 x6 y08 point L06 x5 y06 point R06 x6 y06 point L04 x5 y04 point R04 x6 y04 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 66 point L02 x5 y02 point R02 x6 y02 point L00 x5 y00 point R00 x6 y00 draw the dashes from Left to Right so have small gap at right axis drawline L16R16 L14R14 L12R12 L10R10 LO8R08 LO6R06 LO4RO4 LO2RO02 LOOROO Vendpicture Yframebox end document The following example is the TEX code output by the above mathsPIC program ox x mathsPIC 2 1g1 6 Copyright c RWD Nickalls 1999 2002 x Email dicknickalls compuserve com x Date m d y 02 02 2003 16 22 19 Command Line b s MAC ISO7 M x Input Filename MAC ISO7 M x Output Filename MAC ISO7 MT ox mac iso7 m modified from mac iso5 m Feb 1st 2003 final graph chart for the bja wih decimals cdot and fbox new curves for anaesthesia o mathsPIC documentclass a4paper 12pt article usepackage pictexwd begin docume
136. 2 set widget y 2 set widget h 250 pushdict ANsetiwidget parent h widget port monitor O Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hh datex port 1 Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh set subclass TPort Datex AS3 v0 1 set widget w 200 set sample period 5000 set device dev ttyS0 4 set device dev ttyS1 4 request start 0 no 1 yes 4 set request start send 0 4 request stop O no 1 yes 4 set request stop send 0 4 request stop period 0 1 whatever set request stop period 0 set name First Datex set logfile datex0 dat set param set param set param set param set param set param sat sat sat inv 0 s bp s inv 0 d bp d ecg hr ecg hr sat hr sat hr ecg rr ecg rr set param set param set param set param 02 insp o2 insp inv 1 m cvp co2 exp co2 exp co2 insp co2 insp CHAPTER 12 CONFIGURATION FILES RWD Nickalls 162 set param set param set param set param set param set param set param set param set param set param set param co2 rr co2 rr ecg rr fecg rr fv tv insp tv insp fv tv exp tv exp vap exp vap exp vap insp vap insp vap code vap code n2o0 exp n20 exp nibp s nibp s nibp d nibp d fv mv exp mv exp set param fv pplat pplat set param temp 0 t temp 0 set param temp 1 t temp 1 newinstance popdict popdict
137. 2 3110506 xml f ampp2 3110506 xml f ingredient2 3110506 xml f lookup2 3110506 xml f vmp2 3110506 xml f vmpp2 3110506 xml f vtm2 3110506 xml ingredient v2 3 xsd letters lookup v2 3 xsd vmpp v2 3 xsd vmp v2 3 xsd vtm v2 3 xsd 13 4 VTM File format The f vtmXXX xm1 database 114 KB in this particular case is an XML formatted database of about 1800 drugs and drug combinations week 19 2006 lt xml version 1 0 encoding utf 8 7 VIRTUAL THERAPEUTIC MOIETIES xsi noNamespaceSchemaLocation vtm v2 2 xsd xmlns xmlns xsi http www w3 org 2001 XMLSchema instance gt lt Generated by Prescription Pricing Authority gt VTM VTMID 68088000 VTMID NM Acebutolol NM VTM lt VIM gt lt VIMID gt 90332006 lt VIMID gt lt NM gt Paracetamol lt NM gt lt VTM gt lt VIM gt lt VIMID gt 33664007 lt VIMID gt lt NM gt Acetazolamide lt NM gt lt VTM gt lt VIM gt lt VIMID gt 108974006 lt VTMID gt lt NM gt Abciximab lt NM gt lt VTM gt lt VIM gt lt VIMID gt 109077006 lt VIMID gt lt NM gt Acarbose lt NM gt lt VIM gt lt VIM gt lt VTMID gt 398910009 lt VTMID gt lt NM gt Acebutolol Hydrochlorothiazide lt NM gt lt VTM gt VTM VTMID 329923004 VTMID NM Aceclofenac NM VTM VTM VTMID 116084008 VTMID NM Abacavir NM VTM CHAPTER 13 DRUG DICTIONARY RWD Nickalls 170 lt VIM gt lt VTMID gt 9835811000001101 lt VIMID gt lt NM
138. 233 20 00000 1 85402 p15p20 plot 20 00000 1 85402 25 00000 1 79748 p20p25 plot 25 00000 1 79748 30 00000 1 74266 p25p30 plot 30 00000 1 74266 35 00000 1 68952 p30p35 plot 35 00000 1 68952 40 00000 1 63800 p35p40 plot 40 00000 1 63800 45 00000 1 58805 p40p45 plot 45 00000 1 58805 50 00000 1 53962 p45p50 plot 50 00000 1 53962 55 00000 1 49267 p50p55 plot 55 00000 1 49267 60 00000 1 44715 p55p60 plot 60 00000 1 44715 65 00000 1 40302 p60p65 plot 65 00000 1 40302 70 00000 1 36024 p65p70 plot 70 00000 1 36024 75 00000 1 31875 p70p75 plot 75 00000 1 31875 80 00000 1 27854 p75p80 plot 80 00000 1 27854 85 00000 1 23955 p80p85 plot 85 00000 1 23955 90 00000 1 20175 p85p90 plot 90 00000 1 20175 95 00000 1 16510 p90p95 end of file lt isopdata8 dat gt loop 1 thickline inputfile isondata8 dat 1 2 start of file lt isondata8 dat gt loop 1 Iteration number 1 n mac40 iso 1 2 point n5 5 1 743882 manual n5 5 00000 1 74388 point n10 10 1 690702 point n15 15 1 639144 point n20 20 1 589158 point n25 25 1 540697 point n30 30 1 493713 point n35 35 1 448162 point n40 40 1 404 point n45 45 1 361185 point n50 50 1 319675 point n55 55 1 279432 point n60 60 1 240415 point n65 65 1 202589 point n70 70 1 165916 point n75 75 1 130361 point n80
139. 278 285 0 0 0 0 lt D3 gt 0 1 80 Invas Press 5 subrecord 286 289 0 0 0 0 290 291 D 0 292 293 2 80 294 295 2 80 296 297 2 80 298 299 1 80 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 37 Invas Press 6 subrecord 300 303 0 0 0 0 304 305 E 0 306 307 2 80 308 309 2 80 310 311 2 80 312 313 1 80 Reserved 2 2 bytes 314 315 0 0 Marker Byte 316 0 Reserved 3 1 byte 317 0 Last WORD 318 319 31 0 2 319 318 bytes 4 5 List of parameter names This is a provisional list namelst tex of parameter variable and string names made in November 2001 for use in the Linux Anaesthesia AS 3 project Each parameter name has an associated number of Bytes Unit Divisor and De scription The parameters have a fixed byte location Position in the output data string Note that the first location is numbered 1 and hence this numbering corresponds exactly with the numbers used in the SUB Decode Section page The parameter names I have suggested in the following table consist mostly of combined upper case and lower case characters Use of the Divisor DIV we first extract the numeric value and then divide it by the DIV value to obtain the true value see example on Table 3 5 on page 21 for invas BP for which DIV 100 Use the numeric example given in
140. 39 1 027131 9958085 9654412 936 45 9074566 8797836 8529544 8269435 8017257 7772771 7535739 7305936 15 1 092763 k10k15 20 1 059439 k15k20 25 1 027131 k20k25 30 35 40 50 55 60 65 70 75 80 85 9958085 k25k30 9654412 k30k35 936 k35k40 9074566 k40k45 8797836 k45k50 8529544 k50k55 8269435 k55k60 8017257 k60k65 4772771 9696 k65k70 535739 9696 K70k75 305936 9696 k75k80 08314 k80k85 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 72 plot 85 708314 90 6867139 k85k90 plot 90 6867139 95 6657725 k90k95 drawpoint k10k20k30k40k50k60k70k80k90 put bullet at 10 1 127135 k10 put bullet at 20 1 059439 k20 put bullet at 30 9958085 k30 put bullet at 40 936 k40 put bullet at 50 8797836 k50 put bullet at 60 8269435 k60 put bullet at 70 7772771 k70 put bullet at 80 7305936 k80 put bullet at 90 6867139 k90 end of file lt isokdata dat gt thinline inputfile isojdata dat 0 6 start of file lt isojdata dat gt j mac40 iso 6 point j5 5 871941 5 871941 manual point j10 10 8453511 10 8453511 point j15 15 819572 15 819572 point j20 20 794579 20 794579 point j25 25 7703483 25 7703483 point j30 30 7468564 30 7468564 point j35 35 724080
141. 4 25000 8 27125 hh point B35 35 m m40 10 0 00269 34 40 1 0 05 37 35 B35 35 00000 8 63087 hh point B36 36 m m40 10 0 00269 34 40 1 0 05 37 36 B36 36 00000 9 11036 hh point B37 137 m m40 10 0 00269 34 40 1 0 05 37 37 B37 37 00000 9 58985 hh point B38 138 m m40 10 0 00269 34 40 1 0 05 37 38 B38 38 00000 10 06935 hh point B39 39 m m40 10 0 00269 34 40 1 0 05 37 39 B39 39 00000 10 54884 hh point B40 39 75 m m40 10 0 00269 34 40 1 0 05 37 39 75 B40 39 75000 10 90846 color blue hh adrawline B34 B37 plot 34 25000 8 27125 37 00000 9 58985 B34B37 color red hh drawline B37 B40 plot 37 00000 9 58985 39 75000 10 90846 B37B40 color black hh Grawpoint B35 B36 B37 B38 B39 put bullet at 35 00000 8 63087 4 B35 put bullet at 36 00000 9 11036 44 B36 put bullet at 37 00000 9 58985 44 B37 put bullet at 38 00000 10 06935 B38 put bullet at 39 00000 10 54884 44 B39 hh text turnboxrt18 1039569311426 boldmath 1 4 B37 polar r9 18 1039569311426 t9 deg put turnbox 18 1039569311426 boldmath 1 4 at 37 105676 9 759652 A4 m 2 2 hh var m 1 2 AMAC A4 m 7 1 2 hh point C34 134 25 m m40 10 0 00269 34 40 1 0 05 37 734 20D C34 34 25000 7 08964 hh point C35
142. 5 75 1 318754 point p80 80 1 278539 point p85 85 1 23955 point p90 90 1 201749 point p5 5 2 034529 manual put bullet at 10 00000 2 25427 q10 put bullet at 20 00000 2 11888 q20 put bullet at 30 00000 1 99162 q30 put bullet at 40 00000 1 87200 q40 put bullet at 50 00000 1 75957 q50 put bullet at 60 00000 1 65389 q60 put bullet at 70 00000 1 55455 q70 put bullet at 80 00000 1 46119 q80 put bullet at 90 00000 1 37343 q90 end of file lt isoqdata8 dat gt loop 1 inputfile isopdata8 dat 1 4 start of file lt isopdata8 dat gt loop 1 p10 10 00000 1 97249 p15 15 00000 1 91233 p20 20 00000 1 85402 p25 25 00000 1 79748 p30 30 00000 1 74266 p35 35 00000 1 68952 p40 40 00000 1 63800 p45 45 00000 1 58805 p50 50 00000 1 53962 p55 55 00000 1 49267 p60 60 00000 1 44715 p65 65 00000 1 40302 p70 70 00000 1 36024 p75 75 00000 1 31875 p80 80 00000 1 27854 p85 85 00000 1 23955 p90 90 00000 1 20175 p5 5 00000 2 03453 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 83 point p95 95 1 165102 p95 95 00000 1 16510 drawline p5 p10 p15 p20 p25 p30 p35 p40 p45 p50 p55 p60 p65 p70 p75 p80 p85 p90 p95 plot 5 00000 2 03453 10 00000 1 97249 p5p10 plot 10 00000 1 97249 15 00000 1 91233 p10p15 plot 15 00000 1 91
143. 53 point m20 20 1 324298 20 1 324298 point m25 25 1 283914 25 1 283914 point m30 30 1 244761 30 1 244761 point m35 35 1 206802 35 1 206802 point m40 40 1 17 40 1 17 point m45 45 1 134321 45 1 134321 point m50 50 1 099729 50 1 099729 point m55 55 1 066193 55 1 066193 point m60 60 1 033679 60 1 033679 point m65 65 1 002157 65 1 002157 point m70 70 9715963 70 9715963 point m75 75 9419674 75 9419674 point m80 80 9132419 80 9132419 point m85 85 8853925 85 8853925 point m90 90 8583924 90 8583924 point m95 95 8322156 95 8322156 drawline m5m10m15m20m25m30m35m40m45m50m55m60m65m70m75m80m85m90m095 plot 5 1 453235 10 1 408918 m5m10 plot 10 1 408918 15 1 365953 m10m15 plot 15 1 365953 20 1 324298 m15m20 plot 20 1 324298 25 1 283914 m20m25 plot 25 1 283914 30 1 244761 m25m30 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 71 plot plot plot plot plot plot plot plot plot plot plot plot plot 30 35 40 45 50 55 60 65 70 75 80 85 90 1 244761 35 1 206802 m30m35 1 206802 40 1 17 9676 m35m40 1 17 45 1 134321 m40m45 1 134321 1 099729 1 066193 1 033679 1 002157 9715963 9419674 9132419 8853925 8583924 50 55 60 65 70 75 80 85 90 95 1 099729 m45m50 1 066193
144. 60000 var h12 h10 d h12 1 75 text fbox 1 cdot 2 x h12 put fbox 1 cdot 2 at 1 000000 1 750000 var h14 h12 d h14 2 04 text fbox 1 cdot 4 x h14 put fbox 1 cdot 4 at 1 000000 2 040000 var h16 h14 d h16 2 33 text fbox 1 cdot 6 x h16 put fbox 1 cdot 6 at 1 000000 2 330000 new rotated legends from macATdes2 pl var y2 2 6 y2 2 6 var y1 0 4 y1 0 4 newcommand ylegend sf End tidal in 100 oxygen air determine string length gt Yunits etc newlength ylength settowidth ylength ylegend Ytext answer ylength number ylength 37 0 4 halflength 3 818 0 777 y units CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 88 text turnbox 90 ylegend 25 y1 y2 y1 2 0 777 put turnbox 90 ylegend at 25 000000 0 723000 beginSKIP endSKIP P beginSKIP endSKIP newcommand myrightb fbox begin minipage 3 5cem 3 8cm End expired in hspacex 9mm 67 hspace 8mm 50 hspacex 9mm N _2 0 hspace 7 5mm N _2 0 end minipage 1 end of newcommand text myrightb 89 143 2 657 I put myrightb 1 at 89 143000 2 657000 End expired N96 in 67 hspace 8mm 50 N 2 O hspace 7 5mm N _2 0 P newcommand mybottom Age years
145. 621 p45p50 plot 50 1 539621 55 1 49267 p50p55 plot 55 1 49267 60 1 447151 p55p60 plot 60 1 447151 65 1 40302 p60p65 plot 65 1 40302 70 1 360235 p65p70 plot 70 1 360235 75 1 318754 p70p75 plot 75 1 318754 80 1 278539 p75p80 plot 80 1 278539 85 1 23955 p80p85 plot 85 1 23955 90 1 201749 p85p90 plot 90 1 201749 95 1 165102 p90p95 end of file lt isopdata dat gt thickline inputfile isondata dat 1 2 start of file lt isondata dat gt n mac40 iso 1 2 point n5 5 1 743882 5 1 743882 manual point n10 10 1 690702 10 1 690702 point n15 15 1 639144 15 1 639144 point n20 20 1 589158 20 1 589158 point n25 25 1 540697 25 1 540697 point n30 30 1 493713 30 1 493713 point n35 35 1 448162 35 1 448162 point n40 40 1 404 40 1 404 point n45 45 1 361185 45 1 361185 point n50 50 1 319675 50 1 319675 point n55 55 1 279432 55 1 279432 point n60 60 1 240415 60 1 240415 point n65 65 1 202589 65 1 202589 point n70 70 1 165916 70 1 165916 point n75 75 1 130361 75 1 130361 point n80 80 1 09589 80 1 09589 point n85 85 1 062471 85 1 062471 point n90 90 1 030071 90 1 030071 point n95 95 9986587 95 9986587 drawline n5n10n15n20n25n30n35n40n45n50n55n60n65n70n75n80n85n90N95 plot 5 1 743882 10 1 690702
146. 7 0D 013 238 82 130 239 16 022 240 E5 229 241 14 020 242 F4 244 243 06 006 244 TE 126 245 02 002 246 00 000 247 00 000 248 00 000 249 00 000 250 07 007 251 00 000 252 01 001 253 80 128 254 01 001 255 80 128 256 01 001 257 80 128 258 01 001 259 80 128 260 20 032 261 00 000 262 00 000 263 00 000 264 00 000 265 00 000 266 01 001 267 80 128 268 01 001 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 47 269 80 128 270 FF 255 271 8D 141 272 01 001 273 80 128 274 43 067 275 00 000 276 42 066 277 00 000 278 00 000 279 00 000 280 00 000 281 00 000 282 BD 189 283 BD 189 284 01 001 285 80 128 286 00 000 287 00 000 288 00 000 289 00 000 290 0D 013 291 00 000 292 02 002 293 80 128 294 02 002 295 80 128 296 02 002 297 80 128 298 01 001 299 80 128 300 00 000 301 00 000 302 00 000 303 00 000 304 0E 014 305 00 000 306 02 002 307 80 128 308 02 002 309 80 128 310 02 002 311 80 128 312 01 001 313 80 128 314 00 000 315 00 000 316 00 000 317 40 064 318 51 081 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 48 319 00 000 320 DE 222 321 7E 126 4 7 Correspondence The subrecord types are intended to be used in the sr type field of the sr desc struct s see section 3 2 page 8 of the specification and 0 DRI PH XMIT REQ is the correct value for that field However the phdb rcrd type field in the data structure struct phdb req is used for a different pu
147. 8 2 The BASH scriptruncamomile llle 136 8 3 Pressing the RUN button ele 137 8 3 1 Program tklaunch2 pl saaa aaa Se 137 8 4 Useful Linux tools to use with the launcher 140 9 The launchcami2 pl program 141 9 1 Introduction s spore Siae len 141 9 2 The program launchcami2 pl 143 CONTENTS NI The data program Camomile 10 System overview 10 1 Inroducion llle 10 2 Modules i oo 2i64 246442324 24559 24 N REKE qms 10 2 1 Graphical front end module 10 2 2 Data collection and display module 10 2 3 Printing module llle 10 2 4 Epidural database 2er 10 2 5 Help files e pos s oe RR RR RR ERE Re ee 10 3 Directory structure e 11 The Camomile program 11 1 Directory listing of camomile v 0 1_040413b 12 Configuration files 12 1 Introduction sapoe sos RR m RE RR Ro S 12 2 c asSrn COnf s 4 4o oko o EEA om E GR boy nox RO SUE RUN 12 3 x configrn conf is s ok EE do Rem ERROR eR 12 4 projectdir conf osx e cee 2e 12 5 w monitor datexas3 conf e 12 6 People cont s y pacs e ge mode ie RE PAR US RR 12 7 Dr gs cOonf 232 e mom a Ryo SASS RE EES E Roy 12 8 X widgets cOnl ais uo oe cook e a RR ae HEER 13 Drug dictionary 13 1 Introduction scoest erpa edee SS ES ss ee 13 2 Initial drug list ees 13 3 Download bundle aa SE EE Se 13 4 VTM File format ss rn 13 5 Perl p
148. 8 vscale 0 85 nofiles votfset 72bp ANoddsidemargin 30bp Nheadheight 20bp headsep 5bp 4 textwidth 450bp ANtextheight 770bp TA Noddsidemargin 10bp usepackage camomile def docName Camomile Configuration file 11 4 3 def S 1 section 1 def SS 1 subsection 1 def SSS 1 subsubsection 1 def FN 1 tt 1 def fN 1 tt 1 def set 1 2 SET 1 2 Vpagestylefheadings makeindex begin document docName tableofcontents CHAPTER 12 CONFIGURATION FILES RWD Nickalls 158 S Introduction This is a configuration file for Camomile It is layed out in TeX so that we can do some form of literate programming The alternative could be XML or look at FN sendmail s configuration file 4 Nnewpage S Configuration Notes begin itemize item screen dimensions in nominal units On original screen measure off in whatever units you find convenient mm bp etc When you port this configuration to another size of monitor adjust the fN pixelsize parameters It is probably best to set your fN pixelsize parameters to an initally sensible value say 1000 then adjust from there end itemize newpage beginCamomileConfig Ncomnent Nnewpage SS Configure Application SetCamomileIncludePath home dick allfiles camomiletop conf2 newdict set path config home dick allfiles camomiletop conf2 set class main newinstance popdict hhhhh
149. 9 35 7240809 point j40 40 702 40 702 point j45 45 6805924 45 6805924 point j50 50 6598377 50 6598377 point j55 55 6397159 55 6397159 point j60 60 6202077 60 6202077 point j65 65 6012943 65 6012943 point j70 70 5829578 70 5829578 point j75 75 5651804 75 5651804 point j80 80 5479452 80 5479452 point j85 85 5312355 85 5312355 point j90 90 5150355 90 5150355 point j95 95 4993294 95 4993294 Arawline j5j10j15j20j25j30j35j4 0j45j50j55j60j65j70j75j80j85j90j95 plot 5 871941 10 8453511 j5j10 plot 10 8453511 15 819572 j10j15 plot 15 819572 20 794579 j15j20 plot 20 794579 25 7703483 j20j25 plot 25 7703483 30 7468564 j25j30 plot 30 7468564 35 7240809 j30j35 plot 35 7240809 40 702 j35j40 plot 40 702 45 6805924 j40j45 plot 45 6805924 50 6598377 j45j50 plot 50 6598377 55 6397159 j50j55 plot 55 6397159 60 6202077 j55j60 plot 60 6202077 65 6012943 j60j65 plot 65 6012943 70 5829578 j65j70 plot 70 5829578 75 5651804 j70j75 plot 75 5651804 80 5479452 j75j80 plot 80 5479452 85 5312355 j80j85 plot 85 5312355 90 5150355 j85j90 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 73 plot 90 5150355 95 4993294 j90j95 end of file lt isojdata dat gt endSKIP ofrom mac
150. 9979 436 94 500000 1080560024 d The log file timefile txt Concurrently with the previous process the program cam2gnnh p1 creates the timefile dat file which holds the start times for each of the gnn files see below This file is very useful as a check on the functioning of the cam2gnnh p1 program timefile txt 01 1071580301 2003 12 16 13 11 41 bp s g01 02 1071583865 2003 12 16 14 11 5 bp s g02 03 1071587465 2003 12 16 15 11 5 bp s g03 01 1071580276 2003 12 16 13 11 16 sat gO01 02 1071583840 2003 12 16 14 10 40 sat g02 03 1071587440 2003 12 16 15 10 40 sat g03 e The base log file baselog data After processing all the parameter fields gnn files we then access extract the anaesthetists log file base 110g using the camomilefielf2tex utility as before only this time using the 1 switch and the s tex option since we are wanting to access a log file it cam2gnnh p1 system camomilefield2tex p projdir l base o baselog data Note that since we are running this command from within the pdata subdirectory then the default location for the output files is the current directory 16 7 Write the GNUplot scripts for each graph Each 1 hour page of the Anaesthesia Record consists of six separate graphs each showing a time plot of several parameters Each spearate graph requires its own so called gnu file script which sets up the graph structure and plots each
151. A The suite of Perl programs making up this stand alone module is coordinated by the Perl program processdata pl All the programs and scripts required for processing and printing are stored in the 264 CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 265 camomiletop datexsim printfiles directory The various programs are as follows processdata pl coordinates the module in the operation directory fields2PDATA pl main program in the dir PDATA dir binlog2gnn pl converts binlog files to gnn files binlog2data pl converts binlog files to data files prtanes6 tex TeX file for typesetting the graphs prtdrug2 sty TeX style option required by printdrug tex prtdrug tex TeX file for typesetting the drug page base2texd pl ASCII to TeX conversion from keyboard entry log file 19 2 Running the processdata pl script To start the process we first need to move the Perl script processdata pl into the appropriate operation directory e g 2005 8ep 23 1423 we then need to move to that directory and type the following at the commandline perl processdata pl In due course the script will be made to take the PATH of the operation directory as a parameter in which case the user will type something like the following from any location or even within a script perl processdata pl camomiletop theatredata 2005 Sep 23 1342 The key steps performed by this module ar
152. B start_time dataline string timefile dat dataline n place the params into an array value split dataline hour value 0 time_unix value 1 time_gmt value 2 GMT yyyy mm dd hh mm ss gfile value 3 CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 299 get the largest Gnn value gnnmax if hour gt gnnmax gnnmax hour end of whilef close timefile print printlog SUB start time GnnMax gnnmax in return gnnmax end of sub
153. Button text gt EPIDURAL and DOUBLE LUMEN TUBE database wraplength gt 110 padx gt 30 pady gt 50 relief gt raised background gt DarkSeaGreen2 activebackground gt DarkSeaGreen3 command gt amp epidural gt pack side gt bottom expand gt 1 right Hi PRINT button topwindow gt Button text gt PRINT LAST CASE padx gt 60 pady gt 60 relief gt raised background gt LightBlue3 activebackground gt LightBlue4 command gt amp printout gt pack side gt right expand gt 1 HE MainLoop Ht sub launch if e launchcam12 pl first remove the Tk screen topwindow destroy if Tk Exists topwindow topwindow gt bell beeps if click window p 296 system perl launchcam12 pl system perl tklaunch2 pl geometry 300x400 50 300 else print ERROR W print can t find program launchcam12 pl MW exit Ht sub quit exit Hf sub printout topwindow gt bell result dialog1 gt Show if result eq OK HE sub projectteam topwindow gt bell result dialog2 Show CHAPTER 8 THE PERL TK FRONT END RWD Nickalls 140 if result eq OK Y topwindow destroy if Tk Exists topwindow tHisystem clear system xd
154. D ALONE SA MODULE RWD Nickalls 249 al Create the log file and make new directory processdata pl use Carp better error messages use File Copy for copying files use Cwd for grabbing PATH of current working directory use FindBin gets name of perl script and base dir dH 4 open logfile gt processdata log die ERROR can t open file lt processdata log gt n get progName and its base dir namei FindBin Bin programname FindBin Script print logfile this LOG generated by program lt programname gt Nn timenow localtime print logfile timenow n print logfile Running program name1 programname n thisdir cwd grab the PATH of current working dir print logfile thisdir n create the PDATA dir mkdir PDATA 0744 format mkdir dir mode black book p 283 a2 Copy the required software tools to the PDATA directory We now copy a suite of files required for data processing and printing from the datexsim printfiles directory to the PDATA directory We use the secure copy command from the File Copy module Note that with this command we can only copy one file at a time In the extract below we copy the file fields2PDATA pl processdata pl copy the required printTOOLS files from camomiletop datexsim printfiles to PDATA fromdir datexsim printfiles filei
155. D34 34 25000 5 90803 34 25 hh point D35 35 m m40 10 0 00269 34 40 1 D35 35 00000 6 16491 X point D36 136 m m40 10 0 00269 34 40 1 D36 36 00000 6 50740 X point D37 377 m m40 10 0 00269 34 40 1 D37 37 00000 6 84990 X point D38 138 m m40 10 0 00269 34 40 1 D38 38 00000 7 19239 hh point D39 39 m m40 10 0 00269 34 40 1 D39 39 00000 7 53488 X point D40 39 75 m m40 10 0 00269 34 40 1 0 05 37 D40 39 775000 7 79176 39 75 color blue hh drawline D34 D37 plot 34 25000 5 90803 37 00000 6 84990 D34D37 color red hh drawline D37 D40 84990 39 75000 7 79176 44 D37D40 plot 37 00000 6 color black hh drawpoint D35 put bullet put bullet put bullet put bullet put bullet hh text turnbor 13 Adef r2d 180 _pi_ D36 D37 D38 D39 at at at at at 35 00000 6 16491 D35 36 00000 6 50740 D36 37 00000 6 84990 D37 38 00000 7 19239 D38 39 00000 7 53488 D39 0 05 37 0 05 37 0 05 37 0 05 37 0 05 37 1441191824082 Vb oLdmath 1 0 D37 polar r9 13 1441191824082 t9 deg put turnbox 13 1441191824082 boldmath 1 0 at 37 119961 7 009929 hh get slope of line hh var s direction D35 D40 A44 radians hh s 0 329973032902251 hh var ri4 atan 5 2 tan
156. DESFLURANE xk V Hprint xx AGE amp TEMPERATURE CORRECTION n print xx kV print ses macATdes1 pl Nn print x rwd nickalls 2005 sNn Hprint kk SSS ekke kkk kk N THE for Sage 1 age lt 120 age age 1 need the filenames to have 3 digit integers force age 3 integer digits eg 002 055 etc see black book p 233 Sagef is the formatted age string only for filenames agef sprintf 3u Sage basename macdes mfilename basename agef m mtfilename basename agef mt psfilename basename agef ps pdffilename basename agef pdf dvifilename basename agef dvi define filename to be printed on chart pdf or ps filename psfilename CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 116 print 4n VA print making files for age age Wn print An THE create the output file open outfile gt mfilename die ERROR can t create file mfilename Wn do some initial calculation of some reguired variables FIRST calculate the slopes of all lines for mAC1 6 gt 0 6 pi 4 atan2 1 1 r2d 180 pi d2r pi 180 m40 6 6 desflurane MAC40 agecorr 10 0 00269 age 40 agecorr THAN Yodef etdes t mm40 amp agecorr 1 0 05 37 t etdes s1634 etdes 1 6 34 s1640 etdes 1 6 40 s16deg r2d at
157. ED MAC RWD Nickalls 61 M etn2o 100 eto2 etco2 etvap M do N20 calculation first M restrict n2o to zero or above M IF n20 lt 0 THEN n20 0 M eqn mac mac40 10 0 00269 deltaage M q 1 6 mac 1 17 M p 1 4 mac 1 17 Mn 1 2 mac 1 17 M m 1 mac 1 17 M k 0 8 mac 1 17 M j 0 6 mac 1 17 EEEE 2998988 OPEN isoqdata dat FOR OUTPUT AS 1 n 1 6 code q mac40 1 17 REM isoflurane REM PRINT 1 92696 code mac40 iso x n FOR j 5 TO 95 STEP 5 REM j age deltaage j 40 BB 00269 mac n mac40 10 BB x deltaage PRINT j mac PRINT 1 point code j j mac s s code STR j SPACE 1 NEXT j PRINT 1 PRINT 1 drawline s REM 6 3 1 A data file for a single iso MAC curve The following output data file isogdata dat was generated by the above program This data file contained the mathsPIC code for drawing the iso MAC 1 6 curve q for the agent isoflurane This file was then one of the input files for another mathsPIC program which drew the whole graph isoqdata dat q mac40 iso 1 6 point q 5 5 2 325176 manual point q 10 10 2 25427 point q 15 15 2 185525 point q 20 20 2 118877 point q 25 25 2 054262 point q 30 30 1 991617 wv CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 62 poin
158. FINISHED n print nn WM rosok nV T SUB note that the lt sub gt keyword must be lowercase sub tedname THE returns a date time encoded filename 7 projdir using the GMT start time string passed as a parameter my S startgmtstring 0 my n _ 1 CHAPTER 9 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 146 print SUB starttimestring startgmtstring n print SUB number of args passed n n note the main items are space separated except hh mm ss format is Sun Jan 25 13 24 35 2004 format is Sun Jan 5 13 24 35 2004 note get two spaces after the Month if days lt 10 if two spaces in posn 8 and 9 then remove one if substr startgmtstring 7 2 eq substr startgmtstring 7 2 print SUB new translated string startgmtstring n now replace spaces with commas startgmtstring tr THE make an array stgmt split startgmtstring day stgmt 0 month stgmt 1 date stgmt 2 hms stgmt 3 year stgmt 4 noitems stgmt 1 print SUB orig string startgmtstring Wn print SUB extracted gmt part is day month date hms year n print SUB extracted starttime hh mm ss hms n THE now extract the hh mm ss part to get the hh mm hhmmss split hms hour hhmmss 0 min hhmmss 1 sec hhmmss 2 force two digit for date day of month THE as unix gm
159. GOIOEKKASAI 2 E gt Location F nemejdickraHOUSE Lali inuxLUG 2008 carcincld stufficarcincldE Sept2008 mkhtmlp humi sl m E nj a Xenon5 anaesthesia record system RWD Nickalls dicknickalls doctors org uk Department of Anaesthesia Nottingham University Hospitals City Hospital Campus Nottingham UK mj This page created Thu Jul 10 18 33 25 2008 ie em ftheatredata carcinoidB Sept2006 Graphic record Drug record Log files Programs Gnuplot files Xenons This HTML front end to the Xenon5 anaesthesia record system gives easy access to the data and graphs for the selected operation The graphic data pdf is tabulated according to the page The drug data is a single file which may have several pages All the raw data and all intermediate data files are available as ASCII files The Anaesthetic Record to be placed in the patient files consists of the Graphic and Drug records which are typically printed out in the operating theatre at the close of the operation For some general background see the brief history of the Xenon5 project For more details and full documentation of files programs formats see the Xenon5 project website Microsoft users may well not be able to view PostScript files unless the free Open Source GhostScript utility http www cs wisc edu ghost is installed freely downloadable from the internet However all the PostScript files are accompanied with a PDF equivalent Graphic record The gr
160. IABETES DECISION SUPPORT SYSTEM RWD Nickalls 196 kalarm b c red f home dick file html 14 2 5 Current alarm status The list and status of all current outstanding alarms are displayed in the Kalarm tray tabular listing seen by clicking on the Kalarm icon on the bottom bar The code to place the icon in the bottom bar tray is as follows kalarm tray 14 2 6 Cancelling an alarm The Kalarm command case sensitive for cancelling an existing alarm having the UID 197659548 1073 as shown above is as follows which has the effect of deleting the associated VEVENT environment from the calendar ics file Kalarm cancelEvent KAlarm 197659548 1073 Thus in order to delete an existing alarm event it is necessary to parse the calendar ics file and determine the UID associated with the particular alarm Consequently in order to facilitate identifying the correct UID for an alarm we simply arrange that a only a single alarm exists at any one time and b we include a key word say DIABETES in the text message 14 3 Alarm widget program dn tkalarm pl dick on a diabetes button to set an alarm DIABETES 20 mins DIABETES 30 mins DIABETES 40 mins DIABETES 50 mins DIABETES 60 mins HELP on diabetes Figure 14 1 View of the pop up diabetes support widget Clicking one of the blue diabetes buttons 20 60 mins sets an alert for the associated time interval The three
161. Linux Kalarm utility Tk widgets are used to present a menu which allows the user to quickly set special alerts to prompt regular monitoring of blood glucose A help system allows the user to access protocols for the insulin management of diabetic patients during major surgery 1 4 6 A drug menu module This is a pull down drug menu from which the anaesthetists can select a drugname for addition to the drug record This database is the standard DM D EU drug list database downloaded from the NHS DM D website which is updated weekly The list currently consists of about 2500 drugs CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 6 E Ins file home dick allfiles camomiletop conf2 x displays ll Ele Edt View Bookmarks Tools Settings Help x 4 BB jep RAAS st x displays conf BRRRRRRRRRRRRRR RR ER comment newpage sSS Displays setup displays newdict set class display set widget parent widget top s set widget x 2 set widget y 2 set widget 1lmargin 50 a s N20 exp 40 92 Nset time scale 3600 1 hr CO2 exp 1co 14 CO insp EE set time scale 360 10 min THE ecg 32 a set time scale 420 HR sat 36 sel n EE 157 SWset time scale 4 EE set time scale 840 SEV 4 0 00 set time scale 212 NIBP dia 0 00TVOb a9 set time scale 105 RespR CO2 10 set time scale 720 10 min RespR ECG EED NEU x Wset time scal
162. NE 37 y2 0 7 put sf Huge DESFLURANE at 37 000000 13 700000 def theage j7 text sf large AGE 77 Q1 shift 0 2 0 7 1 A4 text sf large AGE 34 Q1 shift 0 2 0 7 1 put sf large AGE 34 1 at 34 200000 12 300000 hh point Q2 t 40 y1 A44 bottom right corner Q2 40 00000 2 50000 hh text sf copyright RWD Nickalls 2005 1Q2 shift 0 2 0 35 r put sf copyright RWD Nickalls 2005 r at 39 800000 2 850000 hh teat TVsf mathsPIC _ perl Q2 shift 0 2 0 r put sf mathsPIC _ per1 r at 39 800000 3 200000 hh point Q3 35 y1 A4 bottom left side Q3 35 00000 2 50000 A44 text sf macdes034 dvi Q3 shift 0 0 35 1 put sf macdes034 dvi 1 at 35 000000 2 850000 9 hh define the polar rr tt for the urnboxzt MAC labels hh var r9 0 27 A4 r9 0 2 hh var 19 404 degrees hh t9 40 7 hh test Vsf Temperature 7 circ C 37 y1 0 7 put sf Temperature Ncirc C at 37 000000 1 800000 hh test VsfVLarge Age amp temperature corrected iso MAC chart 37 y1 1 4 put sf Large Age amp temperature corrected iso MAC chart at 37 000000 1 100000 J TEE newcommand refs begin minipage textwidth sf Eger EI 2001 Anesthesiology underline 93 947 953 newline sf Nickalls RWD and Mapleson WW 2003 Br J Anaesthesia underline 91 170 174 end minipage hh teat refs 34 yl 2 352 114 put refs 1
163. NE 37 y2 0 7 def theage jj text sf large AGE jj Q1 shift 0 2 0 7 M1 amp theage amp age point Q2 40 y1 bottom right corner text sf copyright RWD Nickalls 2005 Q2 shift 0 2 0 35 Mr text sf mathsPIC _ perl Q2 shift 0 2 0 7 r point Q3 35 y1 bottom left side text sf filename O3 shift 0 0 35 1 define the polar rr tt for the turnbox MAC labels var r9 0 2 var t9 40 degrees text sf Temperature cire C 37 y1 0 7 text sf Large Age amp temperature corrected iso MAC chart 37 y1 1 4 refs newcommand refs begin minipage textwidth sf Eger EI 2001 Anesthesiology underline 93 947 953 newline sf Nickalls RWD and Mapleson WW 2003 Br J A Anaesthesia underline 91 170 174 end minipage text refs 34 y1 2 35 1 newcommand ylegend sf End tidal Desflurane in 100 oxygen air determine string length gt Yunits etc newlength ylength settowidth ylength ylegend 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 CHAPTER 7 AGE amp
164. OR can t find file lt perlprog gt n c Determine the start time The first thing the fields2PDATA p1 script does is to determine the start time by reading the time associated with the first data point in each of the binlog files in the fields directory and selecting the earliest as defining the working start time Armed with a working start time we can then determine an elapsed time for each data event In practice these times are expressed as so called Unix time seconds since 1st Jan 1970 Each line of a typical binlog file is a comma separated data pair where the first item is the Unix time and the second item is the parameter value An example of a typical sat binlog structure is as follows sat binlog sat binlog 1071580231 92 1071580236 92 1071580241 93 1071580246 93 5 1071580251 93 1071580256 93 1071580261 92 5 1071580266 92 The fields2PDATA pl script starts by determining the earliest data entry time for each of the binlog files and then setting this earliest time as the starttimeunix variable It does this by reading only the first Unix time entry in each of the binlog files reading each filename from an array of all such filenames and determining the earliest time It also writes comments to the logfile so we can check its progress if we need to investigate any errors fields2PDATA p1 CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 251 make a
165. PTER 2 DATA PROCESSING IN ANAESTHESIA RWD Nickalls 20 APSF 2001 Information systems in anesthesia http www apsf org resource centre newsletter 2001 summer special issue of the Newslet ter Beecher HK 1940 The first anesthesia records Codman Cushing Surg Gynecol Obstet 71 689 693 Byrne AJ Sellen AJ and Jones JG 1998 Errors on handwritten anaesthetic record charts as a measure of anaesthetic performance during simulated critical incidents British Journal of Anaesthesia 80 58 62 Cushing HW 1902 On the avoidance of shock in major amputation by co cainization of large nerve trunks preliminary to their division With observations on blood pressure changes in surgical cases Annals of Surgery 36 321 345 from Hirsch amp Smith 1986 Cushing HW 1903 On routine determinations of arterial tension in operating rooms and clinic Boston Med Surg Journal 148 250 256 from Hirsch amp Smith 1986 reproduced in Classical File Survey of Anesthesiology 1960 4 419 from Rushman Davies and Atkinson 1996 Ellis RH 1995 The Casebooks of Dr John Snow Wellcome Institute for the History of Medicine p 22 p 30 Fulton JF 1946 Harvey Cushing a biography Charles C Thomas Springfield IL USA Gage JS 2002 Anesthesia Informations Management Systems AIMS ASA Newsletter June 2002 http www asahq org Newsletters 2002 6_02 gage html Hall n B 1990 The value of a
166. Presentation to the Society for Computing and Technology in Anaesthesia SCATA Manchester UK November 12 14 2003 Nickalls RWD and Mapleson WW 2003 Age related iso MAC charts for isoflurane sevoflurane and desflurane in man British Journal of Anaesthesia 91 August 170 174 http bja oupjournals org cgi reprint 91 2 170 pdf Nickalls RWD 19982 Automated data capture the doctor s view Invited talk at an industry workshop on The Medical Information Bus MIB Royal Angus Hotel Birmingham UK June 17 1998 Organised by LinkTech Incorporated Nickalls RWD 1998b TEX in the operating theatre an Anaesthesia application Invited presentation to the Annual UK TEX Users Group meeting Cambridge UK September 21 22 1998 Nickalls RWD 1998c TEX in the operating theatre an Anaesthesia application TUGboat 19 Proceedings of the 19th International TEX Users Group Meeting p 7 9 Torun Poland August 17 20 1998 http www tug org TUGboat Articles tb19 3 tb60nick pdf Nickalls RWD 1997 An Anaesthesia Record keeping System using free text based software SCATA News 6 1 6 Abstract of a presentation to the Society for Computing and Technology in Anaesthesia SCATA Glasgow UK November 21 22 1996 Nickalls RWD 1996 An automated Anaesthesia Record System using free text based software Oral presentation to the 76th International Symposium on Monitoring and Computing in Anaesthesia and Intensive C
167. SSING IN ANAESTHESIA RWD Nickalls 19 added parameters for example real time age corrected MAC Nickalls and Mapleson 2003 Of course commercial information and anaesthesia record systems are available e g the NarKoData system IMESO GmbH Huttenberg Germany see Benson ef al 2000 but they are generally far from ideal For example these systems tend to be extremely expensive and are generally machine specific e g the Datex AS 3 system and are quite awkward to use The existing commercial systems tend to be most useful in collecting what one might loosly call hospital theatre management information while being relatively unhelpful in facilitating anaesthesia related activities or even generating good quality records These latter failings largely account for the poor take up of commercial systems by anaesthetists Computerisation also offers a significant research benefit For example in a study by Muller ef al 2002 anaesthetists were able to search the database of their automated anaesthesia record keeper and establish useful risk factors predictive of subsequent inotropic support requirement following cardio pulmonary bypass 2 3 Databases Extracting data from big databases requires a good data dictionary Sanderson and Monk 2003 as for example the currently well advanced SNOMED Clinical Terms program SNOMED CT http www snomed org snomedct which is a dynamic health care terminology infrastructure being de
168. TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 99 text answer number ylength 37 1 halflength 1 5 2 2223 y units text turnbox 90 ylegend 33 3 y1 y2 y1 2 2 2223 labels at top text sf N _2 O 40 25 y2 0 7 text sf N _2 0 40 98 y2 0 7 text sf 67 40 25 y2 0 7 0 35 text sf 50 40 98 y2 0 7 0 35 newcommand rightylegend sf End tidal Desflurane in N _2 0 text turnbox 270 rightylegend 41 4 y1 y2 y1 2 1 66 MAC 1 6 normalcolor var m 1 6 MAC point A34 34 25 amp etdes 34 25 point A35 35 amp etdes 35 point A36 36 amp etdes 36 point A37 37 amp etdes 37 point A38 38 amp etdes 38 point A39 39 amp etdes 39 point A40 39 75 amp etdes 39 75 color blue drawline A34 A37 color red drawline A37 A40 color black drawpoint A35 A36 A37 A38 A39 text turnbox s16deg boldmath 1 6 A37 polar r9 s16deg t9 deg MACage label def macage jj text sf Marge MAC _ jj A37 shift 0 12 0 8 1 amp macage amp age var m 1 4 MAC point B34 34 25 etdes 34 25 point B35 35 amp etdes 35 point B36 36 amp etdes 36 point B37 37 amp etdes 37 point B38 38 amp etdes 38 point B39 39 amp etdes 39 point B40 39 75 amp etdes 39 75 color blue drawline B34 B37 colo
169. TES alarm sending Kalarm string kalarm b c red no more t 2006 04 26 12 28 Ira erview etting an alert ancelling an alert esting Author i 0005 2 08 DIABETES repeat blood sugar cancelEvent KAlar u 2006 04 27 1 ITU Sliding Scale Run 5 Dextrose at 60 mls hr Run insulin actrapid 1Unit ml at 0 5 Units hr Glucose Insulin rate units hr ersion date 1 2 3 4 5 Figure 14 4 HOWTO use VIEW logfile VIEW calfile DIABETES 60 mins HELP on diabetes Eile Actions Settings Help Jas x Time Repeat Message File or Ci Screen showing in additon the Linux alarm window bottom right which opens by clicking on the alarm icon on bottom bar Location ols Settings Window Help leszna oo A qu EE E gt Location i fle home dick camomile stuff screenshots pngSO snapshot51 png imMSeos5omn x SAT Flo2 CO exp CO insp alarm Alarm On CVP 25 alarm Alarm Oft CVP 18 alarm Alarm On CVP 239 alarm Alarm OT CVP alarm Alarm On BP 271 268 alarm Alarm Of BP 145 105 alarm Alarm On CVP 320 alarmAlarm On BP 297 47 alarm Alarm OMBP 128 45 5 10 Eks Total MAC 103 s DR lage 65 57 1000 a 1 Figure 14 5 Screen showing the pop up diabetes alarm Clicking the close button c
170. Tisoflurane string etisoddp if nitrous 50 ETisoflurane macfrac m40isoxagecorr myage 1 0 05 37 temp nitrousoffset50iso elsif nitrous 67 ETisoflurane macfrac m40isoxagecorr myage 1 0 05 37 temp nitrousoffset67iso else ETisoflurane macfracx m40isoxagecorr myage 1 0 05 37 temp etiso4dp sprintf 4f ETisoflurane string age myage temp temp macFrac macfrac n2o nitrous print ET iso string etiso4dpYn return ETisoflurane CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 129 sub ETsevoflurane calculate et sevoflurane from age macfrac temp my myage temp nitrous macfrac _ print mac temp mac tempNn my m40sevo 1 8 my nitrousoffset50sevo 0 86 my nitrousoffset67sevo 1 16 my ETsevoflurane string etsevo4dp if nitrous 50 ETsevoflurane macfracx m40sevoxagecorr myage 1 0 05 37 temp nitrousoffset50sevo elsif nitrous 67 ETsevoflurane macfrac m40sevoxagecorr myage 1 0 05 37 temp nitrousoffset67sevo else ETsevoflurane macfrac m40sevoxagecorr myage 1 0 05 37 temp Setsevo4dp sprintf 4f ETsevoflurane string age myage temp temp macFrac macfrac n2o nitrous print ET sevo string etsevo4dp n return ETsevoflurane sub ETdesflur
171. ach Gnn now write the timeline xtics string for GNUplot work with unix time seconds gnnstartunix starttimeunix gnn 1 pageseconds SUB colonformattime format 2004 9 23 13 40 29 gnnstarttime colonformattime gnnstartunix make an array mytime tyear tmonth tday thour tmin tsec split gnncolonstarttime mytime split gnnstarttime thour mytime 3 tmin mytime 4 tsec mytime 5 note that the output from colonFormattedTime is hrs and mins are two digits so do not need to add extra zero if lt 10 etc initially but only if later determine the timeSecs ts of the minute lines h thour m tmin 1 add 1 as the first minute mark is the next full minute if m gt 59 m m 460 h h 1 if h gt 23 h h 24 force leading zero of 10 m substr 00 m 2 h substr 00 h 2 ts 60 tsec ti qq h m ts GNUplot xtics format timestring lt space gt x value secs m m 1 if m gt 59 m mA60 h h 1 if h gt 23 h h7 24 m substr 00 m 2 h substr 00 h 2 CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 277 ts ts 60 t2 qq h m ts m m 1 if m gt 59 m m 460 h h 1 if h gt 23 h h7Z 24 m substr 00 m 2 h substr 00 h 2 ts ts 60 t3 qq h m ts m m 1 if m gt 59 m
172. al and MAY occur more than once X prop dispprop 3 the following are all REQUIRED but MUST NOT occur more than once action description trigger duration and repeat are both optional and MUST NOT occur more than once each but if one occurs so MUST the other duration repeat the following is optional and MAY occur more than once x prop 5x emailprop the following are all REQUIRED but MUST NOT occur more than once action description trigger summary the following is REQUIRED CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 188 and MAY occur more than once attendee duration and repeat are both optional and MUST NOT occur more than once each but if one occurs so MUST the other duration repeat the following are optional and MAY occur more than once attach x prop procprop 3 the following are all REQUIRED but MUST NOT occur more than once action attach trigger duration and repeat are both optional and MUST NOT occur more than once each but if one occurs so MUST the other duration repeat description is optional and MUST NOT occur more than once description the following is optional and MAY occur more than once X prop Description A VALARM calendar component is a grouping of component properties that is a rem
173. al calculation of some required variables FIRST calculate the slopes of all lines for mAC1 6 gt 0 6 pi 4 atan2 1 1 r2d 180 pi d2r pi 180 m40 6 6 desflurane MAC40 agecorr 10 0 00269 age 40 agecorr THAN Yodef etdes t mm40 amp agecorr 1 0 05 37 t etdes s1634 etdes 1 6 34 s1640 etdes 1 6 40 s16deg r2d atan 51640 51634 5 6 2 s1434 etdes 1 4 34 s1440 etdes 1 4 40 s14deg r2dxatan s1440 51434 5 6 2 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 95 s1234 etdes 1 2 34 s1240 etdes 1 2 40 s12deg r2dxatan s1240 s1234 5 6 2 s1034 etdes 1 0 34 s1040 etdes 1 0 40 s10deg r2d atan 51040 51034 5 6 2 s0834 etdes 0 8 34 s0840 etdes 0 8 40 s08deg r2dxatan s0840 s0834 45 6 2 s0634 etdes 0 6 34 s0640 etdes 0 6 40 s06deg r2d atan s0640 s0634 5 62 print etdes1634 s51634 Wn print etdes1640 81640 n print slope s16Deg s16deg Wn print slope s14Deg s14deg Wn print slope s12Deg s12deg Wn print slope s10Deg s10
174. alls 226 open outfilei gt destinationfilename1 die ERROR can t create file lt starttime dat gt n print outfilel 44 file name startfile dat created timenowgmt Nn print outfilel file generated by lt launchcam pl gt RWD Nickalls Wn print outfilei file read by lt plotgnnk2 pl gt Nn print outfilel projectdir projdir n use commas no spaces print outfilel starttime timenowunix timenowgmt n no spaces close outfilei1 A typical starttime dat produced by this code is as follows hh Startfile dat created Mon Mar 29 10 26 28 2004 file generated by lt launchcam pl gt RWD Nickalls hh file read by plotgnnh pl projectdir home dick allfiles camomiletop theatredata 2004 Mar 29 1026 starttime 1080552388 Mon Mar 29 10 26 28 2004 Note that we deliberately use commas to separate the key data strings in the last two lines as we can then easily manipulate the data strings using the Perl split command for putting the relevant data strings into arrays Copy required software tools We now copy a suite of files required for the printing process from the datexsim printfiles directory to the pdata directory it 1aunchcam12 p1 now copy all the lt printfiles gt tools to the projdir pdata dir print copying files from datexsim printfiles to project pdata Mn system cp v printfiles projpdatadir print done n Now everything is in
175. ame FindBin Script print logfile this LOG generated by program lt programname gt n timenow localtime print logfile timenow n print logfile Running program name1 programname n print logfile line n print logfile the current starting dir is n system pwd thisdir cwd print logfile thisdir n print logfile line n create the PDATA dir make it PDATA to be different to show that processed via different route create new directory copy this file back to printfiles for safe keeping remember to delete this when finished testing copy processdata pl datexsim printfiles print logfile creating PDATA directory n system mkdir PDATA mkdir PDATA 0744 format mkdir dir mode black book p 283 now check the dir copy all printTOOLS files from datexsim printfiles to PDATA print logfile copying all required printfiles from datexsim printfiles to PDATA n fromdir datexsim printfiles filei fields2PDATA pl CHAPTER 20 PROCESSDATA PL RWD Nickalls 284 copy fromdir filei PDATA if eq print logfile filei file copied OK n else print logfile file1 COPY ERROR n file2 binlog2gnn pl uses Dick s binlog2data pl copy fromdir file2 PDATA if eq print logfile file2 fi
176. an 51640 51634 5 6 2 s1434 etdes 1 4 34 s1440 etdes 1 4 40 s14deg r2d atan 51440 51434 5 6 2 s1234 etdes 1 2 34 s1240 etdes 1 2 40 s12deg r2dxatan s1240 s1234 5 6 2 s1034 etdes 1 0 34 s1040 etdes 1 0 40 s10deg r2d atan 51040 51034 5 6 2 s0834 etdes 0 8 34 s0840 etdes 0 8 40 s08deg r2dxatan s0840 s0834 5 6 2 s0634 etdes 0 6 34 s0640 etdes 0 6 40 s06deg r2d atan s0640 s0634 5 6 2 print etdes1634 s51634 n print etdes1640 51640 n print slope s16Deg s16deg Wn print slope s14Deg s14deg Wn print slope s12Deg s12deg W print slope s10Deg s10deg Wn print slope s08Deg s08deg Wn print slope s06Deg s06deg Wn now to do 67 axis scale age 12 m40 6 6 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 117 agecorr 10 0 00269 age 40 first need to know what Y2 is k2 1 6 m40 agecorr 1 0 05 37 40 increment scales by 0 5 j2 int k2 0 25 0 5 y2 j2 0 5 0 5 print k2 k2 n print j2 j2Wn print y2 y2 n n for left scale 100 02 k1 is ycoord of KHS of isoMAC 0 6 line k1 0 6 m40 agecorr 1 0 05 37 34 j1 int k1 0 25 0 5 y1 j1 0 5 0 5 print k1 K1 Vn print jle 1Nn print y1 yl n n 10
177. an index of anaesthetic potency A typical anaesthetic is associated with approximately 1 1 2 MAC CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 3 Collaboration with Leicester University 2001 During the academic year 2001 2002 I formed a collaboration with the Department of Electronic amp Software Engineering University of Leicester UK with a view to porting the existing program to the Linux operating system and making several enhancements including a module for accessing existing patient data via the City Hospital Informa tion System HIS in conjunction with Andy Smith Department of Information and Computing Technology City Hospital During this period four engineering students worked on parts of the program for their final year practical modules Unfortunately however the relatively short time allowed the students for their project was insufficient for a prototype to be developed and the project terminated after one year Collaboration with Liverpool University 2002 Significant interest in this project was shown by the Department of Clinical Engineering at the Royal Liverpool University Hospital Unfortunately however a joint grant application 2004 to the EPSRC Engineering and Physical Sciences Research Council in conjunction with the Department of Clinical Engineering RLUH to fund research and development was not successful Collaboration with Nottingham Trent University 2005 In December 2005 we expl
178. ane calculate et desflurane from age macfrac temp my myage temp nitrous macfrac _ print mac temp mac tempNn my m40des 6 6 my nitrousoffset50des 3 15 my nitrousoffset67des 4 22 my ETdesflurane string etdes4dp if nitrous 50 ETdesflurane macfrac m40desxagecorr myage 1 0 05 37 temp nitrousoffset50des elsif nitrous 67 ETdesflurane macfrac m40des agecorr myage 1 0 05 37 temp nitrousoffset67des else ETdesflurane macfracx m40des agecorr myage 1 0 05 37 temp Setdes4dp sprintf 7o 4f ETdesflurane string age myage temp temp macFrac macfrac n2o nitrous print ET des string etdes4dp Wn return ETdesflurane sub agecorr calculate age correction factor from age my thisage _ my agecorr agecorr 10 0 00269 thisage 40 return agecorr END__ THES CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 130 7 6 1 Output datafile nacsolver out txt test program Perl5 Linux for MAC age amp temp correction charts c RWD Nickalls October 2008 data generated by prog lt MACsolver pl gt Uses MAC and temp correction data from Nickalls amp Mapleson 2003 and Eger 2001 agecorr 10 0 00269 thisage 40 ETdesflurane macfrac m40des agecorr myage 1 0 05 37 temp nitrousoffset ET
179. ane when used either with or without nitrous oxide The temperature correction data is derived from Eger 2001 and the age correction data from Mapleson 1996 and Nickalls amp Mapleson 2003 DESFLURANE SAO som oxygen air in 100 h Desflurane sueinyseg eP pu3 End tidal ON ut mathsPICpert Lo mac des034 ps RWD Nickalls 2005 5 T T T T 34 35 36 37 is 39 10 Temperature C Age amp temperature corrected iso MAC chart Eger El 2001 Anesthesia and Analgesia 93 047 953 Nickalls RWD and Mapleson WW 2003 Br J Anaesthesia 91 170 174 Figure 7 1 View of a typical age amp temperature corrected MAC chart for desflurane generated by the Perl program macatdes2 pl 92 FOO ANNAN FWY Ha N LL LL 09 Q9 Q9 b2 b2 P2 P2 P2 P2 P2 P2 l2 YS RP SPR ee QV Un I 002 t2 CO iD 00 10 tn EL t2 TO 00 10 tA FW CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 93 It is envisaged that such charts would be printed out on demand by anaesthetists in the operating theatre by selecting the patient age from a simple menu This chart could easily be included in the patient notes along with the rest of the electronic anaesthesia record Alternatively and far better the corrected MAC can be displayed in real time on a computer Itis the purpose of this note to detail the programs and methodology for generating these charts The primary generating programs which are wr
180. aphs are tabulated according to page number and are in both PDF and PostScript formats ine sts al Figure 1 5 Anaesthetic record HTML front end CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 10 ANTON TEGO AN STHESIA RECORD lick on the lt RUN gt Maie Oy ctl button to start the ial aum CAMOMILE anaesthesia program EE EIE Ez al lof1 Figure 1 6 Anaesthetic record graphic record ee EE EER ESE ON DS SI LG Go Bookmarks PageMarks Tools Settings Window Help DO 4 DOgmunune 72z2 ANJESTHESIA RECORD Nottingham City Hospital NHS Trust Patient label Begin Log at 2004 04 29 12 35 15 Note 192 opened logfile home dick allfiles camomiletop theatredata 2004 Apr 29 1 235 base log 2004 04 29 12 35 45 Patient 57 yrs 65 kg 173 cm Male 2004 04 29 12 35 52 Surgeon Mr D Beggs 2004 04 29 8 Anssthetist Dr R W D Nickalls 2004 04 29 12 57 21 Drug Atracurium 20 2004 04 29 Drug Metariminol Smg 2004 04 29 Comment Temp 36 6C naso pharyngeal 2004 04 29 Comment MAC age 1 2 2004 04 29 Comment Epidural 10 mls Bupivicaine fentanyl IN 2004 04 29 Comment CVP 9 2004 04 29 Urine output 45 total 2004 04 29 Comment Start of thoracotomy 2004 04 29 Drug Noradrenaline 2mg S0
181. apter The current version of the program comes as camomilefield2tex 0 1 040411 tgz which expands to tarballs camomilefield2tex 0 1 040411 tar gz To install type do the make install as root CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 228 configure make make install To get the help info type camomilefield2tex help which gives p path path of the project directory f parameter parameter field name o filename output file name s lt style gt output style tex gnuplot V version help this help information Example of use camomilefield2tex p projdir f sat o sat data s gnuplot We use the style gnuplot as this gives simple comma separated fields which can be easily parsed by Perl b Calling the camomilefield2tex c utility The list of required parameter names is held in the array paramname defined at the beginning of the program as follows In fact for thoracic anaesthesia we also need to display the ventilation plateau pressures to be incorporated later it cam2gnnh p1 paramname bp s bp d ecg hr sat 5 o2 insp n2o exp co2 exp tv exp co2 rr vap insp vap exp mac big sat hr cvp nibp s For each parameter name we then generate a datafile by calling the utility program camomilefield2tex the next line then generates all the gnn files by calling the subroutine makeGnnfiles see
182. are in Rotterdam Holland May 1996 3A meeting concerned with the IEEE 1073 Standard regarding computer interfacing to Medical Devices CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 8 e Nickalls RWD and Ramasubramanian R 1995 Interfacing the IBM PC to medical equipment the art of serial communication ISBN 0 521 46280 0 pp 402 Cambridge University Press 1 5 Screen shots Figure 1 3 Program running in Theatre 1 CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 9 E Camomile 0 1 031105 Operation 2003 11 13 11 49 24 GMT Thursday Eile Project Entry Timer View Help ENEAK MaA ceses EN deese a ee SISIE EE Resp 12 Total MAC vapour SEV age 100 1 QM Total Mac Met Sd n dm 2 TIETE Pom aa eiosostioeslgomain 7 Camomile 0 1 031105 0p RO 14 21 5 Figure 1 4 Screen showing full width option for the lower half of the screen Top half shows saturation red blood pressure dark blue ecg heart rate green oximeter heart rate black inspired oxygen red central venous pressure pale blue current values are shown in top right window Bottom half of the screen shows expired CO blue inspired CO red tidal volume TV blue respiratory rate green expired anes agent sevoflurane red and age corrected MAC blue a pe EER ESE R GO
183. arm icon To generate the Kalarm icon just type kalarm at the command line and it will appear on the bottom bar The diabetes alarm depends on the Kalarm scheduling daemon running this can be started using the reset option as follows see also documentation section below kalarm reset 14 2 20 Documentation Online help is available via the command kalarm help all as follows Detailed information is also available from the Kalarm Handbook which can be accessed via the alarm tray widget click on help and also from usr share doc HTML en kalarm index docbook version 0 8 3 Usage kalarm Qt options KDE options options message kalarm kalarm bcilLrstu f URL kalarm bcilLrstu message CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 193 kalarm ilLrtu e commandline kalarm tray reset stop kalarm cancelEvent eventID calendarURL url kalarm triggerEvent eventID calendarURL url kalarm handleEvent eventID calendarURL url kalarm generic options KDE personal alarm message and command scheduler Generic options help help qt help kde help all author V version license Qt options display lt displayname gt session lt sessionId gt cmap ncols count Show help about options Show Qt specific options Show KDE specific options Show all options Show author information Show version information Show l
184. ase data processing and call the Perl coordinating program fields2PDATA pl as follows processdata p1 PDATAdir PDATA chdir PDATAdir b Data processing launch program fields2PDATA pl The data processing is coordinated by the Perl script fie1ds2PDATA pl so the next thing is a first check we are in the correct directory PDATA and if so then to launch CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 267 the program using the system command writing appropriate comments to the logfile as we go processdata p1 check we are in the correct directory print logfile the current dir is n thisdir cwd grab the current working dir print logfile thisdir n now call fields2PDATA pl perlprog fields2PDATA pl print logfile CALLing program lt perlprog gt if e perlprog print Nn CALLing program perlprog n print logfile OK doneM system perl perlprog else print ERROR can t find file lt perlprog gt n print logfile ERROR can t find file lt perlprog gt n c Determine the start time The first thing the fields2PDATA p1 script does is to determine the start time by reading the time associated with the first data point in each of the binlog files in the fields directory and selecting the earliest as defining the working start time Armed with a working sta
185. at Unfortunately the AS 3 amp S 5 monitors use a rather complicated and somewhat con fusing transmission request command a string of 52 bytes to instruct the monitor to output data The frequency of data output every 10 seconds 60 seconds etc is set using bytes 43 and 44 In practice we require data output every 10 seconds for which is encoded using byte 43 OAhex and byte 44 OOhex see below The Transmission Request string which is the one currently used is described below For example In the following PowerBasic code used in my original DOS program the Transmission Request string is assembled by the SUB requeststring which is part of the Datex module This string is sent only once by the Main module soon after system initialisation it sends the string and then waits a maximum of 5 seconds for the first incomming data string before timing out note that the LOC function returns the number of bytes in the receive buffer REM now trigger data output every 10 sec from Datex AS 3 monitor see Chapter 12 in http www nickalls org dick xenon ARS5aD0C2014a pdf CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 30 CALL RequestString REM in DatexAS3 module REM start timer and wait max 5 sec for data to arrive thistime timer DO IF TIMER gt thistime 5 THEN BEEP PRINT No data quiting program SLEEP 1 END END IF REM if data in buffer then continue IF LOC datexAS3comport
186. ate the values associated with the extremes of the lines for 1 6 and 0 6 For example the program generates the following output for age 34 temp 37 macFractionl 6 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 125 ET hal age 34 temp 37 macFrac 1 6 1 24543551525272 ET iso age 34 temp 37 macFrac 1 6 1 94287940379424 ET sevo age 34 temp 37 macFrac 1 6 2 98904523660653 ET des age 34 temp 37 macFrac 1 6 10 9598325342239 and for age 34 temp 40 macFraction1 6 we get ET hal age 34 temp 40 macFrac 1 6 1 43225084254063 ET iso age 34 temp 40 macFrac 1 6 2 23431131436338 ET sevo age 34 temp 40 macFrac 1 6 3 43740202209751 ET des age 34 temp 40 macFrac 1 6 12 6038074143575 The test program is as follows usr bin perl LINUX version book xenon macAT testing MACsolver pl Ht Dick Nickalls Jan 5 2007 HH numerical test prog to calculate correct age amp temp corr mac to serve as a computational check on my MAC age temp graphs w warning switch use warnings use strict use Fatal qw open close for errors with opening closing files use Carp allows croak use Perl6 Builtins qu system use Getopt Long for commandline stuff use version use Cwd grab this dir THE m40 0 75 halothane agecorr 10 0 00269 age 40 ethal mf m40 agecorr 1 0 05 37 t
187. ation from the PostScript file as the following BASH file makepdf sh shows mue makepdf sh echo running makepdf on file 1 tex mathspic 1 m latex 1 mt dvips 1 dvi o 1 ps dvips E 1 dvi o 1 eps determines the BBox gt eps epstopdf 1 eps echo end of run 7 6 Test program MACsolver pl The following Perl test program was written to generate test data for checking the charts against The calculation of the corrected MACage temp of desflurane for a given age temperature and MACfraction uses the following age correction factor Mapleson 1996 Nickalls and Mapleson 2003 agecorr 10 0 00269 age 40 and the 5 linear temperature correction factor Eger 2001 1 0 05 37 temp to correct the MAC ag for desflurane 6 696 Thus for a given MACfraction of 1 6 we have ETdesflurane MAC f rac x MACa4oaes X agecorr age x 1 0 05 37 temp For example if age 40yrs and temp 37 then this reduces to ETdesflurane MAC frac x MAC des X 1 x 1 i e we obtain as expected ET desflurane MAC tion fraction 66 In order to generate the chart for a given agent and age we select particular MACfrac tions 0 6 1 6 and calculate the associated ET concentrations for the temperature range 34 40 for the given age These results are then plotted as a series of striaght lines colour coded centered on the normal temperature 37 As a final check we then use the above program to calcul
188. auses the alarm to close and re appear in 5 minutes Once a blood sugar has been done then a new interval alarm is set by clicking on one of the time option buttons 20 60 minutes on the diabetes widget Chapter 15 Data storage files and formats December 13 2014 allfiles camomile cam book ch camdata tex 15 1 Introduction The Camomile data program generates two groups of stored numeric data known as D data raw data from the Datex monitor and binlog data data consisting of lt UnixTime gt lt parameter value gt pairs one file for each parameter 15 2 Filenames time date encoding The data files associated with each operation are held in a time date encoded directory For example the filename for a record started at 14 34 hrs on 26 November 2001 would be in the directory allfiles camomiletop theatredata 2001 Nov 26 1434 15 3 D data This is the raw data from the Datex AS 3 monitor and is saved to the file port 0 dnn in the main operation directory allfiles camomiletop theatredata 2001 Nov 26 1434 port 0 dnn Each data record consistes of 321 bytes and is saved as a comma separated string of 8 bit ASCII codes 000 255 The format of the D data is as follows note that each 5 second data episode is formatted into blocks of 19 lines each line starting with an identifying code sequence A83000 483018 The first line of each block gives the time and date information A8300 14 40 19 23 09 2004 d
189. be only two items nitems value 1 print no of items in the line nitems n time value 0 parametervalue value 1 determine the least time J file counter if j 1 starttimeunix time else if time lt starttimeunix starttimeunix time only require the first UNIXtime from this file if n 1 last n is line counter end of line loop end of file loop close fieldsfile print printlog finished reading all the binlog files n d Decode the Unix start time local time The start time in Unix time is required later by the subroutine makegnnfiles in the script binlog2gnn p1 in order to be able to split up the data files created by the script binlog2data p1 into one page data files files containing data which will be typeset on a single page of the Anaesthetic Record We now decode the Unix start time fields2PDATA pl starttimeunix has been determined above starttimegmt localtime starttimeunix originalgmt starttimegmt needed for printing header on anaes sheet below print printlog starttimeunix starttimeunix Nin print printlog starttimegmt starttimegmt Wn print printlog n now put the starttimeGMT into an array Sa Se a Se ee ee es note the main items are lt space gt separated except hh mm ss format is Sun Jan 25 13 24 35 2004 format is Sun Jan 5 13 24 35 2
190. brackets at the end of each line as a guide to the number of decimal places to use for the final parameter value always either only the integer or 1 decimal place Note a that bytes 1 41 are part of the data header b bytes 278 317 are not allocated at present c the FirstWord bytes 2 3 and LastWord bytes 318 319 are always the same number d the checksum is an 8 bit unsigned integer of the sum of all bytes including start AND stop flags need to check this CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 38 Table 4 5 Parameter definitions for Datex AS 3 Position bytes Name Unit Div Description 2 3 2 FirstWord total bytes excluding start amp stop amp lt checksum gt 318 4 1 stringNumber gives the no of strings since start 5 1 AS3version software interface version 2 42 45 4 TIMEabsolute secs 1 Time in secs since 1 1 1970 871550923 46 49 4 ECGstatus ECG status 50 51 2 ECGlabel ECG label 52 53 2 HRecg min 1 ECG Heart Rate 63 54 55 2 ST1 mm 100 ST depression 1 1 6 56 57 2 ST2 mm 100 ST depression 2 1 6 58 59 2 ST3 mm 100 ST depression 3 1 6 60 61 2 RRecg min 1 Respiratory rate 15 62 65 4 BPIstatus Inv Press 1 status 66 67 2 BPllabel Inv Press 1 label 68 69 2 BPls mmHg 100 Inv Press 1 systolic 120 70 71 2 BPld mmHg 100 Inv Press 1 diastolic 80
191. by Camomile we have to wait until camomile terminates before sending the lt starttime gt file to the new projdir pdata dir which will contain all the NEW processed data all the original collected data is in the projdir fields directory lt starttime dat gt file only needed for the printing ie after running Camomile THE write the starttime file to the projdir pdata dir first need to create the new pdata dir projpdatadir projdir pdata mkdir projpdatadir now write the starttime dat file into the pdata directory print writing the lt starttime dat gt file to pdata dir n destinationfilename1 projpdatadir starttime dat print lt starttime gt destinationfilenamel destinationfilename1 Wn open outfile1 gt destinationfilename1 die ERROR can t create file lt starttime dat gt n THE print outfile1 file name startfile dat created timenowgmt Wn print outfile1 2576 file generated by lt launchcam pl gt RWD Nickalls Wn print outfile1 file read by plotgnnk2 pl Wn print outfile1 projectdir projdir n use comma separation amp no spaces print outfile1 starttime timenowunix timenowgmt n no spaces close outfile1 THE now copy all the lt printfiles gt tools to the projdir pdata dir print copying files from datexsim printfiles to project pdata directory Wn system cp v pri
192. can t create file gnnheader dat Wn HH timenow localtime print outfile5 gnnheader dat created timenow n print outfile5 file generated by lt plotgnnk2 pl gt RWD Nickalls n fname anes gnn dvi print outfiled header starttimeunix originalgmt fname n note that here originalgmt starttimegmt close outfile5 CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 297 print lt gnnheader dat gt done n ae EE EER N Eg print printlog running LATEX on prtanes6 tex n system pslatex prtanes6 tex use pslatex dvifilename anes gnn dvi copy the dvi file to have a gnn dvi filename system cp v prtanes6 dvi dvifilename make the ps files psfilename anes gnn ps system dvips dvifilename o psfilename print printlog LATEX done n make the pdf files system pdflatex prtanes6 tex use pslatex pdffilename anes gnn pdf copy the pdf file to have a gnn pdf filename system cp v prtanes6 pdf pdffilename a view the output graphs i system gv psfilename show the dvi file on the screen system xdvi dvifilename now send file to the printer system dvips dvifilename HHHHHH goto OUTLINE dbebeekeeeeeieeoookek print the dvi file to printer system dvips prtanes6 dvi process the prtdrug stuff
193. chloride Normal Saline 0 9 has been put on the list just now drugi Saline 0 9 drug2 Sodium chloride Saline 0 9 has been put on the list just now drugi Bicarbonate 8 4 drug2 Sodium bicarbonate Bicarbonate 8 4 has been put on the list just now drugi Sodium bicarbonate 8 4 drug2 Sodium bicarbonate Sodium bicarbonate 8 4 has been put on the list just now HAS4 5 Human albumin solution 4 5 has been put on the list just now drugi Hartmans solution drug2 Sodium lactate Hartmans solution has been put on the list just now Blood packed cells has been put on the list just now drugi Magnesium drug2 Magnesium sulphate Magnesium has been put on the list just now drugi Potassium drug2 Potassium chloride Potassium has been put on the list just now drugi Thiopentone drug2 Thiopental Thiopentone has been put on the list just now dmd addname 10170311000001108 Cryoprecipitate is ALREADY on the VIM list CHAPTER 13 DRUG DICTIONARY RWD Nickalls 184 dmd addname 77856005 Esmolol is ALREADY on the VIM list 13 12 Final list for pull down menu Finally the program outputs a list suitable for the Workstation program and which is input on startup In practice we left the list as the complete list and were intending to make a special anaesthesia subgroup for use with the workstation Although this was not finished in practice the pull down menu was fast enough for us t
194. ckalls 260 first make sure the gnn string has three characters if gnn lt 10 gnn 0 gnn define the graph heights smallheight 0 43 for all other graphs now create the sat file open satfile gt plot sat gnu Idie ERROR can t open plot sat gnu file n print satfile usr bin gnuplot n print satfile plot sat gnu script made by plotgnnk2 pl n print satfile set terminal latex Wn print satfile set output plot sat pic Nn print satfile set size 1 40 smallheight Wn print satfile set xtics timeline Nin print satfile set ytics 80 90 100 n print satfile set y2tics 80 90 100 n print satfile set nokey n print satfile set grid n print satfile xmin 0 xmax 3600 n print satfile ymin 80 ymax 100 n print satfile plot xmin xmax ymin ymax n satfilename sat g gnn fo2filename o2 insp g gnn if e satfilename print satfile satfilename using 1 2 with linespoints 4 8 n else print printlog no sat gnn files n if e fo2filename print satfile fo2filename using 1 2 with linespoints 4 else print printlog no fo2 gnn files n dummyline 20 with lines 1 dummy line print satfile dummyline in close satfile It is significant here that in the last few lines of this code we have used the line print bpfil
195. ckalls 290 iit extract the separate hh mm ss values start times split st starthour start time 0 startminute start time 1 startsecond start time 2 print printlog graphs extracted start hour min sec are starthour startminute startsecoi now print all the graphs for all Gnn files from O1 to GnnMax for gnn 1 gnn gnnmax gnn gnn 1 1 print printlog EET print printlog starting FOR NEXT loop with Gnn gnn gnnMax gnnmax n the xtics line is different for each Gnn print starthour startminute startsecond Mn determine time in secs to the begining of next full hour deltah 3600 startminute 60 startsecond print printlog deltah deltah n generate correct start hour depending on Gnn value h starthour gnn hminusi h 1 hplusi h 1 if h 0 hminus1 23 if h 23 hplus1 0 q 900 qq 1800 qqq 2700 qqqq 3600 force 24hour clock if h lt 10 h 0 h if hminus1 lt 10 hminusi 0 hminusi if hplus1 10 hplusi O hplusi deltahminusqqqq deltah qqqq deltahminusqqq deltah qqq deltahminusqq deltah qq deltahminusq deltah q deltahplusqqqq deltah qqqq deltahplusqqq deltah qqq deltahplusqq deltaht qq deltahplusq deltah q t1 qq hminusi 00 deltahminusqqqq t2 qq hminusi 15 deltahminusqqq t3 qq hminusi 30 deltahm
196. code A CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 215 while VIEWFILE S text insert end MainLoop close VIEWFILE else croak errormessage code B Y T end 14 7 Error message widget program dn errorbox pl usr bin perl w RN errorbox pl modified from rntkalarm pl my thisprog rn errorbox pl to define this program name in error messaages THE RWD Nickalls April 26 2006 message boxes for Xenon Useful books page 301 Perl core languages Little Black Book TE usage perl dn errorbox pl in error message is requires use of the explicit in tag TE BOOK Mastering Perl Tk by Lidie S and Walsh N O Reilly 2002 to get FullScreen mode at startup p 307 geometry widthXheight Xoffset Yoffset NO spaces page 409 perl tklaunch2 pl geometry 1028x768 0 0 page 409 system perl tklaunch2 pl geometry 300x400 50 300 Y E use Tk use Carp use Fatal use Getopt Long gets options from command line see my prog diabetes2 pl get the commandline options using Getopt Long Perl best practice p 309 to allow an Input filename to view my message my options_okay GetOptions in s gt message in option expects a string usage perl rn tkviewer pl in filename Ht if
197. ct format home dick allfiles camomiletop theatredata test Y M D h m include projectdir conf 44 has the new dirs from launchcam pl CHAPTER 12 CONFIGURATION FILES RWD Nickalls 160 set title project format Operation Y M D h m s S W set app htmlbrowser konqueror s set class main newinstance hh popdict comment newpage SS Configure Dialogs newdict set class lists 4 set subclass people 7 include u peoplern conf A Vnewinstance popdict hh newdict set class lists hhh set subclass drugs include u drugsrn conf Vnewinstance popdict Aheof 12 4 projectdir conf hh projectdir conf created Mon Mar 1 19 15 50 2004 file generated by lt launchcamX pl gt RWD Nickalls this file to be input by conf2 x configRN conf set path project format home dick allfiles camomiletop theatredata 2004 Mar 01 1915 Khon sss LERE 12 5 w monitor datexas3 conf hh widgets conf mods 11 4 3 initial hhhhhhhhhhh AA lh hhhhhhhhhhhhhhhhhhhhhhhhlh ode loh dn 44 Ports hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh CHAPTER 12 CONFIGURATION FILES RWD Nickalls 161 comment newpage SSS Datex AS 3 newdict set widget parent widget monitors set class port set port parity E set port stopbits 1 set port databits 8 set port baud 19200 4 set reader rate 5000 read at 5s block set widget x
198. cular J status 264 265 4 NMJlabel Neuromuscular J label 266267 2 NMJtI 10 Train of 4 T1 34 268 269 2 NMjtratio 10 Train of 4 ratio 34 270 271 2 NMjJptc Post tetanic count bit encoded 272 273 2 HRecg2 min 1 ECG Heart Rate 63 274 275 2 HRmax2 min 1 ECG Heart Rate max 63 276 277 2 HRmin2 min 1 ECG Heart Rate min 63 318 319 2 LastWord total bytes excluding lt start gt amp lt stop gt amp lt checksum gt 318 320 1 lt checksum gt 4 6 Example of data output The following Datex AS 3 S 5 output data string was received during an operation and saved in the following D data format decimal of 18 lines of decimal codes each with a leading AS3nn header For details of the D data format see Chapter 15 page 219 AS301 126 062 001 111 005 000 000 166 052 241 058 000 000 000 000 000 000 000 AS302 000 001 000 074 255 097 220 044 000 000 000 044 000 000 000 189 189 032 AS303 000 189 189 032 000 166 052 241 058 019 048 000 000 000 034 067 000 021 AS304 000 001 128 001 128 001 128 003 000 000 000 001 000 062 058 231 028 049 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 41 A8316 141 001 128 067 000 066 000 000 000 000 000 189 189 001 128 000 000 000 A8317 000 013 000 002 128 002 128 002 128 001 128 000 000 000 000 014 000 002 A8318 128 002 128 002 128 001 128 000 000 000 064 081 000 222 126 For example one of the Datex AS 3
199. d drugname drugcode hash my addlist Drug1 drug2 Atropine Drug2 just array my addname my novalue 0 foreach addname addlist print addname Wn if exists dmd addname print dmd addname Wn print logg drugname xxx is ALREADY on the VTM listNn print addname is ALREADY on the VIM list n j else dmd dmd addname novalue add new drugname drugcode pair to the hash push udrugname addname f add new drugname only to the Unsorted drugname array print logg drugname has been put on the list just nowNn print addname has been put on the list just now n print n foreach addname udrugname print addname n 13 11 Logfile generated by add2list pl rnalarm log Sun May 14 22 12 16 2006 Unix 1147641136 log of my Perl rnalarm3 pl program reading the infile file line by line adding drugs from the LOCAL list dmd addname 9885311000001102 Adrenaline is ALREADY on the VIM list dmd addname 9873211000001103 Atracurium is ALREADY on the VIM list CHAPTER 13 DRUG DICTIONARY RWD Nickalls 183 Frusemide has been put on the list just now drugi Dextrose saline drug2 Glucose Sodium chloride Dextrose saline has been put on the list just now drugi Normal Saline 0 9 drug2 Sodium
200. d type the following at the commandline perl processdata pl In due course the script will be made to take the PATH of the operation directory as a parameter in which case the user will type something like the following from any location or even within a script perl processdata pl camomiletop theatredata 2005 Sep 23 1342 The key steps performed by this module are as folows the relevant program script is shown in a box e Create a sub directory called PDATA processdata pl e Move key files into the PDATA sub directory processdata pl e Determine the start time of data collection fields2PDATA pl e Convert the Unix time in binlog files local time in data files binlog2data pl e Split up the data files into 1 hr gnn files binlog2gnn pl e Convert the gnn files into GNUplot scripts for plotting binlog2gnn pl e Run gnuplot to generate the separate graphs in IATEX format e Run BIEX to typeset the graphs and keyboard entry log tex as the anaesthetic record We now address the printing process in some detail covering the various steps from the raw binlog files output by the Camomile data module to the production of the paper endpoint the Anaesthetic Record which is placed in the patient notes The full code of the eight or so Perl programs is listed in the subsequent chapters CHAPTER 18 PRINTING THE STAN
201. deg Wn print slope s08Deg s08deg Wn print slope s06Deg s06deg Wn THE now to do 67 axis scale tHi age 12 m40 6 6 agecorr 10 0 00269 age 40 first need to know what Y2 is k2 1 6 m40 agecorr 1 0 05 37 40 increment scales by 0 5 j2 int k2 0 25 0 5 y2 j2 0 5 0 5 print k2 k2 n print j2 j2 n print y2 y2 n n for left scale 100 02 k1 is ycoord of KHS of isoMAC 0 6 line k1 0 6 m40 agecorr 1 0 05 37 34 j1 int k1 0 25 0 5 y1 j1 0 5 0 5 print k1 K1 n print jle j1 n print y1 yl nn k int y2 0 5 make string A 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 96 string100a ticks withvalues string100b at for j y1 j lt y2 0 15 j j 0 5 problem with j lt y2 looses last cycle hence use fix j lt y2 0 15 print j j n format values to 1 decimal place vv sprintf 1f j if vv 0 0 vv 0 string100a string100a vv string100b string100b j y string100a string100a
202. des 38 point E39 39 amp etdes 39 point E40 39 75 amp etdes 39 75 color blue drawline E34 E37 color red drawline E37 E40 color black drawpoint E35 E36 E37 E38 E39 text turnbox 10 5817540253587 boldmath 0 8 E37 polar r9 10 5817540253587 t9 deg var m 0 6 MAC point F34 34 25 amp etdes 34 25 point F35 35 amp etdes 35 point F36 36 amp etdes 36 point F37 37 amp etdes 37 point F38 38 amp etdes 38 point F39 39 amp etdes 39 point F40 39 75 amp etdes 39 75 color blue drawline F34 F37 color red drawline F37 F40 color black drawpoint F35 F36 F37 F38 F39 text turnbox 7 97587571582933 boldmath 0 6 F37 polar r9 7 97587571582933 t9 deg now draw all the horizontal dashed lines setdashes linethickness 0 4pt var w1 34 1 left end of dashed lines var w2 39 85 right end of dashed lines point L16 w1 ycoord A37 point R16 w2 ycoord A37 point L14 w1 ycoord B37 point R14 w2 ycoord B37 point L12 w1 ycoord C37 point R12 w2 ycoord C37 point L10 w1 ycoord D37 point R10 w2 ycoord D37 point L08 w1 ycoord E37 point R08 w2 ycoord E37 point L06 w1 ycoord F37 point R06 w2 ycoord F37 drawline L16 R16 L14 R14 L12 R12 L10 R10 L08 R08 L06 R06 linethickness 1pt Vsetsolid A normalcolor endpicture end document CHAPTER 7 AGE amp
203. des m variable x 1 1 variable x2 x advance 2 1 point h x2 2 475 1 2 475 text MAC h put MAC at 1 2 475 vertical diff 0 29 units 0 28 variable d 0 29 29 variable h6 0 88 88 0 9 text fbox 0 cdot 6 x h6 put fbox 0 cdot 6 at 1 88 variable h8 h6 advance d 1 17 text fbox 0 cdot 8 x h8 put fbox 0 cdot 8 at 1 1 17 variable h10 h8 advance d 1 46 text fbox 1 cdot 0 x h10 put fbox 1 cdot 0 at 1 1 46 variable h12 h10 advance d 1 75 text fbox 1 cdot 2 x h12 put fbox 1 cdot 2 at 1 1 75 variable h14 h12 advance d 2 04 text fbox 1 cdot 4 x h14 put fbox 1 cdot 4 at 1 2 04 variable h16 h14 advance d 2 33 text fbox 1 cdot 6 x h16 put fbox 1 cdot 6 at 1 2 33 newcommand myleft framebox begin minipage 29mm Vcentering End expired in 100 oxygen end minipage 196 1 text myleft 45 2 0 put myleft at 45 2 newcommand myrightb 96 fbox begin minipage 4cm End expired in 67 hspace 8mm 50 N _2 0 hspace 7 5mm N _2 O end minipage 1 end of newcommand text myrightb 102 2 657 1 was 2 6 put myrightb 1 at 102 2 657 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 74 newcommand mybottom Age years
204. ding on the par ticular keyboard entries made during the operation Small is beautiful An automated system for data collec tion display and printing has clear advan tages over the usual hand written method it is certainly a more accurate record and physiological data can be sampled much more frequently Furthermore keyboard entry of drugs and other information can be made simple and fast by careful design of the interface Since this is a specific stand alone ap plication it is possible to use a much cut down version of IATEX consisting only of the essential files fonts and style options required for the application with the effect that the size of the printing module can be made extremely small A not insignificant bonus therefore of using TEX as the type setting engine is that I am able to make use of old 386 PCs having relatively small hard drives which have been discarded by my memory hungry colleagues References 1 Nickalls RWD and Ramasubrama nian R 1995 Interfacing the IBM PC to medical equipment the art of serial communication Cambridge University Press Cambridge UK pp 402 ISBN 0 521 46280 0 http www cs dartmouth edu gnuplot_info html CHAPTER 3 TEX IN THE OPERATING THEATRE RWD Nickalls 25 ANAESTHETIC SHEET Theatre 1 City Hospital Nottingham UK DATE OPERATION ANAESTHETISTS SURGEONS 18 August 2000 Laparotomy RWD Nickalls et al JOHN DOE dob A
205. dot 6 1 cdot 8 2 cdot 0 2 cdot 2 2 cdoth 4 at 0 60 0 80 1 00 1 20 1 40 1 60 1 80 2 00 2 20 2 40 Vaxis bottom ticks withvalues 0 10 20 30 40 50 60 70 80 90 100 at 0 10 20 30 40 50 60 70 80 90 100 Vaxis right using N2O 6796 shift 0 7523 ticks withvalues 0 O0 cdot 2 0 cdot 4 0 cdot 6 O cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 at 0 7523 0 9523 1 1523 1 3523 1 5523 1 7523 1 9523 2 1523 2 3523 extra 50 right axis shift 0 5614 since this axis is off the graph then need new paper command but do not use axis option paper units 0 7mm 3 818181cm xrange 8 121 yrange 0 5614 2 3614 axis right seconds right axis for 50 oxygen shift 0 5614 ticks withvalues 0 O cdot 2 O cdot 4 0 cdot 6 0 cdot 8 V 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 1 cdot 8 at 0 5614 0 7614 0 9614 1 1614 1 3614 1 5614 1 7614 1 9614 2 1614 2 3614 beginSKIP newcommand thickline setplotsymbol Large newcommand thinline setplotsymbol tiny thickline inputfile isoqdata dat 1 6 thinline CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 64 inputfile isopdata dat 1 4 thickline inputfile isondata dat 1 2 thinline inputfile isomdata dat 1 thickline inputfile isokdata dat 0 8 thinline inputfile isojdata dat 0 6 endSKIP from mac des
206. ds elapsed time parameter value unix time which are space separated In this example the data was collected every 30 40 seconds or so and the elapsed times are seen to be 31 76 121 etc The unix time field is retained as a check The 03 in the filename extension g03 indicates that it represents data collected during the third hour sat g03 31 87 500000 1080559619 76 88 000000 1080559664 121 89 500000 1080559709 166 93 000000 1080559754 211 94 500000 1080559799 256 95 000000 1080559844 301 95 000000 1080559889 346 95 000000 1080559934 391 95 000000 1080559979 436 94 500000 1080560024 g The log file timefile txt Concurrently with the previous process the program cam2gnnh p1 creates the timefile dat file which holds the start times for each of the gnn files see below This file is very useful as a check on the functioning of the cam2gnnh p1 program timefile txt 01 1071580301 2003 12 16 13 11 41 bp s g01 02 1071583865 2003 12 16 14 11 5 bp s g02 03 1071587465 2003 12 16 15 11 5 bp s g03 01 1071580276 2003 12 16 13 11 16 sat go1 02 1071583840 2003 12 16 14 10 40 sat g02 03 1071587440 2003 12 16 15 10 40 sat g03 CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 258 h The base log file baselog data After processing all the parameter fields gnn files we then access extract the anaesthetists log file base log using the camomilef
207. e collect name code pairs into a hash dmd dmd drugname drugcode check drugname for reverse and add to listing p lt space gt lt space gt defined above if drugname m print YES the string has a n THE make array of words separated by space my words split drugname clean out remove leading and trailing white space from each string my clean_words foreach delement words delement s s remove leading white space delement s s ft trailing space push clean_words delement my w1 w2 w3 w4 w5 w6 w7 clean words my n clean_words 1 print n n n print string drugname n if n 2 reverse the order REVstring w2 p w1 print REVstring REVstring Wn drugname REVstring push udrugname drugname add to the Unsorted drugname array dmd dmd drugname drugcode add new name code pair to the hash elsif n 3 CHAPTER 13 DRUG DICTIONARY RWD Nickalls 174 only need to have each item first once REVstring w2 p w1 p w3 print REVstring REVstring Wn drugname REVstring push udrugname drugname add to the Unsorted drugname array dmd dmd drugname drugcode add new name code pair to the hash REVstring w3 p w1 p w2 print REVstring REVstring Wn drugname REVstring push
208. e dummyline Mn This is to solve a problem which would arise should one or more of the parameter files not exist as in this situation GNUplot graph plotting would fail since it requires that the final line must not have a comma at the end By using a dummy line which has no comma and only plots a point below the graph 20 and hence is never visibly plotted as the final line we are able to handle the failure of all or some of the parameter lines which therefore can all have a terminal comma CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 261 18 4 Run GNUplot on all the gnu files Once all the gnu files have been written then we run GNUplot on each one to generate each figure in IATEX 2g picture format Each printed sheet has five figures arranged horizontally from top to bottom The legends are on the right hand side so they are not obscured by the binding when placed in the patient notes fields2PDATA p1 print printlog running GNUPLOT on all the gnu files n system gnuplot plot bp gnu system gnuplot plot sat gnu system gnuplot plot fo2 gnu system gnuplot plot co2 gnu system gnuplot plot tv gnu system gnuplot plot vap gnu print printlog GNUPLOT done n 18 5 Write the header line for the printouts Each printed sheet has a header indicating the start time GMT and unix and the dvi filename which indicates which hour the sheet
209. e 36 1 min TV exp j d set time scaler 5 haut n e dick Shell x s Help vapour 0 Ea set width pixel 2 set widget w 891 pushdict Total MAC di 62 TM g A Line 1 Col 0 INS NORM a aSe 2 EE hin AZ camomile 0 1031 fle snome dick all tl dicke locathost to ER CQ 16 27 2002 11 E BP level BP graph and Now Figure 1 2 Screenshot showing the MAC widget in a red alert state Note that the main display screen pushed to the LHS is designed so that all the important minute to minute data and alarm data is positioned on the RHS of the main display screen and so allows the main display screen to be moved towards the left in order to view other data files or images as required In this example a file is opened on the RHS of the PC screen References e Nickalls RWD Dales S and Nice AK 2010 A Linux based anaesthesia worksta tion Invited presentation to the ESCTAIC 2010 conference Amsterdam October 6 9 2010 European Society for Computing and Technology in Anaesthesia and Intensive Care Abstract J Clinical Monitoring and Computing 2011 24 No 2 April http www nickalls org dick xenon rwdnXenon html e Nickalls RWD and Mahajan R 2010 Awareness and anaesthesia think dose think data British Journal of Anaesthesia 104 1 2 http dx doi org 10 1093 bja aep360 e Nickalls RWD 2008 Linux g
210. e set y2tics 80 90 100 n print satfile set nokey n print satfile set grid n print satfile xmin 0 xmax 3600 n print satfile ymin 80 ymax 100 n print satfile plot xmin xmax ymin ymax n satfilename sat g gnn CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 235 fo2filename o2 insp g gnn if e satfilename print satfile satfilename using 1 2 with linespoints 4 8 n else print printlog no sat gnn files n if e fo2filename print satfile fo2filename using 1 2 with linespoints 4 10 n else print printlog no fo2 gnn files n dummyline 20 with lines 1 dummy line print satfile dummyline An close satfile It is significant here that in the last few lines of this code we have used the line print bpfile dummyline Mn This is to solve a problem which would arise should one or more of the parameter files not exist as in this situation GNUplot graph plotting would fail since it requires that the final line must not have a comma at the end By using a dummy line which has no comma and only plots a point below the graph 20 and hence is never visibly plotted as the final line we are able to handle the failure of all or some of the parameter lines which therefore can all have a terminal comma 16 8 Run GNUplot on all the gnu files Once all the gnu files have been written then w
211. e 40 temp 37 macFrac 1 6 n20 67 6 3400 ET des age 40 temp 40 macFrac 1 6 n20 67 7 9240 ET iso age 80 temp 34 macFrac 0 6 n20 0 0 4658 ET iso age 80 temp 37 macFrac 0 6 n20 0 0 5479 ET iso age 80 temp 40 macFrac 0 6 n20 0 0 6301 ET iso age 80 temp 34 macFrac 1 6 n20 50 0 6820 ET iso age 80 temp 37 macFrac 1 6 n20 50 0 9012 ET iso age 80 temp 40 macFrac 1 6 n20 50 1 1204 ET iso age 80 temp 34 macFrac 1 6 n20 67 0 4920 ET iso age 80 temp 37 macFrac 1 6 n20 67 0 7112 ET iso age 80 temp 40 macFrac 1 6 n20 67 0 9304 ET sevo age 80 temp 34 macFrac 0 6 n20 0 0 7165 ET sevo age 80 temp 37 macFrac 0 6 n20 0 0 8430 ET sevo age 80 temp 40 macFrac 0 6 n20 0 0 9694 ET sevo age 80 temp 34 macFrac 1 6 n20 50 1 0508 ET sevo age 80 temp 37 macFrac 1 6 n20 50 1 3880 ET sevo age 80 temp 40 macFrac 1 6 n20 50 1 7252 ET sevo age 80 temp 34 macFrac 1 6 n20 67 0 7508 ET sevo age 80 temp 37 macFrac 1 6 n20 67 1 0880 ET sevo age 80 temp 40 macFrac 1 6 n20 67 1 4252 ET des age 80 temp 34 macFrac 0 6 n20 0 2 6273 ET des age 80 temp 37 macFrac 0 6 n20 0 3 0910 ET des age 80 temp 40 macFrac 0 6 n20 0 3 5546 ET des age 80 temp 34 macFrac 1 6 n20 50 3 8562 ET des age 80 temp 37 macFrac 1 6 n20 50 5 0926 ET des age 80 temp 40 macFrac 1 6 n20 50 6 3290 ET des age 80 temp 34 macFrac 1 6 n20 67 2 7862 ET des age 80 t
212. e IV Calcium Gluconate 10 10 mls 2 25 mMol 4 5 mEq 93 mg Ca IV Calcium chloride 10 10 mls 6 8 mMol 13 6 mEq 272 mg Ca Oral tablets Calcium gluconate lactate carbonate PRECAUTIONS 1 Calcium chloride has THREE TIMES the amount of elemental Ca as same strength calcium gluconate see above 1 dilute in 5 dextrose 50 100 mls if via peripheral vein 2 check plasma Mg treat also if low 3 DO NOT give calcium into a line containing BICARBONATE precipitates white CaCO3 INTERACTIONS 1 If hypomagnesaemia also then will need to correct this also as symptoms of hypocalcaemia are relatively resistant to treatment in presence of low Mg 2 Optimum therapy requires monitoring and correcting Ca Mg PO4 2 ORAL calcium carbonate is converted into a soluble calcium salt by stomach acid and therefore is NOT effective in achlorhydria zd Figure 1 15 Help desk showing the drug info for Calcium CHAPTER 1 AN ANAESTHESIA WORKSTATION 15 ETT 25835 File Edit View en Quit sa EE either a ANAESTHETIC SHEET b in ep Cy Hospital Nottingham UK EI i 7 Dar Tanuary 12 004 S
213. e accurately and hence it has significant medico legal advantages regarding the documentation of patient care partic ularly during complicated and or unstable cases 2 23 Guidelines The Royal College of Anaesthetists has published a summary of what data ought to be collected in addition to the electronic data from the anaesthesia monitors as part of the Anaesthesia Record Adams 1996 building on the work of Lack et al 1994 The extent to which these guidelines are actually being met has also been looked at Smith 1997 The required record set which appears to be emerging consists of a number of fields within the following general categories pre per and post operative information untoward events and hazard flags CHAPTER 2 DATA PROCESSING IN ANAESTHESIA RWD Nickalls 18 2 3 The anaesthesia workstation Much work has gone into studying the anaesthetists s workload Weinger et al 1997 Byrne Sellen and Jones 1998 Leedal and Smith 2005 and it is clear that computer isation would free anaesthetists and nurses from much of the work of documentation e g drug doses procedures measured parameters etc releasing significant amounts of time which could be better spent on direct patient care and vigilance Anaesthesia ITU information and record keeping systems clearly offer the advantage of allowing the anaesthetists and nursing staff to concentrate fully on the patient leading to enhanced vigilance and improved patient
214. e as folows the relevant program script is shown in a box e Create a sub directory called PDATA processdata pl e Move key files into the PDATA sub directory processdata pl e Determine the start time of data collection fields2PDATA pl e Convert the Unix time in binlog files local time in data files binlog2data pl e Split up the data files into 1 hr gnn files binlog2gnn pl e Convert the gnn files into GNUplot scripts for plotting binlog2gnn pl e Run gnuplot to generate the separate graphs in IATEX format e Run BIEX to typeset the graphs and keyboard entry log tex as the anaesthetic record We now address the printing process in some detail covering the various steps from the raw binlog files output by the Camomile data module to the production of the paper endpoint the Anaesthetic Record which is placed in the patient notes The full code of the eight or so Perl programs is listed in the subsequent chapters CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 266 al Create the log file and make new directory processdata pl use Carp better error messages use File Copy for copying files use Cwd for grabbing PATH of current working directory use FindBin gets name of perl script and base dir dH 4 open logfile gt proce
215. e endcode then get another line string print looking for new line string can t find endcode Wn next LINE print dataline Nn end of the input loop reading the INfile THE print no more events found termating now n print n print event string event n HE now add missing drugs if they do not already exist on the VTM list make this be input from a file collect name code pairs into a hash snomed code dmd dname need to make this a subroutine which reads the names from a local list THE add drugs from the LOCAL file print logg adding drugs from the LOCAL list Wn print logg Ww my addname my addnamecode open the input file open my datafile dn drugs2add dat die ERROR can t open drugs2add dat file n newline dataline LINE2 while lt datafile gt next LINE2 if skip comments next LINE2 if skip comments next LINE2 if skip blank lines 3 grab the whole line as a string newline _ chomp newline removes the line ending THE split up the line if present my drugs split newline my clean_drugs foreach delement drugs delement s s remove leading white space delement s s ft trailing space push clean_drugs delement CHAPTER 13 DRUG DICTIONARY RWD Nickalls 176
216. e list just now Wn reset the addnamecode to the default addnamecode print logg n nn close datafile THE THE now print out the arrays and hashes as a check BBook p 74 works OK my key the drug name my value the Snomed code CHAPTER 13 DRUG DICTIONARY RWD Nickalls 177 while key value each Yodmd print key gt value n sleep 1 Hf now print the Unsorted name array my element foreach element udrugname print element n sleep 1 THE now sort the array alphabetically from the Unsorted list udrugname my Gsdrugname Gsdrugname sort a cmp b udrugname now print the sorted name array to the files s means SORTED THE u means UNsorted my n 0 my listnumberz my dnamez my snomed code open my camfile 7 u drugsrn conf new die ERROR can t open CAMfile n foreach dname sdrugname print dname n n n 1 listnumber 0000 n listnumber substr listnumber 4 snomed code dmd dname print to a simple file print outfile2 lt listnumber gt lt dname gt lt snomed_code gt n print sorted order in format for Camomile add drugname print camfile add drugname dname n print camfile add drugname
217. e paper endpoint the Anaesthetic Record which is placed in the patient notes The full code of the eight or so Perl programs is listed in the subsequent chapters 223 CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 224 16 2 The start time A key piece of information required by the printing process is the start time of the operation or in practice the start time of data collection The start time is required for two main reasons as follows e To define the directory name projdir of the current operation so all related information can be stored there The start time is determined by the Perl program launchcam12 pl1 by grabbing the Unix time and Local time This start time is then used to construct a time encoded directory TED by passing the time parameter to the subroutine tedtime resulting in a suitable dirctory string For example a typical TED directory string is as follows 2004 Mar 18 11 23 e To determine the number of 1 hour A4 printed records i e we subtract the start time from the time associated with the last recorded data item The folowing extracts from the Perl program 1aunchcam12 p1 illustrate the relevant steps in making the time encoded directory name it 1aunchcam12 p1 grab the starttime as GMT and Unixtime timenowgmt localtime timenowunix time projdir tedname timenowgmt add the at the end of the dir so Camomile program makes the fields subdirectory p
218. e run GNUplot on each one to generate each figure in BIEX 2e picture format Each printed sheet has five figures arranged horizontally from top to bottom The legends are on the right hand side so they are not obscured by the binding when placed in the patient notes plotgnnk2 pl print printlog running GNUPLOT on all the gnu files n system gnuplot plot bp gnu system gnuplot plot sat gnu system gnuplot plot fo2 gnu system gnuplot plot co2 gnu system gnuplot plot tv gnu system gnuplot plot vap gnu print printlog GNUPLOT doneNn 16 9 Write the header line for the printouts Each printed sheet has a header indicating the start time GMT and unix and the dvi filename which indicates which hour the sheet refers to as follows Record start time Thu Feb 12 12 11 19 2004 unix 1076587879 anes 04 dvi CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 236 This is written to a file header dat as follows and then read back when needed for printing plotgnnk2 pi print writing the lt gnnheader dat gt file to contain header for Anes record Wn open outfile5 gt gnnheader dat die ERROR can t create file lt gnnheader dat gt n timenow localtime print outfile5 gnnheader dat created timenow n print outfile5 4 file generated by plotgnnk2 pl RWD Nickalls n fname anes gnn dvi print outfile5 header s
219. e was therefore almost certainly the only such system in the UK and possibly in the world The theatre program was later rewritten for the Linux operating system using the new Datex Ohmeda AS3 monitors having a much better data stream detailed in the Datex chapter 6 1 1 MAC subroutine MS DOS The agent name and the end tidal concentration output by the Datex monitor were used as inputs for the calculation the MACage 40 values for each agent being stored in simple look up table in the following subroutine written in QuickBASIC 4 5 REM MS DOS program M 1996 QuickBASIC 4 5 B mac n2opercent vapourname etvapour ageofpatient bmac Z M Determines the current value of MAC M using the recent paper by Mapleson BJA 1996 vol 76 p 179 185 M Effect of age on MAC in humans a meta analysis lt M new MAC sub using etn20 M returns the value of BIGMAC bmac M this is the newMAC which works correctly IF etvapour 0 THEN etvapour 001 n2o n2opercent v vapourname vap etvapour A ageofpatient deltaage A 40 BB 00269 SGS5955858858368 lt CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 58 REM REM this MAC sub is called from the end of PLOTVAPOUR sub REM vapour is on Datex Ultima BOO and C04 13 3 data strings REM vapourcode ISO HAL etc when not selected IF v THEN mac40 0 IF v HAL THEN mac40 75 IF v ISO THEN mac40 1 17 IF v
220. ears text mybottom 46 0 12 0 15 text Mootnotesize V copyright RWD NickallsV 2003 19 0 5 text Marge ISOFLURANE 46 2 8 80 draw horizontal dashed lines linethickness 0 4pt equivalent to tiny linethickness 0 6pt half way between tiny and normalsize setdashes var X525 Left X value var x6 100 Right X value var y16 2 3523 var y14 2 1523 var y12 1 9523 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 79 var y10 1 7523 var y08 1 5523 var y06 1 3523 var y04 1 1523 var y02 0 9523 0 7523 0 2 var y00 0 7523 0 7523 point L16 x5 y16 point R16 1x6 y16 point L14 x5 y14 point R14 x6 y14 point L12 x5 y12 point R12 x6 y12 point L10 x5 y10 point R10 x6 y10 point L08 x5 y08 point R08 x6 y08 point L06 x5 y06 point R06 x6 y06 point L04 x5 y04 point R04 x6 y04 point L02 x5 y02 point R02 x6 y02 point L00 x5 y00 point RO0 x6 y00 draw the dashes from Left to Right so have small gap at right axis drawline L16R16 L14R14 L12R12 L10R10 L08ROS8 LO6R06 LO4RO4 LO2R02 LOOROO Vendpicture 9oframebox end document 6 3 4 Output mac iso8t mt code from the previous mathsPIC pro gram ox x mathspic Perl version 1 00 Feb 14 2005 x A filter program for use with PiCTeX Copyright c 2005 A Syropoulos amp RWD Nickalls CHAPTER 6 AGE CORRECTED MAC RWD
221. econd generate correct start hour depending on Gnn value h starthour gnn hminusi h 1 hplusi h 1 if h 0 hminus1 23 if h 23 hplusis0 q 900 qq 1800 qqq 2700 qqqq 3600 force 24hour clock if h lt 10 h 0 h if hminusi lt 10 hminusi 0 hminusi if hplusi lt 10 hplusi 0 hplus1 deltahminusqqqg deltah qqqq deltahminusqqq deltah qqq deltahminusqq deltah qq deltahminusq deltah q deltahplusgaga deltaht gaag deltahplusqqq deltaht qqq deltahplusqq deltah qq deltahplusq deltah q t1 hminusi 00 deltahminusqqqq t2 hminusi 15 deltahminusqqq t3 hminusi 30 deltahminusqq t4 hminusi 45 deltahminusq t5 h 00 deltah t6 h 15 deltahplusq t7 h 30 deltahplusqq t8 h 45 deltahplusqqq t9 hplusi 00 deltahplusqqqq timeline t1 t2 t3 9t4 t5 9t6 t7 9t8 t9 Armed with the time base we can start making write to the gnu files In the following we illustrate the code for writing the sat gnu script file which will be processed by the GNUplot program eventually First we check that the hour value incorporated into the gnn string always has two digits i e 4 04 and hence we obtain g04 and defining the graph height to be used we then open the output file and proceed fields2PDATA p1 CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Ni
222. ee Sonet mes w Oros nx Hele Werb Z AxwTuPSTS RWD Nidal et al 3m adel we Me on the next 2008 Dec24 1423 401 dvi Full size camin tex 200 testing inputtir zm 1E Mdocumentclass a4pa usepackage camomil hegin Figu begin document centering ei strutl First Page 10 Page 5 7prtanes4 tex LaTeXZe 2001 06 01 Prev Babel lt v3 7h gt and hyphenati eque italian portuges rd usr share texmf tex latex Dum Document Class article 2004 usr share texmf tex latex Pagers usr share texmf tex latex usr share texm tex latex Pages10 lOverfull hbox 5 69054pt ti Last plot bp pic plot sat plot tv pic plot vap 1 prtanes4 aux View PS see the transcript file fo Output written on prtanes4 Back Transcript written on prtang prtanesd dvi gt anes 01 0 EER EER ETE NEL GEE Re see gee see es MM SDN This is xdvik 22 40y TlLib rendering on xi WE Xdvi prtan dickGlocalho A file home dici g A a y Ej ii 5 A Ha X mm h Mykwrite 4 IK a i Figure 1 16 Screen showing preview of the Anaesthetic Record about to be printed Chapter 2 Data processing in anaesthesia ch camhist 2 4 Introduction The next significant change in anaesthesia practice will very likely be related to data processing particularly in the areas of smart alarms and decision support While development and take up in the operating theatre is almost imperceptible just now the future surely li
223. ef EntryTimer 1 2 3 4 timeO time1 delay comment newcommand EntryTimerDiabetes 4 count30 3 seconds see Knuth p 118 4 Nn CHAPTER 17 TYPESETTING PROGRAMS RWD Nickalls 243 divide count30 by 60 44 gives the minutes noindent 1 myspace bfseries Timer diabetes review in the count30 mins 4 n hhh note Simon actually has 5 fields for diabetes timer A NdefNEntryTimerDiabetesiis24344 timeO time1 delay comment newcommand EntryAnaesthetist 4 noindent 2 myspace bfseries An ae sthetist 3 n hh 1 2 3 4 type time name comment newcommand EntrySurgeon 4 noindent 2 myspace bfseries Surgeon N 3 n hh 1 2 3 4 type time name comment newcommand EntryPatientEvent 6 noindent 1 myspace bfseries Patient 4 yrs 2 kg 3 cn Ah 1 Q2H SH 4HOHE time mass height age isMale comment newcommand EntryPatientEventJ 7 noindent 1 myspace bfseries Patient 5 yrs 3 kg 4 c ALKIRORSKARSKERT comment time mass height age M F Jobno def Conc 1 2 legend value 81 427 def Dosage 1 2 legend value 81 427 newcommand EntryBloodLoss 3 noindent 1 myspace bfseries Blood Loss 2 3 n h def EntryBloodLoss 1 2 3 time amount comment newcommand EntryUrine 3 noindent 1 myspace bfseries Urine output 2 3 n 4 def EntryUrine 1 2 3 time amount comment newcommand EntryComment 2 noindent 1 myspace bfs
224. eference Manual February 2001 4 2 Serial interface The RS 232 serial data interface is via the so called UPI board see 4 INTERFACING in Datex Ohmeda AS 3 Anaesthesia Monitor Technical Reference Manual Document No 896624 November 1999 4 2 1 Serial port connector The monitors have a MALE 9 pin D type serial port which conforms to the RS 232 E standard The serial port is located at the back of the monitor On the S 5 anaes thesia monitor the RS 232 serial data connector is designated as X8 see 82 3 3 in Datex Ohmeda Document No 8001022 the pin outs are as shown in Table 4 3 Caution The S 5 monitor also has a 9 pin female D connector designated as X4 which is a network interface The serial port allows commands to be sent to the monitor and also allows CTS RTS flow control hardware handshaking via pins 7 and 8 of the serial port CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 28 Table 4 3 Datex AS 3 CS 3 S 5 RS 232 serial port 9 pin MALE D connector Pin No Name Comments 2 RxD Receives data 3 TxD Transmits data LOW on power up 5 GND Signal ground 7 RTS Set HIGH when powered up 8 CTS Can be used to control data flow 4 2 2 Cable connections The wiring configuration for interfacing the Datex AS 3 monitor to a PC is shown in Figure 4 1 e CTS NB not fully checked out for AS 3 Data output from the Datex monitor is usually controlled by influencing
225. emp 37 macFrac 1 6 n20 67 4 0226 ET des age 80 temp 40 macFrac 1 6 n20 67 5 2590 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTSRWD Nickalls 132 7 References Eger EI 2001 Age minimum alveolar anesthetic concentration and minimum alveolar anesthetic concentration awake Anesthesia and Analgesia 93 947 953 has an appendix on temperature correction Mapleson WW 1996 Effect of age on MAC in humans a meta analysis Br J Anaesth 76 179 185 http bja oupjournals org cgi reprint 76 2 179 pdf Nickalls RWD 1999 mathsPIC a filter program for use with PiCTEX EuroTEX 99 Proceedings 1999 p 192 210 http www uni giessen de g029 eurotex99 nickalls pdf Nickalls RWD and Mapleson WW 2003 Age related iso MAC charts for isoflurane sevoflurane and desflurane in man Br J Anaesth 91 170 174 http bja oupjournals org cgi reprint 91 2 170 pdf Syropoulos A and Nickalls RWD 2000 A perl port of the mathsPIC graphics package TUGboat 21 292 7 Syropoulos A and Nickalls RWD 2007 MathsPIC 1 1 http www tex ac uk tex archive graphics mathspic perl A new updated bug fix version February 2007 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTSRWD Nickalls 133 DESFLURANE MO NO 67 50 13 05 L 8 5 12 5 5 9 5 AGE 34 r 8 0 9 0 1204 MAC F 7 5 8 5 1154 Y H 7 0 E a ene Oe AE ee OO uad coc nisi er OP 80 h H 6 5 7 s 1054 fro Mie amp 1004
226. en record on graph paper of the patient s pulse and respiration rate during operations known as the ether chart Beecher 1940 Hirsch and Smith 1986 Apparently this was prompted by a death under anaesthesia in 1893 Rushman 16 CHAPTER 2 DATA PROCESSING IN ANAESTHESIA RWD Nickalls 17 Davies and Atkinson 1996 p 128 In 1901 they started including measurements of the arterial blood pressure using the newly described apparatus of Scipione Riva Rocci 1863 1937 of Turin Cushing 1902 Cushing 1903 Rushman Davies and Atkinson 1996 p 157 Ralph Waters 1936 1942 championed and emphasised the importance of written anaesthetic records and later Noseworthy 1945 produced special cards on which to record anaesthetic details see Rushman Davies and Atkinson 1996 p 111 for an illustration 2 2 2 Automation The first mechanical device capable of printing an anaesthetic record was the Nargraf machine of 1930 developed by EI McKessons Westhorpe 1989 which generated a semi automated record of inspired oxygen tidal volume and inspiratory gas pressure Since then little of real technological significance was developed in the area of anaesthesia monitoring until the 1970s when advances in chip technology gave rise to clinically useful portable electronic devices for measuring such things as arterial and central venous blood pressure breath by breath concentrations of oxygen carbon dioxide and inhalational anaesthetics
227. enerally used and have also been included in the widely used Oxford handbook of anaesthesia Allman and Wilson 2006 6 3 Generating the charts The charts were generated using QuickBasic 4 5 MS DOS Perl and mathsPIC I originally used a QuickBasic program e g iso mac dat see below to generate the agent specific data files for isoflurane sevoflurane desflurane containing the data points for each of the iso MAC curve i e for the curves associated with the MAC values 0 6 0 8 1 0 1 2 1 4 1 6 These data files were coded with the letters j k m n p q For example the following program iso mac bas generated the isoflurane data file isoqdata dat i e the data file for the q iso MAC 1 6 curve for isoflurane In order to generate all the different data files a total of 3 x 6 different data files the program was run many times each run having different values enabled for agent and MAC etc REM new iso mac bas COLOR 15 1 CLS M IF ageofpatient o 1 THEN ageofpatient 1 Z M this MAC sub is called from the end of PLOTVAPOUR sub M vapour is on BOO and C04 13 3 data strings M vapourcode ISO HAL etc when not selected MIFv THEN mac40 0 M IF v HAL THEN mac40 75 M IF v ISO THEN mac40 1 17 M IF v ENF THEN mac40 1 63 M IF v SEV THEN mac40 1 8 M IF v DES THEN mac40 6 6 M mac40 for N2O 104 SGS55888555858885 CHAPTER 6 AGE CORRECT
228. entrydrug xpm 473 Aug 8 2003 entrytimer diabetes xpm 453 Feb 17 2003 entrytimer xpm CHAPTER 11 THE CAMOMILE PROGRAM RWD Nickalls 153 326 Feb 17 2003 filenew xpm 416 Feb 17 2003 fileopen xpm 381 Feb 17 2003 filesave xpm 1266 Feb 18 2003 helpbrowse xpm 2366 Apr 11 2004 main cpp 5703 Apr 13 2004 Makefile am 69286 Apr 13 2004 Makefile in O Feb 17 2003 mini camomile2 xpm 433 Jul 12 2003 out blood xpm 418 Jul 9 2003 out urine xpm 383 Apr 1 2003 projectclose xpm 370 Apr 1 2003 projectnew xpm 367 Apr 1 2003 projectopen xpm 430 Feb 17 2003 projectoptions xpm 1281 Mar 5 2003 start stop xpm 3871 Apr 10 2004 taboutbox cpp 1556 Jun 15 2003 taboutbox h 1808 Apr 10 2004 tapplication cpp 1493 Feb 17 2003 tapplication h 7221 Apr 10 2004 tapplicationsetting cpp 3237 Apr 5 2004 tapplicationsetting h 1723 Aug 20 2003 tcamomilecolor cpp 1432 Aug 20 2003 tcamomilecolor h 1951 Mar 31 2003 tchecksums cpp 1401 Mar 31 2003 tchecksums h 3756 Apr 11 2004 tclock cpp 2087 Apr 10 2004 tclock h 1013 Aug 20 2003 tcolor h 10347 Apr 10 2004 tcommandline cpp 1199 Feb 17 2003 tcommandline h 10954 Apr 13 2004 tdatastore cpp 3616 Apr 13 2004 tdatastore h 9310 Apr 10 2004 tdictionary cpp 3891 Aug 19 2003 tdictionary h 1203 Mar 27 2003 tdimensions h 25392 Apr 10 2004 tdocscript cpp 1259 Mar 6 2003 tdocscript h 1144 Aug 12 2003 tempclass cpp 1156 Aug 12 2003 tempclass h 9156 Apr 13 2004 tentrydrugs cpp 2270 Jul 30 2003 tentrydrugs h 5913 Apr 13 2004 t
229. entrydude cpp 2368 Jun 19 2003 tentrydude h 4710 Apr 13 2004 tentrypatient cpp 1452 Mar 26 2003 tentrypatient h 8588 Apr 10 2004 tentrytimer cpp 1668 Jul 3 2003 tentrytimer h 6943 Jan 23 2004 tfilesystem cpp 2550 Jun 19 2003 tfilesystem h 1225 Apr 13 2004 tguisetups cpp CHAPTER 11 THE CAMOMILE PROGRAM RWD Nickalls 154 1226 Apr 13 2004 tguisetups h 6220 Apr 10 2004 thelpbrowser cpp 1628 Jun 23 2003 thelpbrowser h 4840 Apr 10 2004 ticonfactory cpp 1640 Mar 6 2003 ticonfactory h 2401 Apr 13 2004 tlogevent device event cpp 1704 Apr 5 2004 tlogevent device event h 2592 Nov 21 2003 tlookup vapour cpp 1314 Nov 17 2003 tlookup vapour h 1072 Mar 11 2003 tport cpp 1311 Mar 16 2003 tport h 7129 Apr 10 2004 tportserial cpp 5964 Apr 10 2004 tportserial datex as3 cpp 1810 Dec 3 2003 tportserial datex as3 h 4024 Apr 10 2004 tportserial graseby 3400 cpp 1716 Nov 4 2003 tportserial graseby 3400 h 2486 Aug 29 2003 tportserial h 7358 Apr 10 2004 tproject cpp 3066 Apr 10 2004 tprojectdialog cpp 1497 Mar 6 2003 tprojectdialog h 3242 Apr 10 2004 tproject h 1940 Aug 20 2003 tsampler displaybase cpp 1882 Aug 20 2003 tsampler displaybase h 2255 Aug 20 2003 tsampler display clock cpp 1488 Aug 20 2003 tsampler display clock h 15716 Apr 10 2004 tsampler display dial cpp 1833 Dec 15 2003 tsampler display dial h 20149 Apr 13 2004 tsampler display graph cpp 2681 Apr 13 2004 tsampler display graph h 2529 Apr 10 2004 tsampl
230. er display lcd cpp 1506 Aug 20 2003 tsampler display lcd h 5717 Apr 13 2004 tsampler display log cpp 1438 Aug 20 2003 tsampler display log h 17799 Apr 13 2004 tsampler display nickallsalarm cpp 2130 Nov 24 2003 tsampler display nickallsalarm h 8086 Apr 11 2004 tsampler display nickallsmac cpp 1945 Nov 20 2003 tsampler display nickallsmac h 18135 Apr 10 2004 tsampler display nickallsnow cpp 1886 Nov 24 2003 tsampler display nickallsnow h 12174 Apr 11 2004 tsampler display pumpcontroller cpp 2135 Aug 21 2003 tsampler display pumpcontroller h 3846 Apr 10 2004 tsampler display relaxants cpp 1522 Aug 20 2003 tsampler display relaxants h 28736 Apr 10 2004 tsampler portbase datex as3 cpp 5505 Dec 1 2003 tsampler portbase datex as3 h 17744 Apr 10 2004 tsampler portbase graseby 3400 cpp 2417 Aug 28 2003 tsampler portbase graseby 3400 h 4717 Apr 10 2004 tsampler portbasewidget cpp 2355 Apr 10 2004 tsampler portbasewidget h 5643 Apr 10 2004 twaffle cpp CHAPTER 11 THE CAMOMILE PROGRAM RWD Nickalls 155 2899 Apr 10 2004 twaffle h 6805 Apr 10 2004 twidgetfactory cpp 1943 Mar 16 2003 twidgetfactory h 3348 Apr 11 2004 twidgetfactory port cpp 6181 Apr 10 2004 twidgetfactory widget cpp 1503 Apr 10 2004 twidgetsampler cpp 1885 Mar 27 2003 twidgetsampler h 2843 Apr 11 2004 widgetTimeEntry cpp 889 Apr 11 2004 widgetTimeEntry h 6802 Feb 17 2003 widgetTimeEntry ui 3865 Apr 11 2004 wRelaxants cpp 1155 Apr 11 2004 wRelaxants h 8415 Jun
231. er ylength 37 1 halflength 1 5 2 2223 y units text turnbox 90 ylegend 33 3 y1 y2 y1 2 2 2223 labels at top text sf N 2 0 40 25 y2 0 7 text sf N 2 0 140 98 y2 0 7 text sf 67 40 25 y2 0 7 0 35 text sf 50 26 40 98 y2 0 7 0 35 newcommand rightylegend sf End tidal Desflurane in N _2 0 text turnbox 270 rightylegend 41 4 y1 y2 y1 2 1 66 MAC 1 6 normalcolor var m 1 6 MAC point A34 34 25 amp etdes 34 25 point A35 35 amp etdes 35 point A36 36 amp etdes 36 point A37 37 amp etdes 37 point A38 38 amp etdes 38 point A39 39 amp etdes 39 point A40 39 75 amp etdes 39 75 color blue drawline A34 A37 color red drawline A37 A40 color black drawpoint A35 A36 A37 A38 A39 text turnbox 20 4872294273676 boldmath 1 6 A37 polar r9 20 4872294273676 t9 deg MACage label def macage jj text sf large MAC _ jj A37 shift 0 12 0 8 1 amp macage amp age var m 1 4 MAC point B34 34 25 amp etdes 34 25 point B35 35 amp etdes 35 point B36 36 amp etdes 36 point B37 37 amp etdes 37 point B38 38 amp etdes 38 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 105 point B39 39 amp etdes 39 point B40 39 75 amp etdes 39 75 color blue drawline B34 B37 color red drawline
232. eries Comment N left parbox 10cm 2 right n parbox 10cm 2 n A4 def EntryComment 1 2 time comment header for the prtanes graph file newcommand header 3 vspace 3mm hfill Record start time 2 hspace 5mm unix 1 hspace 5mm 3 hspace 3 3cm vspace 3mm uses the three parameters 1 2 3 unixtime gmttime gnnfilename Aheof CHAPTER 17 TYPESETTING PROGRAMS RWD Nickalls 244 17 3 prtdrug tex hh prtdrug tex testing inputting base file Ndocumentclass a4paper article 4 usepackage camomile record usepackage dvips color graphicx usepackage times usepackage geometry geometry hscale 0 8 vscale 0 7 usepackage url usepackage decimal usepackage prtdrug2 usepackage fancyhdr begin document newcommand patientlabel framebox rule 10mm Ocm 3 3cm hspace 2 2cm Patient label hspace 2 2cm noindent hspace 10 1cm patientlabel vspace 3 5cm noindent hspace 2 3cm color blue LARGE AN AE STHESIA RECORD vspace 3mm noindent hspace 5 2cm textsf Nottingham City Hospital 44 2 3cm noindent hspace 5 0cm hspace 2 27cm color blue textsf NHS Trust vspace 2 2cm vspace 4mm 1 7 4 noindent hspace 2mm vbox 4 begin tabular 11 hline sc Date rule Opt 12pt amp today sc Operation amp hspace 5 5cm NN iNsc Anaesthetists amp RWD Nickalls textitfet al N Z sc Surgeon
233. es 1 and 0 have special side effects as documented in the table on page 11 of the Specification Chapter 5 Interfacing the serial port using Perl ch serialport perl 5 1 Introduction Currently using the Perl programs as3sim pl and dn getfile2 pl Both in the dir aHOUSE perl serial port serial port code testing 5 2 Device SerialPort pm This is a Perl program which allows control of the serial port in Linux I originally used version 1 002 000 and have needed to modify it by adding a new CTS subroutine in order to allow hardware handshaking control via the CTS line This was done simply by copying and modifying the existing sub rts active subroutine sub cts active RWDN Jan 2 2006 return unless _ 2 my self shift return unless self can cts my on yes true shift returns ioctl result my value 10CTL VALUE CTS my rc self ioctl on TIOCMBIS TIOCMBIC V value my rc ioctl self gt HANDLE on bitset bitclear rtsout warn cts active on ioctl n if rc return rc The current version is Device SerialPort 1 04 tar gz available from CPAN 49 CHAPTER 5 INTERFACING THE SERIAL PORT USING PERL RWD Nickalls 50 5 3 Sending program as3sim pl it AS3sim pl sends data from dxdemo3c pl RWD Nickalls Nov 27 2005 use Device SerialPort qw STAT for MS RTS ON functions etc use POSIX use strict use warnings
234. es in computers offering anaesthetists seriously useful facilities and real time information The initial motivation with regard to data handling lay in automating the anaesthesia record However while this technology has been effectively solved for over 15 years see Kenny 1990 the take up by anaesthestists remains almost zero 2 2 History of the anaesthesia record The documentation of events procedures undertaken physiological parameters vital signs which are associated with the process of anaesthesia for example in conjunction with surgery or an intensive care setting is known as the Anaesthesia Record This record serves two main functions namely a medical the moment to moment drug history and vital signs serves as a useful practical aid and b medico legal the anaesthesia record is a legal document in its own right setting out the facts as they unfold during an anaesthetic 22 1 Background Effective surgical anaesthesia was established in 1846 following the discovery of the effects of inhaled diethyl ether ether Although John Snow 1813 1858 Joseph Clover 1825 1882 and Mounier 1855 demonstrated the importance of monitoring the pulse and respiration during anaesthesia Ellis 1995 Rushman Davies and Atkinson 1996 it was not until 1894 at the Massachusetts General Hospital Boston that surgeons Ernst A Codman 1869 1940 and Harvey Cushing 1869 1939 established the practice of keeping a careful writt
235. es in database X Launch CAMOMILE file home dick allfile y 1 S E 3 4 dick localhost More fiehomerdicklalfie s WS 9 ey yl ma Figure 1 8 Screen showing the initial graphic front end right which allows the user to either start the program or access other utilities For example clicking on the epidural button runs the Epidural and Double lumen tube database program shown on the left of the screen which predicts epidural depth and tube length for a given height and weight LE Camomile 0 1 031208 Operation 2004 01 162 09 38 52 GMT Friday pile Be Eile Project Entry Timer View Help ELERTE 50 33 20 Man Eg Alarms 7 Loss WERE Pumps Other stun NEC EE Text alarmAlarm ORR TT Es alarm Alarm Off TV exp 810 coe Win alarm Alatm Off MVoL 8 1 Wop alarm Alanm On CVP 25 MVol alarm Alatm OR CVP 19 alam Alarm On CVP 288 MESS alarm Alam Off CVP CVP alarm Alarm On BP 271 269 alarm Alarm Of BP 145 105 NIBP alarm Alarm On CVP 320 Tempi 3618 alemAlam On BP 287 47 Temp alarm Alatm OTBP 128 45 alarm Alatm Of CVP 15 alarm Alarm On CVP 298 4 H338 7 janaesthetistDick Nickalls sl im voimas Z camomile 61 031208 0p BI dick localhost localdomain em 13 54 seco Figure 1 9 Screen showing the log alarm MAC and trend windows The blood pressure BP is highligh
236. esia application R W D Nickalls BSc PhD MBBS FRCA Consultant in Anaesthesia amp Intensive Care Department of Anaesthesia City Hospital Nottingham UK dick nickalls org Abstract This article describes the author s experience of using TEX for typesetting the Anaes thesia Record as part of an automated data collection system developed for use in the operating theatre TUGboat 19 3 Proceedings of the 19th Inte Poland August 17 20 1998 pp 7 9 rnational TEX Users Group meeting Torun http www tug org TUGboat Articles tbi19 3 tb60nick pdf Introduction Since the theme of this year s confer ence is Integrating TEX with the surround ing world I would like to describe my integration of TEX with the world of the operating theatre specifically with the do main of anaesthesia One of the many things that occupies anaesthetists during an operation is doc umentation This takes the form of a log of various physiological parameters see Figure 1 drugs used blood lost flu ids administered procedures performed etc otherwise known as the Anaesthesia Record Since this is generally a hand Written record the documentation side of things can become rather neglected dur 23 ing busy periods and consequently anaes thetists are increasingly using computers to automate the collection of such data This has many advantages including allowing real time processing of data generation of various de
237. et Yoffset NO spaces xpage 409 perl tklaunch2 pl geometry 1028x768 0 0 page 409 system perl tklaunch2 pl geometry 300x400 50 300 Y see p 233 PerlTK book see TEXT widget p 162 THE T use warnings use strict use Tk use Carp use Fatal to give good failure error messages use Getopt Long for command line see my prog diabetes2 pl get the commandline options using Getopt Long Perl best practice p 309 to allow an Input filename to view my input filename my options_okay GetOptions incs gt Minput filename in option expects a string usage perl dn tkviewer pl in filename HH if Sinput filename eq croak ERROR filename not specified thisprog HH define an error message for use later my errormessage ERROR can t find filename lt input_filename gt thisprog note that this errror messahe must be outside the if statement HH if e input_filename now make the widget my topwindow MainWindow gt new topwindow gt title XENON file input filename my text topwindow Scrolled Text background gt LightGrey default background colour is a very pale grey font gt courier 147 gt pack open my VIEWFILE lt input filename croak errormessage
238. filenumber gt O THEN PRINT data output OK SLEEP 1 EXIT DO END IF SLEEP 1 REM print dots while waiting PRINT LOOP 4 3 2 Transmission request command The structure of the Transmission request command string used in this project is that of type 2 see the correspondence at the end of this chapter and triggers data outout every 10 seconds The following few points are relevant here e The string starts and ends with a 7Eh byte e I have numbered the bytes decimal starting with 1 1 52 e The byte values are given in Hexadecimal h and Decimal d e The bytes are divided up into their functional groups 1 2 4 bytes etc Byte Hex Decimal Description no value value 1 TE 126 Start flag 2 31 49 start of header 3 00 0 Total length 0031h 49d bytes word r len 4 00 0 Reserved set to zero byte resi 5 00 0 Ignored by monitor set to zero byte r dri level 6 00 0 Reserved 0000H byte res2 2 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 31 Transmission time 0x00000000 ignored by monitor when sending transmission request dword r_time However time can be meaningful in outputted messages structure dword r time Main type of record DRI MT PHDB 0 r maintype Offset to the first subrecord 0000H sr desc 0 offset Type of first subrecord DRI PH XMIT REG 0 sr desc 0 sr type Offset to the second subrecord 0000H calculated from the beginn
239. flatex prtanes6 tex pdffilename anes gnn pdf copy the pdf file to include a gnn pdf filename system cp v prtanes6 pdf pdffilename 19 7 Typeset the drug file using IATFX 2e Processing the drug file log file is slightly more complicated owing to the fact that the typesetting is done using IATEX 2g Consequently since the anaesthetists can enter data using the keyboard we need to filter out all non TEX material essentially to escape certain ASCII characters for example we would modify rightarrow etc This conversion is currently done by the Perl program base2texd pl which processes the original log file baselog data to the filtered file baselognew data We now typeset the filtered drug file and create the output formats dvi ps and pdf on the fly as before The TEX file for the graphs is prtdrug tex The style option is prtdrug2 sty We create the PostScript files using dvips We create the pdf files using pdflatex process the baselog data file system perl base2texd pl now latex the prtdrug file system latex prtdrug tex copy the dvi file to have a anes drug dvi filename system cp v prtdrug dvi anes drug dvi make the PS version of the dvi file system dvips anes drug dvi o anes drug ps make the pdf file system pdflatex prtdrug tex copy the pdf file to have a gnn pdf filename system cp v prtdrug pdf anes drug pdf 19 8 Pr
240. flurane word from ylegend push Isoflutane title up push age down 9 documentclass a4paper 12pt article usepackage mathspic usepackage decimal rotating begin document Noddsidemargin 17mm framebox beginpicture use sf font for figures for BJA fontfamily cmss selectfont normalsize linethickness 1 1pt normalsize was 0 9 for BJA my manual p 23 structure copied from mac des m CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 76 ISOflurane Delta for N2O 0 75 66 6666 104 1 17 y units 12cm 2 2 5 454545 paper units mm 5 454545cm xrange 5 100 yrange 0 4 2 6 axes L ticks 10 0 2 paper units 0 7mm 3 818181cm xrange 8 100 yrange 0 4 2 6 want to print only some of the L axis scale 0 6 2 4 so do it manually axis left ticks withvalues 0 cdot 6 O cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 1 cdot 8 2 cdot 0 2 cdot 2 2 cdoth 4 at 0 60 0 80 1 00 1 20 1 40 1 60 1 80 2 00 2 20 2 40 Vaxis bottom ticks withvalues 0 10 20 30 40 50 60 70 80 90 100 V at 0 10 20 30 40 50 60 70 80 90 100 axis right using N2O 6796 shift 0 7523 ticks withvalues 0 O0 cdot 2 O cdot 4 0 cdot 6 O cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 at 0 7523 0 9523 1 1523 1 3523 1 5523 1 7523 1 9523 2 1523 2 3523 extra 50 right axis
241. from the new parameter data file which may contain many hours of data since it contains all the data held in the original binlog file a series of 1 page gnn files suitable for use by the GNUplot graphing program each gnn file generating a single page of the typeset Anaesthetic Record The makegnnfiles subroutine is part of the Perl program binlog2gnn pl which is itself called by the co ordinating Perl program fields2PDATA p1 The subroutine is called with the field parameter name for example bp d or sat hr as follows makegnnfiles paramname j Calling the subroutine makennnfiles converts each of the parameter data files into a series of 1 page duration two column space separated data files suitable CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 255 for accessing by gnuplot For example a 4 hr sat data file would typically be be converted into four page files 1 hour per page as follows sat g01 sat g02 sat g03 sat g04 generally known at the gnn files The makegnnfiles subroutine also generated an elapsed time for each data point within each page file relative to the beginning of each page typically each hour by using the new computed start time for each page file as the zero time i e the elapsed time within a 1 hour gnn file will run from 0 3590 secs i e just 1 hour per page in this case We have three space delimited fields namely elapsed time local parameter uni
242. g fields mac n20o binlog fields mac vap binlog fields mv exp binlog fields n2o exp binlog fields nibp d binlog fields nibp s binlog fields o2 insp binlog fields pplat binlog fields sat binlog fields sat hr binlog fields temp 0 binlog fields temp 1 binlog fields tv exp binlog fields tv insp binlog fields vap code binlog fields vap exp binlog fields vap insp binlog get each binlog file in turn and read the first line for UNIXtime for j 0 j lt fieldfilename j j 1 1 ifile fieldfilename jl if e ifile open fieldsfile lt ifile die ERROR can t open file ifile n else print printlog ifile does NOT exist n next print reading the fields file lt bp d binlog gt to access UNIX time n n 0 line counter LINE while lt fieldsfile gt next LINE if skip comments next LINE if 4 skip 4 comments next LINE if skip blank lines grab the whole line as a string dataline _ n n 1 increment line counter CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 269 chomp dataline removes the line ending print the line to the log file print printlog dataline filename ifile n print the line is dataline n place the two params into an array value split dataline get no of items should
243. g2gnn pl which is itself called by the co ordinating Perl program fields2PDATA p1 The subroutine is called with the field parameter name for example bp d or sat hr as follows makegnnfiles paramname j Calling the subroutine makennnfiles converts each of the parameter data files into a series of 1 page duration two column space separated data files suitable CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 272 for accessing by gnuplot For example a 4 hr sat data file would typically be be converted into four page files 1 hour per page as follows sat g01 sat g02 sat g03 sat g04 generally known at the gnn files The makegnnfiles subroutine also generated an elapsed time for each data point within each page file relative to the beginning of each page typically each hour by using the new computed start time for each page file as the zero time i e the elapsed time within a 1 hour gnn file will run from 0 3590 secs i e just 1 hour per page in this case We have three space delimited fields namely elapsed time local parameter unix time The subroutine works out how to split up the data file into 1 page chunks of 1 page time periods by using the difference between the operation start time and the unix time on each line of data Note that the Unix start time was passed to the binlog2gnn p1l program by the calling program fields2PDATA p1 If the elapsed time exceeds the pa
244. ge AN Other et al Hosp No 123456789 Nightingale Ward 24 01 1925 OTA 200 150 LR ERA S06 eo a a BP dias o booeoge99go d a A 5 M AS P ad 5 MUS CVP iue OSL eee 50 Par qmd sula e 20 o ee ETES 09 30 09 45 10 00 10 15 100 ioo 6 5 00 0 90 B0 9 0 00095 OLD DOOYOO ao 9 a Te S o Sato 90 9 Dil O2 o 80 09 30 09 45 10 00 10 15 70 GREASE SS ES ES GE FETS N20 AO EED e 9 9e 0 0 9 00 veo Oe 30 Pr lings DS E j9 0 0 0 0 0 PERI 2196 EA SE EL EL RD AA ER MIE IM OE EE 10 09 30 09 45 10 00 10 15 8 CO 6 599999 expo veo OO p OO OOOO OOOO 909999 09990097 GOO OOOO G 4 oo o insp 2 09 30 09 45 10 00 10 15 Tidal vol pesi idal vo 0 1000 mls DO Ee BUE Resp rate e JOGE 0 20 min m 09 30 09 45 10 00 10 15 4 Isoflurane 3 np 5 exp 1 ooo Total
245. ge duration the default is 1 hour then the current gnn file is closed and the next one opened etc In practice however the default sampling interval is 45 second intervals this interval can be easily varied depending on the graph plotting typesetting requirements So although the original binlog data accumulates every 5 seconds from the Datex AS 3 monitor the actual printed data is typically thinned out somewhat purely because there is a limit to the density of data which can usefully be printed on the Anaesthesia Record If better resolution is required then higher resolution printing can be performed at a later date by making both the sampling interval and the page duration shorter for example we could plot a the data by making the sampling interval from the data file 0 seconds and having a page duration of 6 minutes that is by plotting 72 data points at 5 second intervals per 6 minute page t binlog2gnn pl sub makegnnfiles 1 get the starttimeUNIX passed from commandline value gt ARGV the starttimeUNIX is obtained originally from file lt starttime dat gt starttimeunix ARGV 0 passing only one name into array my file _ print processing parameter file Wn add the file ending dat infilename file data print the input filename is infilename Wn open infile infilename die ERROR can t find file infilename Mn now make time dependent ou
246. gham UK 1 4 Modules The Anaesthesia Workstation project currently consists of four software components as follows see screenshots at the end 1 4 1 Printing archiving module This is written in the Perl language Perl5 and coordinates data manipulation graph plotting using GNUplot and typesetting using IAIEX2g An electronic form of the Anaesthesia Record and associated data and programs is made available for easy viewing via a HTML front end A paper version of the Anaesthesia Record in a format suitable for placing directly into the patient notes generated and is printed in the operating theatre at the end of anaesthesia This consists of a the graphic trends a series of 1 hour graphic records of measured parameters and b the data log and keyboard entries events procedures drugs given blood lost etc 1 4 2 Data acquisition and display module This is written in C C and uses the Qt library standard with Linux systems The program accesses serial data from the Datex AS 3 anaesthesia monitor and displays the data in trend and tabular formats on the screen The operating theatre PC runs Mandriva Linux on a Dell Pentium PC CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 5 1 4 3 MAC display widget A key invention development by our group is the real time MAC display widget Fig ure 1 1 which is positioned in the lower right part of the main display screen Fig ure 6 1 This widget displays the current
247. gmt part is day month date st year year2 n print printlog extracted starttime hh mm ss st n print starttime starttimegmt n print no of gmt items ngmtitems n print the gmt part is day month date st year n need to include some error checking ie abort if probem with the times HHHHHH goto LASTLINE abort program e Running the script binlog2gnn pl We now a convert each binlog file into a data file see below and then b each of these is split into a series of 1 page gnn files e g g01 g02 etc each typically representing 1 hour periods such that the data of each gnn file is destined to be typeset on a single page of the Anaesthetic Record fields2PDATA p1 system perl binlog2gnn pl starttimeunix f Convert binlog files to data files The program binlog2gnn p1 first rewrites each binlog file into a more useful and informative data files each line of which will then also include two extra data items namely a a local time translation of the Unix time and b the elapsed time since the start of data collection the start time The script binlog2gnn pl CALLs the binlog2data p1 script to perform this particular task binlog2gnn pl1 CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 254 it usr bin perl starttimeunix ARGV O used by the SUB Makegnnfiles open timefile gt timef
248. gram e Running the script binlog2gnn pl We now a convert each binlog file into a data file see below and then b each of these is split into a series of 1 page gnn files e g g01 g02 etc each typically representing 1 hour periods such that the data of each gnn file is destined to be typeset on a single page of the Anaesthetic Record fields2PDATA p1 system perl binlog2gnn pl starttimeunix f Convert binlog files to data files The program binlog2gnn p1 first rewrites each binlog file into a more useful and informative data files each line of which will then also include two extra data items namely a a local time translation of the Unix time and b the elapsed time since the start of data collection the start time The script binlog2gnn pl CALLs the binlog2data p1 script to perform this particular task binlog2gnn pl1 CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 271 it usr bin perl starttimeunix ARGV O used by the SUB Makegnnfiles open timefile gt timefile dat die ERROR can t open file timefile dat n make an array of all required paremater names used for printing anaes Record paramname bp s bp d ecg hr sat hr cvp nibp s nibp d sat o2 insp n2o exp co2 exp tv exp co2 rr pplat vap insp vap exp mac big get each parameter binlog file in turn for
249. grey buttons are for displaying help information the two green buttons are for generating test displays usr bin perl THE dn tkalarm pl modified from tklaunch2 pl last modified April 24 2006 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 197 my thisprog dn tkalarm pl to define this program name in error messaages RWD Nickalls last change Jan 22 2006 alarms for Xenon Useful books page 301 Perl core languages Little Black Book HH BOOK Mastering Perl Tk by Lidie S and Walsh N O Reilly 2002 to get FullScreen mode at startup p 307 geometry widthXheight Xoffset Yoffset NO spacess page 409 perl tklaunch2 pl geometry 1028x768 0 0 page 409 system perl tklaunch2 pl geometry 300x400 50 300 Y HE use warnings use strict use Carp use Fatal use Tk use Tk Help use Cwd get this path macros my beep Va BEEP my OS ERROR used in viewcal SUB my kalarm calendar path home dick kde share apps kalarm calendar ics my topwindow MainWindow gt new topwindow gt title XENON diabetes support topwindow gt Label text gt Click on a diabetes button to set an alarm wraplength gt 100 padx gt 0 5 250 height gt 10 gt pack camel logo if Ce anim gif my camelimage to
250. h 322 set widget name widget bottom newinstance popdict pushdict setup bottom tabbed window set widget parent widget bottom pushdict set widget parent widget bottom big set widget title amp Gases set widget name widget gases newinstance popdict 4 setup bottom tabbed window set widget title Alarms set widget name widget alarms newinstance 4 setup bottom tabbed window set widget title kLogs set widget name widget logs newinstance setup bottom tabbed window ANsetiwidget title Warning amp Robots 4 set widget name widget warningRobots 4Nnewinstance 4 setup bottom tabbed window CHAPTER 12 CONFIGURATION FILES RWD Nickalls 166 Z set widget title xCalculators 4 set widget name widget calcs 4 newinstance 4 setup bottom tabbed window 4 Npushdict 4 set subclass tabbedwindow set widget title Monitor amp s set widget name widget monitors newinstance Nset widget title PN amp umps set widget name widget pumps newinstance popdict 4 setup bottom tabbed window Nsetiwidget title N amp Other Stuff set widget name widget otherstuff newinstance popdict popdict more windows here popdict eof Chapter 13 Drug dictionary December 13 2014 allfiles camomile cam book ch drugdict tex 13 1 Introduction The drug dictionary listing used in the pull d
251. h 0 2 increments for sevo top right use t 40 and MAC 1 6 var k2 1 6 m40 amp agecorr 1 0 05 37 40 j2 int k2 0 25 0 5 var y2 j2 0 5 0 5 bottom left use t 34 and MAC 0 6 var k1 2 0 6 m40 amp agecorr 1 0 05 37 34 jl int k1 0 25 0 5 var y12 j1 0 5 0 5V 76 now do the paper command only for axes B here as no decimals paper units 2cm 1 3cm xrange 34 40 yrange y1 y2 axes B ticks 1 0 5 now do LEFT axis ticks etc left axis 100 oxygen axis left left axis for 100 oxygen string100a string100b Me modified from mac des7 m Waxisright 67 N2O scale offset for 67 4 22 label lines using N2O string67a string67b modified from mac des7 m extra right axis 50 N2O as axis off graph then need new paper command paper units mm 3 5294cm xrange 5 117 yrange 0 8653 3 465 paper units 2cm 1 3cm xrange 34 40 75 yrange 3 142 y2 use offset 50 axis right second right axis for 50 oxygen Offset 3 142 string50a string50b initial conditions linethickness 1pt draw vertical T37 line make top end half way between top and MAC1 6 line var y22 y2 y2 k2 2 point T137 37 y22 point B137 37 y1 drawline T137 B137 vertical T 37 line point Q1 34 y2 top
252. haracters if gnn lt 10 gnn 0 gnn define the graph heights smallheight 0 43 for all other graphs now create the sat file open satfile gt plot sat gnu Idie ERROR can t open plot sat gnu file n print satfile usr bin gnuplot n print satfile plot sat gnu script made by plotgnnk2 pl n print satfile set terminal latex Wn print satfile set output plot sat pic Nn print satfile set size 1 40 smallheight Wn print satfile set xtics timeline Nin print satfile set ytics 80 90 100 n print satfile set y2tics 80 90 100 n print satfile set nokey n print satfile set grid n print satfile xmin 0 xmax 3600 n print satfile ymin 80 ymax 100 n print satfile plot xmin xmax ymin ymax n satfilename sat g gnn fo2filename o2 insp g gnn if e satfilename print satfile satfilename using 1 2 with linespoints 4 8 n else print printlog no sat gnn files n if e fo2filename print satfile fo2filename using 1 2 with linespoints 4 else print printlog no fo2 gnn files n dummyline 20 with lines 1 dummy line print satfile dummyline in close satfile It is significant here that in the last few lines of this code we have used the line print bpfile dummyline Mn This is to solve a problem which would ari
253. he Camomile stored data Both these parameters are passed by the coordinating program plotgnnk2 p1 to the program cam2gnnh p1 which creates all the parameter data files and from these generates all the gnn files a Access the parameter fields camomilefields2tex c The output data is stored by the Camomile data program in the project sub directory fields and so our first task is to access the data in a suitable format using the software access tool camomilefield2tex a C program This utility allows us to grap the data and store it in a form suitable for post processing Although the original data is currently stored in ASCII files this may well change during development An example of the current sat binlog structure is as follows sat binlog sat binlog 1071580231 92 1071580236 92 1071580241 93 1071580246 93 5 1071580251 93 1071580256 93 1071580261 92 5 1071580266 92 Consequently accessing the data via an access tool has the advantage that the post processing can proceed independent of the particular data storage format The C program camomilefield2tex is a utility to access the stored data in a form suitable for post processing unfortunately this is awkward since it requires access to the starttime dat file and so this utility has since been simplified and rewritten in Perl so it gets the time by reading the data file itself and is currently used in the stand alone printing module described in the next ch
254. ht so have small gap at right axis P drawline L16R16 L14R14 L12R12 L10R10 L08R08 L06R06 L04R04 L02R02 L00R00 putrule from 5 2 3523 to 100 2 3523 L16R16 putrule from 5 2 1523 to 100 2 1523 L14R14 putrule from 5 1 9523 to 100 1 9523 L12R12 putrule from 5 1 7523 to 100 1 7523 L10R10 putrule from 5 1 5523 to 100 1 5523 LO8RO8 putrule from 5 1 3523 to 100 1 3523 LO6R06 putrule from 5 1 1523 to 100 1 1523 LO4RO4 putrule from 5 9523 to 100 9523 L02R02 putrule from 5 7523 to 100 7523 LOOROO 5 5 5 5 5 5 5 5 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 75 Vendpicture V framebox end document Yox x PointNumber 200 Number of points variables used 153 ox 6 3 3 Final mathsPIC program for making the version of BJA charts for the Oxford Handbook of Anaesthesia This version of the mathsPIC program mac iso8t m incorporated axis legend rotation using IATEX and PostScript mac iso8T m TEST version modified from mac iso8 m Jan 10 2006 mathsPICperl version final graph chart for the bja wih decimals cdot and fbox new curves for anaesthesia mathsPIC to test rotation legend on axes A NN for percent enter the Y2 Y1 values in ET units adjust oddsidemargin adjust linethickness adjust minipage gt 3 6cm adjust possn of MAC remove iso
255. ic mfilename system latex mtfilename system dvips o psfilename dvifilename system go psfilename system ps2pdf psfilename system mathspic macdes m system latex macdes mt system xdvi macdes1 doi system dvips o macdes ps macdes doi system gv macdes ps tend of the FOR print 4n END n THE calculate etdes from mac t sub etdes 3 used only for slope for rotating label Yodef etdes t m m40 amp agecorr 1 0 05 37 t etdes passed two parameters mac for iso mac curve and t temp my array _ my mac t first get the mean mac 0 t 0 initialise mac array 0 mac t array 1 temp use 1 8 for m40 fix later etdes mac 1 8 agecorr 1 0 05 37 t return etdes END Note that in the above program we used the utility ps2pdf line 435 to generate the PDF file without actually determining the Bounding Box of the image as follows system mathspic mfilename system latex mtfilename CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 124 system dvips o psfilename dvifilename system gv psfilename system ps2pdf psfilename In fact it would have been better to have generated the PDF via the EPS version has the Bounding Box specified by using DVIPS with the E switch which extracts the Bounding Box inform
256. icense information End of options Use the X server display displayname Restore the application for the given sessionId Causes the application to install a private colour map on an 8 bit display Limits the number of colours allocated in the colour cube on an 8 bit display if the application is using the QApplication ManyColor colour Specification nograb tells Qt to never grab the mouse or the keyboard dograb running under a debugger can cause an implicit nograb use dograb to override Sync switches to synchronous mode for debugging fn font lt fontname gt defines the application font bg background color sets the default background colour and an application palette light and dark shades are calculated fg foreground color sets the default foreground colour btn button color sets the default button colour name name title title visual TrueColor inputstyle lt inputstyle gt im XIM server noxim reverse KDE options Sets the application name sets the application title caption forces the application to use a TrueColour visual on an 8 bit display sets XIM X Input Method input style Possible values are onthespot overthespot offthespot and root set XIM server disable XIM mirrors the whole layout of widgets CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 194 caption caption icon ico
257. ields filled with BD 27 29 BD BD BD Note bdh 189d 30 32 BD BD BD 33 35 BD BD BD 36 38 BD BD BD 39 41 BD BD BD Santas end of header always 40 bytes CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 34 42 45 CB CF F2 lt 33 gt Time in secs since 1 1 1970 8 7155092 E08 ECG subrecord 46 49 0B 3A 00 00 ECG group header status 4 bytes 50 51 lt 74 gt 32 label 2 bytes 52 53 02 80 HR 54 55 0A 81 sti mm 100 56 57 lt 05 gt lt 81 gt st2 58 59 lt 08 gt lt 81 gt st3 60 61 lt 01 gt lt 80 gt rr resp rate min INV Press 1 subrecord 62 65 1 0 0 0 Inv Press 1 header status 66 67 1 0 label 68 69 2 80 Sys x100 70 71 2 lt 80 gt diast x100 72 73 2 80 mean x100 74 75 1 80 heart rate min INV Press 2 subrecord 76 79 1 0 0 0 status 80 81 lt 2 gt 0 label 82 83 2 80 Sys x100 84 85 2 80 diast x100 86 87 2 80 mean x100 88 89 1 80 heart rate min INV Press 3 subrecord 90 93 1 0 0 0 status 94 95 B 0 label 96 97 2 80 Sys x100 98 99 2 80 diast x100 100 101 2 80 mean x100 102 103 1 80 heart rate min INV Press 4 subrecord 104 107 1 0 0 0 status 108 109 3 0 label 11
258. ielf2tex utility as before only this time using the 1 switch and the s tex option since we are wanting to access a log file it cam2gnnh p1 system camomilefield2tex p projdir l base o baselog data Note that since we are running this command from within the pdata subdirectory then the default location for the output files is the current directory 18 3 Write the GNUplot scripts for each graph Each 1 hour page of the Anaesthesia Record consists of six separate graphs each showing a time plot of several parameters Each spearate graph requires its own so called gnu file script which sets up the graph structure and plots each parameter inside it All this is coordinated by the Perl program plotgnnk 2 pl and so we will look in more detail how this is done Each parameter to be plotted has its own gnn parameter file not absolutely necessary but very convenient in practice see previous section To facilitate this we arrange that each 1 hour gnn file has its elapsed time starting from zero which greatly simplifies the plotting process The most difficult part of generating the gnu files one file per graph is to construct the time base such that all g01 parameter files are plotted on graphs showing the start and end times of the first hour and also of the 15 minute vertical lines which are also drawn The timebase parameter timeline The time markings along the x axis are drawn using the GNUplot set xtics com
259. ient pressure Oxygen 02 subrecord 192 195 3 0 0 0 status 196 197 0 0 label 198 199 1 80 ET 02 x100 200 201 1 80 FI 02 x100 202 205 206 207 208 209 210 211 Nitrous Oxide N2 3 0 0 0 0 0 1 80 ET N 1 80 FIN 0 subrecord status label 20 4 x100 20 4 x100 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 36 Anaesthetic agent 212 215 3 0 0 0 status 216 217 2 0 label 218 219 1 80 ET AA 4 x100 220 221 1 80 FI AA 4 x100 222 223 0 0 MAC sum x100 Flow amp Volume 224 227 3 0 0 0 status 228 229 0 0 label 230 231 0 0 RR resp rate 232 233 1 80 pPeak x100 234 235 1 80 peep x100 236 237 1 80 pPlat x100 238 239 1 80 TV insp x10 240 241 1 80 TV exp x10 242 243 1 80 compliance x100 cms H20 244 245 1 80 MV exp x100 min Cardiac Output amp Wedge press 246 249 3 0 0 0 status 250 251 7 0 label 252 253 1 80 CO 254 255 1 80 Blood Temp 256 257 1 80 Ref 258 259 1 80 pcwp Neuro Muscular J NMJ 260 263 20 0 0 KOP status 264 265 0 0 label 266 267 1 80 268 269 1 80 270 271 FF 8d ECG 2 no header 272 273 2 80 274 275 1 80 276 277 1 80 Reserved 1 8 bytes
260. ile dat die ERROR can t open file timefile dat n make an array of all required paremater names used for printing anaes Record paramname bp s bp d ecg hr sat hr cvp nibp s nibp d sat o2 insp n2o exp co2 exp tv exp co2 rr pplat vap insp vap exp mac big get each parameter binlog file in turn for j 0 j lt paramname j j 1 ifile paramname j NO binlog file extension here system perl binlog2data pl ifile A typical example of the sat data file is as follows Note that the elapsed time parameter on the first line is zero and that both the unix time and the elapsed times increase in steps of 5 seconds data is output from the Datex monitor every 5 seconds it sat data 1071580231 2003 12 16 13 10 31 0 92 000000 1071580236 2003 12 16 13 10 36 5 92 000000 1071580241 2003 12 16 13 10 41 10 93 000000 1071580246 2003 12 16 13 10 46 15 93 500000 1071580251 2003 12 16 13 10 51 20 93 000000 1071580256 2003 12 16 13 10 56 25 93 000000 1071580261 2003 12 16 13 11 1 30 92 500000 1071580266 2003 12 16 13 11 6 35 92 000000 Armed with the above data file for a given parameter then we proceed to generate from this a series of 1 page gnn files each typically of 1 hour duration as described in the next section g Generate 1 page gnn files with subroutine nakegnnfiles This role of this subroutine is to generate
261. include x config conf include x configrn conf 4 Nickalls Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh windows Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh include x widgets conf Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh Ports Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh CHAPTER 12 CONFIGURATION FILES RWD Nickalls 159 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh h monitors hhhhhhhhhhhhhhhhhhhhhhhhlhlohtlh include x monitors conf include w monitor datexas3 conf 4 hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh 4 Pumps hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh include x pumps conf 4Nincludeixx bozo controller conf Ninclude xx nickallscontroller conf 4Nincludeixx graseby3400 conf hhhhhhhhhhhhhhhhhhhhhhhhlhlohtlh hh displays hhhhhhhhhhhhhhhhhhhhhhhlh lhl h 4 include x displaysrn conf hhh Nickalls include x displays conf endCamomileConfig newpage S More Waffle end document Lheot 12 3 x configrn conf Ahhhhhhhhhhh 4 config paths Ahhhhhhhhhhhh comment newpage SS Configure paths newdict set path config home dick allfiles camomiletop conf2 set path help base home dick allfiles camomiletop docs help en index htm1 7 set path help cribsheet home dick allfiles camomiletop aneshelp index htm1 set path help diabetescrib home dick allfiles camomiletop aneshelp diabetes html set path project wd home dick allfiles camomiletop theatredata Ahhh rwdn Feb 17 2004 now reads in both paths hhh set path proje
262. inder or alarm for an event or a to do For example it may be used to define a reminder for a pending event or an overdue to do The VALARM calendar component MUST include the ACTION and CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 189 TRIGGER properties The ACTION property further constrains the VALARM calendar component in the following ways When the action is AUDIO the alarm can also include one and only one ATTACH property which MUST point to a sound resource which is rendered when the alarm is triggered When the action is DISPLAY the alarm MUST also include a DESCRIPTION property which contains the text to be displayed when the alarm is triggered When the action is EMAIL the alarm MUST include a DESCRIPTION property which contains the text to be used as the message body a SUMMARY property which contains the text to be used as the message subject and one or more ATTENDEE properties which contain the email address of attendees to receive the message It can also include one or more ATTACH properties which are intended to be Sent as message attachments When the alarm is triggered the email message is sent When the action is PROCEDURE the alarm MUST include one and only one ATTACH property which MUST point to a procedure resource which is invoked when the alarm is triggered The VALARM calendar component MUST only appear within either a VEVENT or VTODO ca
263. ine ending print outstring pass ob write outstring iit need a small delay to work properly why exactly for my j 1 j lt 15000 j seems to be OK now send EOF character ASCII 26 Z my EOF chr 26 pass 0ob write EOF for my j 1 j lt 15000 j seems to be OK print n end of file Mn print total length of file total len Wn print waiting 5 secs before closing the file n sleep 5 include slight pause here before closing the file close outfile need to keep the F 5 4 Receiving program dn getfile2 pl dn getfile pl from dxdemo3c pl CHAPTER 5 INTERFACING THE SERIAL PORT USING PERL RWD Nickalls 53 receives a file amp prints to the log file RWD Nickalls Dec 31 2005 use Device SerialPort qw STAT use strict use warnings use Fatal use Carp use I0 Handle for autoflush page 224 226 use prompt module use commandline stuff my pass used when writing output to the port my COM2 dev ttyS1 my ob Device SerialPort new COM2 croak Can t open COM2 open my LOG gt logfile log croak can t open logfile file Mn see book p 224 226 for better autoflush using I0 Handle module force autoflush after every write print LOG autoflushO to the log file STDOUT autoflush to the screen print LOG The logfile is open OK n print some heading
264. ing a lot of printing utility files into the project pdata directory this will change soon to keep all the printing tools files in a separate directory The program currently performs the following actions A Create a time encoded project directory name pro jdir for the operation This is achieved by passing the current localtime to the subroutine tedname This directory name is also passed to the camomile program as a command line option to force camomile to create this particular base directory name for the operation We add the forward slash to the end of the directory name in order to allow the camomile program to create the fields subdirectory for its output of binlog data files timenowgmt localtime projdir tedname timenowgmt projdir projdir Call the camomile program using command line switches for automatic startup A 1 Path P and configuration file c respectively as follows need to make sure that everything is all on one line Note that we also pass the string projdir to the camomile startup command and make camomile itself create the new project directory Camomile then places all its output data files into the directory projdir fields camomile A 1 P projdir c conf2 c_as3rn conf Now write the start time in unixtime and localgmttime formats to a new spe cially created file lt starttime dat gt which we write to a new data directory
265. ing it to accomodate the time interval associated with each gnn value so as we move from one hour to the next then the time associated with each hour increases accordingly fields2PDATA p1 determine the earliest start time from GO1 files in timefile dat put the start time GMT year month day hrs mins sec into an array then determine how many hours worth of Gnn files there are s tex file st is the start time hh mm ss from the lt starttime dat gt file see above JJ gnnmax 01 returns gnnMax print printlog start time st in Not to be confused with the gnn data files CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 276 print printlog GnnMax gnnmax M extract the separate hh mm ss values start times split st starthour start time 0 startminute start time 1 startsecond start time 2 make an array to hold the starttimes of each gnn file these parameters are also used in binlog2GNN pl to define the page size and sampling interval from the data files pageseconds 440 88 x 5secs no of seconds per typeset page interval 2 the sampling interval now print all the graphs for all Gnn files from 01 to GnnMax for gnn 1 gnn gnnmax gnn gnn 1 1 print printlog EET print printlog starting FOR NEXT loop with Gnn gnn gnnMax gnnmax n the xtics line is different for e
266. ing of the data area after the header part Value is not meaningful since there is only one subrecord in the request sr desc 1 offset sr desc 2 offset one subrecord transmitted 0x0000 no sr desc 2 sr type no meaning sr desc 3 sr desc 3 sr desc 4 sr desc 4 sr desc 5 Sr type sr desc 5 sr desc 6 sr desc 6 offset Sr type offset Sr type offset offset Sr type 0x0000 no no meaning 0x0000 no no meaning 0x0000 no no meaning 0x0000 no no meaning which use the header of the same meaning since only meaning meaning meaning meaning CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 32 39 0x00 40 0x00 sr desc 7 offset 0x0000 no meaning 41 0x00 sr_desc 7 sr_type 0x00 no meaning START OF THE TRANSMISSION REQUEST SUBGROUP 42 0x01 Request current values of physiological database DRI_PH_DISPL field phdb_rcrd_type of struct phdb_req 43 OxOA 44 0x00 Transmission interval in seconds Ox0004 i e send current values of physiological database every 10 seconds field tx interval of struct phdb req 45 0x00 46 0x00 reserved 0 of struct phdb_req must be zeroed 47 0x00 48 0x00 reserved 1 of struct phdb req must be zeroed 49 0x00 50 0x00 reserved 2 of struct phdb_req must be zeroed 51 Ox3B checksum 52 Ox7E End flag 4 4 Output data string format The data format for the Datex AS 3 amp CS 3 mon
267. ins trigger time mins n print logg interval mins repeat interval mins An CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 212 print logg until mins until time mins An HE determine the new trigger time determine final time trigger time my trigger_unix time_now _unix trigger_time_mins 60 secs get local time string my trigger_string localtime trigger_unix get ymdhm of trigger time my trigger ymdhm ymdhmi trigger string use the subroutine print trigger time hh mm trigger hhmm Nn print logg trigger time trigger ymdhm Wn write the correct trigger string for the Kalarm commandline my trigger t trigger ymdhm two trailing spaces Ht determine the correct until_time add 24hrs my until_unix time_now_unix until_time_mins 60 secs my until_string localtime until_unix my until_ymdhm ymdhm until_string print until time until ymdhm Nn print logg until time Suntil_ymdhm An my until u until ymdhm the period during which it repeats format is until u 2005 12 13 15 36 Ht testing with file use the KDE geometry option to get width correct Gfile f home dick allfiles akalarm perlfhelp txt out kalarm color until repeat_interval file set a new DIABETES alarm out kalarm c
268. int printlog starttimeunix starttimeunix Nin print printlog starttimegmt starttimegmt Wn print printlog n now put the starttimeGMT into an array Sa Se a Se ee ee es note the main items are lt space gt separated except hh mm ss format is Sun Jan 25 13 24 35 2004 format is Sun Jan 5 13 24 35 2004 Typically a page contains 1 hour of data sampled at 45 second intervals but it is useful to be able to devote single pages to a shorter period of time in order to view the data in greater resolution say every 5 seconds having only 6 minutes of data per page CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 253 note get two spaces after the Month if days 10 modified from SUB tedname in launchcam12 pl dei ER OO ER RE if two spaces in posn 8 and 9 then remove one if substr starttimegmt 7 2 eq substr starttimegmt 7 2 print tr string startgmtstring n replace spaces with commas starttimegmt tr make an array stgmt split starttimegmt day stgmt 0 month stgmt 1 date stgmt 2 st stgmt 3 year stgmt 4 noitems stgmt 1 print printlog extracted starttimeUNIX starttimeunix n print printlog extracted starttimeGMT starttimegmt n print printlog extracted no of gmt items ngmtitems corr in print printlog extracted
269. int vapfile xmin 0 xmax 3600 n CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 296 print vapfile ymin 0 ymax 4 n print vapfile plot xmin xmax ymin ymax n print vapfile 1 with lines 1 NW print vapfile 2 with lines 1 n print vapfile 3 with lines 1 n vapexpfilename vap exp g gnn vapinspfilename vap insp g gnn macbigfilename mac big g gnn if e vapexpfilename print vapfile vapexpfilename using 1 2 with lines 1 n else print printlog no vap exp gnn files n if e vapinspfilename print vapfile vapinspfilename using 1 2 with lines 2 n else print printlog no vap insp gnn files n if e macbigfilename print vapfile macbigfilename using 1 2 with points 4 1 n else print printlog no mac big gnn files n print vapfile dummyline Nn close vapfile print printlog VAP gnu done n now run GNUplot on the GNU files print printlog running GNUPLOT on all the gnu files Wn system gnuplot plot bp gnu system gnuplot plot sat gnu system gnuplot plot fo2 gnu system gnuplot plot co2 gnu system gnuplot plot tv gnu system gnuplot plot vap gnu print printlog GNUPLOT done n print writing the lt gnnheader dat gt file to contain header for Anes record n open outfile5 gt gnnheader dat die ERROR
270. inting the paper sheets Finally we print out all the sheets making up the Anaesthesia Record This currently consists of one or more drug sheets the log file together with a number of 1 hour graphic sheets presenting the measured parameters These are usually printed out in the operating theatre and placed in the patient notes In practice a small Perl program printall p1 sends the final files to the printer in reverse order as follows usr bin perl CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 281 printALL pl do graphs in reverse order if e anes 10 dvi system dvips anes 10 dvi else if e anes 09 dvi system dvips anes 09 dvi else if e anes 08 dvi system dvips anes 08 dvi else if e anes 07 dvi system dvips anes 07 dvi else if e anes 06 dvi system dvips anes 06 dvi else if e anes 05 dvi system dvips anes 05 dvi else if e anes 04 dvi system dvips anes 04 dvi else if e anes 03 dvi system dvips anes 03 dvi else if e anes 02 dvi system dvips anes 02 dvi else if e anes 0O1 dvi system dvips anes 01 dvi else print the drug sheet last on top if e anes drug dvi system dvips anes drug dvi else 1 Chapter 20 processdata pl dt dt us us us us iit dt iit dt dt iit dt dt dt iit idt idt dt dt dt dt dt dt iit iit December 13 2014
271. inusqq t4 qq hminusi 45 deltahminusq t5 qq h 00 deltah t6 qq h 15 deltahplusq t7 qq h 30 deltahplusqq t8 qq h 45 deltahplusaaa t9 qq hplus1 00 deltahplusqqqq timeline t1 t2 t3 t4 t5 t6 t7 t8 t9 print printlog set xtics timeline n print printlog starting to write all the gnn files Mn CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 291 first make sure the gnn string has three characters if gnn lt 10 gnn 0 gnn define the graph heights bigheight 0 9 for bp graph smallheight 0 43 for all other graphs now create the BP file open bpfile gt plot bp gnu die ERROR can t open plot bp gnu file n print bpfile usr bin gnuplot n print bpfile plot bp gnu script made by plotgnnk2 pl n print bpfile set terminal latex n print bpfile set output plot bp pic Mn print bpfile NB full size 5x3 inches set x y n print bpfile set size 1 40 bigheight n print bpfile set xtics timeline n print bpfile set noytics n print bpfile set y2tics 0 20 50 100 150 200 n print bpfile set y2label ys print satfile set y2label Sat circ WW FION 2V bullet NP 1300 print bpfile set nokey n print bpfile set grid n print bpfile xmin 0 xmax 3600 n print bpfile ymin 0 ymax 200 n print bpfile plot xmin xmax ymin y
272. invasive blood pressure sub records is encoded in bytes 62 75 as shown in the following Table Table 4 8 Decoding part of the invasive blood pressure 1 record bytes 62 75 The systolic diastolic and mean blood pressure values x 100 are encoded as a sequence of three pairs of Hex words ie six bytes in the positions 68 73 see Table 4 5 The following table shows the decimal and hex forms of each byte and the hex and decimal values of the respective words 1 word consists of two bytes Note the ordering of the bytes when combining them into words Note also that the decimal value of each word has to be divided by 100 to obtain the physiological value and in this particular case the decoded values are systolic BP 149 1 diastolic BP 73 99 mean BP 105 45 In practice we would only pass on the integer values for blood pressure mean diastolic systolic Byte number 73 72 71 70 69 68 Dec value 041 049 028 231 058 062 Hex value 29h 31h 1Ch E7h 3Ah 3Eh Hex word 2931h 1CE7h 3A3Eh decimal 10545 7399 14910 BP decimal 100 105 45 73 99 149 1 The following is the same data but placed in byte order 1 321 together with the Dec and Hex equivalent byte Hex Dec 001 7E 126 002 3E 062 003 01 001 004 6E 111 005 05 005 006 00 000 007 00 000 008 46 166 009 34 052 010 F1 241 011 34 058 012 00 000 013 00 000 014 00 000 015 00 000 016 00 000 017 00 000 018 00 000 CHAPTER 4 THE
273. itors is described in the Datex document AS 3 amp CS 3 Computer Interface Specification Revision 3 1 15 5 1997 This is a 37 page A4 document available from Datex and covers the software versions listed in Table 4 2 After the computer sends the above Transmission Request command string the Da tex AS 3 monitor responds by outputting the following 321 byte string every 10 seconds which consists of a a 1 byte start flag lt 7Eh gt b a 40 byte header c a number of so called sub records and finally d a checksum 1 byte followed by a 1 byte stop flag lt 7Eh gt The following few points are relevant e The string starts and ends with a 7Eh byte 126d e I have numbered the bytes decimal starting with 1 1 321 Note that byte 1 is the FIRST byte to be received by the PC e The byte values are given in Hexadecimal h CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 33 e In the following listing the bytes are divided up into their functional groups 1 2 3 4 bytes etc Note that the order of the bytes within a group is shown in the left hand column e When decoding the groups of bytes note that UNIX rules apply and the within group byte order needs to be reversed i e in order to have the highest byte number to the left hand side and lowest byte number to the right hand side For example the four byte double word group lt CBh gt lt CFh gt lt F2h gt lt 33h gt
274. itten in Perl version 5 generate as output a mathsPIC script for drawing the graph This script is then run through mathsPIC itself Nickalls 1999 Syropoulos and Nickalls 2000 Syropoulos and Nickalls 2005 7 3 Program macatdes2 pl This Perl program asks the user to select the age of the patient and then generates the desflurane chart for the given age usr bin perl LINUX version Desflurane macATdes2 pl from macATdes1 pl to fix the decimal problem Dick Nickalls May 6 2005 put on end of all newcommand and all TeX commands THE history Ht H w warning switch Ht use Math Trig program name is O see black book p 211 timenowgmt localtime print n print sek ek seek kke ekke eek kkk D print x Mn print xx MAC CHART DESFLURANE xn print xx AGE amp TEMPERATURE CORRECTION n print xx KENT print macATdes2 pl n print x rwd nickalls 2005 xn print ekoo CCC CACC CoCo ooo nV n HE from Programming Perl p 191 sign digits d decimal more digits Vd number sign digits decimal more digits works OK for here but rejects 2 E 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
275. k failed to close Leof Nn print LOG undef ob frees memory back to Perl but no error message Chapter 6 Age corrected MAC aHOUSE book xenon ch macage01 tex 6 1 Introduction I first implemented the real time age corrected MAC output on the anaesthesia worksta tion towards the end of 1996 quite soon after reading Mapleson s MAC paper Mapleson 1996 The workstation program at that time was an MS DOS application written in QuickBasic 4 5 and already running in the thoracic theatre at the City Hospital Figure 6 1 Screenshot November 1997 of the MS DOS anaesthe sia workstation program version D2c showing the age corrected MAC bigMAC value in a red alert state only 0 74 on the lower RHS of the screen Other red alert states also indicated are for Bp blood pressure too low and alarm sound OFF In practice this application was greatly facilitated by the excellent serial port data stream output by the Datex Cardiocap and Capnomac Ultima series of anaesthesia monitors we then used detailed in Nickalls and Ramasubramanian 1995 since the data 56 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 57 included agent name and inspired and expired vapour concentrations Consequently a practical real time age corrected MAC output display on the screen was straightforward and simple to implement since all I had to do was to write a small subroutine to calculate
276. k K k paaa k k kk kk vspace 4mm CHAPTER 17 TYPESETTING PROGRAMS RWD Nickalls 240 noindent input plot tv pic hfill now put on the right axis for Resp rate 0 5 10 15 20 vspace 32 5mm noindent hspace 158 5mm 20 bullet vspace 1 4mm noindent hspace 158 5mm 15 vspace 1 4mm noindent hspace 158 5mm 10 was 8mm vspace 1 4mm noindent hspace 159mm 5 vspace 1 4mm noindent hspace 159mm 0 was 189 vspace 4mm d okokokokokokokokeokookeolokeokookokookeokeolok vspace 7mm noindent input plot vap pic hfill d okokokokokokokokokokekokeokolokookek vspace 19 4cm hspace 16 75cm was 16 5 begin minipage 2cm BP inv BP circ NIBP Box vspace 6mm HR _ oxim bullet mbox bullet HR _ ecg bullet vspace 5 5mm vspace 18 5mm SAT circ vspace 6 5mm fiotwo bullet vspace 12 1mm ntwoo Box CHAPTER 17 TYPESETTING PROGRAMS RWD Nickalls 241 vspace 3 2mm fiotwo bullet vspace 3 2mm P plateau fN textstyle circ vspace 2mm vspace 22mm AAET CO 2 etcotwo diamond vspace 25 2mm TV expl N Box vspace 1 4mm RR bullet vspace 15mm VAP _ insp ldots vspace 2mm VAP _ exp mbox vspace 2mm MAC _ age Diamond end minipage vfill noindent rule 8cm 0 5pt footnotesize noindent copyright RWD Nickalls
277. l log file baselog data to the filtered file baselognew data We now typeset the filtered drug file and create the output formats dvi ps and pdf on the fly as before The TEX file for the graphs is prtdrug tex The style option is prtdrug2 sty We create the PostScript files using dvips We create the pdf files using pdflatex CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 237 process the baselog data file system perl base2texd pl now latex the prtdrug file system copy system make system make system copy system latex prtdrug tex the dvi file to have a anes drug dvi filename cp v prtdrug dvi anes drug dvi the PS version of the dvi file dvips anes drug dvi o anes drug ps the pdf file pdflatex prtdrug tex the pdf file to have a gnn pdf filename cp v prtdrug pdf anes drug pdf 16 12 Printing the paper sheets Finally we print out all the sheets making up the Anaesthesia Record This currently consists of one or more drug sheets the log file together with a number of 1 hour graphic sheets presenting the measured parameters These are usually printed out in the operating theatre and placed in the patient notes In practice a small Perl program printall p1 sends the final files to the printer in reverse order as follows usr bin perl printALL pl do graphs in reverse order if e if if if if if if if if if
278. lapsedtime now print data into 1 hr files make NewElapsed time relative to begining of new hour hour 1 first real hour hour will be zero on first run thro algorithm so goes to else if elapsedtime lt hour 3600 space calculate new elapsed time from begining of new hour newet elapsedtime 3600 hour 1 print outfile newet space paramvalue space unixtime n else close existing gnn file and open a new one gnn 1 close outfile hour hour 1 use two digits for the filename extension eg g04 if hour lt 10 hour 0 hour gnudatafilename file g hour print the new output filename gnudatafilename Wn open outfile gt gnudatafilename die can t open the outfile Mn write some headers to the outfile outfileheader1 Camomile gnuplot datafilename gnudatafilename outfileheader2 date print outfile outfileheader1 n print outfile outfileheader2 n write info to the timefile print timefile hour unixtime gmtime gnudatafilename n CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 257 space calculate new elapsed time from begining of new hour newet elapsedtime 3600 hour 1 print outfile newet space paramvalue space unixtime n JHtend of elsef end o while close infile close outfile TES A typical example of a gnn file the file sat g03 is as follows There are three fiel
279. le cam book ch printover tex 16 1 Introduction The anaesthesia data accumulated by the Camomile data program is output and stored in the fields directory of the current operation directory projdir in the form of binlog files each one associated with a given parameter field containing a series of time parameter value pairs When the Camomile data program terminates control returns to the coordinating Perl program launchcam12 p1 which currently coordinates the data processing preliminary to the physical printing of the Anaesthesia Record itself The aim of the printing process is to access the stored data in the fields directory and plot it in graphic form on Ad paper in such a way that each A4 sheet shows 1 hour of data All the data manipulation is done by the following small Perl programs which are stored in the camomiletop datexsim printfiles directory base2texd pl does some ASCII to TeX conversion to log file cam2gnnh pl generates the data and gnn files launchcami2 pl runs the Camomile program plotgnnk2 pl coordinates printing module printall pl prints the paper sheets prtanes6 tex TeX file for the graphs prtdrug2 sty TeX style option for printing module prtdrug tex TeX file for the log file We now address the printing process in some detail covering the various steps from the raw field output data acquired by the Camomile data program to the production of th
280. le copied OK n else print logfile file2 COPY ERROR n file21 binlog2data pl CALLed by cam2gnnH2 copy fromdir file21 PDATA if eq print logfile file21 file copied OK n else print logfile file21 COPY ERROR n file3 prtanes6 tex copy fromdir file3 PDATA if eq print logfile file3 file copied OK n else print logfile file3 COPY ERROR n file4 prtdrug tex copy fromdir file4 PDATA if eq print logfile file4 file copied OK n else print logfile file4 COPY ERROR n fileb prtdrug2 sty copy fromdir fileb PDATA if eq print logfile file5 file copied OK n else print logfile file5 COPY ERROR n file6 base2texd pl converts base log baselog data gt something which TeX can print copy fromdir file6 PDATA if eq print logfile file6 file copied OK n else print logfile file6 COPY ERROR n move to the required dir print logfile changing DIR to PDATA dir n PDATAdir PDATA chdir PDATAdir note that chdir is a PERL command but cd is a Linux BASH command now check we are in the correct directory print logfile the current dir is Mn system pwd
281. left corner text sf large NAME Q1 shift 0 2 0 35 text sf Huge DESFLURANE 37 y2 0 7 def theage jj text sf large AGE jj Q1 shift 0 2 0 7 MI CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 120 amp theage amp age point Q2 40 y1 bottom right corner text sf copyright RWD Nickalls 2005 Q2 shift 0 2 0 35 Mr text sf mathsPIC _ perl Q2 shift 0 2 0 7 Mr point Q3 35 y1 bottom left side text sf filename O3 shift 0 0 35 1 define the polar rr tt for the turnbox MAC labels var r9 0 2 var t9 40 degrees text sf Temperature circ C 37 y1 0 7 text sf Large Age amp temperature corrected iso MAC chart 37 y1 1 4 refs newcommand refs begin minipage textwidth sf Eger EI 2001 Anesthesiology underline 93 947 953 newline sf Nickalls RWD and Mapleson WW 2003 Br J A Anaesthesia underline 91 170 174 end minipage text refs 34 y1 2 35 1 newcommand ylegend sf End tidal Desflurane in 100 oxygen air determine string length gt Yunits etc newlength ylength settowidth ylength ylegend text answer number ylength 37 1 halflength 1 5 2 2223 y units text turnbox 90 ylege
282. lendar component VALARM calendar components cannot be nested Multiple mutually independent VALARM calendar components can be specified for a single VEVENT or VTODO calendar component The TRIGGER property specifies when the alarm will be triggered The TRIGGER property specifies a duration prior to the start of an event or a to do The TRIGGER edge may be explicitly set to be relative to the START or END of the event or to do with the RELATED parameter of the TRIGGER property The TRIGGER property value type can alternatively be set to an absolute calendar date and time of day value In an alarm set to trigger on the START of an event or to do the DTSTART property MUST be present in the associated event or to do In an alarm in a VEVENT calendar component set to trigger on the END of the event either the DTEND property MUST be present or the DTSTART and DURATION properties MUST both be present In an alarm in a VTODO calendar component set to trigger on the END of the to do either the DUE property MUST be present or the DTSTART and DURATION properties MUST both be present The alarm can be defined such that it triggers repeatedly A definition of an alarm with a repeating trigger MUST include both the DURATION and REPEAT properties The DURATION property specifies CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 190 the delay period after which the alarm will repeat
283. les is the current directory 19 3 Write the GNUplot scripts for each graph Each 1 hour page of the Anaesthesia Record consists of six separate graphs each showing a time plot of several parameters Each spearate graph requires its own so called gnu file script which sets up the graph structure and plots each parameter inside it All this is coordinated by the Perl program plotgnnk 2 pl and so we will look in more detail how this is done Each parameter to be plotted has its own gnn parameter file not absolutely necessary but very convenient in practice see previous section To facilitate this we arrange that each 1 hour gnn file has its elapsed time starting from zero which greatly simplifies the plotting process The most difficult part of generating the gnu files one file per graph is to construct the time base such that all g01 parameter files are plotted on graphs showing the start and end times of the first hour and also of the 15 minute vertical lines which are also drawn The timebase parameter timeline The time markings along the x axis are drawn using the GNUplot set xtics com mand which in this case takes a complicated parameter which is the string timeline In practice for each hour the particular time base used will be the same for all graphs drawn using parameters values from files having the same gnn value say g02 files for example The following code determines this string for each hour tailor
284. m b c red t 2008 04 10 11 51 i 0005 u 2008 04 11 11 31 DIABETES repeat blood sugar This command generates a new calendar ics file which encodes the alarm data Note that a given alarm instance VEVENT may be associated with several alarms VALARM in different formats eg text displayed file voice etc There is one VALARM for the display of message and another VALARM for the sound of the beep Note the empty lines following the END commands BEGIN VCALENDAR PRODID K Desktop Environment NONSGML KAlarm 1 2 10 EN VERSION 2 0 BEGIN VEVENT DTSTAMP 20080410T113102 ORGANIZER MAILTO CREATED 20080410T113102 UID KAlarm 1412322138 966 SEQUENCE 1232236916 LAST MODIFIED 20080410T113102 CLASS PUBLIC PRIORITY 5 RRULE FREQ MINUTELY UNTIL 20080411T113100 INTERVAL 5 DTSTART 20080410T115100 TRANSP TRANSPARENT BEGIN VALARM DESCRIPTION DIABETES repeat blood sugar ACTION DISPLAY TRIGGER VALUE DURATION PTOS X KDE KALARM FONTCOLOR 0000 000000 END VALARM BEGIN VALARM ACTION AUDIO TRIGGER VALUE DURATION PTOS END VALARM END VEVENT END VCALENDAR 14 2 4 Displaying a file Note that the alarm can be the display of a file For example the following code will immediately since no t option display a HTML file in a window Note that there must be NO display message argument with this command since in this case the file has taken the place of the message CHAPTER 14 D
285. max n print bpfile 20 with lines 1 n print bpfile 50 with lines 1 n print bpfile 100 with lines 1 n print bpfile 150 with lines 1 n bpsfilename bp s g gnn bpdfilename bp d g gnn nibpsfilename nibp s g gnn nibpdfilename nibp d g gnn hrecgfilename ecg hr g gnn hroximfilename sat hr g gnn cvpfilename cvp g gnn if e bpsfilename print bpfile bpsfilename using 1 2 with linespoints 1 9 n else print printlog no bp s gnn files n if e bpdfilename print bpfile bpdfilename using 1 2 with linespoints 1 8 n else print printlog no bp d gnn files n if e nibpsfilename print bpfile nibpsfilename using 1 2 with linespoints 1 3 n CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 292 else print printlog no nibp s gnn files n if e nibpdfilename print bpfile nibpdfilename using 1 2 with linespoints 1 3 n else print printlog no nibp d gnn files n SS SSS EDE EE DEE if e hrecgfilename print bpfile hrecgfilename using 1 2 with points 1 10 NN Wn else print printlog no hr ecg gnn files n if e hroximfilename print bpfile hroximfilename using 1 2 with linespoints 1 10 n else print printlog no hr oxim gnn files n if e cvpfilename print bpfile
286. me are passed to the cam2gnnh p1 program by the calling program plotgnnk2 p1 If the elapsed time exceeds 1 hour then the current gnn file is closed and the next one opened etc In practice however data is only retained at approximately 30 45 second intervals this interval can be varied depending on the requirements So although the data is originally stored every 5 seconds the actual printed data is thinned out somewhat purely CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 230 because there is a limit to what density of data can usefully be printed to the Anaesthesia Record If better resolution is required then higher resolution printing can be performed at a later date it cam2gnnh p1 sub makegnnfiles 1 get the starttimeUNIX passed from commandline value gt ARGV the starttimeUNIX is obtained originally from file lt starttime dat gt starttimeunix ARGV O passing only one name into array my file _ print processing parameter file Wn add the file ending dat infilename file data print the input filename is infilename Wn open infile infilename die ERROR can t find file infilename Mn now make time dependent out filename start with hour set to zero hour 0 start inputting lines of data need to get the time associated with line 1 interval 45 secs oldelapsedtime 0 LINE while lt infile gt next LINE if
287. n print event event n next LINE HE finally dump the event string and start again z print dataline Nn dataline end of the input loop reading the calfile THE print no more events found termating now An print n print event string event Nn THE get the commandline options using Getopt Long Perl best practice p 309 my trigger time mins 30 mins my repeat interval mins 5 mins my until time mins 1440 mins 24hrs my message qq DIABETES my S options okay GetOptions trigger i gt V trigger time mins trigger expects an integer mins interval i gt V repeat interval mins interoal mins untilzi gt M until time mins until mins 1440 24hrs message s gt message message y use 2 trailing spaces to separate items my kalarm kalarm my bell b b my color c red trigger time minss 1Ht starttime repeat interval mins 5 mins my S intervala 0000 repeat interval mins my intervalb substr intervala 4 print logg interval intervalb Wn my repeat interval i intervalb THE my message qq DIABETES repeat blood sugar print logg bell bell n print logg color color Wn print logg trigger m
288. n miniicon icon config filename dcopserver server nocrashhandler waitforwm style style geometry lt geometry gt nofork Options a ack confirm b beep c color color calendarURL url cancelEvent lt eventID gt e exec lt commandline gt f file url handleEvent lt eventID gt i interval period l late cancel L login r repeat count reset s sound url gtop t time time tray u until time displayEvent lt eventID gt Use caption as name in the titlebar icon as the application icon as the icon in the alternative configuration Use the DCOP Server specified Disable crash handler to get core dumps Waits for a WM NET compatible windowmanager sets the application GUI style sets the client geometry of the main widget Don t run in the background icon titlebar file by server Use Use Use Prompt for confirmation when alarm is acknowledged Beep when message is displayed Message background colour name or hex OxRRGGBB URL of calendar file Cancel alarm with the specified event ID Execute a shell command line File to display Trigger or cancel alarm with the specified event ID Interval between alarm recurrences Cancel alarm if it cannot be triggered on time Repeat alarm at every login Number of times to repeat alarm after the initial occasion Reset
289. n text gt HOWTO use padx gt 9 pady gt 10 relief gt raised background gt LightGrey activebackground gt Grey foreground gt Blue activeforeground gt Red command gt Gerrorbox command gt amp showhelp command gt sub showhelp gt pack side 2 bottom expand gt 1 gt place relx gt 0 05 rely gt 0 54 VIEW logfile button topwindow gt Button text gt VIEW logfile padx gt 10 pady gt 10 relief gt raised background gt LightGrey activebackground gt Grey foreground gt Blue activeforeground gt Red command gt amp viewlog gt pack side gt bottom expand gt 1 gt place relx gt 0 05 rely gt 0 66 VIEW calendar file button topwindow gt Button text gt VIEW calfile padx gt 10 pady gt 10 relief gt raised background gt LightGrey activebackground gt Grey foreground gt Blue activeforeground gt Red command gt amp viewcal gt pack side 2 bottom expand gt 1 gt place relx gt 0 05 rely gt 0 78 HELP button topwindow gt Button text gt HELP on diabetes padx gt 115 pady gt 10
290. n we avoid wasting the data we collect ASA Newsletter 67 November http www asahq org Newsletters 2003 11_03 sanderson html The Novem ber ASA Newsletter was a special issue on Performance and outcome measures Sanderson PM Watson MO and Russell WJ 2005 Advanced patient monitoring displays tools for continuous informing Anesthesia and Analgesia 101 161 168 Smith A 1997 New college guidelines for anaesthesia records how do current forms measure up Royal College of Anaesthetists Newsletter 36 1997 3 6 CHAPTER 2 DATA PROCESSING IN ANAESTHESIA RWD Nickalls 22 Waters RM 1936 The teaching value of records Journal of the Indiana Medical Association 29 110 from Hall n 1990 Waters RM 1942 The evolution of anaesthesia Proceedings of the Mayo Clinic 17 40 from Hall n 1990 Weinger MB Herndon OW and Gaba DM 1997 The effect of electronic record keeping and transesophageal echocardiography on task distribution workload and vigilance during cardiac anesthesia Anesthesiology 87 144 155 Westhorpe R 1989 McKesson Nargraf anaesthesic record Anaesthesia and Intensive Care 17 250 Wong DH Gallegos Y Weinger MB Clack S Slagle J and Anderson CT 2003 Changes in intensive care unit nurse task activity after installation of a third generation intensive care unit information system Critical Care Medicine 31 2488 2494 Chapter 3 TEX in the Operating Theatre an Anaesth
291. n 20 CHAPTER 13 DRUG DICTIONARY RWD Nickalls 181 Hespan Hydroxy ethyl starch Gelofusin Hartmans solution Sodium lactate Blood packed cells Blood whole Magnesium Magnesium sulphate Insulin Potassium Potassium chloride Thiopentone Thiopental Cryoprecipitate FFP Fresh frozen plasma PPF Plasma protein fraction Esmolol Aheot As time went by some of these drugs would be added to the NHS list and so the program indicated in the log file whether any of the drugs were found in the NHS list and if so did not add them 13 10 Perl program add2list pl This program added to the NHS list the drugs in the missing list usr bin perl add2list pl RWDN Jan 13 2006 T use strict use warnings use Cwd to get this PATH eg thisdirzcmd use Carp allows croak and warn warn always gt to STDERR use Fatal qw open close for errors use Perl6 Builtins qu system use Getopt Long for commandline stuff use version my udrugname my dmd my drugname my drugcode drugname Atropine drugcode push udrugname drugname collect name code pairs into a hash dmd dmd drugname drugcode drugname Bupivicaine drugcode push udrugname drugname collect name code pairs into a hash CHAPTER 13 DRUG DICTIONARY RWD Nickalls 182 dmd dm
292. n array of all required input filenames we are running this from the PDATA dir fieldfilename fields bp d binlog fields bp s binlog fields ecg rr binlog fields co2 exp binlog fields co2 insp binlog fields co2 rr binlog fields cvp binlog fields ecg hr binlog fields ecg rr binlog fields mac big binlog fields mac n20o binlog fields mac vap binlog fields mv exp binlog fields n2o exp binlog fields nibp d binlog fields nibp s binlog fields o2 insp binlog fields pplat binlog fields sat binlog fields sat hr binlog fields temp 0 binlog fields temp 1 binlog fields tv exp binlog fields tv insp binlog fields vap code binlog fields vap exp binlog fields vap insp binlog get each binlog file in turn and read the first line for UNIXtime for j 0 j lt fieldfilename j j 1 1 ifile fieldfilename jl if e ifile open fieldsfile lt ifile die ERROR can t open file ifile n else print printlog ifile does NOT exist n next print reading the fields file lt bp d binlog gt to access UNIX time n n 0 line counter LINE while lt fieldsfile gt next LINE if skip comments next LINE if 4 skip 4 comments next LINE if skip blank lines grab the whole line as a string dataline _ n n 1 increme
293. naesthetic records for morbidity and mortality studies In Ed Kenny G Automated Anaesthetic Records Bailli re s Clinical Anaesthesiology 4 June 7 16 Hirsch NP and Smith GB 1986 Harvey Cushing his contribution to anesthesia Anesthesia and Analgesia 65 288 293 Kennedy PJ Feingold A Wierner EL and Hosek RS 1976 Analysis for tasks and human factors in anaesthesia for coronary artery bypass Anesthesia and Analgesia 55 374 377 Kenny GNC ed 1990 Automated anaesthesia records Bailliere s Clinical Anaesthesiology 4 June Lack JA Stewart Taylor M and Tecklenburg A 1994 An anaesthesia minimum data set and report format British Journal of Anaesthesia 73 256 260 Leedal JM and Smith AF 2005 Methodological approaches to anaesthetists workload in the operating theatre British Journal of Anaesthesia 94 702 709 Middleton H 1957 Proc Roy Soc Med 50 888 from Middleton 1958a CHAPTER 2 DATA PROCESSING IN ANAESTHESIA RWD Nickalls 21 Middleton H 1958a A cumulative anaesthesia record system Anaesthesia 13 337 340 Middleton H 1958b Brit Med Bull 14 42 from Middleton 1958a Mounier CCR 1855 Acad Sci Paris vol 40 p 530 from Rushman Davies and Atkinson 1996 M ller M Junger A Br u M Kwapisz MM Schindler E Akint rk Benson M and Hempelmann G 2002 Incidence and risk calculation of inotropic support in patients undergoing cardiac surgery with cardiopulm
294. nbox s14deg boldmath 1 4 B37 polar r9 s14deg t9 deg var m 1 2 MAC point C34 34 25 amp etdes 34 25 point C35 35 amp etdes 35 point C36 36 amp etdes 36 point C37 37 amp etdes 37 point C38 38 amp etdes 38 point C39 39 amp etdes 39 point C40 39 75 amp etdes 39 75 color blue drawline C34 C37 color red drawline C37 C40 color black drawpoint C35 C36 C37 C38 C39 text turnbox s12deg boldmath 1 2 C37 polar r9 s12deg t9 deg NaN Ne NEN var m 1 0 MAC point D34 34 25 amp etdes 34 25 point D35 35 amp etdes 35 point D36 36 amp etdes 36 point D37 37 amp etdes 37 point D38 38 amp etdes 38 point D39 39 amp etdes 39 point D40 39 75 amp etdes 39 75 color blue drawline D34 D37 color red drawline D37 D40 color black CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 122 drawpoint D35 D36 D37 D38 D39 text turnbox s10deg boldmath 1 0 D37 polar r9 s10deg t9 deg get slope of line var s direction D35 D40 radians var r14 atan 5 2 x tan s def r2d 180 pi V var d14 r14 amp r2d var m 0 8 MAC point E34 34 25 amp etdes 34 25 point E35 35 amp etdes 35 point E36 36 amp etdes 36 point E37 37 amp etdes 37 point E38 38 amp etdes 38 point E39 39 amp etdes 39 point E40 39 75 amp etdes 39 75 color blue
295. nd 33 3 y1 y2 y1 2 2 2223 labels at top text sf N _2 0 40 25 y2 0 7 text sf N 2 0 40 98 y2 0 7 text sf 67 40 25 y2 0 7 0 35 text sf 50 40 98 y2 0 7 0 35 newcommand rightylegend sf End tidal Desflurane in N _2 0 text turnbox 270 rightylegend 41 4 y1 y2 y1 2 1 66 MAC 1 6 normalcolor var m 1 6 MAC point A34 34 25 amp etdes 34 25 point A35 35 amp etdes 35 point A36 36 amp etdes 36 point A37 37 amp etdes 37 point A38 38 amp etdes 38 point A39 39 amp etdes 39 point A40 39 75 amp etdes 39 75 color blue drawline A34 A37 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 121 color red drawline A37 A40 color black drawpoint A35 A36 A37 A38 A39 text turnbox s16deg boldmath 1 6 A37 polar r9 s16deg t9 deg MACage label def macage jj text sf large MAC _ jj A37 shift 0 12 0 8 1 amp macage amp age var m 1 4 MAC point B34 34 25 etdes 34 25 point B35 35 amp etdes 35 point B36 36 amp etdes 36 point B37 37 amp etdes 37 point B38 38 amp etdes 38 point B39 39 amp etdes 39 point B40 39 75 amp etdes 39 75 color blue drawline B34 B37 color red drawline B37 B40 color black drawpoint B35 B36 B37 B38 B39 text tur
296. nesthetic concentration and minimum alveolar anesthetic concentration awake Anesthesia and Analgesia 93 947 953 has an appendix on temperature correction CHAPTER 6 AGE CORRECTED MAC RWD Nickalls go ISOFLURANE End expired in 67 50 End tidal 96 in 100 oxygen air RWD Nickalls 2003 0 10 20 30 40 50 60 70 80 90 100 Age years Figure 6 3 The isoflurane version mac iso8t m generated for the Oxford Handbook of Anaesthesia with rotated LHS axis legend Hardman JG and Aitkenhead AR 2005 Awareness during anaesthesia Continu ing Education in Anaesthesia Critical Care amp Pain 5 183 186 Lerou JGC 2004 Nomogram to estimate age related MAC Br J Anaesth 93 288 291 e Liem EB Lin C M Suleman M Doufas AG Gregg RG Veauthier JM Loyd G and Sessler DI 2004 Anesthetic requirement is increased in redheads Anesthe siology 101 279 83 MAC requirement is increased by 19 Mapleson WW 1979 From Clover to computer towards programmed anaes thesia Anaesthesia 34 163 172 an edited version of the 19th Joseph Clover Lecture Mapleson WW 1996 Effect of age on MAC in humans a meta analysis Br J Anaesth 76 179 185 Nickalls RWD 1999 mathsPIC a filter program for use with PiCTEX Eu roTEX 99 Proceedings 1999 p 192 210 http www uni giessen de g029 eurotex99 nickalls pdf Nickalls RWD 2000 mathsPIC 2 1 http www tex ac uk tex archive graphic
297. nline setplotsymbol tiny BJA graphs make thin line a bit thicker for the OUP graphs newcommand thinline setplotsymbol large thickline inputfile isoqdata8 dat 1 6 start of file lt isoqdata8 dat gt loop 1 969695 Iteration number 1 q mac40 iso 1 6 point q5 5 2 325176 manual point q10 10 2 25427 point q15 15 2 185525 point q20 20 2 118877 point q25 25 2 054262 point q30 30 1 991617 point q35 35 1 930882 point q40 40 1 872 point q45 45 1 814913 point a50 50 1 759567 point a55 55 1 705909 point a60 60 1 653887 point q65 165 1 603451 point q70 70 1 554554 point q75 75 1 507148 point q80 80 1 461187 point q85 85 1 416628 point q90 90 1 373428 point q95 95 1 331545 q10 10 00000 2 25427 q15 15 00000 2 18553 q20 20 00000 2 11888 q25 25 00000 2 05426 q30 30 00000 1 99162 q35 35 00000 1 93088 q40 40 00000 1 87200 q45 45 00000 1 81491 q50 50 00000 1 75957 q55 55 00000 1 70591 q60 60 00000 1 65389 q65 65 00000 1 60345 q70 70 00000 1 55455 q75 75 00000 1 50715 q80 80 00000 1 46119 q85 85 00000 1 41663 q90 90 00000 1 37343 q95 95 00000 1 33154 q5 5 00000 2 32518 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 82 q90 q95 plot 10 00000 2 25427 plot 15 00000 2 18553 plot
298. note that this is a Perl program and so the command has to be issued as part of the Perl system command launchcam12 p1 conf conf2 c_as3rn conf projdir home user camomiletop theatredata 2004 Mar 18 11 23 system tarballs camomile 0 1_040411 camomile camomile A 1 P projdir c conf 16 4 After the Camomile data program exits Once the Camomile data program has terminated we then create a subdirectory in the project directory called pdata the p indicating that this subdirectory relates to Printing data to contain all the files required for printing as well as those generated during the printing process While this directory can be placed anywhere it is convenient during the current development period to keep all the files and directories relating to a given operation together while at the same time keeping the camomile raw data separate from the derived processed data launchcam12 p1 create the new pdata subdirectory projpdatadir projdir pdata mkdir projpdatadir Start time Since various programs need to know the start time both in Unix time and in GMT time we now make these times available by writing them to a special ASCII file text file called starttime dat which can then be read by any process needing this important information The starttime dat file is written by the program launchcam12 pl as follows it 1aunchcam12 p1 CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nick
299. nt thispagestyle empty to avoid page nos oddsidemargin 17mm framebox beginpicture use sf font for figures for BJA fontfamily cmss selectfont normalsize linethickness 0 9pt 2 normalsize my manual p 23 structure copied from mac des m ISOflurane Delta for N2O 0 75 66 6666 104 1 17 pointnumber 200 y units 12cm 2 2 5 454545 paper units mm 5 454545cm xrange 5 100 yrange 0 4 2 6 axes L ticks 10 0 2 paper units 0 7mm 3 818181cm xrange 8 100 yrange 0 4 2 6 axes T setcoordinatesystem units lt 7mm 3 818181cm gt note xunits amp yunits are different setplotarea x from 8 to 100 y from 4 to 2 6 axis top CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 67 want to print only some of the L axis scale 0 6 2 4 so do it manually axis left ticks withvalues 0 cdot 6 0 cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 1 cdot 8 2 cdot 0 2 cdot 2 2 cdot 4 at 0 60 0 80 1 00 1 20 1 40 1 60 1 80 2 00 2 20 240 axis bottom ticks withvalues 0 10 20 30 40 50 60 70 80 90 100 at 0 10 20 30 40 50 60 70 80 90 100 axis right 767070 using N2O 6776 shift 0 7523 ticks withvalues 0 O cdot 2 0 cdot 4 O cdot 6 O cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 at 0 7523 0 9523 1 1523 1 3523 1 5523 1 7523 1 9523 2 1523 2 3523 extra 50 right axis shift
300. nt line counter CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 252 chomp dataline removes the line ending print the line to the log file print printlog dataline filename ifile n print the line is dataline n place the two params into an array value split dataline get no of items should be only two items nitems value 1 print no of items in the line nitems n time value 0 parametervalue value 1 determine the least time J file counter if j 1 starttimeunix time else if time lt starttimeunix starttimeunix time only require the first UNIXtime from this file if n 1 last n is line counter end of line loop end of file loop close fieldsfile print printlog finished reading all the binlog files n d Decode the Unix start time local time The start time in Unix time is required later by the subroutine makegnnfiles in the script binlog2gnn p1 in order to be able to split up the data files created by the script binlog2data p1 into one page data files files containing data which will be typeset on a single page of the Anaesthetic Record We now decode the Unix start time fields2PDATA pl starttimeunix has been determined above starttimegmt localtime starttimeunix originalgmt starttimegmt needed for printing header on anaes sheet below pr
301. nter log file open my logg dnalarm log die ERROR can t open dnalarm log file n THE grab current time my time now unix time seconds my time now string localtime time now unix print logg dnalarm log time now string Unix time now unix n print logg log of my Perl dnalarm3 pl program W copy the Kalarm calendar file to this dir with new name if Ce kalarm calendar path 1 print logg copying the calendar ics file gt dn calendar ics W THE grab the current directtory pathname my thisdir cwd my copy string cp kalarm calendar path thisdir dn calendar ics system copy string and croak could not run copy string OS ERROR Perl best practice p 280 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 209 else print ERROR cannot copy the cal file n read the calendar file set the eventFLAG my eventnumber 0 counter to count the number of DIABETES events my eventFLAG OFF open my calfile dn calendar ics die ERROR can t open file dn calendar ics n now read each line in the file and place parameters into an array print reading the CAL file line by lineWn print logg reading the CAL file line by lineWn reset these variables to zero BEFORE starting the WHILE loop my uid1 0 my uid2 0 my uid ce my S text1 0 my text2 0 Hn
302. ntfiles projpdatadir print done W HHH now start the optional printing process CHAPTER 9 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 145 now move to the project pdata dir to CALL the print prog lt plotgnnk2 pl gt print moving dir gt projpdatadir Wn chdir projpdatadir print the new dir is n system pwd THE now start running the printing process by running lt plotgnnk pl gt print now calling perl plotgnnk2 pl Wn system perl plotgnnk2 pl THE finally copy the starttime file to the base dir for safekeeping print now copying file lt starttime dat gt to project dir Wn system cp v starttime dat goto jump print OPTION print 4n n print Press P to PRINT results q to quit p lt STDIN gt chomp p imortant here to remove the lt CRLF gt if ae eq p check program exists if e printall pl print sending data to the printer now An system perl printall pl print done n n else print ERROR can t find program lt printall pl gt n else print returning to original dir now n n THE jump THE now return to the orig dir print returning to datexsim n returndir home dick allfiles camomiletop datexsim chdir returndir print DERE EER E EER RE N N N n print
303. o simply leave the list as it was add drugname Abacavir add drugname Abacavir Lamivudine add drugname Abciximab add drugname Acacia add drugname Acacia Starch Tragacanth add drugname Acamprosate add drugname Acarbose add drugname Acebutolol add drugname Acebutolol Hydrochlorothiazide add drugname Aceclofenac add drugname Acemetacin add drugname Acenocoumarol add drugname Acetarsol add drugname Acetazolamide add drugname Acetic acid add drugname Zinc sulphate Lithium succinate add drugname Zinc undecenoate Undecenoic acid add drugname Zoledronic acid add drugname Zolmitriptan add drugname Zolpidem add drugname Zonisamide add drugname Zopiclone add drugname Zotepine add drugname Zuclopenthixol add drugname Zuclopenthixol acetate add drugname Zuclopenthixol decanoate add drugname von Willebrand factor Factor VIII Chapter 14 Diabetes decision support system RWD Nickalls 2006 December 13 2014 aHOUSE book xenon ch diabetes tex 14 1 Introduction The Diabetes decision support system con sists of a diabetes widget which offers in formation and support as well as an alert ing system to remind the anaesthetist to repeat blood sugars etc This alert system uses the excellent Linux KDE Kalarm util ity see below The diabetes widget system described here is a working prototype which has proved to be extremely
304. oes to hospital Invited presentation to the Nottingham Linux Users Group Nottingham UK September 18 2008 e Nickalls RWD 2006 MAC values In Allman KG and Wilson IH Eds Oxford Handbook of Anaesthesia 2006 Oxford University Press UK pp 1160 1162 e Nickalls RWD 20052 Interfacing the PC to medical equipment Invited talk to the Nottingham amp East Midlands Society of Anaesthesia NEMSA Queen s Medical Centre April 8 2005 mini symposium on Information Technology e Nickalls RWD 2005b Linux in the operating theatre CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickals 7 Invited presentation to the Nottingham Linux Users Group Nottingham UK March 16 2005 Nickalls RWD 2004a Critical Software in Anaesthesia a doctor s view of what is needed Invited presentation to the Institute of Physics and Engineering in Medicine one day conference on The software medical device London November 12 2004 Nickalls RWD 2004b Age corrected MAC Invited talk to the Nottingham amp East Midlands Society of Anaesthesia NEMSA Queen s Medical Centre October 8 2004 mini symposium on MAC elderly patients and confusion Nickalls RWD 2004c An open source anaesthesia workstation for the NHS Presentation to the Patient Safety Network meeting IBIS Hotel Birmingham UK April 27 2004 Nickalls RWD and Dales S 2003 Camomile an open source anaesthesia record keeper and information system
305. oller bottom left of screen CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 13 D CEO ECA Eile project Entry Timer View Help RRMA e DP OMK T7 tool sol ske BARC Ee Recommendations Konqueror o Location Edit View Go Bookmarks Tools Settings Window Help MandrakeSoft gt MandrakeStore gt MandrakeFxnert 93 MandrakeSoft F9 News 100 aot 9 FOOD AARP E gt Location 8 dick alfiles camomiletop aneshelp tracheostomy nodeS html z 50 Ned Up Previous 33 Next About this document Up Tracheostomy amp recommendations Previous Heat 20 diathermy oH Main Recommendations EET 10 1 All theatre staff should be aware that an airway fire may occur during trachesotomy 5 2 Have a fire extinguisher immediately available It should be mounted inside the operating theatre near the entrance In practice a carbon dioxide fire extinguisher will 0 be the usual choice Halon fire extinguishers are significantly better for operating EE ia theatre fires but their use is declining owing to environmental concerns ECRI 1996a Bn 1000 1996b 3 Have a bowl of saline and wet drapes available on the surgical instrument trolley at all sooj times Baur 1999 4 Have a self iling ventilation bag eg Ambu bag available for ventilating the patient with room air
306. olor trigger repeat interval until message my out kalarm bell color trigger repeat interval until message print setting new DIABETES alarm n print sending Kalarm string out Wn print logg setting new DIABETES alarm Wn print logg sending Kalarm string out n system qq out and croak could not run out OS ERROR Perl best practice p 280 HHHH SUBS ymdhm time string sub ymdhm THE format yyyy mm dd hh hh passing only one time_string into array my time string _ print processing parameter time string Nn now get the until time as yyy mm dd hh mm from the time string routine modified from fields2PDATA pl CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 213 note the main items are lt space gt separated except hh mm ss format is Sun Jan 25 13 24 35 2004 format is Sun Jan 5 13 24 35 2004 THE note x get two spaces after the Month if days 10 see SUB tedname in launchcam12 pl HH if two spaces in posn 8 and 9 then remove one space if substr time_string 7 2 eq substr time_string 7 2 replace spaces with commas time string tr THE make an array my stgmt split time string day stemt 0 not used my month stgmt 1 my date stgmt 2 my st stgmt 3 my year stgmt 4 noitems stgmt 1 not used
307. onary bypass using an automated anaesthesia record keeping system Br J Anaesthesia 89 398 404 Nickalls RWD 1998 TEX in the operating theatre an Anaesthesia applica tion TUGBOAT 19 239 241 http www tug org TUGboat articles letters tb21 3 tb60nick pdf Nickalls RWD and Mapleson WW 2003 Age related iso MAC charts for isoflurane sevoflurane and desflurane in man British Journal of Anaesthesia 91 170 174 http bja oupjournals org cgi reprint 91 2 170 pdf Nickalls RWD and Ramasubramanian R 1995 Interfacing the IBM PC to medical equipment the art of serial communication ISBN 0 521 46280 0 pp 402 Cambridge University Press Noseworthy M 1937 St Thomas s Hospital Reports London 2 54 from Rushman Davies and Atkinson 1996 Noseworthy M 1943 British Journal of Anaesthesia 18 4 p 160 from Oldham 1963 Middleton 1958 Noseworthy M 1945 Anesthesia and Analgesia 24 221 from Rushman Davies and Atkinson 1996 Noseworthy M 1953 Anaesthesia 8 43 from Noseworthy 1963 Noseworthy M 1963 Anaesthetic record card Anaesthesia 18 209 212 Oldham KW 1963 Anaesthetic and operation records Anaesthesia 18 213 216 Rushman GB Davies NJH and Atkinson RS 1996 A short history of anaesthe sia the first 150 years Butterworth Heinmann Oxford UK see chapter 14 Monitoring p 154 161 Sanderson IC and Monk TG 2003 Standard anesthesia terminologies how ca
308. open my logg 7 dnalarm log die ERROR can t open dnalarm log file n print logg TEST button pressed n print TEST button pressed Wn grab current time my time now_unix time seconds my time now string localtime time now unix print logg dn alarm log time now string Unix time now unix An print logg log of Perl dn alarm demoRED pl program Wn HE for NO recurrence we need NO trigger time AND the u until delay must be LESS than the i delay so we make u NOWtime 2mins and set the i time to 5mins my until unix time now unix 120 2mins in secs my until string localtime until unix my until ymdhm ymdhm until string print until time until ymdhm 42 mins n print interval time 5 mins n print logg until time Suntil_ymdhm 2 mins n print logg interval time 5 minsWn format is until u 2005 12 13 15 36 include terminal spaces my until u until ymdhm the period during which it repeats Ht THE set a new alarm need i to be gt time to u my message qq time for a COFFEE break Ahh my out kalarm b c red i 0005 until message print setting new RED COFFEE alarm n print sending Kalarm string out Wn print logg setting new COFFEE alarm n print
309. ored a collaboration with Department of Computing and Informatics Nottingham Trent University with a view to rewriting the software and implementing a more robust and scalable architecture However funding was unsuc cessful Collaboration with Nottingham University Hospitals 2008 In December 2008 we embarked in conjunction with Professor Mahajan Department of Anaesthesia on a collaboration with the Department of Medical Physics at the Nottingham University Hospitals City Hospital Campus with a view to developing a stand alone real time MAC monitor for use by anaesthetists This project failed to progress owing to insufficient resources 1 3 The Linux project Towards the end of 2002 I formed an open source collaboration with Simon Dales Software engineer Oxford UK During 2003 2004 the original program was rewritten from scratch for the Linux operating system the data acquisition and display module in C C by SD and the printing amp processing modules in Perl GNUplot and ATEX 2e by RWDN The resulting working stand alone Linux prototype has been up and running in the thoracic operating theatre at the City Hospital Nottingham since 2004 used by both consultant and trainee anaesthetists and has been very successful see illustrations at the end The program gives a continuous trend display of a variety of measured and derived parameters as well as help and other general information allows inp
310. our gnudatafilename file g hour print the new output filename gnudatafilename Mn open outfile gt gnudatafilename die can t open the outfile n write some headers to the outfile outfileheader1 Camomile gnuplot datafilename gnudatafilename outfileheader2 date print outfile outfileheader1 n print outfile outfileheader2 n write info to the timefile print timefile hour unixtime gmtime gnudatafilename n space calculate new elapsed time from begining of new hour newet elapsedtime 3600 hour 1 print outfile newet space paramvalue space unixtime n end of elsef Htend o while close infile close outfile A typical example of a gnn file the file sat g03 is as follows There are three fields elapsed time parameter value unix time which are space separated In this example the data was collected every 30 40 seconds or so and the elapsed times are seen to be 31 76 121 etc The unix time field is retained as a check The 03 in the filename extension g03 indicates that it represents data collected during the third hour sat g03 87 500000 1080559619 88 000000 1080559664 89 500000 1080559709 93 000000 1080559754 94 500000 1080559799 95 000000 1080559844 31 76 121 166 211 256 CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 232 301 95 000000 1080559889 346 95 000000 1080559934 391 95 000000 108055
311. own menu of drugs and IV fluids was de rived from the NHS Dictionary of Medicines and Deviced DM D website a username and password are required The listing we used was the Virtual Therapeutic Moiety VTM database and was downloaded every few weeks This very comprehensive listing is added to periodically by the NHS and is intended to be ultimately a list of all drugs and associated European wide numeric codes for use in the NHS In 2006 this list consisted of approximately 1800 drugs and drug combinations st Entry Timer View Help Drugs Entry Aprotinin Atracurium Atropine Bicarbonate 8 4 j Blood packed cells Blood whole Bupivicaine Cefuroxime hmat Cephradine Cisatracurium Cryoprecipitate Gases Dexamethasone x Alarms Monitors Pumps Other Stuff EE Text 5 21 12 57 40 COZ insp i 65 kg 175 cm 17 years M RR Figure 13 1 Screenshot showing the pull down menu and the drug Bupivacaine selected 167 CHAPTER 13 DRUG DICTIONARY RWD Nickalls 168 13 2 Initial drug list The drug list uploaded to the workstation was u drugs conf a typical example from June 2003 being as follows 4 canomile conf drugs01 cfg 15 June 2003 add drugname Adrenaline add drugname Alfentanil add drugname Atracurium add drugname Atropine add drugname Bicarbonate 8 4 add drugname Blood packed cells add drugname Blood whole add drugname
312. pl print sending data to the printer now Mn system perl printall pl print done n n else print ERROR can t find program lt printall pl gt n else print returning to original dir now n n G Finally we return to the original directory returndir home dick allfiles camomiletop datexsim chdir returndir print roo kkk kk n n n n print FINISHED An print WMuWMnWnsekekelekokokokokokolokolelokolelolelelelelelefNnNn CHAPTER 9 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 143 9 2 The program launchcami2 pl 8 usr bin perl launchcam12 pl CALLed by the Tk frontend widget tklaunch2 pl THE April 10 2004 for launching camomile and the printing program HH RWD Nickalls works well THE 1 new version to use Simon s new camomilefields2tex version THE HH write code to first check that all supporting programs are present THE print making a time encoded base directory Wn grab the starttime timenowgmt localtime timenowunix time now create the projdir as a timerelated filename call the SUB tedname to generate the projdirname format of tedname home dick allfiles camomiletop theatredata date we pass the timenowGMT value to the tedname sub print calling sub tedname for time encoded dirnameWn projdir tedname timenowgmt remember to add the at
313. place so we now move to the pdata directory in prepara tion for the next phase data processing and call the Perl coordinating program plotgnnk 2 pl as follows it 1aunchcam12 p1 chdir projpdatadir Data processing launch program plotgnnk2 pl The next phase is to process all the data and generate all the necessary dvi pdf and ps files so we can then print them out at a suitable time usually at the end of the operation and keep copies for archiving All the data processing is coordinated by the Perl program plotgnnk 2 pl so the next thing it to launch this program as follows it 1aunchcam12 p1 print now calling perl plotgnnk2 pl gt Mn system perl plotgnnk2 pl CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 227 During the data processing we write comments to the screen and also write detailed comments to the log file printlog txt In addition we keep a detailed log of the start times for a number of parameter files as these files are created in 1 hour chunks this data is collected in the file timefile txt 16 5 Reading the starttime dat file We read the starttime dat file right at the begining of data processing in order to access a the unix start time and b the name of the operation directory This information is on the first and second data lines in the file Both these parameters are passed by the coordinating program plotgnnk 2 pl to the program cam2gnnh pl 16 6 Accessing t
314. ploggnnk2 pl determine the earliest start time from GO1 files in timefile dat file put the start time GMT year month day hrs mins sec into an array then determine how many hours worth of Gnn files there are st is the start time hh mm ss from the lt starttime dat gt file see above JJ gnnmax 01 returns gnnMax print printlog start time st Nn print printlog GnnMax gnnmax Mn extract the separate hh mm ss values start times split st starthour start time 0 startminute start time 1 startsecond start time 2 now print all the graphs for all Gnn files from 01 to GnnMax for gnn 1 gnn lt gnnmax gnn gnn 1 1 first determine time in secs to the begining of next full hour deltah 3600 startminute 60 startsecond generate correct start hour depending on Gnn value h starthour gnn hminusi h 1 hplusi h 1 if h 0 hminus1 23 if h 23 hplusis0 q 900 qq 1800 qqq 2700 qqqq 3600 force 24hour clock if h lt 10 h 0 h if hminusi lt 10 hminusi 0 hminusi if hplusi lt 10 hplusi 0 hplus1 deltahminusqqqg deltah qqqq deltahminusqqq deltah qqq CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 234 deltahminusqq deltah qq deltahminusq deltah q deltahplusqqqq deltah qqqq deltahplusqqq deltah qqq deltahplusqq deltah qq deltahplusq deltah q t1 hminus1 00
315. point q70 70 1 554554 70 1 554554 point q75 75 1 507148 75 1 507148 point q80 80 1 461187 80 1 461187 point q85 85 1 416628 85 1 416628 point q90 90 1 373428 90 1 373428 point q95 95 1 331545 95 1 331545 drawline q5q10q15q20q25q30q35q40g45q50q55q60q65q70q75q80q85q90g95 plot 5 2 325176 10 2 25427 q5q10 plot 10 2 25427 15 2 185525 q10q15 plot 15 2 185525 20 2 118877 q15q20 plot 20 2 118877 25 2 054262 q20q25 plot 25 2 054262 30 1 991617 q25q30 plot 30 1 991617 35 1 930882 q30q35 plot 35 1 930882 40 1 872 q35q40 plot 40 1 872 45 1 814913 q40q45 plot 45 1 814913 50 1 759567 q45q50 plot 50 1 759567 55 1 705909 q50q55 plot 55 1 705909 60 1 653887 q55q60 plot 60 1 653887 65 1 603451 q60q65 plot 65 1 603451 70 1 554554 q65q70 plot 70 1 554554 75 1 507148 q70q75 plot 75 1 507148 80 1 461187 q75q80 plot 80 1 461187 85 1 416628 q80q85 plot 85 1 416628 90 1 373428 q85q90 plot 90 1 373428 95 1 331545 q90q95 drawpoint q10q20q30q40q50q60q70q80q90 put bullet at 10 2 25427 q10 put bullet at 20 2 118877 q20 put bullet at 30 1 991617 q30 put bullet at 40 1 872 q40 put bullet at 50 1 759567 q50 put bullet at 60 1 653887 q60 put bullet at 70 1 554554 q70 put bullet at 80 1 461187 q80 put bullet at 90 1 373428
316. pondence oaoa a 48 5 Interfacing the serial port using Perl 49 5 1 Introduction ss sesos seepe oe eea sepa e se 49 5 2 Device SerialPort pm llle 49 5 3 Sending program as3sim pl llle 50 5 4 Receiving program dn getfile2 pl ll Je 6 Age corrected MAC 56 6 1 Introduction s 43 Geese n s 3 Shea Pe v up Rear ce ax 56 6 1 1 MAC subroutine MS DOS 57 6 2 Age corrected MAC charts lens 59 6 3 Generating the charts lees 60 6 3 1 A data file for a single iso MAC curve ll 61 6 3 2 mathsPIC script for drawing the whole graph 62 6 3 3 Final mathsPIC program for making the version of BJA charts for the Oxford Handbook of Anaesthesia 22 6 3 4 Output mac iso8t mt code from the previous mathsPIC program 79 64 References s ic Ro E BALK GS Vh XS qp aere wu 89 7 Age amp temperature corrected MAC charts 92 7 1 Introduction s s se secco ler 92 7 2 Program macatdes2 pl 2 2 93 7 3 Program macatdes2 m lees 102 7 4 TEX file macdes034 mt ees 107 7 5 Program macATdes2batch p1 for automating the pdf output 115 7 6 Test program MACsolver pl 22e 124 7 6 1 Output datafile macsolver out txt 130 7 1 References i s koe OR Rom m SR we SOP AC a GE NT Pos wy RUN 132 II The front end coordinating program 134 8 ThePerl Tk front end 135 81 Introduction N ON EE RUE ON Re ER OE 135
317. print the gmt part is day month date st year n print logg the gmt part is day month date st year n but Kalarm requires that both month and date are in numerals if month eq Jan month 01 if month eq Feb month 02 if month eq Mar month 03 if month eq Apr month 04 if month eq May month 05 if month eq Jun month 06 if month eq Jul month 07 if month eq Aug month 08 if month eq Sep month 09 if month eq Oct month 10 if month eg Nov month 11 if month eq Dec month 12 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 208 my ymdhm year month date hh mm return ymdhm Htend of sub T close END THE end of prog 14 5 Diabetes alarm program dn alarm diabetes3 pl usr bin perl RWDN Thurs 16Dec2005 d demo alarm diabetes2 pl use warnings use strict use Carp allows croak use Fatal qw open close for errors use Perl6 Builtins qu system use Getopt Long for commandline stuff use version use Cwd grab this dir DN alarm diabetes2 pl modified from dn alarm DIABETES1 pl runs Kalarm initialising my kalarm calendar path home dick kde share apps kalarm calendar ics my OS ERROR H create a pri
318. processed as n n n CHAPTER 13 DRUG DICTIONARY RWD Nickalls 179 else print NO the string has no n 13 7 Initial data listing The above program outputs the list in the existing order as follows showing that the list is not ordered alphabetically this just reflects the fact that drugs are added to the list by the NHS simply in the order they are considered etc The program then orders the list alphabetically to make it easier to find drugs in the pull down menu see below Where drugs are in combinations then the program makes a new entry for each of the combined drugs while including each of the other ones so each drug combination appears several times but each time with a different drug first This naturally swells the drug listing in this case from about 1842 entries to 2258 see below lt 1 gt lt Acebutolol gt lt 68088000 gt lt 2 gt lt Paracetamol gt lt 90332006 gt lt 3 gt lt Acetazolamide gt lt 33664007 gt lt 30 gt lt Alprazolam gt lt 111127002 gt lt 31 gt lt Alprostadil gt lt 109119001 gt lt 32 gt lt Insulin glargine gt lt 126212009 gt lt 33 gt lt Insulin lispro gt lt 388454007 gt lt 34 gt lt Insulin aspart gt lt 388452006 gt lt 35 gt lt Metformin gt lt 109081006 gt lt 36 gt lt Metformin Rosiglitazone gt lt 409120009 gt lt 37 gt lt Glipizide gt lt 26124005 gt lt 38 gt lt Gliclazide gt lt 325238000 gt lt 39 gt lt Alteplase gt lt
319. pulse oximetry and of course small computers From an interfacing point of view a very significant and far reaching feature was incorporated into virtually all early medical monitoring devices namely a specialised se rial communications interface known as the RS 232 port Equally significant therefore was the decision by IBM to incorporate the same RS 232 port into the IBM Personal Computer which appeared in 1981 Fortunately all IBM compatible PCs since then have also incorporated the RS 232 serial port Owing to the wisespread use of the RS 232 interface in medical equipment it soon became a relatively easy matter to use a PC to access the numerous measured parameters output by patient monitoring devices and consequently anaesthetists increasingly ex plored methods for automating data collection and processing with a view to developing useful trend displays of measured data real time calculation of derived parameters and hard copy data printouts The RS 232 interface is set to be replaced in the relatively near future by the Medical Interface Bus MIB IEEE 1073 This a high tech high speed medical plug and play version of the familiar domestic USB interface and will greatly facilitate medical device inter connectivity largely by allowing the relevant interface software to be more easily standardised An automated anaesthesia record is significantly superior to the usual hand written record since it samples data more frequently and mor
320. pwindow gt Photo file gt anim gif topwindow gt Button relief gt flat image gt camelimage gt place relx gt 0 005 rely gt 0 QUIT button topwindow gt Button text gt QUIT padx gt 20 pady gt 20 relief gt raised background gt LightBluel activebackground gt LightBlue2 command gt amp quit gt place relx gt 0 05 rely 0 115 gt pack side gt left expand gt 1 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 198 c XENON project team topwindow gt Button text gt c The XENON project team padx gt 10 pady gt 10 relief gt flat background gt LightGrey activebackground gt LightGrey foreground gt Black activeforeground gt Black gt place relx gt 0 35 rely gt 0 016 DIABETES 20mins button topwindow gt Button text gt DIABETES 20 mins padx gt 10 pady gt 10 relief gt raised background gt LightBlue3 activebackground gt LightBlue2 foreground gt Blue activeforeground gt Red command gt amp diabetes20 gt pack side 2 right expand gt 1 gt place relx gt 0 5 rely gt 0 3 DIABETES 30min
321. r HOWTO use DIABETES 40 mins VIEW logfile DIABETES 50 mins VIEW calfile DIABETES 60 mins HELP on diabetes Figure 14 2 Screen showing the diabetes alarm widget right and the Linux command line window left The widget displays 5 blue time option buttons 20 60 minutes which initiate the red interval alarm as shown in the following figure ss Session Edit View Bookmarks Settings Help 800162303 363 looking for the next event events found termating now Gejsetting new DIABETES alarm sending Kalarm string kalarm b c red t 2006 04 22 16 53 i 0005 u 2006 04 23 16 33 DIABETES repeat blood sugar VIEW logfile HOWTO use ITU Sliding Scale DELI Run S amp Dextrose at 60 mis hr VIEW calfile etting an alert Run insulin actrapid 1Unit ml ancelling an alert at 0 5 Units hr esting Author mMol L units hr ersion date Glucose Insulin rate Figure 14 3 Screen showing the alarm help window bottom left which opens by clicking on the HOWto use button The help window doubles as a diabetes management information as well as a help feature for using the alarm widget itself CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 218 Session Edit View Bookmarks Settings Help cancelling existing DIABETES alarm sending command kalarm 886993 618 looking for the next event events found termating now setting new DIABE
322. r sat g03 31 87 500000 1080559619 76 88 000000 1080559664 121 89 500000 1080559709 166 93 000000 1080559754 211 94 500000 1080559799 256 95 000000 1080559844 301 95 000000 1080559889 346 95 000000 1080559934 391 95 000000 1080559979 436 94 500000 1080560024 g The log file timefile txt Concurrently with the previous process the program cam2gnnh p1 creates the timefile dat file which holds the start times for each of the gnn files see below This file is very useful as a check on the functioning of the cam2gnnh p1 program timefile txt 01 1071580301 2003 12 16 13 11 41 bp s g01 02 1071583865 2003 12 16 14 11 5 bp s g02 03 1071587465 2003 12 16 15 11 5 bp s g03 01 1071580276 2003 12 16 13 11 16 sat go1 02 1071583840 2003 12 16 14 10 40 sat g02 03 1071587440 2003 12 16 15 10 40 sat g03 CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 275 h The base log file baselog data After processing all the parameter fields gnn files we then access extract the anaesthetists log file base log using the camomilefielf2tex utility as before only this time using the 1 switch and the s tex option since we are wanting to access a log file it cam2gnnh p1 system camomilefield2tex p projdir l base o baselog data Note that since we are running this command from within the pdata subdirectory then the default location for the output fi
323. r r14 atan 5 2 tan s def r2d 180 pi V var d14 r14 x amp r2d var m 0 8 MAC point E34 34 25 etdes 34 25 point E35 35 amp etdes 35 point E36 36 amp etdes 36 point E37 37 amp etdes 37 point E38 38 amp etdes 38 point E39 39 amp etdes 39 point E40 39 75 amp etdes 39 75 color blue drawline E34 E37 color red drawline E37 E40 color black drawpoint E35 E36 E37 E38 E39 text turnbox s08deg boldmath 0 8 E37 polar r9 s08deg t9 deg var m 0 6 MAC point F34 34 25 amp etdes 34 25 point F35 35 amp etdes 35 point F36 36 amp etdes 36 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 101 point F37 37 amp etdes 37 point F38 38 amp etdes 38 point F39 39 amp etdes 39 point F40 39 75 amp etdes 39 75 color blue drawline F34 F37 color red drawline F37 F40 color black drawpoint F35 F36 F37 F38 F39 text turnbox s06deg boldmath 0 6 F37 polar r9 s06deg t9 deg now draw all the horizontal dashed lines setdashes linethickness 0 4pt var w134 1 left end of dashed lines var
324. r red drawline B37 B40 color black drawpoint B35 B36 B37 B38 B39 text turnbox s14deg boldmath 1 4 B37 polar r9 s14deg t9 deg var m 1 2 MAC point C34 34 25 amp etdes 34 25 point C35 35 amp etdes 35 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 3T 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 100 point C36 36 amp etdes 36 point C37 37 amp etdes 37 point C38 38 amp etdes 38 point C39 39 amp etdes 39 point C40 39 75 amp etdes 39 75 color blue drawline C34 C37 color red drawline C37 C40 color black drawpoint C35 C36 C37 C38 C39 text turnbox s12deg boldmath 1 2 C37 polar r9 s12deg t9 deg var m 1 0 MAC point D34 34 25 amp etdes 34 25 point D35 35 amp etdes 35 point D36 36 amp etdes 36 point D37 37 amp etdes 37 point D38 38 amp etdes 38 point D39 39 amp etdes 39 point D40 39 75 amp etdes 39 75 color blue drawline D34 D37 color red drawline D37 D40 color black drawpoint D35 D36 D37 D38 D39 text turnbox s10deg boldmath 1 0 D37 polar r9 s10deg t9 deg get slope of line var s direction D35 D40 radians va
325. rd in the usual way The output of all data processed by this SA module is stored in a separate PDATA sub directory i e we preserve the original pdata sub directory as follows camomiletop theatredata 2005 8ep 23 1342 camomiletop theatredata 2005 8ep 23 1342 fields camomiletop theatredata 2005 8ep 23 1342 pdata camomiletop theatredata 2005 Sep 23 1342 PDATA The suite of Perl programs making up this stand alone module is coordinated by the Perl program processdata pl All the programs and scripts required for processing and printing are stored in the 247 CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 248 camomiletop datexsim printfiles directory The various programs are as follows processdata pl coordinates the module in the operation directory fields2PDATA pl main program in the dir PDATA dir binlog2gnn pl converts binlog files to gnn files binlog2data pl converts binlog files to data files prtanes6 tex TeX file for typesetting the graphs prtdrug2 sty TeX style option required by printdrug tex prtdrug tex TeX file for typesetting the drug page base2texd pl ASCII to TeX conversion from keyboard entry log file 18 2 Running the processdata pl script To start the process we first need to move the Perl script processdata pl into the appropriate operation directory e g 2005 8ep 23 1423 we then need to move to that directory an
326. ring50b string50b value50b E string50a string50a string50b string50b print outfile lt lt EOF mathsPIC macDes1 m for Desflurane to create temp and age MAC chart corrections April 13 2005 documentclass a4paper article usepackage mathspic color usepackage decimal rotating setlength textheight 30cm setlength oddsidemargin 0cm begin document beginpicture DES MAC40 6 6 agent specific adjustments need to adjust Xunits Yunits MAC zero offset for N2O 50 and 67 the Ytick interval 0 5 for des as well as the space above and below the line space def age age AGE var m40 6 6 desflurane MAC40 def agecorr 10 0 00269 amp age 40 agecorr def etdes t m m40 amp agecorr 1 0 05 37 t etdes determine the X and Y axes lengths age dependent want to make the Y axis just longer than the line space for the ticks to work nicely we want left Yaxis to be an exact multiple of tick interval therefore we addsome extra and adjust with 0 2 increments for sevo top right use t 40 and MAC 1 6 var k2 1 6 m40 amp agecorr 1 0 05 37 40 j2 int K2 0 25 0 5 V 26 var y2 j2 0 5 0 5 bottom left use t 34 and MAC 0 6 var k1 2 0 6 m40 amp agecorr 1 0 05 37 34 jl int k1 0 25 0 5
327. rived parameters and greatly en hanced information display facilities Collecting and processing the data Since most monitoring equipment used in Critical Care environments has an RS 232 serial interface the process of data collection construction of trend graphics formatting and typesetting can be auto mated reasonably easily My own system is a menu driven re search application which uses compiled QuickBASIC programs to coordinate the CHAPTER 3 TEX IN THE OPERATING THEATRE RWD Nickalls 24 access display and printing of both real time physiological data and keyboard in puts The printing module uses IATEX to typeset the text and graphics to create the Anaesthesia Record in a format suited to the hospital notes The data from the various anaesthesia monitors is accessed via the serial port using a multiplexing device Individual parameters are then extracted using the relevant software for each of the various monitors see 1 for interfacing details relating to particular anaesthesia monitors Unfortunately there is currently no stan dardisation with regard to data formats for medical monitoring devices but this may well soon change with the development of the new international Medical Information Bus MIB standard IEEE 1073 During anaesthesia the program ac cesses and displays all the data in real time as graphic trends as well as deriving a number of so called value added pa rameters and p
328. rking theatre based prototype MS DOS program which was used in the thoracic operating theatre City Hospital A paper anaesthesia record for the patient notes was output using the open source programs GNUplot for graphic trends and IATEX 2g for typesetting Much of the initial work relating to interfacing medical devices via the serial port was published as a book by Cambridge University Press Nickalls and Ramasubramanian 1995 During 2002 2004 the program was ported to Linux see Section 1 3 and expanded to include alarms some basic decision support as well as the calculation of various useful so called value added real time parameters for example age dependent MAC Nickalls and Mapleson 2003 1 2 Difficulty with funding and R amp D During the past eight years or so I have tried to collaborate with various university departments with a view to R amp D Discussions with the Nottingham University Depart ments of Computing and Department of Electrical and Electronic Engineering in 2005 did not lead anywhere owing to lack of funding Unfortunately funding has not been forthcoming an EPSRC grant application in conjunction with Dept Med Physics Liver pool Univ Hosp was rejected see details below and therefore serious development has stalled These ventures are summarised below My original version was in QuickBasic 4 5 It was later ported to PowerBasic 3 5 Minimum Alveolar Concentration MAC of an anaesthetic agent is
329. rocessing keyboard entries At the end of the operation the program typesets the text and graphics to form the Anaesthesia Record The graphics are created using the ex cellent freeware program GNUPLOT which allows batch processing and will output graphics in IATEX picture format Armed with the maximum and mini mum values for each of the measured pa rameters the program writes the GNUPLOT input files and then calls GNUPLOT out putting the graphics in IATEX picture for mat and placing them into the appropriate directories The program then writes the BIEX input tex file and then calls IATEX to typeset the text and graphics Finally the dvi file is printed and put into the hospital notes In practice all this is per formed locally within the operating theatre such that the Anaesthesia Record is printed and placed in the patient notes just as the patient is returned to the recovery area Fig ure 1 shows the graphics page of a typical Anaesthesia Record Advantages of ASCII based systems The fact that both TEX and GNUPLOT use inputs which are ASCII based has the great advantage that their input files can be written on the fly by the coordinating computer program Such flexibility allows the final text and graphics of the document to be tailored to the data For example this allows the axes of graphs to be automati cally adjusted depending on maximum and minimum values Similarly text layout can be made to vary depen
330. rogram dn dmd5 pl ES EE SS se 13 6 Perl program reverse pl SS SS Es SS SS 13 7 Initial data listing ee 13 8 Th ordered list amp sod Be A Ey HOE REDE SEN ere ed 13 9 Adding drugs to the list llle 13 10Perl program add2list pl lens 13 11Logfile generated by add21ist pl 13 12Final list for pull down menu leen 14 Diabetes decision support system 14 1 Introduction oaa e 14 1 1 Kalarm and the iCalendar standard 14 1 2 VALARM specification from the RFC 2445 manual v 2 Nov 1908 RE RE HEEN EE EE eU AE 142 Kalarm eie enea N Ee RE RE Heeb ede ee bee aes 14 2 1 To show Kalarmicon SE SE SS SE se 14 2 0 Documentation ES SE SE SE SE SE ee ee 14 2 3 Initiating a diabetes alarm 14 2 4 Displaying a file SE SS SE SS ES se 14 2 5 Current alarm status SS SE SE SS SE se vil 147 148 148 148 148 149 149 149 149 149 151 151 156 156 157 159 160 160 162 162 163 167 167 168 169 169 170 178 178 179 180 181 182 184 CONTENTS 14 2 6 Cancelling an alarm llle 14 3 Alarm widget program dn tkalarm pl 14 4 Test demo programs dn alarm demoRED pl 14 5 Diabetes alarm program dn alarm diabetes3 pl 14 6 File viewer program dn tkviewer pl 14 7 Error message widget program dn errorbox pl
331. rojdir projdir sub tednamef returns a date time encoded filename gt projdir my startgmtstring 0 format is Sun Jan 25 13 24 35 2004 format is Sun Jan 5 13 24 35 2004 note get two spaces after the Month if days 10 if two spaces in posn 8 and 9 then remove one if substr startgmtstring 7 2 eq substr startgmtstring 7 2 now replace spaces with commas startgmtstring tr make an array stgmt split startgmtstring day stgmt 0 month stgmt 1 date stgmt 2 hms stgmt 3 year stgmt 4 noitems stgmt 1 now extract the hh mm ss part to get the hh mm hhmmss split hms hour hhmmss 0 min hhmmss 1 CHAPTER 16 PRINTING MODULE OVERVIEW RWD Nickalls 225 force two digit for date day of month as unix gmt uses only 1 char if less than 10 if date lt 10 date 0 date format the datestring as 2004 01 22 1341 datestring year month date hour min return home dick allfiles camomiletop theatredata datestring 16 3 Running the Camomile data program In practice the operation time encoded directory project directory is actually created by the Camomile data program To this end the Camomile data program is passed the required project directory name projdir at start up This is done using Camomile s P command line switch together with the name of a required configuration file as follows
332. rom from from from from from 34 34 34 34 34 34 10000 10000 10000 10000 10000 10000 hh Linethickness 1pt linethickness 1 00000pt Linethickness 1 00000pt 7 font CM cmr1i0 at 9 97226pt setplotsymbol setsolid 7 normalcolor endpicture end document 10 95983 to 39 85000 10 95983 7 L16R16 9 58985 to 39 85000 9 58985 Z4 L14R14 8 21987 to 39 85000 8 21987 Z4 L12R12 6 84990 to 39 85000 6 84990 L10R10 5 47992 to 39 85000 5 47992 LOSRO8 4 10994 to 39 85000 4 10994 LO6RO6 NOM DA CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 115 7 5 Program macATdes2batch p1 for automating the pdf output Since most anaesthetists do not have Perl installed on their Microsoft PCs they are unable to run the above interactive program for generating a single chart for a specific agent and age and so it was decided to distribute a CD with all the charts for all possible ages The following batch program generates all the desflurane charts one for each age placing all in the same directory The filenames are age encoded for convience usr bin perl Desflurane macATdes2batch pl from macatsdes1batch pl Dick Nickalls May 01 2005 E H w warning switch HE use Math Trig program name is O see black book p 211 timenowgmt localtime print Nn Hprint ORR coca kk ekke k ikke T1 print xx kV print xx MAC CHART
333. rom 0 40000 to 2 60000 want to print only some of the L axis scale 0 6 2 4 so do it manually axis left ticks withvalues 0 cdot 6 O cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 1 cdot 8 2 cdot 0 2 cdot 2 2 cdot 4 at 0 60 0 80 1 00 1 20 1 40 1 60 1 80 2 00 2 20 240 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 81 Vaxis bottom ticks withvalues 0 10 20 30 40 50 60 70 80 90 100 at 0 10 20 30 40 50 60 70 80 90 100 Vaxis right 969 using N2O 67 shift 0 7523 ticks withvalues 0 O cdot 2 0 cdot 4 0 cdot 6 O cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 at 0 7523 0 9523 1 1523 1 3523 1 5523 1 7523 1 9523 2 1523 2 3523 extra 50 right axis shift 0 5614 since this axis is off the graph then need new paper command but do not use axis option paper units 0 7mm 3 818181cm xrange 8 121 yrange 0 5614 2 3614 Y setcoordinatesystem units lt 0 7mm 3 818181cm gt setplotarea x from 8 00000 to 121 00000 y from 0 56140 to 2 36140 axis right seconds right axis for 50 oxygen shift 0 5614 ticks withvalues 0 O cdot 2 0 cdot 4 1 cdot 0 1 cdot 2 1 cdot 4 at 0 5614 0 7614 0 9614 1 1614 1 3614 1 5614 1 7614 1 9614 2 1614 2 3614 O cdot 6 O0 cdot 8 1 cdot 6 1 cdot 8 beginSKIP newcommand thickline setplotsymbol Large newcommand thi
334. rpose though the used enumeration is the same The phdb rcrd type field indicates what kind of physiological data you are requesting for example sr type 0 phdb rcrd type 1 Send current values of the physiological database sr type 0 phdb rcrd type 2 Send 10 s trended values sr type 0 phdb rcrd type 3 Send 60 s trended values sr type 0 phdb rcrd type 4 Send auxiliary phys information values 1 2 3 and 4 for field sr type are reserved for output values as you suggested So DRI PH DISPL 1 DRI PH 108 TREND 2 DRI PH 608 TREND 3 and DRI PH AUX INFO 4 The values correspond to subrecord type listed on page 10 of the specification although the constant names are not explicitly defined in the table In addition the texts in the Value field of the table on page 11 of the specification related to tx interval are incorrect Instead of texts Any positive value together with subrecord type the texts Should be Any positive value together with physiological record type referencing to field phdb rcrd type of struct phdb req rather than to the sr type field of struct sr desc the tx interval field specifies the transmission interval for the physiological data records the type of which is specified by the field phdb rcrd type together with subrecord type For 10s and 60s trends the transmission interval is however always fixed 10s and 60s In addition the special valu
335. rt time we can then determine an elapsed time for each data event In practice these times are expressed as so called Unix time seconds since 1st Jan 1970 Each line of a typical binlog file is a comma separated data pair where the first item is the Unix time and the second item is the parameter value An example of a typical sat binlog structure is as follows sat binlog sat binlog 1071580231 92 1071580236 92 1071580241 93 1071580246 93 5 1071580251 93 1071580256 93 1071580261 92 5 1071580266 92 The fields2PDATA pl script starts by determining the earliest data entry time for each of the binlog files and then setting this earliest time as the starttimeunix variable It does this by reading only the first Unix time entry in each of the binlog files reading each filename from an array of all such filenames and determining the earliest time It also writes comments to the logfile so we can check its progress if we need to investigate any errors fields2PDATA p1 CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 268 make an array of all required input filenames we are running this from the PDATA dir fieldfilename fields bp d binlog fields bp s binlog fields ecg rr binlog fields co2 exp binlog fields co2 insp binlog fields co2 rr binlog fields cvp binlog fields ecg hr binlog fields ecg rr binlog fields mac big binlo
336. s hh r14 0 708103747230623 hh var di4 ri4 180 pi hh G14 40 5713561737131 hh var m 0 8 Z44MAC 35 36 37 38 39 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 113 AA m 0 8 hh point E34 134 25 m m40 10 0 00269 34 40 1 0 05 37 734 25 E34 34 25000 4 72643 hh point ES5 135 m m40 10 0 00269 34 40 1 E35 35 00000 4 93192 hh point E36 136 m m40 10 0 00269 34 40 1 E36 36 00000 5 20592 hh point E37 137 m m40 10 0 00269 34 40 1 E37 37 00000 5 47992 hh point E38 138 m m40 10 0 00269 34 40 1 E38 38 00000 5 75391 hh point E39 139 m m40 10 0 00269 34 40 1 E39 39 00000 6 02791 0 05 37 0 05 37 0 05 37 0 05 37 0 05 37 35 36 37 38 39 hh point E40 39 75 m m40 10 0 00269 34 40 1 0 05 37 39 75 E40 39 75000 6 23340 color blue hh adrawline E34 E37 plot 34 25000 4 72643 37 00000 5 47992 4 4 E34E37 color red hh adrawline E37 E40 plot 37 00000 5 47992 39 75000 6 23340 E37E40 color black hh drawpoint E35 E36 E37 E38 E39 put bullet at 35 00000 4 93192 4 E35 put bullet at 36 00000 5 20592 4 E36 put bullet at 37 00000 5 47992 Z4 E37 put bullet at 38 00000 5 75391 4 E38 put
337. s amp NN hline end tabular ht pagestyle fancy CHAPTER 17 TYPESETTING PROGRAMS RWD Nickalls 245 fancyhead fancyfoot rhead An ae sthesia Record Log File hspace 1cm thepage rhead thepage lfoot hrule vspace 0 5 baselineskip copyright RWD Nickalls S Dales amp A Nice 1994 2004 sc an ae sthesia record system camomile Ntextit Linux newline textsc email textit dicknickalls compuserve com check location of the base log file typeout getting the base log file from parent dir input baselognew data A end document J f OoOtnote22222222 22z2 2 22 2 22 2 2 2 2 17 4 printall tex it usr bin perl printALL pl prints all the anes nn dvi and anes drug dvi files do in reverse order with drug on top if e anes 10 dvi system dvips anes 10 dvi elsef if e anes 09 dvi system dvips anes 09 dvi else if e anes 08 dvi system dvips anes 08 dvi else if e anes 07 dvi system dvips anes 07 dvi else if e anes 06 dvi system dvips anes 06 dvi else if e anes 05 dvi system dvips anes 05 dvi else if e anes 04 dvi system dvips anes 04 dvi else if e anes 03 dvi system dvips anes 03 dvi else if e anes 02 dvi system dvips anes 02 dvi else if e anes 01 dvi system dvips anes 01 dvi else print no anes nn d
338. s main newinstance popdict CHAPTER 12 CONFIGURATION FILES RWD Nickalls 164 Ncomment Nnewpage NSSS Windows 4 setup some windows newdict set widget parent main set class window pushdict Ahhhhhhhhhhhhhhhhhhhhhhhhhh hh top window Ahhhhhhhhhhhhhhhhhhhhhhhhhh set widget name widget top Vsetfwidget x 0 set widget y 0 set widget h 300 set widget w 1015 set fixed 1 newinstance popdict pushdict Ahhhhhhhhhhhhhhhhhhhhhhhhhh hh text window Ahhhhhhhhhhhhhhhhhhhhhhhhhh 4 setup text window set widget set widget set widget set widget set widget name widget text x 900 w 115 y 300 h 322 newinstance popdict Ahhhhhhhhhhhhhhhhhhhhhhhhhh hh bottom window Ahhhhhhhhhhhhhhhhhhhhhhhhhh pushdict 4 setup bottom window pushdict set subclass tabbedwindow set widget w 900 set widget y 280 set widget h 346 set widget name widget bottom big newinstance popdict CHAPTER 12 CONFIGURATION FILES RWD Nickalls 165 4 setup bottom window pushdict set widget title amp Main set widget parent widget bottom big set widget name widget bottom frame newinstance popdict pushdict set widget title ZZBottom set widget parent widget bottom frame set subclass tabbedwindow set widget x 100 set widget w 650 set widget w 550 set widget y 0 set widget
339. s 6o Encouraged by colleagues who tested these charts one for each of the three main inhalational agents I eventually submitted a paper to the British Journal of Anaesthesia November 2001 However it met with opposition from some of the reviewers who felt that my new paper and these charts failed to offer anything over and above Mapleson s original 1996 paper Well at one level this is true the raw data was the same in each paper However it was impossible to use the data presented in the Mapleson 1996 paper in a clinical setting to guide at all accurately the appropriate choice of end tidal agent concentration for a particular patient The reviewers simply failed to appreciate that by reformulating Mapleson s data and supplementing it with nitrous oxide data one could present the information in a way that would be a useful guide for practising anaesthetists and essentially eliminate the guesswork which was otherwise involved I therefore telephoned Bill Mapleson and asked if he would agree to be a co author as together we would stand a better chance of getting the paper published Bill Mapleson agreed immediately and we submitted a new version of the paper February 2003 which was then accepted and published in the British Journal of Anaesthesia Nickalls and Mapleson 2003 We were fortunate in that the article was also the subject of an editorial White 2003 Since then the use of these age corrected iso MAC charts have become g
340. s button topwindow gt Button text gt DIABETES 30 mins padx gt 10 pady gt 10 relief gt raised background gt LightBlue3 activebackground gt LightBlue2 foreground gt Blue activeforeground gt Red command gt amp diabetes30 gt pack side gt bottom expand gt 1 gt place relx gt 0 5 rely gt 0 42 DIABETES 40mins button topwindow gt Button text gt DIABETES 40 mins padx gt 10 pady gt 10 relief gt raised background gt LightBlue3 activebackground gt LightBlue2 foreground gt Blue activeforeground gt Red command gt amp diabetes40 gt pack side gt bottom expand gt 1 gt place relx gt 0 5 rely gt 0 54 DIABETES 50mins button CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 199 topwindow gt Button text gt DIABETES 50 mins padx gt 10 pady gt 10 relief gt raised background gt LightBlue3 activebackground gt LightBlue2 foreground gt Blue activeforeground gt Red command gt amp diabetes50 gt pack side 2 bottom expand gt 1 gt place relx gt 0 5 rely gt 0 66 DIABETES 60mins b
341. s ee 1 4 2 Data acquisition and display module 1 4 3 MAC display widget EE ES SS SS se 1 4 4 Decision support module llle 1 4 5 A diabetes alert module EE Se 1 4 6 Drug menu module SE EE ES se 1 5 SEre n shots e s ace bos N ER RE EE RR RR RUE EE Re RR s e ded Data processing in anaesthesia 2 1 Introduction 2 SS SS SS Ape se 2 2 History of the anaesthesia record ss SS ss Se 2 4 1 Background ss gc Em RR oe ea bb EER be RERO RSS 222 Automation lass 2 2 3 Guidelines 2 6645 6 dS mo o RR RE X SES 2 3 The anaesthesia workstation c n 2 3 1 Databases SS ee 2 3 2 The futures 2 0 64 4 2 4464 44 844 4 be nhc oe RR TX in the Operating Theatre The Datex AS 3 anaesthesia monitor 4 1 Introduction ooa SS SS SS ee 4 1 1 Software version len 4 1 2 Available software 42 Serial interface SS SS ee 42 1 Serial port connector ES EE EE 4 2 2 Cable connections osoo e eee 423 ProtoGolz cee a a EE ER Rue A Scere oS xU mad Co UUR RU P P2 WY CONTENTS vi 4 3 Transmission Request string ooa 29 43 1 Format N iis se as nat eee eom p a Bo 29 4 3 2 Transmission request command 30 4 4 Output data string format EE ES ES SE ss 32 45 List of parameter names o oo a 37 4 6 Example of data output ooa a 40 4 7 Corres
342. s ma n d E i d m d send the file sendfileO goto LASTLINE CPC xr my crlf r n my outstringi abcdefgi12345 crlf my outstring2 123x crlf write the strings to the port while 1 1 print outstring1 pass ob write outstring1 sleep 3 print outstring2 pass ob write outstring2 Sleep 3 LASTLINE close close any open files ob close croak can t close SERIAL PORT undef ob returns memory back to Perl ESUBEEEES see Sasa to send a file line by line sub sendfile works OK always send EOF character to signify the end CHAPTER 5 INTERFACING THE SERIAL PORT USING PERL RWD Nickalls 52 my ifile drugs txt local outfile make it local if in SUB best practices p if e ifile open outfile lt ifile croak ERROR can t open file ifile n now read each line in the file and place parameters into an array print reading the fields file lt ifile gt line by line n my dataline ny outstring my Len length of string my total_len 0 LINE while lt outfile gt next LINE if skip comments next LINE if 4 skip comments next LINE if skip blank lines grab the whole line as a string dataline _ outstring dataline determine the Byte size of the file Len length outstring total_len total_len Len chomp dataline remove the l
343. s mathspic dos Nickalls RWD and Mapleson WW 2003 Age related iso MAC charts for isoflurane sevoflurane and desflurane in man Br J Anaesth 91 170 174 http bja oxfordjournals org cgi reprint 91 2 170 pdf Nickalls RWD and Ramasubramanian R 1995 Interfacing the IBM PC to medical equipment the art of serial communication Cambridge University Press CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 91 Peyton PJ Chong M Stuart Andrews C Robinson GJB Pierce R and Thompson BR 2007 Measurement of anaesthetics in blood using a conventional infrared clinical gas analyzer Anesthesia and Analgesia 105 680 687 Syropoulos A Nickalls RWD 2000 A perl port of the mathsPIC graphics package TUGboat 2000 21 292 7 Syropoulos A and Nickalls RWD 2005 MathsPIC 1 0 http www tex ac uk tex archive graphics mathspic perl Syropoulos A and Nickalls RWD 2007 MathsPIC 1 1 http www tex ac uk tex archive graphics mathspic perl A new bug fix version February 2007 White D 2003 Uses of MAC Br J Anaesth 91 167 169 editorial Chapter 7 Age amp temperature corrected MAC charts aHOUSE book xenon ch macAT02 tex 7 1 Introduction The age amp temperature corrected MAC charts see Figure below enable anaesthetists to readily determine the appropriate End tidal ET concentration of the commonly used volatile inhalational anaesthetic agents isoflurane sevoflurane desflur
344. s6 tex base2tex pl prt drug2 sty prtdrug tex Feb 25 2004 plot pplateau pressure pplat binlog also plot rr on fo2 graph as well to catch rr gt 20 create a printer log file open printlog gt printlog txt die ERROR can t open printlog txt file n dH 286 CHAPTER 21 FIELDS2PDATA PL RWD Nickalls 287 gmt localtime print printlog printlog txt gmt n print printlog log of the printing module fields2PDATA p1 n print printlog this program is CALLed by lt processdata pl gt n print printlog start of perl fields2PDATA p1 Mn dHE determine the UNIXstarttime from binlog files make an array of all required input filenames we are running this from the PDATA dir fieldfilename fields bp d binlog fields bp s binlog fields ecg rr binlog fields co2 exp binlog fields co2 insp binlog fields co2 rr binlog fields cvp binlog fields ecg hr binlog fields ecg rr binlog fields mac big binlog fields mac n20 binlog fields mac vap binlog fields mv exp binlog fields n2o exp binlog fields nibp d binlog fields nibp s binlog fields o2 insp binlog fields pplat binlog fields sat binlog fields sat hr binlog fields temp 0 binlog fields temp 1 binlog fields tv exp binlog
345. se should one or more of the parameter files not exist as in this situation GNUplot graph plotting would fail since it requires that the final line must not have a comma at the end By using a dummy line which has no comma and only plots a point below the graph 20 and hence is never visibly plotted as the final line we are able to handle the failure of all or some of the parameter lines which therefore can all have a terminal comma CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 279 19 4 Run GNUplot on all the gnu files Once all the gnu files have been written then we run GNUplot on each one to generate each figure in IATEX 2g picture format Each printed sheet has five figures arranged horizontally from top to bottom The legends are on the right hand side so they are not obscured by the binding when placed in the patient notes fields2PDATA p1 print printlog running GNUPLOT on all the gnu files n system gnuplot plot bp gnu system gnuplot plot sat gnu system gnuplot plot fo2 gnu system gnuplot plot co2 gnu system gnuplot plot tv gnu system gnuplot plot vap gnu print printlog GNUPLOT done n 19 5 Write the header line for the printouts Each printed sheet has a header indicating the start time GMT and unix and the dvi filename which indicates which hour the sheet refers to as follows Record start time Thu Feb 12 12
346. sition of the bottom right hand corner of the widget relative to the bottom right hand corner of the screen and the sign is associated with the top left hand corner of the widget relative to the top left hand corner of the screen In order to make the script function globally i e much as a DOS batch file would it first has its mode set to executable using the Linux command chmod u x runcamomile which adds the executable permission for the user and then the script which must have no file extension is placed in the PATH which in the case of a Linux user s batch file means that it is placed in the standard directory usr local bin which is always in the Linux PATH i e usr local bin runcamomile Now whichever directory the user types the command runcamomi le in then Linux will move to the datexsim directory and run the tklaunch2 p1 program 8 3 Pressing the RUN button The subroutine and code which starts the Camomile program is as follows Clicking on one of the button first deletes the screen widget to prevent another button being pressed calls the associated program or message widget and finally restores the screen widget when the launched program terminates For example pressing the RUN button launches the perl program 1aunchcam12 p1 by calling the subroutine 1aunch as follows sub launch if Ce launchcam12 pl first remove the Tk screen topwindow destroy if
347. ssdata log die ERROR can t open file lt processdata log gt n get progName and its base dir namei FindBin Bin programname FindBin Script print logfile this LOG generated by program lt programname gt Nn timenow localtime print logfile timenow n print logfile Running program name1 programname n thisdir cwd grab the PATH of current working dir print logfile thisdir n create the PDATA dir mkdir PDATA 0744 format mkdir dir mode black book p 283 a2 Copy the required software tools to the PDATA directory We now copy a suite of files required for data processing and printing from the datexsim printfiles directory to the PDATA directory We use the secure copy command from the File Copy module Note that with this command we can only copy one file at a time In the extract below we copy the file fields2PDATA pl processdata pl copy the required printTOOLS files from camomiletop datexsim printfiles to PDATA fromdir datexsim printfiles filei fields2PDATA pl copy fromdir filei PDATA if eq print logfile filei file copied OK n else print logfile file1 COPY ERROR n After copying all the files currently six files we then have everything in place for processing the data so we now move to the pdata directory in preparation for the next ph
348. t mathsPIC macDes1 m for Desflurane to create temp and age MAC chart corrections April 13 2005 documentclass a4paper article usepackage mathspic color usepackage decimal rotating setlength textheight 30cm setlength oddsidemargin 0cm begin document beginpicture DES MACAO 6 6 agent specific adjustments need to adjust Xunits Yunits MAC zero offset for N2O 50 and 67 the Ytick interval 0 5 for des as well as the space above and below the line space def age 34 AGE var m40 6 6 desflurane MAC40 def agecorr 10 0 00269 amp age 40 agecorr def etdes t mxm40 amp agecorr 1 0 05 37 t etdes determine the X and Y axes lengths age dependent want to make the Y axis just longer than the line space for the ticks to work nicely we want left Yaxis to be an exact multiple of tick interval therefore we addsome extra and adjust with 0 2 increments for sevo top right use t 40 and MAC 1 6 var k2 1 6 m40 amp agecorr 1 0 05 37 40 j2 int k2 0 25 0 5 var y2 j2 0 5 40 5 bottom left use t 34 and MAC 0 6 var k1 0 6 m40 amp agecorr 1 0 05 37 34 jl int k1 0 25 0 5 var y12 j1 0 5 0 576 now do the paper command only for axes B here as no decimals paper units 2cm 1 3cm xrange 34 40 yrange y1 y2 axes B ticks 1 0 5 MEE now do LEFT a
349. t 6 x h16 new rotated legends from macATdes2 pl var y2 2 6 var y1 0 4 newcommand ylegend sf End tidal in 100 oxygen air determine string length gt Yunits etc newlength ylength settowidth ylength ylegend Ytext answer ylength number ylength 37 0 4 halflength 3 818 0 777 y units text turnbox 90 ylegend 25 y1 y2 y1 2 0 777 beginSKIP newcommand rightylegend sf End tidal in N _2 0 newlength rylength settowidth rylength rightylegend text answer rylength number rylength 37 1 0 halflength 3 818 0 7188 y units text turnbox 270 rightylegend 140 y1 y2 y1 2 0 7188 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 78 endSKIP 9 beginSKIP newcommand myleft framebox begin minipage 29mm Vcentering V End expired in 100 oxygen end minipage Nr text myleft 45 2 0 endSKIP newcommand myrightb fbox V begin minipage 3 5cem 3 8cm V End expired in V hspacex 9mm 67 hspace 8mm 50 V hspacex 9mm N _2 O hspace 7 5mm N _2 0 V end minipage 96 V end of newcommand text myrightb 89 143 2 657 1 End expired in 67 hspace 8mm 50 N 2 O hspace 7 5mm N _2 0 newcommand mybottom Age y
350. t filename start with hour set to zero hour 0 start inputting lines of data need to get the time associated with line 1 interval 45 secs oldelapsedtime 0 LINE while lt infile gt next LINE if skip comments CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 273 next LINE if 4 skip comments next LINE if skip blank lines grab the whole line as a string dataline _ place the params into an array value split dataline print value 0 value 1 value 2 n assign the elapsedtime and param values unixtime value 0 gmtime value 1 GMT yyyy mm dd hh mm ss elapsedtime value 2 elapsed time secs paramvalue value 3 chomp paramvalue remove the line ending to help maths multiply the rr values by 50 to make them fit range 0 1000 if file eq co2 rr paramvalue paramvalue 50 save data only every interval secs elapsedtime unixtime starttimeunix determine true elapsedtime if elapsedtime lt oldelapsedtime interval next LINE else oldelapsedtime elapsedtime now print data into 1 hr files make NewElapsed time relative to begining of new hour hour 1 first real hour hour will be zero on first run thro algorithm so goes to else if elapsedtime lt hour 3600 space calculate new elapsed time from begining of new hour newet elapsedtime 3600 hour 1 print o
351. t q 35 35 1 930882 point q 40 40 1 872 point q 45 45 1 814913 point q 50 50 1 759567 point q 55 55 1 705909 point q 60 60 1 653887 point q 65 65 1 603451 point q 70 70 1 554554 point q 75 75 1 507148 point q 80 80 1 461187 point q 85 85 1 416628 point q 90 90 1 373428 point q 95 95 1 331545 drawline q 5 q 10 q 15 q 20 q 25 q 30 q 35 q 40 q 45 q 50 q 55 q 60 q 65 q 70 q 75 q 80 q85q90q95 drawpoint q 10 q20 q30 q40 q50 q60 q70 q80 q90 6 3 2 mathsPIC script for drawing the whole graph Once having generated all the different data files above a mathsPIC script was written to draw the axes and to draw the graph by inputting all the relevant data files For example the following mathsPIC script mac iso7 m inputs each of the various data files one for each iso MAC curve and draws the complete isoflurane graph outputting the IATEX form of the graph For those not familiar with TEX and IATEX the complete process to be run through is roughly as follows we first process the mathsPIC script via the mathsPIC program a Perl program to generate the TEX mt output file and then we IATEX this file to generate the dvi output file Next we generate a PostScript version using the dvips utility and then define the Bounding Box BB using GhostScript and form the EPS version i e by including the BB coordinates and then renaming the file
352. t uses only 1 char if less than 10 if date lt 10 date 0 date THE format the datestring as 2004 01 22 1341 datestring year month date hour min return home dick allfiles camomiletop theatredata datestring y END Part III The data program Camomile Chapter 10 System overview December 13 2014 allfiles camomile cam book ch overview tex 10 1 Introduction The anaesthesia work station accesses data from both the keyboard and the Datex AS 3 anaesthesia monitor This data is processed and made available to the anaesthetist in various ways for example as trend data on the screen as a printed Anaesthesia Record as age corrected MAC and alarm and warning information Other aids for the anaesthetist are in the form of help files for decision support access to an epidural and double lumen tube database and timers e g use with diabetic patients as reminders for determining blood sugars and adjustment of insulin glucose therapy The software is open source and designed and written for the Linux operating system For the purposes of description the software components fall into the following categories e a graphical front end module for launching the various systems e a data collection and display module e a printing module e an epidural and double lumen tube database e an HTML help module These are now described briefly in turn 10
353. tabase program TEPID Note that the program lt tklaunch2 p1 gt is itself launched by the bash script lt runcamomile gt Allows the user to search the TEPID database to determine the predicted tube length size and epidural depth for a given patient by inputting age gender height weight 8 2 The BASH script runcamomile In practice the graphic front end is itself launched by the small BASH script runcamomile The reason for using a preliminary script to launch the Perl Tk program is because this allows the initial start up size and position of the Tk widget to be easily controlled using the geometry commandline option usr bin bash runcamomile sh BASH script to change dir to gt datexsim amp start the loader widget echo changing directory to allfiles camomiletop datexsim cd home dick allfiles camomiletop datexsim perl tklaunch2 pl geometry 300x400 50 300 Note that the opening size and position in the screen is set using the geometry switch and its various options width height x shift y shift see Lidie and Walsh 2002 p 409 The format for the geometry switch is as follows geometry width x height i x shift i y shift See the book Mastering Perl Tk by Lidie S and Walsh N O Reilly CHAPTER 8 THE PERL TK FRONT END RWD Nickalls 137 The sign option determines the location of the origin of the screen coordinates The sign is associated with the po
354. tarttimeunix originalgmt fname n close outfile5 print isses lt gnnheader dat gt done n 16 10 Typeset the graphic pages using IATEX 2e We now typeset the graph pages and create the output formats dvi ps and pdf on the fly The TEX file for the graphs is prtanes6 tex The style option is prtdrug2 sty We create the PostScript files using dvips We create the pdf files using pdflatex print printlog running LATEX on prtanes6 tex n system pslatex prtanes6 tex dvifilename anes gnn dvi copy the dvi file to have a gnn dvi filename system cp v prtanes6 dvi dvifilename make the ps files psfilename anes gnn ps system dvips dvifilename o psfilename print printlog LATEX done n now make the pdf files system pdflatex prtanes6 tex pdffilename anes gnn pdf copy the pdf file to include a gnn pdf filename system cp v prtanes6 pdf pdffilename 16 11 Typeset the drug file using IATEX 2e Processing the drug file log file is slightly more complicated owing to the fact that the typesetting is done using BIEX 2e Consequently since the anaesthetists can enter data using the keyboard we need to filter out all non TEX material essentially to escape certain ASCII characters for example we would modify rightarrow etc This conversion is currently done by the Perl program base2texd pl which processes the origina
355. ted in yellow in the alarms window indicating a minor departure from the normal range CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 12 ERGE TT ER ETD GEES AN ESTHESIA RECORD lick on the RUN Menon Hegel Qum button to start the 5 CAMOMILE ipaesthesia progran PRINT LAST CASE c The CAMOMILE project team 2004 TE ee Figure 1 10 Screen showing use of the Patient Data widget o Camomile 0 1 031121 Operation Eile Project Entry Timer View Help NEER oroke BP 100 30 D EE 80 150 100 33 vemm TH 20 z Men rgssss Cor E ETE EES CO insp First Datex HR ecg 86 N2O MAC 046 HR sat 88 5 an aa Vap MAC 1 00 BP sys 1260 Total MAC 148 BP dia 80 01 0 vapour SEV je 43 controls INIBP sys 0 00 ag NIBP dia 0 00TV sn s espn coz 10 T000 Sampie Periods RespR ECG 0 URP XL TV exp 600 500 EE MVol 521 Last read on Temp1 00 a Laste Thu May 3 12 33 52 2001 Em d A fus dev dew ttySQ He pa IF Checksum 75 75 bad checksum 43 Sound off Beep off n d me ETE ea ea ii Zi Camomile 0 1 031121 op B dick localhost localdomain o mae 16 2 Figure 1 11 Screen showing the Datex contr
356. the document template for the agenda file ATTACH FMTTYPE application binary http host com templates agen da doc END VALARM The following example is for a VALARM calendar component that specifies a procedural alarm that will trigger at a precise date time and will repeat 23 more times at one hour intervals The alarm will CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 192 invoke a procedure file BEGIN VALARM TRIGGER VALUE DATE TIME 19980101T050000Z REPEAT 23 DURATION PT1H ACTION PROCEDURE ATTACH FMTTYPE application binary ftp host com novo procs felizano exe END VALARM Before describing the diabetes alert widget and the associated Perl programs initiated by clicking on the various buttons we first give a brief overview of the Kalarm system and its command structure with illustrations linked to the diabetes alarm 14 2 Kalarm The Linux Kalarm utility is an established and versatile alarm tool which can be de veloped for use with the anaesthesia workstation Kalarm is maintained by David Jarvie software astrojar org uk http www astrojar ork uk linux kalarm htm1 The latest version is 1 4 0 April 2006 Kalarm can be accessed either using a form via the mouse from the taskbar icon or via the command line and has good documenta tion via a standard kalarm help command Alarms can be both initiated and cancelled using commands issued via the comman dline 14 2 1 To show Kal
357. the value and display the numeric value continuously and arrange for the value to be displayed in red and also trigger an audible alarm when less than a critical value initially I chose the critical value to be 0 86 see the program below An interesting problem regarding the administration of anaesthesia at that time was the fact that with no less than four inhalational anaesthetic vapours in common use halothane isoflurane desflurane sevoflurane and it was therefore virtually impossible to remember the appropriate settings for each combination of agent and age Conse quently the prospect of inadvertent awareness was ever present and anaesthetists tended therefore to learn how to use one particular agent for most things even though other agents may well be more suitable in certain circumstances In view of this problem the display of age corrected MAC was an immediate success since one could now use any agent for any patient irrespective of age simply by administering the agent in terms of MAC and with the great benefit of essentially eliminating the possibility of inadvertent awareness simply by ensuring the age corrected MAC was greater than a certain critical value now taken to be 1 MAC Hardman JG and Aitkenhead AR 2005 In fact we now had a working practical way of giving anaesthetics in terms of MAC units as originally foreseen by Mapleson many years earlier in his insightful Clover lecture Mapleson 1979 Our system at that tim
358. ucose Insulin rate nmMol L units hr n n0 39 0 n4 69 11n7 99 2 nl0 14 9 3 n15 199 4 n 20 5 text sr create the help object needs to go last my help topwindow gt Help title gt XENON diabetes help change parameter values here see file Help pm listfontsize gt 14 detailsheaderfontsize gt 14 detailsfontsize gt 14 height gt 20 screen height 50 listwidth gt 20 detailswidth gt 30 font gt Times does not work weight gt normal does not work H end variable gt helparray 14 4 Test demo programs dn alarm demoRED p1 There are two test buttons which trigger demo programs these show a yellow dn alarm demoYELLOW p1 and a red dn alarm demoRED pl demo alert The following is the red demo pro gram usr bin perl dn alarm demoRED pl CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 206 RWDN Thurs 24April2006 to look like a diabetes alarm main difference is that the trigger option is NOT used here use warnings use strict use Carp allows croak use Fatal qw open close f for errors use Perl6 Builtins qu system use version use Cwd to get this path T my kalarm calendar path home dick kde share apps kalarm calendar ics my OS ERROR HE create a printer log file
359. useful alarm capability the PROCEDURE type of alarm SHOULD be treated by the Calendar User Agent as a potential security risk Example The following example is for a VALARM calendar component that specifies an audio alarm that will sound at a precise time and repeat 4 more times at 15 minute intervals BEGIN VALARM TRIGGER VALUE DATE TIME 19970317T133000Z REPEAT 4 DURATION PT15M ACTION AUDIO ATTACH FMTTYPE audio basic ftp host com pub sounds bell1 01 aud END VALARM The following example is for a VALARM calendar component that specifies a display alarm that will trigger 30 minutes before the scheduled start of the event or the due date time of the to do it is associated with and will repeat 2 more times at 15 minute intervals BEGIN VALARM TRIGGER PT3OM REPEAT 2 DURATION PT15M ACTION DISPLAY DESCRIPTION Breakfast meeting with executive n team at 8 30 AM EST END VALARM The following example is for a VALARM calendar component that specifies an email alarm that will trigger 2 days before the scheduled due date time of a to do it is associated with It does not repeat The email has a subject body and attachment link BEGIN VALARM TRIGGER P2D ACTION EMAIL ATTENDEE MAILTO john doeQhost com SUMMARY REMINDER SEND AGENDA FOR WEEKLY STAFF MEETING DESCRIPTION A draft agenda needs to be sent out to the attendees to the weekly managers meeting MGR LIST Attached is a pointer
360. utfile newet space paramvalue space unixtime n else close existing gnn file and open a new one gnn 1 close outfile hour hour 1 use two digits for the filename extension eg g04 if hour lt 10 hour 0 hour gnudatafilename file g hour print the new output filename gnudatafilename Wn open outfile gt gnudatafilename die can t open the outfile Mn write some headers to the outfile outfileheader1 Camomile gnuplot datafilename gnudatafilename outfileheader2 date print outfile outfileheader1 n print outfile outfileheader2 n write info to the timefile print timefile hour unixtime gmtime gnudatafilename n CHAPTER 19 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 274 space calculate new elapsed time from begining of new hour newet elapsedtime 3600 hour 1 print outfile newet space paramvalue space unixtime n JHtend of elsef end o while close infile close outfile TES A typical example of a gnn file the file sat g03 is as follows There are three fields elapsed time parameter value unix time which are space separated In this example the data was collected every 30 40 seconds or so and the elapsed times are seen to be 31 76 121 etc The unix time field is retained as a check The 03 in the filename extension g03 indicates that it represents data collected during the third hou
361. utting of drug and other information and automatically prints out the Anaesthesia Record at the end of the operation in a form suitable to be placed directly into the patient s notes as a final record In time we would like to incorporate a suitable database develop CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 4 smart alarm and decision support software extend the on line help facility and to explore connectivity with the hospital information system HISS Support is in house by the Group members see below Electrical safety issues re lating to the hardware are overseen by Ged Dean Medical Physics City Hospital Linux support is by Adrian Nice Department of Information and Computing Technology City Hospital This project has been the subjet of many lecture presentations over the last few years and these are listed in the References Group members The project team consists of the following members e Richard WD Nickalls Consultant in Anaesthesia amp Intensive Care Depart ment of Anaesthesia Nottingham University Hospitals City Hospital Campus Nottingham UK e Simon Dales Software Engineer PurrSoft Oxford UK e Adrian K Nice Senior Systems Developer Department of Information and Computing Technology Nottingham University Hospitals City Hospital Campus Nottingham UK e Ged Dean Clinical Engineer Department of Medical Physics Nottingham Uni versity Hospitals City Hospital Campus Nottin
362. utton topwindow gt Button text gt DIABETES 60 mins padx gt 10 pady gt 10 relief gt raised background gt LightBlue3 activebackground gt LightBlue2 foreground gt Blue activeforeground gt Red command gt amp diabetes60 gt pack side 2 bottom expand gt 1 gt place relx gt 0 5 rely gt 0 78 4 TEST COFFEE demo button topwindow Button text gt TEST c padx gt 10 pady gt 5 relief gt raised background gt Green activebackground gt Yellow foreground gt Black activeforeground gt Red command gt amp testcoffeed gt pack side gt bottom expand gt 1 gt place relx gt 0 05 rely gt 0 36 TEST diabetes demo button topwindow gt Button text gt TEST d padx gt 10 pady gt 5 relief gt raised background gt Green activebackground gt Red foreground gt Black activeforeground gt Blue command gt amp testdiabetes gt pack side 2 bottom expand gt 1 gt place relx gt 0 05 rely gt 0 45 CHAPTER 14 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 200 HOWTO use button topwindow gt Butto
363. veloped as part of the NHS National Program for Information Technology NPfIT A demonstration program can be accessed from the SNOMED CT home page Another NPfIT dictionary database of interest to anaesthetists is the Dictionary of Medicines and Devices DM d http www dmd nhs uk This consists of a number of coordinated XML encoded pharmaceutical related databases which also incorporate the associated SNOMED encoding Of particular interest to anaesthetists is the Virtual Therapeutic Moiety V TM database of approximately 2000 official drug names which are to be used henceforth in all computer interactions relating to drugs This list is updated weekly and can be downloaded from the website password required This list is currently incorporated into the experimental program used in the thoracic theatre 2 3 2 The future The future holds the exciting prospect of developing sophisticated and possibly Open Source anaesthesia workstations giving anaesthetists access to good data displays and trends sophisticated alarms smart alarms real time and predictive modelling for drugs and physiological parameters information management and decision support systems Sanderson Watson and Russell 2005 A good overview of what might be possible in a USA office setting was presented recently by Gage 2002 References e Adams AP 1996 A revised anaesthetic record set Royal College of Anaes thetists Newsletter 27 1996 8 9 CHA
364. vi camteama5dvi dvi paper a5 geometry 420420 system perl tklaunch2 pl geometry 300x400 50 300 HE sub epidural if e epidural pl first remove the Tk screen topwindow destroy if Tk Exists topwindow THE now clear the window system clear topwindow gt bell beeps if click window p 296 system perl epidural pl tHisystem perl tube pl system perl tklaunch2 pl geometry 300x400 50 300 else print ERROR n print can t find program lt epidural pl gt n n exit HHH 8 4 Useful Linux tools to use with the launcher In practice it may be easier to use many of the existing Xwindows utilities for displaying manual pages examples info and warnings etc Note that the widget size and screen location can be easily controlled from the commandline using the geometry option Chech the relevant options by viewing the manpages for each of these utilities Note there is a FullScreen option for Tk xclock xman xmessage xdvi for viewing dvi information pages xpdf xghostscript for ps files and pdf Chapter 9 The l1aunchcami 2 pl program December 13 2014 oAHOUSE book xenon ch launchcam tex 9 1 Introduction This perl program is currently used to launch and coordinate the camomile system It is launched from the perl Tk widget Note that currently the program coordinates the printing process by copy
365. vi files available n print the drug sheet last on top if e anes drug dvi print printing file anes drug dvi n system dvips anes drug dvi else print no anes drug dvi file available n Part V Data processing stand alone printing module Chapter 18 Printing the stand alone SA module December 13 2014 allfiles book xenon ch printmod sa tex 18 1 Introduction Although the automated in line printing module described in chapter X worked well in processing the data immediately at the end of an operation by clicking on the print last case button on the launcher widget it was difficult to implement retrospectively for example when wanting to re processing a different database of binlog files typically placed in the fields subdirectory The pdata sub directory contains the original output of processed data A typical directory structure of an operation database which for example started at 13 42 hrs on September 23 2005 is as follows camomiletop theatredata 2005 8ep 23 1342 camomiletop theatredata 2005 Sep 23 1342 fields camomiletop theatredata 2005 8ep 23 1342 pdata A new stand alone printing module was therefore developed which a was simpler i e did not use Simon Dales camomilefields2tex C program or need to read the starttime dat file and b could be pointed at a particular fields subdirectory to generate the full printable anaesthesia reco
366. w2 39 85 right end of dashed lines point L16 w1 ycoord A37 point R16 w2 ycoord A37 point L14 w1 ycoord B37 point R14 w2 ycoord B37 point L12 w1 ycoord C37 point R12 w2 ycoord C37 point L10 w1 ycoord D37 point R10 w2 ycoord D37 point L08 w1 ycoord E37 point R08 w2 ycoord E37 point L06 w1 ycoord F37 point R06 w2 ycoord F37 drawline L16 R16 L14 R14 L12 R12 L10 R10 L08 R08 L06 R06 linethickness 1pt setsolid normalcolor endpicture end document EOF close outfile system mathspic mfilename system latex mtfilename system xdvi macdes1 dvi system dvips o psfilename dvifilename system gv psfilename THE calculate etdes from mac t sub etdes Yodef etdes t m m40 amp agecorr 1 0 05 37 t etdes passed two parameters mac for iso mac curve and t temp my array _ my mac t first get the mean mac 0 t 0 initialise mac array 0 mac 464 465 466 467 468 469 CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 102 t array 1 temp use 1 8 instead of m40 for now fix later etdes mac 1 8x agecorr 1 0 05 37 t return etdes END 7 3 Program macatdes2 m This mathsPIC program is output by the above program macatdes2 p1 Perl and it this program which draws the char
367. x time The subroutine works out how to split up the data file into 1 page chunks of 1 page time periods by using the difference between the operation start time and the unix time on each line of data Note that the Unix start time was passed to the binlog2gnn p1l program by the calling program fields2PDATA p1 If the elapsed time exceeds the page duration the default is 1 hour then the current gnn file is closed and the next one opened etc In practice however the default sampling interval is 45 second intervals this interval can be easily varied depending on the graph plotting typesetting requirements So although the original binlog data accumulates every 5 seconds from the Datex AS 3 monitor the actual printed data is typically thinned out somewhat purely because there is a limit to the density of data which can usefully be printed on the Anaesthesia Record If better resolution is required then higher resolution printing can be performed at a later date by making both the sampling interval and the page duration shorter for example we could plot a the data by making the sampling interval from the data file 0 seconds and having a page duration of 6 minutes that is by plotting 72 data points at 5 second intervals per 6 minute page binlog2gnn pl sub makegnnfiles get the starttimeUNIX passed from commandline value gt ARGV the starttimeUNIX is obtained originally from file lt starttime dat gt
368. xes ticks etc left axis 100 oxygen CHAPTER 7 AGE amp TEMPERATURE CORRECTED MAC CHARTS RWD Nickalls 103 axis left left axis for 100 oxygen V ticks withvalues 2 5 3 06 3 5 4 0 4 5 5 06 5 5 6 0 6 5 7 0 7 5 8 0 8 55 9 0 9 5 10 0 10 5 11 0 11 5 12 0 12 5 13 0 at 2 5 3 3 5 4 4 5 5 5 5 6 6 5 7 75 8 85995 10 10 5 11 11 5 12 125 13 o modified from mac des7 m axis right 67 N2O scale offset for 67 4 22 V ticks withvalues 0 0 5 1 0 1 5 2 0 2 5 3 0 3 5 4 06 4 5 5 0 5 55 6 0 6 5 7 0 7 5 8 0 8 5 at 4217 4 717 5 217 5 717 6 217 6 717 7 217 7 717 8 217 8 717 9 217 9 717 10 217 10 717 11 217 11 717 12 217 12 717 modified from mac des7 m extra right axis 50 N2O as axis off graph then need new paper command Jo opaper units mm 3 5294cm xrange 5 117 yrange 0 8653 3 465 paper units 2cm 1 3cm xrange 34 40 75 yrange 3 142 y2 use offset 50 axis right second right axis for 50 oxygen Offset 3 142 ticks withvalues 0 0 5 1 0 1 5 2 0 2 5 3 0 3 5 4 0 4 5 5 0 5 5 6 0 6 5 7 0 7 5 8 0 8 5 9 0 9 5 at 3 147 3 647 4 147 4 647 5 147 5 647 6 147 6 647 7 147 7 647 8 147 8 647 9 147 9 647 10 147 10 647 11 147 11 647 12 147 12 647 initial conditions linethickness 1pt
369. y Squill gt lt 10046311000001100 gt lt 0017 gt lt Acetic acid Turpentine oil1 10044711000001105 lt 0018 gt lt Acetone gt lt 333511003 gt lt 0019 gt lt Acetylated wool alcohols Liquid paraffin gt lt 9888211000001103 gt lt 2249 gt lt Zoledronic acid gt lt 134600006 gt lt 2250 gt lt Zolmitriptan gt lt 108406003 gt lt 2251 gt lt Zolpidem gt lt 96231005 gt lt 2252 gt lt Zonisamide gt lt 398762003 gt lt 2253 gt lt Zopiclone gt lt 321174005 gt lt 2254 gt lt Zotepine gt lt 321641006 gt lt 2255 gt lt Zuclopenthixol gt lt 9723611000001100 gt lt 2256 gt lt Zuclopenthixol acetate gt lt 9723711000001109 gt lt 2257 gt lt Zuclopenthixol decanoate gt lt 9723811000001101 gt lt 2258 gt lt von Willebrand factor Factor VIII gt lt 319925005 gt 13 9 Adding drugs to the list Since some of the anaesthesia drugs would be missing from the NHS list then one had to add these In order to do this conveniently a file containing the drugs we wanted to add was created as follows 4 dn drugs2add dat input file for the dn dmd4 pl program Local drugname official NHS drugname Adrenaline Atracurium Isoprenaline Frusemide Furosemide Dextrose saline Glucose Sodium chloride Normal Saline 0 9 Sodium chloride Saline 0 9 Sodium chloride Bicarbonate 8 4 Sodium bicarbonate Sodium bicarbonate 8 4 Sodium bicarbonate HAS4 5 Human albumin solution 4 5 HAS20 Human albumin solutio
370. y n print tvfile set grid n print tvfile xmin 0 xmax 3600 n print tvfile ymin 0 ymax 1000 n print tvfile plot xmin xmax ymin ymax n print tvfile 250 with lines 1 n print tvfile 500 with lines 1 n print tvfile 750 with lines 1 n tvexpfilename tv exp g gnn rrfilename co2 rr g gnn if e tvexpfilename print tvfile tvexpfilename using 1 2 with linespoints 4 3 n else print printlog no tv exp gnn files n if e rrfilename print tvfile rrfilename using 1 2 with linespoints 4 10 n else print printlog no rr gnn files n print tvfile dummyline Mn close tvfile print printlog TV gnu done n now create the Vap file vapIN vapOUT MAC open vapfile gt plot vap gnu die ERROR can t open plot vap gnu file n print vapfile usr bin gnuplot n print vapfile plot vap gnu script made by plotgOla pl n print vapfile set terminal latex n print vapfile set output plot vap pic n print vapfile set size 1 376 smallheight n print vapfile set xtics timeline n print vapfile set noytics n print vapfile set y2tics 0 1 2 3 4 n y2label qq Sat circ FIO _2 bullet print vapfile set y2label hello hello n print vapfile set nokey n print vapfile set grid n pr
371. ystem cp v prtdrug pdf anes drug pdf 18 8 Printing the paper sheets Finally we print out all the sheets making up the Anaesthesia Record This currently consists of one or more drug sheets the log file together with a number of 1 hour graphic sheets presenting the measured parameters These are usually printed out in the operating theatre and placed in the patient notes In practice a small Perl program printall p1 sends the final files to the printer in reverse order as follows usr bin perl CHAPTER 18 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 263 printALL pl do graphs in reverse order if e anes 10 dvi system dvips anes 10 dvi else if e anes 09 dvi system dvips anes 09 dvi else if e anes 08 dvi system dvips anes 08 dvi else if e anes 07 dvi system dvips anes 07 dvi else if e anes 06 dvi system dvips anes 06 dvi else if e anes 05 dvi system dvips anes 05 dvi else if e anes 04 dvi system dvips anes 04 dvi else if e anes 03 dvi system dvips anes 03 dvi else if e anes 02 dvi system dvips anes 02 dvi else if e anes 0O1 dvi system dvips anes 01 dvi else print the drug sheet last on top if e anes drug dvi system dvips anes drug dvi else 1 Chapter 19 Printing the stand alone SA 06 module December 13 2014 allfiles book xenon ch printmod sa06 tex

Download Pdf Manuals

image

Related Search

Related Contents

[U4.81.02] Opérateur CALC_NO  GE 134996600B (0711) Clothes Dryer User Manual  清水建設株式会社様  Epson Stylus Pro 7700  Edsal RT362466-4 Instructions / Assembly  MHC-GNV111D  YS1326B-0703  NEC XV17+ User's Manual  Installation, Operation and Maintenance Manual  Philips 46677107826 halogen lamp  

Copyright © All rights reserved.
Failed to retrieve file