³ò
ðßlJc           @   sg  d  d k  Td  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d  d k Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d f  d „  ƒ  YZ e ƒ  Z  e  i! d ƒ e e  ƒ Z" e  i# ƒ  d S(   iÿÿÿÿ(   t   *Nc         C   sš  d Gy t  i d d ƒ } Wn- d GHt i d d ƒ t t i ƒ t Sn X|  d  } | d  } y | | } Wn d GH| i ƒ  t Sn Xy t	 | } Wn d | | <n X| | | j o t
 t i ƒ nÊ | | |  j o$ d	 GH| i ƒ  t
 t i ƒ t Sn• | | | j oc | | |  j oR d
 Gd G| | Gd G| GH| i ƒ  t i d d ƒ t t i ƒ t S| i ƒ  n! d GHt t i ƒ | i ƒ  t Sd  S(   Ns   barccodes called s   boxcodes_db1.dbt   cs,   no barcode database file. Cannot check codest   Warningi   s   something wrong heret   0000s   Label matches ?labels!   Warning, label does not match boxt   #t   Errors   Label does not match boxs0   neither barcode has been recognised as a boxcode(   t   anydbmt   opent   tkMessageBoxt   askokcancelt   set_colourgreyt   appt   labelrg1t   Falset   closet   codebdt   set_colourgreent   Truet	   showerrort   set_colourredt   self(   t   blt   bbt   codedbt	   labelcodet   lb2codet   codelblt   codelb2(    (    s   tkavsuppjul26.pyt   barcodes)   sL    



"

c         C   sÐ  d } d GHd } y. t  | ƒ } d G| GHt  | ƒ } d G| GHWn d	 GHt i d
 d	 ƒ n X| G| GH| G| GH| d  G| d  GH| | j o t i d d ƒ n | d  d j p | d  d j oD d GH| } d } | | j o" t |  i ƒ t | | ƒ | SqÌnÅ | d  d j p | d  d j o! | d j o t i d d ƒ n‚ | d  d j p | d  d j o9 | d j o, | } | | j o t | | ƒ | SqÌn' t i d
 d ƒ d GHt |  i ƒ d Sd  S(   Nt   0t   checkBarcodest   5000471006063t   5000471006810t   5000471006827t   5000123109388t   5000471006070s   check 1 s#   one or both barcodes not all digitsR   i   i   s   warning s   Same barcodest   82t   84s   bcode_a is label barcodet   1s#   Label barcode also in Boxcode entrys0   Neither barcode entered is from a barcoded labels   neither is a label barcodet	   nobarcode(   R   R    R!   R    R"   R#   (	   t   intR   t   showwarningt   tkmessageBoxt   set_colourpinkR   R   R	   R
   (   R   t   bcode_at   bcode_bt   lblt   boxcodest   check1t   check2t   barcode_label(    (    s   tkavsuppjul26.pyR   m   sF    			"//c         C   s0  d } | GH| d j p | d j p | d j o! | Gd GHt  i d d ƒ t Sn y t | ƒ } t |  ƒ } Wn t  i d d	 ƒ d
 Sn X| d j o t Sn‹ d | | j  o t  i d d ƒ t Snb | | j o t  i d d ƒ t Sn= d | | j o t Sn$ d | | j  o t Sn t | ƒ d  S(   Nt   checkweightt    R   s   patient weights   probably no weight entered!s   NB s   No weight checks will be madeR   s_   Cannot check dose vs weight. Check weight entered as numbers only, no decimal points or letterss   not integersi(   i   s   Warning s:   Dose appears more than 50% higher than expected for weights(   Dose appears small for weight of patienti   (   R   t   showinfoR   R(   R	   R   t	   gonewrong(   t   dosedt   weightedt   funcnamet   weightt   dose(    (    s   tkavsuppjul26.pyR3   œ   s2    '	c         C   s  d } | GHt  |  ƒ } t  | ƒ } d } d G| G| GH| | j o! | G| GHt i d d	 ƒ d  Sn | d j  o t i d
 d ƒ d  Sn | d j o! t i d d ƒ t t i ƒ nW| d j oT | d j o" | d j  o t t	 i ƒ t
 Sqt i d d ƒ t t	 i ƒ t Snö| d j o† | d j o% t i d d ƒ t t	 i ƒ t Sq| d j o" | d j  o t t	 i ƒ t
 Sqt i d d ƒ t t	 i ƒ t Snc| d j o† | d j o% t i d d ƒ t t	 i ƒ t Sq| d j o" | d j  o t t	 i ƒ t
 Sqt i d d ƒ t t	 i ƒ t SnÐ | d j o¸ | d j o% t i d d ƒ t t	 i ƒ t Sq| d j o" | d j  o t t	 i ƒ t
 Sq| d j o% t i d d ƒ t t	 i ƒ t Sqt i d d ƒ t t	 i ƒ t Sn t | ƒ d  S(   Nt
   checkidosei   i
   i   i-   i<   iK   s   Warning s:   Intended dose is not a whole capsule/blister (or multiple)s   Note s:    Zanamivir (Relenza) dosage - normally pregnant women onlys   Warning, Program Error s#    Intended dose entry appears wrong i   ix   s)   "Intended dose" entry does not match age i   i   i   i   i   i   i    s(   Under 1 year olds need to be seen by GP (   i   i   i
   i   i-   i<   iK   (   R(   R   R   R5   R)   R   R   t   labelrg4R   R   R   R   R6   (   R7   t   agesR:   R9   R;   t   aget   doses(    (    s   tkavsuppjul26.pyR<   ¹   sz    	c         C   s³   d } | GHy t  |  ƒ } t  | ƒ } Wn( t i d d ƒ t t i ƒ d  Sn X| | j o t t i ƒ n@ | | j o. t i d d ƒ t t i ƒ t t i ƒ n t	 Sd  S(   Nt   checkaget   warnings\   Cannot check labelled dose and intended dose. Need to be entered as numbers only, no letterss   Warning sN   Medicine label states a different strength from that entered for intended dose(
   R(   R   R)   R
   R   t   labelrg3R   R   R   R   (   t   doselR7   R9   t   doselbt   dosedr(    (    s   tkavsuppjul26.pyt
   checkdoses  s     c         C   sÙ   d } | GHy t  | ƒ } t  |  ƒ } Wn* t i d d ƒ | Gd GHd } t Sn Xd t  | ƒ } d G| GHt | | | ƒ } | t j o | Gt GHt Sn9 | t j o | Gt GHt Sn | Gt GHt t i ƒ t Sd  S(   Nt
   check_agebs   Warning sy   Patient's age, and intended dose, need to be entered as whole figures only, no letters or decimal points. Please re-enters   dose or age not digitsi    s
   check_age (	   R(   R   R	   R   R<   R   R
   R   R   (   t   agedR:   R7   R9   R;   R?   t   cid(    (    s   tkavsuppjul26.pyRH     s.    				c         C   s·  d } | GHy t  |  ƒ Wn& t i d d ƒ d GHd }  t Sn Xd t  |  ƒ }  d G| G| d  GH| d j o d	 GHt t i ƒ d  Sn ye | d  d
 j o
 d } nG | d  d j o
 d } n, | d  d j o t i d d ƒ n d } Wn t i d d ƒ n Xy t  | d d !ƒ } | GHWn! t i d d ƒ t Sd } n X| d j o¶t | | ƒ } | t	 j o	 d GHn, | t j o d GHt i d d ƒ n d GH|  d j o | d j o t	 Sq³d |  j  o
 d j  n o | d j o t	 Sq³d |  j  o
 d j  n o | d j o t	 Sq³d  |  j o
 d! j n o | d" j o t	 Sq³|  d j o t i d# d$ ƒ d% GHd& Sq³|  d' j p |  d j  o1 t i d# d( ƒ d) | d* G| Gd+ G|  GHt Sq³t i d# d, ƒ d- GHd. | d* G| Gd+ G|  GHt Sn¨ | d j o‘ |  d/ j  o% t i d# d0 ƒ d1 G|  Gd2 GHt
 Sq³d/ |  j  o
 d' j  n o d3 |  d4 GHt	 Sq³d5 | d* G| Gd+ G|  GH|  d/ j  GHt Sn
 d6 GHt Sd  S(7   Nt	   check_ages   Warning sd   Patient's age needs to be entered as whole years only, no letters or decimal points. Please re-enters   ignoring age - set to 0i    s
   check_age i   t   9999s    can't check against barcodelabelR%   t   oseltamivirR$   t	   zanamivirt   99s   NB s$   Cannot check label dose against age t   unknowns~    Label code gives unknown value for drug - ie I don't know what to do with this - please check barcode entry for label and boxi   s#   Label barcode in unexpected format s   Dose ok for weights   Dose not OKt   nbs   label Dose not OK for weights   Couldn't check against weighti   iK   i   i<   i   i-   i   i   i   R   s   Baby Dose should be checkeds   GET SOMONE ELSE TO CHECKt   Babyis   s   Age looks wrongs    something wrong here. Drug s    Dose s    Age s   Dose looks wrong for ages8    Warning !! Dose looks wrong, unless patient very heavy s   Dose out of range for age Drug i   s$   Need to check age/dose for Zanamivirs    Age is s    need to complete checks....s    Age implies adult t    s    something wrong here s&    Apparently not a drug I recognise....(   R(   R   R	   R   R
   R   R   R)   R3   R   t   false(   R?   R:   t   barcode_lblR9   t   drugR;   t   ck_wt(    (    s   tkavsuppjul26.pyRK   6  s–    	


	
	+++c         C   sá   d GHd GHt  |  i ƒ t  |  i ƒ t  |  i ƒ t  |  i ƒ |  i i i d ƒ |  i i i d ƒ |  i	 i i d ƒ |  i
 i i d ƒ |  i i i d ƒ |  i i i d ƒ |  i i i d	 ƒ |  i i ƒ  |  i i ƒ  d  S(
   Nt   washups   washup - setting all to greys   Enter patient id s   Enter postcodes,   Enter pt age (whole years, 0 if less than 1)s   patient weights    Enter dose advised by callcentres   Enter label barcodes   Enter box barcode(   t   resetcolourR   t   labelrg2RC   R=   t   ptidt   contentst   sett   ptpcodet   ptdobt   ptweightt   ptdoseR,   t	   boxcode_at   propht   deselectt   odddose(   R   (    (    s   tkavsuppjul26.pyRX   ž  s     c         C   s²   y t  i d d ƒ } Wn d GHn Xy t  i d d ƒ }	 Wn d GHn Xt | ƒ }
 |	 d } | |  | | | | | | | f	 } t i | ƒ } | | | <| i ƒ  |	 i ƒ  d S(   Ns   ptdb_bckey.dbR   s    File open or creation error s   ptdbtest.dbt   indexs   Entry saved(   R   R   t   strt   picklet   dumpsR   (   t   idt   dobt   pcodeR:   R;   t   lbcodet   boxcodeRB   t   ptdbct	   ptdbindext   key2Rf   t   ptt   ptstr(    (    s   tkavsuppjul26.pyt   writeTobcDB±  s    
!


c         C   sQ  y t  i d d ƒ } Wn d GHn Xy t i | d ƒ }	 Wn2 d GHt i d ƒ | d <t i | d ƒ }	 n Xt t |	 ƒ d ƒ }
 |  | | | | | | | f } t i | ƒ } | | |
 <t i |
 ƒ | d <| i ƒ  y t  i d d ƒ } Wn d GHn Xt | ƒ } |  | | | | |
 | | f } t i | ƒ } | | | <| i ƒ  d	 S(
   Ns   ptdbtest.dbR   s    File open or creation error Rf   s   No index found, creating onet   1000000i   s   ptdbbarcode.dbs   Entry saved(   R   R   Rh   t   loadsRi   Rg   R(   R   (   Rj   Rk   Rl   R:   R;   Rm   Rn   RB   t   ptdbt   key1t   keycodeRr   Rs   t   ptdb2Rq   (    (    s   tkavsuppjul26.pyt	   writeToDBÍ  s0    



c          C   sa  y t  i d d ƒ }  Wn d GHn Xy t  i d d ƒ } Wn d GHn Xx |  D] } |  | | | <qQ W|  i ƒ  | i ƒ  d } } t i d ƒ } t i d ƒ } d GH| G| GHy t  i d	 d ƒ } Wn d GHn Xy t  i d
 d ƒ } Wn d GHn Xx | D] } | | | | <qW| i ƒ  | i ƒ  d } } t i d ƒ } t i d ƒ } d GHd S(   Ns   ptdbtest.dbR   s    File open or creation error s   ptdbtestbakup2.dbi    s   copy ptdbtest.db ptdbcopy.dbs   cp ptdbtest.db ptdbcopy.dbs   file copieds   ptdbarcode.dbs   ptdbbarcodebakup.dbs    copy ptdbbarcode.db ptdbccopy.dbs   cp ptdbbarcode.db ptdbccopy.dbt   done(   R   R   R   t   ost   popen(   Rw   t   ptdbbakt   keyt   resultt   result2Rz   t   ptdbbak2(    (    s   tkavsuppjul26.pyt   copydbmõ  s@     


	 


c          C   s~   t  i  ƒ  }  d G|  GHt |  ƒ d  } | Gd t | ƒ d } | GHd | GHt i d | ƒ t i d | ƒ | Gd G| GHd  S(	   Ns   timenow i   Rw   s   .dbs
   copy to %ss   copy ptdbarcode.db \%ss   cp ptdbarcode.db \%ss    <- datestamp, datestamped -> (   t   timeRg   R}   R~   (   t   timenowt	   datestampt   datestampeddb(    (    s   tkavsuppjul26.pyt   maketimecopy#  s    		c          C   s  y t  i d d ƒ }  Wn d GHn Xy" t i t d d ƒ d d ƒ} Wn d GHn Xt i ƒ  } t i ƒ  } x< |  D]4 } | d	 j o qu qu | i t i |  | ƒ ƒ qu Wt i ƒ  } t i ƒ  } |  i	 ƒ  d
 G| | Gd GHd
 G| | Gd GHy | i	 ƒ  Wn d GHn Xd  S(   Ns   ptdbtest.dbR   s    File open or creation error s   tkavsupplied2.csvt   wt   dialectt   excels     CSV File open or creation errorRf   s   Close down took s    millisecondss    milliseconds, using clocks   Could not close down csv file(
   R   R   t   csvt   writerR…   t   clockt   writerowRh   Rv   R   (   Rw   t	   av1writert   time5t   time5aR€   t   time6t   time6a(    (    s   tkavsuppjul26.pyt
   output2csv5  s*    " 
c           C   s   d  S(   N(    (    (    (    s   tkavsuppjul26.pyt   updatecheckdoseX  s    c           C   s   d  S(   N(    (    (    (    s   tkavsuppjul26.pyt   updatecheckweight[  s    c         C   s   |  i  d d ƒ |  Gd GHd  S(   Nt   bgt   redRY   (   t   config(   R   (    (    s   tkavsuppjul26.pyR   a  s    c         C   s   |  i  d d ƒ |  Gd GHd  S(   NR™   t   pinkRY   (   R›   (   R   (    (    s   tkavsuppjul26.pyR+   f  s    c         C   s   |  i  d d ƒ |  Gd GHd  S(   NR™   t   greens
   turn green(   R›   (   R   (    (    s   tkavsuppjul26.pyR   k  s    c         C   s   |  i  d d ƒ |  Gd GHd  S(   NR™   t   grays	   turn gray(   R›   (   R   (    (    s   tkavsuppjul26.pyR
   r  s    c         C   s   |  i  d d ƒ |  Gd GHd  S(   NR™   t   oranges   turn orange(   R›   (   R   (    (    s   tkavsuppjul26.pyt   set_colourambery  s    c         C   s-   |  i  d d ƒ d |  _ |  Gd G|  i GHd  S(   NR™   Rž   s   checking barcodesRY   (   R›   t
   checkbcode(   R   (    (    s   tkavsuppjul26.pyRY   €  s    	c         C   s   |  Gd GHd  S(   Ns    has gone wrong(    (   R9   (    (    s   tkavsuppjul26.pyR6   …  s    t   AVAppc           B   sb   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 d	 „  Z RS(
   c         C   sø
  d „  } d „  } t  | ƒ } | i d | ƒ t  | ƒ } | i d d d | ƒ | i ƒ  | i d d d | i ƒ t  | ƒ } | i d d d | ƒ | i d d	 d | ƒ t ƒ  } t ƒ  } t ƒ  }	 t ƒ  }
 t | ƒ } | i d
 t	 d d d d ƒ t
 | d d ƒ|  _ |  i i d
 t	 d d d d ƒ t
 | d d ƒ|  _ |  i i d
 t	 d d d d ƒ t | ƒ } | i d
 t d d d d ƒ t
 | d d d d ƒ|  _ |  i i d d d d d d d d ƒ t | d d d d ƒ|  _ |  i i d d d d d d d d ƒ t ƒ  |  i _ |  i i i d ƒ |  i i |  i d <|  i i d |  i ƒ t
 | d d d d ƒ|  _ |  i i d d d d d d d d ƒ t | d d d d  ƒ|  _ |  i i d d! d d d d d d ƒ t ƒ  |  i _ |  i i i d" ƒ |  i i |  i d <|  i i d |  i ƒ t
 | d d# ƒ|  _ |  i i d d d d d d d d ƒ t | d d$ ƒ|  _ |  i i d d d d d d d d ƒ t ƒ  |  i _ |  i i i d% ƒ |  i i |  i d <|  i i d |  i ƒ t
 | d d& ƒ|  _ |  i i d d d d d d d d ƒ t | d d' ƒ|  _ |  i i d d! d d d d d d ƒ t ƒ  |  i _ |  i i i d' ƒ |  i i |  i d <|  i i d |  i ƒ t
 | d d( ƒ|  _ |  i i d d) d d d d d d ƒ t | d d* ƒ|  _ |  i i d d+ d d d d d d ƒ t ƒ  |  i _ |  i i i d, ƒ |  i i |  i d <|  i i d |  i ƒ t
 | d d- d d. ƒ|  _ |  i i d d d d/ d d d d ƒ t | d d- ƒ|  _ |  i i d d d d/ d d d d ƒ t ƒ  |  i _ |  i i i d0 ƒ |  i i |  i d <|  i i d |  i  ƒ t
 | d d- d d1 ƒ|  _! |  i! i d d d d/ d d d d ƒ t | d d- ƒ|  _" |  i" i d d! d d/ d d d d ƒ t ƒ  |  i" _ |  i" i i d0 ƒ |  i" i |  i" d <|  i" i d |  i  ƒ t# ƒ  |  _$ |  i$ i d2 ƒ t% | d d3 d4 |  i$ d |  i& ƒ|  _' |  i' i d d5 d d d d d d ƒ t# ƒ  |  _( |  i( i d2 ƒ t% | d d6 d4 |  i( d |  i) ƒ|  _* |  i* i d d5 d d d d d d ƒ t
 | d d7 ƒ|  _+ |  i+ i d d d d d d d d ƒ t, | d d8 d d9 d |  i- ƒ|  _. |  i. i d d: d d d d d d ƒ |  i. i d |  i- ƒ t, | d d; d |  i/ ƒ|  _0 |  i0 i d d< d d d d d d ƒ |  i0 i d |  i/ ƒ t, | d d= d |  i1 ƒ|  _2 |  i2 i d d> d d d d d d ƒ |  i2 i d |  i1 ƒ t, | d d d |  i3 ƒ|  _4 |  i4 i d d> d d2 d d d d ƒ d? } t
 | d@ d dA t5 dB d dC dD d | d | dE dF ƒ|  _6 | i dG ƒ |  i6 i d d5 d d/ d d d d ƒ t
 | d@ d dA t5 dB d dC dD d | d | dE dF ƒ|  _7 | i dH ƒ |  i7 i d d d d/ d d d d ƒ t
 | d@ d dA t5 dB d dC dD d | d |	 dE dF ƒ|  _8 |	 i dI ƒ |  i8 i d d: d d/ d d d d ƒ t
 | d@ d dA t5 dB dJ dC dD d | d |
 dE dF ƒ|  _9 |
 i dK ƒ |  i9 i d d< d d/ d d d d ƒ d  S(L   Nc           S   s	   d GHd  S(   Ns   called the callback(    (    (    (    s   tkavsuppjul26.pyt   callbackŽ  s    c           S   s   t  i d d ƒ d  S(   Nt   Versions   Pre-production Version  0.1(   R   R	   (    (    (    s   tkavsuppjul26.pyt   about1  s    t   menut   labelt   Filet   Exitt   commandt   Helps   About...t   sidet   padxi   t   padyt   texts   Entry Number %si
   sJ   Click (or Tab) between entries, replace contents, then click OK to confirmi   R™   t   cyans   Enter Pt ID (initials)t   rowi   t   columni   t   textvariables
   patient idi   s	   test ptids   <Key-Return>s   Enter patient Post Codes   patient postcodei   s   test ptpcodes,   Enter patient age in years, use 0 if under 1s   patient ages   Patient Ages$   Enter patient weight in Kg, if knowns   patient weights!   Enter dose as advised (See notes)i	   s   patient dosei   s   test pt doset   yellows   Enter Label barcodei   s   test bcode-as   Enter Box barcodei    s   Prophylaxis doset   variablei   s&   Clinician Authorised Non-Standard dosesK   Click 'Check Details' to check above details then 'Click to Accept Details's    Check DetailsRœ   i   s   Click to Accept Details OKi   s   Accept Details with errori   RŸ   t   bdt   relieft   heightt   widthi   t
   wraplengthi<   s   Test Barcodes Matchs   Test label Dose matches Ages!   Check Label dose vs Intended Dosei   s   Test advised dose vs age(:   t   MenuR›   t   add_cascadet   add_separatort   add_commandt   quitt	   StringVart   Framet   packt   TOPt   Labelt   subtitlet	   subtitle2t   BOTTOMt   idlabelt   gridt   EntryR[   R\   R]   t   bindt   print_contentst
   pcodelabelR^   t   doblabelR_   t   ptweightlabelR`   t   ptdoselabelRa   t
   bcodelabelR,   t
   checkcodest   boxcodelabelRb   t   IntVart   var_cbt   Checkbuttont   cbRc   t   var_odt   odRe   t   label1t   Buttont
   run_checkst
   ckokbuttont   enter_barcodest   okbuttont   record_detailst   overridebuttont   cleanupt   exitt   SUNKENR   RZ   RC   R=   (   R   t   parentR£   R¥   R¦   t   filemenut   helpmenuR¡   t   checkavdoset	   checkmisct	   checklastt   ft   okframet   colour1(    (    s   tkavsuppjul26.pyt   __init__‹  sâ    		
				%%%%%%%%%%%%%%'%'%%	$%%%%	9%9%9%9c         C   s[   d GHt  i d d ƒ o: t ƒ  d j o! d GHt ƒ  t ƒ  t i ƒ  qW d GHn d GHd  S(   NRâ   s   You sures   click OK to exit. Please wait while backup is made, before switching off computer. It may take several seconds, after clicking OKR|   t   Hurrays   warning.. No backup createds   oops ....???(   R   R	   R„   R–   R‰   t   winareat   destroy(   R   (    (    s   tkavsuppjul26.pyRâ     s    	c         C   so   d } | d j o |  i  i d d ƒ nB | d j o* |  i  i i d ƒ |  i  i d d ƒ n t | ƒ d  S(   Nt   updatebcodetestt   nomatchR™   Rš   t   matchs   Barcodes matchR   (   R   R›   R¡   R]   R6   (   R   Rô   R9   (    (    s   tkavsuppjul26.pyRò     s    c         C   sG  d GH|  i  i i ƒ  } |  i i i ƒ  } d G| Gd G| GHt |  | | ƒ } | GH| t j o n: | t j o, t i d d ƒ | GHd } t	 |  | ƒ n |  i
 i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } t | | | ƒ y | d  } Wn d } n Xd	 G| GH| d j o t | | ƒ nk t | d
 d !| ƒ t | | | ƒ }	 d G|	 GH|	 t j o t |  i ƒ n t |  i ƒ t i d d ƒ |  i i i ƒ  } | d
 }
 |
 d d j o | d }
 n d G|
 G| d
 GH| |
 j o% t |  i ƒ |  i ƒ  |  i ƒ  n6 t i d d ƒ t |  i ƒ |  i ƒ  |  i ƒ  t Sd  S(   NRÜ   s   lbcode s	    boxcode t   Problemss   Click OK or not, I have no clueRó   i   RL   s	   barcode4 i   s	   retcode2 s   Warning s(   Dose may not match patient age or weighti    R   i   s
   runchecks s4   Dose of Medicine on box may not match dose intended (   R,   R\   t   getRb   R   R   R   R   R	   Rò   R_   R`   Ra   R<   RA   RG   RK   R   RZ   R   RC   R×   RÙ   (   R   t   b_code_at   box_codet   retcodeRô   t   pt_aget	   pt_weightt   pt_doset   barcode4t   retcode2t   lb_dose(    (    s   tkavsuppjul26.pyRÜ   Ÿ  sZ    
		



c         C   sC   d G|  i  i ƒ  } |  i  i ƒ  GH| d j o t |  i ƒ n d  S(   Ns   cb i   (   RÕ   Rö   R    RZ   (   R   t   cb_on(    (    s   tkavsuppjul26.pyR×   æ  s
    c         C   sP   d G|  i  i ƒ  } |  i  i ƒ  GH| d j o t |  i ƒ t |  i ƒ n d  S(   Ns   od i   (   RØ   Rö   R    RC   RZ   (   R   t   od_on(    (    s   tkavsuppjul26.pyRÙ   ñ  s    c         C   s9   d GH|  i  ƒ  o |  i ƒ  n t i d d ƒ d GHd  S(   Ns$   doing enter_barcodes, from OK buttons   Warning s•   There are some conflicting/incomplete data entered. Please change, then click 'Details OK' again, or click on 'Accept with Errors' if details corrects   pop up a barcode entry screen(   RÜ   Rà   R   R	   (   R   (    (    s   tkavsuppjul26.pyRÞ   þ  s
    c      	   C   s–  d } d GHd GH|  i  i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } t	 |  | | ƒ }	 d G|	 GH|	 t
 j o d GH|	 }
 t |  i ƒ n0 |	 t j o d GHt
 }	 n |	 }
 t |  i ƒ t | | |
 ƒ } | t
 j o  | d } t |  i ƒ | GHn | d } t | | | | | | | | ƒ t | | | | | | | | ƒ t |  ƒ d  S(	   NR4   s   checking codess   eventually...s   record_details retcode s   CheckBarcodes faileds%   retcode should not come back as True!s   age_weight_mismatch t   ageOK(   R[   R\   Rö   R_   R^   R`   Ra   R,   Rb   R   R   R   R   R   R   RK   RZ   R{   Rt   RX   (   R   RB   t   pt_idt   pt_dobt   pt_pcodeRû   Rü   R÷   Rø   Rù   RU   t
   checkedAge(    (    s   tkavsuppjul26.pyRà     s<    	

	
c         C   sm   d G|  i  i i ƒ  GHd G|  i i i ƒ  GHd G|  i i i ƒ  GHd G|  i i i ƒ  GHd G|  i i i ƒ  GHd  S(   Ns   id entry is now ---->s   dob entry is now ---->s    pcode entry is now ---->s   weight entry is now ---->s   dose is --->(   R[   R\   Rö   R_   R^   R`   Ra   (   R   t   event(    (    s   tkavsuppjul26.pyRÌ   6  s
    c         C   s  d } d GH|  i  i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } |  i i i ƒ  } |  i i i ƒ  }	 t	 |  | |	 ƒ }
 |
 t
 j o  d GH| d } t |  i ƒ n) |
 t j o | d } t |  i ƒ n t | | |
 ƒ } | t
 j o0 d GH| d } t i d d	 ƒ t |  i ƒ n3 | t j o  d
 GH| d } t |  i ƒ n d GHt | | | ƒ } | t
 j o	 d GHn d  S(   NR4   s   checking codess   now do something on GUIs   label wrong s   label UNknown s+   cheskedagelbl = false - do something usefuls   lbl_age_weight_mismatch R   s.   Label Dose does not appear to be right for ages   age okt   agelblOKs   I missed something s   checkedAgeBox is False(   R[   R\   Rö   R_   R^   R`   Ra   R,   Rb   R   R   R   R   R   R
   RK   R   R	   RZ   R   RH   (   R   R  RB   R  R  R  Rû   Rü   R÷   Rø   Rù   t   checkedAgelblt   checkedAgeX(    (    s   tkavsuppjul26.pyRÒ   >  s>    



(   t   __name__t
   __module__Rî   Râ   Rò   RÜ   R×   RÙ   RÞ   Rà   RÌ   RÒ   (    (    (    s   tkavsuppjul26.pyR¢   Š  s   	ö			G				*	s   AV supply application - alpha($   t   Tkintert   dbhashR   Rh   R   R}   R   R…   R   R   R3   R<   RG   RH   RK   RX   Rt   R{   R„   R‰   R–   R—   R˜   R   R+   R   R
   R    RY   R6   R¢   t   TkRð   t   titleR   t   mainloop(    (    (    s   tkavsuppjul26.pys   <module>    sF   
	D	/		L			h			(	.		#									ÿ ï	