<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>labmedit.net</title>
	<atom:link href="http://www.labmedit.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.labmedit.net</link>
	<description>Laboratory Medicine IT</description>
	<pubDate>Mon, 16 Jun 2008 14:09:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
		<!-- podcast_generator="podPress/8.8" -->
		<copyright>&#xA9; </copyright>
		<managingEditor>craig.webster@mac.com ()</managingEditor>
		<webMaster>craig.webster@mac.com()</webMaster>
		<category></category>
		<ttl>1440</ttl>
		<itunes:keywords></itunes:keywords>
		<itunes:subtitle></itunes:subtitle>
		<itunes:summary>Laboratory Medicine IT</itunes:summary>
		<itunes:author></itunes:author>
		<itunes:category text="Society &amp; Culture"/>
		<itunes:owner>
			<itunes:name></itunes:name>
			<itunes:email>craig.webster@mac.com</itunes:email>
		</itunes:owner>
		<itunes:block>No</itunes:block>
		<itunes:explicit>no</itunes:explicit>
		<itunes:image href="http://labmedit.net/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<image>
			<url>http://labmedit.net/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
			<title>labmedit.net</title>
			<link>http://www.labmedit.net</link>
			<width>144</width>
			<height>144</height>
		</image>
		<item>
		<title>Protected: Electrophoresis Presentations</title>
		<link>http://www.labmedit.net/2008/06/16/electrophoresis-presentations/</link>
		<comments>http://www.labmedit.net/2008/06/16/electrophoresis-presentations/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 13:52:33 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[Communication]]></category>

		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/?p=47</guid>
		<description><![CDATA[There is no excerpt because this is a protected post.]]></description>
			<content:encoded><![CDATA[<form action="http://www.labmedit.net/wp-pass.php" method="post">
<p>This post is password protected. To view it please enter your password below:</p>
<p><label for="pwbox-47">Password:<br />
<input name="post_password" id="pwbox-47" type="password" size="20" /></label><br />
<input type="submit" name="Submit" value="Submit" /></p></form>
]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/06/16/electrophoresis-presentations/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Performance Rules for Web Site Design</title>
		<link>http://www.labmedit.net/2008/04/04/performance-rules-for-web-site-design/</link>
		<comments>http://www.labmedit.net/2008/04/04/performance-rules-for-web-site-design/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 23:48:37 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[Webdesign]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/?p=46</guid>
		<description><![CDATA[Exceptional Performance
Yahoo!'s Exceptional Performance team evangelizes best practices for improving web performance. They conduct research, build tools, write articles and blogs, and speak at conferences. Their best practices center around the rules for high performance web sites.
Rules for High Performance Web Sites
The Exceptional Performance team has identified 13 rules for making web pages fast. Each [...]]]></description>
			<content:encoded><![CDATA[<h2><a href="http://developer.yahoo.com/performance/">Exceptional Performance</a></h2>
<p>Yahoo!'s Exceptional Performance team evangelizes best practices for improving web performance. They conduct research, build tools, write articles and blogs, and speak at conferences. Their best practices center around the rules for high performance web sites.</p>
<h2>Rules for High Performance Web Sites</h2>
<p>The Exceptional Performance team has identified 13 rules for making web pages fast. Each rule is discussed in the Developer Network Blog articles listed below.</p>
<p>1. Make Fewer HTTP Requests<br />
2. Use a Content Delivery Network<br />
3. Add an Expires Header<br />
4. Gzip Components<br />
5. Put CSS at the Top<br />
6. Move Scripts to the Bottom<br />
7. Avoid CSS Expressions<br />
8. Make JavaScript and CSS External<br />
9. Reduce DNS Lookups<br />
10. Minify JavaScript<br />
11. Avoid Redirects<br />
12. Remove Duplicate Scripts<br />
13. Configure ETags<br />
14. Make Ajax Cacheable</p>
]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/04/04/performance-rules-for-web-site-design/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Sub Version For Version Control In Web Development</title>
		<link>http://www.labmedit.net/2008/03/23/sub-version-for-version-control-in-web-development/</link>
		<comments>http://www.labmedit.net/2008/03/23/sub-version-for-version-control-in-web-development/#comments</comments>
		<pubDate>Sun, 23 Mar 2008 00:28:59 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[Webdesign]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/2008/03/23/sub-version-for-version-control-in-web-development/</guid>
		<description><![CDATA[This was insipired by the article "Subrversion for Designers" on think vitamin
Creation of SVN repository for project on server

1st I installed subversion on my server with  apt-get install subversion
2nd I created a directory tree for version control under /usr/local/svn
Each project is then contained within its own directory under this i.e. /usr/loca/svn/My_Project
I then issue the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.labmedit.net/wp-content/uploads/2008/03/dreamstime_3397900.png" title="Numbers" rel="lightbox"><img src="http://www.labmedit.net/wp-content/uploads/2008/03/dreamstime_3397900.png" style="margin: 5px; width: 200px; height: 200px" alt="Numbers" align="left" height="200" hspace="5" vspace="5" width="200" /></a>This was insipired by the article "<a href="http://www.thinkvitamin.com/features/design/subversion-for-designers">Subrversion for Designers</a>" on think vitamin</p>
<h2>Creation of SVN repository for project on server</h2>
<ol>
<li>1st I installed subversion on my server with  apt-get install subversion</li>
<li>2nd I created a directory tree for version control under /usr/local/svn</li>
<li>Each project is then contained within its own directory under this i.e. /usr/loca/svn/My_Project</li>
<li>I then issue the command  "svnadmin create /usr/local/svn/My_Project"</li>
<li>Then I import the web site I'm developing into svn with the following: svn import /location_of_files  file:///usr/local/svn/My Project/ -m "Initial import"</li>
<li>This creates the 1st version in the repository.</li>
<li>I then edit the svnserve conf file in the My_Project/conf directory to the following:</li>
</ol>
<pre>[general]anon-access = none

auth-access = write
password-db = userfile</pre>
<p>This allows access to the repository via password control.</p>
<p>A userfile is created with the user name=password format</p>
<p>i.e.</p>
<pre>[users]

UserName = Password</pre>
<h2>Accessing Repository</h2>
<p>As I do most of my development on a windows machine I installed <a href="http://tortoisesvn.net/">tortoise SVN</a> <a href="http://tortoisesvn.net/">http://tortoisesvn.net/</a> which is an SVN client that is implemented as a Windows shell extension, which makes it integrate seamlessly into the Windows explorer.</p>
<p>Create a Directory where you would like to store a working copy of the web site e.g. c:\web developement\some project</p>
<p>Right click on the directory and select the SVN checkout option on the context senstive menu.</p>
<p>Enter the location of the repository in the subsequent dialog box</p>
<p><a href="http://www.labmedit.net/wp-content/uploads/2008/03/2008-03-23_0013.png" title="SVN Dialog box" rel="lightbox"><img src="http://www.labmedit.net/wp-content/uploads/2008/03/2008-03-23_0013.png" alt="SVN Dialog box" /></a></p>
<p>This will checkout a version of the web site to the local machine. These file can then be edited using the appropiate editor. Once happy with the files the documents are the checked back in by right clicking the root directory and selecting the SVN comit option.</p>
<p>The typical work cycle looks like this:</p>
<p>Update your working copy<span></span></p>
<p><span><strong class="command">svn update</strong></span></p>
<p>Make changes<span></span></p>
<p><span><strong class="command">svn add</strong></span></p>
<p><span><strong class="command">svn delete</strong></span></p>
<p><span><strong class="command">svn copy</strong></span></p>
<p><span><strong class="command">svn move</strong></span></p>
<p>Examine your changes<span></span></p>
<p><span><strong class="command">svn status</strong></span></p>
<p><span><strong class="command">svn diff</strong></span></p>
<p>Possibly undo some changes<span></span></p>
<p><span><strong class="command">svn revert</strong></span></p>
<p>Resolve Conflicts (Merge Others' Changes)<span></span></p>
<p><span><strong class="command">svn update</strong></span></p>
<p><span><strong class="command">svn resolved</strong></span></p>
<p>Commit your changes<span></span></p>
<p><span><strong class="command">svn commit</strong></span></p>
<p><a href="http://svnbook.red-bean.com/en/1.4/index.html">Link to subversion manual</a></p>
<a href="javascript:toggleStartStop();PicLensLite.start({feedUrl:'http://www.labmedit.net/wp-content/plugins/wp-piclens/mrss.php?id=43'});">Start Slide Show with PicLens Lite <img src="http://www.labmedit.net/wp-content/plugins/wp-piclens/PicLensButton.png" alt="PicLens" width="16" height="12" border="0" align="top"></a>]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/03/23/sub-version-for-version-control-in-web-development/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RFID in baggage Handling</title>
		<link>http://www.labmedit.net/2008/03/14/rfid-in-baggage-handling/</link>
		<comments>http://www.labmedit.net/2008/03/14/rfid-in-baggage-handling/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 10:09:01 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[Amsterdam 2008]]></category>

		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/2008/03/14/rfid-in-baggage-handling/</guid>
		<description><![CDATA[Real world example of tagging.
Implemented in KLM baggage handling at Schipol.
Surprised at the error rates of reads in fast moving pieces. Accepted an error (IR) of 8% 
]]></description>
			<content:encoded><![CDATA[<p>Real world example of tagging.<br />
Implemented in KLM baggage handling at Schipol.<br />
Surprised at the error rates of reads in fast moving pieces. Accepted an error (IR) of 8% </p>
]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/03/14/rfid-in-baggage-handling/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Lean processing of samples</title>
		<link>http://www.labmedit.net/2008/03/14/lean-processing-of-samples/</link>
		<comments>http://www.labmedit.net/2008/03/14/lean-processing-of-samples/#comments</comments>
		<pubDate>Fri, 14 Mar 2008 10:07:39 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[Amsterdam 2008]]></category>

		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/2008/03/14/lean-processing-of-samples/</guid>
		<description><![CDATA[Should be aiming towards single piece flow instead of batch flow. Batch flow introduces "waste" into the process by its very nature. Single piece flow will always outperform batch flow analysis. All optimisation should be towards improving the flow of samples through the laboratory.
Lean principle is to reduce waste as waste raises costs. Simple things [...]]]></description>
			<content:encoded><![CDATA[<p>Should be aiming towards single piece flow instead of batch flow. Batch flow introduces "waste" into the process by its very nature. Single piece flow will always outperform batch flow analysis. All optimisation should be towards improving the flow of samples through the laboratory.</p>
<p>Lean principle is to reduce waste as waste raises costs. Simple things like tidying up the laboratory improves working practices and reduces waste.</p>
<h2>Value stream mapping</h2>
<p>A process of mapping the flows and movements in the laboratory to identify areas of waste. Simple message is not to try and do everything in one go, leave time for changes to take place and bed in. i.e. split into phases.</p>
<p>Identify bottlenecks 1st and then move on:</p>
<p>e.g. </p>
<ul>
Reception<br />
then analysis<br />
then courier</ul>
<p>Cant impose any changes on staff need to get them to buy into this. Have a small group feeding into a "lean executive" who can make decisions.</p>
<h2>Activity of product</h2>
<p>(need to get Rachel's data on this and re-audit sample flows within the laboratory)</p>
<p>Map of what sample is doing in time and in space. ? Film the processes to also map what staff are doing. Stress filming the process and not the operator.</p>
<p>Structural layouts drive waste. Don't waste talent, don't install automation before lean principles have been followed otherwise you are automating an inefficient process. Return on investment is typically 15-18 months.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/03/14/lean-processing-of-samples/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Updated logic</title>
		<link>http://www.labmedit.net/2008/03/13/updated-logic/</link>
		<comments>http://www.labmedit.net/2008/03/13/updated-logic/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 08:49:24 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[Databases]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/2008/03/13/updated-logic/</guid>
		<description><![CDATA[Add data to main activity table
This triggers:
1. Query to find earliest date in table (start_date)
2. Find latest date in table (end_date)
Loop though set table using Setcode
From setcode decide if daily or weekly
query table and count number of samples received in a day.
             If [...]]]></description>
			<content:encoded><![CDATA[<p>Add data to main activity table</p>
<p>This triggers:</p>
<p>1. Query to find earliest date in table (start_date)<br />
2. Find latest date in table (end_date)</p>
<p>Loop though set table using Setcode</p>
<p>From setcode decide if daily or weekly</p>
<p>query table and count number of samples received in a day.<br />
             If > 20 then do daily stats</p>
<pre name="code" class="sql">SELECT Min(s.`DateReceived`) INTO Start_Date FROM setinfo s
ORDER BY s.`DateReceived`;

SELECT Max(s.`DateReceived`) INTO End_Date FROM setinfo s
ORDER BY s.`DateReceived`;</pre>
<p>             ELSE<br />
                   do weekly stats</p>
<p>calc_all_stats MySQL stored procedure</p>
<pre name="code" class="sql">
DELIMITER $$

DROP PROCEDURE IF EXISTS `activity`.`calc_stats_all_tests_ver2` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `calc_stats_all_tests_ver2`()
BEGIN

  declare done INT DEFAULT 0;
  declare c_SetName VARCHAR(50);
  declare Start_Date Date;
  declare End_Date Date;
  declare ave_per_day DOUBLE;

DECLARE cur1 CURSOR FOR

SELECT s.`SetCode` FROM setparameters s;

DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;

DROP TABLE IF EXISTS `activity`.`daily_stats`;
CREATE TABLE  `activity`.`daily_stats` (
  `SetName` varchar(50) NOT NULL,
  `HrsIn` double NOT NULL,
  `DateReceived` datetime NOT NULL,
  `AVGTurnaround` double NOT NULL,
  `NumberOfRequests` INT NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

DROP TABLE IF EXISTS `activity`.`weekly_stats`;
  CREATE TABLE  `activity`.`weekly_stats` (
    `SetName` varchar(50) NOT NULL,
    `HrsIn` double NOT NULL,
    `WeekDate` datetime NOT NULL,
    `AVGTurnaround` double NOT NULL,
    `NumberOfRequests` INT NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

SELECT Min(s.`DateReceived`) INTO Start_Date FROM setinfo s
ORDER BY s.`DateReceived`;

SELECT Max(s.`DateReceived`) INTO End_Date FROM setinfo s
ORDER BY s.`DateReceived`;

  open cur1;

  repeat
        fetch cur1 into c_SetName;
          if not done then

            SELECT AVG (counts) INTO ave_per_day from(
              SELECT s.`Set`, count(*) as counts FROM setinfo s
              WHERE s.`Set` = c_SetName
              GROUP BY s.`DateReceived`) as f;

            if ave_per_day > 20 then
              CALL calcstats(c_SetName, Start_Date, End_Date);
            else
              CALL calculate_weekly_medians_by_date_range(Start_Date, End_Date, c_SetName);
            end if;

          end if;
  until done end repeat;

close cur1;

END $$

DELIMITER ;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/03/13/updated-logic/feed/</wfw:commentRss>
		</item>
		<item>
		<title>RFID Tags and Blood Transfusion Chain</title>
		<link>http://www.labmedit.net/2008/03/13/rfid-tags-and-blood-transfusion-chain/</link>
		<comments>http://www.labmedit.net/2008/03/13/rfid-tags-and-blood-transfusion-chain/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 08:49:04 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[Amsterdam 2008]]></category>

		<category><![CDATA[Conferences]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/2008/03/13/rfid-tags-and-blood-transfusion-chain/</guid>
		<description><![CDATA[RFID tags themselves are cheap. But infrastructure required for reading is expensive. ? any great advantages over traditional barcodes. Placement of tags on patients is an issue especially with large tags (medics remove them). Questions about the improvement in the management of the blood transfusion change.
Could be useful in tracking movement of samples through lab [...]]]></description>
			<content:encoded><![CDATA[<p>RFID tags themselves are cheap. But infrastructure required for reading is expensive. ? any great advantages over traditional barcodes. Placement of tags on patients is an issue especially with large tags (medics remove them). Questions about the improvement in the management of the blood transfusion change.</p>
<p>Could be useful in tracking movement of samples through lab in initial modeling phase ? would need to do it all the time maybe just one or two for TAT monitoring etc.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/03/13/rfid-tags-and-blood-transfusion-chain/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Two Systems?</title>
		<link>http://www.labmedit.net/2008/03/02/two-systems/</link>
		<comments>http://www.labmedit.net/2008/03/02/two-systems/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 19:18:17 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[Databases]]></category>

		<category><![CDATA[Featured]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/2008/03/02/two-systems/</guid>
		<description><![CDATA[? would need two systems for distribution of data.
1. Using Excel to chart TATs for Monthly QA meetings. Tables containing daily and weekly TATs are generated and then graphs built from these tables.
2. Web display of data could do as above but on the fly. However as data is unlikely to change on a regular [...]]]></description>
			<content:encoded><![CDATA[<p>? would need two systems for distribution of data.</p>
<p>1. Using Excel to chart TATs for Monthly QA meetings. Tables containing daily and weekly TATs are generated and then graphs built from these tables.</p>
<p>2. Web display of data could do as above but on the fly. However as data is unlikely to change on a regular basis (monthly) then tables could be generated as per 1. New data could trigger generation of new tables of statistical data.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/03/02/two-systems/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Calculate Weekly Medians Between Two Dates using Setcode and a Start Date and an End Date</title>
		<link>http://www.labmedit.net/2008/03/02/calculate-weekly-medians-between-two-dates-using-setcode-and-a-start-date-and-an-end-date/</link>
		<comments>http://www.labmedit.net/2008/03/02/calculate-weekly-medians-between-two-dates-using-setcode-and-a-start-date-and-an-end-date/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 18:37:17 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[Databases]]></category>

		<category><![CDATA[Featured]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/2008/03/02/calculate-weekly-medians-between-two-dates-using-setcode-and-a-start-date-and-an-end-date/</guid>
		<description><![CDATA[DELIMITER $$

DROP PROCEDURE IF EXISTS `activity`.`calculate_weekly_medians_by_date_range` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `calculate_weekly_medians_by_date_range`(IN Start_Date DATE, IN End_date DATE, IN C_SetName VARCHAR(50))
BEGIN

  DECLARE Count_Date DATE;

  DROP TABLE IF EXISTS `activity`.`weekly_stats`;

  CREATE TABLE  `activity`.`weekly_stats` (
    `SetName` varchar(50) NOT NULL,
    `HrsIn` double NOT NULL,
    `WeekDate` datetime NOT NULL,
 [...]]]></description>
			<content:encoded><![CDATA[<pre name="code" class="sql">DELIMITER $$

DROP PROCEDURE IF EXISTS `activity`.`calculate_weekly_medians_by_date_range` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `calculate_weekly_medians_by_date_range`(IN Start_Date DATE, IN End_date DATE, IN C_SetName VARCHAR(50))
BEGIN

  DECLARE Count_Date DATE;

  DROP TABLE IF EXISTS `activity`.`weekly_stats`;

  CREATE TABLE  `activity`.`weekly_stats` (
    `SetName` varchar(50) NOT NULL,
    `HrsIn` double NOT NULL,
    `WeekDate` datetime NOT NULL,
    `AVGTurnaround` double NOT NULL,
    `NumberOfRequests` INT NOT NULL
  ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

  SET Count_Date=Start_Date;

  WHILE Count_Date < End_Date DO
    CALL calc_weekly_medians(c_SetName, Count_Date);
    SET Count_Date = DATE_ADD(Count_Date,INTERVAL +1 WEEK);
  END WHILE;

END $$

DELIMITER ;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/03/02/calculate-weekly-medians-between-two-dates-using-setcode-and-a-start-date-and-an-end-date/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Calculate Weekly Medians (1 week) using Setcode and a Start Date</title>
		<link>http://www.labmedit.net/2008/03/02/calculate-weekly-medians-1-week-using-setcode-and-a-start-date/</link>
		<comments>http://www.labmedit.net/2008/03/02/calculate-weekly-medians-1-week-using-setcode-and-a-start-date/#comments</comments>
		<pubDate>Sun, 02 Mar 2008 18:36:20 +0000</pubDate>
		<dc:creator>cwebster</dc:creator>
		
		<category><![CDATA[Databases]]></category>

		<category><![CDATA[Featured]]></category>

		<guid isPermaLink="false">http://www.labmedit.net/2008/03/02/calculate-weekly-medians-1-week-using-setcode-and-a-start-date/</guid>
		<description><![CDATA[DELIMITER $$

DROP PROCEDURE IF EXISTS `activity`.`calc_weekly_medians` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `calc_weekly_medians`(IN l_SETNAME VARCHAR(50), IN Start_Date Date)
BEGIN

  declare done INT DEFAULT 0;
  declare c_SetName VARCHAR(50);
  declare c_HrsIn DOUBLE;
  declare c_DateReceived DATE;
  declare c_Count INT;
  declare c_AVG DOUBLE;

DECLARE cur1 CURSOR FOR

    SELECT s.`Set`, s.`HrsIn`, s.`DateReceived`, count(*),avg(HrsIn) FROM setinfo s
 [...]]]></description>
			<content:encoded><![CDATA[<pre name="code" class="sql">DELIMITER $$

DROP PROCEDURE IF EXISTS `activity`.`calc_weekly_medians` $$
CREATE DEFINER=`root`@`localhost` PROCEDURE `calc_weekly_medians`(IN l_SETNAME VARCHAR(50), IN Start_Date Date)
BEGIN

  declare done INT DEFAULT 0;
  declare c_SetName VARCHAR(50);
  declare c_HrsIn DOUBLE;
  declare c_DateReceived DATE;
  declare c_Count INT;
  declare c_AVG DOUBLE;

DECLARE cur1 CURSOR FOR

    SELECT s.`Set`, s.`HrsIn`, s.`DateReceived`, count(*),avg(HrsIn) FROM setinfo s
    WHERE s.`DateReceived` BETWEEN Start_Date and DATE_ADD(Start_Date,INTERVAL +1 WEEK)
    AND s.`Set`=l_SETNAME
    GROUP BY s.`DateReceived`;

  DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = 1;

  open cur1;

  repeat
        fetch cur1 into c_SetName, c_HrsIn, c_DateReceived,c_Count,c_AVG;
        if not done then
          insert into activity.weekly_stats VALUES (c_SetName, c_HrsIn, c_DateReceived,c_AVG,c_Count);
        end if;
  until done end repeat;

close cur1;

END $$

DELIMITER ;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.labmedit.net/2008/03/02/calculate-weekly-medians-1-week-using-setcode-and-a-start-date/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
