Home

Documentation - Nickalls.org

image

Contents

1. 200 150 P ws ii S06 eo a a BP dias o booeoge99go d a A 5 M AS P ad 5 MUS CVP iue ABO ropa ue 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 TETT e 9 9e 0 0 9 00 veo Oe 30 Pr lings DS E j9 0 0 0 0 0 PERI 2196 debt qo 2 EE RD AA ER EMILE 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 730 Ee BUE Resp rate e JOGE 0 20 min t 09 30 09 45 10 00 10 15 4 Isoflurane 96 3 np 5 exp 1 ooo Total 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 IATEX picture format The record shows blood pressure BP heart rate HR central venous pressure CVP oxygen saturation of haemoglobin Sat inspired oxygen O2 inspired nitrous oxide N20 expired carbon dioxide CO tidal
2. eo 28 Quit ANAESTHETIC SHEET Open Chy Hospital Nottingham UK i Omnem n Patient label Help ANAESTIETISTS Sonoros Full size E TE 13 First w i en Page 10 m Page 5 Prev Next 130 Pagers Pagerio Last lie rr Bw is E e Vieu PS Eco H Back 1 1100 1315 1330 a s 10 EE E NN This is xdvik 22 40y TILib rendering on xl Xdvi prtan 4 dick localhoa file home dic gy A Ey E g a ug Document n SyKwrite 4 K a i 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 lies 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
3. ALZ camomie 0 1_ amp fle thomeydick I dick localhos 5 xavi fepe EB 15 08 Figure 1 13 Screen showing real time data plus preview of printout Location Edit View Go Bookmarks Tools Settings Window Help A RRE home page Antibiotic websit Blood loss guide BP high 1 BP high 2 Drugs Diabetes CHN Guidelines calcium low calcium high 1 calcium high 2 MAC Pulse Oximetry Sepsis Tracheostomy e Thoracic notes The following RAH handbook was internet 2004 Malignant hyperpyrexia main index Xenon5 Anaesthesia Workstation e Background This project started life in about 1992 or so in the form of a series of small projects directed towards writing interfacing software 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 Interfacing downloaded from the the IBM PC to medical Royal Adelaide Hospital us equipment anaesthetic handbook The art of serial Figure 1 14 Screen showing help desk home page CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 14 Location Edit View Go Bookmarks Tools Settings Window Help Jaana OG ERARA J i E gt Locat
4. E pushdict BP level EP graph and Now Line 1 Col 0 INS NORM Zi EX an 2 TEIT TEL camomie a101 ie shome tckia il dickelocalhost c ein Ca 1627 n 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 dmain 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 The development of the real time corrected MAC widget follows from our earlier work on developing charts facilitating the determination of age corrected MAC for anaesthetists Nickalls and Mapleson 2003 These charts have also been included in an anaesthesia handbook Nickalls 2006 Current work involves upgrading the MAC monitor to include the age temperature and hair colour corrections for MAC CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 6 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
5. 0 7523 0 2 436 variable y00 0 7523 7523 0 7523 437 point L16 x5 y16 5 2 3523 438 point R16 x6 y16 100 2 3523 439 point L14 x5 y14 5 2 1523 440 point R14 x6 y14 100 2 1523 44 point L12 x5 y12 5 1 9523 442 point R12 x6 y12 100 1 9523 443 point L10 x5 y10 5 1 7523 444 point R10 x6 y10 100 1 7523 445 point L08 x5 y08 5 1 5523 446 point RO08 x6 y08 100 1 5523 447 point L06 x5 y06 5 1 3523 448 point R06 x6 y06 100 1 3523 449 point L04 x5 y04 5 1 1523 450 point RO4 1x6 y04 100 1 1523 451 point L02 x5 y02 5 9523 452 point RO02 1x6 y02 100 9523 453 point L00 x5 y00 5 7523 454 point RO0 x6 y00 100 7523 455 draw the dashes from Left to Right 456 so have small gap at right axis 457 drawline L16R16 L14R14 L12R12 L10R10 LO8R08 LOGRO6 LO4R 458 putrule from 5 2 3523 to 100 2 3523 L16R16 459 putrule from 5 2 1523 to 100 2 1523 L14R14 460 putrule from 5 1 9523 to 100 1 9523 L12R12 461 putrule from 5 1 7523 to 100 1 7523 L10R10 462 putrule from 5 1 5523 to 100 1 5523 LO8R08 463 putrule from 5 1 3523 to 100 1 3523 LO6R06 464 putrule from 5 1 1523 to 100 1 1523 LO4RO4 465 putrule from 5 9523 to 100 9523 LO2RO2 466 putrule from 5 7523 to 100 7523 LOOROO 467
6. End expired in 67 hspace 8xm 50N26NN N 2 0 hspace 7 5mm N _2 0 9 newcommand mybottom Age years CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 87 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 415 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 X text mybottom 46 0 12 0 15 put mybottom at 46 000000 0 120000 text footnotesize copyright RAD Nickalls 2003 19 0 5 put footnotesize copyright RWD Nickalls 2003 at 19 000000 0 500000 text V large ISOFLURANE 46 2 8 80 put large 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 Yolo var x5 5 Left X value 996 x5 5 var x6 100 Right X value YA x6 100 var y16 2 3523 w yl6 2 3523 var yl4 2 1523 wW y14 2 1523 var yl2 1 9523 96 0 y12 1 9523 var y10 1 7523 y10 1 7523 96 var y08 1 5523 96 0 y08 1 5523 wW var y06 1 3523 9670 y06 1 3523 var y04 1 1523 y04 1 1523 9o var y02 0 9523 966 0 7523 0 2 9 y02 0 9523 9o var y00 0 7523 0 7523 y00 0 7523 point L16 x5 y16 L16 5 00000 2 35230 point R16
7. 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 nokey 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
8. 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 fie1ds2PDATA pl CHAPTER 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 224 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
9. 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 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 06 MODULERWD Nickalls 239 h
10. OK doneNn 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 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 Ist 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 n
11. 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 def EntryTimer 1 2 3 4 timeO time1 delay comment newcommand EntryTimerDiabetes 4 count30 3 seconds see Knuth p 118 4 Nn CHAPTER 16 TYPESETTING PROGRAMS RWD Nickalls 207 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 4 def EntryTimerDiabetes 1 2 3 4 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
12. right THE PRINT button topwindow 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 HH MainLoop HH sub launch if e launchcam12 pl first remove the Tk screen topwindow gt destroy if Tk Exists topwindow topwindow bell beeps if click window p 296 system perl launchcam12 pl CHAPTER 7 THE PERL TK FRONT END RWD Nickalls 96 89 90 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 system perl tklaunch2 pl geometry 300x400 50 300 else print ERROR n print can t find program launchcam12 pl gt n n exit Ht sub quit exit THE sub printout topwindow gt bell result dialog1 Show if result eq OK THE sub projectteam topwindow gt bell result dialog2 gt Show if result eq OK Y topwindow gt destroy if Tk Exists topwindow itsystem clear system xdvi camteama5dvi dvi paper a5 geometry 20 20 system perl tklaunch2 pl geometry 300x400 50 300 1HE sub epid
13. 98 CHAPTER 8 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 99 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 pl print sending data to the printer now Mn system perl p
14. 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 18 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 241 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 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 t
15. VAP gnu doneNn 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 can t create file lt gnnheader dat gt n zs timenow localtime print outfile5 gnnheader dat created timenow n print outfileb 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 20 FIELDS2PDATA PL RWD Nickalls 261 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
16. 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 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 CHAPTER 15 PRINTING MODULE OVERVIEW RWD Nickalls 199 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 m
17. CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 38 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 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 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 39 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 119 00 000 120 00 000 121 00 000 122 03 003 123 01 001 124 01 001 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 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 40 151 00 000 152 0D 013 153 00 000 154 01 001 155 80 128
18. VTM VTM VTMID 329923004 VTMID NM Aceclofenac NM VTM lt VIM gt lt VTMID gt 116084008 lt VIMID gt lt NM gt Abacavir lt NM gt lt VTM gt CHAPTER 12 DRUG DICTIONARY RWD Nickalls 128 lt VIM gt lt VTMID gt 9835811000001101 lt VIMID gt lt NM gt Medium chain triglycerides Soyaoil lt NM gt lt VTM gt VTM VTMID 9835911000001106 VTMID NM Dornase alfa NM VTM VTM VTMID 9836011000001103 VTMID NM Drotrecogin alfa NM VTM lt VIM gt lt VIMID gt 9837611000001107 lt VIMID gt lt NM gt Homeopathic cocculus indicus NM VTM VIRTUAL THERAPEUTIC MOIETIES 12 5 Perl program dn dmd5 p1 1 usr bin perl 2 3 dn dmd5 pl modified from dn dmd4 pl 4 to accommodate the lt INVALID gt tag 5 RADN May 14 2006 6 to read the xml VIM files to extract the drug names and codes 7 Ht 8 VIRTUAL THERAPEUTIC MOIETIES filezf otm2 xml week50 2005 9 vtm_v2_2 xsd 10 11 TO DO 12 search the vtm XSD file for all the key TAGS 13 and then extract these from the VIM xml file 14 search for the other possible key words 15 search for the INVALID INVALID done 16 search for the lt ABBREVNM gt lt ABBREVNM gt 17 fH 18 set up commandline flags in etc 19 so user can specify input and output filenames etc 20 fH 21 use strict 22 use
19. io 00 10 tn PWN Se AA HA Ph LP AO 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 3l 32 33 34 35 36 37 38 usr bin perl w allfiles camomiletop datexsim thlaunch2 pl RWD Nickalls April 5 2004 to get FullScreen mode at startup p 307 HF 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 pack THE topwindow title Launch CAMOMILE topwindow Label text gt Click on the lt RUN gt button to start the CAMOMIE anaesthesia program wraplength gt 130 padx gt 250 height gt 10 gt pack THE camel logo button usr lib perl5 vendor perl 5 8 1 i386 linux thread mult camelimage topwindow Photo file gt home dick allfiles camomiletop datexsim anim gif topwindow Button relief gt flat image gt camelimage gt place relx gt 0 rely gt 0 THE project team button topwindow Button text gt c The CAMOMIE project team 2004 padx 2230 pady gt 20 relief
20. 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 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 20 FIELDS2PDATA PL RWD Nickalls 253 LI mm CMM ERR MD CL CE M C M C 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
21. print vapfile plot vap gnu script made by plotgOla pl n print vapfile set terminal latex n print vapfile set output plot vap pic Nn print vapfile set size 1 376 smallheight n print vapfile set xtics timeline Wn 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 print vapfile xmin 0 xmax 3600 n CHAPTER 20 FIELDS2PDATA PL RWD Nickalls 260 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
22. 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 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 11 CONFIGURATION FILES RWD Nickalls 124 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 Nseti
23. trigger hhmm Nn print logg trigger time trigger yndhm Mn CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 176 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 252 253 write the correct trigger string for the Kalarm commandline my trigger t trigger_ymdhm spaces n two trailing Hit 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 until ymdhm Wn my until u untilymdhm 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 file f home dick allfiles akalarm perl help txt out kalarm color until repeat_interval file set a new DIABETES alarm out kalarm color trigger repeat_interval until messag my out kalarm bell color trigger repeat_interval until y print setting new DIABETES alarm n print sending Kalarm string out An print logg setting new DIABETES al
24. write info to the timefile print timefile hour unixtime gmtime gnudatafilename n CHAPTER 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 221 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 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 1
25. 75 1 point n80 80 1 point n85 85 1 point n90 90 1 point n95 95 9986587 99 o 99 o 99 o Soy o Soy o Soy o 99 o 99 o 99 o Soy o Soy o Soy o 99 o 99 o 99 o Soy o Soy o Soy o 99 o Soy o 99 o kline inputfile isondata dat start of file lt isondata dat gt 1 2 690702 639144 589158 540697 493713 448162 404 361185 319675 279432 240415 202589 165916 130361 09589 062471 030071 1 2 7 4 7 ROER ER ER ER ER ODE EER EE EE EE UI 80 85 10 T5 4 20 25 30 39 5 45 50 55 60 65 70 75 1 743882 1 690702 1 639144 1 589158 1 540697 1 493713 1 448162 1 404 1 361185 1 319675 1 279432 1 240415 1 202589 1 165916 1 130361 1 09589 1 062471 90 1 030071 95 9986587 manual vr wH wr wv wv WH drawline n5n10n15n20n25n30n35n40n45n50n55n60n65n70n75n8 plot 5 1 743882 10 1 690702 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 V plot 25 1 540697 30 1 493713 n25n30 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
26. An Open Source Anaesthesia Workstation Linux revision 09 n x us ETE TE ANAESTHETIC SHEET Hopital Netinsbun UK 4 s ee 1 W mum o Tp E eve o S ie mmeie 8 dickelocathost i xavi fepna fS 15 08 E 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 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 RWD Nickalls S Dales AK Nice G Dean 1994 2009 zTv d n April 2009 revision 09a Preface This document brings together in one place most of the available information regarding the development work files programs and screenshots relating to the current version of our open source Anaesthetic Workstation computer program which was used in one of the thoracic operating theatres during the period 2002 2006 This docume
27. ERROR Vn 352 print can t find file dn calendar ics gt n n 353 system perl dn tkalarm pl geometry 320x380 50 300 354 EH 355 end of the sub 356 357 358 359 sub help 360 this displays the main diabetes help file 361 topwindow gt bell 362 result dialog2 gt Show 363 topwindow gt destroy if Tk Exists topwindow 364 if e camteama5Sdvi dvi 365 if e diabetes diabetes intro html 366 88 first remove the Tk screen 367 topwindow gt destroy if Tk Exists topwindow 368 topwindow bell beeps if click window p 296 369 system xdvi camteamaSdvi dvi paper a5 geometry 20 20 370 system konqueror diabetes intro html 371 372 if use Simon s Konquered utility then it needs the FULL path 373 system konquered geometry 500x550 20 100 home dick allfiles akalarm diabetes 374 diabetes intro html 375 system perl dn tkalarm pl geometry 320x380 50 300 376 377 else print ERROR Vn 378 print can t find program camteama5dvi dvi AW CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 165 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 system perl dn tkalarm pl geomet
28. 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 CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 11 TE Camomile 0 1 031208 Operation 200m5 09 38 52 GMT Friday nx Eile Project Entry Timer View Help RMA orok BP 100 30 80 150 100 50 33 20 D van EER NZO ext 0 92 Alarms Logs Monitors Pumps Others ER ENS L E EE Ted zi vapour SEV eo ce gm jee i 1 alamAlam ONTV op 610 Cors o ap wae var 13 24 alarm Alarm Off MVol 8 1 TV ex eso 0 lage ES 13 25 alarm Alarm On CVP 25 MVol 69 ci 1000 1327 alarm Alarm Off CVP 19 HR ecg 102 x m 1 1328 alam Alam On CVP 299 iv 105 13 29 alarm Alarm Off CVP CVP 16 1332 alarmAlarm On BP 271 269 13 32 5 105 NIBP EU 1332 alam Alarm On CVP 320 Tempi 3618 X v 1338 alarm Alarm On BP 297 47 Tempe ms 1333 alarm Alarm Off BP 128 45 Total MAC 1335 alarm Alarm Off CVP 15 zi i 1337 alarm Alarm On CVP 298 AEST anaesthetistDick Nikalls i sem vo Beep of N Da 27 E CE TT camomite o1 os2osope i dick localhostlocaldomain Tan 13 54 Ts Figure 1 9 Screen sho
29. REPEAT 4 DURATION PT15M ACTION AUDIO ATTACH FMTTYPE audio basic ftp host com pub sounds bell 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 PT30M 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 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 invoke a procedure file BEGIN V
30. Xenons 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 Xenons project website files are accompanied with a PDF equivalent Graphic record The graphs are tabulated according to page number and are in both PDF and PostScript formats 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 Microgoft users may well not be able to view PostScript files unless the free Open Source GhostScript utility http mww cs wisc edu ghost is installed freely downloadable from the internet However all the PostScript E Er Figure 1 5 Anaesthetic record HTML front end w Help EET ANESTHESIA RECORD mir quit nd Paice 1220 RD ren id lofl lick on the RUN button to start the CAMOMILE anaesthesia
31. cdot 4 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 65 67 68 69 70 71 72 13 74 75 76 TI 78 79 80 81 82 83 84 85 86 87 88 89 90 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 OT Vcdot 16 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 rbeginSKIP 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 9 manual point ql0 10 2 25427 10 2 25427 point q15 15 2 185525 15 2 185525 point q20 20 2 118877 20 2 118877 point q25 125 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 r vr ww 0 point q55 55 1 705909 55 X point q50 50 1 759567 50 1 759567 1 705909 X point q60 60 1 653887 60 1 653887 X point q65 65 1 603451 65 1 603451 point q70 70 1 554554 70 1 554554 X point q75 75 1 507148 75 1 507148 X point q80 80 1 461187 80 1 461187
32. 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 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 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 225 17 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
33. gt flat background LightGrey activebackground gt Grey Tk CHAPTER 7 THE PERL TK FRONT END RWD Nickalls 95 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 TI 78 79 80 81 82 83 84 85 86 87 88 foreground gt Blue command gt amp projectteam gt pack side gt bottom expand gt 1 Ht RUN button topwindow gt Button text gt RUN padx gt 50 pady gt 90 relief raised background gt SeaGreenl activebackground gt SeaGreen2 command gt amp launch gt pack side gt left expand gt 1 Ht QUIT button topwindow gt Button text gt QUIT padx gt 20 pady gt 20 relief raised background gt LightBluel activebackground gt LightBlue2 command gt amp quit place relx gt 0 rely gt 0 1 pack side left expand gt 1 Ht EPIDURAL button topwindow 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 DarkSeaGreen3 command gt amp epidural pack side gt bottom expand gt 1
34. 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 198 deltahminusqq deltah qq deltahminusq deltah q deltahplusqqqq deltah qqq4 deltahplusqqq deltah qqq deltahplusqq deltaht qq deltahplusq deltah q t1 hminus1 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 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
35. k20k25 plot 25 1 027131 30 9958085 996 k25k30 plot 30 9958085 35 9654412 k30k35 plot 35 9654412 40 936 k35k40 plot 40 936 45 9074566 k40k45 plot 45 9074566 50 8797836 k45k50 plot 50 8797836 55 8529544 k50k55 plot 55 8529544 60 8269435 k55k60 V plot 60 8269435 65 8017257 k60k65 V plot 65 8017257 70 7772771 98 k65k70 plot 70 7772771 75 7535739 90 k70k75 plot 75 7535739 80 7305936 k75k80 plot 80 7305936 85 708314 k80k85 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 996 end of file lt isokdata dat gt thinline inputfile isojdata dat 0 6 967 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 k85k90k95 CHAPTER 6 AGE CORRECTED MAC RWD N
36. 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 i ploggnnk2 p1 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
37. my until time mins 1440 mins 24hrs my message qq DIABETES my options_okay GetOptions trigger i gt V trigger time mins trigger expects an integer mins interval i gt V repeat interval mins interval mins until i gt until_time_mins until mins 1440 24hrs message s gt message message use 2 trailing spaces to separate items my kalarm kalarm my bellz b b my colorz c red trigger time mins starttime repeat_interval_mins 5 mins my intervala 0000 repeat_interval_mins my intervalbzsubstr intervala 4 print logg interval intervalb Wn my repeat interval i intervalb Ht my message qq DIABETES repeat blood sugar print logg bell bell Wn print logg color color Wn print logg trigger mins trigger time mins Nn print logg interval mins repeat interval mins Mn print logg until mins until time mins Mn 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 S trigger string use the subroutine print trigger time hh mm
38. point R02 1x6 y02 229 230 point LOO 1x5 y00 231 point RO0 x6 y00 232 233 draw the dashes from Left to Right 234 so have small gap at right axis 235 drawline L16R16 L14R14 LI2R12 L10R10 L08R08 LO6RO6 L04R04 LO2RO2 LOOROO 236 237 Vendpicture 238 framebox 239 end document 6 3 4 Output mac iso8t mt code from the previous mathsPIC pro gram ox mathspic Perl version 1 00 Feb 14 2005 A filter program for use with PiCTeX 7o Copyright c 2005 A Syropoulos amp RAD Nickalls A UN CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 78 41 42 43 44 45 46 47 48 49 50 51 52 Command line usr local bin mpic100 pl mac iso8t m Input filename mac iso8t m Output filename mac iso8t mt o Date amp time 2006 01 13 09 19 33 Yox 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 9 9o W gt 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 12 pt article usepackage mathspic usepackage
39. 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 18 Printing the stand alone SA 06 module April 19 2009 allfiles book xenon ch printmod sa06 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 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 sta
40. 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 print waiting for data lt CTRL C gt to quit n print total chars sumpb n 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 sumpbt length portbuffer if Ler 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 Cl i print LOG remaining buffer buffer n CHAPTER 5 INTERFACING THE SERIAL PORT IN LINUX RWD Nickalls 51 print LOG total portbuffer chars sumpb n print LOG Mn 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 print LOG NO LF NO EOF Mn print LOG buffer buffer n print LOG portbuffer portbuffer n print LOG
41. 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 projdir pdata and is used to facilitate data processing and printing
42. 1 80 Invas Press 5 subrecord 286 289 0 0 0 SOP 290 291 D 0 292 293 2 80 294 295 2 80 296 297 2 80 298 299 1 80 Invas Press 6 subrecord 300 303 0 0 0 SOP 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 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 36 4 5 Example of data output The following Datex AS 3 output data string was received during an operation and saved in D data decimal and is the same as that shown in Chapter 14 page 183 For details of the format of the D data see page 183 A8300 09 36 49 05 03 1991 m d y Datex AS 3 monitor A8301 126 062 001 111 005 000 000 166 052 241 058 000 000 000 000 000 000 000 A8302 000 001 000 074 255 097 220 044 000 000 000 044 000 000 000 189 189 032 A8303 000 189 189 032 000 166 052 241 058 019 048 000 000 000 034 067 000 021 A8304 000 001 128 001 128 001 128 003 000 000 000 001 000 062 058 231 028 049 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 One of the Datex AS 3 invasive blood pressure sub records is encoded i
43. 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 print outfilel 796 file name startfile dat created timenowgmt n print outfilel file generated by launchcam pl RAD Nickalls An print outfilel file read by lt plotgnnk2 pl gt n print outfilel projectdir projdir n use comma separation amp no spaces print outfilel starttime timenowunix timenowgmt n no spaces close outfilel H print lt starttime dat gt done n 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 printfiles projpdatadir print done n HHH now start the optional printing process now move to the project pdata dir to CALL the print prog lt plotgnnk2 pl gt print moving dir gt projpdatadir n chdir projpdatadir print the new dir is Vn system pwd now start running the printing process by running plotgnnk pl print now calling perl plotgnnk2 pl gt 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 Mn system cp v starttime dat goto jump print OP
44. 178 13 7 Error message widget program dn errorbox pl 178 13 8 Screenshots 2 0 es 181 CONTENTS 14 Data storage files and formats 14 1 Inroducion s s es esea cete ee etde i e e 14 2 Filenames time date encoding o oo e 14 3 D dat 2 RR EE kho EA E on E wor Rs 14 4 binl g ko ke mh RR ERR Rmo mum ms Re ww E 14 5 Drup dat amp x acm o ER RU HY Ae RE EE IV Data processing inline printing module 15 Printing module overview 15 1 Introduction 2 2 0 0 2 002 000 0020 e e 15 2 Thestart ime ss o ccs es Rm gr m ko RR RR 15 3 Running the Camomile data program les 15 4 After the Camomile data programexits 15 5 Reading the starttime dat file leen 15 6 Accessing the Camomile stored data lcs 15 7 Write the GNUplot scripts foreach graph 15 8 Run GNUplot on all the gnu files EE EE EE ee 15 9 Write the header line for the printouts 15 10 Typeset the graphic pages using IHTEX2g 2 lens 15 11 Typeset the drug file using BIEX 2g 2 llle 15 12Printing the paper sheets a 16 Typesetting programs 16 1 prtanes6 tex 2 54 24 64 225286684 22 bbb ARE sb RE 16 2 prtdrug2 8ty a aec HORE HS Se ee ee ES 16 3 prtdrig tex 20 s we EAE ae AR scd 16 4 printall tex 4 223 BES Bands Roe RUE LO uk eR did V Data processing stand alone printing module 17 Printing the stand alone SA
45. 196 197 0 0 label 198 199 1 lt 80 gt ET 02 x100 200 201 1 80 FI 02 x100 Nitrous Oxide N20 subrecord 202 205 3 0 0 0 status 206 207 0 0 label 208 209 1 80 ET N20 4 x100 210 211 1 80 FI N20 4 x100 Anaesthetic agent 212 215 3 0 0 0 status 216 217 2 0 label 218 219 1 80 ET AA x100 220 221 1 80 FI AA 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 lt 1 gt lt 80 gt compliance x100 cms H20 244 245 lt 1 gt lt 80 gt MV exp x100 min CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 35 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 lt 20 gt 0 0 0 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 278 285 0 0 0 0 D3 lt 0 gt
46. 199 point n55 55 1 279432 n55 55 00000 1 200 point n60 60 1 240415 n60 60 00000 1 201 point n65 1 65 1 202589 n65 65 00000 1 1 1 1 1 1 0 0 202 point n70 70 1 165916 n70 70 00000 203 point n75 75 1 130361 n75 75 00000 204 point n80 80 1 09589 n80 80 00000 205 point n85 85 1 062471 n85 85 00000 206 point n90 90 1 030071 n90 90 00000 207 point n95 95 0 9986587 n95 95 00000 208 drawline n5 n10 n15 n20 n25 n30 n35 n40 n45 n5 n65 n70 n75 n80 n85 n90 n95 209 plot 5 00000 1 74388 10 00000 210 plot 10 00000 1 69070 15 00000 211 plot 15 00000 1 63914 20 00000 212 plot 20 00000 1 58916 25 00000 213 plot 25 00000 1 54070 30 00000 214 plot 30 00000 1 49371 35 00000 215 plot 35 00000 1 44816 40 00000 216 plot 40 00000 1 40400 45 00000 217 plot 45 00000 1 36119 50 00000 218 plot 50 00000 1 31967 55 00000 219 plot 55 00000 1 27943 60 00000 220 plot 60 00000 1 24042 65 00000 221 plot 65 00000 1 20259 70 00000 222 plot 70 00000 1 16592 75 00000 223 plot 75 00000 1 13036 80 00000 224 plot 80 00000 1 09589 85 00000 225 plot 85 00000 1 06247 90 00000 226 plot 90 00000 1 03007 95 00000 227 drawpoint n10 n20 n30 n40 n50 n60 n70 n80 n90 228 put bullet at 10 00000 1 69070 n10 229 put bullet at 20 00000 1 58916 n20 230 put bullet at 30 00000 1 49371 n30 231 put bullet at 40 00000 1 40400
47. 25 00000 0 77035 346 point j30 30 0 7468564 j30 30 00000 0 74686 347 point j35 35 0 7240809 j35 35 00000 0 72408 348 point j40 40 0 702 j40 40 00000 0 70200 349 point j45 45 0 6805924 j45 45 00000 0 68059 350 point j50 50 0 6598377 j50 50 00000 0 65984 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 85 351 point j55 55 0 6397159 j55 55 00000 352 point j60 60 0 6202077 j60 60 00000 353 967 point j65 65 0 6012943 j65 65 00000 354 point j70 70 0 5829578 j70 70 00000 355 967 point j75 75 0 5651804 j75 75 00000 356 point j80 80 0 5479452 j80 80 00000 357 point j85 85 0 5312355 j85 85 00000 358 point j90 90 0 5150355 j90 90 00000 359 point j95 95 0 4993294 j95 95 00000 360 drawline j5 j10 j15 j20 j25 j30 j35 j40 j45 j5 j65 j70 j75 j80 j85 j90 j95 361 plot 5 00000 0 87194 10 00000 0 84535 j5j10 84535 15 00000 0 81957 j10j15 81957 20 00000 0 79458 j15j20 79458 25 00000 0 77035 j20j25 77035 30 00000 0 74686 j25j30 74686 35 00000 0 72408 j30j35 72408 40 00000 0 70200 j35j40 70200 45 00000 0 68059 j40j45 68059 50 00000 0 65984 j45j50 65984 55 00000 0 63972 j50j55 63972 60 00000 0 62021 j55j60 62021 65 00000 0 60129 j60j65 60129 70 00000 0 58296 j65j70 362 V plot 10 00000 363 Vplot 15 00000 364
48. 4 Snoitems stgemt 1 not used 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 yearNn print logg the gmt part is day month date st yearNn Hl d ee 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 monthz 04 if month eq May month 05 if month eg Jun month 06 if month eq Jul monthz 07 if month eq Aug month 08 if month eq Sep month z 09 if month eq Oct monthz 10 if month eq Nov monthz 11 if month eg Dec month 12 my ymdhm year month date hh return ymdhm Htend of sub THE close END H mm CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 178 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 13 6 File viewer program dn tkviewer pl usr bin perl RN tkviewer pl modified from RNtkview pl my thisprog dn tkviewer pl used in error messages T RWD Nickalls Dec 16 2005 a simple TK filevi
49. CONFIGURATION FILES RWD Nickalls 119 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 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 11 CONFIGURATION FILES RWD Nickalls 120 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 e
50. Ctlon RA NR EE ER OR ER HE 125 12 2 Initial drug lists lees 126 12 3 Download bundle ens 127 12 4 VTM File format 0000002 ee eee 127 12 5 Perl program dn dmd5 pl leen 128 12 6 Perl program reverse pl ee 137 12 7 Initial data listing ee ee 138 12 8 The ordered list 0020000002 eee 139 12 9 Adding drugs tothe list ES SE EE ss 139 12 10Perl program add2list pl ss SS SS EE SS Se 140 12 11Logfile generated by add21ist pl 142 12 12Final list for pull down menu leen 143 13 Diabetes decision support system 145 13 1 Inroducion lt osr e eses ded enek e e e ss ee 145 13 1 1 Kalarm and the iCalendar standard 145 13 1 2 VALARM specification from the RFC 2445 manual v 2 Nov 1998 ek eA aa Robo Sem EN She b Eom cR RD a 146 13 2 Kalam 6 RR RE Rer GR ae Re exce Bees ee ERA 152 13 2 1 To show Kalarmicon 22004 152 13 2 2 Documentation lees 152 13 2 3 Initiating a diabetes alarm ls 154 13 2 4 Displyingafile lens 155 13 25 Current alarm status llle 155 13 2 6 Cancelling an alarm llle 156 13 3 Alarm widget program dn tkalarm pl 156 13 4 Test demo programs dn alarm demoRED pl 168 13 5 Diabetes alarm program dn alarm diabetes3 pl 171 13 6 File viewer program dn tkviewer pl
51. I started writing some Perl programs to extract and process the NHS listing whch could be downloaded from the DM D website 12 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 amp2 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 12 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 VTM VTMID 108974006 VTMID NM Abciximab NM VTM VTM VTMID 109077006 VTMID NM Acarbose NM VTM VTM VTMID 398910009 VTMID NM Acebutolol Hydrochlorothiazide NM
52. THEN mac40 75 IF v ISO THEN mac40 1 17 IF v 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 n2o 0 REM eqn mac mac40 10 0 00269 deltaage macn20 104 10 BB deltaage IF macn2o lt 0 THEN Fmacn20 01 REM changed from 0 to 01 check ELSE Fmacn20 n20 macn20 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 Fmacn20 ELSE Fmacvapour vap macvapour totalFmac Fmacvapour Fmacn2o END IF REM REM do not print to screen if printing last 20 mins fast data IF pl20mf on THEN GOIO 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 lt 0 THEN COLOR red screenbackcolour PRINT USING 43 44 B COLOR green screenbackcolour ELSE CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 56 71 72 73 74 75 76 TI 78 79 80 81 82 83 84 85 86 87 88 89 90 PRINT USING 45 445 B END IF PRINT PR
53. and MAY occur more than once X prop emailprop 5 the following are all REQUIRED but MUST NOT occur more than once action description trigger summary the following is REQUIRED 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 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 148 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 reminder 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 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
54. is required later by the subroutine nakegnnfiles 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 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 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 217 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
55. 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 06 MODULERWD Nickalls 244 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 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
56. plot 55 00000 0 85295 60 00000 0 82694 k55k60 318 V plot 60 00000 0 82694 65 00000 0 80173 k60k65 319 V plot 65 00000 0 80173 70 00000 0 77728 k65k70 320 V plot 70 00000 0 77728 75 00000 0 75357 k70k75 321 plot 75 00000 0 75357 80 00000 0 73059 k75k80 322 V plot 80 00000 0 73059 85 00000 0 70831 k80k85 323 V plot 85 00000 0 70831 90 00000 0 68671 k85k90 324 V plot 90 00000 0 68671 95 00000 0 66577 k90k95 325 drawpoint k10 k20 k30 k40 k50 k60 k70 k80 k90 326 put bullet at 10 00000 1 12713 k10 327 put bullet at 20 00000 1 05944 k20 328 put bullet at 30 00000 0 99581 k30 329 put bullet at 40 00000 0 93600 k40 330 put bullet at 50 00000 0 87978 k50 331 put bullet at 60 00000 0 82694 k60 332 put bullet at 70 00000 0 77728 k70 333 put bullet at 80 00000 0 73059 k80 334 put bullet at 90 00000 0 68671 k90 335 9976 end of file lt isokdata8 dat gt loop 1 336 thinline 337 inputfile isojdata8 dat 960 6 338 start of file isojdata8 dat loop 1 339 Iteration number 1 340 j mac40 iso 6 341 point j5 5 0 871941 manual 5 00000 0 87194 342 point j10 10 0 8453511 j10 10 00000 0 84535 343 point j15 15 0 819572 j15 15 00000 0 81957 344 point j20 20 0 794579 j20 20 00000 0 79458 345 point j25 25 0 7703483 j25
57. 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 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 06 MODULERWD Nickalls 243 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
58. 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 written 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 15 CHAPTER 2 DATA PROCESSING IN ANAESTHESIA RWD Nickalls 16 Davies and Atkinson 1996 p 128 In 1901 they started including measurements of the arterial blood pressure using the newly described apparatus o
59. skip comments next LINE2 if skip comments next LINE2 if skip blank lines grab the whole line as a string newline chomp newline f removes the line ending 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 trailing space push clean_drugs delement CHAPTER 12 DRUG DICTIONARY RWD Nickalls 135 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 my drugl drug2 clean drugs addname ucfirst drugl force Uppercase first letter ucfirst if a synonym drugl is given for existing drug using sign drug2 then 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 ie at least two drugs in the input line print logg drugl drug1 drug2 s1 drug2 Wn check we can actually find the snomed code if exists dmd drug2 addnamecode dmd drug2 else print logg can t find synonym drug2 Wn addnamecode ERROR if only single name given t
60. 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 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 216 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
61. 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 entrydrug xpm 473 Aug 8 2003 entrytimer diabetes xpm 453 Feb 17 2003 entrytimer xpm CHAPTER 10 THE CAMOMILE PROGRAM RWD Nickalls 111 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
62. 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 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 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 41 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 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 237 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 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 42 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 2
63. 200 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 starttimeunix originalgmt fname n close outfile5 print iiw lt gnnheader dat gt done n 15 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
64. 22 1341 datestring year month date hour min return home dick allfiles camomiletop theatredata datestring 15 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 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 15 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 it 1aunchcam12 p1 crea
65. 3 8cm V End expired in N hspace 9mm 67 hspace 8mm 50V 70NN hspace 9mm N _2 0 hspace 7 5mm N 2 O N end minipage 9o V end of newcommand text myrightb 89 143 2 657 1 76 End expired in 67 hspace 8um 50 N 2 0 hspace 7 5mm N _2 0 newcommand mybottom Age years text mybottom 46 0 12 0 15 text footnotesize copyright RAD Nickalls 20031 19 0 5 text large 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 xb5z5 Left X value var x6 100 Right X value var yl6 2 3523 var yl4 2 1523 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 77 198 var y12 1 9523 199 var y10 1 7523 200 var y08 1 5523 201 var y06 1 3523 202 var y04 1 1523 203 var y02 0 9523 0 7523 0 2 204 var y00 0 7523 0 7523 205 206 point L16 x5 y16 207 point R16 1x6 y16 208 209 point L14 x5 y14 210 point R14 1x6 y14 211 212 point L12 x5 y12 213 point R12 x6 y12 214 215 point L10 1x5 y10 216 point R10 1x6 y10 217 218 point L0O8 1x5 y08 219 point R08 1x6 y08 220 221 point L0O6 1x5 y06 222 point R06 1x6 y06 223 224 point LO4 x5 y04 225 point R04 1x6 y04 226 227 point L02 1x5 y02 228
66. 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 20 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 cardiopulmonary 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 oupjou
67. 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 bfseries 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 16 TYPESETTING PROGRAMS RWD Nickalls 208 16 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 patientl
68. 55230 to 100 00000 1 55230 L08R08 putrule from 5 00000 1 35230 to 100 00000 1 35230 LO6RO6 putrule from 5 00000 1 15230 to 100 00000 1 15230 LO4RO4 putrule from 5 00000 0 95230 to 100 00000 0 95230 L02R02 putrule from 5 00000 0 75230 to 100 00000 0 75230 LOOROO endpicture N oframebox end document ISOFLURANE End expired in End tidal in 100 oxygen air RWD Nickalls 2003 67 509 NO NO 16 18 14 16 12 F14 1 0 12 08 F10 06 0 8 04 0 6 02 0 4 0 Fo2 0 0 10 20 30 40 50 60 70 80 90 100 Age years Figure 6 5 The isoflurane version nac iso8t m generated for the Oxford Handbook of Anaesthesia with rotated LHS axis legend CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 89 6 4 References Allman KG and Wilson IH Eds 2006 Oxford Handbook of Anaesthesia 2nd ed 1160 1162 Eger EI 1974 Anesthetic uptake and action Williams and Wilkins Company Baltimore USA p 12 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 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 Liem EB Lin C M Suleman M Doufas AG Gregg RG
69. 75 5651804 80 5479452 j75j80 358 V plot 80 5479452 85 5312355 j80j85 359 plot 85 5312355 90 5150355 9 j85j90 360 plot 90 5150355 95 4993294 j90j95 361 end of file lt isojdata dat gt 362 endSKIP 363 364 from mac des m 365 996 variable x 1 1 366 variable x2 ix advance 2 1 367 X point h x2 2 475 1 2 475 368 text MAC h 369 put MAC at 1 2 475 370 vertical diff 0 29 units 0 28 31 variable d 0 29 29 372 variable h6 0 88 88 0 9 373 text fbox 0 cdot 6 x h6 374 put fbox 0 cdot 6 at 1 88 375 variable h8 h6 advance d 1 17 376 text fbox 0 cdot 8 x h8 377 put fbox 0 cdot 8 at 1 1 17 378 variable h10 h8 advance d 1 46 379 text fbox 1 cdot 0 x h10 380 put fbox 1 cdot 0 at 1 1 46 381 variable h12 h10 advance d 1 75 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 71i 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 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 W text fbox 1 cdot 2 x h12 put fbox 1 cdot 2 at 1 1 75 variable h14 h12 advance d 2 04 W text fbox 1 cdot 4 x h14 put fbo
70. 8 CTS Can be used to control data flow CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 27 4 2 1 Cable connections The wiring configuration for interfacing the Datex AS 3 monitor to a PC is shown in Figure 4 1 CTS NB not fully checked out for AS 3 Data output from the Datex monitor is usually controlled by influencing 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 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 e a pin 3 TxD pin 5 GND pin 5 GND pin 8 CTS e 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
71. 9654412 k35 35 00000 0 96544 point k40 40 0 936 k40 40 00000 0 93600 point k45 45 0 9074566 k45 45 00000 0 90746 point k50 50 0 8797836 k50 50 00000 0 87978 point k55 55 0 8529544 k55 55 00000 0 85295 point k60 60 0 8269435 k60 60 00000 0 82694 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 84 299 point k65 65 0 8017257 k65 65 00000 0 80173 300 point k70 70 0 7772771 k70 70 00000 0 77728 301 point k75 175 0 7535739 k75 75 00000 0 75357 302 point k80 80 0 7305936 k80 80 00000 0 73059 303 point k85 85 0 708314 k85 85 00000 0 70831 304 point k90 90 0 6867139 k90 90 00000 0 68671 305 point k95 95 0 6657725 k95 95 00000 0 66577 306 drawline k5 k10 k15 k20 k25 k30 k35 k40 k45 k50 k55 k60 k65 k70 k75 k80 k85 k90 k95 307 plot 5 00000 1 16259 10 00000 1 12713 k5k10 308 Vplot 10 00000 1 12713 15 00000 1 09276 k10k15 309 V plot 15 00000 1 09276 20 00000 1 05944 k15k20 310 V plot 20 00000 1 05944 25 00000 1 02713 k20k25 311 plot 25 00000 1 02713 30 00000 0 99581 k25k30 312 V plot 30 00000 0 99581 35 00000 0 96544 k30k35 313 V plot 35 00000 0 96544 40 00000 0 93600 k35k40 314 V plot 40 00000 0 93600 45 00000 0 90746 k40k45 315 V plot 45 00000 0 90746 50 00000 0 87978 k45k50 316 V plot 50 00000 0 87978 55 00000 0 85295 k50k55 317
72. BD BD 36 38 BD BD BD 39 41 BD BD BD EE end of header always 40 bytes 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 lt 32 gt label 2 bytes 52 53 lt 02 gt 80 HR 54 55 0A 81 sti mm 100 56 57 05 81 st2 58 59 08 81 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 80 diast x100 72 73 2 80 mean x100 74 75 1 80 heart rate min CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 33 INV Press 2 subrecord 76 79 1 0 0 0 status 80 81 2 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 110 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 subrec
73. Consequently a practical real time age corrected MAC output display was straightforward and simple to implement since all that was necessary was to write a small subroutine to calculate 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 value 0 86 see the program below A significant problem regarding the administration of anaesthesia at that time was the fact that no less than four inhalational anaesthetic vapours were in common use halothane isoflurane desflurane sevoflurane it was essentially impossible for anyone to remember the appropriate settings for each combination of agent and age Con sequently the prospect of inadvertent awareness was ever present and anaesthetists generally tended to learn how to use one or two agents for most things even though particular agents may well be more suitable in certain circumstances eg desflurane with obesity etc In view of this problem the display of age corrected MAC was particularly since one could now use any agent for any patient irrespective of age quite safely 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
74. 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 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 CHAPTER 5 INTERFACING THE SERIAL PORT IN LINUX RWD Nickalls 50 ob gt handshake none croak fail setting handshake ob gt write_settings croak no settings my my ny my dt dump portbuffer Ld Lb 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 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 n print LOG n starting collecting data n nC my EOF chr 26 EOF character my Leof 1 my Lcr char length to the CR my buffer
75. 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 more 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 t
76. Society of Anaesthesia NEMSA Queen s Medical Centre April 8 2005 mini symposium on Information Technology Nickalls RWD 2005b Linux in the operating theatre 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 CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickals 7 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 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
77. 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 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 hou
78. 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 These are the working subroutines in the 1 002 version no change with the 1 04 version sub sub rts active return unless _ 2 my self shift return unless self gt can_rts my on yes true shift returns ioctl result my value 10CTL VALUE RTS my rc self ioctl on TIOCMBIS TIOCMBIC V value my rc ioctl self gt HANDLE on bitset bitclear rtsout warn rts active on ioctl n if rc return rc cts active RWDN Jan 2 2006 return unless 2 45 CHAPTER 5 INTERFACING THE SERIAL PORT IN LINUX RWD Nickalls 46 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 When the module is installed linux Mandriva places the module in the following location usr lib perl5
79. V plot 20 00000 365 plot 25 00000 366 plot 30 00000 367 V plot 35 00000 368 plot 40 00000 369 plot 45 00000 370 plot 50 00000 371 plot 55 00000 372 V plot 60 00000 373 V plot 65 00000 OOOOOOOOOOOO 0 0 0 0 0 0 0 0 0 0 63972 62021 60129 58296 56518 54795 53124 51504 49933 j55 j60 374 plot 70 00000 0 58296 75 00000 0 56518 j70j75 375 plot 75 00000 0 56518 80 00000 0 54795 9 j75j80 376 plot 80 00000 0 54795 85 00000 0 53124 j80j85 377 plot 85 00000 0 53124 90 00000 0 51504 j85j90 378 plot 90 00000 0 51504 95 00000 0 49933 j90j95 379 end of file isojdata8 dat loop 1 380 endSKIP 381 382 from mac des m 383 var x 1 384 YA x 1 385 var x2 x 2 386 x2 T 387 X point h x2 2 55 2 475 h 1 00000 2 55000 388 text MAC h 389 Vput MAC at 1 000000 2 550000 390 vertical diff 0 29 units 0 28 391 var d 0 29 392 d 0 29 393 var h6 0 88 394 996 h6 0 88 395 text Vfbox 0 Ncdot 6 x h6 396 put fbox 0 cdot 6 at 1 000000 0 880000 397 var h8 h6 d 398 h8 1 17 399 text fbox 0 cdot 8 x h8 400 put fbox 0 cdot 8 at 1 000000 1 170000 401 var h10 h8 d 402 h10 1 46 403 text fbox 1 cdot 0 x h10 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 86 404 405 406 407 408 409 410 411 4
80. 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 17 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 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 227 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
81. 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 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 193 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
82. 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 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 06 MODULERWD Nickalls 234 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
83. 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 line 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 CHAPTER 5 INTERFACING THE SERIAL PORT IN LINUX RWD Nickalls 49 print n end of file n 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 h 5 4 Receiving program dn getfile2 pl dn getfile pl from dxdemo3c p1 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
84. camomiletop tarballs camomile 0 1_040411 camomile docs camomiletop tarballs camomile 0 1_040411 camomile docs camomiletop tarballs camomilefield2tex 0 1_040411 camomile camomiletop tarballs camomilefield2tex 0 1_040411 camomile camomiletop tarballs camomilefield2tex 0 1_040411 camomile camomiletop tarballs inc camomiletop tarballs inc port datex as3 h camomiletop theatredata camomiletop theatredata 2004 Mar 05 1027 l bin runcamomile l bin camomilefield2tex Chapter 10 The Camomile program April 19 2009 oAHOUSE book xenon ch camomile tex 10 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 Ap
85. 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 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 protcols for the insulin management of diabetic patients during major surgery The current version is only a prototype we aim to greatly improve it by incorporating computer algorithms described by Mraz et al 2008 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 1500 drugs References Mraz M Kopecky P Hovorka R and Haluzik M 2008 Intensive insulin therapy in the ICU the use of computer algorithms British Journal of intensive Care 18 129 134 Nickalls RWD 2008 Linux goes to hospital Invited presentation to the Nottingham Linux Users Group Nottingham UK September 18 2008 Nickalls RWD 2006 MAC values In Allman KG and Wilson IH Eds Oxford Handbook of Anaesthesia 2006 Oxford University Press UK pp 1160 1162 Nickalls RWD 20052 Interfacing the PC to medical equipment Invited talk to the Nottingham amp East Midlands
86. ctsval 0 ctsval MS_CTS_ON print CTSval ctsval n my ringval 0 ringval MS RING ONO print RIval ringval n ob gt dtr_active F O red 1 green OK ob rts active 0 O red 1 green OK send the file sendfileO goto LASTLINE my crlf r n my outstringi abcdefgi2345 crlf my outstring2 123x crlf write the strings to the port while 1 print outstring1 pass ob write outstring1 sleep 3 print outstring2 pass ob write outstring2 CHAPTER 5 INTERFACING THE SERIAL PORT IN LINUX RWD Nickalls 48 Sleep 3 LASTLINE close close any open files ob gt close croak can t close SERIAL PORT undef ob returns memory back to Perl SUBR SSS SSS SEER ESE ES SEED to send a file line by line sub sendfilef works OK always send EOF character to signify the end my ifile drugs txt local outfile make it local if in SUB best practices p if e ifile 1 open outfile lt ifile croak ERROR can t open file ifile n 3 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 my 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
87. dataline uid1 uid2 6 uid1 print this string to outfile print UID uid Wn dissect out the front middle end parts of the string uid f1 index uid VIMP VIMID m1 index uid lt VIMID gt lt NM gt el index uid c NMP VIM d 1l detect the INVALID tag invalid index uid INVALID if find INVALID then remove the current string segment and get next line if invalid gt 1 f invalidflags ON print INVALID tag found Wn print invalid FLAG ON n goto REMOVE drugcode substr uid 12 m1 12 OK print drugcode lt drugcode gt Wn drugname substr uid ml 12 e1 m1 12 OK print drugname lt drugname gt Wn print new format to outfile this is actual Unordered contents of VIM file print outfile eventnumber gt lt drugname dru collect all the drugname s into an Unsorted array so we can sort it later push udrugname drugname collect name code pairs into a hash dmd dmd drugname drugcode check drugname for reverse and add to listing p lt space gt t lt space gt defined above igcode 5n CHAPTER 12 DRUG DICTIONARY RWD Nickalls 132 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 2
88. endpicture 468 framebox 469 Vend document 470 471 PointNumber 200 472 96 Number of points variables used 153 473 Yox 4 L02R02 LOOROO 6 3 3 Final mathsPIC program for making the charts This version of the mathsPIC program mac iso8t m incorporated axis legend rotation using IATEX and PostScript and generated the version used by the Oxford handbook of anaesthesia 1 mac iso8T m TEST version modified from mac iso8 m 2 Jan 10 2006 3 mathsPICperl version 4 X final graph chart for the bja CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 73 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 wih decimals cdot and fbox new curves for anaesthesia mathsPIC to test rotation legend on axes 9 6 W 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 isoflurane word from ylegend push Isoflutane title up push age down A documentclass a4paper 12pt article usepackage mathspic usepackage decimal rotating begin document Noddsidemargin 17m framebox beginpicture use sf font for figures for BJA fontfamily cmss selectfont normalsize Minethickness 1 1pt normalsize was 0 9 for BJA my manual p 23 structure c
89. 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 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 tim
90. 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 of displaying real time age corrected MAC was at that time almost certainly the only such system in the UK and possibly in the world N2O exp 40 01 Vap exp 2 62 N2O MAC 0 38 Vap MAC 148 Figure 6 2 Total MAC 1 87 Example of the new real time age corrected MAC widget vapour SEV i 2 age 43 displayed by the anaesthesia workstation Linux software Nickalls 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 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 This allowed a nice widget design and hence a much better age corrected MAC screen display as shown in Figures 6 2 6 3 This display was intuitive easy to read and well liked CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 54 E Ins file home dicl 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
91. 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 noyticsNn 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 ymax 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 20 FIELDS2PDATA PL RWD Nickalls 256 else print printlog no nibp s gnn files n if e nibpdf
92. 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 project format home dick allfiles camomiletop theatredata test Y M D h m include projectdir conf 44 has the new dirs from launchcam pl CHAPTER 11 CONFIGURATION FILES RWD Nickalls 118 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 11 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 se5 11 5 w monitor datexas3 conf hh widgets conf mods 11 4 3 initial hhhhhhhhhhh AA lh hhhhhhhhhhhhhhhhhhhhhhhhlh ode loh dn 44 Ports hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh CHAPTER 11
93. how do current forms measure up Royal College of Anaesthetists Newsletter 36 1997 3 6 CHAPTER 2 DATA PROCESSING IN ANAESTHESIA RWD Nickalls 21 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 Anaesthesia 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 Internati
94. 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 12 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 CHAPTER 12 DRUG DICTIONARY RWD Nickalls 140 add was created as follows 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 solution 20 Hespan Hydroxy ethyl starch Gelofusin Hartmans solution Sodium lactate Blood packed cell
95. n40 232 put bullet at 50 00000 1 31967 n50 233 put bullet at 60 00000 1 24042 n60 234 put bullet at 70 00000 1 16592 n70 235 put bullet at 80 00000 1 09589 n80 236 put bullet at 90 00000 1 03007 n90 237 end of file lt isondata8 dat gt loop 1 238 thinline 239 inputfile isomdata8 dat 1 240 start of file lt isomdata8 dat gt loop 1 241 Iteration number 1 242 m mac40 iso 1 AA HA HA HA HA HA HA HA hi i hi HA hi HA HA HA Lm HAHAHA HAHAHA HHA HHA HHA HA HA HE j jae HA HA HA hi T hat 69070 n5n10 63914 n10n15 58916 n15n20 54070 n20n25 49371 n25n30 44816 n30n35 40400 n35n40 36119 99 n40n45 31967 n45n50 27943 99 n50n55 24042 n55n60 20259 n60n65 16592 n65n70 13036 n70n75 09589 n75n80 06247 99 n80n85 03007 n85n90 99866 n90n95 49371 44816 40400 36119 31967 27943 24042 16592 13036 09589 06247 03007 99866 20259 n6 n55 243 X point m5 5 1 453235 m5 5 00000 1 45324 244 W point m10 10 1 408918 m10 245 99 point m15 15 1 365953 m15 246 99 point m20 20 1 324298 m20 10 00000 1 15 00000 1 20 00000 1 Il 40892 36595 32430 0 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 83 247 248 249 250 251 252 25
96. 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 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 a
97. 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 17 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 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 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 starttimeunix originalgmt fname n close outfile5 print areas lt gnnheader dat gt done n 17 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 creat
98. point q85 85 1 416628 85 1 416628 X point q90 90 1 373428 90 1 373428 point q95 95 1 331545 95 1 331545 99 o drawline q5q10q15q20q25q30q35q40q45q50q55q60q65q70q75q8 plot 5 2 325176 10 2 25427 996 q5q10 plot 10 2 25427 15 2 185525 q10q15 plot 15 2 185525 20 2 118877 q15q20 plot 20 2 118877 25 2 054262 996 q20q25 plot 25 2 054262 30 1 991617 q25q30 plot 30 1 991617 35 1 930882 q30q35 plot 35 1 930882 40 1 872 amp q35q40 plot 40 1 872 45 1 814913 996 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 X drawpoint g10420430440450460470480490 q85q90q95 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 66 117 Vput bullet at 10 2 25427 q10 118 put bullet at 20 2 118877 q20 119 Vput bullet at 30 1 991617 q30 120 Vput bullet at 40 1 872 q40 121 put bullet at 50 1 759567 q50 122 put bullet at 60 1 653887 q60 123 Vput bullet at 70 1 554554 g70 124 Vput bullet at 80 1 461187 q80 125 Vput bullet at 90 1 373428 q9
99. 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 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 16 Typesetting programs 16 1 ch prtanes tex prtanes6 tex Ndocumentclass a4paper article usepackage dvips color graphicx ANusepackage pdftex color graphicx usepackage times usepackage latexsym 44 for Box
100. program PRINT LAST CASE c The CAMOMILE project team 2004 Figure 1 6 Anaesthetic record graphic record CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 10 Go Bookmarks PageMarks Tools Settings Window Help 9 OS mix e Tt Click on the RUN AN STHESIA RECORD Putian to Siart the Nottingham City Hospital anaesthesia program NHS Trust Patient label Begin Log at 2 35 15 Note 192 opened logfile home dick allfiles camomileto p theatredata base log 2004 04 29 12 35 45 Patient 57 yrs 65 kg 173 cm Male 2004 04 29 Surgeon Mr 2004 04 29 Ansesthetist Dr 2004 04 29 Drug Atracurium 20 2004 04 29 Drug Meuriminol 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 50 mls 6 mlslhr 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 29 Comment changing ett to single lumen 2004 04 29 15 55 33 Drug Propofol 20 Figure 1 7 Ana
101. 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 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 20 FIELDS2PDATA PL RWD Nickalls 262 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 timefil
102. relx gt 0 5 rely gt 0 66 123 _______ 124 DIABETES 60mins button 125 topwindow Button text gt DIABETES 60 mins 126 padx gt 10 pady gt 10 127 relief gt raised 128 background gt LightBlue3 129 activebackground gt LightBlue2 130 foreground gt Blue 131 activeforeground gt Red 132 133 command gt amp diabetes60 134 gt pack side bottom expand gt 1 135 place relx gt 0 5 rely gt 0 78 136 137 138 4 139 TEST COFFEE demo button 140 topwindow Button text gt TEST c 141 padx gt 10 pady gt 5 142 relief gt raised 143 background gt Green 144 activebackground gt Yellow 145 foreground gt Black 146 activeforeground gt Red 147 command gt amp testcoffee5 148 pack side bottom expand gt 1 149 place relx gt 0 05 rely gt 0 36 150 151 152 153 4 154 TEST diabetes demo button CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 160 155 topwindow Button text gt TEST d 156 padx gt 10 pady gt 5 157 relief gt raised 158 background gt Green 159 activebackground gt Red 160 foreground gt Black
103. s cesas u e ee Ru AR 91 7 2 The BASH script runcamomile llle 92 7 3 Pressing the RUN button aaa 93 7 3 1 Program tklaunch2 pl cen 94 7 4 Useful Linux tools to use with the launcher 96 8 The launchcami2 pl program 98 8 1 Jnt oduction s 4v RU Sod SOT v tcm E AE e ad 98 8 2 The program launchcami2 pl ss 100 NI The data program Camomile 105 9 System overview 106 91 Introductions 24 243 4545548 See xS RR EG EORR RE 106 92 Modules e nemei o n m RR m WER GE m m n m m v e 107 9 2 1 Graphical front end module l l 107 9 2 2 Data collection and display module 107 9 2 3 Printing module earo a EE EE ss EE se 107 9 2 4 Epidural database llle 107 92 5 Helpfiles sei pos Rom RR RR B GR E EE RR ER OR de 107 9 3 Directory structure lese 107 CONTENTS viii 10 The Camomile program 109 10 1 Directory listing of camomile v 0 1 040413b 109 11 Configuration files 114 11 1 Introduction 2 len 114 11 2 C2aS3rm Cont exces ES ee S a Ro ee E BR 115 11 3 x configrn COnf s ed Xe wae ee he We s Re e gere es 117 11 4 projectdiCODE s s sea KERE RD RR ERES ER OR Ee N ES 118 11 5 w monitor datexas3 conf ee ee 118 11 6 People conf gt s so ER ME ER Re ERR REB EE GR RR 120 11 7 Drugsicont sabe RR ER R E E ERR 3 120 11 8 x widgets conf 4 5 ks o RR a 121 12 Drug dictionary 125 12 1 ritrod
104. 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 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 06 MODULERWD Nickalls 238 space calculate new elapsed time from begining of new hour newet elapsedtime 3600 hour 1 print outfile newet space paramvalue space unixtime n
105. the 22 CHAPTER 3 TEX IN THE OPERATING THEATRE RWD Nickalls 23 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 processing 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 put
106. 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 Care in Rotterdam Holland May 1996 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 3A meeting concerned with the IEEE 1073 Standard regarding computer interfacing to Medical Devices CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 8 1 5 Th
107. 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 C7 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 12 pt article usepackage pictexwd 10 begin document thispagestyle empty to avoid page nos 12 oddsidemargin 17mm 13 framebox 14 beginpicture 15 VO 00 10 Uta RD 17 use sf font for figures for BJA 18 fontfamily cmss selectfont normalsize 19 linethickness 0 9pt normalsize my manual p 23 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 6o 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 structure copied from mac des m Yoh ISOflurane Delta for N20 0 75 66 6666 104 1 17 pointnumber 200 y units 12cm 2 2 5 454545 paper units mm5 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 axis left tic
108. 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 24 ANAESTHETIC SHEET Theatre 1 City Hospital Nottingham UK DATE OPERATION ANAESTHETISTS SURGEONS 18 August 2000 Laparotomy RWD Nickalls et al JOHN DOE dob Age AN Other et al Hosp No 123456789 Nightingale Ward 24 01 1925 DS
109. time encoded dirname n 28 projdir tedname timenowgmt 29 remember to add the at the end of the dir so Camomile makes the fields dir 30 as a subdirectory 31 projdir projdir 32 print time encoded directory made OK projdir n 33 34 35 print unixtime timenowunix gmt timenowgmt n 36 print projdir name tedname projdir Wn 37 38 fHHHHHHEE for testing 39 HHHHH use this for testing with the dir cam1404fields 40 THHHHHHE for 1240 test 41 HHHH starttimeunix 1075984828 Thu Feb 5 12 40 28 2004 42 projdir home dick allfiles camomiletop theatredata cam1240 43 timenowunix 1075984828 44 timenowgmt Thu Feb 5 12 40 28 2004 45 46 camomile starts here CHAPTER 8 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 101 4T 48 49 50 51 52 53 54 55 56 51 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 TI 78 79 80 81 82 83 84 85 86 print An M cire start of camomile program n run camomile here from camomiletop datexsim keep everything on single line campath tarballs camomile 0 1_040411 camomile camomile 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 et
110. 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 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 183 CHAPTER 14 DATA STORAGE FILES AND FORMATS RWD Nickalls 184 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 18
111. 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 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 ields2PDATA pl so the next thing is a first check we are in the correct directory PDATA and if so then to launch CHAPTER 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 214 the program using the system command writing appropriate comments to the logfile as we go processda
112. 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 chapter 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 192 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
113. volume respiration rate isoflurane and MAC Chapter 4 The Datex AS 3 anaesthesia monitor ch dxmon 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 358 9 39411 FAX 358 9 146 3310 Datex Ohmeda 71 Great North Road Hatfield Hertfordshire AL9 5EN UK Tel 01707 263 570 FAX 01707 260 065 25 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 26 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 by
114. x5 y02 point R02 x6 y02 point L00 x5 y00 point R00 1x6 y00 draw the dashes from Left to Right so have small gap at right axis drawline L16R16 L14R14 L12R12 L10R10 L08R08 LO6RO6 L04R04 LO2RO2 LOOROO endpicture Yframebox end document ox mathsPIC 2 1g1 Copyright c RAD Nickalls 1999 2002 Email dicknickalls compuserve com s Date m d y 02 02 2003 16 22 19 Command Line b s MAC ISO7 M Input Filename MACISO7 M 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 mathsPIC documentclass a4paper 12 pt article usepackage pictexwd begin document thispagestyle empty to avoid page nos oddsidemargin 17mm framebox beginpicture use sf font for figures for BJA fontfamily cmss selectfont normalsize Minethickness 0 9 pt normalsize my manual p 23 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 64 27 28 29 30 31 32 33 34 35 36 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 structure copied from mac des m YK ISOflurane Delta for N20 0 75 66 6666 104 1 17 W pointnumber 200 y units 12cm 2 2 5 454545 paper units mm
115. 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 LO8 x5 y08 L08 5 00000 1 55230 point RO8 x6 y08 R08 100 00000 1 55230 X point L06 x5 y06 L06 5 00000 1 35230 point R06 1x6 y06 R06 100 00000 1 35230 point L04 x5 y04 L04 5 00000 1 15230 X point RO4 1x6 y04 R04 100 00000 1 15230 point LO2 x5 y02 L02 5 00000 0 95230 point RO2 x6 y02 R02 100 00000 0 95230 point LOO x5 y00 LOO 5 00000 0 75230 point ROO x6 y00 ROO 100 00000 0 75230 ll Il Il Il Il IE Il CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 88 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 draw the dashes from Left to Right so have small gap at right axis drawline L16R16 L14R14 LI2R12 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
116. 0 1 554554 17 point q 75 75 1 507148 18 point q 80 80 1 461187 19 point q 85 85 1 416628 20 point q 90 90 1 373428 21 point q 95 95 1 331545 EE BA aa 23 drawline g 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 q 85 q 90 q 95 24 drawpoint q 10 q 20 q 30 q 40 q 50 q 60 q 70 q 80 q 90 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 nac 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 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 f version of
117. 0 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 99 6 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 isondata8 dat loop 1 W Iteration number 1 n mac40 iso 1 2 point n5 5 1 743882 manual n5 5 00000 1 74388 point n10 10 1 690702 n10 10 00000 1 69070 point n15 15 1 639144 n15 15 00000 1 63914 point n20 20 1 589158 n20 20 00000 1 58916 point n25 25 1 540697 n25 25 00000 1 54070 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 82 194 point n30 130 1 493713 n30 30 00000 1 195 point n35 35 1 448162 n35 35 00000 1 196 point n40 40 1 404 n40 40 00000 1 197 point n45 45 1 361185 n45 45 00000 1 198 point n50 50 1 319675 n50 50 00000 1
118. 0 126 end of file lt isoqdata dat gt 127 thinline 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 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 inputfile isopdata dat Wo ee p mac40 iso point p5 5 2 034529 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 p75 75 1 318754 point p80 80 1 278539 point p85 85 1 23955 point p90 90 1 201749 point p95 95 1 165102 997 o Y o 99 o 99 o 99 o Soy o Soy o Soy o 99 o 99 o 99 o Soy o Soy o Soy o 99 o 99 o Soy o Soy o Soy o Soy o 99 o drawline p5p10p15p20p25p30p35p40p45p50p55p60p65p70p75p8 V plot plot plot plot plot plot plot plot plot plot plot plot plot plot plot plot plot plot ee 1 4 201 4 5 40 55 65 85 start of file lt isopdata dat gt 2 034529 10 1 972486 15 1 912335 20 1 854018 25 1 797479 30 1 742665 35 1 689522 1 638 45 1 588049 50 1 539621 1 49267 60 1 4
119. 0 1 70591 99 6 q50q55 121 plot 55 00000 1 70591 60 00000 1 65389 q55q60 122 plot 60 00000 1 65389 65 00000 1 60345 q60q65 123 plot 65 00000 1 60345 70 00000 1 55455 q65q70 124 plot 70 00000 1 55455 75 00000 1 50715 q70q75 125 plot 75 00000 1 50715 80 00000 1 46119 99 6 q75q80 126 plot 80 00000 1 46119 85 00000 1 41663 q80q85 127 plot 85 00000 1 41663 90 00000 1 37343 q85q90 128 plot 90 00000 1 37343 95 00000 1 33154 q90q95 129 drawpoint q10 q20 q30 q40 q50 q60 q70 q80 4q90 130 Vput bullet at 10 00000 2 25427 q10 131 Vput bullet at 20 00000 2 11888 q20 132 Vput bullet at 30 00000 1 99162 q30 133 Vput bullet at 40 00000 1 87200 q40 134 put bullet at 50 00000 1 75957 q50 135 put bullet at 60 00000 1 65389 q60 136 put bullet at 70 00000 1 55455 q70 137 Vput bullet at 80 00000 1 46119 q80 138 put bullet at 90 00000 1 37343 q90 139 140 141 142 99 o 99 o Soy o end of file lt isoqdata8 dat gt loop 1 thinline inputfile isopdata8 dat start of file lt isopdata8 dat gt loop 1 1 4 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 81 143 144 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 18
120. 01 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 if drugname m print YES the string has a FYN make array of words separated by space my words split drugname f 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 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 wl print REVstring REVstring Wn drugname REVstring push udrugname drugname add to the Unsorted drugname array dmd Y dmd drugname drugcode add new name code pair to the hash j elsif n 3 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 Y dmd drugname drugcode add new name code pair to the hash REVstring w3 p w1 p w2 print REVstring REVstring Wn drugname REVstring push udrugname drugname add to the Unsorted drugname array dmd Y dmd drugname drugcode add new name code pair to the h
121. 06 nFixed red diabetes demo alert VnVn Version 1 0 nDecember 18 2005 text gt 3l H 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 An mls hrXn Run insulin actrapid 1Unit ml at 0 5 Units hr n nGlucose Insulin rate nmMol L units hr n n 0 3 9 O n 4 6 9 1n 7 9 9 2 n10 14 9 3 n15 19 9 4 n 20 5 text gt TYD title gt Sliding scale header gt ITU Sliding Scale n n Run 5 Dextrose at 60 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 168 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 create the help object needs to go last my help topwindow 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 Times does not work 4 weight gt normal does not work NE EN NE variable gt helparray HH end 13 4 Test demo programs dn alarm demoRED pl There are two test buttons which trigger demo programs these show a
122. 1 15 5 1997 This is a 37 page A4 document available as a WORD document 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 The string starts and ends with a 7Eh byte 126d have numbered the bytes decimal starting with 1 1 321 Note that byte 1 is the FIRST byte to be received by the PC The byte values are given in Hexadecimal h 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 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 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 dou
123. 1 CONFIGURATION FILES RWD Nickalls 115 x displaysrn conf x set alarms conf x set alarmsrn conf x widgets conf xx lst 11 2 c as3rn conf A amp LaTeX camomile 4 40n0ff beginCamomileConfig endCamomileConfig V EndCamomileComments documentclass a4paper article usepackage geometry geometry hscale 0 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 11 CONFIGURATION FILES RWD Nickalls 116 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 s
124. 1 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 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 222 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 files is the current directory 17 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 ar
125. 1 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 13 5 Screen showing the pop up diabetes alarm Clicking the close button causes 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 14 Data storage files and formats April 19 2009 allfiles camomile cam book ch camdata tex 14 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 14 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 14 3 D data This is the raw data from the Datex AS 3 monitor and is saved
126. 12 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 put fbox 1 cdot 0 at 1 000000 1 460000 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 hl6 hl4 d h16 2 33 text Vfbox 1 Ncdot 6 x h16 put fbox 1 cdot 6 at 1 000000 2 330000 macATdes2 pl 99 var y2 2 6 y2 2 6 99 var yl 0 4 W yl 0 4 newcommand ylegend sf End tidal in 100 oxygen air determine string length gt Yunits etc newlength ylength settowidth ylength ylegend 76 text answer ylength number ylength 37 0 4 halflength 3 818 0 777 y units text turnbox 90 ylegend 25 yl y2 y1 2 0 777 put turnbox 90 ylegend at 25 000000 0 723000 rbeginSKIP 9o endSKIP 9 rbeginSKIP yendSKIP newcommand myrightb fbox begin minipage 3 5cm 3 8cm End expired in hspace 9mm 67 hspace 8mm 50 hspace 9mm N _2 0 hspace 7 5mm N 2 0 end minipage 9o 1 end of newcommand text myrightb 89 143 2 657 1 put myrightb 1 at 89 143000 2 657000
127. 161 activeforeground gt Blue 162 command gt amp testdiabetes 163 gt pack side bottom expand gt 1 164 place relx gt 0 05 rely gt 0 45 165 166 167 HOWIO use button 168 topwindow Button text gt HOWIO use 169 padx gt 9 pady gt 10 170 relief gt raised 171 background gt LightGrey 172 activebackground gt Grey 173 foreground gt Blue 174 activeforeground gt Red 175 command gt G amp errorbox 176 command gt Gshowhelp 177 command gt sub showhelp 178 pack side bottom expand gt 1 179 place relx 20 05 rely gt 0 54 180 181 182 183 VIEW logfile button 184 topwindow Button text VIEW logfile 185 padx gt 10 pady gt 10 186 relief gt raised 187 background gt LightGrey 188 activebackground gt Grey 189 foreground Blue 190 activeforeground Red 191 command gt amp viewlog 192 pack side bottom expand gt 1 193 place relx gt 0 05 rely gt 0 66 194 195 ______ __ 196 VIEW calendar file button 197 topwindow Button text gt VIEW calfile 198 padx gt 10 pady gt 10 199 relief gt raised 200 background gt LightGr
128. 19 20 21 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 14 pack open my VIEWFILE lt input filename croak errormessage code A while lt VIEWFILE gt text gt insert end _ MainLoop close VIEWFILE else croak errormessage code B end 13 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 T T RWD Nickalls April 26 2006 message boxes for Xenon Useful books page 301 Perl core languages Little Black Book THE usage perl dn errorbox pl in error message VSA ee requires use of the explicit in tag THE 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 HE 300x400 50 300 use Tk CHAPTER 13 DIABETES DECISION S
129. 2 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 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 perfo
130. 2 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 tsampler 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 10 THE CAMOMILE PROGRAM RWD Nickalls 113 2899 Apr 10 2004 twaffle h 6805 Apr 10 2004 twidgetfactory cpp 1943 Mar 16 2003 twidgetfactory h 3348 Ap
131. 20 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 e g QuickBASIC 4 5 OBASIC 1 1 cannot be used to program the Datex AS3 serial interface PowerBASIC 3 5 FirstBASIC 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 4 3 Command format 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 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 28 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 Unfortunately the AS 3 and CS 3 monitors use a rather complicated and somewhat confusing transmission request command a string of 52 bytes to instruct the monitor to output data the complete output data string is 321 bytes The frequency of data output every 10 seconds 60 seconds etc is set using bytes 43 and 44 In practi
132. 2005 to reverse a string of n names with my instring AlA1 A2A2 clcl c2c2 RIR1 R2R2 my p ee replace with just instring s p put the words into an array if instring m print YES the string has a FYN make array of words separated by space my words split instring clean out remove leading and trailing white space from each string my Gclean 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 Gclean words my n clean_words 1 print n my n Nn print string instring Wn CHAPTER 12 DRUG DICTIONARY RWD Nickalls 138 30 31 32 33 34 35 36 37 38 39 40 4l 42 43 44 45 46 47 48 49 if n 2 print REVstring w2 p wl1 n j elsif n 3 print REVstring w1 p w3 p w2 Nn print REVstring w2 p w1 p w3 n print REVstring w2 p w3 p w1 n print REVstring w3 p w1 p w2 Nn print REVstring w3 p w2 p w1 n elsif n 4 print first w1 Wn print seconds w2 Wn print third w3 Wn print 4th w4 Nn else print ERROR string NOT processed as n QU NAO else print NO the string has no M 12 7 Initial
133. 202589 70 1 165916 n65n70 plot 70 1 165916 75 1 130361 n70n75 V plot 75 1 130361 80 1 09589 n75n80 V plot 80 1 09589 85 1 062471 n80n85 plot 85 1 062471 90 1 030071 n85n90 V 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 ee end of file lt isondata dat gt n85n90n95 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 68 223 thinline 224 W inputfile isomdata dat 1 225 start of file lt isomdata dat gt 226 m mac40 iso 1 227 point m5 5 1 453235 5 1 453235 228 point m10 10 1 408918 10 1 408918 229 point m15 15 1 365953 15 1 365953 230 point m20 20 1 324298 20 1 324298 231 point m25 25 1 283914 25 1 283914 232 point m30 30 1 244761 30 1 244761 233 point m35 35 1 206802 35 1 206802 234 point m40 40 1 17 40 1 17 235 point m45 45 1 134321 45 1 134321 236 point m50 50 1 099729 50 1 099729 237 point m55 55 1 066193 55 1 066193 238 point m60 60 1 033679 60 1 033679 23
134. 2tics 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 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 20 FIELDS2PDATA PL RWD Nickalls 258 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 pl
135. 3 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 Soy o Soy o Soy o 99 o 99 o Soy o Soy o Soy o Soy o 99 o 99 o 99 o Soy o 0 Vo 997 o 0 y A S plot 5 00000 1 45324 10 00000 plot 10 00000 plot 15 00000 plot 20 00000 plot 25 00000 plot 30 00000 plot 35 00000 plot 40 00000 plot 45 00000 plot 50 00000 plot 55 00000 plot 60 00000 plot 65 00000 plot 70 00000 0 97160 75 00000 plot 75 00000 0 94197 80 00000 plot 80 00000 0 91324 85 00000 plot 85 00000 0 88539 90 00000 plot 90 00000 0 85839 95 00000 Soy o point m25 25 1 283914 m25 25 00000 point m30 30 1 244761 m30 30 00000 point m35 35 1 206802 m35 35 00000 point m40 40 1 17 m40 40 00000 1 17000 point m45 45 1 134321 m45 45 00000 point m50 50 1 099729 m50 50 00000 point m55 55 1 066193 m55 55 00000 point m60 60 1 033679 m60 60 00000 point m65 65 1 002157 m65 65 00000 point m70 70 0 9715963 m70 70 00000 point m75 75 0 9419674 m75 75 00000 point m80 80 0 9132419 ms0 80 00000 point m85 85 0 8853925 m85 85 00000 point m90 90 0 8583924 m90 90 00000 point m95 95 0 8322156 m95 95 00000 drawline m5 m10 m15 m20 m25 m30 m35 m40 m45 m5 m65 m70
136. 3 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 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 kalarm b c red t 2008 04 10 11 51 DIABETES repeat blood sugar i 0005 u 2008 04 11 11 31 20 21 22 23 24 25 26 27 28 29 30 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 155 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 th
137. 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 sSnomed org snomedct which is a dynamic health care terminology infrastructure being developed 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 int
138. 40 iso 8 270 point k5 5 1 162588 5 1 162588 manual 271 point k10 10 1 127135 10 1 127135 272 point k15 15 1 092763 15 1 092763 273 point k20 20 1 059439 20 1 059439 274 point k25 25 1 027131 25 1 027131 275 point k30 30 9958085 30 9958085 wr wv CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 69 276 277 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 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 point k35 135 9654412 35 9654412 point k40 40 936 40 936 point k45 145 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 Y drawline k5k10k15k20k25k30k35k40k45k50k55k60k65k70k75k8 plot 5 1 162588 10 1 127135 k5k10 plot 10 1 127135 15 1 092763 k10k15 plot 15 1 092763 20 1 059439 k15k20 plot 20 1 059439 25 1 027131
139. 47151 1 40302 70 1 360235 75 1 318754 80 1 278539 1 23955 90 1 201749 95 1 165102 manual vr WH 5 2 034529 10 1 972486 p5p10 10 1 972486 15 1 912335 p10p15 15 1 912335 20 1 854018 p15p20 20 1 854018 25 1 797479 p20p25 25 1 797479 30 1 742665 p25p30 30 1 742665 35 1 689522 p30p35 35 1 689522 40 1 638 p35p40 40 1 638 45 1 588049 p40p45 45 1 588049 50 1 539621 p45p50 50 1 539621 55 1 49267 99 p50p55 55 1 49267 60 1 447151 p55p60 60 1 447151 65 1 40302 p60p65 65 1 40302 70 1 360235 p65p70 70 1 360235 75 1 318754 p70p75 75 1 318754 80 1 278539 p75p80 80 1 278539 85 1 23955 p80p85 85 1 23955 90 1 201749 p85p90 90 1 201749 95 1 165102 p90p95 end of file lt isopdata dat gt p85p90p95 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 67 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 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 thic Soy o ee n mac40 iso point n5 5 1 743882 point n10 10 1 point n15 15 1 point n20 20 1 point n25 25 1 point n30 30 1 point n35 35 1 point n40 40 1 point n45 45 1 point n50 50 1 point n55 55 1 point n60 60 1 point n65 65 1 point n70 70 1 point n75
140. 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 setcoordinatesystem units lt 7mm 3 818181cm gt Wo note xunits amp yunits are different setplotarea x from 8 to 100 y from 4 to 2 6 axis top want to print only some of the L axis scale 0 6 2 4 so do it manually axis left ticks withvalues O cdot 6 Of Ncdot 18 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 2 40 96 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 Vaxis right YA using N20 67 shift 0 7523 ticks withvalues 0 0 cdot 2 0 cdot 4 0 cdot 6 0 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 96 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 Soy o 6 axes T paper units 0 7mm 3 818181cm xrange 8 121 yrange 0 5614 2 3614 setcoordinatesystem units lt 7mm 3 818181cm gt Wo 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 0 Ncdot 12 0
141. 580251 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 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 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 219 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 g0
142. 6 69 extra 50 right axis shift 0 5614 70 since this axis is off the graph then need new paper command 71 but do not use axis option 72 X paper units 0 7mm3 818181cm xrange 8 121 yrange 0 5614 2 3614 73 Nsetcoordinatesystem units 0 7mm3 818181cm 74 Nsetplotarea x from 8 00000 to 121 00000 y from 0 56140 to 2 36140 75 Naxis right 9 seconds right axis for 50 oxygen shift 0 5614 76 ticks withvalues 0 0 Ncdot 12 0 cdot 4 0 cdot 16 0 cdot 8 TI 1 cdot 0 1 cdot 2 1 cdot 4 1 cdot 6 1 cdot 8 78 at 0 5614 0 7614 0 9614 1 1614 1 3614 79 1 5614 1 7614 1 9614 2 1614 2 3614 80 81 beginSKIP 82 newcommand thickline HY setplotsymbol fV Large 83 newcommand thinline setplotsymbol tiny BJA graphs 84 make thin line a bit thicker for the OUP graphs 85 newcommand thinline setplotsymbol large 86 thickline 87 inputfile isoqdata8 dat 1 6 88 start of file lt isoqdata8 dat gt loop 1 89 Iteration number 1 90 q mac40 iso 1 6 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 8o 91 X point q5 5 2 325176 manual 5 00000 2 32518 92 X point q10 10 2 25427 q10 10 00000 2 25427 93 point q15 15 2 185525 q15 15 00000 2 18553 94 X point q20 20 2 118877 q20 20 00000 2 11888 95 X point q25 25 2 054262 q25 25 00000 2 05426 96
143. 600 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 deltahminusqq 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 20 FIELDS2PDATA PL RWD Nickalls 255 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
144. 64 note get two spaces after the Month if days lt 10 165 if two spaces in posn 8 and 9 then remove one 166 if substr startgmtstring 7 2 eq substr startgmtstring 7 2 167 print SUB new translated string startgmtstring Wn 168 now replace spaces with commas 169 startgmtstring tr 170 make an array 171 Gstgmt split startgmtstring 172 day stgmt 0 173 month stgmt 1 174 date stgmt 2 175 hms stgmt 3 176 year stgmt 4 CHAPTER 8 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 104 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 noitems ffstgmt 1 print SUB orig string startgmtstring n print SUB extracted gmt part is day month date hms year n print SUB extracted starttime hh mm ss hms Vn now extract the hh mm ss part to get the hh mm Ghhmmss split hms hour hhmmss 0 min hhmmss 1 sec hhmmss 2 ee rd EA 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 da END_ testring Part III The data program Camomile 105 Ch
145. 68 01 001 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 283 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 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 43 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 319 00 000 320 DE 222 321 7E 126 4 6 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 O 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 purpose 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 valu
146. 8 189 190 191 192 193 W Iteration number 1 p mac40 iso 1 4 point p5 5 2 034529 manual p5 5 00000 2 03453 point p10 10 1 972486 p10 10 00000 1 97249 point p15 15 1 912335 p15 15 00000 1 91233 point p20 20 1 854018 p20 20 00000 1 85402 point p25 25 1 797479 p25 25 00000 1 79748 W point p30 30 1 742665 p30 30 00000 1 74266 W point p35 35 1 689522 p35 35 00000 1 68952 point p40 40 1 638 p40 40 00000 1 63800 point p45 45 1 588049 p45 45 00000 1 58805 o point p50 50 1 539621 p50 50 00000 1 53962 point p55 55 1 49267 p55 55 00000 1 49267 point p60 60 1 447151 p60 60 00000 1 44715 W point p65 65 1 40302 p65 65 00000 1 40302 point p70 70 1 360235 p70 70 00000 1 36024 point p75 75 1 318754 p75 75 00000 1 31875 point p80 80 1 278539 p80 80 00000 1 27854 o point p85 85 1 23955 p85 85 00000 1 23955 point p90 90 1 201749 p90 90 00000 1 20175 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 91233 20 00000 1 85402 p15p20 plot 20 00000 1 85402 25 00000 1 79748 p20p25 plot 25 00000 1 79748 30 00000 1 74266 p25p3
147. 8 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 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 14 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 14 5 Drug data The Camomile data
148. 87 padx gt 10 pady gt 10 88 relief gt raised 89 background gt LightBlue3 90 activebackground gt LightBlue2 91 foreground gt Blue 92 activeforeground Red 93 94 command gt amp diabetes30 95 pack side bottom expand gt 1 96 place relx gt 0 5 rely gt 0 42 9 dE 98 DIABETES 40mins button 99 topwindow Button text gt DIABETES 40 mins 100 padx gt 10 pady gt 10 101 relief gt raised 102 background gt LightBlue3 103 activebackground gt LightBlue2 104 foreground gt Blue 105 activeforeground gt Red CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 159 106 107 command gt amp diabetes40 108 pack side bottom expand gt 1 109 place relx gt 0 5 rely gt 0 54 110 111 DIABETES 50mins button 112 topwindow Button text gt DIABETES 50 mins 113 padx gt 10 pady gt 10 114 relief gt raised 115 background gt LightBlue3 116 activebackground gt LightBlue2 117 foreground gt Blue 118 activeforeground gt Red 119 120 command gt amp diabetes50 121 gt pack side bottom expand gt 1 122 place
149. 9 point m65 65 1 002157 65 1 002157 240 point m70 70 9715963 70 9715963 241 point m75 75 9419674 75 9419674 242 point m80 80 9132419 80 9132419 243 point m85 85 8853925 85 8853925 244 point m90 90 8583924 90 8583924 245 point m95 95 8322156 95 8322156 vr wv w EE 246 drawline m5m10m15m20m25m30m35m40m45mb50m55m60m65m70m75m80m85m90m95 247 plot 5 1 453235 10 1 408918 m5m10 248 V plot 10 1 408918 15 1 365953 m10m15 249 plot 15 1 365953 20 1 324298 m15m20 250 plot 20 1 324298 25 1 283914 9 m20m25 251 V plot 25 1 283914 30 1 244761 m25m30 252 V plot 30 1 244761 35 1 206802 m30m35 253 plot 35 1 206802 40 1 17 90 6 m35m40 254 V plot 40 1 17 45 1 134321 m40m45 255 plot 45 1 134321 50 1 099729 9 m45m50 256 V plot 50 1 099729 55 1 066193 9 m50m55 257 plot 55 1 066193 60 1 033679 m55m60 258 V plot 60 1 033679 65 1 002157 m60m65 259 plot 65 1 002157 70 9715963 m65m70 260 plot 70 9715963 75 9419674 9 m70m75 261 V plot 75 9419674 80 9132419 9 m75m80 262 V plot 80 9132419 85 8853925 9 m80m85 263 plot 85 8853925 90 8583924 9 m85m90 264 V plot 90 8583924 95 8322156 9 m90m95 265 996 end of file lt isomdata dat gt 266 thickline 267 inputfile isokdata dat 0 8 268 start of file lt isokdata dat gt 269 k mac
150. ALARM TRIGGER VALUE DATE TIME 19980101T050000Z REPEAT 23 DURATION PT1H ACTION PROCEDURE ATTACH FMTTYPE application binary ftp host com novo CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 152 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 13 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 13 2 1 To show Kalarm 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 13 2 2 Documentation Online help is available via the comm
151. AND ALONE SA 06 MODULERWD Nickalls 235 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 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 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 des
152. ASH script to change dir to gt datexsim G start the loader widget HE 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 See the book Mastering Perl Tk by Lidie S and Walsh N O Reilly CHAPTER 7 THE PERL TK FRONT END RWD Nickalls 93 geometry width x height Mx shift y shift The sign option determines the location of the origin of the screen coordinates The sign is associated with the position 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 dir
153. 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 tentrydude 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 10 THE CAMOMILE PROGRAM RWD Nickalls 112 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 188
154. IABETES DECISION SUPPORT SYSTEM RWD Nickalls 154 geometry geometry 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 sets the client geometry of the main widget Don t run in the background 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 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 ldd hh mm or date yyyy mm dd Obsolete use triggerEvent instead Trigger alarm with the specified event ID triggerEvent lt eventID gt Arguments message Message text to display 1
155. INT USING 43 44 A REM print in red if bigmac less than IF c lt 0 86 THEN COLOR red screenbackcolour ELSE COLOR green screenbackcolour END IF LOCATE 19 68 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 86 6 2 Agecorrected 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 a I was unable then to use my computer program based in the thoracic theatre at the City Hospital and b 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 End expired 96 in 100 oxygen 0 10 20 30 40 50 60 70 80 90 100 Age years End expired 96 i ISOFLURANE M mde 5096 N20 18 16 14 12 10 08 0 6 04 0 2 0 Figure 6 4 One of the first age corrected iso MAC charts drawn using mathsPIC CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 57 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 eff
156. Lcr Lcr n print LOG Leof Leof n print LOG Mn ds end of while2 end of whilel close LOG now close the serial port ob gt close croak failed to close undef ob frees memory back to Perl but no error message Chapter 6 Age corrected MAC RWD Nickalls 2008 April 19 2009 oAHOUSE book xenon ch macage01 tex 6 1 Introduction The first implementation of the real time age corrected MAC output on the anaesthesia workstation was towards the end of 1996 soon after reading Mappleson s MAC paper Mapleson 1996 The workstation program at that time was an MS DOS application written in QuickBasic 4 5 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 52 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 53 data included agent name and inspired and expired vapour concentrations
157. PTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 166 408 409 until a new blue DIABETES alert until the existing alert is cancelled text gt j 410 411 412 413 title header click on the window text gt ENN gt Cancelling an alert gt AnClick 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 is set or delete button and close the 414 415 416 417 418 title gt Testing header gt NnClick on the green TEST butons VnVnTI is generates a demo COFFEE break reminder yellow VnW generates a RED coffee break alert beep to simulate the red DIABETES alert text gt rb 419 420 421 title gt Author header gt nRWD EST c nThis rnTEST d n This Nickalls nXenon project team nDepartinent of Anaesthesia Hospital nN dicknickalls text gt nCity ottingham nUK n nemail compuserve com CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 167 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 ar title gt Version date header gt NnVersion 1 1 April 24 20
158. Perl script processdata pl into the appropriate operation directory e g 2005 Sep 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 are as folows the relevant program script is shown in a box Create a sub directory called PDATA processdata pl Move key files into the PDATA sub directory processdata pl e Determine the start time of data collection fields2PDATA pl Convert the Unix time in binlog files local time in data files binlog2data pl Split up the data files into 1 hr gnn files binlog2gnn pl 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 pati
159. TES DECISION SUPPORT SYSTEM RWD Nickalls 170 67 68 69 70 71 72 73 74 75 76 TI 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 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 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 THE if two spaces in posn 8 and 9 then remove one space if substr time string 7 2 eg Tsubstr time string 7 2 replace spaces with commas time string tr make an array my stgmt split time string day stgmt 0 not used here my month stgmt 1 my date stgmt 2 my st stgmt 3 my year stgmt 4 Snoitems stemt 1 not used here now split the time hh mm ss gt hh mm only my sthhmmss split st my hh sthhmmss 0 my mme sthhmmss 1 ss sthhmmss 2 not used here print the gmt part is day month date st yearNn print logg the gmt part is day month date st yearNn Ke ME ip ord but Kalarm requires that both month and date are in numerals if month eq Jan mo
160. TION print An An print Press P to PRINT results q to quit p lt STDIN gt chomp p imortant here to remove the lt CRLF gt if VEU eq p check program exists if e printall pl CHAPTER 8 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 103 130 print sending data to the printer now Xn 5 131 system perl printall pl 132 print done n n 133 else 134 print ERROR can t find program lt printall pl gt n 135 i 136 else 137 print returning to original dir now n n 138 139 jump 140 141 142 now return to the orig dir 143 print returning to datexsim in 144 returndir home dick allfiles camomiletop datexsim 145 chdir returndir 146 print NL s eoe EE IG IG ES 147 print FINISHED n 148 print Vn nn Gee a E E E nn 149 150 151 SUB 152 note that the lt sub gt keyword must be lowercase 153 154 sub tedname 155 returns a date time encoded filename projdir 156 using the GMT start time string passed as a parameter 157 my startgmtstring 0 158 my n _ 1 159 print SUB starttimestring startgmtstring Wn 160 print SUB number of args passed n n 161 note the main items are lt space gt separated except hh mm ss 162 format is Sun Jan 25 13 24 35 2004 163 format is Sun Jan 5 13 24 35 2004 1
161. TION 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 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 in
162. UPPORT SYSTEM RWD Nickalls 180 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 4l 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 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 AO my options_okay GetOptions in s gt M message in option expects a string usage perl rn tkviewer pl in filename if message eq croak ERROR message not specified thisprog THE write the word ERROR underlined my error ERROR MESSAGE n n n n my boxmessage error message THE topwindow MainWindow 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 place anchor gt n pack gt pack side gt top expand gt 1 MainLoop Ht end CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 181 13 8 Screenshofs Session Edit View Bookmarks Settings Help DIABETES event found mj idi 48 Ajuid2 73 UI Alarm 800162303 363 ENON A EEr E
163. 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 graphics 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 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 2007 MathsPIC 1 1 http www tex ac uk tex archive grap
164. YPESETTING PROGRAMS RWD Nickalls 205 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 finspl N ldots vspace 2mm VAP _ exp mbox vspace 2mm MAC _ age Diamond end minipage vfill noindent rule 8cm 0 5pt footnotesize noindent copyright RWD Nickalls S Dales amp A Nice 1994 2004 sc an ae sthesia record systen newline sc email textit dicknickalls compuserve com end document CHAPTER 16 TYPESETTING PROGRAMS RWD Nickalls 206 16 2 prtdrug2 sty Ahhhhhhhhhhhhhhhhhhhhh prtdrug2 sty rwd nickalls April 15 2004 LaTeX version modifiction of Simon s Camomile record sty he natnn IDEE Ntypeout TERRE KERE KERKE REK REK RE RE 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
165. abel vspace 3 5cm noindent hspace 2 3cm color blue LARGE AN AE STHESIA RECORD vspace 3mm noindent hspace 5 2cm textsf Nottingham City Hospital 4 4 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 NN A sc Surgeons amp hline end tabular ht pagestyle fancy CHAPTER 16 TYPESETTING PROGRAMS RWD Nickalls 209 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 2 16 4 printall tex 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 else if e anes 09 dvi system dvips anes 09
166. ac 1 17 REM k 0 8 mac 1 17 REM j 0 6 mac 1 17 OPEN isoqdata dat FOR OUIPUT AS 1 n 1 6 Hn code q 1 17 REM isoflurane 3 D o HS e I REM PRINT 1 code mac40 iso n FOR j 5 TO 95 STEP 5 REM j age deltaage j 40 BB 00269 mac n mac40 10 BB deltaage PRINT j mac PRINT 1 point code j j mac Y s s code STR j SPACES 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 isoqdata 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 ee rFPeoOmAANI DUN PWN WN isoqdata dat 96 0 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 point 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 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 59 15 point q 65 65 1 603451 16 point q 70 7
167. aesthetic 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 9 2 4 Epidural database This is accessed from the fornt end by clicking on the relevant button 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 9 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 9 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 CHAPTER 9 SYSTEM OVERVIEW RWD Nickalls 108 home home home home home home en home home docs home docs en home home home home usr loca usr loca camomiletop tarballs camomiletop tarballs camomile 0 1 040411 camomiletop tarballs camomile 0 1 040411 admin camomiletop tarballs camomile 0 1 040411 camomile
168. all required printfiles from datexsim printfiles to PDATA n fromdir datexsim printfiles filei fields2PDATA pl CHAPTER 19 PROCESSDATA PL RWD Nickalls 248 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 file 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 file5 prtdrug2 sty copy fromdir file5 PDATA if eq print logfile file5 file copied OK n else print logfile file5 COPY ERROR n file6 base2texd pl converts base log basel
169. and 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 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 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 153 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 license 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 tell
170. apter 9 System overview April 19 2009 allfiles camomile cam book ch overview tex 9 1 Introduction The Camomile data program was written by Simon Dales in conjunction with Dick Nickalls during the period March 2003 to April 2004 and started to be used in the oper ating theatre during 2004 The program was a sophisticated Linux re implementation of an earlier MS DOS prototype developed by Dick Nickalls during the period 1995 2002 The final version of the code camomile v 0 1 040413b c Apr 15 2004 worked well was used uneventfully for approximately 6 months or so April September 2006 in the operating theatre at the City Hospital In fact this code was used during the Carcinoid case of September 28 2006 described later Structure 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 desc
171. ar h14 h12 d text fbox 1 cdot 4 x h14 var hl6 h14 d text fbox 1 cdot 6 x h16 new rotated legends from macATdes2 pl var y2 2 6 var yl 0 4 newcommand ylegend sf End tidal in 100 oxygen air determine string length Yunits etc newlength ylength settowidth ylength ylegend Pbtext answer ylength number ylength 37 0 4 halflength 3 818 0 777 y units text turnbox 90 ylegend 3 725 y1 y2 y1 2 0 777 beginSKIP newcommand rightylegend sf End tidal in N _2 O 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 yl y2 y1 2 0 7188 endSKIP CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 76 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 9 beginSKIP newcommand myleft framebox Vbeginfminipage 29mm centering V End expired V in 10096 V oxygen Vend minipage o 1 J text myleft 45 2 0 endSKIP newcommand myrightb fbox NV begin minipage 3 5cm
172. arm n print logg sending Kalarm string out in system qq out and croak could not run out OS ERROR Perl best practice p 280 Ne message THHHE SUBS ymdhm time string sub ymdhm format yyyy mm dd hh hh passing only one time string into array my time string print processing parameter time string Mn 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 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 177 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 T8 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 THE if two spaces in posn 8 and 9 then remove one space if substr time string 7 2 eg Tsubstr time string 7 2 3 replace spaces with commas time string tr make an array my stgmt split time string day stgmt 0 not used my month stgmt 1 my date stgmt 2 my st stgmt 3 my year stgmt
173. ash elsif n 4 no strings with 3 as yet print first w1 Wn print seconds w2 Wn print third w3 n print 4th w4 Nn CHAPTER 12 DRUG DICTIONARY RWD Nickalls 133 222 223 224 225 226 221 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 else croak ERROR string NOT processed as n n Nn else carp ERROR string NOT processed as n png ns print ERROR string NOT processed as n n Nn Y 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 n invalidflag z OFF print invalid FLAG OFF n print dataline dataline Nn sleep 1 print A 8 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 hereWn must have a problem here as should not get here next LINE ji es finally dump the
174. ata files CHAPTER 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 223 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 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 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 ti1 t2 t3 9t4 t5 9t6 t7 9t8 t9
175. ay 1000 then adjust from there end itemize newpage beginCamomileConfig comment newpage SS Configure Application SetCamomileIncludePath home dick allfiles camomiletop conf2 newdict set path config home dick allfiles camomiletop conf2 set class main newinstance popdict hhhhh include x config conf include x configrn conf 4 Nickalls Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh windows Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh include x widgets conf Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh Ports Ahhhhhhhhhhhhhhhhhhhhhhhhhhhhhh CHAPTER 11 CONFIGURATION FILES RWD Nickalls 117 hhhhhhhhhhhhhhhhhhhhhhhlh lol lh A monitors hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh 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 11 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
176. b 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 skip comments CHAPTER 18 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 237 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
177. be mounted inside the operating theatre near the entrance In practice a carbon dioxide fire extinguisher will ox be the usual choice Halon fire extinguishers are significantly better for operating niet rn theatre fires but their use is declining owing to environmental concerns ECRI 1996a 1000 1996b 3 Have a bowl of saline and wet drapes available on the surgical instrument trolley at all sol times Baur 1999 4 Have a self filling ventilation bag eg Ambu bag available for ventilating the patient with room air 2 B j 9 E 20 39 Figure 1 12 Screen showing showing a help file viewed using the KDE web browser CHAPTER 1 ANA NAESTHESIA WORKSTATION RWD Nickalls 13 ANAESTHETIC SHEET City Hospital Nottingham UK Dar January Orcnarios Patient label Svnorows is Xdvi file prtanes4 ER SAT 100 3 CO exp 46 CO insp 00 RR 12 TV ep 72 MVol 85 HR ecg 110 HR sat 113 BP NIBP Tempi Temp si 42m voi somees TEN 0 38 gt on 1130 mm 1 00 SEV i liat ooi T 181 117 TotalMAC 118 age 65 1130 HAS 15 00 ORE EE EE ee See 1000 Ve aL ae asesinos ere rcenserceracs A N oo ERAS Mao nas 1500 14 3 5 T s E GHI d la C
178. ble word lt 33F2CFCBh gt which is 871550923 seconds 10087 days 27 July 1997 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 manual for full details CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 32 START OF HEADER 2 3 SE lt 01 gt Total no of bytes in transmission lt O1h 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 S33 f2 cf cb 871550923 secs 10087 days 27yrs 7 months 22 days 27 July 1997 12 15 00 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 fields filled with BD 27 29 BD BD BD Note bdh 189d 30 32 BD BD BD 33 35 BD
179. c and return control to launch widget print An Mis once end of camomile program An flush the buffers after Camomile just to be sure system sync return to lt launchcam gt print returning to launchcam pl WM Wn now create and write the lt starttime dat gt file since the base dir project dir for output is created 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 write the starttime file to the projdir pdata dir first need to create the new pdata dir projpdatadir projdir pdata mkdir projpdatadir ARE PP ER EE now write the starttime dat file into the pdata directory print writing the lt starttime dat gt file to pdata dir Diss I destinationfilenamel projpdatadir starttime dat print lt starttime gt destinationfilenamel destinationfilenamel n open outfilel destinationfilenamel die ERROR can t create file lt starttime dat gt n CHAPTER 8 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 102 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110
180. 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 15 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 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 197 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
181. ce 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 In practice it is assembled by the SUB requeststring page which is part of the Datex module Chapter page This string is sent only once by the Main module soon after system initialisation as shown in the following code extract from the Main Module Chapter page which sends the string and then waits a maximum of 5 seconds for the first incomming data string before timing out REM now trigger data output every 10 sec from Datex AS 3 monitor 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 PRINT BEEP PRINT No data quiting program SLEEP 1 END END IF REM if data in buffer then continue IF LOC datexAS3comportfilenumberf gt O then PRINT data output OK SLEEP 1 EXIT DO END IF SLEEP 1 REM print dots while waiting PRINT LOOP CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 29 4 3 1 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 The string starts and ends wit
182. cg 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 Aheof 11 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 11 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 11 CONFIGURATION FILES eof 11 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 di
183. 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 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 ields2PDATA 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 06 MODULERWD Nickalls 231 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
184. cp v prtanes6 pdf pdffilename 15 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 IATEX 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 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 CHAPTER 15 PRINTING MODULE OVERVIEW RWD Nickalls 201 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 15 12 Printing the paper sheets Finally we
185. 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 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 06 MODULERWD Nickalls 245 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
186. cribed 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 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 06 MODULERWD Nickalls 236 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 f
187. 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 27638005 gt lt 40 gt lt Alverine gt lt 349818006 gt lt 41 gt lt Amantadine gt lt 51361008 gt CHAPTER 12 DRUG DICTIONARY RWD Nickalls 139
188. decimal rotating begin document oddsidemargin 17mm o framebox beginpicture use sf font for figures for BJA fontfamily cmss selectfont normalsize Minethickness 1 1pt normalsize was 0 9 for BJA my manual p 23 structure copied from mac des m Yok ISOflurane Delta for N20 0 75 66 6666 104 1 17 y units 12cm 2 2 5 454545 paper units mm5 454545cm xrange 5 100 yrange 0 4 2 6 axes L ticks 10 0 2 paper units 0 7mm3 818181cm xrange 8 100 yrange 0 4 2 6 setcoordinatesystem units lt 0 7mm3 818181cm gt setplotarea x from 8 00000 to 100 00000 y from 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 O cdot 6 Of Ncdot 18 1 cdot 0 1 cdot 2 1 cdot 4 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 79 1 cdot 6 53 1 cdot 8 2 cdot 0 2 cdot 2 2 cdot 4 54 at 0 60 0 80 1 00 1 20 1 40 55 1 60 1 80 2 00 2 20 2 40 Jf 56 57 axis bottom 58 ticks withvalues 0 10 20 30 40 50 60 70 80 90 100 59 at 0 10 20 30 40 50 60 70 80 90 100 60 61 axis right 62 W using N20 67 shift 0 7523 63 ticks withvalues 0 Of cdot 2 0 cdot 4 0 cdots 16 64 O cdot 8 1 cdot 0 1 cdot 2 1 cdot 4 65 1 cdot 6 66 at 0 7523 0 9523 1 1523 1 3523 1 5523 1 7523 1 9523 2 1523 67 2 3528 68 9
189. dilute to 50 100 mls in 5 dextrose or dextrose saline via peripheral vein Isoflurane o Potassium PREPARATIONS o Sevoflurane IV Calcium Gluconate 10 10 mls 2 25 mMol 4 5 mEq 93 mg Ca REFERENCES 111 Charmau 11900 The Dharm rcalanic annenach ta the critical iil matinnt and ad 19 ONE Q jag Eile Edit View Bookmark sometimes w Figure 1 15 Help desk showing the drug info for Calcium x File Edit View either a b in ep 13 a amp 5i Q Werb Z This error M le Lin Figure 1 16 Screen showing preview of the Anaesthetic Record about to be printed documentclass a4pal lusepackagefcamonil beginffigu beginfdocument centering on the next amin tex testing inputtin lstruti ui S Session Edit View Bookmarks Setti prtanes4 tex Latex2e lt 2001 06 01 gt Babel lt v3 7h gt and hyphenati asque italian portuges rd usr share texmf tex latex Document Class article 2001 uer share texmf tex latex 7usr share texmf tex latex uer share texmf tex latex Dyerfull Wbox 5 69054pt ti plot bp pic plot sat l plot tv pic plot vap 1 prtanes4 aux see the transcript file fo Output written on prtanes4 d Transcript written on prtang prtanesd dvi gt anes 01 d 1 3 zu
190. dural 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 186 Chapter 15 Printing module overview April 19 2009 allfiles camomile cam book ch printover tex 15 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 co
191. 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 dvi 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 210 Chapter 17 Printing the stand alone SA module April 19 2009 allfiles book xenon ch printmod sa tex 17 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 fo
192. e Figure 13 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 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 182 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 DIABETES 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 13 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 snapshot5
193. 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 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 April 19 2009 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
194. e 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 sugar HOWTO use DIABETES 40 mins VIEW logfile DIABETES 50 mins VIEW calfile DIABETES 60 mins HELP on diabetes Figure 13 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 rat
195. e 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 SUB 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 20 FIELDS2PDATA PL RWD Nickalls 263 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
196. e 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 time 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 194 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 arra
197. e 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 the delay period after which the alarm will repeat 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 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 150 The AC
198. e sound of the beep Note the empty lines following the END commands BEGIN VCALENDAR PRODID K Desktop Environment NONSCML 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 13 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 kalarm b c red f home dick file html 13 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 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 156 kalarm tray 13 2 6 Ca
199. e the PostScript files using dvips We create the pdf files using pdf latex print printlog running LATEX on prtanes6 tex n system pslatex prtanes6 tex dvifilename anes gnn dvi CHAPTER 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 226 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 17 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
200. eatre and screenshots Figure 1 3 Program running in Theatre 1 O Camomile 0 1 031105 Operation 20889 11 RO 11 49 24 GMT Thursday Elle Project Entry Timer View Help MBA 0 SF OBR Ts sicketocathostiocaldomain Z camomile 0 1 031105 0pe BB Tg 14 21 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 CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 9 Location View Go Bookmarks Tools Settings Window Help jaoeo joo rss a ara E gt Location E momeldckarouSEtalniLUG 2008 carin Renee Sep ooi RD htni Xenon5 anaesthesia record system RWD Nickalls dicknickalls doctors org uk Department of Anaesthesia Nottingham University Hospitals City Hospital Campus Nottingham UK This page created Thu Jul 10 18 33 25 2008 Dh EED Home Folder O E P theatredata carcinoidB Sept2006 Graphic record Drug record Log files Programs Gnuplot files
201. ect of nitrous oxide The design of such a chart was not straightforward and it was quite a long time before I formulated a suitable design which allowed nitrous oxide use see Figure 6 4 The solution lay in the generally held view that MAC multiples were additive and hence the nitrous oxide scale could simply be shifted by an agent specific amount 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 Encouraged by colleagues who tested these charts one for each of the three main inhalational agents a paper was submitted to the British Journal of Anaesthesia in November 2001 A revised version was submitted in February 2003 and was published later that year Nickalls and Mapleson 2003 The article was also the subject of an editorial White 2003 Since then the these age corrected iso MAC charts have been included in the 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 wit
202. ectory usr local bin which is always in the Linux PATH i e usr local bin runcamomile Now whichever directory the user types the command runcamomile in then Linux will move to the datexsim directory and run the tklaunch2 p1 program 7 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 e launchcam12 pl first remove the Tk screen topwindow gt destroy if 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 Vn print can t find program launchcam12 pl MW exit CHAPTER 7 THE PERL TK FRONT END RWD Nickalls 94 7 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
203. ed in V 67 hspace 8mm 50 V N 2 0 hspace 7 5mm N 2 O N Vend minipage 9o V 6 end of newcommand text Vmyrightb 102 2 657 1 was 2 6 newcommand mybottom Age years text mybottom 46 0 15 Wrotext copyright RAD 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 1100 996 Right X value variable y16 2 3523 variable y14 2 1523 variable y12 1 9523 variable y10 1 7523 variable y08 1 5523 variable y06 1 3523 variable y04 1 1523 variable y02 1 0 9523 variable y00 0 7523 0 7523 0 2 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 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 63 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 The following example is the TEX code output by the above mathsPIC program VO 00 10 Ut RD NNNNNND BBB Be Be ee ee NOP WNrF COU ANAND UN PWN KH CO point R10 x6 y10 point L08 x5 y08 point R08 1x6 y08 point L06 x5 y06 point R06 1x6 y06 point L04 x5 y04 point R04 x6 y04 point L02
204. ed 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 145 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 146 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 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 emb
205. edding iCalendar data in web pages using hCalendar a 1 1 representation of iCalendar in semantic XHTML 13 12 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 audioprop BEGIN VALARM CRLF audioprop dispprop emailprop procprop END VALARM CRLF 2 action and trigger are both REQUIRED but MUST NOT occur more than once action 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 but MUST NOT occur more than once CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 147 attach the following is optional 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
206. eed to investigate any errors fields2PDATA p1 CHAPTER 18 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 232 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 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
207. enerate 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 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 213 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
208. ent notes The full code of the eight or so Perl programs is listed in the subsequent chapters CHAPTER 18 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 230 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
209. erest 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 Adams AP 1996 A revised anaesthetic record set Royal College of Anaes thetists Newsletter 27 1996 8 9 CHAPTER 2 DATA PROCESSING IN ANAESTHESIA RWD Nickalls 19 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 dur
210. es 1 2 3 and 4 for field sr type are reserved for output values as you suggested So DRI PH DISPL 1 DRI PH 10S TREND 2 DRI PH 608 TREND 3 and DRI PH AUX INFO 4 The values correspond to subrecord type listed on CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 44 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 values 1 and 0 have special side effects as documented in the table on page 11 of the Specification Chapter 5 Interfacing the serial port in Linux ch serialport 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
211. est 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 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 215 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 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
212. esthetic record drug record EE ETE EE 00000000K NOTTINGHAM EPIDURAL AND DOUBLE LUMEN TUBE DATABASE TE N enter GENDER M F q to quit f enter HEIGHT cms q to quit 155 enter WEIGHT kg q to quit 56 6 enter RANGE default 7 5 q to quit Female Ht 155 cm Wt 56 6 kg pm 7 5 pm 7 5 RESULTS midline data male female combined BS 3 T4 5 mean midline BS 1 T6 7 mean midline BS 0 T7 8 mean midline BS 1 T8 9 mean midline BS 42 T9 10 mean midline BS 3 T10 11 mean midline BS 4 T11 12 mean midline 153 range 4 6 117 range 3 75 01 range 3 5 4 8 5 n 1 RESULTS Double lumen tube data 27 53 range 25 30 n 15 26 65 range 23 5 28 5 n 13 26 5 range 24 5 28 n 15 length length mean length 26 5 nei mean length 25 78 range 24 28 n 7 database numbers total no of entries in database n 509 midline epidural entries in database male female combined n 274 tube Female entries in database n 151 Press P to PRINT results q to quit p 75 range 3 75 6 0 n 18 5 0 n 10 nes X Launch CAMOMILE 3 file home dick allfile E E A N aij d dick localhost shor file home dick allfile 4 TEER ERGE Feed lick on the RUN button to start the RUIT CAMOMILE anaesthesia program c The CAMOMILE project team 2004 o A aG a an SE
213. etist to repeat blood sugars etc This alert system uses the excellent Linux KDE Kalarm util ity see below The Kalarm version cur rently being used with the Xenon worksta tion v 0 8 3 Kalarm is a sophisticated system and the latest version 1 4 0 is capable of send ing emails displaying text files triggering an audible voice message as well as dis playing a coloured alert banner following a specified alarm interval or at a specified date time The Kalarm system allows in put either via a form or via the command line The form input method mouse amp keyboard is however rather too compli cated and time consuming for use in the theatre environment input errors would be likely making the system sufficiently unreliable for anaesthesia use It was there fore decided to write a Perl Tk program to generate a widget and info system which would allow a diabetes alert to be set eas ily and reliably simply by clicking on an appropriate widget button ke HOWTO use VIEW logfile VIEW calfile Click 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 ml 13 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 nest
214. event found checking for word DIABETES Wn if event m DIABETES i increment event counter eventnumber eventnumber 1 HH DIABETES _event DIABETES_event event get UID print DIABETES event found n print event event Nn process the event string to get UID and TEXT TH get the index positions for UID and SEQUENCE uid1 index event UID KAlarm uid2 index event SEQUENCE print uidl uid1 n print uid2 uid2 n uid substr event uid1 5 uid2 uid1 5 print UID uid Wn get the index positions for TEXT and ACTION textl index event TEXT text2 index event ACTION print textl text1 Wn print text2 text2 Nn text substr event text1 5 text2 text1 5 print TEXT text An HH cancel the event aline CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 174 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 my cancel kalarm cancelEvent Suid print cancelling existing DIABETES alarm Wn print sending command cancel n print logg cancelling existing DIABETES alarm n print logg sending command cancel n if more
215. event string and start again 1 gend of looking for the endcode if when fall off end of string while still looking for the endcode then get another line string print looking for new line string can t find endcode n u CHAPTER 12 DRUG DICTIONARY RWD Nickalls 134 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 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 303 304 305 306 307 308 next LINE print dataline Nn end of the input loop reading the INfile Ht print no more events found termating now n print Ww print event string event Nn THE now add missing drugs if they do not already exist on the VIM 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 T add drugs from the LOCAL file print logg adding drugs from the LOCAL list in print logg Wn my addname my addnamecode open the input file open my datafile c dn drugs2add dat die ERROR can t open drugs2add dat fileWn newlinez datalinez LINE2 while lt datafile gt next LINE2 if t
216. ewer takes filename as argument TH 8 now make the widget T 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 see p 233 PerlTK book see TEXT widget p 162 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 inss gt input_filename in option expects a string usage perl dn tkviewer pl in filename if input_filename eq croak ERROR filename not specified thisprog TH define an error message for use later my errormessage ERROR can t find filename S input filename thisprog note that this errror messahe must be outside the if statement CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 179 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 wn VO 00 10 tA RR 11 12 13 14 15 16 17 18
217. 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 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 pl 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 pl script to perform this particular task binlog2gnn p1l CHAPTER 18 PRINTING THE ST
218. ey 201 activebackground gt Grey 202 foreground gt Blue 203 activeforeground gt Red 204 command gt amp viewcal 205 pack side bottom expand gt CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 161 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 221 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 1 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 relief flat background gt LightGrey activebackground gt Grey foreground gt Blue activeforeground gt Red command gt amp help place relx gt 0 rely gt 0 9 my diabetes_error_message ERROR running dn alarm diabetes2 thisprog MainLoop THE SUBS gc sub quit clear the command line terminal window and then exit system clear exit sub diabetes20 topwindow gt bell result dialog1 gt Show THE if result eg OK Y 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 geo
219. f 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 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
220. gfile END Chapter 20 fields2PDATA pl April 19 2009 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 pl 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 prtanes6 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 zs 250 CHAPTER 20 FIELDS2PDATA PL RWD Nickalls 251 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 i
221. h a 7Eh byte have numbered the bytes decimal starting with 1 1 52 The byte values are given in Hexadecimal h and Decimal d The bytes are divided up into their functional groups 1 2 4 bytes etc Thefollowing string is the one currently used and assembled by the SUB requeststring page which is part of the Datex module Chapter page see above 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 OOOOH byte res2 2 7 00 0 8 00 0 Transmission time 0x00000000 ignored by monitor 9 00 0 when sending transmission request dword r_time 10 00 0 However time can be meaningful in outputted 11 00 0 messages which use the header of the same structure dword r_time 12 00 0 Reserved 00000000H dword res3 13 00 0 14 00 0 15 00 0 16 00 0 Main type of record DRI_MT_PHDB 0 17 00 0 r_maintype 18 00 0 Offset to the first subrecord 0000H 19 00 0 sr desc 0 offset 20 00 0 Type of first subrecord DRI PH XMIT REG 0 sr desc 0 sr type CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 30 Offset to the second subrecord OOOOH calculated from the beginning of the data area after the header part Value is not meaningful since there is only one
222. h 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 1 REM new iso mac bas 2 COLOR 15 1 3 CLS 4 REM IF ageofpatient lt 1 THEN ageofpatient o 1 5 REM 6 REM this MAC sub is called from the end of PLOIVAPOUR sub 7 REM vapour is on BOO and C04 13 3 data strings 8 REM vapourcode ISO HAL etc when not selected 9 REM IF v THEN mac40 0 10 IREM IF v HAL THEN mac40 75 11 REM IF v ISO THEN mac40 1 17 12 REM IF v ENF THEN mac40 1 63 13 REM IF v SEV THEN mac40 1 8 14 REM IF v DES THEN mac40 6 6 15 IREM mac40 for N2O 104 16 REM 17 REM etn2o 100 eto2 etco2 etvap 18 REM 19 IREM do N2O calculation first 20 REM restrict n20o to zero or above 21 REM IF n2o lt 0 THEN n2o 0 22 REM eqn macz mac40 10 0 00269 deltaage CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 58 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 REM REM q 1 6 mac 1 17 REM p 1 4 mac 1 17 REM n 1 2 mac 1 17 REM m 1 m
223. he 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 06 MODULERWD Nickalls 242 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
224. hen 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 addname is ALREADY on the VIM listYn print dmd addname Nn print logg drugname is ALREADY on the VIM list n print addname is ALREADY on the VIM list An 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 addname has been put on the list just now n print addname has been put on the list just now n H reset the addnamecode to the default n addnamecode print logg W CHAPTER 12 DRUG DICTIONARY RWD Nickalls 136 347 348 349 close datafile 350 351 352 353 Ht 354 now print out the arrays and hashes as a check 355 BBook p 74 works OK 356 my key the drug name 357 my value the Snomed code 358 359 while key value each dmd 360 print key gt value n 361 sleep 1 362 363 364 365 now print the Unsorted name array 366 my element 367 368 foreach element udrugname 369 print element n 370
225. hics mathspic perl A new bug fix version February 2007 White D 2003 Uses of MAC Br J Anaesth 91 167 169 editorial Part II The front end coordinating program 90 Chapter 7 The Perl Tk front end April 19 2009 aHOUSE book xenon ch tklauncher 7 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 gt click on RUN button perl launchcam12 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 gt 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 prog
226. hinline setplotsymbol tiny thickline inputfile isoqdata dat 1 6 thinline 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 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 10 88 990 9 text fbox 0 cdot 6 x h6 variable h8 h6 advance d text fbox 0 cdot 8 x h8 variable h10 1h8 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 centering V End expired V in 100 V oxygen CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 62 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 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 end minipage text myleft 45 2 0 newcommand myrightb fbox begin minipage 4cm V End expir
227. ickalls 70 329 X point j35 35 7240809 35 7240809 330 X point j40 140 702 40 702 331 X point j45 45 6805924 45 6805924 332 X point j50 50 6598377 50 6598377 333 X point j55 55 6397159 55 6397159 334 X point j60 60 6202077 60 6202077 335 X point j65 65 6012943 65 6012943 336 X point j70 70 5829578 70 5829578 337 X point j75 75 5651804 75 5651804 338 X point j80 80 5479452 80 5479452 339 X point j85 85 5312355 85 5312355 340 X point j90 90 5150355 90 5150355 341 X point j95 195 4993294 95 4993294 EER EER EER EE EE ER ER ER ER TS SS a 342 drawline j5j10j15j20j25j30j35j40j45j50j55j60j65j70j75j80j85j90j95 343 V plot 5 871941 10 8453511 j5j10 344 V plot 10 8453511 15 819572 j10j15 345 V plot 15 819572 20 794579 j15j20 346 V plot 20 794579 25 7703483 j20j25 347 plot 25 7703483 30 7468564 j25j30 348 V plot 30 7468564 35 7240809 j30j35 349 V plot 35 7240809 40 702 j35j40 350 plot 40 702 45 6805924 j40j45 351 V plot 45 6805924 50 6598377 j45j50 352 V plot 50 6598377 55 6397159 j50j55 353 V plot 55 6397159 60 6202077 j55j60 354 V plot 60 6202077 65 6012943 j60j65 355 plot 65 6012943 70 5829578 j65j70 356 V plot 70 5829578 75 5651804 j70j75 357 plot
228. ile 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 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 t binlog2gnn pl su
229. ilename 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 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 p
230. ine by lineWn reset these variables to zero BEFORE starting the WHILE loop my uid1 0 my uid2 0 my uid my textl 0 my text2 0 my text my datalinez my event LINE while lt calfile gt next LINE if t skip comments next LINE if skip comments next LINE if skip blank lines grab the whole line as a string dataline _ chomp dataline f removes the line ending reset variables to zero uid1 0 uid2 0 uid textl 0 text2 0 text value split 1 dataline print dataline CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 173 82 83 84 85 86 87 88 89 90 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 replace CR LF space with visible chars newbuffer dataline s r lt CR gt dataline s n lt LF gt dataline s lt SPACE gt print dataline Nn if dataline m BEGIN VEVENT eventFLAG ON print FLAG ONWn event event event dat next LINE bh if eventFLAG eq ON events event dataline print event event Nn if dataline m END VEVENT eventFLAG OFF print FLAG OFF n now analyse the event string to find UID and TEXT print NEW
231. ing 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 anaesthetic 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
232. ion file shome dick allfiles atest helpdesk helpdesk htm Drug index e back to main index INDICATIONS above IV Calcium chloride 10 10 mls Oral tablets Calcium gluconate lactate carbonate PRECAUTIONS 1 Calcium chloride has THREE TIMES the amount of elemental Ca as same strength calcium gluconate see 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 Calcium 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 8 mMol 13 6 mEq 272 mg Ca Correction of hypocalcaemia antagonism of hyperkalaemia post op maintenance following total thyroidectomy as in laryngo pharyngo oesophagectomy cardiac resuscitation Amiodarone Aprotinin DOSE Atropine Acute 2 25mMol SLOWLY over 10 mins approximately Maintenance 9mMol day approximately in divided doses 40 mls IV 10 Ca gluconate 24hrs H ne Typical adult IV bolus dose 10 mls Ca Gluconate 10 SLOWLY over 10mins via CVP line if possible as is irritant to Erythromycin veins else
233. ive 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 pl script to perform this particular task binlog2gnn p1l CHAPTER 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 218 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 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 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 1071
234. ive 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 hour 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
235. ks 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 12 2 cdot 4 at 0 60 0 80 1 00 1 20 1 40 X 1 60 1 80 2 00 2 20 2 40 rs 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 Vaxis right AL using N2O 67 shift 0 7523 X ticks withvalues 0 O0f Vcdot 12 O0 cdot 4 OT Vcdot 16 N O Ncdot 8 1 cdot 0 1 cdot 2 1 cdot 4 X 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 7mm3 818181cm xrange 8 121 yrange 0 5614 2 3614 axis right seconds right axis for 50 oxygen shift 0 5614 N ticks withvalues 0 O0 cdot 12 0 cdot 4 0 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 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 61 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 TI 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 N 1 5614 1 7614 1 9614 2 1614 2 3614 erhbeginSKIP newcommand thickline setplotsymbol Large newcommand t
236. log die ERROR can t open dnalarm log fileWn 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 An print logg log of my Perl dnalarm3 pl program Wn copy the Kalarm calendar file to this dir with new name if Ce kalarm_calendar_path print logg copying the calendar ics file gt dn calendar ics Wn grab the current directtory pathname my thisdir cwd CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 172 36 37 38 39 40 4l 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 TI 78 79 80 81 my copy string cp kalarm_calendar_path S thisdir dn calendar ics system copy string and croak could not run copy string OS ERROR Perl best practice p 280 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 c dn calendar ics die ERROR can t open file dn calendar ics Wn now read each line in the file and place parameters into an array print reading the CAL file line by line n print logg reading the CAL file l
237. long 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 PROCESSING IN ANAESTHESIA RWD Nickalls 18 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
238. 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 12 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 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 Honey Squill gt lt 10046311000001100 gt lt 0017 gt lt Acetic acid Turpentine 011 gt lt 10044711000001105 gt lt 0018 gt lt Acetone gt lt 333511003 gt
239. m75 m80 m85 m90 m95 40892 15 00000 36595 20 00000 32430 25 00000 28391 30 00000 24476 35 00000 20680 40 00000 17000 45 00000 13432 50 00000 09973 55 00000 06619 60 00000 03368 65 00000 00216 70 00000 PR HA HA HA HA HA HA HA HA HA hat COOCO OR RP RP RP RP RP RP RP RP RP RR end of file lt isomdata8 dat gt loop 1 thickline Soy o 99 o inputfile isokdata8 dat 0 8 start of file isokdata8 dat loop 1 W Iteration number 1 99 o Soy o Soy o 99 o 99 o Soy o Soy o Soy o Soy o 99 o 99 o 99 o Soy o k mac40 iso 8 1 28391 1 1 24476 20680 1 13432 1 09973 1 06619 1 03368 1 00216 0 97160 0 0 0 0 0 0 94197 91324 88539 85839 83222 m55 m60 40892 m5m10 36595 m10m15 32430 m15m20 28391 m20m25 24476 m25m30 20680 m30m35 17000 m35m40 13432 m40m45 09973 m45m50 06619 m50m55 03368 m55m60 00216 m60m65 97160 m65m70 94197 98 m70m75 91324 m75m80 88539 m80m85 85839 m85m90 83222 r m90m95 point k5 5 1 162588 manual k5 5 00000 1 16259 point k10 10 1 127135 k10 10 00000 1 12713 point k15 15 1 092763 k15 15 00000 1 09276 point k20 20 1 059439 k20 20 00000 1 05944 point k25 25 1 027131 k25 25 00000 1 02713 point k30 30 0 9958085 k30 30 00000 0 99581 point k35 35 0
240. mation and Computing Technology City Hospital Nottingham UK Ged Dean Clinical Engineer Department of Medical Physics City Hospital Nottingham 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 amp HTML front end module This is written in the Perl language by RWD Nickalls and coordinates data manipula tion graph plotting using GNUplot and typesetting using IATEX 2g 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 by S Dales 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 tabulat 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 The screen display incorp
241. mes for a number of parameter files as these files are created in 1 hour chunks this data is collected in the file timefile txt 15 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 15 6 Accessing the 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
242. metry 320x380 50 300 sub diabetes30 topwindow gt bell result dialog1 gt Show THE 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 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 162 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 320x380 50 300 j sub diabetes40 topwindow gt bell dH result dialog1 Show THE 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 perl dn tkalarm pl geometry 320x380 50 300 j sub diabetes50 topwindow gt bell result dialog1 gt Show THE 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 j sub diabetes60 topwindow gt bell result dialog1 gt Show THE if
243. module 17 1 Introduction 4 Rom Reyes UR X REL 17 2 Running the processdata pl script 17 3 Write the GNUplot scripts foreach graph 17 4 Run GNUplot on all the gnu files les 17 5 Write the header line for the printouts 17 6 Typeset the graphic pages using ATEX 2e 04 17 7 Typeset the drug file using BIEX 2g 2 2 llle 17 8 Printing the paper sheets llle 18 Printing the stand alone SA 06 module 18 1 Introduction 2 2 2 0 2 0 0 0 0 e 18 2 Running the processdata pl script 18 3 Write the GNUplot scripts foreach graph 18 4 Run GNUplot on all the gnu files les 18 5 Write the header line for the printouts 18 6 Typeset the graphic pages using ATEX 2e oaaao ix 183 183 183 183 184 184 186 187 187 188 189 189 191 191 196 199 199 200 200 201 202 202 206 208 209 210 211 2H 212 222 225 225 225 226 226 CONTENTS RWD Nickalls x 18 7 Typeset the drug file using BIEX 2 llle 244 18 8 Printing the paper sheets e 244 19 processdata pl 246 20 fieldsZ2PDATA pl 250 Part I Background Chapter 1 An anaesthesia workstation ch intro 1 1 Introduction Since 1994 RWDN has run an on going research project to develop an open source anaesthsia workstation for free use by the NHS in the operating theatre Wha
244. n 22 2006 alarms for Xenon VO 00 10 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 157 10 Useful books page 301 Perl core languages Little Black Book 1 12 BOOK Mastering Perl Tk by Lidie S and Walsh N O Reilly 2002 13 to get FullScreen mode at startup p 307 14 geometry widthXheight Xoffset Yoffset NO spaces page 409 15 perl tklaunch2 pl geometry 1028x768 0 0 page 409 16 system perl tklaunch2 pl geometry 300x400 50 300 17 4 18 19 use warnings 20 use strict 21 use Carp 22 use Fatal 23 use Tk 24 use Tk Help 25 use Cwd get this path 26 27 1t macros 28 my beep Va BEEP 29 mmy OS ERROR z used in viewcal SUB 30 my kalarm calendar path home dick kde share apps kalarm calendar ics 31 32 33 my topwindow MainWindow new 34 35 topwindow title XENON diabetes support 36 topwindow gt Label text gt Click on a diabetes button to set an alarm 37 wraplength gt 100 38 padx gt 0 5 250 39 height gt 10 40 pack 41 42 Ht camel logo 43 if Ce anim gif 44 my camelimage topwindow Photo file gt anim gif 45 topwindow Button relief gt flat image gt camelimage 46 place relx gt 0 005 rel
245. n bytes 62 75 as shown in the following Table Table 4 5 Decoding invasive blood pressure 1 bytes 62 75 The systolic diastolic and mean blood pressure values x100 are encoded as Hex words Unix The decimal value therefore 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 Hex values 29h 31h ICh 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 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 37 001 7E 126 002 3E 062 003 01 001 004 6F 111 005 05 005 006 00 000 007 00 000 008 46 166 009 34 052 010 F1 241 011 3A 058 012 00 000 013 00 000 014 00 000 015 00 000 016 00 000 017 00 000 018 00 000 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 3A 058 046 13 019 047 30 048 048 00 000 049 00 000 050 00 000
246. ncelling 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 13 3 Alarm widget program dn tkalarm pl XENON diabetes support J G Per 2 c The XENON project team dick on a QUIT diabetes button to set an alarm DIABETES 40 mins VIEW logfile DIABETES 50 mins VIEW calfile DIABETES 60 mins HELP on diabetes Figure 13 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 grey buttons are for displaying help information the two green buttons are for generating test displays usr bin perl dn tkalarm pl modified from tklaunch2 pl last modified April 24 2006 nk WN E my thisprog dn tkalarm pl to define this program name in error messaages RWD Nickalls last change Ja
247. 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 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 5 aie daama 7 C 1 57 Wet time scale 4 EE set time scale 840 SEV 4 set time scale 212 NIBP dia 0 00TVoboy set time scale 105 RespR CO2 10 set time scale 720 10 min RespR ECG eed N Nset time scale 36 1 min vapour NIBP sys 000 ag TV exp 659 set time scaler 5 hiver n N xem OX set width pixel 2 s Help set widget w 891 pushdict Total MAC JT erm m M B P Line 1 Col 0 INS NORM s oma 278 LET EL anomie oo 2 fie nomeracuar t dick localhostic AO 16 27 I BP level BP graph and Now Figure 6 3 Screenshot showing the Linux 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 6 1 1 MAC
248. 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 18 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 233 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 nakegnnfiles 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
249. ng the infile file line by line n 52 53 set the eventFLAG 54 my eventnumber 0 counts the number of durg value pairs in the dictionary 55 my eventFLAG OFF 56 57 initialise variables 58 my uidl 0 59 my uid2 0 60 my uid 61 my begincode VIM 62 my endcode lt VIM gt 63 my len 0 64 my f1 0 65 my ml 0 66 my e1 0 67 my invalid 0 68 my invalidflag OFF 69 70 my datalinez 71 my newlinez 72 my p 73 74 my drugcodes 75 my drugnames 76 71 my delement 78 my REVstring 79 80 define the Unsorted drugname array 81 my udrugname 82 83 define the hash for drugname drugcode pairs 84 my dmd CHAPTER 12 DRUG DICTIONARY RWD Nickalls 130 85 86 87 88 89 90 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 LINE while lt infile gt next LINE if t skip comments next LINE if skip comments next LINE if skip blank lines grab the whole line as a string newline _ append the newline string to any remaining dataline fragment when we start a new line dataline dataline newline chomp dataline removes the line ending reset variables to ze
250. ngs 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 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 191 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 ti
251. nlog2data 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 17 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 are as folows the relevant program script is shown in a box Create a sub directory called PDATA processdata pl Move key files into the PDATA sub directory processdata pl e Determine the start time of data collection fields2PDATA pl Convert the Unix time in binlog files local time in data files binlog2data pl Split up the data files into 1 hr gnn files binlog2gnn pl Convert the gnn files into GNUplot scripts for plotting binlog2gnn pl e Run gnuplot to g
252. nsp 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 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 20 FIELDS2PDATA PL RWD Nickalls 252 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
253. nt is still work in progress and will therefore be updated periodically This project started with an MS DOS prototype written by RWD Nickalls during 1994 2001 the details of which are also on this website http www nickalls org dick xenon rwdnXenon html RWD Nickalls 2009 Contents Preface Contents I Background 1 Ananaesthesia workstation 14 Introduction eke mo Ee ER RR ER EP HORE ES 1 2 Difficulty with funding and R amp D llle 1 3 The Linux project oe 5 da wae RON EUR RR SU RA 14 Modules 5 s amp 2 sc bdo de Bl uen DA Rg Soba eas ed 1 4 1 Printing amp HTML front end module 1 4 2 Data acquisition and display module 1 4 3 MAC display widget leen 1 4 4 Decision support module lll 1 4 5 A diabetes alert module EE EE Se 1 4 6 Adrug menu module SE EE Se 1 5 Theatre and screenshots SS EE ES se 2 Data processing in anaesthesia 2 1 Introduction re SS SS SS SS SS SS SS SS SS Se 2 2 History of the anaesthesia record ss SS Se 221 Background sesos 4 m ee a ee EER Be RE mom OR e 222 Automation les 2 2 3 Guidelines 2 3 The anaesthesia workstation css 23 1 Databases SS SS ee 2 3 2 The future 2 Re de a we ee Me EE 3 TEX in the Operating Theatre 4 The Datex AS 3 anaesthesia monitor 4 Introduction 222 r
254. nthz 01 if month eq Feb monthz 02 if month eq Mar month 03 if month eq Apr monthz 04 if month eq May month 05 if month eg Jun month 06 if month eq Jul monthz 07 if month eq Aug month 08 if month eq Sep month 09 if month eq Oct monthz 10 if month eq Nov monthz 11 if month eq Dec month 12 my ymdhm year month date hh mm CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 171 111 112 113 114 115 116 O 00 10 tn PWN See AA HE Ab WN HK OO 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 return ymdhm Htend of sub THE close END Hit end of prog 13 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 qw system use Getopt Long for commandline stuff use version use Cwd grab this dir nu DN alarm diabetes2 pl modified from dn alarm DIABETES1 pl runs Kalarm initialising kalarm calendar path home dick kde share apps kalarm calendar ics my OS ERROR Hit create a printer log file open my logg gt dnalarm
255. nversion 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 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 187 CHAPTER 15 PRINTING MODULE OVERVIEW RWD Nickalls 188 15 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 pro jdir of the current operation so all related information can be stored there The start time is determined by the Perl program launchcam12 p1l 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 T
256. o 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 projdir 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 189 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
257. o 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 17 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 care and safety For example Kennedy et 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
258. og 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 writes to screen thisdir cwd print logfile thisdir n CHAPTER 19 PROCESSDATA PL RWD Nickalls 249 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 Wn 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 lo
259. onal TEX Users Group meeting Toru Poland August 17 20 1998 pp 7 9 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 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 derived 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
260. 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 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 149 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 calendar 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 edg
261. opied from mac des m Yoh ISOflurane Delta for N20 0 75 66 6666 104 1 17 y units 12cm 2 2 5 454545 paper units mm5 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 X ticks withvalues 0 Ncdot 16 0 Ncdot 18 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 X 1 60 1 80 2 00 2 20 2 40 96 axis bottom CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 74 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 TI 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 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 Y using N2O 67 shift 0 7523 ticks withvalues 0 O cdot 2 0 cdot 4 0 cdots 6 O0 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 8523 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 7mm3 818181cm xrange 8 121 yrange 0 5614 2 3614 axis right
262. orates a real time MAC display widget Figure 1 1 which is positioned in the lower right part of the main display screen Figure 6 1 This widget N20 exp 40 01 Vap exp 2 62 N20 MAC 0 39 Vap MAC 148 Figure 1 1 Fe Po LE Example of the real time age corrected MAC widget dis ade 43 played by the anaesthesia workstation software O Nickalls 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 displays the current 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 avoidence of inadvertent awareness of the patient under anaesthesia 2 EET omiletop co File Edit View Bookmarks Tools Settings Help AS ae SePBBAOWARG x displays cont eaeeeneseseneacsens 8 conment newpace sss Displays setup displays newdic g i j set claes display set widget parent widget top s lset widget x 2 set widget y 2 set wa margin 50 NEO ep 4082 2600 1 hr cozep sico aaCOfox Vape 277 se 360 10 min je NIE sys NIBP die 0 00T HR 100 i RospRECG o i e veg EET set time scaler 5 Presi cx s Help set wadth pixel 2 cet widget w 091
263. ord 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 lt 80 gt diast x100 128 129 1 80 mean x100 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 CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 34 160 161 lt E gt lt 0 gt label 162 163 lt 1 gt lt 80 gt deg C x100 Saturation Sp02 subrecord 164 167 lt 3 gt lt 0 gt lt 0 gt lt 0 gt status 168 169 lt 0 gt lt 0 gt label 00 Sa02 01 Sv02 10 error 170 171 lt 1 gt lt 80 gt 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 S02 0 3 not used Carbon dioxide C02 subrecord 178 181 47 0 0 0 status 182 183 1 0 label source 01 2C02 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 ambient pressure Oxygen 02 subrecord 192 195 3 0 0 0 status
264. ore 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 15 8 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 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 15 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 15 PRINTING MODULE OVERVIEW RWD Nickalls
265. otgOla 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 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 20 FIELDS2PDATA PL RWD Nickalls 259
266. ox 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 system perl dn tkalarm pl geometry 320x380 50 300 h end of the sub sub viewcal topwindow gt destroy if Tk Exists topwindow BE Soe ED ir copy latest instance of the file this is a significant error if the copy fails CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 164 339 my thisdir cwd 340 my copy string cp kalarm calendar path thisdir dn calendar ics 341 system copy string 342 and carp could not run copy string OS ERROR 343 Perl best practice p 280 344 345 now view the copied file 346 if e dn calendar ics 347 use my dn tkviewer pl utility to view the file 348 system perl dn tkviewer pl in dn calendar ics 349 and carp could not run Perl dn tkviewer pl thisprog OS ERROR 350 system perl dn tkalarm pl geometry 320x380 50 300 351 else print
267. p 1 76 First Datex HR ecg 86 N20 MAC 046 HR sat 88 Sel ax Vap MAC 1 00 BP sys 15260 Total MAC 146 BP dia BOOT ox vapour SEV conos NIBP sys 000 age 43 NIBP dia 000TVi Lose se EE m Sample Period s RespR ECG D i ed sr TV exp 600 500 IMVol sal Last read on Tempi 0 00 z taste Thu May 3 12 33 52 2001 ES 020 Anes N 4 dev devityso ET pu 7 IF Checksum 75 75 in 2 bad checksum 43 Total MAC EHI Sound of c x mw 1 Z camomile 01 o31121 0p i dick elocalhost localdomain o mae 16 28 J Figure 1 11 Screen showing the Datex controller bottom left of screen D Camomile 0 1_030814 0 Eile Project Entry Timer View Help MB ARS ao some T 400 30 asol O A Recommendations Konqueror o Location Edit View Go Bookmarks Tools Settings Window Help MandrakeSoft MandrakeStore S MandrakeFxnerr 124 Mandrake Sat T24 News T iol 4 amp 5450 FDS AAA d Y E gt Location 3 dick allfles camomiletop aneshelp tracheostomy nodeS html 50 Ned Up Previous 33 Next About this document Up Tracheostomy amp recommendations Previous Heat 0 diathermy oH Main Recommendations Ee 1035 1 All theatre staff should be aware that an airway fire may occur during trachesotomy Er 2 Have a fire extinguisher immediately available It should
268. point g30 30 1 991617 q30 30 00000 1 99162 97 X point q35 35 1 930882 q35 35 00000 1 93088 98 X point q40 40 1 872 q40 40 00000 1 87200 99 X point q45 45 1 814913 q45 45 00000 1 81491 100 point q50 50 1 759567 q50 50 00000 1 75957 101 point q55 55 1 705909 q55 55 00000 1 70591 102 point q60 60 1 653887 q60 60 00000 1 65389 103 point q65 65 1 603451 q65 65 00000 1 60345 104 point q70 70 1 554554 q70 70 00000 1 55455 105 point q75 75 1 507148 q75 75 00000 1 50715 106 point q80 80 1 461187 q80 80 00000 1 46119 107 point q85 85 1 416628 q85 85 00000 1 41663 108 point q90 90 1 373428 q90 90 00000 1 37343 109 point q95 95 1 331545 q95 95 00000 1 33154 110 drawline q5 q10 q15 q20 q25 q30 q35 q40 q45 q50 q55 q60 q65 q70 q75 q80 q85 q90 q95 111 plot 5 00000 2 32518 10 00000 2 25427 q5q10 112 V plot 10 00000 2 25427 15 00000 2 18553 q10q15 113 Vplot 15 00000 2 18553 20 00000 2 11888 q15q20 114 Vplot 20 00000 2 11888 25 00000 2 05426 99 6 q20q25 115 plot 25 00000 2 05426 30 00000 1 99162 q25q30 116 plot 30 00000 1 99162 35 00000 1 93088 q30q35 117 plot 35 00000 1 93088 40 00000 1 87200 q35q40 118 plot 40 00000 1 87200 45 00000 1 81491 q40q45 119 plot 45 00000 1 81491 50 00000 1 75957 q45q50 120 plot 50 00000 1 75957 55 0000
269. 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 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 pl 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 informat
270. 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 14 DATA STORAGE FILES AND FORMATS RWD Nickalls 185 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 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 EntryAnaesthetist E 2004 09 23 14 39 26 Dr R W D Nickalls et al Mark 2004 09 23 14 44 24 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 Epi
271. r 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 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 06 MODULERWD Nickalls 240 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 s
272. r 11 2004 dDisplayDial h 7631 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 109 CHAPTER 10 THE CAMOMILE PROGRAM RWD Nickalls 110 850 Apr 11 2004 dDisplayNow h 6610 Apr 11 2004 dDrugs cpp 1437 Apr 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
273. r 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 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 11 Configuration files ch config tex 11 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 114 CHAPTER 1
274. r 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 S until unix my until ymdhm ymdhm until string print until time until ymdhm 42 mins An print interval time 5 mins n print logg until time until ymdhm 2 mins n print logg interval time 5 mins n format is until u 2005 12 13 15 36 include terminal spaces my until u until ymdhm which it repeats n the period during THE set a new alarm need i to be 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 An print logg setting new COFFEE alarm n print logg sending Kalarm string out in system qq out and croak could not run out OS ERROR Perl best practice p 280 THHHE SUBS ymdhm time string need to determine the until time in the correct format for kalarm sub ymdhm format yyyy mm dd hh hh passing only one time string into array my time string print processing parameter time string n CHAPTER 13 DIABE
275. r 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 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 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 211 CHAPTER 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 212 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 bi
276. rams and graphs to be viewed easily The buttons are mapped to programs as follows e RUN camomile launchcam12 pl EPIDURAL database epidural pl e PROJECT TEAM camteanabdvi dvi QUIT exit O PRINT LAST CASE not active just gives help message 91 CHAPTER 7 THE PERL TK FRONT END RWD Nickalls 92 CAMOMILE Tauncher v2 e Peri dick on the RUN button to start the C CAMOMILE anaesthesia program EPIDURAL and DOUBLE LUMEN TUBE c The CAMOMILE project team 2004 Figure 7 1 Screen showing the initial graphic front end loader widget lt tklaunch2 pl 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 database 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 7 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 B
277. range 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 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 d
278. result eg OK Y 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 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 if use parameters u 1 only then instant and no repeat test use only 1 min test u 1 i 1 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 163 297 298 299 300 301 302 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 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 300 system perl dn tkalarm pl geometry 320x380 50 300 j sub errorbox testing area topwindow gt bell result dialog1 gt Show THE if result eg OK Y topwindow gt destroy if Tk Exists topwindow print beep system qq perl dn errorb
279. rint 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 if e satfilename CHAPTER 20 FIELDS2PDATA PL RWD Nickalls 257 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 doneNn 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 y
280. rintall 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 8 THE LAUNCHCAM12 PL PROGRAM RWD Nickalls 100 8 2 The program launchcami12 pl 1 usr bin perl 2 launchcam12 pl 3 Ht CALLed by the Tk frontend widget tklaunch2 pl 4 5 April 10 2004 6 for launching camomile and the printing program 7 8 RAD Nickalls 9 works well 10 11 1 new version to use Simon s new camomilefields2tex version 12 13 14 15 write code to first check that all supporting programs are present 16 17 print launchcam12 pl n 18 19 print making a time encoded base directory in 20 grab the starttime 21 timenowgmt localtime 22 timenowunix time 23 now create the projdir as a timerelated filename 24 call the SUB tedname to generate the projdirname 25 format of tedname home dick allfiles camomiletop theatredata date 26 we pass the timenowGMT value to the tedname sub 27 print calling sub tedname for
281. ription the software components fall into the following categories e a graphical front end module for launching the various systems a data collection and display module a printing module an epidural and double lumen tube database an HTML help module These are now described briefly in turn 106 CHAPTER 9 SYSTEM OVERVIEW RWD Nickalls 107 9 2 Modules 9 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 9 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 9 2 3 Printing module At the end of the an
282. rmed 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 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 skip comments CHAPTER 17 PRINTING THE STAND ALONE SA MODULE RWD Nickalls 220 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 val
283. rnals 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 can 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
284. ro uid1 0 uid2 0 uid f1 0 m1 0 e1 20 value split 1 dataline print dataline replace CR LF space with visible chars newbuffer dataline s r lt CR gt dataline s n lt LF gt dataline s lt SPACE gt print dataline n LINEA if dataline m lt VIM gt if eventFLAG eq ON print FLAG is still ON else eventFLAG ON print FLAG ON Wn if dataline m endcode eventFLAG OFF print FLAG OFF n now analyse the event string to find UID and TEXT print NEW endcode found starting to extract the name SNOMEDcode pair n increment event counter eventnumber eventnumber 1 len length dataline print len dataline len in print dataline dataline Nn CHAPTER 12 DRUG DICTIONARY RWD Nickalls 131 131 132 133 134 135 136 137 138 139 140 141 142 143 144 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 uy print string number eventnumber Mn process the event string to locate begin and end codes TH get the index positions for UID and SEQUENCE uid1 index dataline VIM uid2 index dataline lt VIM gt print uid1 uid1 Wn print uid2 uid2 Wn uid substr
285. rttime 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 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 228 CHAPTER 18 PRINTING THE STAND ALONE SA 06 MODULERWD Nickalls 229 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
286. rugname collect name code pairs into a hash dmd dmd drugname drugcode hash my addlist Drugl drug2 Atropine Drug2 just array my addname my novalue 0 foreach addname addlist print addname Wn if exists dmd addname print ss dmd addname An print logg drugname is ALREADY on the VIM list n print addname is ALREADY on the VIM list An j else dmd dmd addname novalue add new drugname drugcode pair to the hash push udrugname addname add new drugname only to the Unsorted drugname array print logg drugname has been put on the list just now n print addname has been put on the list just now An j print Nn j P CHAPTER 12 DRUG DICTIONARY RWD Nickalls 142 59 foreach addname udrugname 60 print addname Wn 61 12 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 Isoprenaline has been put on the list just now drugi Frusemide drug2 Furosemide Frusemide has been put on the li
287. ry 320x380 50 300 n end of sub sub showhelp opens the small help window create the array of help contents to pass to the help module my helparray title in HOWIO use n 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 NnThis 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 Mnkalarm html 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 nIf 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 eeet 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 CHA
288. s Blood whole Magnesium Magnesium sulphate Insulin Potassium Potassium chloride Thiopentone Thiopental Cryoprecipitate FFP Fresh frozen plasma PPF Plasma protein fraction Esmolol eof 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 12 10 Perl program add2list pl This program added to the NHS list the drugs in the missing list 1 usr bin perl 2 3 Ht add2list pl 4 5 RWDN Jan 13 2006 6 Ht 7 use strict 8 use warnings 9 use Cwd to get this PATH eg thisdir cmd 10 use Carp allows croak and warn warn always gt to STDERR CHAPTER 12 DRUG DICTIONARY RWD Nickalls 141 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 4l 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 use Fatal qw open close for errors use Perl6 Builtins gw system use Getopt Long for commandline stuff use version my udrugname my dmd my drugname my drugcode drugname Atropine drugcode push Qudrugname drugname collect name code pairs into a hash dmd dmd drugname drugcode drugname Bupivicaine drugcode push udrugname d
289. s 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 caption caption icon icon miniicon icon config filename dcopserver server nocrashhandler waitforwm style style 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 Use caption as name in the titlebar Use icon as the application icon Use icon as the icon in the titlebar Use alternative configuration file Use the DCOP Server specified by server Disable crash handler to get core dumps Waits for a WM NET compatible windowmanager sets the application GUI style CHAPTER 13 D
290. s 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 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 12 DRUG DICTIONARY RWD Nickalls 127 add drugname Thiopentone add drugname Vancomycin add drugname Vecuronium hheot However
291. seconds right axis for 50 oxygen shift 0 5614 X ticks withvalues 0 O0 cdot 12 O0 cdot 4 0 cdots 16 0 cdot 8 X 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 96 ehbeginSKIP 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 inputfile isokdata8 dat 0 8 thinline inputfile isojdata8 dat 0 6 endSKIP CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 75 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 145 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 hl0 h8 d text fbox 1 cdot 0 x h10 var hl2 zh10 d text fbox 1 cdot 2 x h12 v
292. sh 4 1 1 Software version llle 4 1 2 Available software SS SS SS Se 4 2 serial port e ie ERROR EL EAR SGA xm ems 4 2 1 Cable connections SS SS SS 422 Protocol ss 4 14 pa sa gh be EHR WE OST P XU S vi E ooo o tn dg RUNNEN 15 IS 16 16 17 18 18 22 CONTENTS vii 43 Command format leen 2I 4 3 1 Transmission request command 29 44 Output data string format SE EE EE ss EE se 31 45 Example of data output llle 36 4 6 Correspondence ES eee ee ee 43 5 Interfacing the serial port in Linux 45 21 JntroductiOB s se uoo fees ro RR SOR GG RES RE 45 5 2 Device SerialPort pm less 45 5 3 Sending program as3sim pl llle 46 5 4 Receiving program dn getfile2 pl lr 49 6 Age corrected MAC 52 6 l Introduction lt 25 29 RR DRR RR Ro 2544445454 254 52 6 1 1 MAC subroutine MS DOS 54 6 2 Age corrected MAC charts lens 56 6 3 Generating the charts eee 57 6 3 1 A data file for a single iso MAC curve ll 58 6 3 2 mathsPIC script for drawing the whole graph 59 6 3 3 Final mathsPIC program for making the charts p 6 3 4 Output mac iso8t mt code from the previous mathsPIC program 77 6 4 References os moe e n qub we S RGB hon EUR ee OR Res 89 II The front end coordinating program 90 7 The Perl Tk front end 91 7 1 Introduction ss
293. site perl 5 8 7 1386 linux Device SerialPort pm 5 3 Sending program as3sim pl 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 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 handshake none croak fail setting handshake ob gt write_settings croak no settings nnne my pass CHAPTER 5 INTERFACING THE SERIAL PORT IN LINUX RWD Nickalls 47 use a while loop to send output data via the serial port H lc test pulses works OK print testing RTS on off n ob pulse rts on 1000 100 ms ob pulse rts off 1000 if MS RTS ONO 1 print RTS ON n else print RTS OFF n if MS_CTS_ON 0 print CTS ON n else print CTS OFF n my rtsval 0 rtsval MS_RTS_ON print RTSval rtsval n my
294. sleep 1 371 372 373 R 374 375 now sort the array alphabetically from the Unsorted list udrugname 376 my sdrugname 377 sdrugname sort a cmp b udrugname 378 379 380 f now print the sorted name array to the files 381 s means SORTED 382 u means UNsorted 383 384 my n 0 385 my listnumber 386 my dname 387 my snomed codes 388 389 open my camfile gt u drugsrn conf new die ERROR can t open CAMfile in nU 390 391 392 foreach dname sdrugname 393 print dname Wn 394 n n 1 395 listnumber 0000 n 396 listnumber substr listnumber 4 397 snomed_code dmd dname 398 CHAPTER 12 DRUG DICTIONARY RWD Nickalls 137 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 OU RU F2 N 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 print to a simple file print outfile2 Slistnumber gt lt dname snomed code gt n print sorted order in format for Camomile Nadd drugname V print camfile add drugname dname n print camfile add drugname dname dmd dname n sleep 1 THE close END 12 6 Perl program reverse pl usr bin perl w HH reverse pl RWD Nickalls
295. splay 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 class main newinstance popdict CHAPTER 11 CONFIGURATION FILES RWD Nickalls 122 comment newpage SSS 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 11 CONFIGURATION FILES RWD Nickalls 123 4 setup bottom window pushdict set widget title amp Main
296. st 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 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 44 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 CHAPTER 12 DRUG DICTIONARY RWD Nickalls 143 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 dmd addname 77856005 Esmolol is ALREADY on the VIM list 12 12 Final list for pull down menu Finally the program output a list suitable for the Workstation program and which was input on startup In practice we left the list as the complete list and were in
297. 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 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 DE EE Re 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
298. sthetists and has been very sucessful 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 inputting 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 CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 4 as a final record In time we would like to incorporate a suitable database develop 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 Several lecture presentations relating to this project have been given over the last few years Nickalls 2008 2005a 2005b 2004a 2004b 2004c Nickalls and Dales 2003 Group members The project team consists of the following members Richard WD Nickalls Consultant Anaesthetist Department of Anaesthesia City Hospital Nottingham UK Simon Dales Software Engineer PurrSoft Oxford UK simond Q purrsoft co uk Adrian K Nice Senior Systems Developer Department of Infor
299. 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 sr desc T7 Sr type 0x00 no meaning sr desc 7 offset Sr type offset Sr type offset offset Sr type offset 0x0000 no no meaning 0x0000 no no meaning 0x0000 no no meaning 0x0000 no no meaning 0x0000 no START OF THE TRANSMISSION REQUEST SUBGROUP Request current values of physiological database DRI_PH_DISPL field phdb_rcrd_type of struct phdb_req 42 0x01 meaning since only meaning meaning meaning meaning meaning Transmission interval in seconds Ox0004 i e Send current values of physiological database every 10 seconds field tx interval of struct phdb req CHAPTER 4 THE DATEX AS 3 ANAESTHESIA MONITOR RWD Nickalls 31 49 0x00 50 0x00 reserved 2 of struct phdb_req must be zeroed 51 Ox3B checksum 52 Ox7E End flag In the Data Program this command string is send by the SUB RequestString page which is part of the Datex module detailed in Chapter see also Figure page 4 4 Output data string format The data format for the Datex AS 3 amp CS 3 monitors is described in the Datex document AS 3 amp CS 3 Computer Interface Specification Revision 3
300. subroutine MS DOS The agent name and the end tidal concentration output by the Datex monitor were used as inputs for the calculation the MACge ag values for each agent being stored in simple look up table in the following subroutine written in QuickBASIC 4 5 1 REM MS DOS program 2 REM 1996 QuickBASIC 4 5 3 SUB mac n2opercent vapourname etvapour ageofpatient bmac 4 REM 5 REM Determines the current value of MAC 6 REM using the recent paper by Mapleson BJA 1996 vol 76 p 179 185 7 REM Effect of age on MAC in humans a meta analysis 8 REM 9 REM new MAC sub using etn20 10 REM returns the value of BIGMAC bmac 11 REM this is the newMAC which works correctly 12 REM 13 IF etvapour 0 THEN etvapour 001 14 n20 n2opercent 15 v vapourname 16 vap etvapour 17 A ageofpatient 18 deltaage A 40 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 55 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 33 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 BB 00269 REM REM this MAC sub is called from the end of PLOIVAPOUR 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
301. 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 _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 202 CHAPTER 16 TYPESETTING PROGRAMS RWD Nickalls 203 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 starttime
302. t 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 1994 2001 we developed a working 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 In 2002 Simon Dales joined the project and the program was ported to Linux see Section 1 3 and the program was extended to include alarms some basic decision support as well as the calculation and visulisation 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 we have tried to collaborate with various univer sity departments with a view to R amp D Discussions with the Nottingham University Departments of Computing and Department of Electrical and Electronic Engineering in 2005 did not lead anywhere owing to lack of funding Unfortunately funding has still not been forthcoming an EPSRC grant application in conjunction with Dept Med Physics Liverpool Univ Hosp
303. ta 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 doneNn 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 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 Ist 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 earli
304. tal 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 explored 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 Again financial support did not materialise Collaboration with Nottingham University Hospitals 2008 In December 2008 we embarked in conjunction with Professor R Mahajan Depart ment of Anaesthesia on a collaboration with the Department of Medical Physics at the Nottingham University Hospitals City Hospital Campus with a view to further development 1 3 The Linux project Towards the end of 2002 we 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 IATIEX 2g 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 anae
305. tarttimes 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 each 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
306. te 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 2 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 4 20 Serial port 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 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 Table 4 3 Datex AS 3 amp CS 3 RS 232 serial port 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
307. te 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 190 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 stri
308. tended 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 disable or otherwise ignore this type of alarm While a very 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 CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 151 BEGIN VALARM TRIGGER VALUE DATE TIME 19970317T133000Z
309. tending 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 to 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 CHAPTER 12 DRUG DICTIONARY RWD Nickalls 144 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 13 Diabetes decision support system RWD Nickalls 2006 April 19 2009 aHOUSE book xenon ch diabetes tex 13 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 anaesth
310. than one DIABETES event to cancel then need to pause slightly as it takes time for each cancel to take effect if eventnumber gt 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 Ans event 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 print NO DIABETES word in this event so looking for next event n print event event Nn next LINE HH finally dump the event string and start again h print dataline Nn datalinez end of the input loop reading the calfile THE print no more events found termating now n rint EET TERS n P print event string event Nn CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 175 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 199 200 201 202 203 204 205 206 207 208 209 210 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
311. 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 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 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 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
312. 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 20 FIELDS2PDATA PL RWD Nickalls 254 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 3
313. 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 196 301 95 000000 1080559889 346 95 000000 1080559934 391 95 000000 1080559979 436 94 500000 1080560024 d The log file timefile txt Concurrently with the previous process the program cam2gnnh p1 creates the timef ile 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
314. ting the graphics in IATEX picture for mat and placing them into the appropriate directories The program then writes the IATEX 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 depending 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
315. 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 246 CHAPTER 19 PROCESSDATA PL RWD Nickalls 247 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 programname 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
316. ue 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 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
317. unix 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 k K k paaa k k kk kk vspace 4mm CHAPTER 16 TYPESETTING PROGRAMS RWD Nickalls 204 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 16 T
318. ural if e epidural pl first remove the Tk screen topwindow gt destroy if Tk Exists topwindow now clear the window system clear topwindow bell beeps if click window p 296 system perl epidural pl system perl tube pl system perl tklaunch2 pl geometry 300x400 50 300 else print ERROR Vn print can t find program lt epidural pl gt n n exit Ht 7 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 CHAPTER 7 THE PERL TK FRONT END RWD Nickalls 97 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 8 The l1aunchcami 2 pl program April 19 2009 oAHOUSE book xenon ch launchcam tex 8 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 copying a lot of printing utility files into the project pdata directory
319. warnings 23 use Carp allows croak to STDERR 24 use Fatal qw open close for errors 25 use Perl6 Builtins gw system 26 use Getopt Long for commandline stuff 27 use version 28 29 30 create a printer log file 31 open my logg 2 dn dmdlog log die ERROR can t open dn dmdlog log file n 32 grab current time 33 my time now unix time seconds 34 my time now string localtime time now unix 35 print logg rnalarm log time now string Unix time now unix An 36 print logg log of my Perl rnalarm3 pl program Wn 37 i 38 39 nu nn and warn warn always CHAPTER 12 DRUG DICTIONARY RWD Nickalls 129 40 set up the in and out files 41 open my infile test otm23 txt open INfile M 42 open my infile dn fotm2xml txt die ERROR can t open INfile n 8 w50 2005 43 open my infile c vtm23 w19y2006xml txt die ERROR can t open INfile week19 n 44 45 open my outfile test out vtm txt die ERROR can t open OUTfile in 46 open my outfile2 gt test outsorted txt die ERROR can t open OUTsortedfile Mn die ERROR can t 47 48 fH 49 now read each line in the file and place parameters into an array 50 print reading the infile file line by line n 51 print logg readi
320. was rejected see details below and therefore serious development stalled However more recently a collaboration with our own Medical l The original version was in QuickBasic 4 5 It was later ported to PowerBasic 3 5 in order to accommo date the 11 bit serial data frame used by the Datex AS 3 anaesthesia monitors Minimum Alveolar Concentration MAC of an anaesthetic agent is an index of anaesthetic potency A typical anaesthetic is associated with approximately 1 1 2 MAC CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 3 Physics department has resulted in some ongoing development which will be detailed in due course These ventures are summarised below Collaboration with Leicester University 2001 During the academic year 2001 2002 we 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 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 Hospi
321. widget title N amp Other Stuff set widget name widget otherstuff newinstance popdict popdict more windows here popdict eof Chapter 12 Drug dictionary April 19 2009 allfiles camomile cam book ch drugdict tex 12 1 Introduction The drug dictionary listing used in the pull down 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 Je Cephradine Cisatracurium Cryoprecipitate Gases Dexamethasone x Alarms Monitors Pumps Other Stuff EE Text e 3 21 12 57 40 CO2 insp i7 65 kg 175 cm 17 years M RR Figure 12 1 Screenshot showing the pull down menu and the drug Bupivacaine selected 125 CHAPTER 12 DRUG DICTIONARY RWD Nickalls 126 12 2 Initial drug list The drug list uploaded to the workstation was u drug
322. wing the log alarm MAC and trend windows The blood pressure BP is highlighted in yellow in the alarms window indicating a minor departure from the normal range GEE Camomile 0 1 030814 OperationGoeseip2 20 05 07 GMT SundayD Bx Eile Project Entry Timer View Help NRX OOP OWN T 100 90 ET pee TA ER LE DEE terete EA N nnn 100 XE ox Clinical 3 Gender i a e Mae Eemale in Gases 7 Melgnt kg ed amp coz 47 YE e ME mel EE ek 10 ht fom 17s lesp EED TVex 308 Bone EE EE OE EE eee Age years 8 1 IE N20 Mac 0 62 Vap MAC 089 0 Total MAC 1 51 vapour SEV Ty 101 000 j MM MMMMM MM M MM ee eee as sey 500 y 2 EE ER RR RR EE GR Ie imde p ol 5 Anes 4 x 2 e BEE EE MA IM Eun LE ii 9 RO 20 31 Figure 1 10 Screen showing use of the Patient Data widget CHAPTER 1 AN ANAESTHESIA WORKSTATION RWD Nickalls 12 D c Camomile 0 1_031121 Oj E ile Project Entry Timer View Help N MX eo oPomixe BP 100 j eM EE 80 150 100 50 20 SS Main Gases N20 exp 46 86 Alarms Logs Monitors Pumps Other Sturt CO exp 48COgps ER 3 tees al CO2 insp oo t0 Vapex
323. x 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 centering End expired in 100 oxygen end minipage 1 1 text myleft 45 2 0 put myleft at 45 2 newcommand myrightb fbox begin minipage 4cm End expired in 67 hspace 8mm 50 N _2 0 hspace 7 5mm N _2 0 end minipage 9o 1 end of newcommand X text Vmyrightb 102 2 657 1 was 2 6 put myrightb 1 at 102 2 657 newcommand mybottom Age years text umybottom 46 0 15 put mybottom at 46 15 text V copyright RAD 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 CHAPTER 6 AGE CORRECTED MAC RWD Nickalls 72 435 variable y02 0 9523 9523
324. y 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 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 15 PRINTING MODULE OVERVIEW RWD Nickalls 195 TES now print data into 1 hr files make NewElapsed time relat
325. y gt 0 47 48 49 QUIT button 50 topwindow Button text gt QUIT 51 padx gt 20 pady gt 20 52 relief gt raised 53 background gt LightBluel 54 activebackground gt LightBlue2 55 command gt amp quit CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 158 56 place relx gt 0 05 rely gt 0 115 57 pack side left expand gt 1 58 59 60 c XENON project team 61 topwindow Button text gt c The XENON project team 62 padx gt 10 pady gt 10 63 relief gt flat 64 background LightGrey 65 activebackground gt LightGrey 66 foreground gt Black 67 activeforeground Black 68 69 place relx gt 0 35 rely s 0 016 70 71 d 72 DIABETES 20mins button 73 topwindow Button text gt DIABETES 20 mins 74 padx gt 10 pady gt 10 75 relief gt raised 76 background gt LightBlue3 TI activebackground gt LightBlue2 78 foreground gt Blue 79 activeforeground Red 80 81 command gt amp diabetes20 82 pack side right expand gt T 83 place relx gt 0 5 rely gt 0 3 84 E 85 DIABETES 30mins button 86 topwindow Button text gt DIABETES 30 mins
326. yellow dn alarm demoYELLOW p1 and a red dn alarm demoRED pl demo alert The following is the red demo pro gram OU RU F2 on 10 11 12 13 14 15 16 17 18 19 20 21 usr bin perl dn alarm demoRED pl 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 for errors use Perl6 Builtins qw system use version use Cwd to get this path Ht nu my kalarm calendar path home dick kde share apps kalarm calendar ics my OS ERROR THE create a printer log file open my logg gt dnalarm log die ERROR can t open dnalarm log file Wn CHAPTER 13 DIABETES DECISION SUPPORT SYSTEM RWD Nickalls 169 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 22 53 54 55 56 57 58 59 60 61 62 63 64 65 66 print logg TEST button pressed Wn print TEST button pressed n 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 An Ht fo

Download Pdf Manuals

image

Related Search

Related Contents

MHX-550.LP  TekNmotion Pulsar SX User's Manual  WINDOWS 8 - INSTALL, SET-UP, & CUSTOMIZE  High Dynamic Range Rendering in Real-Time  Lexmark 90P3000 All in One Printer User Manual  AuerHEAT LINER - ディンプレックス・ジャパン  

Copyright © All rights reserved.
Failed to retrieve file