Index: EDIS/trunk/java/tracking-ear/pom.xml
===================================================================
--- EDIS/trunk/java/tracking-ear/pom.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-ear/pom.xml	(revision 1227)
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>gov.va.med.edp</groupId>
+        <artifactId>edis-tracking-parent</artifactId>
+        <version>1.0-T29-SNAPSHOT</version>
+        <relativePath>../tracking-parent</relativePath>
+    </parent>
+    <groupId>gov.va.med.edp</groupId>
+    <artifactId>edis-tracking-application</artifactId>
+    <packaging>ear</packaging>
+    <name>EDIS Tracking Application Bundle</name>
+    <version>1.0-T29-SNAPSHOT</version>
+    <description>Emergency Department Integration Software - Tracking Application Bundle</description>
+    <dependencies>
+        <dependency>
+            <groupId>gov.va.med.edp</groupId>
+            <artifactId>edis-tracking-server-main</artifactId>
+            <version>${project.version}</version>
+            <type>war</type>
+        </dependency>
+        <dependency>
+            <groupId>gov.va.med.edp</groupId>
+            <artifactId>edis-tracking-server-bigboard</artifactId>
+            <version>${project.version}</version>
+            <type>war</type>
+        </dependency>
+        <dependency>
+            <groupId>gov.va.med.edp</groupId>
+            <artifactId>edis-tracking-help</artifactId>
+            <version>${project.version}</version>
+            <type>war</type>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-ear-plugin</artifactId>
+                <configuration>
+                    <!-- <unpackTypes>war</unpackTypes> -->
+                    <modules>
+                        <webModule>
+                            <groupId>gov.va.med.edp</groupId>
+                            <artifactId>edis-tracking-server-main</artifactId>
+                            <contextRoot>${edis.tracking.trackingContextRoot}</contextRoot>
+                        </webModule>
+                        <webModule>
+                            <groupId>gov.va.med.edp</groupId>
+                            <artifactId>edis-tracking-server-bigboard</artifactId>
+                            <contextRoot>${edis.tracking.boardContextRoot}</contextRoot>
+                        </webModule>
+                        <webModule>
+                            <groupId>gov.va.med.edp</groupId>
+                            <artifactId>edis-tracking-help</artifactId>
+                            <contextRoot>${edis.tracking.helpContextRoot}</contextRoot>
+                        </webModule>
+                    </modules>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>
Index: EDIS/trunk/java/tracking-ear/src/main/application/META-INF/application.xml
===================================================================
--- EDIS/trunk/java/tracking-ear/src/main/application/META-INF/application.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-ear/src/main/application/META-INF/application.xml	(revision 1227)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC
+	"-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN"
+	"http://java.sun.com/dtd/application_1_3.dtd">
+<application>
+  <display-name>edis-tracking-application</display-name>
+  <description>Emergency Department Integration Software - Tracking Application Bundle</description>
+  <module>
+    <web>
+      <web-uri>main.war</web-uri>
+      <context-root>/main</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>bigboard.war</web-uri>
+      <context-root>/bigboard</context-root>
+    </web>
+  </module>
+  <module>
+    <web>
+      <web-uri>help.war</web-uri>
+      <context-root>/help</context-root>
+    </web>
+  </module>
+</application>
Index: EDIS/trunk/java/tracking-parent/TrackingClientUIProjectSet.psf
===================================================================
--- EDIS/trunk/java/tracking-parent/TrackingClientUIProjectSet.psf	(revision 1227)
+++ EDIS/trunk/java/tracking-parent/TrackingClientUIProjectSet.psf	(revision 1227)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="com.perforce.team.core.PerforceTeamProvider">
+<project reference="PORT=vhaislprf2.vha.med.va.gov:1666;NAME=tracking-parent;PATH=//reeng/main/ed/tracking-parent"/>
+<project reference="PORT=vhaislprf2.vha.med.va.gov:1666;NAME=tracking-ui-core;PATH=//reeng/main/ed/tracking-ui-core"/>
+<project reference="PORT=vhaislprf2.vha.med.va.gov:1666;NAME=tracking-ui-client;PATH=//reeng/main/ed/tracking-ui-client"/>
+<project reference="PORT=vhaislprf2.vha.med.va.gov:1666;NAME=tracking-ui-bigboard;PATH=//reeng/main/ed/tracking-ui-bigboard"/>
+</provider>
+</psf>
Index: EDIS/trunk/java/tracking-parent/TrackingSSLProjectSet.psf
===================================================================
--- EDIS/trunk/java/tracking-parent/TrackingSSLProjectSet.psf	(revision 1227)
+++ EDIS/trunk/java/tracking-parent/TrackingSSLProjectSet.psf	(revision 1227)
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="com.perforce.team.core.PerforceTeamProvider">
+<project reference="PORT=vhaislprf2.vha.med.va.gov:1666;NAME=tracking-weblogic-ssl;PATH=//reeng/main/ed/tracking-weblogic-ssl"/>
+</provider>
+</psf>
Index: EDIS/trunk/java/tracking-parent/TrackingServerProjectSet.psf
===================================================================
--- EDIS/trunk/java/tracking-parent/TrackingServerProjectSet.psf	(revision 1227)
+++ EDIS/trunk/java/tracking-parent/TrackingServerProjectSet.psf	(revision 1227)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<psf version="2.0">
+<provider id="com.perforce.team.core.PerforceTeamProvider">
+<project reference="PORT=vhaislprf2.vha.med.va.gov:1666;NAME=tracking-parent;PATH=//reeng/main/ed/tracking-parent"/>
+<project reference="PORT=vhaislprf2.vha.med.va.gov:1666;NAME=tracking-server-core;PATH=//reeng/main/ed/tracking-server-core"/>
+<project reference="PORT=vhaislprf2.vha.med.va.gov:1666;NAME=tracking-server-proxy;PATH=//reeng/main/ed/tracking-server-proxy"/>
+<project reference="PORT=vhaislprf2.vha.med.va.gov:1666;NAME=tracking-server-bigboard;PATH=//reeng/main/ed/tracking-server-bigboard"/>
+</provider>
+</psf>
Index: EDIS/trunk/java/tracking-parent/mvn clean package.launch
===================================================================
--- EDIS/trunk/java/tracking-parent/mvn clean package.launch	(revision 1227)
+++ EDIS/trunk/java/tracking-parent/mvn clean package.launch	(revision 1227)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="MAVEN_HOME" value="/Application/Development/maven-2.0.8"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${mvn}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="clean package"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/>
+</launchConfiguration>
Index: EDIS/trunk/java/tracking-parent/mvn clean.launch
===================================================================
--- EDIS/trunk/java/tracking-parent/mvn clean.launch	(revision 1227)
+++ EDIS/trunk/java/tracking-parent/mvn clean.launch	(revision 1227)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.ui.externaltools.ProgramLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<mapAttribute key="org.eclipse.debug.core.environmentVariables">
+<mapEntry key="MAVEN_HOME" value="/Application/Development/maven-2.0.8"/>
+</mapAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${mvn}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="clean"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${project_loc}"/>
+</launchConfiguration>
Index: EDIS/trunk/java/tracking-parent/pom.xml
===================================================================
--- EDIS/trunk/java/tracking-parent/pom.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-parent/pom.xml	(revision 1227)
@@ -0,0 +1,283 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<groupId>gov.va.med.edp</groupId>
+	<artifactId>edis-tracking-parent</artifactId>
+	<packaging>pom</packaging>
+	<name>EDIS Tracking Application</name>
+	<description>Emergency Department Integration Software - Tracking Application</description>
+	<version>1.0-T29-SNAPSHOT</version>
+	<modules>
+		<module>../tracking-ui-core</module>
+		<module>../tracking-ui-main</module>
+		<module>../tracking-ui-bigboard</module>
+		<module>../tracking-server-core</module>
+		<module>../tracking-server-main</module>
+		<module>../tracking-server-bigboard</module>
+		<module>../tracking-help</module>
+		<module>../tracking-weblogic-ssl</module>
+		<module>../tracking-ear</module>
+	</modules>
+	<organization>
+		<name>Department of Veterans Affairs</name>
+		<url>http://www.va.gov/</url>
+	</organization>
+	<prerequisites>
+		<maven>2.0.8</maven>
+	</prerequisites>
+	<licenses>
+		<license>
+			<name>Public Domain</name>
+			<url>http://creativecommons.org/licenses/publicdomain/</url>
+		</license>
+	</licenses>
+	<scm>
+		<connection>scm:perforce://reeng/main/ed/tracking-parent</connection>
+		<developerConnection>scm:perforce://reeng/main/ed/tracking-parent</developerConnection>
+	</scm>
+	<!--issueManagement>
+			<system></system>
+			<url></url>
+		</issueManagement-->
+	<!-- <ciManagement>
+		   <system>luntbuild</system>
+		   <url>http://vhaislcfgm2.vha.med.va.gov:8080/luntbuild</url>
+	   </ciManagement> -->
+	<developers>
+		<developer>
+			<id>vhaislmeldruk</id>
+			<name>Kevin Meldrum</name>
+			<email>kevin.meldrum@va.gov</email>
+			<organization>Department of Veterans Affairs</organization>
+			<timezone>-7</timezone>
+		</developer>
+		<developer>
+			<id>vhaislgearys</id>
+			<name>Sandi Geary</name>
+			<email>sandra.geary@va.gov</email>
+			<organization>SAIC</organization>
+			<timezone>-7</timezone>
+		</developer>
+		<developer>
+			<name>Melanie Buechler</name>
+			<email>melanie.buechler@va.gov</email>
+			<organization>Department of Veterans Affairs</organization>
+			<timezone>-6</timezone>
+		</developer>
+		<developer>
+			<id>vhaislblazs</id>
+			<name>Solomon Blaz</name>
+			<email>solomon.blaz@va.gov</email>
+			<organization>SAIC</organization>
+			<timezone>-7</timezone>
+		</developer>
+		<developer>
+			<id>vhaisldhars</id>
+			<name>Sanjay Dhar</name>
+			<email>sanjay.dhar@va.gov</email>
+			<organization>SAIC</organization>
+			<timezone>-7</timezone>
+		</developer>
+	</developers>
+	<contributors>
+		<contributor>
+			<name>Gary Tyndall</name>
+			<email>gary.tyndall@va.gov</email>
+			<organization>Department of Veterans Affairs</organization>
+			<timezone>-5</timezone>
+		</contributor>
+		<contributor>
+			<name>Robert Stults</name>
+			<email>robert.stults2@va.gov</email>
+			<organization>Shoulders Corp</organization>
+			<organizationUrl>http://www.shoulderscorp.com/</organizationUrl>
+			<timezone>-5</timezone>
+		</contributor>
+		<contributor>
+			<name>Cheryl Walton</name>
+			<email>cheryl.walton2@va.gov</email>
+			<organization>SAIC</organization>
+			<timezone>-7</timezone>
+		</contributor>
+	</contributors>
+	<repositories>
+		<repository>
+			<id>central</id>
+			<url>http://repo1.maven.org/maven2</url>
+		</repository>
+		<repository>
+			<id>bob-repository</id>
+			<name>Bob's Maven Repository</name>
+			<url>http://vhaislcfgm2.vha.med.va.gov/maven-repository</url>
+		</repository>
+		<repository>
+			<id>Codehaus Snapshots</id>
+			<url>http://snapshots.repository.codehaus.org/</url>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+			<releases>
+				<enabled>false</enabled>
+			</releases>
+		</repository>
+		<repository>
+			<id>flex-mojos-repository</id>
+			<url>http://repository.sonatype.org/content/groups/flexgroup/</url>
+		</repository>		
+	</repositories>
+	<pluginRepositories>
+		<pluginRepository>
+			<id>Codehaus Snapshots</id>
+			<url>http://snapshots.repository.codehaus.org/</url>
+			<snapshots>
+				<enabled>true</enabled>
+			</snapshots>
+			<releases>
+				<enabled>false</enabled>
+			</releases>
+		</pluginRepository>
+		<pluginRepository>
+			<id>flex-mojos-repository</id>
+			<url>http://repository.sonatype.org/content/groups/flexgroup/</url>
+			<releases>
+				<enabled>true</enabled>
+			</releases>
+			<snapshots>
+				<enabled>false</enabled>
+			</snapshots>
+		</pluginRepository>
+	</pluginRepositories>
+	<distributionManagement>
+		<repository>
+			<id>bob-repository</id>
+			<name>Bob's Maven Repository</name>
+			<url>scp://vhaislcfgm2.vha.med.va.gov:/var/www/html/maven-repository</url>
+		</repository>
+	</distributionManagement>
+	<build>
+		<pluginManagement>
+			<plugins>
+				<plugin>
+					<artifactId>maven-compiler-plugin</artifactId>
+					<configuration>
+						<source>1.4</source>
+						<target>1.4</target>
+					</configuration>
+				</plugin>
+				<plugin>
+					<artifactId>maven-eclipse-plugin</artifactId>
+					<configuration>
+						<downloadSources>true</downloadSources>
+						<downloadJavadocs>true</downloadJavadocs>
+					</configuration>
+				</plugin>
+				<plugin>
+					<artifactId>maven-idea-plugin</artifactId>
+					<configuration>
+						<downloadSources>true</downloadSources>
+						<downloadJavadocs>true</downloadJavadocs>
+						<dependenciesAsLibraries>true</dependenciesAsLibraries>
+						<useFullNames>false</useFullNames>
+					</configuration>
+				</plugin>
+				<plugin>
+					<groupId>info.flex-mojos</groupId>
+					<artifactId>flex-compiler-mojo</artifactId>
+					<version>${flex.mojos.version}</version>
+					<extensions>true</extensions>
+					<configuration>
+						<accessible>${flex.compiler.accessible}</accessible>
+						<headlessServer>${flex.compiler.headless-server}</headlessServer>
+						<locales>
+							<locale>en_US</locale>
+						</locales>
+						<debug>${flex.compiler.debug}</debug>
+					</configuration>
+					<dependencies>
+						<dependency>
+							<groupId>com.adobe.flex</groupId>
+							<artifactId>compiler</artifactId>
+							<version>${flex.version}</version>
+							<type>pom</type>
+						</dependency>
+					</dependencies>
+				</plugin>
+			</plugins>
+		</pluginManagement>
+	</build>
+	<reporting>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-project-info-reports-plugin</artifactId>
+				<reportSets>
+					<reportSet>
+						<reports>
+							<report>index</report>
+							<report>summary</report>
+							<report>dependency-convergence</report>
+							<report>project-team</report>
+							<report>cim</report>
+							<report>scm</report>
+							<report>license</report>
+						</reports>
+					</reportSet>
+				</reportSets>
+			</plugin>
+			<plugin>
+				<artifactId>maven-changes-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-checkstyle-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<groupId>org.codehaus.mojo</groupId>
+				<artifactId>cobertura-maven-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-javadoc-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-jxr-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-pmd-plugin</artifactId>
+			</plugin>
+			<plugin>
+				<artifactId>maven-surefire-report-plugin</artifactId>
+			</plugin>
+		</plugins>
+	</reporting>
+	<properties>
+		<!-- versions of dependencies -->
+		<spring.version>2.0.8</spring.version>
+		<vha.stddata.version>15.0</vha.stddata.version>
+		<spring.security.version>2.0.3</spring.security.version>
+		<slf4j.version>1.5.2</slf4j.version>
+		<easymock.version>2.4</easymock.version>
+		
+		<flex.version>3.1.0.2710</flex.version>
+		<flexunit.version>0.85</flexunit.version>
+
+		<!-- flex compiler settings -->
+		<flex.mojos.version>2.0.3</flex.mojos.version>
+		<flex.compiler.accessible>true</flex.compiler.accessible>
+		<flex.compiler.headless-server>true</flex.compiler.headless-server>
+		<flex.compiler.debug>true</flex.compiler.debug>
+		<skipTests>${java.awt.headless}</skipTests>
+
+		<!-- EDIS project settings -->
+		<edis.tracking.trackingContextRoot>/main</edis.tracking.trackingContextRoot>
+		<edis.tracking.boardContextRoot>/bigboard</edis.tracking.boardContextRoot>
+		<edis.tracking.helpContextRoot>/help</edis.tracking.helpContextRoot>
+	</properties>
+	<profiles>
+		<profile>
+			<id>dev</id>
+			<properties>
+				<flex.compiler.debug>true</flex.compiler.debug>
+			</properties>
+		</profile>
+	</profiles>
+</project>
Index: EDIS/trunk/java/tracking-server-bigboard/pom.xml
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/pom.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/pom.xml	(revision 1227)
@@ -0,0 +1,211 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>gov.va.med.edp</groupId>
+		<artifactId>edis-tracking-parent</artifactId>
+		<version>1.0-T29-SNAPSHOT</version>
+		<relativePath>../tracking-parent</relativePath>
+	</parent>
+	<groupId>gov.va.med.edp</groupId>
+	<artifactId>edis-tracking-server-bigboard</artifactId>
+	<packaging>war</packaging>
+	<name>EDIS Tracking Server Big Board</name>
+	<version>1.0-T29-SNAPSHOT</version>
+	<description>Emergency Department Integration Software - Tracking Server Big Board</description>
+	<dependencies>
+		<dependency>
+			<groupId>gov.va.med.edp</groupId>
+			<artifactId>edis-tracking-ui-bigboard</artifactId>
+			<version>${project.version}</version>
+			<type>swf</type>
+			<scope>runtime</scope>
+		</dependency>
+		<dependency>
+			<groupId>gov.va.med.edp</groupId>
+			<artifactId>edis-tracking-server-core</artifactId>
+			<version>${project.version}</version>
+		</dependency>
+		<dependency>
+			<groupId>javax.servlet</groupId>
+			<artifactId>jstl</artifactId>
+			<version>1.0.6</version>
+		</dependency>
+		<dependency>
+			<groupId>taglibs</groupId>
+			<artifactId>standard</artifactId>
+			<version>1.0.6</version>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>3.8.1</version>
+			<scope>test</scope>
+		</dependency>
+	</dependencies>
+	<build>
+		<finalName>${edis.tracking.boardContextRoot}</finalName>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<filtering>true</filtering>
+			</resource>
+		</resources>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-war-plugin</artifactId>
+				<configuration>
+					<webResources>
+						<resource>
+							<directory>src/main/webapp/WEB-INF</directory>
+							<includes>
+								<include>weblogic.xml</include>
+							</includes>
+							<filtering>true</filtering>
+							<targetPath>WEB-INF</targetPath>
+						</resource>
+						<resource>
+							<directory>${edis.tracking.build.swf.directory}</directory>
+							<targetPath>/</targetPath>
+							<filtering>false</filtering>
+							<includes>
+								<include>*.swf</include>
+							</includes>
+						</resource>
+					</webResources>
+				</configuration>
+			</plugin>
+			<plugin>
+				<artifactId>maven-antrun-plugin</artifactId>
+				<executions>
+					<execution>
+						<phase>process-resources</phase>
+						<configuration>
+							<tasks>
+								<tstamp>
+									<format property="timestamp" pattern="yyyy/MM/dd HH:mm:ss z"/>
+								</tstamp>
+								<replaceregexp byline="true">
+									<regexp pattern="app.buildtime=BUILD_TIME_PLACEHOLDER"/>
+									<substitution expression="app.buildtime=${timestamp}"/>
+									<fileset dir="target" includes="**/*.properties"/>
+								</replaceregexp>
+							</tasks>
+						</configuration>
+						<goals>
+							<goal>run</goal>
+						</goals>
+					</execution>
+				</executions>
+				<dependencies>
+					<dependency>
+						<groupId>ant</groupId>
+						<artifactId>ant-nodeps</artifactId>
+						<version>1.6.5</version>
+					</dependency>
+				</dependencies>
+			</plugin>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-dependency-plugin</artifactId>
+				<version>2.0</version>
+				<executions>
+					<execution>
+						<id>include-latest-client-version</id>
+						<phase>generate-resources</phase>
+						<goals>
+							<goal>copy-dependencies</goal>
+						</goals>
+						<configuration>
+							<includeTypes>swf</includeTypes>
+							<outputDirectory>${edis.tracking.build.swf.directory}</outputDirectory>
+							<overWriteSnapshots>true</overWriteSnapshots>
+							<excludeTransitive>true</excludeTransitive>
+						</configuration>
+					</execution>
+					<execution>
+						<id>include-backwards-compatible-client-versions</id>
+						<phase>generate-resources</phase>
+						<goals>
+							<goal>copy</goal>
+						</goals>
+						<configuration>
+							<artifactItems>
+ 								<artifactItem>
+                                    <groupId>${project.groupId}</groupId>
+                                    <artifactId>edis-tracking-ui-bigboard</artifactId>
+                                    <version>1.0-T28</version>
+                                    <type>swf</type>
+                                </artifactItem>  
+							</artifactItems>
+							<outputDirectory>${edis.tracking.build.swf.directory}</outputDirectory>
+							<overWriteSnapshots>true</overWriteSnapshots>
+						</configuration>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+	<profiles>
+	<profile>
+		<id>dev</id>
+		<build>
+			<plugins>
+				<plugin>
+					<groupId>org.apache.maven.plugins</groupId>
+					<artifactId>maven-war-plugin</artifactId>
+					<configuration>
+						<webResources>
+							<resource>
+								<directory>src/main/webapp-dev/WEB-INF</directory>
+								<includes>
+									<include>web.xml</include>
+								</includes>
+								<targetPath>WEB-INF</targetPath>
+							</resource>
+							<resource>
+								<directory>src/main/webapp/WEB-INF</directory>
+								<excludes>
+									<exclude>web.xml</exclude>
+								</excludes>
+							</resource>
+                            <resource>
+								<directory>src/main/webapp-dev</directory>
+								<includes>
+									<include>BigBoard.jsp</include>
+								</includes>
+							</resource>
+							<resource>
+								<directory>src/main/webapp</directory>
+								<excludes>
+									<exclude>BigBoard.jsp</exclude>
+								</excludes>
+							</resource>
+                            <resource>
+								<directory>src/main/webapp/WEB-INF</directory>
+								<includes>
+									<include>weblogic.xml</include>
+								</includes>
+								<filtering>true</filtering>
+								<targetPath>WEB-INF</targetPath>
+							</resource>
+							<resource>
+								<directory>${edis.tracking.build.swf.directory}</directory>
+								<targetPath>/</targetPath>
+								<filtering>false</filtering>
+								<includes>
+									<include>*.swf</include>
+								</includes>
+							</resource>
+						</webResources>
+					</configuration>
+				</plugin>
+			</plugins>
+		</build>
+	</profile>
+	</profiles>
+	<properties>
+		<edis.tracking.build.swf.directory>${project.build.directory}/swf</edis.tracking.build.swf.directory>
+	</properties>
+</project>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/resources/applicationContext-dao.xml
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/resources/applicationContext-dao.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/resources/applicationContext-dao.xml	(revision 1227)
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+    <bean id="bigBoardDao" class="gov.va.med.edp.dao.rpc.VistaLinkBigBoardDao"/>
+    <bean id="serverPackageVersionDao" class="gov.va.med.edp.dao.rpc.VistaLinkServerPackageVersionDao"/>
+    <bean id="siteCodeDao" class="gov.va.med.edp.dao.jdbc.JdbcSiteCodeLookUpDao">
+    	<property name="dataSource" ref="dataSource"/>
+    </bean>
+    
+	<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
+		<property name="jndiName"><value>jdbc/gov.va.med.term.access.Database</value></property>
+		<property name="resourceRef"><value>false</value></property>
+	</bean>     
+</beans>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/resources/strings.properties
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/resources/strings.properties	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/resources/strings.properties	(revision 1227)
@@ -0,0 +1,7 @@
+app.name=Emergency Department Integration Software - Tracking Board
+app.version=${project.version}
+app.buildtime=BUILD_TIME_PLACEHOLDER
+copyright.year=2008
+copyright.organization.url=http://www.va.gov
+copyright.organization=Department of Veterans Affairs
+help.contextRoot=${edis.tracking.helpContextRoot}
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp-dev/WEB-INF/web.xml
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp-dev/WEB-INF/web.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp-dev/WEB-INF/web.xml	(revision 1227)
@@ -0,0 +1,90 @@
+<!DOCTYPE web-app PUBLIC
+        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/dtd/web-app_2_3.dtd" >
+<web-app>
+    <display-name>Emergency Department Tracking Board Server Proxy Application</display-name>
+
+    <context-param>
+        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
+        <param-value>strings</param-value>
+    </context-param>
+    <!-- Fallback locale if no bundles found for browser's preferred locale -->
+    <!-- Force a single locale using param-name 'javax.servlet.jsp.jstl.fmt.locale' -->
+    <context-param>
+        <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
+        <param-value>en</param-value>
+    </context-param>
+
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>
+            classpath*:/applicationContext-dao.xml
+        </param-value>
+    </context-param>
+
+    <filter>
+        <filter-name>noCacheFilter</filter-name>
+        <filter-class>gov.va.med.edp.web.servlet.filter.ResponseHeaderFilter</filter-class>
+        <init-param>
+            <param-name>Cache-Control</param-name>
+            <param-value>cache,must-revalidate</param-value>
+        </init-param>
+        <init-param>
+            <param-name>Pragma</param-name>
+            <param-value>public</param-value>
+        </init-param>
+    </filter>
+
+    <listener>
+        <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+
+    <servlet>
+        <servlet-name>dispatcher</servlet-name>
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <filter-mapping>
+        <filter-name>noCacheFilter</filter-name>
+        <url-pattern>*.swf</url-pattern>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>noCacheFilter</filter-name>
+        <url-pattern>/bigboard.html</url-pattern>
+    </filter-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>/bigboard.html</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>*.xml</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>*.csv</url-pattern>
+    </servlet-mapping>
+
+    <session-config>
+        <session-timeout>5</session-timeout>
+    </session-config>
+
+    <welcome-file-list>
+        <welcome-file>/bigboard.html</welcome-file>
+    </welcome-file-list>
+
+    <error-page>
+        <error-code>500</error-code>
+        <location>/error500.jsp</location>
+    </error-page>
+
+</web-app>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp-dev/bigboard.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp-dev/bigboard.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp-dev/bigboard.jsp	(revision 1227)
@@ -0,0 +1,149 @@
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %><%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
+<meta http-equiv="Pragma" content="no-cache" />
+<meta http-equiv="Expires" content="-1" />
+<title><fmt:message key="app.name"/></title>
+<script src="AC_OETags.js" language="javascript"></script>
+<style>
+ html, body {
+        height: 100%;
+        margin: 0;
+        padding: 0;
+    }
+    body {
+        overflow:hidden;
+    }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = 9;
+// Minor version of Flash required
+var requiredMinorVersion = 0;
+// Minor version of Flash required
+var requiredRevision = 28;
+// -----------------------------------------------------------------------------
+// -->
+</script>
+
+<!-- BEGIN call Flex function on browser close -->
+<script language="JavaScript" type="text/javascript">
+<!--
+function shutdownHook()
+{
+	var fxControl = document.BigBoard || window.BigBoard;
+	var warning = fxControl.getUnsavedDataWarning();
+	if (warning != '')
+		return warning;
+	else
+		return;
+}
+
+window.onbeforeunload = shutdownHook;
+-->
+</script>
+<!-- END call Flex function on browser close -->
+
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+
+// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
+if ( hasProductInstall && !hasRequestedVersion ) {
+	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
+	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
+	// DO NOT MODIFY THE FOLLOWING FOUR LINES
+	// Location visited after installation is complete if installation is required
+	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+	var MMredirectURL = window.location;
+    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+    var MMdoctitle = document.title;
+
+	AC_FL_RunContent(
+		"src", "playerProductInstall",
+		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+		"width", "100%",
+		"height", "100%",
+		"align", "middle",
+		"id", "<c:out value="${clientArtifactId}"/>",
+		"quality", "high",
+		"bgcolor", "#869ca7",
+		"allowFullScreen", "true",
+		"name", "<c:out value="${clientArtifactId}"/>",
+		"allowScriptAccess","sameDomain",
+		"type", "application/x-shockwave-flash",
+		"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+} else if (hasRequestedVersion) {
+	// if we've detected an acceptable version
+	// embed the Flash Content SWF when all tests are passed
+
+	// Cache Server Page namespace should be set here (don't forget the ampersand)
+	//var edpVars = "cspNmsp=CPM&cspDemo=500^10vehu^vehu10&";
+	//var edpVars = "cspServ=vhaislcfgm2.vha.med.va.gov/csp/CPM&cspToken=20012^662&";
+	//var edpVars = "vljServ=10.5.17.153:7001&";
+	//var edpVars = "vljServ=10.5.17.225:7001&";
+	//var edpVars = "vljServ=localhost:7001&";
+	//SEE LINE BELOW TO LAUNCH BIG BOARD FROM FLEX BUILDER AND PASSING IN A SITE ID
+	//var edpVars = "vljServ=vhaislbll2.vha.med.va.gov:7141&siteId=442&";
+    var edpVars = "contextRoot=<c:out value="${pageContext.request.contextPath}"/>&board=<c:out value="${param.board}"/>&siteId=<c:out value="${param.siteId}"/>&area=<c:out value="${param.area}"/>&helpContextRoot=<fmt:message key="help.contextRoot"/>";
+
+	AC_FL_RunContent(
+			"src", "<c:out value="${clientFinalName}"/>",
+			"width", "100%",
+			"height", "100%",
+			"align", "middle",
+			"id", "<c:out value="${clientArtifactId}"/>",
+			"quality", "high",
+			"bgcolor", "#869ca7",
+			"allowFullScreen", "true",
+			"name", "<c:out value="${clientArtifactId}"/>",
+			"flashvars", edpVars,
+			"allowScriptAccess","sameDomain",
+			"type", "application/x-shockwave-flash",
+			"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+  } else {  // flash is too old or we can't detect the plugin
+    var alternateContent = 'Alternate HTML content should be placed here. '
+  	+ 'This content requires the Adobe Flash Player. '
+   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+    document.write(alternateContent);  // insert non-flash content
+  }
+// -->
+</script>
+<noscript>
+  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+			id="<c:out value="${clientArtifactId}"/>" width="100%" height="100%"
+			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+			<param name="movie" value="<c:out value="${clientFinalName}"/>.swf" />
+			<param name="quality" value="high" />
+			<param name="allowFullScreen" value="true" />
+			<param name="bgcolor" value="#869ca7" />
+			<param name="allowScriptAccess" value="sameDomain" />
+			<embed src="<c:out value="${clientFinalName}"/>.swf" quality="high" allowFullScreen="true" bgcolor="#869ca7"
+				width="100%" height="100%" name="<c:out value="${clientArtifactId}"/>" align="middle"
+				play="true"
+				loop="false"
+				quality="high"
+				allowScriptAccess="sameDomain"
+				type="application/x-shockwave-flash"
+				pluginspage="http://www.adobe.com/go/getflashplayer">
+			</embed>
+	</object>
+</noscript>
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/AC_OETags.js
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/AC_OETags.js	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/AC_OETags.js	(revision 1227)
@@ -0,0 +1,276 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+	var version;
+	var axo;
+	var e;
+
+	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+	try {
+		// version will be set for 7.X or greater players
+		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+		version = axo.GetVariable("$version");
+	} catch (e) {
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 6.X players only
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+			
+			// installed player is some revision of 6.0
+			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+			// so we have to be careful. 
+			
+			// default to the first public version
+			version = "WIN 6,0,21,0";
+
+			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
+			axo.AllowScriptAccess = "always";
+
+			// safe to call for 6.0r47 or greater
+			version = axo.GetVariable("$version");
+
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 4.X or 5.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = axo.GetVariable("$version");
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 3.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = "WIN 3,0,18,0";
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 2.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+			version = "WIN 2,0,0,11";
+		} catch (e) {
+			version = -1;
+		}
+	}
+	
+	return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+	// NS/Opera version >= 3 check for Flash plugin in plugin array
+	var flashVer = -1;
+	
+	if (navigator.plugins != null && navigator.plugins.length > 0) {
+		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+			var descArray = flashDescription.split(" ");
+			var tempArrayMajor = descArray[2].split(".");			
+			var versionMajor = tempArrayMajor[0];
+			var versionMinor = tempArrayMajor[1];
+			var versionRevision = descArray[3];
+			if (versionRevision == "") {
+				versionRevision = descArray[4];
+			}
+			if (versionRevision[0] == "d") {
+				versionRevision = versionRevision.substring(1);
+			} else if (versionRevision[0] == "r") {
+				versionRevision = versionRevision.substring(1);
+				if (versionRevision.indexOf("d") > 0) {
+					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+				}
+			}
+			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+		}
+	}
+	// MSN/WebTV 2.6 supports Flash 4
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+	// WebTV 2.5 supports Flash 3
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+	// older WebTV supports Flash 2
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+	else if ( isIE && isWin && !isOpera ) {
+		flashVer = ControlVersion();
+	}	
+	return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+	versionStr = GetSwfVer();
+	if (versionStr == -1 ) {
+		return false;
+	} else if (versionStr != 0) {
+		if(isIE && isWin && !isOpera) {
+			// Given "WIN 2,0,0,11"
+			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
+			tempString        = tempArray[1];			// "2,0,0,11"
+			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
+		} else {
+			versionArray      = versionStr.split(".");
+		}
+		var versionMajor      = versionArray[0];
+		var versionMinor      = versionArray[1];
+		var versionRevision   = versionArray[2];
+
+        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
+		if (versionMajor > parseFloat(reqMajorVer)) {
+			return true;
+		} else if (versionMajor == parseFloat(reqMajorVer)) {
+			if (versionMinor > parseFloat(reqMinorVer))
+				return true;
+			else if (versionMinor == parseFloat(reqMinorVer)) {
+				if (versionRevision >= parseFloat(reqRevision))
+					return true;
+			}
+		}
+		return false;
+	}
+}
+
+function AC_AddExtension(src, ext)
+{
+  if (src.indexOf('?') != -1)
+    return src.replace(/\?/, ext+'?'); 
+  else
+    return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs) 
+{ 
+    var str = '';
+    if (isIE && isWin && !isOpera)
+    {
+  		str += '<object ';
+  		for (var i in objAttrs)
+  			str += i + '="' + objAttrs[i] + '" ';
+  		str += '>';
+  		for (var i in params)
+  			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
+  		str += '</object>';
+    } else {
+  		str += '<embed ';
+  		for (var i in embedAttrs)
+  			str += i + '="' + embedAttrs[i] + '" ';
+  		str += '> </embed>';
+    }
+
+    document.write(str);
+}
+
+function AC_FL_RunContent(){
+  var ret = 
+    AC_GetArgs
+    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+     , "application/x-shockwave-flash"
+    );
+  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+  var ret = new Object();
+  ret.embedAttrs = new Object();
+  ret.params = new Object();
+  ret.objAttrs = new Object();
+  for (var i=0; i < args.length; i=i+2){
+    var currArg = args[i].toLowerCase();    
+
+    switch (currArg){	
+      case "classid":
+        break;
+      case "pluginspage":
+        ret.embedAttrs[args[i]] = args[i+1];
+        break;
+      case "src":
+      case "movie":	
+        args[i+1] = AC_AddExtension(args[i+1], ext);
+        ret.embedAttrs["src"] = args[i+1];
+        ret.params[srcParamName] = args[i+1];
+        break;
+      case "onafterupdate":
+      case "onbeforeupdate":
+      case "onblur":
+      case "oncellchange":
+      case "onclick":
+      case "ondblClick":
+      case "ondrag":
+      case "ondragend":
+      case "ondragenter":
+      case "ondragleave":
+      case "ondragover":
+      case "ondrop":
+      case "onfinish":
+      case "onfocus":
+      case "onhelp":
+      case "onmousedown":
+      case "onmouseup":
+      case "onmouseover":
+      case "onmousemove":
+      case "onmouseout":
+      case "onkeypress":
+      case "onkeydown":
+      case "onkeyup":
+      case "onload":
+      case "onlosecapture":
+      case "onpropertychange":
+      case "onreadystatechange":
+      case "onrowsdelete":
+      case "onrowenter":
+      case "onrowexit":
+      case "onrowsinserted":
+      case "onstart":
+      case "onscroll":
+      case "onbeforeeditfocus":
+      case "onactivate":
+      case "onbeforedeactivate":
+      case "ondeactivate":
+      case "type":
+      case "codebase":
+        ret.objAttrs[args[i]] = args[i+1];
+        break;
+      case "id":
+      case "width":
+      case "height":
+      case "align":
+      case "vspace": 
+      case "hspace":
+      case "class":
+      case "title":
+      case "accesskey":
+      case "name":
+      case "tabindex":
+        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+        break;
+      default:
+        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+    }
+  }
+  ret.objAttrs["classid"] = classid;
+  if (mimeType) ret.embedAttrs["type"] = mimeType;
+  return ret;
+}
+
+
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/META-INF/MANIFEST.MF	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/META-INF/MANIFEST.MF	(revision 1227)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/dispatcher-servlet.xml
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/dispatcher-servlet.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/dispatcher-servlet.xml	(revision 1227)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <bean id="exceptionHandler" class="gov.va.med.edp.web.handler.ExceptionResolver">
+        <property name="defaultErrorView" value="exception"/>
+    </bean>
+
+    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
+        <property name="basename" value="strings"/>
+    </bean>
+
+    <bean id="handlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
+
+    <bean id="viewResolver" class="org.springframework.web.servlet.view.XmlViewResolver"/>
+
+    <bean name="/bigboard.html" class="gov.va.med.edp.web.controller.BigBoardClientVersionSynchronizationController">
+        <property name="clientArtifactId" value="edis-tracking-ui-bigboard"/>
+        <property name="viewName" value="bigBoard"/>
+		<property name="errorViewName" value="errorView"/>        
+        <property name="siteCodeDao" ref="siteCodeDao"/>
+        <property name="serverPackageVersionDao" ref="serverPackageVersionDao"/>
+        <property name="trackingDao" ref="bigBoardDao"/>
+    </bean>
+
+    <bean name="/testpage.html" class="gov.va.med.edp.web.controller.TestController">
+        <property name="viewName" value="testPage"/>
+    </bean>
+
+    <bean name="/board.xml" class="gov.va.med.edp.web.controller.BigDisplayBoardController">
+        <property name="trackingDao" ref="bigBoardDao"/>
+        <property name="serverPackageVersionDao" ref="serverPackageVersionDao"/>
+        <property name="siteCodeDao" ref="siteCodeDao"/>
+        <property name="errorViewName" value="errorView"/>
+    </bean>
+
+</beans>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/jsp/incompatibility.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/jsp/incompatibility.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/jsp/incompatibility.jsp	(revision 1227)
@@ -0,0 +1,50 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+    <title><fmt:message key="app.name"/> - Version Incompatibility</title>
+    <script language="JavaScript">
+        var targetURL = '<c:url value="/"/>';
+        var countdownfrom = 30;
+        var currentsecond;
+        
+        function init() {
+            currentsecond = document.getElementById('countdown').innerHTML = countdownfrom + 1;
+            countredirect();
+        }
+
+        function countredirect() {
+            if (currentsecond != 1) {
+                currentsecond -= 1;
+                document.getElementById('countdown').innerHTML = currentsecond;
+            }
+            else {
+                window.location = targetURL;
+                return
+            }
+            setTimeout("countredirect()", 1000);
+        }
+    </script>
+</head>
+<body onload="init()">
+<%session.invalidate();%>
+<h2>
+    <fmt:message key="app.name"/>
+</h2>
+
+<h3>Version Incompatibility</h3>
+
+<p>This is EDIS web application version '<fmt:message key="app.version"/>'.<br/>
+    The EDIS server package version running in your VistA account is '<c:out value="${serverPackageVersion}"/>'.<br/>
+    A compatible client ('<c:out value="${clientFinalName}"/>') was not found bundled in this web application.
+</p>
+
+<p>Please ensure the version in your VistA account is compatible with version '<fmt:message key="app.version"/>' of the
+    EDIS web application.</p>
+
+<p>Will attempt to re-establish connection in <span id="countdown">XX</span> seconds.</p>
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/views.xml
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/views.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/views.xml	(revision 1227)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <bean id="xmlView" class="gov.va.med.edp.web.view.XmlView"/>
+
+    <bean id="exception" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/exception.jsp"/>
+    </bean>
+
+    <bean id="bigBoard" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/bigdisplayboard.jsp"/>
+    </bean>
+    
+    <bean id="errorView" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/boardErrorReport.jsp"/>
+    </bean>    
+
+    <bean id="testPage" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/testpage.jsp"/>
+    </bean>
+
+     <bean id="incompatibilityView" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/WEB-INF/jsp/incompatibility.jsp"/>
+    </bean>
+</beans>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/web.xml
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/web.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/web.xml	(revision 1227)
@@ -0,0 +1,126 @@
+<!DOCTYPE web-app PUBLIC
+        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/dtd/web-app_2_3.dtd" >
+<web-app>
+    <display-name>Emergency Department Tracking Board Server Proxy Application</display-name>
+
+    <context-param>
+        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
+        <param-value>strings</param-value>
+    </context-param>
+    <!-- Fallback locale if no bundles found for browser's preferred locale -->
+    <!-- Force a single locale using param-name 'javax.servlet.jsp.jstl.fmt.locale' -->
+    <context-param>
+        <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
+        <param-value>en</param-value>
+    </context-param>
+
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>
+            classpath*:/applicationContext-dao.xml
+        </param-value>
+    </context-param>
+
+    <filter>
+        <filter-name>noCacheFilter</filter-name>
+        <filter-class>gov.va.med.edp.web.servlet.filter.ResponseHeaderFilter</filter-class>
+        <init-param>
+            <param-name>Cache-Control</param-name>
+            <param-value>no-store,must-revalidate</param-value>
+        </init-param>
+        <init-param>
+            <param-name>Expires</param-name>
+            <param-value>Thu, 01 Jan 1970 01:00:00 GMT</param-value>
+        </init-param>
+    </filter>
+
+    <listener>
+        <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+
+    <servlet>
+        <servlet-name>dispatcher</servlet-name>
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <filter-mapping>
+        <filter-name>noCacheFilter</filter-name>
+        <url-pattern>*.swf</url-pattern>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>noCacheFilter</filter-name>
+        <url-pattern>/bigboard.html</url-pattern>
+    </filter-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>/bigboard.html</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>/testpage.html</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>noCacheFilter</servlet-name>
+        <url-pattern>/testpage.html</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>*.xml</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>*.csv</url-pattern>
+    </servlet-mapping>
+
+    <session-config>
+        <session-timeout>5</session-timeout>
+    </session-config>
+
+    <welcome-file-list>
+        <welcome-file>/index.jsp</welcome-file>
+    </welcome-file-list>
+
+    <error-page>
+        <error-code>500</error-code>
+        <location>/error500.jsp</location>
+    </error-page>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>ED Tracking Board Flex Client</web-resource-name>
+            <url-pattern>*.swf</url-pattern>
+            <url-pattern>*.html</url-pattern>
+            <url-pattern>*.xml</url-pattern>
+            <url-pattern>*.jsp</url-pattern>
+            <url-pattern>*.csv</url-pattern>
+            <http-method>GET</http-method>
+            <http-method>POST</http-method>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>SSL_AUTHENTICATED_USERS</role-name>
+        </auth-constraint>
+        <user-data-constraint>
+            <transport-guarantee>NONE</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
+
+    <login-config>
+        <auth-method>CLIENT-CERT</auth-method>
+    </login-config>
+
+    <security-role>
+        <role-name>SSL_AUTHENTICATED_USERS</role-name>
+    </security-role>
+</web-app>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/weblogic.xml
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/weblogic.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/WEB-INF/weblogic.xml	(revision 1227)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
+
+<weblogic-web-app>
+
+	<session-descriptor>
+
+		<session-param>
+
+			<param-name>CookieName</param-name>
+
+			<param-value>edisboardJSESSIONID</param-value>
+
+		</session-param>
+
+		<session-param>
+
+			<param-name>PersistentStoreType</param-name>
+
+			<param-value>replicated_if_clustered</param-value>
+
+		</session-param>
+
+	</session-descriptor>
+
+	<container-descriptor>
+
+		<session-monitoring-enabled>true</session-monitoring-enabled>
+
+	</container-descriptor>
+
+	<context-root>${edis.tracking.boardContextRoot}</context-root>
+
+	<security-role-assignment>
+
+		<role-name>SSL_AUTHENTICATED_USERS</role-name>
+
+		<principal-name>SSL_AUTHENTICATED_USERS</principal-name>
+
+	</security-role-assignment>
+
+</weblogic-web-app>
+
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/about.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/about.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/about.jsp	(revision 1227)
@@ -0,0 +1,25 @@
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <title>
+        <fmt:message key="app.name"/>
+    </title>
+</head>
+<body>
+<h2>
+     <fmt:message key="app.name"/>
+</h2>
+
+<h3>
+    <fmt:message key="app.version"/>
+</h3>
+
+<h4>Built: <fmt:message key="app.buildtime"/></h4>
+
+<div>
+    Copyright <fmt:message key="copyright.year"/> - <a href="<fmt:message key="copyright.organization.url"/>"><fmt:message key="copyright.organization"/></a>
+</div>
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/bigdisplayboard.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/bigdisplayboard.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/bigdisplayboard.jsp	(revision 1227)
@@ -0,0 +1,146 @@
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %><%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title><fmt:message key="app.name"/></title>
+<script src="AC_OETags.js" language="javascript"></script>
+<style>
+ html, body {
+        height: 100%;
+        margin: 0;
+        padding: 0;
+    }
+    body {
+        overflow:hidden;
+    }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = 9;
+// Minor version of Flash required
+var requiredMinorVersion = 0;
+// Minor version of Flash required
+var requiredRevision = 28;
+// -----------------------------------------------------------------------------
+// -->
+</script>
+
+<!-- BEGIN call Flex function on browser close -->
+<script language="JavaScript" type="text/javascript">
+<!--
+function shutdownHook()
+{
+	var fxControl = document.BigBoard || window.BigBoard;
+	var warning = fxControl.getUnsavedDataWarning();
+	if (warning != '')
+		return warning;
+	else
+		return;
+}
+
+window.onbeforeunload = shutdownHook;
+-->
+</script>
+<!-- END call Flex function on browser close -->
+
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+
+// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
+if ( hasProductInstall && !hasRequestedVersion ) {
+	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
+	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
+	// DO NOT MODIFY THE FOLLOWING FOUR LINES
+	// Location visited after installation is complete if installation is required
+	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+	var MMredirectURL = window.location;
+    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+    var MMdoctitle = document.title;
+
+	AC_FL_RunContent(
+		"src", "playerProductInstall",
+		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+		"width", "100%",
+		"height", "100%",
+		"align", "middle",
+		"id", "<c:out value="${clientArtifactId}"/>",
+		"quality", "high",
+		"bgcolor", "#869ca7",
+		"allowFullScreen", "true",
+		"name", "<c:out value="${clientArtifactId}"/>",
+		"allowScriptAccess","sameDomain",
+		"type", "application/x-shockwave-flash",
+		"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+} else if (hasRequestedVersion) {
+	// if we've detected an acceptable version
+	// embed the Flash Content SWF when all tests are passed
+
+	// Cache Server Page namespace should be set here (don't forget the ampersand)
+	//var edpVars = "cspNmsp=CPM&cspDemo=500^10vehu^vehu10&";
+	//var edpVars = "cspServ=vhaislcfgm2.vha.med.va.gov/csp/CPM&cspToken=20012^662&";
+	//var edpVars = "vljServ=10.5.17.153:7001&";
+	//var edpVars = "vljServ=10.5.17.225:7001&";
+	//var edpVars = "vljServ=localhost:7001&";
+	//SEE LINE BELOW TO LAUNCH BIG BOARD FROM FLEX BUILDER AND PASSING IN A SITE ID
+	//var edpVars = "vljServ=vhaislbll2.vha.med.va.gov:7141&siteId=442&";
+	var edpVars = "contextRoot=<c:out value="${pageContext.request.contextPath}"/>&board=<c:out value="${param.board}"/>&area=<c:out value="${param.area}"/>&helpContextRoot=<fmt:message key="help.contextRoot"/>";
+
+	AC_FL_RunContent(
+			"src", "<c:out value="${clientFinalName}"/>",
+			"width", "100%",
+			"height", "100%",
+			"align", "middle",
+			"id", "<c:out value="${clientArtifactId}"/>",
+			"quality", "high",
+			"bgcolor", "#869ca7",
+			"allowFullScreen", "true",
+			"name", "<c:out value="${clientArtifactId}"/>",
+			"flashvars", edpVars,
+			"allowScriptAccess","sameDomain",
+			"type", "application/x-shockwave-flash",
+			"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+  } else {  // flash is too old or we can't detect the plugin
+    var alternateContent = 'Alternate HTML content should be placed here. '
+  	+ 'This content requires the Adobe Flash Player. '
+   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+    document.write(alternateContent);  // insert non-flash content
+  }
+// -->
+</script>
+<noscript>
+  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+			id="<c:out value="${clientArtifactId}"/>" width="100%" height="100%"
+			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+			<param name="movie" value="<c:out value="${clientFinalName}"/>.swf" />
+			<param name="quality" value="high" />
+			<param name="allowFullScreen" value="true" />
+			<param name="bgcolor" value="#869ca7" />
+			<param name="allowScriptAccess" value="sameDomain" />
+			<embed src="<c:out value="${clientFinalName}"/>.swf" quality="high" allowFullScreen="true" bgcolor="#869ca7"
+				width="100%" height="100%" name="<c:out value="${clientArtifactId}"/>" align="middle"
+				play="true"
+				loop="false"
+				quality="high"
+				allowScriptAccess="sameDomain"
+				type="application/x-shockwave-flash"
+				pluginspage="http://www.adobe.com/go/getflashplayer">
+			</embed>
+	</object>
+</noscript>
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/boardErrorReport.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/boardErrorReport.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/boardErrorReport.jsp	(revision 1227)
@@ -0,0 +1,22 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+    <title><fmt:message key="app.name"/></title>
+</head>
+<body>
+
+<h2><fmt:message key="app.name"/></h2>
+
+<p>This is EDIS web application version '<fmt:message key="app.version"/>'.</p>
+
+<p>An error occurred while processing your request. The message is:<br/>
+<font color="red"><b> <c:out value="${errorMessage}"/></b></font></p>
+
+<p><a href="<%= request.getContextPath() %>">Click here to try again...</a></p>
+
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/debug.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/debug.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/debug.jsp	(revision 1227)
@@ -0,0 +1,70 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<html>
+<head><title><fmt:message key="app.name"/> Debug</title></head>
+<body>
+
+<h1><fmt:message key="app.name"/> Debug</h1>
+
+<h4>initLogArea</h4>
+
+<form name="initLogArea" action="tracking.xml" method="post">
+    <input name="command" type="hidden" value="initLogArea"/>
+    <table>
+        <tr>
+            <td><label for="init_area">area</label></td>
+            <td><input id="init_area" name="area" type="text" value="1"/></td>
+        </tr>
+    </table>
+    <input type="submit" value="Execute"/>
+</form>
+
+<h4>initTrackingArea</h4>
+
+<form name="initTrackingArea" action="board.xml" method="post">
+    <input name="command" type="hidden" value="initLogArea"/>
+    <table>
+        <tr>
+            <td><label for="init_area">area</label></td>
+            <td><input id="init_area" name="area" type="text" value="1"/></td>
+        </tr>
+    </table>
+    <input type="submit" value="Execute"/>
+</form>
+
+<h4>refreshLogSelector</h4>
+
+<form name="refreshLogSelector" action="tracking.xml" method="post">
+    <input name="command" type="hidden" value="refreshLogSelector"/>
+    <table>
+         <tr>
+            <td><label for="refresh_area">area</label></td>
+            <td><input id="refresh_area" name="area" type="text" value="1"/></td>
+        </tr>
+        <tr>
+            <td><label for="token">token</label></td>
+            <td><input id="token" name="token" type="text" value="-1"/></td>
+        </tr>
+    </table>
+    <input type="submit" value="Execute"/>
+</form>
+
+<h4>switchLogEntry</h4>
+
+<form name="switchLogEntry" action="tracking.xml" method="post">
+    <input name="command" type="hidden" value="switchLogEntry"/>
+    <table>
+        <tr>
+            <td><label for="logID">logID</label></td>
+            <td><input id="logID" name="logID" type="text" value="64"/></td>
+        </tr>
+        <tr>
+            <td><label for="getChoices">getChoices</label></td>
+            <td><input id="getChoices" name="getChoices" type="text" value="1"/></td>
+        </tr>
+    </table>
+    <input type="submit" value="Execute"/>
+</form>
+
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/error500.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/error500.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/error500.jsp	(revision 1227)
@@ -0,0 +1,12 @@
+<%@ page pageEncoding="UTF-8" contentType="application/xml;charset=UTF-8" language="java" session="false" isErrorPage="true" %><?xml version="1.0" encoding="UTF-8"?>
+<results>
+<error>
+    <code><%= request.getAttribute("javax.servlet.error.status_code") %></code>
+    <message><%= request.getAttribute("javax.servlet.error.exception") %></message>
+    <resource><%= request.getAttribute("javax.servlet.error.request_uri") %></resource>
+    <detail xml:space="preserve"><% Throwable e =
+        (Throwable) request.getAttribute("javax.servlet.error.exception");
+    e.printStackTrace(new java.io.PrintWriter(out));
+%></detail>
+</error>
+</results>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/exception.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/exception.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/exception.jsp	(revision 1227)
@@ -0,0 +1,12 @@
+<%@ page pageEncoding="UTF-8" contentType="application/xml;charset=UTF-8" language="java" session="false" isErrorPage="true" %><?xml version="1.0" encoding="UTF-8"?>
+<results>
+<error>
+    <code>500</code>
+    <message><%= ((Exception) request.getAttribute("exception")).getMessage() %></message>
+    <resource><%= request.getAttribute("resource") %></resource>
+    <detail xml:space="preserve"><% Exception e =
+        (Exception) request.getAttribute("exception");
+    e.printStackTrace(new java.io.PrintWriter(out));
+%></detail>
+</error>
+</results>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/index.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/index.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/index.jsp	(revision 1227)
@@ -0,0 +1,2 @@
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
+<c:redirect url="/bigboard.html"/>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/logout.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/logout.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/logout.jsp	(revision 1227)
@@ -0,0 +1,16 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+  <head><title><fmt:message key="app.name"/> Logged Out</title></head>
+  <body>
+  <%session.invalidate();%>
+  <h2>
+     <fmt:message key="app.name"/>
+  </h2>
+  <p>You have been logged out.</p>
+  <p><a href="<%= request.getContextPath() %>">Log in again.</a></p>
+  <p><a href="http://vhaislcfgm2.vha.med.va.gov/shadowfax/joomla/index.php?option=com_fireboard&Itemid=121&task=listcat&catid=14">EDIS Tracking Feedback Forum</a></p>
+  </body>
+</html>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/reset.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/reset.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/reset.jsp	(revision 1227)
@@ -0,0 +1,3 @@
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
+<% session.invalidate(); %>
+<c:redirect url="/"/>
Index: EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/testpage.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/testpage.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-bigboard/src/main/webapp/testpage.jsp	(revision 1227)
@@ -0,0 +1,25 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
+    <title><fmt:message key="app.name"/></title>
+</head>
+<body>
+
+<h2><fmt:message key="app.name"/></h2>
+
+<p>This is EDIS web application version '<fmt:message key="app.version"/>'.</p>
+
+
+<p>HTTP Header Value for 'EdisClientMachineName' =<b><font color="blue">
+<c:out value="${EdisClientMachineName}"/></font></b></p>
+
+
+<p>All HTTP Headers Were:<b><font color="blue">
+<c:out value="${HttpHeaders}"/></font></b></p>
+
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-core/pom.xml
===================================================================
--- EDIS/trunk/java/tracking-server-core/pom.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/pom.xml	(revision 1227)
@@ -0,0 +1,168 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>gov.va.med.edp</groupId>
+		<artifactId>edis-tracking-parent</artifactId>
+		<version>1.0-T29-SNAPSHOT</version>
+		<relativePath>../tracking-parent</relativePath>
+	</parent>
+	<groupId>gov.va.med.edp</groupId>
+	<artifactId>edis-tracking-server-core</artifactId>
+	<packaging>jar</packaging>
+	<name>EDIS Tracking Server Core</name>
+	 <version>1.0-T29-SNAPSHOT</version>
+	<description>Emergency Department Integration Software - Tracking Application Server Core</description>
+    <dependencies>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-jca</artifactId>
+			<version>${spring.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>log4j</groupId>
+					<artifactId>log4j</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>logkit</groupId>
+					<artifactId>logkit</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>avalon-framework</groupId>
+					<artifactId>avalon-framework</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.servlet</groupId>
+					<artifactId>servlet-api</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-webmvc</artifactId>
+			<version>${spring.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>log4j</groupId>
+					<artifactId>log4j</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>logkit</groupId>
+					<artifactId>logkit</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>avalon-framework</groupId>
+					<artifactId>avalon-framework</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.servlet</groupId>
+					<artifactId>servlet-api</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-jdbc</artifactId>
+			<version>${spring.version}</version>
+			<exclusions>
+				<exclusion>
+					<groupId>log4j</groupId>
+					<artifactId>log4j</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>logkit</groupId>
+					<artifactId>logkit</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>avalon-framework</groupId>
+					<artifactId>avalon-framework</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.servlet</groupId>
+					<artifactId>servlet-api</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>		
+		<dependency>
+			<groupId>gov.va.med.authentication</groupId>
+			<artifactId>kaajee</artifactId>
+			<version>1.0.1.002</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>log4j</groupId>
+			<artifactId>log4j</artifactId>
+			<version>1.2.8</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>weblogic</groupId>
+			<artifactId>weblogic</artifactId>
+			<version>8.1</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>gov.va.med.vistalink</groupId>
+			<artifactId>vljFoundationsLib</artifactId>
+			<version>1.5.0.026</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>gov.va.med.vistalink</groupId>
+			<artifactId>vljConnector</artifactId>
+			<version>1.5.0.026</version>
+			<scope>provided</scope>
+		</dependency>
+		<dependency>
+			<groupId>junit</groupId>
+			<artifactId>junit</artifactId>
+			<version>3.8.1</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>easymock</groupId>
+			<artifactId>easymock</artifactId>
+			<version>1.2_Java1.3</version>
+			<scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.springframework</groupId>
+			<artifactId>spring-mock</artifactId>
+			<version>${spring.version}</version>
+			<scope>test</scope>
+			<exclusions>
+				<exclusion>
+					<groupId>log4j</groupId>
+					<artifactId>log4j</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>logkit</groupId>
+					<artifactId>logkit</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>avalon-framework</groupId>
+					<artifactId>avalon-framework</artifactId>
+				</exclusion>
+				<exclusion>
+					<groupId>javax.servlet</groupId>
+					<artifactId>servlet-api</artifactId>
+				</exclusion>
+			</exclusions>
+		</dependency>
+	</dependencies>
+	<build>
+		<plugins>
+			<plugin>
+				<groupId>org.apache.maven.plugins</groupId>
+				<artifactId>maven-source-plugin</artifactId>
+				<executions>
+					<execution>
+						<goals>
+							<goal>jar</goal>
+						</goals>
+					</execution>
+				</executions>
+			</plugin>
+		</plugins>
+	</build>
+</project>
Index: EDIS/trunk/java/tracking-server-core/src/main/java/META-INF/MANIFEST.MF
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/META-INF/MANIFEST.MF	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/META-INF/MANIFEST.MF	(revision 1227)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/ServerPackageVersionDao.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/ServerPackageVersionDao.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/ServerPackageVersionDao.java	(revision 1227)
@@ -0,0 +1,14 @@
+package gov.va.med.edp.dao;
+
+import gov.va.med.edp.vo.BigBoardDebugInfoVO;
+
+import org.springframework.dao.DataAccessException;
+
+
+/**
+ * TODO: document ServerPackageVersionDao
+ */
+public interface ServerPackageVersionDao {
+    String getServerPackageVersion(String stationNumber);
+    BigBoardDebugInfoVO getVistaLinkConnectionInfo(String stationNumber) throws DataAccessException;
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/SessionDao.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/SessionDao.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/SessionDao.java	(revision 1227)
@@ -0,0 +1,8 @@
+package gov.va.med.edp.dao;
+
+import gov.va.med.edp.vo.SessionVO;
+import org.springframework.dao.DataAccessException;
+
+public interface SessionDao {
+    SessionVO getSessionInfo(String stationNumber, String duz) throws DataAccessException;
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/SiteCodeLookUpDao.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/SiteCodeLookUpDao.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/SiteCodeLookUpDao.java	(revision 1227)
@@ -0,0 +1,7 @@
+package gov.va.med.edp.dao;
+
+import org.springframework.dao.DataAccessException;
+
+public interface SiteCodeLookUpDao {
+    String getSiteCode(String machineName) throws DataAccessException;
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/TrackingDao.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/TrackingDao.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/TrackingDao.java	(revision 1227)
@@ -0,0 +1,9 @@
+package gov.va.med.edp.dao;
+
+import org.springframework.dao.DataAccessException;
+
+import java.util.Map;
+
+public interface TrackingDao {
+    String executeCommand(String stationNumber, String duz, Map params) throws DataAccessException;
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/jdbc/JdbcSiteCodeLookUpDao.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/jdbc/JdbcSiteCodeLookUpDao.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/jdbc/JdbcSiteCodeLookUpDao.java	(revision 1227)
@@ -0,0 +1,72 @@
+package gov.va.med.edp.dao.jdbc;
+
+import gov.va.med.edp.dao.SiteCodeLookUpDao;
+
+import java.util.List;
+
+import javax.sql.DataSource;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.dao.DataAccessException;
+import org.springframework.jdbc.core.JdbcTemplate;
+import org.springframework.util.Assert;
+
+public class JdbcSiteCodeLookUpDao implements SiteCodeLookUpDao, InitializingBean {
+
+	private JdbcTemplate jdbcTemplate;
+    private static Logger logger = Logger.getLogger(JdbcSiteCodeLookUpDao.class);
+	
+	
+    public String getSiteCode(String machineName) throws DataAccessException {
+    	String sql = "select siteCode from EDP.SiteMapper where sitePrefix=?";
+    	String siteCode = "";
+    	List siteCodeList = null;
+
+    	if (logger.isDebugEnabled()){
+    		logger.debug("Executing SQL: " + sql + " with parameter: " + machineName);
+    	}
+    	siteCodeList = jdbcTemplate.queryForList(sql, new Object[]{machineName} , String.class);
+    	if (!(siteCodeList!= null && siteCodeList.size() == 1)){
+    		String sitePrefix = parseSitePrefix(machineName);
+    		if (logger.isDebugEnabled()){
+    			logger.debug("Matching site code was not found for the full machineName. Now executing SQL query:" + sql + " with parameter: " + sitePrefix);
+    		}
+    		siteCodeList = jdbcTemplate.queryForList(sql, new Object[]{sitePrefix} , String.class);
+    	}	  
+
+    	if (siteCodeList!= null && siteCodeList.size() == 1){
+    		siteCode = siteCodeList.get(0).toString();
+    		if (logger.isDebugEnabled()) logger.debug("SQL Query executed successfully. The Site Code is: " + siteCode);
+    		return siteCode;
+    	} 
+
+    	if (logger.isDebugEnabled()) logger.debug("No Results were found for the SQL Query. Returning null for siteCode");
+    	return null;
+    }
+
+	public void setDataSource(DataSource dataSource) {
+		this.jdbcTemplate = new JdbcTemplate(dataSource);
+	}
+
+
+	public void afterPropertiesSet() throws Exception {
+		Assert.notNull(jdbcTemplate, "jdbcTemplate must not be null");		
+	}
+
+	private String parseSitePrefix(String machineName){
+		 String sitePrefix = "";
+		 if (machineName.startsWith("VHA")){
+			 sitePrefix = machineName.substring(3, 6);
+			 
+		 } else {
+			 sitePrefix = machineName.substring(0, 3);
+		 }
+		
+		if (logger.isDebugEnabled()){
+			  logger.debug("Parsed sitePrefix from the machineName: " + machineName + " is: " + sitePrefix);
+		  }		
+		return sitePrefix;
+	}
+	
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkBigBoardDao.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkBigBoardDao.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkBigBoardDao.java	(revision 1227)
@@ -0,0 +1,51 @@
+package gov.va.med.edp.dao.rpc;
+
+import gov.va.med.edp.dao.TrackingDao;
+import gov.va.med.edp.rpc.VistaLinkDaoSupport;
+import org.springframework.dao.DataAccessException;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public class VistaLinkBigBoardDao extends VistaLinkDaoSupport implements TrackingDao {
+    static final String EDPS_BOARD_CONTEXT = "EDPS BOARD CONTEXT";
+    static final String EDP_CONTROLLER_BOARD_RPC = "EDPCBRD RPC";
+    static final String EDPTRACKING_APPLICATION_USER = "EDPTRACKING,PROXY";
+
+    /**
+     * Builds the list of parameters to pass to the RPC.
+     * First argument to the RPC is a string of the format "${duz}^${stationNumber}".  If duz is null, will send "0^${stationNumber}"
+     * Second argument to the RPC is a multiple containing key value pairs passed in as a map.
+     *
+     * @param stationNumber The station number that this command is being executed on behalf of.  Note how this is different
+     *                      from the station number of the vista account this dao is communicating with.
+     * @param duz           user who command is being executed on behalf of.  Can be null for some operations. Note how this is different
+     *                      from the "application user duz" that RPCs are executed with.
+     * @param params        A map containing key value pairs that are passed to RPC as a multiple.
+     * @return list with two items in it, a string and a multiple, to be passed as RPC arguments.
+     */
+    protected List buildRpcParameterList(String stationNumber, String duz, Map params) {
+        ArrayList paramList = new ArrayList();
+        paramList.add((duz == null ? "0" : duz) + '^' + stationNumber);
+        paramList.add(params);
+        return paramList;
+    }
+
+    /**
+     * Commands executed by this data access object are always executed by the "application user" against the stationNumber
+     * set by the property on this bean.
+     *
+     * @param stationNumber The station number that this command is being executed on behalf of. Note how this is different
+     *                      from the station number of the vista account this dao is communicating with.  Cannot be null.
+     * @param duz           A duz to execute the command on behalf of. Can be null for some operations. Note how this is different
+     *                      from the "application user duz" that RPCs are executed with.
+     * @param params        A map containing key value pairs that are passed to the RPC as a multiple.
+     * @return result of executing command RPC as a string.
+     * @throws org.springframework.dao.DataAccessException
+     *
+     */
+    public String executeCommand(String stationNumber, String duz, Map params) throws DataAccessException {
+        return getRpcTemplate().rpcAsApplication(stationNumber, EDPTRACKING_APPLICATION_USER, EDPS_BOARD_CONTEXT, EDP_CONTROLLER_BOARD_RPC, buildRpcParameterList(stationNumber, duz, params));
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkServerPackageVersionDao.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkServerPackageVersionDao.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkServerPackageVersionDao.java	(revision 1227)
@@ -0,0 +1,68 @@
+package gov.va.med.edp.dao.rpc;
+
+import gov.va.med.edp.rpc.VistaLinkDaoSupport;
+import gov.va.med.edp.vo.BigBoardDebugInfoVO;
+import gov.va.med.edp.dao.ServerPackageVersionDao;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.io.StringReader;
+import java.io.IOException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.springframework.dao.DataAccessException;
+import org.springframework.dao.DataRetrievalFailureException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+/**
+ * TODO: document VistaLinkServerPackageVersionDao
+ */
+public class VistaLinkServerPackageVersionDao extends VistaLinkBigBoardDao implements ServerPackageVersionDao {
+    private static final String UNABLE_TO_GET_VERSION_INFO = "unable to get version info";    
+
+    public String getServerPackageVersion(String stationNumber) {
+        Map params = new HashMap();
+        params.put("command", "initTracking");
+        String result = executeCommand(stationNumber, null, params);
+        return getVersion(result);
+    }
+
+    public BigBoardDebugInfoVO getVistaLinkConnectionInfo(String stationNumber) throws DataAccessException {
+    	return getRpcTemplate().getVistaLinkConnectionInfo(stationNumber, EDPTRACKING_APPLICATION_USER);
+    }    
+    
+    private String getVersion(String result) {
+        Document doc = buildDocument(result);
+        return getVersion(doc);
+    }   
+    
+    private Element getUserElement(Document doc) {
+        return (Element) doc.getDocumentElement().getElementsByTagName("user").item(0);
+    }
+
+    private String getVersion(Document doc) {
+        Element user = getUserElement(doc);
+        if (user == null) return null;
+        return user.getAttribute("version");
+    }
+
+    private Document buildDocument(String result) {
+           try {
+               DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+               return builder.parse(new InputSource(new StringReader("<results>" + result + "</results>")));
+           } catch (ParserConfigurationException e) {
+               throw new DataRetrievalFailureException(UNABLE_TO_GET_VERSION_INFO, e);
+           } catch (IOException e) {
+               throw new DataRetrievalFailureException(UNABLE_TO_GET_VERSION_INFO, e);
+           } catch (SAXException e) {
+               throw new DataRetrievalFailureException(UNABLE_TO_GET_VERSION_INFO, e);
+           }
+       }
+
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkSessionDao.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkSessionDao.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkSessionDao.java	(revision 1227)
@@ -0,0 +1,70 @@
+package gov.va.med.edp.dao.rpc;
+
+import gov.va.med.edp.dao.SessionDao;
+import gov.va.med.edp.vo.SessionVO;
+import org.springframework.dao.DataAccessException;
+import org.springframework.dao.DataRetrievalFailureException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+
+public class VistaLinkSessionDao extends VistaLinkTrackingDao implements SessionDao {
+    private static final String UNABLE_TO_GET_USER_INFO = "unable to get user info";
+
+    public SessionVO getSessionInfo(String stationNumber, String duz) throws DataAccessException {
+        Map params = new HashMap();
+        params.put("command", "initUser");
+        String result = executeCommand(stationNumber, duz, params);
+        return createSessionInfo(result);
+    }
+
+    private SessionVO createSessionInfo(String result) {
+        Document doc = buildDocument(result);
+
+        SessionVO session = new SessionVO();
+        session.setServerPackageVersion(getServerPackageVersion(doc));
+        session.setTimeOutMillis(Integer.parseInt(getTimeout(doc)));
+        session.setCountDownMillis(Integer.parseInt(getCountdown(doc)));
+        return session;
+    }
+
+    private String getServerPackageVersion(Document doc) {
+        return getUserElement(doc).getAttribute("version");
+    }
+
+    private String getTimeout(Document doc) {
+        return getUserElement(doc).getAttribute("timeOut");
+    }
+
+    private Element getUserElement(Document doc) {
+        return ((Element) doc.getDocumentElement().getElementsByTagName("user").item(0));
+    }
+
+    private String getCountdown(Document doc) {
+        return getUserElement(doc).getAttribute("countDown");
+    }
+
+    private Document buildDocument(String result) {
+        try {
+            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+            return builder.parse(new InputSource(new StringReader("<results>" + result + "</results>")));
+        } catch (ParserConfigurationException e) {
+            throw new DataRetrievalFailureException(UNABLE_TO_GET_USER_INFO, e);
+        } catch (IOException e) {
+            throw new DataRetrievalFailureException(UNABLE_TO_GET_USER_INFO, e);
+        } catch (SAXException e) {
+            throw new DataRetrievalFailureException(UNABLE_TO_GET_USER_INFO, e);
+        }
+    }
+
+    
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkTrackingDao.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkTrackingDao.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/dao/rpc/VistaLinkTrackingDao.java	(revision 1227)
@@ -0,0 +1,25 @@
+package gov.va.med.edp.dao.rpc;
+
+import org.springframework.dao.DataAccessException;
+
+import java.util.List;
+import java.util.Map;
+import java.util.ArrayList;
+
+import gov.va.med.edp.dao.TrackingDao;
+import gov.va.med.edp.rpc.VistaLinkDaoSupport;
+
+public class VistaLinkTrackingDao extends VistaLinkDaoSupport implements TrackingDao {
+    static final String EDPF_TRACKING_SYSTEM_CONTEXT = "EDPF TRACKING SYSTEM";
+    static final String EDP_CONTROLLER_RPC = "EDPCTRL RPC";
+
+    public String executeCommand(String stationNumber, String duz, Map params) throws DataAccessException {
+        return getRpcTemplate().rpcAsUser(stationNumber, duz, EDPF_TRACKING_SYSTEM_CONTEXT, EDP_CONTROLLER_RPC, buildRpcParameterList(params));
+    }
+
+    private List buildRpcParameterList(Map params) {
+        ArrayList paramList = new ArrayList();
+        paramList.add(params);
+        return paramList;
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/ConnectionFactoryLocator.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/ConnectionFactoryLocator.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/ConnectionFactoryLocator.java	(revision 1227)
@@ -0,0 +1,22 @@
+package gov.va.med.edp.rpc;
+
+import org.springframework.dao.DataAccessResourceFailureException;
+
+import javax.resource.cci.ConnectionFactory;
+
+/**
+ * Implementations of this interface retrieve JCA connection factories for a particular VistA station number.
+ *
+ * @see InstitutionMappingConnectionFactoryLocator
+ */
+public interface ConnectionFactoryLocator {
+    /**
+     * Retrieves a connection factory for the specified station number, or throws an exception.  Never should return null.
+     *
+     * @param stationNumber
+     * @return the connection factory for the specified station number, or throw a data access resource exception if there is none.
+     * @throws DataAccessResourceFailureException
+     *
+     */
+    ConnectionFactory getConnectionFactory(String stationNumber) throws DataAccessResourceFailureException;
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/InstitutionMappingConnectionFactoryLocator.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/InstitutionMappingConnectionFactoryLocator.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/InstitutionMappingConnectionFactoryLocator.java	(revision 1227)
@@ -0,0 +1,39 @@
+package gov.va.med.edp.rpc;
+
+import gov.va.med.vistalink.adapter.cci.VistaLinkConnectionFactory;
+import gov.va.med.vistalink.institution.InstitutionMapNotInitializedException;
+import gov.va.med.vistalink.institution.InstitutionMappingDelegate;
+import gov.va.med.vistalink.institution.InstitutionMappingNotFoundException;
+import org.springframework.dao.DataAccessResourceFailureException;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.resource.cci.ConnectionFactory;
+import java.text.MessageFormat;
+
+public class InstitutionMappingConnectionFactoryLocator implements ConnectionFactoryLocator {
+    private static final String NO_CONNECTION_FACTORY = "Unable to obtain connection factory for station ''{0}''";
+    private static final String NO_CONNECTION_FACTORY_JNDI = "Unable to obtain connection factory for station ''{0}'' at JNDI name ''{1}''";
+
+    public ConnectionFactory getConnectionFactory(String stationNumber) throws DataAccessResourceFailureException {
+        try {
+            String jndiConnectorName = InstitutionMappingDelegate.getJndiConnectorNameForInstitution(
+                    stationNumber);
+            try {
+                Context ic = new InitialContext();
+                VistaLinkConnectionFactory vistaLinkConnectionFactory = (VistaLinkConnectionFactory) ic.lookup(jndiConnectorName);
+                if (vistaLinkConnectionFactory == null)
+                    throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY_JNDI, new Object[]{stationNumber, jndiConnectorName}));
+                return vistaLinkConnectionFactory;
+            } catch (NamingException e) {
+                throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY_JNDI, new Object[]{stationNumber, jndiConnectorName}), e);
+            }
+        } catch (InstitutionMappingNotFoundException e) {
+            throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY, new Object[]{stationNumber}), e);
+        } catch (InstitutionMapNotInitializedException e) {
+            throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY, new Object[]{stationNumber}), e);
+        }
+
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkDaoSupport.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkDaoSupport.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkDaoSupport.java	(revision 1227)
@@ -0,0 +1,34 @@
+package gov.va.med.edp.rpc;
+
+import org.springframework.dao.support.DaoSupport;
+
+public class VistaLinkDaoSupport extends DaoSupport {
+
+    private VistaLinkRpcTemplate rpcTemplate;
+
+    protected void checkDaoConfig() throws IllegalArgumentException {
+        if (this.rpcTemplate == null) {
+			setConnectionFactoryLocator(new InstitutionMappingConnectionFactoryLocator());
+		}
+    }
+
+    protected VistaLinkRpcTemplate createRpcTemplate(ConnectionFactoryLocator connectionFactoryLocator) {
+        return new VistaLinkRpcTemplate(connectionFactoryLocator);
+    }
+
+    public ConnectionFactoryLocator getConnectionFactoryLocator() {
+        return rpcTemplate.getConnectionFactoryLocator();
+    }
+
+    public void setConnectionFactoryLocator(ConnectionFactoryLocator connectionFactoryLocator) {
+        setRpcTemplate(createRpcTemplate(connectionFactoryLocator));
+    }
+
+    public VistaLinkRpcTemplate getRpcTemplate() {
+        return rpcTemplate;
+    }
+
+    public void setRpcTemplate(VistaLinkRpcTemplate rpcTemplate) {
+        this.rpcTemplate = rpcTemplate;
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcDataRetrievalFailureException.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcDataRetrievalFailureException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcDataRetrievalFailureException.java	(revision 1227)
@@ -0,0 +1,38 @@
+package gov.va.med.edp.rpc;
+
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+import org.springframework.dao.DataRetrievalFailureException;
+
+public class VistaLinkRpcDataRetrievalFailureException extends DataRetrievalFailureException {
+
+    private VistaLinkFaultException fault;
+
+    public VistaLinkRpcDataRetrievalFailureException(VistaLinkFaultException fault) {
+        super(fault.getMessage(), fault);
+        this.fault = fault;
+    }
+
+    public String getErrorCode() {
+        return fault.getErrorCode();
+    }
+
+    public String getErrorMessage() {
+        return fault.getErrorMessage();
+    }
+
+    public String getErrorType() {
+        return fault.getErrorType();
+    }
+
+    public String getFaultActor() {
+        return fault.getFaultActor();
+    }
+
+    public String getFaultCode() {
+        return fault.getFaultCode();
+    }
+
+    public String getFaultString() {
+        return fault.getFaultString();
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcInvalidApiUsageException.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcInvalidApiUsageException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcInvalidApiUsageException.java	(revision 1227)
@@ -0,0 +1,41 @@
+package gov.va.med.edp.rpc;
+
+import org.springframework.dao.InvalidDataAccessApiUsageException;
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+
+/**
+ * TODO: document VistaLinkRpcInvalidApiUsageException
+ */
+public class VistaLinkRpcInvalidApiUsageException extends InvalidDataAccessApiUsageException {
+
+    private VistaLinkFaultException fault;
+
+    public VistaLinkRpcInvalidApiUsageException(VistaLinkFaultException fault) {
+        super(fault.getMessage());
+        this.fault = fault;
+    }
+
+    public String getErrorCode() {
+        return fault.getErrorCode();
+    }
+
+    public String getErrorMessage() {
+        return fault.getErrorMessage();
+    }
+
+    public String getErrorType() {
+        return fault.getErrorType();
+    }
+
+    public String getFaultActor() {
+        return fault.getFaultActor();
+    }
+
+    public String getFaultCode() {
+        return fault.getFaultCode();
+    }
+
+    public String getFaultString() {
+        return fault.getFaultString();
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcPermissionDeniedException.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcPermissionDeniedException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcPermissionDeniedException.java	(revision 1227)
@@ -0,0 +1,38 @@
+package gov.va.med.edp.rpc;
+
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+import org.springframework.dao.PermissionDeniedDataAccessException;
+
+public class VistaLinkRpcPermissionDeniedException extends PermissionDeniedDataAccessException {
+
+    private VistaLinkFaultException fault;
+
+    public VistaLinkRpcPermissionDeniedException(VistaLinkFaultException fault) {
+        super(fault.getMessage(), fault);
+        this.fault = fault;
+    }
+
+    public String getErrorCode() {
+        return fault.getErrorCode();
+    }
+
+    public String getErrorMessage() {
+        return fault.getErrorMessage();
+    }
+
+    public String getErrorType() {
+        return fault.getErrorType();
+    }
+
+    public String getFaultActor() {
+        return fault.getFaultActor();
+    }
+
+    public String getFaultCode() {
+        return fault.getFaultCode();
+    }
+
+    public String getFaultString() {
+        return fault.getFaultString();
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcTemplate.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcTemplate.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/rpc/VistaLinkRpcTemplate.java	(revision 1227)
@@ -0,0 +1,169 @@
+package gov.va.med.edp.rpc;
+
+import gov.va.med.edp.vo.BigBoardDebugInfoVO;
+import gov.va.med.exception.FoundationsException;
+import gov.va.med.vistalink.adapter.cci.VistaLinkAppProxyConnectionSpec;
+import gov.va.med.vistalink.adapter.cci.VistaLinkConnection;
+import gov.va.med.vistalink.adapter.cci.VistaLinkConnectionSpec;
+import gov.va.med.vistalink.adapter.cci.VistaLinkDuzConnectionSpec;
+import gov.va.med.vistalink.adapter.record.LoginsDisabledFaultException;
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+import gov.va.med.vistalink.adapter.spi.VistaLinkServerInfo;
+import gov.va.med.vistalink.rpc.*;
+import gov.va.med.vistalink.security.m.SecurityFaultException;
+import gov.va.med.vistalink.security.m.SecurityDivisionDeterminationFaultException;
+import org.apache.log4j.Logger;
+import org.springframework.dao.*;
+import org.springframework.jca.cci.core.CciTemplate;
+import org.springframework.jca.cci.core.ConnectionCallback;
+import org.springframework.util.Assert;
+
+import javax.resource.ResourceException;
+import javax.resource.cci.Connection;
+import javax.resource.cci.ConnectionFactory;
+import java.sql.SQLException;
+import java.text.MessageFormat;
+import java.util.List;
+
+/**
+ * This is the central class in the rpc package. It simplifies the use of VistaLink RPCs and helps to avoid common errors.
+ * It executes core RPC workflow, leaving application code to provide RPC names and parameters and extract results. This
+ * class executes RPCs with VistaLink, initiating iteration over RPC results and catching VistaLink exceptions and
+ * translating them to the generic data access exception hierarchy defined in the org.springframework.dao package.
+ */
+public class VistaLinkRpcTemplate {
+
+    private static final int USER_TYPE_DUZ = 1;
+    private static final int USER_TYPE_APPLICATION_PROXY = 2;
+
+    static final int DEFAULT_TIMEOUT = 10000;
+
+    private static Logger log = Logger.getLogger(VistaLinkRpcTemplate.class);
+
+    private int timeOut = DEFAULT_TIMEOUT;
+    private String rpcContext;
+    private ConnectionFactoryLocator connectionFactoryLocator;
+
+    private static final String UNABLE_TO_EXECUTE_RPC = "Unable to execute RPC";
+
+    public VistaLinkRpcTemplate(ConnectionFactoryLocator connectionFactoryLocator) {
+        this.connectionFactoryLocator = connectionFactoryLocator;
+    }
+
+    public String rpcAsUser(final String division, final String duz, final String rpcContext, final String rpcName) throws DataAccessException {
+        return rpcAsUser(division, duz, rpcContext, rpcName, null);
+    }
+
+    public String rpcAsUser(final String division, final String duz, final String rpcContext, final String rpcName, final List params) throws DataAccessException {
+        return rpc(division, duz, rpcContext, rpcName, params, USER_TYPE_DUZ);
+    }
+
+    public String rpcAsApplication(final String division, final String applicationProxyName, final String rpcContext, final String rpcName) throws DataAccessException {
+        return rpcAsApplication(division, applicationProxyName, rpcContext, rpcName, null);
+    }
+
+    public String rpcAsApplication(final String division, final String applicationProxyName, final String rpcContext, final String rpcName, final List params) throws DataAccessException {
+        return rpc(division, applicationProxyName, rpcContext, rpcName, params, USER_TYPE_APPLICATION_PROXY);
+    }
+
+    public BigBoardDebugInfoVO getVistaLinkConnectionInfo(final String division, final String user) throws DataAccessException {
+        return getConnectionInfo(division, user, USER_TYPE_APPLICATION_PROXY);
+    }    
+    
+    public String rpc(final String division, final String user, final String rpcContext, final String rpcName, final List params, final int userType) throws DataAccessException {
+        if (log.isDebugEnabled())
+            log.debug(MessageFormat.format("''{0}'' called in context ''{1}'' by ''{2}'' at facility ''{3}'' with params: {4}", new Object[]{rpcName, rpcContext, user, division, params}));
+
+        ConnectionFactory connectionFactory = connectionFactoryLocator.getConnectionFactory(division);
+        try {
+            CciTemplate t = new CciTemplate(connectionFactory, createConnectionSpec(division, user, userType));
+            RpcResponse response = (RpcResponse) t.execute(new ConnectionCallback() {
+                public Object doInConnection(Connection connection, ConnectionFactory connectionFactory) throws ResourceException, SQLException, DataAccessException {
+                    try {
+                        Assert.isInstanceOf(VistaLinkConnection.class, connection);
+                        VistaLinkConnection conn = (VistaLinkConnection) connection;
+                        conn.setTimeOut(getTimeOut());
+
+                        RpcRequest request = RpcRequestFactory.getRpcRequest(rpcContext, rpcName);
+                        request.setUseProprietaryMessageFormat(true);
+                        request.setXmlResponse(false);
+
+                        if (params != null) {
+                            request.setParams(params);
+                        }
+
+                        return conn.executeRPC(request);
+                    } catch (IllegalArgumentException e) {
+                        throw new InvalidDataAccessApiUsageException(UNABLE_TO_EXECUTE_RPC, e);
+                    } catch (NoRpcContextFaultException e) {
+                        throw new VistaLinkRpcInvalidApiUsageException(e);
+                    } catch (RpcNotOkForProxyUseException e) {
+                        throw new VistaLinkRpcInvalidApiUsageException(e);
+                    } catch (RpcNotInContextFaultException e) {
+                        throw new VistaLinkRpcPermissionDeniedException(e);
+                    } catch (LoginsDisabledFaultException e) {
+                        throw new DataAccessResourceFailureException(UNABLE_TO_EXECUTE_RPC, e);
+                    } catch (SecurityDivisionDeterminationFaultException e) {
+                        throw new VistaLinkRpcInvalidApiUsageException(e);
+                    } catch (SecurityFaultException e) {
+                        throw new VistaLinkRpcPermissionDeniedException(e);
+                    } catch (VistaLinkFaultException e) {
+                        throw new DataRetrievalFailureException(UNABLE_TO_EXECUTE_RPC, e);
+                    } catch (FoundationsException e) {
+                        throw new DataRetrievalFailureException(UNABLE_TO_EXECUTE_RPC, e);
+                    }
+                }
+            });
+            String result = response.getResults();
+            if (log.isDebugEnabled()) {
+                log.debug(MessageFormat.format("''{0}'' returned: {1}", new Object[]{rpcName, result}));
+            }
+            return result;
+        } catch (IllegalArgumentException e) {
+            throw new InvalidDataAccessApiUsageException(UNABLE_TO_EXECUTE_RPC, e);
+        }
+    }
+
+    private BigBoardDebugInfoVO getConnectionInfo(final String division, final String user, final int userType) throws DataAccessException {
+		VistaLinkConnection conn = null;
+    	ConnectionFactory connectionFactory = connectionFactoryLocator.getConnectionFactory(division);
+		try {
+			conn = (VistaLinkConnection)connectionFactory.getConnection(createConnectionSpec(division, user, userType));
+		} catch (ResourceException e) {
+			throw new DataAccessResourceFailureException("error getting connection info", e);
+		}
+	    VistaLinkServerInfo vistaLinkServerInfo = conn.getConnectionInfo();
+	    BigBoardDebugInfoVO bbd = new BigBoardDebugInfoVO(vistaLinkServerInfo.getAddress().toString(), new Integer(vistaLinkServerInfo.getPort()).toString());
+	    return bbd;
+    } 	   
+    	
+    private VistaLinkConnectionSpec createConnectionSpec(String division, String user, int userType) {
+        switch (userType) {
+            case USER_TYPE_APPLICATION_PROXY:
+                return new VistaLinkAppProxyConnectionSpec(division, user);
+            case USER_TYPE_DUZ:
+            default:
+                return new VistaLinkDuzConnectionSpec(division, user);
+        }
+    }
+
+    public int getTimeOut() {
+        return timeOut;
+    }
+
+    public void setTimeOut(int timeOut) {
+        this.timeOut = timeOut;
+    }
+
+    public String getRpcContext() {
+        return rpcContext;
+    }
+
+    public void setRpcContext(String rpcContext) {
+        this.rpcContext = rpcContext;
+    }
+
+    public ConnectionFactoryLocator getConnectionFactoryLocator() {
+        return connectionFactoryLocator;
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/vo/BigBoardDebugInfoVO.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/vo/BigBoardDebugInfoVO.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/vo/BigBoardDebugInfoVO.java	(revision 1227)
@@ -0,0 +1,74 @@
+package gov.va.med.edp.vo;
+
+public class BigBoardDebugInfoVO {
+
+	private String vistalinkIPAddress;
+    private String vistalinkPort;
+    private String siteId;
+    private String machineName;	
+
+	public BigBoardDebugInfoVO(String vistalinkIPAddress, String vistalinkPort) {
+		super();
+		this.vistalinkIPAddress = vistalinkIPAddress;
+		this.vistalinkPort = vistalinkPort;
+	}
+    
+	public BigBoardDebugInfoVO() {
+		super();
+	}
+    
+    public String getVistalinkIPAddress() {
+		return vistalinkIPAddress;
+	}
+
+
+
+	public void setVistalinkIPAddress(String vistalinkIPAddress) {
+		this.vistalinkIPAddress = vistalinkIPAddress;
+	}
+
+
+
+	public String getVistalinkPort() {
+		return vistalinkPort;
+	}
+
+
+
+	public void setVistalinkPort(String vistalinkPort) {
+		this.vistalinkPort = vistalinkPort;
+	}
+
+
+
+	public String getSiteId() {
+		return siteId;
+	}
+
+
+
+	public void setSiteId(String siteId) {
+		this.siteId = siteId;
+	}
+
+
+
+	public String getMachineName() {
+		return machineName;
+	}
+
+
+
+	public void setMachineName(String machineName) {
+		this.machineName = machineName;
+	}
+
+
+    public String toString() {
+        return "<vistalinkConnectionInfo><vistalinkIPAddress>" + vistalinkIPAddress + "</vistalinkIPAddress>" +
+                "<vistalinkPort>" + vistalinkPort + "</vistalinkPort>" +
+                "<siteId>" + siteId + "</siteId>" +
+                "<machineName>" + machineName + "</machineName>" +
+                "</vistalinkConnectionInfo>";
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/vo/SessionVO.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/vo/SessionVO.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/vo/SessionVO.java	(revision 1227)
@@ -0,0 +1,52 @@
+package gov.va.med.edp.vo;
+
+public class SessionVO {
+
+    static final int DEFAULT_TIMEOUT_MS = 300000;   // 5 minutes
+    static final int DEFAULT_COUNTDOWN_MS = 10000;  // 10 seconds
+
+    private String serverPackageVersion;
+    private int timeOutMillis = DEFAULT_TIMEOUT_MS;
+    private int countDownMillis = DEFAULT_COUNTDOWN_MS;
+
+    public String getServerPackageVersion() {
+        return serverPackageVersion;
+    }
+
+    public void setServerPackageVersion(String serverPackageVersion) {
+        this.serverPackageVersion = serverPackageVersion;
+    }
+
+    public int getTimeOutMillis() {
+        return timeOutMillis;
+    }
+
+    public void setTimeOutMillis(int timeOutMillis) {
+        this.timeOutMillis = timeOutMillis;
+    }
+
+    public int getCountDownMillis() {
+        return countDownMillis;
+    }
+
+    public void setCountDownMillis(int countDownMillis) {
+        this.countDownMillis = countDownMillis;
+    }
+
+    /**
+     * Calculates the time, in seconds, between client requests before the servlet container will invalidate this session.
+     *
+     * @return
+     */
+    public int getMaxInactiveInterval() {
+        return (getTimeOutMillis() + getCountDownMillis()) / 1000 + 60;
+    }
+
+    public String toString() {
+        return "SessionVO{" +
+                "serverPackageVersion='" + serverPackageVersion + '\'' +
+                ", timeOutMillis=" + timeOutMillis +
+                ", countDownMillis=" + countDownMillis +
+                '}';
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/BigBoardClientVersionSynchronizationController.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/BigBoardClientVersionSynchronizationController.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/BigBoardClientVersionSynchronizationController.java	(revision 1227)
@@ -0,0 +1,93 @@
+package gov.va.med.edp.web.controller;
+
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+
+import org.apache.log4j.Logger;
+import org.springframework.util.Assert;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * TODO: document BigBoardClientVersionSynchronizationController
+ */
+public class BigBoardClientVersionSynchronizationController extends ClientVersionSynchronizationController {
+
+
+	private String errorMsg;
+
+    private static Logger logger = Logger.getLogger(BigBoardClientVersionSynchronizationController.class);
+
+	
+    public void afterPropertiesSet() throws Exception {
+    	setRequireSession(false);
+        super.afterPropertiesSet();
+        Assert.notNull(serverPackageVersionDao, "serverPackageVersionDao must not be null");
+    	Assert.notNull(getSiteCodeDao(), "siteCodeDao is required");
+    	Assert.notNull(getTrackingDao(), "trackingDao is required");
+    	
+    }
+
+    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
+    	//First attempt is to get the machineName from HTTP Header:EdisClientMachineName as decided 
+    	// this HTTP header is appended by the load balancer and the value of this header (the machine name)
+    	//is parsed by the load balancer.
+    	String machineName = parseCNFromHttpHeaders(request.getHeader(MACHINE_NAME_HEADER));    	
+
+    	if (StringUtils.hasText(machineName)){
+    		debug("Machine name obtained from HTTP Header:" + MACHINE_NAME_HEADER + " was: " + machineName);
+    	} else {
+    		debug("No Machine name was found in HTTP Header:" + MACHINE_NAME_HEADER );
+    		machineName = getMachineNameFromUserPrincipalOrSessionOrRequest(request);
+    	}
+    	//set the machine name in an existing session for refreshes/restored sessions
+		HttpSession session = request.getSession(false);
+		if (session != null){
+		session.setAttribute(MACHINE_NAME_PARAM, machineName);
+		} else {
+    		return createErrorModelAndView("Invalid Session was detected. Please try re-launching the EDIS Big Board");
+		}
+    	
+    	String siteCode = getSiteCodeDao().getSiteCode(machineName);
+		debug("Site Code Obtained for Machine: " + machineName + " was: " + siteCode);
+
+    	if (!StringUtils.hasText(siteCode)){
+    		errorMsg = "A matching site code for the machine: " + machineName + " was not found in the EDP.SiteMapper table.\n" +
+    						"Please contact the EDIS national help desk with this message for remedy.";
+    		return createErrorModelAndView(errorMsg);
+    	}    	
+		
+		String serverPackageVersion = (String) request.getSession().getAttribute(SessionConstants.SERVER_PACKAGE_VERSION_KEY);
+    	if (serverPackageVersion == null) {
+        	serverPackageVersion = serverPackageVersionDao.getServerPackageVersion(siteCode);
+            request.getSession().setAttribute(SessionConstants.SERVER_PACKAGE_VERSION_KEY, serverPackageVersion);
+        }
+		debug("serverPackageVersion is: " + serverPackageVersion);
+
+    	if (isBoardNameAvailableForMachine(siteCode, machineName, request)) return super.handleRequestInternal(request, response);
+        
+        return createErrorModelAndView(errorMsg);
+    }
+
+	private boolean isBoardNameAvailableForMachine(String siteCode, String machineName, HttpServletRequest request) {
+		String result = getTrackingDao().executeCommand(siteCode, "0", buildParameterMap(request,machineName));
+    	if (result.startsWith("<error>")){
+    		int start = result.indexOf("<error>");
+    		int end = result.indexOf("</error>");
+    		errorMsg = result.substring(start + 7, end);
+    		debug("isBoardNameAvailableForMachine: false");
+    		return false;
+    	} 
+    	debug("isBoardNameAvailableForMachine: true");
+    	return true;
+	}
+
+    private void debug(String s) {
+    	if (logger.isDebugEnabled()){
+    		logger.debug(s);
+    	}
+	}
+
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/BigDisplayBoardController.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/BigDisplayBoardController.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/BigDisplayBoardController.java	(revision 1227)
@@ -0,0 +1,92 @@
+package gov.va.med.edp.web.controller;
+
+import gov.va.med.edp.vo.BigBoardDebugInfoVO;
+import gov.va.med.edp.web.view.XmlView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.util.Assert;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.support.WebContentGenerator;
+
+public class BigDisplayBoardController extends SiteCodeController implements InitializingBean {
+
+    private static final String MACHINE_NAME_PARAM = SiteCodeController.MACHINE_NAME_PARAM;
+    public static final String MACHINE_NAME_HEADER = SiteCodeController.MACHINE_NAME_HEADER;
+
+    protected static final String XML_VIEW = "xmlView";
+    
+    private static Logger log = Logger.getLogger(BigDisplayBoardController.class);
+
+    public BigDisplayBoardController() {
+        setRequireSession(false);
+        setSupportedMethods(new String[]{WebContentGenerator.METHOD_POST, WebContentGenerator.METHOD_GET});
+    }
+
+    public void afterPropertiesSet() throws Exception {
+    	Assert.notNull(getSiteCodeDao(), "siteCodeDao is required");
+    	Assert.notNull(getTrackingDao(), "trackingDao is required");
+    	Assert.notNull(getServerPackageVersionDao(), "ServerPackageVersionDao is required");
+    }
+
+    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
+		String result = "";
+    	//First attempt is to get the machineName from HTTP Header:EdisClientMachineName as decided 
+    	// this HTTP header is appended by the load balancer and the value of this header (the machine name)
+    	//is parsed by the load balancer.
+    	String machineName = parseCNFromHttpHeaders(request.getHeader(MACHINE_NAME_HEADER)); 
+    	
+    	if (StringUtils.hasText(machineName)){
+			clearRequestAndSession(request);
+    	} else {
+    		machineName = getMachineNameFromUserPrincipalOrSessionOrRequest(request);
+    	}
+    	debug("Machine name obtained from certificate/HTTP Header/request/session:" + machineName);
+    	String siteCode = getSiteCodeDao().getSiteCode(machineName);
+    	
+    	if (!StringUtils.hasText(siteCode)){
+    		String errorMsg = "No site code was found for the machine name: " + machineName;
+    		return createErrorModelAndView(errorMsg);
+    	}    	
+
+    	result = getTrackingDao().executeCommand(siteCode, "0", buildParameterMap(request,machineName));
+    	if (isInitCommand(request))
+    	result = appendSiteAndVistaLinkConnectionInfo(result, request, siteCode, machineName);    	
+    	return createModelAndView(result, siteCode, machineName);
+    }
+
+
+	private void clearRequestAndSession(HttpServletRequest request) {
+		request.getSession().setAttribute(MACHINE_NAME_PARAM, null);
+		request.setAttribute(MACHINE_NAME_PARAM, null);
+	}
+
+	private boolean isInitCommand(HttpServletRequest request) {
+		if (request.getParameter("command").equals("initDisplayBoard")) return true;
+		return false;
+	}	
+
+    protected ModelAndView createModelAndView(String result, String siteCode, String machineName) {
+    	return new ModelAndView(XML_VIEW, XmlView.XML_FRAGMENT, result);
+    }
+
+    private String appendSiteAndVistaLinkConnectionInfo(String result,HttpServletRequest request, String siteCode, String machineName) {
+    	BigBoardDebugInfoVO vistalinkInfo = serverPackageVersionDao.getVistaLinkConnectionInfo(siteCode);
+    	vistalinkInfo.setSiteId(siteCode);
+    	vistalinkInfo.setMachineName(machineName);
+    	result = result.concat(vistalinkInfo.toString());
+    	return result;
+    }
+
+	private void debug(String s) {
+    	if (log.isDebugEnabled()){
+    		log.debug(s);
+    	}
+	}    
+
+
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/ClientVersionSynchronizationController.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/ClientVersionSynchronizationController.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/ClientVersionSynchronizationController.java	(revision 1227)
@@ -0,0 +1,122 @@
+package gov.va.med.edp.web.controller;
+
+import gov.va.med.edp.web.servlet.listener.TimeOutIntegrationSessionAttributeListener;
+
+import java.util.Random;
+import java.util.Set;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.core.io.Resource;
+import org.springframework.dao.DataAccessException;
+import org.springframework.util.Assert;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * TODO: document PackageClientVersionSynchronizationController
+ */
+public class ClientVersionSynchronizationController extends SiteCodeController implements InitializingBean {
+
+    public static final String DEFAULT_INCOMPATIBILITY_VIEW = "incompatibilityView";
+
+    private String clientArtifactId;
+    private String viewName;
+    private String incompatibilityViewName = DEFAULT_INCOMPATIBILITY_VIEW;
+    private Random random = new Random();
+
+    public ClientVersionSynchronizationController() {
+        setRequireSession(true);
+    }
+
+    public void afterPropertiesSet() throws Exception {
+        Assert.notNull(clientArtifactId, "clientArtifactId must not be null");
+        Assert.notNull(viewName, "viewName must not be null");
+    }
+
+    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
+        String serverPackageVersion = (String) request.getSession().getAttribute(SessionConstants.SERVER_PACKAGE_VERSION_KEY);
+        if (serverPackageVersion == null) {
+            DataAccessException error = (DataAccessException) request.getSession().getAttribute(SessionConstants.SERVER_ERROR_KEY);
+            if (error != null) {
+                throw error;
+            } else {
+                throw new IllegalStateException("Didn't find server package version number or an error explaining its absence in session. Is the " +
+                        TimeOutIntegrationSessionAttributeListener.class.getName() + " session listener configured correctly?");
+            }
+        }
+
+        String swfID = generateAndRememberSwfId(request);
+
+        return createModelAndView(serverPackageVersion, swfID);
+    }
+
+    // generate a swf id and add to list for this session        
+    private String generateAndRememberSwfId(HttpServletRequest request) {
+        String swfID = generateUid();
+        String ids = (String) request.getSession().getAttribute(SessionConstants.RECOGNIZED_SWF_IDS_KEY);
+
+        Set idSet = StringUtils.commaDelimitedListToSet(ids);
+        while (idSet.contains(swfID)) {
+            swfID = generateUid();
+        }
+        idSet.add(swfID);
+        ids = StringUtils.collectionToCommaDelimitedString(idSet);
+
+        request.getSession().setAttribute(SessionConstants.RECOGNIZED_SWF_IDS_KEY, ids);
+        return swfID;
+    }
+
+    protected ModelAndView createModelAndView(String serverPackageVersion, String swfID) {
+        ModelAndView mav = new ModelAndView(isCompatible(serverPackageVersion) ? getViewName() : getIncompatibilityViewName());
+        mav.addObject("swfID", swfID);
+        mav.addObject("serverPackageVersion", serverPackageVersion);
+        mav.addObject("clientVersion", serverPackageVersion); // TODO: remove this from flashVars after Flex 3 migration (use resource bundle inside SWF)
+        mav.addObject("clientArtifactId", getClientArtifactId());
+        mav.addObject("clientFinalName", getClientFinalName(serverPackageVersion));
+        return mav;
+    }
+
+    private String generateUid() {
+        return Integer.toString(Math.abs(random.nextInt()));
+    }
+
+    private boolean isCompatible(String serverPackageVersion) {
+        Resource r = getWebApplicationContext().getResource(getClientFileName(serverPackageVersion));
+        return r.exists();
+    }
+
+    private String getClientFinalName(String serverPackageVersion) {
+        return getClientArtifactId() + "-" + serverPackageVersion;
+    }
+
+    private String getClientFileName(String serverPackageVersion) {
+        return getClientFinalName(serverPackageVersion) + ".swf";
+    }
+
+    public String getClientArtifactId() {
+        return clientArtifactId;
+    }
+
+    public void setClientArtifactId(String clientArtifactId) {
+        this.clientArtifactId = clientArtifactId;
+    }
+
+    public String getViewName() {
+        return viewName;
+    }
+
+    public void setViewName(String viewName) {
+        this.viewName = viewName;
+    }
+
+    public String getIncompatibilityViewName() {
+        return incompatibilityViewName;
+    }
+
+    public void setIncompatibilityViewName(String incompatibilityViewName) {
+        this.incompatibilityViewName = incompatibilityViewName;
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/ExportReportController.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/ExportReportController.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/ExportReportController.java	(revision 1227)
@@ -0,0 +1,19 @@
+package gov.va.med.edp.web.controller;
+
+import gov.va.med.edp.web.view.CsvView;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.support.WebContentGenerator;
+
+public class ExportReportController extends TrackingController {
+    private static final String CSV_VIEW = "csvView";
+
+    public ExportReportController() {
+        super();
+        setSupportedMethods(new String[]{WebContentGenerator.METHOD_POST, WebContentGenerator.METHOD_GET});
+    }    
+    
+    protected ModelAndView createModelAndView(String result) {
+        return new ModelAndView(CSV_VIEW, CsvView.CSV_MODEL, result);
+    }
+    
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/LogoutController.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/LogoutController.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/LogoutController.java	(revision 1227)
@@ -0,0 +1,60 @@
+package gov.va.med.edp.web.controller;
+
+import org.springframework.web.servlet.mvc.AbstractController;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.util.StringUtils;
+import org.springframework.util.Assert;
+import org.springframework.beans.factory.InitializingBean;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Set;
+
+/**
+ * Controller for handling logout.
+ * <p/>
+ * Only logic for logout other than invalidating the session is remove the swfID from the list of recognized ones
+ * for this session. If the count drops to 0, or the swfID is not supplied, then invalidate the session.
+ */
+public class LogoutController extends AbstractController implements InitializingBean {
+
+    public static final String DEFAULT_VIEW_NAME = "logout";
+
+    private String viewName = DEFAULT_VIEW_NAME;
+
+    public void afterPropertiesSet() throws Exception {
+        Assert.notNull(viewName, "viewName must not be null");
+    }
+
+    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
+        String swfID = request.getParameter("swfID");
+        if (!StringUtils.hasLength(swfID)) {
+            request.getSession().invalidate();
+        } else {
+            String ids = (String) request.getSession().getAttribute(SessionConstants.RECOGNIZED_SWF_IDS_KEY);
+            Set idSet = StringUtils.commaDelimitedListToSet(ids);
+            if (idSet.isEmpty()) {
+                request.getSession().invalidate();
+            } else {
+                idSet.remove(swfID);
+                if (idSet.isEmpty()) {
+                    request.getSession().setAttribute(SessionConstants.RECOGNIZED_SWF_IDS_KEY, null);
+                    request.getSession().invalidate();
+                } else {
+                    ids = StringUtils.collectionToCommaDelimitedString(idSet);
+                    request.getSession().setAttribute(SessionConstants.RECOGNIZED_SWF_IDS_KEY, ids);
+                }
+            }
+        }
+
+        return new ModelAndView(getViewName());
+    }
+
+    public String getViewName() {
+        return viewName;
+    }
+
+    public void setViewName(String viewName) {
+        this.viewName = viewName;
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/NoUserInfoInSessionException.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/NoUserInfoInSessionException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/NoUserInfoInSessionException.java	(revision 1227)
@@ -0,0 +1,4 @@
+package gov.va.med.edp.web.controller;
+
+public class NoUserInfoInSessionException extends Exception {
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/SessionConstants.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/SessionConstants.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/SessionConstants.java	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.web.controller;
+
+/**
+ * Constants used as keys for session attributes.
+ */
+public class SessionConstants {
+
+    public static final String SERVER_PACKAGE_VERSION_KEY = "edis.server.package.version";
+    public static final String SERVER_ERROR_KEY = "edis.server.error";
+    public static final String RECOGNIZED_SWF_IDS_KEY = "edis.swf.ids";
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/SiteCodeController.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/SiteCodeController.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/SiteCodeController.java	(revision 1227)
@@ -0,0 +1,132 @@
+package gov.va.med.edp.web.controller;
+
+import gov.va.med.edp.dao.ServerPackageVersionDao;
+import gov.va.med.edp.dao.SiteCodeLookUpDao;
+import gov.va.med.edp.dao.TrackingDao;
+
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.log4j.Logger;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.AbstractController;
+
+public abstract class SiteCodeController extends AbstractController {
+
+    public static final String MACHINE_NAME_PARAM = "machineName";
+    public static final String SITE_CODE_PARAM = "siteCode";    
+    public static final String MACHINE_NAME_HEADER = "EdisClientMachineName";
+    
+    private SiteCodeLookUpDao siteCodeDao;
+	private TrackingDao trackingDao;
+
+    private String errorViewName;
+	protected ServerPackageVersionDao serverPackageVersionDao;
+	
+    private static Logger log = Logger.getLogger(SiteCodeController.class);
+    
+
+    protected ModelAndView createErrorModelAndView(String errorMessage) {
+        ModelAndView mav = new ModelAndView(getErrorViewName());
+        mav.addObject("errorMessage", errorMessage);
+        return mav;
+    }    
+    
+	public SiteCodeLookUpDao getSiteCodeDao() {
+		return siteCodeDao;
+	}
+
+
+	public void setSiteCodeDao(SiteCodeLookUpDao siteCodeDao) {
+		this.siteCodeDao = siteCodeDao;
+	}
+
+
+	public String getErrorViewName() {
+		return errorViewName;
+	}
+
+
+	public void setErrorViewName(String errorViewName) {
+		this.errorViewName = errorViewName;
+	}
+	
+    protected Map buildParameterMap(HttpServletRequest request, String machineName) {
+        Map params = new HashMap();
+        Enumeration e = request.getParameterNames();
+        while (e.hasMoreElements()) {
+            String paramName = (String) e.nextElement();
+            params.put(paramName, request.getParameter(paramName));
+        }
+        //add the machine name that needs to be passed into M here
+        params.put("machine", machineName.toUpperCase());
+        debug("Parameters:" + params.toString());
+        
+        return params;
+    }
+
+    protected String parseCNFromHttpHeaders(String machineName){
+    	if (StringUtils.hasText(machineName) && machineName.startsWith("CN=")){
+    		return machineName.substring(3);
+    	}
+        debug("Parsed Machine Name from Http Header is:" + machineName);
+    	return machineName;
+    }
+    
+	public TrackingDao getTrackingDao() {
+		return trackingDao;
+	}
+
+
+	public void setTrackingDao(TrackingDao trackingDao) {
+		this.trackingDao = trackingDao;
+	}
+	
+    private void debug(String s) {
+    	if (logger.isDebugEnabled()){
+    		logger.debug(s);
+    	}
+	} 	
+	
+	protected String getMachineNameFromUserPrincipalOrSessionOrRequest(HttpServletRequest request) throws UnrecognizedClientException {
+		String machineName = "";
+    	
+		//first try user principal. This is for situations where we don't have a load balancer in the mix
+		// this is where the client is talking directly to a weblogic server using 2-way ssl..
+    	if (request.getUserPrincipal() != null){
+    		machineName = request.getUserPrincipal().getName();
+			debug("Machine name retrieved from user principal is:" + machineName);
+    	}
+		
+		//then try request
+		if (!StringUtils.hasText(machineName)){
+			machineName = request.getParameter(MACHINE_NAME_PARAM);
+			debug("Machine name retrieved from HTTP Request is:" + machineName);
+		}
+    	//then try the session..	
+    	if (!StringUtils.hasText(machineName)){
+    		machineName =(String)request.getSession().getAttribute(MACHINE_NAME_PARAM);
+			debug("Machine name retrieved from HTTP Session is:" + machineName);
+    	}		
+    	
+		if (StringUtils.hasText(machineName)){
+			return machineName;
+		} else {
+    		throw new UnrecognizedClientException(UnrecognizedClientException.NO_MACHINE_NAME_PARAM_MESSAGE, MACHINE_NAME_PARAM);
+		}
+	}
+
+	public void setServerPackageVersionDao(ServerPackageVersionDao serverPackageVersionDao) {
+	    this.serverPackageVersionDao = serverPackageVersionDao;
+	}	
+    
+	public ServerPackageVersionDao getServerPackageVersionDao() {
+	    return this.serverPackageVersionDao;
+	}	
+	
+	
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/TestController.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/TestController.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/TestController.java	(revision 1227)
@@ -0,0 +1,79 @@
+package gov.va.med.edp.web.controller;
+
+import java.util.Enumeration;
+import java.util.Iterator;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.util.Assert;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.AbstractController;
+
+/**
+ * TODO: document PackageClientVersionSynchronizationController
+ */
+public class TestController extends AbstractController implements InitializingBean {
+
+    public static final String EDIS_MACHINE_NAME_HEADER = "EdisClientMachineName";
+    
+    private String viewName;
+    private static Logger logger = Logger.getLogger(TestController.class);
+
+    public TestController() {
+        setRequireSession(true);
+    }
+
+    public void afterPropertiesSet() throws Exception {
+        Assert.notNull(viewName, "viewName must not be null");
+    }
+
+    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
+    	if (logger.isDebugEnabled()){
+    		logger.debug("Inside handleRequestInternal() method. The view name is:" + getViewName());
+    		logger.debug("The value for the HTTP Header '" + EDIS_MACHINE_NAME_HEADER + "' is: " + getClientMachineName(request));
+    	}
+    		
+        ModelAndView mav = new ModelAndView(getViewName());
+        mav.addObject(EDIS_MACHINE_NAME_HEADER, getClientMachineName(request));
+        mav.addObject("HttpHeaders", getAllHttpHeaders(request));
+        return mav;    
+    }
+
+
+    private Object getAllHttpHeaders(HttpServletRequest request) {
+		String headers = "";
+		Enumeration headersEnum = request.getHeaderNames();
+		while (headersEnum.hasMoreElements()) {
+			String headerName = (String) headersEnum.nextElement();
+			headers = headers + headerName + "=" + request.getHeader(headerName) + "<br/>";
+		}
+		return headers;
+	}
+
+	private String getClientMachineName(HttpServletRequest request) {
+		return parseMachineName(request.getHeader(EDIS_MACHINE_NAME_HEADER));
+	}
+
+    
+    private String parseMachineName(String machineName){
+    	if (StringUtils.hasText(machineName) && machineName.startsWith("CN=")){
+    		String name = machineName.substring(3);
+    		return name;
+    	}
+    	return machineName;
+    }
+    
+	public String getViewName() {
+        return viewName;
+    }
+
+    public void setViewName(String viewName) {
+        this.viewName = viewName;
+    }
+
+
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/TrackingController.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/TrackingController.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/TrackingController.java	(revision 1227)
@@ -0,0 +1,96 @@
+package gov.va.med.edp.web.controller;
+
+import gov.va.med.authentication.kernel.LoginUserInfoVO;
+import gov.va.med.edp.dao.ServerPackageVersionDao;
+import gov.va.med.edp.dao.TrackingDao;
+import gov.va.med.edp.vo.BigBoardDebugInfoVO;
+import gov.va.med.edp.web.view.XmlView;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.util.Assert;
+import org.springframework.util.StringUtils;
+import org.springframework.web.servlet.ModelAndView;
+import org.springframework.web.servlet.mvc.AbstractController;
+import org.springframework.web.servlet.support.WebContentGenerator;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Enumeration;
+import java.util.Set;
+
+public class TrackingController extends AbstractController implements InitializingBean {
+
+    private TrackingDao trackingDao;
+    private ServerPackageVersionDao serverPackageVersionDao;
+    protected static final String XML_VIEW = "xmlView";
+
+    public TrackingController() {
+        setRequireSession(true);
+        setSupportedMethods(new String[]{WebContentGenerator.METHOD_POST});
+    }
+
+    public void afterPropertiesSet() throws Exception {
+        Assert.notNull(trackingDao, "trackingDao is required");
+    }
+
+    protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
+        validateSwfID(request);
+        LoginUserInfoVO userInfo = getUserInfo(request);
+        String result = trackingDao.executeCommand(userInfo.getLoginStationNumber(), userInfo.getUserDuz(), buildParameterMap(request));
+        if (isInitDisplayBoardCommand(request))
+        result = appendSiteAndVistaLinkConnectionInfo(result, request);
+        return createModelAndView(result);
+    }
+
+    private void validateSwfID(HttpServletRequest request) throws UnrecognizedClientException {
+        String swfID = request.getParameter("swfID");
+        if (!StringUtils.hasLength(swfID)) return;
+
+        String ids = (String) request.getSession().getAttribute(SessionConstants.RECOGNIZED_SWF_IDS_KEY);
+        Set idSet = StringUtils.commaDelimitedListToSet(ids);
+        if (idSet.isEmpty()) throw new UnrecognizedClientException(UnrecognizedClientException.UNRECOGNIZED_CLIENT_MESSAGE, swfID);
+        if (!idSet.contains(swfID)) throw new UnrecognizedClientException(UnrecognizedClientException.UNRECOGNIZED_CLIENT_MESSAGE, swfID);
+    }
+
+    public void setTrackingDao(TrackingDao trackingDao) {
+        this.trackingDao = trackingDao;
+    }
+
+    public void setServerPackageVersionDao(ServerPackageVersionDao serverPackageVersionDao) {
+        this.serverPackageVersionDao = serverPackageVersionDao;
+    }    
+    
+    protected LoginUserInfoVO getUserInfo(HttpServletRequest request) throws NoUserInfoInSessionException {
+        LoginUserInfoVO userInfo = (LoginUserInfoVO) request.getSession().getAttribute(LoginUserInfoVO.SESSION_KEY);
+        if (userInfo == null) throw new NoUserInfoInSessionException();
+        return userInfo;
+    }
+
+    protected ModelAndView createModelAndView(String result) {
+        return new ModelAndView(XML_VIEW, XmlView.XML_FRAGMENT, result);
+    }
+
+	private boolean isInitDisplayBoardCommand(HttpServletRequest request) {
+		if (request.getParameter("command").equals("initDisplayBoard")) return true;
+		return false;
+	}    
+    
+    private String appendSiteAndVistaLinkConnectionInfo(String result,HttpServletRequest request) throws Exception{
+    	String stnNumber = getUserInfo(request).getLoginStationNumber();
+    	BigBoardDebugInfoVO vistalinkInfo = serverPackageVersionDao.getVistaLinkConnectionInfo(stnNumber);
+    	vistalinkInfo.setSiteId(stnNumber);
+    	result = result.concat(vistalinkInfo.toString());
+    	return result;
+    }	
+	
+    protected Map buildParameterMap(HttpServletRequest request) {
+        Map params = new HashMap();
+        Enumeration e = request.getParameterNames();
+        while (e.hasMoreElements()) {
+            String paramName = (String) e.nextElement();
+            params.put(paramName, request.getParameter(paramName));
+        }
+        return params;
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/UnrecognizedClientException.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/UnrecognizedClientException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/controller/UnrecognizedClientException.java	(revision 1227)
@@ -0,0 +1,14 @@
+package gov.va.med.edp.web.controller;
+
+/**
+ * TODO: document UnrecognizedClientException
+ */
+public class UnrecognizedClientException extends Exception {
+	
+	public static final String UNRECOGNIZED_CLIENT_MESSAGE = "request from an unrecognized client with swfID=";
+	public static final String NO_MACHINE_NAME_PARAM_MESSAGE = "Could not find machine name in the HTTPHeader " + SiteCodeController.MACHINE_NAME_HEADER + " nor found the machine name in user principal or request parameter with name";
+	
+    public UnrecognizedClientException(String message, String swfID) {
+        super(message + "'" + swfID + "'");
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/handler/ExceptionResolver.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/handler/ExceptionResolver.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/handler/ExceptionResolver.java	(revision 1227)
@@ -0,0 +1,14 @@
+package gov.va.med.edp.web.handler;
+
+import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class ExceptionResolver extends SimpleMappingExceptionResolver{
+    protected ModelAndView getModelAndView(String viewName, Exception ex, HttpServletRequest request) {
+        ModelAndView mav = super.getModelAndView(viewName, ex, request);
+        mav.addObject("resource", request.getRequestURI());
+        return mav;
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/servlet/filter/ResponseHeaderFilter.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/servlet/filter/ResponseHeaderFilter.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/servlet/filter/ResponseHeaderFilter.java	(revision 1227)
@@ -0,0 +1,50 @@
+package gov.va.med.edp.web.servlet.filter;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Enumeration;
+
+/**
+ * Servlet filter that sets HTTP Response Headers based on initialization parameters.
+ * <p/>
+ * Example usage in web.xml of servlet application:
+ * <code>
+ * <filter>
+ * <filter-name>responseHeaderFilter</filter-name>
+ * <filter-class>gov.va.med.edp.web.servlet.filter.ResponseHeaderFilter</filter-class>
+ * <init-param>
+ * <param-name>Cache-Control</param-name>
+ * <param-value>max-age=3600</param-value>
+ * </init-param>
+ * </filter>
+ * ...
+ * <filter-mapping>
+ * <filter-name>responseHeaderFilter</filter-name>
+ * <url-pattern>/logo.png</url-pattern>
+ * </filter-mapping>
+ * </code>
+ */
+public class ResponseHeaderFilter implements Filter {
+
+    FilterConfig filterConfig;
+
+    public void init(FilterConfig filterConfig) throws ServletException {
+        this.filterConfig = filterConfig;
+    }
+
+    public void doFilter(ServletRequest req, ServletResponse res, FilterChain filterChain) throws IOException, ServletException {
+        HttpServletResponse response = (HttpServletResponse) res;
+        // set the provided HTTP response parameters
+        for (Enumeration e = filterConfig.getInitParameterNames(); e.hasMoreElements();) {
+            String headerName = (String) e.nextElement();
+            response.addHeader(headerName, filterConfig.getInitParameter(headerName));
+        }
+
+        filterChain.doFilter(req, response);
+    }
+
+    public void destroy() {
+        this.filterConfig = null;
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/servlet/listener/TimeOutIntegrationSessionAttributeListener.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/servlet/listener/TimeOutIntegrationSessionAttributeListener.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/servlet/listener/TimeOutIntegrationSessionAttributeListener.java	(revision 1227)
@@ -0,0 +1,63 @@
+package gov.va.med.edp.web.servlet.listener;
+
+import gov.va.med.authentication.kernel.LoginUserInfoVO;
+import gov.va.med.edp.dao.SessionDao;
+import gov.va.med.edp.vo.SessionVO;
+import gov.va.med.edp.web.controller.SessionConstants;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.web.context.WebApplicationContext;
+import org.springframework.web.context.support.WebApplicationContextUtils;
+import org.springframework.dao.DataAccessException;
+
+import javax.servlet.http.HttpSessionAttributeListener;
+import javax.servlet.http.HttpSessionBindingEvent;
+
+public class TimeOutIntegrationSessionAttributeListener implements HttpSessionAttributeListener {
+    private static final String SESSION_DAO_BEAN_NAME = "sessionDao";
+
+    private static final Log log = LogFactory.getLog(TimeOutIntegrationSessionAttributeListener.class);
+
+    public void attributeAdded(HttpSessionBindingEvent event) {
+        if (!event.getName().equals(LoginUserInfoVO.SESSION_KEY)) return;
+
+        setTimeOut(event);
+    }
+
+    public void attributeRemoved(HttpSessionBindingEvent event) {
+        if (!event.getName().equals(LoginUserInfoVO.SESSION_KEY)) return;
+    }
+
+    public void attributeReplaced(HttpSessionBindingEvent event) {
+        if (!event.getName().equals(LoginUserInfoVO.SESSION_KEY)) return;
+
+        setTimeOut(event);
+    }
+
+    private void setTimeOut(HttpSessionBindingEvent event) {
+        LoginUserInfoVO userInfo = (LoginUserInfoVO) event.getValue();
+
+        try {
+            WebApplicationContext ac = getApplicationContext(event);
+            SessionDao dao = (SessionDao) ac.getBean(SESSION_DAO_BEAN_NAME, SessionDao.class);
+
+            SessionVO sessionInfo = dao.getSessionInfo(userInfo.getLoginStationNumber(), userInfo.getUserDuz());
+
+            String serverPackageVersion = sessionInfo.getServerPackageVersion();
+            if (log.isDebugEnabled()) log.debug("set server package version to '" + serverPackageVersion + "'");
+            event.getSession().setAttribute(SessionConstants.SERVER_PACKAGE_VERSION_KEY, serverPackageVersion);
+
+            int timeOut = sessionInfo.getMaxInactiveInterval();
+            event.getSession().setMaxInactiveInterval(timeOut);
+            if (log.isDebugEnabled()) log.debug("set timeout for user " + userInfo.getUserDuz() + " to " + timeOut + " seconds.");
+        } catch (DataAccessException e) {
+            log.error("unable to fetch session info", e);
+            event.getSession().setAttribute(SessionConstants.SERVER_ERROR_KEY, e);
+        }
+    }
+
+    private WebApplicationContext getApplicationContext(HttpSessionBindingEvent event) throws IllegalStateException {
+        return WebApplicationContextUtils.getRequiredWebApplicationContext(event.getSession().getServletContext());
+    }
+
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/view/CsvView.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/view/CsvView.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/view/CsvView.java	(revision 1227)
@@ -0,0 +1,23 @@
+package gov.va.med.edp.web.view;
+
+import org.springframework.web.servlet.view.AbstractView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+
+public class CsvView extends AbstractView {
+
+    public static final String CSV_MODEL = "csvModel";   
+    private static final String CONTENT_TYPE = "application/vnd.ms-excel";
+    
+    public CsvView() {
+       setContentType(CONTENT_TYPE);
+    }
+
+    protected void renderMergedOutputModel(Map map, HttpServletRequest request, HttpServletResponse response) throws Exception {
+        HttpCacheControl.addNoCacheHeaders(response);
+        response.getWriter().print(map.get(CSV_MODEL));
+        response.getWriter().close();
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/view/HttpCacheControl.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/view/HttpCacheControl.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/view/HttpCacheControl.java	(revision 1227)
@@ -0,0 +1,18 @@
+package gov.va.med.edp.web.view;
+
+import org.springframework.web.servlet.support.WebContentGenerator;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * TODO: document HttpCacheControl
+ */
+public class HttpCacheControl {
+    static final java.lang.String HEADER_CACHE_CONTROL = "Cache-Control";
+    static final java.lang.String HEADER_EXPIRES = "Expires";
+
+    public static void addNoCacheHeaders(HttpServletResponse response) {
+        response.setHeader(HEADER_CACHE_CONTROL, "no-store, must-revalidate");
+        response.setHeader(HEADER_EXPIRES, "Thu, 01 Jan 1970 01:00:00 GMT");
+    }
+}
Index: EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/view/XmlView.java
===================================================================
--- EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/view/XmlView.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-core/src/main/java/gov/va/med/edp/web/view/XmlView.java	(revision 1227)
@@ -0,0 +1,25 @@
+package gov.va.med.edp.web.view;
+
+import org.springframework.web.servlet.view.AbstractView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.Map;
+
+public class XmlView extends AbstractView {
+    public static final String XML_FRAGMENT = "xmlFragment";
+
+    public XmlView() {
+        setContentType("text/xml;charset=utf-8");
+    }
+
+    protected void renderMergedOutputModel(Map map, HttpServletRequest request, HttpServletResponse response) throws Exception {
+        HttpCacheControl.addNoCacheHeaders(response);
+
+        response.getWriter().println("<?xml version='1.0' encoding='UTF-8'?>");
+        response.getWriter().println("<results>");
+        response.getWriter().println(map.get(XML_FRAGMENT));
+        response.getWriter().println("</results>");
+        response.getWriter().close();
+    }
+}
Index: EDIS/trunk/java/tracking-server-main/pom.xml
===================================================================
--- EDIS/trunk/java/tracking-server-main/pom.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/pom.xml	(revision 1227)
@@ -0,0 +1,233 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>gov.va.med.edp</groupId>
+        <artifactId>edis-tracking-parent</artifactId>
+        <version>1.0-T29-SNAPSHOT</version>
+        <relativePath>../tracking-parent</relativePath>
+    </parent>
+    <groupId>gov.va.med.edp</groupId>
+    <artifactId>edis-tracking-server-main</artifactId>
+    <packaging>war</packaging>
+    <name>EDIS Tracking Server Application</name>
+    <version>1.0-T29-SNAPSHOT</version>
+    <description>Emergency Department Integration Software - Tracking Server Application</description>
+    <dependencies>
+        <dependency>
+            <groupId>gov.va.med.edp</groupId>
+            <artifactId>edis-tracking-ui-main</artifactId>
+            <version>${project.version}</version>
+            <type>swf</type>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>gov.va.med.edp</groupId>
+            <artifactId>edis-tracking-ui-bigboard</artifactId>
+            <version>${project.version}</version>
+            <type>swf</type>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>gov.va.med.edp</groupId>
+            <artifactId>edis-tracking-server-core</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>gov.va.med.authentication</groupId>
+            <artifactId>kaajee</artifactId>
+            <version>1.0.1.002</version>
+        </dependency>
+        <dependency>
+            <groupId>gov.va.med.term</groupId>
+            <artifactId>vha-stddata-client</artifactId>
+            <version>${vha.stddata.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>gov.va.med.term</groupId>
+            <artifactId>vha-stddata-basic</artifactId>
+            <version>${vha.stddata.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>com.intersystems</groupId>
+            <artifactId>cache-db</artifactId>
+            <version>5.2</version>
+            <classifier>jdk14</classifier>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>weblogic</groupId>
+            <artifactId>weblogic</artifactId>
+            <version>8.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>javax.servlet</groupId>
+            <artifactId>jstl</artifactId>
+            <version>1.0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>taglibs</groupId>
+            <artifactId>standard</artifactId>
+            <version>1.0.6</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <finalName>${edis.tracking.trackingContextRoot}</finalName>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-war-plugin</artifactId>
+                <configuration>
+                    <webResources>
+                        <resource>
+                            <directory>src/main/webapp/WEB-INF</directory>
+                            <includes>
+                                <include>kaajeeConfig.xml</include>
+                                <include>weblogic.xml</include>
+                            </includes>
+                            <filtering>true</filtering>
+                            <targetPath>WEB-INF</targetPath>
+                        </resource>
+                        <resource>
+                            <directory>${edis.tracking.build.swf.directory}</directory>
+                            <targetPath>/</targetPath>
+                            <filtering>false</filtering>
+                            <includes>
+                                <include>*.swf</include>
+                            </includes>
+                        </resource>
+                    </webResources>
+                </configuration>
+            </plugin>
+            <plugin>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>process-resources</phase>
+                        <configuration>
+                            <tasks>
+                                <tstamp>
+                                    <format property="timestamp" pattern="yyyy/MM/dd HH:mm:ss z"/>
+                                </tstamp>
+                                <replaceregexp byline="true">
+                                    <regexp pattern="app.buildtime=BUILD_TIME_PLACEHOLDER"/>
+                                    <substitution expression="app.buildtime=${timestamp}"/>
+                                    <fileset dir="target" includes="**/*.properties"/>
+                                </replaceregexp>
+                            </tasks>
+                        </configuration>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <dependencies>
+                    <dependency>
+                        <groupId>ant</groupId>
+                        <artifactId>ant-nodeps</artifactId>
+                        <version>1.6.5</version>
+                    </dependency>
+                </dependencies>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <version>2.0</version>
+                <executions>
+                    <execution>
+                        <id>include-latest-client-version</id>
+                        <phase>generate-resources</phase>
+                        <goals>
+                            <goal>copy-dependencies</goal>
+                        </goals>
+                        <configuration>
+                            <includeTypes>swf</includeTypes>
+                            <outputDirectory>${edis.tracking.build.swf.directory}</outputDirectory>
+                            <overWriteSnapshots>true</overWriteSnapshots>
+                            <excludeTransitive>true</excludeTransitive>
+                        </configuration>
+                    </execution>
+                    <execution>
+                       <id>include-backwards-compatible-client-versions</id>
+                       <phase>generate-resources</phase>
+                       <goals>
+                           <goal>copy</goal>
+                       </goals>
+                       <configuration>
+                           <artifactItems>
+								<artifactItem>
+                                    <groupId>${project.groupId}</groupId>
+                                    <artifactId>edis-tracking-ui-main</artifactId>
+                                    <version>1.0-T28</version>
+                                    <type>swf</type>
+                                </artifactItem>
+                           </artifactItems>
+                           <outputDirectory>${edis.tracking.build.swf.directory}</outputDirectory>
+                           <overWriteSnapshots>true</overWriteSnapshots>
+                       </configuration>
+                </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+    <profiles>
+        <profile>
+            <id>dev</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.apache.maven.plugins</groupId>
+                        <artifactId>maven-war-plugin</artifactId>
+                        <configuration>
+                            <webResources>
+                                <resource>
+                                    <directory>src/main/webapp-dev/WEB-INF</directory>
+                                    <includes>
+                                        <include>kaajeeConfig.xml</include>
+                                    </includes>
+                                    <targetPath>WEB-INF</targetPath>
+                                </resource>
+                                <resource>
+                                    <directory>src/main/webapp/WEB-INF</directory>
+                                    <includes>
+                                        <include>weblogic.xml</include>
+                                    </includes>
+                                    <excludes>
+                                        <exclude>kaajeeConfig.xml</exclude>
+                                    </excludes>
+                                    <filtering>true</filtering>
+                                    <targetPath>WEB-INF</targetPath>
+                                </resource>
+                                <resource>
+                                    <directory>${edis.tracking.build.swf.directory}</directory>
+                                    <targetPath>/</targetPath>
+                                    <filtering>false</filtering>
+                                    <includes>
+                                        <include>*.swf</include>
+                                    </includes>
+                                </resource>
+                            </webResources>
+                        </configuration>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+    <properties>
+        <edis.tracking.build.swf.directory>${project.build.directory}/swf</edis.tracking.build.swf.directory>
+    </properties>
+</project>
Index: EDIS/trunk/java/tracking-server-main/src/main/resources/application.properties
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/resources/application.properties	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/resources/application.properties	(revision 1227)
@@ -0,0 +1,9 @@
+# Generated by genAppProperties.xsl at 2007-09-06 02:48:11
+#
+# Application=med.term.access
+# Environment=readonly
+# Database=hsqldb
+#
+gov.va.med.term.access.util.ImplementorRegistry/gov.va.med.term.access.TableManager$Factory=gov.va.med.term.access.readonly.factory.db.TableManagerFactory
+gov.va.med.term.access.util.ImplementorRegistry/gov.va.med.term.access.*$Factory=gov.va.med.term.access.readonly.factory.cache.*Factory
+gov.va.med.term.access.util.ImplementorRegistry/gov.va.med.term.access.readonly.Readonly*$Factory=gov.va.med.term.access.readonly.factory.db.*Factory
Index: EDIS/trunk/java/tracking-server-main/src/main/resources/applicationContext-dao.xml
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/resources/applicationContext-dao.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/resources/applicationContext-dao.xml	(revision 1227)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+    <bean id="trackingDao" class="gov.va.med.edp.dao.rpc.VistaLinkTrackingDao"/>
+    <bean id="bigBoardDao" class="gov.va.med.edp.dao.rpc.VistaLinkBigBoardDao"/>
+    <bean id="sessionDao" class="gov.va.med.edp.dao.rpc.VistaLinkSessionDao"/>
+    <bean id="serverPackageVersionDao" class="gov.va.med.edp.dao.rpc.VistaLinkServerPackageVersionDao"/>
+    
+</beans>
Index: EDIS/trunk/java/tracking-server-main/src/main/resources/strings.properties
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/resources/strings.properties	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/resources/strings.properties	(revision 1227)
@@ -0,0 +1,9 @@
+app.name=Emergency Department Integration Software - Tracking Application
+app.version=${project.version}
+app.buildtime=BUILD_TIME_PLACEHOLDER
+copyright.year=2008
+copyright.organization.url=http://www.va.gov
+copyright.organization=Department of Veterans Affairs
+help.contextRoot=${edis.tracking.helpContextRoot}
+logged.out=You have been logged out.
+login.again=Log in again.
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp-dev/WEB-INF/kaajeeConfig.xml
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp-dev/WEB-INF/kaajeeConfig.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp-dev/WEB-INF/kaajeeConfig.xml	(revision 1227)
@@ -0,0 +1,471 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<kaajee-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="kaajeeConfig.xsd">
+
+
+
+    <!-- host application name, used for login page display and logging -->
+
+    <host-application-name>EDIS Tracking Board</host-application-name>
+
+
+
+    <!-- put each station number for KAAJEE login here -->
+
+    <login-station-numbers>
+
+        <station-number>402</station-number>
+
+        <station-number>405</station-number>
+
+        <station-number>423</station-number>
+
+        <station-number>433</station-number>
+
+        <station-number>436</station-number>
+
+        <station-number>437</station-number>
+
+        <station-number>438</station-number>
+
+        <station-number>442</station-number>
+
+        <station-number>447</station-number>
+
+        <station-number>454</station-number>
+
+        <station-number>459</station-number>
+
+        <station-number>460</station-number>
+        
+        <station-number>463</station-number>
+
+        <station-number>500</station-number>
+
+        <station-number>501</station-number>
+
+        <station-number>502</station-number>
+
+        <station-number>503</station-number>
+
+        <station-number>504</station-number>
+
+        <station-number>506</station-number>
+
+        <station-number>508</station-number>
+
+        <station-number>509</station-number>
+
+        <station-number>509A0</station-number>
+
+        <station-number>512</station-number>
+
+        <station-number>512A5</station-number>
+
+        <station-number>515</station-number>
+
+        <station-number>516</station-number>
+
+        <station-number>517</station-number>
+
+        <station-number>518</station-number>
+
+        <station-number>519</station-number>
+
+        <station-number>520</station-number>
+
+        <station-number>520A0</station-number>
+
+        <station-number>521</station-number>
+
+        <station-number>523</station-number>
+
+        <station-number>523A4</station-number>
+
+        <station-number>523A5</station-number>
+
+        <station-number>524</station-number>
+
+        <station-number>526</station-number>
+
+        <station-number>528</station-number>
+
+        <station-number>528A4</station-number>
+
+        <station-number>528A5</station-number>
+
+        <station-number>528A6</station-number>
+
+        <station-number>528A7</station-number>
+
+        <station-number>528A8</station-number>
+
+        <station-number>529</station-number>
+
+        <station-number>531</station-number>
+
+        <station-number>534</station-number>
+
+        <station-number>537</station-number>
+
+        <station-number>538</station-number>
+
+        <station-number>539</station-number>
+
+        <station-number>540</station-number>
+
+        <station-number>541</station-number>
+
+        <station-number>542</station-number>
+
+        <station-number>544</station-number>
+
+        <station-number>546</station-number>
+
+        <station-number>548</station-number>
+
+        <station-number>549</station-number>
+
+        <station-number>549A4</station-number>
+
+        <station-number>550</station-number>
+
+        <station-number>552</station-number>
+
+        <station-number>553</station-number>
+
+        <station-number>554</station-number>
+
+        <station-number>556</station-number>
+
+        <station-number>557</station-number>
+
+        <station-number>558</station-number>
+
+        <station-number>561</station-number>
+
+        <station-number>561A4</station-number>
+
+        <station-number>562</station-number>
+
+        <station-number>564</station-number>
+
+        <station-number>565</station-number>
+
+        <station-number>568</station-number>
+
+        <station-number>568A4</station-number>
+
+        <station-number>570</station-number>
+
+        <station-number>573</station-number>
+
+        <station-number>573A4</station-number>
+
+        <station-number>575</station-number>
+
+        <station-number>578</station-number>
+
+        <station-number>580</station-number>
+
+        <station-number>581</station-number>
+
+        <station-number>583</station-number>
+
+        <station-number>585</station-number>
+
+        <station-number>586</station-number>
+
+        <station-number>589</station-number>
+
+        <station-number>589A4</station-number>
+
+        <station-number>589A5</station-number>
+
+        <station-number>589A6</station-number>
+
+        <station-number>589A7</station-number>
+
+        <station-number>590</station-number>
+
+        <station-number>593</station-number>
+
+        <station-number>595</station-number>
+
+        <station-number>596</station-number>
+
+        <station-number>596A4</station-number>
+
+        <station-number>598</station-number>
+
+        <station-number>600</station-number>
+
+        <station-number>603</station-number>
+
+        <station-number>605</station-number>
+
+        <station-number>607</station-number>
+
+        <station-number>608</station-number>
+
+        <station-number>610</station-number>
+
+        <station-number>610A4</station-number>
+
+        <station-number>612</station-number>
+
+        <station-number>612A4</station-number>
+
+        <station-number>613</station-number>
+
+        <station-number>614</station-number>
+
+        <station-number>618</station-number>
+
+        <station-number>619</station-number>
+
+        <station-number>619A4</station-number>
+
+        <station-number>620</station-number>
+
+        <station-number>620A4</station-number>
+
+        <station-number>621</station-number>
+
+        <station-number>623</station-number>
+
+        <station-number>626</station-number>
+
+        <station-number>626A4</station-number>
+
+        <station-number>629</station-number>
+
+        <station-number>630</station-number>
+
+        <station-number>630A4</station-number>
+
+        <station-number>630A5</station-number>
+
+        <station-number>631</station-number>
+
+        <station-number>632</station-number>
+
+        <station-number>635</station-number>
+
+        <station-number>636</station-number>
+
+        <station-number>636A4</station-number>
+
+        <station-number>636A6</station-number>
+
+        <station-number>636A7</station-number>
+
+        <station-number>636A8</station-number>
+
+        <station-number>637</station-number>
+
+        <station-number>640</station-number>
+
+        <station-number>640A4</station-number>
+
+        <station-number>642</station-number>
+
+        <station-number>644</station-number>
+
+        <station-number>646</station-number>
+
+        <station-number>646A4</station-number>
+
+        <station-number>646A5</station-number>
+
+        <station-number>648</station-number>
+
+        <station-number>648A4</station-number>
+
+        <station-number>649</station-number>
+
+        <station-number>650</station-number>
+
+        <station-number>652</station-number>
+
+        <station-number>653</station-number>
+
+        <station-number>654</station-number>
+
+        <station-number>655</station-number>
+
+        <station-number>656</station-number>
+
+        <station-number>657</station-number>
+
+        <station-number>657A0</station-number>
+
+        <station-number>657A4</station-number>
+
+        <station-number>657A5</station-number>
+
+        <station-number>658</station-number>
+
+        <station-number>659</station-number>
+
+        <station-number>660</station-number>
+
+        <station-number>662</station-number>
+
+        <station-number>663</station-number>
+
+        <station-number>663A4</station-number>
+
+        <station-number>664</station-number>
+
+        <station-number>666</station-number>
+
+        <station-number>667</station-number>
+
+        <station-number>668</station-number>
+
+        <station-number>671</station-number>
+
+        <station-number>671A4</station-number>
+
+        <station-number>672</station-number>
+
+        <station-number>673</station-number>
+
+        <station-number>674</station-number>
+
+        <station-number>674A4</station-number>
+
+        <station-number>674A5</station-number>
+
+        <station-number>675</station-number>
+
+        <station-number>676</station-number>
+
+        <station-number>678</station-number>
+
+        <station-number>679</station-number>
+
+        <station-number>687</station-number>
+
+        <station-number>688</station-number>
+
+        <station-number>689</station-number>
+
+        <station-number>689A4</station-number>
+
+        <station-number>691</station-number>
+
+        <station-number>691A4</station-number>
+
+        <station-number>692</station-number>
+
+        <station-number>693</station-number>
+
+        <station-number>695</station-number>
+
+        <station-number>757</station-number>
+
+		
+
+        <station-number>982</station-number>
+
+    </login-station-numbers>
+
+
+
+
+
+    <!-- defined application context root Name -->
+
+    <context-root-name>${edis.tracking.trackingContextRoot}</context-root-name>
+
+
+
+
+
+    <!-- put the system announcement here. Use ~ for a line break, or ~ ~ for a
+
+  paragraph break. -->
+
+    <system-announcement>
+
+        U.S. Government Computer System
+
+        ~ ~
+
+        U. S. government systems are intended to be used by authorized government network users for viewing and
+
+        retrieving information only, except as otherwise explicitly authorized for official business and limited
+
+        personal use in accordance with policy. Information from these systems resides on and transmits through computer
+
+        systems and networks funded by the government. All access or use constitutes understanding and acceptance that
+
+        there is no reasonable expectation of privacy in the use of Government networks or systems.
+
+        ~ ~
+
+        The data and documents on this system include Federal records that contain sensitive information protected by
+
+        various Federal statutes, including the Privacy Act, 5 U.S.C. Section 552a, and veterans' records
+
+        confidentiality statutes such as 38 U.S.C. Sections 5701 and 7332. Access to the data and records is on a
+
+        need-to-know basis only.
+
+        ~ ~
+
+        All access or use of this system constitutes user understanding and acceptance of these terms and constitutes
+
+        unconditional consent to review and action including (but not limited to) monitoring, recording, copying,
+
+        auditing, inspecting, investigating, restricting access, blocking, tracking, disclosing to authorized personnel,
+
+        or any other authorized actions by all authorized government and law enforcement personnel.
+
+        ~ ~
+
+        Unauthorized user attempts or acts to (1) access, upload, change, or delete information on this system, (2)
+
+        modify this system, (3) deny access to this system, (4) accrue resources for unauthorized use or (5) otherwise
+
+        misuse this system are strictly prohibited. Such attempts or acts are subject to action that may result in
+
+        criminal, civil, or administrative penalties.
+
+    </system-announcement>
+
+
+
+    <!-- set to true to return a user's "New Person" division multiple as part
+
+  of login -->
+
+    <user-new-person-divisions retrieve="true"/>
+
+
+
+    <!-- set to true to return all children divisions of the login division's
+
+computing facility, as part of login -->
+
+    <computing-facility-divisions retrieve="true"/>
+
+
+
+    <cactus-insecure-mode enabled="false"/>
+
+
+
+    <!-- BEAWeblogic Server SSL listen port , used for login page to implement SSL   -->
+
+    <!--   <ssl-listen-port-number>7002</ssl-listen-port-number>  -->
+
+
+
+
+
+</kaajee-config>
+
+  
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/AC_OETags.js
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/AC_OETags.js	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/AC_OETags.js	(revision 1227)
@@ -0,0 +1,276 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+	var version;
+	var axo;
+	var e;
+
+	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+	try {
+		// version will be set for 7.X or greater players
+		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+		version = axo.GetVariable("$version");
+	} catch (e) {
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 6.X players only
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+			
+			// installed player is some revision of 6.0
+			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+			// so we have to be careful. 
+			
+			// default to the first public version
+			version = "WIN 6,0,21,0";
+
+			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
+			axo.AllowScriptAccess = "always";
+
+			// safe to call for 6.0r47 or greater
+			version = axo.GetVariable("$version");
+
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 4.X or 5.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = axo.GetVariable("$version");
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 3.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = "WIN 3,0,18,0";
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 2.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+			version = "WIN 2,0,0,11";
+		} catch (e) {
+			version = -1;
+		}
+	}
+	
+	return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+	// NS/Opera version >= 3 check for Flash plugin in plugin array
+	var flashVer = -1;
+	
+	if (navigator.plugins != null && navigator.plugins.length > 0) {
+		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+			var descArray = flashDescription.split(" ");
+			var tempArrayMajor = descArray[2].split(".");			
+			var versionMajor = tempArrayMajor[0];
+			var versionMinor = tempArrayMajor[1];
+			var versionRevision = descArray[3];
+			if (versionRevision == "") {
+				versionRevision = descArray[4];
+			}
+			if (versionRevision[0] == "d") {
+				versionRevision = versionRevision.substring(1);
+			} else if (versionRevision[0] == "r") {
+				versionRevision = versionRevision.substring(1);
+				if (versionRevision.indexOf("d") > 0) {
+					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+				}
+			}
+			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+		}
+	}
+	// MSN/WebTV 2.6 supports Flash 4
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+	// WebTV 2.5 supports Flash 3
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+	// older WebTV supports Flash 2
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+	else if ( isIE && isWin && !isOpera ) {
+		flashVer = ControlVersion();
+	}	
+	return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+	versionStr = GetSwfVer();
+	if (versionStr == -1 ) {
+		return false;
+	} else if (versionStr != 0) {
+		if(isIE && isWin && !isOpera) {
+			// Given "WIN 2,0,0,11"
+			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
+			tempString        = tempArray[1];			// "2,0,0,11"
+			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
+		} else {
+			versionArray      = versionStr.split(".");
+		}
+		var versionMajor      = versionArray[0];
+		var versionMinor      = versionArray[1];
+		var versionRevision   = versionArray[2];
+
+        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
+		if (versionMajor > parseFloat(reqMajorVer)) {
+			return true;
+		} else if (versionMajor == parseFloat(reqMajorVer)) {
+			if (versionMinor > parseFloat(reqMinorVer))
+				return true;
+			else if (versionMinor == parseFloat(reqMinorVer)) {
+				if (versionRevision >= parseFloat(reqRevision))
+					return true;
+			}
+		}
+		return false;
+	}
+}
+
+function AC_AddExtension(src, ext)
+{
+  if (src.indexOf('?') != -1)
+    return src.replace(/\?/, ext+'?'); 
+  else
+    return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs) 
+{ 
+    var str = '';
+    if (isIE && isWin && !isOpera)
+    {
+  		str += '<object ';
+  		for (var i in objAttrs)
+  			str += i + '="' + objAttrs[i] + '" ';
+  		str += '>';
+  		for (var i in params)
+  			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
+  		str += '</object>';
+    } else {
+  		str += '<embed ';
+  		for (var i in embedAttrs)
+  			str += i + '="' + embedAttrs[i] + '" ';
+  		str += '> </embed>';
+    }
+
+    document.write(str);
+}
+
+function AC_FL_RunContent(){
+  var ret = 
+    AC_GetArgs
+    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+     , "application/x-shockwave-flash"
+    );
+  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+  var ret = new Object();
+  ret.embedAttrs = new Object();
+  ret.params = new Object();
+  ret.objAttrs = new Object();
+  for (var i=0; i < args.length; i=i+2){
+    var currArg = args[i].toLowerCase();    
+
+    switch (currArg){	
+      case "classid":
+        break;
+      case "pluginspage":
+        ret.embedAttrs[args[i]] = args[i+1];
+        break;
+      case "src":
+      case "movie":	
+        args[i+1] = AC_AddExtension(args[i+1], ext);
+        ret.embedAttrs["src"] = args[i+1];
+        ret.params[srcParamName] = args[i+1];
+        break;
+      case "onafterupdate":
+      case "onbeforeupdate":
+      case "onblur":
+      case "oncellchange":
+      case "onclick":
+      case "ondblClick":
+      case "ondrag":
+      case "ondragend":
+      case "ondragenter":
+      case "ondragleave":
+      case "ondragover":
+      case "ondrop":
+      case "onfinish":
+      case "onfocus":
+      case "onhelp":
+      case "onmousedown":
+      case "onmouseup":
+      case "onmouseover":
+      case "onmousemove":
+      case "onmouseout":
+      case "onkeypress":
+      case "onkeydown":
+      case "onkeyup":
+      case "onload":
+      case "onlosecapture":
+      case "onpropertychange":
+      case "onreadystatechange":
+      case "onrowsdelete":
+      case "onrowenter":
+      case "onrowexit":
+      case "onrowsinserted":
+      case "onstart":
+      case "onscroll":
+      case "onbeforeeditfocus":
+      case "onactivate":
+      case "onbeforedeactivate":
+      case "ondeactivate":
+      case "type":
+      case "codebase":
+        ret.objAttrs[args[i]] = args[i+1];
+        break;
+      case "id":
+      case "width":
+      case "height":
+      case "align":
+      case "vspace": 
+      case "hspace":
+      case "class":
+      case "title":
+      case "accesskey":
+      case "name":
+      case "tabindex":
+        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+        break;
+      default:
+        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+    }
+  }
+  ret.objAttrs["classid"] = classid;
+  if (mimeType) ret.embedAttrs["type"] = mimeType;
+  return ret;
+}
+
+
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/META-INF/MANIFEST.MF
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/META-INF/MANIFEST.MF	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/META-INF/MANIFEST.MF	(revision 1227)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/dispatcher-servlet.xml
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/dispatcher-servlet.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/dispatcher-servlet.xml	(revision 1227)
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <bean id="exceptionHandler" class="gov.va.med.edp.web.handler.ExceptionResolver">
+        <property name="defaultErrorView" value="exception"/>
+        <property name="exceptionMappings">
+            <props>
+                <prop key="gov.va.med.edp.rpc.VistaLinkRpcPermissionDeniedException">vistaLinkPermissionDeniedView
+                </prop>
+            </props>
+        </property>
+    </bean>
+
+    <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
+        <property name="basename" value="strings"/>
+    </bean>
+
+    <bean id="handlerMapping" class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping"/>
+
+    <bean id="viewResolver" class="org.springframework.web.servlet.view.XmlViewResolver"/>
+
+    <bean name="/tracking.html" class="gov.va.med.edp.web.controller.ClientVersionSynchronizationController">
+        <property name="clientArtifactId" value="edis-tracking-ui-main"/>
+        <property name="viewName" value="tracking"/>
+    </bean>
+
+    <bean name="/board.html" class="gov.va.med.edp.web.controller.ClientVersionSynchronizationController">
+        <property name="clientArtifactId" value="edis-tracking-ui-bigboard"/>
+        <property name="viewName" value="board"/>
+    </bean>
+
+    <bean name="/logout.html" class="gov.va.med.edp.web.controller.LogoutController"/>
+
+    <bean name="/tracking.xml" class="gov.va.med.edp.web.controller.TrackingController">
+        <property name="trackingDao" ref="trackingDao"/>
+    </bean>
+
+    <bean name="/board.xml" class="gov.va.med.edp.web.controller.TrackingController">
+        <property name="trackingDao" ref="bigBoardDao"/>
+    	<property name="serverPackageVersionDao" ref="serverPackageVersionDao"/>        
+    </bean>
+
+    <bean name="/export.csv" class="gov.va.med.edp.web.controller.ExportReportController">
+        <property name="trackingDao" ref="trackingDao"/>
+    </bean>
+
+</beans>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/jsp/incompatibility.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/jsp/incompatibility.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/jsp/incompatibility.jsp	(revision 1227)
@@ -0,0 +1,22 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+  <head><title><fmt:message key="app.name"/> - Version Incompatibility</title></head>
+  <body>
+  <%session.invalidate();%>
+  <h2>
+     <fmt:message key="app.name"/>
+  </h2>
+  <h3>Version Incompatibility</h3>
+  <p>This is EDIS web application version '<fmt:message key="app.version"/>'.<br/>
+     The EDIS server package version running in your VistA account is '<c:out value="${serverPackageVersion}"/>'.<br/>
+     A compatible client ('<c:out value="${clientFinalName}"/>') was not found bundled in this web application.
+   </p>
+  <p>Please ensure the version in your VistA account is compatible with version '<fmt:message key="app.version"/>' of the EDIS web application.</p>
+  <p><fmt:message key="logged.out"/></p>
+  <p><a href="<%= request.getContextPath() %>"><fmt:message key="login.again"/></a></p>
+  </body>
+</html>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/jsp/logout.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/jsp/logout.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/jsp/logout.jsp	(revision 1227)
@@ -0,0 +1,15 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+  <head><title><fmt:message key="app.name"/> Logged Out</title></head>
+  <body>
+  <h2>
+     <fmt:message key="app.name"/>
+  </h2>
+  <p><fmt:message key="logged.out"/></p>
+  <p><a href="<%= request.getContextPath() %>"><fmt:message key="login.again"/></a></p>
+  <p><a href="http://vhaislcfgm2.vha.med.va.gov/shadowfax/joomla/index.php?option=com_fireboard&Itemid=121&task=listcat&catid=14">EDIS Tracking Feedback Forum</a></p>
+  </body>
+</html>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/jsp/vistaLinkPermissionDenied.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/jsp/vistaLinkPermissionDenied.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/jsp/vistaLinkPermissionDenied.jsp	(revision 1227)
@@ -0,0 +1,19 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+  <head><title><fmt:message key="app.name"/> - Permission Denied</title></head>
+  <body>
+  <%session.invalidate();%>
+  <h2>
+     <fmt:message key="app.name"/>
+  </h2>
+  <h3>Permission Denied</h3>
+  <p><c:out value="${exception.errorMessage}"/></p>
+  <p>Please communicate with IRM to ensure you have the appropriate permissions in this VistA account in order to use EDIS.</p>
+  <p><fmt:message key="logged.out"/></p>
+  <p><a href="<%= request.getContextPath() %>"><fmt:message key="login.again"/></a></p>
+  </body>
+</html>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/kaajeeConfig.xml
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/kaajeeConfig.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/kaajeeConfig.xml	(revision 1227)
@@ -0,0 +1,469 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<kaajee-config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="kaajeeConfig.xsd">
+
+
+
+    <!-- host application name, used for login page display and logging -->
+
+    <host-application-name>EDIS Tracking Board</host-application-name>
+
+
+
+    <!-- put each station number for KAAJEE login here -->
+
+    <login-station-numbers>
+
+        <station-number>402</station-number>
+
+        <station-number>405</station-number>
+
+        <station-number>423</station-number>
+
+        <station-number>433</station-number>
+
+        <station-number>436</station-number>
+
+        <station-number>437</station-number>
+
+        <station-number>438</station-number>
+
+        <station-number>442</station-number>
+
+        <station-number>447</station-number>
+
+        <station-number>454</station-number>
+
+        <station-number>459</station-number>
+
+        <station-number>460</station-number>
+        
+		<station-number>463</station-number>
+
+        <station-number>501</station-number>
+
+        <station-number>502</station-number>
+
+        <station-number>503</station-number>
+
+        <station-number>504</station-number>
+
+        <station-number>506</station-number>
+
+        <station-number>508</station-number>
+
+        <station-number>509</station-number>
+
+        <station-number>509A0</station-number>
+
+        <station-number>512</station-number>
+
+        <station-number>512A5</station-number>
+
+        <station-number>515</station-number>
+
+        <station-number>516</station-number>
+
+        <station-number>517</station-number>
+
+        <station-number>518</station-number>
+
+        <station-number>519</station-number>
+
+        <station-number>520</station-number>
+
+        <station-number>520A0</station-number>
+
+        <station-number>521</station-number>
+
+        <station-number>523</station-number>
+
+        <station-number>523A4</station-number>
+
+        <station-number>523A5</station-number>
+
+        <station-number>524</station-number>
+
+        <station-number>526</station-number>
+
+        <station-number>528</station-number>
+
+        <station-number>528A4</station-number>
+
+        <station-number>528A5</station-number>
+
+        <station-number>528A6</station-number>
+
+        <station-number>528A7</station-number>
+
+        <station-number>528A8</station-number>
+
+        <station-number>529</station-number>
+
+        <station-number>531</station-number>
+
+        <station-number>534</station-number>
+
+        <station-number>537</station-number>
+
+        <station-number>538</station-number>
+
+        <station-number>539</station-number>
+
+        <station-number>540</station-number>
+
+        <station-number>541</station-number>
+
+        <station-number>542</station-number>
+
+        <station-number>544</station-number>
+
+        <station-number>546</station-number>
+
+        <station-number>548</station-number>
+
+        <station-number>549</station-number>
+
+        <station-number>549A4</station-number>
+
+        <station-number>550</station-number>
+
+        <station-number>552</station-number>
+
+        <station-number>553</station-number>
+
+        <station-number>554</station-number>
+
+        <station-number>556</station-number>
+
+        <station-number>557</station-number>
+
+        <station-number>558</station-number>
+
+        <station-number>561</station-number>
+
+        <station-number>561A4</station-number>
+
+        <station-number>562</station-number>
+
+        <station-number>564</station-number>
+
+        <station-number>565</station-number>
+
+        <station-number>568</station-number>
+
+        <station-number>568A4</station-number>
+
+        <station-number>570</station-number>
+
+        <station-number>573</station-number>
+
+        <station-number>573A4</station-number>
+
+        <station-number>575</station-number>
+
+        <station-number>578</station-number>
+
+        <station-number>580</station-number>
+
+        <station-number>581</station-number>
+
+        <station-number>583</station-number>
+
+        <station-number>585</station-number>
+
+        <station-number>586</station-number>
+
+        <station-number>589</station-number>
+
+        <station-number>589A4</station-number>
+
+        <station-number>589A5</station-number>
+
+        <station-number>589A6</station-number>
+
+        <station-number>589A7</station-number>
+
+        <station-number>590</station-number>
+
+        <station-number>593</station-number>
+
+        <station-number>595</station-number>
+
+        <station-number>596</station-number>
+
+        <station-number>596A4</station-number>
+
+        <station-number>598</station-number>
+
+        <station-number>600</station-number>
+
+        <station-number>603</station-number>
+
+        <station-number>605</station-number>
+
+        <station-number>607</station-number>
+
+        <station-number>608</station-number>
+
+        <station-number>610</station-number>
+
+        <station-number>610A4</station-number>
+
+        <station-number>612</station-number>
+
+        <station-number>612A4</station-number>
+
+        <station-number>613</station-number>
+
+        <station-number>614</station-number>
+
+        <station-number>618</station-number>
+
+        <station-number>619</station-number>
+
+        <station-number>619A4</station-number>
+
+        <station-number>620</station-number>
+
+        <station-number>620A4</station-number>
+
+        <station-number>621</station-number>
+
+        <station-number>623</station-number>
+
+        <station-number>626</station-number>
+
+        <station-number>626A4</station-number>
+
+        <station-number>629</station-number>
+
+        <station-number>630</station-number>
+
+        <station-number>630A4</station-number>
+
+        <station-number>630A5</station-number>
+
+        <station-number>631</station-number>
+
+        <station-number>632</station-number>
+
+        <station-number>635</station-number>
+
+        <station-number>636</station-number>
+
+        <station-number>636A4</station-number>
+
+        <station-number>636A6</station-number>
+
+        <station-number>636A7</station-number>
+
+        <station-number>636A8</station-number>
+
+        <station-number>637</station-number>
+
+        <station-number>640</station-number>
+
+        <station-number>640A4</station-number>
+
+        <station-number>642</station-number>
+
+        <station-number>644</station-number>
+
+        <station-number>646</station-number>
+
+        <station-number>646A4</station-number>
+
+        <station-number>646A5</station-number>
+
+        <station-number>648</station-number>
+
+        <station-number>648A4</station-number>
+
+        <station-number>649</station-number>
+
+        <station-number>650</station-number>
+
+        <station-number>652</station-number>
+
+        <station-number>653</station-number>
+
+        <station-number>654</station-number>
+
+        <station-number>655</station-number>
+
+        <station-number>656</station-number>
+
+        <station-number>657</station-number>
+
+        <station-number>657A0</station-number>
+
+        <station-number>657A4</station-number>
+
+        <station-number>657A5</station-number>
+
+        <station-number>658</station-number>
+
+        <station-number>659</station-number>
+
+        <station-number>660</station-number>
+
+        <station-number>662</station-number>
+
+        <station-number>663</station-number>
+
+        <station-number>663A4</station-number>
+
+        <station-number>664</station-number>
+
+        <station-number>666</station-number>
+
+        <station-number>667</station-number>
+
+        <station-number>668</station-number>
+
+        <station-number>671</station-number>
+
+        <station-number>671A4</station-number>
+
+        <station-number>672</station-number>
+
+        <station-number>673</station-number>
+
+        <station-number>674</station-number>
+
+        <station-number>674A4</station-number>
+
+        <station-number>674A5</station-number>
+
+        <station-number>675</station-number>
+
+        <station-number>676</station-number>
+
+        <station-number>678</station-number>
+
+        <station-number>679</station-number>
+
+        <station-number>687</station-number>
+
+        <station-number>688</station-number>
+
+        <station-number>689</station-number>
+
+        <station-number>689A4</station-number>
+
+        <station-number>691</station-number>
+
+        <station-number>691A4</station-number>
+
+        <station-number>692</station-number>
+
+        <station-number>693</station-number>
+
+        <station-number>695</station-number>
+
+        <station-number>757</station-number>
+
+		
+
+        <station-number>982</station-number>
+
+    </login-station-numbers>
+
+
+
+
+
+    <!-- defined application context root Name -->
+
+    <context-root-name>${edis.tracking.trackingContextRoot}</context-root-name>
+
+
+
+
+
+    <!-- put the system announcement here. Use ~ for a line break, or ~ ~ for a
+
+  paragraph break. -->
+
+    <system-announcement>
+
+        U.S. Government Computer System
+
+        ~ ~
+
+        U. S. government systems are intended to be used by authorized government network users for viewing and
+
+        retrieving information only, except as otherwise explicitly authorized for official business and limited
+
+        personal use in accordance with policy. Information from these systems resides on and transmits through computer
+
+        systems and networks funded by the government. All access or use constitutes understanding and acceptance that
+
+        there is no reasonable expectation of privacy in the use of Government networks or systems.
+
+        ~ ~
+
+        The data and documents on this system include Federal records that contain sensitive information protected by
+
+        various Federal statutes, including the Privacy Act, 5 U.S.C. Section 552a, and veterans' records
+
+        confidentiality statutes such as 38 U.S.C. Sections 5701 and 7332. Access to the data and records is on a
+
+        need-to-know basis only.
+
+        ~ ~
+
+        All access or use of this system constitutes user understanding and acceptance of these terms and constitutes
+
+        unconditional consent to review and action including (but not limited to) monitoring, recording, copying,
+
+        auditing, inspecting, investigating, restricting access, blocking, tracking, disclosing to authorized personnel,
+
+        or any other authorized actions by all authorized government and law enforcement personnel.
+
+        ~ ~
+
+        Unauthorized user attempts or acts to (1) access, upload, change, or delete information on this system, (2)
+
+        modify this system, (3) deny access to this system, (4) accrue resources for unauthorized use or (5) otherwise
+
+        misuse this system are strictly prohibited. Such attempts or acts are subject to action that may result in
+
+        criminal, civil, or administrative penalties.
+
+    </system-announcement>
+
+
+
+    <!-- set to true to return a user's "New Person" division multiple as part
+
+  of login -->
+
+    <user-new-person-divisions retrieve="true"/>
+
+
+
+    <!-- set to true to return all children divisions of the login division's
+
+computing facility, as part of login -->
+
+    <computing-facility-divisions retrieve="true"/>
+
+
+
+    <cactus-insecure-mode enabled="false"/>
+
+
+
+    <!-- BEAWeblogic Server SSL listen port , used for login page to implement SSL   -->
+
+    <!--   <ssl-listen-port-number>7002</ssl-listen-port-number>  -->
+
+
+
+
+
+</kaajee-config>
+
+  
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/kaajeeConfig.xsd
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/kaajeeConfig.xsd	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/kaajeeConfig.xsd	(revision 1227)
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- edited with XMLSPY v5 rel. 3 U (http://www.xmlspy.com) by Kyle Clarke (Department of Veterans Affairs) -->
+
+<!--W3C Schema generated by XMLSPY v5 rel. 3 U (http://www.xmlspy.com)-->
+
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
+
+	<xs:element name="computing-facility-divisions">
+
+		<xs:complexType>
+
+			<xs:attribute name="retrieve" type="xs:boolean" use="required"/>
+
+		</xs:complexType>
+
+	</xs:element>
+
+	<xs:element name="host-application-name" type="xs:string"/>
+
+	<xs:element name="kaajee-config">
+
+		<xs:complexType>
+
+			<xs:all>
+
+				<xs:element ref="host-application-name" minOccurs="0"/>
+
+				<xs:element ref="login-station-numbers"/>
+
+				<xs:element ref="context-root-name" minOccurs="0"/>
+
+				<xs:element ref="system-announcement" minOccurs="0"/>
+
+				<xs:element ref="user-new-person-divisions" minOccurs="0"/>
+
+				<xs:element ref="computing-facility-divisions" minOccurs="0"/>
+
+				<xs:element ref="cactus-insecure-mode" minOccurs="0"/>
+
+			</xs:all>
+
+		</xs:complexType>
+
+	</xs:element>
+
+	<xs:element name="login-station-numbers">
+
+		<xs:complexType>
+
+			<xs:sequence>
+
+				<xs:element ref="station-number" maxOccurs="unbounded"/>
+
+			</xs:sequence>
+
+		</xs:complexType>
+
+	</xs:element>
+
+	<xs:element name="station-number" type="xs:string"/>
+
+	<xs:element name="system-announcement" type="xs:string"/>
+
+	<xs:element name="user-new-person-divisions">
+
+		<xs:complexType>
+
+			<xs:attribute name="retrieve" type="xs:boolean" use="required"/>
+
+		</xs:complexType>
+
+	</xs:element>
+
+	<xs:element name="cactus-insecure-mode"/>
+
+	<xs:element name="context-root-name"/>
+
+</xs:schema>
+
+
+
+
+
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/views.xml
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/views.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/views.xml	(revision 1227)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
+
+    <bean id="xmlView" class="gov.va.med.edp.web.view.XmlView"/>
+
+    <bean id="csvView" class="gov.va.med.edp.web.view.CsvView"/>
+
+    <bean id="exception" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/exception.jsp"/>
+    </bean>
+
+    <bean id="tracking" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/tracking.jsp"/>
+    </bean>
+
+    <bean id="board" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/board.jsp"/>
+    </bean>
+
+    <bean id="incompatibilityView" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/WEB-INF/jsp/incompatibility.jsp"/>
+    </bean>
+
+    <bean id="vistaLinkPermissionDeniedView" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/WEB-INF/jsp/vistaLinkPermissionDenied.jsp"/>
+    </bean>
+
+    <bean id="logout" class="org.springframework.web.servlet.view.JstlView">
+        <property name="url" value="/WEB-INF/jsp/logout.jsp"/>
+    </bean>
+</beans>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/web.xml
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/web.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/web.xml	(revision 1227)
@@ -0,0 +1,216 @@
+<!DOCTYPE web-app PUBLIC
+        "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
+        "http://java.sun.com/dtd/web-app_2_3.dtd" >
+<web-app>
+    <display-name>Emergency Department Tracking Board Server Proxy Application</display-name>
+
+    <context-param>
+        <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
+        <param-value>strings</param-value>
+    </context-param>
+    <!-- Fallback locale if no bundles found for browser's preferred locale -->
+    <!-- Force a single locale using param-name 'javax.servlet.jsp.jstl.fmt.locale' -->
+    <context-param>
+        <param-name>javax.servlet.jsp.jstl.fmt.fallbackLocale</param-name>
+        <param-value>en</param-value>
+    </context-param>
+
+    <context-param>
+        <param-name>contextConfigLocation</param-name>
+        <param-value>
+            classpath*:/applicationContext-dao.xml
+        </param-value>
+    </context-param>
+
+    <filter>
+        <filter-name>characterEncodingFilter</filter-name>
+        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
+        <init-param>
+            <param-name>encoding</param-name>
+            <param-value>UTF-8</param-value>
+        </init-param>
+    </filter>
+
+    <filter>
+        <filter-name>noCacheFilter</filter-name>
+        <filter-class>gov.va.med.edp.web.servlet.filter.ResponseHeaderFilter</filter-class>
+         <init-param>
+            <param-name>Cache-Control</param-name>
+            <param-value>no-store, must-revalidate</param-value>
+        </init-param>
+        <init-param>
+            <param-name>Expires</param-name>
+            <param-value>Thu, 01 Jan 1970 01:00:00 GMT</param-value>
+        </init-param>
+    </filter>
+
+    <listener>
+        <listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>gov.va.med.authentication.kernel.KaajeeSessionAttributeListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>gov.va.med.authentication.kernel.KaajeeHttpSessionListener</listener-class>
+    </listener>
+
+    <listener>
+        <listener-class>gov.va.med.edp.web.servlet.listener.TimeOutIntegrationSessionAttributeListener</listener-class>
+    </listener>
+
+    <servlet>
+        <servlet-name>KaajeeInit</servlet-name>
+        <servlet-class>gov.va.med.authentication.kernel.InitKaajeeServlet</servlet-class>
+        <init-param>
+            <param-name>kaajee-config-file-location</param-name>
+            <param-value>/WEB-INF/kaajeeConfig.xml</param-value>
+        </init-param>
+        <load-on-startup>3</load-on-startup>
+    </servlet>
+
+    <servlet>
+        <servlet-name>LoginController</servlet-name>
+        <servlet-class>gov.va.med.authentication.kernel.LoginController</servlet-class>
+        <run-as>
+            <!-- In this example, weblogic is the boot user name (i.e., weblogic console user name) -->
+            <role-name>weblogic</role-name>
+        </run-as>
+    </servlet>
+
+    <servlet>
+        <servlet-name>dispatcher</servlet-name>
+        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <filter-mapping>
+        <filter-name>characterEncodingFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>noCacheFilter</filter-name>
+        <url-pattern>*.swf</url-pattern>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>noCacheFilter</filter-name>
+        <url-pattern>/tracking.html</url-pattern>
+    </filter-mapping>
+
+     <filter-mapping>
+        <filter-name>noCacheFilter</filter-name>
+        <url-pattern>/board.html</url-pattern>
+    </filter-mapping>
+
+    <filter-mapping>
+        <filter-name>noCacheFilter</filter-name>
+        <url-pattern>/logout.html</url-pattern>
+    </filter-mapping>
+
+    <servlet-mapping>
+        <servlet-name>LoginController</servlet-name>
+        <url-pattern>/LoginController</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>*.xml</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>*.csv</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>tracking.html</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>board.html</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>dispatcher</servlet-name>
+        <url-pattern>logout.html</url-pattern>
+    </servlet-mapping>
+
+    <session-config>
+        <session-timeout>5</session-timeout>
+    </session-config>
+
+    <welcome-file-list>
+        <welcome-file>/index.jsp</welcome-file>
+    </welcome-file-list>
+
+    <error-page>
+        <error-code>500</error-code>
+        <location>/error500.jsp</location>
+    </error-page>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>ED Tracking Board XML Services</web-resource-name>
+            <url-pattern>*.xml</url-pattern>
+            <http-method>GET</http-method>
+            <http-method>POST</http-method>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>AUTHENTICATED_KAAJEE_USER</role-name>
+        </auth-constraint>
+        <user-data-constraint>
+            <transport-guarantee>NONE</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>ED Tracking Board Flex Client</web-resource-name>
+            <url-pattern>*.swf</url-pattern>
+            <url-pattern>tracking.html</url-pattern>
+            <url-pattern>board.html</url-pattern>
+            <http-method>GET</http-method>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>AUTHENTICATED_KAAJEE_USER</role-name>
+        </auth-constraint>
+        <user-data-constraint>
+            <transport-guarantee>NONE</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
+
+    <security-constraint>
+        <web-resource-collection>
+            <web-resource-name>ED Tracking Board Debug Screen</web-resource-name>
+            <url-pattern>debug.jsp</url-pattern>
+            <http-method>GET</http-method>
+        </web-resource-collection>
+        <auth-constraint>
+            <role-name>AUTHENTICATED_KAAJEE_USER</role-name>
+        </auth-constraint>
+        <user-data-constraint>
+            <transport-guarantee>NONE</transport-guarantee>
+        </user-data-constraint>
+    </security-constraint>
+
+    <login-config>
+        <auth-method>FORM</auth-method>
+        <form-login-config>
+            <form-login-page>login/login.jsp</form-login-page>
+            <form-error-page>login/loginerror.jsp</form-error-page>
+        </form-login-config>
+    </login-config>
+    
+    <security-role>
+        <role-name>AUTHENTICATED_KAAJEE_USER</role-name>
+    </security-role>
+</web-app>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/weblogic.xml
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/weblogic.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/WEB-INF/weblogic.xml	(revision 1227)
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!DOCTYPE weblogic-web-app PUBLIC "-//BEA Systems, Inc.//DTD Web Application 8.1//EN" "http://www.bea.com/servers/wls810/dtd/weblogic810-web-jar.dtd">
+
+<weblogic-web-app>
+
+	<session-descriptor>
+
+		<session-param>
+
+			<param-name>CookieName</param-name>
+
+			<param-value>edJSESSIONID</param-value>
+
+		</session-param>
+
+		<session-param>
+
+			<param-name>PersistentStoreType</param-name>
+
+			<param-value>replicated_if_clustered</param-value>
+
+		</session-param>
+
+	</session-descriptor>
+
+	<container-descriptor>
+
+		<session-monitoring-enabled>true</session-monitoring-enabled>
+
+	</container-descriptor>
+
+	<context-root>${edis.tracking.trackingContextRoot}</context-root>
+
+</weblogic-web-app>
+
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/about.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/about.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/about.jsp	(revision 1227)
@@ -0,0 +1,25 @@
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+    <title>
+        <fmt:message key="app.name"/>
+    </title>
+</head>
+<body>
+<h2>
+     <fmt:message key="app.name"/>
+</h2>
+
+<h3>
+    <fmt:message key="app.version"/>
+</h3>
+
+<h4>Built: <fmt:message key="app.buildtime"/></h4>
+
+<div>
+    Copyright <fmt:message key="copyright.year"/> - <a href="<fmt:message key="copyright.organization.url"/>"><fmt:message key="copyright.organization"/></a>
+</div>
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/board.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/board.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/board.jsp	(revision 1227)
@@ -0,0 +1,162 @@
+<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %><%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title><fmt:message key="app.name"/></title>
+<script src="AC_OETags.js" language="javascript"></script>
+<style>
+ html, body {
+        height: 100%;
+        margin: 0;
+        padding: 0;
+    }
+    body {
+        overflow:hidden;
+    }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = 9;
+// Minor version of Flash required
+var requiredMinorVersion = 0;
+// Minor version of Flash required
+var requiredRevision = 28;
+// -----------------------------------------------------------------------------
+// -->
+</script>
+
+<!-- BEGIN call Flex function on browser close -->
+<script language="JavaScript" type="text/javascript">
+<!--
+function shutdownHook()
+{
+	var fxControl = document.BigBoard || window.BigBoard;
+	var warning = fxControl.getUnsavedDataWarning();
+	if (warning != '')
+		return warning;
+	else
+		return;
+}
+
+function invalidateSwf() {
+    var AJAX;
+    if (window.XMLHttpRequest) {
+        AJAX=new XMLHttpRequest();
+    } else {
+        AJAX=new ActiveXObject("Microsoft.XMLHTTP");
+    }
+    if (AJAX) {
+        AJAX.open("GET", '<c:url value="logout.html"/>?swfID=<c:out value="${swfID}"/>', false);
+        AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+        AJAX.send(null);
+    }
+}
+
+window.onbeforeunload = shutdownHook;
+window.onunload = invalidateSwf;
+
+-->
+</script>
+<!-- END call Flex function on browser close -->
+
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+
+// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
+if ( hasProductInstall && !hasRequestedVersion ) {
+	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
+	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
+	// DO NOT MODIFY THE FOLLOWING FOUR LINES
+	// Location visited after installation is complete if installation is required
+	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+	var MMredirectURL = window.location;
+    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+    var MMdoctitle = document.title;
+
+	AC_FL_RunContent(
+		"src", "playerProductInstall",
+		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+		"width", "100%",
+		"height", "100%",
+		"align", "middle",
+		"id", "<c:out value="${clientArtifactId}"/>",
+		"quality", "high",
+		"bgcolor", "#869ca7",
+		"allowFullScreen", "true",
+		"name", "<c:out value="${clientArtifactId}"/>",
+		"allowScriptAccess","sameDomain",
+		"type", "application/x-shockwave-flash",
+		"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+} else if (hasRequestedVersion) {
+	// if we've detected an acceptable version
+	// embed the Flash Content SWF when all tests are passed
+
+	// Cache Server Page namespace should be set here (don't forget the ampersand)
+	//var edpVars = "cspNmsp=CPM&cspDemo=500^10vehu^vehu10&";
+	//var edpVars = "cspServ=vhaislcfgm2.vha.med.va.gov/csp/CPM&cspToken=20012^662&";
+	//var edpVars = "vljServ=10.5.17.153:7001&";
+	//var edpVars = "vljServ=10.5.17.225:7001&";
+	//var edpVars = "vljServ=localhost:7001&";
+	//SEE LINE BELOW TO LAUNCH BIG BOARD FROM FLEX BUILDER AND PASSING IN A SITE ID
+	//var edpVars = "vljServ=vhaislbll2.vha.med.va.gov:7141&siteId=442&";
+	var edpVars = "swfID=<c:out value="${swfID}"/>&timeout=true&contextRoot=<c:out value="${pageContext.request.contextPath}"/>&board=<c:out value="${param.board}"/>&area=<c:out value="${param.area}"/>&helpContextRoot=<fmt:message key="help.contextRoot"/>";
+
+	AC_FL_RunContent(
+			"src", "<c:out value="${clientFinalName}"/>",
+			"width", "100%",
+			"height", "100%",
+			"align", "middle",
+			"id", "<c:out value="${clientArtifactId}"/>",
+			"quality", "high",
+			"bgcolor", "#869ca7",
+			"allowFullScreen", "true",
+			"name", "<c:out value="${clientArtifactId}"/>",
+			"flashvars", edpVars,
+			"allowScriptAccess","sameDomain",
+			"type", "application/x-shockwave-flash",
+			"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+  } else {  // flash is too old or we can't detect the plugin
+    var alternateContent = 'Alternate HTML content should be placed here. '
+  	+ 'This content requires the Adobe Flash Player. '
+   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+    document.write(alternateContent);  // insert non-flash content
+  }
+// -->
+</script>
+<noscript>
+  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+			id="<c:out value="${clientArtifactId}"/>" width="100%" height="100%"
+			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+			<param name="movie" value="<c:out value="${clientFinalName}"/>.swf" />
+			<param name="quality" value="high" />
+			<param name="allowFullScreen" value="true" />
+			<param name="bgcolor" value="#869ca7" />
+			<param name="allowScriptAccess" value="sameDomain" />
+			<embed src="<c:out value="${clientFinalName}"/>.swf" quality="high" allowFullScreen="true" bgcolor="#869ca7"
+				width="100%" height="100%" name="<c:out value="${clientArtifactId}"/>" align="middle"
+				play="true"
+				loop="false"
+				quality="high"
+				allowScriptAccess="sameDomain"
+				type="application/x-shockwave-flash"
+				pluginspage="http://www.adobe.com/go/getflashplayer">
+			</embed>
+	</object>
+</noscript>
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/debug.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/debug.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/debug.jsp	(revision 1227)
@@ -0,0 +1,83 @@
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>
+<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
+<html>
+<head><title><fmt:message key="app.name"/> Debug</title></head>
+<body>
+
+<h1><fmt:message key="app.name"/> Debug</h1>
+
+<a href="<c:url value="logout.html"/>">Logout</a>
+
+<h4>initLogArea</h4>
+
+<form name="initLogArea" action="tracking.xml" method="post">
+    <input name="command" type="hidden" value="initLogArea"/>
+    <table>
+        <tr>
+            <td><label for="init_area">area</label></td>
+            <td><input id="init_area" name="area" type="text" value="1"/></td>
+        </tr>
+    </table>
+    <input type="submit" value="Execute"/>
+</form>
+
+<h4>refreshLogSelector</h4>
+
+<form name="refreshLogSelector" action="tracking.xml" method="post">
+    <input name="command" type="hidden" value="refreshLogSelector"/>
+    <table>
+         <tr>
+            <td><label for="refresh_area">area</label></td>
+            <td><input id="refresh_area" name="area" type="text" value="1"/></td>
+        </tr>
+        <tr>
+            <td><label for="token">token</label></td>
+            <td><input id="token" name="token" type="text" value="-1"/></td>
+        </tr>
+    </table>
+    <input type="submit" value="Execute"/>
+</form>
+
+<h4>switchLogEntry</h4>
+
+<form name="switchLogEntry" action="tracking.xml" method="post">
+    <input name="command" type="hidden" value="switchLogEntry"/>
+    <table>
+        <tr>
+            <td><label for="logID">logID</label></td>
+            <td><input id="logID" name="logID" type="text" value="64"/></td>
+        </tr>
+        <tr>
+            <td><label for="getChoices">getChoices</label></td>
+            <td><input id="getChoices" name="getChoices" type="text" value="1"/></td>
+        </tr>
+    </table>
+    <input type="submit" value="Execute"/>
+</form>
+
+<h4>matchPatients</h4>
+
+<form name="matchPatients" action="tracking.xml" method="post">
+    <input name="command" type="hidden" value="matchPatients"/>
+    <table>
+        <tr>
+            <td><label for="partial">partial</label></td>
+            <td><input id="partial" name="partial" type="text" value="TEN"/></td>
+        </tr>
+    </table>
+    <input type="submit" value="Execute"/>
+</form>
+
+
+<h4>initUser</h4>
+
+<form name="initUser" action="tracking.xml" method="post">
+    <input name="command" type="hidden" value="initUser"/>
+    <input type="submit" value="Execute"/>
+</form>
+
+<a href="<c:url value="logout.html"/>">Logout</a>
+
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/error500.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/error500.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/error500.jsp	(revision 1227)
@@ -0,0 +1,12 @@
+<%@ page pageEncoding="UTF-8" contentType="application/xml;charset=UTF-8" language="java" session="false" isErrorPage="true" %><?xml version="1.0" encoding="UTF-8"?>
+<results>
+<error>
+    <code><%= request.getAttribute("javax.servlet.error.status_code") %></code>
+    <message><%= request.getAttribute("javax.servlet.error.exception") %></message>
+    <resource><%= request.getAttribute("javax.servlet.error.request_uri") %></resource>
+    <detail xml:space="preserve"><% Throwable e =
+        (Throwable) request.getAttribute("javax.servlet.error.exception");
+    e.printStackTrace(new java.io.PrintWriter(out));
+%></detail>
+</error>
+</results>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/exception.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/exception.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/exception.jsp	(revision 1227)
@@ -0,0 +1,12 @@
+<%@ page pageEncoding="UTF-8" contentType="application/xml;charset=UTF-8" language="java" session="false" isErrorPage="true" %><?xml version="1.0" encoding="UTF-8"?>
+<results>
+<error>
+    <code>500</code>
+    <message><%= ((Exception) request.getAttribute("exception")).getMessage() %></message>
+    <resource><%= request.getAttribute("resource") %></resource>
+    <detail xml:space="preserve"><% Exception e =
+        (Exception) request.getAttribute("exception");
+    e.printStackTrace(new java.io.PrintWriter(out));
+%></detail>
+</error>
+</results>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/index.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/index.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/index.jsp	(revision 1227)
@@ -0,0 +1,2 @@
+<%@taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
+<c:redirect url="tracking.html"/>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/login/SessionTimeout.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/login/SessionTimeout.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/login/SessionTimeout.jsp	(revision 1227)
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+
+<%@ page language="java" %>
+
+<HTML><HEAD>
+
+<!--<p><a href="<%= request.getContextPath() %>/login/login.jsp">Try login again.</a></p>
+
+ * 
+
+ * @author Infrastructure & Security Service
+
+ * @version 1.0.1.002
+
+ * -->
+
+<TITLE>Login Session Time out Error</TITLE></HEAD>
+
+<BODY>
+
+
+
+<h3>Your session expired during login, please try again by restarting </h3>
+
+<h3> the login process  by  using your original bookmark, shortcut or URL destination </h3>
+
+</BODY></HTML>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/login/javascript/login.js
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/login/javascript/login.js	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/login/javascript/login.js	(revision 1227)
@@ -0,0 +1,345 @@
+/**
+
+ * This JavaScript file contains functions that are needed for login.
+
+ * @author Infrastructure & Security Service
+
+ * @version 1.0.1.002
+
+ */
+
+
+
+function preserveRadioGroup (evt) {
+
+  this.checked = this.storedChecked;
+
+  var rgb = this.form[this.name];
+
+  if (!rgb.length && rgb.storedChecked)
+
+    rgb.checked = true;
+
+  else 
+
+    for (var b = 0; b < rgb.length; b++)
+
+      rgb[b].checked = rgb[b].storedChecked ? true : false;
+
+}
+
+
+
+function disableRadioGroup (radioGroup) {
+
+  if (!radioGroup.disabled) {
+
+    radioGroup.disabled = true;
+
+    if (document.all || document.getElementById) {
+
+      if (!radioGroup.length)
+
+        radioGroup.disabled = true;
+
+      else
+
+        for (var b = 0; b < radioGroup.length; b++)
+
+          radioGroup[b].disabled = true;
+
+     }
+
+    else {
+
+      if (!radioGroup.length) {
+
+        radioGroup.storedChecked = radioGroup.checked;
+
+        radioGroup.oldOnClick = radioGroup.onclick;
+
+        radioGroup.onclick = preserveRadioGroup;
+
+      }
+
+      else
+
+        for (var b = 0; b < radioGroup.length; b++) {
+
+          radioGroup[b].storedChecked = radioGroup[b].checked;
+
+          radioGroup[b].oldOnClick = radioGroup[b].onclick;
+
+          radioGroup[b].onclick = preserveRadioGroup;
+
+        }
+
+    }
+
+  }
+
+}
+
+
+
+function enableRadioGroup (radioGroup) {
+
+  if (radioGroup.disabled) {
+
+    radioGroup.disabled = false;
+
+    if (document.all || document.getElementById) {
+
+      if (!radioGroup.length)
+
+        radioGroup.disabled = false;
+
+      else
+
+        for (var b = 0; b < radioGroup.length; b++)
+
+          radioGroup[b].disabled = false;
+
+     }
+
+    else {
+
+      if (!radioGroup.length) {
+
+        radioGroup.onclick = radioGroup.oldOnClick;
+
+      }
+
+      else
+
+        for (var b = 0; b < radioGroup.length; b++) {
+
+          radioGroup[b].onclick = radioGroup[b].oldOnClick;
+
+        }
+
+    }
+
+  }
+
+}
+
+
+
+function isblank(s) {
+
+	slen = s.length;
+
+	for (var i = 0; i < slen; i++) {
+
+		var c = s.charAt(i);
+
+		if ((c != ' ') && (c != '\n') && (c != '')) return false;
+
+	}
+
+	return true;
+
+}
+
+
+
+function disableObj(obj) {
+
+	obj.disabled = true;
+
+}
+
+
+
+function enableObj(obj) {
+
+	obj.disabled = false;
+
+}
+
+
+
+function checkHF(myForm,mySelect,myRadioButtonGroup,myHiddenObj1,myHiddenObj2,myHiddenObj3) {
+
+	disableInstitutionObj(myForm,mySelect,myRadioButtonGroup,myHiddenObj1,myHiddenObj2)
+
+	if (myHiddenObj3.value == "number") {
+
+		reSortSelectOptions(myForm,mySelect,"value");
+
+	}
+
+	else if (myHiddenObj3.value == "name") {
+
+		reSortSelectOptions(myForm,mySelect,"text");
+
+	}
+
+}
+
+
+
+function disableInstitutionObj(myForm,mySelect,myRadioButtonGroup,myHiddenObj1,myHiddenObj2) {
+
+	if (myHiddenObj1.value == "true") disableObj(mySelect);
+
+	if ((myHiddenObj1.value == "true") || (myHiddenObj2.value == "true")) {
+
+		disableRadioGroup(myRadioButtonGroup);
+
+	}
+
+}
+
+
+
+function enableInstitutionObj(myForm,mySelect,myRadioButtonGroup,myHiddenObj1,myHiddenObj2) {
+
+	myHiddenObj1.value = "false";
+
+	myHiddenObj2.value = "false";
+
+	enableObj(mySelect);
+
+	enableRadioGroup(myRadioButtonGroup);
+
+}
+
+
+
+function hasOptions(obj) {
+
+  if (obj!=null && obj.options!=null) { return true; }
+
+  return false;
+
+}
+
+
+
+function sortSelect(obj,sortBy) {
+
+  var o = new Array();
+
+  if (!hasOptions(obj)) { return false; }
+
+  for (var i=0; i<obj.options.length; i++) {
+
+    o[o.length] = new Option( obj.options[i].text, obj.options[i].value, obj.options[i].defaultSelected, obj.options[i].selected) ;
+
+  }
+
+  if (o.length==0) { return true; }
+
+  if (sortBy == "text") {
+
+  	o = o.sort( 
+
+    	  function(a,b) { 
+
+      	  if ((a.text+"") < (b.text+"")) { return -1; }
+
+      	  if ((a.text+"") > (b.text+"")) { return 1; }
+
+      	  return 0;
+
+    	  } 
+
+  	);
+
+  }
+
+  else if (sortBy == "value") {
+
+    	o = o.sort( 
+
+    	  function(a,b) { 
+
+      	  if ((a.value+"") < (b.value+"")) { return -1; }
+
+      	  if ((a.value+"") > (b.value+"")) { return 1; }
+
+      	  return 0;
+
+    	  } 
+
+  	);
+
+  }
+
+  else {
+
+  	alert("\nError encountered while sorting institutions!!!");
+
+  }
+
+
+
+  for (var i=0; i<o.length; i++) {
+
+    obj.options[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
+
+  }
+
+  return true;
+
+}
+
+
+
+function reSortSelectOptions(formRef,selectRef,sortBy) {
+
+	if (!formRef) {
+
+	 alert("\nForm reference unknown!!!");
+
+	}
+
+	else if (selectRef.length <1) {
+
+	 alert("\n" + selectRef.name + " drop down component is empty!!!");
+
+	}
+
+	else {
+
+	 var result = sortSelect(selectRef,sortBy);
+
+	 if (!result) {
+
+	  alert("\nSorting Select Object failed!!!");
+
+	 }
+
+	}
+
+}
+
+
+
+function doInitialSortOnDivisions(myForm,mySelect,mySortPref,mycookie) {
+
+    var allcookies = mycookie;
+
+    var cookieArry = allcookies.split(";");
+
+    for (var i=0; i < cookieArry.length; i++) {
+
+        cookieArry[i]=cookieArry[i].split("=");
+
+        if ((cookieArry[i][0].indexOf("gov.va.med.authentication.kernel.defaultSortDivisionBy") != -1) &&
+
+            (cookieArry[i][1] == "name")) {
+
+                //Now call function to sort divisions by name.
+
+                reSortSelectOptions(myForm,mySelect,mySortPref)
+
+                break;
+
+        }
+
+    }
+
+}
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/login/login.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/login/login.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/login/login.jsp	(revision 1227)
@@ -0,0 +1,499 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<%@ page language="java" session = "false" %>
+
+
+
+<%@ page import="gov.va.med.authentication.kernel.ConfigurationVO,
+
+  gov.va.med.authentication.kernel.LoginController,
+
+  weblogic.servlet.security.ServletAuthentication;"%>
+
+  
+
+<%
+
+// Turn off cache so that a user cannot navigate back to the login page after post-login
+
+response.setHeader("Cache-Control","no-store, no-cache, must-revalidate"); //HTTP 1.1
+
+response.setHeader("Pragma","no-cache"); //HTTP 1.0
+
+response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
+
+%>
+
+
+
+
+
+<HTML>
+
+<HEAD>
+
+<!--
+
+ * 
+
+ * @author Infrastructure & Security Service
+
+ * @version 1.0.1.002
+
+ * -->
+
+<STYLE type="text/css">
+
+.scrollPane { height:18em; overflow: auto; }
+
+</STYLE>
+
+<TITLE>Login Page</TITLE>
+
+<script type="text/javascript" src="<%= request.getContextPath()%>/login/javascript/login.js"></script>
+
+
+
+
+
+</HEAD>
+
+<BODY onload="javascript:checkHF(document.LoginForm,document.LoginForm.institution,document.LoginForm.sortInstBy,document.LoginForm.disableInstitutionObjHF,document.LoginForm.disableSortByObjHF,document.LoginForm.sortByObjHF);document.LoginForm.access.focus();">
+
+  <a href="#skip" title="Skip to login fields"></a>
+
+
+
+<% 
+
+/*
+
+It could be argued that using code within JSP is not a good thing, but for such a small app it's 
+
+completely acceptable.  If we were working with an HTML designer, the separation would be good. But then
+
+JSTL would be needed and with that we'd introduce some version of that as a dependency, which is preferably
+
+avoided given because we're embedded, we force these dependencies on the containing application as well.
+
+*/
+
+ConfigurationVO kaajeeEnv = ConfigurationVO.getInstance();
+
+
+
+/*
+
+Here if the protocol is 'http', I redirected the user to the same page using 'https' protocol. 
+
+*/
+
+        if(request.getParameter("relogin")!=null){
+
+        HttpSession hSess = request.getSession(false);
+
+		if(hSess == null) {
+
+			StringBuffer sbsession = new StringBuffer(request.getContextPath());
+
+			sbsession.append("/login/SessionTimeout.jsp");
+
+			response.sendRedirect(sbsession.toString());
+
+			return;
+
+		  } 
+
+		 }
+
+		 
+
+HttpSession hSess = request.getSession(true);
+
+		
+
+String desiredSchema = "https"; //or http
+
+String usingSchema = request.getScheme();
+
+if(kaajeeEnv.getHTTPSPortLis() != null ) {
+
+if(!desiredSchema.equals(usingSchema)) {
+
+   
+
+	StringBuffer sburl = request.getRequestURL();
+
+	java.net.URL url = new java.net.URL(sburl.toString());
+
+	hSess = request.getSession(true);
+
+	Integer portValue = new Integer(url.getPort());
+
+	hSess.setAttribute("portnumber",portValue);
+
+
+
+	String urlString = desiredSchema+"://"+ url.getHost() +":"+kaajeeEnv.getHTTPSPortLis()+url.getPath();
+
+    response.sendRedirect(response.encodeRedirectURL(urlString));
+
+    return;
+
+   }
+
+}
+
+
+
+%>
+
+
+
+<FORM name="LoginForm" method="post" action="<%= request.getContextPath() %>/LoginController" onSubmit="javascript:enableInstitutionObj(document.LoginForm,document.LoginForm.institution,document.LoginForm.sortInstBy,document.LoginForm.disableInstitutionObjHF,document.LoginForm.disableSortByObjHF)">
+
+<table align="center" summary="This table is for formatting purposes only">
+
+  <tr>
+
+    <td>
+
+	<table width="75%" border="0" align="center" cellpadding="4" cellspacing="4" bgcolor="#eeeeee">
+
+	    <caption align="left"><strong>System Announcements:</strong></caption>
+
+        <tr><td><div class="scrollPane"><%= kaajeeEnv.getIntroductoryText() %></div></td></tr></table>
+
+
+
+      <table border="0" align="center" cellpadding="3" cellspacing="3" summary="This table is for formatting purposes only">
+
+        <tr align="center"> 
+
+          <td colspan="2" nowrap><h3>Login: <%= kaajeeEnv.getHostApplicationName() %></h3></td>
+
+        </tr>
+
+        <tr> 
+
+          <td><img src="<%= request.getContextPath() %>/login/images/HealtheVetVistaSmallBlue.jpg" alt="Health e Vet Vista logo" width="120" height="60"></td>
+
+          <td><table border="0" align="center" cellpadding="3" cellspacing="3" summary="This table is for formatting purposes only">
+
+              <tr> 
+
+                <th align="right" nowrap><a name="skip"></a>Access Code:</th>
+
+                <td><input type="password" name="access" value="" size=16 maxlength=20></td>
+
+                <td>&nbsp;</td>
+
+              </tr>
+
+              <tr> 
+
+                <th align="right" nowrap>Verify Code:</th>
+
+                <td><input type="password" name="verify" value="" size=16 maxlength=20></td>
+
+              </tr>
+
+              </table></td></tr>
+
+              <tr>
+
+              <%
+
+              //1. Initialize values
+
+              String kaajeeDefaultInstitutionValue = "";
+
+              String kaajeeDisableInstitutionComponentsValue = "";
+
+              String kaajeeSortStationByValue = "";
+
+              String kaajeeDisableSortStationByValue = "";
+
+              boolean kaajeeDefaultInstitutionParamFound = false;
+
+              boolean kaajeeDisableInstitutionParamFound = false;
+
+              boolean kaajeeSortStationByParamFound = false;
+
+              boolean kaajeeDisableSortStationByParamFound = false;
+
+              //2. Get targetURL and parse out parameters
+
+              String targetURL = ServletAuthentication.getTargetURLForFormAuthentication(request.getSession());
+
+              if (targetURL == null) {
+
+                  StringBuffer sbNavErrorPg = new StringBuffer(request.getContextPath());
+
+                  sbNavErrorPg.append("/login/navigationerror.jsp");
+
+                  response.sendRedirect(sbNavErrorPg.toString());
+
+                  return;
+
+              } 
+
+              int paramPos = targetURL.indexOf('?');
+
+              String paramList = (paramPos > -1) ? targetURL.substring(paramPos + 1, targetURL.length()) : "";
+
+              String[] paramArray = paramList.split("\u0026"); //split on '&' char
+
+              for (int i=0; i < paramArray.length; i++) {
+
+                  String[] tempArray=paramArray[i].split("\u003D"); //split on '=' char
+
+                  if (tempArray[0].indexOf("kaajeeDefaultInstitution") != -1) {
+
+                  kaajeeDefaultInstitutionValue = tempArray[1];
+
+                  kaajeeDefaultInstitutionParamFound = true;
+
+                  } else {
+
+                  	if (tempArray[0].indexOf("kaajeeDisableInstitutionComponents") != -1) {
+
+                  	kaajeeDisableInstitutionComponentsValue = tempArray[1];
+
+                  	kaajeeDisableInstitutionParamFound = true;
+
+                  	} else {
+
+                  		if (tempArray[0].indexOf("kaajeeSortStationBy") != -1) {
+
+                  		kaajeeSortStationByValue = tempArray[1];
+
+                  		kaajeeSortStationByParamFound = true;
+
+                  		} else {
+
+                  			if (tempArray[0].indexOf("kaajeeDisableSortStationBy") != -1) {
+
+                  			kaajeeDisableSortStationByValue = tempArray[1];
+
+                  			kaajeeDisableSortStationByParamFound = true;
+
+                  			}
+
+                  		}
+
+                  	}
+
+                  }
+
+                  if ((kaajeeDefaultInstitutionParamFound) && (kaajeeDisableInstitutionParamFound) && (kaajeeSortStationByParamFound) && (kaajeeDisableSortStationByParamFound)) break;
+
+              }
+
+              //
+
+                  //3. Get default login institution and sorting preference if any from cookies
+
+                  boolean sortCookieFound = false;
+
+                  boolean instCookieFound = false;
+
+                  String defaultSortInstBy="";
+
+                  String defaultInst="";
+
+                  String cookieDefaultSortInstitutionByString = LoginController.COOKIE_DEFAULT_SORT_INSTITUTION_BY_STRING;
+
+                  String cookieDefaultDivisionString = LoginController.COOKIE_DEFAULT_DIVISION_STRING;
+
+                  Cookie[] cookies = request.getCookies();
+
+                  if (cookies != null) {
+
+                    for (int i=0;i<cookies.length;i++) {
+
+                      if (cookies[i].getName().equals(cookieDefaultSortInstitutionByString)) {
+
+                        defaultSortInstBy=cookies[i].getValue();
+
+                        // store in session for LoginController, post-submit
+
+                        hSess.setAttribute(LoginController.SESSION_KEY_COOKIE_DEFAULT_SORT_INSTITUTION_BY, defaultSortInstBy);
+
+                        sortCookieFound = true;
+
+                      } else {
+
+                      		if (cookies[i].getName().equals(cookieDefaultDivisionString)) {
+
+                        	defaultInst=cookies[i].getValue(); 
+
+                        	// store in session for LoginController, post-submit
+
+                        	hSess.setAttribute(LoginController.SESSION_KEY_COOKIE_DEFAULT_DIVISION, defaultInst);
+
+                        	instCookieFound = true;
+
+                        	}
+
+                      }
+
+                      if ((sortCookieFound) && (instCookieFound)) break;
+
+                    }
+
+                  }
+
+                  String radioButton1CheckValue = ((kaajeeSortStationByValue.trim().length() > 0) ?
+
+                  	(kaajeeSortStationByValue.equals("number") ? "checked" : "") :
+
+                  	((defaultSortInstBy.equals("")) ||
+
+                  	(defaultSortInstBy.equals("number")) ? "checked" : ""));
+
+                  String radioButton2CheckValue = ((kaajeeSortStationByValue.trim().length() > 0) ?
+
+                  	(kaajeeSortStationByValue.equals("name") ? "checked" : "") :
+
+                  	((defaultSortInstBy.equals("name")) ? "checked" : ""));
+
+              %>
+
+                <td>
+
+                  <input type=radio <%= radioButton1CheckValue %> name=sortInstBy value="number" onclick="reSortSelectOptions(this.form,this.form.institution,'value')">Sort by Station Number *</td>
+
+                <td> <input type=radio <%= radioButton2CheckValue %> name=sortInstBy value="name" onclick="reSortSelectOptions(this.form,this.form.institution,'text')">Sort by Station Name *
+
+                </td>
+
+              </tr>
+
+              <tr> <td > <input type=hidden name="disableInstitutionObjHF" value=<%= kaajeeDisableInstitutionComponentsValue %> ></td></tr>
+
+              <tr> <td > <input type=hidden name="disableSortByObjHF" value=<%= kaajeeDisableSortStationByValue %> ></td></tr>
+
+              <tr> <td > <input type=hidden name="sortByObjHF" value=<%= kaajeeSortStationByValue %> ></td></tr>
+
+              <tr align="center"> 
+
+                <th colspan="2" nowrap>Institution: 
+
+                  <select name="institution" size="1">
+
+                    <%
+
+                  //4. Initialize and Create Option List
+
+                  String imOptionList = "";
+
+                  if (defaultSortInstBy.equals("name")) {
+
+                    imOptionList = kaajeeEnv.getJspDropDownListLoginOptionsByName();
+
+                  }	else {
+
+                    imOptionList = kaajeeEnv.getJspDropDownListLoginOptions();
+
+                  }
+
+                  // TODO: if string is "", show error message?
+
+
+
+                  //5. Set the selected institution in the list based on the cookie value
+
+                  if ((defaultInst != null) || ((kaajeeDefaultInstitutionValue != null) && (kaajeeDefaultInstitutionValue.trim().length() > 0))) {
+
+					// int indexDefaultInst = imOptionList.indexOf("value="+defaultInst+">");
+
+					StringBuffer sbInst = new StringBuffer();
+
+					sbInst.append(((kaajeeDefaultInstitutionValue != null) && (kaajeeDefaultInstitutionValue.trim().length() > 0)) ? kaajeeDefaultInstitutionValue : defaultInst);
+
+					int indexDefaultInst = imOptionList.indexOf("value="+ sbInst.toString() +">");
+
+					if (indexDefaultInst > -1) {
+
+						StringBuffer sb = new StringBuffer();
+
+						sb.append(imOptionList.substring(0, indexDefaultInst -1));
+
+						sb.append(" selected ");
+
+						sb.append(imOptionList.substring(indexDefaultInst, imOptionList.length()-1));
+
+						imOptionList = sb.toString();
+
+					}
+
+                  }
+
+                  %>
+
+                    <%= imOptionList %> 
+
+                  </select>
+
+                  * </th>
+
+                <td>&nbsp;</td>
+
+              </tr>
+
+              <tr> 
+
+                <td align="right" nowrap>&nbsp;</td>
+
+                <!-- <td><input type="checkbox" name="changeverify" value="yes" /><strong>Change Verify Code (Not yet implemented)</strong></td> -->
+
+              </tr>
+
+              <tr> 
+
+                <!-- Relocate Login button here!!! -->
+
+                <td align="right" nowrap>&nbsp;</td>
+
+                <td><input name="submit" type="submit" value="Login"></td>
+
+              </tr>
+
+                <tr align="center">
+
+                <td colspan="2" nowrap>&nbsp;</td>
+
+                <td>&nbsp;</td>
+
+              </tr>
+
+              <tr align="center"> 
+
+                <td colspan="2" nowrap>* Persistent Cookie Used (<a href="<%= request.getContextPath() %>/login/loginCookieInfo.htm" 
+
+          onClick='window.open("<%= request.getContextPath() %>/login/loginCookieInfo.htm","new_win","status=no,scrollbars=yes,toolbar=no,location=no,width=400,height=450,resizable"); return false;'>more 
+
+                  information</a>).</td>
+
+                <td>&nbsp;</td>
+
+              </tr>
+
+            </table></td>
+
+        </tr>    
+
+        <tr> 
+
+          <td colspan="2"><div align="center"></div></td>
+
+        </tr>
+
+      </table>
+
+    </FORM>
+
+</BODY>
+
+</HTML>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/login/loginCookieInfo.htm
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/login/loginCookieInfo.htm	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/login/loginCookieInfo.htm	(revision 1227)
@@ -0,0 +1,87 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+
+<html>
+
+<head>
+
+<!--
+
+ * 
+
+ * @author Infrastructure & Security Service
+
+ * @version 1.0.1.002
+
+ * -->
+
+<title>Login Persistent Cookie Information</title>
+
+</head>
+
+<body>
+
+<h3>Login Persistent Cookie Information</h3>
+
+<p>The login module uses a persistent cookie to store the institution you select at login.
+
+<p>This information is used at the next login, to pre-select the same institution for the next login.</p>
+
+<p>Given that the list of institutions may be quite long for some applications, the goal of using the 
+
+persistent cookie is to save you time by pre-selecting the most likely institution choice, which for most
+
+users would be the previously selected login. This is similar to the Windows login, which saves your last
+
+domain used for login, and pre-selects that domain at the next login.
+
+<p>In addition to the above persistent cookie, the login module uses another persistent cookie to store
+
+the user's preference for sorting institutions in the Institution Drop Down box of the login page.
+
+<p>The cookies contains the following information:
+
+<ul>
+
+<li>name: gov.va.med.authentication.kernel.defaultDivision
+
+<li>value: station number used for the previous login
+
+<li>expiry time: 180 days
+
+<li>name: gov.va.med.authentication.kernel.defaultSortInstitutionBy
+
+<li>value: sort order of name or number used for the previous refresh
+
+<li>expiry time: 180 days
+
+</ul>
+
+
+
+<h4>Thin Client/Terminal Server users:</h4>
+
+<p>Please note that persistent cookies may not be of much use on Terminal Servers.
+
+<p>The reason is that many Terminal Servers may have been configured to use roaming profiles that may
+
+not retain as part of the user profile cookies and temporary internet files upon the user logout
+
+and disconnect.</p>
+
+<p>In such cases, the recommendation is to create on each Terminal Server shortcuts and save them
+
+on the desktop and/or quick launch bar.  These shortcuts should have the desired target URLs plus any
+
+desired KAAJEE supported parameters.  For further details regarding how to use these KAAJEE supported
+
+parameters in order to pre-select the desired institution and institution sorting preference,
+
+please refer to the KAAJEE documentation.
+
+
+
+<p align="center"><a href="loginCookieInfo.htm" ONCLICK='window.close()'><b>Close Window</b></a></p>
+
+</body>
+
+</html>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/login/loginerror.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/login/loginerror.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/login/loginerror.jsp	(revision 1227)
@@ -0,0 +1,25 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+
+<%@ page language="java" %>
+
+<HTML><HEAD>
+
+<!--
+
+ * 
+
+ * @author Infrastructure & Security Service
+
+ * @version 1.0.1.002
+
+ * -->
+
+<TITLE>Forms Authentication Error</TITLE></HEAD>
+
+<BODY>
+
+<h3>Forms authentication login failed.</h3>
+
+<p><a href="<%= request.getContextPath() %>/login/login.jsp">Try login again.</a></p>
+
+</BODY></HTML>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/login/loginerrordisplay.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/login/loginerrordisplay.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/login/loginerrordisplay.jsp	(revision 1227)
@@ -0,0 +1,62 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+
+<%@ page language="java" %>
+
+<HTML><HEAD>
+
+<!--
+
+ * 
+
+ * @author Infrastructure & Security Service
+
+ * @version 1.0.1.002
+
+ * -->
+
+<TITLE>Login Error</TITLE></HEAD>
+
+<BODY>
+
+<%
+
+
+
+String stringurl = "";
+
+ String errorMessage = (String) session.getAttribute("gov.va.med.authentication.kernel.errormessage");
+
+ if (errorMessage == null) errorMessage = "";
+
+ 
+
+%>
+
+<!-- TODO: invalidate any login user demographics session object here? -->
+
+<h3>There was a login error detected by the login system:</h3>
+
+  <table width="80%" align="center">
+
+  <tr><td align="left"><p><b><%= errorMessage %></b></p>
+
+  </td></tr></table>
+
+<%    session.removeAttribute("gov.va.med.authentication.kernel.errormessage");
+
+	  session = request.getSession(false);
+
+	  stringurl =  request.getContextPath()+"/login/login.jsp"+"?relogin=true";
+
+	  
+
+	  
+
+	  
+
+%>
+
+<p><a href="<%= stringurl %>">Try login again.</a></p>
+
+</BODY></HTML>
+
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/login/navigationerror.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/login/navigationerror.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/login/navigationerror.jsp	(revision 1227)
@@ -0,0 +1,27 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
+
+<%@ page language="java" %>
+
+<HTML><HEAD>
+
+<!--<p><a href="<%= request.getContextPath() %>/login/login.jsp">Try login again.</a></p>
+
+ * 
+
+ * @author Infrastructure & Security Service
+
+ * @version 1.0.1.002
+
+ * -->
+
+<TITLE>Navigation Error</TITLE></HEAD>
+
+<BODY>
+
+
+
+<h3>You navigated inappropriately to this page. </h3>
+
+<h3> The login process should only be invoked via the consuming application by using your original bookmark, shortcut or URL destination </h3>
+
+</BODY></HTML>
Index: EDIS/trunk/java/tracking-server-main/src/main/webapp/tracking.jsp
===================================================================
--- EDIS/trunk/java/tracking-server-main/src/main/webapp/tracking.jsp	(revision 1227)
+++ EDIS/trunk/java/tracking-server-main/src/main/webapp/tracking.jsp	(revision 1227)
@@ -0,0 +1,158 @@
+<%@taglib prefix="c" uri="http://java.sun.com/jstl/core" %><%@taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Trans//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<title><fmt:message key="app.name"/></title>
+<script src="AC_OETags.js" language="javascript"></script>
+<style type="text/css">
+    html, body {
+        height: 100%;
+        margin: 0;
+        padding: 0;
+    }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = 9;
+// Minor version of Flash required
+var requiredMinorVersion = 0;
+// Minor version of Flash required
+var requiredRevision = 28;
+// -----------------------------------------------------------------------------
+// -->
+</script>
+
+<!-- BEGIN call Flex function on browser close -->
+<script language="JavaScript" type="text/javascript">
+<!--
+function shutdownHook()
+{
+    var fxControl = document.getElementById('<c:out value="${clientArtifactId}"/>');
+	var warning = fxControl.getUnsavedDataWarning();
+	if (warning != '')
+		return warning;
+	else
+		return;
+}
+
+function invalidateSwf() {
+    var AJAX;
+    if (window.XMLHttpRequest) {
+        AJAX=new XMLHttpRequest();
+    } else {
+        AJAX=new ActiveXObject("Microsoft.XMLHTTP");
+    }
+    if (AJAX) {
+        AJAX.open("GET", '<c:url value="logout.html"/>?swfID=<c:out value="${swfID}"/>', false);
+        AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
+        AJAX.send(null);
+    }            
+}
+
+window.onbeforeunload = shutdownHook;
+window.onunload = invalidateSwf;
+-->
+</script>
+<!-- END call Flex function on browser close -->
+
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+
+// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
+if ( hasProductInstall && !hasRequestedVersion ) {
+	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
+	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
+	// DO NOT MODIFY THE FOLLOWING FOUR LINES
+	// Location visited after installation is complete if installation is required
+	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+	var MMredirectURL = window.location;
+    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+    var MMdoctitle = document.title;
+
+	AC_FL_RunContent(
+		"src", "playerProductInstall",
+		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+		"width", "100%",
+		"height", "100%",
+		"align", "middle",
+		"id", "<c:out value="${clientArtifactId}"/>",
+		"quality", "high",
+		"bgcolor", "#869ca7",
+		"allowFullScreen", "true",
+		"name", "<c:out value="${clientArtifactId}"/>",
+		"allowScriptAccess","sameDomain",
+		"type", "application/x-shockwave-flash",
+		"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+} else if (hasRequestedVersion) {
+	// if we've detected an acceptable version
+	// embed the Flash Content SWF when all tests are passed
+
+	// Cache Server Page namespace should be set here (don't forget the ampersand)
+	//var edpVars = "cspNmsp=CPM&cspDemo=500^10vehu^vehu10&";
+	//var edpVars = "cspServ=vhaislcfgm2.vha.med.va.gov/csp/CPM&cspToken=20012^662&";
+	//var edpVars = "vljServ=10.5.17.153:7001&";
+	//var edpVars = "vljServ=10.5.17.225:7001&";
+	//var edpVars = "vljServ=localhost:7001&";
+	var edpVars = "swfID=<c:out value="${swfID}"/>&contextRoot=<c:out value="${pageContext.request.contextPath}"/>&helpContextRoot=<fmt:message key="help.contextRoot"/>";
+
+	AC_FL_RunContent(
+			"src", "<c:out value="${clientFinalName}"/>",
+			"width", "100%",
+			"height", "100%",
+			"align", "middle",
+			"id", "<c:out value="${clientArtifactId}"/>",
+			"quality", "high",
+			"bgcolor", "#869ca7",
+			"allowFullScreen", "true",
+			"name", "<c:out value="${clientArtifactId}"/>",
+			"flashvars", edpVars,
+			"allowScriptAccess","sameDomain",
+			"type", "application/x-shockwave-flash",
+			"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+    
+    document.onload = document.getElementById('<c:out value="${clientArtifactId}"/>').focus(); 
+  } else {  // flash is too old or we can't detect the plugin
+    var alternateContent = 'Alternate HTML content should be placed here. '
+  	+ 'This content requires the Adobe Flash Player. '
+   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+    document.write(alternateContent);  // insert non-flash content
+  }
+// -->
+</script>
+<noscript>
+  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+			id="<c:out value="${clientArtifactId}"/>" width="100%" height="100%"
+			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+			<param name="movie" value="<c:out value="${clientFinalName}"/>.swf" />
+			<param name="quality" value="high" />
+			<param name="allowFullScreen" value="true" />
+			<param name="bgcolor" value="#869ca7" />
+			<param name="allowScriptAccess" value="sameDomain" />
+			<embed src="<c:out value="${clientFinalName}"/>.swf" quality="high" allowFullScreen="true" bgcolor="#869ca7"
+				width="100%" height="100%" name="tracking" align="middle"
+				play="true"
+				loop="false"
+				quality="high"
+				allowScriptAccess="sameDomain"
+				type="application/x-shockwave-flash"
+				pluginspage="http://www.adobe.com/go/getflashplayer">
+			</embed>
+	</object>
+</noscript>
+</body>
+</html>
Index: EDIS/trunk/java/tracking-server-vista/pom.xml
===================================================================
--- EDIS/trunk/java/tracking-server-vista/pom.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/pom.xml	(revision 1227)
@@ -0,0 +1,150 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>gov.va.med.edp</groupId>
+        <artifactId>edis-tracking-parent</artifactId>
+        <version>1.0-T29-SNAPSHOT</version>
+        <relativePath>../tracking-parent</relativePath>
+    </parent>
+    <groupId>gov.va.med.edp</groupId>
+    <artifactId>edis-tracking-server-vista</artifactId>
+    <packaging>jar</packaging>
+    <name>EDIS VistA Support Library</name>
+    <version>1.0-T29-SNAPSHOT</version>
+    <dependencies>
+    	<dependency>
+    	<groupId>org.springframework</groupId>
+    <artifactId>spring-jca</artifactId>
+    <version>2.0.8</version>
+</dependency>
+    	
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-tx</artifactId>
+            <version>2.5.5</version>  
+            <exclusions>
+            	<exclusion>
+            		<groupId>org.springframework</groupId>
+            		<artifactId>spring-context</artifactId>
+            	</exclusion>
+            </exclusions>         
+        </dependency>        
+        <dependency>
+            <groupId>gov.va.med.vistalink</groupId>
+            <artifactId>vljFoundationsLib</artifactId>
+            <version>1.5.0.026</version>
+            <scope>provided</scope>
+            <!-- remove provided scope in later versions when vistalink is not on classpath of app server -->
+        </dependency>
+        <dependency>
+            <groupId>gov.va.med.vistalink</groupId>
+            <artifactId>vljConnector</artifactId>
+            <version>1.5.0.026</version>
+            <scope>provided</scope>
+            <!-- remove provided scope in later versions when vistalink is not on classpath of app server -->
+        </dependency>
+        <!-- required by vistalink (update vistalink POMs to list dependencies properly) -->
+        <dependency>
+            <groupId>jaxen</groupId>
+            <artifactId>jaxen</artifactId>
+            <version>1.1.1</version>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework.security</groupId>
+            <artifactId>spring-security-core</artifactId>
+            <version>${spring.security.version}</version>
+        </dependency>
+        <dependency><!-- replace this with the two below once we upgrade to newer weblogic -->
+            <groupId>weblogic</groupId>
+            <artifactId>weblogic</artifactId>
+            <version>8.1</version>
+            <scope>provided</scope>
+        </dependency>
+        <!--<dependency>-->
+        <!--<groupId>javax.servlet</groupId>-->
+        <!--<artifactId>servlet-api</artifactId>-->
+        <!--<version>${servlet.version}</version>-->
+        <!--<scope>provided</scope>-->
+        <!--</dependency>-->
+        <!--<dependency>-->
+        <!--<groupId>geronimo-spec</groupId>--><!-- this is the JCA API -->
+        <!--<artifactId>geronimo-spec-j2ee-connector</artifactId>-->
+        <!--<version>1.5-rc4</version>-->
+        <!--<scope>provided</scope>-->
+        <!--</dependency>-->
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-api</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>jcl-over-slf4j</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>log4j-over-slf4j</artifactId>
+            <version>${slf4j.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>junit</groupId>
+            <artifactId>junit</artifactId>
+            <version>3.8.1</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.slf4j</groupId>
+            <artifactId>slf4j-nop</artifactId>
+            <version>${slf4j.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.springframework</groupId>
+            <artifactId>spring-mock</artifactId>
+            <version>${spring.version}</version>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.easymock</groupId>
+            <!-- change to org.easymock for later version -->
+            <artifactId>easymock</artifactId>
+            <version>${easymock.version}</version>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-source-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <configuration>
+                            <attach>true</attach>
+                        </configuration>
+                        <goals>
+                            <goal>jar</goal>
+                            <goal>test-jar</goal>
+                        </goals>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+</project>
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/providers/vistalink/VistaAuthenticationProvider.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/providers/vistalink/VistaAuthenticationProvider.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/providers/vistalink/VistaAuthenticationProvider.java	(revision 1227)
@@ -0,0 +1,159 @@
+package gov.va.med.edp.springframework.security.providers.vistalink;
+
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetailsService;
+import org.springframework.security.*;
+import org.springframework.security.providers.AuthenticationProvider;
+import org.springframework.security.providers.dao.UserCache;
+import org.springframework.security.providers.dao.cache.NullUserCache;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.context.MessageSource;
+import org.springframework.context.MessageSourceAware;
+import org.springframework.context.support.MessageSourceAccessor;
+import org.springframework.dao.DataAccessException;
+import org.springframework.util.Assert;
+
+public class VistaAuthenticationProvider implements AuthenticationProvider, MessageSourceAware, InitializingBean {
+
+    protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();
+    private UserCache userCache = new NullUserCache();
+
+    private VistaUserDetailsService userDetailsService;
+
+    public void afterPropertiesSet() throws Exception {
+        Assert.notNull(this.userCache, "A user cache must be set");
+        Assert.notNull(this.messages, "A message source must be set");
+        Assert.notNull(this.userDetailsService, "A VistaUserDetailsService must be set");
+    }
+
+    public Authentication authenticate(Authentication authentication) throws AuthenticationException {
+        Assert.isInstanceOf(VistaAuthenticationToken.class, authentication,
+                messages.getMessage("VistaAuthenticationProvider.onlySupports",
+                        "Only VistaAuthenticationToken is supported"));
+
+        VistaAuthenticationToken auth = (VistaAuthenticationToken) authentication;
+
+        String username = auth.getName();
+
+        boolean cacheWasUsed = true;
+        VistaUserDetails user = (VistaUserDetails) this.userCache.getUserFromCache(username);
+
+        if (user == null) {
+            cacheWasUsed = false;
+            user = retrieveUser(auth);
+            Assert.notNull(user, "retrieveUser returned null - a violation of the interface contract");
+        }
+
+        if (!user.isAccountNonLocked()) {
+            throw new LockedException(messages.getMessage("VistaAuthenticationProvider.locked",
+                    "User account is locked"));
+        }
+
+        if (!user.isEnabled()) {
+            throw new DisabledException(messages.getMessage("VistaAuthenticationProvider.disabled",
+                    "User is disabled"));
+        }
+
+        if (!user.isAccountNonExpired()) {
+            throw new AccountExpiredException(messages.getMessage("VistaAuthenticationProvider.expired",
+                    "User account has expired"));
+        }
+
+        // This check must come here, as we don't want to tell users
+        // about account status unless they presented the correct credentials
+        try {
+            additionalAuthenticationChecks(user, auth);
+        } catch (AuthenticationException exception) {
+            if (cacheWasUsed) {
+                // There was a problem, so try again after checking
+                // we're using latest data (ie not from the cache)
+                cacheWasUsed = false;
+                user = retrieveUser(auth);
+                additionalAuthenticationChecks(user, auth);
+            } else {
+                throw exception;
+            }
+        }
+
+        if (!user.isCredentialsNonExpired()) {
+            throw new CredentialsExpiredException(messages.getMessage(
+                    "VistaAuthenticationProvider.credentialsExpired", "User credentials have expired"));
+        }
+
+        if (!cacheWasUsed) {
+            this.userCache.putUserInCache(user);
+        }
+
+        return createSuccessAuthentication(user, auth);
+    }
+
+    protected void additionalAuthenticationChecks(VistaUserDetails userDetails,
+                                                  VistaAuthenticationToken authentication) throws AuthenticationException {
+//		Object salt = null;
+//
+//		if (this.saltSource != null) {
+//			salt = this.saltSource.getSalt(userDetails);
+//		}
+//
+        if (authentication.getCredentials() == null) {
+            throw new BadCredentialsException(messages.getMessage(
+                    "VistaAuthenticationProvider.badCredentials", "Bad credentials"),
+                    userDetails);
+        }
+//
+//		String presentedPassword = authentication.getCredentials() == null ? "" : authentication.getCredentials()
+//				.toString();
+//
+//		if (!passwordEncoder.isPasswordValid(userDetails.getPassword(), presentedPassword, salt)) {
+//			throw new BadCredentialsException(messages.getMessage(
+//					"VistaAuthenticationProvider.badCredentials", "Bad credentials"),
+//					includeDetailsObject ? userDetails : null);
+//		}
+    }
+
+    protected Authentication createSuccessAuthentication(VistaUserDetails user, VistaAuthenticationToken authentication) {
+        return new VistaAuthenticationToken(user, authentication.getAccessCode(), authentication.getVerifyCode(), authentication.getRemoteAddress(), user.getAuthorities());
+    }
+
+    public void setMessageSource(MessageSource messageSource) {
+        this.messages = new MessageSourceAccessor(messageSource);
+    }
+
+    public void setUserCache(UserCache userCache) {
+        this.userCache = userCache;
+    }
+
+    public boolean supports(Class authentication) {
+        return VistaAuthenticationToken.class.isAssignableFrom(authentication);
+    }
+
+    public VistaUserDetailsService getUserDetailsService() {
+        return userDetailsService;
+    }
+
+    protected final VistaUserDetails retrieveUser(VistaAuthenticationToken authentication)
+            throws AuthenticationException {
+        VistaUserDetails loadedUser;
+
+        try {
+            loadedUser = this.getUserDetailsService().login(authentication.getStationNumber(), authentication.getAccessCode(), authentication.getVerifyCode(), authentication.getRemoteAddress());
+        }
+        catch (DataAccessException repositoryProblem) {
+            throw new AuthenticationServiceException(repositoryProblem.getMessage(), repositoryProblem);
+        }
+
+        if (loadedUser == null) {
+            throw new AuthenticationServiceException(
+                    "VistaUserDetailsService returned null, which is an interface contract violation");
+        }
+        return loadedUser;
+    }
+
+    public void setUserDetailsService(VistaUserDetailsService userDetailsService) {
+        this.userDetailsService = userDetailsService;
+    }
+
+    public UserCache getUserCache() {
+        return userCache;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/providers/vistalink/VistaAuthenticationToken.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/providers/vistalink/VistaAuthenticationToken.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/providers/vistalink/VistaAuthenticationToken.java	(revision 1227)
@@ -0,0 +1,64 @@
+package gov.va.med.edp.springframework.security.providers.vistalink;
+
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
+import org.springframework.security.GrantedAuthority;
+import org.springframework.security.providers.UsernamePasswordAuthenticationToken;
+import org.springframework.util.StringUtils;
+
+public class VistaAuthenticationToken extends UsernamePasswordAuthenticationToken {
+
+    static final String UNAUTHENTICATED = "UNAUTHENTICATED";
+    private static final String SEP = ";";
+
+    private String accessCode;
+    private String verifyCode;
+
+    public VistaAuthenticationToken(String stationNumber, String accessCode, String verifyCode, String remoteAddress) {
+        super(UNAUTHENTICATED + "@" + stationNumber, (StringUtils.hasLength(accessCode) && StringUtils.hasLength(verifyCode) && StringUtils.hasLength(remoteAddress) ? accessCode + SEP + verifyCode + SEP + remoteAddress : null));
+        this.accessCode = StringUtils.hasLength(accessCode) ? accessCode : null;
+        this.verifyCode = StringUtils.hasLength(verifyCode) ? verifyCode : null;
+        super.setDetails(StringUtils.hasLength(remoteAddress) ? remoteAddress : null);
+    }
+
+    public VistaAuthenticationToken(VistaUserDetails user, String accessCode, String verifyCode, String remoteAddress, GrantedAuthority[] authorities) {
+        super(user, (StringUtils.hasLength(accessCode) && StringUtils.hasLength(verifyCode) && StringUtils.hasLength(remoteAddress) ? accessCode + SEP + verifyCode + SEP + remoteAddress : null), authorities);
+        this.accessCode = StringUtils.hasLength(accessCode) ? accessCode : null;
+        this.verifyCode = StringUtils.hasLength(verifyCode) ? verifyCode : null;
+        super.setDetails(StringUtils.hasLength(remoteAddress) ? remoteAddress : null);
+    }
+
+    public VistaUserDetails getVistaUserDetails() {
+        if (isAuthenticated())
+            return (VistaUserDetails) getPrincipal();
+        return null;
+    }
+
+    public String getDuz() {
+        if (isAuthenticated())
+            return getVistaUserDetails().getDuz();
+        return null;
+    }
+
+    public String getStationNumber() {
+        if (isAuthenticated())
+            return getVistaUserDetails().getLoginStationNumber();
+        else
+            return ((String) getPrincipal()).substring(((String) getPrincipal()).lastIndexOf("@") + 1);
+    }
+
+    public String getAccessCode() {
+        return accessCode;
+    }
+
+    public String getVerifyCode() {
+        return verifyCode;
+    }
+
+    public String getRemoteAddress() {
+        return (String) getDetails();
+    }
+
+    public void setDetails(Object details) {
+        // NOOP
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/ui/vistalink/VistaAuthenticationProcessingFilter.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/ui/vistalink/VistaAuthenticationProcessingFilter.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/ui/vistalink/VistaAuthenticationProcessingFilter.java	(revision 1227)
@@ -0,0 +1,59 @@
+package gov.va.med.edp.springframework.security.ui.vistalink;
+
+import gov.va.med.edp.springframework.security.providers.vistalink.VistaAuthenticationToken;
+import org.springframework.security.Authentication;
+import org.springframework.security.AuthenticationException;
+import org.springframework.security.ui.webapp.AuthenticationProcessingFilter;
+
+import javax.servlet.http.HttpServletRequest;
+
+public class VistaAuthenticationProcessingFilter extends AuthenticationProcessingFilter {
+
+    public static final String STATION_NUMBER_KEY = "j_stationNumber";
+    public static final String ACCESS_CODE_KEY = "j_access";
+    public static final String VERIFY_CODE_KEY = "j_verify";
+
+    public Authentication attemptAuthentication(HttpServletRequest request) throws AuthenticationException {
+        String stationNumber = obtainStationNumber(request);
+        String accessCode = obtainAccessCode(request);
+        String verifyCode = obtainVerifyCode(request);
+        String remoteAddress = obtainRemoteAddress(request);
+
+        if (accessCode == null) {
+            accessCode = "";
+        }
+
+        if (verifyCode == null) {
+            verifyCode = "";
+        }
+
+//        accessCode = accessCode.trim();
+
+        VistaAuthenticationToken authRequest = new VistaAuthenticationToken(stationNumber, accessCode, verifyCode, remoteAddress);
+
+        // Place the last username attempted into HttpSession for views
+//        request.getSession().setAttribute(ACEGI_SECURITY_LAST_USERNAME_KEY, accessCode);
+
+        // Allow subclasses to set the "details" property
+        setDetails(request, authRequest);
+
+        logger.debug("Attempting authentication with token: " + authRequest);
+        return this.getAuthenticationManager().authenticate(authRequest);
+    }
+
+    protected String obtainStationNumber(HttpServletRequest request) {
+        return request.getParameter(STATION_NUMBER_KEY);
+    }
+
+    protected String obtainAccessCode(HttpServletRequest request) {
+        return request.getParameter(ACCESS_CODE_KEY);
+    }
+
+    protected String obtainVerifyCode(HttpServletRequest request) {
+        return request.getParameter(VERIFY_CODE_KEY);
+    }
+
+    protected String obtainRemoteAddress(HttpServletRequest request) {
+        return request.getRemoteAddr();
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/ui/vistalink/VistaLogoutHandler.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/ui/vistalink/VistaLogoutHandler.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/ui/vistalink/VistaLogoutHandler.java	(revision 1227)
@@ -0,0 +1,35 @@
+package gov.va.med.edp.springframework.security.ui.vistalink;
+
+import org.springframework.security.ui.logout.LogoutHandler;
+import org.springframework.security.Authentication;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.util.Assert;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetailsService;
+import gov.va.med.edp.springframework.security.providers.vistalink.VistaAuthenticationToken;
+
+public class VistaLogoutHandler implements LogoutHandler, InitializingBean {
+
+    private VistaUserDetailsService userDetailsService;
+
+    public void afterPropertiesSet() throws Exception {
+        Assert.notNull(userDetailsService, "userDetailsService must be set.");
+    }
+
+    public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication) {
+        if (!(authentication instanceof VistaAuthenticationToken)) return;
+        VistaAuthenticationToken auth = (VistaAuthenticationToken) authentication;
+        userDetailsService.logout(auth.getVistaUserDetails());
+    }
+
+    public VistaUserDetailsService getUserDetailsService() {
+        return userDetailsService;
+    }
+
+    public void setUserDetailsService(VistaUserDetailsService userDetailsService) {
+        this.userDetailsService = userDetailsService;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/VistaUserDetails.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/VistaUserDetails.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/VistaUserDetails.java	(revision 1227)
@@ -0,0 +1,32 @@
+package gov.va.med.edp.springframework.security.userdetails;
+
+import org.springframework.security.userdetails.UserDetails;
+
+public interface VistaUserDetails extends UserDetails {
+
+    String getDuz();
+
+    /**
+     * Corresponds to .01 field in New Person file
+     * @return
+     */
+    String getPersonName();
+
+    String getDisplayName();
+
+    String getGivenName();
+
+    String getMiddleName();
+
+    String getFamilyName();
+
+    String getPrefix();
+
+    String getSuffix();
+
+    String getDegree();
+
+    String getLoginStationNumber();
+
+    String getSignonLogInternalEntryNumber();
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/VistaUserDetailsService.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/VistaUserDetailsService.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/VistaUserDetailsService.java	(revision 1227)
@@ -0,0 +1,37 @@
+package gov.va.med.edp.springframework.security.userdetails;
+
+import org.springframework.security.BadCredentialsException;
+import org.springframework.dao.DataAccessException;
+
+/**
+ * Defines an interface for implementations that wish to provide data access
+ * services to the {@link gov.va.med.edp.springframework.security.providers.vistalink.VistaAuthenticationProvider}.
+ *
+ * <p>
+ * The interface requires only one read-only method, which simplifies support
+ * of new data access strategies.
+ * </p>
+ */
+public interface VistaUserDetailsService {
+     /**
+     * Locates the user based on the username. In the actual implementation, the search may possibly be case
+     * insensitive, or case insensitive depending on how the implementaion instance is configured. In this case, the
+     * <code>UserDetails</code> object that comes back may have a username that is of a different case than what was
+     * actually requested..
+     *
+//     * @param username the username presented to the {@link org.springframework.security.providers.dao.DaoAuthenticationProvider}
+     *
+     * @return a fully populated user record (never <code>null</code>)
+     *
+     * @throws org.springframework.security.userdetails.UsernameNotFoundException if the user could not be found or the user has no GrantedAuthority
+     * @throws org.springframework.dao.DataAccessException if user could not be found for a repository-specific reason
+     */
+    VistaUserDetails login(String stationNumber, String accessCode, String verifyCode, String remoteAddress)
+        throws BadCredentialsException, DataAccessException;
+
+    /**
+     * 
+     * @param user
+     */
+    void logout(VistaUserDetails user) throws DataAccessException;
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/memory/InMemoryDaoImpl.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/memory/InMemoryDaoImpl.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/memory/InMemoryDaoImpl.java	(revision 1227)
@@ -0,0 +1,34 @@
+package gov.va.med.edp.springframework.security.userdetails.memory;
+
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetailsService;
+import org.springframework.security.BadCredentialsException;
+import org.springframework.dao.DataAccessException;
+import org.springframework.beans.factory.InitializingBean;
+import org.springframework.util.Assert;
+
+public class InMemoryDaoImpl implements VistaUserDetailsService, InitializingBean {
+
+    private VistaUserMap userMap;
+
+    public void afterPropertiesSet() throws Exception {
+        Assert.notNull(this.userMap,
+            "A list of user duz, station numbers, access/verify codes, enabled/disabled status and their granted authorities must be set");
+    }
+
+    public VistaUserDetails login(String stationNumber, String accessCode, String verifyCode, String remoteAddress) throws BadCredentialsException, DataAccessException {
+        return userMap.getUser(stationNumber, accessCode, verifyCode);
+    }
+
+    public void logout(VistaUserDetails user) throws DataAccessException {
+        // NOOP
+    }
+
+    public VistaUserMap getUserMap() {
+        return userMap;
+    }
+
+    public void setUserMap(VistaUserMap userMap) {
+        this.userMap = userMap;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/memory/VistaUserMap.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/memory/VistaUserMap.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/memory/VistaUserMap.java	(revision 1227)
@@ -0,0 +1,50 @@
+package gov.va.med.edp.springframework.security.userdetails.memory;
+
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
+import org.springframework.security.userdetails.UsernameNotFoundException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.Assert;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class VistaUserMap {
+
+    private static final Logger logger = LoggerFactory.getLogger(VistaUserMap.class);
+    private Map/*<String, VistaUserDetails>*/ userMap = new HashMap/*<String, VistaUserDetails>*/();
+
+    public void addUser(VistaUserDetails user) throws IllegalArgumentException {
+        Assert.notNull(user, "Must be a valid User");
+
+        logger.info("Adding user [" + getKey(user) + "]");
+        this.userMap.put(getKey(user), user);
+    }
+
+    public VistaUserDetails getUser(String stationNumber, String accessCode, String verifyCode) throws UsernameNotFoundException {
+        String key = getKey(stationNumber, accessCode, verifyCode);
+        VistaUserDetails result = (VistaUserDetails) this.userMap.get(key);
+
+        if (result == null) {
+            throw new UsernameNotFoundException("Could not find user for station '" + stationNumber + "', access code '" + accessCode + "'");
+        }
+
+        return result;
+    }
+
+    private String getKey(VistaUserDetails user) {
+        return (user.getLoginStationNumber() + ";" + user.getPassword()).toUpperCase();
+    }
+
+    private String getKey(String stationNumber, String accessCode, String verifyCode) {
+        return (stationNumber + ";" + accessCode + ";" + verifyCode).toUpperCase();
+    }
+
+    public int getUserCount() {
+        return this.userMap.size();
+    }
+
+    public void setUsers(Map/*<String, VistaUserDetails>*/ users) {
+        this.userMap = users;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/memory/VistaUserMapEditor.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/memory/VistaUserMapEditor.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/memory/VistaUserMapEditor.java	(revision 1227)
@@ -0,0 +1,70 @@
+package gov.va.med.edp.springframework.security.userdetails.memory;
+
+import org.springframework.security.userdetails.memory.UserAttributeEditor;
+import org.springframework.security.userdetails.memory.UserAttribute;
+import org.springframework.beans.propertyeditors.PropertiesEditor;
+import org.springframework.util.StringUtils;
+
+import java.beans.PropertyEditorSupport;
+import java.util.Properties;
+import java.util.Iterator;
+import java.util.Random;
+
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
+import gov.va.med.edp.springframework.security.userdetails.vistalink.VistaUser;
+
+/**
+ * Property editor to assist with the setup of a {@link VistaUserMap}.<p>The format of entries should be:</p>
+ * <p><code> duz@stationNumber=access;verify,grantedAuthority[,grantedAuthority][,enabled|disabled] </code></p>
+ * At least one granted authority must be listed.</p>
+ * <p>The <code>duz@stationNumber</code> represents the key and duplicates are handled the same was as duplicates would be
+ * in Java <code>Properties</code> files.</p>
+ * <p>If the above requirements are not met, the invalid entry will be silently ignored.</p>
+ * <p>This editor always assumes each entry has a non-expired account and non-expired credentials. However, it
+ * does honour the user enabled/disabled flag as described above.</p>
+ */
+public class VistaUserMapEditor extends PropertyEditorSupport {
+    public void setAsText(String s) throws IllegalArgumentException {
+        VistaUserMap userMap = new VistaUserMap();
+
+        if ((s == null) || "".equals(s)) {
+            // Leave value in property editor null
+        } else {
+            // Use properties editor to tokenize the string
+            PropertiesEditor propertiesEditor = new PropertiesEditor();
+            propertiesEditor.setAsText(s);
+
+            Properties props = (Properties) propertiesEditor.getValue();
+            addUsersFromProperties(userMap, props);
+        }
+
+        setValue(userMap);
+    }
+
+    public static VistaUserMap addUsersFromProperties(VistaUserMap userMap, Properties props) {
+        // Now we have properties, process each one individually
+        UserAttributeEditor configAttribEd = new UserAttributeEditor();
+
+        for (Iterator iter = props.keySet().iterator(); iter.hasNext();) {
+            String key = (String) iter.next();
+            String value = props.getProperty(key);
+         
+            // Convert value to a password, enabled setting, and list of granted authorities
+            configAttribEd.setAsText(value);
+
+            UserAttribute attr = (UserAttribute) configAttribEd.getValue();
+
+            // Make a user object, assuming the properties were properly provided
+            if (attr != null) {
+                String duz = StringUtils.split(key, "@")[0];
+                String stationNumber = StringUtils.split(key, "@")[1];
+                String access = StringUtils.split(attr.getPassword(),";")[0];
+                String verify = StringUtils.split(attr.getPassword(),";")[1];
+                VistaUserDetails user = new VistaUser(new Random().toString(), stationNumber, duz, access, verify, attr.isEnabled(), true, true, true, attr.getAuthorities());
+                userMap.addUser(user);
+            }
+        }
+
+        return userMap;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaLinkAccessVerifyConnectionSpec.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaLinkAccessVerifyConnectionSpec.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaLinkAccessVerifyConnectionSpec.java	(revision 1227)
@@ -0,0 +1,165 @@
+package gov.va.med.edp.springframework.security.userdetails.vistalink;
+
+import gov.va.med.crypto.VistaKernelHash;
+import gov.va.med.crypto.VistaKernelHashCountLimitExceededException;
+import gov.va.med.vistalink.adapter.cci.VistaLinkConnectionSpecImpl;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+
+class VistaLinkAccessVerifyConnectionSpec extends VistaLinkConnectionSpecImpl {
+
+    private static final String TYPE_AV = "av";
+    private static final String ELEMENT_AV = "AccessVerify";
+    private static final String ATTRIBUTE_AVCODE = "avCode";
+    private String accessCode;
+    private String verifyCode;
+    private String clientIp;
+    private String avCode;
+
+    private static Logger logger =
+            LoggerFactory.getLogger(VistaLinkAccessVerifyConnectionSpec.class);
+
+    /**
+     * Main constructor for this connection spec.
+     *
+     * @param division   station # (external format) of the division to log the user in against
+     * @param accessCode user access code
+     * @param verifyCode user verify code
+     */
+    public VistaLinkAccessVerifyConnectionSpec(
+            String division,
+            String accessCode,
+            String verifyCode,
+            String clientIp) {
+
+        super(division);
+        this.accessCode = accessCode;
+        this.verifyCode = verifyCode;
+        this.clientIp = clientIp;
+        this.avCode = "";
+        try {
+            this.avCode =
+                    VistaKernelHash.encrypt(
+                            accessCode + ";" + verifyCode + ";" + clientIp,
+                            true);
+        } catch (VistaKernelHashCountLimitExceededException e) {
+            logger.error("Could not encrypt access/verify code", e);
+        }
+    }
+
+    public ArrayList getProprietarySecurityInfo() {
+        ArrayList values = new ArrayList();
+        values.add(this.avCode);
+        return values;
+    }
+
+    public void setAuthenticationNodes(
+            Document requestDoc,
+            Node securityNode) {
+
+        if (logger.isDebugEnabled()) {
+            logger.debug("setAuthenticationNodes -> Re Auth type is 'av'");
+        }
+
+        //AC/OAK OIFO - Next line commented out and replaced by following line as required for upgrading to VL 1.5 dev17:
+        //		setSecurityDivision(securityNode, this.getDivision());
+        setSecurityDivisionAttr(securityNode);
+        //AC/OAK OIFO - Next line commented out and replaced by following line as required for upgrading to VL 1.5 dev17:
+        //		setSecurityType(securityNode, TYPE_AV);
+        setSecurityTypeAttr(securityNode);
+
+        Element elemAV = requestDoc.createElement(ELEMENT_AV);
+
+        /* add CDATA section for encoded AV code */
+        CDATASection cdata = requestDoc.createCDATASection(this.avCode);
+        Node currentAvCdataNode = elemAV.getFirstChild();
+        if (currentAvCdataNode != null) {
+            elemAV.removeChild(currentAvCdataNode);
+        }
+        elemAV.appendChild(cdata);
+
+        securityNode.appendChild(elemAV);
+
+    }
+
+    /**
+     * checks equality with any object
+     */
+    public boolean isConnSpecEqual(Object obj) {
+        return equals(obj);
+    }
+
+    /**
+     * @return whether the object is equal
+     */
+    public boolean equals(Object obj) {
+        if (obj instanceof VistaLinkAccessVerifyConnectionSpec) {
+            VistaLinkAccessVerifyConnectionSpec connSpec =
+                    (VistaLinkAccessVerifyConnectionSpec) obj;
+            if ((connSpec.getDivision().equals(this.getDivision()))
+                    && (connSpec.getAccessCode().equals(this.getAccessCode()))
+                    && (connSpec.getVerifyCode().equals(this.getVerifyCode()))
+                    && (connSpec.getClientIp().equals(this.getClientIp()))) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+    /**
+     * @return the hashCode
+     */
+    public int hashCode() {
+        // algorithm taken from "Effective Java" item #8.
+        int HASHCODE_SEED = 17;
+        int returnVal = HASHCODE_SEED;
+
+        // division contribution to hashcode
+        int divisionHashCode = this.getDivision().hashCode();
+        returnVal = 37 * returnVal + divisionHashCode;
+        // Access code contribution to hashcode
+        int accessHashCode = this.getAccessCode().hashCode();
+        returnVal = 37 * returnVal + accessHashCode;
+        // Verify code contribution to hashcode
+        int verifyHashCode = this.getVerifyCode().hashCode();
+        returnVal = 37 * returnVal + verifyHashCode;
+        // Client IP contribution to hashcode
+        int clientIPHashCode = this.getClientIp().hashCode();
+        returnVal = 37 * returnVal + clientIPHashCode;
+        return returnVal;
+    }
+
+    /**
+     * @return the client ip address
+     */
+    public String getClientIp() {
+        return this.clientIp;
+    }
+
+    /**
+     * @return the internal access code
+     */
+    public String getAccessCode() {
+        return accessCode;
+    }
+
+    /**
+     * @return the internal verify code
+     */
+    public String getVerifyCode() {
+        return verifyCode;
+    }
+
+    /**
+     * returns the security type.
+     */
+    public String getSecurityType() {
+        return TYPE_AV;
+	}
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaLinkUserDetailService.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaLinkUserDetailService.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaLinkUserDetailService.java	(revision 1227)
@@ -0,0 +1,124 @@
+package gov.va.med.edp.springframework.security.userdetails.vistalink;
+
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetailsService;
+import gov.va.med.edp.vistalink.ConnectionFactoryLocator;
+import gov.va.med.edp.vistalink.VistaLinkDaoSupport;
+import gov.va.med.edp.vistalink.VistaLinkTemplate;
+import org.springframework.security.BadCredentialsException;
+import org.springframework.security.GrantedAuthority;
+import org.springframework.security.GrantedAuthorityImpl;
+import org.springframework.dao.DataAccessException;
+import org.springframework.util.StringUtils;
+import org.springframework.util.Assert;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class VistaLinkUserDetailService extends VistaLinkDaoSupport implements VistaUserDetailsService {
+
+    static final int DEFAULT_TIMEOUT = 600;
+
+    static final String RPC_CONTEXT = "XUS KAAJEE WEB LOGON";
+
+    static final String GET_USER_INFO_RPC = "XUS KAAJEE GET USER INFO";
+    static final String LOGOUT_RPC_NAME = "XUS KAAJEE LOGOUT";
+
+    private String applicationName;
+
+    protected void checkDaoConfig() throws IllegalArgumentException {
+        Assert.hasText(applicationName, "''applicationName' must not be empty");
+        super.checkDaoConfig();
+    }
+
+    protected VistaLinkTemplate createRpcTemplate(ConnectionFactoryLocator connectionFactoryLocator) {
+        VistaLinkTemplate template = super.createRpcTemplate(connectionFactoryLocator);
+        template.setTimeOut(DEFAULT_TIMEOUT);
+        return template;
+    }
+
+    public VistaUserDetails login(String stationNumber, String accessCode, String verifyCode, String remoteAddress) throws BadCredentialsException, DataAccessException {
+        if (!StringUtils.hasLength(stationNumber)) throw new BadCredentialsException("missing station number");
+        if (!StringUtils.hasLength(accessCode)) throw new BadCredentialsException("missing access code");
+        if (!StringUtils.hasLength(verifyCode)) throw new BadCredentialsException("missing verify code");
+        if (!StringUtils.hasLength(remoteAddress)) throw new BadCredentialsException("missing remote address");
+        try {
+            String result = getRpcTemplate().rpc(new VistaLinkAccessVerifyConnectionSpec(stationNumber, accessCode, verifyCode, remoteAddress), stationNumber, null, RPC_CONTEXT, GET_USER_INFO_RPC, createLoginParams(remoteAddress));
+            return createVistaUserDetails(result, accessCode, verifyCode);
+        } catch (DataAccessException e) {
+            throw new BadCredentialsException("couldn't log in", e);
+        }
+    }
+
+    public void logout(VistaUserDetails user) throws DataAccessException {
+        getRpcTemplate().rpcAsUser(user.getLoginStationNumber(), user.getDuz(), RPC_CONTEXT, LOGOUT_RPC_NAME, createLogoutParams(user));
+    }
+
+    private List createLoginParams(String remoteAddress) {
+        List params = new ArrayList();
+        params.add(remoteAddress);
+        params.add(getApplicationName());
+        return params;
+    }
+
+
+    private List createLogoutParams(VistaUserDetails user) {
+        List params = new ArrayList();
+        params.add(user.getSignonLogInternalEntryNumber());
+        return params;
+    }
+
+    /*
+     * Result(0) is the users DUZ.
+     * Result(1) is the user name from the .01 field.
+     * Result(2) is the users full name from the name standard file.
+     * Result(3) is the FAMILY (LAST) NAME (or ^ if null)
+     * Result(4) is the GIVEN (FIRST) NAME (or ^ if null)
+     * Result(5) is the MIDDLE NAME (or ^ if null)
+     * Result(6) is the PREFIX (or ^ if null)
+     * Result(7) is the SUFFIX (or ^ if null)
+     * Result(8) is the DEGREE (or ^ if null)
+     * Result(9) is station # of the division that the user is working in.
+     * Result(10) is the station # of the parent facility for the login division
+     * Result(11) is the station # of the computer system "parent" from the KSP file.
+     * Result(12) is the IEN of the signon log entry
+     * Result(13) = # of permissible divisions
+     * Result(14-n) are the permissible divisions for user login, in the format:
+     *             IEN of file 4^Station Name^Station Number^default? (1 or 0)
+     */
+    protected VistaUserDetails createVistaUserDetails(String result, String accessCode, String verifyCode) {
+        String[] results = result.split("\n");
+        VistaUser u = new VistaUser(results[12],
+                results[9],
+                results[0],
+                accessCode,
+                verifyCode,
+                true,
+                true,
+                true,
+                true,
+                new GrantedAuthority[]{new GrantedAuthorityImpl("ROLE_USER")});
+        u.setPersonName(results[1]);
+        u.setDisplayName(results[2]);
+        u.setFamilyName(nullSafeGet(results[3]));
+        u.setGivenName(nullSafeGet(results[4]));
+        u.setMiddleName(nullSafeGet(results[5]));
+        u.setPrefix(nullSafeGet(results[6]));
+        u.setSuffix(nullSafeGet(results[7]));
+        u.setDegree(nullSafeGet(results[8]));
+        return u;
+    }
+
+    private String nullSafeGet(String value) {
+        if (value.equals("^")) return null;
+        return value;
+    }
+
+    public String getApplicationName() {
+        return applicationName;
+    }
+
+    public void setApplicationName(String applicationName) {
+        this.applicationName = applicationName;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaUser.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaUser.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/springframework/security/userdetails/vistalink/VistaUser.java	(revision 1227)
@@ -0,0 +1,153 @@
+package gov.va.med.edp.springframework.security.userdetails.vistalink;
+
+import gov.va.med.edp.springframework.security.userdetails.VistaUserDetails;
+import org.springframework.security.GrantedAuthority;
+
+public class VistaUser implements VistaUserDetails {
+
+    private String loginStationNumber;
+    private String signonLogInternalEntryNumber;
+    private String duz;
+    private String accessCode;
+    private String verifyCode;
+    private String personName;
+    private String displayName;
+    private String givenName;
+    private String middleName;
+    private String familyName;
+    private String prefix;
+    private String suffix;
+    private String degree;
+    private GrantedAuthority[] authorities;
+
+//    private SortedMap<String, VistaDivision> permittedDivisions;
+
+    public VistaUser(String signonLogInternalEntryNumber, String loginStationNumber, String duz, String accessCode, String verifyCode, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, GrantedAuthority[] authorities) {
+        this(signonLogInternalEntryNumber, loginStationNumber, duz, accessCode, verifyCode, null, null,null,null,null,null,null,null,enabled, accountNonExpired, accountNonLocked, credentialsNonExpired, authorities);
+    }
+
+    public VistaUser(String signonLogInternalEntryNumber, String loginStationNumber, String duz, String accessCode, String verifyCode, String personName, String displayName, String givenName, String middleName, String familyName, String prefix, String suffix, String degree, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, GrantedAuthority[] authorities) {
+        if (duz == null) throw new IllegalArgumentException();
+        if (loginStationNumber == null) throw new IllegalArgumentException();
+        if (signonLogInternalEntryNumber == null) throw new IllegalArgumentException();
+        if (authorities == null) throw new IllegalArgumentException();
+        this.duz = duz;
+        this.accessCode = accessCode;
+        this.verifyCode = verifyCode;
+        this.personName = personName;
+        this.displayName = displayName;
+        this.givenName = givenName;
+        this.middleName = middleName;
+        this.familyName = familyName;
+        this.prefix = prefix;
+        this.suffix = suffix;
+        this.degree = degree;
+        this.loginStationNumber = loginStationNumber;
+        this.signonLogInternalEntryNumber = signonLogInternalEntryNumber;
+        this.authorities = authorities;
+    }
+
+    public GrantedAuthority[] getAuthorities() {
+        return authorities;
+    }
+
+    public String getPassword() {
+        return this.accessCode + ";" + this.verifyCode;
+    }
+
+    public String getUsername() {
+        return getDuz() + "@" + getLoginStationNumber();
+    }
+
+    public boolean isAccountNonExpired() {
+        return true;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public boolean isAccountNonLocked() {
+        return true;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public boolean isCredentialsNonExpired() {
+        return true;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public boolean isEnabled() {
+        return true;  //To change body of implemented methods use File | Settings | File Templates.
+    }
+
+    public String getDuz() {
+        return duz;
+    }
+
+    public String getGivenName() {
+        return givenName;
+    }
+
+    public String getMiddleName() {
+        return middleName;
+    }
+
+    public String getFamilyName() {
+        return familyName;
+    }
+
+    public String getPrefix() {
+        return prefix;
+    }
+
+    public String getSuffix() {
+        return suffix;
+    }
+
+    public String getDegree() {
+        return degree;
+    }
+
+    public String getLoginStationNumber() {
+        return loginStationNumber;
+    }
+
+    public String getSignonLogInternalEntryNumber() {
+        return signonLogInternalEntryNumber;
+    }
+
+    public String getDisplayName() {
+        return displayName;
+    }
+
+    public String getPersonName() {
+        return personName;
+    }
+
+    public void setPersonName(String personName) {
+        this.personName = personName;
+    }
+
+    public void setDisplayName(String displayName) {
+        this.displayName = displayName;
+    }
+
+    public void setGivenName(String givenName) {
+        this.givenName = givenName;
+    }
+
+    public void setMiddleName(String middleName) {
+        this.middleName = middleName;
+    }
+
+    public void setFamilyName(String familyName) {
+        this.familyName = familyName;
+    }
+
+    public void setPrefix(String prefix) {
+        this.prefix = prefix;
+    }
+
+    public void setSuffix(String suffix) {
+        this.suffix = suffix;
+    }
+
+    public void setDegree(String degree) {
+        this.degree = degree;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/ConnectionFactoryLocator.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/ConnectionFactoryLocator.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/ConnectionFactoryLocator.java	(revision 1227)
@@ -0,0 +1,22 @@
+package gov.va.med.edp.vistalink;
+
+import org.springframework.dao.DataAccessResourceFailureException;
+
+import javax.resource.cci.ConnectionFactory;
+
+/**
+ * Implementations of this interface retrieve JCA connection factories for a particular VistA station number.
+ *
+ * @see gov.va.med.edp.vistalink.locator.InstitutionMappingConnectionFactoryLocator
+ */
+public interface ConnectionFactoryLocator {
+    /**
+     * Retrieves a connection factory for the specified station number, or throws an exception.  Never should return null.
+     *
+     * @param stationNumber
+     * @return the connection factory for the specified station number, or throw a data access resource exception if there is none.
+     * @throws DataAccessResourceFailureException
+     *
+     */
+    ConnectionFactory getConnectionFactory(String stationNumber) throws DataAccessResourceFailureException;
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkAccessVerifyCodePairInvalidException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkAccessVerifyCodePairInvalidException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkAccessVerifyCodePairInvalidException.java	(revision 1227)
@@ -0,0 +1,9 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.security.m.SecurityAccessVerifyCodePairInvalidException;
+
+public class VistaLinkAccessVerifyCodePairInvalidException extends VistaLinkPermissionDeniedException {
+    public VistaLinkAccessVerifyCodePairInvalidException(SecurityAccessVerifyCodePairInvalidException e) {
+        super(e);
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkDaoSupport.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkDaoSupport.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkDaoSupport.java	(revision 1227)
@@ -0,0 +1,35 @@
+package gov.va.med.edp.vistalink;
+
+import org.springframework.dao.support.DaoSupport;
+import gov.va.med.edp.vistalink.locator.InstitutionMappingConnectionFactoryLocator;
+
+public class VistaLinkDaoSupport extends DaoSupport {
+
+    private VistaLinkTemplate rpcTemplate;
+
+    protected void checkDaoConfig() throws IllegalArgumentException {
+        if (this.rpcTemplate == null) {
+			setConnectionFactoryLocator(new InstitutionMappingConnectionFactoryLocator());
+		}
+    }
+
+    protected VistaLinkTemplate createRpcTemplate(ConnectionFactoryLocator connectionFactoryLocator) {
+        return new VistaLinkTemplate(connectionFactoryLocator);
+    }
+
+    public ConnectionFactoryLocator getConnectionFactoryLocator() {
+        return rpcTemplate.getConnectionFactoryLocator();
+    }
+
+    public void setConnectionFactoryLocator(ConnectionFactoryLocator connectionFactoryLocator) {
+        setRpcTemplate(createRpcTemplate(connectionFactoryLocator));
+    }
+
+    public VistaLinkTemplate getRpcTemplate() {
+        return rpcTemplate;
+    }
+
+    public void setRpcTemplate(VistaLinkTemplate rpcTemplate) {
+        this.rpcTemplate = rpcTemplate;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkDataRetrievalFailureException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkDataRetrievalFailureException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkDataRetrievalFailureException.java	(revision 1227)
@@ -0,0 +1,38 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+import org.springframework.dao.DataRetrievalFailureException;
+
+public class VistaLinkDataRetrievalFailureException extends DataRetrievalFailureException {
+
+    private VistaLinkFaultException fault;
+
+    public VistaLinkDataRetrievalFailureException(VistaLinkFaultException fault) {
+        super(fault.getErrorMessage(), fault);
+        this.fault = fault;
+    }
+
+    public String getErrorCode() {
+        return fault.getErrorCode();
+    }
+
+    public String getErrorMessage() {
+        return fault.getErrorMessage();
+    }
+
+    public String getErrorType() {
+        return fault.getErrorType();
+    }
+
+    public String getFaultActor() {
+        return fault.getFaultActor();
+    }
+
+    public String getFaultCode() {
+        return fault.getFaultCode();
+    }
+
+    public String getFaultString() {
+        return fault.getFaultString();
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkInvalidUsageException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkInvalidUsageException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkInvalidUsageException.java	(revision 1227)
@@ -0,0 +1,37 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+import org.springframework.dao.InvalidDataAccessResourceUsageException;
+
+public class VistaLinkInvalidUsageException extends InvalidDataAccessResourceUsageException {
+    private VistaLinkFaultException fault;
+
+    public VistaLinkInvalidUsageException(VistaLinkFaultException fault) {
+        super(fault.getErrorMessage(), fault);
+        this.fault = fault;
+    }
+
+    public String getErrorCode() {
+        return fault.getErrorCode();
+    }
+
+    public String getErrorMessage() {
+        return fault.getErrorMessage();
+    }
+
+    public String getErrorType() {
+        return fault.getErrorType();
+    }
+
+    public String getFaultActor() {
+        return fault.getFaultActor();
+    }
+
+    public String getFaultCode() {
+        return fault.getFaultCode();
+    }
+
+    public String getFaultString() {
+        return fault.getFaultString();
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkLoginsDisabledException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkLoginsDisabledException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkLoginsDisabledException.java	(revision 1227)
@@ -0,0 +1,9 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.adapter.record.LoginsDisabledFaultException;
+
+public class VistaLinkLoginsDisabledException extends VistaLinkResourceFailureException {
+    public VistaLinkLoginsDisabledException(LoginsDisabledFaultException fault) {
+        super(fault);
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkNoJobSlotsAvailableException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkNoJobSlotsAvailableException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkNoJobSlotsAvailableException.java	(revision 1227)
@@ -0,0 +1,9 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.adapter.record.NoJobSlotsAvailableFaultException;
+
+public class VistaLinkNoJobSlotsAvailableException extends VistaLinkTransientDataAccessResourceException {
+    public VistaLinkNoJobSlotsAvailableException(NoJobSlotsAvailableFaultException fault) {
+        super(fault);
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkNoRpcContextException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkNoRpcContextException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkNoRpcContextException.java	(revision 1227)
@@ -0,0 +1,9 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.rpc.NoRpcContextFaultException;
+
+public class VistaLinkNoRpcContextException extends VistaLinkInvalidUsageException {
+    public VistaLinkNoRpcContextException(NoRpcContextFaultException fault) {
+        super(fault);
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkPermissionDeniedException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkPermissionDeniedException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkPermissionDeniedException.java	(revision 1227)
@@ -0,0 +1,39 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+import gov.va.med.vistalink.security.m.SecurityFaultException;
+import org.springframework.dao.PermissionDeniedDataAccessException;
+
+public class VistaLinkPermissionDeniedException extends PermissionDeniedDataAccessException {
+
+    private VistaLinkFaultException fault;
+
+    public VistaLinkPermissionDeniedException(SecurityFaultException fault) {
+        super(fault.getErrorMessage(), fault);
+        this.fault = fault;
+    }
+
+    public String getErrorCode() {
+        return fault.getErrorCode();
+    }
+
+    public String getErrorMessage() {
+        return fault.getErrorMessage();
+    }
+
+    public String getErrorType() {
+        return fault.getErrorType();
+    }
+
+    public String getFaultActor() {
+        return fault.getFaultActor();
+    }
+
+    public String getFaultCode() {
+        return fault.getFaultCode();
+    }
+
+    public String getFaultString() {
+        return fault.getFaultString();
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkResourceFailureException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkResourceFailureException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkResourceFailureException.java	(revision 1227)
@@ -0,0 +1,37 @@
+package gov.va.med.edp.vistalink;
+
+import org.springframework.dao.DataAccessResourceFailureException;
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+
+public class VistaLinkResourceFailureException extends DataAccessResourceFailureException {
+     private VistaLinkFaultException fault;
+
+    public VistaLinkResourceFailureException(VistaLinkFaultException fault) {
+        super(fault.getErrorMessage(), fault);
+        this.fault = fault;
+    }
+
+    public String getErrorCode() {
+        return fault.getErrorCode();
+    }
+
+    public String getErrorMessage() {
+        return fault.getErrorMessage();
+    }
+
+    public String getErrorType() {
+        return fault.getErrorType();
+    }
+
+    public String getFaultActor() {
+        return fault.getFaultActor();
+    }
+
+    public String getFaultCode() {
+        return fault.getFaultCode();
+    }
+
+    public String getFaultString() {
+        return fault.getFaultString();
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkRpcNotInContextException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkRpcNotInContextException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkRpcNotInContextException.java	(revision 1227)
@@ -0,0 +1,9 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.rpc.RpcNotInContextFaultException;
+
+public class VistaLinkRpcNotInContextException extends VistaLinkInvalidUsageException {
+    public VistaLinkRpcNotInContextException(RpcNotInContextFaultException fault) {
+        super(fault);
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkRpcNotOkForProxyUseException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkRpcNotOkForProxyUseException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkRpcNotOkForProxyUseException.java	(revision 1227)
@@ -0,0 +1,9 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.rpc.RpcNotOkForProxyUseException;
+
+public class VistaLinkRpcNotOkForProxyUseException extends VistaLinkInvalidUsageException {
+    public VistaLinkRpcNotOkForProxyUseException(RpcNotOkForProxyUseException fault) {
+        super(fault);
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkTemplate.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkTemplate.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkTemplate.java	(revision 1227)
@@ -0,0 +1,144 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.exception.FoundationsException;
+import gov.va.med.vistalink.adapter.cci.VistaLinkAppProxyConnectionSpec;
+import gov.va.med.vistalink.adapter.cci.VistaLinkConnection;
+import gov.va.med.vistalink.adapter.cci.VistaLinkDuzConnectionSpec;
+import gov.va.med.vistalink.adapter.record.LoginsDisabledFaultException;
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+import gov.va.med.vistalink.rpc.*;
+import gov.va.med.vistalink.security.m.SecurityFaultException;
+import org.springframework.dao.*;
+import org.springframework.jca.cci.core.CciTemplate;
+import org.springframework.jca.cci.core.ConnectionCallback;
+import org.springframework.util.Assert;
+import org.slf4j.LoggerFactory;
+import org.slf4j.Logger;
+
+import javax.resource.ResourceException;
+import javax.resource.cci.Connection;
+import javax.resource.cci.ConnectionFactory;
+import javax.resource.cci.ConnectionSpec;
+import java.sql.SQLException;
+import java.text.MessageFormat;
+import java.util.List;
+
+/**
+ * This is the central class in the rpc package. It simplifies the use of VistaLink RPCs and helps to avoid common errors.
+ * It executes core RPC workflow, leaving application code to provide RPC names and parameters and extract results. This
+ * class executes RPCs with VistaLink, initiating iteration over RPC results and catching VistaLink exceptions and
+ * translating them to the generic data access exception hierarchy defined in the org.springframework.dao package.
+ */
+public class VistaLinkTemplate {
+
+    static final int DEFAULT_TIMEOUT = 10000;
+
+    private static Logger log = LoggerFactory.getLogger(VistaLinkTemplate.class);
+
+    private int timeOut = DEFAULT_TIMEOUT;
+    private ConnectionFactoryLocator connectionFactoryLocator;
+    private static final String UNABLE_TO_EXECUTE_RPC = "Unable to execute RPC";
+
+    public VistaLinkTemplate(ConnectionFactoryLocator connectionFactoryLocator) {
+        this.connectionFactoryLocator = connectionFactoryLocator;
+    }
+
+    public String rpcAsUser(final String division, final String duz, final String rpcContext, final String rpcName) throws DataAccessException {
+        return rpcAsUser(division, duz, rpcContext, rpcName, (List) null);
+    }
+
+//    TODO: Uncomment me on java 5
+//    public String rpcAsUser(final String division, final String duz, final String rpcContext, final String rpcName, Object... params) throws DataAccessException {
+//        return rpcAsUser(division, duz, rpcContext, rpcName, createParameterList(params));
+//    }
+
+    public String rpcAsUser(final String division, final String duz, final String rpcContext, final String rpcName, final List params) throws DataAccessException {
+        return rpc(new VistaLinkDuzConnectionSpec(division, duz), division, duz, rpcContext, rpcName, params);
+    }
+
+    public String rpcAsApplication(final String division, final String applicationProxyName, final String rpcContext, final String rpcName) throws DataAccessException {
+        return rpcAsApplication(division, applicationProxyName, rpcContext, rpcName, (List) null);
+    }
+
+//    TODO: Uncomment me on java 5
+//    public String rpcAsApplication(final String division, final String applicationProxyName, final String rpcContext, final String rpcName, Object... params) throws DataAccessException {
+//        return rpcAsApplication(division, applicationProxyName, rpcContext, rpcName, createParameterList(params));
+//    }
+
+    public String rpcAsApplication(final String division, final String applicationProxyName, final String rpcContext, final String rpcName, final List params) throws DataAccessException {
+        return rpc(new VistaLinkAppProxyConnectionSpec(division, applicationProxyName), division, applicationProxyName, rpcContext, rpcName, params);
+    }
+
+    public String rpc(ConnectionSpec connectionSpec, final String division, final String user, final String rpcContext, final String rpcName, final List params) throws DataAccessException {
+        if (log.isDebugEnabled())
+            log.debug(MessageFormat.format("''{0}'' called in context ''{1}'' by ''{2}'' at facility ''{3}'' with params: {4}", new Object[]{rpcName, rpcContext, user, division, params}));
+
+        ConnectionFactory connectionFactory = connectionFactoryLocator.getConnectionFactory(division);
+        try {
+            CciTemplate t = new CciTemplate(connectionFactory, connectionSpec);
+            RpcResponse response = (RpcResponse) t.execute(new ConnectionCallback() {
+                public Object doInConnection(Connection connection, ConnectionFactory connectionFactory) throws ResourceException, SQLException, DataAccessException {
+                    try {
+                        Assert.isInstanceOf(VistaLinkConnection.class, connection);
+                        VistaLinkConnection conn = (VistaLinkConnection) connection;
+                        conn.setTimeOut(getTimeOut());
+
+                        RpcRequest request = RpcRequestFactory.getRpcRequest(rpcContext, rpcName);
+                        request.setUseProprietaryMessageFormat(true);
+                        request.setXmlResponse(false);
+
+                        if (params != null) {
+                            request.setParams(params);
+                        }
+
+                        return conn.executeRPC(request);
+                    } catch (IllegalArgumentException e) {
+                        throw new InvalidDataAccessApiUsageException(UNABLE_TO_EXECUTE_RPC, e);
+                    } catch (NoRpcContextFaultException e) {
+                        throw new VistaLinkNoRpcContextException(e);
+                    } catch (RpcNotOkForProxyUseException e) {
+                        throw new VistaLinkRpcNotOkForProxyUseException(e);
+                    } catch (RpcNotInContextFaultException e) {
+                        throw new VistaLinkRpcNotInContextException(e);
+                    } catch (LoginsDisabledFaultException e) {
+                        throw new VistaLinkLoginsDisabledException(e);
+                    } catch (SecurityFaultException e) {
+                        throw new VistaLinkPermissionDeniedException(e);
+                    } catch (VistaLinkFaultException e) {
+                        throw new VistaLinkDataRetrievalFailureException(e);
+                    } catch (FoundationsException e) {
+                        throw new DataRetrievalFailureException(UNABLE_TO_EXECUTE_RPC, e);
+                    }
+                }
+            });
+            String result = response.getResults();
+            if (log.isDebugEnabled()) {
+                log.debug(MessageFormat.format("''{0}'' returned: {1}", new Object[]{rpcName, result}));
+            }
+            return result;
+        } catch (IllegalArgumentException e) {
+            throw new InvalidDataAccessApiUsageException(UNABLE_TO_EXECUTE_RPC, e);
+        }
+    }
+
+    public int getTimeOut() {
+        return timeOut;
+    }
+
+    public void setTimeOut(int timeOut) {
+        this.timeOut = timeOut;
+    }
+
+    public ConnectionFactoryLocator getConnectionFactoryLocator() {
+        return connectionFactoryLocator;
+    }
+
+//  TODO: Uncomment me for java 5
+//    private List createParameterList(Object... params) {
+//        List paramList = new ArrayList();
+//        for (Object param : params) {
+//            paramList.add(param);
+//        }
+//        return paramList;
+//    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkTransientDataAccessResourceException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkTransientDataAccessResourceException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkTransientDataAccessResourceException.java	(revision 1227)
@@ -0,0 +1,37 @@
+package gov.va.med.edp.vistalink;
+
+import org.springframework.dao.TransientDataAccessResourceException;
+import gov.va.med.vistalink.adapter.record.VistaLinkFaultException;
+
+public class VistaLinkTransientDataAccessResourceException extends TransientDataAccessResourceException {
+     private VistaLinkFaultException fault;
+
+    public VistaLinkTransientDataAccessResourceException(VistaLinkFaultException fault) {
+        super(fault.getErrorMessage(), fault);
+        this.fault = fault;
+    }
+
+    public String getErrorCode() {
+        return fault.getErrorCode();
+    }
+
+    public String getErrorMessage() {
+        return fault.getErrorMessage();
+    }
+
+    public String getErrorType() {
+        return fault.getErrorType();
+    }
+
+    public String getFaultActor() {
+        return fault.getFaultActor();
+    }
+
+    public String getFaultCode() {
+        return fault.getFaultCode();
+    }
+
+    public String getFaultString() {
+        return fault.getFaultString();
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkVerifyCodeExpiredException.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkVerifyCodeExpiredException.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/VistaLinkVerifyCodeExpiredException.java	(revision 1227)
@@ -0,0 +1,9 @@
+package gov.va.med.edp.vistalink;
+
+import gov.va.med.vistalink.security.m.SecurityUserVerifyCodeException;
+
+public class VistaLinkVerifyCodeExpiredException extends VistaLinkPermissionDeniedException {
+    public VistaLinkVerifyCodeExpiredException(SecurityUserVerifyCodeException fault) {
+        super(fault);
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/adapter/spi/VistaLinkManagedConnectionFactory.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/adapter/spi/VistaLinkManagedConnectionFactory.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/adapter/spi/VistaLinkManagedConnectionFactory.java	(revision 1227)
@@ -0,0 +1,18 @@
+package gov.va.med.edp.vistalink.adapter.spi;
+
+import org.springframework.beans.factory.InitializingBean;
+import gov.va.med.vistalink.adapter.spi.EMAdapterEnvironment;
+
+public class VistaLinkManagedConnectionFactory extends gov.va.med.vistalink.adapter.spi.VistaLinkManagedConnectionFactory implements InitializingBean {
+
+    private String stationNumber;
+
+    public void afterPropertiesSet() throws Exception {
+        setPrimaryStation(stationNumber);
+        setAdapterEnvironment(EMAdapterEnvironment.J2EE);
+    }
+
+    public void setStationNumber(String stationNumber) {
+        this.stationNumber = stationNumber;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/BeanFactoryConnectionFactoryLocator.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/BeanFactoryConnectionFactoryLocator.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/BeanFactoryConnectionFactoryLocator.java	(revision 1227)
@@ -0,0 +1,65 @@
+package gov.va.med.edp.vistalink.locator;
+
+import org.springframework.beans.BeansException;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.BeanFactoryAware;
+import org.springframework.dao.DataAccessResourceFailureException;
+import org.springframework.util.StringUtils;
+
+import javax.resource.cci.ConnectionFactory;
+import java.text.MessageFormat;           
+
+import gov.va.med.edp.vistalink.ConnectionFactoryLocator;
+
+public class BeanFactoryConnectionFactoryLocator implements ConnectionFactoryLocator, BeanFactoryAware {
+
+    private static final String NO_CONNECTION_FACTORY = "Unable to obtain connection factory for station ''{0}''";
+
+    private BeanFactory beanFactory;
+    private String prefix;
+    private String suffix;
+
+    public ConnectionFactory getConnectionFactory(String stationNumber) throws DataAccessResourceFailureException {
+        try {
+            ConnectionFactory connectionFactory = (ConnectionFactory) beanFactory.getBean(getBeanName(stationNumber), ConnectionFactory.class);
+            return connectionFactory;
+        } catch (BeansException e) {
+
+            throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY, new Object[] {stationNumber}), e);
+//            throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY, stationNumber), e); // TODO: use this one for java 5
+        }
+    }
+
+    private String getBeanName(String stationNumber) {
+//        StringBuilder builder = new StringBuilder();  // TODO: switch to StringBuilder in java 5
+        StringBuffer builder = new StringBuffer();
+        if (StringUtils.hasText(getPrefix())) {
+            builder.append(getPrefix());
+        }
+        builder.append(stationNumber);
+        if (StringUtils.hasText(getSuffix())) {
+            builder.append(getSuffix());
+        }
+        return builder.toString();
+    }
+
+    public void setBeanFactory(BeanFactory beanFactory) throws BeansException {
+        this.beanFactory = beanFactory;
+    }
+
+    public String getPrefix() {
+        return prefix;
+    }
+
+    public void setPrefix(String prefix) {
+        this.prefix = prefix;
+    }
+
+    public String getSuffix() {
+        return suffix;
+    }
+
+    public void setSuffix(String suffix) {
+        this.suffix = suffix;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/InstitutionMappingConnectionFactoryLocator.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/InstitutionMappingConnectionFactoryLocator.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/InstitutionMappingConnectionFactoryLocator.java	(revision 1227)
@@ -0,0 +1,44 @@
+package gov.va.med.edp.vistalink.locator;
+
+import gov.va.med.vistalink.adapter.cci.VistaLinkConnectionFactory;
+import gov.va.med.vistalink.institution.InstitutionMapNotInitializedException;
+import gov.va.med.vistalink.institution.InstitutionMappingDelegate;
+import gov.va.med.vistalink.institution.InstitutionMappingNotFoundException;
+import gov.va.med.edp.vistalink.ConnectionFactoryLocator;
+import org.springframework.dao.DataAccessResourceFailureException;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import javax.resource.cci.ConnectionFactory;
+import java.text.MessageFormat;
+
+public class InstitutionMappingConnectionFactoryLocator implements ConnectionFactoryLocator {
+    private static final String NO_CONNECTION_FACTORY = "Unable to obtain connection factory for station ''{0}''";
+    private static final String NO_CONNECTION_FACTORY_JNDI = "Unable to obtain connection factory for station ''{0}'' at JNDI name ''{1}''";
+
+    public ConnectionFactory getConnectionFactory(String stationNumber) throws DataAccessResourceFailureException {
+        try {
+            String jndiConnectorName = InstitutionMappingDelegate.getJndiConnectorNameForInstitution(
+                    stationNumber);
+            try {
+                Context ic = new InitialContext();
+                VistaLinkConnectionFactory vistaLinkConnectionFactory = (VistaLinkConnectionFactory) ic.lookup(jndiConnectorName);
+                if (vistaLinkConnectionFactory == null)
+                throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY_JNDI, new Object[] {stationNumber, jndiConnectorName}));
+//                    throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY_JNDI, stationNumber, jndiConnectorName)); // TODO: switch to this one in java 5
+                return vistaLinkConnectionFactory;
+            } catch (NamingException e) {
+                 throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY_JNDI, new Object[] {stationNumber, jndiConnectorName}), e);
+//                throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY_JNDI, stationNumber, jndiConnectorName), e); // TODO: switch to this one in java 5
+            }
+        } catch (InstitutionMappingNotFoundException e) {
+            throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY, new Object[] {stationNumber}), e);
+//            throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY, stationNumber), e); // TODO: switch to this one in java 5
+        } catch (InstitutionMapNotInitializedException e) {
+            throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY, new Object[] {stationNumber}), e);
+//            throw new DataAccessResourceFailureException(MessageFormat.format(NO_CONNECTION_FACTORY, stationNumber), e); // TODO: switch to this one in java 5
+        }
+
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/VistaLinkConnectorConfig.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/VistaLinkConnectorConfig.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/VistaLinkConnectorConfig.java	(revision 1227)
@@ -0,0 +1,70 @@
+package gov.va.med.edp.vistalink.locator;
+
+public class VistaLinkConnectorConfig {
+    private String primaryStation;
+    private String name;
+    private String host;
+    private int port;
+    private String accessCode;
+    private String verifyCode;
+
+    public VistaLinkConnectorConfig() {
+    }
+
+     public VistaLinkConnectorConfig(String primaryStation, String name, String host, int port, String accessCode, String verifyCode) {
+        this.primaryStation = primaryStation;
+        this.name = name;
+        this.host = host;
+        this.port = port;
+        this.accessCode = accessCode;
+        this.verifyCode = verifyCode;
+    }
+
+    public String getPrimaryStation() {
+        return primaryStation;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public int getPort() {
+        return port;
+    }
+
+    public String getAccessCode() {
+        return accessCode;
+    }
+
+    public String getVerifyCode() {
+        return verifyCode;
+    }
+
+    public void setPrimaryStation(String primaryStation) {
+        this.primaryStation = primaryStation;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public void setPort(int port) {
+        this.port = port;
+    }
+
+    public void setAccessCode(String accessCode) {
+        this.accessCode = accessCode;
+    }
+
+    public void setVerifyCode(String verifyCode) {
+        this.verifyCode = verifyCode;
+    }
+}
Index: EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/VistaLinkConnectorConfigConnectionFactoryLocator.java
===================================================================
--- EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/VistaLinkConnectorConfigConnectionFactoryLocator.java	(revision 1227)
+++ EDIS/trunk/java/tracking-server-vista/src/main/java/gov/va/med/edp/vistalink/locator/VistaLinkConnectorConfigConnectionFactoryLocator.java	(revision 1227)
@@ -0,0 +1,75 @@
+package gov.va.med.edp.vistalink.locator;
+
+import gov.va.med.edp.vistalink.ConnectionFactoryLocator;
+import gov.va.med.edp.vistalink.adapter.spi.VistaLinkManagedConnectionFactory;
+import org.springframework.beans.factory.BeanFactory;
+import org.springframework.beans.factory.config.BeanDefinition;
+import org.springframework.beans.factory.support.BeanDefinitionBuilder;
+import org.springframework.beans.factory.support.DefaultListableBeanFactory;
+import org.springframework.dao.DataAccessResourceFailureException;
+import org.springframework.jca.support.LocalConnectionFactoryBean;
+
+import javax.resource.cci.ConnectionFactory;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+import java.util.Iterator;
+
+public class VistaLinkConnectorConfigConnectionFactoryLocator implements ConnectionFactoryLocator {
+
+    private static final String VLJ_CONNECTOR_PREFIX = "vljConnector";
+
+    private Map/*<String, VistaLinkConnectorConfig>*/ connectors = new HashMap/*<String, VistaLinkConnectorConfig>*/();
+    private BeanFactoryConnectionFactoryLocator locator = new BeanFactoryConnectionFactoryLocator();
+
+    public VistaLinkConnectorConfigConnectionFactoryLocator() {
+        locator.setPrefix(VLJ_CONNECTOR_PREFIX);
+        locator.setBeanFactory(createBeanFactory());
+    }
+
+    private BeanFactory createBeanFactory() {
+        DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory();
+        for (Iterator i = connectors.values().iterator(); i.hasNext(); ) {
+            VistaLinkConnectorConfig connector = (VistaLinkConnectorConfig) i.next();
+            beanFactory.registerBeanDefinition(getManagedConnectionFactoryBeanName(connector), createManagedConnectionFactoryBeanDefinition(connector));
+            beanFactory.registerBeanDefinition(getConnectionFactoryBeanName(connector), createConnectionFactoryBeanDefinition(connector));
+        }
+        return beanFactory;
+    }
+
+    private String getConnectionFactoryBeanName(VistaLinkConnectorConfig connector) {
+        return VLJ_CONNECTOR_PREFIX + connector.getPrimaryStation();
+    }
+
+    private BeanDefinition createManagedConnectionFactoryBeanDefinition(VistaLinkConnectorConfig connector) {
+        BeanDefinitionBuilder managedConnectionFactoryBeanDefBuilder = BeanDefinitionBuilder.rootBeanDefinition(VistaLinkManagedConnectionFactory.class);
+        managedConnectionFactoryBeanDefBuilder.addPropertyValue("stationNumber", connector.getPrimaryStation());
+        managedConnectionFactoryBeanDefBuilder.addPropertyValue("nonManagedHostIPAddress", connector.getHost());
+        managedConnectionFactoryBeanDefBuilder.addPropertyValue("nonManagedHostPort", new Integer(connector.getPort()));
+        managedConnectionFactoryBeanDefBuilder.addPropertyValue("nonManagedAccessCode", connector.getAccessCode());
+        managedConnectionFactoryBeanDefBuilder.addPropertyValue("nonManagedVerifyCode", connector.getVerifyCode());
+        return managedConnectionFactoryBeanDefBuilder.getBeanDefinition();
+    }
+
+    private BeanDefinition createConnectionFactoryBeanDefinition(VistaLinkConnectorConfig connector) {
+        BeanDefinitionBuilder localConnectionFactoryBeanDefBuilder = BeanDefinitionBuilder.rootBeanDefinition(LocalConnectionFactoryBean.class);
+        localConnectionFactoryBeanDefBuilder.addPropertyReference("managedConnectionFactory", getManagedConnectionFactoryBeanName(connector));
+        return localConnectionFactoryBeanDefBuilder.getBeanDefinition();
+    }
+
+    private String getManagedConnectionFactoryBeanName(VistaLinkConnectorConfig connector) {
+        return "vljManagedConnectionFactory" + connector.getPrimaryStation();
+    }
+
+    public ConnectionFactory getConnectionFactory(String stationNumber) throws DataAccessResourceFailureException {
+        return locator.getConnectionFactory(stationNumber);
+    }
+
+    public void setConnectors(Set/*<VistaLinkConnectorConfig>*/ connectors) {
+        for (Iterator i = connectors.iterator(); i.hasNext(); ) {
+            VistaLinkConnectorConfig connector = (VistaLinkConnectorConfig) i.next();
+            this.connectors.put(connector.getPrimaryStation(), connector);
+        }
+        locator.setBeanFactory(createBeanFactory());
+    }
+}
Index: EDIS/trunk/java/tracking-ui-bigboard/.actionScriptProperties
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/.actionScriptProperties	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/.actionScriptProperties	(revision 1227)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<actionScriptProperties mainApplicationPath="bigboard.mxml" version="3">
+  <compiler additionalCompilerArguments="-locale en_US" copyDependentFiles="true" enableModuleDebug="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="false" htmlPlayerVersion="9.0.0" htmlPlayerVersionCheck="true" outputFolderPath="target" sourceFolderPath="src/main/flex" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+    <compilerSourcePath>
+      <compilerSourcePathEntry kind="1" linkType="1" path="src/main/resources"/>
+    </compilerSourcePath>
+    <libraryPath defaultLinkType="1">
+      <libraryPathEntry kind="4" path="">
+        <modifiedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/>
+        </modifiedEntries>
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="3" linkType="1" path="C:/Documents and Settings/vhaislbelids/.m2/repository/com/adobe/cairngorm/2.2.1/cairngorm-2.2.1.swc" useDefaultLinkType="false"/>
+      <libraryPathEntry kind="3" linkType="1" path="C:/dev/reeng/main/ed/tracking-ui-core/target/edis-tracking-ui-core-1.0.swc" useDefaultLinkType="false"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="bigboard.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>
Index: EDIS/trunk/java/tracking-ui-bigboard/.flexProperties
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/.flexProperties	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/.flexProperties	(revision 1227)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<flexProperties flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/>
Index: EDIS/trunk/java/tracking-ui-bigboard/.p4ignore
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/.p4ignore	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/.p4ignore	(revision 1227)
@@ -0,0 +1,1 @@
+target
Index: EDIS/trunk/java/tracking-ui-bigboard/EDIS_BigBoard.bat
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/EDIS_BigBoard.bat	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/EDIS_BigBoard.bat	(revision 1227)
@@ -0,0 +1,7 @@
+@echo off
+REM start iexplore.exe -k URL_TO_EDIS_BIGBOARD.html ..See Example Below
+start iexplore.exe -k https://edis.med.va.gov/bigboard
+
+REM for using firefox, use the command below..
+REM start firefox.exe -chrome https://edis.med.va.gov/bigboard
+REM you can use install the firefox plugin for Kiosk Mode ..https://addons.mozilla.org/en-US/firefox/addon/1659
Index: EDIS/trunk/java/tracking-ui-bigboard/EDIS_BigBoard_Test.bat
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/EDIS_BigBoard_Test.bat	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/EDIS_BigBoard_Test.bat	(revision 1227)
@@ -0,0 +1,7 @@
+@echo off
+REM start iexplore.exe -k URL_TO_EDIS_BIGBOARD.html ..See Example Below
+start iexplore.exe -k https://staging.edis.med.va.gov/bigboard
+
+REM for using firefox, use the command below..
+REM start firefox.exe -chrome https://staging.edis.med.va.gov/bigboard
+REM you can use install the firefox plugin for Kiosk Mode ..https://addons.mozilla.org/en-US/firefox/addon/1659
Index: EDIS/trunk/java/tracking-ui-bigboard/Launch_EDIS_BigBoard_IE.bat
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/Launch_EDIS_BigBoard_IE.bat	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/Launch_EDIS_BigBoard_IE.bat	(revision 1227)
@@ -0,0 +1,7 @@
+@echo off
+REM start iexplore.exe -k URL_TO_EDIS_BIGBOARD.html ..See Example Below
+start iexplore.exe -k http://www.google.com
+
+REM for using firefor, use the command below..
+REM start firefox.exe -chrome http://www.google.com
+REM you can use install the firefox plugin for Kiosk Mode ..https://addons.mozilla.org/en-US/firefox/addon/1659
Index: EDIS/trunk/java/tracking-ui-bigboard/html-template/AC_OETags.js
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/html-template/AC_OETags.js	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/html-template/AC_OETags.js	(revision 1227)
@@ -0,0 +1,276 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+	var version;
+	var axo;
+	var e;
+
+	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+	try {
+		// version will be set for 7.X or greater players
+		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+		version = axo.GetVariable("$version");
+	} catch (e) {
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 6.X players only
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+			
+			// installed player is some revision of 6.0
+			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+			// so we have to be careful. 
+			
+			// default to the first public version
+			version = "WIN 6,0,21,0";
+
+			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
+			axo.AllowScriptAccess = "always";
+
+			// safe to call for 6.0r47 or greater
+			version = axo.GetVariable("$version");
+
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 4.X or 5.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = axo.GetVariable("$version");
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 3.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = "WIN 3,0,18,0";
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 2.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+			version = "WIN 2,0,0,11";
+		} catch (e) {
+			version = -1;
+		}
+	}
+	
+	return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+	// NS/Opera version >= 3 check for Flash plugin in plugin array
+	var flashVer = -1;
+	
+	if (navigator.plugins != null && navigator.plugins.length > 0) {
+		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+			var descArray = flashDescription.split(" ");
+			var tempArrayMajor = descArray[2].split(".");			
+			var versionMajor = tempArrayMajor[0];
+			var versionMinor = tempArrayMajor[1];
+			var versionRevision = descArray[3];
+			if (versionRevision == "") {
+				versionRevision = descArray[4];
+			}
+			if (versionRevision[0] == "d") {
+				versionRevision = versionRevision.substring(1);
+			} else if (versionRevision[0] == "r") {
+				versionRevision = versionRevision.substring(1);
+				if (versionRevision.indexOf("d") > 0) {
+					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+				}
+			}
+			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+		}
+	}
+	// MSN/WebTV 2.6 supports Flash 4
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+	// WebTV 2.5 supports Flash 3
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+	// older WebTV supports Flash 2
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+	else if ( isIE && isWin && !isOpera ) {
+		flashVer = ControlVersion();
+	}	
+	return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+	versionStr = GetSwfVer();
+	if (versionStr == -1 ) {
+		return false;
+	} else if (versionStr != 0) {
+		if(isIE && isWin && !isOpera) {
+			// Given "WIN 2,0,0,11"
+			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
+			tempString        = tempArray[1];			// "2,0,0,11"
+			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
+		} else {
+			versionArray      = versionStr.split(".");
+		}
+		var versionMajor      = versionArray[0];
+		var versionMinor      = versionArray[1];
+		var versionRevision   = versionArray[2];
+
+        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
+		if (versionMajor > parseFloat(reqMajorVer)) {
+			return true;
+		} else if (versionMajor == parseFloat(reqMajorVer)) {
+			if (versionMinor > parseFloat(reqMinorVer))
+				return true;
+			else if (versionMinor == parseFloat(reqMinorVer)) {
+				if (versionRevision >= parseFloat(reqRevision))
+					return true;
+			}
+		}
+		return false;
+	}
+}
+
+function AC_AddExtension(src, ext)
+{
+  if (src.indexOf('?') != -1)
+    return src.replace(/\?/, ext+'?'); 
+  else
+    return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs) 
+{ 
+    var str = '';
+    if (isIE && isWin && !isOpera)
+    {
+  		str += '<object ';
+  		for (var i in objAttrs)
+  			str += i + '="' + objAttrs[i] + '" ';
+  		str += '>';
+  		for (var i in params)
+  			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
+  		str += '</object>';
+    } else {
+  		str += '<embed ';
+  		for (var i in embedAttrs)
+  			str += i + '="' + embedAttrs[i] + '" ';
+  		str += '> </embed>';
+    }
+
+    document.write(str);
+}
+
+function AC_FL_RunContent(){
+  var ret = 
+    AC_GetArgs
+    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+     , "application/x-shockwave-flash"
+    );
+  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+  var ret = new Object();
+  ret.embedAttrs = new Object();
+  ret.params = new Object();
+  ret.objAttrs = new Object();
+  for (var i=0; i < args.length; i=i+2){
+    var currArg = args[i].toLowerCase();    
+
+    switch (currArg){	
+      case "classid":
+        break;
+      case "pluginspage":
+        ret.embedAttrs[args[i]] = args[i+1];
+        break;
+      case "src":
+      case "movie":	
+        args[i+1] = AC_AddExtension(args[i+1], ext);
+        ret.embedAttrs["src"] = args[i+1];
+        ret.params[srcParamName] = args[i+1];
+        break;
+      case "onafterupdate":
+      case "onbeforeupdate":
+      case "onblur":
+      case "oncellchange":
+      case "onclick":
+      case "ondblClick":
+      case "ondrag":
+      case "ondragend":
+      case "ondragenter":
+      case "ondragleave":
+      case "ondragover":
+      case "ondrop":
+      case "onfinish":
+      case "onfocus":
+      case "onhelp":
+      case "onmousedown":
+      case "onmouseup":
+      case "onmouseover":
+      case "onmousemove":
+      case "onmouseout":
+      case "onkeypress":
+      case "onkeydown":
+      case "onkeyup":
+      case "onload":
+      case "onlosecapture":
+      case "onpropertychange":
+      case "onreadystatechange":
+      case "onrowsdelete":
+      case "onrowenter":
+      case "onrowexit":
+      case "onrowsinserted":
+      case "onstart":
+      case "onscroll":
+      case "onbeforeeditfocus":
+      case "onactivate":
+      case "onbeforedeactivate":
+      case "ondeactivate":
+      case "type":
+      case "codebase":
+        ret.objAttrs[args[i]] = args[i+1];
+        break;
+      case "id":
+      case "width":
+      case "height":
+      case "align":
+      case "vspace": 
+      case "hspace":
+      case "class":
+      case "title":
+      case "accesskey":
+      case "name":
+      case "tabindex":
+        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+        break;
+      default:
+        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+    }
+  }
+  ret.objAttrs["classid"] = classid;
+  if (mimeType) ret.embedAttrs["type"] = mimeType;
+  return ret;
+}
+
+
Index: EDIS/trunk/java/tracking-ui-bigboard/html-template/index.template.html
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/html-template/index.template.html	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/html-template/index.template.html	(revision 1227)
@@ -0,0 +1,148 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Cache-Control" content="no-cache, must-revalidate" />
+<meta http-equiv="Pragma" content="no-cache" />
+<meta http-equiv="Expires" content="-1" />
+<title>${title}</title>
+<script src="AC_OETags.js" language="javascript"></script>
+<style>
+    html, body {
+        height: 100%;
+        margin: 0;
+        padding: 0;
+    }
+    body {
+        overflow:hidden;
+    }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = ${version_major};
+// Minor version of Flash required
+var requiredMinorVersion = ${version_minor};
+// Minor version of Flash required
+var requiredRevision = ${version_revision};
+// -----------------------------------------------------------------------------
+// -->
+</script>
+
+<!-- BEGIN call Flex function on browser close -->
+<script language="JavaScript" type="text/javascript">
+<!--
+function shutdownHook()
+{
+	var fxControl = document.${application} || window.${application};
+	var warning = fxControl.getUnsavedDataWarning();
+	if (warning != '')
+		return warning;
+	else
+		return;
+}
+
+window.onbeforeunload = shutdownHook;
+-->
+</script>
+<!-- END call Flex function on browser close -->
+
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+
+// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
+if ( hasProductInstall && !hasRequestedVersion ) {
+	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
+	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
+	// DO NOT MODIFY THE FOLLOWING FOUR LINES
+	// Location visited after installation is complete if installation is required
+	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+	var MMredirectURL = window.location;
+    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+    var MMdoctitle = document.title;
+
+	AC_FL_RunContent(
+		"src", "playerProductInstall",
+		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+		"width", "${width}",
+		"height", "${height}",
+		"align", "middle",
+		"id", "${application}",
+		"quality", "high",
+		"bgcolor", "${bgcolor}",
+		"allowFullScreen", "true",
+		"name", "${application}",
+		"allowScriptAccess","sameDomain",
+		"type", "application/x-shockwave-flash",
+		"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+} else if (hasRequestedVersion) {
+	// if we've detected an acceptable version
+	// embed the Flash Content SWF when all tests are passed
+	
+	// Cache Server Page namespace should be set here (don't forget the ampersand)
+	//var edpVars = "cspNmsp=CPM&cspDemo=500^10vehu^vehu10&";
+	//var edpVars = "cspServ=vhaislcfgm2.vha.med.va.gov/csp/CPM&cspToken=20012^662&";
+	//var edpVars = "vljServ=10.5.17.153:7001&";
+	//var edpVars = "vljServ=10.5.17.225:7001&";
+	//SEE LINE BELOW TO LAUNCH BIG BOARD FROM FLEX BUILDER AND PASSING IN A SITE ID
+	var edpVars = "vljServ=vhaislbll2.vha.med.va.gov:7141&siteId=442&";
+	//var edpVars = "";
+	
+	AC_FL_RunContent(
+			"src", "${swf}",
+			"width", "${width}",
+			"height", "${height}",
+			"align", "middle",
+			"id", "${application}",
+			"quality", "high",
+			"bgcolor", "${bgcolor}",
+			"allowFullScreen", "true",
+			"name", "${application}",
+			"flashvars", edpVars,
+			"allowScriptAccess","sameDomain",
+			"type", "application/x-shockwave-flash",
+			"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+  } else {  // flash is too old or we can't detect the plugin
+    var alternateContent = 'Alternate HTML content should be placed here. '
+  	+ 'This content requires the Adobe Flash Player. '
+   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+    document.write(alternateContent);  // insert non-flash content
+  }
+// -->
+</script>
+<noscript>
+  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+			id="${application}" width="${width}" height="${height}"
+			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+			<param name="movie" value="${swf}.swf" />
+			<param name="quality" value="high" />
+			<param name="allowFullScreen" value="true" />
+			<param name="bgcolor" value="${bgcolor}" />
+			<param name="allowScriptAccess" value="sameDomain" />
+			<embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"
+				width="${width}" height="${height}" name="${application}" align="middle"
+				play="true"
+				loop="false"
+				quality="high"
+				allowScriptAccess="sameDomain"
+				type="application/x-shockwave-flash"
+				pluginspage="http://www.adobe.com/go/getflashplayer">
+			</embed>
+	</object>
+</noscript>
+</body>
+</html>
Index: EDIS/trunk/java/tracking-ui-bigboard/pom.xml
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/pom.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/pom.xml	(revision 1227)
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>gov.va.med.edp</groupId>
+        <artifactId>edis-tracking-parent</artifactId>
+        <version>1.0-T29-SNAPSHOT</version>
+        <relativePath>../tracking-parent</relativePath>
+    </parent>
+    <groupId>gov.va.med.edp</groupId>
+    <artifactId>edis-tracking-ui-bigboard</artifactId>
+    <packaging>swf</packaging>
+    <name>EDIS Tracking UI Big Board</name>
+    <version>1.0-T29-SNAPSHOT</version>
+    <dependencies>
+        <dependency>
+            <groupId>gov.va.med.edp</groupId>
+            <artifactId>edis-tracking-ui-core</artifactId>
+            <version>${project.version}</version>
+            <type>swc</type>
+        </dependency>
+    </dependencies>
+    <build>
+        <sourceDirectory>src/main/flex</sourceDirectory>
+        <resources>
+            <resource>
+                <directory>src/main/resources</directory>
+                <filtering>true</filtering>
+            </resource>
+        </resources>
+        <plugins>
+            <plugin>
+                <groupId>info.flex-mojos</groupId>
+                <artifactId>flex-compiler-mojo</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
Index: EDIS/trunk/java/tracking-ui-bigboard/src/main/flex/META-INF/MANIFEST.MF
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/src/main/flex/META-INF/MANIFEST.MF	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/src/main/flex/META-INF/MANIFEST.MF	(revision 1227)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+
Index: EDIS/trunk/java/tracking-ui-bigboard/src/main/flex/bigboard.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/src/main/flex/bigboard.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/src/main/flex/bigboard.mxml	(revision 1227)
@@ -0,0 +1,236 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- BigBoard.mxml -->
+
+<mx:Application
+        xmlns:mx="http://www.adobe.com/2006/mxml"
+        xmlns:control="gov.va.med.edp.control.*"
+        xmlns:business="gov.va.med.edp.business.*"
+        xmlns:view="gov.va.med.edp.view.*"
+        xmlns:log="gov.va.med.edp.view.log.*"
+        pageTitle="Tracking Display Board"
+        height="100%"
+        width="100%"
+        paddingLeft="0" paddingRight="0" paddingBottom="0"
+        paddingTop="6"
+        creationComplete="initApp()" xmlns:board="gov.va.med.edp.view.board.*">
+
+    <mx:Style source="edp.css"/>
+
+    <mx:Script>
+	<![CDATA[
+        import flash.utils.Timer;
+        import flash.events.TimerEvent;
+        import mx.managers.SystemManager;
+        import mx.core.Container;
+        import mx.utils.URLUtil;
+        import com.adobe.cairngorm.control.CairngormEventDispatcher;
+        import com.adobe.cairngorm.control.CairngormEvent;
+        import gov.va.med.edp.model.TrackingModelLocator;
+        import gov.va.med.edp.control.InitAppEvent;
+        import gov.va.med.edp.util.InactivityTimeout;
+        import com.adobe.cairngorm.business.ServiceLocator;
+        import gov.va.med.edp.business.Services;
+
+        public static const VERSION_INCOMPATIBILITY_RELOAD_COUNTDOWN:int = 10;
+
+        [Bindable]
+        public var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        [Bindable]
+        private var inactivityTimeout:InactivityTimeout = new InactivityTimeout();
+
+        private var reloadTimer : Timer;
+        private var digitalClockTimer:Timer;
+
+        private function initApp():void
+        {
+
+            var e: InitAppEvent = new InitAppEvent(InitAppEvent.EVENT_INIT_APP);
+            e.appName = TrackingModelLocator.APP_NAME_BIGBOARD;
+            e.contextRoot = Application.application.parameters.contextRoot;
+            e.helpContextRoot = Application.application.parameters.helpContextRoot;
+            e.protocol = URLUtil.getProtocol(Application.application.url);
+            if (e.protocol == "file") e.protocol = "http";
+
+            // first check the vljServ parameter
+            if (Application.application.parameters.hasOwnProperty("vljServ")) {
+                e.server = Application.application.parameters.vljServ;
+                e.mode = InitAppEvent.SERVICE_USE_VLJ;
+            }
+            if (Application.application.parameters.hasOwnProperty("timeout")) {
+                e.timeout = new Boolean(Application.application.parameters.timeout);
+            }
+            if (Application.application.parameters.hasOwnProperty("siteId")) {
+                e.siteId = Application.application.parameters.siteId;
+            }
+            if (Application.application.parameters.hasOwnProperty("area")) {
+                e.areaName = Application.application.parameters.area;
+            }
+
+
+            // then check the cspServ parameter
+            if ((e.server.length == 0) && Application.application.parameters.hasOwnProperty("cspServ")) {
+                e.server = Application.application.parameters.cspServ;
+                e.mode = InitAppEvent.SERVICE_USE_CSP;
+                e.token = Application.application.parameters.cspToken;
+            }
+            // if running in development mode try localhost
+            if ((e.server.length == 0) && (Application.application.url.substr(0, 7) == "file://")) {
+                e.server = "localhost:7001";
+                e.mode = InitAppEvent.SERVICE_USE_VLJ;
+            }
+            // default:  use the server and port of the HTML wrapper with VLJ
+            if (e.server.length == 0) {
+                e.server = URLUtil.getServerNameWithPort(Application.application.url);
+                e.mode = InitAppEvent.SERVICE_USE_VLJ;
+            }
+            e.dispatch();
+
+            Application.application.pageTitle = "Tracking System: " + e.server;
+            //set up the digital clock
+            digitalClockTimer = new Timer(1000);
+            digitalClockTimer.addEventListener(TimerEvent.TIMER, resetClock);
+            digitalClockTimer.start();
+        }
+
+        private function resetClock(event:TimerEvent):void {
+            //currentMemoryLbl.text = "Total Flash Player Memory (bytes): " + System.totalMemory ;
+            var clockDate:Date = new Date();
+            currentDateLbl.text = clockDate.toLocaleDateString() + ", " + clockDate.toLocaleTimeString();
+        }
+
+        private function getView(view:Number): Container
+        {
+            switch (view) {
+                case TrackingModelLocator.VIEW_APP_INTRO: return introView;
+                case TrackingModelLocator.VIEW_APP_VERSION_INCOMPATIBILITY: return versionIncompatibilityView;
+                case TrackingModelLocator.VIEW_APP_DISPLAY_BOARD: return bigBoard;
+                default: return noneView;
+            }
+        }
+
+        [Bindable(event="secondsUntilReloadChanged")]
+        public function get secondsUntilReload():int {
+            if (reloadTimer == null)
+                return VERSION_INCOMPATIBILITY_RELOAD_COUNTDOWN;
+            else
+                return reloadTimer.repeatCount - reloadTimer.currentCount;
+        }
+
+        private function updateSecondsUntilReload(e:TimerEvent):void {
+            dispatchEvent(new Event("secondsUntilReloadChanged"));
+        }
+
+        private function startTimer(): void {
+            if (reloadTimer == null) {
+                reloadTimer = new Timer(1000, VERSION_INCOMPATIBILITY_RELOAD_COUNTDOWN);
+                reloadTimer.addEventListener(TimerEvent.TIMER, updateSecondsUntilReload);
+                reloadTimer.addEventListener(TimerEvent.TIMER_COMPLETE, reloadApp);
+            }
+            reloadTimer.reset();
+            reloadTimer.start();
+        }
+
+        private function reloadApp(e:TimerEvent):void {
+            model.logout();
+        }
+
+        private function set initSessionTimeout(value: uint):void
+        {
+            if (Application.application.parameters.hasOwnProperty("timeout")) {
+                var timeoutEnabled: Boolean = new Boolean(Application.application.parameters.timeout);
+                if (timeoutEnabled) inactivityTimeout.start();
+            }
+            
+        }
+
+        public function set workingStatus(bText:String):void
+        {
+            if (bText.length > 0) {
+                currentState = 'sessionTimeOutState';
+                lblWorkingStatus.text = bText;
+            } else {
+                currentState = "";
+                lblWorkingStatus.text = "";
+            }
+        }
+        
+		private function set addDebugTooltip(value: Boolean): void
+		{        
+            var debugStr: String = "EDIS Version=" + model.appClientVersion + "\n";
+            if (model.bigboardInfo != null && value){
+                 if (model.bigboardInfo.bigBoardSiteCode.length > 0 && model.bigboardInfo.bigBoardSiteCode != "null")debugStr = debugStr + "Site=" + model.bigboardInfo.bigBoardSiteCode + "\n";
+                 if (model.bigboardInfo.bigBoardMachineName.length > 0 && model.bigboardInfo.bigBoardMachineName != "null")debugStr = debugStr + "Machine=" + model.bigboardInfo.bigBoardMachineName + "\n";
+                 if (model.bigboardInfo.vistaLinkIPAddress.length > 0 && model.bigboardInfo.vistaLinkIPAddress != "null")debugStr = debugStr + "Vistalink-IPAddress=" + model.bigboardInfo.vistaLinkIPAddress + "\n";
+                 if (model.bigboardInfo.vistaLinkPort.length > 0 && model.bigboardInfo.vistaLinkPort != "null")debugStr = debugStr + "Vistalink-Port=" + model.bigboardInfo.vistaLinkPort + "\n";
+            }
+            currentDateLbl.toolTip = debugStr;            			
+		}
+        
+            
+
+                
+	]]>
+    </mx:Script>
+
+    <!-- ========================================================================== -->
+
+    <!-- the ServiceLocator where we specify the remote services -->
+    <business:Services id="services"/>
+
+    <!-- the FrontController, containing Commands specific to this appliation -->
+    <control:TrackingController id="controller"/>
+
+    <!-- ========================================================================== -->
+
+    <mx:ViewStack
+            id="appView"
+            width="100%"
+            height="100%"
+            selectedChild="{getView(model.appViewState)}">
+
+        <mx:TitleWindow id="introView" title="Emergency Department Integration Software"/>
+        <mx:Canvas id="noneView">
+            <mx:Label horizontalCenter="0" verticalCenter="0" text="No Views Configured"/>
+        </mx:Canvas>
+        <mx:Canvas id="versionIncompatibilityView" show="startTimer()">
+            <mx:Panel title="EDIS Version Incompatibility"
+                      paddingTop="10" paddingLeft="10" paddingRight="10" horizontalCenter="0" verticalCenter="0"
+                      width="75%">
+                <mx:Text width="100%">
+                    <mx:text>
+                        This is EDIS board version '{model.appClientVersion}'.
+                        The EDIS server package version running in your VistA account is
+                        '{model.session.serverPackageVersion}'.
+                        It appears that the web server has served the wrong version of the board for your configuration.
+                        Will attempt to load version '{model.session.serverPackageVersion}' of the board in
+                        {secondsUntilReload} seconds.
+                    </mx:text>
+                </mx:Text>
+            </mx:Panel>
+        </mx:Canvas>
+        <board:BigDisplayBoard id="bigBoard"/>
+    </mx:ViewStack>
+    <mx:HBox width="100%">
+        <mx:Label id="currentDateLbl" fontSize="10" width="100%" textAlign="center" fontWeight="bold"/>
+<!--        <mx:Label id="currentMemoryLbl" fontSize="10" width="100%" textAlign="center" fontWeight="bold"/> --> 
+    </mx:HBox>
+    <mx:states>
+        <mx:State name="sessionTimeOutState">
+            <mx:AddChild relativeTo="{appView}" position="before">
+                <mx:target>
+                     <mx:VBox id="disconnectedBoardPanel" width="100%">
+                        <mx:ApplicationControlBar paddingBottom="0" paddingTop="0" dock="true" width="100%" fillColors="[#FF0000,#BF0000]" fillAlphas="[0.8,0.8]">
+                            <mx:Text id="lblWorkingStatus" horizontalCenter="0" verticalCenter="0"
+                                     textAlign="center" width="100%" height="100%" color="white" fontSize="{model.boardSpec.displayBoardProperties.fontSize}"/>
+                        </mx:ApplicationControlBar>
+                    </mx:VBox>
+                </mx:target>
+            </mx:AddChild>
+        </mx:State>
+    </mx:states>
+    <mx:Binding source="model.session.timeOut" destination="initSessionTimeout"/>
+    <mx:Binding source="inactivityTimeout.status" destination="workingStatus"/>
+	<mx:Binding source="model.boardSpec.specReady" destination="addDebugTooltip"/>
+    
+</mx:Application>
Index: EDIS/trunk/java/tracking-ui-bigboard/src/main/flex/edp.css
===================================================================
--- EDIS/trunk/java/tracking-ui-bigboard/src/main/flex/edp.css	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-bigboard/src/main/flex/edp.css	(revision 1227)
@@ -0,0 +1,142 @@
+/* CSS file */
+@font-face
+{
+    src: url("/assets/fonts/Vera.ttf");
+    fontFamily: main;
+    fontStyle: normal;
+    fontWeight: normal;
+    advancedAntiAliasing: true;
+}
+
+@font-face
+{
+    src: url("/assets/fonts/VeraBd.ttf");
+    fontFamily: main;
+    fontStyle: normal;
+    fontWeight: bold;
+    advancedAntiAliasing: true;
+}
+
+global {
+    focusThickness: 2;
+    focusBlendMode: difference;
+    letterSpacing: .5;
+    fontThickness: -25;
+}
+
+Application {
+	backgroundColor: #CCCCCC;
+	backgroundGradientColors: #CCCCCC, #EEEEEE;
+	backgroundGradientAlphas: 0.6, 0.4;
+	themeColor: #CCCCCC;
+	fontFamily:main;
+}
+
+Label {
+	font-size:10;
+}
+
+DataGrid {
+	selectionColor:#3366CC;
+	textSelectedColor:white;
+	use-roll-over:false;
+	headerColors: #FFFFFF, #CCCCCC;
+}
+
+List {
+	selectionColor:#3366CC;
+	textSelectedColor:white;
+	use-roll-over:false;
+}	
+
+ComboBox {
+	selection-color: #3366CC;
+	roll-over-color: #3366CC;
+	text-selected-color: white;
+	text-roll-over-color: white;
+	font-weight: bold;
+}
+
+TextInput {
+	font-weight:normal;
+	borderColor: #666666;
+}
+
+LinkBar {
+	color: #6B5B5B;
+	disabledColor: #186CDD;
+	text-roll-over-color: #186CDD;
+}
+
+LinkButton {
+	font-weight:bold;
+	font-size:10;
+	color:#186CDD;
+	roll-over-color: white;
+	selection-color: white;
+}
+
+FormItem {
+	font-weight:bold;
+	font-size:10;
+	color:#999999;
+}
+
+.linkSelected {
+	font-weight:bold;
+	font-size:10;
+	color: #6B5B5B;
+}
+
+.linkUnSelected {
+	color:#186CDD;
+	font-size:10;
+	font-weight:bold;	
+}
+
+.reportLabel {
+	font-weight:bold;
+	font-size:10;
+	color:#999999;
+}
+
+.controlLabel {
+	font-weight:bold;
+	font-size:10;
+	color:#999999;
+}
+
+.normalLabel {
+	font-weight:normal;
+	font-size:10;
+	color:black;
+}
+
+.formField {
+	color:black;
+}
+
+.contentArea {
+	background-color: #F0F0F0;
+}
+	
+.viewTitle {
+	font-size: 14;
+	font-weight: bold;
+	color: black;
+}
+
+
+.subTitle {
+	font-size: 10;
+	font-weight: bold;
+	color: black;
+}
+
+.bottomRightButton
+{
+	vertical-align : bottom;
+	horizontal-align : right;
+	padding-right : 16;
+	padding-bottom : 16;
+}
Index: EDIS/trunk/java/tracking-ui-core/.actionScriptProperties
===================================================================
--- EDIS/trunk/java/tracking-ui-core/.actionScriptProperties	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/.actionScriptProperties	(revision 1227)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<actionScriptProperties mainApplicationPath="tracking_ui_core.as" version="3">
+  <compiler additionalCompilerArguments="" copyDependentFiles="false" enableModuleDebug="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersion="9.0.0" htmlPlayerVersionCheck="true" outputFolderPath="target" sourceFolderPath="src/main/flex" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+    <compilerSourcePath/>
+    <libraryPath defaultLinkType="1">
+      <libraryPathEntry kind="4" path="">
+        <modifiedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/>
+        </modifiedEntries>
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="3" linkType="1" path="C:/Documents and Settings/vhaislbelids/.m2/repository/com/adobe/cairngorm/2.2.1/cairngorm-2.2.1.swc" useDefaultLinkType="false"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="tracking_ui_core.as"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>
Index: EDIS/trunk/java/tracking-ui-core/.flexLibProperties
===================================================================
--- EDIS/trunk/java/tracking-ui-core/.flexLibProperties	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/.flexLibProperties	(revision 1227)
@@ -0,0 +1,301 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<flexLibProperties version="1">
+  <includeClasses>
+    <classEntry path="gov.va.med.edp.business.AddPatientToLogDelegate"/>
+    <classEntry path="gov.va.med.edp.business.CSPService"/>
+    <classEntry path="gov.va.med.edp.business.CheckSensitivePtAndFlagsDelegate"/>
+    <classEntry path="gov.va.med.edp.business.DeleteStubEntryDelegate"/>
+    <classEntry path="gov.va.med.edp.business.InitDisplayBoardDelegate"/>
+    <classEntry path="gov.va.med.edp.business.InitLogAreaDelegate"/>
+    <classEntry path="gov.va.med.edp.business.InitTrackingDelegate"/>
+    <classEntry path="gov.va.med.edp.business.InitUserDelegate"/>
+    <classEntry path="gov.va.med.edp.business.LogSensitivePatientAccessDelegate"/>
+    <classEntry path="gov.va.med.edp.business.MatchClosedVisitsDelegate"/>
+    <classEntry path="gov.va.med.edp.business.MatchDiagnosesDelegate"/>
+    <classEntry path="gov.va.med.edp.business.MatchPatientsDelegate"/>
+    <classEntry path="gov.va.med.edp.business.RefreshDisplayBoardDelegate"/>
+    <classEntry path="gov.va.med.edp.business.RefreshLogSelectorDelegate"/>
+    <classEntry path="gov.va.med.edp.business.RemoveLogEntryDelegate"/>
+    <classEntry path="gov.va.med.edp.business.ResetDisplayBoardDelegate"/>
+    <classEntry path="gov.va.med.edp.business.ResponderChainingDelegate"/>
+    <classEntry path="gov.va.med.edp.business.SaveLogEntryDelegate"/>
+    <classEntry path="gov.va.med.edp.business.Services"/>
+    <classEntry path="gov.va.med.edp.business.SwitchLogEntryDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.LoadBoardConfigDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.LoadConfigStaffDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.LoadConfigurationDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.LoadSelectionConfigDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.MatchPersonDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.SaveBedConfigDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.SaveConfigBoardDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.SaveConfigColorsDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.SaveConfigParamsDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.SaveConfigStaffDelegate"/>
+    <classEntry path="gov.va.med.edp.business.config.SaveSelectionConfigDelegate"/>
+    <classEntry path="gov.va.med.edp.business.reports.ReportDelegate"/>
+    <classEntry path="gov.va.med.edp.business.responder.ResponderDecorator"/>
+    <classEntry path="gov.va.med.edp.business.responder.ServerErrorCheckResponder"/>
+    <classEntry path="gov.va.med.edp.business.responder.XMLResultFormattingResponder"/>
+    <classEntry path="gov.va.med.edp.command.AbstractResponderCommand"/>
+    <classEntry path="gov.va.med.edp.command.AddPatientToLogCommand"/>
+    <classEntry path="gov.va.med.edp.command.CancelLogEntryEditCommand"/>
+    <classEntry path="gov.va.med.edp.command.ChangeFontSizeCommand"/>
+    <classEntry path="gov.va.med.edp.command.ChangeLogEntryFieldCommand"/>
+    <classEntry path="gov.va.med.edp.command.ClearUnsavedViewsModelCommand"/>
+    <classEntry path="gov.va.med.edp.command.DeleteStubEntryCommand"/>
+    <classEntry path="gov.va.med.edp.command.InitAppCommand"/>
+    <classEntry path="gov.va.med.edp.command.InitDisplayBoardCommand"/>
+    <classEntry path="gov.va.med.edp.command.InitLogAreaCommand"/>
+    <classEntry path="gov.va.med.edp.command.InitTrackingCommand"/>
+    <classEntry path="gov.va.med.edp.command.MatchClosedVisitsCommand"/>
+    <classEntry path="gov.va.med.edp.command.MatchDiagnosesCommand"/>
+    <classEntry path="gov.va.med.edp.command.RefreshDisplayBoardCommand"/>
+    <classEntry path="gov.va.med.edp.command.RefreshLogSelectorCommand"/>
+    <classEntry path="gov.va.med.edp.command.RemoveLogEntryCommand"/>
+    <classEntry path="gov.va.med.edp.command.ResetDisplayBoardCommand"/>
+    <classEntry path="gov.va.med.edp.command.SaveLogEntryCommand"/>
+    <classEntry path="gov.va.med.edp.command.SortHeaderCommand"/>
+    <classEntry path="gov.va.med.edp.command.SwitchAppViewCommand"/>
+    <classEntry path="gov.va.med.edp.command.SwitchLogEntryCommand"/>
+    <classEntry path="gov.va.med.edp.command.UndoLogEntryCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.AddBedCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.AddBoardCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.ChangeBedSequenceCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.ChangeParamFieldCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.ConfigAddColumnCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.ConfigChangeColumnCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.ConfigChangeDisplayBoardPropertiesCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.ConfigRemoveColumnCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.LoadBoardConfigCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.LoadConfigStaffCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.LoadConfigurationCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.LoadSelectionConfigCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.MatchPersonCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.SaveBedConfigCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.SaveConfigBoardCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.SaveConfigColorsCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.SaveConfigParamsCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.SaveConfigStaffCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.SaveSelectionConfigCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.SetModifiedCommand"/>
+    <classEntry path="gov.va.med.edp.command.config.UpdateStaffCommand"/>
+    <classEntry path="gov.va.med.edp.command.debug.DebugHTTPServiceResponder"/>
+    <classEntry path="gov.va.med.edp.command.reports.BaseReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.DownloadReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadActivityReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadAcuityReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadBVACReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadDelayReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadExposureReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadMissedOpReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadOrdersByAcuityReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadPatientXRefReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadProviderReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadPtIntakeReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadShiftReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadSummaryReportCommand"/>
+    <classEntry path="gov.va.med.edp.command.reports.LoadVaAdmissionsReportCommand"/>
+    <classEntry path="gov.va.med.edp.control.ChangeLogEntryFieldEvent"/>
+    <classEntry path="gov.va.med.edp.control.ClearUnsavedViewsModelEvent"/>
+    <classEntry path="gov.va.med.edp.control.DateTimeEvent"/>
+    <classEntry path="gov.va.med.edp.control.DisplayBoardEvent"/>
+    <classEntry path="gov.va.med.edp.control.InitAppEvent"/>
+    <classEntry path="gov.va.med.edp.control.InitLogAreaEvent"/>
+    <classEntry path="gov.va.med.edp.control.MatchItemsEvent"/>
+    <classEntry path="gov.va.med.edp.control.ModalDialogEvent"/>
+    <classEntry path="gov.va.med.edp.control.NumberEvent"/>
+    <classEntry path="gov.va.med.edp.control.PatientSelectEvent"/>
+    <classEntry path="gov.va.med.edp.control.RemoveLogEntryEvent"/>
+    <classEntry path="gov.va.med.edp.control.SortHeaderEvent"/>
+    <classEntry path="gov.va.med.edp.control.SwitchAppViewEvent"/>
+    <classEntry path="gov.va.med.edp.control.SwitchLogEntryEvent"/>
+    <classEntry path="gov.va.med.edp.control.TrackingController"/>
+    <classEntry path="gov.va.med.edp.control.TrackingEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.AddBedEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.BoardConfigEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.ChangeBedSequenceEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.ChangeFieldEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.ColorChangedEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.ConfigAddColumnEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.ConfigChangeColumnEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.ConfigChangeDisplayBoardPropertiesEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.ConfigRemoveColumnEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.ConfigurationEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.MatchPersonEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.SaveBedConfigEvent"/>
+    <classEntry path="gov.va.med.edp.control.config.UpdateStaffEvent"/>
+    <classEntry path="gov.va.med.edp.control.reports.ReportDownloadEvent"/>
+    <classEntry path="gov.va.med.edp.control.reports.ReportEvent"/>
+    <classEntry path="gov.va.med.edp.factory.DebugFactory"/>
+    <classEntry path="gov.va.med.edp.factory.ReportFactory"/>
+    <classEntry path="gov.va.med.edp.factory.SessionFactory"/>
+    <classEntry path="gov.va.med.edp.factory.TrackingFactory"/>
+    <classEntry path="gov.va.med.edp.model.BigBoardDebugInfo"/>
+    <classEntry path="gov.va.med.edp.model.BoardSpec"/>
+    <classEntry path="gov.va.med.edp.model.ColorSet"/>
+    <classEntry path="gov.va.med.edp.model.Config"/>
+    <classEntry path="gov.va.med.edp.model.DebugModel"/>
+    <classEntry path="gov.va.med.edp.model.LogEdit"/>
+    <classEntry path="gov.va.med.edp.model.LogEntryList"/>
+    <classEntry path="gov.va.med.edp.model.TrackingModelLocator"/>
+    <classEntry path="gov.va.med.edp.model.reports.ActivityReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.AcuityReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.BVACReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.DelayReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.ExposureReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.MissedOpReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.OrdersByAcuityReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.PatientXRefReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.ProviderReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.PtIntakeReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.ReportsModel"/>
+    <classEntry path="gov.va.med.edp.model.reports.ShiftReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.SummaryReport"/>
+    <classEntry path="gov.va.med.edp.model.reports.VaAdmissionsReport"/>
+    <classEntry path="gov.va.med.edp.pt.demog.IMatchPatientsController"/>
+    <classEntry path="gov.va.med.edp.pt.demog.IPatientChecksController"/>
+    <classEntry path="gov.va.med.edp.pt.demog.IPatientChecksDao"/>
+    <classEntry path="gov.va.med.edp.pt.demog.control.CheckSensitivePtAndFlagsResponder"/>
+    <classEntry path="gov.va.med.edp.pt.demog.control.LogSensitivePatientAccessResponder"/>
+    <classEntry path="gov.va.med.edp.pt.demog.control.MatchPatientsController"/>
+    <classEntry path="gov.va.med.edp.pt.demog.control.MatchPatientsResponder"/>
+    <classEntry path="gov.va.med.edp.pt.demog.control.PatientChecksController"/>
+    <classEntry path="gov.va.med.edp.pt.demog.dao.CairngormPatientChecksDao"/>
+    <classEntry path="gov.va.med.edp.pt.demog.dao.PatientXml"/>
+    <classEntry path="gov.va.med.edp.pt.demog.model.MatchingPatientsModel"/>
+    <classEntry path="gov.va.med.edp.pt.demog.model.PatientCheckVO"/>
+    <classEntry path="gov.va.med.edp.pt.demog.model.PatientChecksModel"/>
+    <classEntry path="gov.va.med.edp.pt.demog.model.PatientRecordFlagVO"/>
+    <classEntry path="gov.va.med.edp.pt.demog.model.PatientSelectVO"/>
+    <classEntry path="gov.va.med.edp.pt.demog.view.FlagsPanel"/>
+    <classEntry path="gov.va.med.edp.pt.demog.view.LookupPanel"/>
+    <classEntry path="gov.va.med.edp.pt.demog.view.MessagePanel"/>
+    <classEntry path="gov.va.med.edp.pt.demog.view.PatientRecordFlagsDialog"/>
+    <classEntry path="gov.va.med.edp.pt.demog.view.SelectPatientButton"/>
+    <classEntry path="gov.va.med.edp.pt.demog.view.SelectPatientDialog"/>
+    <classEntry path="gov.va.med.edp.pt.demog.view.SelectPatientEvent"/>
+    <classEntry path="gov.va.med.edp.pt.demog.view.SelectPatientPanel"/>
+    <classEntry path="gov.va.med.edp.pt.demog.view.SimilarNamesPanel"/>
+    <classEntry path="gov.va.med.edp.skins.LinkButtonTabSkin"/>
+    <classEntry path="gov.va.med.edp.util.AccessibilityTools"/>
+    <classEntry path="gov.va.med.edp.util.AutoScrollView"/>
+    <classEntry path="gov.va.med.edp.util.BoardTools"/>
+    <classEntry path="gov.va.med.edp.util.ChangeWatcher"/>
+    <classEntry path="gov.va.med.edp.util.InactivityTimeout"/>
+    <classEntry path="gov.va.med.edp.util.KeyUtils"/>
+    <classEntry path="gov.va.med.edp.util.ReportUtil"/>
+    <classEntry path="gov.va.med.edp.util.Vista"/>
+    <classEntry path="gov.va.med.edp.view.DisconnectedDialog"/>
+    <classEntry path="gov.va.med.edp.view.ErrorDialog"/>
+    <classEntry path="gov.va.med.edp.view.HelpMessage"/>
+    <classEntry path="gov.va.med.edp.view.LoadingDialog"/>
+    <classEntry path="gov.va.med.edp.view.TrackingViews"/>
+    <classEntry path="gov.va.med.edp.view.board.BigDisplayBoard"/>
+    <classEntry path="gov.va.med.edp.view.board.DisplayBoard"/>
+    <classEntry path="gov.va.med.edp.view.config.ConfigBeds"/>
+    <classEntry path="gov.va.med.edp.view.config.ConfigBoard"/>
+    <classEntry path="gov.va.med.edp.view.config.ConfigColor"/>
+    <classEntry path="gov.va.med.edp.view.config.ConfigParams"/>
+    <classEntry path="gov.va.med.edp.view.config.ConfigSelections"/>
+    <classEntry path="gov.va.med.edp.view.config.ConfigStaff"/>
+    <classEntry path="gov.va.med.edp.view.config.ConfigView"/>
+    <classEntry path="gov.va.med.edp.view.config.DuplicateNameValidator"/>
+    <classEntry path="gov.va.med.edp.view.config.SelectionListDescriptor"/>
+    <classEntry path="gov.va.med.edp.view.debug.LastNetworkCallView"/>
+    <classEntry path="gov.va.med.edp.view.log.ClosedVisitSelector"/>
+    <classEntry path="gov.va.med.edp.view.log.DiagnosesCoded"/>
+    <classEntry path="gov.va.med.edp.view.log.DiagnosesFreeText"/>
+    <classEntry path="gov.va.med.edp.view.log.LogEntryEditor"/>
+    <classEntry path="gov.va.med.edp.view.log.LogEntrySelector"/>
+    <classEntry path="gov.va.med.edp.view.log.LogEntryView"/>
+    <classEntry path="gov.va.med.edp.view.log.PatientHeaderBar"/>
+    <classEntry path="gov.va.med.edp.view.reports.ActivityReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.AcuityReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.BVACReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.DelayReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.ExposureReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.MissedOpReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.OrdersByAcuityReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.PatientXRefReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.ProviderReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.PtIntakeReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.ReportControls"/>
+    <classEntry path="gov.va.med.edp.view.reports.ReportsContainerView"/>
+    <classEntry path="gov.va.med.edp.view.reports.ShiftReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.SummaryReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.VaAdmissionsReportView"/>
+    <classEntry path="gov.va.med.edp.view.reports.print.ReportDataGridPrintView"/>
+    <classEntry path="gov.va.med.edp.view.reports.print.ReportFooter"/>
+    <classEntry path="gov.va.med.edp.view.reports.print.ReportHeader"/>
+    <classEntry path="gov.va.med.edp.vo.CodeSelectionVO"/>
+    <classEntry path="gov.va.med.edp.vo.ColorMapVO"/>
+    <classEntry path="gov.va.med.edp.vo.ColorMatchVO"/>
+    <classEntry path="gov.va.med.edp.vo.ColorSelectionVO"/>
+    <classEntry path="gov.va.med.edp.vo.ColumnSpecVO"/>
+    <classEntry path="gov.va.med.edp.vo.DebugVO"/>
+    <classEntry path="gov.va.med.edp.vo.DisplayBoardPropertiesVO"/>
+    <classEntry path="gov.va.med.edp.vo.DisplaySizeVO"/>
+    <classEntry path="gov.va.med.edp.vo.LogEditParamsVO"/>
+    <classEntry path="gov.va.med.edp.vo.LogEntryVO"/>
+    <classEntry path="gov.va.med.edp.vo.LogSelectorVO"/>
+    <classEntry path="gov.va.med.edp.vo.LookupStringVO"/>
+    <classEntry path="gov.va.med.edp.vo.LookupVO"/>
+    <classEntry path="gov.va.med.edp.vo.NoteVO"/>
+    <classEntry path="gov.va.med.edp.vo.PCECodedValueVO"/>
+    <classEntry path="gov.va.med.edp.vo.RoomBedVO"/>
+    <classEntry path="gov.va.med.edp.vo.SessionVO"/>
+    <classEntry path="gov.va.med.edp.vo.StaffMemberVO"/>
+    <classEntry path="gov.va.med.edp.vo.VisitVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.AcuityVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.AveragesVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.BVACLogEntryVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.EdStaffVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.OrdersByAcuityVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.PatientExposureVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.PatientXRefVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.ProviderShiftVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.ProviderVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.PtIntakeVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.ReportLogEntryVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.ReportParamsVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.ShiftCategoryVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.ShiftReportColumnVO"/>
+    <classEntry path="gov.va.med.edp.vo.reports.SummaryReportVO"/>
+    <classEntry path="gov.va.med.edp.widget.AccessibleLabel"/>
+    <classEntry path="gov.va.med.edp.widget.AccessibleNumericStepper"/>
+    <classEntry path="gov.va.med.edp.widget.AutoComplete"/>
+    <classEntry path="gov.va.med.edp.widget.CenteredCheckBox"/>
+    <classEntry path="gov.va.med.edp.widget.CenteredEmbedImage"/>
+    <classEntry path="gov.va.med.edp.widget.ColorCellRenderer"/>
+    <classEntry path="gov.va.med.edp.widget.ColorSampleRenderer"/>
+    <classEntry path="gov.va.med.edp.widget.ColorSelector"/>
+    <classEntry path="gov.va.med.edp.widget.DataGrid"/>
+    <classEntry path="gov.va.med.edp.widget.DateTimeChooser"/>
+    <classEntry path="gov.va.med.edp.widget.GapAccordion"/>
+    <classEntry path="gov.va.med.edp.widget.InfoDialog"/>
+    <classEntry path="gov.va.med.edp.widget.LinkButton"/>
+    <classEntry path="gov.va.med.edp.widget.LinkButtonTab"/>
+    <classEntry path="gov.va.med.edp.widget.LinkButtonTabBar"/>
+    <classEntry path="gov.va.med.edp.widget.OkCancelDialog"/>
+    <classEntry path="gov.va.med.edp.widget.OpenAlwaysPopUpMenuButton"/>
+    <classEntry path="gov.va.med.edp.widget.PatientCellRenderer"/>
+    <classEntry path="gov.va.med.edp.widget.PatientNameRenderer"/>
+    <classEntry path="gov.va.med.edp.widget.RoomCategoryRenderer"/>
+    <classEntry path="gov.va.med.edp.widget.Spinner"/>
+    <classEntry path="gov.va.med.edp.widget.StatusRenderer"/>
+    <classEntry path="gov.va.med.edp.widget.Tick"/>
+    <classEntry path="gov.va.med.edp.widget.TimeEntry"/>
+    <classEntry path="gov.va.med.edp.widget.ValueComboBox"/>
+    <classEntry path="gov.va.med.edp.widget.VisitRenderer"/>
+    <classEntry path="gov.va.med.edp.widget.WhenRenderer"/>
+    <classEntry path="gov.va.med.edp.widget.YesNoDialog"/>
+    <classEntry path="gov.va.med.edp.widget.YesNoRenderer"/>
+    <classEntry path="gov.va.med.edp.widget.accessibility.AccessibleLabelAccImpl"/>
+    <classEntry path="gov.va.med.edp.widget.accessibility.AutoCompleteAccImpl"/>
+    <classEntry path="gov.va.med.edp.widget.accessibility.IAccessibleComponent"/>
+    <classEntry path="gov.va.med.edp.widget.accessibility.LinkButtonTabBarAccImpl"/>
+    <classEntry path="gov.va.med.edp.widget.accessibility.NumericStepperAccImpl"/>
+  </includeClasses>
+  <includeResources/>
+  <namespaceManifests/>
+</flexLibProperties>
Index: EDIS/trunk/java/tracking-ui-core/.p4ignore
===================================================================
--- EDIS/trunk/java/tracking-ui-core/.p4ignore	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/.p4ignore	(revision 1227)
@@ -0,0 +1,1 @@
+target
Index: EDIS/trunk/java/tracking-ui-core/pom.xml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/pom.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/pom.xml	(revision 1227)
@@ -0,0 +1,60 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>gov.va.med.edp</groupId>
+        <artifactId>edis-tracking-parent</artifactId>
+        <version>1.0-T29-SNAPSHOT</version>
+        <relativePath>../tracking-parent</relativePath>
+    </parent>
+    <groupId>gov.va.med.edp</groupId>
+    <artifactId>edis-tracking-ui-core</artifactId>
+    <packaging>swc</packaging>
+    <name>EDIS Tracking UI Core</name>
+    <version>1.0-T29-SNAPSHOT</version>
+    <scm>
+        <connection>scm:perforce://reeng/main/ed/tracking-ui-core</connection>
+        <developerConnection>scm:perforce://reeng/main/ed/tracking-ui-core</developerConnection>
+    </scm>
+    <dependencies>
+        <dependency>
+            <groupId>com.adobe</groupId>
+            <artifactId>cairngorm</artifactId>
+            <version>2.2.1</version>
+            <type>swc</type>
+        </dependency>
+        <!-- Flex SDK dependencies -->
+        <dependency>
+            <groupId>com.adobe.flex.framework</groupId>
+            <artifactId>flex-framework</artifactId>
+            <version>${flex.version}</version>
+            <type>pom</type>
+        </dependency>
+          <!-- FlexUnit dependencies -->
+        <dependency>
+            <groupId>flexunit</groupId>
+            <artifactId>flexunit</artifactId>
+            <version>${flexunit.version}</version>
+            <type>swc</type>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+			<groupId>info.flex-mojos</groupId>
+			<artifactId>testing-support</artifactId>
+			<version>${flex.mojos.version}</version>
+			<type>swc</type>
+			<scope>test</scope>
+		</dependency>
+    </dependencies>
+    <build>
+        <sourceDirectory>src/main/flex</sourceDirectory>
+        <testSourceDirectory>src/test/flex</testSourceDirectory>
+        <plugins>
+            <plugin>
+                <groupId>info.flex-mojos</groupId>
+                <artifactId>flex-compiler-mojo</artifactId>
+            </plugin>
+        </plugins>
+    </build>
+</project>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/META-INF/MANIFEST.MF
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/META-INF/MANIFEST.MF	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/META-INF/MANIFEST.MF	(revision 1227)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/AddPatientToLogDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/AddPatientToLogDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/AddPatientToLogDelegate.as	(revision 1227)
@@ -0,0 +1,29 @@
+/* AddPatientToLogDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+	
+	import mx.rpc.IResponder;
+    
+	public class AddPatientToLogDelegate extends ResponderChainingDelegate
+	{	
+
+		public function AddPatientToLogDelegate(responder:IResponder)
+		{
+			super(responder, "addPatientToLog" );		
+		}
+	   	 
+		public function addPatientToLog(newPatient: PatientSelectVO, area: int,
+			localTime: String, choiceTS: String): void
+		{
+			var params: Object = new Object();
+			params.addPatient = newPatient.toString();
+			params.area = area;
+			params.localTime = localTime;
+			params.choiceTS = choiceTS;
+			
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/CSPService.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/CSPService.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/CSPService.as	(revision 1227)
@@ -0,0 +1,103 @@
+/* CSPService.as */
+
+package gov.va.med.edp.business
+{
+	import flash.display.DisplayObject;
+	
+	import gov.va.med.edp.command.debug.DebugHTTPServiceResponder;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.containers.Panel;
+	import mx.controls.Label;
+	import mx.core.Application;
+	import mx.managers.PopUpManager;
+	import mx.rpc.AsyncToken;
+	import mx.rpc.IResponder;
+	import mx.rpc.http.mxml.HTTPService;
+
+	public class CSPService extends HTTPService implements IResponder
+	{
+		public var command:String;					// command to pass to CSP Controller
+		public var csp:String;						// url for the Cache Server Page
+		public var vlj: String						// url for VistALink Call
+		public var mock:String;						// file name if using a mock object
+		public var callType: int					// determines which call (vlj, csp, mock) to use
+		public var block: Boolean = false;
+		
+		public static const SERVICE_USE_VLJ: int = 0;
+		public static const SERVICE_USE_CSP: int = 1
+		public static const SERVICE_USE_MOCK: int = 2;		
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		private var _wait: Panel;
+
+		public function CSPService()
+		{
+			super();
+			this.resultFormat = "text";
+			this.method = "POST";
+			this.requestTimeout = 20;
+		}
+		
+		
+		override public function send(parameters:Object=null):AsyncToken
+		{
+			if ((vlj.length == 0) || (csp.length == 0) || (command.length == 0))
+				throw new Error( "csp, vlj and command may not be empty" );
+			if (parameters == null)
+				parameters = new Object;
+			parameters.command = this.command;
+            if (Application.application.parameters.swfID != null) parameters.swfID = Application.application.parameters.swfID;
+            if (Application.application.parameters.siteId != null)parameters.siteId = Application.application.parameters.siteId;
+            switch (callType) {
+				case SERVICE_USE_CSP:
+					this.url = csp;
+					break;
+				case SERVICE_USE_MOCK:
+					this.url = mock;
+					break;
+				default:
+					this.url = vlj;
+					break;
+			}
+            model.connecting = true;
+            //trace(this.url, ": ", this.command);
+			var token: AsyncToken = super.send(parameters);
+			token.addResponder(this);
+            if (this.block) {
+				showWaitWindow();
+			}
+			
+			if (model.session != null && model.session.debugEnabled){
+				var debugResponder:DebugHTTPServiceResponder = new DebugHTTPServiceResponder(this, parameters);
+				token.addResponder(debugResponder);
+			}
+						
+			return token;
+		}
+		
+		private function showWaitWindow(): void
+		{
+			var label: Label = new Label();
+			label.text = "Wait...";
+			_wait = 
+				Panel(PopUpManager.createPopUp(Application.application as DisplayObject, Panel, true));
+			_wait.addChild(label);
+			PopUpManager.centerPopUp(_wait);
+		}
+		
+		public function result(data:Object):void
+		{
+            model.connecting = false;
+            if (model.disconnected) model.disconnected = false;
+            if (this.block) PopUpManager.removePopUp(_wait);
+		}
+		
+		public function fault(info:Object):void
+		{
+            model.connecting = false;
+            if (this.block) PopUpManager.removePopUp(_wait);
+		}
+
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/CheckSensitivePtAndFlagsDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/CheckSensitivePtAndFlagsDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/CheckSensitivePtAndFlagsDelegate.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* RefreshLogSelectorDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import mx.rpc.IResponder;
+    
+	public class CheckSensitivePtAndFlagsDelegate extends ResponderChainingDelegate
+	{	   	
+	   public function CheckSensitivePtAndFlagsDelegate(responder:IResponder)
+	   {     
+	      super(responder, "checkSensitivePtAndFlags" );
+	   }
+	   	 
+	   public function checkSensitivePtAndFlags(area: int, dfn: String, name: String):void
+	   {
+			var params:Object = new Object();
+		 	params.area = area;
+		 	params.patient = dfn;
+		 	params.name = name;
+
+	     	send(params);
+	   }
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/DeleteStubEntryDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/DeleteStubEntryDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/DeleteStubEntryDelegate.as	(revision 1227)
@@ -0,0 +1,23 @@
+/* DeleteStubEntryDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import mx.rpc.IResponder;
+    
+	public class DeleteStubEntryDelegate extends ResponderChainingDelegate
+	{	
+		public function DeleteStubEntryDelegate(responder:IResponder)
+		{
+			super(responder, "deleteStubEntry" );
+		}
+	   	 
+		public function deleteStubEntry(area: int, logID: int): void
+		{
+			var params:Object = new Object();
+			params.area = area;
+			params.logID = logID;
+			
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitDisplayBoardDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitDisplayBoardDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitDisplayBoardDelegate.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* InitDisplayBoardDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+	
+	import mx.rpc.IResponder;
+    
+	public class InitDisplayBoardDelegate extends ResponderChainingDelegate
+	{	
+		public function InitDisplayBoardDelegate(responder:IResponder)
+		{
+			super(responder, "initDisplayBoard");
+		}
+	   	 
+		public function initDisplayBoard(area: int, name: String):void
+		{
+			var params:Object = new Object();
+			params.area = area;
+			params.board = name; 
+			
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitLogAreaDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitLogAreaDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitLogAreaDelegate.as	(revision 1227)
@@ -0,0 +1,32 @@
+/* InitLogAreaDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+	
+	import gov.va.med.edp.vo.LogEntryVO;
+	
+	import mx.rpc.AsyncToken;
+	import mx.rpc.IResponder;
+    
+	public class InitLogAreaDelegate extends ResponderChainingDelegate
+	{	
+	
+		public function InitLogAreaDelegate(responder:IResponder)
+		{
+			super(responder, "initLogArea" );
+		}
+	   	 
+		public function initLogArea(area: int, logEntry: LogEntryVO):void
+		{
+			var params:Object = new Object();
+			params.area = area;
+
+			if ((logEntry != null) && (logEntry.id > 0)) {
+				params.logEntry = logEntry.toString();
+			}
+
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitTrackingDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitTrackingDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitTrackingDelegate.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* InitTrackingDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+	
+	import mx.rpc.AsyncToken;
+	import mx.rpc.IResponder;
+    
+	public class InitTrackingDelegate extends ResponderChainingDelegate
+	{	
+		public function InitTrackingDelegate(responder:IResponder)
+		{
+			super(responder, "initTracking" );
+		}
+	   	 
+		public function initTracking(areaName: String = ""):void
+		{
+			var params:Object = new Object();
+			params.area = areaName;
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitUserDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitUserDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/InitUserDelegate.as	(revision 1227)
@@ -0,0 +1,23 @@
+/* InitUserDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+	
+	import mx.rpc.IResponder;
+    
+	public class InitUserDelegate extends ResponderChainingDelegate
+	{		
+		public function InitUserDelegate(responder:IResponder)
+		{
+			super(responder, "initUser");
+		}
+		
+		public function initUser(userToken: String):void
+		{
+			var params:Object = new Object();
+			params.userToken = userToken;
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/LogSensitivePatientAccessDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/LogSensitivePatientAccessDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/LogSensitivePatientAccessDelegate.as	(revision 1227)
@@ -0,0 +1,23 @@
+/* RefreshLogSelectorDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import mx.rpc.IResponder;
+    
+	public class LogSensitivePatientAccessDelegate extends ResponderChainingDelegate
+	{	
+	   	
+	   public function LogSensitivePatientAccessDelegate(responder:IResponder)
+	   {     
+	      super(responder, "logSensitivePatientAccess" );
+	   }
+	   	 
+	   public function logSensitivePatientAccess(dfn: String):void
+	   {
+	   	  var params:Object = new Object();
+		  params.patient = dfn;
+	     
+	      send(params);
+	   }
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/MatchClosedVisitsDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/MatchClosedVisitsDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/MatchClosedVisitsDelegate.as	(revision 1227)
@@ -0,0 +1,23 @@
+/* MatchClosedVisitsDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import mx.rpc.IResponder;
+    
+	public class MatchClosedVisitsDelegate extends ResponderChainingDelegate
+	{	
+		public function MatchClosedVisitsDelegate(responder:IResponder)
+		{
+			super(responder, "matchClosed" );
+		}
+	   	 
+		public function matchClosedVisits(area: int, partial:String):void
+		{
+			var params:Object = new Object();
+			params.area = area;
+			params.partial = partial;	 
+			
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/MatchDiagnosesDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/MatchDiagnosesDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/MatchDiagnosesDelegate.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* MatchPateintsDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+	
+	import mx.rpc.AsyncToken;
+	import mx.rpc.IResponder;
+    
+	public class MatchDiagnosesDelegate extends ResponderChainingDelegate
+	{	
+		public function MatchDiagnosesDelegate(responder:IResponder)
+		{
+			super(responder, "matchDiagnoses" );
+		}
+	   	 
+		public function matchDiagnoses(partial:String):void
+		{
+			var params:Object = new Object();
+			params.text = partial;	 
+
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/MatchPatientsDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/MatchPatientsDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/MatchPatientsDelegate.as	(revision 1227)
@@ -0,0 +1,22 @@
+/* MatchPateintsDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import mx.rpc.IResponder;
+    
+	public class MatchPatientsDelegate extends ResponderChainingDelegate
+	{	
+		public function MatchPatientsDelegate(responder:IResponder)
+		{
+			super(responder, "matchPatients" );
+		}
+	   	 
+		public function matchPatients(partial:String):void
+		{
+			var params:Object = new Object();
+			params.partial = partial;	 
+
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/RefreshDisplayBoardDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/RefreshDisplayBoardDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/RefreshDisplayBoardDelegate.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* RefreshDisplayBoardDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import gov.va.med.edp.util.Vista;
+	
+	import mx.rpc.IResponder;
+    
+	public class RefreshDisplayBoardDelegate extends ResponderChainingDelegate
+	{	
+		public function RefreshDisplayBoardDelegate(responder:IResponder)
+		{
+			super(responder, "refreshDisplayBoard");
+		}
+	   	 
+		public function refreshDisplayBoard(area: int, boardName: String, configLastUpdated: String):void
+		{
+			var params:Object = new Object();
+			params.area = area;
+			params.board = boardName;
+			params.last = configLastUpdated;
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/RefreshLogSelectorDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/RefreshLogSelectorDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/RefreshLogSelectorDelegate.as	(revision 1227)
@@ -0,0 +1,22 @@
+/* RefreshLogSelectorDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import mx.rpc.IResponder;
+    
+	public class RefreshLogSelectorDelegate extends ResponderChainingDelegate
+	{	
+	   public function RefreshLogSelectorDelegate(responder:IResponder)
+	   {     
+	      super(responder, "refreshLogSelector" );
+	   }
+	   	 
+	   public function refreshLogSelector(area: int, refreshToken: String):void
+	   {
+		  var params:Object = new Object();
+		  params.area = area;
+		  params.token = refreshToken;
+	 	  send(params);
+	   }
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/RemoveLogEntryDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/RemoveLogEntryDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/RemoveLogEntryDelegate.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* RemoveLogEntryDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import gov.va.med.edp.vo.LogEntryVO;
+	
+	import mx.rpc.IResponder;
+    
+	public class RemoveLogEntryDelegate extends ResponderChainingDelegate
+	{	
+		public function RemoveLogEntryDelegate(responder:IResponder)
+		{
+			super(responder, "removeLogEntry" );
+		}
+	   	 
+		public function removeLogEntry(logEntry: LogEntryVO, area: int): void
+		{
+			var params: Object = new Object();
+			params.logEntry = logEntry.toString();
+			params.area = area;
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/ResetDisplayBoardDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/ResetDisplayBoardDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/ResetDisplayBoardDelegate.as	(revision 1227)
@@ -0,0 +1,22 @@
+/* ResetDisplayBoardDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import mx.rpc.IResponder;
+    
+	public class ResetDisplayBoardDelegate extends ResponderChainingDelegate
+	{	
+		public function ResetDisplayBoardDelegate(responder:IResponder)
+		{
+			super(responder, "resetDisplayBoard" );
+		}
+	   	 
+		public function resetDisplayBoard(area: int, boardName: String):void
+		{
+			var params:Object = new Object();
+			params.area = area;
+			params.board = boardName;
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/ResponderChainingDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/ResponderChainingDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/ResponderChainingDelegate.as	(revision 1227)
@@ -0,0 +1,35 @@
+package gov.va.med.edp.business
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+
+    import gov.va.med.edp.business.responder.XMLResultFormattingResponder;
+    import gov.va.med.edp.business.responder.ServerErrorCheckResponder;
+	
+	import mx.rpc.AsyncToken;
+	import mx.rpc.IResponder;
+	
+	/**
+	 * Base class for Cairngorm service delegates that sends IResponder methods
+	 * to a chain of decorator responders which eventually forward result and fault methods
+	 * to responder specified on construction. 
+	 */
+	public class ResponderChainingDelegate
+	{
+		private var responder:IResponder;
+		private var service:Object;
+		
+		public function ResponderChainingDelegate(responder:IResponder, serviceName:String) {
+            this.service = ServiceLocator.getInstance().getHTTPService(serviceName);
+            this.responder = createResponderChain(responder);
+		}
+		
+		protected function createResponderChain(lastResponder: IResponder) : IResponder {
+			return new XMLResultFormattingResponder(new ServerErrorCheckResponder(lastResponder));
+		}
+		
+		public final function send(params:Object = null) : void {
+			var token:AsyncToken = service.send(params);
+			token.addResponder(responder);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/SaveLogEntryDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/SaveLogEntryDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/SaveLogEntryDelegate.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* SaveLogEntryDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import gov.va.med.edp.vo.LogEntryVO;
+	
+	import mx.rpc.IResponder;
+    
+	public class SaveLogEntryDelegate extends ResponderChainingDelegate
+	{	
+
+		public function SaveLogEntryDelegate(responder:IResponder)
+		{
+			super(responder, "saveLogEntry" );
+		}
+	   	 
+		public function saveLogEntry(logEntry:LogEntryVO):void
+		{
+			var params:Object = new Object();
+			params.logEntry = logEntry.toString();
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/Services.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/Services.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/Services.mxml	(revision 1227)
@@ -0,0 +1,231 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--Services.mxml -->
+
+<cairngorm:ServiceLocator
+		xmlns:mx="http://www.adobe.com/2006/mxml"
+		xmlns:cairngorm="com.adobe.cairngorm.business.*"
+		xmlns:vista="gov.va.med.edp.business.*">
+
+	<mx:Script>
+		<![CDATA[
+			[Bindable]
+		public var callPrefix:String = "";
+
+		[Bindable]
+		public var callMode: int = 1;
+		]]>
+	</mx:Script>
+
+	<vista:CSPService id="initUser"
+					  command="initUser"
+					  showBusyCursor="true"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/initUser.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="initTracking"
+					  command="initTracking"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}board.xml"
+					  mock="assets/mock/initTracking.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="refreshLogSelector"
+					  command="refreshLogSelector"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/refreshLogEntries.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="switchLogEntry"
+					  command="switchLogEntry"
+					  showBusyCursor="true"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/switchLogEntry.xml"
+					  concurrency="last"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="saveLogEntry"
+					  command="saveLogEntry"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/saveLogEntry.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="deleteStubEntry"
+					  command="deleteStubEntry"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/deleteStubEntry.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="matchPatients"
+					  command="matchPatients"
+					  csp="{callPrefix}edp.controller.cls"
+					  mock="assets/mock/matchPatients.xml"
+					  vlj="{callPrefix}tracking.xml"
+					  callType="{callMode}"
+					  concurrency="last"/>
+
+	<vista:CSPService id="matchClosed"
+					  command="matchClosed"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/matchClosed.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="initLogArea"
+					  command="initLogArea"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/initLogArea.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="addPatientToLog"
+					  command="addPatientToLog"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/addPatientToLog.xml"
+					  callType="{callMode}"
+					  concurrency="last"/>
+
+	<vista:CSPService id="initDisplayBoard"
+					  command="initDisplayBoard"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}board.xml"
+					  mock="assets/mock/initDisplayBoard.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="refreshDisplayBoard"
+					  command="refreshDisplayBoard"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}board.xml"
+					  mock="assets/mock/refreshDisplayBoard.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="removeLogEntry"
+					  command="removeLogEntry"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/removeLogEntry.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="loadConfiguration"
+					  command="loadConfiguration"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/loadConfiguration.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="loadBoardConfig"
+					  command="loadBoardConfig"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/loadBoardConfig.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="saveBedConfig"
+					  command="saveBedConfig"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/saveBedConfig.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="saveConfigBoard"
+					  command="saveConfigBoard"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/saveConfigBoard.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="saveColorConfig"
+					  command="saveColorConfig"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/saveColorConfig.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="saveParamConfig"
+					  command="saveParamConfig"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/saveParamConfig.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="loadStaffConfig"
+					  command="loadStaffConfig"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/loadStaffConfig.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="saveStaffConfig"
+					  command="saveStaffConfig"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/saveStaffConfig.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="matchPersons"
+					  command="matchPersons"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/matchPersons.xml"
+					  callType="{callMode}"
+					  concurrency="last"/>
+
+	<vista:CSPService id="loadSelectionConfig"
+					  command="loadSelectionConfig"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/loadSelectionConfig.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="saveSelectionConfig"
+					  command="saveSelectionConfig"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/saveSelectionConfig.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="loadReports"
+					  command="getReport"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/activityReport.xml"
+					  callType="{callMode}"/>
+
+	<!-- command=getCSV -->
+	<vista:CSPService id="downloadReports"
+					  command="getCSV"
+					  csp="{callPrefix}edp.download.cls"
+					  vlj="{callPrefix}export.csv"
+					  showBusyCursor="true"
+					  callType="{callMode}" method="GET"/>
+
+	<vista:CSPService id="matchDiagnoses"
+					  command="getLexiconMatches"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  showBusyCursor="true"
+					  mock="assets/mock/activityReport.xml"
+					  callType="{callMode}"/>
+
+	<vista:CSPService id="checkSensitivePtAndFlags"
+					  command="getPatientChecks"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/sensitiveAndFlags.xml"
+					  callType="{callMode}"
+					  concurrency="last"/>
+
+	<vista:CSPService id="logSensitivePatientAccess"
+					  command="saveSecurityLog"
+					  csp="{callPrefix}edp.controller.cls"
+					  vlj="{callPrefix}tracking.xml"
+					  mock="assets/mock/logSensitivePtAccess.xml"
+					  callType="{callMode}"/>
+
+</cairngorm:ServiceLocator>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/SwitchLogEntryDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/SwitchLogEntryDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/SwitchLogEntryDelegate.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* SwitchLogEntryDelegate.as */
+
+package gov.va.med.edp.business
+{
+	import gov.va.med.edp.vo.LogEntryVO;
+	
+	import mx.rpc.IResponder;
+	    
+	public class SwitchLogEntryDelegate extends ResponderChainingDelegate
+	{	
+		
+		public function SwitchLogEntryDelegate(responder:IResponder)
+		{
+			super(responder, "switchLogEntry");
+		}
+	   	 
+		public function switchLogEntry(logID: Number, logEntry: LogEntryVO, choiceTS: String): void
+		{
+			var params:Object = new Object();
+			params.logID = logID;
+			if (logEntry != null) params.logEntry = logEntry.toString();
+			params.choiceTS = choiceTS;
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadBoardConfigDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadBoardConfigDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadBoardConfigDelegate.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* LoadBoardConfigDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	
+	import mx.rpc.IResponder;
+    
+	public class LoadBoardConfigDelegate extends ResponderChainingDelegate
+	{	
+		public function LoadBoardConfigDelegate(responder:IResponder)
+		{
+			super(responder, "loadBoardConfig");
+		}
+	   	 
+		public function loadBoardConfig(area: int, boardID: int):void
+		{
+			var params:Object = new Object();
+			params.area = area;
+			params.boardID = boardID;
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadConfigStaffDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadConfigStaffDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadConfigStaffDelegate.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* LoadConfigStaffDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+	
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	
+	import mx.rpc.AsyncToken;
+	import mx.rpc.IResponder;
+    
+	public class LoadConfigStaffDelegate extends ResponderChainingDelegate
+	{	
+		public function LoadConfigStaffDelegate(responder:IResponder)
+		{
+			super(responder, "loadStaffConfig");
+		}
+	   	 
+		public function loadConfigStaff(area: int):void
+		{
+			var params:Object = new Object();
+			params.area = area;	 
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadConfigurationDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadConfigurationDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadConfigurationDelegate.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* LoadConfigurationDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	
+	import mx.rpc.IResponder;
+    
+	public class LoadConfigurationDelegate extends ResponderChainingDelegate
+	{	
+	
+		public function LoadConfigurationDelegate(responder:IResponder)
+		{
+			super(responder, "loadConfiguration");
+		}
+	   	 
+		public function loadConfiguration(area: int):void
+		{
+			var params:Object = new Object();
+			params.area = area;	 
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadSelectionConfigDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadSelectionConfigDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/LoadSelectionConfigDelegate.as	(revision 1227)
@@ -0,0 +1,23 @@
+/* LoadSelectionConfigDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	
+	import mx.rpc.IResponder;
+    
+	public class LoadSelectionConfigDelegate extends ResponderChainingDelegate
+	{	
+		public function LoadSelectionConfigDelegate(responder:IResponder)
+		{
+			super(responder, "loadSelectionConfig");
+		}
+	   	 
+		public function loadSelectionConfig(area: int):void
+		{
+			var params:Object = new Object();
+			params.area = area;	 
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/MatchPersonDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/MatchPersonDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/MatchPersonDelegate.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* MatchPersonDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	
+	import mx.rpc.IResponder;
+    
+	public class MatchPersonDelegate extends ResponderChainingDelegate
+	{	
+		public function MatchPersonDelegate(responder:IResponder)
+		{
+			super(responder, "matchPersons");
+		}
+	   	 
+		public function matchPersons(partial: String, personType: String):void
+		{
+			var params:Object = new Object();
+			params.partial = partial;
+			params.personType = personType;
+			
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveBedConfigDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveBedConfigDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveBedConfigDelegate.as	(revision 1227)
@@ -0,0 +1,33 @@
+/* SaveBedConfigDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	import gov.va.med.edp.vo.RoomBedVO;
+	
+	import mx.collections.ArrayCollection;
+	import mx.rpc.IResponder;
+    
+	public class SaveBedConfigDelegate extends ResponderChainingDelegate
+	{	
+		public function SaveBedConfigDelegate(responder:IResponder)
+		{
+			super(responder, "saveBedConfig");
+		}
+	   	 
+		public function saveBedConfig(beds: ArrayCollection, area: int, bedToken: String):void
+		{
+			var params:Object = new Object();
+			var bed: RoomBedVO;
+			
+			params.area = area;
+			params.bedToken = bedToken;
+			for (var i: int = 0; i < beds.length; i++) {
+				bed = beds[i] as RoomBedVO;
+				params["bed-" + i] = bed.toString();
+			}
+			
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigBoardDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigBoardDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigBoardDelegate.as	(revision 1227)
@@ -0,0 +1,31 @@
+/* SaveConfigBoardDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	
+	import mx.rpc.IResponder;
+    
+	public class SaveConfigBoardDelegate extends ResponderChainingDelegate
+	{	
+		public function SaveConfigBoardDelegate(responder:IResponder)
+		{
+			super(responder, "saveConfigBoard");
+		}
+	   	 
+		public function saveConfigBoard(area: int, boardID: int, boardName: String, boardToken: String, boardXML: XML): void
+		{
+			var params: Object = new Object();
+			var i: int = 0;
+			params.area = area;
+			params.boardID = boardID;
+			params.boardName = boardName;
+			params.boardToken = boardToken;
+			for each (var elem:XML in boardXML.children()) {
+				i++;
+				params["col-" + i] = elem.toXMLString();
+			}
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigColorsDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigColorsDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigColorsDelegate.as	(revision 1227)
@@ -0,0 +1,38 @@
+/* SaveConfigColorsDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	
+	import mx.rpc.IResponder;
+    
+	public class SaveConfigColorsDelegate extends ResponderChainingDelegate
+	{	
+		public function SaveConfigColorsDelegate(responder:IResponder)
+		{
+			super(responder, "saveColorConfig");
+		}
+	   	 
+		public function saveConfigColors(area: int, colorXML: XML, colorToken: String): void
+		{
+			var params:Object = new Object();
+			var i: int = 0;
+			params.area = area;
+			params.colorToken = colorToken;
+			for each (var elem: XML in colorXML.children()) {
+				if (elem.@type == "bed") continue;     // bed colors saved from room/bed screen
+				if (elem.@type == "staff") continue;   // staff colors saved from staff screen
+				i++;
+				params["xml-"+i] = '<colors id="' + elem.@id + '" type="' + elem.@type + '" >';
+				for each (var match: XML in elem.children()) {
+					i++;
+					params["xml-"+i] = match.toXMLString();
+				}
+				i++;
+				params["xml-"+i] = '</colors>';
+			}
+
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigParamsDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigParamsDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigParamsDelegate.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* SaveConfigParamsDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	import gov.va.med.edp.vo.LogEditParamsVO;
+	
+	import mx.rpc.IResponder;
+    
+	public class SaveConfigParamsDelegate extends ResponderChainingDelegate
+	{	
+		public function SaveConfigParamsDelegate(responder:IResponder)
+		{
+			super(responder, "saveParamConfig");
+		}
+	   	 
+		public function saveConfigParams(area: int, logParams: LogEditParamsVO, paramToken: String):void
+		{
+			var params:Object = new Object();
+			params.area = area;
+			params.paramToken = paramToken;
+			params.param = logParams.toString();
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigStaffDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigStaffDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveConfigStaffDelegate.as	(revision 1227)
@@ -0,0 +1,33 @@
+/* SaveConfigStaffDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	import gov.va.med.edp.vo.StaffMemberVO;
+	
+	import mx.collections.ArrayCollection;
+	import mx.rpc.IResponder;
+    
+	public class SaveConfigStaffDelegate extends ResponderChainingDelegate
+	{	
+		public function SaveConfigStaffDelegate(responder:IResponder)
+		{
+			super(responder, "saveStaffConfig");
+		}
+	   	 
+		public function saveConfigStaff(area: int, staffToken: String, staffList: ArrayCollection):void
+		{
+			var params:Object = new Object();
+			params.area = area;
+			params.staffToken = staffToken;
+			
+			var num: int = 0;
+			for each (var staff: StaffMemberVO in staffList) {
+				num++;
+				params["staff-" + num] = staff.toString();
+			}
+			
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveSelectionConfigDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveSelectionConfigDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/config/SaveSelectionConfigDelegate.as	(revision 1227)
@@ -0,0 +1,56 @@
+/* SaveSelectionConfigDelegate.as */
+
+package gov.va.med.edp.business.config
+{
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	import gov.va.med.edp.vo.CodeSelectionVO;
+	
+	import mx.collections.ArrayCollection;
+	import mx.rpc.IResponder;
+    
+	public class SaveSelectionConfigDelegate extends ResponderChainingDelegate
+	{	
+		public function SaveSelectionConfigDelegate(responder:IResponder)
+		{
+			super(responder, "saveSelectionConfig");
+		}
+	   	 
+		public function saveSelectionConfig(area: int, selectionToken: String, statuses: ArrayCollection,
+			dispositions: ArrayCollection, delays: ArrayCollection, arrivals: ArrayCollection): void
+		{
+			var params:Object = new Object();
+			params.area = area;
+			params.selectionToken = selectionToken;
+			
+			var code: CodeSelectionVO;
+			var i: int;
+			
+			if (statuses != null) {
+				for (i = 0; i < statuses.length; i++) {
+					code = statuses[i] as CodeSelectionVO;
+					params["status-"+i] = code.toString() + "seq=" + (i+1);
+				}
+			}
+			if (dispositions != null) {
+				for (i = 0; i < dispositions.length; i++) {
+					code = dispositions[i] as CodeSelectionVO;
+					params["disposition-"+i] = code.toString() + "seq=" + (i+1);
+				}
+			}
+			if (delays != null) {
+				for (i = 0; i < delays.length; i++) {
+					code = delays[i] as CodeSelectionVO;
+					params["delay-"+i] = code.toString() + "seq=" + (i+1);
+				}
+			}			
+			if (arrivals != null) {
+				for (i = 0; i < arrivals.length; i++) {
+					code = arrivals[i] as CodeSelectionVO;
+					params["arrival-"+i] = code.toString() + "seq=" + (i+1);
+				}
+			}
+			
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/reports/ReportDelegate.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/reports/ReportDelegate.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/reports/ReportDelegate.as	(revision 1227)
@@ -0,0 +1,30 @@
+/* LoadConfigColorsDelegate.as */
+
+package gov.va.med.edp.business.reports
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+	
+	import gov.va.med.edp.business.ResponderChainingDelegate;
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.util.Vista;
+	
+	import mx.rpc.IResponder;
+    
+	public class ReportDelegate extends ResponderChainingDelegate
+	{	
+		public function ReportDelegate(responder:IResponder)
+		{
+			super(responder, "loadReports");
+		}
+	   	 
+		public function loadReport(reportEvent:ReportEvent):void
+		{
+			var params:Object = new Object();
+			params.start = Vista.DatetoFM(reportEvent.reportParams.startDate);
+			params.stop = Vista.DatetoFM(reportEvent.reportParams.stopDate);
+			params.id = reportEvent.reportParams.id;
+			params.report =	reportEvent.type as String; 
+			send(params);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/responder/ResponderDecorator.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/responder/ResponderDecorator.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/responder/ResponderDecorator.as	(revision 1227)
@@ -0,0 +1,24 @@
+package gov.va.med.edp.business.responder
+{
+	import mx.rpc.IResponder;
+
+	public class ResponderDecorator implements IResponder
+	{
+		protected var responder:IResponder;
+		
+		public function ResponderDecorator(responder:IResponder) {
+			this.responder = responder;
+		}
+		
+		public function result(data:Object):void
+		{
+			this.responder.result(data);
+		}
+		
+		public function fault(info:Object):void
+		{
+			this.responder.fault(info);
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/responder/ServerErrorCheckResponder.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/responder/ServerErrorCheckResponder.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/responder/ServerErrorCheckResponder.as	(revision 1227)
@@ -0,0 +1,30 @@
+package gov.va.med.edp.business.responder
+{
+	import mx.rpc.Fault;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+    /**
+     * Responder that checks the result for <error> tags produced by the server.  If found, calls fault on
+     * decorated responder, if not, passes through result unmodified.
+     */
+    public class ServerErrorCheckResponder extends ResponderDecorator implements IResponder
+	{	
+		public function ServerErrorCheckResponder(responder: IResponder) {
+			super(responder);
+		}
+		
+		public override function result(data:Object):void {
+			var xml:XML = ResultEvent(data).result as XML;
+			if (xml.error != undefined) {
+				var fault:Fault = new Fault(xml.error.code, xml.error.message, xml.error.detail);
+				fault.rootCause = xml.error;
+				var faultEvent:FaultEvent = FaultEvent.createEvent(fault);
+				this.fault(faultEvent);
+			} else {
+				responder.result(data);
+			}
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/responder/XMLResultFormattingResponder.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/responder/XMLResultFormattingResponder.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/business/responder/XMLResultFormattingResponder.as	(revision 1227)
@@ -0,0 +1,33 @@
+package gov.va.med.edp.business.responder
+{
+	import mx.rpc.Fault;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+    import mx.rpc.http.HTTPService;
+
+    /**
+     * Responder that takes a text result and attempts to create an XML object of it.  If an error during the XML parse
+     * occurs, fault is called on the decorated responder, otherwise a new ResultEvent is created with result set to the
+     * XML object. This emulates the behavior of setting the resultFormat on HTTPService to "e4x".
+     */
+    public class XMLResultFormattingResponder extends ResponderDecorator implements IResponder
+	{	
+		public function XMLResultFormattingResponder(responder: IResponder) {
+			super(responder);
+		}
+
+		public override function result(data:Object):void {
+            var resultEvent:ResultEvent = ResultEvent(data);
+            try {
+                var xml:XML = new XML(String(resultEvent.result));
+                responder.result(new ResultEvent(ResultEvent.RESULT, resultEvent.bubbles, resultEvent.cancelable, xml, resultEvent.token, resultEvent.message));
+			} catch (error:Error) {
+                var fault:Fault = new Fault(HTTPService.ERROR_DECODING, error.message);
+                fault.rootCause = String(resultEvent.result);
+                var faultEvent:FaultEvent = FaultEvent.createEvent(fault);
+                responder.fault(faultEvent);
+            }
+		}
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/AbstractResponderCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/AbstractResponderCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/AbstractResponderCommand.as	(revision 1227)
@@ -0,0 +1,89 @@
+package gov.va.med.edp.command
+{
+	import flash.system.System;
+	import flash.utils.getQualifiedClassName;
+    import flash.net.URLRequest;
+    import flash.net.navigateToURL;
+
+    import gov.va.med.edp.control.ClearUnsavedViewsModelEvent;
+    import gov.va.med.edp.control.SwitchAppViewEvent
+    import gov.va.med.edp.model.TrackingModelLocator;
+    import gov.va.med.edp.view.ErrorDialog;
+
+import mx.core.Application;
+import mx.events.CloseEvent;
+    import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+    import mx.rpc.http.HTTPService;
+
+    public class AbstractResponderCommand implements IResponder
+	{  
+        public function result(data:Object):void {
+			// NOOP: must override
+		}
+		
+		public function fault(info:Object):void {
+			var f:FaultEvent = info as FaultEvent;
+			if (f.fault.faultCode == "Client.Error.RequestTimeout" || f.fault.faultCode == "Server.Error.Request") {
+                handleServerUnavailable(f);
+            } else if (f.fault.faultCode == HTTPService.ERROR_DECODING) {          // XML parser choking on HTML error page
+                if (isLoginPage(String(f.fault.rootCause))) {
+                    ErrorDialog.show("Your session appears to be invalid.\nYou will be now be asked to log in.\nUnsaved changes will be lost.", createFaultDetail(f), "Invalid Session", attemptLogin, "Login");
+                } else {
+                    handleServerError(f);
+                }
+            } else {
+                handleUnknownError(f);
+			}
+		}
+
+        protected function getFaultMessage(faultEvent:FaultEvent) : String {
+			return faultEvent.fault.faultString;
+		}
+		
+		protected function createFaultDetail(faultEvent:FaultEvent) : Object {
+			var detail:Object = {};
+			detail.command = getQualifiedClassName(this);
+			detail.fault = faultEvent.fault;
+			detail.totalMemory = System.totalMemory;
+			detail.currentTarget = faultEvent.currentTarget;
+			return detail;
+		}
+
+        protected function handleServerUnavailable(f:FaultEvent) : void {
+            TrackingModelLocator.getInstance().disconnectionFault = f.fault;
+            TrackingModelLocator.getInstance().disconnected = true;
+        }
+
+        protected function handleServerError(f:FaultEvent) : void {
+			if (TrackingModelLocator.getInstance().appName == TrackingModelLocator.APP_NAME_BIGBOARD) {
+				reloadBoard();
+			} else {
+            	ErrorDialog.fatal(getFaultMessage(f), createFaultDetail(f));  // sign of a unknown server-side error
+			}
+        }
+
+        protected function handleUnknownError(f:FaultEvent) : void {
+			if (TrackingModelLocator.getInstance().appName == TrackingModelLocator.APP_NAME_BIGBOARD) {
+				reloadBoard();
+			} else {
+            	ErrorDialog.show(getFaultMessage(f), createFaultDetail(f));	// default is non-fatal
+			}
+        }
+
+        private function isLoginPage(result:String):Boolean {
+            return result.indexOf("<TITLE>Login Page</TITLE>") != -1;
+        }
+
+        private function attemptLogin():void {
+            ClearUnsavedViewsModelEvent.dispatchClearUnsavedViews();
+		  	var request: URLRequest = new URLRequest(TrackingModelLocator.getInstance().rootURL);
+		    navigateToURL(request, "_top");
+        }
+
+		private function reloadBoard():void {
+			if (TrackingModelLocator.getInstance().reloadFunction)
+				TrackingModelLocator.getInstance().reloadFunction.call(null);
+		}
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/AddPatientToLogCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/AddPatientToLogCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/AddPatientToLogCommand.as	(revision 1227)
@@ -0,0 +1,79 @@
+/*  Command
+	event & command must be added to TrackingController.as    */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.AddPatientToLogDelegate;
+	import gov.va.med.edp.control.PatientSelectEvent;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.util.Vista;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.collections.ArrayCollection;
+	import mx.collections.Sort;
+	import mx.collections.SortField;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class AddPatientToLogCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate:AddPatientToLogDelegate = new AddPatientToLogDelegate(this);
+			var addEvent:PatientSelectEvent = PatientSelectEvent(event);
+			var localTime: String = Vista.DatetoFM(model.buildSiteDate());
+
+			delegate.addPatientToLog(addEvent.newPatient, model.logArea, localTime, model.logEdit.choiceTS);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+
+			if (xml.add.@status == "fail") {
+				InfoDialog.show("Patient could not be added to the log: " + xml.add.@msg);
+				return;
+			}			
+			
+			// make sure the choices are set up before setting the logEntry
+			model.logEdit.setChoices(xml.choices[0]);
+			// now that the choices are in place, we can set the log entry
+			model.logEdit.setEntry(TrackingFactory.buildLogEntryFromXML(xml.logEntry[0]));
+			model.logEdit.entry.isStub = true;
+            model.logEdit.dirty = true;
+            model.setEditState();
+			
+			// refresh the list of log entries
+			model.logEntryList.entries =
+				new ArrayCollection(TrackingFactory.buildLogSelectorListFromXML(xml.logEntries.log));
+			model.logEntryList.token = xml.logEntries.@token;
+				
+			// sort based on previous settings
+			if (model.logEntryList.sortField.length > 0) {
+				var sort:Sort = new Sort();
+				sort.fields = [new SortField(model.logEntryList.sortField, true, model.logEntryList.sortDescending)];
+				model.logEntryList.entries.sort = sort;
+				model.logEntryList.entries.refresh();
+			}
+			// now that it is sorted, set the selected index to the just added patient
+			// (must set initial -1 to fire bindings)
+			model.logEntryList.selectedIndex = -1;
+			model.logEntryList.selectedIndex = 
+				Vista.locateIndex(model.logEntryList.entries, model.logEdit.entry.id, "id");
+			model.logEntryList.selectedID = model.logEdit.entry.id;
+			
+			model.logEdit.patientSelected = true;
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Add patient to log failed: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/CancelLogEntryEditCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/CancelLogEntryEditCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/CancelLogEntryEditCommand.as	(revision 1227)
@@ -0,0 +1,21 @@
+/* CancelLogEntryEditCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+
+	public class CancelLogEntryEditCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		public function execute(event:CairngormEvent):void
+		{	
+			model.logEdit.resetEntry();
+			model.logEntryViewState = TrackingModelLocator.VIEW_EDIT_MESSAGE;
+			model.logEntryList.selectedIndex = -1;
+			model.logEntryList.selectedID = 0;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ChangeFontSizeCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ChangeFontSizeCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ChangeFontSizeCommand.as	(revision 1227)
@@ -0,0 +1,21 @@
+/* ChangeFontSizeCommand.as */
+   	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.NumberEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+
+	public class ChangeFontSizeCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		public function execute(event:CairngormEvent):void
+		{
+			var e: NumberEvent = NumberEvent(event);
+			model.boardSpec.displayBoardProperties.squishFontSize = e.value;
+		} // execute
+	} // class
+} // package
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ChangeLogEntryFieldCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ChangeLogEntryFieldCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ChangeLogEntryFieldCommand.as	(revision 1227)
@@ -0,0 +1,173 @@
+/* ChangeLogEntryFieldCommand.as */
+   	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.ChangeLogEntryFieldEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+	import gov.va.med.edp.vo.LogSelectorVO;
+	import gov.va.med.edp.vo.PCECodedValueVO;
+
+	public class ChangeLogEntryFieldCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		public function execute(event:CairngormEvent):void
+		{
+			var changeEvent:ChangeLogEntryFieldEvent = ChangeLogEntryFieldEvent(event);
+			model.logEdit.dirty = true;
+
+			switch(changeEvent.field)
+			{
+				case "patient":
+					// set the name, ssn, and dfn all at once
+					var patientVO: PatientSelectVO = changeEvent.value as PatientSelectVO;
+					if ((model.logEdit.entry != null && model.logEdit.entry.name == "(ambulance)") && 
+						(patientVO.name != "(ambulance)") &&
+						(model.logEdit.entry.inTS == null) ) {
+						model.logEdit.entry.inTS = model.buildSiteDate();
+						model.logEdit.patientSelected = true;	
+					}
+					model.logEdit.entry.name = patientVO.name;
+					model.logEdit.entry.ssn = patientVO.ssn;
+					model.logEdit.entry.dob = patientVO.dob;
+					model.logEdit.entry.dfn = patientVO.dfn;
+					synchSelector("name", patientVO.name);
+					synchSelector("ssn", patientVO.ssn);
+					break;
+				case "name":
+					model.logEdit.entry.name = changeEvent.value;
+					synchSelector(changeEvent.field, changeEvent.label);
+					break;
+				case "ssn":
+					model.logEdit.entry.ssn = changeEvent.value;
+					synchSelector(changeEvent.field, changeEvent.label);
+					break;
+				case "inTS":
+					model.logEdit.entry.inTS = changeEvent.value;
+					model.logEdit.entry.requireDelay = isDelayRequired();
+					break;
+				case "outTS":
+					model.logEdit.entry.outTS = changeEvent.value;
+					model.logEdit.entry.requireDelay = isDelayRequired();
+					break;
+				case "complaint":
+					model.logEdit.entry.complaint = changeEvent.value;
+					break;
+				case "longComplaint":
+					model.logEdit.entry.longComplaint = changeEvent.value;
+					break;
+				case "arrival":
+					model.logEdit.entry.arrival = changeEvent.value;
+					break;
+				case "bed":
+					model.logEdit.entry.bed = changeEvent.value;
+					if (int(changeEvent.reference) > 0) {
+						model.logEdit.entry.status = int(changeEvent.reference);
+					} else {
+						if (model.logEdit.undo != null) {
+							model.logEdit.entry.status = model.logEdit.undo.status;
+						}
+					}
+					// don't synch until "save"
+					// synchSelector(changeEvent.field, changeEvent.label);
+					break;
+				case "acuity":
+					model.logEdit.entry.acuity = changeEvent.value;
+					break;
+				case "clinic":
+					model.logEdit.entry.clinic = changeEvent.value;
+					break;
+				case "status":
+					model.logEdit.entry.status = changeEvent.value;
+					break;
+				case "provider":
+					model.logEdit.entry.provider = changeEvent.value;
+					break;
+				case "resident":
+					model.logEdit.entry.resident = changeEvent.value;
+					break;
+				case "nurse":
+					model.logEdit.entry.nurse = changeEvent.value;
+					break;
+				case "comment":
+					model.logEdit.entry.comment = changeEvent.value;
+					break;
+				case "disposition":
+					model.logEdit.entry.disposition = changeEvent.value;
+					model.entryRemoveReady();
+					break;
+				case "delay":
+					model.logEdit.entry.delay = changeEvent.value;
+					model.entryRemoveReady();
+					break;
+				case "diagnoses":
+					var pceItem: PCECodedValueVO = changeEvent.value as PCECodedValueVO;
+					if (changeEvent.clear) {
+						// clear means we want to remove the item
+						var index: int = model.logEdit.entry.diagnoses.getItemIndex(pceItem);
+						if (pceItem.added) {
+							// remove from list if we just added it in this session
+							model.logEdit.entry.diagnoses.removeItemAt(index);
+						} else {
+							// otherwise set remove to true so PCE can remove it
+							model.logEdit.entry.diagnoses[index].remove = true;
+						}
+					} else if (pceItem.updated){ // MAKE SURE THAT UPDATE IS CHECKED BEFORE ADD..
+						pceItem.updated = true	// BECAUSE AN ITEM CAN BE ADDED AND THEN UPDTED IN THE SAME SESSION
+						model.logEdit.entry.diagnoses[index].updated = true;
+					} else if (pceItem.added){
+						pceItem.added = true;
+						model.logEdit.entry.diagnoses.addItem(pceItem);
+					} 
+					model.logEdit.entry.updatedDiagnoses = true;
+					model.entryRemoveReady();
+					break;
+			} // switch
+		} // execute
+		
+		private function synchSelector(field: String, label: String): void
+		{
+			var logSelector: LogSelectorVO = findLogSelector();
+			if (logSelector == null) return;
+			
+			switch(field)
+			{
+				case "name":
+					logSelector.name = label;
+					break;
+				case "ssn":
+					logSelector.ssn = label;
+					break;
+				case "bed":
+					logSelector.bed = label;
+					break;
+			} // switch
+		} // synchSelector
+		
+		private function findLogSelector(): LogSelectorVO
+		{
+			for each (var logSelector: LogSelectorVO in model.logEntryList.entries) {
+				if (logSelector.id == model.logEdit.entry.id) {
+					return logSelector;
+				}
+			}
+			return null;		
+		}
+		
+		private function isDelayRequired(): Boolean
+		{
+			if (!model.logEditParams.requireDelay) return false;
+			
+			// don't require delay reason for "entered in error"
+			if (model.logEdit.entry.disposition == model.logEditParams.errorIEN) return false;
+			
+			var mins: Number = (model.logEdit.entry.outTS.valueOf() - model.logEdit.entry.inTS.valueOf()) / 60000;  // milliseconds to minutes
+			return (mins > model.logEditParams.delayMinutes) ? true : false;
+		}
+		
+	} // class
+} // package
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ClearUnsavedViewsModelCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ClearUnsavedViewsModelCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ClearUnsavedViewsModelCommand.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* ClearUnsavedViewsModelCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.model.TrackingModelLocator;
+
+	public class ClearUnsavedViewsModelCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		public function execute(event:CairngormEvent):void
+		{
+			//clear all dirty flags
+			model.logEdit.dirty = false;
+			model.config.bedMods = false;
+			model.config.boardMods = false;
+			model.config.colorMods = false;
+			model.config.paramMods = false;
+			model.config.selectionMods = false;
+			model.config.staffMods = false;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/DeleteStubEntryCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/DeleteStubEntryCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/DeleteStubEntryCommand.as	(revision 1227)
@@ -0,0 +1,60 @@
+/* DeleteStubEntryCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.DeleteStubEntryDelegate;
+	import gov.va.med.edp.control.TrackingEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class DeleteStubEntryCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate: DeleteStubEntryDelegate = new DeleteStubEntryDelegate(this);
+			if (model.logEdit.entry.isStub) {
+				model.logEdit.dirty = false;
+				delegate.deleteStubEntry(model.logArea, model.logEdit.entry.id);
+			}
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+
+			if (xml.upd.@status == "fail") {
+				InfoDialog.show("Cancel failed: " + xml.upd.@msg);
+				model.logEdit.dirty = true;
+				model.synchToLastEntry();
+			} else {
+				model.logEdit.resetEntry();
+				model.logEdit.message = "No visit currently selected.";
+				model.logEntryViewState = TrackingModelLocator.VIEW_EDIT_MESSAGE;
+				model.logEntryList.selectedIndex = -1;
+				model.logEntryList.selectedID = 0;
+				
+				var e: TrackingEvent = new TrackingEvent(TrackingEvent.EVENT_REFRESH_LOG_SELECTOR);
+				e.dispatch();
+			}
+		}
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Cancelling log entry failed: " + super.getFaultMessage(faultEvent);
+		}
+		
+		public override function fault(info:Object):void
+		{
+			model.logEdit.dirty = true;
+			model.synchToLastEntry();
+			super.fault(info);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitAppCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitAppCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitAppCommand.as	(revision 1227)
@@ -0,0 +1,111 @@
+/* InitAppCommand.as */
+
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.InitUserDelegate;
+	import gov.va.med.edp.business.Services;
+	import gov.va.med.edp.control.InitAppEvent;
+	import gov.va.med.edp.control.TrackingEvent;
+	import gov.va.med.edp.factory.SessionFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.view.ErrorDialog;
+	import gov.va.med.edp.vo.SessionVO;
+
+	import mx.core.Application;
+
+    import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+	
+	public class InitAppCommand extends AbstractResponderCommand implements ICommand, IResponder
+    {
+        private    var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        public function execute(event:CairngormEvent):void
+        {
+            // set up Services.mxml so it knows the runtime URL
+            var e: InitAppEvent = InitAppEvent(event);
+            var prefix: String = "";
+
+            if (e.mode == InitAppEvent.SERVICE_USE_VLJ) {
+                prefix = e.protocol + "://" + e.server + e.contextRoot + "/";
+                model.rootURL = prefix;
+                model.logoutURL = prefix + "logout.html?swfID=" + Application.application.parameters.swfID;
+                model.helpContextRootURL = e.protocol + "://" + e.server + "/" + e.helpContextRoot + "/";
+                if (e.appName == TrackingModelLocator.APP_NAME_BIGBOARD) {
+                    if (!e.timeout) {
+                        model.logoutURL = prefix + "reset.jsp";
+                    }
+                }
+            }
+            if (e.mode == InitAppEvent.SERVICE_USE_CSP) {
+                prefix = e.protocol + "://" + e.server + "/";
+                model.rootURL = prefix;
+                model.logoutURL = prefix + "edp.logout.cls";
+                model.helpContextRootURL = e.protocol + "://" + e.server + "/" + e.helpContextRoot + "/";
+            }
+            Services(ServiceLocator.getInstance()).callPrefix = prefix;
+            Services(ServiceLocator.getInstance()).callMode = e.mode;
+            model.appName = e.appName;
+            model.contextRoot = e.contextRoot;
+
+            if (e.appName == TrackingModelLocator.APP_NAME_BIGBOARD) {
+                if (e.timeout) {
+                    new InitUserDelegate(this).initUser(e.token);
+                } else {
+					initAnonymousUser(e.areaName);						
+				}
+            } else {
+                new InitUserDelegate(this).initUser(e.token);
+            }
+        }
+
+        // don't call facility server for big board
+        private function initAnonymousUser(areaName: String): void
+        {
+            model.session = new SessionVO();
+            model.session.duz = "0";
+            model.session.site = "";
+            model.session.siteName = "";
+            model.session.area = 0;
+            model.session.areaName = areaName;
+            model.session.baseTime = new Date();
+            model.session.timeOut = 3600000;
+            model.session.countDown = 0;
+            model.session.canExport = false;
+            model.session.showProviderReport = false;
+            model.session.showPatientCrossReferenceReport = false;
+            model.session.debugEnabled = false;
+            // model.appViewList not used by big board (no menu on left side)
+            new TrackingEvent(TrackingEvent.EVENT_INIT_TRACKING).dispatch();
+
+        }
+
+        public override function result(data:Object):void
+        {
+            var xml:XML = ResultEvent(data).result as XML;
+
+            model.session = SessionFactory.buildSessionFromXML(xml);
+            model.appViewList = SessionFactory.buildLookupListFromXML(xml.view);
+
+            // now that information has been obtained from the local facility
+            // post this event to get the main server info and start the application
+            new TrackingEvent(TrackingEvent.EVENT_INIT_TRACKING).dispatch();
+        }
+
+        protected override function getFaultMessage(fault:FaultEvent) : String {
+            return "Unable to get user profile.";
+        }
+
+        protected override function createFaultDetail(fault:FaultEvent) : Object {
+            var detail:Object = super.createFaultDetail(fault);
+            detail.callPrefix = ﻿Services(ServiceLocator.getInstance()).callPrefix;
+            detail.callMode = ﻿Services(ServiceLocator.getInstance()).callMode;
+            return detail;
+        }
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitDisplayBoardCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitDisplayBoardCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitDisplayBoardCommand.as	(revision 1227)
@@ -0,0 +1,72 @@
+/* InitDisplayBoardCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.InitDisplayBoardDelegate;
+	import gov.va.med.edp.control.DisplayBoardEvent;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.BigBoardDebugInfo;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.util.BoardTools;
+	
+	import mx.collections.XMLListCollection;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class InitDisplayBoardCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate:InitDisplayBoardDelegate = new InitDisplayBoardDelegate(this);
+			var initEvent:DisplayBoardEvent = DisplayBoardEvent(event);
+			delegate.initDisplayBoard(model.session.area, initEvent.name);
+			model.boardSpec.specReady = false;
+			model.boardReady = false;
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml: XML = ResultEvent(data).result as XML;
+			
+			// build the color maps first so they can be referenced by columns
+			model.boardSpec.colorMaps = TrackingFactory.buildColorMapListFromXML(xml.colorSpec.colors);
+			
+			// build the column specs
+			model.boardSpec.columns =
+				TrackingFactory.buildColumnSpecListFromXML(xml.spec.col, model.boardSpec.colorMaps);
+				
+			//build display properties
+			model.boardSpec.displayBoardProperties =
+    			TrackingFactory.buildDisplayBoardPropertiesFromXML(xml.spec.displayProperties);
+
+			// build the row spec			
+			model.boardSpec.rowColorMap =
+				BoardTools.locateColorMap(xml.spec.row.@color, model.boardSpec.colorMaps);
+
+			// load the actual data for the board
+			model.boardData = new XMLListCollection(xml.rows.children() as XMLList);
+			
+			model.bigboardInfo = new BigBoardDebugInfo();
+			model.bigboardInfo.bigBoardSiteCode = xml.vistalinkConnectionInfo.siteId;
+			model.bigboardInfo.bigBoardMachineName = xml.vistalinkConnectionInfo.machineName;	
+			model.bigboardInfo.vistaLinkIPAddress = xml.vistalinkConnectionInfo.vistalinkIPAddress;
+			model.bigboardInfo.vistaLinkPort = xml.vistalinkConnectionInfo.vistalinkPort;			
+			
+			model.boardSpec.specReady = true;
+			
+			model.boardLastUpdated = new Date();
+			model.boardReady = true;
+			
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Initialize display board failed: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitLogAreaCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitLogAreaCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitLogAreaCommand.as	(revision 1227)
@@ -0,0 +1,63 @@
+/* InitLogAreaCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.InitLogAreaDelegate;
+	import gov.va.med.edp.control.InitLogAreaEvent;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.collections.ArrayCollection;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class InitLogAreaCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate:InitLogAreaDelegate = new InitLogAreaDelegate(this);
+			var initEvent:InitLogAreaEvent = InitLogAreaEvent(event);
+			model.logArea = initEvent.area;
+			delegate.initLogArea(initEvent.area, initEvent.logEntrySave);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+			
+			if (xml.udp.@status == "fail") {
+				InfoDialog.show("Update failed: " + xml.upd.@msg);
+				return;
+			}
+			
+			model.logEditParams = TrackingFactory.buildLogEditParamsFromXML(XML(xml.params));
+			
+			if (xml.logEntries.@status == "new") {
+				model.logEntryList.entries =
+					new ArrayCollection(TrackingFactory.buildLogSelectorListFromXML(xml.logEntries.log));
+				model.logEntryList.token = xml.logEntries.@token;
+				model.logEntryList.selectedIndex = -1;
+				model.logEntryList.sortField = "";
+				model.logEntryList.sortDescending = false;
+				model.logEntryViewState = TrackingModelLocator.VIEW_EDIT_MESSAGE;
+				//from AutoSave: model.editorViewState = TrackingModelLocator.VIEW_EDIT_MESSAGE;
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Unsuccessful save command: " + super.getFaultMessage(faultEvent);
+		}
+		
+		public override function fault(info:Object):void
+		{
+			super.fault(info);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitTrackingCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitTrackingCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/InitTrackingCommand.as	(revision 1227)
@@ -0,0 +1,64 @@
+/* InitTrackingCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.InitTrackingDelegate;
+	import gov.va.med.edp.control.SwitchAppViewEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.vo.LookupVO;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+	
+	public class InitTrackingCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate: InitTrackingDelegate = new InitTrackingDelegate(this);
+			delegate.initTracking(model.session.areaName);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+
+            model.session.serverPackageVersion = xml.user[0].@version;
+            if (model.session.area <= 0) {
+	            model.session.area = xml.user[0].@area;
+				model.session.areaName = xml.user[0].@areaNm;            	
+            }
+
+            model.logArea = model.session.area;  // set initial logArea value
+			
+			if (model.appName == TrackingModelLocator.APP_NAME_TRACKING) {
+                var e:SwitchAppViewEvent = new SwitchAppViewEvent(SwitchAppViewEvent.EVENT_SWITCH_APP_VIEW);
+				if (isVersionIncompatibility()) {
+                    e.view = TrackingModelLocator.VIEW_APP_VERSION_INCOMPATIBILITY;
+                } else if (model.appViewList.length > 0) {
+					e.view = (model.appViewList[0] as LookupVO).data;
+				}
+				e.dispatch();
+            } else if (model.appName == TrackingModelLocator.APP_NAME_BIGBOARD) {
+                if (isVersionIncompatibility()) {
+                    model.appViewState = TrackingModelLocator.VIEW_APP_VERSION_INCOMPATIBILITY;
+                } else {
+                    model.appViewState = TrackingModelLocator.VIEW_APP_DISPLAY_BOARD;
+                }
+            }
+		}
+
+        private function isVersionIncompatibility():Boolean {
+            return model.appClientVersion != model.session.serverPackageVersion;
+        }
+
+        protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Unable to initialize tracking views: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/MatchClosedVisitsCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/MatchClosedVisitsCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/MatchClosedVisitsCommand.as	(revision 1227)
@@ -0,0 +1,47 @@
+/*  MatchClosedVisitsCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.MatchClosedVisitsDelegate;
+	import gov.va.med.edp.control.MatchItemsEvent;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class MatchClosedVisitsCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var matchEvent: MatchItemsEvent = MatchItemsEvent(event);
+ 			if ((matchEvent.partial == null) || (matchEvent.partial.length == 0)) {
+				model.matchingClosedVisits = null;
+				return;
+			}
+			
+			var delegate:MatchClosedVisitsDelegate = new MatchClosedVisitsDelegate(this);
+			delegate.matchClosedVisits(model.logArea, matchEvent.partial);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+			model.matchingClosedVisits = 
+				TrackingFactory.buildVisitListFromXML(xml.visit);
+			model.logEdit.resetEntry();
+			model.setEditState();
+			model.matchingClosedVisitsIndex = -1;
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Retrieve closed visits failed: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/MatchDiagnosesCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/MatchDiagnosesCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/MatchDiagnosesCommand.as	(revision 1227)
@@ -0,0 +1,49 @@
+/*  MatchPatientsCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.MatchDiagnosesDelegate;
+	import gov.va.med.edp.control.MatchItemsEvent;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class MatchDiagnosesCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+
+			var matchDiagnosesEvent:MatchItemsEvent = MatchItemsEvent(event);
+ 			if ((matchDiagnosesEvent.partial == null) || (matchDiagnosesEvent.partial.length == 0)) {
+				model.matchingDiagnoses = null;
+				return;
+			}
+			
+			var delegate:MatchDiagnosesDelegate= new MatchDiagnosesDelegate(this);
+			delegate.matchDiagnoses(matchDiagnosesEvent.partial);
+		}
+		
+		public override function result(data:Object):void
+		{
+			model.matchingDiagnosesLoaded = false;
+			var xml:XML = ResultEvent(data).result as XML;
+			model.matchingDiagnoses = 
+				TrackingFactory.buildLookupDiagnosesListFromXML(xml);
+			model.matchingDiagnosesLoaded = true;
+				
+		}
+	
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Retrieve matching diagnoses failed: " + super.getFaultMessage(faultEvent);
+		}
+	
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/RefreshDisplayBoardCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/RefreshDisplayBoardCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/RefreshDisplayBoardCommand.as	(revision 1227)
@@ -0,0 +1,84 @@
+/* RefreshDisplayBoardCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.RefreshDisplayBoardDelegate;
+	import gov.va.med.edp.control.DisplayBoardEvent;
+	import gov.va.med.edp.model.BigBoardDebugInfo;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.collections.Sort;
+	import mx.collections.SortField;
+	import mx.collections.XMLListCollection;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class RefreshDisplayBoardCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		private var initDisplayBoardEvent: DisplayBoardEvent;
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate:RefreshDisplayBoardDelegate = new RefreshDisplayBoardDelegate(this);
+			var refreshEvent: DisplayBoardEvent = DisplayBoardEvent(event);
+			
+			//save off the refreshEvent as an initDisplayBoardEvent in case we need to fire it if needed..
+			initDisplayBoardEvent = new DisplayBoardEvent(DisplayBoardEvent.EVENT_INIT_DISPLAY_BOARD);
+			initDisplayBoardEvent.name = refreshEvent.name;
+			
+			delegate.refreshDisplayBoard(model.session.area, refreshEvent.name, model.boardSpec.configLastUpdated);
+			model.boardReady = false;
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+
+            // if the version on the server has changed we will need to load the new bigboard .swf automatically
+            // (UI used by human will get updated during login process)
+            if (model.appName == TrackingModelLocator.APP_NAME_BIGBOARD && model.appClientVersion != xml.rows.@version) {
+                model.logout();
+                return;
+            }
+
+            model.boardSpec.configLastUpdated = xml.rows.@configLastUpdated;
+			model.boardSpec.reloadConfig = (xml.rows.@reloadConfig == "true");		
+				
+			//if reloadConfig is true, fire an InitDisplayBoard Event Instead..
+			// this will cause the new Display Board Configuration and Data to be reloaded
+			//instead of just reloading the data...
+			if (model.boardSpec.reloadConfig == true){
+				initDisplayBoardEvent.dispatch();
+				return;			
+			}
+									
+			model.boardData = null;
+			model.boardData = new XMLListCollection(xml.rows.children() as XMLList);
+			model.boardLastUpdated = new Date();
+
+							
+			// sort based on previous settings
+			if (model.boardSortField.length > 0) {
+				var sort: Sort = new Sort();
+				//Do a numeric sort for any mins related columns
+				if ((model.boardSortField.indexOf("min") != -1 )){
+					sort.fields = [new SortField(model.boardSortField, true, model.boardSortDescending, true)];
+				} else {
+					sort.fields = [new SortField(model.boardSortField, true, model.boardSortDescending, false)];
+				}
+				model.boardData.sort = sort;
+				model.boardData.refresh();
+			}
+			model.boardReady = true;
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Unable to refresh display board: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/RefreshLogSelectorCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/RefreshLogSelectorCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/RefreshLogSelectorCommand.as	(revision 1227)
@@ -0,0 +1,68 @@
+/* RefreshLogSelectorCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.RefreshLogSelectorDelegate;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.util.Vista;
+	
+	import mx.collections.ArrayCollection;
+	import mx.collections.Sort;
+	import mx.collections.SortField;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class RefreshLogSelectorCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate:RefreshLogSelectorDelegate = new RefreshLogSelectorDelegate(this);
+			delegate.refreshLogSelector(model.logArea, model.logEntryList.token);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+			
+			//DONOT refresh if the Dirty flags is true. This is because the ChangeWatcher keeps different
+			//components in sync but if the user is still editing and the referesh comes in the components get
+			//out of sync..
+			//ALSO only refresh the list if it has changed
+			if (!model.logEdit.dirty && xml.logEntries.@status == "new"){
+				model.logEntryList.entries =
+					new ArrayCollection(TrackingFactory.buildLogSelectorListFromXML(xml.logEntries.log));
+				model.logEntryList.token = xml.logEntries.@token;
+				
+				// sort based on previous settings
+				if (model.logEntryList.sortField.length > 0) {
+					var sort:Sort = new Sort();
+					sort.fields = [new SortField(model.logEntryList.sortField, true, model.logEntryList.sortDescending)];
+					model.logEntryList.entries.sort = sort;
+					model.logEntryList.entries.refresh();
+				}
+				// now that it is sorted, reset the selected index (must set initial -1 to fire bindings)
+				model.logEntryList.selectedIndex = -1;
+				model.logEntryList.selectedIndex = 
+					Vista.locateIndex(model.logEntryList.entries, model.logEntryList.selectedID, "id");
+				// if the ID is no longer in the list, the entry must be closed
+				if ((model.logEntryList.selectedIndex == -1) && (model.logEntryList.selectedID > 0)) {
+					model.logEdit.resetEntry();
+					model.logEdit.message = "The selected entry has been closed.";
+					model.logEntryViewState = TrackingModelLocator.VIEW_EDIT_MESSAGE;
+					//from AutoSave: model.editorViewState = TrackingModelLocator.VIEW_EDIT_MESSAGE;
+				}
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Refresh Log Selector failed: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/RemoveLogEntryCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/RemoveLogEntryCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/RemoveLogEntryCommand.as	(revision 1227)
@@ -0,0 +1,70 @@
+/*  RemoveLogEntryCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.RemoveLogEntryDelegate;
+	import gov.va.med.edp.control.RemoveLogEntryEvent;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.collections.ArrayCollection;
+	import mx.collections.Sort;
+	import mx.collections.SortField;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class RemoveLogEntryCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate:RemoveLogEntryDelegate = new RemoveLogEntryDelegate(this);
+			var removeEvent: RemoveLogEntryEvent = RemoveLogEntryEvent(event);
+
+			delegate.removeLogEntry(model.logEdit.entry, model.logArea);
+			model.logEdit.dirty = false;
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+
+			// bail if the update of the changed log entry failed
+			if (xml.upd.@status == "fail") {
+				InfoDialog.show("Removal of log entry failed.\n" + xml.upd.@msg);
+				return;
+			}
+			
+			// clear the current record
+			model.logEdit.resetEntry();
+			model.logEdit.message = "Patient removed from board.";
+			model.logEntryViewState = TrackingModelLocator.VIEW_EDIT_MESSAGE;
+			model.logEntryList.selectedIndex = -1;
+			model.logEntryList.selectedID = 0;
+						
+			// refresh the list of log entries
+			model.logEntryList.entries =
+				new ArrayCollection(TrackingFactory.buildLogSelectorListFromXML(xml.logEntries.log));
+			model.logEntryList.token = xml.logEntries.@token;
+				
+			// sort based on previous settings
+			if (model.logEntryList.sortField.length > 0) {
+				var sort:Sort = new Sort();
+				sort.fields = [new SortField(model.logEntryList.sortField, true, model.logEntryList.sortDescending)];
+				model.logEntryList.entries.sort = sort;
+				model.logEntryList.entries.refresh();
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Remove patient entry failed: " + super.getFaultMessage(faultEvent);
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ResetDisplayBoardCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ResetDisplayBoardCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/ResetDisplayBoardCommand.as	(revision 1227)
@@ -0,0 +1,38 @@
+/* ResetDisplayBoardCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.ResetDisplayBoardDelegate;
+	import gov.va.med.edp.control.DisplayBoardEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.ResultEvent;
+
+	public class ResetDisplayBoardCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate:ResetDisplayBoardDelegate = new ResetDisplayBoardDelegate(this);
+			var resetEvent: DisplayBoardEvent = DisplayBoardEvent(event);
+			delegate.resetDisplayBoard(model.session.area, resetEvent.name);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+		}
+		
+		public override function fault(info:Object):void
+		{
+			InfoDialog.show("Unable to load display board spec.");
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SaveLogEntryCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SaveLogEntryCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SaveLogEntryCommand.as	(revision 1227)
@@ -0,0 +1,72 @@
+/* SaveLogEntryCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.SaveLogEntryDelegate;
+	import gov.va.med.edp.control.TrackingEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class SaveLogEntryCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate:SaveLogEntryDelegate = new SaveLogEntryDelegate(this);
+			if (model.logEdit.dirty) {
+				model.logEdit.dirty = false;
+				delegate.saveLogEntry(model.logEdit.entry);
+			}
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+
+			if (xml.upd.@status == "fail") {
+				var msg: String = xml.upd.@msg;
+				InfoDialog.show("Unable to save,  " + msg);
+				model.logEdit.dirty = true;
+				model.synchToLastEntry();
+				if (msg.indexOf("Delay Reason") > -1) {
+					model.logEdit.entry.requireDelay = true;
+				}
+			} else if (xml.upd.@status == "collision") {
+				InfoDialog.show(xml.upd, "Updated Entry");
+				model.logEdit.dirty = true;
+				model.synchToLastEntry();
+				model.logEdit.entry.loadTS = xml.upd.@loadTS;
+			} else {
+				model.logEdit.resetEntry();
+				model.logEdit.message = "Entry saved.";
+				model.logEntryViewState = TrackingModelLocator.VIEW_EDIT_MESSAGE;
+				model.logEntryList.selectedIndex = -1;
+				model.logEntryList.selectedID = 0;
+				
+				//force the binding to fire...
+				model.matchingClosedVisitsIndex = 0;
+				model.matchingClosedVisitsIndex = -1;
+
+				new TrackingEvent(TrackingEvent.EVENT_REFRESH_LOG_SELECTOR).dispatch();
+			}
+		}
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Saving log entry failed: " + super.getFaultMessage(faultEvent);
+		}
+		
+		public override function fault(info:Object):void
+		{
+			model.logEdit.dirty = true;
+			model.synchToLastEntry();
+			super.fault(info);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SortHeaderCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SortHeaderCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SortHeaderCommand.as	(revision 1227)
@@ -0,0 +1,28 @@
+/* SortHeaderCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.control.SortHeaderEvent;
+
+	public class SortHeaderCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		public function execute(event:CairngormEvent):void
+		{
+			var sortEvent: SortHeaderEvent = SortHeaderEvent(event);
+			if (sortEvent.type == SortHeaderEvent.EVENT_SORT_LOG_SELECTOR) {
+				model.logEntryList.sortField = sortEvent.sortField;
+				model.logEntryList.sortDescending = sortEvent.sortDescending;				
+			}
+			if (sortEvent.type == SortHeaderEvent.EVENT_SORT_DISPLAY_BOARD) {
+				model.boardSortField = sortEvent.sortField;
+				model.boardSortDescending = sortEvent.sortDescending;
+			}
+
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SwitchAppViewCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SwitchAppViewCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SwitchAppViewCommand.as	(revision 1227)
@@ -0,0 +1,32 @@
+/* SwitchAppViewCommand.as */
+
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.control.SwitchAppViewEvent;
+
+	public class SwitchAppViewCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		public function execute(event:CairngormEvent):void
+		{
+			var viewEvent: SwitchAppViewEvent = SwitchAppViewEvent(event);
+			
+			if ((viewEvent.view == TrackingModelLocator.VIEW_APP_EDIT_CLOSED) &&
+			    (model.appViewState != TrackingModelLocator.VIEW_APP_EDIT_CLOSED)) {
+				model.logEdit.resetEntry();
+				model.logEntryList.resetSelection();
+			}
+			
+			if (model.logEdit.entry == null) {
+				model.logEdit.message = "No visit currently selected.";
+			}
+			
+			model.appViewState = viewEvent.view;
+			model.setEditState();
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SwitchLogEntryCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SwitchLogEntryCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/SwitchLogEntryCommand.as	(revision 1227)
@@ -0,0 +1,61 @@
+/* SwitchLogEntryCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.SwitchLogEntryDelegate;
+	import gov.va.med.edp.control.SwitchLogEntryEvent;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+	import gov.va.med.edp.vo.LogEntryVO;
+
+	public class SwitchLogEntryCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		public function execute(event:CairngormEvent): void
+		{
+			var delegate:SwitchLogEntryDelegate = new SwitchLogEntryDelegate(this);
+			var switchEvent:SwitchLogEntryEvent = SwitchLogEntryEvent(event);
+			
+			model.logEntryList.selectedIndex = switchEvent.selectedIndex;
+			model.logEntryList.selectedID = switchEvent.logID;
+			
+			delegate.switchLogEntry(switchEvent.logID, null, model.logEdit.choiceTS);
+		}
+		
+		public override function result(data:Object): void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+			
+			// make sure the choices are set up before setting the logEntry
+			model.logEdit.setChoices(xml.choices[0]);
+			
+			// now that the choices are in place, we can set the log entry
+			model.logEdit.setEntry(TrackingFactory.buildLogEntryFromXML(xml.logEntry[0]));
+			model.logEdit.undo = new LogEntryVO;  // used for resetting status right now
+			model.logEdit.entry.copyTo(model.logEdit.undo);
+			model.logEdit.dirty = false;
+			model.logEdit.patientSelected = false;
+			model.entryRemoveReady();
+			model.setEditState();
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Loading log entry failed: " + super.getFaultMessage(faultEvent);
+		}
+		
+		public override function fault(info:Object): void
+		{
+			model.synchToLastEntry();
+			super.fault(info);
+		}
+		
+	} // class
+} // package
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/UndoLogEntryCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/UndoLogEntryCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/UndoLogEntryCommand.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* UndoLogEntryCommand.as */
+	
+package gov.va.med.edp.command
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+
+	public class UndoLogEntryCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		public function execute(event:CairngormEvent):void
+		{
+			if (!model.logEdit.dirty) return;
+			
+			model.logEdit.undo.copyTo(model.logEdit.entry);
+			model.logEdit.message = "";
+			model.logEdit.dirty = false;
+			model.entryRemoveReady();
+			//from AutoSave: model.editorViewState = TrackingModelLocator.VIEW_EDIT_FORM;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/AddBedCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/AddBedCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/AddBedCommand.as	(revision 1227)
@@ -0,0 +1,31 @@
+/* AddBedCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.config.AddBedEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.vo.RoomBedVO;
+
+	public class AddBedCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var addEvent: AddBedEvent = AddBedEvent(event);
+			var bed: RoomBedVO = new RoomBedVO();
+			bed.area = model.logArea;
+			bed.changed = true;
+			bed.displayName = "new" + addEvent.newIndex;
+			bed.displayWhen = 0;
+			bed.id = 0;
+			bed.name = bed.displayName;
+			bed.sequence = 9999;
+			model.config.beds.addItem(bed);
+			model.config.bedMods = true;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/AddBoardCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/AddBoardCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/AddBoardCommand.as	(revision 1227)
@@ -0,0 +1,40 @@
+/* AddBoardCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.vo.LookupVO;
+
+	public class AddBoardCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			// make sure we have a unique temporary name
+			var boardName: String;
+			for (var i: int = 1; i < 1000; i++) {
+				boardName = "New-" + i;
+				var dupFound: Boolean = false;
+				for each (var board: LookupVO in model.config.boards) {
+					if (board.label == boardName) {
+						dupFound = true;
+						break;
+					}
+				}
+				if (!dupFound) break;
+			}
+			
+			// add a new board entry (config will be based on last selected board)
+			var newBoard: LookupVO = new LookupVO;
+			newBoard.data = 0;
+			newBoard.label = boardName;
+			model.config.boards.addItem(newBoard);
+			model.config.boardIndex = model.config.boards.getItemIndex(newBoard);
+			model.config.boardMods = true;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ChangeBedSequenceCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ChangeBedSequenceCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ChangeBedSequenceCommand.as	(revision 1227)
@@ -0,0 +1,23 @@
+/* ChangeBedSequenceCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.config.ChangeBedSequenceEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+
+	public class ChangeBedSequenceCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var changeEvent: ChangeBedSequenceEvent = ChangeBedSequenceEvent(event);
+			var bed: Object = model.config.beds.removeItemAt(changeEvent.oldIndex);
+			model.config.beds.addItemAt(bed, changeEvent.newIndex);
+			model.config.bedMods = true;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ChangeParamFieldCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ChangeParamFieldCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ChangeParamFieldCommand.as	(revision 1227)
@@ -0,0 +1,58 @@
+/* ChangeParamFieldCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.config.ChangeFieldEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+
+	public class ChangeParamFieldCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var e: ChangeFieldEvent = ChangeFieldEvent(event);
+			model.config.paramMods = true;
+
+			switch(e.field)
+			{
+				case "reqDiag":
+					model.config.params.requireDiagnosis = e.value;
+					break;
+				case "codedDiag":
+					model.config.params.codedDiagnosis = e.value;
+					break;
+				case "reqDisp":
+					model.config.params.requireDisposition = e.value;
+					break;
+				case "reqDelay":
+					model.config.params.requireDelay = e.value;
+					break;
+				case "minDelay":
+					model.config.params.delayMinutes = e.value;
+					break;
+				case "shiftOne":
+					model.config.params.shiftStart = e.value;
+					break;
+				case "shiftLen":
+					model.config.params.shiftDuration = e.value;
+					break;
+				case "residents":
+					model.config.params.promptResidents = e.value;
+					break;
+				case "clinics":
+					model.config.params.promptClinics = e.value;
+					break;
+				case "ambulance":
+					model.config.params.ambulanceArea = e.value;
+					break;
+				case "dfltRoom":
+					model.config.params.defaultRoom = e.value;
+					break;
+			}
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigAddColumnCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigAddColumnCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigAddColumnCommand.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* ConfigAddColumnCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.config.ConfigAddColumnEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.events.ResultEvent;
+
+	public class ConfigAddColumnCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var loadEvent: ConfigAddColumnEvent = ConfigAddColumnEvent(event);
+			model.config.columns.addItem(loadEvent.data);
+			model.config.boardMods = true;
+			trace("config add column");
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigChangeColumnCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigChangeColumnCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigChangeColumnCommand.as	(revision 1227)
@@ -0,0 +1,37 @@
+/* ConfigChangeColumnCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.config.ConfigChangeColumnEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.vo.ColumnSpecVO;
+	import gov.va.med.edp.util.BoardTools;
+
+	public class ConfigChangeColumnCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var changeEvent: ConfigChangeColumnEvent = ConfigChangeColumnEvent(event);
+			if (changeEvent.type == ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_COLUMN_SEQ) {
+				var colSpec: Object = model.config.columns.removeItemAt(changeEvent.oldIndex);
+				model.config.columns.addItemAt(colSpec, changeEvent.newIndex);
+			}
+			if (changeEvent.type == ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_COLUMN_WIDTH) {
+				for (var i:int = 0; i < changeEvent.widths.length; i++) {
+					ColumnSpecVO(model.config.columns[i]).width = changeEvent.widths[i];
+				}
+			}
+			if (changeEvent.type == ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_ROW_COLOR) {
+				model.config.rowColorMap = 
+					BoardTools.locateColorMap(changeEvent.rowColor, model.config.colorMaps);
+			}
+			model.config.boardMods = true;
+			trace("change column");
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigChangeDisplayBoardPropertiesCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigChangeDisplayBoardPropertiesCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigChangeDisplayBoardPropertiesCommand.as	(revision 1227)
@@ -0,0 +1,43 @@
+/* ConfigChangeColumnCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.config.ConfigChangeColumnEvent;
+	import gov.va.med.edp.control.config.ConfigChangeDisplayBoardPropertiesEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.util.BoardTools;
+	import gov.va.med.edp.vo.ColumnSpecVO;
+
+	public class ConfigChangeDisplayBoardPropertiesCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var changeEvent: ConfigChangeDisplayBoardPropertiesEvent = ConfigChangeDisplayBoardPropertiesEvent(event);
+			if (changeEvent.type == ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_DISPLAY_WIDTH) {
+				model.config.displayBoardProperties.displaySize = changeEvent.displaySize;
+			}
+			if (changeEvent.type == ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_FONT_SIZE) {
+				model.config.displayBoardProperties.fontSize = changeEvent.fontSize;
+			}
+			if (changeEvent.type == ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_SCROLL_DELAY) {
+				model.config.displayBoardProperties.scrollDelay = changeEvent.scrollDelay;
+			}
+			if (changeEvent.type == ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_SQUISH) {
+				model.config.displayBoardProperties.squish = changeEvent.squish;
+			}
+			//Make sure this if block is the last in the code for the presence of a return statement
+			// added ChangeFontSizeCommand -- do we still need this section?			
+			if (changeEvent.type == ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_SQUISH_FONT_SIZE) {
+				model.config.displayBoardProperties.squishFontSize = changeEvent.squishFontSize;
+				return;
+			}				
+			model.config.boardMods = true;
+			trace("change properties");
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigRemoveColumnCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigRemoveColumnCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/ConfigRemoveColumnCommand.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* ConfigRemoveColumnCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.config.ConfigRemoveColumnEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+
+	public class ConfigRemoveColumnCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var loadEvent: ConfigRemoveColumnEvent = ConfigRemoveColumnEvent(event);
+			var index: int = model.config.columns.getItemIndex(loadEvent.data);
+			model.config.columns.removeItemAt(index);
+			model.config.boardMods = true;
+			trace("remove column");
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadBoardConfigCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadBoardConfigCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadBoardConfigCommand.as	(revision 1227)
@@ -0,0 +1,46 @@
+/* LoadBoardConfigCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.business.config.LoadBoardConfigDelegate;
+	import gov.va.med.edp.control.config.BoardConfigEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.factory.SessionFactory;
+	import gov.va.med.edp.util.BoardTools;
+	import gov.va.med.edp.util.Vista;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadBoardConfigCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent): void
+		{
+			model.config.boardLoaded = false;
+			var e: BoardConfigEvent = BoardConfigEvent(event);
+			var delegate: LoadBoardConfigDelegate = new LoadBoardConfigDelegate(this);
+			delegate.loadBoardConfig(model.logArea, e.boardID);
+		}
+		
+		public override function result(data:Object): void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+
+			// load specific board spec
+			BoardTools.applyBoardSpec(model.config, xml);
+			model.config.boardLoaded = true;
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error loading configuration for display board: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadConfigStaffCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadConfigStaffCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadConfigStaffCommand.as	(revision 1227)
@@ -0,0 +1,39 @@
+/* LoadConfigStaffCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.LoadConfigStaffDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.util.BoardTools;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadConfigStaffCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate: LoadConfigStaffDelegate = new LoadConfigStaffDelegate(this);
+			model.config.staffConfigLoaded = false;
+			delegate.loadConfigStaff(model.logArea);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+			BoardTools.applyStaffLists(model.config, xml);
+			model.config.staffConfigLoaded = true;
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error loading configuration for staff: " + super.getFaultMessage(faultEvent);
+		}		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadConfigurationCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadConfigurationCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadConfigurationCommand.as	(revision 1227)
@@ -0,0 +1,82 @@
+/* LoadConfigurationCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.LoadConfigurationDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.control.config.ConfigurationEvent;
+	import gov.va.med.edp.factory.SessionFactory;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.util.BoardTools;
+	import gov.va.med.edp.vo.ColorMapVO;
+	import gov.va.med.edp.vo.ColorMatchVO;
+	import gov.va.med.edp.vo.DisplaySizeVO;
+	
+	import mx.collections.ArrayCollection;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadConfigurationCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			model.config.colorLoaded = false;
+			model.config.bedLoaded = false;
+			model.config.paramLoaded = false;
+			var delegate: LoadConfigurationDelegate = new LoadConfigurationDelegate(this);
+			var loadEvent: ConfigurationEvent = ConfigurationEvent(event);
+			delegate.loadConfiguration(model.logArea);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+
+			// load color info first so it can be referenced by columns
+			// load color info - default maps
+			model.config.colorMaps =
+				TrackingFactory.buildColorMapListFromXML(xml.colorMaps.colors);
+
+			// load color info - maps for current spec		
+			BoardTools.applyColorSpec(xml.colorSpec.colors, model.config.colorMaps);
+			model.config.colorToken = xml.colorToken;
+			model.config.colorLoaded = true;
+			
+			// load available columns
+			model.config.availableColumns = 
+				TrackingFactory.buildColumnSpecListFromXML(xml.columnList.col, model.config.colorMaps);
+
+			//load screen sizes
+			model.config.displaySizes = TrackingFactory.buildScreenSizesFromXML(xml.screenSizes.size);
+				
+			// load room/bed info
+			model.config.beds = 
+				TrackingFactory.buildRoomBedListFromXML(xml.beds.bed);
+			model.config.whenList = 
+				SessionFactory.buildLookupListFromXML(xml.displayWhen.when);
+			model.config.statusList = 
+				SessionFactory.buildLookupListFromXML(xml.statusList.status);
+			model.config.roomCategoryList =
+				SessionFactory.buildLookupListFromXML(xml.roomCategories.item);
+			model.config.bedToken = xml.bedToken;
+			model.config.bedLoaded = true;
+				
+			// load parameter info
+			model.config.params = TrackingFactory.buildLogEditParamsFromXML(xml.params[0]);
+			model.config.defaultRoomList = SessionFactory.buildLookupListFromXML(xml.defaultRoomList.item);
+			model.config.paramToken = xml.paramToken;
+			model.config.paramLoaded = true;
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error loading configuration for display board: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadSelectionConfigCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadSelectionConfigCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/LoadSelectionConfigCommand.as	(revision 1227)
@@ -0,0 +1,40 @@
+/* LoadSelectionConfigCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.LoadSelectionConfigDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.util.BoardTools;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadSelectionConfigCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate: LoadSelectionConfigDelegate = new LoadSelectionConfigDelegate(this);
+			model.config.selectionConfigLoaded = false;
+			delegate.loadSelectionConfig(model.logArea);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+			BoardTools.applySelectionLists(model.config, xml);
+			model.config.selectionConfigLoaded = true;
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error loading selection configuration for display board: " + super.getFaultMessage(faultEvent);
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/MatchPersonCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/MatchPersonCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/MatchPersonCommand.as	(revision 1227)
@@ -0,0 +1,44 @@
+/* MatchPersonCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.MatchPersonDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.control.config.MatchPersonEvent;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class MatchPersonCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var e: MatchPersonEvent = MatchPersonEvent(event);
+
+			model.config.srcStaffReady = false;
+			model.config.srcStaff = null;
+
+			var delegate: MatchPersonDelegate = new MatchPersonDelegate(this);
+			delegate.matchPersons(e.partial, e.personType);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;
+			model.config.srcStaff = TrackingFactory.buildStaffListFromXML(xml.staff);
+			model.config.srcStaffReady = true;
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error matching persons: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveBedConfigCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveBedConfigCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveBedConfigCommand.as	(revision 1227)
@@ -0,0 +1,96 @@
+/* SaveBedConfigCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.SaveBedConfigDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.factory.SessionFactory;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.vo.RoomBedVO;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.collections.ArrayCollection;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class SaveBedConfigCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent): void
+		{
+			// clear filter so we don't miss any changes that might be hidden
+			var bedFilter: Function = model.config.beds.filterFunction;
+			if (bedFilter != null) {
+				model.config.beds.filterFunction = null;
+				model.config.beds.refresh();
+			}
+			
+			// set the sequence based on the visible order in the datagrid	
+			var i: int;
+			var seq: int;
+			var bed: RoomBedVO;
+			for (i=0; i<model.config.beds.length; i++) {
+				seq = (i+1)*10;
+				bed = model.config.beds[i] as RoomBedVO;
+				if (bed.sequence != seq) {
+					bed.sequence = seq;
+					bed.changed = true;
+				}
+			}
+			
+			// create a collection of the changed entries
+			var saveBeds: ArrayCollection = new ArrayCollection();
+			for (i=0; i<model.config.beds.length; i++) {
+				bed = model.config.beds[i] as RoomBedVO;
+				if (bed.changed) {
+					saveBeds.addItem(bed);
+				}
+			}
+			
+			// reset filter to previous setting now that beds have been saved
+			if (bedFilter != null) {
+				model.config.beds.filterFunction = bedFilter;
+				model.config.beds.refresh();
+			}
+			
+			// now save the changed entries
+			model.config.bedLoaded = false;
+			var delegate: SaveBedConfigDelegate = new SaveBedConfigDelegate(this);
+			delegate.saveBedConfig(saveBeds, model.logArea, model.config.bedToken);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			if ((xml.save.@status == "ok") || (xml.save.@status == "collide")) {
+				model.config.beds = 
+					TrackingFactory.buildRoomBedListFromXML(xml.beds.bed);
+				model.config.defaultRoomList =
+					SessionFactory.buildLookupListFromXML(xml.defaultRoomList.item);
+				model.config.bedToken = xml.bedToken;
+				model.config.bedMods = false;
+				model.config.bedLoaded = true;
+				
+				if (xml.save.@status == "ok") {
+					InfoDialog.show("New room/bed configuration saved.");
+				} else {
+					InfoDialog.show("Save failed: " + xml.save);
+				}
+			}
+			
+			if (xml.save.@status == "fail") {
+				InfoDialog.show("Save failed: " + xml.save);
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error saving configuration for rooms / beds: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigBoardCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigBoardCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigBoardCommand.as	(revision 1227)
@@ -0,0 +1,84 @@
+/* SaveConfigBoardCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.SaveConfigBoardDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.control.config.BoardConfigEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.vo.ColumnSpecVO;
+	import gov.va.med.edp.widget.InfoDialog;
+	import gov.va.med.edp.util.BoardTools;
+	import gov.va.med.edp.factory.SessionFactory;
+	import gov.va.med.edp.util.Vista;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class SaveConfigBoardCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate: SaveConfigBoardDelegate = new SaveConfigBoardDelegate(this);
+			var saveEvent: BoardConfigEvent = BoardConfigEvent(event);
+			
+			var xml:XML = <spec />;
+			var row:XML = <row />;
+			row.@color = model.config.rowColorMap.id;
+			xml.appendChild(row);
+			
+			var displayProperties:XML = <displayProperties />;
+			displayProperties.@fontSize = model.config.displayBoardProperties.fontSize;
+			displayProperties.@displayWidth = model.config.displayBoardProperties.displaySize.width;
+			displayProperties.@displayHeight = model.config.displayBoardProperties.displaySize.height;
+			displayProperties.@displayLabel = model.config.displayBoardProperties.displaySize.label;
+			displayProperties.@scrollDelay = model.config.displayBoardProperties.scrollDelay;
+			displayProperties.@squish = model.config.displayBoardProperties.squish;
+			xml.appendChild(displayProperties);
+			
+			var colSpec: ColumnSpecVO;
+			for (var i:int = 0; i < model.config.columns.length; i++) {
+				colSpec = model.config.columns[i] as ColumnSpecVO;
+				var node:XML = <col />;
+				node.@att = colSpec.attribute;
+				node.@header = colSpec.header;
+				node.@color = (colSpec.colorMap != null) ? colSpec.colorMap.id : "";
+				node.@width = colSpec.width;
+				node.@label = colSpec.label;
+				xml.appendChild(node);
+			}
+			model.config.boardLoaded = false;
+			delegate.saveConfigBoard(model.logArea, saveEvent.boardID, saveEvent.boardName, model.config.boardToken, xml);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+
+			if ((xml.save.@status == "ok")|| (xml.save.@status == "collide")) {
+				BoardTools.applyBoardSpec(model.config, xml);
+				model.config.boardLoaded = true;			
+
+				if (xml.save.@status == "ok") {
+					InfoDialog.show("New board colors saved.");
+				} else {
+					InfoDialog.show("Save failed: " + xml.save);
+				}				
+			}
+
+			if (xml.save.@status == "fail") {
+				InfoDialog.show("Save failed: " + xml.save);
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error saving configuration for display board: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigColorsCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigColorsCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigColorsCommand.as	(revision 1227)
@@ -0,0 +1,71 @@
+/* SaveConfigColorsCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.SaveConfigColorsDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.vo.ColorMapVO;
+	import gov.va.med.edp.vo.ColorMatchVO;
+	import gov.va.med.edp.widget.InfoDialog;
+	import gov.va.med.edp.util.BoardTools;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class SaveConfigColorsCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate: SaveConfigColorsDelegate = new SaveConfigColorsDelegate(this);
+
+			var xml: XML = <colorSpec />;
+			for each (var map: ColorMapVO in model.config.colorMaps) {
+				var colors: XML = <colors />;
+				colors.@id = map.id;
+				colors.@type = map.type;
+				for each (var match: ColorMatchVO in map.matches) {
+					var node: XML = <map />;
+					node.@att = match.attribute;
+					node.@val = match.value;
+					node.@clr = match.color.toString();
+					colors.appendChild(node);
+				}
+				xml.appendChild(colors);
+			}
+			model.config.colorLoaded = false;
+			delegate.saveConfigColors(model.logArea, xml, model.config.colorToken);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			if ((xml.save.@status == "ok") || (xml.save.@status == "collide")) {
+				BoardTools.applyColorSpec(xml.colorSpec.colors, model.config.colorMaps);
+				model.config.colorToken = xml.colorToken;
+				model.config.colorMods = false;
+				model.config.colorLoaded = true;
+				
+				if (xml.save.@status == "ok") {
+					InfoDialog.show("New board colors saved.");
+				} else {
+					InfoDialog.show("Save failed: " + xml.save);
+				}
+			}
+			
+			if (xml.save.@status == "fail") {
+				InfoDialog.show("Save failed: " + xml.save);
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error saving configuration for colors: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigParamsCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigParamsCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigParamsCommand.as	(revision 1227)
@@ -0,0 +1,54 @@
+/* SaveConfigParamsCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.SaveConfigParamsDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class SaveConfigParamsCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate: SaveConfigParamsDelegate = new SaveConfigParamsDelegate(this);
+			model.config.paramLoaded = false;
+			delegate.saveConfigParams(model.logArea, model.config.params, model.config.paramToken);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			if ((xml.save.@status == "ok") || (xml.save.@status == "collide")) {
+				model.config.params = TrackingFactory.buildLogEditParamsFromXML(xml.params[0]);
+				model.config.paramToken = xml.paramToken;
+				model.config.paramMods = false;
+				model.config.paramLoaded = true;
+
+				if (xml.save.@status == "ok") {
+					InfoDialog.show("New parameter configuration saved.");
+				} else {
+					InfoDialog.show("Save failed: " + xml.save);
+				}
+			}
+			
+			if (xml.save.@status == "fail") {
+				InfoDialog.show("Save failed: " + xml.save);
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error saving configuration for parameters: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigStaffCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigStaffCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveConfigStaffCommand.as	(revision 1227)
@@ -0,0 +1,67 @@
+/* SaveConfigStaffCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.SaveConfigStaffDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.util.BoardTools;
+	import gov.va.med.edp.vo.StaffMemberVO;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.collections.ArrayCollection;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class SaveConfigStaffCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var updatedStaff: ArrayCollection = new ArrayCollection();
+			var staff: StaffMemberVO;
+			
+			for each (staff in model.config.providers.source) {
+				if (staff.changed || staff.colorChanged) { updatedStaff.addItem(staff); }
+			}
+			for each (staff in model.config.residents.source) {
+				if (staff.changed || staff.colorChanged) { updatedStaff.addItem(staff); }
+			}
+			for each (staff in model.config.nurses.source) {
+				if (staff.changed || staff.colorChanged) { updatedStaff.addItem(staff); }
+			}
+
+			model.config.staffConfigLoaded = false;
+			var delegate: SaveConfigStaffDelegate = new SaveConfigStaffDelegate(this);
+			delegate.saveConfigStaff(model.logArea, model.config.staffToken, updatedStaff);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			if  ((xml.save.@status == "ok") || (xml.save.@status == "collide")) {
+				BoardTools.applyStaffLists(model.config, xml);
+				model.config.staffConfigLoaded = true;
+
+				if (xml.save.@status == "ok") {
+					InfoDialog.show("New staff configuration saved.");
+				} else {
+					InfoDialog.show("Save failed: " + xml.save);
+				}
+			}
+			
+			if (xml.save.@status == "fail") {
+				InfoDialog.show("Save failed: " + xml.save);
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error saving configuration for staff: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveSelectionConfigCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveSelectionConfigCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SaveSelectionConfigCommand.as	(revision 1227)
@@ -0,0 +1,72 @@
+/* SaveSelectionConfigCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.config.SaveSelectionConfigDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.util.BoardTools;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.collections.ArrayCollection;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class SaveSelectionConfigCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent): void
+		{
+			var newStatuses: ArrayCollection;
+			var newDispositions: ArrayCollection;
+			var newDelays: ArrayCollection;
+			var newArrivals: ArrayCollection;
+						
+			if (model.config.statusesChanged) {
+				newStatuses = model.config.statuses;
+			}
+			if (model.config.dispositionsChanged) {
+				newDispositions = model.config.dispositions;
+			}
+			if (model.config.delaysChanged) {
+				newDelays = model.config.delays;
+			}
+			if (model.config.arrivalsChanged) {
+				newArrivals = model.config.arrivals;
+			}
+			
+			model.config.selectionConfigLoaded = false;
+			var delegate: SaveSelectionConfigDelegate = new SaveSelectionConfigDelegate(this);
+			delegate.saveSelectionConfig(model.logArea, model.config.selectionToken,
+				newStatuses, newDispositions, newDelays, newArrivals);
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			if ((xml.save.@status == "ok") || (xml.save.@status == "collide")) {
+				BoardTools.applySelectionLists(model.config, xml);
+				model.config.selectionConfigLoaded = true;
+				
+				if (xml.save.@status == "ok") {
+					InfoDialog.show("New selection configuration saved.");
+				} else {
+					InfoDialog.show("Save failed: " + xml.save);
+				}
+			}
+			
+			if (xml.save.@status == "fail") {
+				InfoDialog.show("Save failed: " + xml.save);
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error saving configuration for selections: " + super.getFaultMessage(faultEvent);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SetModifiedCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SetModifiedCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/SetModifiedCommand.as	(revision 1227)
@@ -0,0 +1,42 @@
+/* SetModifiedCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.config.ConfigurationEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+
+	public class SetModifiedCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var e: ConfigurationEvent = ConfigurationEvent(event);
+			if (e.type == ConfigurationEvent.EVENT_BED_MODIFIED) {
+				model.config.bedMods = true;
+			}
+			if (e.type == ConfigurationEvent.EVENT_BOARD_MODIFIED) {
+				model.config.boardMods = true;
+				trace("set modified");
+			}
+			if (e.type == ConfigurationEvent.EVENT_COLOR_MODIFIED) {
+				model.config.colorMods = true;
+			}
+			if (e.type == ConfigurationEvent.EVENT_PARAM_MODIFIED) {
+				model.config.paramMods = true;
+			}
+			if (e.type == ConfigurationEvent.EVENT_PARAM_MODIFIED_RESET) {
+				model.config.paramMods = false;  // RESET (after creation complete)
+			}
+			if (e.type == ConfigurationEvent.EVENT_SELECTION_MODIFIED) {
+				model.config.selectionMods = true;
+			}
+			if (e.type == ConfigurationEvent.EVENT_STAFF_MODIFIED) {
+				model.config.staffMods = true;
+			}
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/UpdateStaffCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/UpdateStaffCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/config/UpdateStaffCommand.as	(revision 1227)
@@ -0,0 +1,68 @@
+/* UpdateStaffCommand.as */
+	
+package gov.va.med.edp.command.config
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.control.config.UpdateStaffEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.util.AccessibilityTools;
+	import gov.va.med.edp.vo.StaffMemberVO;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	import mx.collections.ArrayCollection;
+
+    public class UpdateStaffCommand implements ICommand
+	{
+		private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var update: UpdateStaffEvent = UpdateStaffEvent(event);
+
+			if (update.type == UpdateStaffEvent.EVENT_ADD_STAFF) {
+				switch (update.staff.role) {
+					case "P":
+                        addStaff(model.config.providers, update.staff);
+                        break;
+					case "R":
+                        addStaff(model.config.residents, update.staff);
+                        break;
+					case "N":
+                        addStaff(model.config.nurses, update.staff);
+                        break;
+				}
+			} else if (update.type == UpdateStaffEvent.EVENT_REMOVE_STAFF) {
+				removeStaff(update.staff);
+			}
+		}
+
+        private function addStaff(list : ArrayCollection, staff : StaffMemberVO) : void {
+            if (contains(list, staff)) {
+                InfoDialog.show("Staff member " + staff.name + " has already been added and cannot be added again.");
+                return;
+            }
+            staff.changed = true;
+            list.addItem(staff);
+            model.config.staffMods = true;
+            
+			if (AccessibilityTools.isAccessibilityActive())InfoDialog.show("added successfully", "Message", true);            
+
+        }
+
+        private function removeStaff(staff : StaffMemberVO) : void {
+            staff.inactive = true;
+		    staff.changed = true;
+            model.config.staffMods = true;
+        }
+
+        private function contains(list : ArrayCollection, staff : StaffMemberVO) : Boolean {
+           for (var i:int = 0; i < list.length; i++) {
+               var s : StaffMemberVO = list.getItemAt(i) as StaffMemberVO;
+               if (s.duz == staff.duz) return true;
+           }
+           return false;
+        }
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/debug/DebugHTTPServiceResponder.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/debug/DebugHTTPServiceResponder.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/debug/DebugHTTPServiceResponder.as	(revision 1227)
@@ -0,0 +1,33 @@
+package gov.va.med.edp.command.debug
+{
+	import gov.va.med.edp.business.CSPService;
+	import gov.va.med.edp.factory.DebugFactory;
+	
+	import mx.rpc.IResponder;
+
+	public class DebugHTTPServiceResponder implements IResponder
+	{
+		private var resultStr:String="";
+		private var faultStr:String="";
+		private var parameters:Object;
+		private var cspService:CSPService=null;
+		
+		public function DebugHTTPServiceResponder(cspService:CSPService, parameters:Object){
+			this.cspService = cspService;
+			this.parameters = parameters;
+		}
+		
+		public function result(data:Object):void
+		{
+			resultStr = String(data.result);
+			DebugFactory.updateDebugModel(cspService, resultStr, faultStr, parameters);	
+		}
+		
+		public function fault(data:Object):void
+		{
+			faultStr = data.toString();
+			DebugFactory.updateDebugModel(cspService, resultStr, faultStr, parameters);
+		}		
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/BaseReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/BaseReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/BaseReportCommand.as	(revision 1227)
@@ -0,0 +1,38 @@
+/* LoadMissedOpReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.reports.ReportDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+
+	public class BaseReportCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		protected var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+		private static const REPORT_DT_FORMAT: String = "MM/DD/YYYY JJ:NN";
+					
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate: ReportDelegate = new ReportDelegate(this);
+			var reportEvent: ReportEvent = ReportEvent(event);
+			delegate.loadReport(reportEvent);
+			if (reportEvent.reportParams.startDate != null && reportEvent.reportParams.stopDate != null)
+			{
+				model.reports.startDate = reportEvent.reportParams.startDate;
+				model.reports.stopDate = reportEvent.reportParams.stopDate;
+			}
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error Loading Report: " + super.getFaultMessage(faultEvent);
+		}
+				
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/DownloadReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/DownloadReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/DownloadReportCommand.as	(revision 1227)
@@ -0,0 +1,65 @@
+
+package gov.va.med.edp.command.reports
+{
+	import com.adobe.cairngorm.business.ServiceLocator;
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+	import flash.events.IOErrorEvent;
+	import flash.net.FileReference;
+	import flash.net.URLRequest;
+	
+	import gov.va.med.edp.business.CSPService;
+	import gov.va.med.edp.control.reports.ReportDownloadEvent;
+	import gov.va.med.edp.util.Vista;
+	import gov.va.med.edp.widget.InfoDialog;
+	
+	public class DownloadReportCommand implements ICommand
+	{	
+		private var fr:FileReference = new FileReference();
+		
+		public function execute(event:CairngormEvent):void
+		{
+            fr.addEventListener(Event.OPEN, openHandler);
+            fr.addEventListener(IOErrorEvent.IO_ERROR, errorHandler);
+            fr.addEventListener(Event.COMPLETE, completeHandler);	
+
+			var reportEvent: ReportDownloadEvent = ReportDownloadEvent(event);
+			var service:CSPService = ServiceLocator.getInstance().getHTTPService("downloadReports") as CSPService;
+			var startFMDate:String = Vista.DatetoFM(reportEvent.reportParams.startDate);
+			var endFMDate:String = Vista.DatetoFM(reportEvent.reportParams.stopDate);
+			
+			var urlPrefix:String = "";
+			
+			if (service.callType == CSPService.SERVICE_USE_VLJ){
+				urlPrefix = service.vlj;
+			} else if (service.callType == CSPService.SERVICE_USE_CSP){
+				urlPrefix = service.csp;
+			}
+			
+			var completeUrl: String = urlPrefix + "?command=" + service.command + "&report=" + reportEvent.reportParams.reportName.toLowerCase() + 
+									"&start=" + startFMDate + "&stop=" + endFMDate + "&id=" + reportEvent.reportParams.id;
+									  
+            var request:URLRequest = new URLRequest(completeUrl);
+            var fileName:String = reportEvent.reportParams.reportName + "Report.xls";
+
+           fr.download(request, fileName);
+ 				
+		}
+
+        private function completeHandler(event:Event):void {
+			InfoDialog.show("Download Complete");
+        }
+        
+        private function errorHandler(event:Event):void {
+			InfoDialog.show("An error occured while downloading the file" + event.currentTarget.toString());
+        }
+        
+        private function openHandler(event:Event):void {
+			trace("Dialog Opened");
+        }
+
+
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadActivityReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadActivityReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadActivityReportCommand.as	(revision 1227)
@@ -0,0 +1,27 @@
+/* LoadActivityReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadActivityReportCommand extends BaseReportCommand
+	{
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			//add log enteries to model
+			model.reports.activityReport.activityLogs = ReportFactory.buildReportLogEntriesFromXML(xml.logEntries.log);
+			//add averages to model..
+			model.reports.activityReport.activityAverages = ReportFactory.buildReportAveragesFromXML(xml.averages.average);
+									
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_ACTIVITY_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadAcuityReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadAcuityReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadAcuityReportCommand.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* LoadActivityReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadAcuityReportCommand extends BaseReportCommand
+	{
+		
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			//add acuity stats to model
+			model.reports.acuityReport.acuityStats = ReportFactory.buildAcuityReportStatsFromXML(xml.statistics.row);
+			
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_ACUITY_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadBVACReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadBVACReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadBVACReportCommand.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* LoadActivityReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadBVACReportCommand extends BaseReportCommand
+	{
+		
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			//add summaryVO data to model
+			model.reports.bvacReport.bvacReportLogs = ReportFactory.buildBVACLogEntriesFromXML(xml.logEntries.log);
+			model.reports.bvacReport.bvacReportAverages = ReportFactory.buildReportAveragesFromXML(xml.averages.average);						
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_BVAC_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadDelayReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadDelayReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadDelayReportCommand.as	(revision 1227)
@@ -0,0 +1,30 @@
+/* LoadActivityReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.reports.ReportDelegate;
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadDelayReportCommand extends BaseReportCommand
+	{
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			//add delay logs to model
+			model.reports.delayReport.delayLogs = ReportFactory.buildReportLogEntriesFromXML(xml.logEntries.log);
+			
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_DELAY_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadExposureReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadExposureReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadExposureReportCommand.as	(revision 1227)
@@ -0,0 +1,54 @@
+/* LoadMissedOpReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.reports.ReportDelegate;
+	import gov.va.med.edp.command.AbstractResponderCommand;
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.IResponder;
+	import mx.rpc.events.FaultEvent;
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadExposureReportCommand extends AbstractResponderCommand implements ICommand, IResponder
+	{
+		
+		protected var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+		public function execute(event:CairngormEvent):void
+		{
+			var delegate: ReportDelegate = new ReportDelegate(this);
+			var reportEvent: ReportEvent = ReportEvent(event);
+			delegate.loadReport(reportEvent);
+			model.reports.exposureReport.id = reportEvent.reportParams.id;
+		}
+		
+		public override function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			
+			//Point to the correct factory methods to process XML..
+			model.reports.exposureReport.contagiousPtRoomList = ReportFactory.buildPatientExposureVOListFromXML(xml.patient.row);
+			model.reports.exposureReport.ptsExposedinTreatmentRoomList = ReportFactory.buildPatientExposureVOListFromXML(xml.treatmentRoom.row);
+			model.reports.exposureReport.allOtherPatientsList = ReportFactory.buildPatientExposureVOListFromXML(xml.otherPatients.row);
+			
+			model.reports.exposureReport.exposedMDsList = ReportFactory.buildEDStaffVOListFromXML(xml.onDutyStaff.doctors.md);
+			model.reports.exposureReport.exposedNursesList = ReportFactory.buildEDStaffVOListFromXML(xml.onDutyStaff.nurses.rn);
+			model.reports.exposureReport.exposedResidentsList = ReportFactory.buildEDStaffVOListFromXML(xml.onDutyStaff.residents.md);
+											
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_EXPOSURE_REPORT;
+		}
+		
+		protected override function getFaultMessage(faultEvent:FaultEvent):String {
+			return "Error Loading Report: " + super.getFaultMessage(faultEvent);
+		}		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadMissedOpReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadMissedOpReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadMissedOpReportCommand.as	(revision 1227)
@@ -0,0 +1,28 @@
+/* LoadMissedOpReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadMissedOpReportCommand extends BaseReportCommand
+	{
+		
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			//add missedOp logs to model
+			model.reports.missedOpReport.missedOpLogs = ReportFactory.buildReportLogEntriesFromXML(xml.logEntries.log);
+			//Add disposition codes data..
+			ReportFactory.buildMissedOpDispositionCodes(model.reports.missedOpReport, xml.totals);
+											
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_MISSED_OP_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadOrdersByAcuityReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadOrdersByAcuityReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadOrdersByAcuityReportCommand.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* LoadOrdersByAcuityReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadOrdersByAcuityReportCommand extends BaseReportCommand
+	{
+		
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+
+			model.reports.ordersByAcuityReport.ordersByAcuityLogs = ReportFactory.buildOrdersByAcuityLogEntriesFromXML(xml.statistics.row);
+
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_ORDERS_BY_ACUITY_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadPatientXRefReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadPatientXRefReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadPatientXRefReportCommand.as	(revision 1227)
@@ -0,0 +1,30 @@
+/* LoadActivityReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.reports.ReportDelegate;
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadPatientXRefReportCommand extends BaseReportCommand
+	{
+		
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			//add acuity stats to model
+			model.reports.patientXRefReport.patientXRefList = ReportFactory.buildPatientXRefListFromXML(xml.patients.patient);
+			
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_PATIENT_XREF_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadProviderReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadProviderReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadProviderReportCommand.as	(revision 1227)
@@ -0,0 +1,30 @@
+/* LoadProviderReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.reports.ReportDelegate;
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadProviderReportCommand extends BaseReportCommand
+	{
+		
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			//add providers to model
+			model.reports.providerReport.providerList = ReportFactory.buildProviderListFromXML(xml.providers.md);
+
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_PROVIDER_REPORT;
+		}
+
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadPtIntakeReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadPtIntakeReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadPtIntakeReportCommand.as	(revision 1227)
@@ -0,0 +1,31 @@
+/* LoadMissedOpReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import com.adobe.cairngorm.commands.ICommand;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.reports.ReportDelegate;
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import mx.rpc.IResponder;
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadPtIntakeReportCommand extends BaseReportCommand
+	{
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			trace(xml.toXMLString());
+			//Point to the correct factory methods to process XML..
+			model.reports.ptIntakeReport.ptIntakeVOList = ReportFactory.buildPtIntakeListFromXML(xml.averages.row);
+											
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_PATIENT_INTAKE_REPORT
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadShiftReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadShiftReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadShiftReportCommand.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* LoadShiftReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadShiftReportCommand extends BaseReportCommand
+	{
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			model.reports.shiftReport.shiftCategories = ReportFactory.buildShiftReportCategoriesFromXML(xml.categories.category);
+			model.reports.shiftReport.shiftReportColumns = ReportFactory.buildShiftReportColumnsFromXML(xml.columns.column);
+									
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_SHIFT_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadSummaryReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadSummaryReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadSummaryReportCommand.as	(revision 1227)
@@ -0,0 +1,28 @@
+/* LoadActivityReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadSummaryReportCommand extends BaseReportCommand
+	{
+		
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			//add summaryVO data to model
+			model.reports.summaryReport.summaryVO = ReportFactory.buildSummaryVOFromXML(xml.averages.average);
+			//add delay chart data to model..
+			model.reports.summaryReport.delayLogs = ReportFactory.buildSummaryDelayChartFromXML(xml.delayChart.delay);
+									
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_SUMMARY_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadVaAdmissionsReportCommand.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadVaAdmissionsReportCommand.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/command/reports/LoadVaAdmissionsReportCommand.as	(revision 1227)
@@ -0,0 +1,31 @@
+/* LoadActivityReportCommand.as */
+	
+package gov.va.med.edp.command.reports
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import gov.va.med.edp.business.reports.ReportDelegate;
+	import gov.va.med.edp.control.reports.ReportEvent;
+	import gov.va.med.edp.factory.ReportFactory;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import mx.rpc.events.ResultEvent;
+
+	public class LoadVaAdmissionsReportCommand extends BaseReportCommand
+	{
+		
+		override public function result(data:Object):void
+		{
+			var xml:XML = ResultEvent(data).result as XML;	
+			// process the xml
+			//add log enteries to model
+			model.reports.vaAdmissionsReport.admissionLogs = ReportFactory.buildReportLogEntriesFromXML(xml.logEntries.log);
+			//add averages to model..
+			model.reports.vaAdmissionsReport.admissionAverages = ReportFactory.buildReportAveragesFromXML(xml.averages.average);
+									
+			//fire the binding..
+			model.reports.reportType = "";
+			model.reports.reportType = ReportEvent.EVENT_VA_ADMISSIONS_REPORT;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/ChangeLogEntryFieldEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/ChangeLogEntryFieldEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/ChangeLogEntryFieldEvent.as	(revision 1227)
@@ -0,0 +1,29 @@
+/* ChangeLogEntryFieldEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class ChangeLogEntryFieldEvent extends CairngormEvent
+	{
+		public static const EVENT_CHANGE_LOG_ENTRY_FIELD : String = "changeLogEntryField";
+		
+		public var field: String;
+		public var clear: Boolean = false;
+		public var value: *;
+		public var label: String;
+		public var reference: String;
+			
+		public function ChangeLogEntryFieldEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ChangeLogEntryFieldEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/ClearUnsavedViewsModelEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/ClearUnsavedViewsModelEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/ClearUnsavedViewsModelEvent.as	(revision 1227)
@@ -0,0 +1,28 @@
+/* ClearUnsavedViewsModelEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class ClearUnsavedViewsModelEvent extends CairngormEvent
+	{
+		public static const EVENT_CLEAR_UNSAVED_VIEWS:String = "clearUnsavedViewsModel";
+			
+		public function ClearUnsavedViewsModelEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ClearUnsavedViewsModelEvent(type);
+		}
+
+        public static function dispatchClearUnsavedViews():void {
+            var clearUnsavedViewsEvent: ClearUnsavedViewsModelEvent = new ClearUnsavedViewsModelEvent(ClearUnsavedViewsModelEvent.EVENT_CLEAR_UNSAVED_VIEWS);
+		    clearUnsavedViewsEvent.dispatch(); 
+        }
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/DateTimeEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/DateTimeEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/DateTimeEvent.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* DateTimeEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class DateTimeEvent extends CairngormEvent
+	{
+		public static const EVENT_DATE_TIME : String = "dateTimeEvent";
+		
+		public var dateTime:Date;
+			
+		public function DateTimeEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new DateTimeEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/DisplayBoardEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/DisplayBoardEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/DisplayBoardEvent.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* DisplayBoardEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class DisplayBoardEvent extends CairngormEvent
+	{
+		public static const EVENT_INIT_DISPLAY_BOARD:String = "initDisplayBoard";
+		public static const EVENT_REFRESH_DISPLAY_BOARD:String = "refreshDisplayBoard";
+		
+		public var name: String;
+			
+		public function DisplayBoardEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new DisplayBoardEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/InitAppEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/InitAppEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/InitAppEvent.as	(revision 1227)
@@ -0,0 +1,40 @@
+/* InitAppEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class InitAppEvent extends CairngormEvent
+	{
+		public static const EVENT_INIT_APP:String = "initApp";
+		
+		public static const SERVICE_USE_VLJ: int = 0;
+		public static const SERVICE_USE_CSP: int = 1
+		public static const SERVICE_USE_MOCK: int = 2;	
+		
+		public static const SITE_ID: String = "siteId";
+		
+		public var server: String = "";
+		public var mode: int = 0;
+		public var token: String = "";
+		public var appName: String = "";
+		public var contextRoot: String = "";
+		public var protocol: String = "";
+		public var helpContextRoot: String = "";
+		public var siteId: String = "";
+		public var areaName: String = "";
+		public var timeout: Boolean = false;
+
+        public function InitAppEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new InitAppEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/InitLogAreaEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/InitLogAreaEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/InitLogAreaEvent.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* InitLogAreaEvent.as */
+
+package gov.va.med.edp.control
+{
+	import flash.events.Event;
+	import com.adobe.cairngorm.control.CairngormEvent;
+	import gov.va.med.edp.vo.LogEntryVO;
+
+	public class InitLogAreaEvent extends CairngormEvent
+	{
+		public static const EVENT_INIT_LOG_AREA:String = "initLogArea";
+		
+		public var area: int;
+		public var logEntrySave: LogEntryVO;
+		
+		public function InitLogAreaEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new InitLogAreaEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/MatchItemsEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/MatchItemsEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/MatchItemsEvent.as	(revision 1227)
@@ -0,0 +1,26 @@
+/*  MatchPatientsEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class MatchItemsEvent extends CairngormEvent
+	{
+		public static const EVENT_MATCH_DIAGNOSES:String = "matchDiagnoses";
+		public static const EVENT_MATCH_CLOSED_VISITS: String = "matchClosedVisits";
+		
+		public var partial:String = "";
+			
+		public function MatchItemsEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new MatchItemsEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/ModalDialogEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/ModalDialogEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/ModalDialogEvent.as	(revision 1227)
@@ -0,0 +1,24 @@
+package gov.va.med.edp.control
+{
+import flash.display.DisplayObject;
+import flash.events.Event;
+
+import mx.core.UIComponent;
+
+public class ModalDialogEvent extends Event
+{
+    public static const CLOSE : String = "modalDialogClose";
+    public static const OPEN : String = "modalDialogOpen";
+
+    public var dialogPanel:UIComponent;
+
+    public function ModalDialogEvent(type:String, dialogPanel:UIComponent = null) {
+        super(type, true);
+        this.dialogPanel = dialogPanel;
+    }
+
+    override public function clone():Event {
+        return new ModalDialogEvent(type, dialogPanel);
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/NumberEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/NumberEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/NumberEvent.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* NumberEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class NumberEvent extends CairngormEvent
+	{
+		public static const EVENT_CHANGE_SQUISH_FONT_SIZE: String = "changeSquishFontSize";
+		
+		public var value: Number;
+			
+		public function NumberEvent(type: String, bubbles: Boolean=true, cancelable: Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new NumberEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/PatientSelectEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/PatientSelectEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/PatientSelectEvent.as	(revision 1227)
@@ -0,0 +1,27 @@
+/* ChangePatientEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+	
+	import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+
+	public class PatientSelectEvent extends CairngormEvent
+	{
+		public static const EVENT_ADD_PATIENT_TO_LOG:String = "addPatientToLog";
+		
+		public var newPatient: PatientSelectVO;
+			
+		public function PatientSelectEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new PatientSelectEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/RemoveLogEntryEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/RemoveLogEntryEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/RemoveLogEntryEvent.as	(revision 1227)
@@ -0,0 +1,22 @@
+/* RemoveLogEntryEvent.as */
+
+package gov.va.med.edp.control
+{
+	import flash.events.Event;
+	import com.adobe.cairngorm.control.CairngormEvent;
+
+	public class RemoveLogEntryEvent extends CairngormEvent
+	{
+		public static const EVENT_REMOVE_LOG_ENTRY: String = "removeLogEntry";
+		
+		public function RemoveLogEntryEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new RemoveLogEntryEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/SortHeaderEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/SortHeaderEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/SortHeaderEvent.as	(revision 1227)
@@ -0,0 +1,27 @@
+/* SortHeaderEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class SortHeaderEvent extends CairngormEvent
+	{
+		public static const EVENT_SORT_LOG_SELECTOR : String = "sortLogSelector";
+		public static const EVENT_SORT_DISPLAY_BOARD : String = "sortDisplayBoard";
+		
+		public var sortField: String;
+		public var sortDescending: Boolean;
+			
+		public function SortHeaderEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new SortHeaderEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/SwitchAppViewEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/SwitchAppViewEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/SwitchAppViewEvent.as	(revision 1227)
@@ -0,0 +1,32 @@
+/*  SwitchAppViewEvent.as */
+
+/* need to implement this later as a possible way to control initialization */
+
+package gov.va.med.edp.control
+{
+	import flash.events.Event;
+	import com.adobe.cairngorm.control.CairngormEvent;
+
+	public class SwitchAppViewEvent extends CairngormEvent
+	{
+		public static const EVENT_SWITCH_APP_VIEW:String = "switchAppView";
+		
+		public var view: int = 0;
+			
+		public function SwitchAppViewEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new SwitchAppViewEvent(type);
+		}
+
+        public static function dispatchSwitchAppView(view:int):void {
+           var e:SwitchAppViewEvent = new SwitchAppViewEvent(EVENT_SWITCH_APP_VIEW);
+           e.view = view;
+           e.dispatch();
+        }
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/SwitchLogEntryEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/SwitchLogEntryEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/SwitchLogEntryEvent.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* SwitchLogEntryEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class SwitchLogEntryEvent extends CairngormEvent
+	{
+		public static const EVENT_SWITCH_LOG_ENTRY:String = "switchLogEntry";
+		
+		public var logID: Number;
+		public var selectedIndex: int;
+			
+		public function SwitchLogEntryEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new SwitchLogEntryEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/TrackingController.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/TrackingController.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/TrackingController.as	(revision 1227)
@@ -0,0 +1,92 @@
+/* TrackingController.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.FrontController;
+	
+	import gov.va.med.edp.command.*;
+	import gov.va.med.edp.command.config.*;
+	import gov.va.med.edp.command.reports.*;
+	import gov.va.med.edp.control.config.*;
+	import gov.va.med.edp.control.reports.ReportDownloadEvent;
+	import gov.va.med.edp.control.reports.ReportEvent;
+
+	public class TrackingController extends FrontController
+	{
+		public function TrackingController()
+		{
+			initializeCommands();
+		}
+		
+		public function initializeCommands():void
+		{
+			addCommand(InitAppEvent.EVENT_INIT_APP, InitAppCommand);
+			addCommand(TrackingEvent.EVENT_INIT_TRACKING, InitTrackingCommand);
+			addCommand(SwitchAppViewEvent.EVENT_SWITCH_APP_VIEW, SwitchAppViewCommand);
+			addCommand(TrackingEvent.EVENT_REFRESH_LOG_SELECTOR, RefreshLogSelectorCommand);
+			addCommand(SwitchLogEntryEvent.EVENT_SWITCH_LOG_ENTRY, SwitchLogEntryCommand);
+			addCommand(TrackingEvent.EVENT_SAVE_LOG_ENTRY, SaveLogEntryCommand);
+			addCommand(TrackingEvent.EVENT_CANCEL_EDIT, CancelLogEntryEditCommand);
+			addCommand(TrackingEvent.EVENT_DELETE_STUB_ENTRY, DeleteStubEntryCommand);
+			addCommand(MatchItemsEvent.EVENT_MATCH_CLOSED_VISITS, MatchClosedVisitsCommand);
+			addCommand(InitLogAreaEvent.EVENT_INIT_LOG_AREA, InitLogAreaCommand);
+			addCommand(PatientSelectEvent.EVENT_ADD_PATIENT_TO_LOG, AddPatientToLogCommand);
+			addCommand(ChangeLogEntryFieldEvent.EVENT_CHANGE_LOG_ENTRY_FIELD, ChangeLogEntryFieldCommand);
+			addCommand(DisplayBoardEvent.EVENT_INIT_DISPLAY_BOARD, InitDisplayBoardCommand);
+			addCommand(DisplayBoardEvent.EVENT_REFRESH_DISPLAY_BOARD, RefreshDisplayBoardCommand);
+			addCommand(RemoveLogEntryEvent.EVENT_REMOVE_LOG_ENTRY, RemoveLogEntryCommand);
+			addCommand(SortHeaderEvent.EVENT_SORT_DISPLAY_BOARD, SortHeaderCommand);
+			addCommand(SortHeaderEvent.EVENT_SORT_LOG_SELECTOR, SortHeaderCommand);
+			addCommand(ConfigurationEvent.EVENT_LOAD_CONFIGURATION, LoadConfigurationCommand);
+			addCommand(ConfigurationEvent.EVENT_LOAD_STAFF_CONFIG, LoadConfigStaffCommand);
+			addCommand(BoardConfigEvent.EVENT_ADD_CONFIG_BOARD, AddBoardCommand);
+			addCommand(BoardConfigEvent.EVENT_LOAD_CONFIG_BOARD, LoadBoardConfigCommand);
+			addCommand(BoardConfigEvent.EVENT_SAVE_CONFIG_BOARD, SaveConfigBoardCommand);
+			addCommand(SaveBedConfigEvent.EVENT_SAVE_CONFIG_BEDS, SaveBedConfigCommand);
+			addCommand(ConfigurationEvent.EVENT_SAVE_COLOR_CONFIG, SaveConfigColorsCommand);
+			addCommand(ConfigurationEvent.EVENT_SAVE_PARAM_CONFIG, SaveConfigParamsCommand);
+			addCommand(ConfigurationEvent.EVENT_SAVE_STAFF_CONFIG, SaveConfigStaffCommand);
+			addCommand(ConfigurationEvent.EVENT_LOAD_SELECTION_CONFIG, LoadSelectionConfigCommand);
+			addCommand(ConfigurationEvent.EVENT_SAVE_SELECTION_CONFIG, SaveSelectionConfigCommand);
+			addCommand(ConfigurationEvent.EVENT_BED_MODIFIED, SetModifiedCommand);
+			addCommand(ConfigurationEvent.EVENT_BOARD_MODIFIED, SetModifiedCommand);
+			addCommand(ConfigurationEvent.EVENT_COLOR_MODIFIED, SetModifiedCommand);
+			addCommand(ConfigurationEvent.EVENT_PARAM_MODIFIED, SetModifiedCommand);
+			addCommand(ConfigurationEvent.EVENT_PARAM_MODIFIED_RESET, SetModifiedCommand);
+			addCommand(ConfigurationEvent.EVENT_SELECTION_MODIFIED, SetModifiedCommand);
+			addCommand(ConfigurationEvent.EVENT_STAFF_MODIFIED, SetModifiedCommand);
+			addCommand(ConfigAddColumnEvent.EVENT_CONFIG_ADD_COLUMN, ConfigAddColumnCommand);
+			addCommand(ConfigRemoveColumnEvent.EVENT_CONFIG_REMOVE_COLUMN, ConfigRemoveColumnCommand);
+			addCommand(ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_COLUMN_SEQ, ConfigChangeColumnCommand);
+			addCommand(ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_COLUMN_WIDTH, ConfigChangeColumnCommand);
+			addCommand(ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_ROW_COLOR, ConfigChangeColumnCommand);
+			addCommand(ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_FONT_SIZE, ConfigChangeDisplayBoardPropertiesCommand);
+			addCommand(ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_DISPLAY_WIDTH, ConfigChangeDisplayBoardPropertiesCommand);
+			addCommand(ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_SCROLL_DELAY, ConfigChangeDisplayBoardPropertiesCommand);
+			addCommand(ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_SQUISH, ConfigChangeDisplayBoardPropertiesCommand);
+			addCommand(ChangeBedSequenceEvent.EVENT_CHANGE_BED_SEQUENCE, ChangeBedSequenceCommand);
+			addCommand(NumberEvent.EVENT_CHANGE_SQUISH_FONT_SIZE, ChangeFontSizeCommand);
+			addCommand(UpdateStaffEvent.EVENT_ADD_STAFF, UpdateStaffCommand);
+			addCommand(UpdateStaffEvent.EVENT_REMOVE_STAFF, UpdateStaffCommand);
+			addCommand(MatchPersonEvent.EVENT_MATCH_PERSON, MatchPersonCommand);
+			addCommand(AddBedEvent.EVENT_ADD_BED, AddBedCommand);
+			addCommand(ChangeFieldEvent.EVENT_CHANGE_PARAM_FIELD, ChangeParamFieldCommand);
+			addCommand(ReportEvent.EVENT_ACTIVITY_REPORT, LoadActivityReportCommand);
+			addCommand(ReportEvent.EVENT_ACUITY_REPORT, LoadAcuityReportCommand);
+			addCommand(ReportEvent.EVENT_DELAY_REPORT, LoadDelayReportCommand);
+			addCommand(ReportEvent.EVENT_SUMMARY_REPORT, LoadSummaryReportCommand);
+			addCommand(ReportEvent.EVENT_MISSED_OP_REPORT, LoadMissedOpReportCommand);
+			addCommand(ReportEvent.EVENT_SHIFT_REPORT, LoadShiftReportCommand);
+			addCommand(ReportEvent.EVENT_PATIENT_XREF_REPORT, LoadPatientXRefReportCommand);
+			addCommand(ReportEvent.EVENT_VA_ADMISSIONS_REPORT, LoadVaAdmissionsReportCommand);
+			addCommand(ReportEvent.EVENT_PROVIDER_REPORT, LoadProviderReportCommand);
+			addCommand(ReportEvent.EVENT_BVAC_REPORT, LoadBVACReportCommand);
+			addCommand(ReportEvent.EVENT_ORDERS_BY_ACUITY_REPORT, LoadOrdersByAcuityReportCommand);
+			addCommand(ReportDownloadEvent.EVENT_DOWNLOAD_REPORT, DownloadReportCommand);
+			addCommand(ReportEvent.EVENT_EXPOSURE_REPORT, LoadExposureReportCommand);
+			addCommand(ReportEvent.EVENT_PATIENT_INTAKE_REPORT, LoadPtIntakeReportCommand);
+			addCommand(MatchItemsEvent.EVENT_MATCH_DIAGNOSES, MatchDiagnosesCommand);
+			addCommand(ClearUnsavedViewsModelEvent.EVENT_CLEAR_UNSAVED_VIEWS, ClearUnsavedViewsModelCommand);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/TrackingEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/TrackingEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/TrackingEvent.as	(revision 1227)
@@ -0,0 +1,27 @@
+/*  TrackingEvent.as */
+
+package gov.va.med.edp.control
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class TrackingEvent extends CairngormEvent
+	{
+		public static const EVENT_INIT_TRACKING: String = "initTracking";
+		public static const EVENT_CANCEL_EDIT: String = "cancelEdit";
+		public static const EVENT_SAVE_LOG_ENTRY: String = "saveLogEntry";
+		public static const EVENT_DELETE_STUB_ENTRY: String = "deleteStubEntry";
+		public static const EVENT_REFRESH_LOG_SELECTOR: String = "refreshLogSelector";
+		
+		public function TrackingEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new TrackingEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/AddBedEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/AddBedEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/AddBedEvent.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* AddBedEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class AddBedEvent extends CairngormEvent
+	{
+		public static const EVENT_ADD_BED: String = "addBed"
+				
+		public var newIndex: int;
+		
+		public function AddBedEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new AddBedEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/BoardConfigEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/BoardConfigEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/BoardConfigEvent.as	(revision 1227)
@@ -0,0 +1,30 @@
+/* BoardConfigEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+	
+	import mx.collections.ArrayCollection;
+
+	public class BoardConfigEvent extends CairngormEvent
+	{
+		public static const EVENT_ADD_CONFIG_BOARD: String = "addBoardConfig";
+		public static const EVENT_LOAD_CONFIG_BOARD: String = "loadBoardConfig";
+		public static const EVENT_SAVE_CONFIG_BOARD: String = "saveBoardConfig";
+		
+		public var boardID: int;
+		public var boardName: String;
+		
+		public function BoardConfigEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new BoardConfigEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ChangeBedSequenceEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ChangeBedSequenceEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ChangeBedSequenceEvent.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* ChangeBedSequenceEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class ChangeBedSequenceEvent extends CairngormEvent
+	{
+		public static const EVENT_CHANGE_BED_SEQUENCE: String = "changeBedSequence"
+				
+		public var oldIndex: int;
+		public var newIndex: int;
+		
+		public function ChangeBedSequenceEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ChangeBedSequenceEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ChangeFieldEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ChangeFieldEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ChangeFieldEvent.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* ChangeFieldEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class ChangeFieldEvent extends CairngormEvent
+	{
+		public static const EVENT_CHANGE_PARAM_FIELD : String = "changeParamField";
+		
+		public var field: String;
+		public var value: *;
+			
+		public function ChangeFieldEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ChangeFieldEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ColorChangedEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ColorChangedEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ColorChangedEvent.as	(revision 1227)
@@ -0,0 +1,20 @@
+package gov.va.med.edp.control.config
+{
+    import flash.events.Event;
+    
+    import gov.va.med.edp.vo.ColorSelectionVO;
+    
+    public class ColorChangedEvent extends Event
+    {
+        public static var COLOR_CHANGED:String = "colorChange";
+        
+        public var color:ColorSelectionVO;
+        
+        public function ColorChangedEvent(color:ColorSelectionVO)
+        {
+            // pass type and set bubbles (2nd param) to true
+            super(COLOR_CHANGED, true, true);
+            this.color = color;
+        }
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigAddColumnEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigAddColumnEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigAddColumnEvent.as	(revision 1227)
@@ -0,0 +1,23 @@
+/* ConfigAddColumnEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class ConfigAddColumnEvent extends CairngormEvent
+	{
+		public static const EVENT_CONFIG_ADD_COLUMN: String = "configAddColumn";
+		
+		public function ConfigAddColumnEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ConfigAddColumnEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigChangeColumnEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigChangeColumnEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigChangeColumnEvent.as	(revision 1227)
@@ -0,0 +1,30 @@
+/* ConfigChangeColumnEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class ConfigChangeColumnEvent extends CairngormEvent
+	{
+		public static const EVENT_CONFIG_CHANGE_COLUMN_SEQ: String = "configChangeColumnSequence";
+		public static const EVENT_CONFIG_CHANGE_COLUMN_WIDTH: String = "configChangeColumnWidth";
+		public static const EVENT_CONFIG_CHANGE_ROW_COLOR: String = "configChangeRowColor"
+				
+		public var oldIndex: int;
+		public var newIndex: int;
+		public var widths: Array = [];
+		public var rowColor: String;
+		
+		public function ConfigChangeColumnEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ConfigChangeColumnEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigChangeDisplayBoardPropertiesEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigChangeDisplayBoardPropertiesEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigChangeDisplayBoardPropertiesEvent.as	(revision 1227)
@@ -0,0 +1,35 @@
+/* ConfigChangeDisplayBoardPropertiesEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+	
+	import gov.va.med.edp.vo.DisplaySizeVO;
+
+	public class ConfigChangeDisplayBoardPropertiesEvent extends CairngormEvent
+	{
+		public static const EVENT_CONFIG_CHANGE_FONT_SIZE: String = "configChangeFontSize";
+		public static const EVENT_CONFIG_CHANGE_SQUISH_FONT_SIZE: String = "configChangeSquishFontSize";		
+		public static const EVENT_CONFIG_CHANGE_DISPLAY_WIDTH: String = "configChangeDisplayWidth";
+		public static const EVENT_CONFIG_CHANGE_SCROLL_DELAY: String = "configChangeScrollDelay"		
+		public static const EVENT_CONFIG_CHANGE_SQUISH: String = "configChangeSquish"
+				
+		public var displaySize: DisplaySizeVO;
+		public var fontSize: int;
+		public var squishFontSize: int;		
+		public var scrollDelay: int;
+		public var squish:Boolean;
+		
+		public function ConfigChangeDisplayBoardPropertiesEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ConfigChangeDisplayBoardPropertiesEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigRemoveColumnEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigRemoveColumnEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigRemoveColumnEvent.as	(revision 1227)
@@ -0,0 +1,23 @@
+/* ConfigRemoveColumnEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class ConfigRemoveColumnEvent extends CairngormEvent
+	{
+		public static const EVENT_CONFIG_REMOVE_COLUMN: String = "configRemoveColumn";
+		
+		public function ConfigRemoveColumnEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ConfigRemoveColumnEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigurationEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigurationEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/ConfigurationEvent.as	(revision 1227)
@@ -0,0 +1,37 @@
+/* ConfigurationEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class ConfigurationEvent extends CairngormEvent
+	{
+		public static const EVENT_LOAD_CONFIGURATION: String = "loadConfiguration";
+		public static const EVENT_LOAD_SELECTION_CONFIG: String = "loadSelectionConfig";
+		public static const EVENT_SAVE_SELECTION_CONFIG: String = "saveSelectionConfig";
+		public static const EVENT_SAVE_COLOR_CONFIG: String = "saveColorConfig";
+		public static const EVENT_LOAD_STAFF_CONFIG: String = "loadStaffConfig";
+		public static const EVENT_SAVE_STAFF_CONFIG: String = "saveStaffConfig";
+		public static const EVENT_SAVE_PARAM_CONFIG: String = "saveParamConfig";
+		public static const EVENT_BED_MODIFIED: String = "bedModified";
+		public static const EVENT_BOARD_MODIFIED: String = "boardModified";
+		public static const EVENT_COLOR_MODIFIED: String = "colorModified";
+		public static const EVENT_PARAM_MODIFIED: String = "paramModified";
+		public static const EVENT_PARAM_MODIFIED_RESET: String = "paramModifiedReset";
+		public static const EVENT_SELECTION_MODIFIED: String = "selectionModified";
+		public static const EVENT_STAFF_MODIFIED: String = "staffModified";
+		
+		public function ConfigurationEvent(type: String, bubbles: Boolean=true,
+			cancelable: Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ConfigurationEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/MatchPersonEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/MatchPersonEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/MatchPersonEvent.as	(revision 1227)
@@ -0,0 +1,26 @@
+/* MatchPersonEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+
+	public class MatchPersonEvent extends CairngormEvent
+	{
+		public static const EVENT_MATCH_PERSON : String = "matchPerson";
+		
+		public var partial: String;
+		public var personType: String;
+			
+		public function MatchPersonEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new MatchPersonEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/SaveBedConfigEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/SaveBedConfigEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/SaveBedConfigEvent.as	(revision 1227)
@@ -0,0 +1,22 @@
+/* SaveBedConfigEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import flash.events.Event;
+	import com.adobe.cairngorm.control.CairngormEvent;
+
+	public class SaveBedConfigEvent extends CairngormEvent
+	{
+		public static const EVENT_SAVE_CONFIG_BEDS:String = "saveConfigBeds";
+		
+		public function SaveBedConfigEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new SaveBedConfigEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/UpdateStaffEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/UpdateStaffEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/config/UpdateStaffEvent.as	(revision 1227)
@@ -0,0 +1,44 @@
+/* UpdateStaffEvent.as */
+
+package gov.va.med.edp.control.config
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+
+	import flash.events.Event;
+
+	import gov.va.med.edp.vo.StaffMemberVO;
+
+	public class UpdateStaffEvent extends CairngormEvent
+	{
+		public static const EVENT_ADD_STAFF: String = "AddStaff";
+		public static const EVENT_REMOVE_STAFF: String = "RemoveStaff";
+
+		public var staff: StaffMemberVO;
+
+		public function UpdateStaffEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+
+		override public function clone():Event
+		{
+			return new UpdateStaffEvent(type);
+		}
+
+        public static function dispatchAdd(staff : StaffMemberVO, role : String) : void {
+        	if (staff == null) return;
+            var addEvent: UpdateStaffEvent = new UpdateStaffEvent(EVENT_ADD_STAFF);
+			addEvent.staff = staff;
+			addEvent.staff.role = role;
+			addEvent.staff.changed = true;
+			addEvent.dispatch();
+        }
+
+         public static function dispatchRemove(staff : StaffMemberVO) : void {
+         	if (staff == null) return;
+            var removeEvent: UpdateStaffEvent = new UpdateStaffEvent(EVENT_REMOVE_STAFF);
+			removeEvent.staff = staff;
+			removeEvent.dispatch();
+        }
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/reports/ReportDownloadEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/reports/ReportDownloadEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/reports/ReportDownloadEvent.as	(revision 1227)
@@ -0,0 +1,41 @@
+/* LoadConfigBedsEvent.as */
+
+package gov.va.med.edp.control.reports
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+	
+	import gov.va.med.edp.vo.reports.ReportParamsVO;
+
+	public class ReportDownloadEvent extends CairngormEvent
+	{
+		public static const EVENT_DOWNLOAD_REPORT:String = "downloadReportEvent";
+		
+		public static const EVENT_ACTIVITY_REPORT:String = "Activity";
+		public static const EVENT_DELAY_REPORT:String = "_Delay";
+		public static const EVENT_SUMMARY_REPORT:String = "Summary";
+		public static const EVENT_MISSED_OP_REPORT:String = "MissedOp";
+		public static const EVENT_ACUITY_REPORT:String = "Acuity";
+		public static const EVENT_SHIFT_REPORT:String = "Shift";
+		public static const EVENT_PROVIDER_REPORT:String = "Provider";
+		public static const EVENT_EXPOSURE_REPORT:String = "Exposure";
+		public static const EVENT_PATIENT_INTAKE_REPORT:String = "Intake";
+		public static const EVENT_PATIENT_XREF_REPORT:String = "Patient";
+		public static const EVENT_VA_ADMISSIONS_REPORT:String = "Admissions";	
+		public static const EVENT_BVAC_REPORT:String = "Bvac";
+		public static const EVENT_ORDERS_BY_ACUITY_REPORT:String = "Orders";			
+	
+		public var reportParams: ReportParamsVO;
+		
+		public function ReportDownloadEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ReportDownloadEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/reports/ReportEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/reports/ReportEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/control/reports/ReportEvent.as	(revision 1227)
@@ -0,0 +1,40 @@
+/* LoadConfigBedsEvent.as */
+
+package gov.va.med.edp.control.reports
+{
+	import com.adobe.cairngorm.control.CairngormEvent;
+	
+	import flash.events.Event;
+	
+	import gov.va.med.edp.vo.reports.ReportParamsVO;
+
+	public class ReportEvent extends CairngormEvent
+	{
+		public static const EVENT_ACTIVITY_REPORT:String = "Activity";
+		public static const EVENT_DELAY_REPORT:String = "_Delay";
+		public static const EVENT_SUMMARY_REPORT:String = "Summary";
+		public static const EVENT_MISSED_OP_REPORT:String = "MissedOp";
+		public static const EVENT_ACUITY_REPORT:String = "Acuity";
+		public static const EVENT_SHIFT_REPORT:String = "Shift";
+		public static const EVENT_PROVIDER_REPORT:String = "Provider";
+		public static const EVENT_EXPOSURE_REPORT:String = "Exposure";
+		public static const EVENT_PATIENT_INTAKE_REPORT:String = "Intake";
+		public static const EVENT_PATIENT_XREF_REPORT:String = "Patient";
+		public static const EVENT_VA_ADMISSIONS_REPORT:String = "Admissions";
+		public static const EVENT_BVAC_REPORT:String = "Bvac";
+		public static const EVENT_ORDERS_BY_ACUITY_REPORT:String = "Orders";
+		public static const EVENT_NONE:String = "";
+	
+		public var reportParams: ReportParamsVO;
+		
+		public function ReportEvent(type:String, bubbles:Boolean=true, cancelable:Boolean=false)
+		{
+			super(type, bubbles, cancelable);
+		}
+		
+		override public function clone():Event
+		{
+			return new ReportEvent(type);
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/DebugFactory.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/DebugFactory.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/DebugFactory.as	(revision 1227)
@@ -0,0 +1,38 @@
+/* DebugFactory.as */
+
+package gov.va.med.edp.factory
+{
+    import gov.va.med.edp.business.CSPService;
+    import gov.va.med.edp.model.TrackingModelLocator;
+    import gov.va.med.edp.vo.DebugVO;
+    
+    import mx.collections.ArrayCollection;
+    import mx.utils.ObjectUtil;
+        
+    public class DebugFactory
+    {
+		
+    	public static function updateDebugModel(cspService:CSPService, results:String, fault:String, parameters:Object): void
+        {
+			var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+			var list:ArrayCollection = model.debug.cspServiceCallList;
+			
+			if (list != null){
+				var debugVO: DebugVO= new DebugVO()
+				debugVO.url = cspService.url;
+				debugVO.command = cspService.command;
+	
+				debugVO.parameters = ObjectUtil.toString(parameters);
+				debugVO.request = ObjectUtil.toString(cspService);
+				
+				debugVO.results = results;
+				if (fault != "" && fault != null){
+					debugVO.results = fault;
+				}
+				list.addItem(debugVO);			
+			}
+        }
+        
+    }
+    
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/ReportFactory.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/ReportFactory.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/ReportFactory.as	(revision 1227)
@@ -0,0 +1,406 @@
+/* ReportFactory.as */
+
+package gov.va.med.edp.factory
+{
+    import gov.va.med.edp.model.reports.MissedOpReport;
+    import gov.va.med.edp.util.Vista;
+    import gov.va.med.edp.vo.reports.AcuityVO;
+    import gov.va.med.edp.vo.reports.AveragesVO;
+    import gov.va.med.edp.vo.reports.BVACLogEntryVO;
+    import gov.va.med.edp.vo.reports.EdStaffVO;
+    import gov.va.med.edp.vo.reports.OrdersByAcuityVO;
+    import gov.va.med.edp.vo.reports.PatientExposureVO;
+    import gov.va.med.edp.vo.reports.PatientXRefVO;
+    import gov.va.med.edp.vo.reports.ProviderShiftVO;
+    import gov.va.med.edp.vo.reports.ProviderVO;
+    import gov.va.med.edp.vo.reports.PtIntakeVO;
+    import gov.va.med.edp.vo.reports.ReportLogEntryVO;
+    import gov.va.med.edp.vo.reports.ShiftCategoryVO;
+    import gov.va.med.edp.vo.reports.ShiftReportColumnVO;
+    import gov.va.med.edp.vo.reports.SummaryReportVO;
+    
+    import mx.collections.ArrayCollection;
+        
+    public class ReportFactory
+    {
+    	
+    	public static function buildMissedOpDispositionCodes(missedOpReport: MissedOpReport, xmlList:XMLList): void
+        {
+        	for each (var item:XML in xmlList) {
+				missedOpReport.AMA = item.@AMA;
+				missedOpReport.eloped = item.@E;
+				missedOpReport.leftWithoutTreatment = item.@L;
+        	}
+        }
+    	
+    	public static function buildSummaryVOFromXML(nodeList:XMLList): SummaryReportVO
+        {
+        	var summaryReportVO: SummaryReportVO = new SummaryReportVO();
+        	//TODO: Mel needs to Change XML Structure.
+        	//This structure doesn't fit very well..  
+        	
+        	for each (var item:XML in nodeList) {
+        		if (item.@type == "All Patients"){
+        			summaryReportVO.avgAllAdmitDecisionTime = item.@avgAdmDec;
+        			summaryReportVO.avgAllEDVisitTime = item.@avgTime;
+        			summaryReportVO.totAllEDVisits = item.@total;
+        			summaryReportVO.totAllVisitOver6Hrs = item.@num6hr;
+        			summaryReportVO.totAllVisitOver23Hrs = item.@num23hr;
+        			summaryReportVO.numAdmittedToObservation = item.@numObs;
+        		} else if (item.@type == "Not VA Admitted"){
+        			summaryReportVO.totNotVaAdmittedVisits = item.@total;
+        			summaryReportVO.avgNotVaAdmittedVisitTime = item.@avgTime;
+        		} else if (item.@type == "VA Admitted"){
+					summaryReportVO.totVaAdmittedEDVisits = item.@total;        		
+        		    summaryReportVO.totVaAdmittedDelayOver6Hrs = item.@num6hr;
+        		    summaryReportVO.avgVaAdmittedDelayTime = item.@avgAdmDel;
+        		    summaryReportVO.avgVaAdmittedDecisionTime = item.@avgAdmDec;
+        		    summaryReportVO.numVaAdmittedDelayOver6Hrs = item.@numAdmDel6hr;
+        		}
+        	}
+        	return summaryReportVO;
+        }
+        
+    	public static function buildPatientXRefListFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var patientXRefList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var patientXRefVO: PatientXRefVO = buildPatientXRefVOFromXML(item);
+        		patientXRefList.addItem(patientXRefVO);
+        	}
+        	return patientXRefList;
+        }          
+            
+        private static function buildPatientXRefVOFromXML(xml:XML): PatientXRefVO
+        {
+        	var patientXRefVO: PatientXRefVO = new PatientXRefVO();
+        	patientXRefVO.id = xml.@id;
+        	patientXRefVO.patientDfn = xml.@patientDfn;
+        	patientXRefVO.patientId = xml.@patientId;
+        	return patientXRefVO;
+        }             
+            	
+    	public static function buildShiftReportCategoriesFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var shiftCategoriesList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var shiftCategoryVO: ShiftCategoryVO = buildShiftReportCategoryFromXML(item);
+        		shiftCategoriesList.addItem(shiftCategoryVO);
+        	}
+        	return shiftCategoriesList;
+        }            	
+            	
+        private static function buildShiftReportCategoryFromXML(xml:XML): ShiftCategoryVO
+        {
+        	var shiftCategoryVO: ShiftCategoryVO = new ShiftCategoryVO();
+        	shiftCategoryVO.category = xml.@category;
+        	shiftCategoryVO.one = xml.@one;
+        	shiftCategoryVO.two = xml.@two;
+        	shiftCategoryVO.three = xml.@three;
+        	shiftCategoryVO.four = xml.@four;
+        	return shiftCategoryVO;
+        }            	
+            	
+    	public static function buildShiftReportColumnsFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var shiftReportColumnsList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var shiftReportColumnVO: ShiftReportColumnVO = buildShiftReportColumnFromXML(item);
+        		shiftReportColumnsList.addItem(shiftReportColumnVO);
+        	}
+        	return shiftReportColumnsList;
+        }              	
+            
+        private static function buildShiftReportColumnFromXML(xml:XML): ShiftReportColumnVO
+        {
+        	var shiftReportColumnVO: ShiftReportColumnVO = new ShiftReportColumnVO();
+        	shiftReportColumnVO.name = xml.@name;
+        	shiftReportColumnVO.shiftId = xml.@shiftId;
+        	return shiftReportColumnVO;
+        }            
+            	
+    	public static function buildAcuityReportStatsFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var acuityStatsList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var acuityVO: AcuityVO = buildAcuityStatFromXML(item);
+        		acuityStatsList.addItem(acuityVO);
+        	}
+        	return acuityStatsList;
+        }
+
+    	public static function buildSummaryDelayChartFromXML(nodeList:XMLList): ArrayCollection
+        {
+			return buildAcuityReportStatsFromXML(nodeList);
+        }
+
+        private static function buildAcuityStatFromXML(xml:XML): AcuityVO
+        {
+        	var acuityVO: AcuityVO = new AcuityVO();
+        	acuityVO.none = xml.@none;
+        	acuityVO.one = xml.@one;
+        	acuityVO.two = xml.@two;
+        	acuityVO.three = xml.@three;
+        	acuityVO.four= xml.@four;
+        	acuityVO.five = xml.@five;
+        	acuityVO.type = xml.@type;
+        	acuityVO.avgTotal = xml.@total;
+        	acuityVO.reason = xml.@reason;
+        	return acuityVO;
+        }        
+        
+        
+        public static function buildProviderListFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var providerList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var providerVO: ProviderVO = buildProviderVOFromXML(item);
+        		providerList.addItem(providerVO);
+        	}
+        	return providerList;
+        }
+        
+        private static function buildProviderVOFromXML(xml:XML): ProviderVO
+        {
+        	var providerVO: ProviderVO = new ProviderVO();
+        	providerVO.name = xml.@name;
+        	providerVO.total = xml.@total;
+        	providerVO.avgTimeMDAssigned = xml.@timeMD;
+        	providerVO.avgTimeToDisposition = xml.@timeDisp;
+        	providerVO.shifts = buildProviderShiftsFromXML(xml.shifts.shift);
+        	return providerVO;
+        }         
+
+        private static function buildProviderShiftsFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var providerShiftList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var providerShiftVO: ProviderShiftVO = buildProviderShiftVOFromXML(item);
+        		providerShiftList.addItem(providerShiftVO);
+        	}
+        	return providerShiftList;
+        }
+        
+        private static function buildProviderShiftVOFromXML(xml:XML): ProviderShiftVO
+        {
+        	var providerShiftVO: ProviderShiftVO = new ProviderShiftVO();
+        	providerShiftVO.number = xml.@number;
+			providerShiftVO.acuity = xml.@acuity;
+			providerShiftVO.total = xml.@total;
+			providerShiftVO.timeInToMDAssigned = xml.@timeMD;
+			providerShiftVO.timeFromMDAssignedToDisposition = xml.@timeDisp;
+        	return providerShiftVO;
+        }  
+        
+        public static function buildPatientExposureVOListFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var patientExposureVOList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var patientExposureVO: PatientExposureVO = buildPatientExposureVOFromXML(item);
+        		patientExposureVOList.addItem(patientExposureVO);
+        	}
+        	return patientExposureVOList;
+        }
+
+        private static function buildPatientExposureVOFromXML(xml:XML): PatientExposureVO
+        {
+        	var patientExposureVO: PatientExposureVO = new PatientExposureVO();
+        	patientExposureVO.id = xml.@id;
+			patientExposureVO.arrival = xml.@arrival;
+			patientExposureVO.roomName = xml.@roomName;
+			patientExposureVO.disposition = xml.@disposition;
+			patientExposureVO.dx = xml.@dx;
+			patientExposureVO.shiftIn = xml.@shiftIn;
+			patientExposureVO.timeIn = Vista.FMtoDate(xml.@inTS);
+			patientExposureVO.shiftOut = xml.@shiftOut;
+			patientExposureVO.timeOut = Vista.FMtoDate(xml.@outTS);
+			patientExposureVO.notes = xml.@notes;
+        	return patientExposureVO;
+        }       
+
+        public static function buildEDStaffVOListFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var edStaffVOList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var edStaffVO: EdStaffVO = buildEDStaffVOFromXML(item);
+        		edStaffVOList.addItem(edStaffVO);
+        	}
+        	return edStaffVOList;
+        }
+
+        private static function buildEDStaffVOFromXML(xml:XML): EdStaffVO
+        {
+        	var edStaffVO: EdStaffVO = new EdStaffVO();
+				edStaffVO.name = xml.@name;
+        	return edStaffVO;
+        } 
+
+        
+        public static function buildReportLogEntriesFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var activityLogEntryList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var reportLogEntryVO: ReportLogEntryVO = buildReportLogEntryFromXML(item);
+        		activityLogEntryList.addItem(reportLogEntryVO);
+        	}
+        	return activityLogEntryList;
+        }
+        
+        private static function buildReportLogEntryFromXML(xml:XML): ReportLogEntryVO
+        {
+        	var reportLogEntryVO: ReportLogEntryVO = new ReportLogEntryVO();
+        	reportLogEntryVO.id = xml.@id;
+        	reportLogEntryVO.acuity = xml.@acuity;
+        	reportLogEntryVO.complaint = xml.@complaint;
+        	reportLogEntryVO.disposition = xml.@disposition;
+        	//TODO; talk to Mel to see how multiple diagnoses as passed on in xml..
+        	var dx: ArrayCollection = new ArrayCollection();
+        	dx.addItem(xml.@dx);
+        	reportLogEntryVO.diagnoses = dx;
+        	reportLogEntryVO.elapsed = xml.@elapsed;
+        	reportLogEntryVO.timeIn = Vista.FMtoDate(xml.@inTS);
+        	reportLogEntryVO.timeOut = Vista.FMtoDate(xml.@outTS);
+        	reportLogEntryVO.provider = xml.@md;
+        	reportLogEntryVO.triage = xml.@triage;
+        	reportLogEntryVO.wait = xml.@wait;
+        	reportLogEntryVO.admDec = xml.@admDec;
+        	reportLogEntryVO.admDel = xml.@admDel;
+        	reportLogEntryVO.arrival = xml.@arrival;
+        	reportLogEntryVO.icd9 = xml.@icd;
+        	reportLogEntryVO.delayReason = xml.@delayReason;
+        	return reportLogEntryVO;
+        }       
+        
+        //buildOrdersByAcuityReportFromXML
+        public static function buildOrdersByAcuityLogEntriesFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var ordersByAcuityLogEntryList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var ordersByAcuityVO: OrdersByAcuityVO = buildOrdersByAcuityLogEntryFromXML(item);
+        		ordersByAcuityLogEntryList.addItem(ordersByAcuityVO);
+        	}
+        	return ordersByAcuityLogEntryList;
+        }
+        
+        private static function buildOrdersByAcuityLogEntryFromXML(xml:XML): OrdersByAcuityVO
+        {
+        	var ordersByAcuityVO: OrdersByAcuityVO = new OrdersByAcuityVO();
+        	ordersByAcuityVO.acuity = xml.@acuity;
+        	ordersByAcuityVO.meds = xml.@meds;
+        	ordersByAcuityVO.labs = xml.@labs;
+        	ordersByAcuityVO.images = xml.@images;
+        	ordersByAcuityVO.consults = xml.@consults;
+        	ordersByAcuityVO.others = xml.@other;
+
+        	return ordersByAcuityVO;
+        }          
+
+
+
+
+        
+        public static function buildBVACLogEntriesFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var bvacLogEntryList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var bvacLogEntryVO: BVACLogEntryVO = buildBVACLogEntryFromXML(item);
+        		bvacLogEntryList.addItem(bvacLogEntryVO);
+        	}
+        	return bvacLogEntryList;
+        }
+        
+        private static function buildBVACLogEntryFromXML(xml:XML): BVACLogEntryVO
+        {
+        	var bvacLogEntryVO: BVACLogEntryVO = new BVACLogEntryVO();
+        	bvacLogEntryVO.id = xml.@id;
+        	bvacLogEntryVO.acuity = xml.@acuity;
+        	bvacLogEntryVO.complaint = xml.@complaint;
+        	bvacLogEntryVO.disposition = xml.@disposition;
+        	//TODO; talk to Mel to see how multiple diagnoses as passed on in xml..
+        	var dx: ArrayCollection = new ArrayCollection();
+        	dx.addItem(xml.@dx);
+        	bvacLogEntryVO.diagnoses = dx;
+        	bvacLogEntryVO.elapsed = xml.@elapsed;
+        	bvacLogEntryVO.timeIn = Vista.FMtoDate(xml.@inTS);
+        	bvacLogEntryVO.timeOut = Vista.FMtoDate(xml.@outTS);
+        	bvacLogEntryVO.provider = xml.@md;
+        	bvacLogEntryVO.triage = xml.@triage;
+        	bvacLogEntryVO.wait = xml.@wait;
+        	bvacLogEntryVO.admDec = xml.@admDec;
+        	bvacLogEntryVO.admDel = xml.@admDel;
+        	bvacLogEntryVO.arrival = xml.@arrival;
+        	bvacLogEntryVO.icd9 = xml.@icd;
+        	bvacLogEntryVO.delayReason = xml.@delayReason;
+        	
+ 			bvacLogEntryVO.agentOrange = xml.@agentOrange;
+ 			bvacLogEntryVO.iraq = xml.@iraq;
+ 			bvacLogEntryVO.patientName = xml.@patient;
+ 			bvacLogEntryVO.persGulf = xml.@persGulf;
+ 			bvacLogEntryVO.pow = xml.@pow;
+ 			bvacLogEntryVO.purpleHeart = xml.@purpleHeart;
+ 			bvacLogEntryVO.serviceConnPct = xml.@servConnPct;
+ 			bvacLogEntryVO.unemployable = xml.@unemployable;
+ 			bvacLogEntryVO.vaPension = xml.@vaPension;
+ 			bvacLogEntryVO.vietnamVet = xml.@vietnam;
+ 			bvacLogEntryVO.combatEndDate = Vista.FMtoDate(xml.@combatEndDT);
+        	return bvacLogEntryVO;
+        }          
+        
+        
+        
+        
+        public static function buildPtIntakeListFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var ptIntakeList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var ptIntakeVO: PtIntakeVO = buildPtIntakeVOFromXML(item);
+        		ptIntakeList.addItem(ptIntakeVO);
+        	}
+        	return ptIntakeList;
+        }      
+        
+        private static function buildPtIntakeVOFromXML(xml:XML): PtIntakeVO
+        {
+        	var ptIntakeVO: PtIntakeVO = new PtIntakeVO();
+			ptIntakeVO.sun = xml.@Sunday;
+			ptIntakeVO.mon = xml.@Monday;
+			ptIntakeVO.tue = xml.@Tuesday;
+			ptIntakeVO.wed = xml.@Wednesday;
+			ptIntakeVO.thu = xml.@Thursday;
+			ptIntakeVO.fri = xml.@Friday;
+			ptIntakeVO.sat = xml.@Saturday;
+			ptIntakeVO.time = xml.@time;
+			ptIntakeVO.total = xml.@total;
+			ptIntakeVO.average = xml.@average;
+			
+        	return ptIntakeVO;
+        } 
+        
+        public static function buildReportAveragesFromXML(nodeList:XMLList): ArrayCollection
+        {
+        	var averagesList: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+        		var averagesVO: AveragesVO = buildReportAverageFromXML(item);
+        		averagesList.addItem(averagesVO);
+        	}
+        	return averagesList;
+        }
+        
+        private static function buildReportAverageFromXML(xml:XML): AveragesVO
+        {
+        	var averagesVO: AveragesVO = new AveragesVO();
+        	averagesVO.admDec = xml.@admDec;
+	       	averagesVO.admDel = xml.@admDel;
+	       	averagesVO.elapsed = xml.@elapsed;
+	       	averagesVO.total = xml.@total;
+	       	//Talk to Mel change for attribute to type instead..
+	       	averagesVO.type = xml.@type;
+	       	averagesVO.triage = xml.@triage;
+	       	averagesVO.wait = xml.@wait;
+	       	return averagesVO;
+        }  
+    }
+    
+    
+    
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/SessionFactory.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/SessionFactory.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/SessionFactory.as	(revision 1227)
@@ -0,0 +1,93 @@
+/* SessionFactory.as */
+
+package gov.va.med.edp.factory
+{
+    import gov.va.med.edp.util.Vista;
+    import gov.va.med.edp.vo.LookupStringVO;
+    import gov.va.med.edp.vo.LookupVO;
+    import gov.va.med.edp.vo.SessionVO;
+    
+    import mx.collections.ArrayCollection;
+        
+    public class SessionFactory
+    {
+        /*
+        expects XML node:
+        <anyRoot>
+            <user duz="99" site="99" siteNm="a name" area="99" areaName="a name" />
+        </anyRoot>
+        */
+        public static function buildSessionFromXML(xml:XML):SessionVO
+        {
+        	//since this is the ONLY call that does not get added to the debug tool..tracing xml here for debug mode..
+        	trace ("Session XML\n" + xml);
+            var sessionVO:SessionVO = new SessionVO();
+            sessionVO.duz = xml.user[0].@duz;
+            sessionVO.site = xml.user[0].@station;
+            sessionVO.siteName = xml.user[0].@siteNm;
+            sessionVO.area = xml.user[0].@area;
+            sessionVO.areaName = xml.user[0].@areaNm;
+            sessionVO.baseTime = new Date();
+            sessionVO.siteTimeFM = xml.user[0].@time;
+            sessionVO.siteTime = Vista.FMtoDate(sessionVO.siteTimeFM);
+
+            var timeOut:int = xml.user[0].@timeOut;
+            if (timeOut > 0) sessionVO.timeOut = timeOut;
+            var countDown:int = xml.user[0].@countDown;
+            if (countDown > 0) sessionVO.countDown = countDown;
+
+            sessionVO.canExport = (xml.user[0].@rptExport == "1")
+            sessionVO.showProviderReport = (xml.user[0].@rptProvider == "1");
+            sessionVO.showPatientCrossReferenceReport = (xml.user[0].@rptXRef == "1");
+            sessionVO.debugEnabled = (xml.user[0].@progMode == "1");
+
+            sessionVO.serverPackageVersion = xml.user[0].@version;
+
+            return sessionVO;
+        }
+        
+        /*
+        expects XML node:  <anyNode data="internalID" label="externalName" />
+        */
+        public static function buildLookupItemFromXML(xml:XML):LookupVO
+        {
+        	var lookupVO:LookupVO = new LookupVO();
+        	lookupVO.data = Number(xml.@data);
+        	lookupVO.label = xml.@label;
+        	lookupVO.abbr = xml.@abbr;
+        	return lookupVO;
+        }
+        
+        /*
+        expects xml to be: 
+        <anyRoot>
+	      	<anyNode data="internalID" label="externalName" />
+    	   	<anyNode data="internalID" label="externalName" />
+    	   	...
+    	</anyRoot>
+    	*/
+
+        public static function buildLookupListFromXML(nodeList: XMLList): ArrayCollection
+        {
+        	var lookupList:ArrayCollection = new ArrayCollection();
+        	for each (var item: XML in nodeList) {
+        		var lookupVO:LookupVO = buildLookupItemFromXML(item);
+        		lookupList.addItem(lookupVO);
+        	}
+        	return lookupList;
+        }
+        
+        public static function buildLookupStringListFromXML(nodeList: XMLList): ArrayCollection
+        {
+        	var list: ArrayCollection = new ArrayCollection();
+        	for each (var item: XML in nodeList) {
+        		var lookupStringVO: LookupStringVO = new LookupStringVO();
+        		lookupStringVO.data = item.@data;
+        		lookupStringVO.label = item.@label;
+        		lookupStringVO.reference = item.@ref;
+        		list.addItem(lookupStringVO);
+        	}
+        	return list;
+        }
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/TrackingFactory.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/TrackingFactory.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/factory/TrackingFactory.as	(revision 1227)
@@ -0,0 +1,375 @@
+package gov.va.med.edp.factory
+{
+import gov.va.med.edp.pt.demog.dao.PatientXml;
+    import gov.va.med.edp.util.BoardTools;
+    import gov.va.med.edp.util.Vista;
+    import gov.va.med.edp.vo.CodeSelectionVO;
+    import gov.va.med.edp.vo.ColorMapVO;
+    import gov.va.med.edp.vo.ColorMatchVO;
+    import gov.va.med.edp.vo.ColorSelectionVO;
+    import gov.va.med.edp.vo.ColumnSpecVO;
+    import gov.va.med.edp.vo.DisplayBoardPropertiesVO;
+    import gov.va.med.edp.vo.DisplaySizeVO;
+    import gov.va.med.edp.vo.LogEditParamsVO;
+    import gov.va.med.edp.vo.LogEntryVO;
+    import gov.va.med.edp.vo.LogSelectorVO;
+    import gov.va.med.edp.vo.NoteVO;
+    import gov.va.med.edp.vo.PCECodedValueVO;
+    import gov.va.med.edp.pt.demog.model.PatientCheckVO;
+    import gov.va.med.edp.pt.demog.model.PatientRecordFlagVO;
+    import gov.va.med.edp.vo.RoomBedVO;
+    import gov.va.med.edp.vo.StaffMemberVO;
+    import gov.va.med.edp.vo.VisitVO;
+    import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+    
+    import mx.collections.ArrayCollection;
+
+        
+    public class TrackingFactory
+    {
+    	public static function buildLogEditParamsFromXML(xml: XML): LogEditParamsVO
+    	{
+    		var logEditParamsVO: LogEditParamsVO = new LogEditParamsVO();
+    		logEditParamsVO.requireDiagnosis = (xml.@reqDiag == "1");
+    		logEditParamsVO.requireDisposition = (xml.@reqDisp == "1");
+    		logEditParamsVO.requireDelay = (xml.@reqDelay == "1");
+    		logEditParamsVO.delayMinutes = int(xml.@minDelay);
+    		logEditParamsVO.codedDiagnosis = (xml.@codedDiag == "1");
+    		logEditParamsVO.shiftStart = int(xml.@shiftOne);
+    		logEditParamsVO.shiftDuration = int(xml.@shiftLen);
+    		logEditParamsVO.promptResidents = (xml.@residents == "1");
+    		logEditParamsVO.promptClinics = (xml.@clinics == "1");
+    		logEditParamsVO.ambulanceArea = int(xml.@ambulance);
+    		logEditParamsVO.defaultRoom = int(xml.@dfltroom);
+    		logEditParamsVO.emptyValue = int(xml.@emptyIEN);
+    		logEditParamsVO.errorIEN = int(xml.@errorIEN);
+    		logEditParamsVO.nurseEvalIEN = int(xml.@evalIEN);
+    		logEditParamsVO.leftIEN = int(xml.@leftIEN);
+    		return logEditParamsVO;
+    	}
+    	
+    	public static function buildDisplayBoardPropertiesFromXML(xmlList: XMLList): DisplayBoardPropertiesVO
+    	{
+    		var displayBoardPropertiesVO: DisplayBoardPropertiesVO = new DisplayBoardPropertiesVO();
+    		for each (var xml: XML in xmlList) {
+				var displaySize:DisplaySizeVO = new DisplaySizeVO();
+				displaySize.width = xml.@displayWidth;
+				//This loop exists because M dosen't have defaults set.
+				//get these defaults set in M
+				var dispHt:int = xml.@displayHeight;
+				if (dispHt != 0){
+					displaySize.height = xml.@displayHeight;
+				} else {
+					//default it to 768
+					displaySize.height = 768;
+				}
+				
+				displaySize.label = xml.@displayLabel;
+				displaySize.data = xml.@displayLabel;
+				displayBoardPropertiesVO.displaySize = displaySize;
+				displayBoardPropertiesVO.fontSize = xml.@fontSize;
+				displayBoardPropertiesVO.squishFontSize = xml.@fontSize;
+				displayBoardPropertiesVO.scrollDelay = xml.@scrollDelay;
+				displayBoardPropertiesVO.squish = (xml.@squish == "true");
+    		}
+    		return displayBoardPropertiesVO;
+    	}
+    	    	
+        public static function buildScreenSizesFromXML(nodeList: XMLList): ArrayCollection
+        {
+        	var screenSizes:ArrayCollection = new ArrayCollection();
+        	for each (var item: XML in nodeList) {
+        		var screenSize:DisplaySizeVO = new DisplaySizeVO();
+        		screenSize.label = item.@label;
+        		screenSize.data = item.@label;
+        		screenSize.width = item.@width;
+        		screenSize.height = item.@height;
+        		screenSizes.addItem(screenSize);
+        	}
+        	return screenSizes;
+        }    	
+    	
+    	public static function buildLogEntryFromXML(xml:XML):LogEntryVO
+    	{
+    		var logEntryVO:LogEntryVO = new LogEntryVO();
+			logEntryVO.id = xml.id;
+			logEntryVO.site = xml.site;
+			logEntryVO.area = xml.area;
+			logEntryVO.dfn = xml.dfn;
+			logEntryVO.name = xml.name;
+			logEntryVO.ssn = xml.ssn;
+			logEntryVO.dob = xml.dob;
+			logEntryVO.arrival = int(xml.arrival);
+			logEntryVO.inTS = Vista.FMtoDate(xml.inTS);
+			logEntryVO.visit = int(xml.visit);
+			logEntryVO.closed = (xml.closed == "1");
+			logEntryVO.clinic = int(xml.clinic);
+			logEntryVO.complaint = xml.complaint;
+			logEntryVO.longComplaint = xml.compLong;
+			logEntryVO.status = int(xml.status);
+			logEntryVO.acuity = int(xml.acuity);
+			logEntryVO.bed = int(xml.bed);
+			logEntryVO.provider = xml.md;
+			logEntryVO.resident = xml.res;
+			logEntryVO.nurse = xml.nurse;
+			logEntryVO.comment = xml.comment;
+			logEntryVO.outTS = Vista.FMtoDate(xml.outTS);
+			logEntryVO.delay = int(xml.delay);
+			logEntryVO.disposition = int(xml.disposition);
+			logEntryVO.diagnoses = new ArrayCollection();
+			logEntryVO.patientFlags = PatientXml.buildPtRecordFlagsFromXML(xml.patientRecordFlags.flag);
+			logEntryVO.loadTS = xml.loadTS;
+
+			for each (var item: Object in xml.diagnosis) {
+				var pceItem: PCECodedValueVO = new PCECodedValueVO;
+				pceItem.type = item.@type;
+				pceItem.ien = int(item.@ien);
+				pceItem.code = item.@code;
+				pceItem.label = item.@label;
+				pceItem.primary = (item.@primary == "1");
+				pceItem.quantity = int(item.@qty);
+				logEntryVO.diagnoses.addItem(pceItem);
+			}
+			
+			var required:String = xml.required;
+			
+			logEntryVO.required = required;
+			logEntryVO.removeReady = (logEntryVO.required.length == 0);
+			
+			if (required.indexOf("diag") != -1) logEntryVO.requireDiagnosis = true;
+			if (required.indexOf("disp") != -1) logEntryVO.requireDisposition = true;
+			if (required.indexOf("delay") != -1) logEntryVO.requireDelay = true;
+			
+			return logEntryVO;
+    	}
+    	
+		/* buildLogSelectorListFromXML expects:
+        <anyRoot>
+            <anyNode id="9999" dfn="99" ptNm="XXXX" ssn="999999999" last4="X9999"
+             dob="2380106" bed="XXX" same="1" />
+             ...
+        </anyRoot> */
+        public static function buildLogSelectorListFromXML(nodeList: XMLList): Array
+        {
+        	var logSelectorVO: LogSelectorVO; 
+        	var logSelectorList: Array = [];
+        	for each (var item: XML in nodeList) {
+	        	logSelectorVO = new LogSelectorVO();
+	        	logSelectorVO.id = Number(item.@id);
+	        	logSelectorVO.name = item.@name;
+	        	logSelectorVO.ssn = item.@ssn;
+	        	logSelectorVO.last4 = item.@last4;
+	        	logSelectorVO.bed = item.@bed;
+	        	logSelectorVO.similar = (item.@same == "1") ? true : false;        		
+        		logSelectorList.push(logSelectorVO);
+        	}
+        	return logSelectorList;
+        }
+ 
+         public static function buildLookupDiagnosesListFromXML(xml:XML): ArrayCollection
+        {
+        	var codedValueVO: PCECodedValueVO;
+        	var diagnosesSelectList: ArrayCollection = new ArrayCollection();
+        	
+        	//Add support for no matches found..
+        	if (xml.children().children().length() == 0){
+        		codedValueVO = new PCECodedValueVO;
+	        	codedValueVO.code = "";
+    	    	codedValueVO.label = "No matches found.";
+        		diagnosesSelectList.addItem(codedValueVO);
+        	} else {
+        		for each (var item:XML in xml.children().children()) {
+	        		codedValueVO = new PCECodedValueVO();
+	        		var code:String = item.@code;
+	        		if (code == null || code == "")	code = item.@cpt;
+	        		codedValueVO.type = item.@type;
+	        		codedValueVO.ien = item.@ien;
+		        	codedValueVO.code = item.@code;
+	    	    	codedValueVO.label = item.@text;
+	        		diagnosesSelectList.addItem(codedValueVO);
+        		}
+        	}
+        	return diagnosesSelectList;
+        }
+ 
+        /* buildColorMapListFromXML expects:
+        <colors id="stsAcuity" nm="Status / Acuity" type="val">
+         	...
+        </colors>
+        ... */
+		public static function buildColorMapListFromXML(nodeList: XMLList): ArrayCollection
+        {
+        	var colorMap: ColorMapVO;
+        	var list: ArrayCollection = new ArrayCollection();
+        	
+        	for each (var item: XML in nodeList) {
+        		colorMap = new ColorMapVO();
+        		colorMap.id = item.@id;
+        		colorMap.name = item.@nm;
+        		colorMap.type = item.@type;
+        		colorMap.matches = buildColorMatchListFromXML(item.map);
+        		list.addItem(colorMap);
+        	}
+        	return list;
+        }
+ 
+ 		public static function buildColorSelection(c: String): ColorSelectionVO
+ 		{
+			var sel: ColorSelectionVO = new ColorSelectionVO();
+      		var x: Array = c.split(",");
+      		sel.ignore = (x[0] != "1");  // 1 means "use color"
+    		if (!sel.ignore) {
+    			sel.text = uint(x[1]);
+    			sel.back = uint(x[2]);
+    		}
+    		return sel;
+ 		}
+ 		
+		/* buildColorMatchListFromXML expects:
+        <map att="@status" clr="1,0x00ff00,0xff0000" val="10" nm="ED Patient" />
+		... */       
+        public static function buildColorMatchListFromXML(nodeList: XMLList): ArrayCollection
+        {
+        	var colorMatch: ColorMatchVO;
+        	var list: ArrayCollection = new ArrayCollection();
+
+       		for each (var item: XML in nodeList) {
+        		colorMatch = new ColorMatchVO;
+        		colorMatch.attribute = item.@att;
+        		colorMatch.name = item.@nm;
+        		colorMatch.value = item.@val;
+        		colorMatch.color = buildColorSelection(item.@clr);
+        		
+/*  			colorMatch.color = new ColorSelectionVO();
+	      		var c: String = item.@clr;
+	      		var x: Array = c.split(",");
+    	    	colorMatch.color.ignore = (x[0] != "1");  // 1 means "use color"
+        		if (!colorMatch.color.ignore) {
+        			colorMatch.color.text = uint(x[1]);
+        			colorMatch.color.back = uint(x[2]);
+        		}
+ */        		
+        		list.addItem(colorMatch);
+        	}
+			return list;
+        }
+        
+        /* buildColumnSpecListFromXML expects:
+        <col att="bed" header="Bed" color="" width="6" />
+        ... */
+		public static function buildColumnSpecListFromXML(nodeList: XMLList,
+			colorMaps: ArrayCollection): ArrayCollection
+        {
+        	var columnSpec: ColumnSpecVO;
+        	var list: ArrayCollection = new ArrayCollection();
+        	for each (var item:XML in nodeList) {
+	        	columnSpec = new ColumnSpecVO();
+	        	columnSpec.attribute = item.@att;
+	        	columnSpec.header = item.@header;
+	        	columnSpec.colorMap = BoardTools.locateColorMap(item.@color, colorMaps);
+	        	columnSpec.width = int(item.@width);
+	        	columnSpec.label = item.@label;
+	        	list.addItem(columnSpec);
+        	}
+        	return list;
+        }
+       
+        public static function buildRoomBedListFromXML(nodeList: XMLList): ArrayCollection
+        {
+        	var list: ArrayCollection = new ArrayCollection();
+        	for each (var item: XML in nodeList) {
+        		var bed: RoomBedVO = new RoomBedVO();
+        		bed.id = int(item.@id);
+        		bed.area = int(item.@area);
+        		bed.name = item.@name;
+        		bed.inactive = (item.@inactive == "1");
+				bed.sequence = int(item.@seq);
+				bed.displayName = item.@display;
+				bed.displayWhen = item.@when;
+				bed.defaultStatus = item.@status;
+				bed.category = item.@category;
+				bed.sharedName = item.@shared;
+				bed.boardName = item.@board;
+				bed.color = buildColorSelection(item.@color);
+				list.addItem(bed);		
+        	}
+        	return list;
+        }
+        
+        public static function buildCodeSelectionListFromXML(nodeList: XMLList): ArrayCollection
+        {
+        	var list: ArrayCollection = new ArrayCollection();
+        	for each (var item: XML in nodeList) {
+        		var sel: CodeSelectionVO = new CodeSelectionVO();
+        		sel.id = int(item.@id);
+        		sel.name = item.@nm;
+        		sel.displayName = item.@show;
+        		sel.abbreviation = item.@abbr;
+        		sel.flag = item.@flag;
+        		sel.inactive = (item.@inact == "1") ? true : false;
+        		sel.national = item.@natl;
+        		list.addItem(sel);
+        	}
+        	return list;
+        }
+        
+        // <staff duz="123" nm="WELBY,MARCUS" itl="MW" role="P" clr="1,0x00ff00,0xff0000" />
+        public static function buildStaffListFromXML(nodeList: XMLList): ArrayCollection
+        {
+        	var list: ArrayCollection = new ArrayCollection();
+        	for each (var item: XML in nodeList) {
+        		var person: StaffMemberVO = new StaffMemberVO();
+        		person.duz = item.@duz;
+        		person.name = item.@nm;
+        		person.initials = item.@itl;
+        		var title:String = item.@title;
+        		person.role = item.@role;
+        		if (title.length > 0){
+        		person.displayName = item.@nm + " (" + title + ")";
+        		} else {
+        		person.displayName = item.@nm;
+        		}
+        		person.color = buildColorSelection(item.@clr);
+        		list.addItem(person);
+        	}
+        	return list;
+        }
+        
+        public static function buildVisitListFromXML(nodeList: XMLList): ArrayCollection
+        {
+         	var list: ArrayCollection = new ArrayCollection();
+			if (nodeList.length() == 0) {
+				var emptyVisit: VisitVO = new VisitVO();
+    			emptyVisit.id = -1;
+    			emptyVisit.name = "No matches found.";
+				list.addItem(emptyVisit);
+				return list;
+			} else {
+        		for each (var item: XML in nodeList) {
+        			var visit: VisitVO = new VisitVO();
+        			visit.id = item.@id;
+        			visit.name = item.@name;
+        			visit.inTS = Vista.FMtoDate(item.@inTS);
+        			list.addItem(visit);
+        		}
+        		return list;
+			}       	
+        }            
+        
+        private static function buildNotesFromXML(nodeList: XMLList): ArrayCollection
+        {
+        	var list: ArrayCollection = new ArrayCollection();
+        	for each (var item: XML in nodeList) {
+        		var note: NoteVO = new NoteVO();
+        		note.action = item.@action;
+        		note.author = item.@author;
+        		note.id = item.@id;
+        		note.noteDate = Vista.FMtoDate(item.@noteTS);
+        		note.text = item.text;
+        		list.addItem(note);
+        	}
+        	return list;
+        }        
+                       
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/BigBoardDebugInfo.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/BigBoardDebugInfo.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/BigBoardDebugInfo.as	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.model
+{
+	[Bindable]
+	public class BigBoardDebugInfo
+	{
+		public var bigBoardMachineName: String = "";
+		public var bigBoardSiteCode: String = "";
+		public var vistaLinkIPAddress: String = "";
+		public var vistaLinkPort: String = "";
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/BoardSpec.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/BoardSpec.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/BoardSpec.as	(revision 1227)
@@ -0,0 +1,66 @@
+package gov.va.med.edp.model
+{
+	import gov.va.med.edp.vo.ColorMapVO;
+	import gov.va.med.edp.vo.ColorMatchVO;
+	import gov.va.med.edp.vo.ColorSelectionVO;
+	import gov.va.med.edp.vo.ColumnSpecVO;
+	import gov.va.med.edp.vo.DisplayBoardPropertiesVO;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class BoardSpec
+	{
+		public var colorMaps: ArrayCollection;		// array of ColorMapVO
+		public var columns: ArrayCollection;		// array of ColumnSpecVO
+		public var rowColorMap: ColorMapVO;
+		public var displayBoardProperties: DisplayBoardPropertiesVO;
+		public var configLastUpdated: String;
+		public var reloadConfig: Boolean = false;
+		public var specReady: Boolean = false;
+
+		public function cellColor(att: String, data: Object): ColorSelectionVO
+		{
+			var i: int;
+			var col: ColumnSpecVO;
+			var colorMap: ColorMapVO;
+			var colorMatch: ColorMatchVO;
+			var defaultColor: ColorSelectionVO = new ColorSelectionVO;
+			
+			// find the colorMap for this attribute
+			for (i = 0; i < columns.length; i++) {
+				col = columns[i];
+				if (col.attribute == att) {
+					colorMap = col.colorMap;
+					break;
+				} // if
+			} // for
+			if (colorMap == null) {
+				colorMap = rowColorMap;
+			}
+			if (colorMap == null) return defaultColor;
+			
+			if (colorMap.type == "rng") {
+				// find a color match within the range of the value
+				for (i = colorMap.matches.length - 1; i >= 0; i--) {
+					colorMatch = colorMap.matches[i];
+					if (data.hasOwnProperty(colorMatch.attribute) &&
+					   (int(data[colorMatch.attribute]) > int(colorMatch.value))) {
+					   return colorMatch.color.ignore ? defaultColor : colorMatch.color;
+					} // if				
+				}				
+			} else {
+				// find a match where the attribute is of equal value
+				for each (colorMatch in colorMap.matches) {
+					if (colorMatch.color.ignore) continue;
+					if (data.hasOwnProperty(colorMatch.attribute) &&
+					   (data[colorMatch.attribute] == colorMatch.value)) {
+					   return colorMatch.color;
+					} // if
+				} // for				
+			}
+			
+			return defaultColor;
+		} // CellColor
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/ColorSet.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/ColorSet.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/ColorSet.as	(revision 1227)
@@ -0,0 +1,14 @@
+package gov.va.med.edp.model
+{
+	public class ColorSet
+	{
+		public var text: uint;
+		public var back: uint;
+		
+		public function ColorSet(textValue: uint, backValue: uint)
+		{
+			text = textValue;
+			back = backValue;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/Config.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/Config.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/Config.as	(revision 1227)
@@ -0,0 +1,84 @@
+/* Config.as */
+
+package gov.va.med.edp.model
+{
+	import gov.va.med.edp.vo.ColorMapVO;
+	import gov.va.med.edp.vo.DisplayBoardPropertiesVO;
+	import gov.va.med.edp.vo.LogEditParamsVO;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class Config
+	{
+		// configure display board & colors
+		public var boards: ArrayCollection;				 // array of LookupVO
+		public var boardIndex: int = 0;
+
+		public var columns: ArrayCollection;             // array of ColumnSpecVO		
+		public var availableColumns: ArrayCollection;    // array of ColumnSpecVO
+
+		public var colorMaps: ArrayCollection;	         // array of ColorMap
+		public var rowColorMap: ColorMapVO;
+		public var rowColorMapIndex: int = -1;
+
+		public var displaySizes: ArrayCollection;
+		public var displayBoardProperties: DisplayBoardPropertiesVO;
+
+		// configure rooms/beds
+		public var beds: ArrayCollection;		         // array of RoomBedVO
+		public var statusList: ArrayCollection;          // array of LookupVO
+		public var whenList: ArrayCollection;			 // array of LookupVO
+		public var roomCategoryList: ArrayCollection;	 // array of LookupVO
+		
+		// configure staff
+		//public var srcProviders: ArrayCollection;		 // arrays of StaffMemberVO
+		//public var srcNurses:  ArrayCollection;
+		public var srcStaff: ArrayCollection;
+		public var srcStaffReady: Boolean = false;
+		
+		public var providers: ArrayCollection;
+		public var residents: ArrayCollection;
+		public var nurses: ArrayCollection;
+		
+		// configure selections
+		public var acuities: ArrayCollection;			// arrays of CodeSelectionVO
+		public var statuses: ArrayCollection;
+		public var arrivals: ArrayCollection;
+		public var dispositions: ArrayCollection;
+		public var delays: ArrayCollection;
+		public var acuitiesChanged: Boolean = false;	// dirty flags for each list
+		public var statusesChanged: Boolean = false;
+		public var arrivalsChanged: Boolean = false;
+		public var dispositionsChanged: Boolean = false;
+		public var delaysChanged: Boolean = false;
+		
+		// configure params
+		public var params: LogEditParamsVO = new LogEditParamsVO();
+		public var defaultRoomList: ArrayCollection;   // array of LookupVO
+		
+		// loaded flags
+		public var bedLoaded: Boolean = false;
+		public var boardLoaded: Boolean = false;
+		public var colorLoaded: Boolean = false;
+		public var paramLoaded: Boolean = false;
+		public var selectionConfigLoaded: Boolean = false;
+		public var staffConfigLoaded: Boolean = false;
+
+		// dirty flags
+		public var bedMods: Boolean = false;
+		public var boardMods: Boolean = false;
+		public var colorMods: Boolean = false;
+		public var paramMods: Boolean = false;
+		public var selectionMods: Boolean = false;
+		public var staffMods: Boolean = false;
+		
+		// locking tokens
+		public var bedToken: String = "";
+		public var boardToken: String = "";
+		public var colorToken: String = "";
+		public var paramToken: String = "";
+		public var selectionToken: String = "";
+		public var staffToken: String = "";
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/DebugModel.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/DebugModel.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/DebugModel.as	(revision 1227)
@@ -0,0 +1,17 @@
+/*DebugModel.as*/
+ 
+package gov.va.med.edp.model
+{
+	import mx.collections.ArrayCollection;
+	
+	
+	
+	[Bindable]
+	public class DebugModel
+	{
+	
+		public var cspServiceCallList: ArrayCollection = new ArrayCollection();
+
+	}
+
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/LogEdit.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/LogEdit.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/LogEdit.as	(revision 1227)
@@ -0,0 +1,128 @@
+package gov.va.med.edp.model
+{
+	import gov.va.med.edp.factory.SessionFactory;
+	import gov.va.med.edp.util.Vista;
+	import gov.va.med.edp.vo.LogEntryVO;
+	import gov.va.med.edp.vo.LookupStringVO;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class LogEdit
+	{
+		public var entry: LogEntryVO;
+		public var undo: LogEntryVO;
+		
+		public var processedSensitivePatient:Boolean = false;
+		public var patientSelected: Boolean = false;
+		public var dirty: Boolean = false;
+		public var message: String = "No visit currently selected.";
+		public var choiceTS: String = "";
+		public var removeMessage: String = "";
+		
+		public var arrivals: ArrayCollection;
+		public var clinics: ArrayCollection;
+		public var statuses: ArrayCollection;
+		public var acuities: ArrayCollection;
+		public var delays: ArrayCollection;
+		public var dispositions: ArrayCollection;
+		
+		// initialize site defined lists to empty array in case site fails to configure
+		public var beds: ArrayCollection = new ArrayCollection();
+		public var providers: ArrayCollection = new ArrayCollection();
+		public var residents: ArrayCollection = new ArrayCollection();
+		public var nurses: ArrayCollection = new ArrayCollection();
+
+		
+		public function setEntry(value: LogEntryVO): void
+		{
+			entry = value;
+			message = "";
+		}
+		
+		/* called if entry is no longer open */
+		public function resetEntry(): void
+		{
+			entry = null;
+			this.dirty = false;
+			this.message = "No visit currently selected.";
+		}
+				
+		public function setChoices(xml:XML):void
+		{
+			// make sure the choices are set up before setting the logEntry
+			choiceTS = xml.@ts;
+			
+			if (xml.hasOwnProperty("bedList")) {
+				beds = SessionFactory.buildLookupStringListFromXML(xml.bedList.bed);
+			}
+			if (xml.hasOwnProperty("mdList")) {
+				providers = SessionFactory.buildLookupStringListFromXML(xml.mdList.md);
+			}
+			if (xml.hasOwnProperty("resList")) {
+				residents = SessionFactory.buildLookupStringListFromXML(xml.resList.res);
+			}
+			if (xml.hasOwnProperty("nurseList")) {
+				nurses = SessionFactory.buildLookupStringListFromXML(xml.nurseList.nurse);
+			}
+			if (xml.hasOwnProperty("arrivalList")) {
+				arrivals = SessionFactory.buildLookupStringListFromXML(xml.arrivalList.arrival);
+			}
+			if (xml.hasOwnProperty("clinicList")) {
+				clinics = SessionFactory.buildLookupStringListFromXML(xml.clinicList.clinic);
+			}
+			if (xml.hasOwnProperty("acuityList")) {
+				acuities = SessionFactory.buildLookupStringListFromXML(xml.acuityList.acuity);
+			}
+			if (xml.hasOwnProperty("statusList")) {
+				statuses = SessionFactory.buildLookupStringListFromXML(xml.statusList.status);
+			}
+			if (xml.hasOwnProperty("delayList")) {
+				delays = SessionFactory.buildLookupStringListFromXML(xml.delayList.delay);
+			}
+			if (xml.hasOwnProperty("dispositionList")) {
+				dispositions = SessionFactory.buildLookupStringListFromXML(xml.dispositionList.disposition);
+			}
+			
+			// add selections to the comboboxes for the persons in the current record, if necessary
+			insertValues(providers, xml.persons.provider[0]);
+			insertValues(nurses, xml.persons.nurse[0]);
+			insertValues(residents, xml.persons.resident[0]);
+			insertValues(arrivals, xml.selected.arrival[0]);
+			insertValues(clinics, xml.clinics.clinic[0]);
+			insertValues(statuses, xml.selected.status[0]);
+			insertValues(delays, xml.selected.delay[0]);
+			insertValues(dispositions, xml.selected.disposition[0]);
+		}
+
+		private function insertValues(collection: ArrayCollection, xml:XML): void
+		{
+			if (collection == null) return;
+			removeTransients(collection);
+			
+			if (xml == null) return;
+			if (xml.@data == "") return;
+			
+			var index:int = Vista.locateIndex(collection, xml.@data);
+			if (index < 0) {
+				var lookup: LookupStringVO = new LookupStringVO;
+				lookup.data = xml.@data;
+				lookup.label = xml.@label;
+				lookup.transient = true;
+				ArrayCollection(collection).addItemAt(lookup, collection.length);
+				// TODO:  add to the end of the list then sort the collection
+			}
+		}
+		
+		private function removeTransients(collection: ArrayCollection): void
+		{
+			for (var i: int = 0; i < collection.length; i++) {
+				var lookupItem: LookupStringVO = collection[i];
+				if (lookupItem.transient) {
+					collection.removeItemAt(i);
+				}
+			}
+		}
+
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/LogEntryList.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/LogEntryList.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/LogEntryList.as	(revision 1227)
@@ -0,0 +1,22 @@
+package gov.va.med.edp.model
+{
+	import mx.collections.ArrayCollection;
+	import gov.va.med.edp.vo.LogSelectorVO;
+	
+	[Bindable]
+	public class LogEntryList
+	{
+		public var entries: ArrayCollection;
+		public var selectedID: Number;
+		public var selectedIndex: int = -1;
+		public var sortField: String = "";
+		public var sortDescending: Boolean;
+		public var token: String;
+
+		public function resetSelection(): void
+		{
+			selectedIndex = -1;
+			selectedID = 0;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/TrackingModelLocator.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/TrackingModelLocator.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/TrackingModelLocator.as	(revision 1227)
@@ -0,0 +1,383 @@
+/* TrackingModelLocator.as */
+
+package gov.va.med.edp.model
+{
+import com.adobe.cairngorm.model.ModelLocator;
+
+import flash.events.TimerEvent;
+import flash.net.URLRequest;
+import flash.net.navigateToURL;
+import flash.utils.Timer;
+
+import gov.va.med.edp.model.reports.ReportsModel;
+import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+import gov.va.med.edp.vo.LogEditParamsVO;
+import gov.va.med.edp.vo.LogSelectorVO;
+import gov.va.med.edp.vo.SessionVO;
+import gov.va.med.edp.vo.VisitVO;
+
+import mx.collections.ArrayCollection;
+import mx.collections.XMLListCollection;
+import mx.rpc.Fault;
+
+
+[Bindable]
+public class TrackingModelLocator implements ModelLocator
+{
+	// Possible view states for the application
+	public static const VIEW_APP_INTRO: int = 0;
+	public static const VIEW_APP_SIGN_IN: int = 1;
+	public static const VIEW_APP_TRIAGE: int = 2;
+	public static const VIEW_APP_UPDATE: int = 3;
+	public static const VIEW_APP_DISPOSITION: int = 4;
+	public static const VIEW_APP_EDIT_CLOSED: int = 5;
+	public static const VIEW_APP_DISPLAY_BOARD: int = 6;
+	public static const VIEW_APP_ASSIGN_STAFF: int = 7;
+	public static const VIEW_APP_REPORTS: int = 8;
+	public static const VIEW_APP_CONFIGURE: int = 9;
+	public static const VIEW_APP_VERSION_INCOMPATIBILITY: int = 90;
+	public static const VIEW_APP_NO_VIEWS: int = 99;
+
+	public static const VIEW_EDIT_MESSAGE: String = "Message";
+	public static const VIEW_EDIT_SIGN_IN: String = "SignIn";
+	public static const VIEW_EDIT_TRIAGE: String = "Triage";
+	public static const VIEW_EDIT_UPDATE: String = "Update";
+	public static const VIEW_EDIT_UPDATE_NORES: String = "UpdateNoRes";
+	public static const VIEW_EDIT_DISP_DELAY: String = "DispDelay";
+	public static const VIEW_EDIT_DISP_DELAY_CODED: String = "DispDelayCoded";
+	public static const VIEW_EDIT_CLOSED: String = "EditClosed";
+	public static const VIEW_EDIT_CLOSED_CODED: String = "EditClosedCoded";
+
+	public static const APP_NAME_BIGBOARD: String = "bigboard";
+	public static const APP_NAME_TRACKING: String = "tracking";
+	
+	public var bigboardInfo: BigBoardDebugInfo;
+
+	public var appName: String = "";
+	public var appClientVersion: String = "1.0";
+	public var contextRoot: String = "";
+	public var appViewList: ArrayCollection;
+	public var appViewState: int = VIEW_APP_INTRO;
+	public var logEntryViewState: String = "";
+	public var logEntryTitle: String = "";
+
+	// Session information
+	public var session: SessionVO;
+	public var rootURL: String;
+	public var logoutURL: String;
+	public var helpContextRootURL: String;
+
+	// Reports
+	public var reports: ReportsModel = new ReportsModel();
+
+	// Debug
+	public var debug: DebugModel = new DebugModel();
+
+	// Log Editor
+	public var logArea: int;
+	public var logEntryList: LogEntryList = new LogEntryList();
+	public var logEdit: LogEdit = new LogEdit();
+	public var logEditParams: LogEditParamsVO;
+	public var matchingDiagnoses: ArrayCollection;
+	public var matchingDiagnosesLoaded: Boolean = false;
+
+	// Patient Selection
+	public var patientChecksModel:PatientChecksModel = new PatientChecksModel();
+
+	public var matchingClosedVisits: ArrayCollection;
+	public var matchingClosedVisitsIndex: int = -1;
+
+	// Display Board
+	public var boardSortField: String = "";
+	public var boardSortDescending: Boolean;
+	public var boardReady: Boolean = false;
+	public var boardData: XMLListCollection;
+	public var boardSpec: BoardSpec = new BoardSpec();
+	public var boardLastUpdated: Date;
+
+	// Configure
+	public var config: Config = new Config();
+
+	// Connectivity
+	public var reconnectFunction:Function;
+	public var disconnectionFault:Fault = null;
+	private var _disconnected: Boolean = false;
+	private var _connecting: Boolean = false;
+	private var _reconnectTimer: Timer;
+
+	public var reloadFunction:Function; // function for reloading the flash application in case of fatal error or sommat
+
+	private static const RECONNECT_SECONDS:int = 10;
+
+	//Singleton logic -----------------------------------------------------------
+
+	private static var modelLocator: TrackingModelLocator;
+
+	public static function getInstance(): TrackingModelLocator
+	{
+		if (modelLocator == null) {
+			modelLocator = new TrackingModelLocator();
+		}
+		return modelLocator;
+	}
+
+	public function TrackingModelLocator()
+	{
+		if (modelLocator != null) {
+			throw new Error("Only one TrackingModelLocator should be instantiated.");
+		}
+	}
+
+	public function isDisconnected(): Boolean {
+		return disconnected;
+	}
+
+	public function buildSiteDate(): Date
+	{
+		var now:Date = new Date();
+		return new Date(now.time - session.baseTime.time + session.siteTime.time);
+	}
+
+	public function synchToLastEntry(): void
+	{
+		for (var i:int = 0; i < logEntryList.entries.length; i++) {
+			var logSelector: LogSelectorVO = logEntryList.entries[i];
+			if (logSelector.id == logEdit.entry.id) {
+				logEntryList.selectedIndex = -1;  // force binding to fire
+				logEntryList.selectedIndex = i;
+				logEntryList.selectedID = logSelector.id;
+				return;
+			} // if
+		} // for
+	} // synchToLastEntry
+
+	public function synchToClosedEntry(): void
+	{
+		for (var i: int = 0; i < matchingClosedVisits.length; i++) {
+			var visit: VisitVO = matchingClosedVisits[i];
+			if (visit.id == logEdit.entry.id) {
+				matchingClosedVisitsIndex = -1;  // force binding to fire
+				matchingClosedVisitsIndex = i;
+				return;
+			} // if
+		} // for
+	} // synchToClosedEntry
+
+	public function appViewTitle(view: int): String
+	{
+		switch (appViewState) {
+			case VIEW_APP_SIGN_IN:
+				return "EDIS Sign In";
+			case VIEW_APP_TRIAGE:
+				return "EDIS Triage";
+			case VIEW_APP_UPDATE:
+				return "EDIS Update";
+			case VIEW_APP_DISPOSITION:
+				return "EDIS Disposition";
+			case VIEW_APP_EDIT_CLOSED:
+				return "EDIS Edit Closed Visit";
+			case VIEW_APP_DISPLAY_BOARD:
+				return "EDIS Display Board";
+			case VIEW_APP_ASSIGN_STAFF:
+				return "EDIS Staff List";
+			case VIEW_APP_REPORTS:
+				return "EDIS Reports";
+			case VIEW_APP_CONFIGURE:
+				return "EDIS Configuration";
+			case VIEW_APP_NO_VIEWS:
+				return "EDIS";
+			default:
+				return "EDIS";
+		}
+	}
+
+	public function appViewHelp(view: int): String
+	{
+		switch (appViewState) {
+			case VIEW_APP_SIGN_IN:
+				return "SignIn";
+			case VIEW_APP_TRIAGE:
+				return "Triage";
+			case VIEW_APP_UPDATE:
+				return "Update";
+			case VIEW_APP_DISPOSITION:
+				return "Disposition";
+			case VIEW_APP_EDIT_CLOSED:
+				return "EditClosedVisit";
+			case VIEW_APP_DISPLAY_BOARD:
+				return "DisplayBoard";
+			case VIEW_APP_ASSIGN_STAFF:
+				return "StaffList";
+			case VIEW_APP_REPORTS:
+				return "Reports";
+			case VIEW_APP_CONFIGURE:
+				return "Configuration";
+			case VIEW_APP_NO_VIEWS:
+				return "General";
+			default:
+				return "General";
+		}
+	}
+
+	public function setEditState(): void
+	{
+		// always start at the beginning
+		logEntryViewState = "";
+
+		if (logEdit.entry == null) {
+			logEntryViewState = VIEW_EDIT_MESSAGE;
+			return;
+		}
+
+		// convenient place to clear lookup list since this is called when entry changes
+		matchingDiagnoses = null;
+
+		switch (appViewState) {
+			case VIEW_APP_SIGN_IN:
+				logEntryViewState = VIEW_EDIT_SIGN_IN;
+				break;
+			case VIEW_APP_TRIAGE:
+				logEntryViewState = VIEW_EDIT_TRIAGE;
+				break;
+			case VIEW_APP_UPDATE:
+				logEditParams.promptResidents ?
+				logEntryViewState = VIEW_EDIT_UPDATE : logEntryViewState = VIEW_EDIT_UPDATE_NORES;
+				break;
+			case VIEW_APP_DISPOSITION:
+				logEditParams.codedDiagnosis ?
+				logEntryViewState = VIEW_EDIT_DISP_DELAY_CODED :
+				logEntryViewState = VIEW_EDIT_DISP_DELAY;
+				break;
+			case VIEW_APP_EDIT_CLOSED:
+				logEditParams.codedDiagnosis ?
+				logEntryViewState = VIEW_EDIT_CLOSED_CODED :
+				logEntryViewState = VIEW_EDIT_CLOSED;
+				break;
+			default:
+				logEntryViewState = VIEW_EDIT_MESSAGE;
+				break;
+		} // switch
+	} // setEditState
+
+	public function modifiedViews(): String
+	{
+		var x: String = "";
+		if (logEdit.dirty) {
+			var viewName: String = logEntryViewState;
+			viewName = (viewName.substr(0, 4) == "Disp") ? "Disposition" : viewName;
+			viewName = (viewName.substr(0, 4) == "Upda") ? "Update" : viewName;
+			viewName = (viewName.substr(0, 4) == "Edit") ? "Edit Closed" : viewName;
+			x += "\t" + viewName + "\n";
+		}
+		x += config.staffMods ? "\tStaff Configuration \n" : "";
+		x += config.bedMods ? "\tRoom / Area Configuration \n" : "";
+		x += config.boardMods ? "\tDisplay Board Configuration \n" : "";
+		x += config.colorMods ? "\tColor Configuration \n" : "";
+		x += config.paramMods ? "\tParameter Configuration \n" : "";
+		x += config.selectionMods ? "\tSelection List Configuration \n" : "";
+		return x;
+	}
+
+	public function entryRemoveReady(): void
+	{
+		var ready: Boolean = true;
+
+		// special dispositions that allow immediate removal
+		if ((logEdit.entry.disposition == logEditParams.errorIEN) ||
+			(logEdit.entry.disposition == logEditParams.nurseEvalIEN) ||
+			(logEdit.entry.disposition == logEditParams.leftIEN)) {
+			logEdit.entry.removeReady = true;
+			return;
+		}
+
+		if (logEdit.entry.requireDiagnosis && (logEdit.entry.diagnoses.length == 0)) {
+			ready = false;
+		}
+		if (logEdit.entry.requireDisposition &&
+			((logEdit.entry.disposition == logEditParams.emptyValue) ||
+			 (logEdit.entry.disposition < 1))) {
+			ready = false;
+		}
+		if (logEdit.entry.requireDelay &&
+			((logEdit.entry.delay == logEditParams.emptyValue) ||
+			 (logEdit.entry.delay < 1))) {
+			ready = false;
+		}
+		if (Number(logEdit.entry.provider) < 1) {
+			ready = false;
+		}
+
+		logEdit.entry.removeReady = ready;
+	}
+
+	public function logout(): void {
+		var request: URLRequest = new URLRequest(logoutURL);
+		navigateToURL(request, "_top");
+	}
+
+	public function get disconnected(): Boolean {
+		return _disconnected;
+	}
+
+	public function set disconnected(b:Boolean):void {
+		if (_disconnected && !b) {
+			stopReconnectCountdown();
+			disconnectionFault = null;
+		} else if (!_disconnected && b) {
+			startReconnectCountdown();
+		}
+		_disconnected = b;
+	}
+
+	public function get connecting(): Boolean {
+		return _connecting;
+	}
+
+	public function set connecting(b:Boolean):void {
+		_connecting = b;
+		if (disconnected) {
+			if (!_connecting) {
+				startReconnectCountdown();
+			} else {
+				stopReconnectCountdown();
+			}
+		}
+	}
+
+	[Bindable(event="reconnectSecondsChanged")]
+	public function get reconnectSeconds():int {
+		if (_reconnectTimer == null) return RECONNECT_SECONDS;
+		return _reconnectTimer.repeatCount - _reconnectTimer.currentCount;
+	}
+
+	public function attemptReconnect():void {
+		stopReconnectCountdown();
+		reconnectFunction.call(null);
+	}
+
+	private function reconnectCountDown(e:TimerEvent):void {
+		dispatchEvent(new Event("reconnectSecondsChanged"));
+	}
+
+	private function reconnectTimerComplete(e:TimerEvent):void {
+		attemptReconnect();
+	}
+
+	private function startReconnectCountdown():void {
+		if (_reconnectTimer == null) {
+			_reconnectTimer = new Timer(1000, RECONNECT_SECONDS);
+			_reconnectTimer.addEventListener(TimerEvent.TIMER, reconnectCountDown);
+			_reconnectTimer.addEventListener(TimerEvent.TIMER_COMPLETE, reconnectTimerComplete);
+		}
+		_reconnectTimer.reset();
+		_reconnectTimer.start();
+	}
+
+	private function stopReconnectCountdown():void {
+		if (_reconnectTimer != null) {
+			_reconnectTimer.reset();
+		}
+	}
+
+} // class
+} // package
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ActivityReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ActivityReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ActivityReport.as	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class ActivityReport
+	{
+		public var activityLogs: ICollectionView;
+		public var activityAverages: ICollectionView;
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/AcuityReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/AcuityReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/AcuityReport.as	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class AcuityReport
+	{
+		public var acuityStats: ICollectionView;
+
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/BVACReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/BVACReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/BVACReport.as	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class BVACReport
+	{
+		public var bvacReportLogs: ICollectionView;
+		public var bvacReportAverages: ICollectionView;
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/DelayReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/DelayReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/DelayReport.as	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class DelayReport
+	{
+		public var delayLogs: ICollectionView;
+
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ExposureReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ExposureReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ExposureReport.as	(revision 1227)
@@ -0,0 +1,17 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class ExposureReport
+	{
+		public var id:String;
+		public var contagiousPtRoomList: ICollectionView;
+		public var ptsExposedinTreatmentRoomList: ICollectionView;
+		public var allOtherPatientsList: ICollectionView;
+		public var exposedMDsList: ICollectionView;
+		public var exposedNursesList: ICollectionView;
+		public var exposedResidentsList: ICollectionView;
+		
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/MissedOpReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/MissedOpReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/MissedOpReport.as	(revision 1227)
@@ -0,0 +1,13 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class MissedOpReport
+	{
+		public var missedOpLogs: ICollectionView;
+		public var AMA: int;
+		public var eloped: int;
+		public var leftWithoutTreatment: int;
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/OrdersByAcuityReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/OrdersByAcuityReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/OrdersByAcuityReport.as	(revision 1227)
@@ -0,0 +1,10 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class OrdersByAcuityReport
+	{
+		public var ordersByAcuityLogs: ICollectionView;
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/PatientXRefReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/PatientXRefReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/PatientXRefReport.as	(revision 1227)
@@ -0,0 +1,10 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class PatientXRefReport
+	{
+		public var patientXRefList: ICollectionView;
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ProviderReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ProviderReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ProviderReport.as	(revision 1227)
@@ -0,0 +1,10 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class ProviderReport
+	{
+		public var providerList: ICollectionView;
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/PtIntakeReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/PtIntakeReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/PtIntakeReport.as	(revision 1227)
@@ -0,0 +1,10 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class PtIntakeReport
+	{
+		public var ptIntakeVOList: ICollectionView;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ReportsModel.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ReportsModel.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ReportsModel.as	(revision 1227)
@@ -0,0 +1,28 @@
+package gov.va.med.edp.model.reports
+{
+	
+	
+	[Bindable]
+	public class ReportsModel
+	{
+		public var reportType: String = "";
+		public var clearDisplayArea: Boolean = false;
+		public var startDate: Date;
+		public var stopDate: Date;
+		
+		public var activityReport: ActivityReport = new ActivityReport();
+		public var acuityReport: AcuityReport = new AcuityReport();
+		public var delayReport: DelayReport = new DelayReport();
+		public var summaryReport: SummaryReport = new SummaryReport();
+		public var shiftReport: ShiftReport = new ShiftReport();
+		public var missedOpReport: MissedOpReport = new MissedOpReport();
+		public var patientXRefReport: PatientXRefReport = new PatientXRefReport();
+		public var vaAdmissionsReport: VaAdmissionsReport = new VaAdmissionsReport();
+		public var providerReport: ProviderReport = new ProviderReport();
+		public var ptIntakeReport: PtIntakeReport = new PtIntakeReport();
+		public var exposureReport: ExposureReport = new ExposureReport();
+		public var bvacReport: BVACReport = new BVACReport();
+		public var ordersByAcuityReport: OrdersByAcuityReport = new OrdersByAcuityReport();
+	}
+
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ShiftReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ShiftReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/ShiftReport.as	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class ShiftReport
+	{
+		public var shiftReportColumns: ICollectionView;
+		public var shiftCategories: ICollectionView;
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/SummaryReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/SummaryReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/SummaryReport.as	(revision 1227)
@@ -0,0 +1,13 @@
+package gov.va.med.edp.model.reports
+{
+	import gov.va.med.edp.vo.reports.SummaryReportVO;
+	
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class SummaryReport
+	{
+		public var summaryVO: SummaryReportVO;
+		public var delayLogs: ICollectionView;
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/VaAdmissionsReport.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/VaAdmissionsReport.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/model/reports/VaAdmissionsReport.as	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.model.reports
+{
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class VaAdmissionsReport
+	{
+		public var admissionLogs: ICollectionView;
+		public var admissionAverages: ICollectionView;
+ 	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/IMatchPatientsController.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/IMatchPatientsController.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/IMatchPatientsController.as	(revision 1227)
@@ -0,0 +1,8 @@
+package gov.va.med.edp.pt.demog {
+public interface IMatchPatientsController {
+    function resetMatchingPatients():void;
+
+      function matchPatients(partial:String):void;
+    
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/IPatientChecksController.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/IPatientChecksController.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/IPatientChecksController.as	(revision 1227)
@@ -0,0 +1,15 @@
+package gov.va.med.edp.pt.demog {
+import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+public interface IPatientChecksController {
+
+    function resetPatientChecks():void;
+
+    function loadPatientChecks(pt:PatientSelectVO, forwardOnLoad:Boolean = false):void;
+
+    function logPatientAccess(pt:PatientSelectVO):void;
+
+    function backPatientCheck():void;
+
+    function forwardPatientCheck():void;
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/IPatientChecksDao.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/IPatientChecksDao.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/IPatientChecksDao.as	(revision 1227)
@@ -0,0 +1,8 @@
+package gov.va.med.edp.pt.demog {
+import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+import mx.rpc.IResponder;
+public interface IPatientChecksDao {
+    function loadPatientChecks(responder:IResponder, pt:PatientSelectVO):void;
+    function logPatientAccess(responder:IResponder, dfn:String):void;
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/CheckSensitivePtAndFlagsResponder.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/CheckSensitivePtAndFlagsResponder.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/CheckSensitivePtAndFlagsResponder.as	(revision 1227)
@@ -0,0 +1,41 @@
+package gov.va.med.edp.pt.demog.control
+{
+import gov.va.med.edp.pt.demog.IPatientChecksController;
+import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+import gov.va.med.edp.pt.demog.dao.PatientXml;
+import gov.va.med.edp.command.AbstractResponderCommand;
+import mx.rpc.IResponder;
+import mx.rpc.events.FaultEvent;
+import mx.rpc.events.ResultEvent;
+
+public class CheckSensitivePtAndFlagsResponder extends AbstractResponderCommand implements IResponder
+{
+	private var cntrl:IPatientChecksController;
+	private var model:PatientChecksModel;
+	private var checksForPt:PatientSelectVO;
+	private var forwardOnLoad:Boolean;
+
+	public function CheckSensitivePtAndFlagsResponder(cntrl:IPatientChecksController, model:PatientChecksModel, pt:PatientSelectVO, forwardOnLoad:Boolean = false):void {
+		this.cntrl = cntrl;
+		this.model = model;
+		this.checksForPt = pt;
+		this.forwardOnLoad = forwardOnLoad;
+	}
+
+	public override function result(data:Object):void
+	{
+		var xml:XML = ResultEvent(data).result as XML;
+		model.patientChecks = PatientXml.buildPtChecksFromXML(xml);
+		model.checksForPt = checksForPt;
+		model.patientChecksReady = true;
+		if (forwardOnLoad) {
+			cntrl.forwardPatientCheck();
+		}
+	}
+
+	protected override function getFaultMessage(faultEvent:FaultEvent):String {
+		return "command for patient selection checks failed: " + super.getFaultMessage(faultEvent);
+	}
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/LogSensitivePatientAccessResponder.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/LogSensitivePatientAccessResponder.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/LogSensitivePatientAccessResponder.as	(revision 1227)
@@ -0,0 +1,24 @@
+package gov.va.med.edp.pt.demog.control
+{
+import gov.va.med.edp.command.AbstractResponderCommand;
+import gov.va.med.edp.widget.InfoDialog;
+
+import mx.rpc.IResponder;
+import mx.rpc.events.FaultEvent;
+import mx.rpc.events.ResultEvent;
+
+public class LogSensitivePatientAccessResponder extends AbstractResponderCommand implements IResponder
+{
+    public override function result(data:Object):void
+    {
+        var xml:XML = ResultEvent(data).result as XML;
+        if (xml.save.@status == "fail") {
+            InfoDialog.show("Logging of Sensitive Patient to the server failed");
+        }
+    }
+
+    protected override function getFaultMessage(faultEvent:FaultEvent):String {
+        return "command for logging sensitive pt to server failed: " + super.getFaultMessage(faultEvent);
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/MatchPatientsController.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/MatchPatientsController.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/MatchPatientsController.as	(revision 1227)
@@ -0,0 +1,30 @@
+package gov.va.med.edp.pt.demog.control {
+
+import gov.va.med.edp.pt.demog.IMatchPatientsController;
+import gov.va.med.edp.business.MatchPatientsDelegate;
+import gov.va.med.edp.pt.demog.model.MatchingPatientsModel;
+
+public class MatchPatientsController implements IMatchPatientsController {
+
+    [Bindable]
+    public var model:MatchingPatientsModel;
+
+    public function resetMatchingPatients():void {
+        model.matchingPatients = null; // TODO: is this right?
+        model.matchingPatientsLoaded = false;
+        model.matchingPatientsTruncated = false;
+    }
+
+    public function matchPatients(partial:String):void {
+        model.matchingPatientsLoaded = false;
+
+        if ((partial == null) || (partial.length == 0)) {
+            model.matchingPatients = null;
+            return;
+        }
+
+        var delegate:MatchPatientsDelegate = new MatchPatientsDelegate(new MatchPatientsResponder(model));
+        delegate.matchPatients(partial);
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/MatchPatientsResponder.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/MatchPatientsResponder.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/MatchPatientsResponder.as	(revision 1227)
@@ -0,0 +1,36 @@
+/*  MatchPatientsCommand.as */
+
+package gov.va.med.edp.pt.demog.control
+{
+import gov.va.med.edp.pt.demog.model.MatchingPatientsModel;
+import gov.va.med.edp.pt.demog.dao.PatientXml;
+import gov.va.med.edp.command.AbstractResponderCommand;
+
+import mx.rpc.IResponder;
+import mx.rpc.events.FaultEvent;
+import mx.rpc.events.ResultEvent;
+
+public class MatchPatientsResponder extends AbstractResponderCommand implements IResponder
+{
+    private var model:MatchingPatientsModel;
+
+    public function MatchPatientsResponder(model:MatchingPatientsModel):void {
+        this.model = model
+    }
+
+    public override function result(data:Object):void
+    {
+        var xml:XML = ResultEvent(data).result as XML;
+        model.matchingPatients =
+        PatientXml.buildLookupPatientListFromXML(xml);
+
+        model.matchingPatientsTruncated = (xml.matchesTruncated == "true");
+        trace("trucated: ", model.matchingPatientsTruncated);
+        model.matchingPatientsLoaded = true;
+    }
+
+    protected override function getFaultMessage(faultEvent:FaultEvent):String {
+        return "Retrieve matching patients failed: " + super.getFaultMessage(faultEvent);
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/PatientChecksController.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/PatientChecksController.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/control/PatientChecksController.as	(revision 1227)
@@ -0,0 +1,43 @@
+package gov.va.med.edp.pt.demog.control {
+import gov.va.med.edp.pt.demog.IPatientChecksDao;
+import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+import gov.va.med.edp.pt.demog.IPatientChecksController;
+public class PatientChecksController implements IPatientChecksController {
+
+    [Bindable]
+    public var model:PatientChecksModel;
+
+    [Bindable]
+    public var dao:IPatientChecksDao;
+
+    public function resetPatientChecks():void {
+       model.reset();
+    }
+
+    public function loadPatientChecks(pt:PatientSelectVO, forwardOnLoad:Boolean = false):void {
+        resetPatientChecks();
+        model.checkState = PatientChecksModel.STATE_LOADING;
+        dao.loadPatientChecks(new CheckSensitivePtAndFlagsResponder(this, model, pt, forwardOnLoad), pt);
+    }
+
+    public function logPatientAccess(pt:PatientSelectVO):void {
+        logAccessForDfn(pt.dfn);
+    }
+
+    private function logAccessForDfn(dfn:String):void {
+        dao.logPatientAccess(new LogSensitivePatientAccessResponder(), dfn);
+    }
+
+    public function backPatientCheck():void {
+        model.back();
+    }
+
+    public function forwardPatientCheck():void {     
+        if (model.continueEnabled && model.checkState == PatientChecksModel.STATE_SENSITIVE && model.patientChecks.logAccess) {
+           logAccessForDfn(model.patientChecks.dfn); 
+        }
+        model.forward();
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/dao/CairngormPatientChecksDao.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/dao/CairngormPatientChecksDao.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/dao/CairngormPatientChecksDao.as	(revision 1227)
@@ -0,0 +1,22 @@
+package gov.va.med.edp.pt.demog.dao {
+import mx.rpc.IResponder;
+import gov.va.med.edp.business.LogSensitivePatientAccessDelegate;
+import gov.va.med.edp.business.CheckSensitivePtAndFlagsDelegate;
+import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+import gov.va.med.edp.pt.demog.IPatientChecksDao;
+public class CairngormPatientChecksDao implements IPatientChecksDao {
+
+    [Bindable]
+    public var logArea:int;
+
+    public function loadPatientChecks(responder:IResponder, pt:PatientSelectVO):void {
+        var delegate: CheckSensitivePtAndFlagsDelegate = new CheckSensitivePtAndFlagsDelegate(responder);
+        delegate.checkSensitivePtAndFlags(logArea, pt.dfn, pt.name);
+    }
+
+    public function logPatientAccess(responder:IResponder, dfn:String):void {
+        var delegate:LogSensitivePatientAccessDelegate = new LogSensitivePatientAccessDelegate(responder);
+        delegate.logSensitivePatientAccess(dfn);
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/dao/PatientXml.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/dao/PatientXml.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/dao/PatientXml.as	(revision 1227)
@@ -0,0 +1,83 @@
+package gov.va.med.edp.pt.demog.dao {
+import gov.va.med.edp.util.Vista;
+import gov.va.med.edp.pt.demog.model.PatientRecordFlagVO;
+import gov.va.med.edp.factory.TrackingFactory;
+import gov.va.med.edp.pt.demog.model.PatientCheckVO;
+
+import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+import mx.collections.ArrayCollection;
+
+public class PatientXml {
+    /* buildLookupPatientListFromXML expects:
+     <anyRoot>
+     <anyNode dfn="999" ptNm="XXXX" ssn="999999999" dob="mmm dd,yyyy" />
+     ...
+     </anyRoot> */
+    public static function buildLookupPatientListFromXML(xml:XML): ArrayCollection
+    {
+        var patientSelectVO: PatientSelectVO;
+        var patientSelectList: ArrayCollection = new ArrayCollection();
+        for each (var item:XML in xml.children()) {
+            patientSelectVO = new PatientSelectVO();
+            patientSelectVO.dfn = item.@dfn;
+            patientSelectVO.name = item.@name;
+            patientSelectVO.ssn = item.@ssn;
+            patientSelectVO.dob = item.@dob;
+            patientSelectList.addItem(patientSelectVO);
+        }
+        return patientSelectList;
+    }
+
+    public static function buildPtChecksFromXML(xml: XML): PatientCheckVO
+    {
+        var ptCheck: PatientCheckVO = new PatientCheckVO();
+        ptCheck.dfn = xml.checks[0].@dfn;
+        ptCheck.sensitive = (xml.checks[0].@sensitive == "1");
+        ptCheck.mayAccess = (xml.checks[0].@mayAccess == "1");
+        ptCheck.logAccess = (xml.checks[0].@logAccess == "1");
+        ptCheck.deceasedText = xml.died;
+        ptCheck.onBoardText = xml.checks[0].@onBoard;
+        ptCheck.warningText = xml.warning;
+        ptCheck.similarText = xml.warnSimilar;
+        ptCheck.similarNames = buildPatientSelectListFromXML(xml.similar);
+        ptCheck.flags = buildPtRecordFlagsFromXML(xml.patientRecordFlags.flag);
+        return ptCheck;
+    }
+
+    public static function buildPatientSelectListFromXML(nodeList: XMLList): Array
+    {
+        var ptSel: PatientSelectVO;
+        var list: Array = [];
+        for each (var item: XML in nodeList) {
+            ptSel = new PatientSelectVO();
+            ptSel.dfn = item.@dfn;
+            ptSel.name = item.@name;
+            ptSel.dob = item.@dob;
+            ptSel.ssn = item.@ssn;
+            list.push(ptSel);
+        }
+        return list;
+    }
+
+    public static function buildPtRecordFlagsFromXML(nodeList: XMLList): ArrayCollection
+    {
+        var list: ArrayCollection = new ArrayCollection();
+        for each (var item: XML in nodeList) {
+            var ptRecordFlag: PatientRecordFlagVO = new PatientRecordFlagVO();
+            ptRecordFlag.name = item.@name;
+            ptRecordFlag.type = item.@type;
+            ptRecordFlag.category = item.@category;
+            ptRecordFlag.status = item.@assignmentStatus;
+            ptRecordFlag.assignDate = Vista.FMtoDate(item.@assignTS);
+            ptRecordFlag.approved = item.@approved;
+            ptRecordFlag.nextReviewDate = Vista.FMtoDate(item.@nextReviewDT);
+            ptRecordFlag.ownerSite = item.@ownerSite;
+            ptRecordFlag.originatingSite = item.@originatingSite;
+            ptRecordFlag.text = item.text;
+            //ptRecordFlag.notes = buildNotesFromXML(item.notes.note);
+            list.addItem(ptRecordFlag);
+        }
+        return list;
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/MatchingPatientsModel.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/MatchingPatientsModel.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/MatchingPatientsModel.as	(revision 1227)
@@ -0,0 +1,9 @@
+package gov.va.med.edp.pt.demog.model {
+import mx.collections.ArrayCollection;
+[Bindable]
+public class MatchingPatientsModel {
+    public var matchingPatients: ArrayCollection;
+    public var matchingPatientsLoaded: Boolean = false;
+    public var matchingPatientsTruncated: Boolean = false;
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientCheckVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientCheckVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientCheckVO.as	(revision 1227)
@@ -0,0 +1,38 @@
+package gov.va.med.edp.pt.demog.model
+{
+import gov.va.med.edp.pt.demog.*;
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ArrayCollection;
+
+	[Bindable]
+	public class PatientCheckVO implements IValueObject
+	{
+		public var dfn: String;
+		public var sensitive: Boolean = false;  	// display sensitive warning
+		public var mayAccess: Boolean = true;		// prevent access to own record
+		public var logAccess: Boolean = false;		// must log access to patient
+		public var onBoardText: String = "";		// patient is already on the board
+		public var warningText: String = "";		// sensitive warning text to display
+		public var similarText: String = "";		// similar patient warning text
+		public var deceasedText: String = "";		// display deceased warning
+		public var similarNames: Array;				// array of PatientSelectVO
+		public var flags: ArrayCollection;			// array of PatientRecordFlagVO
+
+        public function isOnBoard():Boolean {
+            return onBoardText.length > 0;
+        }
+
+        public function hasSimilarNames():Boolean {
+            return similarNames != null && similarNames.length > 0;
+        }
+
+        public function isDeceased():Boolean {
+            return deceasedText.length > 0;
+        }
+
+        public function hasFlags():Boolean {
+            return flags != null && flags.length > 0
+        }
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientChecksModel.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientChecksModel.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientChecksModel.as	(revision 1227)
@@ -0,0 +1,92 @@
+package gov.va.med.edp.pt.demog.model {
+import gov.va.med.edp.pt.demog.model.PatientCheckVO;
+[Bindable]
+public class PatientChecksModel {
+    public static const STATE_NONE: int = 0;
+    public static const STATE_LOADING: int = 1;
+    public static const STATE_LOADED: int = 2;
+
+    public static const STATE_ONBOARD: int = 10;
+    public static const STATE_SIMILAR: int = 11;
+    public static const STATE_SENSITIVE: int = 12;
+    public static const STATE_DECEASED: int = 13;
+    public static const STATE_FLAGS: int = 14;
+
+    public static const STATE_ALLOW: int = 22;
+
+    public var checkState: int = STATE_NONE;
+
+    public var patientChecks: PatientCheckVO;
+
+	public var checksForPt:PatientSelectVO;
+
+    public var backEnabled:Boolean = false;
+
+    public var continueEnabled:Boolean = false;
+
+    private var _patientChecksReady: Boolean = false;
+
+    public function get patientChecksReady():Boolean {
+        return _patientChecksReady;
+    }
+
+    public function set patientChecksReady(b:Boolean):void {
+        this._patientChecksReady = b;
+        if (b && checkState == STATE_LOADING) {
+            checkState = STATE_LOADED;
+            continueEnabled = true;
+        }
+    }
+
+    public function reset():void {
+        patientChecks = null;
+		checksForPt = null;
+		checkState = STATE_NONE;
+        patientChecksReady = false;
+        continueEnabled = false;
+        backEnabled = false;
+    }
+
+    public function back():void {
+        if (!backEnabled) return;
+
+        if (!continueEnabled) continueEnabled = true;
+
+        if (checkState > STATE_DECEASED && patientChecks.isDeceased()) {
+            checkState = STATE_DECEASED;
+        } else if (checkState > STATE_SENSITIVE && patientChecks.sensitive) {
+            checkState = STATE_SENSITIVE;
+        } else if (checkState > STATE_SIMILAR && patientChecks.hasSimilarNames()) {
+            checkState = STATE_SIMILAR;
+        } else if (checkState > STATE_LOADED) {
+            checkState = STATE_LOADED;
+            backEnabled = false;
+        }
+    }
+
+    public function forward():void {
+        if (!continueEnabled) return;
+
+        if (!backEnabled) backEnabled = true;
+
+        if (checkState < STATE_ONBOARD && patientChecks.isOnBoard()) {
+            checkState = STATE_ONBOARD;
+            continueEnabled = false;
+        } else if (checkState < STATE_SIMILAR &&
+                   patientChecks.hasSimilarNames()) {
+            checkState = STATE_SIMILAR;
+        } else if (checkState < STATE_SENSITIVE && patientChecks.sensitive) {
+            checkState = STATE_SENSITIVE;
+            if (!patientChecks.mayAccess) continueEnabled = false;
+        } else if (checkState < STATE_DECEASED && patientChecks.isDeceased()) {
+            checkState = STATE_DECEASED;
+        } else if (checkState < STATE_FLAGS && patientChecks.hasFlags()) {
+            checkState = STATE_FLAGS;
+        } else {
+            checkState = STATE_ALLOW;
+            backEnabled = false;
+            continueEnabled = false;
+        }
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientRecordFlagVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientRecordFlagVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientRecordFlagVO.as	(revision 1227)
@@ -0,0 +1,23 @@
+package gov.va.med.edp.pt.demog.model
+{
+import gov.va.med.edp.pt.demog.*;
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ICollectionView;
+
+	[Bindable]
+	public class PatientRecordFlagVO implements IValueObject
+	{
+		public var name: String;
+		public var type: String;
+		public var category: String;
+		public var status: String;		
+		public var assignDate: Date;
+		public var approved: String;
+		public var nextReviewDate: Date;
+		public var ownerSite: String;
+		public var originatingSite: String;		
+		public var text: String;
+		//public var notes: ICollectionView;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientSelectVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientSelectVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/model/PatientSelectVO.as	(revision 1227)
@@ -0,0 +1,19 @@
+package gov.va.med.edp.pt.demog.model
+{
+import gov.va.med.edp.pt.demog.*;
+	public class PatientSelectVO
+	{
+		public var dfn: String = "";
+		public var name: String = "";
+		public var dob: String = "";
+		public var ssn: String = "";
+		
+		public function toString():String
+		{
+			return "dfn=" + dfn + "\t" +
+				"name=" + name + "\t" +
+				"dob=" + dob + "\t" +
+				"ssn=" + ssn;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/FlagsPanel.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/FlagsPanel.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/FlagsPanel.mxml	(revision 1227)
@@ -0,0 +1,97 @@
+<?xml version="1.0" ?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
+         xmlns:widget="gov.va.med.edp.widget.*"
+         xmlns:accessibility="flash.accessibility.*">
+    <mx:Script><![CDATA[
+        import mx.collections.ArrayCollection;
+        import gov.va.med.edp.pt.demog.model.PatientRecordFlagVO;
+
+        [Bindable]
+        public var baseTabIndex:int;
+
+        [Bindable]
+        public var flags:ArrayCollection;
+
+        ]]></mx:Script>
+    <mx:DataGrid
+            id="ptRecordFlagsGrid"
+            accessibilityProperties="{accessibleMessage}"
+            dataProvider="{flags}"
+            tabIndex="{baseTabIndex}"
+            rowCount="4"
+            width="100%"
+            selectedIndex="0">
+        <mx:columns>
+            <mx:DataGridColumn dataField="name" headerText="Active Flag"/>
+        </mx:columns>
+    </mx:DataGrid>
+
+    <mx:VBox id="formBox" width="100%">
+        <mx:Form id="ptRecordFlagDetailForm" borderThickness="1" borderStyle="solid" tabChildren="true" width="100%">
+            <mx:FormItem label="Flag Name">
+                <widget:AccessibleLabel text="{ptRecordFlagsGrid.selectedItem.name}"
+                                        accessibleText="{ptRecordFlagsGrid.selectedItem.name}" tabIndex="{baseTabIndex + 1}" styleName="formField"/>
+            </mx:FormItem>
+            <mx:FormItem label="Assignment Narrative" paddingRight="0">
+                <mx:TextArea id="txtAssNarrative" borderThickness="0" tabIndex="{baseTabIndex + 2}" editable="false" paddingRight="0"
+                             text="{ptRecordFlagsGrid.selectedItem.text}"
+                             toolTip="{ptRecordFlagsGrid.selectedItem.text}" styleName="formField"/>
+            </mx:FormItem>
+            <mx:FormItem label="Flag Type">
+                <widget:AccessibleLabel text="{ptRecordFlagsGrid.selectedItem.type}"
+                                        accessibleText="{ptRecordFlagsGrid.selectedItem.type}" tabIndex="{baseTabIndex + 3}" styleName="formField"/>
+            </mx:FormItem>
+            <mx:FormItem label="Flag Category">
+                <widget:AccessibleLabel text="{ptRecordFlagsGrid.selectedItem.category}"
+                                        accessibleText="{ptRecordFlagsGrid.selectedItem.category}" tabIndex="{baseTabIndex + 4}" styleName="formField"/>
+            </mx:FormItem>
+            <mx:FormItem label="Assignment Status">
+                <widget:AccessibleLabel text="Active" accessibleText="Active" tabIndex="{baseTabIndex + 5}" styleName="formField"/>
+            </mx:FormItem>
+            <mx:FormItem label="Initial Assigned Date">
+                <widget:AccessibleLabel text="{fmtDt.format(ptRecordFlagsGrid.selectedItem.assignDate)}"
+                                        accessibleText="{fmtDt.format(ptRecordFlagsGrid.selectedItem.assignDate)}"
+                                        tabIndex="{baseTabIndex + 6}" styleName="formField"/>
+            </mx:FormItem>
+            <mx:FormItem label="Approved By">
+                <widget:AccessibleLabel text="{ptRecordFlagsGrid.selectedItem.approved}"
+                                        accessibleText="{ptRecordFlagsGrid.selectedItem.approved}" tabIndex="{baseTabIndex + 7}" styleName="formField"/>
+            </mx:FormItem>
+            <mx:FormItem label="Next Review Date">
+                <widget:AccessibleLabel text="{fmtDt.format(ptRecordFlagsGrid.selectedItem.nextReviewDate)}"
+                                        accessibleText="{fmtDt.format(ptRecordFlagsGrid.selectedItem.nextReviewDate)}"
+                                        tabIndex="{baseTabIndex + 8}" styleName="formField"/>
+            </mx:FormItem>
+            <mx:FormItem label="Owner Site">
+                <widget:AccessibleLabel text="{ptRecordFlagsGrid.selectedItem.ownerSite}"
+                                        accessibleText="{ptRecordFlagsGrid.selectedItem.ownerSite}" tabIndex="{baseTabIndex + 9}" styleName="formField"/>
+            </mx:FormItem>
+            <mx:FormItem label="Originating Site">
+                <widget:AccessibleLabel text="{ptRecordFlagsGrid.selectedItem.originatingSite}"
+                                        accessibleText="{ptRecordFlagsGrid.selectedItem.originatingSite}"
+                                        tabIndex="{baseTabIndex + 10}" styleName="formField"/>
+            </mx:FormItem>
+        </mx:Form>
+
+        <!--
+        linked progress notes are not currently used
+
+        <mx:Label width="100%" text="Signed, Linked Notes of Title: Patient Record Flag Category" styleName="subTitle"/>
+        <mx:DataGrid
+            id="signedLinkedNotesGrid"
+            initialize="{AccessibilityTools.accessComponentName(signedLinkedNotesGrid,'Signed, Linked Notes of Title: Patient Record Flag Category')}"
+            width="100%"
+            rowCount="3"
+            click="{displayNoteText()}">
+            <mx:columns>
+                <mx:DataGridColumn dataField="noteDate" headerText="Date"/>
+                <mx:DataGridColumn dataField="action" headerText="Action"/>
+                <mx:DataGridColumn dataField="author" headerText="Author"/>
+            </mx:columns>
+        </mx:DataGrid>
+    -->
+
+    </mx:VBox>
+    <mx:DateFormatter id="fmtDt" formatString="D MMM YY H:NN"/>
+    <accessibility:AccessibilityProperties name="Patient Record Flags" id="accessibleMessage"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/LookupPanel.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/LookupPanel.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/LookupPanel.mxml	(revision 1227)
@@ -0,0 +1,196 @@
+<?xml version="1.0"?>
+<widget:GapAccordion
+		xmlns:mx="http://www.adobe.com/2006/mxml"
+		xmlns:widget="gov.va.med.edp.widget.*"
+		xmlns:accessibility="flash.accessibility.*"
+		xmlns:pt-cntrl="gov.va.med.edp.pt.demog.control.*"
+		accessibilityProperties="{accAccordian}"
+		width="100%" height="100%"
+		paddingLeft="1"
+		paddingTop="1"
+		borderStyle="none"
+		verticalGap="12"
+		tabEnabled="false"
+		creationPolicy="all"
+		creationComplete="init()"
+		change="updateSelectedPatient()">
+	<mx:Metadata>
+		[Event(name="selectPatient", type="gov.va.med.edp.pt.demog.view.SelectPatientEvent")]
+	</mx:Metadata>
+	<mx:Script><![CDATA[
+		import mx.events.ValidationResultEvent;
+		import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+		import gov.va.med.edp.pt.demog.model.MatchingPatientsModel;
+
+
+		private static const NAME_AMBULANCE: String = "(ambulance en route)";
+		private static const AMBULANCE_MSG: String =
+				"<p>Patient name will display as:  " + NAME_AMBULANCE + "</p>" +
+				"<p>Use <b>Identify Patient</b> button when patient is known. </p>";
+
+		private static const MARGIN_RADIO_LEFT: int = 14;
+		private static const MARGIN_RADIO_TOP: int = 12;
+
+
+		[Bindable]
+		private var matchingPatientsModel:MatchingPatientsModel = new MatchingPatientsModel();
+
+		[Bindable]
+		public var baseTabIndex:int;
+
+		private var _initialPatient: PatientSelectVO;
+
+		[Bindable]
+		public function get initialPatient():PatientSelectVO {
+			return _initialPatient;
+		}
+
+		public function set initialPatient(pt:PatientSelectVO):void {
+			_initialPatient = pt;
+			if (_initialPatient != null)
+				currentState = "noAmbulance";
+			else
+				currentState = ""
+		}
+
+		private function init():void {
+			matchPatientsController.resetMatchingPatients();
+			callLater(partialNameInput.setFocus);
+		}
+
+		private function matchPatients():void {
+			matchPatientsController.matchPatients(partialNameInput.text);
+		}
+
+		private function updateSelectedPatient(selectAndContinue:Boolean = false):void
+		{
+			var patient: PatientSelectVO = new PatientSelectVO();
+			if (this.selectedChild == vistaPt) {
+				patient = patientList.selectedItem as PatientSelectVO;
+				if (patient != null && patient.dfn == "0") patient = null;
+			} else if (this.selectedChild == nonVistaPt) {
+				var result:ValidationResultEvent = nonVistaNameValidator.validate();
+				if (result.type == ValidationResultEvent.INVALID) {
+					patient = null;
+				} else {
+					patient.name = nonVistaName.text;
+				}
+			} else if (this.selectedChild == ambulancePt) {
+				patient.name = NAME_AMBULANCE;
+			}
+			dispatchEvent(new SelectPatientEvent(SelectPatientEvent.EVENT_SELECT_PATIENT, patient, selectAndContinue));
+		}
+
+		private function set matchesLoaded(loaded:Boolean):void
+		{
+			if (loaded) {
+				if (matchingPatientsModel.matchingPatients.length > 0) {
+					callLater(selectFirstMatch);
+				}
+			}
+		}
+
+		private function selectFirstMatch():void {
+			if (matchingPatientsModel.matchingPatients.length > 0) {
+				patientList.selectedIndex = 0;
+				updateSelectedPatient();
+				patientList.setFocus();
+			}
+		}
+
+		private function patientListKeyHandler(event:KeyboardEvent):void {
+			if (event.keyCode == Keyboard.ENTER) {
+				updateSelectedPatient(true);
+			}
+		}
+
+		]]></mx:Script>
+
+	<pt-cntrl:MatchPatientsController id="matchPatientsController" model="{matchingPatientsModel}"/>
+
+	<widget:headerRenderer>
+		<mx:Component>
+			<mx:RadioButton/>
+		</mx:Component>
+	</widget:headerRenderer>
+	<widget:states>
+		<mx:State name="noAmbulance">
+			<mx:RemoveChild target="{ambulancePt}"/>
+		</mx:State>
+	</widget:states>
+
+	<mx:VBox
+			id="vistaPt"
+			label="Search for Patient in VistA"
+			paddingBottom="6">
+		<mx:HBox
+				width="100%"
+				paddingLeft="{MARGIN_RADIO_LEFT}" paddingTop="{MARGIN_RADIO_TOP}" defaultButton="{search}">
+			<mx:Label
+					text="Find Patient"/>
+			<mx:TextInput
+					id="partialNameInput"
+					width="100%"
+					accessibilityProperties="{accPartial}"
+					tabIndex="{baseTabIndex + 1}"
+					enter="matchPatients()"/>
+			<mx:Button
+					id="search"
+					label="Search"
+					click="matchPatients()"
+					focusEnabled="false"/>
+		</mx:HBox>
+		<mx:DataGrid
+				id="patientList"
+				useRollOver="false"
+				dataProvider="{matchingPatientsModel.matchingPatients}"
+				accessibilityProperties="{accMatches}"
+				change="updateSelectedPatient()"
+				doubleClickEnabled="true"
+				doubleClick="updateSelectedPatient(true)"
+				tabIndex="{baseTabIndex + 2}"
+				keyDown="patientListKeyHandler(event)">
+			<mx:columns>
+				<mx:DataGridColumn headerText="Name" dataField="name" width="210"/>
+				<mx:DataGridColumn headerText="SSN" dataField="ssn" width="80"/>
+				<mx:DataGridColumn headerText="DOB" dataField="dob" width="80"/>
+			</mx:columns>
+		</mx:DataGrid>
+	</mx:VBox>
+
+	<mx:VBox
+			id="nonVistaPt"
+			label="Enter Name, Patient Is Not in VistA">
+		<mx:HBox
+				paddingLeft="{MARGIN_RADIO_LEFT}" paddingTop="{MARGIN_RADIO_TOP}">
+			<mx:Label
+					text="Patient Name"/>
+			<mx:TextInput
+					id="nonVistaName"
+					accessibilityProperties="{accPartial}"
+					text="{partialNameInput.text}"
+					change="updateSelectedPatient()"
+					tabIndex="{baseTabIndex + 3}"/>
+		</mx:HBox>
+	</mx:VBox>
+
+	<mx:VBox
+			id="ambulancePt"
+			label="Ambulance Is Arriving, Patient Name Is Unknown">
+		<mx:Text
+				width="100%" height="100%"
+				paddingLeft="{MARGIN_RADIO_LEFT}" paddingTop="{MARGIN_RADIO_TOP}"
+				htmlText="{AMBULANCE_MSG}"
+				tabIndex="{baseTabIndex + 4}"/>
+	</mx:VBox>
+
+	<mx:StringValidator id="nonVistaNameValidator" source="{nonVistaName}" property="text" required="true"
+						requiredFieldError="A patient name must be entered." maxLength="40"
+						tooLongError="Patient name is too long (> 40 characters)."/>
+
+	<accessibility:AccessibilityProperties id="accPartial" name="Patient Name"/>
+	<accessibility:AccessibilityProperties id="accMatches" name="Matching Patients"/>
+	<accessibility:AccessibilityProperties id="accAccordian" name="Accordion Control"/>
+
+	<mx:Binding source="matchingPatientsModel.matchingPatientsLoaded" destination="matchesLoaded"/>
+</widget:GapAccordion>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/MessagePanel.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/MessagePanel.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/MessagePanel.mxml	(revision 1227)
@@ -0,0 +1,17 @@
+<?xml version="1.0" ?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:widget="gov.va.med.edp.widget.*" height="100%">
+    <mx:Script><![CDATA[
+
+        [Bindable]
+        public var baseTabIndex:int;
+
+        [Bindable]
+        public var message:String;
+
+        [Bindable]
+        public var title:String;
+
+        ]]></mx:Script>
+    <widget:AccessibleLabel id="titleLabel" text="{title}" tabIndex="{baseTabIndex}" styleName="subTitle" accessibleText="{title}"/>
+    <mx:TextArea borderThickness="0" id="txtWarning" width="100%" height="100%" tabIndex="{baseTabIndex + 1}" text="{message}"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/PatientRecordFlagsDialog.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/PatientRecordFlagsDialog.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/PatientRecordFlagsDialog.mxml	(revision 1227)
@@ -0,0 +1,94 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml"
+                xmlns:accessibility="flash.accessibility.*"
+                xmlns:pt="gov.va.med.edp.pt.demog.view.*"
+                xmlns:widget="gov.va.med.edp.widget.*"
+                title="Patient Record Flags"
+                minWidth="300" minHeight="300" maxHeight="900" maxWidth="900"
+                keyDown="disposeOnEscape(event)"
+				defaultButton="{closeBtn}"
+                implements="mx.managers.IFocusManagerContainer">
+
+    <mx:Script>
+        <![CDATA[
+        	import mx.events.CloseEvent;
+        import mx.core.Application;
+        import gov.va.med.edp.control.ModalDialogEvent;
+        import mx.collections.ArrayCollection;
+        import mx.managers.PopUpManager;
+
+        [Bindable]
+        public var flags: ArrayCollection;
+
+        public static const OK:uint = 0x0004;
+
+        public static function show(flags:ArrayCollection, closeListener:Function = null):void
+        {
+            var dialog:PatientRecordFlagsDialog = PatientRecordFlagsDialog(PopUpManager.createPopUp(Application.application as DisplayObject, PatientRecordFlagsDialog, true));
+            dialog.flags = flags;
+            if (closeListener != null)
+            {
+                dialog.addEventListener(CloseEvent.CLOSE, closeListener);
+            }
+
+
+            //Dispatch the event for get clear background
+            Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.OPEN));
+            PopUpManager.centerPopUp(dialog);
+        }
+
+        public function removePopUp():void
+        {
+            // Let the calling component know we're closing
+            dispatchEvent(new CloseEvent(CloseEvent.CLOSE, false, false, OK));
+
+            ////Dispatch the event for removing clear background when accessibility is active
+            Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.CLOSE));
+            PopUpManager.removePopUp(this);
+        }
+
+
+//        private function creationCompleteHandler() : void {
+//            var focusTimer: Timer = new Timer(300, 1);
+//            focusTimer.addEventListener(TimerEvent.TIMER, moveFocus);
+//            focusTimer.start();
+//        }
+
+//        private function moveFocus(e: TimerEvent): void
+//        {
+//            if (Accessibility.active) {
+//                ptRecordFlagsGrid.setFocus();
+//                txtAssNarrative.editable = true;
+//                txtAssNarrative.tabIndex = 1104;
+//            } else {
+//                closeBtn.setFocus();
+//            }
+//        }
+
+        public function disposeOnEscape(event:KeyboardEvent):void
+        {
+            if (event.keyCode == Keyboard.ESCAPE) {
+                removePopUp();
+            }
+        }
+		]]>
+    </mx:Script>
+
+    <accessibility:AccessibilityProperties name="Popup Dialog {this.title}" id="accessibleMessage"/>
+
+    <mx:VBox id="layOutVBox" width="100%" height="100%">
+
+        <pt:FlagsPanel id="flagsPanel" flags="{flags}" baseTabIndex="1100"/>
+
+    </mx:VBox>
+
+	<mx:ControlBar width="100%" horizontalAlign="right">
+		 <mx:Spacer width="100%"/>
+		 <mx:Button id="closeBtn" label="Close" click="{removePopUp()}" tabIndex="1114"
+                       creationComplete="setFocus();"/>
+	</mx:ControlBar>
+
+    <mx:Iris id="irisOut" duration="700" showTarget="true"/>
+    <mx:Iris id="irisIn" duration="700" showTarget="false"/>
+    <mx:DateFormatter id="fmtDt" formatString="D MMM YY H:NN"/>
+</mx:TitleWindow>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientButton.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientButton.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientButton.mxml	(revision 1227)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Button xmlns:mx="http://www.adobe.com/2006/mxml"
+		   click="selectPatient()">
+
+	<mx:Metadata>
+		[Event(name="selectPatient", type="gov.va.med.edp.pt.demog.view.SelectPatientEvent")]
+	</mx:Metadata>
+
+	<mx:Script>
+		<![CDATA[
+        import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+		import gov.va.med.edp.pt.demog.IPatientChecksController;
+		import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+
+		private var _patient: PatientSelectVO;
+		private var _open:Boolean = false;
+
+		[Bindable]
+		public var ptSelectController:IPatientChecksController;
+
+		[Bindable]
+		public var patientChecksModel:PatientChecksModel;
+
+		[Bindable]
+		public var centered: Boolean = false;
+
+		[Bindable]
+		public function get patient():PatientSelectVO {
+			return _patient;
+		}
+
+		public function set patient(value: PatientSelectVO): void
+		{
+			_patient = value;
+		}
+
+		private function selectPatient(): void {
+			if (_open) return;
+			_open = true;
+			SelectPatientDialog.show(ptSelectController, patientChecksModel, patient, this, closeHandler, centered);
+		}
+
+		private function closeHandler(event:SelectPatientEvent):void {
+			if (event.patient != null) {
+				var forwardEvent: SelectPatientEvent =
+						new SelectPatientEvent(SelectPatientEvent.EVENT_SELECT_PATIENT);
+				forwardEvent.patient = event.patient;
+				dispatchEvent(forwardEvent);
+			}
+			_open = false;			
+		}
+		]]>
+	</mx:Script>
+
+</mx:Button>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientDialog.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientDialog.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientDialog.mxml	(revision 1227)
@@ -0,0 +1,81 @@
+<?xml version="1.0" ?>
+<mx:Panel xmlns:mx="http://www.adobe.com/2006/mxml"
+		  xmlns:pt="gov.va.med.edp.pt.demog.view.*"
+		  layout="vertical" headerHeight="4"
+		  borderStyle="solid" borderThickness="12" borderColor="#CCCCCC"
+		  paddingTop="12" paddingLeft="12" paddingRight="12" paddingBottom="0"
+		  implements="mx.managers.IFocusManagerContainer">
+	<mx:Script><![CDATA[
+import mx.core.Application;
+		import gov.va.med.edp.util.AccessibilityTools;
+		import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+		import gov.va.med.edp.control.ModalDialogEvent;
+		import mx.managers.PopUpManager;
+		import gov.va.med.edp.pt.demog.IPatientChecksController;
+		import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+
+		public static function show(cntrl:IPatientChecksController, ptChecksModel:PatientChecksModel, patient:PatientSelectVO = null, dialogParent:Sprite = null, closeHandler:Function = null, centered:Boolean = false):void {
+			var dialog:SelectPatientDialog = createDialog(cntrl, ptChecksModel, patient, dialogParent, closeHandler);
+			if (dialogParent != null) {
+				dialogParent.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.OPEN, dialog));
+			}
+			if (!AccessibilityTools.isAccessibilityActive()) { // when accessibility active, we don't use a popup, so popup location is irreleant
+				if (dialogParent != null) {
+					dialog.validateNow();
+					var point:Point = new Point();
+					point = dialogParent.localToGlobal(point);
+					point.y += dialogParent.height;
+					if (centered) {
+						point.x -= ((dialog.width - dialogParent.width) / 2);
+					}
+					if ((point.x + dialog.width) > Application.application.systemManager.screen.width) {
+						dialog.x = Application.application.systemManager.screen.width - dialog.width;
+					} else {
+						dialog.x = point.x;
+					}
+					dialog.y = point.y;
+				} else {
+					PopUpManager.centerPopUp(dialog);
+				}
+			}
+		}
+
+		private static function createDialog(cntrl:IPatientChecksController, ptChecksModel:PatientChecksModel, patient:PatientSelectVO, dialogParent:Sprite, closeHandler:Function):SelectPatientDialog {
+			var dialog:SelectPatientDialog = null;
+			if (AccessibilityTools.isAccessibilityActive()) // no popup when accessibility is active
+				dialog = new SelectPatientDialog();
+			else
+				dialog = SelectPatientDialog(PopUpManager.createPopUp(dialogParent, SelectPatientDialog, true));
+			dialog.ptChecksController = cntrl;
+			dialog.model = ptChecksModel;
+			dialog.dialogParent = dialogParent;
+			dialog.closeHandler = closeHandler;
+			dialog.patient = patient;
+			return dialog;
+		}
+
+		private function close(event:SelectPatientEvent):void {
+			if (closed) return;
+			closed = true;
+			if (closeHandler != null) closeHandler(event);
+			if (dialogParent != null) dialogParent.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.CLOSE));
+			if (!AccessibilityTools.isAccessibilityActive()) PopUpManager.removePopUp(this); // no popup when accessibility is active
+		}
+
+		[Bindable]
+		public var ptChecksController:IPatientChecksController;
+
+		[Bindable]
+		public var model:PatientChecksModel;
+
+		[Bindable]
+		public var patient:PatientSelectVO;
+
+		private var dialogParent:Sprite;
+		private var closeHandler:Function;
+		private var closed:Boolean = false;
+
+		]]></mx:Script>
+	<pt:SelectPatientPanel model="{model}" ptChecksController="{ptChecksController}"
+						   cancel="close(event)" selectPatient="close(event)" initialPatient="{patient}"/>
+</mx:Panel>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientEvent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientEvent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientEvent.as	(revision 1227)
@@ -0,0 +1,20 @@
+package gov.va.med.edp.pt.demog.view {
+import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+import flash.events.Event;
+
+public class SelectPatientEvent extends Event {
+
+    public static const EVENT_CANCEL:String = "cancel";
+    public static const EVENT_SELECT_PATIENT:String = "selectPatient";
+
+    public var patient:PatientSelectVO;
+    public var selectAndContinue:Boolean;
+
+    public function SelectPatientEvent(type:String, patient:PatientSelectVO = null, selectAndContinue:Boolean = false) {
+        super(type);
+        this.patient = patient;
+        this.selectAndContinue = selectAndContinue;
+    }
+
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientPanel.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientPanel.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SelectPatientPanel.mxml	(revision 1227)
@@ -0,0 +1,211 @@
+<?xml version="1.0" ?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
+		 xmlns:pt="gov.va.med.edp.pt.demog.view.*" creationComplete="doCreationComplete(event)"
+		 width="{selectPatientPanel.width}"
+		 horizontalScrollPolicy="off"
+		 verticalScrollPolicy="off"
+		 keyDown="keyHandler(event)"
+		 defaultButton="{model.continueEnabled ? btnNext : btnPrevious}">
+	<mx:Metadata>
+		[Event(name="cancel", type="gov.va.med.edp.pt.demog.view.SelectPatientEvent")]
+		[Event(name="selectPatient", type="gov.va.med.edp.pt.demog.view.SelectPatientEvent")]
+	</mx:Metadata>
+	<mx:Script><![CDATA[
+import mx.managers.IFocusManagerComponent;
+import gov.va.med.edp.util.AccessibilityTools;
+		import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+		import gov.va.med.edp.pt.demog.IPatientChecksController;
+		import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+		import mx.core.UIComponent;
+
+		[Bindable]
+		public var ptChecksController:IPatientChecksController;
+
+		[Bindable]
+		public var model:PatientChecksModel;
+
+		[Bindable]
+		public var initialPatient:PatientSelectVO;
+
+		private var blurring:Array = new Array();
+		private var _page:Number = 0;
+		private var checksPending:Boolean = false;
+		private var dispatched:Boolean = false;
+
+		public function doCreationComplete(event:Event):void {
+			blurring.push(new BlurFilter(64, 2));
+		}
+
+		public function doEndMove(event:Event):void {
+			cvsPanels.filters = null;
+		}
+
+		private function cancel():void {
+			dispatchEvent(new SelectPatientEvent(SelectPatientEvent.EVENT_CANCEL));
+			ptChecksController.resetPatientChecks();
+		}
+
+		private function selected(event:SelectPatientEvent):void {
+			if (event.patient != null) {
+				ptChecksController.loadPatientChecks(event.patient, event.selectAndContinue);
+			} else {
+				ptChecksController.resetPatientChecks();
+			}
+		}
+
+		public function doNext(event:Event):void {
+			ptChecksController.forwardPatientCheck();
+		}
+
+		public function doPrevious(event:Event):void {
+			ptChecksController.backPatientCheck();
+		}
+
+		[Bindable(event="pageChange")]
+		public function get page():Number {
+			return _page;
+		}
+
+		public function set page(value:Number):void {
+			if (_page != value) {
+				var oldPagePanel:UIComponent = UIComponent(boxPanels.getChildAt(_page));
+				oldPagePanel.tabChildren = false;
+
+				const backward:Boolean = value < _page;
+				_page = value;
+
+				var gap:Number = boxPanels.getStyle("horizontalGap");
+				var newPagePanel:UIComponent = UIComponent(boxPanels.getChildAt(value));
+
+				newPagePanel.tabChildren = true;
+
+				if (AccessibilityTools.isAccessibilityActive()){
+					callLater(focusManager.getNextFocusManagerComponent(backward).setFocus);
+				}
+
+				// Form pages
+				cvsPanels.filters = blurring;
+				boxPanels.x = 0 - ( value * ( newPagePanel.width + gap ) );
+
+				dispatchEvent(new Event("pageChange"));
+			}
+		}
+
+		private function set checkState(state:int):void {
+			if (checksPending) return;
+			switch (state) {
+				case PatientChecksModel.STATE_ALLOW:
+					dispatchPatientSelected();
+					break;
+				case PatientChecksModel.STATE_FLAGS:
+					page = 5;
+					break;
+				case PatientChecksModel.STATE_DECEASED:
+					page = 4;
+					break;
+				case PatientChecksModel.STATE_SENSITIVE:
+					page = 3;
+					break;
+				case PatientChecksModel.STATE_SIMILAR:
+					page = 2;
+					break;
+				case PatientChecksModel.STATE_ONBOARD:
+					page = 1;
+					break;
+				case PatientChecksModel.STATE_LOADED:
+				default:
+					page = 0;
+					break;
+			}
+		}
+
+		private function set ready(r:Boolean):void {
+			checksPending = !r;
+		}
+
+		private function dispatchPatientSelected():void {
+			if (dispatched) return;
+			dispatchEvent(new SelectPatientEvent(SelectPatientEvent.EVENT_SELECT_PATIENT, model.checksForPt));
+			dispatched = true;
+			callLater(reset);
+		}
+
+		private function reset():void {
+			ptChecksController.resetPatientChecks();
+			dispatched = false;
+		}
+
+		private function keyHandler(event:KeyboardEvent):void {
+			if (event.keyCode == Keyboard.ESCAPE) {
+				cancel();
+			}
+		}
+
+		]]></mx:Script>
+	<mx:Move id="effSlide" effectEnd="doEndMove( event )"/>
+	<mx:Canvas
+			id="cvsPanels"
+			width="100%"
+			height="100%"
+			horizontalScrollPolicy="off"
+			verticalScrollPolicy="off"
+			defaultButton="{model.continueEnabled ? btnNext : btnPrevious}">
+		<mx:HBox id="boxPanels" moveEffect="{effSlide}">
+			<pt:LookupPanel id="selectPatientPanel"
+							selectPatient="selected(event)"
+							initialPatient="{initialPatient}"
+							tabChildren="true"
+							baseTabIndex="100"/>
+			<pt:MessagePanel id="alreadyOnBoardPanel"
+							 width="{selectPatientPanel.width}"
+							 title="Duplicate Selection"
+							 message="{model.patientChecks.onBoardText + ' is already active on the board.'}"
+							 visible="{model.patientChecks.isOnBoard()}"
+							 tabChildren="false"
+							 baseTabIndex="110"
+							 defaultButton="{model.continueEnabled ? btnNext : btnPrevious}"/>
+			<pt:SimilarNamesPanel id="similarNamesPanel"
+								  model="{model}"
+								  width="{selectPatientPanel.width}"
+								  visible="{model.patientChecks.hasSimilarNames()}"
+								  tabChildren="false"
+								  baseTabIndex="120"
+								  defaultButton="{model.continueEnabled ? btnNext : btnPrevious}"/>
+			<pt:MessagePanel id="sensitivePatientPanel"
+							 width="{selectPatientPanel.width}"
+							 title="{model.patientChecks.mayAccess ? 'Restricted Record' : 'Access Denied'}"
+							 message="{model.patientChecks.warningText}"
+							 visible="{model.patientChecks.sensitive}"
+							 tabChildren="false"
+							 baseTabIndex="130"
+							 defaultButton="{model.continueEnabled ? btnNext : btnPrevious}"/>
+			<pt:MessagePanel id="deceasedPanel" width="{selectPatientPanel.width}"
+							 title="Deceased Patient"
+							 message="{model.patientChecks.deceasedText}"
+							 visible="{model.patientChecks.isDeceased()}"
+							 tabChildren="false"
+							 baseTabIndex="140"
+							 defaultButton="{model.continueEnabled ? btnNext : btnPrevious}"/>
+			<pt:FlagsPanel id="flagsPanel" flags="{model.patientChecks.flags}"
+						   width="{selectPatientPanel.width}"
+						   visible="{model.patientChecks.hasFlags()}"
+						   tabChildren="false"
+						   baseTabIndex="150"
+						   defaultButton="{model.continueEnabled ? btnNext : btnPrevious}"/>
+		</mx:HBox>
+	</mx:Canvas>
+
+	<mx:HRule width="100%"/>
+
+	<mx:HBox horizontalAlign="right" width="100%">
+		<mx:Button id="btnCancel" label="Cancel" click="cancel()" tabIndex="200"/>
+		<mx:Spacer width="100%"/>
+		<mx:Button id="btnPrevious" label="Back" click="doPrevious(event)" enabled="{model.backEnabled}"
+				   tabIndex="201"/>
+		<mx:Button id="btnNext" label="Continue" click="doNext(event)" enabled="{model.continueEnabled}"
+				   tabIndex="202"/>
+	</mx:HBox>
+
+	<mx:Binding source="model.checkState" destination="checkState"/>
+	<mx:Binding source="model.patientChecksReady" destination="ready"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SimilarNamesPanel.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SimilarNamesPanel.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/pt/demog/view/SimilarNamesPanel.mxml	(revision 1227)
@@ -0,0 +1,27 @@
+<?xml version="1.0" ?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:widget="gov.va.med.edp.widget.*">
+    <mx:Script><![CDATA[
+        import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+
+        [Bindable]
+        public var baseTabIndex:int;
+
+        [Bindable]
+        public var model:PatientChecksModel;
+
+        ]]></mx:Script>
+    <widget:AccessibleLabel id="titleLabel" text="Similar Patients" tabIndex="{baseTabIndex}" styleName="subTitle"/>
+    <mx:DataGrid
+            id="grdSimilar"
+            tabIndex="{baseTabIndex + 1}"
+            dataProvider="{model.patientChecks.similarNames}"
+            width="100%"
+            rowCount="{model.patientChecks.similarNames.length + 1}">
+        <mx:columns>
+            <mx:DataGridColumn headerText="Name" dataField="name"/>
+            <mx:DataGridColumn headerText="Date of Birth" dataField="dob" width="100"/>
+            <mx:DataGridColumn headerText="SSN" dataField="ssn" width="100"/>
+        </mx:columns>
+    </mx:DataGrid>
+    <mx:TextArea borderThickness="0" id="txtWarning" width="100%" tabIndex="{baseTabIndex + 2}"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/skins/LinkButtonTabSkin.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/skins/LinkButtonTabSkin.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/skins/LinkButtonTabSkin.as	(revision 1227)
@@ -0,0 +1,127 @@
+////////////////////////////////////////////////////////////////////////////////
+//
+//  ADOBE SYSTEMS INCORPORATED
+//  Copyright 2003-2007 Adobe Systems Incorporated
+//  All Rights Reserved.
+//
+//  NOTICE: Adobe permits you to use, modify, and distribute this file
+//  in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+
+package gov.va.med.edp.skins
+{
+
+import mx.core.EdgeMetrics;
+import mx.core.UIComponent;
+import mx.skins.Border;
+import mx.styles.StyleManager;
+import mx.utils.ColorUtil;
+
+/**
+ *  The skin for all the states of a Tab in a TabNavigator or TabBar.
+ */
+public class LinkButtonTabSkin extends Border
+{	
+	/**
+	 *  @private
+	 *  Storage for the borderMetrics property.
+	 */
+	private var _borderMetrics:EdgeMetrics = EdgeMetrics.EMPTY;
+
+	/**
+	 *  @private
+	 */
+	override public function get borderMetrics():EdgeMetrics
+	{
+		return _borderMetrics;
+	}
+
+	//----------------------------------
+	//  measuredWidth
+	//----------------------------------
+	
+	/**
+	 *  @private
+	 */
+	override public function get measuredWidth():Number
+	{
+		return UIComponent.DEFAULT_MEASURED_MIN_WIDTH;
+	}
+	
+	//----------------------------------
+	//  measuredHeight
+	//----------------------------------
+
+	/**
+	 *  @private
+	 */
+	override public function get measuredHeight():Number
+	{
+		return UIComponent.DEFAULT_MEASURED_MIN_HEIGHT;
+	}
+	
+	/**
+	 *  @private
+	 */
+	override protected function updateDisplayList(w:Number, h:Number):void
+	{
+		super.updateDisplayList(w, h);
+
+		// User-defined styles.
+		var rollOverColor:uint = getStyle("rollOverColor");
+		var cornerRadius:Number = getStyle("cornerRadius");
+		var selectionColor:uint = getStyle("selectionColor");
+		
+		graphics.clear();
+		
+		switch (name)
+		{
+			case "upSkin":
+			{
+				// Draw invisible shape so we have a hit area.
+				drawRoundRect(
+					0, 0, w, h, cornerRadius,
+					0, 0);
+				break;
+			}
+
+			case "overSkin":
+			{
+				drawRoundRect(
+					0, 0, w, h, cornerRadius,
+					rollOverColor, 1);
+				break;
+			}
+
+			case "disabledSkin":
+			{
+				// Draw invisible shape so we have a hit area.
+				drawRoundRect(
+					0, 0, w, h, cornerRadius,
+					0, 0);
+				break;
+			}
+			case "selectedDownSkin":
+			case "downSkin":
+			{
+						drawRoundRect(
+					0, 0, w, h, cornerRadius,
+					selectionColor, 1);
+				break;
+			}
+			case "selectedUpSkin":		
+			case "selectedOverSkin":
+			case "selectedDisabledSkin":
+			{
+			drawRoundRect(
+					0, 0, w, h, cornerRadius,
+					0, 0);
+				break;
+			}
+		}
+	}
+	
+}
+
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/AccessibilityTools.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/AccessibilityTools.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/AccessibilityTools.as	(revision 1227)
@@ -0,0 +1,149 @@
+package gov.va.med.edp.util
+{
+import flash.accessibility.Accessibility;
+import flash.accessibility.AccessibilityProperties;
+import flash.utils.setTimeout;
+
+import mx.core.UIComponent;
+
+
+[Bindable]
+public class AccessibilityTools
+{
+
+    //----------------------------------------------------------------
+    //
+    //  Class constants
+    //
+    //-----------------------------------------------------------------
+
+    private static const ACC_READ_DELAY:int = 2000;
+
+
+    /**
+     *  Function: accessComponentName()
+     *  Parameters:
+     *      component:UIComponent - Screen component reference
+     *      accessName:String - Text to be read by JAWS
+     *  Description:
+     *      Generic functionality for reading flex accessible components
+     *      when JAWS accessible feature(508) is used.
+     *  Created by: jtorreno
+     *  Date: 2008.02.08
+     *
+     **/
+    public static function accessComponentName(component:UIComponent,
+                                               accessName:String): void
+    {
+
+        if ((component != null) && (accessName != null)) {
+            component.accessibilityProperties =
+            new AccessibilityProperties();
+            component.accessibilityProperties.name = accessName;
+
+            setTimeout(updateAccessibleProperties, ACC_READ_DELAY);
+        }
+
+    }
+
+    /**
+     *  Function: updateAccessibleProperties()()
+     *  Parameters:
+     *        NONE
+     *  Description:
+     *      Generic functionality for updating accessible properties
+     *      when JAWS accessible feature(508) is used.
+     *  Created by: jtorreno
+     *  Date: 2008.02.15
+     *
+     **/
+
+    private static function updateAccessibleProperties(): void
+    {
+        if (Accessibility.active) {
+            Accessibility.updateProperties();
+        }
+    }
+
+    /**
+     *  Function: accessComponentDescription()
+     *  Parameters:
+     *      component:UIComponent - Screen component reference
+     *      accessName:String - Text to be read by JAWS
+     *  Description:
+     *      Generic functionality for reading flex accessible components
+     *      when JAWS accessible feature(508) is used.
+     *  Created by: jtorreno
+     *  Date: 2008.02.08
+     *
+     **/
+    public static function accessComponentDescription(
+            component:UIComponent, accessName:String): void
+    {
+
+        if ((component != null) && (accessName != null)) {
+            component.accessibilityProperties =
+            new AccessibilityProperties();
+            component.accessibilityProperties.description = accessName;
+
+            setTimeout(updateAccessibleProperties, ACC_READ_DELAY);
+        }
+
+    }
+
+    /**
+     *  Function: accessAppViewHeader()
+     *  Parameters:
+     *      component:UIComponent - Screen component reference
+     *      tabIndex:int - Tab index to be read by JAWS
+     *  Description:
+     *      Reads application header when JAWS accessible
+     *      feature(508) is used.
+     *  Created by: jtorreno
+     *  Date: 2008.02.12
+     *
+     **/
+    public static function accessAppViewHeader(component:UIComponent,
+                                               tabIndex:int):void
+    {
+
+        if ((component != null) && (tabIndex >= 0)) {
+            component.accessibilityProperties =
+            new AccessibilityProperties();
+            component.focusEnabled = true;
+            component.tabIndex = tabIndex;
+
+            setTimeout(updateAccessibleProperties, ACC_READ_DELAY);                            
+        }
+
+    }
+
+    /**
+     *  Function: isAccessibilityToolActive()
+     *  Parameters:
+     *        NONE
+     *  Description:
+     *      Checks if accessibility tool is active.
+     *  Return:
+     *      Returns false if JAWS reader is active
+     *  Created by: jtorreno
+     *  Date: 2008.04.1
+     *
+     **/
+    public static function setToFalseIfAccessToolIsActive():Boolean
+    {
+        var bActive:Boolean = true;
+
+        if (isAccessibilityActive()) {
+            bActive = false;
+        }
+        return bActive;
+    }
+
+    public static function isAccessibilityActive():Boolean
+    {
+//        return true;
+                      return Accessibility.active;
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/AutoScrollView.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/AutoScrollView.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/AutoScrollView.as	(revision 1227)
@@ -0,0 +1,142 @@
+/**
+ *   Autoscroll screen if component to be focused is offscreen to make it visible. 
+ *   created by: jtorreno 2008.05.08
+ */	 
+   
+package gov.va.med.edp.util
+{
+   import flash.display.DisplayObjectContainer;
+   import flash.display.InteractiveObject;
+   import flash.events.FocusEvent;
+   import flash.geom.Point;
+   import flash.geom.Rectangle;
+   
+   import mx.core.Container;
+   import mx.core.EdgeMetrics;
+   import mx.managers.IFocusManager;
+  
+   [Bindable]
+   public class AutoScrollView
+   {
+  
+	  private static var focusMgr:IFocusManager;         
+	     
+	  /** 
+	   *  Function:  setupFocusViewportWatcher()
+	   *  Parameters:
+	   *      dispObj:DisplayObjectContainer - focused object container
+	   *      focusManager:IFocusManager - Focus manager
+	   *  Description:
+	   *     Set up the event listener for the focusIn event
+	   *  Date: 2008.05.08
+	   * 
+	   **/
+       public static function setupFocusViewportWatcher(
+            dispObj:DisplayObjectContainer, focusManager:IFocusManager):void {
+	            	
+	        focusMgr = focusManager;
+	        dispObj.addEventListener("focusIn", makeFocusedItemVisible);
+	    }
+		    
+		/** 
+		 *  Function:  makeFocusedItemVisible()
+		 *  Parameters:
+		 *             event:FocusEvent  get focus event
+		 *  Description:
+		 *     Set up the event listener for the focusIn event
+		 *  Date: 2008.05.08
+		 * 
+		 **/
+		 private static function makeFocusedItemVisible(event:FocusEvent):void {
+		     // Target is the actual object that has focus.
+		     var target:InteractiveObject = null;
+		     // OriginalTarget is the component that has focus as some
+		     // component actually delegate true focus to an internal object.
+		     var originalTarget:InteractiveObject = null; 
+		          
+		     if ((event != null) && (event.target != null)) {
+			     
+			     target = InteractiveObject(event.target);
+			     originalTarget = InteractiveObject(focusMgr.findFocusManagerComponent(target));
+			 
+			     // The viewable portion of a container
+			     var viewport:Rectangle = new Rectangle();
+			     
+			     if ((target != null) && (originalTarget != null)) {
+			        do {
+			           // Cycle through all parents looking for containers.
+			           if ((target.parent is Container) && (target.parent != null)) {
+			               var viewportChanged:Boolean = false;
+			               var c:Container = target.parent as Container;
+			
+			               // Get the viewable area in the container.
+			               var vm:EdgeMetrics = c.viewMetrics;
+			               viewport.x = vm.left;
+			               viewport.y = vm.top;
+			               viewport.width = 
+			               c.width / c.scaleX - vm.left - vm.right;
+			               viewport.height = 
+			               c.height / c.scaleY - vm.top - vm.bottom;
+			                    
+			               // Calculate the position of the target in the container.
+			               var topLeft:Point = new Point(0, 0);
+			               var bottomRight:Point = 
+			                   new Point(originalTarget.width, originalTarget.height);
+			                   topLeft = originalTarget.localToGlobal(topLeft);
+			                   topLeft = c.globalToLocal(topLeft);
+			                   bottomRight = originalTarget.localToGlobal(bottomRight);
+			                   bottomRight = c.globalToLocal(bottomRight);
+			    
+			               // Figure out if we have to move the scroll bars.
+			               // If the scroll bar moves, the position of the component
+			               // moves as well. This algorithm makes sure the top
+			               // left of the component is visible if the component is
+			               // bigger than the viewport.
+			               var delta:Number;
+			
+			               if (bottomRight.x > viewport.right) {
+			                   delta = bottomRight.x - viewport.right;
+			                   c.horizontalScrollPosition += delta;
+			                   topLeft.x -= delta;
+			                   viewportChanged = true;
+			                }
+			
+			                if (topLeft.x < viewport.left) {
+			                   // leave it a few pixels in from the left
+			                   c.horizontalScrollPosition -= 
+			                   viewport.left - topLeft.x + 2;
+			                   viewportChanged = true;
+			                 }
+			                    
+			                 if (bottomRight.y > viewport.bottom) {
+			                    delta = bottomRight.y - viewport.bottom;
+			                    c.verticalScrollPosition += delta;
+			                    topLeft.y -= delta;
+			                    viewportChanged = true;
+			                 }
+			                    
+			                 if (topLeft.y < viewport.top) {
+			                   // leave it a few pixels down from the top
+			                   c.verticalScrollPosition -= 
+			                   viewport.top - topLeft.y + 2;
+			                   viewportChanged = true;
+			                 }
+			                    
+			                 // You must the validateNow() method to get the 
+			                 // container to move the component before working 
+			                 // on the next parent.
+			                 // Otherwise, your calculations will be incorrect.
+			                 if (viewportChanged) {
+			                    c.validateNow();
+			                  }
+			               }
+			               
+			               target = target.parent;
+			                
+			        } while ((target != originalTarget) && (target.parent != null) 
+			              && (target.parent as Container));
+		         }
+		     }
+		 }
+       }      
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/BoardTools.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/BoardTools.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/BoardTools.as	(revision 1227)
@@ -0,0 +1,189 @@
+package gov.va.med.edp.util
+{
+	import gov.va.med.edp.factory.SessionFactory;
+	import gov.va.med.edp.factory.TrackingFactory;
+	import gov.va.med.edp.model.Config;
+	import gov.va.med.edp.vo.ColorMapVO;
+	import gov.va.med.edp.vo.ColorMatchVO;
+	import gov.va.med.edp.vo.ColumnSpecVO;
+	import gov.va.med.edp.widget.ColorCellRenderer;
+	
+	import mx.collections.ArrayCollection;
+	import mx.controls.DataGrid;
+	import mx.controls.dataGridClasses.DataGridColumn;
+	import mx.core.ClassFactory;
+	
+	public class BoardTools
+	{
+		static public function renderPatientName(item:Object, col: DataGridColumn): String
+		{
+			var name: String = "";
+			if (col.dataField == "@last4") {
+				name = item.@last4;
+			}
+			if (col.dataField == "@ptNm") {
+				name = item.@ptNm;
+			}
+			if (item.@similar == "1") {
+				name = "*  " + name;
+			} else {
+				name = "    " + name;
+			}
+			return name;
+		}
+			
+		static public function buildColumns(spec: ArrayCollection, destGrid: DataGrid): void
+		{
+			var newCols:Array = new Array();
+			var newCol: DataGridColumn;
+			for each (var colInfo: ColumnSpecVO in spec) {
+				newCol = new DataGridColumn(colInfo.attribute);
+				newCol.headerText = colInfo.header;
+				newCol.dataField = colInfo.attribute;
+				//newCol.width = colInfo.width;
+				newCol.itemRenderer = new ClassFactory(gov.va.med.edp.widget.ColorCellRenderer);
+				if ((colInfo.attribute == "@last4") || (colInfo.attribute == "@ptNm")) {
+					newCol.labelFunction = renderPatientName;
+				}
+				newCols.push(newCol);
+			}
+			destGrid.columns = newCols;
+			destGrid.invalidateDisplayList();
+		}
+
+		
+		public static function locateColorMap(id: String, colorMaps: ArrayCollection): ColorMapVO
+		{
+			for each (var colorMap: ColorMapVO in colorMaps) {
+				if (colorMap.id == id) return colorMap;
+			}
+			return null;
+		}
+		
+
+		public static function applyColorSpec(nodeList: XMLList, colorMaps: ArrayCollection): void
+		{
+			for each (var item: XML in nodeList) {
+				var colorMap: ColorMapVO = locateColorMap(item.@id, colorMaps);
+				if (colorMap == null) continue;
+				
+				var colorSpecMatches: ArrayCollection = TrackingFactory.buildColorMatchListFromXML(item.map);
+				if (colorMap.type == "rng") {
+					colorMap.matches = colorSpecMatches;
+				}
+				
+				insertActiveColors(colorMap.matches, colorSpecMatches);
+			}
+		}
+		
+		private static function insertActiveColors(baseColors: ArrayCollection, activeColors: ArrayCollection): void
+		{
+			for each (var match: ColorMatchVO in activeColors) {
+				var baseIndex: int = indexOfMatch(match.attribute, match.value, baseColors);
+				if (baseIndex > -1) {
+					var baseColor: ColorMatchVO = baseColors[baseIndex] as ColorMatchVO;
+					baseColor.color = match.color;
+				}
+			}
+		}
+		
+		private static function indexOfMatch(att: String, val: String, matches: ArrayCollection): int
+		{
+			for (var i: int = 0; i < matches.length; i++) {
+				var match: ColorMatchVO = matches[i] as ColorMatchVO;
+				if ((match.attribute == att) && (match.value == val)) {
+					return i;
+				}
+			}
+			return -1;
+		}
+		
+		public static function applyBoardSpec(config: Config, xml: XML): void
+		{
+			// load list of boards
+			config.boards = SessionFactory.buildLookupListFromXML(xml.boards.board);
+			config.boardIndex = Vista.locateIndex(config.boards, xml.spec.@boardID);
+			// load color info for row
+			config.rowColorMap = locateColorMap(xml.spec.row.@color, config.colorMaps);
+			config.rowColorMapIndex = config.colorMaps.getItemIndex(config.rowColorMap);
+			// load actual columns info
+			config.columns = TrackingFactory.buildColumnSpecListFromXML(xml.spec.col, config.colorMaps);
+			//load screen displayProperties
+			config.displayBoardProperties = 
+				TrackingFactory.buildDisplayBoardPropertiesFromXML(xml.spec.displayProperties);
+			
+			config.boardToken = xml.boardToken;
+			config.boardMods = false;				
+		}
+		
+		public static function applyStaffLists(config: Config, xml: XML): void
+		{
+			config.providers = TrackingFactory.buildStaffListFromXML(xml.providers.staff);
+			config.residents = TrackingFactory.buildStaffListFromXML(xml.residents.staff);
+			config.nurses =  TrackingFactory.buildStaffListFromXML(xml.nurses.staff);
+			
+			config.providers.filterFunction = hideInactive;
+			config.providers.refresh();
+			config.residents.filterFunction = hideInactive;
+			config.residents.refresh();
+			config.nurses.filterFunction = hideInactive;
+			config.nurses.refresh();
+			
+			config.staffToken = xml.staffToken;
+			config.staffMods = false;			
+		}
+		
+		public static function hideInactive(item: Object): Boolean
+		{
+			return (item.inactive == false);
+		}
+		
+		public static function applySelectionLists(config: Config, xml: XML): void
+		{
+			config.acuities =
+				TrackingFactory.buildCodeSelectionListFromXML(xml.acuity.code);
+			config.statuses =
+				TrackingFactory.buildCodeSelectionListFromXML(xml.status.code);
+			config.arrivals =
+				TrackingFactory.buildCodeSelectionListFromXML(xml.arrival.code);
+			config.dispositions =
+				TrackingFactory.buildCodeSelectionListFromXML(xml.disposition.code);
+			config.delays =
+				TrackingFactory.buildCodeSelectionListFromXML(xml.delay.code);
+
+			config.selectionMods = false;
+			config.selectionToken = xml.selectionToken;
+		}
+		
+		public static function displayTimeAsHrsAndMins(item: Object, column: DataGridColumn): String{
+			var dataField:String = column.dataField;
+			if ((item != null) && (item[dataField] != null)) {
+				var time:Number = parseInt(item[dataField]);
+				var hours:int = (time/60);
+				var minutes:int = ((time%60) * 60)/60;	
+				
+				var hrString:String = hours.toString();		
+				var minString:String = minutes.toString();
+				
+				if (minutes < 10){
+					minString = "0" + minutes.toString();
+				}
+				var retString:String = hrString + ":" + minString;		        				
+				if (hrString == "0" && minString == "00") {
+					return "";
+				} 
+				return hrString + ":" + minString;		        				
+			} else {
+				return "";
+			}
+		}
+		
+/* 		public static function locateColorMapIndex(id: String, colorMaps: ArrayCollection): int
+		{
+			for (var i: int = 0; i < colorMaps.length; i++) {
+				if ((colorMaps[i] as ColorMapVO).id == id) return i;
+			}
+			return -1;
+		}		
+ */	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/ChangeWatcher.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/ChangeWatcher.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/ChangeWatcher.as	(revision 1227)
@@ -0,0 +1,62 @@
+package gov.va.med.edp.util
+{
+	import flash.events.Event;
+	
+	import gov.va.med.edp.control.ChangeLogEntryFieldEvent;
+	import gov.va.med.edp.pt.demog.view.SelectPatientEvent;
+
+	import mx.controls.ComboBox;
+	import mx.controls.TextInput;
+	import mx.events.CalendarLayoutChangeEvent;
+
+	public class ChangeWatcher
+	{
+		public static function changeField(event: Event): void
+		{
+			var changeEvent: ChangeLogEntryFieldEvent = 
+				new ChangeLogEntryFieldEvent(ChangeLogEntryFieldEvent.EVENT_CHANGE_LOG_ENTRY_FIELD);
+			changeEvent.field = event.currentTarget.id;
+			if (event.currentTarget is ComboBox) {
+				changeEvent.value = comboBoxValue(ComboBox(event.currentTarget));
+				changeEvent.label = comboBoxLabel(ComboBox(event.currentTarget));
+				changeEvent.reference = comboBoxRef(ComboBox(event.currentTarget));
+			}
+			if (event.currentTarget is TextInput) {
+				changeEvent.value = TextInput(event.currentTarget).text;
+				//changeEvent.value = (changeEvent.value == "") ? "   " : changeEvent.value;
+				changeEvent.label = changeEvent.value;
+			}
+			if (event is SelectPatientEvent) {
+				changeEvent.value = SelectPatientEvent(event).patient;
+				changeEvent.field = "patient";
+			}
+			if (event is CalendarLayoutChangeEvent) {
+				changeEvent.value = CalendarLayoutChangeEvent(event).newDate;
+				changeEvent.field = event.currentTarget.id;
+			}
+			changeEvent.dispatch();
+		}
+		
+		private static function comboBoxValue(box: ComboBox): *
+		{
+			if (box.selectedItem == null) return -1;
+			return box.selectedItem.data;
+		}
+		
+		private static function comboBoxLabel(box: ComboBox): String
+		{
+			if (box.selectedItem == null) return "";
+			return box.selectedItem.label;
+		}
+		
+		private static function comboBoxRef(box: ComboBox): String
+		{
+			if (box.selectedItem == null) return "";
+			if (box.selectedItem.hasOwnProperty("reference")) {
+				return box.selectedItem.reference;
+			} else {
+				return "";
+			}
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/InactivityTimeout.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/InactivityTimeout.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/InactivityTimeout.as	(revision 1227)
@@ -0,0 +1,108 @@
+package gov.va.med.edp.util {
+import flash.events.TimerEvent;
+import flash.utils.Timer;
+import flash.utils.getTimer;
+
+import gov.va.med.edp.control.ClearUnsavedViewsModelEvent;
+import gov.va.med.edp.model.TrackingModelLocator;
+
+import mx.core.Application;
+import mx.core.SoundAsset;
+public class InactivityTimeout {
+    //	private var timeOutInterval:uint;
+    private var confirmInterval:uint;
+    private var sessionTimeOutTimer:Timer;
+
+    private var confirmTimer:Timer;
+    private var countdownTimer:Timer = new Timer(1000)
+    private var lastActivityTime:Number = 0;
+    private var counter:uint = 0;
+    private var timersStarted:Boolean = false;
+    
+    [Embed(source="Timeout.mp3")]
+    private var alertSound: Class;
+    
+    [Bindable]
+    public var status:String = "";
+
+    private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+    public function start():void {
+        sessionTimeOutTimer = new Timer(model.session.timeOut);
+        sessionTimeOutTimer.addEventListener(TimerEvent.TIMER, onTimeOutTimer);
+
+        confirmTimer = new Timer(model.session.countDown);
+        confirmTimer.addEventListener(TimerEvent.TIMER, onConfirmTimer);
+        countdownTimer.addEventListener(TimerEvent.TIMER, onCountdownTimer);
+
+        confirmInterval = model.session.countDown;
+
+        Application.application.addEventListener("keyDown", activity);
+        Application.application.addEventListener("mouseMove", activity);
+
+        sessionTimeOutTimer.start();
+        timersStarted = true;
+    }
+
+    public function reset():void
+    {
+        lastActivityTime = getTimer();
+        //For some reason the reset method in the Timer class is flaky..Not reliable..
+        if (sessionTimeOutTimer != null) {
+            sessionTimeOutTimer.stop();
+            sessionTimeOutTimer.start();
+        }
+
+        if (timersStarted && confirmTimer.running) {
+            confirmTimer.stop();
+            countdownTimer.stop();
+            counter = 0;
+            status = "";
+        }
+    }
+
+    private function activity(event:Event):void {
+        reset(); 
+    }
+
+    private function onTimeOutTimer(event:TimerEvent):void
+    {
+        confirmTimer.start();
+        countdownTimer.start();
+    }
+
+
+    private function onConfirmTimer(event:TimerEvent):void
+    {
+        status = "Session timed out..Redirecting to Logout...";
+        //Make sure you clear out any unsaved views
+        //other wise the javascript will not let you navigate out..
+        var clearUnsavedViewsEvent: ClearUnsavedViewsModelEvent = new ClearUnsavedViewsModelEvent(ClearUnsavedViewsModelEvent.EVENT_CLEAR_UNSAVED_VIEWS);
+        clearUnsavedViewsEvent.dispatch();
+
+        Application.application.removeEventListener("keyDown", reset);
+        Application.application.removeEventListener("mouseMove", reset);
+
+        confirmTimer.stop();
+        countdownTimer.stop();
+        
+        model.logout();
+    }
+
+    private function onCountdownTimer(event:TimerEvent):void
+    {
+        counter++;
+        var seconds:String = String(confirmInterval / 1000 - counter);
+ 
+ 		trace("Counter: ", counter);
+ 		if (counter == 1) playAlertSound();
+        status = "EDIS has been idle and will close in " + seconds + " seconds.";
+    }
+    
+    private function playAlertSound(): void
+    {
+    	var chime: SoundAsset = new alertSound() as SoundAsset;
+    	chime.play(0,1);
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/KeyUtils.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/KeyUtils.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/KeyUtils.as	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.util
+{
+	import flash.events.KeyboardEvent;
+	import flash.ui.Keyboard;
+	
+	public class KeyUtils {
+		public static function isRemoveKey(e:KeyboardEvent):Boolean {
+			return e.keyCode == Keyboard.BACKSPACE || e.keyCode == Keyboard.DELETE;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/ReportUtil.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/ReportUtil.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/ReportUtil.as	(revision 1227)
@@ -0,0 +1,146 @@
+package gov.va.med.edp.util
+{
+	import gov.va.med.edp.control.reports.ReportDownloadEvent;
+	import gov.va.med.edp.model.TrackingModelLocator;
+	import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+	import gov.va.med.edp.vo.reports.ReportParamsVO;
+	
+	import mx.containers.HBox;
+	import mx.controls.dataGridClasses.DataGridColumn;
+	import mx.core.Application;
+	import mx.printing.FlexPrintJob;
+	import mx.utils.ObjectUtil;
+	
+	public class ReportUtil
+	{
+		private static var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		public static const millisecondsPerHour:int = 1000 * 60 * 60;
+		private static const DT_FORMAT: String = "DD MMM YY JJ:NN";
+		private static const ACCESSIBLE_DT_FORMAT: String = "MMMM DD, YYYY JJ:NN";
+					
+		static public function buildReportLabelText(initilizationText:String): String
+		{
+			var startDate:String = Vista.formattedDate(model.reports.startDate, DT_FORMAT);
+			var stopDate:String = Vista.formattedDate(model.reports.stopDate, DT_FORMAT);
+			var lbltext:String = initilizationText + " from " + startDate + " to " + stopDate;
+ 			return lbltext;
+		}
+		
+		static public function accessibleReportLabelText(initilizationText:String): String
+		{
+			var startDate:String = Vista.formattedDate(model.reports.startDate, ACCESSIBLE_DT_FORMAT);
+			var stopDate:String = Vista.formattedDate(model.reports.stopDate, ACCESSIBLE_DT_FORMAT);
+			var lbltext:String = initilizationText + " from " + startDate + " to " + stopDate;
+ 			
+ 			return lbltext;
+		}
+		
+		static public function calculateEndTimeForShiftReport(startDate:Date): Date
+		{
+			var endDate:Date = new Date(startDate.getTime());
+			endDate.setTime(endDate.getTime() + (24* millisecondsPerHour));
+			return endDate;
+		}
+		
+		static public function formatReportDate(item: Object, column: DataGridColumn): String
+		{
+			var dataField:String = column.dataField;
+			if ((item != null) && (item[dataField] != null)) {
+				return Vista.formattedDate(item[dataField], "M/D/YY JJ:NN");					
+			} else {
+				return "";
+			}
+		}
+		
+		static public function sortTimeInDates(obj1:Object, obj2:Object):int
+		{
+			var date1: Date = obj1.timeIn;
+			var date2: Date = obj2.timeIn;
+			return ObjectUtil.dateCompare(date1, date2);
+		} 		
+		
+		static public function sortTimeOutDates(obj1:Object, obj2:Object):int
+		{
+			var date1: Date = obj1.timeOut;
+			var date2: Date = obj2.timeOut;
+			return ObjectUtil.dateCompare(date1, date2);
+		} 				
+		
+		static public function exportReport(reportName:String, reportId:String=null): void
+		{
+			var reportEvent: ReportDownloadEvent = new ReportDownloadEvent(ReportDownloadEvent.EVENT_DOWNLOAD_REPORT);
+			var reportParams: ReportParamsVO = new ReportParamsVO();
+			reportParams.reportName = reportName;
+			reportParams.startDate = new Date(model.reports.startDate);	
+			reportParams.stopDate = new Date(model.reports.stopDate);
+			reportParams.id = reportId;
+			reportEvent.reportParams = reportParams;
+			reportEvent.dispatch();
+		}		
+		
+		static public function setExportButtonState(button:HBox): void
+		{
+			button.visible = model.session.canExport;
+		}		
+		
+		static public function printDataGrid(printJob:FlexPrintJob, gridColumns:Array, dataProviderForGrid:Object, reportHeaderText: String, gridFontSize:int=8, reportHeaderFontSize:int=8):void{
+	                // Create a FormPrintView control as a child of the current view.
+            var dataGridPrintView:ReportDataGridPrintView = new ReportDataGridPrintView();
+           Application.application.addChild(dataGridPrintView);
+
+            //Set the print view properties.
+            //FlexPrintJobScaleType
+            dataGridPrintView.width=printJob.pageWidth;
+            dataGridPrintView.height=printJob.pageHeight;
+            dataGridPrintView.lblHeaderText = reportHeaderText;
+            // Set the data provider of the FormPrintView component's data grid
+            // to be the data provider of the displayed data grid.
+            dataGridPrintView.reportDataGrid.columns = gridColumns;
+            dataGridPrintView.reportDataGrid.dataProvider = dataProviderForGrid;
+            dataGridPrintView.reportDataGrid.setStyle('fontSize', gridFontSize);
+            dataGridPrintView.header.setStyle('fontSize', reportHeaderFontSize);
+            // Create a single-page image.
+            dataGridPrintView.showPage("single");
+            // If the print image's data grid can hold all the provider's rows,
+            // add the page to the print job.
+            if(!dataGridPrintView.reportDataGrid.validNextPage)
+            {
+                printJob.addObject(dataGridPrintView);
+            }
+            // Otherwise, the job requires multiple pages.
+            else
+            {
+                // Create the first page and add it to the print job.
+                dataGridPrintView.showPage("first");
+                printJob.addObject(dataGridPrintView);
+                dataGridPrintView.pageNumber++;
+                // Loop through the following code until all pages are queued.
+                while(true)
+                {
+                    // Move the next page of data to the top of the print grid.
+                    dataGridPrintView.reportDataGrid.nextPage();
+                    dataGridPrintView.showPage("last");
+                    // If the page holds the remaining data, or if the last page
+                    // was completely filled by the last grid data, queue it for printing.
+                    // Test if there is data for another PrintDataGrid page.
+                    if(!dataGridPrintView.reportDataGrid.validNextPage)
+                    {
+                        // This is the last page; queue it and exit the print loop.
+                        printJob.addObject(dataGridPrintView);
+                        break;
+                    }
+                    else
+                    // This is not the last page. Queue a middle page.
+                    {
+                        dataGridPrintView.showPage("middle");
+                        printJob.addObject(dataGridPrintView);
+                        dataGridPrintView.pageNumber++;
+                    }
+                }
+            }
+            // All pages are queued; remove the FormPrintView control to free memory.
+            Application.application.removeChild(dataGridPrintView);
+		}
+				
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/Vista.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/Vista.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/util/Vista.as	(revision 1227)
@@ -0,0 +1,97 @@
+/* Vista.as */
+
+package gov.va.med.edp.util
+{
+	import mx.collections.ICollectionView;
+	import mx.formatters.DateFormatter;	
+	
+	public class Vista
+	{
+		private static const DT_FORMAT: String = "D MMM YY J:NN";
+				
+		/*
+		Searches a collection for the index of the item that matches that data value
+		*/
+		public static function locateIndex(collection: ICollectionView, 
+			value: Object, property: String = "data"): int
+		{
+			for (var i:int; i < collection.length; i++) {
+				var item:Object = collection[i];
+				if (item.hasOwnProperty(property) && (item[property] == value)) return i;
+			}
+			return -1;
+		}
+
+		/*
+		Returns the numeric identifier for an object at an index in a collection
+		*/
+		public static function getIDFieldAtIndex(collection: ICollectionView, 
+			index: int, property: String = "data"): Number
+		{
+			if (index < 0) return NaN;
+			if (index < collection.length) {
+				var item:Object = collection[index];
+				if (item.hasOwnProperty(property)) return item[property];
+			}
+			return NaN;
+		}
+		
+		public static function FMtoDate(fmDT: String): Date
+		{
+			if (fmDT.length < 7) {
+				return null;
+			}
+			
+			var x:String = fmDT + "00000";
+			var y:int = int(x.substr(0,3)) + 1700;
+			var m:int = int(x.substr(3,2)) - 1;
+			var d:int = int(x.substr(5,2));
+			var h:int = int(x.substr(8,2));
+			var n:int = int(x.substr(10,2));
+			return new Date(y,m,d,h,n);
+		}
+		
+		public static function DatetoFM(aDate: Date): String
+		{
+			if (aDate == null) return "";
+			
+			var y:int = (aDate.fullYear - 1700) * 10000;
+			var m:int = (aDate.month + 1) * 100;
+			var d:int = aDate.date;
+			var h:String = "00" + String(aDate.hours);
+			var n:String = "00" + String(aDate.minutes);
+
+			if ((y+m+d) == 0) return "";
+			
+			if ((aDate.hours + aDate.minutes) > 0) {
+				return String(y+m+d) + "." + h.substr(-2,2) + n.substr(-2,2); 
+			} else {
+				return String(y+m+d);
+			}
+		}
+		
+		public static function formattedDate(aDate: Date, formatString:String=null): String
+		{
+			if (aDate == null) {
+				return "";
+			}
+			
+			var formatter:DateFormatter = new DateFormatter();
+			if (formatString != null){
+				formatter.formatString = formatString;
+			} else {
+			formatter.formatString = DT_FORMAT;
+			}
+			
+			return formatter.format(aDate);
+		}
+		
+		public static function getBooleanValueForString(str: String): Boolean
+		{
+			if (str == "true") {
+				return true;
+			}
+			return false;
+		}		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/DisconnectedDialog.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/DisconnectedDialog.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/DisconnectedDialog.mxml	(revision 1227)
@@ -0,0 +1,120 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:widget="gov.va.med.edp.widget.*"
+                title="EDIS Server Unavailable"
+                creationComplete="creationCompleteHandler()"
+                minWidth="600" showCloseButton="false" horizontalAlign="right" verticalAlign="top" layout="vertical"
+                paddingTop="10" paddingLeft="10" paddingRight="10" xmlns:accessibility="flash.accessibility.*">
+    <mx:Script>
+		<![CDATA[
+			import gov.va.med.edp.util.AccessibilityTools;
+		import gov.va.med.edp.control.ModalDialogEvent;
+	    import gov.va.med.edp.model.TrackingModelLocator;
+        import gov.va.med.edp.widget.Spinner;
+        import mx.binding.utils.ChangeWatcher;
+        import mx.collections.ArrayCollection;
+        import mx.controls.Spacer;
+        import mx.core.Application;
+        import mx.core.IFlexDisplayObject;
+        import mx.managers.PopUpManager;
+
+
+        private static var dialog:DisconnectedDialog;
+
+        public static function show() : void {
+            if (dialog != null) return;
+            dialog = DisconnectedDialog(PopUpManager.createPopUp(Application.application as DisplayObject, DisconnectedDialog, true));
+	    	//Dispatch the event for getting clear background on PopuP Modal Dialog to support Jaws Virtual Cursor Mode..
+        	Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.OPEN));            
+            PopUpManager.centerPopUp(dialog);
+        }
+
+        public static function hide() : void {
+            if (dialog == null) return;
+		    //Dispatch the event for removing the clear background on closing PopuP Modal Dialog and returning to normal view
+    	    Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.CLOSE));            
+            PopUpManager.removePopUp(dialog);
+            dialog = null;
+        }
+
+        [Bindable]
+        public var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private var _connecting:Boolean;
+
+        [Bindable]
+        public function get connecting():Boolean {
+            return _connecting;
+        }
+
+        public function set connecting(b:Boolean):void {
+            _connecting = b;
+            if (_connecting) {
+                spinner.play();
+            } else {
+                spinner.stop();
+            }
+        }
+
+        private function connectingStatusChanged() : void {
+            if (model.connecting) {
+                spinner.play();
+            } else {
+                spinner.stop();
+            }
+        }
+
+        private function reconnectButtonHandler() : void {
+            model.attemptReconnect();
+        }
+        
+        private function creationCompleteHandler() : void {
+			var focusTimer: Timer = new Timer(300, 1);
+			focusTimer.addEventListener(TimerEvent.TIMER, moveFocus);
+            focusTimer.start();
+        }        
+        
+        private function moveFocus(e: TimerEvent): void
+	    {
+	         if (AccessibilityTools.isAccessibilityActive()) {
+	         	messageBox.setFocus();
+	         	messageBox.editable = true;
+	         } else {
+	         	reconnectNowButton.setFocus();
+	         }
+	    }        
+
+		]]>
+    </mx:Script>
+    <accessibility:AccessibilityProperties name="Popup Dialog  {this.title}"  id="accessibleMessage"/>
+
+    <mx:states>
+		<mx:State name="detailsShowing">
+			<mx:AddChild relativeTo="{content}" position="lastChild">
+					<mx:TextArea id="detailArea" width="100%" minWidth="400" minHeight="300" text="{model.disconnectionFault}"/>
+			</mx:AddChild>
+			<mx:RemoveChild target="{showDetailsButton}"/>
+			<mx:AddChild relativeTo="{reconnectNowButton}" position="before">	
+				<mx:Button id="hideButton" label="Hide Details" click="currentState = '';"/>
+			</mx:AddChild>
+		</mx:State>
+	</mx:states>
+
+    <mx:VBox id="content" height="100%" width="100%">
+        <mx:HBox width="100%" verticalAlign="middle">
+            <mx:Image source="@Embed('critical_icon.jpg')" width="32" height="32"/>
+            <mx:TextArea id="messageBox" width="100%" editable="false" borderThickness="0" tabIndex="1"
+                     text="The last attempt to connect to the server timed out due to either network or server unavailability.  This program does not have the ability to diagnose the problem further."/>
+        </mx:HBox>
+        <mx:Label width="100%" textAlign="right" tabIndex="2"
+                  text="{model.connecting ? '...trying to reconnect...' : 'Will try to reconnect in ' + model.reconnectSeconds + ' seconds.'}"/>
+    </mx:VBox>
+    <mx:ControlBar horizontalAlign="right">
+        <widget:Spinner id="spinner" autoPlay="false" numTicks="10" size="20" tickWidth="2"/>
+        <mx:Spacer id="spacer" width="100%"/>
+        <mx:Button id="showDetailsButton" label="Show Details" click="currentState = 'detailsShowing';" tabIndex="3"/>
+        <mx:Button id="reconnectNowButton" label="Try to Reconnect Now" click="reconnectButtonHandler()" tabIndex="4"
+                   enabled="{!model.connecting}"/>
+    </mx:ControlBar>
+
+   <mx:Binding source="{model.connecting}" destination="connecting"/>
+</mx:TitleWindow>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/ErrorDialog.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/ErrorDialog.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/ErrorDialog.mxml	(revision 1227)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" title="Emergency Department Integration Software Error" 
+	creationComplete="creationCompleteHandler()" minWidth="600" showCloseButton="false" horizontalAlign="right" verticalAlign="top" 
+	layout="vertical" xmlns:accessibility="flash.accessibility.*">
+	<mx:Script>
+	
+		<![CDATA[
+			import gov.va.med.edp.util.AccessibilityTools;
+			import gov.va.med.edp.control.ModalDialogEvent;
+			import gov.va.med.edp.control.ClearUnsavedViewsModelEvent;
+			import gov.va.med.edp.model.TrackingModelLocator;
+			import mx.utils.ObjectUtil;
+			import mx.collections.ArrayCollection;
+			import mx.core.Application;
+			import mx.core.IFlexDisplayObject;
+            import mx.events.CloseEvent;
+            import mx.managers.PopUpManager;
+			
+			[Bindable]
+			private var message : String;
+			
+			[Bindable]
+			private var details : String;
+			
+			[Bindable]
+			private var closeButtonLabel : String;
+
+            private var closeListener : Function = null;
+	
+			public static function show(message:String,
+                                        detail:Object = null,
+                                        title:String = null,
+                                        closeListener:Function = null,
+                                        closeButtonLabel:String = "Close") : void {
+				var dialog:ErrorDialog = ErrorDialog(PopUpManager.createPopUp(Application.application as DisplayObject, ErrorDialog, true));
+                if (title != null && title.length > 0)
+                    dialog.title = title;
+                dialog.closeButtonLabel = closeButtonLabel;
+				dialog.message = message;
+				dialog.details = detail != null ? ObjectUtil.toString(detail) : "No details available for this error.";
+                dialog.closeListener = closeListener;
+                
+		    	//Dispatch the event for getting clear background on PopuP Modal Dialog to support Jaws Virtual Cursor Mode..
+            	Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.OPEN));                 
+                PopUpManager.centerPopUp(dialog);
+			}
+
+            public static function fatal(message:String, detail:Object = null, title:String = null) : void {
+                show(message, detail, title, logout, "Exit");
+            }
+
+            private static function logout(): void {
+				ClearUnsavedViewsModelEvent.dispatchClearUnsavedViews();
+				TrackingModelLocator.getInstance().logout();
+			}
+
+            private function closeButtonHandler() : void {
+		    	//Dispatch the event for removing the clear background on closing PopuP Modal Dialog and returning to normal view
+    	        Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.CLOSE));		
+
+                PopUpManager.removePopUp(this);
+                if (closeListener != null) {
+                    closeListener();
+                }
+            }
+			
+			private function copyToClipboard() : void {
+				flash.system.System.setClipboard(details);
+			}
+			
+	        private function creationCompleteHandler() : void {
+				var focusTimer: Timer = new Timer(350, 1);
+				focusTimer.addEventListener(TimerEvent.TIMER, moveFocus);
+	            focusTimer.start();
+	
+	        }			
+	        
+	        private function moveFocus(e: TimerEvent): void
+		    {
+		         if (AccessibilityTools.isAccessibilityActive()) {
+		         	messageBox.setFocus();
+		         	messageBox.editable = true;
+		         } else {
+		         	closeBtn.setFocus();
+		         }
+		    }			
+			
+		]]>
+	</mx:Script>
+    <accessibility:AccessibilityProperties name="Popup Dialog  {this.title}"  id="accessibleMessage"/>
+	
+	<mx:states>
+		<mx:State name="detailsShowing">
+			<mx:AddChild relativeTo="{content}" position="lastChild">
+					<mx:TextArea id="detailArea" width="100%" minWidth="400" minHeight="300" text="{details}"/>	
+			</mx:AddChild>
+			<mx:AddChild relativeTo="{spacer}" position="before">				
+					<mx:Button label="Copy to Clipboard" id="copy2ClipboardButton" click="copyToClipboard();"/>
+			</mx:AddChild>
+			<mx:RemoveChild target="{showDetailsButton}"/>
+			<mx:AddChild relativeTo="{closeBtn}" position="before">	
+				<mx:Button id="hideButton" label="Hide Details" click="currentState = '';"/>
+			</mx:AddChild>		
+		</mx:State>
+	</mx:states>
+	<mx:VBox id="content" height="100%" width="100%">
+		<mx:HBox width="100%" verticalAlign="middle">
+			<mx:Image source="@Embed('critical_icon.jpg')" width="32" height="32"/>
+			<mx:TextArea id="messageBox" text="{message}" width="100%" enabled="true" borderThickness="0" editable="false" accessibilityProperties="{accessibleMessage}"/>
+		</mx:HBox>
+	</mx:VBox>
+	<mx:ControlBar id="buttonBar" horizontalAlign="right">
+		<mx:Spacer id="spacer" width="100%"/>
+		<mx:Button id="showDetailsButton" label="Show Details" click="currentState = 'detailsShowing';"/>
+		<mx:Button id="closeBtn" label="{closeButtonLabel}" click="closeButtonHandler();"/>
+	</mx:ControlBar>
+</mx:TitleWindow>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/HelpMessage.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/HelpMessage.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/HelpMessage.mxml	(revision 1227)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Panel
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	layout="vertical" borderAlpha="1" >
+
+	<mx:Script>
+	<![CDATA[
+		import mx.managers.PopUpManager;
+		
+		private function closeWindow(): void
+		{
+			PopUpManager.removePopUp(this);	
+		}
+	]]>
+	</mx:Script>
+	<mx:Text id="message" />
+	<mx:Canvas width="100%" >
+		<mx:Button
+			label="Close"
+			top="12" right="12" bottom="12"
+			click="closeWindow()" />		
+	</mx:Canvas>
+</mx:Panel>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/LoadingDialog.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/LoadingDialog.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/LoadingDialog.mxml	(revision 1227)
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:widget="gov.va.med.edp.widget.*"
+                title="Please Wait..."
+                minWidth="600" minHeight="100" showCloseButton="false" horizontalAlign="right" verticalAlign="top" layout="vertical"
+                paddingTop="10" paddingLeft="10" paddingRight="10">
+    <mx:Script>
+		<![CDATA[
+			import mx.core.Application;
+			import mx.managers.PopUpManager;
+
+        private static var dialog:LoadingDialog;
+
+        public static function show() : void {
+            if (dialog != null) return;
+            dialog = LoadingDialog(PopUpManager.createPopUp(Application.application as DisplayObject, LoadingDialog, true));
+            PopUpManager.centerPopUp(dialog);
+        }
+
+        public static function hide() : void {
+            if (dialog == null) return;
+            PopUpManager.removePopUp(dialog);
+            dialog = null;
+        }
+
+
+		]]>
+    </mx:Script>
+    <mx:VBox id="content" height="90%" width="100%">
+        <mx:HBox width="100%" verticalAlign="middle">
+            <mx:Image source="@Embed('loading_icon.gif')" width="32" height="32"/>
+            <mx:Text fontSize="18" width="100%"
+                     text="Loading..." textAlign="center"/>
+        </mx:HBox>
+     </mx:VBox>
+     <!--mx:HBox width="100%" height="10%" horizontalAlign="center">
+        	<mx:Button label="Close" click="hide()" horizontalCenter="0"/>
+     </mx:HBox-->
+</mx:TitleWindow>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/TrackingViews.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/TrackingViews.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/TrackingViews.mxml	(revision 1227)
@@ -0,0 +1,242 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:HDividedBox
+        xmlns:mx="http://www.adobe.com/2006/mxml"
+        xmlns:log="gov.va.med.edp.view.log.*"
+        xmlns:reports="gov.va.med.edp.view.reports.*"
+        xmlns:board="gov.va.med.edp.view.board.*"
+        xmlns:config="gov.va.med.edp.view.config.*"
+        xmlns:debug="gov.va.med.edp.view.debug.*"
+        xmlns:widget="gov.va.med.edp.widget.*"
+        xmlns:pt-model="gov.va.med.edp.pt.demog.model.*"
+        xmlns:pt-ctrl="gov.va.med.edp.pt.demog.control.*"
+        xmlns:pt-dao="gov.va.med.edp.pt.demog.dao.*"
+        width="100%" height="100%"
+        paddingBottom="0" paddingTop="0" paddingLeft="0" paddingRight="0"
+        creationComplete="activateAutoScroll();">
+
+    <mx:Script>
+        <![CDATA[
+        import gov.va.med.edp.widget.OkCancelDialog;
+        import gov.va.med.edp.view.debug.LastNetworkCallView;
+        import mx.events.CloseEvent;
+        import mx.events.ItemClickEvent;
+        import mx.core.Container;
+        import gov.va.med.edp.model.TrackingModelLocator;
+        import gov.va.med.edp.control.SwitchAppViewEvent;
+        import gov.va.med.edp.vo.LookupVO;
+        import gov.va.med.edp.util.AccessibilityTools;
+        import gov.va.med.edp.util.AutoScrollView;
+
+		[Embed(source="EDIS_Small.png")]
+        [Bindable]
+		private var EDIS_LOGO:Class;
+
+        [Bindable]
+        public var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private var nextView: int;
+
+        /**
+         *  Function:  activateAutoScroll()
+         *  Parameters:
+         *           NA
+         *  Description:
+         *    Activate auto scroll screen when component is not visible
+         *  Created by: jtorreno
+         *  Date: 2008.05.08
+         **/
+        private function activateAutoScroll(): void
+        {
+            AutoScrollView.setupFocusViewportWatcher(this, focusManager);
+        }
+
+        private function displayLastBrokerCallView(): void
+        {
+            trackingViews.addChildAt(new LastNetworkCallView(), trackingViews.getChildren().length);
+            trackingViews.selectedChild = lastNetworkCallView;
+        }
+
+        private function findView(appView: int): Container
+        {
+            appList.callLater(hiliteView);
+
+            switch (appView) {
+                case TrackingModelLocator.VIEW_APP_NO_VIEWS:
+                    return noneView;
+                case TrackingModelLocator.VIEW_APP_SIGN_IN:
+                case TrackingModelLocator.VIEW_APP_TRIAGE:
+                case TrackingModelLocator.VIEW_APP_UPDATE:
+                case TrackingModelLocator.VIEW_APP_DISPOSITION:
+                case TrackingModelLocator.VIEW_APP_EDIT_CLOSED:
+                    return logEntryView;
+                case TrackingModelLocator.VIEW_APP_DISPLAY_BOARD:
+                    return boardView;
+                case TrackingModelLocator.VIEW_APP_ASSIGN_STAFF:
+                    return staffView;
+                case TrackingModelLocator.VIEW_APP_REPORTS:
+                    return reportsView;
+                case TrackingModelLocator.VIEW_APP_CONFIGURE:
+                    return configView;
+                default:
+                    return noneView;
+            }
+        }
+
+        private function hiliteView(): void
+        {
+
+            if (trackingViews.selectedChild == lastNetworkCallView) {
+                debugLink.styleName = "linkSelected";
+                appList.enabled = false;
+            } else {
+                debugLink.styleName = "linkUnSelected";
+                appList.enabled = true;
+            }
+
+        }
+
+        private function attemptSwitchView(event: ItemClickEvent): void
+        {
+            // there's got to be a better way
+            nextView = (event.item as LookupVO).data;
+
+            var curView: int = model.appViewState;
+            var curViewIsLog: Boolean = (
+                    (curView == TrackingModelLocator.VIEW_APP_SIGN_IN) ||
+                    (curView == TrackingModelLocator.VIEW_APP_TRIAGE) ||
+                    (curView == TrackingModelLocator.VIEW_APP_UPDATE) ||
+                    (curView == TrackingModelLocator.VIEW_APP_DISPOSITION) );
+            var nextViewIsLog: Boolean = (
+                    (nextView == TrackingModelLocator.VIEW_APP_SIGN_IN) ||
+                    (nextView == TrackingModelLocator.VIEW_APP_TRIAGE) ||
+                    (nextView == TrackingModelLocator.VIEW_APP_UPDATE) ||
+                    (nextView == TrackingModelLocator.VIEW_APP_DISPOSITION) );
+
+            if (model.logEdit.dirty && ((nextViewIsLog == false) ||
+                                        (curView == TrackingModelLocator.VIEW_APP_EDIT_CLOSED))) {
+                OkCancelDialog.show("Are you sure you want to change views?\n\n" +
+                                    "You have unsaved changes.\nIf you continue, you will lose the changes.\n\n" +
+                                    "Press OK to continue and lose the changes.\n" +
+                                    "Press Cancel to stay and save the changes.", "Discard Changes?", attemptSwitchHandler, appList);
+            } else {
+                if ((curViewIsLog == false) && (nextViewIsLog)) {
+                    // refresh the current entry
+                    logEntryView.logEntrySelector.switchLogEntry();
+                }
+                switchView(nextView);
+            }
+        }
+
+        private function attemptSwitchHandler(event: CloseEvent): void
+        {
+            if (event.detail == OkCancelDialog.OK) {
+                logEntryView.logEntryEditor.cancelEdit();
+                switchView(nextView);
+            } else {
+                nextView = model.appViewState;
+                switchView(model.appViewState);
+            }
+        }
+
+        private function switchView(newView: int): void
+        {
+            var e: SwitchAppViewEvent = new SwitchAppViewEvent(SwitchAppViewEvent.EVENT_SWITCH_APP_VIEW);
+            e.view = newView;
+            e.dispatch();
+            appList.selectedIndex = getSelectedTab(newView);
+        }
+
+        private function showHelp(): void
+        {
+            var helpUrl:String = model.helpContextRootURL + model.appViewHelp(model.appViewState) + ".html";
+            var request: URLRequest = new URLRequest(helpUrl);
+            navigateToURL(request, "_blank");
+        }
+
+        private function getSelectedTab(appView: int): int
+        {
+            for (var i: int = 0; i < model.appViewList.length; i++) {
+                if (appView == model.appViewList[i].data) return i;
+            }
+            return 0;
+        }
+        ]]>
+    </mx:Script>
+
+    <mx:VBox
+            width="90" height="100%"
+            horizontalScrollPolicy="off" verticalScrollPolicy="off" tabChildren="true" paddingLeft="6" paddingBottom="6">
+		<mx:HBox width="100%" horizontalAlign="left" verticalAlign="bottom">
+			<!-- <mx:Image source="{EDIS_LOGO}"/>-->
+			 <mx:Label text="v{model.appClientVersion}" styleName="lightLabel" />
+		</mx:HBox>
+        <mx:Spacer height="2"/>
+        <widget:LinkButtonTabBar
+                id="appList"
+                direction="vertical"
+                dataProvider="{model.appViewList}"
+                itemClick="attemptSwitchView(event)"
+                tabStyleName="linkUnSelected" selectedTabTextStyleName="linkSelected" tabIndex="1" width="100%"/>
+        <mx:Spacer height="100%"/>
+        <widget:LinkButton id="debugLink"
+                           label="Debug"
+                           click="displayLastBrokerCallView()"
+                           visible="{model.session.debugEnabled}"
+                           focusEnabled="true"
+                           height="20"
+                           textAlign="left"
+                           tabIndex="100001" width="100%" paddingLeft="2" paddingRight="2"/>
+        <widget:LinkButton
+                label="Logout"
+                textAlign="left"
+                height="20"
+                id="logoutBtn"
+                focusEnabled="true"
+                click="model.logout()"
+                tabIndex="100002" width="100%" paddingLeft="2" paddingRight="2"/>
+    </mx:VBox>
+
+    <mx:VBox
+            width="100%" height="100%" tabChildren="true">
+        <mx:Canvas
+                id="titleArea"
+                width="100%" tabChildren="true">
+            <mx:Label
+                    id="lblTitle"
+                    text="{model.appViewTitle(model.appViewState)}"
+                    toolTip="{model.appViewTitle(model.appViewState)}"
+                    horizontalCenter="0"
+                    paddingTop="0" paddingBottom="0"
+                    styleName="viewTitle"/>
+            <!-- because of the accessibility bug with LinkButtons, Make them look like link buttons for common look and feel-->
+            <widget:LinkButton
+                    icon="@Embed(source='help.png')"
+                    id="help"
+                    focusEnabled="true"
+                    initialize="{AccessibilityTools.accessComponentName(help,'Help')}"
+                    right="6" top="2"
+                    click="showHelp();" tabIndex="100000"/>
+        </mx:Canvas>
+
+        <mx:ViewStack
+                id="trackingViews"
+                width="100%" height="100%"
+                selectedChild="{findView(model.appViewState)}">
+
+            <mx:Canvas id="noneView">
+                <mx:Label horizontalCenter="0" verticalCenter="0" text="No Views Configured"/>
+            </mx:Canvas>
+
+            <log:LogEntryView id="logEntryView" ptChecksController="{ptChecksController}" patientChecksModel="{model.patientChecksModel}"/>
+            <board:DisplayBoard id="boardView"/>
+            <reports:ReportsContainerView id="reportsView"/>
+            <config:ConfigStaff id="staffView"/>
+            <config:ConfigView id="configView"/>
+            <debug:LastNetworkCallView id="lastNetworkCallView"/>
+        </mx:ViewStack>
+
+    </mx:VBox>
+
+    <pt-ctrl:PatientChecksController id="ptChecksController" model="{model.patientChecksModel}" dao="{ptChecksDao}"/>
+    <pt-dao:CairngormPatientChecksDao id="ptChecksDao" logArea="{model.logArea}"/>
+</mx:HDividedBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/board/BigDisplayBoard.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/board/BigDisplayBoard.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/board/BigDisplayBoard.mxml	(revision 1227)
@@ -0,0 +1,397 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
+		 width="100%" height="100%"
+		 paddingBottom="0" paddingRight="0" paddingLeft="0" paddingTop="0"
+		 show="initDisplayBoard()"
+		 hide="stopBoardTimer()" xmlns:widget="gov.va.med.edp.widget.*">
+
+	<mx:Script>
+		<![CDATA[
+			import mx.utils.ObjectUtil;
+		import gov.va.med.edp.util.BoardTools;
+		import gov.va.med.edp.view.LoadingDialog;
+		import mx.events.FlexEvent;
+		import mx.binding.utils.ChangeWatcher;
+		import mx.collections.ArrayCollection;
+		import mx.formatters.DateFormatter;
+		import mx.core.Application;
+		import mx.controls.dataGridClasses.DataGridColumn;
+		import mx.events.DataGridEvent;
+
+		import gov.va.med.edp.vo.ColumnSpecVO;
+		import gov.va.med.edp.control.DisplayBoardEvent;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.widget.ColorCellRenderer;
+		import gov.va.med.edp.control.SortHeaderEvent;
+		import gov.va.med.edp.control.NumberEvent;
+
+		[Bindable]
+		private var dateFormatter:DateFormatter;
+		private var sortColumn:DataGridColumn;
+
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		private	var visibleBoardTimer: Timer = new Timer(1200, 1);
+		private	var refreshTimer: Timer = new Timer(30000);
+		private var autoScrollTimer: Timer = new Timer(10000);
+		private var counter:int = 0;
+		private var boardName: String = "";
+
+		private var _disconnected:Boolean = false;
+		private var _connecting:Boolean = false;
+
+		private static var MINIMUM_FONT_SIZE:Number = 9;
+		private static var MINIMUM_ROW_HEIGHT:int = 18;
+
+		[Bindable]
+		public function get disconnected():Boolean {
+			return _disconnected;
+		}
+
+		public function set disconnected(b:Boolean):void {
+			_disconnected = b;
+			if (_disconnected) {
+				if (dateFormatter == null) {
+					dateFormatter = new DateFormatter();
+					dateFormatter.formatString = "MMM DD,YY JJ:NN";
+				}
+				stopBoardTimer();
+				currentState = 'disconnected';
+			} else {
+				currentState = '';
+				startBoardTimer();
+			}
+		}
+
+		[Bindable]
+		public function get connecting():Boolean {
+			return _connecting;
+		}
+
+		public function set connecting(b:Boolean):void {
+			_connecting = b;
+			if (_connecting) {
+				connectingSpinner.play();
+			} else {
+				connectingSpinner.stop();
+			}
+		}
+
+		private function initDisplayBoard(): void
+		{
+			if (model.session.area < 1) return;
+
+			boardName = Application.application.parameters.board;
+			model.reloadFunction = reload;
+
+			dispatchBoardInit();
+			visibleBoardTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeLoadingDialog);
+			refreshTimer.addEventListener(TimerEvent.TIMER, refreshDisplayBoard);
+			refreshTimer.start();
+			visibleBoardTimer.start();
+			
+			autoScrollTimer.addEventListener(TimerEvent.TIMER, doScroll);
+
+			model.reconnectFunction = reconnect;
+
+			LoadingDialog.show();
+		}
+
+		private function dispatchBoardInit(): void {
+			var resetEvent: DisplayBoardEvent = new DisplayBoardEvent(DisplayBoardEvent.EVENT_INIT_DISPLAY_BOARD);
+			resetEvent.name = boardName;
+			resetEvent.dispatch();
+		}
+
+		private function reconnect():void {
+			dispatchBoardInit();
+		}
+
+		private function reload():void {
+			var url:String = TrackingModelLocator.getInstance().rootURL;
+			if (TrackingModelLocator.getInstance().contextRoot.indexOf("main") != -1) {
+				url += "board.html";
+			} else {
+				url += "bigboard.html";
+			}
+			if (Application.application.parameters.board || Application.application.parameters.area) {
+				url += "?";
+			}
+			if (Application.application.parameters.board) {
+				url += "board=" + Application.application.parameters.board;
+			}
+			if (Application.application.parameters.area) {
+				if (Application.application.parameters.board) url += "&";
+				url += "area=" + Application.application.parameters.area;
+			}
+			navigateToURL(new URLRequest(url), "_top");                        
+		}
+
+		private function stopBoardTimer(): void
+		{
+			refreshTimer.reset();
+		}
+
+		private function startBoardTimer(): void
+		{
+			if (!refreshTimer.running) refreshTimer.start();
+		}
+
+		private function refreshDisplayBoard(event: TimerEvent): void
+		{
+			if (model.session.area < 1) return;
+
+			var refreshEvent: DisplayBoardEvent =
+					new DisplayBoardEvent(DisplayBoardEvent.EVENT_REFRESH_DISPLAY_BOARD);
+			refreshEvent.name = boardName;
+			refreshEvent.dispatch();
+
+		}
+
+		private function removeLoadingDialog(event: TimerEvent): void
+		{
+			LoadingDialog.hide();
+		}
+
+		private function set readyToBuild(value: Boolean): void
+		{
+			if (value == true) {
+				callLater(buildColumns);
+			}
+		}
+
+		private function buildColumns(): void
+		{
+			clearBoardProperties();
+			var newCols:Array = new Array();
+			var newCol: DataGridColumn;
+			for each (var colInfo: ColumnSpecVO in model.boardSpec.columns) {
+				newCol = new DataGridColumn(colInfo.attribute);
+				newCol.headerText = colInfo.header;
+				newCol.dataField = colInfo.attribute;
+				newCol.width = colInfo.width;
+
+				//set the label and sort function for any minute based columns
+				if (colInfo.attribute.indexOf("min") != -1) {
+					newCol.sortCompareFunction = sortMinutes;
+					newCol.labelFunction = BoardTools.displayTimeAsHrsAndMins;
+				}
+
+
+				if ((colInfo.attribute == "@last4") || (colInfo.attribute == "@ptNm")) {
+					newCol.itemRenderer = new ClassFactory(gov.va.med.edp.widget.PatientCellRenderer);
+				} else if (colInfo.attribute == "@visit") {
+					newCol.itemRenderer = new ClassFactory(gov.va.med.edp.widget.VisitRenderer);
+				} else {
+					newCol.itemRenderer = new ClassFactory(gov.va.med.edp.widget.ColorCellRenderer);
+				}
+				newCols.push(newCol);
+			}
+
+			board.columns = newCols;
+
+			//Set the Board properties here..
+			board.width = model.boardSpec.displayBoardProperties.displaySize.width;
+
+			//start the timer and get original DG properties
+			doScroll(new TimerEvent(TimerEvent.TIMER));
+			initAutoScrollTimer();
+
+			board.setVisible(true);
+		}
+
+		private function initAutoScrollTimer(): void {
+			autoScrollTimer.reset();
+			autoScrollTimer.delay = model.boardSpec.displayBoardProperties.scrollDelay * 1000;
+			autoScrollTimer.start();
+		}
+
+		private function clearBoardProperties(): void
+		{
+			counter = 0;
+			if (board != null) {
+				board.invalidateSize();
+				board.invalidateDisplayList();
+				board.invalidateProperties();
+				board.invalidateList();
+				board.initialize();
+			}
+		}
+
+		// this must be called later by handleHeader for the sortField to be accurate
+		private function saveSortInfo(col:DataGridColumn): void
+		{
+			var sortEvent:SortHeaderEvent =
+					new SortHeaderEvent(SortHeaderEvent.EVENT_SORT_DISPLAY_BOARD);
+			sortEvent.sortDescending = col.sortDescending;
+			sortEvent.sortField = col.dataField;
+			sortEvent.dispatch();
+		}
+
+		private function handleHeader(event:DataGridEvent): void
+		{
+			sortColumn = DataGridColumn(event.currentTarget.columns[event.columnIndex]);
+			callLater(saveSortInfo, [sortColumn]);
+		}
+
+
+		private function sortMinutes(obj1:Object, obj2:Object):int
+		{
+			if (sortColumn == null) return 0;
+
+			var num1:Number = parseInt(obj1[sortColumn.dataField]);
+			var num2:Number = parseInt(obj2[sortColumn.dataField]);
+			return ObjectUtil.numericCompare(num1, num2);
+		}
+
+		private function doScroll(event: TimerEvent): void
+		{
+			if (isSquishOrAutoScrollingNeeded()) {
+				if (model.boardSpec.displayBoardProperties.squish) {
+					doSquishIfPossible();
+				} else {
+					startScrolling();
+				}
+			} else {
+				board.verticalScrollPosition = 0;
+				resetOriginalBoardProperties();
+			}
+		}
+
+
+		private function isSquishOrAutoScrollingNeeded(): Boolean
+		{
+			var neededRowHeight: Number = model.boardData.length * getGridRowHeight();
+			if ((neededRowHeight + board.headerHeight) < board.height) {
+				return false;
+			}
+			return true;
+		}
+
+
+		private function doSquishIfPossible(): void
+		{
+			if (isSquishPossible()) {
+				squishDGRows();
+			} else {
+				startScrolling();
+			}
+		}
+
+
+		private function isSquishPossible(): Boolean
+		{
+			if (getSquishedGridRowHt() >= MINIMUM_ROW_HEIGHT) {
+				return true;
+			}
+			return false;
+		}
+
+		private function squishDGRows(): void
+		{
+			board.verticalScrollPolicy = "off";
+			var userConfiguredFontSize:int = model.boardSpec.displayBoardProperties.fontSize;
+			var squishedFontSize: Number = (getSquishedGridRowHt() / getGridRowHeight()) * userConfiguredFontSize;
+
+			var changeEvent: NumberEvent = new NumberEvent(NumberEvent.EVENT_CHANGE_SQUISH_FONT_SIZE);
+
+			if (squishedFontSize >= MINIMUM_FONT_SIZE && squishedFontSize <= userConfiguredFontSize) {
+				changeEvent.value = squishedFontSize;
+				board.setStyle("fontSize", squishedFontSize);
+				board.rowHeight = getSquishedGridRowHt();
+
+			} else if (squishedFontSize > userConfiguredFontSize) {
+				changeEvent.value = userConfiguredFontSize;
+				board.setStyle("fontSize", userConfiguredFontSize);
+				board.rowHeight = getGridRowHeight();
+			} else {
+				changeEvent.value = MINIMUM_FONT_SIZE;
+				board.setStyle("fontSize", MINIMUM_FONT_SIZE);
+				board.rowHeight = MINIMUM_ROW_HEIGHT
+			}
+			changeEvent.dispatch();
+		}
+
+		private function getSquishedGridRowHt(): Number
+		{
+			//40 pixels for making sure we see all the screen...Sometimes there is plastic that cover the actual screen in laptops etc..
+			//saw this on one of testing laptops where some portion of last row was hidden under plastic covering.. 
+			var boardHeight:Number = (board.height - board.headerHeight - 40);
+			var rowHeight:Number = boardHeight / (model.boardData.length + 1);
+			return rowHeight
+		}
+
+		//There is now way to calculate row height since everything is dynamic
+		//we can only go of something that we do know and it's user configured Font size.
+		private function getGridRowHeight(): int {
+			var rowHt:int = Math.floor(model.boardSpec.displayBoardProperties.fontSize * 2);
+			return rowHt;
+		}
+
+		private function startScrolling(): void {
+			//Reset the board properties back to original settings
+			resetOriginalBoardProperties();
+
+			//recalcuate the loops here in case the dataprovider has changed..
+			var actualRowCountNum:Number = (board.height - board.headerHeight) / getGridRowHeight();  //account for header
+			var actualRowCount:int = Math.floor(actualRowCountNum);
+			var loopsNum:Number = (model.boardData.length + 1) / (actualRowCount);
+			var numOfLoops:int = Math.ceil(loopsNum);
+
+
+			if (counter >= numOfLoops) counter = 0;
+			board.verticalScrollPosition = (counter * actualRowCount);
+			counter++;
+		}
+
+		private function resetOriginalBoardProperties(): void {
+			board.verticalScrollPolicy = "auto";
+			board.setStyle("fontSize", model.boardSpec.displayBoardProperties.fontSize);
+			board.rowHeight = getGridRowHeight();
+			var changeEvent: NumberEvent = new NumberEvent(NumberEvent.EVENT_CHANGE_SQUISH_FONT_SIZE);
+			changeEvent.value = model.boardSpec.displayBoardProperties.fontSize;
+			changeEvent.dispatch();
+		}
+                    
+		]]>
+	</mx:Script>
+
+	<mx:HBox
+			id="mainArea"
+			width="100%" height="100%"
+			styleName="contentArea">
+		<widget:DataGrid
+				id="board"
+				dataProvider="{model.boardData}"
+				headerRelease="handleHeader(event)"
+				width="100%" height="100%"
+				useRollOver="false"/>
+	</mx:HBox>
+
+	<mx:Binding source="model.boardSpec.specReady" destination="readyToBuild"/>
+	<mx:Binding source="model.disconnected" destination="disconnected"/>
+	<mx:Binding source="model.connecting" destination="connecting"/>
+
+	<mx:states>
+		<mx:State name="disconnected">
+			<mx:AddChild relativeTo="{mainArea}" position="before">
+				<mx:target>
+					<mx:VBox id="disconnectedBoardPanel" width="100%">
+						<mx:ApplicationControlBar paddingBottom="0" paddingTop="0" dock="true" width="100%"
+												  fillColors="[#FF0000,#BF0000]" fillAlphas="[0.8,0.8]">
+							<mx:Text id="disconnectionMessage" horizontalCenter="0" verticalCenter="0"
+									 textAlign="center" width="100%" height="100%" color="white"
+									 fontSize="{model.boardSpec.displayBoardProperties.fontSize}">
+								<mx:text>This board is disconnected from the server. Last updated
+									{dateFormatter.format(model.boardLastUpdated)}. {model.connecting ? "Trying to reconnect..." : "Will try to reconnect in " + model.reconnectSeconds + " seconds."}
+								</mx:text>
+							</mx:Text>
+							<widget:Spinner id="connectingSpinner" autoPlay="false" tickColor="#FFFFFF"/>
+						</mx:ApplicationControlBar>
+					</mx:VBox>
+				</mx:target>
+			</mx:AddChild>
+		</mx:State>
+	</mx:states>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/board/DisplayBoard.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/board/DisplayBoard.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/board/DisplayBoard.mxml	(revision 1227)
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- DisplayBoard.mxml -->
+
+<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
+	width="100%" height="100%"
+	paddingBottom="0" paddingRight="0" paddingLeft="0" paddingTop="0"
+	creationComplete="initDisplayBoard()"
+	show="startBoardTimer(false)"
+	hide="stopBoardTimer()"
+	styleName="contentArea" xmlns:accessibility="flash.accessibility.*">
+
+	<mx:Script>
+		<![CDATA[
+			import gov.va.med.edp.util.AccessibilityTools;
+			import mx.controls.Alert;
+			import mx.utils.ObjectUtil;
+			import gov.va.med.edp.util.BoardTools;
+			import gov.va.med.edp.view.LoadingDialog;
+			import gov.va.med.edp.widget.VisitRenderer;
+			import gov.va.med.edp.control.SortHeaderEvent;
+			import mx.controls.dataGridClasses.DataGridColumn;
+			import mx.events.DataGridEvent;
+			import gov.va.med.edp.vo.ColumnSpecVO;
+			import gov.va.med.edp.control.DisplayBoardEvent;
+			import gov.va.med.edp.model.TrackingModelLocator;
+			import gov.va.med.edp.widget.ColorCellRenderer;
+			
+			[Bindable]
+			private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+			private var sortColumn:DataGridColumn;
+			
+			private	var refreshTimer: Timer = new Timer(30000);
+			private	var visibleBoardTimer: Timer = new Timer(1000, 1);
+
+			private function initDisplayBoard(): void
+			{
+				if (model.session.area < 1) return;
+				
+				var resetEvent: DisplayBoardEvent =
+					new DisplayBoardEvent(DisplayBoardEvent.EVENT_INIT_DISPLAY_BOARD);
+				resetEvent.dispatch();
+
+				refreshTimer.addEventListener(TimerEvent.TIMER, refreshDisplayBoard);
+				visibleBoardTimer.addEventListener(TimerEvent.TIMER_COMPLETE, removeLoadingDialog);
+
+                LoadingDialog.show();				
+				visibleBoardTimer.start();
+				
+				startBoardTimer(true);
+			}
+			
+			private function startBoardTimer(firstTime:Boolean): void
+			{
+				//Dispatch a refresh event so that ppl are able to see their
+				//changes right away rather than sitting around waiting..
+				if (!firstTime)refreshDisplayBoard(new TimerEvent(TimerEvent.TIMER));
+				//do not refresh the display doard when the JAWS reader is active
+				//only fire refresh on demand by pressing F7 key...
+				if (!AccessibilityTools.isAccessibilityActive())refreshTimer.start();
+				callLater(board.setFocus);
+			}			
+			
+			private function stopBoardTimer(): void
+			{
+				refreshTimer.stop();
+			}
+			
+			private function refreshDisplayBoard(event: TimerEvent): void
+			{
+				if (model.session.area < 1) return;
+
+				var refreshEvent: DisplayBoardEvent =
+					new DisplayBoardEvent(DisplayBoardEvent.EVENT_REFRESH_DISPLAY_BOARD);
+				refreshEvent.dispatch();
+            }
+			
+			private function set readyToBuild(value: Boolean): void
+			{
+				if (value == true) {
+					callLater(buildColumns);
+				}
+			}		
+			
+			private function buildColumns(): void
+			{
+				var newCols:Array = new Array();
+				var newCol: DataGridColumn;
+				for each (var colInfo: ColumnSpecVO in model.boardSpec.columns) {
+					newCol = new DataGridColumn(colInfo.attribute);
+					newCol.headerText = colInfo.header;
+					newCol.dataField = colInfo.attribute;
+					newCol.width = colInfo.width;
+					
+					//set the label and sort function for any minute based columns
+					if (colInfo.attribute.indexOf("min") != -1 ) {
+						newCol.sortCompareFunction = sortMinutes;
+						newCol.labelFunction = BoardTools.displayTimeAsHrsAndMins;
+					}	
+
+					if ((colInfo.attribute == "@last4") || (colInfo.attribute == "@ptNm")) {
+						newCol.itemRenderer = new ClassFactory(gov.va.med.edp.widget.PatientCellRenderer);
+						//newCol.labelFunction = renderPatientName;
+					} else if (colInfo.attribute == "@visit") {
+						newCol.itemRenderer = new ClassFactory(gov.va.med.edp.widget.VisitRenderer);
+					} else {
+						newCol.itemRenderer = new ClassFactory(gov.va.med.edp.widget.ColorCellRenderer);	
+					}
+					newCols.push(newCol);
+				}
+				board.columns = newCols;
+                callLater(board.setFocus);
+            }
+			
+			private function sortMinutes(obj1:Object, obj2:Object):int
+			{
+				if (sortColumn == null) return 0;
+				
+				var num1:Number = parseInt(obj1[sortColumn.dataField]);
+				var num2:Number = parseInt(obj2[sortColumn.dataField]);
+				return ObjectUtil.numericCompare(num1, num2);
+			}				
+			
+            private function removeLoadingDialog(event: TimerEvent): void
+			{
+				LoadingDialog.hide();
+				board.setFocus();
+			}			
+			
+			// this must be called later by handleHeader for the sortField to be accurate
+			private function saveSortInfo(col:DataGridColumn): void
+			{
+				var sortEvent:SortHeaderEvent = 
+					new SortHeaderEvent(SortHeaderEvent.EVENT_SORT_DISPLAY_BOARD);
+				sortEvent.sortDescending = col.sortDescending;
+				sortEvent.sortField = col.dataField;
+				sortEvent.dispatch();
+			}
+			
+			private function handleHeader(event:DataGridEvent): void
+			{
+				sortColumn = DataGridColumn(event.currentTarget.columns[event.columnIndex]);
+				callLater(saveSortInfo, [sortColumn]);
+			}
+			
+			private function refreshBoardOnDemand(event:KeyboardEvent): void
+			{
+				if (event.keyCode == Keyboard.F7){
+					refreshDisplayBoard(new TimerEvent(TimerEvent.TIMER));
+				}
+			}			
+
+		]]>
+	</mx:Script>
+	<accessibility:AccessibilityProperties id="accssibleProps" name="EDIS Tracker Display Board. Press F7 to refresh data in Display Board"/>
+ 	<mx:DataGrid
+		id="board"
+		accessibilityProperties="{accssibleProps}"
+		dataProvider="{model.boardData}"
+		headerRelease="handleHeader(event)"
+		keyDown="refreshBoardOnDemand(event)"
+		width="100%" height="100%"
+		useRollOver="false" tabIndex="1000"/>
+ 		
+	<mx:Binding source="model.boardSpec.specReady" destination="readyToBuild" />
+	
+</mx:HBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigBeds.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigBeds.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigBeds.mxml	(revision 1227)
@@ -0,0 +1,452 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:HBox
+		xmlns:mx="http://www.adobe.com/2006/mxml"
+		xmlns:acc="flash.accessibility.*"
+		xmlns:config-model="gov.va.med.edp.vo.*"
+		xmlns:widget="gov.va.med.edp.widget.*"
+		creationComplete="init()"
+		horizontalGap="0"
+		width="100%" height="100%"
+		currentState="{selectedBed != null ? 'editing' : ''}" xmlns:config="gov.va.med.edp.view.config.*">
+
+	<mx:Script>
+	<![CDATA[
+import mx.events.DragEvent;
+		import mx.validators.Validator;
+		import mx.controls.Image;
+		import mx.binding.utils.BindingUtils;
+		import mx.events.ListEvent;
+		import gov.va.med.edp.util.Vista;
+		import gov.va.med.edp.widget.InfoDialog;
+		import gov.va.med.edp.widget.CenteredCheckBox;
+		import mx.collections.ArrayCollection;
+		import gov.va.med.edp.control.config.ConfigurationEvent;
+		import mx.core.UIComponent;
+		import mx.controls.CheckBox;
+		import mx.controls.ComboBox;
+		import mx.controls.TextInput;
+		import mx.events.CollectionEvent;
+		import mx.events.CollectionEventKind;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.control.config.ChangeBedSequenceEvent;
+		import gov.va.med.edp.control.config.SaveBedConfigEvent;
+		import gov.va.med.edp.control.config.AddBedEvent;
+		import gov.va.med.edp.vo.RoomBedVO;
+		import gov.va.med.edp.widget.ColorSelector;
+		import gov.va.med.edp.vo.ColorSelectionVO;
+		import gov.va.med.edp.util.AccessibilityTools;
+
+		[Embed(source="icon_close16.png")]
+		public var inactiveImg:Class;
+
+		public var activeImg:Class = Bitmap;
+
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		private var reordering:Boolean = false;
+
+		private var _selectedBed:RoomBedVO;
+
+		private var newCount: int = 0;
+
+		private var validators:Array;
+
+		[Bindable(event="selectedBedChange")]
+		private function get selectedBed():RoomBedVO {
+			return _selectedBed;
+		}
+
+		private function set selectedBed(bed:RoomBedVO):void {
+			if (bed == null) {
+				if (reordering) {
+					callLater(reselect);
+					return;
+				}
+			} else if (bed === _selectedBed) {
+				if (reordering) reordering = false;
+			}
+			_selectedBed = bed;
+			dispatchEvent(new Event("selectedBedChange"));
+		}
+
+		private function reselect():void {
+			var index:int = grdBeds.dataProvider.getItemIndex(_selectedBed);
+			grdBeds.scrollToIndex(index);
+			grdBeds.selectedIndex = index;
+			model.config.bedMods = true;
+		}
+
+		private function init():void {
+			validators = [roomBedNameValidator, roomBedDisplayNameValidator];
+		}
+
+		private function selectedItemChanged(): void {
+			Validator.validateAll(validators);
+		}
+
+		private function inactiveImgFunction(o:Object, c:DataGridColumn):String {
+			var bed:RoomBedVO = o as RoomBedVO;
+			if (bed.inactive)
+				return "inactiveImg";
+			else
+				return "activeImg";
+		}
+
+		private function saveBeds(): void
+		{
+			// loop thru all beds checking for duplicates
+			var i: int;
+			var bed: RoomBedVO;
+			var empties: Boolean = false;
+			var dups: String = "";
+			var dflts: String = "";
+			for (i = 0; i < model.config.beds.source.length; i++) {
+				bed = model.config.beds.source[i] as RoomBedVO;
+				if (bed.name == null || bed.name.length == 0 || bed.displayName == null || bed.displayName.length == 0) {
+					empties = true;
+					break;
+				}
+				if (isDuplicate("name", bed.name, i) || isDuplicate("displayName", bed.displayName, i)) {
+					dups = dups + bed.name + ":  " + bed.displayName + "\n";
+				}
+				if (bed.inactive && (bed.id == model.config.params.ambulanceArea)) {
+					dflts = dflts + bed.name + ":  " + bed.displayName + "\n";
+				}
+				if (bed.inactive && (bed.id == model.config.params.defaultRoom)) {
+					dflts = dflts + bed.name + ":  " + bed.displayName + "\n";
+				}
+			}
+			if (empties) {
+				InfoDialog.show("There are Room/Areas with blank names which must be corrected before saving.\n"
+						, "Required Names", false, btnSave);
+				return;
+			}
+			if (dups.length > 0) {
+				InfoDialog.show("The following duplicate names must be corrected before saving:\n"
+						+ dups, "Duplicate Names", false, btnSave);
+				return;
+			}
+
+			if (dflts.length > 0) {
+				InfoDialog.show("The following are default rooms/areas and may not be inactivated:\n"
+						+ dflts, "Default Rooms/Areas", false, btnSave);
+				return;
+			}
+
+			var saveEvent: SaveBedConfigEvent =
+					new SaveBedConfigEvent(SaveBedConfigEvent.EVENT_SAVE_CONFIG_BEDS);
+			saveEvent.dispatch();
+		}
+
+		private function addBed(): void
+		{
+			newCount++;
+			var addEvent: AddBedEvent = new AddBedEvent(AddBedEvent.EVENT_ADD_BED);
+			addEvent.newIndex = newCount;
+			addEvent.dispatch();
+			this.callLater(selectNewIndex, [model.config.beds.length]);
+		}
+
+		private function isDuplicate(field: String, value: String, index: int): Boolean
+		{
+			if (!((field == "name") || (field == "displayName"))) return false;
+
+			var bed: RoomBedVO;
+			for (var i: int = 0; i < model.config.beds.length; i++) {
+				if (i == index) continue;
+				bed = model.config.beds[i] as RoomBedVO;
+				if (bed[field].toLowerCase() == value.toLowerCase()) return true;
+			}
+			return false;
+		}
+
+		private function markChanged(event: Event): void
+		{
+			var bed: RoomBedVO = selectedBed;
+
+			if (event.currentTarget === nameInput) {
+				if (bed.name != nameInput.text) {
+					bed.name = nameInput.text;
+					bed.changed = true;
+				}
+			} else if (event.currentTarget === displayNameInput) {
+				if (bed.displayName != displayNameInput.text) {
+					bed.displayName = displayNameInput.text;
+					bed.changed = true;
+				}
+			} else if (event.currentTarget === whenChooser) {
+				if (bed.displayWhen != whenChooser.selectedItem.data) {
+					bed.displayWhen = int(whenChooser.selectedItem.data);
+					bed.changed = true;
+				}
+			} else if (event.currentTarget === statusChooser) {
+				if (bed.defaultStatus != statusChooser.selectedItem.data) {
+					bed.defaultStatus = statusChooser.selectedItem.data;
+					bed.changed = true;
+				}
+			} else if (event.currentTarget === inactiveCheckBox) {
+				if (bed.inactive != inactiveCheckBox.selected) {
+					bed.inactive = inactiveCheckBox.selected;
+					bed.changed = true;
+				}
+			} else if (event.currentTarget === roomCategoryChooser) {
+				if (bed.category != roomCategoryChooser.selectedItem.data) {
+					bed.category = int(roomCategoryChooser.selectedItem.data);
+					bed.changed = true;
+				}
+			} else if (event.currentTarget === sharedInput) {
+				if (bed.sharedName != sharedInput.text) {
+					bed.sharedName = sharedInput.text;
+					bed.changed = true;
+				}
+			} else if (event.currentTarget === boardInput) {
+				if (bed.boardName != boardInput.text) {
+					bed.boardName = boardInput.text;
+					bed.changed = true;
+				}
+			} else if (event.currentTarget === colorSelector) {
+				if (bed.color != colorSelector.color) {
+					bed.color.ignore = colorSelector.color.ignore;
+					bed.color.text = colorSelector.color.text;
+					bed.color.back = colorSelector.color.back;
+					bed.changed = true;
+				}
+			}
+			if (bed.changed) {
+				new ConfigurationEvent(ConfigurationEvent.EVENT_BED_MODIFIED).dispatch();
+			}
+			model.config.beds.refresh();
+		}
+
+		private function listOrderTextChanged(event:Event):void {
+			if (listOrderInput.text.length == 0) return;
+			var newIndex:int = int(listOrderInput.text) - 1;
+			if (newIndex < 0 || newIndex >= grdBeds.dataProvider.length) return;
+			if (newIndex != grdBeds.selectedIndex) {
+				reordering = true;
+				var changeEvent: ChangeBedSequenceEvent = new ChangeBedSequenceEvent(ChangeBedSequenceEvent.EVENT_CHANGE_BED_SEQUENCE);
+				changeEvent.newIndex = newIndex;
+				changeEvent.oldIndex = grdBeds.selectedIndex;
+				changeEvent.dispatch();
+				grdBeds.selectedIndex = -1;
+			}
+		}
+
+		private function selectNewIndex(newIndex: int): void
+		{
+			grdBeds.scrollToIndex(newIndex);
+			grdBeds.selectedIndex = newIndex;
+		}
+
+		private function refreshBedFilter(): void {
+			if (hideInactiveCheckBox.selected) {
+				model.config.beds.filterFunction = activeBedFilter;
+			} else {
+				model.config.beds.filterFunction = null;
+			}
+			model.config.beds.refresh();
+		}
+
+		private function activeBedFilter(item:Object): Boolean {
+			var roomBed : RoomBedVO = item as RoomBedVO;
+			return !roomBed.inactive;
+		}
+
+		private function keyDownHadler(event:KeyboardEvent): void {
+			if (event.keyCode == Keyboard.ESCAPE) {
+				update();
+			}
+		}
+
+		private function update():void {
+			if (btnSave.enabled)
+				btnSave.setFocus();
+			else
+				grdBeds.setFocus();
+			grdBeds.selectedIndex = -1;
+		}
+
+		private function doDragDrop(event:DragEvent):void {
+			reordering = true;
+		}
+
+       	]]>
+    </mx:Script>
+
+	<mx:VBox height="100%" width="100%">
+		<mx:HBox width="100%" verticalAlign="middle">
+			<mx:Button
+					label="Add Room/Area"
+					id="addRoomBtn"
+					click="addBed()"
+					tabIndex="1100"/>
+			<mx:Spacer width="100%"/>
+			<mx:Label
+					text="Rooms / Areas"
+					styleName="controlLabel"/>
+			<mx:Spacer width="100%"/>
+			<mx:CheckBox
+					id="hideInactiveCheckBox"
+					label="Hide Inactive"
+					click="refreshBedFilter()" visible="false"
+					tabIndex="1101"/>
+		</mx:HBox>
+
+		<mx:HBox width="100%" height="100%">
+			<mx:DataGrid
+					id="grdBeds"
+					accessibilityProperties="{bedGridAcc}"
+					width="100%" height="100%"
+					keyDown="keyDownHadler(event)"
+					change="selectedItemChanged()"
+					resizeEffect="{resizeEffect}"
+					editable="false"
+					sortableColumns="false"
+					dragEnabled="true"
+					dragMoveEnabled="true"
+					dropEnabled="true"
+					dragDrop="doDragDrop(event)"
+					dataProvider="{model.config.beds}"
+					tabIndex="1102">
+				<mx:columns>
+					<mx:DataGridColumn
+							width="100"
+							headerText="Name"
+							dataField="name"/>
+					<mx:DataGridColumn
+							width="72"
+							headerText="Display Name"
+							dataField="displayName"/>
+					<mx:DataGridColumn
+							width="72"
+							headerText="Display When"
+							dataField="displayWhen"
+							itemRenderer="gov.va.med.edp.widget.WhenRenderer"
+							visible="{currentState != 'editing'}"/>
+					<mx:DataGridColumn
+							width="90"
+							headerText="Default Status"
+							dataField="defaultStatus"
+							itemRenderer="gov.va.med.edp.widget.StatusRenderer"
+							visible="{currentState != 'editing'}"/>
+					<mx:DataGridColumn
+							width="40"
+							headerText="Inactive?"
+							dataField="inactive"
+							itemRenderer="gov.va.med.edp.widget.CenteredEmbedImage"
+							labelFunction="inactiveImgFunction"/>
+					<mx:DataGridColumn
+							width="80"
+							headerText="Category"
+							dataField="category"
+							itemRenderer="gov.va.med.edp.widget.RoomCategoryRenderer"
+							visible="{currentState != 'editing'}"/>
+					<mx:DataGridColumn
+							width="50"
+							headerText="Shared"
+							dataField="sharedName"
+							visible="{currentState != 'editing'}"/>
+					<mx:DataGridColumn
+							width="50"
+							headerText="Board"
+							dataField="boardName"
+							visible="{currentState != 'editing'}"/>
+					<mx:DataGridColumn
+							width="60"
+							headerText="Color"
+							dataField="color"
+							itemRenderer="gov.va.med.edp.widget.ColorSampleRenderer"/>
+				</mx:columns>
+			</mx:DataGrid>
+		</mx:HBox>
+
+		<mx:HBox width="100%" horizontalAlign="center" verticalAlign="middle">
+			<mx:Button
+					id="btnSave"
+					label="Save Room / Area Changes"
+					enabled="{(model.config.bedMods &amp;&amp; model.config.bedLoaded)}"
+					click="saveBeds()" tabIndex="1900"/>
+		</mx:HBox>
+	</mx:VBox>
+	<mx:states>
+		<mx:State name="editing">
+			<mx:AddChild relativeTo="{grdBeds}" position="after">
+				<mx:VBox id="roomBedForm">
+					<mx:Form>
+						<mx:FormHeading label="Room / Area Details"/>
+						<mx:FormItem label="Name">
+							<mx:TextInput id="nameInput" text="{selectedBed.name}" styleName="formField"
+										  change="markChanged(event)" tabIndex="1200"/>
+						</mx:FormItem>
+						<mx:FormItem label="Display Name">
+							<mx:TextInput id="displayNameInput" text="{selectedBed.displayName}" styleName="formField"
+										  change="markChanged(event)" tabIndex="1201"/>
+						</mx:FormItem>
+						<mx:FormItem label="Display When">
+							<mx:ComboBox id="whenChooser" dataProvider="{model.config.whenList}"
+										 selectedIndex="{Vista.locateIndex(model.config.whenList, selectedBed.displayWhen)}"
+										 styleName="formField" change="markChanged(event)" tabIndex="1202"/>
+						</mx:FormItem>
+						<mx:FormItem label="Default Status">
+							<mx:ComboBox id="statusChooser" dataProvider="{model.config.statusList}"
+										 selectedIndex="{Vista.locateIndex(model.config.statusList, selectedBed.defaultStatus)}"
+										 styleName="formField" change="markChanged(event)" tabIndex="1203"/>
+						</mx:FormItem>
+						<mx:FormItem label="Inactive?">
+							<mx:CheckBox id="inactiveCheckBox" selected="{selectedBed.inactive}" styleName="formField"
+										 change="markChanged(event)" tabIndex="1204"/>
+						</mx:FormItem>
+						<mx:FormItem label="Category">
+							<mx:ComboBox id="roomCategoryChooser" dataProvider="{model.config.roomCategoryList}"
+										 selectedIndex="{Vista.locateIndex(model.config.roomCategoryList, selectedBed.category)}"
+										 styleName="formField" change="markChanged(event)" tabIndex="1205"/>
+						</mx:FormItem>
+						<mx:FormItem label="Shared Name">
+							<mx:TextInput id="sharedInput" text="{selectedBed.sharedName}" styleName="formField"
+										  change="markChanged(event)" tabIndex="1206"/>
+						</mx:FormItem>
+						<mx:FormItem label="Use Board">
+							<mx:TextInput id="boardInput" text="{selectedBed.boardName}" styleName="formField"
+										  change="markChanged(event)" tabIndex="1207"/>
+						</mx:FormItem>
+						<mx:FormItem label="Color">
+							<widget:ColorSelector id="colorSelector" styleName="formField" tabIndex="1208"
+												  color="{selectedBed.color}" colorChange="markChanged(event)"/>
+						</mx:FormItem>
+						<mx:FormItem label="List Order" visible="{AccessibilityTools.isAccessibilityActive()}">
+							<mx:TextInput id="listOrderInput" styleName="formField" tabIndex="1220"
+										  text="{model.config.beds.getItemIndex(selectedBed) + 1}"
+										  change="listOrderTextChanged(event)"/>
+						</mx:FormItem>
+					</mx:Form>
+					<mx:Button id="updateBedButton" label="All Columns >>" click="update()"
+							   tabIndex="1300"/>
+				</mx:VBox>
+			</mx:AddChild>
+		</mx:State>
+	</mx:states>
+
+	<mx:Resize id="resizeEffect" duration="200"/>
+
+	<config:DuplicateNameValidator id="roomBedNameValidator"
+								   field="name"
+								   beds="{model.config.beds}"
+								   selectedBed="{selectedBed}"
+								   source="{nameInput}"
+								   property="text"/>
+	<config:DuplicateNameValidator id="roomBedDisplayNameValidator"
+								   field="displayName"
+								   beds="{model.config.beds}"
+								   selectedBed="{selectedBed}"
+								   source="{displayNameInput}"
+								   property="text"/>
+	<mx:NumberValidator id="listOrderValidator" minValue="1" maxValue="{model.config.beds.length}"
+						source="{listOrderInput}" property="text"/>
+
+	<acc:AccessibilityProperties name="Up" id="upButtonAcc"/>
+	<acc:AccessibilityProperties name="Down" id="downButtonAcc"/>
+	<acc:AccessibilityProperties id="bedGridAcc" name="Rooms / Areas"/>
+
+	<mx:Binding source="RoomBedVO(grdBeds.selectedItem)" destination="selectedBed"/>
+</mx:HBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigBoard.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigBoard.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigBoard.mxml	(revision 1227)
@@ -0,0 +1,677 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox
+        xmlns:mx="http://www.adobe.com/2006/mxml"
+        xmlns:widget="gov.va.med.edp.widget.*"
+        xmlns:acc="flash.accessibility.*"
+        horizontalScrollPolicy="off" verticalScrollPolicy="off"
+        width="100%" height="100%" creationComplete="loadBoardSpec()">
+
+    <mx:Script>
+		<![CDATA[
+		import gov.va.med.edp.util.AccessibilityTools;
+        import mx.controls.DataGrid;
+        import mx.events.MenuEvent;
+        import mx.collections.ICollectionView;
+        import gov.va.med.edp.widget.InfoDialog;
+        import gov.va.med.edp.widget.YesNoDialog;
+        import mx.events.CloseEvent;
+        import gov.va.med.edp.vo.LookupVO;
+        import gov.va.med.edp.vo.DisplaySizeVO;
+        import gov.va.med.edp.control.config.ConfigChangeDisplayBoardPropertiesEvent;
+        import mx.collections.IList;
+        import mx.managers.DragManager;
+        import mx.events.DragEvent;
+        import gov.va.med.edp.control.config.ConfigurationEvent;
+        import gov.va.med.edp.vo.ColorMapVO;
+        import mx.events.DataGridEvent;
+        import mx.events.CollectionEvent;
+        import mx.controls.dataGridClasses.DataGridColumn;
+        import mx.events.IndexChangedEvent;
+        import gov.va.med.edp.control.config.BoardConfigEvent;
+        import gov.va.med.edp.control.config.ConfigChangeColumnEvent;
+        import gov.va.med.edp.control.config.ConfigRemoveColumnEvent;
+        import gov.va.med.edp.control.config.ConfigAddColumnEvent;
+        import gov.va.med.edp.model.TrackingModelLocator;
+        import gov.va.med.edp.vo.ColumnSpecVO;
+        import gov.va.med.edp.util.KeyUtils;
+
+        [Bindable]
+        private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private var dragInitiator: String;
+        private var switchMode: String;
+
+        private var _boardColumns:ICollectionView;
+
+        [Bindable]
+        private function get boardColumns():ICollectionView {
+            return _boardColumns;
+        }
+
+        private function set boardColumns(cols:ICollectionView):void {
+            if (_boardColumns != null && model.config.availableColumns.filterFunction === availableColumnsFilterFunction) {
+                model.config.availableColumns.filterFunction = null;
+            }
+            _boardColumns = cols;
+            if (_boardColumns != null) {
+                model.config.availableColumns.filterFunction = availableColumnsFilterFunction;
+                model.config.availableColumns.refresh();
+            }
+        }
+
+        private function set readyToListen(value: Boolean): void
+        {
+            if (value == false) return;
+            model.config.columns.addEventListener(CollectionEvent.COLLECTION_CHANGE, rebuildPreview);
+            rebuildPreview(null);
+            boardList.selectedIndex = model.config.boardIndex;
+        }
+
+        private function set keepSelectedBoardVisible(value: int): void
+        {
+            callLater(boardList.scrollToIndex, [value]);
+        }
+
+        private function loadBoardSpec(): void
+        {
+            var e: BoardConfigEvent =
+                    new BoardConfigEvent(BoardConfigEvent.EVENT_LOAD_CONFIG_BOARD);
+            e.boardID = (boardList.selectedItem == null) ? 0 : (boardList.selectedItem as LookupVO).data;
+            e.dispatch();
+        }
+
+        private function saveConfig(): void
+        {
+            var saveEvent: BoardConfigEvent =
+                    new BoardConfigEvent(BoardConfigEvent.EVENT_SAVE_CONFIG_BOARD);
+            var selectedBoard: LookupVO = boardList.selectedItem as LookupVO;
+            saveEvent.boardID = selectedBoard.data;
+            saveEvent.boardName = selectedBoard.label;
+            saveEvent.dispatch();
+        }
+
+        private function cancelChanges():void {
+            loadBoardSpec();
+            boardList.setFocus();
+        }
+        
+        private function addNewBoard(): void
+        {
+            new BoardConfigEvent(BoardConfigEvent.EVENT_ADD_CONFIG_BOARD).dispatch();
+            callLater(boardNameInput.setFocus);
+        }
+
+        private function attemptBoardSwitch(eventName: String): void
+        {
+            switchMode = eventName;
+            if (model.config.boardMods) {
+                YesNoDialog.show("You have unsaved changes to the currently selected board.\n\n" +
+                                 "Do you want to abandon these changes?\n\n" +
+                                 "Yes=Lose Changes\nNo=Return & Save Changes", "Unsaved Changes", handleSwitch, addBoardBtn);
+            } else {
+                switchBoard();
+            }
+        }
+
+        private function handleSwitch(event: CloseEvent): void
+        {
+            if (event.detail == YesNoDialog.YES) {
+                switchBoard();
+            } else {
+                boardList.selectedIndex = model.config.boardIndex;
+            }
+        }
+
+        private function switchBoard(): void
+        {
+            if (switchMode == BoardConfigEvent.EVENT_ADD_CONFIG_BOARD) addNewBoard();
+            if (switchMode == BoardConfigEvent.EVENT_LOAD_CONFIG_BOARD) loadBoardSpec();
+            switchMode = "";
+        }
+
+        private function rebuildPreview(event:CollectionEvent): void
+        {
+            var newCols:Array = new Array();
+            var newCol: DataGridColumn;
+            for each (var colInfo: ColumnSpecVO in model.config.columns) {
+                newCol = new DataGridColumn(colInfo.attribute);
+                newCol.headerText = colInfo.header;
+                newCol.dataField = colInfo.attribute;
+                newCol.width = colInfo.width;
+                newCol.setStyle("fontSize", model.config.displayBoardProperties.fontSize);
+                newCols.push(newCol);
+            }
+            preview.columns = newCols;
+
+            if (event != null) {
+                new ConfigurationEvent(ConfigurationEvent.EVENT_BOARD_MODIFIED).dispatch();
+            }
+        }
+
+        public function addColumnItemClickHandler(event:MenuEvent):void {
+            var selectedColumn:ColumnSpecVO = event.item as ColumnSpecVO;
+            addColumn(selectedColumn);
+        }
+
+        // drag/drop ------------------------------------------------------
+
+        private function setDragInitator(event:MouseEvent, id:String):void
+        {
+            dragInitiator = id;
+        }
+
+        private function doDragOver(event:DragEvent):void
+        {
+            var dropTarget:DataGrid = DataGrid(event.currentTarget);
+            // add the DataGrid drop feedback
+            dropTarget.showDropFeedback(event);
+        }
+
+        private function doDragEnter(event:DragEvent):void
+        {
+            var dropTarget:DataGrid = DataGrid(event.currentTarget);
+
+            if (dragInitiator == dropTarget.id) {
+                DragManager.showFeedback(DragManager.MOVE);
+                DragManager.acceptDragDrop(dropTarget);
+            }
+        }
+
+
+        private function doDragDrop(event:DragEvent):void
+        {
+            var dropTarget:DataGrid = DataGrid(event.currentTarget);
+            doDragExit(event);
+
+            var items:Array = event.dragSource.dataForFormat("items") as Array;
+            var dropLoc:int = dropTarget.calculateDropIndex(event);
+            for (var i:int = 0; i < items.length; i++)
+            {
+                if (dragInitiator == dropTarget.id) {
+                    // moving within list
+                    if (dropLoc > DataGrid(dropTarget).selectedIndex)
+                        dropLoc = dropLoc - 1;
+                    if (dropLoc > IList(dropTarget.dataProvider).length - 1)
+                        dropLoc = dropLoc - 1;
+                    IList(dropTarget.dataProvider).removeItemAt(dropTarget.selectedIndex);
+                    IList(dropTarget.dataProvider).addItemAt(items[i], dropLoc);
+                    callLater(updateSelection, [dropLoc]);
+                } else {
+                    IList(dropTarget.dataProvider).addItemAt(items[i], dropLoc);
+                }
+            }
+        }
+
+        private function updateSelection(index : int) : void
+        {
+            boardColumnsGrid.selectedIndex = index;
+        }
+
+
+        private function doDragExit(event:DragEvent):void
+        {
+            var dropTarget:DataGrid = DataGrid(event.currentTarget);
+            dropTarget.hideDropFeedback(event);
+        }
+
+        private function keyHandler(event:KeyboardEvent): void
+        {
+            if (!KeyUtils.isRemoveKey(event)) return;
+            if (boardColumnsGrid.editable && boardColumnsGrid.editedItemPosition != null) return;
+            if (KeyUtils.isRemoveKey(event)) removeSelectedColumnsFromGrid();
+
+            if (event.keyCode == Keyboard.ESCAPE) {
+                boardColumnsGrid.selectedIndex = -1;
+                btnSaveBoard.setFocus();
+            }
+        }
+
+
+        private function removeSelectedColumnsFromGrid(): void
+        {
+            if (boardColumnsGrid.selectedItems != null && boardColumnsGrid.selectedItems.length > 0) {
+                for each (var item:ColumnSpecVO in boardColumnsGrid.selectedItems) {
+                    removeColumn(item);
+                }
+
+            }
+        }
+
+
+        // update columns -------------------------------------------------
+
+        private function addColumn(selectedItem: ColumnSpecVO): void
+        {
+            if (selectedItem == null) return;
+
+            var addEvent: ConfigAddColumnEvent =
+                    new ConfigAddColumnEvent(ConfigAddColumnEvent.EVENT_CONFIG_ADD_COLUMN);
+            addEvent.data = selectedItem;
+            addEvent.dispatch();
+
+            model.config.availableColumns.refresh();
+
+            if (AccessibilityTools.isAccessibilityActive()) InfoDialog.show("Added successfully", "Message", true, addColumnSelector);
+        }
+
+        private function removeColumn(selectedItem: ColumnSpecVO): void
+        {
+            if (selectedItem == null) return;
+
+            var removeEvent: ConfigRemoveColumnEvent =
+                    new ConfigRemoveColumnEvent(ConfigRemoveColumnEvent.EVENT_CONFIG_REMOVE_COLUMN);
+            removeEvent.data = selectedItem;
+            removeEvent.dispatch();
+
+            model.config.availableColumns.refresh();
+
+            if (AccessibilityTools.isAccessibilityActive()) InfoDialog.show("Removed successfully", "Message", true, boardColumnsGrid);
+        }
+
+        private function changeBoardName():void {
+            var newBoardName: String = boardNameInput.text;
+            if (newBoardName != model.config.boards[model.config.boardIndex].label) {
+                boardList.selectedItem.label = newBoardName;
+                new ConfigurationEvent(ConfigurationEvent.EVENT_BOARD_MODIFIED).dispatch()
+            }
+        }
+
+        private function changeColumnSequence(event: IndexChangedEvent): void
+        {
+            var changeEvent: ConfigChangeColumnEvent =
+                    new ConfigChangeColumnEvent(ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_COLUMN_SEQ);
+            changeEvent.oldIndex = event.oldIndex;
+            changeEvent.newIndex = event.newIndex;
+            changeEvent.dispatch();
+        }
+
+        private function changeColumnWidth(event: DataGridEvent): void
+        {
+            var changeEvent: ConfigChangeColumnEvent =
+                    new ConfigChangeColumnEvent(ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_COLUMN_WIDTH);
+            changeEvent.widths = [];
+            for (var i: int = 0; i < preview.columns.length; i++) {
+                changeEvent.widths.push(DataGridColumn(preview.columns[i]).width);
+            }
+            changeEvent.dispatch();
+        }
+
+        private function changeRowColor(): void
+        {
+            var changeEvent: ConfigChangeColumnEvent =
+                    new ConfigChangeColumnEvent(ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_ROW_COLOR);
+            var colorMap: ColorMapVO = rowColor.selectedItem as ColorMapVO;
+            changeEvent.rowColor = (colorMap != null) ? colorMap.id : "";
+            changeEvent.dispatch();
+        }
+
+        // update display properties --------------------------------------
+
+
+        private function changeDisplayBoardWidth(): void
+        {
+            var changeEvent: ConfigChangeDisplayBoardPropertiesEvent =
+                    new ConfigChangeDisplayBoardPropertiesEvent(ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_DISPLAY_WIDTH);
+            var displayWidth: DisplaySizeVO = displaySizeCmb.selectedItem as DisplaySizeVO;
+            changeEvent.displaySize = displayWidth;
+            changeEvent.dispatch();
+        }
+
+        private function changeDisplayBoardFontSize(): void
+        {
+            var changeEvent: ConfigChangeDisplayBoardPropertiesEvent =
+                    new ConfigChangeDisplayBoardPropertiesEvent(ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_FONT_SIZE);
+            var fontSize: int = fntSizeNmStepper.value;
+            changeEvent.fontSize = fontSize;
+            changeEvent.dispatch();
+
+            for each (var gridColumn:DataGridColumn in preview.columns) {
+                gridColumn.setStyle("fontSize", fontSize);
+            }
+        }
+
+        private function changeDisplayBoardScrollDelay(): void
+        {
+            var changeEvent: ConfigChangeDisplayBoardPropertiesEvent =
+                    new ConfigChangeDisplayBoardPropertiesEvent(ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_SCROLL_DELAY);
+            var scrollDelay: int = ScrollDlyNmStepper.value;
+            changeEvent.scrollDelay = scrollDelay;
+            changeEvent.dispatch();
+        }
+
+        private function changeDisplayBoardSquish(): void
+        {
+            // prevent setting boardMods during initialization of checkbox
+            if (model.config.boardLoaded == false) return;
+
+            var changeEvent: ConfigChangeDisplayBoardPropertiesEvent =
+                    new ConfigChangeDisplayBoardPropertiesEvent(ConfigChangeDisplayBoardPropertiesEvent.EVENT_CONFIG_CHANGE_SQUISH);
+            changeEvent.squish = squishChkBox.selected;
+            changeEvent.dispatch();
+        }
+
+        // label function for color maps
+        private function showColorMapName(item: Object, column: DataGridColumn): String
+        {
+            var c: ColumnSpecVO = item as ColumnSpecVO;
+            if ((c != null) && (c.colorMap != null)) {
+                return c.colorMap.name;
+            } else {
+                return "";
+            }
+        }
+
+        private function changeColumnHeader(): void {
+            if (headerInput.text != boardColumnsGrid.selectedItem.header) {
+                boardColumnsGrid.selectedItem.header = headerInput.text;
+            }
+        }
+
+        private function changeColumnColor(): void {
+            if (boardColumnsGrid.selectedItem.colorMap != columnColor.selectedItem) {
+                boardColumnsGrid.selectedItem.colorMap = columnColor.selectedItem;
+            }
+        }
+
+        private function changeColumnSequenceText(): void {
+            var currentIndex:int = boardColumnsGrid.selectedIndex;
+            var newIndex:int = int(columnOrderInput.text) - 1;
+            if (newIndex < 0 || newIndex >= boardColumns.length) return;
+            if (newIndex != currentIndex) {
+                boardColumnsGrid.selectedIndex = -1;
+                var changeEvent: ConfigChangeColumnEvent =
+                        new ConfigChangeColumnEvent(ConfigChangeColumnEvent.EVENT_CONFIG_CHANGE_COLUMN_SEQ);
+                changeEvent.oldIndex = currentIndex;
+                changeEvent.newIndex = newIndex;
+                changeEvent.dispatch();
+                callLater(updateSelection, [newIndex]);
+                callLater(columnOrderInput.setFocus);
+            }
+        }
+
+        private function changeColumnWidthText(): void {
+            var currentWidth:int = 0;
+            var newWidth:int = int(widthInput.text);
+
+            resizeColumn(preview, boardColumnsGrid.selectedIndex, newWidth);
+        }
+
+        /**
+         *  @private
+         *  If there is no horizontal scroll bar, changes the display width of other columns when
+         *  one column's width is changed.
+         *  @param col column whose width is changed
+         *  @param w width of column
+         */
+        private function resizeColumn(grid:DataGrid, col:int, w:Number):void
+        {
+            if (col < 0 || col >= grid.columns.length - 1)   // no resize of right most column
+                return;
+
+            if (w < grid.columns[col].minWidth)
+                w = grid.columns[col].minWidth;
+
+            // find the columns in the set of visible columns;
+            var n:int = grid.columns.length;
+            var i:int = col;
+
+            // we want all cols's new widths to the right of this to be in proportion
+            // to what they were before the stretch.
+
+            // get the original space to the right not taken up by the column
+            var totalSpace:Number = 0;
+            var lastColumn:DataGridColumn;
+            var newWidth:Number;
+            //non-resizable columns don't count though
+            for (i = col + 1; i < n; i++)
+            {
+                if (grid.columns[i].visible)
+                    if (grid.columns[i].resizable)
+                        totalSpace += grid.columns[i].width;
+            }
+
+            var newTotalSpace:Number = grid.columns[col].width - w + totalSpace;
+            if (totalSpace)
+            {
+                grid.columns[col].width = w;
+            }
+
+            var totX:Number = 0;
+            // resize the columns to the right proportionally to what they were
+            for (i = col + 1; i < n; i++)
+            {
+                if (grid.columns[i].visible)
+                    if (grid.columns[i].resizable)
+                    {
+                        newWidth = Math.floor(grid.columns[i].width
+                                * newTotalSpace / totalSpace);
+                        if (newWidth < grid.columns[i].minWidth)
+                            newWidth = grid.columns[i].minWidth;
+                        grid.columns[i].width = newWidth;
+                        totX += grid.columns[i].width;
+                        lastColumn = grid.columns[i];
+                    }
+            }
+
+            if (totX > newTotalSpace)
+            {
+                // if excess then should be taken out only from changing column
+                // cause others would have already gone to their minimum
+                newWidth = grid.columns[col].width - totX + newTotalSpace;
+                if (newWidth < grid.columns[col].minWidth)
+                    newWidth = grid.columns[col].minWidth;
+                grid.columns[col].width = newWidth;
+            }
+            else if (lastColumn)
+            {
+                // if less then should be added in last column
+                // dont need to check for minWidth as we are adding
+                lastColumn.width = lastColumn.width - totX + newTotalSpace;
+            }
+
+            invalidateDisplayList();
+        }
+
+        private static function availableColumnsFilterFunction(item:Object):Boolean {
+            var availableColumn:ColumnSpecVO = item as ColumnSpecVO;
+            for each (var col:ColumnSpecVO in TrackingModelLocator.getInstance().config.columns) {
+                if (availableColumn.label == col.label) return false;
+            }
+            return true;
+        }
+		]]>
+    </mx:Script>
+
+    <mx:HBox height="100%" width="100%">
+        <mx:VBox height="100%">
+            <mx:Button label="Add Board"
+                       click="attemptBoardSwitch(BoardConfigEvent.EVENT_ADD_CONFIG_BOARD)"
+                       id="addBoardBtn"
+                       tabIndex="1101"/>
+            <mx:List
+            	id="boardList"
+            	dataProvider="{model.config.boards}"
+            	selectedIndex="{model.config.boardIndex}"
+            	change="attemptBoardSwitch(BoardConfigEvent.EVENT_LOAD_CONFIG_BOARD)"
+            	rowCount="{model.config.boards.length}"
+            	backgroundColor="0xe7e7e7" cornerRadius="4" width="96"
+            	labelField="label"
+            	tabIndex="1102" />
+        </mx:VBox>
+
+        <mx:VBox height="100%" paddingLeft="12">
+            <widget:OpenAlwaysPopUpMenuButton id="addColumnSelector" dataProvider="{model.config.availableColumns}"
+                                              label="Add Column" itemClick="addColumnItemClickHandler(event)"
+                                              tabIndex="1103"/>
+            <mx:DataGrid
+                    id="boardColumnsGrid"
+                    dataProvider="{boardColumns}"
+                    accessibilityProperties="{boardColumnsGridAcc}"
+                    height="100%" width="100%"
+                    dragEnabled="true"
+                    dragEnter="doDragEnter(event);"
+                    dragExit="doDragExit(event)"
+                    dragDrop="doDragDrop(event)"
+                    dragOver="doDragOver(event)"
+                    allowMultipleSelection="true"
+                    dragMoveEnabled="false"
+                    mouseDown="setDragInitator(event, 'boardColumnsGrid')"
+                    keyDown="keyHandler(event)"
+                    sortableColumns="false"
+                    tabIndex="1104">
+                <mx:columns>
+                    <mx:DataGridColumn
+                            headerText="Column"
+                            dataField="label"
+                            width="160"/>
+                    <mx:DataGridColumn
+                            headerText="Header"
+                            dataField="header"
+                            width="84"/>
+                    <mx:DataGridColumn
+                            headerText="Color Based On"
+                            dataField="colorMap"
+                            editorDataField="colorMap"
+                            labelFunction="showColorMapName"
+                            width="160"/>
+                </mx:columns>
+            </mx:DataGrid>
+        </mx:VBox>
+        <mx:VBox height="100%" width="100%">
+            <mx:Form id="boardPropertyForm">
+                <mx:FormHeading label="Board Properties"/>
+                <mx:FormItem label="Board Name">
+                    <mx:TextInput id="boardNameInput" styleName="formField" text="{boardList.selectedItem.label}"
+                                  editable="{boardList.selectedItem.label != 'Main (default)'}"
+                                  change="changeBoardName()" tabIndex="1200"/>
+                </mx:FormItem>
+                <mx:FormItem label="Row Color Based On">
+                    <mx:ComboBox
+                            id="rowColor"
+                            dataProvider="{model.config.colorMaps}"
+                            selectedIndex="{model.config.rowColorMapIndex}"
+                            labelField="name"
+                            rowCount="{model.config.colorMaps.length}"
+                            change="changeRowColor()"
+                            styleName="formField"
+                            tabIndex="1201"/>
+                </mx:FormItem>
+                <mx:FormItem label="Display Size">
+                    <widget:ValueComboBox
+                            id="displaySizeCmb"
+                            styleName="formField"
+                            dataProvider="{model.config.displaySizes}"
+                            labelField="label"
+                            value="{model.config.displayBoardProperties.displaySize.label}"
+                            rowCount="{model.config.displaySizes.length}"
+                            change="changeDisplayBoardWidth()"
+                            tabIndex="1202"/>
+                </mx:FormItem>
+                <mx:FormItem label="Font Size">
+                    <widget:AccessibleNumericStepper
+                            id="fntSizeNmStepper"
+                            name=" "
+                            stepSize="1" minimum="6" maximum="36"
+                            change="changeDisplayBoardFontSize()"
+                            value="{model.config.displayBoardProperties.fontSize}"
+                            styleName="formField"
+                            tabIndex="1203"/>
+                </mx:FormItem>
+                <mx:FormItem label="Squish Rows To Fit">
+                    <mx:CheckBox
+                            id="squishChkBox"
+                            label="(if possible)"
+                            toolTip="squish will try to squish the Display Board rows so as to display the data on one screen as long as the font size is greater than 9. If the number of rows grows and the rows start getting too small, normal auto scrolling functionality will return."
+                            change="changeDisplayBoardSquish()"
+                            selected="{model.config.displayBoardProperties.squish}"
+                            paddingLeft="0" paddingTop="2"
+                            styleName="formField"
+                            tabIndex="1204"/>
+                </mx:FormItem>
+                <mx:FormItem label="Scroll Delay">
+                    <widget:AccessibleNumericStepper
+                            id="ScrollDlyNmStepper"
+                            name=" in Seconds"
+                            stepSize="1" minimum="1" maximum="120"
+                            change="changeDisplayBoardScrollDelay()"
+                            value="{model.config.displayBoardProperties.scrollDelay}"
+                            styleName="formField"
+                            tabIndex="1205"/>
+                </mx:FormItem>
+
+	            <mx:Form id="columnProperties" visible="{boardColumnsGrid.selectedItem != null}">
+	                <mx:FormHeading label="Column Properties" paddingTop="6"/>
+	                <mx:FormItem label="Header">
+	                    <mx:TextInput id="headerInput" styleName="formField"
+	                                  text="{boardColumnsGrid.selectedItem.header}" tabIndex="1207"
+	                                  change="changeColumnHeader()"/>
+	                </mx:FormItem>
+	                <mx:FormItem label="Color Based On" toolTip="Overrides row color setting.">
+	                    <mx:ComboBox
+	                            id="columnColor"
+	                            dataProvider="{model.config.colorMaps}"
+	                            selectedIndex="{model.config.colorMaps.getItemIndex(boardColumnsGrid.selectedItem.colorMap)}"
+	                            labelField="name"
+	                            rowCount="{model.config.colorMaps.length}"
+	                            change="changeColumnColor()"
+	                            styleName="formField"
+	                            tabIndex="1208"/>
+	                </mx:FormItem>
+	                <mx:FormItem label="Column Order" visible="{AccessibilityTools.isAccessibilityActive()}" >
+	                    <mx:TextInput id="columnOrderInput" styleName="formField"
+	                                  text="{boardColumnsGrid.selectedIndex + 1}" tabIndex="1209"
+	                                  change="changeColumnSequenceText()"/>
+	                </mx:FormItem>
+	                <mx:FormItem label="Width" visible="{AccessibilityTools.isAccessibilityActive()}" >
+	                    <mx:TextInput id="widthInput" styleName="formField" text="{boardColumnsGrid.selectedItem.width}"
+	                                  tabIndex="1210" change="changeColumnWidthText()"/>
+	                </mx:FormItem>
+	            </mx:Form>
+            </mx:Form>	            
+
+			<mx:HBox
+				id="boxButton"
+				height="100%" width="100%"
+				horizontalAlign="center" verticalAlign="bottom" >
+<!--                <mx:Button id="btnCancelBoardChanges"
+                		   label="Cancel" enabled="{model.config.boardMods}" tabIndex="1300"
+                           click="cancelChanges()"/>-->
+	            <mx:Button id="btnSaveBoard"
+	                       label="Save Display Board Changes"
+	                       enabled="{(model.config.boardMods &amp;&amp; model.config.boardLoaded)}"
+	                       click="saveConfig()" tabIndex="1301"/>				
+			</mx:HBox>
+        </mx:VBox>
+
+    </mx:HBox>
+    <mx:Spacer height="12"/>
+    <mx:HRule width="100%" strokeColor="0xcccccc" shadowColor="0x777777" />
+    <mx:Label
+            text="Preview Display Board   (drag to move and size columns)"
+            styleName="controlLabel"/>
+    <mx:Canvas width="100%" horizontalScrollPolicy="auto" verticalScrollPolicy="off">
+        <mx:DataGrid
+                id="preview"
+                accessibilityProperties="{previewAcc}"
+                columnStretch="changeColumnWidth(event)"
+                headerShift="changeColumnSequence(event)"
+                width="{model.config.displayBoardProperties.displaySize.width}"
+                rowCount="3"
+                focusEnabled="false">
+            <mx:columns>
+                <mx:DataGridColumn headerText="Selected columns appear here, drag column splitters to set widths."/>
+            </mx:columns>
+        </mx:DataGrid>
+    </mx:Canvas>
+
+    <mx:NumberValidator id="columnOrderValidator" source="{columnOrderInput}" property="text" minValue="1"
+                        maxValue="{boardColumns.length}"/>
+
+    <acc:AccessibilityProperties id="boardColumnsGridAcc" name="Board Columns"/>
+    <acc:AccessibilityProperties id="previewAcc" name="Preview Display Board   (drag to move and size columns)"/>
+    <acc:AccessibilityProperties id="availableColumnsAcc" name="Available Columns"/>
+
+    <mx:Binding source="model.config.boardLoaded" destination="readyToListen"/>
+    <mx:Binding source="model.config.columns" destination="boardColumns"/>
+    <mx:Binding source="model.config.boardIndex" destination="keepSelectedBoardVisible"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigColor.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigColor.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigColor.mxml	(revision 1227)
@@ -0,0 +1,303 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	width="100%" height="100%"
+	show="addFilter()" hide="removeFilter()" xmlns:widget="gov.va.med.edp.widget.*">
+
+	<mx:states>
+		<mx:State name="staff">
+			<mx:AddChild relativeTo="{actionArea}" >
+				<mx:Canvas width="100%" height="100%">
+					<widget:AccessibleLabel
+						text="Use the Staff view to set colors for individuals."
+						accessibleText="Info: Use the Staff view to set colors for individuals."
+						verticalCenter="0" horizontalCenter="0"
+						styleName="subTitle" tabIndex="1200"/>
+				</mx:Canvas>
+			</mx:AddChild>
+		</mx:State>
+		<mx:State name="bed">
+			<mx:AddChild relativeTo="{actionArea}" >
+				<mx:Canvas width="100%" height="100%" >
+					<widget:AccessibleLabel
+						text="Use the Room / Bed view to set colors for locations."
+						accessibleText="Info: Use the Room / Bed view to set colors for locations."
+						verticalCenter="0" horizontalCenter="0"
+						styleName="subTitle" tabIndex="1200"/>					
+				</mx:Canvas>
+			</mx:AddChild>
+		</mx:State>
+		<mx:State name="values">
+			<mx:AddChild relativeTo="{actionArea}" >
+				<mx:DataGrid 
+					id="valueGrid"
+					focusIn="{AccessibilityTools.accessComponentName(valueGrid, viewTitle.text)}"
+					editable="false"
+					height="100%"
+					tabIndex="1200">
+					<mx:columns>
+						<mx:DataGridColumn
+							dataField="name"
+							headerText="Value"
+							width="160" />
+						<mx:DataGridColumn
+							headerText="Color"
+							itemRenderer="gov.va.med.edp.widget.ColorSampleRenderer"
+							width="108" />
+					</mx:columns>
+				</mx:DataGrid>
+			</mx:AddChild>
+			<mx:AddChild relativeTo="{actionArea}" >
+		        <mx:VBox
+		        	id="valuesColorSelectorFrm"
+		        	visible="{valueGrid.selectedItem != null}"
+		        	verticalGap="2"
+		        	height="100%"  >
+		            <mx:Label text="Change Color"/>
+		            <widget:ColorSelector
+		            	id="valuesColorSelector"
+		            	tabIndex="1201"
+		            	color="{selectedColorMatch.color}"
+		            	colorChange="fireColorChange(event)"/>
+		        </mx:VBox>
+			</mx:AddChild>			
+		</mx:State>
+		<mx:State name="ranges">
+			<mx:AddChild relativeTo="{viewTitle}" position="before" >
+					<mx:Button label="Add" click="addRange()" tabIndex="1200" />
+			</mx:AddChild>
+			<mx:AddChild relativeTo="{actionArea}" >
+				<mx:DataGrid
+					id="rangeGrid"
+					focusIn="AccessibilityTools.accessComponentName(rangeGrid, viewTitle.text)" 
+                	editable="false"
+                	keyDown="rangeKeyHandler(event)"
+					height="100%"
+					tabIndex="1202">
+					<mx:columns>
+						<mx:DataGridColumn
+							dataField="value"
+							headerText="Starting at Elapsed Minute"
+							itemRenderer="mx.controls.Label"
+							width="160" />
+						<mx:DataGridColumn
+							headerText="Color"
+							dataField="color"
+							itemRenderer="gov.va.med.edp.widget.ColorSampleRenderer"
+							width="108" />
+					</mx:columns>
+				</mx:DataGrid>					
+			</mx:AddChild>
+			<mx:AddChild relativeTo="{actionArea}" >
+		        <mx:Form height="100%" id="rangesColorSelectorFrm" visible="{rangeGrid.selectedItem != null}">
+					<mx:FormItem label="Starting at Elapsed Minute">
+    						<mx:TextInput
+    							id="numTextInput"
+    							width="100%" height="100%"
+    							tabIndex="1203"
+    							text="{selectedColorMatch.value}"
+    							restrict="0-9"
+    							change="fireRangeChanged(event)"
+    							styleName="formField"/>
+					</mx:FormItem>
+					<mx:FormItem label="Color">
+						 <widget:ColorSelector
+						 	id="rangesColorSelector"
+						 	tabIndex="1204"
+						 	color="{selectedColorMatch.color}"
+						 	colorChange="fireColorChange(event)"
+						 	styleName="formField"/>
+					</mx:FormItem>					
+		        </mx:Form>
+			</mx:AddChild>				
+		</mx:State>
+	</mx:states>
+
+
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.config.ColorChangedEvent;
+		import gov.va.med.edp.widget.InfoDialog;
+		import mx.events.CollectionEvent;
+		import gov.va.med.edp.control.config.ConfigurationEvent;
+		import gov.va.med.edp.vo.ColorMatchVO;
+		import gov.va.med.edp.vo.ColorMapVO;
+		import mx.collections.ArrayCollection;
+		import gov.va.med.edp.vo.ColorSelectionVO;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.AccessibilityTools;
+		import gov.va.med.edp.util.KeyUtils;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		[Bindable]
+		private var selectedColorMatch: ColorMatchVO;
+		
+		private function setValueList(): void
+		{
+			if (colorMapList.selectedIndex < 0) return;
+			var colorMap: ColorMapVO = colorMapList.selectedItem as ColorMapVO;
+			colorMap.matches.addEventListener(CollectionEvent.COLLECTION_CHANGE, detectChanges);
+            
+			if (colorMap.type == "val") {
+				this.currentState = "values";
+				valueGrid.dataProvider = colorMap.matches;
+				viewTitle.text = "Colors for " + colorMap.name;
+			}
+			if (colorMap.type == "rng") {
+				this.currentState = "ranges";
+				rangeGrid.dataProvider = colorMap.matches;
+				viewTitle.text = "Colors for " + colorMap.name;
+			}
+			if (colorMap.type == "bed") {
+				this.currentState = "bed";
+				viewTitle.text = "";
+			}
+			if (colorMap.type == "staff") {
+				this.currentState = "staff";
+				viewTitle.text = ""
+			}
+			if (colorMap.type == "none") {
+				this.currentState = "";
+				viewTitle.text = "";
+			}
+		}
+		
+		private function detectChanges(event: CollectionEvent): void
+		{
+			new ConfigurationEvent(ConfigurationEvent.EVENT_COLOR_MODIFIED).dispatch();
+		}
+		
+		private function addRange(): void
+		{
+			// for now just update the model directly...
+			if (colorMapList.selectedIndex < 0) return;
+			
+			var colorMap: ColorMapVO = colorMapList.selectedItem as ColorMapVO;
+			var match: ColorMatchVO = new ColorMatchVO();
+			match.attribute = "@" + colorMap.id;
+			match.value = "0";
+			match.color = new ColorSelectionVO();
+			colorMap.matches.addItem(match);
+			if (AccessibilityTools.isAccessibilityActive()) InfoDialog.show("Added successfully", "Message", true); 			
+
+			rangeGrid.selectedIndex = rangeGrid.dataProvider.length;
+		}
+		
+		private function removeRange(): void
+		{
+			// for now just update the model directly...
+			if (rangeGrid.selectedIndex < 0) return;
+			var map: ColorMapVO = colorMapList.selectedItem as ColorMapVO;
+			map.matches.removeItemAt(rangeGrid.selectedIndex);		
+			if (AccessibilityTools.isAccessibilityActive()) InfoDialog.show("Removed successfully", "Message", true, rangeGrid); 
+		}
+		
+		private function rangeKeyHandler(event:KeyboardEvent): void
+        {
+            if (!KeyUtils.isRemoveKey(event)) return;
+            removeRange();
+        }
+		
+		private function saveColors(): void
+		{
+			var saveEvent: ConfigurationEvent = 
+				new ConfigurationEvent(ConfigurationEvent.EVENT_SAVE_COLOR_CONFIG);
+			saveEvent.dispatch();
+		}
+		
+		private function addFilter(): void
+		{
+			model.config.colorMaps.filterFunction = hideNone;
+			model.config.colorMaps.refresh();
+		}
+		
+		private function removeFilter(): void
+		{
+			model.config.colorMaps.filterFunction = null;
+			model.config.colorMaps.refresh();
+		}
+		
+		public function hideNone(item: Object): Boolean
+		{
+			return (item.type != "none");
+		}
+        
+		private function fireColorChange(event:ColorChangedEvent):void {
+			var colorMatch:ColorMatchVO = selectedColorMatch;
+
+			if (event.currentTarget === valuesColorSelector) {
+				if (colorMatch.color != valuesColorSelector.color) {
+					colorMatch.color.ignore = valuesColorSelector.color.ignore;
+					colorMatch.color.text = valuesColorSelector.color.text;
+					colorMatch.color.back = valuesColorSelector.color.back;
+					new ConfigurationEvent(ConfigurationEvent.EVENT_COLOR_MODIFIED).dispatch();
+				}			
+			} else if (event.currentTarget === rangesColorSelector) {
+				if (colorMatch.color != rangesColorSelector.color) {
+					colorMatch.color.ignore = rangesColorSelector.color.ignore;
+					colorMatch.color.text = rangesColorSelector.color.text;
+					colorMatch.color.back = rangesColorSelector.color.back;
+					new ConfigurationEvent(ConfigurationEvent.EVENT_COLOR_MODIFIED).dispatch();
+			}
+				
+			}
+				
+				var colorMap: ColorMapVO = colorMapList.selectedItem as ColorMapVO;
+				if (colorMap != null) colorMap.matches.refresh();
+		}
+		
+		private function fireRangeChanged(event:Event):void {
+ 				if (event.currentTarget === numTextInput) {
+				if (selectedColorMatch.value != numTextInput.text) {
+					selectedColorMatch.value = numTextInput.text;
+					new ConfigurationEvent(ConfigurationEvent.EVENT_COLOR_MODIFIED).dispatch();
+				}				
+			}			
+		}		
+
+	]]>
+	</mx:Script>
+
+	<mx:HBox
+		width="100%" height="100%" >
+		<mx:VBox
+			verticalGap="0"
+			height="100%" width="23%">
+			<mx:Label
+				text="Available Color Maps"
+				styleName="controlLabel" />				
+			<mx:List
+				id="colorMapList"
+				initialize="{AccessibilityTools.accessComponentName(colorMapList,'Available Color Maps')}"
+				dataProvider="{model.config.colorMaps}"
+				labelField="name"
+            	backgroundColor="0xe7e7e7" cornerRadius="4"
+            	rowCount="{model.config.colorMaps.length}"
+				width="172"
+				change="setValueList()"
+				tabIndex="1100" />	
+		</mx:VBox>
+		<mx:VBox verticalGap="0" height="100%" width="100%">
+			<mx:HBox id="titleArea" width="100%" paddingBottom="2" >
+				<mx:Label id="viewTitle" styleName="controlLabel" />
+			</mx:HBox>
+			<mx:HBox id="actionArea" width="100%" height="100%" />
+		</mx:VBox>
+	</mx:HBox>	
+
+	<mx:Canvas width="100%" >
+		<mx:Button
+			id = "btnSaveColor"
+			label="Save Color Changes"
+			enabled="{(model.config.colorMods &amp;&amp; model.config.colorLoaded)}"
+			horizontalCenter="0" top="6" bottom="6"
+			click="saveColors()"
+			tabIndex="1900" />
+	</mx:Canvas>	
+
+<mx:Resize id="resize" duration="300"/>
+    <mx:Binding source="ColorMatchVO(valueGrid.selectedItem)" destination="selectedColorMatch"/>  
+	<mx:Binding source="ColorMatchVO(rangeGrid.selectedItem)" destination="selectedColorMatch"/>  
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigParams.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigParams.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigParams.mxml	(revision 1227)
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	xmlns:widget="gov.va.med.edp.widget.*"
+	width="100%" height="100%"
+	creationComplete="resetModified()" >
+
+	<mx:Script>
+		<![CDATA[
+			import gov.va.med.edp.control.config.ConfigurationEvent;
+			import gov.va.med.edp.control.config.ChangeFieldEvent;
+			import mx.controls.CheckBox;
+			import gov.va.med.edp.model.TrackingModelLocator;
+			import gov.va.med.edp.util.AccessibilityTools;
+			import gov.va.med.edp.widget.ValueComboBox;
+
+			[Bindable]
+			private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+			
+			private function resetModified(): void
+			{
+				new ConfigurationEvent(ConfigurationEvent.EVENT_PARAM_MODIFIED_RESET).dispatch();
+			}
+			
+			//hours = int(totSec / 3600)
+			//mins  = int((totSec % 3600) / 60)
+			//secs  = totSec % 60
+			private function buildShiftStart(startMin: int): String
+			{
+				var hours: String = String(int(startMin / 60));
+				var mins: String = String(int(startMin % 60));
+				mins = (mins.length == 1) ? "0" + mins : mins;
+				hours = (hours.length == 1) ? "0" + hours : hours;
+				return hours + ":" + mins;
+			}
+			
+			private function changeParam(event: Event): void
+			{
+				var e: ChangeFieldEvent = new ChangeFieldEvent(ChangeFieldEvent.EVENT_CHANGE_PARAM_FIELD);
+				e.field = event.currentTarget.id;
+				
+				if (event.currentTarget is CheckBox) {
+					e.value = (event.currentTarget as CheckBox).selected;
+				}
+				if (event.currentTarget is AccessibleNumericStepper) {
+					e.value = (event.currentTarget as AccessibleNumericStepper).value;
+				}
+				if (event.currentTarget is ValueComboBox) {
+					e.value = (event.currentTarget as ValueComboBox).value;
+				}
+				e.dispatch();
+			}
+			
+			private function changeShiftStart(): void
+			{
+				var e: ChangeFieldEvent = new ChangeFieldEvent(ChangeFieldEvent.EVENT_CHANGE_PARAM_FIELD);
+				e.field = "shiftOne";
+				var times: Array = shiftStart.text.split(":");
+				if (times.length != 2) return;
+				var hours: int = times[0];				
+				var mins: int = times[1];
+				e.value = (hours * 60) + mins;
+				e.dispatch();				
+			}
+			
+			private function changeShiftLen(): void
+			{
+				var e: ChangeFieldEvent = new ChangeFieldEvent(ChangeFieldEvent.EVENT_CHANGE_PARAM_FIELD);
+				e.field = "shiftLen";
+				var hours: int = shiftLenHours.value;
+				var mins: int = shiftLenMins.value;
+				e.value = (hours * 60) + mins;
+				e.dispatch();				
+			}
+			
+			private function saveParams(): void
+			{
+				var e: ConfigurationEvent = new ConfigurationEvent(ConfigurationEvent.EVENT_SAVE_PARAM_CONFIG);
+				e.dispatch();
+			}
+		]]>
+		
+	</mx:Script>
+	<mx:Form width="100%">
+		<mx:FormItem width="100%">
+			<mx:CheckBox id="residents"
+				label="Show residents on entry form."
+				change="changeParam(event)"
+				selected="{model.config.params.promptResidents}"
+				styleName="normalLabel" 
+				tabIndex="1100"/>
+		</mx:FormItem>
+		<mx:FormItem width="100%">
+			<mx:CheckBox id="clinics"
+				label="Show clinics on entry form."
+				change="changeParam(event)"
+				selected="{model.config.params.promptClinics}"
+				styleName="normalLabel" 
+				tabIndex="1101"/>
+		</mx:FormItem>
+		<mx:FormItem width="100%" paddingTop="18">
+			<mx:CheckBox id="reqDiag"
+				label="Diagnosis is required before removing patient."
+				change="changeParam(event)"
+				selected="{model.config.params.requireDiagnosis}"
+				styleName="normalLabel"
+				tabIndex="1102" />
+		</mx:FormItem>
+		<mx:FormItem width="100%" paddingTop="18">
+			<mx:CheckBox id="codedDiag"
+				label="Diagnosis must be coded as ICD."
+			    change="changeParam(event)"
+				selected="{model.config.params.codedDiagnosis}"
+				enabled="{reqDiag.selected}"
+				styleName="normalLabel"
+				tabIndex="1103" />
+		</mx:FormItem>
+		<mx:FormItem width="100%" paddingTop="18">
+			<mx:CheckBox id="reqDisp"
+				label="Disposition is required before removing patient."
+				change="changeParam(event)"
+				selected="{model.config.params.requireDisposition}"
+				styleName="normalLabel"
+				tabIndex="1104" />
+		</mx:FormItem>
+		<mx:FormItem width="100%" paddingTop="18">
+			<mx:HBox>
+				<mx:CheckBox id="reqDelay"
+					label="Delay reason is required for visits exceeding"
+					change="changeParam(event)"
+					selected="{model.config.params.requireDelay}"
+					paddingTop="2" styleName="normalLabel"
+					tabIndex="1105" />
+				<widget:AccessibleNumericStepper 
+					id="minDelay"
+					name="Minutes"
+					keyDown="changeParam(event)"
+					value="{model.config.params.delayMinutes}"
+					change="changeParam(event)"
+					enabled="{reqDelay.selected}"
+					maximum="9999"
+					styleName="normalLabel"
+					tabIndex="1106" />
+				<mx:Label text="minutes." paddingTop="2" styleName="normalLabel" />				
+			</mx:HBox>
+		</mx:FormItem>
+		<mx:FormItem width="100%" paddingTop="18">
+			
+				<mx:FormItem  label="First shift begins at"  paddingTop="2" styleName="normalLabel" >
+					<mx:TextInput 
+				  	    id="shiftStart"
+					    initialize="{AccessibilityTools.accessComponentName(shiftStart,'First shift begins at time')}"
+					    text="{buildShiftStart(model.config.params.shiftStart)}" 
+					    width="50"
+					    change="changeShiftStart()"
+					    styleName="normalLabel"
+					    tabIndex="1107"/>
+				</mx:FormItem>	
+			
+		</mx:FormItem>
+		<mx:FormItem width="100%" paddingTop="6">
+			<mx:HBox horizontalGap="3">
+				<mx:FormItem label="Shift duration is" styleName="normalLabel"  paddingTop="2">
+				   <widget:AccessibleNumericStepper
+						id="shiftLenHours"
+					    name="Hours"
+						value="{int(model.config.params.shiftDuration / 60)}"
+						change="changeShiftLen()"
+						maximum="24"
+					 	styleName="normalLabel"
+					 	tabIndex="1108" />
+				</mx:FormItem>	
+				
+				<mx:Label
+					text="hours"
+					styleName="normalLabel" paddingTop="3" paddingRight="6" />
+				
+				<mx:FormItem> <!-- necessary to put formitem so it would not be read the label above by JAWS -->
+					<widget:AccessibleNumericStepper
+						id="shiftLenMins"
+						name="Minutes"
+						value="{int(model.config.params.shiftDuration % 60)}"
+						change="changeShiftLen()"
+						maximum="60"
+						styleName="normalLabel"
+						tabIndex="1109" />
+				</mx:FormItem> 
+				<mx:Label text="minutes" styleName="normalLabel" paddingTop="2" />	
+			</mx:HBox>
+		</mx:FormItem>
+		
+		<mx:FormItem paddingTop="18">
+			<mx:HBox horizontalGap="3">
+				<mx:FormItem label="Arriving Ambulance Room/Area is " paddingTop="2" styleName="normalLabel">
+			  	    <widget:ValueComboBox
+					    id="ambulance"
+					    dataProvider="{model.config.defaultRoomList}"
+				    	value="{model.config.params.ambulanceArea}"
+					    change="changeParam(event)"
+					    styleName="normalLabel"
+					    tabIndex="1110" />
+				</mx:FormItem>	    				
+			</mx:HBox>
+		</mx:FormItem>
+		<mx:FormItem paddingTop="6">
+			<mx:HBox horizontalGap="3" >
+				<mx:FormItem label="Default Room/Area is " paddingTop="2" styleName="normalLabel" >
+				    <widget:ValueComboBox
+					    id="dfltRoom"
+				       	dataProvider="{model.config.defaultRoomList}"
+					    value="{model.config.params.defaultRoom}"
+					    change="changeParam(event)"
+				    	styleName="normalLabel"
+					    tabIndex="1111" />	
+				</mx:FormItem>
+			 </mx:HBox>
+		</mx:FormItem>
+	</mx:Form>
+	<mx:Canvas width="100%" >
+		<mx:Button
+			label="Save Parameter Changes"
+			enabled="{(model.config.paramMods &amp;&amp; model.config.paramLoaded)}"
+			horizontalCenter="0" top="6" bottom="6"
+			click="saveParams()"
+			tabIndex="1900" />
+	</mx:Canvas>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigSelections.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigSelections.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigSelections.mxml	(revision 1227)
@@ -0,0 +1,366 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox
+        xmlns:mx="http://www.adobe.com/2006/mxml"
+        xmlns:acc="flash.accessibility.*"
+        width="100%" height="100%"
+        horizontalAlign="center"
+        creationComplete="init()"
+        show="loadSelectionLists()"
+        horizontalScrollPolicy="off"
+        verticalScrollPolicy="off"
+        currentState="{selectedListItem != null ? 'editing' : ''}">
+        
+    <mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.util.AccessibilityTools;
+		import mx.events.ListEvent;
+        import mx.managers.DragManager;
+        import mx.events.DragEvent;
+        import mx.binding.utils.BindingUtils;
+        import mx.collections.ArrayCollection;
+        import gov.va.med.edp.widget.InfoDialog;
+        import flash.events.Event;
+        import mx.events.DataGridEvent;
+        import gov.va.med.edp.vo.CodeSelectionVO;
+        import gov.va.med.edp.control.config.ConfigurationEvent;
+        import gov.va.med.edp.model.TrackingModelLocator;
+
+        [Embed(source="icon_close16.png")]
+        public var inactiveImg:Class;
+        public var activeImg:Class = Bitmap;
+
+        [Bindable]
+        private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private var _selectedListItem:CodeSelectionVO;
+        private var reordering:Boolean = false;
+
+        [Bindable(event="selectedListItemChange")]
+        private function get selectedListItem():CodeSelectionVO {
+            return _selectedListItem;
+        }
+
+        private function set selectedListItem(item:CodeSelectionVO):void {
+            if (item == null) {
+                if (reordering) {
+                    callLater(reselect);
+                    return;
+                }
+            } else if (item === _selectedListItem) {
+                if (reordering) reordering = false;
+            }
+            _selectedListItem = item;
+            dispatchEvent(new Event("selectedListItemChange"));
+        }
+
+        private function reselect():void {
+            var index:int = selections.dataProvider.getItemIndex(_selectedListItem);
+            selections.scrollToIndex(index);
+            selections.selectedIndex = index;
+            setModifiedFlags();
+        }
+
+        private var newCount: int = 0;
+
+        [Bindable]
+        private var selectionLists:ArrayCollection = new ArrayCollection();
+
+        private function inactiveImgFunction(o:Object, c:DataGridColumn):String {
+            var code:CodeSelectionVO = o as CodeSelectionVO;
+            if (code.inactive)
+                return "inactiveImg";
+            else
+                return "activeImg";
+        }
+
+        private function loadSelectionLists(): void
+        {
+            if (model.config.selectionConfigLoaded) return;
+            var loadEvent: ConfigurationEvent =
+                    new ConfigurationEvent(ConfigurationEvent.EVENT_LOAD_SELECTION_CONFIG);
+            loadEvent.dispatch();
+        }
+
+        private function init():void
+        {
+            var statuses:SelectionListDescriptor = new SelectionListDescriptor();
+            statuses.shortName = "Status";
+            statuses.longName = "Selections for Status";
+            statuses.flagsVisible = true;
+            BindingUtils.bindProperty(statuses, "list", model.config, "statuses");
+
+            var dispositions:SelectionListDescriptor = new SelectionListDescriptor();
+            dispositions.shortName = "Disposition";
+            dispositions.longName = "Selections for Disposition";
+            dispositions.flagsVisible = true;
+            BindingUtils.bindProperty(dispositions, "list", model.config, "dispositions");
+
+            var delays:SelectionListDescriptor = new SelectionListDescriptor();
+            delays.shortName = "Delay Reason";
+            delays.longName = "Selections for Delay Reason";
+            delays.flagsVisible = false;
+            BindingUtils.bindProperty(delays, "list", model.config, "delays");
+
+            var arrivals:SelectionListDescriptor = new SelectionListDescriptor();
+            arrivals.shortName = "Source";
+            arrivals.longName = "Selections for Mode of Arrival";
+            arrivals.flagsVisible = false;
+            BindingUtils.bindProperty(arrivals, "list", model.config, "arrivals");
+
+            selectionLists.addItem(statuses);
+            selectionLists.addItem(dispositions);
+            selectionLists.addItem(delays);
+            selectionLists.addItem(arrivals);
+        }
+
+        private function showFlagTip(item: Object): String
+        {
+            if (availLists.selectedIndex < 0) return "";
+
+            switch (availLists.selectedIndex) {
+                case 0:
+                    return "A = Admission\nO = Observation";
+                case 1:
+                    return "VA = VA Admission\n   A = Admission\n   M = Missed Opportunity";
+            }
+            return ""
+        }
+
+        private function markChanged(event:Event): void
+        {
+            //TODO:  prevent default if exported selection?
+            if (availLists.selectedIndex < 0) return;
+
+            if (event.currentTarget === nameInput) {
+                selectedListItem.displayName = nameInput.text;
+            } else if (event.currentTarget === abbreviationInput) {
+                selectedListItem.abbreviation = abbreviationInput.text;
+            } else if (event.currentTarget === flagInput) {
+                selectedListItem.flag = flagInput.text;
+            } else if (event.currentTarget === inactiveCheckBox) {
+                selectedListItem.inactive = inactiveCheckBox.selected;
+            }
+            
+            setModifiedFlags();
+        }
+
+		private function setModifiedFlags(): void
+		{
+            new ConfigurationEvent(ConfigurationEvent.EVENT_SELECTION_MODIFIED).dispatch();
+            //TODO:  post event to model instead of modifying directly
+            switch (availLists.selectedIndex) {
+                case 0:
+                    model.config.statusesChanged = true;
+                    break;
+                case 1:
+                    model.config.dispositionsChanged = true;
+                    break;
+                case 2:
+                    model.config.delaysChanged = true;
+                    break;
+                case 3:
+                    model.config.arrivalsChanged = true;
+                    break;
+            }
+		}
+		
+        private function listOrderTextChanged(event:Event):void {
+            if (listOrderInput.text.length == 0) return;
+            var newIndex:int = int(listOrderInput.text) - 1;
+            if (newIndex < 0 || newIndex >= selections.dataProvider.length) return;
+            if (newIndex != selections.selectedIndex) {
+                reordering = true;
+                var list: ArrayCollection = selections.dataProvider as ArrayCollection;
+                var sel: Object = list.removeItemAt(selections.selectedIndex);
+                list.addItemAt(sel, newIndex);
+                selections.selectedIndex = -1;
+            }
+        }
+
+        private function addEntry(): void
+        {
+            if (availLists.selectedIndex < 0) return;
+
+            //TODO:  post event to model instead of just updating dataprovider
+            newCount++;
+            var list: ArrayCollection = selections.dataProvider as ArrayCollection;
+            var newEntry: CodeSelectionVO = new CodeSelectionVO();
+            newEntry.displayName = "new" + newCount;
+            newEntry.id = 0;
+            list.addItem(newEntry);
+            setModifiedFlags();
+            if (AccessibilityTools.isAccessibilityActive()) InfoDialog.show("New Item Added", "Message", true);
+
+            var newIndex: int = list.length - 1;
+            selections.scrollToIndex(newIndex);
+            selections.selectedIndex = newIndex;
+
+        }
+
+        private function saveChanges(): void
+        {
+			for each (var selectionList:SelectionListDescriptor in selectionLists) {
+				 for each (var code:CodeSelectionVO in selectionList.list) {
+					 if (code.displayName == null || code.displayName.length == 0) {
+						 InfoDialog.show("There are selection list items with blank names which must be corrected before saving.\n"
+						, "Required Names", false, btnSaveSelectionChanges);
+						 return;
+					 }
+				 }
+			}
+
+            var e:ConfigurationEvent =
+                    new ConfigurationEvent(ConfigurationEvent.EVENT_SAVE_SELECTION_CONFIG);
+            e.dispatch();
+        }
+
+
+        private function handleEscKey(event:KeyboardEvent): void {
+            if (event.keyCode == Keyboard.ESCAPE) {
+                selections.selectedIndex = -1;
+                availLists.selectedIndex = -1;
+                if (btnSaveSelectionChanges.enabled)
+                    btnSaveSelectionChanges.setFocus();
+                else
+                    availLists.setFocus();
+            }
+        }
+
+        private function done():void {
+            selections.selectedIndex = -1;
+            if (btnSaveSelectionChanges.enabled)
+                btnSaveSelectionChanges.setFocus();
+            else
+                selections.setFocus();
+        }
+
+        private function doDragDrop(event:DragEvent):void {
+            reordering = true;
+        }
+
+	]]>
+    </mx:Script>
+
+    <mx:HBox height="100%" width="100%" keyDown="handleEscKey(event)" horizontalScrollPolicy="off">
+        <mx:VBox>
+            <mx:Label
+            	text="Selection List"
+            	minHeight="{listControlBox.height}"
+            	styleName="controlLabel" />
+            <mx:List
+                    id="availLists"
+                    accessibilityProperties="{availListsAcc}"
+                    dataProvider="{selectionLists}"
+                    labelField="shortName"
+                    rowCount="{selectionLists.length}"
+                    width="84"
+                    backgroundColor="0xe7e7e7" cornerRadius="4"
+                    tabIndex="1100"/>
+        </mx:VBox>
+        <mx:VBox
+                id="listArea"
+                height="100%"
+                visible="{availLists.selectedIndex > -1}">
+            <mx:HBox id="listControlBox" width="100%" verticalAlign="middle">
+                <mx:Button label="Add" click="addEntry()" tabIndex="1101"/>
+                <mx:Spacer width="2" />
+                <mx:Label id="viewTitle" styleName="controlLabel"
+                          text="{availLists.selectedItem.longName}"/>
+            </mx:HBox>
+            <mx:DataGrid
+                    id="selections"
+                    accessibilityProperties="{selectionsAcc}"
+                    width="100%" height="100%"
+                    dataProvider="{availLists.selectedItem.list}"
+                    editable="false"
+                    dragEnabled="true"
+                    dropEnabled="true"
+                    dragMoveEnabled="true"
+                    dragDrop="doDragDrop(event)"
+                    tabIndex="1102">
+                <mx:columns>
+                    <mx:DataGridColumn
+                    	headerText="Name"
+                    	dataField="displayName"
+                    	width="184" />
+                    <mx:DataGridColumn
+                    	headerText="Abbr"
+                    	dataField="abbreviation"
+                    	width="42" />
+                    <mx:DataGridColumn
+                        headerText="Flags"
+                        dataField="flag"
+                        visible="{availLists.selectedItem.flagsVisible}"
+                        dataTipFunction="showFlagTip"
+                        showDataTips="true"
+                        width="42" />
+                    <mx:DataGridColumn
+                        headerText="Inactive" textAlign="center"
+                        labelFunction="inactiveImgFunction"
+                        itemRenderer="gov.va.med.edp.widget.CenteredEmbedImage"
+                        width="60" />
+                    <mx:DataGridColumn
+                    	headerText="National Name"
+                    	dataField="national"
+                    	width="184" />
+                </mx:columns>
+            </mx:DataGrid>
+        </mx:VBox>
+    </mx:HBox>
+
+    <mx:HBox width="100%" horizontalAlign="center">
+        <mx:Button
+                id="btnSaveSelectionChanges"
+                label="Save Selection List Changes"
+                enabled="{(model.config.selectionMods &amp;&amp; model.config.selectionConfigLoaded)}"
+                click="saveChanges()" tabIndex="1900"/>
+    </mx:HBox>
+
+    <acc:AccessibilityProperties id="availListsAcc" name="Selection List"/>
+    <acc:AccessibilityProperties id="upButtonAcc" name="Up"/>
+    <acc:AccessibilityProperties id="downButtonAcc" name="Down"/>
+    <acc:AccessibilityProperties id="selectionsAcc" name="{viewTitle.text}"/>
+
+    <mx:states>
+        <mx:State name="editing">
+            <mx:AddChild position="after" relativeTo="{listArea}">
+                <mx:Form paddingLeft="0">
+                    <mx:FormHeading label="Edit Selection Item"/>
+                    <mx:FormItem label="Name">
+                        <mx:TextInput id="nameInput" minWidth="184" text="{selectedListItem.displayName}"
+                                      styleName="formField"
+                                      change="markChanged(event)" tabIndex="1200"/>
+                    </mx:FormItem>
+                    <mx:FormItem label="Abbreviation">
+                        <mx:TextInput id="abbreviationInput" minWidth="{nameInput.minWidth}" text="{selectedListItem.abbreviation}"
+                                      styleName="formField" change="markChanged(event)" tabIndex="1201"/>
+                    </mx:FormItem>
+                    <mx:FormItem label="Flags" visible="{availLists.selectedItem.flagsVisible}"
+                                 toolTip="{showFlagTip(null)}">
+                        <mx:TextInput id="flagInput"  minWidth="{nameInput.minWidth}" text="{selectedListItem.flag}" styleName="formField"
+                                      change="markChanged(event)" tabIndex="1202"/>
+                    </mx:FormItem>
+                    <mx:FormItem label="Inactive">
+                        <mx:CheckBox id="inactiveCheckBox" selected="{selectedListItem.inactive}"
+                                     styleName="formField" change="markChanged(event)" tabIndex="1203"/>
+                    </mx:FormItem>
+                    <mx:FormItem label="List Order" visible="{AccessibilityTools.isAccessibilityActive()}">
+                        <mx:TextInput
+                        	id="listOrderInput"
+                        	minWidth="{nameInput.minWidth}"
+                        	text="{availLists.selectedItem.list.getItemIndex(selectedListItem) + 1}"
+                            styleName="formField"
+                            tabIndex="1205"
+                            change="listOrderTextChanged(event)"/>
+                    </mx:FormItem>
+                </mx:Form>
+            </mx:AddChild>
+        </mx:State>
+    </mx:states>
+
+    <mx:NumberValidator id="listOrderValidator" minValue="1" maxValue="{availLists.selectedItem.list.length}"
+                        source="{listOrderInput}" property="text"/>
+	<mx:StringValidator id="nameValidator" required="true" source="{nameInput}" property="text"/>
+
+    <mx:Binding source="selections.selectedItem as CodeSelectionVO" destination="selectedListItem"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigStaff.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigStaff.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigStaff.mxml	(revision 1227)
@@ -0,0 +1,478 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	xmlns:widget="gov.va.med.edp.widget.*"
+	xmlns:accessibility="flash.accessibility.*"
+	width="100%" height="100%"
+	show="providerSrc.setFocus();"
+	paddingTop="6" paddingBottom="6" paddingLeft="12" paddingRight="12"
+	currentState="{getState(model.appViewState)}"
+	styleName="contentArea" >
+
+	<mx:Script>
+		<![CDATA[
+			import gov.va.med.edp.control.config.ColorChangedEvent;
+			import gov.va.med.edp.widget.InfoDialog;
+			import mx.collections.ICollectionView;
+			import gov.va.med.edp.control.config.MatchPersonEvent;
+			import mx.events.DataGridEvent;
+			import gov.va.med.edp.widget.AutoComplete;
+            import gov.va.med.edp.widget.ColorSelector;
+            import mx.controls.DataGrid;
+			import gov.va.med.edp.vo.StaffMemberVO;
+			import gov.va.med.edp.control.config.UpdateStaffEvent;
+			import gov.va.med.edp.control.config.ConfigurationEvent;
+			import gov.va.med.edp.model.TrackingModelLocator;
+			import gov.va.med.edp.util.AccessibilityTools;
+            import gov.va.med.edp.util.KeyUtils;
+            import mx.core.UIComponent;
+
+            [Bindable]
+			private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+			
+			[Bindable]
+			private var selectedProvider:StaffMemberVO;	
+			[Bindable]
+			private var selectedResident:StaffMemberVO;	
+			[Bindable]
+			private var selectedNurse:StaffMemberVO;									
+
+			private static const WIDTH:int = 320;
+
+			private var curStaffSrc: AutoComplete;
+			private var keyTimer: Timer;
+			private var lastRoot: String = "";
+
+			private function getState(state: int): String
+			// monitor state instead of using show event, since show not called on initial view
+			{
+				if (model.appViewState == TrackingModelLocator.VIEW_APP_ASSIGN_STAFF) {
+					loadStaffLists();
+				}
+				return "";
+			}
+
+			private function setStaffSrc(src: AutoComplete): void
+			{
+				// clear the control we are leaving
+				if (curStaffSrc != null) {
+					curStaffSrc.typedText = "";
+				}
+				if (src == null) {
+					var e:MatchPersonEvent = new MatchPersonEvent(MatchPersonEvent.EVENT_MATCH_PERSON);
+					e.partial = "";
+					e.personType = "";
+				}
+
+				// set to the new control or null
+				curStaffSrc = src;
+				lastRoot = "";
+				if ((keyTimer != null) && keyTimer.running) {
+					keyTimer.stop();
+				}
+			}
+
+			private function setTimer(event: Event): void
+			{
+				// stop the running timer, if we come back here too soon
+				if ((keyTimer != null) && keyTimer.running) {
+					keyTimer.stop();
+				}
+				// don't start the timer if we already have the subset of choices
+				if ((lastRoot.length > 0) && (curStaffSrc.typedText.substr(0, lastRoot.length) == lastRoot)) {
+					return;
+				}
+				// only search for inputs of length 3 or more
+				if (curStaffSrc != null && curStaffSrc.typedText.length > 2) {
+					keyTimer = new Timer(500,1);
+					keyTimer.addEventListener("timer", refreshStaffSrc);
+					keyTimer.start();
+				}
+			}
+
+			private function refreshStaffSrc(event: TimerEvent): void
+			{
+				lastRoot = curStaffSrc.typedText.toUpperCase();
+				var e: MatchPersonEvent = new MatchPersonEvent(MatchPersonEvent.EVENT_MATCH_PERSON);
+				e.partial = lastRoot;
+				if (curStaffSrc == providerSrc) {e.personType = "P"}
+				if (curStaffSrc == residentSrc) {e.personType = "R"}
+				if (curStaffSrc == nurseSrc) {e.personType = "N"}
+				e.dispatch();
+			}
+
+			private function set staffSrcReady(isReady: Boolean): void
+			{
+				if (isReady == false) return;
+				curStaffSrc.dataProvider = model.config.srcStaff;
+				curStaffSrc.open();
+				if (model.config.srcStaff.length > 0) curStaffSrc.selectedIndex = 0;
+			}
+
+			private function loadStaffLists(): void
+			{
+				if (model.config.staffConfigLoaded) return;
+				var loadEvent: ConfigurationEvent =
+					new ConfigurationEvent(ConfigurationEvent.EVENT_LOAD_STAFF_CONFIG);
+				loadEvent.dispatch();
+			}
+
+			private function addStaff(list: AutoComplete, role: String, grid: DataGrid): void
+			{
+				var staff:StaffMemberVO = null;
+				if (list!= null && list.selectedItem != null) {
+					staff = list.selectedItem as StaffMemberVO;
+					UpdateStaffEvent.dispatchAdd(staff, role);
+					grid.setFocus();
+		  	    } else {
+					var selectedStaffMemberName:String = list.typedText;
+					if (selectedStaffMemberName != null && selectedStaffMemberName != ""){
+					var ac:ICollectionView = list.dataProvider as ICollectionView;
+					for each (var item:StaffMemberVO in ac){
+							if (selectedStaffMemberName == item.displayName){
+								staff = item;
+								UpdateStaffEvent.dispatchAdd(staff, role);
+							    grid.setFocus();
+							   	break;
+							}
+					}	
+				  }
+				}						
+				resetAutoComplete(list);
+				
+			}
+			
+			
+			private function resetAutoComplete(list:AutoComplete):void{
+				list.selectedIndex = -1;
+				list.typedText = "";
+			}
+
+			private function handleRemoveAndEscKeys(event:KeyboardEvent, grid: DataGrid):void{
+				if (KeyUtils.isRemoveKey(event)){
+					removeStaff(grid);
+				} else if (event.keyCode == Keyboard.ESCAPE){
+					grid.selectedIndex = -1;
+					btnSaveStaff.setFocus();
+				}
+			}
+
+
+			private function removeStaff(grid: DataGrid): void
+			{
+				if (grid.selectedIndex < 0 || grid.selectedItem == null) return;
+				var selectedIndx:int = grid.selectedIndex;
+				var staff:StaffMemberVO = grid.selectedItem as StaffMemberVO;
+			    UpdateStaffEvent.dispatchRemove(staff);
+			    if (AccessibilityTools.isAccessibilityActive())InfoDialog.show("removed successfully", "Message", true, grid);
+			    grid.setFocus();
+			    if (grid.dataProvider.length > 0){
+					grid.selectedIndex = selectedIndx - 1;
+			    } 
+			}
+
+			private function saveStaff(): void
+			{
+				var saveEvent: ConfigurationEvent =
+					new ConfigurationEvent(ConfigurationEvent.EVENT_SAVE_STAFF_CONFIG);
+				saveEvent.dispatch();
+				
+				providerDest.selectedIndex = -1;
+				residentDest.selectedIndex = -1;
+				nurseDest.selectedIndex = -1;
+			}
+			
+
+			private function enableButton(list: AutoComplete,component:UIComponent):void
+			{
+				var enableFlag:Boolean = false;
+				
+				if (list.typedText == "") 
+				{
+					enableFlag = false;
+				}	
+				else
+				{ 
+				    if ((list.selectedIndex > -1) || ((list.text.length > 0) && (list.text != null)))
+				    {
+					    enableFlag = true;
+				    }
+				}    
+				
+				component.enabled = enableFlag;
+			}	
+			
+			private function fireColorChange(event:ColorChangedEvent):void {
+				var staffMember:StaffMemberVO = null;
+				if (event.currentTarget === providerColorSelector) {
+					staffMember = selectedProvider;
+					if (staffMember.color != providerColorSelector.color) {
+						staffMember.color.ignore = providerColorSelector.color.ignore;
+						staffMember.color.text = providerColorSelector.color.text;
+						staffMember.color.back = providerColorSelector.color.back;						
+						staffMember.colorChanged = true;
+						new ConfigurationEvent(ConfigurationEvent.EVENT_STAFF_MODIFIED).dispatch();
+						model.config.providers.refresh();
+					}			
+				} else if (event.currentTarget === residentColorSelector) {
+					staffMember = selectedResident;
+					if (staffMember.color != residentColorSelector.color) {
+						staffMember.color.ignore = residentColorSelector.color.ignore;
+						staffMember.color.text = residentColorSelector.color.text;
+						staffMember.color.back = residentColorSelector.color.back;
+						staffMember.colorChanged = true;
+						new ConfigurationEvent(ConfigurationEvent.EVENT_STAFF_MODIFIED).dispatch();
+						model.config.residents.refresh();
+					}			
+				} else if (event.currentTarget === nurseColorSelector) {
+					staffMember = selectedNurse;
+					if (staffMember.color != nurseColorSelector.color) {
+						staffMember.color.ignore = nurseColorSelector.color.ignore;
+						staffMember.color.text = nurseColorSelector.color.text;
+						staffMember.color.back = nurseColorSelector.color.back;
+						staffMember.colorChanged = true;
+						new ConfigurationEvent(ConfigurationEvent.EVENT_STAFF_MODIFIED).dispatch();
+						model.config.nurses.refresh();
+					}			
+				} 
+			}			
+		]]>
+	</mx:Script>
+
+	<mx:HBox width="100%" height="100%">
+		<mx:VBox verticalGap="0">
+			<mx:Label id="mdLabel" text="Providers" styleName="controlLabel" />
+			<widget:AutoComplete
+				id="providerSrc"
+				name="Autocomplete Provider Name"
+				focusIn="{setStaffSrc(providerSrc); enableButton(providerSrc,addProvider)}" 
+				focusOut="{setStaffSrc(null); enableButton(providerSrc,addProvider)}"
+				keyUp="enableButton(providerSrc,addProvider)"
+				typedTextChange="setTimer(event)"
+				selectedIndex="-1"
+				prompt="(type provider name)"
+				labelField="displayName"
+				width="190"
+				enter="{addStaff(providerSrc, 'P', providerDest)}"
+                tabIndex="1001"/>
+		</mx:VBox>
+		<mx:Canvas height="100%">
+			<mx:Button
+				label="Add &gt;&gt;"
+				id="addProvider"
+				initialize="{AccessibilityTools.accessComponentDescription(addProvider,'Press button to add provider to the list.')}"
+				top="{mdLabel.height}" horizontalCenter="0"
+				click="addStaff(providerSrc, 'P', providerDest); enableButton(providerSrc,addProvider)"
+                enabled="{false}"
+                tabIndex="1002"
+                focusEnabled="false"/>
+			<mx:Button
+				label="Remove"
+				id="removeProvider"
+				initialize="{AccessibilityTools.accessComponentDescription(removeProvider,'Press button to remove provider from the list.')}"
+				verticalCenter="0" horizontalCenter="0"
+				click="removeStaff(providerDest)"
+                enabled="{providerDest.selectedItem != null}"
+                tabIndex="1004"
+                focusEnabled="false"/>
+		</mx:Canvas>
+		<mx:DataGrid
+			id="providerDest"
+			accessibilityProperties="{providerAccProps}"
+			height="100%"
+			editable="false"
+			keyDown="handleRemoveAndEscKeys(event,providerDest)"
+			dataProvider="{model.config.providers}"
+			headerStyleName="controlLabel"
+            tabIndex="1003">
+			<mx:columns>
+				<mx:DataGridColumn
+					headerText="Provider"
+					dataField="name"
+					width="190"/>
+				<mx:DataGridColumn
+					headerText="Initials"
+					dataField="initials"
+					width="60"/>
+				<mx:DataGridColumn
+					editable="true"
+					headerText="Color"
+					width="90"
+					dataField="color"
+					itemRenderer="gov.va.med.edp.widget.ColorSampleRenderer" />
+			</mx:columns>
+		</mx:DataGrid>
+        <mx:VBox
+        	verticalGap="2"
+        	height="100%"
+        	id="providerColorSelectorFrm"
+        	visible="{providerDest.selectedItem != null}">
+            <mx:Label text="Change Color"/>
+            <widget:ColorSelector id="providerColorSelector" tabIndex="1004" color="{selectedProvider.color}" colorChange="fireColorChange(event)"/>
+        </mx:VBox>
+	</mx:HBox>
+
+	<mx:HBox width="100%" height="100%" paddingTop="18">
+		<mx:VBox verticalGap="0">
+			<mx:Label text="Residents" styleName="controlLabel" />
+			<widget:AutoComplete
+				id="residentSrc"
+				name="Autocomplete resident name"
+				focusIn="setStaffSrc(residentSrc); enableButton(residentSrc,addResident)" 
+				focusOut="setStaffSrc(null); enableButton(residentSrc,addResident)"
+				keyUp="enableButton(residentSrc,addResident)"
+				typedTextChange="setTimer(event)"
+				selectedIndex="-1"
+				prompt="(type resident name)"
+				labelField="displayName"
+				width="190"
+				enter="addStaff(residentSrc, 'R', residentDest)"
+                tabIndex="1010"/>
+		</mx:VBox>
+		<mx:Canvas height="100%">
+			<mx:Button
+				label="Add &gt;&gt;"
+				id="addResident"
+				initialize="{AccessibilityTools.accessComponentDescription(addResident,'Press button to add resident to the list.')}"
+				top="{mdLabel.height}" horizontalCenter="0"
+				click="addStaff(residentSrc, 'R', residentDest); enableButton(residentSrc,addResident)"
+                tabIndex="1011"
+                enabled="{false}"
+                focusEnabled="false"/>
+			<mx:Button
+				label="Remove"
+				id="remResident"
+				initialize="{AccessibilityTools.accessComponentDescription(remResident,'Press button to remove resident from the list.')}"
+				verticalCenter="0" horizontalCenter="0"
+				click="removeStaff(residentDest)"
+                tabIndex="1013"
+                enabled="{residentDest.selectedItem != null}"
+                    focusEnabled="false"/>
+		</mx:Canvas>
+
+		<mx:DataGrid
+			id="residentDest"
+			accessibilityProperties="{residentAccProps}"
+			height="100%"
+			editable="false"
+			keyDown="handleRemoveAndEscKeys(event,residentDest)"
+			dataProvider="{model.config.residents}"
+			headerStyleName="controlLabel"
+            tabIndex="1012">
+			<mx:columns>
+				<mx:DataGridColumn
+					headerText="Resident"
+					dataField="name"
+					width="190"/>
+				<mx:DataGridColumn
+					headerText="Initials"
+					dataField="initials"
+					width="60"/>
+				<mx:DataGridColumn
+					editable="true"
+					headerText="Color"
+					width="90"
+					dataField="color"
+					itemRenderer="gov.va.med.edp.widget.ColorSampleRenderer" />
+			</mx:columns>
+		</mx:DataGrid>
+        <mx:VBox
+        	verticalGap="2"
+        	height="100%"
+        	id="residentColorSelectorFrm"
+        	visible="{residentDest.selectedItem != null}">
+            <mx:Label text="Change Color"/>
+            <widget:ColorSelector id="residentColorSelector" tabIndex="1013" color="{selectedResident.color}" colorChange="fireColorChange(event)"/>
+        </mx:VBox>		
+	</mx:HBox>
+
+	<mx:HBox width="100%" height="100%" paddingTop="18">
+		<mx:VBox verticalGap="0">
+			<mx:Label text="Nurses" styleName="controlLabel" />
+			<widget:AutoComplete
+				id="nurseSrc"
+				name="Autocomplete nurse name"
+				focusIn="setStaffSrc(nurseSrc); enableButton(nurseSrc,addNurse)" 
+				focusOut="setStaffSrc(null); enableButton(nurseSrc,addNurse)"
+				keyUp="enableButton(nurseSrc,addNurse)"
+				typedTextChange="setTimer(event)"
+				selectedIndex="-1"
+				prompt="(type nurse name)"
+				labelField="displayName"
+				width="190"
+				enter="addStaff(nurseSrc, 'N', nurseDest)"
+                tabIndex="1020"/>
+		</mx:VBox>
+		<mx:Canvas height="100%">
+			<mx:Button
+				label="Add &gt;&gt;"
+				id="addNurse"
+				initialize="{AccessibilityTools.accessComponentDescription(addNurse,'Press button to add nurse to the list.')}"
+				top="{mdLabel.height}" horizontalCenter="0"
+				click="addStaff(nurseSrc, 'N', nurseDest); enableButton(nurseSrc,addNurse)"      
+                enabled="{false}"
+                tabIndex="1021"
+                focusEnabled="false"/>
+            <mx:Button
+				label="Remove"
+				id="remNurse"
+                initialize="{AccessibilityTools.accessComponentDescription(remNurse,'Press button to remove nurse from the list.')}"
+            	verticalCenter="0" horizontalCenter="0"
+				click="removeStaff(nurseDest)"
+                enabled="{nurseDest.selectedItem != null}"
+                tabIndex="1023"
+                focusEnabled="false"/>
+		</mx:Canvas>
+		<mx:DataGrid
+			id="nurseDest"
+			accessibilityProperties="{nurseAccProps}"
+			height="100%"
+			editable="false"	
+			keyDown="handleRemoveAndEscKeys(event,nurseDest)"
+			dataProvider="{model.config.nurses}"
+			headerStyleName="controlLabel"
+            tabIndex="1022">
+			<mx:columns>
+				<mx:DataGridColumn
+					headerText="Nurse"
+					dataField="name"
+					width="190"/>
+				<mx:DataGridColumn
+					headerText="Initials"
+					dataField="initials"
+					width="60"/>
+				<mx:DataGridColumn
+					editable="true"
+					headerText="Color"
+					width="90"
+					dataField="color"
+					itemRenderer="gov.va.med.edp.widget.ColorSampleRenderer" />
+			</mx:columns>
+		</mx:DataGrid>
+        <mx:VBox
+        	verticalGap="2"
+        	height="100%"
+        	id="nurseColorSelectorFrm"
+        	visible="{nurseDest.selectedItem != null}">
+            <mx:Label text="Change Color"/>
+            <widget:ColorSelector id="nurseColorSelector" tabIndex="1023" color="{selectedNurse.color}" colorChange="fireColorChange(event)"/>
+        </mx:VBox>			
+	</mx:HBox>
+
+	<mx:Canvas width="100%" >
+		<mx:Button
+			id = "btnSaveStaff"
+			label="Save Staff Changes"
+			enabled="{(model.config.staffMods &amp;&amp; model.config.staffConfigLoaded)}"
+			horizontalCenter="0" top="6" bottom="6"
+			click="saveStaff()"
+            tabIndex="1100"/>
+	</mx:Canvas>
+	<accessibility:AccessibilityProperties id="residentAccProps" name="active residents list"/>
+	<accessibility:AccessibilityProperties id="providerAccProps" name="active providers list"/>
+	<accessibility:AccessibilityProperties id="nurseAccProps" name="active nurses list"/>
+	<mx:Binding source="model.config.srcStaffReady" destination="staffSrcReady" />
+ 	<mx:Binding source="StaffMemberVO(providerDest.selectedItem)" destination="selectedProvider"/>  	
+ 	<mx:Binding source="StaffMemberVO(residentDest.selectedItem)" destination="selectedResident"/>  	
+ 	<mx:Binding source="StaffMemberVO(nurseDest.selectedItem)" destination="selectedNurse"/>  	
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/ConfigView.mxml	(revision 1227)
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	xmlns:config="gov.va.med.edp.view.config.*"
+    xmlns:widget="gov.va.med.edp.widget.*"
+    width="100%" height="100%"
+	paddingBottom="6" paddingRight="6" paddingLeft="6" paddingTop="6"
+	creationComplete="loadConfig()"
+	styleName="contentArea" >
+
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.config.ConfigurationEvent;
+		import mx.managers.PopUpManager;
+		import gov.va.med.edp.view.HelpMessage;
+		
+		private function loadConfig(): void
+		{
+			var loadEvent: ConfigurationEvent = new ConfigurationEvent(ConfigurationEvent.EVENT_LOAD_CONFIGURATION);
+			loadEvent.dispatch();
+		}
+	]]>
+	</mx:Script>
+			
+	<mx:Canvas width="100%">
+<!--		linkbar was horizontalalign=center-->
+		<widget:LinkButtonTabBar dataProvider="configViews" tabStyleName="linkUnSelected" selectedTabTextStyleName="linkSelected" tabIndex="1000"/>	
+	</mx:Canvas>
+
+	<mx:ViewStack id="configViews" width="100%" height="100%">
+		<config:ConfigBeds id="configBeds" label="Room / Area" />
+		<config:ConfigBoard id="configBoard" label="Display Board" />
+		<config:ConfigColor id="configColor" label="Colors" />
+		<config:ConfigParams id="configParams" label="Parameters" />
+		<config:ConfigSelections id="configSelections" label="Selections" />
+	</mx:ViewStack>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/DuplicateNameValidator.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/DuplicateNameValidator.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/DuplicateNameValidator.as	(revision 1227)
@@ -0,0 +1,55 @@
+package gov.va.med.edp.view.config
+{
+	import gov.va.med.edp.vo.RoomBedVO;
+	
+	import mx.collections.ArrayCollection;
+	import mx.validators.ValidationResult;
+	import mx.validators.Validator;
+	
+	public class DuplicateNameValidator extends Validator
+	{
+		[Bindable]
+		public var beds:ArrayCollection;
+
+		[Bindable]
+		public var selectedBed:RoomBedVO;
+	
+		[Bindable]
+		public var field:String;
+
+		private var results:Array;
+
+        public function DuplicateNameValidator() {
+            super();
+        }
+    
+    	private function isDuplicate(value:String):Boolean {
+    		if (selectedBed == null) return false;
+    		var skipIndex:int = beds.getItemIndex(selectedBed);
+    		for (var i:int = 0; i < beds.length; i++) {
+    			if (i == skipIndex) continue;
+                var bed:RoomBedVO = beds[i] as RoomBedVO;
+                
+                if (bed[field].toLowerCase() == value.toLowerCase()) return true;
+            }
+            return false;
+    	}
+    
+        override protected function doValidation(value:Object):Array {
+            var inputValue:String = String(value);
+
+            results = [];
+			results = super.doValidation(value);        
+            if (results.length > 0)
+                return results;
+        
+        	if (isDuplicate(inputValue)) {
+        		results.push(new ValidationResult(true, null, "duplicate", "Duplicate name is not allowed."));
+        		return results;
+        	}
+        
+            return results;
+        }
+
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/SelectionListDescriptor.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/SelectionListDescriptor.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/config/SelectionListDescriptor.as	(revision 1227)
@@ -0,0 +1,13 @@
+package gov.va.med.edp.view.config
+{
+import mx.collections.ArrayCollection;
+    [Bindable]
+    public class SelectionListDescriptor
+	{
+		public var shortName:String;
+        public var longName:String;
+        public var flagsVisible:Boolean;
+        public var list:ArrayCollection;
+
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/debug/LastNetworkCallView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/debug/LastNetworkCallView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/debug/LastNetworkCallView.mxml	(revision 1227)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
+	xmlns:reports="gov.va.med.edp.view.debug.*"
+	width="100%" height="100%">
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.vo.DebugVO;
+		import gov.va.med.edp.control.reports.ReportEvent;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		private function displayXML(): void
+		{
+			if (networkCallsGrid.selectedItem != null){
+				responseTextBox.text = DebugVO(networkCallsGrid.selectedItem).results;
+				parametersTextBox.text =  DebugVO(networkCallsGrid.selectedItem).parameters;	
+				requestTextBox.text = DebugVO(networkCallsGrid.selectedItem).request;
+			}
+		}
+		
+		private function clearDebugList(): void
+		{
+			responseTextBox.text = "";
+			parametersTextBox.text = "";
+			requestTextBox.text = "";
+			model.debug.cspServiceCallList.removeAll();
+		}		
+		
+	]]>
+	</mx:Script>
+	
+	<mx:LinkButton label="Clear List" click="{clearDebugList()}" />
+	<mx:DataGrid id="networkCallsGrid" width="100%" height="40%" 
+		dataProvider="{model.debug.cspServiceCallList}"
+		click="displayXML()">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="url" headerText="Url" />
+			<mx:DataGridColumn dataField="command" headerText="Command"/>
+        </mx:columns>		
+	</mx:DataGrid>
+ 
+    <mx:TabNavigator id="tn"  width="100%" height="100%" creationPolicy="all">
+        <mx:VBox label="Parameters" width="100%" height="100%">
+            <mx:TextArea id="parametersTextBox" width="100%" height="100%"/>
+        </mx:VBox>
+
+        <mx:VBox label="Request" width="100%" height="100%">
+            <mx:TextArea id="requestTextBox" width="100%" height="100%"/>
+        </mx:VBox>
+
+        <mx:VBox label="Response" width="100%" height="100%">
+            <mx:TextArea id="responseTextBox" width="100%" height="100%"/>
+        </mx:VBox>
+    </mx:TabNavigator>
+	
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/ClosedVisitSelector.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/ClosedVisitSelector.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/ClosedVisitSelector.mxml	(revision 1227)
@@ -0,0 +1,128 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- ClosedVisitSelector.mxml -->
+
+<mx:VBox	
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	xmlns:widget="gov.va.med.edp.widget.*"
+	xmlns:log="gov.va.med.edp.view.log.*"
+	width="480" height="100%" xmlns:accessibility="flash.accessibility.*">
+	
+	<mx:Script>
+		<![CDATA[
+			import gov.va.med.edp.widget.OkCancelDialog;
+			import gov.va.med.edp.util.Vista;
+			import gov.va.med.edp.vo.StaffMemberVO;
+			import mx.managers.IFocusManagerComponent;
+			import gov.va.med.edp.vo.VisitVO;
+			import gov.va.med.edp.control.MatchItemsEvent;
+			import mx.controls.dataGridClasses.DataGridColumn;
+			import mx.events.CloseEvent;
+			import mx.events.DataGridEvent;
+			import gov.va.med.edp.model.TrackingModelLocator;
+			import gov.va.med.edp.control.TrackingEvent;
+			import gov.va.med.edp.control.SwitchLogEntryEvent;
+			
+			[Bindable]
+			private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+			
+			public function confirmSwitch(): void
+			{
+				if (model.logEdit.dirty) {
+					OkCancelDialog.show("Are you sure you want to change visits?\n\n" +
+					  "You have unsaved changes.\nIf you continue, you will lose the changes.\n\n" +
+				 	  "Press OK to continue and lose the changes.\n" +
+				  	  "Press Cancel to stay and save the changes.", "Discard Changes?", confirmSwitchHandler, patient);		
+				} else {
+					switchLogEntry();
+				}
+			}
+			
+			public function confirmSwitchHandler(event: CloseEvent): void
+			{
+				if (event.detail == OkCancelDialog.OK) {
+					switchLogEntry();
+				} else {
+					model.synchToClosedEntry(); // TODO: move this to an event
+				}
+			}
+			
+			public function switchLogEntry(): void
+			{
+				var switchEvent: SwitchLogEntryEvent = 
+					new SwitchLogEntryEvent(SwitchLogEntryEvent.EVENT_SWITCH_LOG_ENTRY);
+				switchEvent.logID = VisitVO(visits.selectedItem).id;
+				switchEvent.selectedIndex = visits.selectedIndex;
+				switchEvent.dispatch();
+			}
+			
+			public function matchPatientName(): void
+			{
+				//if (patient.text.length == 0) return;
+				
+				var match: MatchItemsEvent =
+					new MatchItemsEvent(MatchItemsEvent.EVENT_MATCH_CLOSED_VISITS);
+				match.partial = patient.text;
+				match.dispatch();
+			}
+			
+			private function formatDate(item: Object, column: DataGridColumn): String
+			{
+				var visit: VisitVO = item as VisitVO;
+				if ((visit != null) && (visit.inTS != null)) {
+					return Vista.formattedDate(visit.inTS);					
+				} else {
+					return "";
+				}
+			}
+			
+			private function keyHandler(e:KeyboardEvent): void
+			{
+				if (e.keyCode == Keyboard.SPACE) {
+					var c:IFocusManagerComponent = focusManager.getNextFocusManagerComponent();
+					if (c != null) focusManager.setFocus(c);
+				}
+			} 
+			
+			private function set reloadDataAndClearGridSelection(index: int): void
+			{
+				if (index == -1) {
+					matchPatientName();
+				}
+			}			
+			
+		]]>
+	</mx:Script>
+
+	<mx:HBox paddingTop="6" width="100%">
+		<mx:Label text="Patient Name or Date:" paddingTop="2"/>
+		<mx:TextInput 
+			id="patient" width="100%"
+			accessibilityProperties="{accPatientName}"
+			enabled="{!model.logEdit.dirty}"
+			enter="matchPatientName()"
+			tabIndex="100"/>
+        <mx:Button id="patientSearchBtn" label="Search" click="matchPatientName()" focusEnabled="false"/>
+	</mx:HBox>
+
+	<mx:DataGrid
+		id="visits"
+		accessibilityProperties="{accClosedVisit}"
+		width="100%" height="100%"
+		dataProvider="{model.matchingClosedVisits}"
+		selectedIndex="{model.matchingClosedVisitsIndex}"
+		change="confirmSwitch()"
+		keyUp="keyHandler(event)"
+		useRollOver="false"
+        tabIndex="101">
+	   	<mx:columns>
+			<mx:DataGridColumn dataField="name" headerText="Name" />
+			<mx:DataGridColumn  dataField="inTS" labelFunction="formatDate" headerText="Time In"/>
+		</mx:columns>		
+		
+	</mx:DataGrid>
+
+	<accessibility:AccessibilityProperties id="accPatientName" name="Patient Name or Date (mm/dd/yy)" />
+	<accessibility:AccessibilityProperties id="accClosedVisit" name="Closed Visit" />
+	<mx:Binding source="model.matchingClosedVisitsIndex" destination="reloadDataAndClearGridSelection" />
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/DiagnosesCoded.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/DiagnosesCoded.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/DiagnosesCoded.mxml	(revision 1227)
@@ -0,0 +1,256 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:widget="gov.va.med.edp.widget.*">
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.widget.InfoDialog;
+		import mx.events.CollectionEvent;
+		import gov.va.med.edp.model.LogEdit;
+		import mx.controls.ComboBox;
+		import mx.controls.CheckBox;
+		import gov.va.med.edp.vo.PCECodedValueVO;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import mx.collections.ICollectionView;
+		import gov.va.med.edp.control.MatchItemsEvent;
+		import gov.va.med.edp.control.ChangeLogEntryFieldEvent;
+		import gov.va.med.edp.util.AccessibilityTools;
+        import gov.va.med.edp.util.KeyUtils;
+
+        [Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private function set selectFirstDiagnosisMatch(value: Boolean): void
+        {        
+        	if (value && model.matchingDiagnoses.length > 0){
+	        	diagnosisMatches.selectedIndex = 0;
+	        	diagnosisMatches.setFocus();
+        	}
+        }
+        	
+        private function set setPrimaryBtnState(codedValue: PCECodedValueVO): void
+        {        
+        	if (codedValue){
+        		primaryDiagnosisBtn.enabled = true;
+        	} else {
+        		primaryDiagnosisBtn.enabled = false;
+        	}
+        }        	
+        		
+		private function setPrimaryDiagnosis():void {
+				var selectedDiagnosis:PCECodedValueVO = selectedDiagnosisGrid.selectedItem as PCECodedValueVO;
+				if (selectedDiagnosis == null) return;
+				
+				model.logEdit.entry.diagnoses.filterFunction = null;
+				
+				for each (var enteredDiagnosis: PCECodedValueVO in model.logEdit.entry.diagnoses) {
+					enteredDiagnosis.updated = true;
+					if (enteredDiagnosis.code == selectedDiagnosis.code){
+						enteredDiagnosis.primary = true;
+					} else {
+						enteredDiagnosis.primary = false;
+					}
+					var updateEvent:ChangeLogEntryFieldEvent = 
+						new ChangeLogEntryFieldEvent(ChangeLogEntryFieldEvent.EVENT_CHANGE_LOG_ENTRY_FIELD);
+					updateEvent.clear = false;
+					updateEvent.field = "diagnoses";
+					updateEvent.value = enteredDiagnosis;
+					updateEvent.dispatch();  		
+				}		
+		}
+		
+		
+		
+		private function addDiagnosis(): void
+		{
+			var pceItem: PCECodedValueVO = diagnosisMatches.selectedItem as PCECodedValueVO;
+			
+			if (pceItem== null || isDuplicateCode(pceItem) || isEmptyCode(pceItem)) return;		
+			
+			if (model.logEdit.entry.diagnoses.length == 0)
+			pceItem.primary = true;	
+
+			pceItem.added = true;
+			var addEvent:ChangeLogEntryFieldEvent = 
+				new ChangeLogEntryFieldEvent(ChangeLogEntryFieldEvent.EVENT_CHANGE_LOG_ENTRY_FIELD);
+			addEvent.clear = false;
+			addEvent.field = "diagnoses";
+			addEvent.value = pceItem;
+			addEvent.dispatch();
+			
+			if (AccessibilityTools.isAccessibilityActive())
+			
+			InfoDialog.show("added successfully", "Message", true, searchBtn);
+			
+			txtDiagnosis.text = "";
+			diagnosisMatches.selectedIndex = -1;
+			txtDiagnosis.setFocus();
+		}	
+
+		private function isEmptyCode(selectedDiagnosis: PCECodedValueVO): Boolean
+		{
+			if (selectedDiagnosis.code == "" || selectedDiagnosis.code == null){		
+				return true;
+			} else {
+				return false;
+			}
+		}
+
+		private function isDuplicateCode(selectedDiagnosis: PCECodedValueVO): Boolean
+		{
+			var enteredDiagnoses:ICollectionView = model.logEdit.entry.diagnoses;
+			for each (var enteredDiagnosis: PCECodedValueVO in enteredDiagnoses) {
+				if (selectedDiagnosis.code == enteredDiagnosis.code) return true;
+			}
+			return false;
+		}
+		
+		public static function activeDiagnosisFilter(item:Object): Boolean
+		{
+            var pceItem: PCECodedValueVO = item as PCECodedValueVO;
+            return !pceItem.remove;
+        }		
+		
+		private function removeDiagnosis(): void
+		{
+			if (selectedDiagnosisGrid.selectedIndex < 0) return;
+			
+			model.logEdit.entry.diagnoses.filterFunction = activeDiagnosisFilter;
+			model.logEdit.entry.diagnoses.refresh();
+ 			
+			var codedValue: PCECodedValueVO = selectedDiagnosisGrid.selectedItem as PCECodedValueVO;
+			var removeEvent:ChangeLogEntryFieldEvent =
+				new ChangeLogEntryFieldEvent(ChangeLogEntryFieldEvent.EVENT_CHANGE_LOG_ENTRY_FIELD);
+			removeEvent.clear = true;
+			removeEvent.field = "diagnoses";
+			removeEvent.value = codedValue;
+			removeEvent.dispatch();
+			
+			if (AccessibilityTools.isAccessibilityActive())
+			InfoDialog.show("removed successfully", "Message", true, addBtn);
+			selectedDiagnosisGrid.setFocus();
+		}	
+		
+		private function matchDiagnoses():void
+		{
+			diagnosisMatches.dataProvider = null;
+			var matchEvent: MatchItemsEvent =
+				new MatchItemsEvent(MatchItemsEvent.EVENT_MATCH_DIAGNOSES);
+			matchEvent.partial = txtDiagnosis.text;
+			matchEvent.dispatch();
+		}		
+
+		private function addDiagnosisOnEnter(event:KeyboardEvent):void
+		{
+			if (event.keyCode == Keyboard.ENTER){
+				addDiagnosis();
+			}
+		}
+		
+		private function removeDiagnosisOnDelete(event:KeyboardEvent):void
+		{
+			if (KeyUtils.isRemoveKey(event)){
+				removeDiagnosis();
+			}
+		}		
+		
+/* 		
+		Calls to validateData were removed because the diagnosis is NOT required before
+		saving the record.  It is only required when removing the patient from the
+		board and closing the visit.  The call to validateData was previously at the
+		end of addDiagnosis() and in the valueCommit property of selectedDiagnosisGrid.
+		
+		private function validateData():void
+		{
+			if (model.logEdit.entry != null && model.logEdit.entry.requireDiagnosis){
+				if (model.logEdit.entry.diagnoses.length > 0){
+					selectedDiagnosisGrid.errorString = "";
+				} else {
+					selectedDiagnosisGrid.errorString = "At least one diagnosis must be provided.";
+				}
+			}
+		}
+*/		
+		
+	]]>
+	</mx:Script>
+    
+	<mx:VBox id="dxSearchBox" width="100%" verticalGap="0">
+		<mx:Label text="Diagnosis" styleName="controlLabel" />
+		<mx:HBox width="100%" id="diagnosesSearchHBox" horizontalGap="4">
+            <mx:TextInput
+                id="txtDiagnosis"
+                initialize="{AccessibilityTools.accessComponentName(txtDiagnosis,'Diagnosis search box')}"
+                width="100%"
+                enter="matchDiagnoses()"
+                paddingRight="0"
+                tabIndex="1200"/>
+            <mx:Button label="Search" id="searchBtn" tabIndex="1201" click="{matchDiagnoses()}" paddingLeft="4" paddingRight="4"/>
+		</mx:HBox>
+         <mx:Spacer height="4"/>
+		<mx:List
+			id="diagnosisMatches"
+			initialize="{AccessibilityTools.accessComponentName(diagnosisMatches, 'Diagnosis Matches List')}"
+			useRollOver="false"
+			doubleClickEnabled="true" doubleClick="{addDiagnosis()}"
+			keyDown="addDiagnosisOnEnter(event)"
+			allowMultipleSelection="false"
+			showDataTips="true"
+			dataProvider="{model.matchingDiagnoses}"
+			width="100%"
+            tabIndex="1202"/>
+	</mx:VBox>
+
+	<mx:Canvas>
+		<mx:Button
+			label="Add &gt;"
+			id="addBtn"
+			top="18"
+			horizontalCenter="0"
+			click="addDiagnosis()" tabIndex="1203"/>
+		<mx:Button
+			label="Remove"
+			top="56"
+			horizontalCenter="0"
+			click="removeDiagnosis()"
+			visible="{selectedDiagnosisGrid.selectedIndex > -1}" tabIndex="1204"/>
+	</mx:Canvas>
+	
+	<mx:VBox width="100%" verticalGap="0" id="selectedBox">
+		<mx:Label text="Selected Diagnoses" styleName="controlLabel" />
+		<mx:DataGrid
+			id="selectedDiagnosisGrid"
+			dataProvider="{model.logEdit.entry.diagnoses}"
+			initialize="{AccessibilityTools.accessComponentName(selectedDiagnosisGrid,'Selected Diagnoses')}"
+			width="100%"
+			keyDown="removeDiagnosisOnDelete(event)"
+			sortableColumns="false"
+			editable="false"
+			height="{diagnosisMatches.height + txtDiagnosis.height}"
+            tabIndex="1205">
+			<mx:columns>
+	 		<mx:DataGridColumn
+	 			headerText="Diagnosis"
+	 			editable="false"
+	 			showDataTips="true"
+	 			dataField="label"/>			
+	 		<mx:DataGridColumn
+	 			headerText="Primary?"
+	 			width="65"
+	 			dataField="primary"
+	 			textAlign="center"
+	 			itemRenderer="gov.va.med.edp.widget.YesNoRenderer"/>			
+	 			</mx:columns>
+		</mx:DataGrid>
+		<mx:HBox width="100%" horizontalAlign="center" paddingTop="4">
+			<mx:Button id="primaryDiagnosisBtn"
+				label="Set as Primary Diagnosis"
+				click="setPrimaryDiagnosis()"
+				enabled="false" tabIndex="1206"/>
+		</mx:HBox>	
+		
+		
+	</mx:VBox>
+    
+	<mx:Binding source="model.matchingDiagnosesLoaded" destination="selectFirstDiagnosisMatch" />   
+	<mx:Binding source="PCECodedValueVO(selectedDiagnosisGrid.selectedItem)" destination="setPrimaryBtnState" /> 
+	
+</mx:HBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/DiagnosesFreeText.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/DiagnosesFreeText.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/DiagnosesFreeText.mxml	(revision 1227)
@@ -0,0 +1,189 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml">
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.widget.InfoDialog;
+		import mx.collections.ICollectionView;
+		import gov.va.med.edp.vo.PCECodedValueVO;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.control.ChangeLogEntryFieldEvent;
+		import gov.va.med.edp.util.AccessibilityTools;
+        import gov.va.med.edp.util.KeyUtils;
+
+        [Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+        		
+		private function setPrimaryDiagnosis():void {
+
+				var selectedDiagnosis:PCECodedValueVO = selectedDiagnosisGrid.selectedItem as PCECodedValueVO;
+				if (selectedDiagnosis == null) return;
+				
+	        	model.logEdit.entry.diagnoses.filterFunction = null;
+
+				for each (var enteredDiagnosis: PCECodedValueVO in model.logEdit.entry.diagnoses) {
+					enteredDiagnosis.updated = true;
+					if (enteredDiagnosis.label == selectedDiagnosis.label){
+						enteredDiagnosis.primary = true;
+					} else {
+						enteredDiagnosis.primary = false;
+					}
+					var updateEvent:ChangeLogEntryFieldEvent = 
+						new ChangeLogEntryFieldEvent(ChangeLogEntryFieldEvent.EVENT_CHANGE_LOG_ENTRY_FIELD);
+					updateEvent.clear = false;
+					updateEvent.field = "diagnoses";
+					updateEvent.value = enteredDiagnosis;
+					updateEvent.dispatch();  		
+				}		
+		}        				
+        					
+        					
+ 		private function addDiagnosis(): void
+		{
+			if (txtDiagnosis.text.length == 0 || isDuplicateDiagnosis(txtDiagnosis.text)) return;
+
+			var codedValue: PCECodedValueVO = new PCECodedValueVO();
+			codedValue.code = "";
+			codedValue.label = txtDiagnosis.text;
+			txtDiagnosis.text = "";
+
+			if (model.logEdit.entry.diagnoses.length == 0)
+			codedValue.primary = true;	
+			codedValue.added = true;
+			var addEvent:ChangeLogEntryFieldEvent = 
+				new ChangeLogEntryFieldEvent(ChangeLogEntryFieldEvent.EVENT_CHANGE_LOG_ENTRY_FIELD);
+			addEvent.clear = false;
+			addEvent.field = "diagnoses";
+			addEvent.value = codedValue;
+			addEvent.dispatch();
+			
+			if (AccessibilityTools.isAccessibilityActive())InfoDialog.show("added successfully", "Message", true, txtDiagnosis);
+		}
+		
+		private function isDuplicateDiagnosis(diagnosis: String): Boolean
+		{
+			var enteredDiagnoses:ICollectionView = model.logEdit.entry.diagnoses;
+			for each (var enteredDiagnosis: PCECodedValueVO in enteredDiagnoses) {
+				if (diagnosis == enteredDiagnosis.label) return true;
+			}
+			return false;
+		}
+		
+        private function set setPrimaryBtnState(codedValue: PCECodedValueVO): void
+        {        
+        	if (codedValue){
+        		primaryDiagnosisBtn.enabled = true;
+        	} else {
+        		primaryDiagnosisBtn.enabled = false;
+        	}
+        }  
+        		
+		private function removeDiagnosis(): void
+		{
+			if (selectedDiagnosisGrid.selectedIndex < 0) return;
+			
+			model.logEdit.entry.diagnoses.filterFunction = activeDiagnosisFilter;
+			model.logEdit.entry.diagnoses.refresh();			
+			
+			var codedValue: PCECodedValueVO = selectedDiagnosisGrid.selectedItem as PCECodedValueVO;
+			var removeEvent:ChangeLogEntryFieldEvent =
+				new ChangeLogEntryFieldEvent(ChangeLogEntryFieldEvent.EVENT_CHANGE_LOG_ENTRY_FIELD);
+			removeEvent.clear = true;
+			removeEvent.field = "diagnoses";
+			removeEvent.value = codedValue;
+			removeEvent.dispatch();
+			if (AccessibilityTools.isAccessibilityActive())InfoDialog.show("removed successfully", "Message", true, addBtn);			
+		}	
+				
+		public static function activeDiagnosisFilter(item:Object): Boolean
+		{
+            var pceItem: PCECodedValueVO = item as PCECodedValueVO;
+            return !pceItem.remove;
+        }
+        
+		private function removeDiagnosisOnDelete(event:KeyboardEvent):void
+		{
+			if (KeyUtils.isRemoveKey(event)){
+				removeDiagnosis();
+			}
+		}    
+		    
+/* 		
+		Calls to validateData were removed because the diagnosis is NOT required before
+		saving the record.  It is only required when removing the patient from the
+		board and closing the visit.  The call to validateData was previously at the
+		end of addDiagnosis() and in the valueCommit property of selectedDiagnosisGrid.
+		
+		private function validateData():void
+		{
+			if ( model.logEdit.entry != null && model.logEdit.entry.requireDiagnosis){
+				if (selectedDiagnosisGrid.dataProvider.length > 0){
+					selectedDiagnosisGrid.errorString = "";
+				} else {
+					selectedDiagnosisGrid.errorString = "At least one diagnosis must be provided.";
+				}
+			}
+		}		
+ */     
+    				
+	]]>
+	</mx:Script>
+	<mx:VBox width="100%" verticalGap="0">
+		<mx:Label text="Diagnosis" styleName="controlLabel" />
+		<mx:TextInput
+			id="txtDiagnosis"
+			initialize="{AccessibilityTools.accessComponentName(txtDiagnosis,'Diagnosis')}"
+			width="100%"
+			enter="addDiagnosis()"
+            tabIndex="1201"/>
+	</mx:VBox>
+
+	<mx:Canvas>
+		<mx:Button
+			label="Add &gt;"
+			top="18"
+			id="addBtn"
+			horizontalCenter="0"
+			click="addDiagnosis()"
+            tabIndex="1202"/>
+		<mx:Button
+			label="Remove"
+			top="56"
+			horizontalCenter="0"
+			click="removeDiagnosis()"
+			visible="{selectedDiagnosisGrid.selectedIndex > -1}"
+            tabIndex="1203"/>
+	</mx:Canvas>
+	
+	<mx:VBox width="100%" verticalGap="0">
+		<mx:Label text="Selected Diagnoses" styleName="controlLabel" />
+		<mx:DataGrid
+			id="selectedDiagnosisGrid"
+			initialize="{AccessibilityTools.accessComponentName(selectedDiagnosisGrid,'Selected Diagnoses')}"
+			rowCount="5"
+			width="100%"
+			editable="false"
+			sortableColumns="false"
+			keyDown="removeDiagnosisOnDelete(event)"
+			dataProvider="{model.logEdit.entry.diagnoses}"
+            tabIndex="1204">
+			<mx:columns>
+	 		<mx:DataGridColumn
+	 			headerText="Diagnosis"
+	 			showDataTips="true"
+	 			editable="false"
+	 			dataField="label"/>
+	 		<mx:DataGridColumn
+	 			headerText="Primary?"
+	 			width="65"
+	 			dataField="primary"
+	 			textAlign="center"
+	 			itemRenderer="gov.va.med.edp.widget.YesNoRenderer"/>		 			
+			</mx:columns>	
+		</mx:DataGrid>			
+		<mx:HBox width="100%" horizontalAlign="center" paddingTop="4">
+			<mx:Button id="primaryDiagnosisBtn" label="Set as Primary Diagnosis"
+				click="setPrimaryDiagnosis()" enabled="false" tabIndex="1205"/>
+		</mx:HBox>					
+	</mx:VBox>
+	<mx:Binding source="PCECodedValueVO(selectedDiagnosisGrid.selectedItem)" destination="setPrimaryBtnState" /> 
+</mx:HBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/LogEntryEditor.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/LogEntryEditor.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/LogEntryEditor.mxml	(revision 1227)
@@ -0,0 +1,541 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- LogEntryEditor.mxml -->
+
+<mx:VBox
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	xmlns:widget="gov.va.med.edp.widget.*"
+	xmlns:log="gov.va.med.edp.view.log.*"
+	xmlns:accessibility="flash.accessibility.*"
+	currentState="{model.logEntryViewState}" 
+	keyDown="keyHandler(event)" >
+
+	<mx:states>
+		<mx:State name="Message" enterState="initMessageState()" >
+			<mx:RemoveChild target="{patientBar}" />
+			<mx:RemoveChild target="{entryForm}" />
+			<mx:RemoveChild target="{btnArea}" />
+			<mx:AddChild>
+				<mx:Canvas id="msgArea" width="100%" height="100%" >
+					<mx:TextArea
+						id="txtMsg"
+						accessibilityProperties="{accMsg}"
+						text="{model.logEdit.message}"
+						tabIndex="99"
+						restrict="*~_"
+						horizontalCenter="0" verticalCenter="0" textAlign="center"
+						styleName="accessibleControlLabel" />
+				</mx:Canvas>
+			</mx:AddChild>
+		</mx:State>
+		<mx:State name="EditClosed" enterState="initEditState()" >
+			<mx:AddChild relativeTo="{entryForm}" position="after">
+				<log:DiagnosesFreeText width="100%" paddingBottom="18" />
+			</mx:AddChild>
+		</mx:State>
+		<mx:State name="EditClosedCoded" enterState="initEditState()" >
+			<mx:AddChild relativeTo="{entryForm}" position="after">
+				<log:DiagnosesCoded width="100%" paddingBottom="18" />
+			</mx:AddChild>
+		</mx:State>
+		<mx:State name="SignIn" enterState="initEditState()" >
+			<mx:RemoveChild target="{longComplaintItem}" />
+			<mx:RemoveChild target="{acuityItem}" />
+			<mx:RemoveChild target="{clinicItem}" />
+			<mx:RemoveChild target="{statusItem}" />
+			<mx:RemoveChild target="{providerItem}" />
+			<mx:RemoveChild target="{residentItem}" />
+			<mx:RemoveChild target="{nurseItem}" />
+			<mx:RemoveChild target="{commentItem}" />
+			<mx:RemoveChild target="{dispositionItem}" />
+			<mx:RemoveChild target="{delayItem}" />
+			<mx:RemoveChild target="{timeInItem}" />
+			<mx:RemoveChild target="{timeOutItem}" />
+		</mx:State>
+		<mx:State name="Triage" enterState="initEditState()">
+			<mx:RemoveChild target="{commentItem}" />
+			<mx:RemoveChild target="{dispositionItem}" />
+			<mx:RemoveChild target="{delayItem}" />
+			<mx:RemoveChild target="{timeInItem}" />
+			<mx:RemoveChild target="{timeOutItem}" />			
+		</mx:State>
+		<mx:State name="Update" enterState="initEditState()" >
+			<mx:RemoveChild target="{complaintItem}" />
+			<mx:RemoveChild target="{longComplaintItem}" />
+			<mx:RemoveChild target="{acuityItem}" />
+			<mx:RemoveChild target="{clinicItem}" />
+			<mx:RemoveChild target="{arrivalItem}" />
+			<mx:RemoveChild target="{dispositionItem}" />
+			<mx:RemoveChild target="{delayItem}" />
+			<mx:RemoveChild target="{timeInItem}" />
+			<mx:RemoveChild target="{timeOutItem}" />			
+		</mx:State>
+		<mx:State name="UpdateNoRes" basedOn="Update" enterState="initEditState()" >
+			<mx:RemoveChild target="{residentItem}" />
+		</mx:State>
+		<mx:State name="DispDelay" enterState="initEditState()" >
+			<mx:RemoveChild target="{complaintItem}" />
+			<mx:RemoveChild target="{longComplaintItem}" />
+			<mx:RemoveChild target="{acuityItem}" />
+			<mx:RemoveChild target="{clinicItem}" />
+			<mx:RemoveChild target="{arrivalItem}" />
+			<mx:RemoveChild target="{nurseItem}" />
+			<mx:RemoveChild target="{commentItem}" />
+			<mx:RemoveChild target="{timeInItem}" />
+			<mx:RemoveChild target="{timeOutItem}" />
+			<mx:AddChild relativeTo="{entryForm}" position="after" creationPolicy="all">
+				<log:DiagnosesFreeText id="diagnosesFreeText" width="100%" paddingBottom="18" />
+			</mx:AddChild>
+			<mx:AddChild relativeTo="{btnArea}" position="firstChild" >
+				<mx:Button
+					label="Save &amp; Remove from Board"
+					enabled="{model.logEdit.entry.removeReady}"
+					click="removeEntry()" tabIndex="1899"/>
+			</mx:AddChild>
+		</mx:State>
+		<mx:State name="DispDelayCoded" basedOn="DispDelay" enterState="initEditState()" >
+			<mx:RemoveChild target="{diagnosesFreeText}" />
+			<mx:AddChild relativeTo="{entryForm}" position="after" creationPolicy="all">
+				<log:DiagnosesCoded id="diagnosesCoded" width="100%" paddingBottom="18" />
+			</mx:AddChild>
+		</mx:State>
+	</mx:states>
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.util.AccessibilityTools;
+        import gov.va.med.edp.pt.demog.model.MatchingPatientsModel;
+        import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+        import gov.va.med.edp.pt.demog.IPatientChecksController;
+        import gov.va.med.edp.widget.InfoDialog;
+        import mx.controls.TextArea;
+        import gov.va.med.edp.control.RemoveLogEntryEvent;
+        import gov.va.med.edp.vo.LogEntryVO;
+        import mx.validators.Validator;
+
+        import gov.va.med.edp.control.TrackingEvent;
+        import gov.va.med.edp.model.TrackingModelLocator;
+        import gov.va.med.edp.util.ChangeWatcher;
+
+        [Bindable]
+        public var ptChecksController:IPatientChecksController;
+
+        [Bindable]
+        public var patientChecksModel:PatientChecksModel;
+
+        [Bindable]
+        private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        [Bindable]
+        private var _showDelay: Boolean = false;  // shows delay if edit closed or server rejects due to delay missing
+
+        private var _validators: Array;
+        private var _txtMsg: TextArea;
+
+        private function initMessageState(): void
+        {
+            if (AccessibilityTools.isAccessibilityActive()) {
+                callLater(txtMsg.setFocus);
+            } else {
+                txtMsg.editable = false;
+            }
+        }
+
+        private function initEditState(): void
+        {
+            // reCalc Widths
+            var item: FormItem;
+            var minWidth: int = 30;
+            var newWidth: int;
+
+            for (var i: int = 0; i < entryForm.numChildren; i++) {
+                item = entryForm.getChildAt(i) as FormItem;
+                newWidth = item.measureText(item.label + "M").width;
+                if (newWidth > minWidth) {
+                    minWidth = newWidth;
+                }
+            }
+            entryForm.setStyle("labelWidth", minWidth);
+
+            // set up validators
+            switch (model.appViewState) {
+                case TrackingModelLocator.VIEW_APP_SIGN_IN:
+                    _validators = [complaintValid, bedValid];
+                    break;
+                case TrackingModelLocator.VIEW_APP_TRIAGE:
+                    _validators = [complaintValid, bedValid, acuityValid, clinicValid];
+                    break;
+                case TrackingModelLocator.VIEW_APP_EDIT_CLOSED:
+                    _validators = [complaintValid, bedValid, acuityValid, providerValid];
+                    if (model.logEditParams.requireDisposition) {
+                        _validators.push(dispositionValid)
+                    };
+                    if (model.logEditParams.requireDelay) {
+                        _validators.push(delayValid)
+                    };
+                    _showDelay = true;  // always show delay prompt for edit closed
+                    break;
+                default:
+                    _validators = [];
+                    break;
+            }
+            if (model.logEdit.entry != null) {
+            	// must call later to give a chance for the bound controls to get set
+            	this.callLater(validateOnLoad);
+            }
+        }
+		
+        private function saveIfValid(): void
+        {
+            var results: Array = Validator.validateAll(_validators);
+
+            if (results.length == 0) {
+                // save record if validators passed
+                var e: TrackingEvent = new TrackingEvent(TrackingEvent.EVENT_SAVE_LOG_ENTRY);
+                e.dispatch();
+            } else {
+                var msg: String = "The following must be satisfied before saving:\n";
+                for (var i: int = 0; i < results.length; i++) {
+                    msg += results[i].target.source.id + "\n";
+                }
+                InfoDialog.show(msg);
+                if (msg.indexOf("delay") > -1) {
+                    _showDelay = true;
+                }
+            }
+        }
+
+        public function cancelEdit(): void
+        {
+            if (model.logEdit.entry.isStub) {
+                var eDelete: TrackingEvent = new TrackingEvent(TrackingEvent.EVENT_DELETE_STUB_ENTRY);
+                eDelete.dispatch();
+            } else {
+                var eCancel: TrackingEvent = new TrackingEvent(TrackingEvent.EVENT_CANCEL_EDIT);
+                eCancel.dispatch();
+            }
+        }
+
+        private function removeEntry(): void
+        {
+            var removeEvent: RemoveLogEntryEvent =
+                    new RemoveLogEntryEvent(RemoveLogEntryEvent.EVENT_REMOVE_LOG_ENTRY);
+            removeEvent.dispatch();
+        }
+
+        private function set currentEntry(entry: LogEntryVO): void
+        {
+            if (entry == null) return;
+
+            //make sure that outTS is disabled for the patients that are still active.
+            //This could potentially mess up data for the active listed patients on the board
+            //if someone assigned them an outTS while they still haven't been discharged..
+            if (!entry.closed) {
+                outTS.selectedDate = null;
+                outTS.enabled = false;
+                outTS.toolTip = "The patient needs to be discharged first to make this field active."
+            } else {
+                outTS.enabled = true;
+                outTS.toolTip = "";
+            }
+            // init _showDelay to false unless we're in edit closed
+            // (usually the model will say whether we need delay reason
+            _showDelay = (model.appViewState == TrackingModelLocator.VIEW_APP_EDIT_CLOSED);
+
+			if (model.logEditParams.promptClinics && (entry.visit == 0)) {
+				clinicItem.visible = true;
+				clinicItem.includeInLayout = true;
+			} else {
+				clinicItem.visible = false;
+				clinicItem.includeInLayout = false;
+			}
+        }
+
+        private function set patientSelectionComplete(isDone: Boolean): void
+        {
+            if (isDone) {
+                // get JAWS to the first prompt after adding a new patient
+                //this.callLater(complaint.setFocus);
+                this.callLater(complaint.setFocus);
+                //var fi: FormItem = entryForm.getChildAt(0) as FormItem;
+                //trace("first child", fi.tabChildren);
+            }
+        }
+
+        private function validateOnLoad(): void
+        {
+            // must set the errorString to null to get the red border to reset
+            complaint.errorString = "";
+            longComplaint.errorString = "";
+            comment.errorString = "";
+            bed.errorString = "";
+            acuity.errorString = ""
+            provider.errorString = "";
+            disposition.errorString = "";
+            delay.errorString = "";
+            clinic.errorString = "";
+            Validator.validateAll(_validators);
+        }
+
+        private function keyHandler(e:KeyboardEvent): void
+        {
+            if (e.keyCode == Keyboard.ESCAPE) {
+                cancelEdit();
+            }
+        }
+	]]>
+	</mx:Script>
+	
+	<log:PatientHeaderBar id="patientBar" width="100%" ptChecksController="{ptChecksController}"
+                          patientChecksModel="{patientChecksModel}"/>
+
+	<mx:Form id="entryForm" width="100%">
+
+		<mx:FormItem
+			id="complaintItem"
+			label="Complaint for Display Board"
+			width="100%" >
+			<mx:Canvas width="100%">
+				<mx:TextInput
+					id="complaint"
+					text="{model.logEdit.entry.complaint}"
+					change="ChangeWatcher.changeField(event)"
+					left="0" right="0"
+					styleName="formField" tabIndex="1100"/>
+			</mx:Canvas>
+		</mx:FormItem>
+		
+		<mx:FormItem
+			id="longComplaintItem"
+			label="Long Complaint (optional)"
+			width="100%" >
+			<mx:Canvas width="100%" >
+				<mx:TextInput
+					id="longComplaint"
+					text="{model.logEdit.entry.longComplaint}"
+					change="ChangeWatcher.changeField(event)"
+					left="0" right="0"
+					styleName="formField" tabIndex="1101"/>
+			</mx:Canvas>
+		</mx:FormItem>
+		
+		<mx:FormItem
+			id="bedItem" width="100%"
+			label="Room / Area" >
+			<widget:ValueComboBox
+				id="bed"
+				dataProvider="{model.logEdit.beds}"
+				value="{model.logEdit.entry.bed}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="20"
+				styleName="formField" tabIndex="1102"/>
+		</mx:FormItem>
+		
+		<mx:FormItem
+			id="acuityItem" width="100%"
+			label="Acuity" >
+			<widget:ValueComboBox
+				id="acuity"
+				dataProvider="{model.logEdit.acuities}"
+				value="{model.logEdit.entry.acuity}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="{model.logEdit.acuities.length}"
+				styleName="formField" tabIndex="1103"/>
+		</mx:FormItem>
+		
+		<mx:FormItem
+			id="statusItem" width="100%"
+			label="Status" >
+			<widget:ValueComboBox
+				id="status"
+				dataProvider="{model.logEdit.statuses}"
+				value="{model.logEdit.entry.status}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="{model.logEdit.statuses.length}"
+				styleName="formField" tabIndex="1104"/>
+		</mx:FormItem>
+		
+		<mx:FormItem
+			id="providerItem" width="100%"
+			label="Provider" >
+			<widget:ValueComboBox
+				id="provider"
+				dataProvider="{model.logEdit.providers}"
+				value="{model.logEdit.entry.provider}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="12"
+				styleName="formField" tabIndex="1105"/>
+		</mx:FormItem>
+		
+		<mx:FormItem
+			id="residentItem" width="100%"
+			label="Resident" >
+			<widget:ValueComboBox
+				id="resident"
+				dataProvider="{model.logEdit.residents}"
+				value="{model.logEdit.entry.resident}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="12"
+				styleName="formField" tabIndex="1106"/>
+		</mx:FormItem>
+		
+		<mx:FormItem
+			id="nurseItem" width="100%"
+			label="Nurse" >
+			<widget:ValueComboBox
+				id="nurse"
+				dataProvider="{model.logEdit.nurses}"
+				value="{model.logEdit.entry.nurse}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="12"
+				styleName="formField" tabIndex="1107"/>
+		</mx:FormItem>
+	
+		<mx:FormItem
+			id="commentItem"
+			label="Comments"
+			width="100%" >
+			<mx:Canvas width="100%">
+				<mx:TextInput
+					id="comment"
+					text="{model.logEdit.entry.comment}"
+					change="ChangeWatcher.changeField(event)"
+					right="0" left="0"
+					styleName="formField" tabIndex="1108"/>
+			</mx:Canvas>
+		</mx:FormItem>
+			
+		<mx:FormItem
+			id="arrivalItem" width="100%"
+			label="Source" >
+			<widget:ValueComboBox
+				id="arrival"
+				dataProvider="{model.logEdit.arrivals}"
+				value="{model.logEdit.entry.arrival}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="{model.logEdit.arrivals.length}"
+				styleName="formField" tabIndex="1109"/>
+		</mx:FormItem>
+
+		<mx:FormItem
+			id="clinicItem" width="100%"
+			label="Clinic" >
+			<widget:ValueComboBox
+				id="clinic"
+				dataProvider="{model.logEdit.clinics}"
+				value="{model.logEdit.entry.clinic}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="{model.logEdit.clinics.length}"
+				styleName="formField" tabIndex="1110"/>
+		</mx:FormItem>
+				
+		<mx:FormItem
+			id="dispositionItem" width="100%"
+			label="Disposition" >
+			<widget:ValueComboBox
+				id="disposition"
+				dataProvider="{model.logEdit.dispositions}"
+				value="{model.logEdit.entry.disposition}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="{model.logEdit.dispositions.length}"
+				styleName="formField" tabIndex="1111"/>
+		</mx:FormItem>		
+		
+		<mx:FormItem
+			id="delayItem" width="100%"
+			visible="{(_showDelay || model.logEdit.entry.requireDelay)}"
+			label="Delay Reason">
+			<widget:ValueComboBox
+				id="delay"
+				dataProvider="{model.logEdit.delays}"
+				value="{model.logEdit.entry.delay}"
+				change="ChangeWatcher.changeField(event)"
+				rowCount="{model.logEdit.delays.length}"
+				styleName="formField" tabIndex="1112"/>
+		</mx:FormItem>
+		
+		<mx:FormItem
+			id="timeInItem" width="100%"
+			label="Time In">
+			<widget:DateTimeChooser
+			id="inTS"
+			tabEnabled="true" 
+			dateType="Time In"
+			selectedDate="{model.logEdit.entry.inTS}"
+			change="ChangeWatcher.changeField(event)"
+			styleName="formField" tabIndexBase="1113"/>
+		</mx:FormItem>
+		
+		<mx:FormItem
+			id="timeOutItem" width="100%"
+			label="Time Out">
+			<widget:DateTimeChooser 
+			id="outTS"
+			tabEnabled="true" 
+			dateType="Time Out"
+			selectedDate="{model.logEdit.entry.outTS}"
+			change="ChangeWatcher.changeField(event)"
+			styleName="formField" tabIndexBase="1114"/>
+		</mx:FormItem>		
+				
+	</mx:Form>
+	
+	<mx:Canvas id="btnArea" width="100%" >
+		<mx:Button
+			id="cancel"
+			label="Cancel"
+			enabled="{model.logEdit.dirty}"
+			click="cancelEdit()"
+			right="{save.width + 12}" tabIndex="1900"/>
+		<mx:Button
+			id="save"
+			label="Save"
+            enabled="{model.logEdit.dirty}"
+            click="saveIfValid()"
+			right="6" tabIndex="1901"/>
+	</mx:Canvas>
+
+	<mx:StringValidator
+		id="complaintValid"
+		source="{complaint}" property="text"
+		maxLength="50" required="true" />
+	<mx:StringValidator
+		id="longCompValid"
+		source="{longComplaint}" property="text"
+		maxLength="220" required="false" />
+	<mx:StringValidator
+		id="commentValid"
+		source="{comment}" property="text"
+		maxLength="80" required="false" />
+	<mx:NumberValidator
+		id="bedValid"
+		source="{bed}" property="selectedIndex"
+		minValue="1" required="true" lowerThanMinError="A room must be selected." />
+	<mx:NumberValidator
+		id="acuityValid"
+		source="{acuity}" property="selectedIndex"
+		minValue="1" required="true" lowerThanMinError="An acuity must be selected." />
+	<mx:NumberValidator
+		id="providerValid"
+		source="{provider}" property="selectedIndex"
+		minValue="1" required="true" lowerThanMinError="A provider must be selected." />
+	<mx:NumberValidator
+		id="clinicValid"
+		source="{clinic}" property="selectedIndex"
+		minValue="1"
+		required="{(model.logEditParams.promptClinics &amp;&amp; (model.logEdit.entry.visit == 0))}"
+		lowerThanMinError="A clinic must be selected." />
+	<mx:NumberValidator
+		id="dispositionValid" 
+		source="{disposition}" property="selectedIndex"
+		minValue="1" required="{model.logEdit.entry.requireDisposition}" lowerThanMinError="A disposition must be selected." />
+	<mx:NumberValidator
+		id="delayValid"
+		source="{delay}" property="selectedIndex"
+		minValue="1" required="{model.logEdit.entry.requireDelay}" lowerThanMinError="A delay reason must be selected." />
+					
+	<accessibility:AccessibilityProperties id="accMsg" name="Info Status Message" />
+	
+	<!-- bind to this so we know when the entry changes -->
+	<mx:Binding source="model.logEdit.entry" destination="currentEntry" />
+	<mx:Binding source="model.logEdit.patientSelected" destination="patientSelectionComplete" />
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/LogEntrySelector.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/LogEntrySelector.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/LogEntrySelector.mxml	(revision 1227)
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox
+        xmlns:mx="http://www.adobe.com/2006/mxml"
+        xmlns:pt="gov.va.med.edp.pt.demog.view.*"
+        xmlns:log="gov.va.med.edp.view.log.*"
+        width="480" height="100%"
+        creationComplete="initLogArea()" xmlns:widget="gov.va.med.edp.widget.*">
+
+    <mx:Script>
+		<![CDATA[
+		import gov.va.med.edp.pt.demog.view.SelectPatientEvent;
+		import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+        import gov.va.med.edp.pt.demog.IPatientChecksController;
+        import gov.va.med.edp.widget.OkCancelDialog;
+        import mx.managers.IFocusManagerComponent;
+        import mx.controls.dataGridClasses.DataGridColumn;
+        import mx.events.CloseEvent;
+        import mx.events.DataGridEvent;
+        import gov.va.med.edp.model.TrackingModelLocator;
+        import gov.va.med.edp.control.InitLogAreaEvent;
+        import gov.va.med.edp.control.TrackingEvent;
+        import gov.va.med.edp.control.SwitchLogEntryEvent;
+        import gov.va.med.edp.control.SortHeaderEvent;
+        import gov.va.med.edp.control.PatientSelectEvent;
+        import gov.va.med.edp.vo.LogSelectorVO;
+        import gov.va.med.edp.util.AccessibilityTools;
+
+        [Bindable]
+        public var ptChecksController:IPatientChecksController;
+
+        [Bindable]
+        public var patientChecksModel:PatientChecksModel;
+
+        [Bindable]
+        private var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private var refreshTimer: Timer = new Timer(30000);  // every 30 seconds
+
+        public function initLogArea():void
+        {
+            if (model.session.area < 1) return;
+
+            var initEvent:InitLogAreaEvent =
+                    new InitLogAreaEvent(InitLogAreaEvent.EVENT_INIT_LOG_AREA);
+            initEvent.area = model.session.area;  // get the default area
+            initEvent.dispatch();
+
+            refreshTimer.addEventListener(TimerEvent.TIMER, handleRefreshTimer);
+            startRefreshTimer();
+        }
+
+        public function startRefreshTimer(): void
+        {
+            if (!refreshTimer.running) {
+                refreshTimer.start();
+            }
+        }
+
+        public function stopRefreshTimer(): void
+        {
+            refreshTimer.stop();
+        }
+
+		private function handleRefreshTimer(event: TimerEvent): void
+		{
+			refreshLogSelector();
+		}
+		
+        public function refreshLogSelector(): void
+        {
+            if (model.appViewState == TrackingModelLocator.VIEW_APP_EDIT_CLOSED) return;
+            if (model.logEntryList.token == "") return;  // only refresh after initLogArea called
+            if (model.logEdit.dirty) return;			 // only refresh no changes pending
+
+            var refreshEvent: TrackingEvent =
+                    new TrackingEvent(TrackingEvent.EVENT_REFRESH_LOG_SELECTOR);
+            refreshEvent.dispatch();
+        }
+
+        public function confirmSwitch(): void
+        {
+
+            if (model.logEdit.dirty) {
+                OkCancelDialog.show("Are you sure you want to change patients?\n\n" +
+                                    "You have unsaved changes.\nIf you continue, you will lose the changes.\n\n" +
+                                    "Press OK to continue and lose the changes.\n" +
+                                    "Press Cancel to stay and save the changes.", "Discard Changes?", confirmSwitchHandler, activePtsLbl);
+            } else {
+                switchLogEntry();
+            }
+        }
+
+        public function confirmSwitchHandler(event: CloseEvent): void
+        {
+            if (event.detail == OkCancelDialog.OK) {
+                switchLogEntry();
+            } else {
+                model.synchToLastEntry(); // TODO: move this to an event
+            }
+        }
+
+        public function switchLogEntry(): void
+        {
+            if (grdLogEntries.selectedItem == null) return;
+
+            var switchEvent: SwitchLogEntryEvent =
+                    new SwitchLogEntryEvent(SwitchLogEntryEvent.EVENT_SWITCH_LOG_ENTRY);
+            switchEvent.logID = LogSelectorVO(grdLogEntries.selectedItem).id;
+            switchEvent.selectedIndex = grdLogEntries.selectedIndex;
+            switchEvent.dispatch();
+        }
+
+        private function addLogEntry(event: SelectPatientEvent): void
+        {
+            var addEvent: PatientSelectEvent =
+                    new PatientSelectEvent(PatientSelectEvent.EVENT_ADD_PATIENT_TO_LOG);
+            addEvent.newPatient = event.patient;
+            addEvent.dispatch();
+        }
+
+        private function addVisible(appState: int): Boolean
+        {
+            switch (appState) {
+                case TrackingModelLocator.VIEW_APP_SIGN_IN:
+                case TrackingModelLocator.VIEW_APP_TRIAGE:
+                    return true;
+                default:
+                    return false;
+            }
+        }
+
+        // scrollIndex doesn't appear to find the correct entry
+        // if the call is not delayed
+        private function delayScroll(index: int): void
+        {
+            grdLogEntries.scrollToIndex(index);
+        }
+
+        private function scrollIndex(index: int):int
+        {
+            grdLogEntries.selectedIndex = index;
+            if (index < 0) return -1;
+            grdLogEntries.callLater(delayScroll, [index]);
+            return index;
+        }
+
+        // this must be called later by handleHeader for the sortField to be accurate
+        private function saveSortInfo(col:DataGridColumn): void
+        {
+            var sortEvent:SortHeaderEvent =
+                    new SortHeaderEvent(SortHeaderEvent.EVENT_SORT_LOG_SELECTOR);
+            sortEvent.sortDescending = col.sortDescending;
+            sortEvent.sortField = col.dataField;
+            sortEvent.dispatch();
+        }
+
+        private function handleHeader(event:DataGridEvent): void
+        {
+            var column:DataGridColumn = DataGridColumn(event.currentTarget.columns[event.columnIndex]);
+            callLater(saveSortInfo, [column]);
+        }
+
+        private function renderPatientName(logSelector: LogSelectorVO,
+                                           dataField: DataGridColumn): String
+        {
+            var name: String = logSelector.name;
+            if (logSelector.similar) {
+                name = "*  " + name;
+            } else {
+                name = "    " + name;
+            }
+            return name;
+        }
+
+        private function keyHandler(e:KeyboardEvent): void
+        {
+            if (e.keyCode == Keyboard.SPACE) {
+                var c:IFocusManagerComponent = focusManager.getNextFocusManagerComponent();
+                if (c != null) focusManager.setFocus(c);
+            }
+        }
+			            
+		]]>
+	</mx:Script>
+
+
+    <mx:Canvas width="100%" height="{addPatient.height + 12}">
+        <pt:SelectPatientButton
+                id="addPatient"
+                label="Add Patient"
+                top="6"
+                visible="{addVisible(model.appViewState)}"
+                enabled="{!model.logEdit.dirty}"
+                selectPatient="addLogEntry(event)" tabIndex="100"
+                ptSelectController="{ptChecksController}"
+                patientChecksModel="{patientChecksModel}"/>
+        <widget:AccessibleLabel
+        		tabIndex="101"
+                text="Active Patients"
+                accessibleText="Info Active Patients Selector Area"
+                id="activePtsLbl"
+                horizontalCenter="0"
+                verticalCenter="0"
+                styleName="subTitle"/>
+    </mx:Canvas>
+
+    <!-- Modified by jtorreno 2008.01.31 to implement accessibility functionality - Start -->
+    <mx:DataGrid
+            id="grdLogEntries"
+            initialize="{AccessibilityTools.accessComponentName(grdLogEntries,'Active Patients')}"
+            width="100%" height="100%"
+            dataProvider="{model.logEntryList.entries}"
+            selectedIndex="{scrollIndex(model.logEntryList.selectedIndex)}"
+            headerRelease="handleHeader(event)"
+            change="confirmSwitch()"
+            useRollOver="false" tabIndex="102"
+            keyUp="keyHandler(event)">
+        <mx:columns>
+            <mx:DataGridColumn dataField="bed" headerText="Bed" width="50"/>
+            <mx:DataGridColumn dataField="name" headerText="Name" width="210"
+                               itemRenderer="gov.va.med.edp.widget.PatientNameRenderer"/>
+            <mx:DataGridColumn dataField="ssn" headerText="SSN" width="80"/>
+        </mx:columns>
+    </mx:DataGrid>
+    <!-- Modified by jtorreno 2008.01.31 to implement accessibility functionality - End -->
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/LogEntryView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/LogEntryView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/LogEntryView.mxml	(revision 1227)
@@ -0,0 +1,90 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- LogEntryView.mxml -->
+
+<mx:HBox
+        xmlns:mx="http://www.adobe.com/2006/mxml"
+        xmlns:log="gov.va.med.edp.view.log.*"
+        xmlns:widget="gov.va.med.edp.widget.*"
+        width="100%" height="100%"
+        paddingBottom="0" paddingRight="0" paddingLeft="0" paddingTop="0"
+        currentState="{getState(model.appViewState)}"
+        styleName="contentArea">
+
+    <mx:states>
+        <mx:State name="ClosedVisits" enterState="enterClosedVisits()">
+            <mx:RemoveChild target="{logEntrySelector}"/>
+            <mx:AddChild relativeTo="{selectorArea}" position="firstChild">
+                <log:ClosedVisitSelector id="closedVisits" width="100%" height="100%"/>
+            </mx:AddChild>
+        </mx:State>
+    </mx:states>
+
+    <mx:Script>
+		<![CDATA[
+import gov.va.med.edp.pt.demog.model.MatchingPatientsModel;
+        import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+        import gov.va.med.edp.pt.demog.IPatientChecksController;
+        import gov.va.med.edp.model.TrackingModelLocator;
+
+        [Bindable]
+        public var ptChecksController:IPatientChecksController;
+
+        [Bindable]
+        public var patientChecksModel:PatientChecksModel;
+
+        [Bindable]
+        public var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private function enterClosedVisits(): void
+        {
+            closedVisits.patient.text = '';
+            closedVisits.matchPatientName();
+        }
+
+        private function getState(state: int): String
+        {
+            if (model.appViewState == TrackingModelLocator.VIEW_APP_EDIT_CLOSED) {
+                if (logEntrySelector != null) {
+                    logEntrySelector.stopRefreshTimer();
+                }
+                return "ClosedVisits";
+            }
+            if ((model.appViewState == TrackingModelLocator.VIEW_APP_DISPOSITION) ||
+                (model.appViewState == TrackingModelLocator.VIEW_APP_SIGN_IN) ||
+                (model.appViewState == TrackingModelLocator.VIEW_APP_TRIAGE) ||
+                (model.appViewState == TrackingModelLocator.VIEW_APP_UPDATE)) {
+                logEntrySelector.refreshLogSelector();
+                logEntrySelector.startRefreshTimer();
+                return "";
+            }
+            if (logEntrySelector != null) {
+                logEntrySelector.stopRefreshTimer();
+            }
+            return "";
+        }
+		]]>
+	</mx:Script>
+
+    <mx:VBox
+            id="selectorArea"
+            width="376" height="100%"
+            paddingLeft="6" paddingBottom="6"
+            verticalGap="0">
+        <log:LogEntrySelector
+                id="logEntrySelector"
+                width="100%" height="100%"
+                ptChecksController="{ptChecksController}"
+                patientChecksModel="{patientChecksModel}"/>
+    </mx:VBox>
+
+    <mx:VBox
+            id="editorArea"
+            width="100%" height="100%"
+            paddingTop="6" paddingRight="6">
+        <log:LogEntryEditor
+                id="logEntryEditor"
+                width="100%" height="100%" ptChecksController="{ptChecksController}"
+                 patientChecksModel="{patientChecksModel}"/>
+    </mx:VBox>
+
+</mx:HBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/PatientHeaderBar.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/PatientHeaderBar.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/log/PatientHeaderBar.mxml	(revision 1227)
@@ -0,0 +1,142 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!--PatientHeaderBar.mxml -->
+<!--
+ApplicationControlBar has some weird borders that can make it screw up your layouts.
+Meaning, if you have a Canvas with 100% width and height, and have theApplicationControl
+bar in it, your Canvas will get scrollbars . Easiest way to fix is to (like a lot of
+things) wrap it in a Canvas with width and height of a 100%, as well as your vertical
+and horizontalScrollPolicies set to “off”. That’ll make it flush and not cause scrollbars.
+This works for other components as well that give you layout grief.
+-->
+<mx:VBox
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+    xmlns:pt="gov.va.med.edp.pt.demog.view.*"
+	verticalScrollPolicy="off" horizontalScrollPolicy="off">
+	
+<mx:ApplicationControlBar
+	paddingBottom="0"
+	paddingTop="0"
+	dock="true"
+	width="100%"
+	fillColors="[#6688E5,#3F6BEA]"
+	fillAlphas="[0.6,0.6]" >
+	
+	<mx:Script>
+		<![CDATA[
+		import gov.va.med.edp.pt.demog.view.SelectPatientEvent;
+		import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+		import gov.va.med.edp.pt.demog.IPatientChecksController;
+		import gov.va.med.edp.pt.demog.view.PatientRecordFlagsDialog;
+		import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+
+		[Bindable]
+		public var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		[Bindable]
+		public var ptChecksController:IPatientChecksController;
+
+		[Bindable]
+		public var patientChecksModel:PatientChecksModel;
+
+		private function getPatient(name: String): PatientSelectVO
+		{
+			// name is passed in just to force the binding to call this
+			var patient: PatientSelectVO = new PatientSelectVO();
+			patient.dfn = model.logEdit.entry.dfn;
+			patient.name = model.logEdit.entry.name;
+			patient.ssn = model.logEdit.entry.ssn;
+			patient.dob = model.logEdit.entry.dob;
+			return patient;
+		}
+
+		private function changePatient(event: SelectPatientEvent): void
+		{
+			ChangeWatcher.changeField(event);
+		}
+
+		private function patientButtonLeft(pw: int, dw: int, sw: int): int
+		{
+			return (pw > (dw + sw + 12)) ? pw + 32 : dw + sw + 18;
+		}
+
+		private function set handleFlagsButton(value: Boolean): void
+		{
+			flag.visible = value;
+		}
+
+		private function displayFlagsDialog(): void
+		{
+			if (model.logEdit.entry.patientFlags != null &&
+				model.logEdit.entry.patientFlags.length > 0) {
+				PatientRecordFlagsDialog.show(model.logEdit.entry.patientFlags);
+			}
+		}
+						
+			
+		]]>
+	</mx:Script>
+	
+	<mx:Canvas width="100%" >
+		<mx:Label
+			id="ptName"
+			top="0" left="6"
+			text="{model.logEdit.entry.name}"
+			toolTip="{model.logEdit.entry.name}"
+			fontWeight="bold" />
+		<mx:Label
+			id="ssn"
+			top="{ptName.height + 2}" left="6"
+			text="{model.logEdit.entry.ssn}" 
+			toolTip="{model.logEdit.entry.ssn}"/>
+		<mx:Label
+			id="dob"
+			top="{ptName.height + 2}" left="{ssn.width + 12}"
+			text="{model.logEdit.entry.dob}" 
+			toolTip="{model.logEdit.entry.dob}"/>
+		<pt:SelectPatientButton
+			id="editPatient"
+			verticalCenter="0"
+			left="{patientButtonLeft(ptName.width, dob.width, ssn.width)}"
+			visible="{(model.logEdit.entry.dfn == '')}"
+			label="Identify Patient..."
+			patient="{getPatient(model.logEdit.entry.name)}"
+			selectPatient="changePatient(event)" tabIndex="1000"
+            ptSelectController="{ptChecksController}"
+                    patientChecksModel="{patientChecksModel}"/>
+		<mx:Canvas
+			paddingTop="0" paddingBottom="0" paddingLeft="0" paddingRight="0" right="6" >
+			<!-- Modified by jtorreno 2008.02.13 for accessibility functionality - Start -->
+			<mx:Button
+				id="flag"
+				 visible="{model.logEdit.entry.patientFlags.length > 0}"
+				initialize="{AccessibilityTools.accessComponentName(flag,'Flag')}" 
+				icon="@Embed(source='flag.png')"
+				click="{displayFlagsDialog()}"
+				left="0" width="24" verticalCenter="0" tabIndex="1001"/>
+			<!-- Modified by jtorreno 2008.02.13 for accessibility functionality - End -->	
+			<mx:Form id="times" left="{flag.width + 6}" indicatorGap="0"
+				paddingTop="0" paddingBottom="0" paddingLeft="0" paddingRight="0">
+				<mx:FormItem label="in"  toolTip="in" tabIndex="1002" >
+					<mx:Label
+						text="{fmtDt.format(model.logEdit.entry.inTS)}"
+						toolTip="{fmtDt.format(model.logEdit.entry.inTS)}"
+						styleName="formField" />
+				</mx:FormItem>
+				<mx:FormItem label="out" toolTip="out" visible="{model.logEdit.entry.outTS != null}" tabIndex="1003">
+					<mx:Label
+						text="{fmtDt.format(model.logEdit.entry.outTS)}"
+						toolTip="{fmtDt.format(model.logEdit.entry.outTS)}"
+						styleName="formField" />
+				</mx:FormItem>
+			</mx:Form>	
+		</mx:Canvas>
+	</mx:Canvas>
+
+</mx:ApplicationControlBar>	
+	
+<mx:DateFormatter id="fmtDt" formatString="D MMM YY J:NN" />
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ActivityReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ActivityReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ActivityReportView.mxml	(revision 1227)
@@ -0,0 +1,129 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" 
+		width="100%" height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}" xmlns:widget="gov.va.med.edp.widget.*">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.util.Vista;
+		import gov.va.med.edp.vo.reports.ReportLogEntryVO;
+		import mx.utils.ObjectUtil;
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.vo.reports.ReportParamsVO;
+		import gov.va.med.edp.control.reports.ReportEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+				
+        private function doPrint():void {
+
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+			
+			ReportUtil.printDataGrid(printJob,dgActivityReportLogEnteries.columns, dgActivityReportLogEnteries.dataProvider, lblReportTitle.text, 5, 7);
+			ReportUtil.printDataGrid(printJob,dgActivityReportAvegares.columns, dgActivityReportAvegares.dataProvider, lblActivityAverages.text, 7, 5);
+
+            printJob.send();
+        }
+        
+        
+		private function sortElapsedTime(obj1:Object, obj2:Object):int
+		{
+			var elapsed1: String = obj1.elapsed;
+			var elapsed2: String = obj2.elapsed;
+			if (elapsed1.indexOf("*") != -1){
+				var len1:int= elapsed1.length
+				elapsed1 = elapsed1.substring(0, len1-2);
+			}
+			if (elapsed2.indexOf("*") != -1){
+				var len2:int= elapsed2.length;
+				elapsed2 = elapsed2.substring(0, len2-2);
+			}			
+			var elapsed1Num:Number = parseFloat(elapsed1);
+			var elapsed2Num:Number = parseFloat(elapsed2);
+			
+			if (elapsed1Num > elapsed2Num){
+				return -1;
+			} else if (elapsed1Num < elapsed2Num) {
+				return 1;
+			} else return 0;
+		} 
+
+
+	]]>
+	</mx:Script>
+	
+	<mx:HBox width="100%" horizontalGap="0">
+	<mx:Label
+			id="lblReportTitle"
+			text="{ReportUtil.buildReportLabelText('Activity Report')}"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			textAlign="center" />
+	<mx:HBox id="exportButton">
+	<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_ACTIVITY_REPORT);}" tabIndex="1900"/>
+	<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+	</mx:HBox>
+	<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>		
+	
+	<mx:DataGrid id="dgActivityReportLogEnteries" 
+		initialize="{AccessibilityTools.accessComponentName(dgActivityReportLogEnteries,ReportUtil.accessibleReportLabelText('Activity Report'))}"
+		dataProvider="{model.reports.activityReport.activityLogs}" 
+		width="100%" 
+		wordWrap="true"
+		height="50%"
+        tabIndex="1100">
+	    <mx:columns>
+	     	<mx:DataGridColumn dataField="id" headerText="IEN" width="40"/>
+            <mx:DataGridColumn dataField="timeIn" labelFunction="ReportUtil.formatReportDate" headerText="Time In" width="105" sortCompareFunction="ReportUtil.sortTimeInDates"/>
+            <mx:DataGridColumn dataField="timeOut" labelFunction="ReportUtil.formatReportDate" headerText="Time Out" width="105" sortCompareFunction="ReportUtil.sortTimeOutDates"/>
+            <mx:DataGridColumn dataField="complaint" headerText="Complaint"/>
+            <mx:DataGridColumn dataField="provider" headerText="MD" width="130"/>
+            <mx:DataGridColumn dataField="acuity" headerText="Acuity" width="58"/>
+            <mx:DataGridColumn dataField="elapsed" headerText="Elapsed" width="67" sortCompareFunction="sortElapsedTime"/>
+            <mx:DataGridColumn dataField="triage" headerText="Triage" width="55"/>
+            <mx:DataGridColumn dataField="wait" headerText="Wait" width="50"/>
+            <mx:DataGridColumn dataField="disposition" headerText="Dispo" width="67"/>
+            <mx:DataGridColumn dataField="admDec" headerText="Adm Dec" width="70"/>
+            <mx:DataGridColumn dataField="admDel" headerText="Adm Delay" width="75"/>
+            <mx:DataGridColumn dataField="diagnoses" headerText="Diagnosis" width="120"/>
+            <mx:DataGridColumn dataField="icd9" headerText="ICD9" width="67"/>            
+        </mx:columns>
+	</mx:DataGrid>	
+	
+	<mx:Spacer height="3%"/>
+	<mx:Label
+		id="lblActivityAverages"
+		text="{ReportUtil.buildReportLabelText('Averages for Different Categories')}"
+		paddingTop="0"
+		paddingBottom="0"
+		styleName="viewTitle" 
+		textAlign="center"
+		width="100%"/>
+	<mx:DataGrid id="dgActivityReportAvegares" 
+		initialize="{AccessibilityTools.accessComponentName(dgActivityReportAvegares,ReportUtil.accessibleReportLabelText('Averages for Different Categories'))}"
+		dataProvider="{model.reports.activityReport.activityAverages}" 
+		width="100%" 
+		height="30%"
+        tabIndex="1101">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="type" headerText="Category"/>
+            <mx:DataGridColumn dataField="total" headerText="Total"/>
+            <mx:DataGridColumn dataField="wait" headerText="Wait" sortable="false"/>
+            <mx:DataGridColumn dataField="triage" headerText="Triage" sortable="false"/>
+            <mx:DataGridColumn dataField="admDel" headerText="Admission Delay" sortable="false"/>
+            <mx:DataGridColumn dataField="admDec" headerText="Admission Decision" sortable="false"/>
+            <mx:DataGridColumn dataField="elapsed" headerText="Elapsed" sortable="false"/>
+        </mx:columns>
+	</mx:DataGrid>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/AcuityReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/AcuityReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/AcuityReportView.mxml	(revision 1227)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" width="100%" 
+			height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}" xmlns:widget="gov.va.med.edp.widget.*">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+        private function doPrint():void {
+
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+			ReportUtil.printDataGrid(printJob,dgAcuityReportStats.columns, dgAcuityReportStats.dataProvider, lblReportTitle.text);
+            printJob.send();
+        }		
+
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<mx:Label
+			id="lblReportTitle"
+			text="{ReportUtil.buildReportLabelText('Acuity Report')}"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			textAlign="center" />
+	<mx:HBox id="exportButton">
+	<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_ACUITY_REPORT);}" tabIndex="1900"/>
+	<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+	</mx:HBox>
+	<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>	
+			
+	<mx:DataGrid id="dgAcuityReportStats" 
+		dataProvider="{model.reports.acuityReport.acuityStats}" 
+		initialize="{AccessibilityTools.accessComponentName(dgAcuityReportStats,ReportUtil.accessibleReportLabelText('Acuity Report'))}"
+		width="100%" 
+		height="100%"
+        tabIndex="1100">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="type" headerText="Acuity-&gt;" width="160"/>
+            <mx:DataGridColumn dataField="none" headerText="None" sortable="false"/>
+            <mx:DataGridColumn dataField="one" headerText="1" sortable="false"/>
+            <mx:DataGridColumn dataField="two" headerText="2" sortable="false"/>
+            <mx:DataGridColumn dataField="three" headerText="3" sortable="false"/>
+            <mx:DataGridColumn dataField="four" headerText="4" sortable="false"/>
+            <mx:DataGridColumn dataField="five" headerText="5" sortable="false"/>
+            <mx:DataGridColumn dataField="avgTotal" headerText="Total/Average" width="120" sortable="false"/>
+        </mx:columns>
+	</mx:DataGrid>	
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/BVACReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/BVACReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/BVACReportView.mxml	(revision 1227)
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" xmlns:widget="gov.va.med.edp.widget.*"
+		width="100%" height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.util.Vista;
+		import gov.va.med.edp.vo.reports.ReportLogEntryVO;
+		import mx.utils.ObjectUtil;
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.vo.reports.ReportParamsVO;
+		import gov.va.med.edp.control.reports.ReportEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+				
+        private function doPrint():void {
+
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+			
+			ReportUtil.printDataGrid(printJob,dgBVACReportLogEntries.columns, dgBVACReportLogEntries.dataProvider, lblReportTitle.text, 5, 7);
+			ReportUtil.printDataGrid(printJob,dgBVACReportAvegares.columns, dgBVACReportAvegares.dataProvider, lblBVACAverages.text, 7, 5);
+
+            printJob.send();
+        }
+        
+        
+		private function sortElapsedTime(obj1:Object, obj2:Object):int
+		{
+			var elapsed1: String = obj1.elapsed;
+			var elapsed2: String = obj2.elapsed;
+			if (elapsed1.indexOf("*") != -1){
+				var len1:int= elapsed1.length
+				elapsed1 = elapsed1.substring(0, len1-2);
+			}
+			if (elapsed2.indexOf("*") != -1){
+				var len2:int= elapsed2.length;
+				elapsed2 = elapsed2.substring(0, len2-2);
+			}			
+			var elapsed1Num:Number = parseFloat(elapsed1);
+			var elapsed2Num:Number = parseFloat(elapsed2);
+			
+			if (elapsed1Num > elapsed2Num){
+				return -1;
+			} else if (elapsed1Num < elapsed2Num) {
+				return 1;
+			} else return 0;
+		} 
+
+
+	]]>
+	</mx:Script>
+	
+	<mx:HBox width="100%" horizontalGap="0">
+	<mx:Label
+			id="lblReportTitle"
+			text="{ReportUtil.buildReportLabelText('ED BVAC Patients')}"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			textAlign="center" />
+	<mx:HBox id="exportButton">
+	<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_BVAC_REPORT);}" tabIndex="1900"/>			
+	<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+	</mx:HBox>
+	<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>
+	</mx:HBox>		
+	
+	<mx:DataGrid id="dgBVACReportLogEntries" 
+		initialize="{AccessibilityTools.accessComponentName(dgBVACReportLogEntries,ReportUtil.accessibleReportLabelText('ED BVAC Patients'))}"
+		dataProvider="{model.reports.bvacReport.bvacReportLogs}" 
+		width="100%" 
+		height="50%"
+            tabIndex="1100">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="timeIn" labelFunction="ReportUtil.formatReportDate" headerText="Time In" sortCompareFunction="ReportUtil.sortTimeInDates"/>
+            <mx:DataGridColumn dataField="timeOut" labelFunction="ReportUtil.formatReportDate" headerText="Time Out" sortCompareFunction="ReportUtil.sortTimeOutDates"/>
+            <mx:DataGridColumn dataField="complaint" headerText="Complaint"/>
+            <mx:DataGridColumn dataField="provider" headerText="MD"/>
+            <mx:DataGridColumn dataField="acuity" headerText="Acuity"/>
+            <mx:DataGridColumn dataField="elapsed" headerText="Elapsed" sortCompareFunction="sortElapsedTime"/>
+            <mx:DataGridColumn dataField="triage" headerText="Triage" />
+            <mx:DataGridColumn dataField="disposition" headerText="Dispo" />
+            <mx:DataGridColumn dataField="admDec" headerText="Adm Dec" />
+            <mx:DataGridColumn dataField="admDel" headerText="Adm Delay" />
+            <mx:DataGridColumn dataField="diagnoses" headerText="Diagnosis" />    
+            <mx:DataGridColumn dataField="icd9" headerText="ICD9" />
+            <mx:DataGridColumn dataField="vietnamVet" headerText="Viet Vet" />
+            <mx:DataGridColumn dataField="agentOrange" headerText="Agent Orange" />
+            <mx:DataGridColumn dataField="iraq" headerText="OEF/OIF" />
+            <mx:DataGridColumn dataField="persGulf" headerText="Pers Gulf" />
+            <mx:DataGridColumn dataField="vaPension" headerText="VA Pension" />  
+            <mx:DataGridColumn dataField="pow" headerText="POW" />
+            <mx:DataGridColumn dataField="serviceConnPct" headerText="Serv Conn %" />
+            <mx:DataGridColumn dataField="purpleHeart" headerText="Purp Hrt" />
+<!--		this column removed until issues with it are resolved on the VistA side
+			<mx:DataGridColumn dataField="unemployable" headerText="Unemploy" />
+-->
+            <mx:DataGridColumn dataField="combatEndDate" headerText="Combat End" labelFunction="ReportUtil.formatReportDate" />                          
+        </mx:columns>
+	</mx:DataGrid>	
+	
+	<mx:Spacer height="3%"/>
+	<mx:Label
+		id="lblBVACAverages"
+		text="{ReportUtil.buildReportLabelText('Averages for Different Categories')}"
+		paddingTop="0"
+		paddingBottom="0"
+		styleName="viewTitle" 
+		textAlign="center"
+		width="100%"/>
+	<mx:DataGrid id="dgBVACReportAvegares" 
+		initialize="{AccessibilityTools.accessComponentName(dgBVACReportAvegares,ReportUtil.accessibleReportLabelText('Averages for Different Categories'))}"
+		dataProvider="{model.reports.bvacReport.bvacReportAverages}" 
+		width="100%" 
+		height="30%"
+            tabIndex="1101">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="total" headerText="Total"/>
+            <mx:DataGridColumn dataField="triage" headerText="Triage"/>
+            <mx:DataGridColumn dataField="admDel" headerText="Admission Delay"/>
+            <mx:DataGridColumn dataField="admDec" headerText="Admission Decision"/>
+            <mx:DataGridColumn dataField="elapsed" headerText="Elapsed"/>
+        </mx:columns>
+	</mx:DataGrid>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/DelayReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/DelayReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/DelayReportView.mxml	(revision 1227)
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" xmlns:widget="gov.va.med.edp.widget.*" width="100%" 
+		 height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+        
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+			ReportUtil.printDataGrid(printJob,dgDelayReportLogEntries.columns, dgDelayReportLogEntries.dataProvider, lblReportTitle.text, 7, 7);
+            printJob.send();
+        }		
+			
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<mx:Label
+			id="lblReportTitle"
+			text="{ReportUtil.buildReportLabelText('Delay Report')}"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			textAlign="center" />			
+		<mx:HBox id="exportButton">
+		<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_DELAY_REPORT);}" tabIndex="1900"/>
+		<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+		</mx:HBox>
+		<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>		
+	<mx:DataGrid id="dgDelayReportLogEntries" 
+		initialize="{AccessibilityTools.accessComponentName(dgDelayReportLogEntries,ReportUtil.accessibleReportLabelText('Delay Report'))}"
+		dataProvider="{model.reports.delayReport.delayLogs}" 
+		width="100%" 
+		height="100%"
+        tabIndex="1100">
+	    <mx:columns>
+	    	<mx:DataGridColumn dataField="id" headerText="IEN" width="45"/>
+            <mx:DataGridColumn dataField="timeIn" labelFunction="ReportUtil.formatReportDate" sortCompareFunction="ReportUtil.sortTimeInDates" headerText="Time In" width="110"/>
+            <mx:DataGridColumn dataField="elapsed" headerText="Elapsed" width="60"/>
+			<mx:DataGridColumn dataField="disposition" headerText="Disposition" width="70"/>
+            <mx:DataGridColumn dataField="delayReason" headerText="Delay Reason" width="110"/>
+            <mx:DataGridColumn dataField="provider" headerText="MD" width="150"/>
+            <mx:DataGridColumn dataField="admDec" headerText="Adm Dec" width="68"/>
+            <mx:DataGridColumn dataField="admDel" headerText="Adm Delay" width="75"/>
+            <mx:DataGridColumn dataField="acuity" headerText="Acuity" width="48"/>
+            <mx:DataGridColumn dataField="diagnoses" headerText="Diagnoses" width="140"/>                        
+        </mx:columns>
+	</mx:DataGrid>	
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ExposureReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ExposureReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ExposureReportView.mxml	(revision 1227)
@@ -0,0 +1,179 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*"
+	xmlns:widget="gov.va.med.edp.widget.*" width="100%" 
+	height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+				
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+
+			ReportUtil.printDataGrid(printJob,dgContagiousPtInfo.columns, dgContagiousPtInfo.dataProvider, lblContagiousPtInfo.text);
+			ReportUtil.printDataGrid(printJob,dgExposedInTreatmentRoom.columns, dgExposedInTreatmentRoom.dataProvider, lblExposedInTreatmentRoom.text);
+			ReportUtil.printDataGrid(printJob,dgOtherEDPatients.columns, dgOtherEDPatients.dataProvider, lblOtherEDPatients.text);
+			ReportUtil.printDataGrid(printJob,dgOnDutyDocs.columns, dgOnDutyDocs.dataProvider, "On Duty Doctors");
+			ReportUtil.printDataGrid(printJob,dgOnDutyNurses.columns, dgOnDutyNurses.dataProvider, "On Duty Nurses");
+			ReportUtil.printDataGrid(printJob,dgOnDutyResidents.columns, dgOnDutyResidents.dataProvider, "On Duty Residents");
+            printJob.send();            
+        } 				
+
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<mx:Label
+			id="lblReportTitle"
+			text="ED Exposure Report"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			textAlign="center" />
+		<mx:HBox id="exportButton">
+		<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_EXPOSURE_REPORT, model.reports.exposureReport.id);}" tabIndex="1900"/>
+		<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+		</mx:HBox>
+		<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>
+	</mx:HBox>		
+	
+	<mx:Spacer height="3%"/>
+	<mx:Label
+		id="lblContagiousPtInfo"
+		text="Contagious Patient Information"
+		paddingTop="0"
+		paddingBottom="0"
+		styleName="subTitle" 
+		textAlign="center"
+		width="100%"/>	
+	<mx:DataGrid id="dgContagiousPtInfo" 
+		initialize="{AccessibilityTools.accessComponentName(dgContagiousPtInfo,'Contagious Patient Information')}"
+		dataProvider="{model.reports.exposureReport.contagiousPtRoomList}" 
+		rowCount="3"
+		width="100%"
+        tabIndex="1100">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="id" headerText="IEN" width="45"/>
+            <mx:DataGridColumn dataField="roomName" headerText="Room"/>
+            <mx:DataGridColumn dataField="shiftIn" headerText="Shift In" width="70"/>
+            <mx:DataGridColumn dataField="timeIn" labelFunction="ReportUtil.formatReportDate" headerText="Time In" width="105" sortCompareFunction="ReportUtil.sortTimeInDates"/>
+            <mx:DataGridColumn dataField="shiftOut" headerText="Shift Out" width="70"/>
+            <mx:DataGridColumn dataField="timeOut" labelFunction="ReportUtil.formatReportDate" headerText="Time Out" width="105" sortCompareFunction="ReportUtil.sortTimeOutDates"/>
+            <mx:DataGridColumn dataField="dx" headerText="Diagnoses"/>
+            <mx:DataGridColumn dataField="disposition" headerText="Disposition"/>
+            <mx:DataGridColumn dataField="arrival" headerText="Arrival Mode"/>
+            <mx:DataGridColumn dataField="notes" headerText="Notes"/>
+        </mx:columns>
+	</mx:DataGrid>	
+	
+	<mx:Spacer height="3%"/>
+	<mx:Label
+		id="lblExposedInTreatmentRoom"
+		text="Patients Directly Exposed in Different Treatment Rooms"
+		paddingTop="0"
+		paddingBottom="0"
+		styleName="subTitle"
+		textAlign="center"
+		width="100%"/>	
+	<mx:DataGrid id="dgExposedInTreatmentRoom" 
+		initialize="{AccessibilityTools.accessComponentName(dgExposedInTreatmentRoom,'Patients Directly Exposed in Different Treatment Rooms')}"
+		dataProvider="{model.reports.exposureReport.ptsExposedinTreatmentRoomList}" 
+		rowCount="4"	
+		width="100%"
+        tabIndex="1101">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="id" headerText="IEN" width="40"/>
+            <mx:DataGridColumn dataField="roomName" headerText="Room"/>
+            <mx:DataGridColumn dataField="shiftIn" headerText="Shift In" width="70"/>
+            <mx:DataGridColumn dataField="timeIn" labelFunction="ReportUtil.formatReportDate" headerText="Time In" width="105" sortCompareFunction="ReportUtil.sortTimeInDates"/>
+            <mx:DataGridColumn dataField="shiftOut" headerText="Shift Out" width="70"/>
+            <mx:DataGridColumn dataField="timeOut" labelFunction="ReportUtil.formatReportDate" headerText="Time Out" width="105" sortCompareFunction="ReportUtil.sortTimeOutDates"/>
+            <mx:DataGridColumn dataField="dx" headerText="Diagnoses"/>
+            <mx:DataGridColumn dataField="disposition" headerText="Disposition"/>
+            <mx:DataGridColumn dataField="arrival" headerText="Arrival Mode"/>
+            <mx:DataGridColumn dataField="notes" headerText="Notes"/>
+        </mx:columns>
+	</mx:DataGrid>	
+	
+	<mx:Spacer height="3%"/>
+	<mx:Label
+		id="lblOtherEDPatients"
+		text="Other ED Patients"
+		paddingTop="0"
+		paddingBottom="0"
+		styleName="subTitle" 
+		textAlign="center"
+		width="100%"/>	
+	<mx:DataGrid id="dgOtherEDPatients" 
+		initialize="{AccessibilityTools.accessComponentName(dgOtherEDPatients,'Other ED Patients')}"
+		dataProvider="{model.reports.exposureReport.allOtherPatientsList}" 
+		rowCount="4"
+		width="100%"
+        tabIndex="1102">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="id" headerText="IEN" width="40"/>
+            <mx:DataGridColumn dataField="roomName" headerText="Room"/>
+            <mx:DataGridColumn dataField="shiftIn" headerText="Shift In" width="70"/>
+            <mx:DataGridColumn dataField="timeIn" labelFunction="ReportUtil.formatReportDate" headerText="Time In" width="105" sortCompareFunction="ReportUtil.sortTimeInDates"/>
+            <mx:DataGridColumn dataField="shiftOut" headerText="Shift Out" width="70"/>
+            <mx:DataGridColumn dataField="timeOut" labelFunction="ReportUtil.formatReportDate" headerText="Time Out" width="105" sortCompareFunction="ReportUtil.sortTimeOutDates"/>
+            <mx:DataGridColumn dataField="dx" headerText="Diagnoses"/>
+            <mx:DataGridColumn dataField="disposition" headerText="Disposition"/>
+            <mx:DataGridColumn dataField="arrival" headerText="Arrival Mode"/>
+            <mx:DataGridColumn dataField="notes" headerText="Notes"/>
+        </mx:columns>
+	</mx:DataGrid>	
+	
+	
+	<mx:Spacer height="3%"/>
+	<mx:Label
+		id="lblOnDutyStaff"
+		text="On Duty Staff"
+		paddingTop="0"
+		paddingBottom="0"
+		styleName="subTitle" 
+		textAlign="center"
+		width="100%"/>	
+<mx:HBox width="100%">
+	<mx:DataGrid id="dgOnDutyDocs" 
+		initialize="{AccessibilityTools.accessComponentName(dgOnDutyDocs,'On Duty Staff')}"
+		dataProvider="{model.reports.exposureReport.exposedMDsList}" 
+		rowCount="3"
+		width="33%"
+        tabIndex="1103">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="name" headerText="Doctors"/>
+        </mx:columns>
+	</mx:DataGrid>	
+	<mx:DataGrid id="dgOnDutyNurses" 
+		dataProvider="{model.reports.exposureReport.exposedNursesList}" 
+		rowCount="3"
+		width="33%"
+        tabIndex="1104">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="name" headerText="Nurses"/>
+        </mx:columns>
+	</mx:DataGrid>	
+	<mx:DataGrid id="dgOnDutyResidents" 
+		dataProvider="{model.reports.exposureReport.exposedResidentsList}"  
+		rowCount="3"
+		width="34%"
+        tabIndex="1105">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="name" headerText="Residents"/>
+        </mx:columns>
+	</mx:DataGrid>		
+</mx:HBox>			
+			
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/MissedOpReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/MissedOpReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/MissedOpReportView.mxml	(revision 1227)
@@ -0,0 +1,109 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" 
+	     xmlns:reports="gov.va.med.edp.view.reports.*" 
+	     xmlns:widget="gov.va.med.edp.widget.*"
+	     width="100%" height="100%" 
+	     creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();	
+		
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+            
+            printJob.addObject(missedOpSummaryForm);           
+			ReportUtil.printDataGrid(printJob,dgMissedOpReportLogEntries.columns, dgMissedOpReportLogEntries.dataProvider, lblReportTitle.text, 7,5);
+            printJob.send();
+        }		
+		
+
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	   	<widget:AccessibleLabel
+			    id="lblReportTitle"
+			    text="{ReportUtil.buildReportLabelText('Missed Opportunities Report')}"
+		        accessibleText="{ReportUtil.accessibleReportLabelText('Missed Opportunities Report')}" 
+			    paddingTop="0" 
+			    paddingBottom="0"
+			    width="100%"
+			    textAlign="center"
+			    styleName="viewTitle" 
+			    tabIndex="1095"/>
+	  	<mx:HBox id="exportButton">
+		    <widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_MISSED_OP_REPORT);}" tabIndex="1900"/>
+	   	    <mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+		</mx:HBox>
+		<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>		
+	
+	<mx:Form width="100%" id="missedOpSummaryForm" backgroundColor="white">
+	<mx:HBox>
+	    <widget:AccessibleLabel	
+		    text="Summary"
+		    accessibleText="Summary" 
+		    styleName="viewTitle"  
+		    width="225" 
+		    textAlign="right"
+		    tabIndex="1096"/>
+	</mx:HBox>	    
+	
+	<mx:FormItem label="Total Left Without Being Treated/Seen">
+		<widget:AccessibleLabel	
+			text="{model.reports.missedOpReport.leftWithoutTreatment}"
+			accessibleText="{'is ' + model.reports.missedOpReport.leftWithoutTreatment}"
+			tabIndex="1097"/>
+	</mx:FormItem>
+	
+	<mx:FormItem label="Total Left AMA">
+		<widget:AccessibleLabel 
+			text="{model.reports.missedOpReport.AMA}"
+			accessibleText="{'is ' + model.reports.missedOpReport.AMA}"
+			tabIndex="1098"/>
+	</mx:FormItem>
+	
+	<mx:FormItem label="Total Eloped">
+		<widget:AccessibleLabel 
+			text="{model.reports.missedOpReport.eloped}" 
+			accessibleText="{'is ' + model.reports.missedOpReport.eloped}" 
+			tabIndex="1099"/>
+	</mx:FormItem>
+	</mx:Form>	
+				
+	<mx:DataGrid id="dgMissedOpReportLogEntries" 
+		initialize="{AccessibilityTools.accessComponentName(dgMissedOpReportLogEntries,'Missed Opportunities Report')}"
+		dataProvider="{model.reports.missedOpReport.missedOpLogs}" 
+		width="100%" 
+		height="100%"
+        tabIndex="1100">
+	    <mx:columns>
+	       	<mx:DataGridColumn dataField="id" headerText="IEN" width="45"/>
+            <mx:DataGridColumn dataField="timeIn" labelFunction="ReportUtil.formatReportDate" sortCompareFunction="ReportUtil.sortTimeInDates" headerText="Time In" width="120"/>
+            <mx:DataGridColumn dataField="complaint" headerText="Complaint" width="170"/>
+			<mx:DataGridColumn dataField="provider" headerText="MD" width="140"/>
+            <mx:DataGridColumn dataField="acuity" headerText="Acuity" width="70"/>
+            <mx:DataGridColumn dataField="elapsed" headerText="Elapsed" width="75"/>
+            <mx:DataGridColumn dataField="triage" headerText="Triage" width="75"/>
+            <mx:DataGridColumn dataField="wait" headerText="Wait" width="75"/>
+			<mx:DataGridColumn dataField="disposition" headerText="Disposition" width="78"/>
+            <mx:DataGridColumn dataField="admDec" headerText="Adm Dec" width="70"/>
+         </mx:columns>
+	</mx:DataGrid>	
+
+
+
+
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/OrdersByAcuityReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/OrdersByAcuityReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/OrdersByAcuityReportView.mxml	(revision 1227)
@@ -0,0 +1,64 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" 
+		xmlns:widget="gov.va.med.edp.widget.*" width="100%" 
+		height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.controls.dataGridClasses.DataGridColumn;
+		import gov.va.med.edp.vo.reports.ShiftReportColumnVO;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+                       
+			ReportUtil.printDataGrid(printJob,ordersByAcuityReportDataGrid.columns, ordersByAcuityReportDataGrid.dataProvider, lblReportTitle.text);
+            printJob.send();
+        }		
+		
+
+
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<mx:Label
+			id="lblReportTitle"
+			text="{ReportUtil.buildReportLabelText('Orders By Acuity Report')}"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			textAlign="center" />
+	<mx:HBox id="exportButton">
+		<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_ORDERS_BY_ACUITY_REPORT);}" tabIndex="1900"/>
+		<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+		</mx:HBox>
+		<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>		
+	<mx:DataGrid id="ordersByAcuityReportDataGrid" 
+		initialize="{AccessibilityTools.accessComponentName(ordersByAcuityReportDataGrid,ReportUtil.accessibleReportLabelText('Orders By Acuity Report'))}"
+		dataProvider="{model.reports.ordersByAcuityReport.ordersByAcuityLogs}" 
+		width="100%" 
+		height="100%"
+        tabIndex="1100">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="acuity" headerText="Acuity/Display Group-&gt; " width="160"/>
+			<mx:DataGridColumn dataField="meds" headerText="Meds" width="80"/>
+            <mx:DataGridColumn dataField="labs" headerText="Labs" width="80"/>
+            <mx:DataGridColumn dataField="images" headerText="Images" width="80"/>
+            <mx:DataGridColumn dataField="consults" headerText="Consults" width="80"/>
+            <mx:DataGridColumn dataField="others" headerText="Others" width="80"/>                       
+        </mx:columns>
+	</mx:DataGrid>	
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/PatientXRefReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/PatientXRefReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/PatientXRefReportView.mxml	(revision 1227)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" 
+		xmlns:widget="gov.va.med.edp.widget.*" width="100%" 
+		 height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+                       
+			ReportUtil.printDataGrid(printJob,ptXRefDataGrid.columns, ptXRefDataGrid.dataProvider, lblReportTitle.text, 8,5);
+            printJob.send();
+        }		
+		
+
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<mx:Label
+			id="lblReportTitle"
+			text="{ReportUtil.buildReportLabelText('ED IEN to Patient ID Cross Reference Report')}"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			fontWeight="bold" 
+			textAlign="center" />
+	<mx:HBox id="exportButton">
+		<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_PATIENT_XREF_REPORT);}" tabIndex="1900"/>
+		<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+		</mx:HBox>
+		<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>			
+	<mx:DataGrid id="ptXRefDataGrid" 
+		dataProvider="{model.reports.patientXRefReport.patientXRefList}" 
+		initialize="{AccessibilityTools.accessComponentName(ptXRefDataGrid,ReportUtil.accessibleReportLabelText('ED IEN to Patient ID Cross Reference Report'))}"
+		width="100%" 
+		height="100%"
+        tabIndex="1100">
+	    <mx:columns>
+	    	<mx:DataGridColumn dataField="id" headerText="ED ID"/>
+            <mx:DataGridColumn dataField="patientId" headerText="Patient ID"/>
+            <mx:DataGridColumn dataField="patientDfn" headerText="Patient DFN"/>
+        </mx:columns>
+	</mx:DataGrid>	
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ProviderReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ProviderReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ProviderReportView.mxml	(revision 1227)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" 
+	     xmlns:reports="gov.va.med.edp.view.reports.*" 
+	     xmlns:widget="gov.va.med.edp.widget.*"
+	     width="100%" 
+		 height="100%" 
+		 creationComplete="{initState()}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.util.AccessibilityTools;
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		[Bindable]
+		private var currentTabIndex: int = 1100;		
+
+        private function buildSummaryLbl(initilizationText: String):String {
+			var lbltext:String = initilizationText + providerRepeater.currentItem.name;
+			return lbltext;
+
+        }
+        
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+                       
+			printJob.addObject(this);
+            printJob.send();
+        }        
+        
+        private function initState():void {
+        	ReportUtil.setExportButtonState(exportButton);
+			if (model.reports.providerReport.providerList.length == 0){
+				currentState = "noDataFoundState";
+			}
+        }        
+
+        private function getNextTabIndex():int {
+			currentTabIndex = currentTabIndex + 1 + providerRepeater.currentIndex;
+		    return currentTabIndex;
+        } 
+
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<widget:AccessibleLabel
+			id="lblReportTitle"
+			initialize="{AccessibilityTools.accessComponentName(lblReportTitle,ReportUtil.accessibleReportLabelText('Provider Report'))}"			
+			text="{ReportUtil.buildReportLabelText('Provider Report')}"
+			paddingTop="5" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			tabIndex="1099"
+			textAlign="center" />
+		<mx:HBox id="exportButton">
+			<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_PROVIDER_REPORT);}" tabIndex="1900"/>
+			<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+		</mx:HBox>
+		<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>		
+	<mx:Spacer height="2" id="labelSpacer"/>
+	
+	<mx:VBox maxHeight="{this.height - 50}" width="100%">
+	<mx:Repeater id="providerRepeater" dataProvider="{model.reports.providerReport.providerList}">
+	<widget:AccessibleLabel
+		id="lblProviderSummary"
+		text="{buildSummaryLbl('Summary for ')}"
+		accessibleText="{buildSummaryLbl('Summary for ')}"
+		fontWeight="bold"
+		fontSize="12"
+		width="100%"
+		paddingTop="5"
+		tabIndex="{getNextTabIndex()}"
+		paddingBottom="0"
+		textAlign="center" />
+			
+	<!--outline box for borders and shading --> 	
+	<mx:VBox width="100%" borderThickness="1" borderStyle="solid" paddingTop="0" paddingBottom="0" backgroundAlpha="0.05" backgroundColor="black">	
+	<!--summary/averages box -->
+	<mx:HBox width="100%" paddingTop="10" paddingBottom="10">
+		<mx:Label text="Total Num of Patients Handled: " tabIndex="{getNextTabIndex()}"/>
+		<widget:AccessibleLabel text="{providerRepeater.currentItem.total}" accessibleText="{'Total Number of Patients Handled is ' + providerRepeater.currentItem.total}" tabIndex="{getNextTabIndex()}"/>
+		<mx:Spacer width="20%"/>
+		<mx:Label text="Avg Time from Time In to Provider Assigned: " tabIndex="{getNextTabIndex()}"/>
+		<widget:AccessibleLabel text="{providerRepeater.currentItem.avgTimeMDAssigned}" accessibleText="{'Average Time from Time In to Provider Assigned is ' + providerRepeater.currentItem.avgTimeMDAssigned}" tabIndex="{getNextTabIndex()}"/>
+		<mx:Spacer width="20%"/>
+		<mx:Label text="Avg Time from Provider Assigned to Disp: " tabIndex="{getNextTabIndex()}"/>
+		<widget:AccessibleLabel text="{providerRepeater.currentItem.avgTimeToDisposition}" accessibleText="{'Average Time from Provider Assigned to Disposition is ' + providerRepeater.currentItem.avgTimeToDisposition}" tabIndex="{getNextTabIndex()}"/>	
+	</mx:HBox>
+	
+	<widget:AccessibleLabel
+		id="lblProviderDetails"
+		text="{buildSummaryLbl('Shift Breakdown/Details for ')}"
+		accessibleText="{buildSummaryLbl('Shift Breakdown/Details for ')}"
+		paddingTop="0" 
+		paddingBottom="0"
+		width="100%"
+		tabIndex="{getNextTabIndex()}"
+		textAlign="center" />
+	<mx:DataGrid id="providerReportDataGrid" 
+		dataProvider="{providerRepeater.currentItem.shifts}" 
+		width="100%"
+		paddingBottom="0"
+		tabIndex="{getNextTabIndex()}"
+		rowCount="5">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="number" headerText="Shift" width="60"/>
+            <mx:DataGridColumn dataField="acuity" headerText="Acuity" width="60"/>
+            <mx:DataGridColumn dataField="total" headerText="Number of Patients"/>
+            <mx:DataGridColumn dataField="timeInToMDAssigned" headerText="Time In to MD Assigned" sortable="false"/>
+            <mx:DataGridColumn dataField="timeFromMDAssignedToDisposition" headerText="Time from MD Assigned to Disposition" sortable="false" width="240"/>
+        </mx:columns>
+	</mx:DataGrid>	
+	</mx:VBox>
+	<mx:Spacer height="10"/>
+	</mx:Repeater>
+	</mx:VBox>
+    <mx:states>
+        <mx:State name="noDataFoundState">
+            <mx:RemoveChild target="{providerRepeater}"/>
+            <mx:AddChild relativeTo="{labelSpacer}" position="after">
+                <mx:target>
+                	<mx:HBox width="100%" borderThickness="1" borderStyle="solid" backgroundAlpha="0.05" backgroundColor="black">
+                		<widget:AccessibleLabel width="100%" text="No data was found for the selected time range." textAlign="center" styleName="viewTitle" tabIndex="1600"/>	
+                	</mx:HBox>
+                </mx:target>
+            </mx:AddChild>
+        </mx:State>
+    </mx:states>	
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/PtIntakeReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/PtIntakeReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/PtIntakeReportView.mxml	(revision 1227)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" 
+		 xmlns:widget="gov.va.med.edp.widget.*" width="100%" 
+		 height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+                       
+			ReportUtil.printDataGrid(printJob,dgPtIntakeReport.columns, dgPtIntakeReport.dataProvider, lblReportTitle.text, 6,5);
+            printJob.send();
+        }		
+		
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<mx:Label
+			id="lblReportTitle"
+			text="{ReportUtil.buildReportLabelText('Patient Intake Report')}"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			textAlign="center" />
+	<mx:HBox id="exportButton">
+		<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_PATIENT_INTAKE_REPORT);}" tabIndex="1900"/>
+		<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+		</mx:HBox>
+	<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>			
+	<mx:DataGrid id="dgPtIntakeReport" 
+		initialize="{AccessibilityTools.accessComponentName(dgPtIntakeReport,ReportUtil.accessibleReportLabelText('Patient Intake Report'))}"
+		dataProvider="{model.reports.ptIntakeReport.ptIntakeVOList}" 
+		width="100%" 
+		sortableColumns="false"
+		height="100%"
+        tabIndex="1100">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="time" headerText="Time of Day"/>
+            <mx:DataGridColumn dataField="sun" headerText="Sun"/>
+            <mx:DataGridColumn dataField="mon" headerText="Mon"/>
+            <mx:DataGridColumn dataField="tue" headerText="Tue"/>
+            <mx:DataGridColumn dataField="wed" headerText="Wed"/>
+            <mx:DataGridColumn dataField="thu" headerText="Thu"/>
+            <mx:DataGridColumn dataField="fri" headerText="Fri"/>
+            <mx:DataGridColumn dataField="sat" headerText="Sat"/>
+            <mx:DataGridColumn dataField="total" headerText="Total"/>
+			<mx:DataGridColumn dataField="average" headerText="Avg/Day"/>
+        </mx:columns>
+	</mx:DataGrid>	
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ReportControls.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ReportControls.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ReportControls.mxml	(revision 1227)
@@ -0,0 +1,306 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox
+	xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="100%" xmlns:widget="gov.va.med.edp.widget.*" creationComplete="setDataProviderForReports()" verticalScrollPolicy="off" horizontalScrollPolicy="auto">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.widget.InfoDialog;
+		import gov.va.med.edp.util.ReportUtil;
+		import gov.va.med.edp.control.DateTimeEvent;
+		import gov.va.med.edp.vo.reports.ReportParamsVO;
+		import gov.va.med.edp.control.reports.ReportEvent;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+        public var reportsDataProvider: Array = [ {label:"Activity Report", data:ReportEvent.EVENT_ACTIVITY_REPORT}, 
+                					{label:"Acuity Report", data:ReportEvent.EVENT_ACUITY_REPORT},
+                					{label:"Delay Report", data:ReportEvent.EVENT_DELAY_REPORT},
+                					{label:"Delay Summary Rpt", data:ReportEvent.EVENT_SUMMARY_REPORT},
+                					{label:"ED BVAC Patients", data:ReportEvent.EVENT_BVAC_REPORT},
+                					{label:"Exposure Report", data:ReportEvent.EVENT_EXPOSURE_REPORT},
+                					{label:"Missed Opportunities", data:ReportEvent.EVENT_MISSED_OP_REPORT},
+                					{label:"Orders By Acuity", data:ReportEvent.EVENT_ORDERS_BY_ACUITY_REPORT}, 
+                					{label:"Patient Intake Rpt", data:ReportEvent.EVENT_PATIENT_INTAKE_REPORT},		
+                					{label:"Shift Report", data:ReportEvent.EVENT_SHIFT_REPORT},
+                					{label:"VA Admissions Rpt", data:ReportEvent.EVENT_VA_ADMISSIONS_REPORT}];
+	
+		private function setDataProviderForReports(): void
+		{
+		   if (model.session.showProviderReport){
+		   		reportsDataProvider.push({label:"Provider Report", data:ReportEvent.EVENT_PROVIDER_REPORT});
+		   }             					
+		   if (model.session.showPatientCrossReferenceReport){
+		   		reportsDataProvider.push({label:"Patient xRef Report", data:ReportEvent.EVENT_PATIENT_XREF_REPORT});
+		   }  
+		       
+		   reportsDataProvider.sortOn("label", Array.CASEINSENSITIVE);
+		   report.rowCount = reportsDataProvider.length;       					
+		}
+		
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+	
+		private function areDatesCorrect(): Boolean
+		{
+			//Make sure start and end dates are valid..
+			if (startTS._selectedDate == null || endTS._selectedDate == null)
+			{
+				InfoDialog.show("Please enter valid date ranges.", "Invalid Dates", false, startTS.dateInput);
+				clearDisplayArea();
+				return false;
+			}
+			//Make sure start date is less than end date
+			if (startTS._selectedDate > endTS._selectedDate)
+			{
+				InfoDialog.show("Start date cannot be later than stop date.","Invalid Dates", false, startTS.dateInput);
+				clearDisplayArea();
+				return false;
+			}
+			return true;
+		}
+
+		
+		private function setCorrectState(): void
+		{
+			if (report.selectedItem.data == ReportEvent.EVENT_EXPOSURE_REPORT) 
+			{
+				currentState = "exposureRptState";
+			} 
+			else if (report.selectedItem.data == ReportEvent.EVENT_SHIFT_REPORT) 
+			{
+			   currentState = "shiftRptState";
+			}	
+			else
+			{
+				currentState = "";
+			}		
+		}		
+		
+		
+		private function clearDisplayArea(): void
+		{
+			model.reports.clearDisplayArea = false;
+			model.reports.clearDisplayArea = true;
+		}		
+		
+			
+		private function displayReport(buttonClicked: Boolean): void
+		{
+			var reportEvent: ReportEvent;
+			var reportParams: ReportParamsVO = new ReportParamsVO();
+
+			switch (report.selectedItem.data){
+			case ReportEvent.EVENT_ACTIVITY_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_ACTIVITY_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;
+			case ReportEvent.EVENT_ACUITY_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_ACUITY_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_DELAY_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_DELAY_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_EXPOSURE_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_EXPOSURE_REPORT);
+				displayExposureReport(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_MISSED_OP_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_MISSED_OP_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_PATIENT_INTAKE_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_PATIENT_INTAKE_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_PROVIDER_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_PROVIDER_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_SHIFT_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_SHIFT_REPORT);
+				displayShiftReport(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_SUMMARY_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_SUMMARY_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_PATIENT_XREF_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_PATIENT_XREF_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_VA_ADMISSIONS_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_VA_ADMISSIONS_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;						
+			case ReportEvent.EVENT_BVAC_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_BVAC_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;	
+			case ReportEvent.EVENT_ORDERS_BY_ACUITY_REPORT:
+				reportEvent	= new ReportEvent(ReportEvent.EVENT_ORDERS_BY_ACUITY_REPORT);
+				displayAllOtherReports(reportEvent, reportParams, buttonClicked);
+				break;										
+			default:
+				break;				
+			}
+				
+		}
+		
+		private function displayExposureReport(reportEvent:ReportEvent, reportParams:ReportParamsVO, buttonClicked: Boolean): void
+		{
+			setCorrectState();
+			clearDisplayArea();
+			
+			if (buttonClicked)
+			{	
+				if (visitIEN.text == "")
+				{
+					InfoDialog.show("Please enter a visit IEN.", "Invalid IEN", false, visitIEN);
+					return;
+				}
+			
+			} else
+			{
+				if (visitIEN.text == "") 
+				{
+					return;				
+				}
+			}
+			
+			reportParams.id = visitIEN.text;
+			reportEvent.reportParams = reportParams;
+			reportEvent.dispatch();	
+
+		}			
+		
+		
+		private function displayShiftReport(reportEvent:ReportEvent, reportParams:ReportParamsVO, buttonClicked: Boolean): void
+		{
+			setCorrectState();
+			clearDisplayArea();
+			var correctDates: Boolean = true;
+			if (buttonClicked)
+			{	
+				if (startTS._selectedDate == null) 
+				{
+				InfoDialog.show("Please enter a valid start date.", "Invalid Dates", false, startTS.dateInput);
+				correctDates = false;
+				}
+			
+			} else
+			{
+				if (startTS._selectedDate == null)
+				{
+					return;
+				}				
+			}			
+			
+			if (correctDates)
+			{
+			reportParams.startDate = startTS._selectedDate;	
+			reportParams.stopDate = ReportUtil.calculateEndTimeForShiftReport(startTS._selectedDate);
+			reportEvent.reportParams = reportParams;
+			reportEvent.dispatch();
+			}		
+		}		
+		
+		
+		private function displayAllOtherReports(reportEvent:ReportEvent, reportParams:ReportParamsVO, buttonClicked: Boolean): void
+		{
+			setCorrectState();
+			clearDisplayArea();
+			var correctDates: Boolean = true;
+			if (buttonClicked)
+			{	
+				correctDates = areDatesCorrect();
+			
+			} else
+			{
+				if (startTS._selectedDate == null || endTS._selectedDate == null)
+				{
+					return;
+				}				
+			}			
+			
+			if (correctDates)
+			{
+			reportParams.startDate = startTS._selectedDate;	
+			reportParams.stopDate = endTS._selectedDate;
+			reportEvent.reportParams = reportParams;
+			reportEvent.dispatch();
+			}		
+		}			
+		
+		
+	]]>
+	</mx:Script>
+
+	<mx:HBox width="100%" height="100%" id="reportControlsBox">
+		<mx:FormItem label="Report" styleName="reportLabel" >
+		  <mx:ComboBox
+		 	 id="report"
+			 initialize="{AccessibilityTools.accessComponentName(report,'Select type to be displayed.')}"
+			 dataProvider="{reportsDataProvider}"
+			 selectedIndex="0"
+			 change="displayReport(false)"
+			 width="152"
+			 styleName="formField"
+             tabIndex="1001"/>
+	 	 </mx:FormItem> 
+		<mx:VRule height="{report.height}" strokeWidth="3" id="reportComboSpacer" />
+		
+		<mx:HBox id="dateControlsBox">
+		 <mx:FormItem label="Start Date" styleName="reportLabel">
+             <!-- DateTimeChooser eats 4 tabIndices (one for each of its sub controls) -->
+              <widget:DateTimeChooser
+		    	id="startTS"
+		    	tabIndexBase="1002"
+		    	dateType="start"
+		        initialize="{AccessibilityTools.accessComponentName(startTS,'Start time')}" />
+		  </mx:FormItem>       	
+		    <mx:VRule height="{report.height}" strokeWidth="3"/>
+		
+		    <mx:HBox id="stopDateBox">
+		       <mx:FormItem label="Stop Date" styleName="reportLabel">
+                <!-- DateTimeChooser eats 4 tabIndices (one for each of its sub controls) -->
+                <widget:DateTimeChooser
+		        	id="endTS"
+		        	dateType="stop"
+		        	tabIndexBase="1006"
+			        initialize="{AccessibilityTools.accessComponentName(endTS,'Stop time')}"/>
+			    </mx:FormItem>       	
+		        <mx:VRule height="{report.height}" strokeWidth="3"/>
+		    </mx:HBox>
+    	</mx:HBox>	
+	<mx:Button label="Run Report" id="btnRunReport" click="displayReport(true)" tabIndex="1010"/>			
+	</mx:HBox>
+		
+
+	<mx:NumberValidator source="{visitIEN}" property="text"/>
+	
+    <mx:states>
+        <mx:State name="exposureRptState">
+            <mx:RemoveChild target="{dateControlsBox}"/>
+            <mx:AddChild relativeTo="{reportComboSpacer}" position="after">
+                <mx:target>
+            		<mx:HBox id="visitIENBox">
+						<mx:Label text="visit IEN" styleName="reportLabel"/>
+						<mx:TextInput id="visitIEN" tabIndex="1009"/>
+						<mx:VRule height="{report.height}" strokeWidth="3"/>
+					</mx:HBox>
+                </mx:target>
+            </mx:AddChild>
+        </mx:State>
+        <mx:State name="shiftRptState">
+            <mx:RemoveChild target="{stopDateBox}"/>
+        </mx:State>        
+    </mx:states>	
+
+    
+</mx:VBox>
+
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ReportsContainerView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ReportsContainerView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ReportsContainerView.mxml	(revision 1227)
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
+	xmlns:reports="gov.va.med.edp.view.reports.*"
+	show="reportControls.report.setFocus();"
+	paddingTop="6" paddingBottom="6" paddingLeft="6" paddingRight="6"
+	width="100%" height="100%" backgroundColor="white">
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.widget.InfoDialog;
+		import gov.va.med.edp.control.reports.ReportEvent;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+		private function set displayReport(value: String): void
+		{
+			displayReportArea.visible = false;
+			displayReportArea.removeAllChildren();
+			switch (value){
+			case ReportEvent.EVENT_ACTIVITY_REPORT:
+				displayReportArea.addChild(new ActivityReportView());
+				break;
+			case ReportEvent.EVENT_ACUITY_REPORT:
+				displayReportArea.addChild(new AcuityReportView());
+				break;	
+			case ReportEvent.EVENT_DELAY_REPORT:
+				displayReportArea.addChild(new DelayReportView());
+				break;	
+			case ReportEvent.EVENT_EXPOSURE_REPORT:
+				displayReportArea.addChild(new ExposureReportView());
+				break;	
+			case ReportEvent.EVENT_MISSED_OP_REPORT:
+				displayReportArea.addChild(new MissedOpReportView());
+				break;	
+			case ReportEvent.EVENT_PATIENT_INTAKE_REPORT:
+				displayReportArea.addChild(new PtIntakeReportView());
+				break;	
+			case ReportEvent.EVENT_PROVIDER_REPORT:
+				displayReportArea.addChild(new ProviderReportView());
+				break;	
+			case ReportEvent.EVENT_SHIFT_REPORT:
+				displayReportArea.addChild(new ShiftReportView());
+				break;	
+			case ReportEvent.EVENT_SUMMARY_REPORT:
+				displayReportArea.addChild(new SummaryReportView());
+				break;	
+			case ReportEvent.EVENT_PATIENT_XREF_REPORT:
+				displayReportArea.addChild(new PatientXRefReportView());
+				break;	
+			case ReportEvent.EVENT_VA_ADMISSIONS_REPORT:
+				displayReportArea.addChild(new VaAdmissionsReportView());
+				break;	
+			case ReportEvent.EVENT_BVAC_REPORT:
+				displayReportArea.addChild(new BVACReportView());
+				break;	
+			case ReportEvent.EVENT_ORDERS_BY_ACUITY_REPORT:
+				displayReportArea.addChild(new OrdersByAcuityReportView());
+				break;									
+			case ReportEvent.EVENT_NONE:
+				break;								
+			default:
+				InfoDialog.show("No matching view found for the event of type: " + value)
+				break;				
+			}
+			displayReportArea.visible = true;
+		}
+		
+		private function set clearDisplayArea(value: Boolean): void
+		{
+			if (value == true) {
+				displayReportArea.removeAllChildren();
+			}
+		}		
+	]]>
+	</mx:Script>
+
+	<reports:ReportControls id="reportControls" width="100%" height="10%"/>
+		
+	<mx:VBox id="displayReportArea" width="100%" height="90%" showEffect="{wipeIn}" visible="false"/>
+	
+	<mx:Binding source="model.reports.reportType" destination="displayReport" />
+	<mx:Binding source="model.reports.clearDisplayArea" destination="clearDisplayArea" />
+    
+	<mx:WipeRight id="wipeIn" duration="1000"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ShiftReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ShiftReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/ShiftReportView.mxml	(revision 1227)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" width="100%" 
+		xmlns:widget="gov.va.med.edp.widget.*"
+		height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.controls.dataGridClasses.DataGridColumn;
+		import gov.va.med.edp.vo.reports.ShiftReportColumnVO;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+        private function buildGridColumns():void {
+				var newCols:Array = new Array();
+				var newCol: DataGridColumn;
+				//add the category column first
+				newCol = new DataGridColumn('category');
+				newCol.headerText = 'Category';
+				newCol.dataField = 'category';
+				newCol.width = 230;
+				newCols.push(newCol);
+				//add shift columns
+				for each (var colInfo: ShiftReportColumnVO in model.reports.shiftReport.shiftReportColumns) {
+					newCol = new DataGridColumn(colInfo.name);
+					newCol.headerText = colInfo.name;
+					newCol.dataField = colInfo.shiftId;
+					newCols.push(newCol);
+				}
+				shiftReportDataGrid.columns = newCols;			
+        }		
+		
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+                       
+			ReportUtil.printDataGrid(printJob,shiftReportDataGrid.columns, shiftReportDataGrid.dataProvider, lblReportTitle.text);
+            printJob.send();
+        }		
+		
+
+
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<mx:Label
+			id="lblReportTitle"
+			text="{ReportUtil.buildReportLabelText('ED Shift Summary Report')}"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			textAlign="center" />
+	<mx:HBox id="exportButton">
+		<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_SHIFT_REPORT);}" tabIndex="1900"/>
+		<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+		</mx:HBox>
+		<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>		
+	<mx:DataGrid id="shiftReportDataGrid" 
+		initialize="{AccessibilityTools.accessComponentName(shiftReportDataGrid,ReportUtil.accessibleReportLabelText('ED Shift Summary Report'))}"
+		dataProvider="{model.reports.shiftReport.shiftCategories}" 
+		width="100%" 
+		height="100%"
+		creationComplete="buildGridColumns()"
+        tabIndex="1100"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/SummaryReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/SummaryReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/SummaryReportView.mxml	(revision 1227)
@@ -0,0 +1,203 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" 
+	  xmlns:reports="gov.va.med.edp.view.reports.*" 
+	  xmlns:widget="gov.va.med.edp.widget.*"
+	  width="100%" height="100%" 
+	  creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+            printJob.addObject(summaryBox);
+                       
+			ReportUtil.printDataGrid(printJob,dgSummaryReportDelayChart.columns, dgSummaryReportDelayChart.dataProvider, lblReportTitle.text);
+            printJob.send();
+        }
+
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<widget:AccessibleLabel
+		 id="lblReportTitle"
+		 text="{ReportUtil.buildReportLabelText('Delay Summary Report')}"
+		 accessibleText="{ReportUtil.accessibleReportLabelText('Delay Summary Report')}"
+		 paddingTop="0" 
+		 paddingBottom="0"
+		 width="100%"
+		 styleName="viewTitle" 
+		 textAlign="center" 
+		 tabIndex="1070"/>
+		 
+	<mx:HBox id="exportButton">
+		<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_SUMMARY_REPORT);}" tabIndex="1900"/>
+		<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+		</mx:HBox>
+		<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>		
+		
+	<mx:Spacer height="10"/>
+	
+	<mx:HBox width="100%" height="25%" paddingBottom="0" id="summaryBox" backgroundColor="white">	
+	
+	<mx:Form width="35%" >
+	     <mx:HBox>   
+	        <widget:AccessibleLabel
+		        text="All ED Visits"
+		        accessibleText="All ED Visits"
+		        styleName="viewTitle"
+		        width="193" 
+		        textAlign="right"
+		        tabIndex="1071"/>
+	    </mx:HBox>   
+	    <mx:FormItem label="Total Visits" tabIndex="1072">
+	         <widget:AccessibleLabel 
+			     text="{model.reports.summaryReport.summaryVO.totAllEDVisits}" 
+			     accessibleText="{'is ' + model.reports.summaryReport.summaryVO.totAllEDVisits}"
+			     tabIndex="1073" />
+	    </mx:FormItem>
+		<mx:FormItem label="Total Visits Over Six Hours" tabIndex="1074">
+		     <widget:AccessibleLabel
+		         text="{model.reports.summaryReport.summaryVO.totAllVisitOver6Hrs}" 
+		    	 accessibleText="{'is ' + model.reports.summaryReport.summaryVO.totAllVisitOver6Hrs}"
+		    	 tabIndex="1075"/>
+	    </mx:FormItem>	
+	    <mx:FormItem label="Total Visits Over 23 Hours" tabIndex="1076">
+	         <widget:AccessibleLabel
+	     	      text="{model.reports.summaryReport.summaryVO.totAllVisitOver23Hrs}" 
+		 	      accessibleText="{'is ' + model.reports.summaryReport.summaryVO.totAllVisitOver23Hrs}"
+		 	      tabIndex="1077" />
+	    </mx:FormItem>	 
+	    <mx:FormItem label="Average Visit Time" tabIndex="1078">
+	         <widget:AccessibleLabel 
+		         text="{model.reports.summaryReport.summaryVO.avgAllEDVisitTime}" 
+			     accessibleText="{'is ' + model.reports.summaryReport.summaryVO.avgAllEDVisitTime}"
+			     tabIndex="1079"/>
+		</mx:FormItem>   
+	    <mx:FormItem label="Average Admit Decision Time" tabIndex="1080">
+	         <widget:AccessibleLabel
+		         text="{model.reports.summaryReport.summaryVO.avgAllAdmitDecisionTime}" 
+			     accessibleText="{'is ' + model.reports.summaryReport.summaryVO.avgAllAdmitDecisionTime}"
+			     tabIndex="1081"/>
+		</mx:FormItem>   
+	    <mx:FormItem label="Number Admitted to Observation" tabIndex="1082">
+	         <widget:AccessibleLabel
+	 	         text="{model.reports.summaryReport.summaryVO.numAdmittedToObservation}" 
+			     accessibleText="{'is ' + model.reports.summaryReport.summaryVO.numAdmittedToObservation}"
+			     tabIndex="1083"/>
+		</mx:FormItem>         
+    </mx:Form>	
+
+	<mx:Form width="35%">
+	     <mx:HBox>   
+	         <widget:AccessibleLabel
+		         text="VA Admitted"
+		         accessibleText="VA Admitted"
+		         styleName="viewTitle"
+		         width="220" 
+		         textAlign="right"
+		         tabIndex="1084"/>
+		 </mx:HBox> 
+		 <mx:FormItem label="Total Visits" tabIndex="1085">
+		      <widget:AccessibleLabel 
+		          text="{model.reports.summaryReport.summaryVO.totVaAdmittedEDVisits}" 
+			      accessibleText="{'is ' + model.reports.summaryReport.summaryVO.totVaAdmittedEDVisits}"
+			      tabIndex="1086"/>
+		 </mx:FormItem>        
+		 <mx:FormItem label="Total Visits Over Six Hours" tabIndex="1087">
+		      <widget:AccessibleLabel 
+			      text="{model.reports.summaryReport.summaryVO.totVaAdmittedDelayOver6Hrs}" 
+			      accessibleText="{'is ' + model.reports.summaryReport.summaryVO.totVaAdmittedDelayOver6Hrs}"
+			      tabIndex="1088" />
+		 </mx:FormItem>   
+		 <mx:FormItem label="Average Admit Decision Time" tabIndex="1089">
+		       <widget:AccessibleLabel 
+			        text="{model.reports.summaryReport.summaryVO.avgVaAdmittedDecisionTime}" 
+			        accessibleText="{'is ' + model.reports.summaryReport.summaryVO.avgVaAdmittedDecisionTime}"
+			        tabIndex="1090" />
+		 </mx:FormItem>
+		 <mx:FormItem label="Average Delay Time" tabIndex="1091">
+		      <widget:AccessibleLabel 
+			      text="{model.reports.summaryReport.summaryVO.avgVaAdmittedDelayTime}" 
+			      accessibleText="{'is ' + model.reports.summaryReport.summaryVO.avgVaAdmittedDelayTime}"
+			      tabIndex="1092"/>
+		 </mx:FormItem>
+		 <mx:FormItem label="Number of Admit Delays Over Six Hours" tabIndex="1093">
+		      <widget:AccessibleLabel 
+			      text="{model.reports.summaryReport.summaryVO.numVaAdmittedDelayOver6Hrs}" 
+			      accessibleText="{'is ' + model.reports.summaryReport.summaryVO.numVaAdmittedDelayOver6Hrs}"
+			      tabIndex="1094"/>
+		 </mx:FormItem>         
+   </mx:Form>	
+
+	<mx:Form width="30%">
+	    <mx:HBox>   
+	        <widget:AccessibleLabel
+		        text="Not VA Admitted"
+		        accessibleText="Not VA Admitted"
+		        styleName="viewTitle"
+		        width="190" 
+		        tabIndex="1095"/>
+	    </mx:HBox> 
+	    <mx:HBox>   
+	        <mx:Spacer width="58"/>
+	        <mx:FormItem label="Total Visits" tabIndex="1096">
+		        <widget:AccessibleLabel 
+		            text="{model.reports.summaryReport.summaryVO.totNotVaAdmittedVisits}" 
+			        accessibleText="{'is ' + model.reports.summaryReport.summaryVO.totNotVaAdmittedVisits}"
+			        tabIndex="1097"/>
+	       </mx:FormItem>  
+	   </mx:HBox> 
+	   <mx:HBox>  
+	       <mx:Spacer width="13"/>
+	       <mx:FormItem label="Average Visit Time" tabIndex="1098" >
+		       <widget:AccessibleLabel 
+			       text="{model.reports.summaryReport.summaryVO.avgNotVaAdmittedVisitTime}" 
+			       accessibleText="{'is ' + model.reports.summaryReport.summaryVO.avgNotVaAdmittedVisitTime}" 
+			       tabIndex="1099"/>
+	       </mx:FormItem>  
+	   </mx:HBox>   
+	 </mx:Form>	
+	</mx:HBox>
+	
+	<mx:Label
+		id="lblDelayChart"
+		text="{ReportUtil.buildReportLabelText('Delay Chart')}"
+		paddingTop="0" 
+		paddingBottom="0"
+		width="100%"
+		styleName="viewTitle" 
+		textAlign="center" />
+	<mx:DataGrid 
+		id="dgSummaryReportDelayChart" 
+		initialize="{AccessibilityTools.accessComponentName(dgSummaryReportDelayChart,ReportUtil.accessibleReportLabelText('Delay Chart'))}"
+		dataProvider="{model.reports.summaryReport.delayLogs}" 
+		width="100%" 
+		height="100%"
+        tabIndex="1100">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="reason" headerText="Acuity-&gt;" width="190"/>
+            <mx:DataGridColumn dataField="none" headerText="None"/>
+            <mx:DataGridColumn dataField="one" headerText="1"/>
+            <mx:DataGridColumn dataField="two" headerText="2"/>
+            <mx:DataGridColumn dataField="three" headerText="3"/>
+            <mx:DataGridColumn dataField="four" headerText="4"/>
+            <mx:DataGridColumn dataField="five" headerText="5"/>
+            <mx:DataGridColumn dataField="avgTotal" headerText="Total"/>
+        </mx:columns>
+	</mx:DataGrid>	
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/VaAdmissionsReportView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/VaAdmissionsReportView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/VaAdmissionsReportView.mxml	(revision 1227)
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:reports="gov.va.med.edp.view.reports.*" 
+		xmlns:widget="gov.va.med.edp.widget.*" width="100%" 
+		 height="100%" creationComplete="{ReportUtil.setExportButtonState(exportButton)}">
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.control.reports.ReportDownloadEvent;
+		import gov.va.med.edp.util.ReportUtil;
+		import mx.core.Application;
+		import gov.va.med.edp.view.reports.print.ReportDataGridPrintView;
+		import mx.printing.FlexPrintJob;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.ChangeWatcher;
+		import gov.va.med.edp.util.AccessibilityTools;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+        private function doPrint():void {
+            var printJob:FlexPrintJob = new FlexPrintJob();
+            if (printJob.start() != true) return;
+                       
+			ReportUtil.printDataGrid(printJob,dgActivityReportLogEnteries.columns, dgActivityReportLogEnteries.dataProvider, lblReportTitle.text, 7,6);
+            ReportUtil.printDataGrid(printJob,dgActivityReportAvegares.columns, dgActivityReportAvegares.dataProvider, lblActivityAverages.text, 7, 6);
+        	printJob.send();
+        }		
+		
+
+	]]>
+	</mx:Script>
+	<mx:HBox width="100%">
+	<mx:Label
+			id="lblReportTitle"
+			text="{ReportUtil.buildReportLabelText('ED to VA Admission Report')}"
+			paddingTop="0" 
+			paddingBottom="0"
+			width="100%"
+			styleName="viewTitle" 
+			textAlign="center" />
+	<mx:HBox id="exportButton">
+	<widget:LinkButton label="Export" click="{ReportUtil.exportReport(ReportDownloadEvent.EVENT_VA_ADMISSIONS_REPORT);}" tabIndex="1900"/>
+	<mx:Label text="|" paddingLeft="0" paddingRight="0" textAlign="center"/>
+	</mx:HBox>
+	<widget:LinkButton label="Print" click="{doPrint()}" tabIndex="1901"/>		
+	</mx:HBox>			
+	<mx:DataGrid id="dgActivityReportLogEnteries" 
+		initialize="{AccessibilityTools.accessComponentName(dgActivityReportLogEnteries,ReportUtil.accessibleReportLabelText('ED to VA Admission Report'))}"
+		dataProvider="{model.reports.vaAdmissionsReport.admissionLogs}" 
+		width="100%" 
+		height="50%"
+        tabIndex="1100">
+	    <mx:columns>
+	    	<mx:DataGridColumn dataField="id" headerText="IEN" width="45"/>
+            <mx:DataGridColumn dataField="timeOut" labelFunction="ReportUtil.formatReportDate" sortCompareFunction="ReportUtil.sortTimeOutDates" headerText="Time Out" width="113"/>
+            <mx:DataGridColumn dataField="complaint" headerText="Complaint" width="170"/>
+            <mx:DataGridColumn dataField="provider" headerText="MD" width="140"/>
+            <mx:DataGridColumn dataField="acuity" headerText="Acuity" width="55"/>
+            <mx:DataGridColumn dataField="disposition" headerText="Disposition" width="82"/>
+            <mx:DataGridColumn dataField="admDec" headerText="Adm Dec" width="70"/>
+            <mx:DataGridColumn dataField="admDel" headerText="Adm Delay" width="75"/>
+            <mx:DataGridColumn dataField="diagnoses" headerText="Diagnoses" width="140"/>            
+            <mx:DataGridColumn dataField="icd9" headerText="ICD9" width="50"/>
+        </mx:columns>
+	</mx:DataGrid>	
+	
+	<mx:Spacer height="3%"/>
+	<mx:Label
+		id="lblActivityAverages"
+		text="{ReportUtil.buildReportLabelText('Averages for Different Categories')}"
+		paddingTop="0"
+		paddingBottom="0"
+		styleName="viewTitle" 
+		textAlign="center"
+		width="100%"/>
+	<mx:DataGrid id="dgActivityReportAvegares" 
+		initialize="{AccessibilityTools.accessComponentName(dgActivityReportAvegares,ReportUtil.accessibleReportLabelText('Averages for Different Categories'))}"
+		dataProvider="{model.reports.vaAdmissionsReport.admissionAverages}" 
+		width="100%" 
+		height="30%"
+        tabIndex="1101">
+	    <mx:columns>
+            <mx:DataGridColumn dataField="type" headerText="Category"/>
+            <mx:DataGridColumn dataField="total" headerText="Total"/>
+            <mx:DataGridColumn dataField="wait" headerText="Wait"/>
+            <mx:DataGridColumn dataField="triage" headerText="Triage"/>
+            <mx:DataGridColumn dataField="admDel" headerText="Admission Delay"/>
+            <mx:DataGridColumn dataField="admDec" headerText="Admission Decision"/>
+            <mx:DataGridColumn dataField="elapsed" headerText="Elapsed"/>
+        </mx:columns>
+	</mx:DataGrid>
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/print/ReportDataGridPrintView.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/print/ReportDataGridPrintView.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/print/ReportDataGridPrintView.mxml	(revision 1227)
@@ -0,0 +1,61 @@
+<?xml version="1.0"?>
+<!-- Custom control to print the DataGrid control on multiple pages. -->
+
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns="*" backgroundColor="#FFFFFF" 
+	paddingBottom="20" paddingLeft="20" paddingTop="30" paddingRight="20" xmlns:print="gov.va.med.edp.view.reports.print.*">
+
+    <mx:Script>
+        <![CDATA[
+        	import gov.va.med.edp.view.reports.ActivityReportView;
+            import mx.core.*
+            // Declare and initialize the variables used in the component.
+            // The application sets the actual prodTotal value.
+            [Bindable]
+            public var pageNumber:Number = 1;
+            [Bindable]
+            public var lblHeaderText:String = "";
+            [Bindable]
+            public var lblFooterText:String = "";            
+
+            // Control the page contents by selectively hiding the header and
+            // footer based on the page type.
+            public function showPage(pageType:String):void {
+                if(pageType == "first" || pageType == "middle") {
+                    // Hide the footer.
+                    footer.includeInLayout=false;
+                    footer.visible = false;
+                }
+                if(pageType == "middle" || pageType == "last") {
+                    // The header won't be used again; hide it.
+                    header.includeInLayout=false;
+                    header.visible = false;
+                }
+                if(pageType == "last") {
+                    // Show the footer.
+                    footer.includeInLayout=true;
+                    footer.visible = true;
+                }
+                //Update the DataGrid layout to reflect the results.
+                validateNow();
+            }        
+        ]]>
+    </mx:Script>
+
+    <!-- The template for the printed page, with the contents for all pages. -->
+
+    <print:ReportHeader id="header" lblText="{lblHeaderText}" fontWeight="bold"/>
+    <!-- The data grid. The sizeToPage property is true by default, so the last
+        page has only as many grid rows as are needed for the data. -->
+    <mx:PrintDataGrid id="reportDataGrid" width="100%" height="100%">
+    <!-- add columns to this grid programatically.. -->       
+    </mx:PrintDataGrid>
+
+    <!-- Create a FormPrintFooter control and set its prodTotal variable. -->
+    <mx:HBox width="100%">
+    <print:ReportFooter id="footer" lblText="{lblFooterText}" />
+     <!--mx:VBox horizontalAlign="right">
+        <mx:Label text="Page {pageNumber}"/>
+    </mx:VBox-->
+    </mx:HBox>
+
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/print/ReportFooter.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/print/ReportFooter.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/print/ReportFooter.mxml	(revision 1227)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!-- Custom control for the header area of the printed page. -->
+
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" horizontalAlign="center" >
+	
+    <mx:Script>
+        <![CDATA[
+            [Bindable]
+            public var lblText:String = "";
+        ]]>
+    </mx:Script>
+
+    <mx:Label id="lblReportFooter" width="100%" textAlign="center" creationComplete="{lblReportFooter.text = lblText;}"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/print/ReportHeader.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/print/ReportHeader.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/view/reports/print/ReportHeader.mxml	(revision 1227)
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+<!-- Custom control for the header area of the printed page. -->
+
+<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" horizontalAlign="center" >
+	
+    <mx:Script>
+        <![CDATA[
+            [Bindable]
+            public var lblText:String = "";
+        ]]>
+    </mx:Script>
+
+    <mx:Label id="lblReportHeader" width="100%" textAlign="center" creationComplete="{lblReportHeader.text = lblText;}"/>
+</mx:VBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/CodeSelectionVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/CodeSelectionVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/CodeSelectionVO.as	(revision 1227)
@@ -0,0 +1,32 @@
+/* CodeSelectionVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class CodeSelectionVO implements IValueObject
+	{
+		public var id: int = 0;
+		public var name: String = "";
+		public var displayName: String = "";
+		public var abbreviation: String = "";
+		public var flag: String = "";
+		public var inactive: Boolean;
+		public var national: String = "";
+
+		public function toString(): String
+		{
+			// in the string form, the first comma piece is 1 if Code should be used
+			var x: String =
+				"id=" + id + "\t" +
+				"nm=" + name + "\t" +
+				"show=" + displayName + "\t" +
+				"abbr=" + abbreviation + "\t" +
+				"flag=" + flag + "\t" +
+				"inact=" + (inactive ? "1" : "0") + "\t" + 
+				"natl=" + national + "\t";
+			return x;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColorMapVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColorMapVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColorMapVO.as	(revision 1227)
@@ -0,0 +1,18 @@
+/* ColorMapVO.as */
+
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ArrayCollection;
+
+	[Bindable]
+	public class ColorMapVO implements IValueObject
+	{
+		public var id: String;
+		public var name: String;
+		public var type: String;
+		public var used: Boolean = false;
+		public var matches: ArrayCollection;  // array of ColorMatchVO
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColorMatchVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColorMatchVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColorMatchVO.as	(revision 1227)
@@ -0,0 +1,15 @@
+/* ColorMatchVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class ColorMatchVO implements IValueObject
+	{
+		public var attribute: String;
+		public var name: String;
+		public var value: String;
+		public var color: ColorSelectionVO;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColorSelectionVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColorSelectionVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColorSelectionVO.as	(revision 1227)
@@ -0,0 +1,24 @@
+/* ColorSelectionVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class ColorSelectionVO implements IValueObject
+	{
+		public var ignore: Boolean = true;
+		public var text: uint = 0;
+		public var back: uint = 0xffffff;
+				
+		public function toString(): String
+		{
+			// in the string form, the first comma piece is 1 if color should be used
+			var x: String =
+				(ignore ? "0" : "1") + "," +
+				"0x" + text.toString(16) + "," +
+				"0x" + back.toString(16) + ",";
+			return x;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColumnSpecVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColumnSpecVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/ColumnSpecVO.as	(revision 1227)
@@ -0,0 +1,28 @@
+/* ColumnSpecVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class ColumnSpecVO implements IValueObject
+	{
+		public var label: String;
+		public var attribute: String;
+		public var header: String;
+		public var width: int;
+		public var colorMap: ColorMapVO;
+		
+		public function toString():String
+		{
+			var x: String =
+				"label=" + label + "\t" +
+				"attribute=" + attribute + "\t" + 
+				"header=" + header + "\t" + 
+				"width=" + width + "\t" + 
+				"colorMap=" + ((colorMap != null) ? colorMap.id : "");
+			return x;
+		}
+
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/DebugVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/DebugVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/DebugVO.as	(revision 1227)
@@ -0,0 +1,17 @@
+/* DebugVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class DebugVO implements IValueObject
+	{
+		public var url: String;
+		public var parameters: String;
+		public var results:String;
+		public var command:String;
+		public var request:String;
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/DisplayBoardPropertiesVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/DisplayBoardPropertiesVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/DisplayBoardPropertiesVO.as	(revision 1227)
@@ -0,0 +1,16 @@
+/* DisplayBoardPropertiesVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class DisplayBoardPropertiesVO implements IValueObject
+	{
+		public var displaySize: DisplaySizeVO;
+		public var scrollDelay: int;
+		public var fontSize: int;
+		public var squish: Boolean = false;
+		public var squishFontSize: int;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/DisplaySizeVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/DisplaySizeVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/DisplaySizeVO.as	(revision 1227)
@@ -0,0 +1,16 @@
+/* DisplaySizeVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class DisplaySizeVO implements IValueObject
+	{
+		public var label: String;
+		public var width: int;
+		public var height: int;
+		public var data: String;
+
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LogEditParamsVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LogEditParamsVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LogEditParamsVO.as	(revision 1227)
@@ -0,0 +1,41 @@
+/* LogEditParamsVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class LogEditParamsVO implements IValueObject
+	{
+		public var requireDiagnosis: Boolean;
+		public var codedDiagnosis: Boolean;
+		public var requireDisposition: Boolean;
+		public var requireDelay: Boolean;
+		public var delayMinutes: int;
+		public var shiftStart: int;
+		public var shiftDuration: int;
+		public var promptResidents: Boolean;
+		public var promptClinics: Boolean;
+		public var ambulanceArea: int;
+		public var defaultRoom: int;
+		public var emptyValue: int;		// used to hold code for empty value, not editable
+		public var errorIEN: int;		// entered in error
+		public var nurseEvalIEN: int;	// send to nurse eval clinic
+		public var leftIEN: int;		// left without being seen
+		
+		public function toString():String
+		{
+			return "reqDiag=" + (requireDiagnosis ? "1" : "0") + "\t" +
+				"codedDiag=" + (codedDiagnosis ? "1" : "0") + "\t" +
+				"reqDisp=" + (requireDisposition ? "1" : "0") + "\t" +
+				"reqDelay=" + (requireDelay ? "1" : "0") + "\t" +
+				"minDelay=" + delayMinutes + "\t" +
+				"shiftOne=" + shiftStart + "\t" +
+				"shiftLen=" + shiftDuration + "\t" +
+				"residents=" + (promptResidents ? "1" : "0") + "\t" +
+				"clinics=" + (promptClinics ? "1" : "0") + "\t" +
+				"ambulance=" + ambulanceArea + "\t" + 
+				"dfltroom=" + defaultRoom + "\t";
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LogEntryVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LogEntryVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LogEntryVO.as	(revision 1227)
@@ -0,0 +1,173 @@
+/* LogEntryVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import gov.va.med.edp.util.Vista;
+	
+	import mx.collections.ArrayCollection;
+
+	[Bindable]
+	public class LogEntryVO implements IValueObject
+	{
+		public var id: Number;
+		public var site: int;
+		public var area: int;
+		
+		public var dfn: String;
+		public var name: String;
+		public var ssn: String;
+		public var dob: String;
+		public var arrival: int;
+		public var inTS: Date;
+		public var visit: int;
+		public var clinic: int;
+		public var closed: Boolean;
+		public var complaint: String;
+		public var longComplaint: String;
+		public var status: int;
+		public var acuity: int;
+		public var bed: int;
+		public var provider: String;
+		public var resident: String;
+		public var nurse: String;
+		public var comment: String;
+		public var outTS: Date;
+		public var delay: int;
+		public var disposition: int;
+		public var diagnoses: ArrayCollection = new ArrayCollection();
+		public var required: String;
+		public var isStub: Boolean = false;
+		public var removeReady: Boolean = false;
+		public var requireDelay: Boolean = false;
+		public var requireDisposition: Boolean = false;
+		public var requireDiagnosis: Boolean = false;
+		public var updatedDiagnoses: Boolean = false;
+		public var patientFlags: ArrayCollection;
+		public var loadTS: String;  // Fileman time for when record loaded, no need to made Date
+		
+		public function toString():String
+		{
+			var x: String =
+				"id=" + id + "\t" +
+				"site=" + site + "\t" +
+				"area=" + area + "\t" +
+				"dfn=" + dfn + "\t" +
+				"name=" + name + "\t" +
+				"ssn=" + ssn + "\t" +
+				"dob=" + dob + "\t" +
+				"arrival=" + arrival + "\t" +
+				"clinic=" + clinic + "\t" +
+				"inTS=" + Vista.DatetoFM(inTS) + "\t" +
+				"complaint=" + complaint + "\t" +
+				"compLong=" + longComplaint + "\t" +
+				"status=" + status + "\t" +
+				"acuity=" + acuity + "\t" +
+				"bed=" + bed + "\t" +
+				"provider=" + provider + "\t" +
+				"resident=" + resident + "\t" +
+				"nurse=" + nurse + "\t" +
+				"comment=" + comment + "\t" +
+				"outTS=" + Vista.DatetoFM(outTS) + "\t" +
+				"delay=" + delay + "\t" +
+				"disposition=" + disposition + "\t" +
+				"required=" + required + "\t" +
+				"updDiag=" + (updatedDiagnoses ? "1" : "0") + "\t" +
+				"loadTS=" + loadTS + "\t";
+				
+				var seq: int = 0;
+				for each (var codedValue: PCECodedValueVO in diagnoses.source) {
+					seq++;
+					x = x + "diagnosis-" + seq + "=" +
+						codedValue.type + "^" +
+						codedValue.ien.toString() + "^" +
+						codedValue.code + "^" +
+						codedValue.label + "^" +
+						(codedValue.added ? "1" : "") + "^" +
+						(codedValue.remove ? "1" : "") + "^" +
+						(codedValue.updated ? "1" : "") + "^" +
+						(codedValue.primary ? "1" : "") + "^" +
+						codedValue.quantity + "\t";
+				}
+				return x;
+		}
+		
+		public function copyTo(dest: LogEntryVO): void
+		{
+			dest.id = this.id;
+			dest.site = this.site;
+			dest.area = this.area;
+			dest.dfn = this.dfn;
+			dest.name = this.name;
+			dest.ssn = this.ssn;
+			dest.dob = this.dob;
+			dest.arrival = this.arrival;
+			dest.inTS = this.inTS;
+			dest.visit = this.visit;
+			dest.clinic = this.clinic;
+			dest.closed = this.closed;			
+			dest.complaint = this.complaint;
+			dest.longComplaint = this.longComplaint;
+			dest.status = this.status;
+			dest.acuity = this.acuity;
+			dest.bed = this.bed;
+			dest.provider = this.provider;
+			dest.resident = this.resident;
+			dest.nurse = this.nurse;
+			dest.comment = this.comment;
+			dest.outTS = this.outTS;
+			dest.delay = this.delay;
+			dest.disposition = this.disposition;			
+			dest.diagnoses = this.diagnoses;
+			dest.required = this.required;
+			dest.isStub = this.isStub;
+			dest.removeReady = this.removeReady;
+			dest.requireDelay = this.requireDelay;
+			dest.requireDiagnosis = this.requireDiagnosis;
+			dest.updatedDiagnoses = this.updatedDiagnoses;
+			dest.requireDisposition = this.requireDisposition;
+			dest.patientFlags = this.patientFlags;
+			dest.loadTS = this.loadTS;
+		}
+		
+		public function clear(): void
+		{
+			id = 0;
+			site = 0;
+			area = 0;
+			
+			dfn = "";
+			name = "";
+			ssn = "";
+			dob = "";
+			arrival = 0;
+			inTS = new Date;
+			visit = 0;
+			clinic = 0;
+			closed = false;
+			complaint = "";
+			longComplaint = "";
+			status = 0;
+			acuity = 0;
+			bed = 0;
+			provider = "";
+			resident = "";
+			nurse = "";
+			comment = "";
+			outTS = new Date;
+			delay = 0;
+			disposition = 0;
+			diagnoses = new ArrayCollection();
+			required = "";
+			isStub = false;
+			removeReady = false;
+			requireDelay = false;
+			requireDiagnosis = false;
+			updatedDiagnoses = false;
+			requireDisposition = false;
+			patientFlags = null;
+			loadTS = "";
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LogSelectorVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LogSelectorVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LogSelectorVO.as	(revision 1227)
@@ -0,0 +1,17 @@
+/* LogSelectorVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class LogSelectorVO implements IValueObject
+	{
+		public var id: Number;
+		public var name: String;
+		public var ssn: String;
+		public var last4: String;
+		public var bed: String;
+		public var similar: Boolean;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LookupStringVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LookupStringVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LookupStringVO.as	(revision 1227)
@@ -0,0 +1,15 @@
+/* LookupStringVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class LookupStringVO implements IValueObject
+	{
+		public var data: String;
+		public var label: String;
+		public var reference: String;
+		public var transient: Boolean = false;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LookupVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LookupVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/LookupVO.as	(revision 1227)
@@ -0,0 +1,14 @@
+/* LookupVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class LookupVO implements IValueObject
+	{
+		public var data: Number;
+		public var label: String;
+		public var abbr: String;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/NoteVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/NoteVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/NoteVO.as	(revision 1227)
@@ -0,0 +1,19 @@
+/* NoteVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ICollectionView;
+
+	[Bindable]
+	public class NoteVO implements IValueObject
+	{
+		public var text: String;
+		public var action: String;
+		public var author: String;
+		public var id: String;
+		public var noteDate: Date;
+
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/PCECodedValueVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/PCECodedValueVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/PCECodedValueVO.as	(revision 1227)
@@ -0,0 +1,20 @@
+/* PCECodedValueVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class PCECodedValueVO implements IValueObject
+	{
+		public var type: String;
+		public var ien: int;
+		public var code: String;
+		public var label: String;
+		public var added: Boolean = false;
+		public var updated: Boolean = false;
+		public var remove: Boolean = false;
+		public var primary: Boolean;
+		public var quantity: int;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/RoomBedVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/RoomBedVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/RoomBedVO.as	(revision 1227)
@@ -0,0 +1,46 @@
+/* RoomBedVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class RoomBedVO implements IValueObject
+	{
+		public var id: int;
+		public var area: int;
+
+		public var name: String = "";
+		public var inactive: Boolean;
+		public var sequence: int;
+		public var displayName: String = "";
+		public var displayWhen: int;
+		public var defaultStatus: int;
+		public var category: int;
+		public var sharedName: String = "";
+		public var boardName: String = "";
+		public var color: ColorSelectionVO = new ColorSelectionVO();
+
+		public var changed: Boolean = false;
+
+		public function toString():String
+		{
+			var x: String =
+				"id=" + id + "\t" +
+				"area=" + area + "\t" +
+				"name=" + name + "\t" +
+				"inactive=" + (inactive ? "1" : "0") + "\t" +
+				"seq=" + sequence + "\t" +
+				"display=" + displayName + "\t" +
+				"when=" + displayWhen + "\t" +
+				"status=" + defaultStatus + "\t" +
+				"category=" + category + "\t" +
+				"shared=" + sharedName + "\t" +
+				"board=" + boardName + "\t" +
+				"color=" + color.toString() + "\t" +
+				"changed=" + (changed ? "1" : "0");
+			return x;
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/SessionVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/SessionVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/SessionVO.as	(revision 1227)
@@ -0,0 +1,29 @@
+/* SessionVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class SessionVO implements IValueObject
+	{
+		public var duz: String;
+		public var userName: String;
+		public var site: String;	        // this is the Station Number!!
+		public var siteName: String;
+		public var area: int;
+		public var areaName: String;
+		public var siteTimeFM: String;
+		public var siteTime: Date;
+		public var baseTime: Date;
+		public var timeOut: int = 300000;   // milliseconds == 5 minutes
+		public var countDown: int = 10000;  // milliseconds == 10 secs
+
+		public var canExport: Boolean = false;
+		public var showProviderReport: Boolean = false;
+		public var showPatientCrossReferenceReport: Boolean = false;
+		public var debugEnabled: Boolean = false;
+
+        public var serverPackageVersion: String;
+    }
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/StaffMemberVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/StaffMemberVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/StaffMemberVO.as	(revision 1227)
@@ -0,0 +1,36 @@
+/* StaffMemberVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class StaffMemberVO implements IValueObject
+	{
+		public var duz: String;
+		public var inactive: Boolean = false;
+		public var name: String;
+		public var initials: String;
+		public var role: String;
+		public var color: ColorSelectionVO;
+		public var colorChanged: Boolean = false;
+		public var changed: Boolean = false;
+		public var displayName:String;
+
+		public function toString(): String
+		{
+			// in the string form, the first comma piece is 1 if Code should be used
+			
+			var isChanged: Boolean = (changed || colorChanged);
+			var x: String =
+				"duz=" + duz + "\t" +
+				"inact=" + (inactive ? "1" : "0") + "\t" +
+				"nm=" + name + "\t" +
+				"itl=" + initials + "\t" +
+				"role=" + role + "\t" +
+				"clr=" + color.toString() + "\t" +
+				"chg=" + (isChanged ? "1" : "0") + "\t";
+			return x;
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/VisitVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/VisitVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/VisitVO.as	(revision 1227)
@@ -0,0 +1,14 @@
+/* VisitVO.as */
+	
+package gov.va.med.edp.vo
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+
+	[Bindable]
+	public class VisitVO implements IValueObject
+	{
+		public var id: int;
+		public var name: String;
+		public var inTS: Date;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/AcuityVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/AcuityVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/AcuityVO.as	(revision 1227)
@@ -0,0 +1,20 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class AcuityVO implements IValueObject
+	{
+		public var none: String;
+		public var one: String;
+		public var two: String;
+		public var three: String;
+		public var four: String;
+		public var five: String;	
+		public var type: String;	
+		public var avgTotal: String;
+		public var reason: String;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/AveragesVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/AveragesVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/AveragesVO.as	(revision 1227)
@@ -0,0 +1,16 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	[Bindable]
+	public class AveragesVO implements IValueObject
+	{
+		public var admDec: String;
+		public var admDel: String;
+		public var elapsed: String;
+		public var type: String;
+		public var total: int;
+		public var triage: String;
+		public var wait: String;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/BVACLogEntryVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/BVACLogEntryVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/BVACLogEntryVO.as	(revision 1227)
@@ -0,0 +1,21 @@
+package gov.va.med.edp.vo.reports
+{
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class BVACLogEntryVO extends ReportLogEntryVO
+	{
+		public var agentOrange: String;
+		//referred to as OEF/OIF in the UI..
+		public var iraq: String;
+		public var patientName: String;
+		public var persGulf: String;
+		public var pow: String;
+		public var purpleHeart: String;
+		public var serviceConnPct: String;
+		public var unemployable: String;	
+		public var vaPension: String;
+		public var vietnamVet: String;	
+		public var combatEndDate: Date;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/EdStaffVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/EdStaffVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/EdStaffVO.as	(revision 1227)
@@ -0,0 +1,12 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class EdStaffVO implements IValueObject
+	{
+		public var name: String;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/OrdersByAcuityVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/OrdersByAcuityVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/OrdersByAcuityVO.as	(revision 1227)
@@ -0,0 +1,15 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	[Bindable]
+	public class OrdersByAcuityVO implements IValueObject
+	{
+		public var acuity: String;
+		public var consults: String;
+		public var images: String;
+		public var labs: String;
+		public var meds: String;
+		public var others: String;	
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/PatientExposureVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/PatientExposureVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/PatientExposureVO.as	(revision 1227)
@@ -0,0 +1,21 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class PatientExposureVO implements IValueObject
+	{
+		public var id: String;
+		public var roomName: String;
+		public var shiftIn: String;
+		public var timeIn: Date;
+		public var shiftOut: String;
+		public var timeOut: Date;
+		public var dx: String;
+		public var disposition: String;
+		public var arrival: String;
+		public var notes: String;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/PatientXRefVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/PatientXRefVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/PatientXRefVO.as	(revision 1227)
@@ -0,0 +1,14 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class PatientXRefVO implements IValueObject
+	{
+		public var id: String;
+		public var patientDfn: String;
+		public var patientId: String;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ProviderShiftVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ProviderShiftVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ProviderShiftVO.as	(revision 1227)
@@ -0,0 +1,16 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class ProviderShiftVO implements IValueObject
+	{
+		public var number: String;
+		public var acuity: int;
+		public var timeInToMDAssigned: String;
+		public var timeFromMDAssignedToDisposition: String;
+		public var total: int;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ProviderVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ProviderVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ProviderVO.as	(revision 1227)
@@ -0,0 +1,15 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ICollectionView;
+	
+	[Bindable]
+	public class ProviderVO extends EdStaffVO implements IValueObject
+	{
+		public var total: int;
+		public var avgTimeMDAssigned: String;
+		public var avgTimeToDisposition: String;
+		public var shifts: ICollectionView;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/PtIntakeVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/PtIntakeVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/PtIntakeVO.as	(revision 1227)
@@ -0,0 +1,21 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class PtIntakeVO implements IValueObject
+	{
+		public var sun: String;
+		public var mon: String;
+		public var tue: String;
+		public var wed: String;
+		public var thu: String;
+		public var fri: String;	
+		public var sat: String;	
+		public var total: String;
+		public var time: String;
+		public var average: String;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ReportLogEntryVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ReportLogEntryVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ReportLogEntryVO.as	(revision 1227)
@@ -0,0 +1,31 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class ReportLogEntryVO implements IValueObject
+	{
+		public var id: int;
+		public var acuity: int;
+		public var admDec: int;
+		public var admDel: int;
+
+		public var complaint: String;
+		public var disposition: String;
+		public var diagnoses: ArrayCollection = new ArrayCollection();
+		public var elapsed: String;
+		public var timeIn: Date;
+		public var timeOut: Date;
+		public var provider: String;
+		public var triage: int;
+		public var wait: int;
+		public var arrival: String;
+		public var icd9: String;
+		
+		public var delayReason: String;
+		
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ReportParamsVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ReportParamsVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ReportParamsVO.as	(revision 1227)
@@ -0,0 +1,27 @@
+/* ReportParamsVO.as */
+	
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import gov.va.med.edp.util.Vista;
+
+	[Bindable]
+	public class ReportParamsVO implements IValueObject
+	{
+		public var reportName: String;
+		public var id: String;
+		public var startDate: Date;
+		public var stopDate: Date;
+		
+		public function toString():String
+		{
+				var x: String = "reportName=" + reportName + "\t" +
+				"id=" + id + "\t" +
+				"startDate=" + Vista.DatetoFM(startDate) + "\t" +
+				"stopDate=" + Vista.DatetoFM(stopDate);
+				return x;
+		}	
+	
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ShiftCategoryVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ShiftCategoryVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ShiftCategoryVO.as	(revision 1227)
@@ -0,0 +1,16 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class ShiftCategoryVO implements IValueObject
+	{
+		public var category: String;
+		public var one: String;
+		public var two: String;
+		public var three: String;
+		public var four: String;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ShiftReportColumnVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ShiftReportColumnVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/ShiftReportColumnVO.as	(revision 1227)
@@ -0,0 +1,13 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class ShiftReportColumnVO implements IValueObject
+	{
+		public var name: String;
+		public var shiftId: String;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/SummaryReportVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/SummaryReportVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/vo/reports/SummaryReportVO.as	(revision 1227)
@@ -0,0 +1,26 @@
+package gov.va.med.edp.vo.reports
+{
+	import com.adobe.cairngorm.vo.IValueObject;
+	
+	import mx.collections.ArrayCollection;
+	
+	[Bindable]
+	public class SummaryReportVO implements IValueObject
+	{
+		public var totAllEDVisits: int;
+		public var avgAllEDVisitTime: String;
+		public var avgAllAdmitDecisionTime: String;
+		public var totAllVisitOver6Hrs: int;
+		public var totAllVisitOver23Hrs: int;
+		public var numAdmittedToObservation: int;
+		
+		public var totNotVaAdmittedVisits: int;
+		public var avgNotVaAdmittedVisitTime: String;
+	
+		public var totVaAdmittedEDVisits: int;
+		public var totVaAdmittedDelayOver6Hrs: int;
+		public var avgVaAdmittedDelayTime: String;
+		public var avgVaAdmittedDecisionTime: String;
+		public var numVaAdmittedDelayOver6Hrs: int;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/AccessibleLabel.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/AccessibleLabel.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/AccessibleLabel.as	(revision 1227)
@@ -0,0 +1,108 @@
+package gov.va.med.edp.widget
+{
+	import flash.events.Event;
+	import flash.events.FocusEvent;
+	
+	import gov.va.med.edp.util.AccessibilityTools;
+	import gov.va.med.edp.widget.accessibility.AccessibleLabelAccImpl;
+	import gov.va.med.edp.widget.accessibility.IAccessibleComponent;
+	
+	import mx.controls.Label;
+	import mx.managers.IFocusManagerComponent;
+       
+    /** 
+     * This class extends the mx Label class  in order to make them focusable.
+     * For a user with a screen reader, if the image is critical to the application
+     * you will need to have some way to communicate a summary of the image's information
+     * to a screen reader.
+     *
+     * You can check if a screen reader is being used to make this component
+     * behave like the standard label component so a user that does not need
+     * accessibility features will not see the tooltips or be able to tab
+     * to label components.
+     */
+	public class AccessibleLabel extends Label 
+	    implements IFocusManagerComponent, IAccessibleComponent 
+	{
+		/**
+	    *  @private
+	    */
+		private var _accessibleText:String = "";
+				
+	   /**
+       *   Constructor
+       */
+		public function AccessibleLabel() 
+		{
+			super();
+		}
+		
+		/**
+	     *  @public
+	     *  Method to set accessible text.
+	     */
+		public function set accessibleText(s:String):void
+		{
+			_accessibleText = s;
+			dispatchEvent(new Event("accessibleTextChanged"));
+		}
+		
+		/**
+	     *  @public
+	     *  Method to get accessible text.
+	     */
+		public function get accessibleText():String
+		{
+			return _accessibleText;
+		}
+		
+		/** 
+		 * The properties are set on creation complete.  
+		 * accessibilityProperties will be guaranteed 
+		 * to be accurate at this point 
+		 * and the accessibility changes
+		 * can be made accordingly. 
+		 **/
+		override protected function commitProperties():void
+		{
+			
+			if ((accessibilityProperties != null) 
+			   && (AccessibilityTools.isAccessibilityActive()))  
+			{
+				focusEnabled = true;
+				tabEnabled = true;
+				accessibilityImplementation = new AccessibleLabelAccImpl(this);
+				setStyle("focusThickness", 2);
+				
+			}
+			else 
+			{
+				focusEnabled = false;
+				tabEnabled = false;
+				removeEventListener(FocusEvent.FOCUS_IN, focusInHandler);
+				removeEventListener(FocusEvent.FOCUS_OUT, focusOutHandler);
+			}
+		}
+		
+		/**
+		 * @protected
+		 *  Method that handles focus in events 
+		 */
+		override protected function focusInHandler(event:FocusEvent):void 
+		{
+			_accessibleText = (_accessibleText == "" ? text : _accessibleText); 
+		   
+		    // revised by jtorreno 07/29/2008
+		    // fix for null error exception if component is null 
+		    if ((focusManager != null) && (focusManager.getFocus() != null))
+		    {
+		        drawFocus(true);
+		    }   
+		   
+			event.stopPropagation();
+		}
+		
+			        
+	}
+}
+
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/AccessibleNumericStepper.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/AccessibleNumericStepper.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/AccessibleNumericStepper.as	(revision 1227)
@@ -0,0 +1,134 @@
+package gov.va.med.edp.widget
+{
+import mx.events.FlexMouseEvent;
+import mx.events.FlexEvent;
+import mx.controls.NumericStepper;
+import mx.core.mx_internal;
+import mx.core.UIComponent;
+import mx.managers.IFocusManagerComponent;
+
+import flash.events.FocusEvent;
+import flash.events.Event;
+import flash.accessibility.AccessibilityProperties;
+import flash.events.KeyboardEvent;
+import flash.events.MouseEvent;
+import flash.ui.Keyboard;
+
+use namespace mx_internal;
+	
+[AccessibilityClass(implementation="gov.va.med.edp.widget.accessibility.NumericStepperAccImpl")]
+	 
+[Event(name="dataChange", type="mx.events.FlexEvent")]
+
+/**
+ *  Dispatched when the user presses the Enter key.
+ *
+ *  @eventType mx.events.FlexEvent.ENTER
+ */
+[Event(name="enter", type="mx.events.FlexEvent")]
+ 
+ 
+[DataBindingInfo("editEvents", "&quot;focusIn;focusOut&quot;stepSizeMouseClickChanged&quot")]
+
+[DefaultBindingProperty(source="text", destination="text")]
+   
+		  
+public class AccessibleNumericStepper extends NumericStepper //implements IFocusManagerComponent
+{
+	/**
+     *  @private
+     *  Placeholder for mixin by ComboBoxAccImpl.
+     */  
+    mx_internal static var createAccessibilityImplementation:Function;
+	
+	/**
+	 * @private
+	 */   
+	private var iNum:int;
+    
+    /**
+    *  Constructor
+    */          
+    public function AccessibleNumericStepper()
+    {
+         super();
+         tabChildren = true;
+         tabEnabled = true; 
+         this.addEventListener(KeyboardEvent.KEY_UP,keyButtonHandler);
+         this.addEventListener(MouseEvent.CLICK,buttonClickHandler);
+     }
+     
+     /**
+	 *    @protected
+	 *    Activates accessibility
+	 */ 
+     override protected function initializeAccessibility():void
+     {
+        if (AccessibleNumericStepper.createAccessibilityImplementation != null)
+            AccessibleNumericStepper.createAccessibilityImplementation(this);
+     }
+     
+     /**
+	  * @protected
+	  *  Method that handles focus in events 
+	 */   
+     override protected function focusInHandler(event:FocusEvent):void 
+	 {
+	    super.focusInHandler(event);
+	    drawFocus(true);
+		dispatchEvent(new Event("numericStepperFocused"));
+		//event.stopPropagation();
+	 }
+      
+     /**
+	  * @private
+	  *  Method that handles mouse button click events 
+	 */        
+     private function buttonClickHandler(event:MouseEvent):void
+     {
+         dispatchEvent(new Event("stepSizeMouseClickChanged"));
+     }
+         
+     /**
+	 * @private
+	 *  Method that handles key button down events 
+	 */       
+     private function keyButtonHandler(event:KeyboardEvent):void
+	 {
+	     switch (event.keyCode)
+         {
+             case Keyboard.ENTER:
+             {
+                 dispatchEvent(new FlexEvent(FlexEvent.ENTER));
+                 break;
+             }
+             case Keyboard.DOWN:
+             {
+                 dispatchEvent(new FlexEvent(FlexEvent.BUTTON_DOWN));
+                 break;
+              }
+          }
+                
+	       dispatchEvent(new Event("stepSizeChanged"));
+     }
+         
+         
+	 /**
+	  *  @private
+	  */
+	 override public function get tabIndex():int
+	 {
+	     return iNum;
+	 }
+	
+	 /**
+	  *  @private
+	  */
+	 override public function set tabIndex(value:int):void
+	 {
+	     iNum = value;
+	 }
+	
+	
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/AutoComplete.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/AutoComplete.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/AutoComplete.as	(revision 1227)
@@ -0,0 +1,739 @@
+package gov.va.med.edp.widget
+{
+
+
+import gov.va.med.edp.util.KeyUtils;
+import flash.events.Event;
+import flash.events.FocusEvent;
+import flash.events.KeyboardEvent;
+import flash.net.SharedObject;
+import flash.ui.Keyboard;
+
+import mx.events.FlexEvent;
+import mx.collections.ArrayCollection;
+import mx.collections.ListCollectionView;
+import mx.controls.ComboBox;
+import mx.core.UIComponent;
+import mx.core.mx_internal;
+
+
+use namespace mx_internal;
+
+//--------------------------------------
+//  Events
+//--------------------------------------
+
+/**
+ *  Dispatched when the <code>filterFunction</code> property changes.
+ *
+ *  You can listen for this event and update the component
+ *  when the <code>filterFunction</code> property changes.</p>
+ *
+ *  @eventType flash.events.Event
+ */
+[Event(name="filterFunctionChange", type="flash.events.Event")]
+
+/**
+ *  Dispatched when the <code>typedText</code> property changes.
+ *
+ *  You can listen for this event and update the component
+ *  when the <code>typedText</code> property changes.</p>
+ *
+ *  @eventType flash.events.Event
+ */
+[Event(name="typedTextChange", type="flash.events.Event")]
+
+//--------------------------------------
+//  Excluded APIs
+//--------------------------------------
+
+[Exclude(name="editable", kind="property")]
+
+// added by jtorreno
+// created accessibility class
+[AccessibilityClass(implementation="gov.va.med.edp.widget.accessibility.AutoCompleteAccImpl")]
+
+/**
+ *  The AutoComplete control is an enhanced
+ *  TextInput control which pops up a list of suggestions
+ *  based on characters entered by the user. These suggestions
+ *  are to be provided by setting the <code>dataProvider
+ *  </code> property of the control.
+ *  @mxml
+ *
+ *  <p>The <code>&lt;fc:AutoComplete&gt;</code> tag inherits all the tag attributes
+ *  of its superclass, and adds the following tag attributes:</p>
+ *
+ *  <pre>
+ *  &lt;fc:AutoComplete
+ *    <b>Properties</b>
+ *    keepLocalHistory="false"
+ *    lookAhead="false"
+ *    typedText=""
+ *    filterFunction="<i>Internal filter function</i>"
+ *
+ *    <b>Events</b>
+ *    filterFunctionChange="<i>No default</i>"
+ *    typedTextChange="<i>No default</i>"
+ *  /&gt;
+ *  </pre>
+ *
+ *  @includeExample ../../../../../../docs/com/adobe/flex/extras/controls/example/AutoCompleteCountriesData/AutoCompleteCountriesData.mxml
+ *
+ *  @see mx.controls.ComboBox
+ *
+ */
+public class AutoComplete extends ComboBox
+{
+
+	// added by jtorreno 05.16.2008
+	 mx_internal static var createAccessibilityImplementation:Function;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Constructor
+    //
+    //--------------------------------------------------------------------------
+	public function AutoComplete()
+	{
+	    super();
+       // added by jtorreno
+        tabChildren=true;
+
+	    //Make ComboBox look like a normal text field
+	    editable = true;
+
+	    if(keepLocalHistory)
+		    addEventListener("focusOut",focusOutHandler);
+
+	    setStyle("arrowButtonWidth",0);
+		setStyle("fontWeight","normal");
+		setStyle("cornerRadius",0);
+		setStyle("paddingLeft",0);
+		setStyle("paddingRight",0);
+		rowCount = 7;
+	}
+
+	//--------------------------------------------------------------------------
+	//
+	//  Variables
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 */
+	private var cursorPosition:Number=0;
+
+	/**
+	 *  @private
+	 */
+	private var prevIndex:Number = -1;
+
+	/**
+	 *  @private
+	 */
+	private var removeHighlight:Boolean = false;
+
+	/**
+	 *  @private
+	 */
+	private var showDropdown:Boolean=false;
+
+	/**
+	 *  @private
+	 */
+	private var showingDropdown:Boolean=false;
+
+	/**
+	 *  @private
+	 */
+	private var tempCollection:Object;
+
+	/**
+	 *  @private
+	 */
+	private var usingLocalHistory:Boolean=false;
+
+	/**
+	 *  @private
+	 */
+	private var dropdownClosed:Boolean=true;
+
+	//--------------------------------------------------------------------------
+	//
+	//  Overridden Properties
+	//
+	//--------------------------------------------------------------------------
+
+ 	//----------------------------------
+	//  editable
+	//----------------------------------
+	/**
+	 *  @private
+	 */
+ 	override public function set editable(value:Boolean):void
+	{
+	    //This is done to prevent user from resetting the value to false
+	    super.editable = true;
+	}
+
+	/**
+	 *  @private
+	 */
+ 	override public function set dataProvider(value:Object):void
+	{
+		super.dataProvider =  value;
+		if(!usingLocalHistory)
+				tempCollection = value;
+	}
+
+	//----------------------------------
+	//  labelField
+	//----------------------------------
+	/**
+	 *  @private
+	 */
+ 	override public function set labelField(value:String):void
+	{
+		super.labelField = value;
+
+		invalidateProperties();
+		invalidateDisplayList();
+	}
+
+
+	//--------------------------------------------------------------------------
+	//
+	//  Properties
+	//
+	//--------------------------------------------------------------------------
+
+
+	//----------------------------------
+	//  filterFunction
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the filterFunction property.
+	 */
+	private var _filterFunction:Function = defaultFilterFunction;
+
+	/**
+	 *  @private
+	 */
+	private var filterFunctionChanged:Boolean = true;
+
+	[Bindable("filterFunctionChange")]
+	[Inspectable(category="General")]
+
+	/**
+	 *  A function that is used to select items that match the
+	 *  function's criteria.
+	 *  A filterFunction is expected to have the following signature:
+	 *
+	 *  <pre>f(item:~~, text:String):Boolean</pre>
+	 *
+	 *  where the return value is <code>true</code> if the specified item
+	 *  should displayed as a suggestion.
+	 *  Whenever there is a change in text in the AutoComplete control, this
+	 *  filterFunction is run on each item in the <code>dataProvider</code>.
+	 *
+ 	 *  <p>The default implementation for filterFunction works as follows:<br>
+ 	 *  If "AB" has been typed, it will display all the items matching
+	 *  "AB~~" (ABaa, ABcc, abAc etc.).</p>
+	 *
+	 *  <p>An example usage of a customized filterFunction is when text typed
+	 *  is a regular expression and we want to display all the
+	 *  items which come in the set.</p>
+	 *
+	 *  @example
+	 *  <pre>
+	 *  public function myFilterFunction(item:~~, text:String):Boolean
+	 *  {
+	 *     public var regExp:RegExp = new RegExp(text,"");
+	 *     return regExp.test(item);
+	 *  }
+	 *  </pre>
+	 *
+	 */
+	public function get filterFunction():Function
+	{
+		return _filterFunction;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set filterFunction(value:Function):void
+	{
+		//An empty filterFunction is allowed but not a null filterFunction
+		if(value!=null)
+		{
+			_filterFunction = value;
+			filterFunctionChanged = true;
+
+			invalidateProperties();
+			invalidateDisplayList();
+
+			dispatchEvent(new Event("filterFunctionChange"));
+		}
+		else
+			_filterFunction = defaultFilterFunction;
+	}
+
+	//----------------------------------
+	//  filterFunction
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the keepLocalHistory property.
+	 */
+	private var _keepLocalHistory:Boolean = false;
+
+	/**
+	 *  @private
+	 */
+	private var keepLocalHistoryChanged:Boolean = true;
+
+	[Bindable("keepLocalHistoryChange")]
+	[Inspectable(category="General")]
+
+	/**
+	 *  When true, this causes the control to keep track of the
+	 *  entries that are typed into the control, and saves the
+	 *  history as a local shared object. When true, the
+	 *  completionFunction and dataProvider are ignored.
+	 *
+	 *  @default "false"
+	 */
+	public function get keepLocalHistory():Boolean
+	{
+		return _keepLocalHistory;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set keepLocalHistory(value:Boolean):void
+	{
+		_keepLocalHistory = value;
+	}
+
+	//----------------------------------
+	//  lookAhead
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the lookAhead property.
+	 */
+	private var _lookAhead:Boolean=false;
+
+	/**
+	 *  @private
+	 */
+	private var lookAheadChanged:Boolean;
+
+	[Bindable("lookAheadChange")]
+	[Inspectable(category="Data")]
+
+	/**
+	 *  lookAhead decides whether to auto complete the text in the text field
+	 *  with the first item in the drop down list or not.
+	 *
+	 *  @default "false"
+	 */
+	public function get lookAhead():Boolean
+	{
+		return _lookAhead;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set lookAhead(value:Boolean):void
+	{
+		_lookAhead = value;
+		lookAheadChanged = true;
+	}
+
+	//----------------------------------
+	//  typedText
+	//----------------------------------
+
+	/**
+	 *  @private
+	 *  Storage for the typedText property.
+	 */
+	private var _typedText:String="";
+	/**
+	 *  @private
+	 */
+	private var typedTextChanged:Boolean;
+
+	[Bindable("typedTextChange")]
+	[Inspectable(category="Data")]
+
+	/**
+	 *  A String to keep track of the text changed as
+	 *  a result of user interaction.
+	 */
+	public function get typedText():String
+	{
+	    return _typedText;
+	}
+
+	/**
+	 *  @private
+	 */
+	public function set typedText(input:String):void
+	{
+	    _typedText = input;
+	    typedTextChanged = true;
+
+	    invalidateProperties();
+		invalidateDisplayList();
+		dispatchEvent(new Event("typedTextChange"));
+	}
+
+    //--------------------------------------------------------------------------
+    //
+    //  Overridden methods
+    //
+    //--------------------------------------------------------------------------
+
+    override protected function createChildren():void
+    {
+        super.createChildren();
+
+        textInput.addEventListener(KeyboardEvent.KEY_DOWN, textInput_keyHandler);
+        textInput.restrict = textInput.restrict + " "; // restrict space characters from being entered
+    }
+
+    /**
+	 *  @private
+	 */
+	override protected function commitProperties():void
+	{
+	    super.commitProperties();
+
+  	    if(!dropdown)
+			selectedIndex=-1;
+
+	    if(dropdown)
+		{
+
+		    if(typedTextChanged)
+		    {
+			    cursorPosition = textInput.selectionBeginIndex;
+
+				updateDataProvider();
+
+			    //In case there are no suggestions there is no need to show the dropdown
+  			    if(collection.length==0 || typedText==""|| typedText==null)
+  			    {
+  			    	dropdownClosed=true;
+			    	showDropdown=false;
+			    	//added by jtorreno
+			    	//reset selected index if autocomplete field is empty
+			    	selectedIndex = -1;
+  			    }
+				else
+				{
+					showDropdown = true;
+					//selectedIndex = 0;
+					// revised by jtorreno
+					// removes default higlighted item on list
+					selectedIndex = -1;
+
+			   	}
+ 		    }
+		}
+	}
+
+	/**
+	 *  @private
+	 */
+	override protected function focusOutHandler(event:FocusEvent):void
+	{
+		super.focusOutHandler(event)
+ 		if(keepLocalHistory && dataProvider.length==0)
+ 			addToLocalHistory();
+	}
+	/**
+	 *  @private
+	 */
+	override public function getStyle(styleProp:String):*
+	{
+		if(styleProp != "openDuration")
+			return super.getStyle(styleProp);
+		else
+		{
+	     	if(dropdownClosed)
+	     		return super.getStyle(styleProp);
+     		else
+     			return 0;
+		}
+	}
+	/**
+	 *  @private
+	 */
+	override protected function keyDownHandler(event:KeyboardEvent):void
+	{
+	    super.keyDownHandler(event);
+
+	    if(!event.ctrlKey)
+		{
+		    //An UP "keydown" event on the top-most item in the drop-down
+		    //or an ESCAPE "keydown" event should change the text in text
+		    // field to original text
+  	        if(event.keyCode == Keyboard.UP && prevIndex==0)
+			{
+			    textInput.text = _typedText;
+			    textInput.setSelection(textInput.text.length, textInput.text.length);
+			    selectedIndex = -1;
+			}
+		    else if(event.keyCode==Keyboard.ESCAPE && showingDropdown)
+			{
+	 		    textInput.text = _typedText;
+			    textInput.setSelection(textInput.text.length, textInput.text.length);
+			    showingDropdown = false;
+			    dropdownClosed=true;
+			}
+            else if (event.keyCode == Keyboard.SPACE && showingDropdown)
+            {
+                showingDropdown = false;
+			    dropdownClosed=true;      
+            }
+            else if(event.keyCode == Keyboard.ENTER)
+			{
+ 				if(keepLocalHistory && dataProvider.length==0)
+					addToLocalHistory();
+ 			}
+			else if(lookAhead && KeyUtils.isRemoveKey(event))
+			    removeHighlight = true;
+	 	}
+	 	else
+		    if(event.ctrlKey && event.keyCode == Keyboard.UP)
+		    	dropdownClosed=true;
+
+
+ 	    prevIndex = selectedIndex;
+	}
+
+	/**
+	 *  @private
+	 */
+	override protected function measure():void
+	{
+	    super.measure();
+	    measuredWidth = mx.core.UIComponent.DEFAULT_MEASURED_WIDTH;
+	}
+
+	/**
+	 *  @private
+	 */
+	override protected function updateDisplayList(unscaledWidth:Number,
+						      unscaledHeight:Number):void
+	{
+
+	    super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+		//An UP "keydown" event on the top-most item in the drop
+		//down list otherwise changes the text in the text field to ""
+  	    if(selectedIndex == -1)
+	    	textInput.text = typedText;
+
+	    if(dropdown)
+		{
+		    if(typedTextChanged)
+			{
+			    //This is needed because a call to super.updateDisplayList() set the text
+			    // in the textInput to "" and thus the value
+			    //typed by the user losts
+  			    if(lookAhead && showDropdown && typedText!="" && !removeHighlight)
+				{
+					var label:String = itemToLabel(collection[0]);
+					var index:Number =  label.toLowerCase().indexOf(_typedText.toLowerCase());
+					if(index==0)
+					{
+					    textInput.text = _typedText+label.substr(_typedText.length);
+					    textInput.setSelection(textInput.text.length,_typedText.length);
+					}
+					else
+					{
+					    textInput.text = _typedText;
+					    textInput.setSelection(cursorPosition, cursorPosition);
+					    removeHighlight = false;
+					}
+
+				}
+			    else
+				{
+				    textInput.text = _typedText;
+				    textInput.setSelection(cursorPosition, cursorPosition);
+				    removeHighlight = false;
+				}
+
+			    typedTextChanged= false;
+			}
+		    else if(typedText)
+		    	//Sets the selection when user navigates the suggestion list through
+		    	//arrows keys.
+				textInput.setSelection(_typedText.length,textInput.text.length);
+		}
+ 	    if(showDropdown && !dropdown.visible)
+ 	    {
+ 	    	//This is needed to control the open duration of the dropdown
+ 	    	super.open();
+	    	showDropdown = false;
+ 	    	showingDropdown = true;
+
+ 	    	if(dropdownClosed)
+	 	    	dropdownClosed=false;
+ 	    }
+	}
+
+
+	/**
+	 *  @private
+	 */
+	override protected function textInput_changeHandler(event:Event):void
+	{
+	    super.textInput_changeHandler(event);
+	    //Stores the text typed by the user in a variable
+	    typedText=text;
+        if (text.charAt(text.length - 1) == ' ') {
+            typedText = text.slice(0, text.length - 1);
+        }
+    }
+
+    protected function textInput_keyHandler(event:KeyboardEvent):void
+    {
+        if (event.keyCode == Keyboard.SPACE && showingDropdown && selectedIndex != -1 && !event.ctrlKey) {
+//            event.preventDefault();
+            dispatchEvent(new FlexEvent(FlexEvent.ENTER));
+        }
+    }
+
+    //--------------------------------------------------------------------------
+	//
+	//  Methods
+	//
+	//--------------------------------------------------------------------------
+
+	/**
+	 *  @private
+	 *  If keepLocalHistory is enabled, stores the text typed
+	 * 	by the user in the local history on the client machine
+	 */
+	private function addToLocalHistory():void
+	{
+        if (id != null && id != "" && text != null && text != "")
+        {
+            var so:SharedObject = SharedObject.getLocal("AutoCompleteData");
+
+            var savedData : Array = so.data.suggestions;
+            //No shared object has been created so far
+            if (savedData == null)
+                savedData = new Array();
+
+             var i:Number=0;
+             var flag:Boolean=false;
+             //Check if this entry is there in the previously saved shared object data
+             for(i=0;i<savedData.length;i++)
+				if(savedData[i]==text)
+				{
+					flag=true;
+					break;
+				}
+             if(!flag)
+             {
+             	//Also ensure it is not there in the dataProvider
+	             for(i=0;i<collection.length;i++)
+	             	if(defaultFilterFunction(itemToLabel(ListCollectionView(collection).getItemAt(i)),text))
+					{
+						flag=true;
+						break;
+					}
+             }
+     		if(!flag)
+     			savedData.push(text);
+
+           so.data.suggestions = savedData;
+           //write the shared object in the .sol file
+	       so.flush();
+        }
+	}
+	/**
+	 *  @private
+	 */
+	private function defaultFilterFunction(element:*, text:String):Boolean
+	{
+	    var label:String = itemToLabel(element);
+	    return (label.toLowerCase().substring(0,text.length) == text.toLowerCase());
+	}
+	/**
+	 *  @private
+	 */
+
+ 	private function templateFilterFunction(element:*):Boolean
+	{
+		var flag:Boolean=false;
+		if(filterFunction!=null)
+			flag=filterFunction(element,typedText);
+		return flag;
+	}
+
+	/**
+	 *  @private
+	 *  Updates the dataProvider used for showing suggestions
+	 */
+	private function updateDataProvider():void
+	{
+		dataProvider = tempCollection;
+ 		collection.filterFunction = templateFilterFunction;
+		collection.refresh();
+
+	    //In case there are no suggestions, check there is something in the localHistory
+  	    if(collection.length==0 && keepLocalHistory)
+  	    {
+            var so:SharedObject = SharedObject.getLocal("AutoCompleteData");
+			usingLocalHistory = true;
+            dataProvider = so.data.suggestions;
+            usingLocalHistory = false;
+	 		collection.filterFunction = templateFilterFunction;
+			collection.refresh();
+  	    }
+  	}
+
+   /**
+	*  @protected
+	*  Puts focus on the autocomplete component and fires an accessibility event
+    *  so that it can be read by a screen reader.
+    *
+    *  added by: jtorreno 04-30-2008
+	*/
+	override protected function focusInHandler(event:FocusEvent):void
+	{
+	    super.setFocus();
+
+	   	dispatchEvent(new Event("onFocus"));
+    }
+
+	/**
+	 * Activates accessibility
+	 * @protected
+	 */
+	override protected function initializeAccessibility():void
+    {
+
+        if (AutoComplete.createAccessibilityImplementation != null)
+            AutoComplete.createAccessibilityImplementation(this);
+        }
+
+    }	
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/CenteredCheckBox.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/CenteredCheckBox.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/CenteredCheckBox.as	(revision 1227)
@@ -0,0 +1,55 @@
+package gov.va.med.edp.widget
+{
+	import flash.display.DisplayObject;
+	import flash.events.MouseEvent;
+	import flash.text.TextField;
+	
+	import mx.controls.CheckBox;
+	import mx.controls.dataGridClasses.DataGridListData;
+	import mx.controls.listClasses.IListItemRenderer;
+
+	public class CenteredCheckBox extends CheckBox implements IListItemRenderer
+	{
+
+		private var _data: Object;
+		
+        override public function set data(value:Object):void
+        {
+        	if(value != null) {
+        		super.data = value;
+        		_data = value;
+        		var dataField: Object = DataGridListData(listData).dataField;
+        		selected = value[dataField];
+        	} else {
+        		selected = false;
+        	}
+        }
+        
+		override public function get data(): Object
+		{
+			return _data;
+		}        
+		
+        override protected function clickHandler(event:MouseEvent):void
+        {
+            super.clickHandler(event);
+            data[DataGridListData(listData).dataField] = selected;
+        }		
+		
+        // center the contentHolder
+        override protected function updateDisplayList(w:Number, h:Number):void
+        {
+        	super.updateDisplayList(w, h);
+
+            var n:int = numChildren;
+            for (var i:int = 0; i < n; i++)
+            {
+            	var c:DisplayObject = getChildAt(i);
+            	if (!(c is TextField)) {
+                	c.x = (w - c.width) / 2;
+                    c.y = 0;
+                }
+            }
+        }		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/CenteredEmbedImage.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/CenteredEmbedImage.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/CenteredEmbedImage.as	(revision 1227)
@@ -0,0 +1,159 @@
+package gov.va.med.edp.widget
+{
+	import flash.display.DisplayObject;
+import mx.events.FlexEvent;
+import mx.core.UIComponent;
+import mx.controls.listClasses.BaseListData;
+import mx.controls.listClasses.IListItemRenderer;
+import mx.controls.listClasses.IDropInListItemRenderer;
+
+/**
+ *  assumes the image is embedded and not a .swf
+ */
+public class CenteredEmbedImage extends UIComponent implements IListItemRenderer, IDropInListItemRenderer
+{
+
+	public function CenteredEmbedImage()
+	{
+		super();
+	}
+
+    //----------------------------------
+    //  data
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the data property.
+     */
+    private var _data:Object;
+
+    [Bindable("dataChange")]
+    [Inspectable(environment="none")]
+
+    /**
+     *  Lets you pass a value to the component
+     *  when you use it in an item renderer or item editor.
+     *  You typically use data binding to bind a field of the <code>data</code>
+     *  property to a property of this component.
+     *
+     *  <p>When you use the control as a drop-in item renderer or drop-in
+     *  item editor, Flex automatically writes the current value of the item
+     *  to the <code>text</code> property of this control.</p>
+     *
+     *  <p>You do not set this property in MXML.</p>
+     *
+     *  @default null
+     *  @see mx.core.IDataRenderer
+     */
+    public function get data():Object
+    {
+        return _data;
+    }
+
+    /**
+     *  @private
+     */
+    public function set data(value:Object):void
+    {
+        var newText:*;
+
+        _data = value;
+
+		invalidateProperties();
+
+        dispatchEvent(new FlexEvent(FlexEvent.DATA_CHANGE));
+    }
+
+    //----------------------------------
+    //  listData
+    //----------------------------------
+
+    /**
+     *  @private
+     *  Storage for the listData property.
+     */
+    private var _listData:BaseListData;
+
+    [Bindable("dataChange")]
+    [Inspectable(environment="none")]
+
+    /**
+     *  When a component is used as a drop-in item renderer or drop-in
+     *  item editor, Flex initializes the <code>listData</code> property
+     *  of the component with the appropriate data from the List control.
+     *  The component can then use the <code>listData</code> property
+     *  to initialize the <code>data</code> property of the drop-in
+     *  item renderer or drop-in item editor.
+     *
+     *  <p>You do not set this property in MXML or ActionScript;
+     *  Flex sets it when the component is used as a drop-in item renderer
+     *  or drop-in item editor.</p>
+     *
+     *  @default null
+     *  @see mx.controls.listClasses.IDropInListItemRenderer
+     */
+    public function get listData():BaseListData
+    {
+        return _listData;
+    }
+
+    /**
+     *  @private
+     */
+    public function set listData(value:BaseListData):void
+    {
+        _listData = value;
+    }
+
+	private var img:DisplayObject;
+
+	/**
+	 *  create the image instance now that we know what it is
+	 */
+	override protected function commitProperties():void
+	{
+		super.commitProperties();
+
+		if (listData)
+		{
+			// remove the old child if we have one
+			if (img)
+				removeChild(img);
+
+			var c:Class = UIComponent(owner).document[listData.label];
+			img = new c();
+			addChild(img);
+		}
+	}
+
+	/**
+	 *  create the image instance now that we know what it is
+	 */
+	override protected function measure():void
+	{
+		super.measure();
+
+		if (img)
+		{
+			measuredHeight = img.height;
+			measuredWidth = img.width;
+		}
+	}
+
+	/**
+	 *  center the contentHolder
+	 */
+	override protected function updateDisplayList(w:Number, h:Number):void
+	{
+		super.updateDisplayList(w, h);
+
+		if (img)
+		{
+			img.x = (w - img.width) / 2;
+		}
+	}
+
+}
+
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ColorCellRenderer.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ColorCellRenderer.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ColorCellRenderer.as	(revision 1227)
@@ -0,0 +1,44 @@
+/* ColorCellRenderer.as */
+
+package gov.va.med.edp.widget
+{
+	import flash.display.Graphics;
+	
+	import gov.va.med.edp.model.TrackingModelLocator;
+	
+	import mx.controls.Label;
+	
+	public class ColorCellRenderer extends Label
+	{	
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		override public function set data(value:Object):void
+		{
+			super.data = value;
+
+			if (value != null)
+			{
+				setStyle("color", model.boardSpec.cellColor(listData["dataField"], value).text);
+				if (model.appName == TrackingModelLocator.APP_NAME_BIGBOARD) {
+					setStyle("fontSize", model.boardSpec.displayBoardProperties.squishFontSize);					
+				}
+			}
+		}
+		
+		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+		{
+			super.updateDisplayList(unscaledWidth, unscaledHeight);
+			
+			if (data != null) {
+				var backColor: uint = model.boardSpec.cellColor(listData["dataField"], data).back;
+				var g:Graphics = graphics;
+				g.clear();
+				g.beginFill(backColor);
+				//g.drawRect(0, -2, unscaledWidth, unscaledHeight+4);
+				g.drawRect(0, 0, unscaledWidth, unscaledHeight);
+				g.endFill();				
+			}
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ColorSampleRenderer.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ColorSampleRenderer.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ColorSampleRenderer.mxml	(revision 1227)
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Label
+	xmlns:mx="http://www.adobe.com/2006/mxml" >
+	
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.vo.ColorSelectionVO;
+		
+		private var _data: Object;
+	
+		override public function set data(value: Object): void {
+			super.data = value;
+
+			if (value != null) {
+				var color: ColorSelectionVO = value["color"] as ColorSelectionVO;
+				if (color == null) return;
+
+				setStyle("color", color.text);
+				if (color.ignore) {
+					this.text = "Color not used"
+				} else {
+					this.text = "Sample Color"
+				}
+			}
+		}
+		
+		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+		{
+			super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+			if (data != null) {
+				var color: ColorSelectionVO = data["color"];
+				if (color == null) return;
+				
+				var g:Graphics = graphics;
+				g.clear();
+				g.beginFill(color.back);
+				g.drawRect(0, 0, unscaledWidth, unscaledHeight);
+				g.endFill();
+			}
+		}		
+	]]>
+	</mx:Script>
+</mx:Label>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ColorSelector.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ColorSelector.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ColorSelector.mxml	(revision 1227)
@@ -0,0 +1,158 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- ColorSelector.mxml assumes a listcontrol passes in a "color" property -->
+
+<mx:HBox
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	horizontalScrollPolicy="off" verticalScrollPolicy="off"
+	horizontalGap="3" creationComplete="setCorrectState()" xmlns:accessibility="flash.accessibility.*">
+	<mx:Metadata>
+		[Event(name="colorChange", type="gov.va.med.edp.control.config.ColorChangedEvent")]
+	</mx:Metadata>
+	<mx:Script>
+	<![CDATA[
+		import gov.va.med.edp.util.AccessibilityTools;
+		import gov.va.med.edp.control.config.ColorChangedEvent;
+		import gov.va.med.edp.control.config.ConfigurationEvent;
+		import mx.controls.dataGridClasses.DataGridListData;
+		import gov.va.med.edp.vo.ColorSelectionVO;
+		
+		private var _data: Object;
+		
+		private var _color:ColorSelectionVO = new ColorSelectionVO();
+	
+		[Bindable]
+		private var _baseTabIndex:int;
+	
+		[Bindable]
+		public function get color():ColorSelectionVO {
+			return _color;
+		}
+	
+		public function set color(c:ColorSelectionVO):void {
+			initColor(c);
+		}
+	
+		[Bindable]
+		public override function get tabIndex():int {
+			return super.tabIndex;
+		}
+		
+		public override function set tabIndex(index:int):void {
+			super.tabIndex = index;
+			_baseTabIndex = index;
+		}
+	
+		override public function set data(value:Object):void
+		{
+			if (value == null) return;
+			_data = value;
+			var curColor: ColorSelectionVO = value["color"] as ColorSelectionVO;
+			initColor(curColor);	
+		}
+		
+		private function initColor(c:ColorSelectionVO):void {
+				if (c == null) {
+				_color.ignore = true;
+				_color.text = 0;
+				_color.back = 0xffffff;
+			} else {
+				_color.ignore = c.ignore;
+				_color.text = c.text;
+				_color.back = c.back;
+			}
+			
+			useColor.selected = !_color.ignore;
+			if (_color.ignore) {
+				_color.back = 0xFFFFFF;
+				_color.text = 0;
+			}
+			textColor.selectedColor = _color.text;
+			backColor.selectedColor = _color.back;
+			textColorTxt.text = rgbToHex(_color.text);
+			backColorTxt.text = rgbToHex(_color.back);	
+		}
+		
+		override public function get data(): Object
+		{
+			return _data;
+			
+		}
+		
+		private function changeIgnore(): void
+		{
+			_color.ignore = !useColor.selected;
+			_color.back = 0xFFFFFF;
+			_color.text = 0;
+			
+			backColorTxt.visible = useColor.selected;
+			textColorTxt.visible = useColor.selected;
+			dispatchEvent(new ColorChangedEvent(_color));
+		}
+		
+		private function changeColor(): void
+		{
+			if (AccessibilityTools.isAccessibilityActive()){
+				if (textColorTxt.text.length == 6){
+				_color.text = uint("0x" + textColorTxt.text);
+				_color.back = uint("0x" + backColorTxt.text);
+				dispatchEvent(new ColorChangedEvent(_color));
+				} else {
+					return;
+				}
+			} else {
+				_color.text = textColor.selectedColor;
+				_color.back = backColor.selectedColor;
+				dispatchEvent(new ColorChangedEvent(_color));
+			}
+			
+		}
+		
+		private function setCorrectState(): void
+		{
+			if (AccessibilityTools.isAccessibilityActive()) currentState = 'accessible'
+			else currentState = '';
+		}		
+		
+	    private function rgbToHex(color:uint):String
+	    {
+	        // Find hex number in the RGB offset
+	        var colorInHex:String = color.toString(16);
+	        var c:String = "00000" + colorInHex;
+	        var e:int = c.length;
+	        c = c.substring(e - 6, e);
+	        return c.toUpperCase();
+	    }		
+			
+	]]>
+	</mx:Script>
+
+	<mx:CheckBox id="useColor" accessibilityProperties="{useColorProps}" label="Use Color" selected="false" paddingTop="2" change="changeIgnore()" tabIndex="{_baseTabIndex + 1}"/>
+	<mx:Label id="textLbl" text="Text" paddingTop="2" visible="{useColor.selected}" />
+	<mx:ColorPicker id="textColor" change="changeColor()" editable="false" showTextField="false" visible="{useColor.selected}" tabIndex="{_baseTabIndex + 2}"/>
+	<mx:Label id="backLbl" text="Back" paddingTop="2" visible="{useColor.selected}" />
+	<mx:ColorPicker id="backColor" change="changeColor()" editable="false" showTextField="false" visible="{useColor.selected}" tabIndex="{_baseTabIndex + 3}"/>
+	
+	<accessibility:AccessibilityProperties id="useColorProps" name="use color" />
+	<accessibility:AccessibilityProperties id="backColorProps" name="enter background color in 6 digit hex string format" />
+	<accessibility:AccessibilityProperties id="textColorProps" name="enter text color in 6 digit hex string format" />
+	
+    <mx:states>
+        <mx:State name="accessible">
+        	 <mx:RemoveChild target="{textColor}"/>
+            <mx:AddChild relativeTo="{textLbl}" position="after">
+                <mx:target>
+                        <mx:TextInput maxChars="6" id="textColorTxt" accessibilityProperties="{textColorProps}" change="changeColor()" width="55" restrict="#xabcdefABCDEF0123456789" visible="{useColor.selected}" tabIndex="{_baseTabIndex + 2}"/>
+                </mx:target>
+            </mx:AddChild>
+            <mx:SetProperty target="{textColorTxt}" name="text" value="{rgbToHex(color.text)}"/>
+            <mx:RemoveChild target="{backColor}"/>
+            <mx:AddChild relativeTo="{backLbl}" position="after">
+                <mx:target>
+                    <mx:TextInput id="backColorTxt" maxChars="6" change="changeColor()" accessibilityProperties="{backColorProps}" width="55" restrict="#xXabcdefABCDEF0123456789" visible="{useColor.selected}" tabIndex="{_baseTabIndex + 3}"/>
+                </mx:target>
+            </mx:AddChild>
+            <mx:SetProperty target="{backColorTxt}" name="text" value="{rgbToHex(color.back)}"/>
+        </mx:State>
+    </mx:states>	
+	
+</mx:HBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/DataGrid.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/DataGrid.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/DataGrid.mxml	(revision 1227)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:DataGrid
+	xmlns:mx="http://www.adobe.com/2006/mxml">
+
+	<mx:Script>
+		<![CDATA[
+		//this class was added for a bug that exists in Flex..
+		//http://bugs.adobe.com/jira/browse/SDK-9476 and http://www.wietseveenstra.nl/blog/2007/03/27/flex-listbase-scroll-vertically-error/
+		// even tho it claims to be fixed but it's not
+		//many people on internet have the same issue..especially when updating the Font size at run time..
+		//Here is the error that gets thrown
+		
+		//TypeError: Error #1010: A term is undefined and has no properties.
+		//at mx.controls.listClasses::ListBase/mx.controls.listClasses:ListBase::scrollVertically()
+		
+ 			override protected function updateDisplayList(w:Number, h:Number):void {
+				var b:Boolean = false;
+				if( rendererChanged ) b = true;
+				super.updateDisplayList(w, h);
+				if( b ) {
+					while( rowInfo.length > listItems.length ) rowInfo.pop();
+				}
+			}
+		]]>
+    </mx:Script>
+
+</mx:DataGrid>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/DateTimeChooser.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/DateTimeChooser.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/DateTimeChooser.mxml	(revision 1227)
@@ -0,0 +1,330 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Canvas
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	xmlns:widget="gov.va.med.edp.widget.*"
+	width="195"
+	horizontalScrollPolicy="off" verticalScrollPolicy="off" tabChildren="true" focusEnabled="false" creationComplete="layoutControls()">
+	
+	<mx:Metadata>
+		[Event(name="change", type="mx.events.CalendarLayoutChangeEvent")]
+ 		[Event(name=DateTimeEvent.EVENT_DATE_TIME, type="gov.va.med.edp.control.DateTimeEvent")]
+ 	</mx:Metadata>  	
+
+	<mx:Script>
+	<![CDATA[
+		import mx.events.CalendarLayoutChangeEvent;
+		import gov.va.med.edp.control.DateTimeEvent;
+		import gov.va.med.edp.control.DateTimeEvent;
+		import gov.va.med.edp.control.DateTimeEvent;
+		import mx.binding.utils.BindingUtils;
+		import gov.va.med.edp.control.DateTimeEvent;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.util.AccessibilityTools;
+
+        [Bindable]
+		public var _selectedDate: Date;
+		
+		[Bindable]
+		private var _tabIndexBase:int = -1;
+		
+		[Bindable]
+		private var _dateType:String = "";		
+		
+		[Bindable]
+		public function set selectedDate(date:Date):void
+		{
+			dateInput.text = "";
+			timeInput.text = "";
+			if (date != null){
+				dateChooser.selectedDate = date;
+				timeChooser.hour = date.getHours();
+				timeChooser.minute = date.getMinutes();
+				dateInput.text = dateFormatter.format(date);
+				timeInput.text = get2DigitTime(date.getHours().toString()) + ":" + get2DigitTime(date.getMinutes().toString());
+			} else {
+				dateChooser.selectedDate = null;
+				timeChooser.hour = 00;
+				timeChooser.minute = 00;
+			}		
+		} 
+		public function get selectedDate():Date
+		{
+			return this._selectedDate;
+		} 
+		
+        private function get2DigitTime(time:String):String {
+        	if (time.length == 1) return "0" + time;
+        	return time;
+        }		
+        
+        private function layoutControls():void {
+        	if (AccessibilityTools.isAccessibilityActive()){
+        		textControlsBox.visible = true;
+        		calendarControlsBox.visible = false;  
+           	} else {
+        		textControlsBox.visible = false;
+        		calendarControlsBox.visible = true;        	
+        	}
+        }			
+			
+		private function fireEventFromCalendarControls(event: Event): void
+		{
+			if (dateChooser.selectedDate == null){
+				this._selectedDate = null;
+				return;
+			}
+				
+			var hours:int = timeChooser.hour;
+			var minutes:int = timeChooser.minute;
+            var year:int = dateChooser.selectedDate.fullYear;
+			var month:int  = dateChooser.selectedDate.month;
+			var date:int = dateChooser.selectedDate.date;
+
+			var dateTime:Date = new Date(year,month, date,hours,minutes);
+			this._selectedDate = dateTime;
+
+			var dateTimeEvent:DateTimeEvent = new DateTimeEvent(DateTimeEvent.EVENT_DATE_TIME);
+			dateTimeEvent.dateTime = dateTime;
+			dispatchEvent(dateTimeEvent);
+
+			var chgEvent: CalendarLayoutChangeEvent =
+				new CalendarLayoutChangeEvent(CalendarLayoutChangeEvent.CHANGE);
+			chgEvent.newDate = dateTime;
+			dispatchEvent(chgEvent);
+		}
+
+		private function fireEventFromTextControls(event: Event): void
+		{
+			var isValid:Boolean = false;
+		
+			if (event.currentTarget.id == "dateInput"){
+				isValid = isDateValid(dateInput.text);			
+			}
+
+			if (event.currentTarget.id == "timeInput"){
+				isValid = isTimeValid(timeInput.text);			
+			}			
+			
+			if (!isValid){
+				this._selectedDate = null;
+				return;
+			}
+		
+	     	var date:Array = dateInput.text.split("/");
+			var time:Array = timeInput.text.split(":");	
+			var hours:int = parseInt(time[0]);
+			var minutes:int = parseInt(time[1]);
+            //var year:int = parseInt(date[2]);
+            var year:int = formatYear(date[2]);
+			var month:int  = parseInt(date[0]);
+			var day:int = parseInt(date[1]);
+		    var dateTime:Date = new Date(year,month-1,day,hours,minutes);
+			
+			this._selectedDate = dateTime;
+		    dateInput.text = DateField.dateToString(dateTime, "MM/DD/YYYY");
+		
+			var dateTimeEvent:DateTimeEvent = new DateTimeEvent(DateTimeEvent.EVENT_DATE_TIME);
+			dateTimeEvent.dateTime = dateTime;
+			dispatchEvent(dateTimeEvent);
+			
+			var chgEvent: CalendarLayoutChangeEvent =
+				new CalendarLayoutChangeEvent(CalendarLayoutChangeEvent.CHANGE);
+			chgEvent.newDate = dateTime;
+			dispatchEvent(chgEvent);
+			
+		}
+        
+        // added by jtorreno 08/17/2008
+        // formats year according to the length of the string and its value
+        // Formatting is based on the autoformatting algorithm of the datechooser field in flex
+        // This is implemented if accessibility is enabled
+        private function formatYear(yearStr: String): int
+        {
+        	var newYear:int = 1900;
+        	var yearLen:int = 0;
+        	var year:int = 0;
+        	
+        	if (yearStr != null)
+        	{
+        		yearLen = yearStr.length;
+        		year = parseInt(yearStr);
+        	}
+        	
+        	if ((yearLen > 0) && (yearLen <=3))
+        	{
+	        	if ((year > 0) && (year < 70) && (yearLen == 2))
+			    {
+			     	newYear = year + 2000;
+			    } else { 	 
+			     	if (((year >= 70) && (year <= 99) && (yearLen == 1)) ||
+			     	    ((year <= 99) && (yearLen == 3)))
+			     	{    
+			     	   newYear = year + 1900;
+			     	} else {
+			     		newYear = year;
+			     	}  
+			     }
+	        } else {
+	        	newYear = year;
+	        }
+	        	
+        	return newYear
+        }
+        
+        // modified by jtorreno 8/17/2008
+        // changed some rules to allow date formatting
+		private function isDateValid(dateString: String): Boolean
+		{
+			var isValid:Boolean = false;
+				
+			// minimum and maximum length of string that can be entered
+			if ((dateString.length >= 5) &&  (dateString.length <= 10))
+			{
+			    var date:Array = dateString.split("/");
+				// checks if array is composed of 3 fields ( Month, Day , Year)
+				if (date.length == 3)
+				{
+					var monthStr:String  = date[0];
+					var dayStr:String = date[1];				
+            		var yearStr:String = date[2];
+                    
+                    // checks string length of month, day, year for validity        		
+            		if ((monthStr.length > 0) && (monthStr.length <= 2) 
+            		    && (dayStr.length > 0) && (dayStr.length <= 2) 
+            		    && (yearStr.length > 0) && (yearStr.length <= 4))
+            		{
+            			var year:Number = parseInt(yearStr);
+						var month:Number  = parseInt(monthStr);
+						var day:Number = parseInt(dayStr);
+					
+						if (isNaN(year) || isNaN(month) || isNaN(day)){
+							isValid = false;
+						} else 
+						     {
+								if (month > 0 && month < 13){
+									if (day > 0 && day < 32){
+										isValid = true;
+									}
+								}     
+            			     }
+            		 }
+                }		
+			}
+						
+			return isValid;
+		}
+		
+		//added by jtorreno 08/17/2008
+		// resets time text if it is left blank 
+		private function resetTimeText(event:Event):void
+		{
+			if (event.currentTarget.id == "timeInput"){
+			    if ((timeInput.text == null) || (timeInput.text.length == 0)) 
+			    {
+			    	timeInput.text = "00:00"
+			    }
+						
+			}	
+		}
+
+		private function isTimeValid(timeString: String): Boolean
+		{
+			var isValid:Boolean = false;
+				if (timeString.length == 5){
+					var time:Array = timeString.split(":");
+					var hourStr:String  = time[0];
+					var minStr:String = time[1];				
+            		if (hourStr.length == 2 && minStr.length == 2){
+            			var hour:Number = parseInt(hourStr);
+						var min:Number  = parseInt(minStr);
+						if (isNaN(hour) || isNaN(min)){
+							isValid = false;
+						} else {
+								if (hour > -1 && hour < 24){
+									if (min > -1 && min < 60){
+										isValid = true;
+									}
+								}     
+            				}
+            			}
+				}			
+			return isValid;
+		}
+
+		private function setAccessibilityPropertiesForDateInput(): void {
+			AccessibilityTools.accessComponentName(dateInput, "Date");
+			AccessibilityTools.accessComponentDescription(dateInput, "Enter " + _dateType + "date as MM/DD/YYYY.");
+			
+		}
+		
+		private function setAccessibilityPropertiesForTimeInput(): void {
+			AccessibilityTools.accessComponentName(timeInput,"Time");
+			AccessibilityTools.accessComponentDescription(timeInput,"Enter " + _dateType + "time in military time format as HH:MM");
+		}		
+
+        public function set tabIndexBase(value:int):void {
+        	_tabIndexBase = value;
+        }
+
+        public function get tabIndexBase():int {
+            return _tabIndexBase;
+        }
+        
+        public function set dateType(value:String):void {
+        	_dateType = value;
+        }
+
+        public function get dateType():String {
+            return _dateType;
+        }        
+	]]>
+	
+    </mx:Script>
+    
+    
+    <mx:HBox id="calendarControlsBox" width="100%" height="100%" x="0" y="0" visible="true">
+		<mx:DateField 
+			id="dateChooser"
+			initialize="{AccessibilityTools.accessComponentName(dateChooser,'Date Chooser')}"
+			yearNavigationEnabled="true" 
+			editable="{AccessibilityTools.setToFalseIfAccessToolIsActive()}" 
+			change="{fireEventFromCalendarControls(event)}" 
+			width="110"
+			tabIndex="{_tabIndexBase}"/>
+		<widget:TimeEntry 
+			id="timeChooser"
+			initialize="{AccessibilityTools.accessComponentName(timeChooser,'Time Chooser')}"
+			showSeconds="false" 
+			is24Hour="true" 
+	        backgroundColor="white" 
+	        borderThickness="1" 
+	        borderStyle="solid"
+	        cornerRadius="5" 
+	        keyDown="{fireEventFromCalendarControls(event)}" 
+	        click="{fireEventFromCalendarControls(event)}"
+	        tabIndexBase="{_tabIndexBase + 1}"/>    
+    </mx:HBox>
+
+    <mx:HBox id="textControlsBox" width="100%" height="100%" x="0" y="0">
+		<mx:TextInput id="dateInput"
+		restrict="0123456789/" 
+		toolTip="date (MM/DD/YYYY)"
+		tabIndex="{_tabIndexBase}"
+		focusOut="fireEventFromTextControls(event)"
+		initialize="setAccessibilityPropertiesForDateInput()"
+		width="90"/>
+		<mx:TextInput id="timeInput" 
+		text="00:00"
+		toolTip="time (HH:MM)"
+		restrict="0123456789:"
+		tabIndex="{_tabIndexBase + 1}"
+		change="fireEventFromTextControls(event)"	
+		initialize="setAccessibilityPropertiesForTimeInput()"
+		width="60"/>
+    </mx:HBox>  
+
+	<mx:DateValidator source="{dateChooser}" property="text" required="true" />
+	<mx:DateValidator source="{dateInput}" property="text" required="true" />
+	<mx:StringValidator source="{timeInput}" property="text" required="true" />	
+ 	<mx:DateFormatter id="dateFormatter" formatString="MM/DD/YYYY" />
+ </mx:Canvas>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/GapAccordion.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/GapAccordion.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/GapAccordion.as	(revision 1227)
@@ -0,0 +1,25 @@
+/* GapAccordion.as
+
+In Flex 2 there is a bug that causes the verticalGap to not be included in the
+measurement calculations for the child containers in the accordion.  This
+adds the verticalGap back in.
+
+See:  http://adamflater.blogspot.com/2007/08/accordion-bug.html
+
+ */
+ 
+package gov.va.med.edp.widget
+{
+	import mx.containers.Accordion;
+
+	public class GapAccordion extends Accordion
+	{
+	
+		override protected function measure():void
+		{
+			super.measure();
+			this.measuredHeight += (this.getStyle("verticalGap") * this.numChildren);
+		}
+		
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/InfoDialog.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/InfoDialog.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/InfoDialog.mxml	(revision 1227)
@@ -0,0 +1,124 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:widget="gov.va.med.edp.widget.*" paddingTop="0"
+				borderThicknessTop="0" creationComplete="creationCompleteHandler()" keyDown="disposeOnEscape(event)"
+				minWidth="240" minHeight="140" horizontalAlign="center" verticalAlign="top" layout="vertical"
+				defaultButton="{closeBtn}"
+				xmlns:accessibility="flash.accessibility.*">
+	<mx:Script>
+		<![CDATA[
+			import gov.va.med.edp.util.AccessibilityTools;
+		import gov.va.med.edp.control.ModalDialogEvent;
+		import mx.events.CloseEvent;
+		import mx.accessibility.ComboBoxAccImpl;
+		import mx.controls.ComboBox;
+		import mx.managers.FocusManager;
+		import flash.net.sendToURL;
+		import mx.core.Container;
+		import mx.core.UIComponent;
+		import mx.core.Application;
+		import mx.managers.PopUpManager;
+
+		[Bindable]
+		private var message : String;
+		[Bindable]
+		private var closeButtonLabel : String;
+		[Bindable]
+		private var selfDisposing : Boolean;
+		private var closeListener : Function = null;
+		[Bindable]
+		private var invoker : UIComponent;
+
+		public static function show(message:String,
+									title:String = "Alert",
+									selfDisposing:Boolean = false,
+									invokerComponent:UIComponent = null,
+									closeListener:Function = null,
+									closeButtonLabel:String = "Close") : void {
+			var dialog:InfoDialog = InfoDialog(PopUpManager.createPopUp(Application.application as DisplayObject, InfoDialog, true));
+			if (title != null && title.length > 0)
+				dialog.title = title;
+			dialog.closeButtonLabel = closeButtonLabel;
+			dialog.selfDisposing = selfDisposing;
+			dialog.message = message;
+			dialog.closeListener = closeListener;
+
+			dialog.invoker = invokerComponent;
+
+			//Dispatch the event for get clear background
+			Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.OPEN));
+
+			PopUpManager.centerPopUp(dialog);
+
+		}
+
+		private function creationCompleteHandler() : void {
+			var focusTimer: Timer = new Timer(500, 1);
+			focusTimer.addEventListener(TimerEvent.TIMER, moveFocus);
+			focusTimer.start();
+
+			if (this.selfDisposing) {
+				var disposeTime: Timer = new Timer(800, 1);
+				disposeTime.addEventListener(TimerEvent.TIMER, autoDisposeDialog);
+				disposeTime.start();
+				accessibleMessage.name = this.title;
+			}
+
+
+		}
+
+		private function disposeDialog() : void {
+			if (closeListener != null) {
+				closeListener();
+			}
+
+			//Dispatch the event for remove clear background
+			Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.CLOSE));
+			PopUpManager.removePopUp(this);
+
+			if (invoker != null) {
+				callLater(setInvokerComponentFocus);
+			}
+		}
+
+		private function setInvokerComponentFocus(): void
+		{   // EVENT_OBJECT_SELECTION == 0x8006
+			Accessibility.sendEvent(invoker, 0, 0x8006);
+			invoker.setFocus();
+		}
+
+		private function moveFocus(e: TimerEvent): void
+		{
+			if (AccessibilityTools.isAccessibilityActive()) {
+				messageBox.setFocus();
+			} else {
+				messageBox.editable = false;
+				closeBtn.setFocus();
+			}
+		}
+
+		private function autoDisposeDialog(e: TimerEvent): void
+		{
+			disposeDialog();
+		}
+
+		public function disposeOnEscape(event:KeyboardEvent):void
+		{
+			if (event.keyCode == Keyboard.ESCAPE) {
+				disposeDialog();
+			}
+		} 
+
+		]]>
+    </mx:Script>
+
+	<accessibility:AccessibilityProperties name="Info Dialog {this.title}" id="accessibleMessage"/>
+
+
+	<mx:VBox id="contentBox" width="100%" height="100%">
+		<mx:TextArea restrict="*~_" id="messageBox" text="{message}" borderThickness="0" width="100%" height="100%"
+					 focusEnabled="true" tabIndex="1" accessibilityProperties="{accessibleMessage}"/>
+	</mx:VBox>
+	<mx:ControlBar width="100%" horizontalAlign="right">
+		<mx:Button id="closeBtn" label="{closeButtonLabel}" click="disposeDialog()" tabIndex="5"/>
+	</mx:ControlBar>
+</mx:TitleWindow>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/LinkButton.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/LinkButton.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/LinkButton.as	(revision 1227)
@@ -0,0 +1,49 @@
+package gov.va.med.edp.widget
+{
+	import gov.va.med.edp.skins.LinkButtonTabSkin;
+	
+	import mx.controls.Button;
+	import mx.core.mx_internal;
+	import mx.styles.CSSStyleDeclaration;
+	import mx.styles.StyleManager;
+	
+	use namespace mx_internal;
+	
+	public class LinkButton extends Button
+	{
+
+		private static var classConstructed:Boolean = classConstruct();
+
+		private static function classConstruct():Boolean {
+			// If there is no CSS definition for our style,
+			// then create one and set the default value.
+			
+			if (!StyleManager.getStyleDeclaration("LinkButton"))
+			{
+				var style:CSSStyleDeclaration = new CSSStyleDeclaration();
+				style.defaultFactory = function():void {
+					this.emphasized = false;
+					this.skin = "mx.skins.halo.LinkButtonSkin";
+					this.upSkin = "mx.skins.halo.LinkButtonSkin";
+					this.downSkin = "mx.skins.halo.LinkButtonSkin";
+					this.disabledSkin = "mx.skins.halo.LinkButtonSkin";
+					this.overSkin = "mx.skins.halo.LinkButtonSkin";
+					this.selectedUpSkin = "mx.skins.halo.LinkButtonSkin";
+					this.selectedDownSkin = "mx.skins.halo.LinkButtonSkin";
+					this.selectedOverSkin = "mx.skins.halo.LinkButtonSkin";
+					this.selectedDisabledSkin = "mx.skins.halo.LinkButtonSkin";					
+				}
+				StyleManager.setStyleDeclaration("LinkButton", style, true);
+			}
+			return true;
+		}
+
+// because of the accessibility bug with LinkButtons, Make them Button components like link buttons for common look and feel-->
+	
+		public function LinkButton()
+		{
+			super();
+		}
+
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/LinkButtonTab.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/LinkButtonTab.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/LinkButtonTab.as	(revision 1227)
@@ -0,0 +1,62 @@
+package gov.va.med.edp.widget
+{
+	import gov.va.med.edp.skins.LinkButtonTabSkin;
+	
+	import mx.controls.Button;
+	import mx.core.mx_internal;
+	import mx.styles.CSSStyleDeclaration;
+	import mx.styles.StyleManager;
+	
+	use namespace mx_internal;
+	
+	public class LinkButtonTab extends Button
+	{
+		private static var classConstructed:Boolean = classConstruct();
+	
+		private static function classConstruct():Boolean {
+			// If there is no CSS definition for our style,
+			// then create one and set the default value.
+			
+			if (!StyleManager.getStyleDeclaration("LinkButtonTab"))
+			{
+				var style:CSSStyleDeclaration = new CSSStyleDeclaration();
+				style.defaultFactory = function():void {
+					this.skin = LinkButtonTabSkin;
+					
+					this.upSkin = LinkButtonTabSkin;
+					this.downSkin = LinkButtonTabSkin;
+					this.disabledSkin = LinkButtonTabSkin;
+					this.overSkin = LinkButtonTabSkin;
+					this.selectedUpSkin = LinkButtonTabSkin;
+					this.selectedDownSkin = LinkButtonTabSkin;
+					this.selectedOverSkin = LinkButtonTabSkin;
+					this.selectedDisabledSkin = LinkButtonTabSkin;				
+				}
+				StyleManager.setStyleDeclaration("LinkButtonTab", style, true);
+			}
+			return true;
+		}
+			
+		public function LinkButtonTab()
+		{
+			super();
+			// Tabs are not tab-enabled.
+			// The TabNavigator handles all focus management.
+			focusEnabled = false;
+		}
+
+		override protected function updateDisplayList(unscaledWidth:Number,
+												  unscaledHeight:Number):void
+		{
+			super.updateDisplayList(unscaledWidth, unscaledHeight);
+	
+			if (currentIcon)
+			{
+				currentIcon.scaleX = 1.0;
+				currentIcon.scaleY = 1.0;
+			}
+	
+			viewIcon();
+		}
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/LinkButtonTabBar.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/LinkButtonTabBar.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/LinkButtonTabBar.as	(revision 1227)
@@ -0,0 +1,188 @@
+package gov.va.med.edp.widget
+{
+import flash.display.Graphics;
+
+import mx.containers.BoxDirection;
+import mx.controls.TabBar;
+import mx.core.ClassFactory;
+import mx.core.EdgeMetrics;
+import mx.core.IFlexDisplayObject;
+import mx.core.mx_internal;
+import mx.styles.CSSStyleDeclaration;
+import mx.styles.StyleManager;
+	
+use namespace mx_internal;
+
+/**
+ *  Name of CSS style declaration that specifies the styles to use for the text
+ *  of the selected tab navigation item. 
+ * 
+ *  @default "selectedLinkStyle" 
+ */
+[Style(name="selectedTabTextStyleName", type="String", inherit="no")]
+
+/**
+ *  Name of CSS style declaration that specifies the styles to use for the tab
+ *  navigation items.
+ * 
+ *  @default "LinkButtonTab"
+ */
+[Style(name="tabStyleName", type="String", inherit="no")]
+
+/**
+ *  Background color of the LinkButton control as you press it.
+ * 
+ *  @default 0xCDFFC1
+ */
+[Style(name="selectionColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Separator color used by the default separator skin.
+ * 
+ *  @default 0xC4CCCC
+ */
+[Style(name="separatorColor", type="uint", format="Color", inherit="yes")]
+
+/**
+ *  Separator pixel width, in pixels.
+ * 
+ *  @default 1
+ */
+[Style(name="separatorWidth", type="Number", format="Length", inherit="yes")]
+		
+/**
+ *  Number of pixels between tab navigation items in the horizontal direction.
+ * 
+ *  @default 8
+ */
+[Style(name="horizontalGap", type="Number", format="Length", inherit="no")]
+
+/**
+ *  Number of pixels between tab navigation items in the vertical direction.
+ * 
+ *  @default 8
+ */
+[Style(name="verticalGap", type="Number", format="Length", inherit="no")]
+
+[AccessibilityClass(implementation="gov.va.med.edp.widget.accessibility.LinkButtonTabBarAccImpl")]
+
+[DefaultProperty("dataProvider")]
+
+[MaxChildren(0)]
+	
+public class LinkButtonTabBar extends TabBar
+{
+    mx_internal static var createAccessibilityImplementation:Function;
+
+    private static var classConstructed:Boolean = classConstruct();
+	
+	private static function classConstruct():Boolean {
+		// If there is no CSS definition for our style,
+		// then create one and set the default value.
+		if (!StyleManager.getStyleDeclaration(".selectedLinkStyle"))
+		{
+			var linkStyle:CSSStyleDeclaration = new CSSStyleDeclaration();
+			linkStyle.defaultFactory = function():void {
+				this.color = 0xAAB3B3;
+				this.textRollOverColor = 0xAAB3B3;
+			}
+			StyleManager.setStyleDeclaration(".selectedLinkStyle", linkStyle, true);
+		}
+		
+		if (!StyleManager.getStyleDeclaration("LinkButtonTabBar"))
+		{
+			var style:CSSStyleDeclaration = new CSSStyleDeclaration();
+			style.defaultFactory = function():void {
+				this.tabStyleName = "LinkButtonTab";
+				
+				this.selectedTabTextStyleName = "selectedLinkStyle";
+				
+				this.separatorColor = 0xC4CCCC;
+				this.separatorWidth = 1;
+				this.selectionColor = 0x0000FF;
+				
+				this.horizontalGap = 8;
+				this.verticalGap = 8;
+			}
+			StyleManager.setStyleDeclaration("LinkButtonTabBar", style, true);
+		}
+		return true;
+	}
+	
+    public function LinkButtonTabBar()
+    {
+        super();
+        navItemFactory = new ClassFactory(LinkButtonTab);
+    }
+
+    override protected function initializeAccessibility():void
+    {
+        if (LinkButtonTabBar.createAccessibilityImplementation != null)
+            LinkButtonTabBar.createAccessibilityImplementation(this);
+    }
+
+    override protected function updateDisplayList(unscaledWidth:Number,
+                                                  unscaledHeight:Number):void
+    {
+        // The super method will lay out the LinkButtons.
+        super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+		var separatorThickness:Number = getStyle("separatorWidth");
+		if (separatorThickness == 0 || separatorThickness == 0) return;
+		
+		var separatorColor:uint = getStyle("separatorColor");
+		
+		var vm:EdgeMetrics = viewMetricsAndPadding;
+
+        var horizontalGap:Number = getStyle("horizontalGap");
+        var verticalGap:Number = getStyle("verticalGap");
+
+        var barHeight:Number = unscaledHeight - (vm.top + vm.bottom);
+        var barWidth:Number = unscaledWidth - (vm.left + vm.right);
+		
+		var g:Graphics = graphics;
+		g.clear();
+		
+		g.lineStyle(separatorThickness, separatorColor);
+		
+		var isVertical:Boolean = direction == BoxDirection.VERTICAL;
+		
+		var x:Number;
+        var y:Number;
+        var h:Number = isVertical ? verticalGap : barHeight;
+        var w:Number = isVertical ? barWidth : horizontalGap;
+		
+        // paint the separators.
+        var n:int = numChildren - 1;
+        for (var i:int = 0; i < n; i++)
+        {
+            var child:IFlexDisplayObject = IFlexDisplayObject(getChildAt(i));
+            
+            if (isVertical)
+			{
+            	x = child.x;
+            	y = child.y + child.height;
+            	g.moveTo(x + 4, y + h / 2);
+				g.lineTo(x + w - 4, y + h / 2);
+            } else {
+            	x = child.x + child.width;
+            	y = child.y;
+            	g.moveTo(x + w / 2, y + 6);
+				g.lineTo(x + w / 2, y + h - 5);
+            }
+        }
+    }
+
+    override public function styleChanged(styleProp:String):void {
+        super.styleChanged(styleProp);
+
+        // Check to see if style changed.
+        if (styleProp == "separatorColor" || styleProp == "separatorWidth" || styleProp == "selectionColor")
+        {
+            invalidateDisplayList();
+            return;
+        }
+    }
+            
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/OkCancelDialog.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/OkCancelDialog.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/OkCancelDialog.mxml	(revision 1227)
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:widget="gov.va.med.edp.widget.*" paddingTop="0" 
+	borderThicknessTop="0" creationComplete="creationCompleteHandler()" maxHeight="500" maxWidth="700"
+    minWidth="280" minHeight="180" horizontalAlign="center" verticalAlign="top" layout="vertical" 
+    xmlns:accessibility="flash.accessibility.*">
+    <mx:Script>
+		<![CDATA[
+			import gov.va.med.edp.util.AccessibilityTools;
+			import gov.va.med.edp.control.ModalDialogEvent;
+		import mx.events.CloseEvent;
+		import mx.core.UIComponent;
+		import mx.core.Application;
+		import mx.managers.PopUpManager;
+
+		[Bindable]
+		private var message : String;	
+		private var invoker : UIComponent;		
+		
+        private var closeListener : Function = null;
+
+	    public static const OK:uint = 0x0004;
+	    public static const CANCEL:uint= 0x0008;
+
+
+		public static function show(message:String,
+                                    title:String = "Alert",
+                                    closeListener:Function = null,  invokerComponent:UIComponent = null) : void {
+			var dialog:OkCancelDialog = OkCancelDialog(PopUpManager.createPopUp(Application.application as DisplayObject, OkCancelDialog, true));
+            if (title != null && title.length > 0)
+                dialog.title = title;
+			dialog.message = message;	
+			if (closeListener != null)
+			dialog.addEventListener(CloseEvent.CLOSE, closeListener);	
+			
+			dialog.invoker = invokerComponent;	
+		    //Dispatch the event for get clear background
+            Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.OPEN));
+ 	        PopUpManager.centerPopUp(dialog);
+		}
+
+        private function creationCompleteHandler() : void {
+			var focusTimer: Timer = new Timer(500, 1);
+			focusTimer.addEventListener(TimerEvent.TIMER, moveFocus);
+            focusTimer.start();
+        }
+
+        private function okButtonHandler() : void {
+            dispatchEvent(new CloseEvent(CloseEvent.CLOSE,false,false,OK));
+			removePopUp();
+        }
+        
+        private function cancelButtonHandler() : void {
+            dispatchEvent(new CloseEvent(CloseEvent.CLOSE,false,false,CANCEL));
+			removePopUp();
+        }        
+        
+        private function removePopUp(): void
+	    {
+          //Dispatch the event for remove clear background
+          Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.CLOSE));	    	
+	      PopUpManager.removePopUp(this);
+	      
+	      if (invoker != null){
+		      callLater(setUIComponentFocus);
+	      }
+	    }        
+ 
+        private function setUIComponentFocus(): void
+	    {
+	    	invoker.setFocus();	
+	    }
+        
+        private function moveFocus(e: TimerEvent): void
+	    {
+	         if (AccessibilityTools.isAccessibilityActive()) {
+	         	messageBox.setFocus();
+	         } else {
+	         	messageBox.editable = false;
+	         	cancelBtn.setFocus();
+	         }
+	    }
+
+
+		]]>
+    </mx:Script>   
+    
+    <accessibility:AccessibilityProperties name="Info Dialog {this.title}"  id="accessibleMessage"/>
+   
+
+    <mx:VBox id="contentBox" width="100%" height="100%">
+		<mx:TextArea restrict="*~_" id="messageBox" text="{message}" width="100%" height="100%" borderThickness="0" tabIndex="1" accessibilityProperties="{accessibleMessage}"/>    	
+    </mx:VBox>
+	<mx:ControlBar width="100%" horizontalAlign="right">
+		<mx:Spacer width="100%"/>
+    	<mx:Button label="OK" click="okButtonHandler()" tabIndex="2"/>
+    	<mx:Button label="Cancel" id="cancelBtn" click="cancelButtonHandler()" tabIndex="3"/>
+    </mx:ControlBar>
+</mx:TitleWindow>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/OpenAlwaysPopUpMenuButton.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/OpenAlwaysPopUpMenuButton.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/OpenAlwaysPopUpMenuButton.as	(revision 1227)
@@ -0,0 +1,31 @@
+package gov.va.med.edp.widget {
+import mx.controls.PopUpButton;
+import flash.events.MouseEvent;
+import mx.controls.PopUpMenuButton;
+import mx.core.mx_internal;
+
+use namespace mx_internal;
+
+    /**
+     * This class contains a workaround for the default behavior of PopUpMenuButton which is to fire an itemClick event
+     * when a click event occurs on the main button.  PopUpMenuButton doesn't respect preventDefault on the click event
+     * object, so we override default behavior by setting openAlways to true and only firing itemClicks on normal menu
+     * selections by making parent class think that all clicks are above the arrow button.  
+     */
+public class OpenAlwaysPopUpMenuButton extends PopUpMenuButton {
+    public function OpenAlwaysPopUpMenuButton() {
+        super();
+        super.openAlways = true;
+
+    }
+
+    public override function set openAlways(b:Boolean):void {
+        // NOOP
+    }
+
+    mx_internal override function overArrowButton(event:MouseEvent):Boolean
+    {
+        return true;
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/PatientCellRenderer.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/PatientCellRenderer.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/PatientCellRenderer.mxml	(revision 1227)
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:HBox
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	implements="mx.controls.listClasses.IListItemRenderer, mx.controls.listClasses.IDropInListItemRenderer"
+	horizontalScrollPolicy="off" verticalScrollPolicy="off">
+	
+	<mx:Script>
+		<![CDATA[
+			import mx.controls.listClasses.BaseListData;
+			import gov.va.med.edp.model.TrackingModelLocator;
+		
+		[Bindable]
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+		
+	    // Internal variable for the property value.
+	    private var _listData: BaseListData;
+
+    	[Bindable("dataChange")]  // Make the listData property bindable.
+	    public function get listData():BaseListData {return _listData;}
+	    public function set listData(value:BaseListData):void {_listData = value;}
+	    
+		override public function set data(value:Object):void
+		{
+			super.data = value;
+			if (value != null)
+			{
+				setStyle("color", model.boardSpec.cellColor(_listData["dataField"], value).text);
+				if (model.appName == TrackingModelLocator.APP_NAME_BIGBOARD) {
+					nmLbl.setStyle("fontSize", model.boardSpec.displayBoardProperties.squishFontSize);					
+				}
+				nmImg.visible = (value.@similar == "1");
+				nmLbl.text = (_listData["dataField"] == "@last4") ? value.@last4 : value.@ptNm;
+			}
+		}
+		
+		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+		{
+			super.updateDisplayList(unscaledWidth, unscaledHeight);
+			
+			if (data != null) {
+				var backColor: uint = model.boardSpec.cellColor(_listData["dataField"], data).back;
+				var g:Graphics = graphics;
+				g.clear();
+				g.beginFill(backColor);
+				//g.drawRect(0, -2, unscaledWidth, unscaledHeight+4);
+				g.drawRect(0, 0, unscaledWidth, unscaledHeight);
+				g.endFill();				
+			}
+		}
+		
+		]]>
+	</mx:Script>
+	<mx:Image
+		id="nmImg"
+		left="2" top="0"
+		source="@Embed(source='kuser.png')"
+		toolTip="{nmLbl.text + ' is similar to another patient name.'}" />
+	<mx:Label
+		id="nmLbl"
+		left="18" verticalCenter="0"/>
+</mx:HBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/PatientNameRenderer.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/PatientNameRenderer.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/PatientNameRenderer.mxml	(revision 1227)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:HBox
+	xmlns:mx="http://www.adobe.com/2006/mxml"
+	horizontalScrollPolicy="off" verticalScrollPolicy="off">
+
+	<mx:Script>
+		<![CDATA[
+			import mx.controls.listClasses.AdvancedListBase;
+		import mx.controls.listClasses.ListBase;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		
+		private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		override public function set data(value:Object):void
+		{
+			super.data = value;
+			
+			nmImg.visible = false;
+			nmLbl.text = "";
+			if (value != null)
+			{
+				nmImg.visible = value.similar;
+				nmLbl.text = value.name;
+			}
+		}
+		
+		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+		{
+		    super.updateDisplayList(unscaledWidth, unscaledHeight);
+				 
+			if(owner is mx.controls.DataGrid && mx.controls.DataGrid(owner).isItemSelected(data)) { //figure out if this itemRenderer is selected
+	            setStyle('color', 0xFFFFFF);  // FIXME: anyway to discover this value from the theme?
+			} else { //otherwise, return the label to its regular state
+	            setStyle('color', 0x000000); // FIXME: anyway to discover this value from the theme?
+			}
+		}
+		]]>
+	</mx:Script>
+	<mx:Image
+		id="nmImg"
+		left="2" top="0"
+		toolTip="{nmLbl.text + ' is similar to another patient name.'}"
+		source="@Embed(source='kuser.png')" />
+	<mx:Label
+		id="nmLbl"
+		left="18" verticalCenter="0" />
+</mx:HBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/RoomCategoryRenderer.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/RoomCategoryRenderer.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/RoomCategoryRenderer.mxml	(revision 1227)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Label
+	xmlns:mx="http://www.adobe.com/2006/mxml">
+
+	<mx:Script>
+		<![CDATA[
+            import mx.controls.listClasses.ListBase;
+            import mx.controls.dataGridClasses.DataGridListData;
+			import gov.va.med.edp.model.TrackingModelLocator;
+			import gov.va.med.edp.vo.LookupVO;
+			import gov.va.med.edp.util.Vista;
+
+			private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+			private var _data: Object;
+		
+			override public function set data(value: Object): void {
+				_data = value;
+				if (value == null) return;
+
+				var category: int = value[DataGridListData(listData).dataField];
+				var i: int = Vista.locateIndex(model.config.roomCategoryList, category);
+				if (i > -1) {
+					this.text = LookupVO(model.config.roomCategoryList[i]).abbr;
+				} else {
+					this.text = "";
+				}
+			}
+			
+			override public function get data(): Object {
+				return _data;
+			}
+
+            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+            {
+                super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+                if(owner is mx.controls.DataGrid && mx.controls.DataGrid(owner).isItemSelected(data)) { //figure out if this itemRenderer is selected
+                    setStyle('color', 0xFFFFFF);  // FIXME: anyway to discover this value from the theme?
+                } else { //otherwise, return the label to its regular state
+                    setStyle('color', 0x000000); // FIXME: anyway to discover this value from the theme?
+                }
+            }
+		]]>
+    </mx:Script>
+
+</mx:Label>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/Spinner.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/Spinner.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/Spinner.as	(revision 1227)
@@ -0,0 +1,475 @@
+package gov.va.med.edp.widget {
+
+	import flash.events.TimerEvent;
+
+	import flash.utils.Timer;
+
+	
+
+	import mx.core.UIComponent;
+
+	import mx.events.FlexEvent;
+
+	import mx.styles.CSSStyleDeclaration;
+
+	import mx.styles.StyleManager;
+
+	
+
+	
+
+	[Style(name="tickColor",type="uint",format="Color",inherit="no")]
+
+	public class Spinner extends UIComponent {
+
+		private static var STYLE_TICK_COLOR:String = "tickColor";
+
+		private var tickColorChanged:Boolean;
+
+		
+
+        private static var classConstructed:Boolean = classConstruct();
+
+        
+
+         // Make sure we create the ticks the first time updateDisplayList is called
+
+        private var creation:Boolean = true;
+
+        
+
+        
+
+		private var fadeTimer:Timer;
+
+		private var _isPlaying:Boolean;
+
+		
+
+		private var _numTicks:int = 12;
+
+		private var numTicksChanged:Boolean;
+
+		
+
+		private var _size:Number = 30;
+
+		private var sizeChanged:Boolean;
+
+		
+
+		private var _tickWidth:Number = 3;
+
+		private var tickWidthChanged:Boolean;
+
+		
+
+		private var _speed:int = 1000;
+
+		[Bindable] public var fadeSpeed:int = 600;
+
+		
+
+		public var autoPlay:Boolean = true;
+
+		
+
+		
+
+		public function Spinner() {
+
+			super();
+
+			
+
+			addEventListener(FlexEvent.CREATION_COMPLETE, handleCreationComplete);
+
+		}
+
+		
+
+		
+
+		private function handleCreationComplete(e:FlexEvent):void {
+
+			removeEventListener(FlexEvent.CREATION_COMPLETE, handleCreationComplete);
+
+			if (autoPlay) {
+
+				play();
+
+			}
+
+		}
+
+		
+
+		
+
+		/**
+
+		 * Set the height and width based on the size of the spinner. This should be more robust, but oh well.
+
+		 */
+
+		override protected function measure():void {
+
+			super.measure();
+
+			
+
+			width = _size;
+
+			height = _size;
+
+		}
+
+		
+
+		
+
+		/**
+
+		 * Override the updateDisplayList method
+
+		 */
+
+		 override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
+
+		 	if (tickColorChanged || numTicksChanged || sizeChanged || tickWidthChanged || creation) {
+
+		 		creation = false;
+
+		 		// Find out whether it's playing so we can restart it later if we need to
+
+				var wasPlaying:Boolean = _isPlaying;
+
+				
+
+				// stop the spinning
+
+				stop();
+
+				
+
+				// Remove all children
+
+				for (var i:int = numChildren - 1; i >= 0; i--) {
+
+					removeChildAt(i);
+
+				}
+
+				
+
+				// Re-create the children
+
+				var radius:Number = size / 2;
+
+				var angle:Number = 2 * Math.PI / _numTicks; // The angle between each tick
+
+				var tickWidth:Number = (_tickWidth != -1) ? _tickWidth : size / 10;
+
+				var tickColor:uint = getStyle(STYLE_TICK_COLOR);
+
+				
+
+				var currentAngle:Number = 0;
+
+				for (var j:int = 0; j < _numTicks; j++) {
+
+					
+
+					var xStart:Number = radius + Math.sin(currentAngle) * ((_numTicks + 2) * tickWidth / 2 / Math.PI);
+
+					var yStart:Number = radius - Math.cos(currentAngle) * ((_numTicks + 2) * tickWidth / 2 / Math.PI);
+
+					var xEnd:Number = radius + Math.sin(currentAngle) * (radius - tickWidth);
+
+					var yEnd:Number = radius - Math.cos(currentAngle) * (radius - tickWidth);
+
+					
+
+					var t:Tick = new Tick(xStart, yStart, xEnd, yEnd, tickWidth, tickColor);
+
+						t.alpha = 0.1;
+
+						
+
+					this.addChild(t);
+
+					
+
+					currentAngle += angle;
+
+				}
+
+				
+
+				// Start the spinning again if it was playing when this function was called.
+
+				if (wasPlaying) {
+
+					play();
+
+				}
+
+				
+
+				tickColorChanged = false;
+
+				numTicksChanged = false;
+
+				sizeChanged = false;
+
+				tickWidthChanged = false;
+
+			}
+
+		}
+
+		 
+
+		 
+
+		private static function classConstruct():Boolean {
+
+			if (!StyleManager.getStyleDeclaration("Spinner")) {
+
+				// If there is no CSS definition for StyledRectangle, 
+
+				// then create one and set the default value.
+
+				var newStyleDeclaration:CSSStyleDeclaration = new CSSStyleDeclaration();
+
+				newStyleDeclaration.setStyle(STYLE_TICK_COLOR, 0x000000);
+
+				StyleManager.setStyleDeclaration("Spinner", newStyleDeclaration, true);
+
+			}
+
+			return true;
+
+		}
+
+		
+
+		override public function styleChanged(styleProp:String):void {
+
+			if (styleProp == STYLE_TICK_COLOR) {
+
+				tickColorChanged = true;
+
+				invalidateDisplayList();
+
+			}
+
+		}
+
+
+
+		
+
+		/**
+
+		 * Begin the circular fading of the ticks.
+
+		 */
+
+		public function play():void {
+
+			if (! _isPlaying) {
+
+				fadeTimer = new Timer(speed / _numTicks, 0);
+
+				// Anonymous functions are especially useful as simple event handlers
+
+				fadeTimer.addEventListener(TimerEvent.TIMER, function (e:TimerEvent):void {
+
+					var tickNum:int = int(fadeTimer.currentCount % _numTicks);
+
+					
+
+					if (numChildren > tickNum) {
+
+						var tick:Tick = getChildAt(tickNum) as Tick;
+
+							tick.fade(fadeSpeed != 1 ? fadeSpeed : speed * 6 / 10);
+
+					}
+
+				});
+
+				fadeTimer.start();
+
+				_isPlaying = true;
+
+			}
+
+		}
+
+		
+
+		/**
+
+		 * Stop the spinning.
+
+		 */
+
+		public function stop():void {
+
+			if (fadeTimer != null && fadeTimer.running) {
+
+				_isPlaying = false;
+
+				fadeTimer.stop();
+
+			}
+
+		}
+
+		
+
+		/**
+
+		 * The overall diameter of the spinner; also the height and width.
+
+		 */
+
+		[Bindable]
+
+		public function set size(value:Number):void {
+
+			if (value != _size) {
+
+				_size = value;
+
+				sizeChanged = true;
+
+				invalidateDisplayList();
+
+				invalidateSize();
+
+			}
+
+		}
+
+		
+
+		public function get size():Number {
+
+			return _size;
+
+		}
+
+		
+
+		/**
+
+		 * The number of 'spokes' on the spinner.
+
+		 */
+
+		[Bindable]
+
+		public function set numTicks(value:int):void {
+
+			if (value != _numTicks) {
+
+				_numTicks = value;
+
+				numTicksChanged = true;
+
+				invalidateDisplayList();
+
+			}
+
+		}
+
+		
+
+		public function get numTicks():int {
+
+			return _numTicks;
+
+		}
+
+		
+
+		/**
+
+		 * The width of the 'spokes' on the spinner.
+
+		 */
+
+		[Bindable]
+
+		public function set tickWidth(value:int):void {
+
+			if (value != _tickWidth) {
+
+				_tickWidth = value;
+
+				tickWidthChanged = true;
+
+				invalidateDisplayList();
+
+			}
+
+		}
+
+		
+
+		public function get tickWidth():int {
+
+			return _tickWidth;
+
+		}
+
+		
+
+		/**
+
+		 * The duration (in milliseconds) that it takes for the spinner to make one revolution.
+
+		 */
+
+		[Bindable]
+
+		public function set speed(value:int):void {
+
+			if (value != _speed) {
+
+				_speed = value;
+
+				fadeTimer.stop();
+
+				fadeTimer.delay = value / _numTicks;
+
+				fadeTimer.start();
+
+			}
+
+		}
+
+		
+
+		public function get speed():int {
+
+			return _speed;
+
+		}
+
+		
+
+		
+
+		public function get isPlaying():Boolean {
+
+			return _isPlaying;
+
+		}
+
+	}
+
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/StatusRenderer.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/StatusRenderer.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/StatusRenderer.mxml	(revision 1227)
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Label
+	xmlns:mx="http://www.adobe.com/2006/mxml">
+
+	<mx:Script>
+		<![CDATA[
+            import mx.controls.listClasses.ListBase;
+            import mx.controls.dataGridClasses.DataGridListData;
+			import gov.va.med.edp.model.TrackingModelLocator;
+			import gov.va.med.edp.vo.LookupVO;
+			import gov.va.med.edp.util.Vista;
+
+			private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+			private var _data: Object;
+		
+			override public function set data(value: Object): void {
+				_data = value;
+				if (value == null) return;
+
+				var status: Number = value[DataGridListData(listData).dataField];
+				var i: int = Vista.locateIndex(model.config.statusList, status);
+				if (i > -1) {
+					this.text = LookupVO(model.config.statusList[i]).label;
+				} else {
+					this.text = "";
+				}
+			}
+			
+			override public function get data(): Object {
+				return _data;
+			}
+
+            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+            {
+                super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+                if(owner is mx.controls.DataGrid && mx.controls.DataGrid(owner).isItemSelected(data)) { //figure out if this itemRenderer is selected
+                    setStyle('color', 0xFFFFFF);  // FIXME: anyway to discover this value from the theme?
+                } else { //otherwise, return the label to its regular state
+                    setStyle('color', 0x000000); // FIXME: anyway to discover this value from the theme?
+                }
+            }
+		]]>
+    </mx:Script>
+
+</mx:Label>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/Tick.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/Tick.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/Tick.as	(revision 1227)
@@ -0,0 +1,47 @@
+package gov.va.med.edp.widget {
+
+	import flash.display.Sprite;
+
+	
+
+	import mx.effects.Fade;
+
+	
+
+	public class Tick extends Sprite {
+
+		private var tickFade:Fade = new Fade(this);
+
+		
+
+			
+
+		public function Tick(fromX:Number, fromY:Number, toX:Number, toY:Number, tickWidth:int, tickColor:uint) {
+
+			this.graphics.lineStyle(tickWidth, tickColor, 1.0, false, "normal", "rounded");
+
+			this.graphics.moveTo(fromX, fromY);
+
+			this.graphics.lineTo(toX, toY);
+
+		}
+
+		
+
+			
+
+		public function fade(duration:Number):void {
+
+			tickFade.alphaFrom = 1.0;
+
+			tickFade.alphaTo = 0.1;
+
+			tickFade.duration = duration;
+
+			tickFade.play();
+
+		}
+
+	}
+
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/TimeEntry.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/TimeEntry.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/TimeEntry.mxml	(revision 1227)
@@ -0,0 +1,478 @@
+<!--
+Copyright (c) 2007 Stretch Media Group
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
+
+Features:
+
+- Provides time entry for hours, minutes and seconds in 24 and 12 hour format  
+- Resizable to fit various text sizes, and also allows for styling of stepper buttons, border, and background
+- Can use numeric stepper to increase/decrease hour, minute, second, am/pm entries
+- Can use keyboard up/down, left/right to increase/decrease hour, minute, second, am/pm entries
+- Hour, minute, second, am/pm entries wrap if reaching max/min values
+- Can tab through fields
+- Can enable/disable component
+- Easily provide hour/minute/text values for preset/updatable time
+
+Properties: 
+
+hour : the numeric value of the selected hour (if provided, overrides the defaultHour value)
+minute : the numeric value of the selected minute (if provided, overrides the defaultMinute value)
+second : the numeric value of the selected second (if provided, overrides the defaultSecond value)
+am_pm : the string value of the selected am/pm entry ("am", "pm")
+defaultHour : the hour which you want the selector to default to (is overriden if hour argument is provided)
+defaultMinute : the minute which you want the selector to default to (is overriden if minute argument is provided)
+defaultSecond : the second which you want the selector to default to (is overriden if second argument is provided)
+showSeconds : show seconds entry in selector
+is24Hour : if false hour selector allows range of 1-12 and am/pm entry is enabled
+		   if true hour selector allows range of 0-23 and am/pm entry is disabled
+
+Revisions:
+
+* 2008.3.3 - added accessibility functionality for hours, minutes, and seconds so that it can be read by JAWS reader.
+
+-->
+
+<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"  
+           creationComplete="createComplete();" tabChildren="true">
+
+    <mx:NumberValidator id="hourValidator" source="{hourText}" exceedsMaxError="" lowerThanMinError="" integerError=""
+                        property="text" maxValue="{maxHour}" minValue="{minHour}"
+                        trigger="{hourText}" triggerEvent="change" invalid="hourText.text = String(maxHour); hourText.errorString = '';" />
+    <mx:NumberValidator id="minuteValidator" source="{minuteText}" exceedsMaxError="" lowerThanMinError="" integerError=""
+                        property="text" maxValue="59" minValue="0" 
+                        trigger="{minuteText}" triggerEvent="change" invalid="minuteText.text = '59'" allowNegative="false"  />
+    <mx:NumberValidator id="secondValidator" source="{secondText}" exceedsMaxError="" lowerThanMinError="" integerError=""
+                        property="text" maxValue="59" minValue="0" 
+                        trigger="{secondText}" triggerEvent="change" invalid="secondText.text = '59'" allowNegative="false"  />
+    
+    <mx:NumericStepper id="timeStepper" x="0" y="0" height="80%" width="100" fontSize="0" textAlign="right" paddingLeft="100"
+                       focusAlpha="0" borderThickness="0" borderStyle="none" maximum="99" minimum="-99"
+                       change="changeStepValue(event)" backgroundAlpha="0" color="{this.getStyle('backgroundColor')}"
+                       click="_focusArea.setFocus();" focusEnabled="false"/>
+       
+    <mx:HBox id="timeBox" 
+    	     horizontalGap="0" 
+    	     verticalAlign="center" 
+    	     height="100%"
+             horizontalScrollPolicy="off"
+             verticalScrollPolicy="off" 
+             backgroundAlpha="0" 
+             creationComplete="setTimeStepperPosition();">
+            
+            
+        <mx:TextInput id="hourText" 
+        	          initialize="{AccessibilityTools.accessComponentName(hourText,'Enter Hours')}" 
+        	          height="100%" 
+        	          borderThickness="0" 
+        	          borderStyle="none" 
+        	          backgroundAlpha="0" 
+                      textAlign="center" 
+                      maxChars="2"
+                      editable="false"
+                      text="{formatText(String(hour), 'hourText')}" 
+                      keyDown="keyHandler(event)" 
+                      mouseUp="setTextFocus(event)" 
+                      mouseDown="setTextFocus(event)" 
+                      focusOut="fixText(event)" 
+                      tabIndex="{_tabIndexBase}"
+                      focusIn="setTextFocus(event)" 
+                      change="setValues(event)"
+                      focusAlpha="0" 
+                      errorString=""/>
+                          
+                      <mx:Spacer width="-8" /><mx:Label text=":" /><mx:Spacer width="-16" />
+            
+        <mx:TextInput id="minuteText" 
+        	          initialize="{AccessibilityTools.accessComponentName(minuteText,'Enter Minutes')}"
+        	          height="100%" 
+        	          borderThickness="0" 
+        	          borderStyle="none" 
+        	          backgroundAlpha="0" 
+                      textAlign="center" 
+                      maxChars="2" 
+                      editable="false"
+                      text="{formatText(String(minute), 'minuteText')}" 
+                      keyDown="keyHandler(event)" 
+                      mouseUp="setTextFocus(event)" 
+                      mouseDown="setTextFocus(event)"
+                      focusOut="fixText(event)" 
+                      focusIn="setTextFocus(event)" 
+                      tabIndex="{_tabIndexBase + 1}"
+                      change="setValues(event)"
+                      focusAlpha="0"   />
+            
+                      <mx:Spacer width="-8" includeInLayout="{showSeconds}" visible="{showSeconds}" />
+                      <mx:Label text=":" includeInLayout="{showSeconds}" visible="{showSeconds}" />
+                      <mx:Spacer width="-16" includeInLayout="{showSeconds}" visible="{showSeconds}" />
+            
+        <mx:TextInput id="secondText" 
+        	          initialize="{AccessibilityTools.accessComponentName(secondText,'Enter Seconds')}"
+        	          height="100%" 
+        	          borderThickness="0"
+        	          borderStyle="none" 
+        	          backgroundAlpha="0" 
+                      textAlign="center" 
+                      maxChars="2"
+                      text="{formatText(String(second), 'secondText')}"
+                      keyDown="keyHandler(event)" 
+                      mouseUp="setTextFocus(event)" 
+                      mouseDown="setTextFocus(event)" 
+                      focusOut="fixText(event)" 
+                      focusIn="setTextFocus(event)" 
+                      change="setValues(event)"
+                      focusAlpha="0" 
+                      includeInLayout="{showSeconds}" 
+                      visible="{showSeconds}" />
+        
+                      <mx:Spacer width="-8" includeInLayout="{!is24Hour}" visible="{!is24Hour}" />
+            
+        
+        <mx:TextInput id="amPMText" 
+        	          height="100%" 
+        	          borderThickness="0" 
+        	          borderStyle="none" 
+        	          backgroundAlpha="0" 
+                      textAlign="center" 
+                      maxChars="2"
+                      text="{this.am_pm}" 
+                      keyDown="amPMKeyHandler(event)" 
+                      mouseUp="setTextFocus(event)" 
+                      mouseDown="setTextFocus(event)" 
+                      focusAlpha="0" 
+                      focusIn="setTextFocus(event)" 
+                      editable="false" 
+                      includeInLayout="{!is24Hour}" 
+                      visible="{!is24Hour}"  />
+                      
+                      <mx:Spacer width="-5" includeInLayout="{!is24Hour}" visible="{!is24Hour}" />
+                        
+    </mx:HBox> 
+    
+       
+       <mx:Script>
+           <![CDATA[
+           	import mx.events.DateChooserEvent;
+            import mx.controls.NumericStepper;
+            import mx.events.NumericStepperEvent;
+            import mx.core.UITextField;
+            import flash.events.MouseEvent;
+            import gov.va.med.edp.util.AccessibilityTools;
+            
+            
+            private var _timeValue:Object;
+            private var _focusArea:TextInput;
+            private var _focusText:TextField;
+            private var _currentStepValue:Number;
+            [Bindable] private var maxHour:Number;
+            [Bindable] private var minHour:Number;
+           
+           
+            [Bindable] public var hour:Number = 0;
+			[Bindable] public var minute:Number = 0;
+            [Bindable] public var second:Number = 0;
+            [Bindable] public var am_pm:String = 'am';
+            [Bindable] public var showSeconds:Boolean;
+            [Bindable] public var is24Hour:Boolean;
+            public var defaultHour:Number;
+            public var defaultMinute:Number = 0;
+            public var defaultSecond:Number = 0;
+            
+/*             [Bindable]
+            public function get totalSeconds(): int
+            {
+            	return ((this.hour * 3600) + (this.minute * 60) + this.second);
+            }
+            
+            public function set totalSeconds(value: int): void
+            {
+            	this.hour = int(value / 3600);
+            	this.minute = int((value % 3600) / 60);
+            	this.second = int(value % 60);
+            } */
+            
+			[Bindable]
+			private var _tabIndexBase:int = -1;            
+
+	        public function set tabIndexBase(value:int):void {
+	        	_tabIndexBase = value;
+	        }
+	
+	        public function get tabIndexBase():int {
+	            return _tabIndexBase;
+	        }
+
+            public function get timeValue():Object
+            {
+            	var tmpTime:Object = new Object();
+            	tmpTime.hour = this.hour;
+            	tmpTime.minute = this.minute;
+            	tmpTime.second = this.second;
+            	return tmpTime;
+            }
+            
+            public function set timeValue(value:Object):void
+            {
+            	this._timeValue = value;
+            }
+            
+            override public function setFocus():void
+            {
+            	_focusArea.setFocus();
+            }
+            
+            private function createComplete():void
+            {
+            	this.focusEnabled = true;
+                this.tabEnabled = true;
+                this.mouseFocusEnabled = true;
+                
+                if(!this.hour) 
+                {
+                	String(this.hour);
+                    this.hour = Number(hourText.text);
+                }
+                else
+                {
+                	if(defaultHour)
+                	{
+                		hourText.text = String(defaultHour);
+                	}
+                	else
+                	{
+                		(is24Hour) ? hourText.text = "12" : hourText.text = "1";
+                	}  
+                }
+                if(!this.minute)
+                {
+                    minuteText.text = (defaultMinute < 10) ? "0" + String(defaultMinute) : String(defaultMinute);
+                    this.minute = Number(minuteText.text);
+                }
+                if(!this.second)
+                {
+                    secondText.text = (defaultSecond < 10) ? "0" + String(defaultSecond) : String(defaultSecond);
+                    this.second = Number(secondText.text);
+                }
+                
+                if(!this.am_pm)
+                {
+                    this.am_pm = (is24Hour) ? 'pm' : "am";;
+                }
+                
+                (is24Hour) ? maxHour = 23 : maxHour = 12;
+                (is24Hour) ? minHour = 0 : minHour = 1;
+                
+                if(!_focusArea) 
+                {
+                    _focusArea = hourText;
+                    _currentStepValue = Number(_focusArea.text);
+                    timeStepper.value = _currentStepValue;
+                }    
+                
+            }
+            private function setTextFocus(event:Event):void
+            {
+                _focusArea = event.currentTarget as TextInput;
+                _focusText = event.target as TextField;
+                TextField(event.target).setSelection(0, 2);
+                if(event.currentTarget != amPMText)
+                {
+                    _currentStepValue = Number(_focusArea.text);
+                    timeStepper.value = _currentStepValue;
+                }
+                setStepValue();
+                
+            }
+            
+            private function setTimeStepperPosition():void
+            {
+                if(timeBox) timeStepper.x = (!is24Hour) ? (timeBox.width - (timeStepper.width * 0.72)) : timeBox.width - (timeStepper.width * 0.8);
+            }
+            
+            private function setStepValue():void
+            {
+                if(_focusArea == amPMText)
+                {
+                    timeStepper.minimum = -99;
+                    timeStepper.maximum = 99;
+                }
+            }
+            
+            private function changeStepValue(event:Event):void
+            {
+                if(_focusArea != amPMText)
+                {
+                    if(_focusArea == hourText)
+                    {
+                        var tmpMinValue:Number = (is24Hour) ? 0 : 1;
+                        if(NumericStepper(event.target).value > maxHour)
+                        {
+                            NumericStepper(event.target).value = (is24Hour) ? 0 : 1;
+                        }
+                        else if(NumericStepper(event.target).value < tmpMinValue)
+                        {
+                            NumericStepper(event.target).value = (is24Hour) ? 23 : 12;
+                        }
+                    }
+                    if(_focusArea == minuteText || _focusArea == secondText)
+                    {
+                        if(NumericStepper(event.target).value > 59)
+                        {
+                            NumericStepper(event.target).value = 0;
+                        }
+                        else if(NumericStepper(event.target).value < 0)
+                        {
+                            NumericStepper(event.target).value = 59;
+                        }
+                    }
+                    
+                    _focusArea.setFocus();
+                    if(_focusArea == hourText) this.hour = NumericStepper(event.target).value;
+                    if(_focusArea == minuteText) this.minute = NumericStepper(event.target).value;
+                    if(_focusArea == secondText) this.second = NumericStepper(event.target).value;
+                }
+                else
+                {
+                    amPMText.text = (amPMText.text == "am") ? "pm" : "am";
+                    this.am_pm = amPMText.text;
+                }
+            }
+            
+            private function fixText(event:Event):void
+            {
+                if(!(event.currentTarget == hourText && !is24Hour))
+                {
+                    _focusArea.text = (_focusArea.text.length < 2) ? "0" + _focusArea.text : _focusArea.text;
+                }
+                _focusArea.setSelection(0, 2);
+                if(event.currentTarget == hourText) this.hour = Number(event.currentTarget.text);
+                if(event.currentTarget == minuteText) this.minute = Number(timeStepper.value);
+                if(event.currentTarget == secondText) this.second = Number(timeStepper.value);
+            }
+            
+            private function setValues(event:Event):void
+            {
+                if(event.currentTarget == hourText)
+                {
+                    if(hourValidator.validate(Number(event.currentTarget.text))){
+                     	timeStepper.value = Number(event.currentTarget.text);
+                     	this.hour = Number(event.currentTarget.text);
+                    }
+                }
+                if(event.currentTarget == minuteText)
+                {
+                    if(minuteValidator.validate(Number(event.currentTarget.text))) {
+                    	timeStepper.value = Number(event.currentTarget.text);
+                    	this.minute = Number(event.currentTarget.text);
+                    }
+                }
+                if(event.currentTarget == secondText)
+                {
+                    if(secondValidator.validate(Number(event.currentTarget.text))) timeStepper.value = Number(event.currentTarget.text);
+                }
+                                
+            }
+            
+            private function formatText(value:String, theField:String):String
+            {
+                if(_focusArea) _focusArea.setSelection(0, 2);
+                if(Number(value) > 12 && !is24Hour && theField == 'hourText')
+                {
+                    value = String(Number(value) % 12);
+                }
+                if(theField == 'hourText' && !is24Hour)
+                {
+                    return value;
+                }
+                else
+                {
+                    return (value.length < 2) ? ("0" + value) : value;
+                }
+            }
+            
+            private function keyHandler(event:KeyboardEvent):void
+            {
+                if(event.keyCode == 39 || event.keyCode == 38) 
+                {
+                    if(_focusArea == hourText)
+                    {
+                        _currentStepValue++;
+                        var tmpMaxValue:Number = (is24Hour) ? (maxHour) : maxHour;
+                        if(_currentStepValue > tmpMaxValue)
+                        {
+                            _currentStepValue = (is24Hour) ? 0 : 1;
+                        }
+
+                      }
+                    else if(_focusArea == minuteText || _focusArea == secondText )
+                    {
+                        _currentStepValue++;
+                        if(_currentStepValue > 59)
+                        {
+                            _currentStepValue = 0;
+                        }
+                        
+                    }
+                    timeStepper.value = _currentStepValue;
+                    timeStepper.dispatchEvent(new NumericStepperEvent('change'));
+                    _focusArea.setSelection(0, 2);
+                }
+                if(event.keyCode == 37 || event.keyCode == 40) 
+                {
+                    if(_focusArea == hourText)
+                    {
+                        _currentStepValue--;
+                        var tmpMinValue:Number = (is24Hour) ? 0 : 1;
+                        if(_currentStepValue < tmpMinValue)
+                        {
+                            _currentStepValue = (is24Hour) ? 23 : 12;
+                        }
+                    }
+                    else if(_focusArea == minuteText || _focusArea == secondText )
+                    {
+                        _currentStepValue--;
+                        if(_currentStepValue < 0)
+                        {
+                            _currentStepValue = 59;
+                        }
+                    }
+                    timeStepper.value = _currentStepValue;
+                    timeStepper.dispatchEvent(new NumericStepperEvent('change'));
+                    
+                    _focusArea.setSelection(0, 2);
+                }
+            }
+            
+            private function amPMKeyHandler(event:KeyboardEvent):void
+            {
+                if(event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 37 || event.keyCode == 39) 
+                {
+                    amPMText.text = (amPMText.text == "am") ? "pm" : "am";
+                    this.am_pm = amPMText.text;
+                    _focusArea.setSelection(0, 2);
+                }
+                
+            }
+           ]]>
+       </mx:Script>
+       
+</mx:Canvas>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ValueComboBox.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ValueComboBox.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/ValueComboBox.mxml	(revision 1227)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- ValueComboBox.mxml
+	 allows value property to be settable
+	 based on "Rich Internet Applications with Adobe Flex and Java" page 319
+-->
+
+<mx:ComboBox xmlns:mx="http://www.adobe.com/2006/mxml">
+	<mx:Script>
+	<![CDATA[
+	    public var dataField: String = "data";
+	    
+		private var candidateValue: Object;
+	    private var valueDirty: Boolean = false;
+	    private var candidateDataProvider: Object;
+	    private var dataProviderDirty: Boolean = false;
+	        
+		[Bindable("change")]
+		[Bindable("valueCommit")]
+		[Inspectable(defaultValue="0", category="General", verbose="1")]
+		override public function get value():Object
+		{
+			var item: Object = selectedItem;
+			if ((item == null) || (typeof(item) != "object")) return item;
+			return item[dataField] ? item[dataField] : item.label;
+		}
+		
+		public function set value(val:Object)  : void
+		{
+	    	candidateValue = val;
+			valueDirty = true;              
+			invalidateProperties();
+		}
+		
+	    private function applyValue(val:Object):void
+	    {
+	    	if ((val != null) && (dataProvider != null)) {
+				for (var i : int = 0; i < dataProvider.length; i++) {
+					if (dataProvider[i] == null) continue;
+					
+					// only checking dataField to avoid accidental selection
+					// (could also check labelField, but not needed for ED app)
+					if (val == dataProvider[i][dataField]) {
+						selectedIndex = i; 
+	                	return;
+	                }
+				}
+			}
+	        selectedIndex = -1;
+		}       
+	
+		override public function set dataProvider(value:Object):void
+		{
+			candidateDataProvider = value;
+			dataProviderDirty = true;
+			invalidateProperties();
+		}
+	
+		override protected function commitProperties():void
+		{
+			super.commitProperties();
+			
+			if (dataProviderDirty)  {
+		        super.dataProvider = candidateDataProvider;
+		        dataProviderDirty = false;
+			}
+			
+			if (valueDirty) {
+		        applyValue(candidateValue);
+		        valueDirty = false;
+			}                       
+		}               
+	]]>
+	</mx:Script>
+</mx:ComboBox>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/VisitRenderer.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/VisitRenderer.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/VisitRenderer.mxml	(revision 1227)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" implements="mx.controls.listClasses.IDropInListItemRenderer" horizontalScrollPolicy="off" verticalScrollPolicy="off">
+	<mx:Script>
+		<![CDATA[
+			import mx.controls.listClasses.BaseListData;
+			import gov.va.med.edp.model.TrackingModelLocator;
+
+		
+		    [Bindable]
+			private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		    // Internal variable for the property value.
+		    private var _listData: BaseListData;
+	
+	    	[Bindable("dataChange")]  // Make the listData property bindable.
+		    public function get listData():BaseListData {return _listData;}
+		    public function set listData(value:BaseListData):void {_listData = value;}
+			
+			override public function set data(value: Object): void {
+				super.data = value;
+				if (value != null) {
+					if (int(value.@visit) > 0) {
+						chkImg.visible = true;
+						chkImg.toolTip = "Visit Created";
+					} else {
+						chkImg.visible = false;
+						chkImg.toolTip = "No Visit Created";
+					}
+				}
+				
+			}
+			
+
+		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+		{
+			super.updateDisplayList(unscaledWidth, unscaledHeight);
+			
+			if (data != null) {
+				var backColor: uint = model.boardSpec.cellColor(_listData["dataField"], data).back;
+				var g:Graphics = graphics;
+				g.clear();
+				g.beginFill(backColor);
+				//g.drawRect(0, -2, unscaledWidth, unscaledHeight+4);
+				g.drawRect(0, 0, unscaledWidth, unscaledHeight);
+				g.endFill();				
+			}
+		}
+
+
+		]]>
+    </mx:Script>
+	
+	<mx:Image
+		id="chkImg"
+		visible="false"
+		verticalCenter="0" horizontalCenter="0"
+		source="@Embed(source='visitCheck.png')" />
+	
+</mx:Canvas>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/WhenRenderer.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/WhenRenderer.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/WhenRenderer.mxml	(revision 1227)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Label
+	xmlns:mx="http://www.adobe.com/2006/mxml">
+
+	<mx:Script>
+		<![CDATA[
+            import mx.controls.listClasses.ListBase;
+            import mx.controls.dataGridClasses.DataGridListData;
+			import gov.va.med.edp.model.TrackingModelLocator;
+			import gov.va.med.edp.vo.LookupVO;
+			import gov.va.med.edp.util.Vista;
+
+
+			private var model: TrackingModelLocator = TrackingModelLocator.getInstance();
+			private var _data: Object;
+		
+			override public function set data(value: Object): void {
+				_data = value;
+				if (value == null) return;
+
+				var when: Number = value[DataGridListData(listData).dataField];
+				var i: int = Vista.locateIndex(model.config.whenList, when);
+				if (i > -1) {
+					this.text = LookupVO(model.config.whenList[i]).label;
+				} else {
+					this.text = "";
+				}
+			}
+			
+			override public function get data(): Object {
+				return _data;
+			}
+
+            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+            {
+                super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+                if(owner is mx.controls.DataGrid && mx.controls.DataGrid(owner).isItemSelected(data)) { //figure out if this itemRenderer is selected
+                    setStyle('color', 0xFFFFFF);  // FIXME: anyway to discover this value from the theme?
+                } else { //otherwise, return the label to its regular state
+                    setStyle('color', 0x000000); // FIXME: anyway to discover this value from the theme?
+                }
+            }
+		]]>
+    </mx:Script>
+
+</mx:Label>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/YesNoDialog.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/YesNoDialog.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/YesNoDialog.mxml	(revision 1227)
@@ -0,0 +1,104 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:widget="gov.va.med.edp.widget.*" paddingTop="0" 
+	borderThicknessTop="0" creationComplete="creationCompleteHandler()"
+    minWidth="280" minHeight="180" horizontalAlign="center" verticalAlign="top" layout="vertical" 
+    xmlns:accessibility="flash.accessibility.*">
+    <mx:Script>
+		<![CDATA[
+			import gov.va.med.edp.util.AccessibilityTools;
+			import gov.va.med.edp.control.ModalDialogEvent;
+			import mx.events.CloseEvent;
+		import mx.core.UIComponent;
+		import mx.core.Application;
+		import mx.managers.PopUpManager;
+
+		[Bindable]
+		private var message : String;	
+		private var invoker : UIComponent;		
+		
+		
+        private var closeListener : Function = null;
+
+	    public static const YES:uint = 0x0001;
+    	public static const NO:uint = 0x0002;
+
+
+		public static function show(message:String,
+                                    title:String = "Alert",
+                                    closeListener:Function = null,
+                                    invokerComponent:UIComponent = null) : void {
+			var dialog:YesNoDialog = YesNoDialog(PopUpManager.createPopUp(Application.application as DisplayObject, YesNoDialog, true));
+            if (title != null && title.length > 0)
+                dialog.title = title;
+			dialog.message = message;	
+			if (closeListener != null)
+			dialog.addEventListener(CloseEvent.CLOSE, closeListener);	
+   			dialog.invoker = invokerComponent;	
+
+		    //Dispatch the event for get clear background
+            Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.OPEN)); 
+ 
+	        PopUpManager.centerPopUp(dialog);
+		}
+
+        private function creationCompleteHandler() : void {
+			var focusTimer: Timer = new Timer(500, 1);
+			focusTimer.addEventListener(TimerEvent.TIMER, moveFocus);
+            focusTimer.start();
+
+        }
+
+        private function yesButtonHandler() : void {
+            dispatchEvent(new CloseEvent(CloseEvent.CLOSE,false,false,YES));
+			removePopUp();
+        }
+        
+        private function noButtonHandler() : void {
+            dispatchEvent(new CloseEvent(CloseEvent.CLOSE,false,false,NO));
+			removePopUp();
+        }        
+        
+        private function removePopUp(): void
+	    {
+	      //Dispatch the event for remove clear background
+          Application.application.dispatchEvent(new ModalDialogEvent(ModalDialogEvent.CLOSE));		
+	      PopUpManager.removePopUp(this);
+	      
+	      if (invoker != null){
+		      callLater(setUIComponentFocus);
+	      }
+	      	      
+	    }        
+        
+        
+        private function setUIComponentFocus(): void
+	    {
+	    	invoker.setFocus();	
+	    }        
+        
+        private function moveFocus(e: TimerEvent): void
+	    {
+	         if (AccessibilityTools.isAccessibilityActive()) {
+	         	messageBox.setFocus();
+	         } else {
+	         	messageBox.editable = false;
+	         	nobtn.setFocus();
+	         }
+	    }
+
+
+		]]>
+    </mx:Script>   
+    
+    <accessibility:AccessibilityProperties name="Info Dialog  {this.title}"  id="accessibleMessage"/>
+   
+
+    <mx:VBox id="contentBox" width="100%" height="100%">
+		<mx:TextArea restrict="*~_" id="messageBox" text="{message}" width="100%" height="100%" borderThickness="0" tabIndex="1" accessibilityProperties="{accessibleMessage}"/>    	
+    </mx:VBox>
+    <mx:ControlBar width="100%" horizontalAlign="right">
+		<mx:Spacer width="100%"/>
+    	<mx:Button label="Yes" click="yesButtonHandler()" tabIndex="2"/>
+    	<mx:Button label="No" id="nobtn" click="noButtonHandler()" tabIndex="3"/>
+    </mx:ControlBar>
+</mx:TitleWindow>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/YesNoRenderer.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/YesNoRenderer.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/YesNoRenderer.mxml	(revision 1227)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<mx:Label
+        xmlns:mx="http://www.adobe.com/2006/mxml"
+        textAlign="center">
+
+    <mx:Script>
+        <![CDATA[
+            import mx.controls.listClasses.ListBase;
+            import mx.controls.dataGridClasses.DataGridListData;
+
+			private var _data: Object;
+		
+			override public function set data(value: Object): void {
+				_data = value;
+				if (value == null) return;
+				
+				if (value[DataGridListData(listData).dataField] == true) {
+					this.text = "yes";
+				} else {
+					this.text = "no";
+				}
+			}
+			
+			override public function get data(): Object {
+				return _data;
+			}
+
+            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
+            {
+                super.updateDisplayList(unscaledWidth, unscaledHeight);
+
+                if(owner is mx.controls.DataGrid && mx.controls.DataGrid(owner).isItemSelected(data)) { //figure out if this itemRenderer is selected
+                    setStyle('color', 0xFFFFFF);  // FIXME: anyway to discover this value from the theme?
+                } else { //otherwise, return the label to its regular state
+                    setStyle('color', 0x000000); // FIXME: anyway to discover this value from the theme?
+                }
+            }
+		]]>
+    </mx:Script>
+
+</mx:Label>
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/AccessibleLabelAccImpl.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/AccessibleLabelAccImpl.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/AccessibleLabelAccImpl.as	(revision 1227)
@@ -0,0 +1,123 @@
+package gov.va.med.edp.widget.accessibility
+{
+	import mx.accessibility.AccImpl;
+	import mx.controls.Label;
+	import flash.events.Event;
+	import flash.accessibility.Accessibility;
+	import flash.accessibility.AccessibilityProperties;
+	import mx.core.UIComponent;
+	
+	/**
+     *  The AccessibleLabelAccImpl class is the accessibility class for 
+     *  Accessible label component.
+     *
+     *  @tiptext This is the AccessibleLabelAccImpl Accessibility Class.
+    */
+	public class AccessibleLabelAccImpl extends AccImpl
+	{
+		/**
+	    *  @private
+	    */
+		private static const EVENT_OBJECT_NAMECHANGE:uint = 0x800C;
+		
+		/**
+		 *  @private
+		 */ 
+		private const ROLE_SYSTEM_STATICTEXT:uint = 0x29;
+    
+        /**
+	    *  @private
+	    *  Default Role of label component.
+	    */
+        private const ROLE_SYSTEM_TEXT:uint = 0x0000002A;
+		
+		/**
+        *   Constructor
+        */
+		public function AccessibleLabelAccImpl(master:UIComponent)
+		{
+			super(master);	
+		}
+		
+		/**
+	     *  Method call for enabling accessibility for a component.
+	     *  this method is required for the compiler to activate
+	     *  the accessibility classes for a component.
+	    */
+		public static function enableAccessibility():void
+		{
+		}
+		
+		/**
+	     *  @private
+	     *  method for returning the name of the accessible label
+	     *
+	     *  @param childID uint
+	     *
+	     *  @return Name String
+	     *  @review
+	    */
+		override protected function getName(childID:uint):String
+		{
+			var label:String = IAccessibleComponent(master).accessibleText;		
+			return label != null && label != "" ? label : "";
+		}
+        
+        /**
+	     *  @private
+	     *  Method for returning the state of the accessible label
+	     *
+	     *  @param childID uint
+	     *
+	     *  @return State uint
+	     */
+		override public function get_accState(childID:uint):uint
+		{
+			var accState:uint = getState(childID);
+
+			return accState;
+		}
+		
+		/**
+	    *  @private
+	    *     Gets the role for the component.
+	    *
+	    *  @param childID uint.
+	    */
+	    override public function get_accRole(childID:uint):uint
+	    {
+		   return ROLE_SYSTEM_TEXT ;
+	    }
+		
+	    /**
+	     *  @private
+	     *	Array of events that we should listen for from the master component.
+	    */	
+		override protected function get eventsToHandle():Array
+		{
+			return super.eventsToHandle.concat(["labelChanged"]);
+		}
+		
+		/**
+	     *  @private
+	     *  Override the generic event handler.
+	     *  All AccImpl must implement this to listen for events
+	     *  from its master component. 
+	     */	
+		override protected function eventHandler(event:Event):void
+		{
+			switch (event.type)
+			{
+				/* tell JAWS to update and reread the information */
+				case "accessibleTextChanged":
+				{
+					Accessibility.sendEvent(master, 0, EVENT_OBJECT_NAMECHANGE);
+					Accessibility.updateProperties();
+					break;
+				}
+			}
+		 }
+		
+	
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/AutoCompleteAccImpl.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/AutoCompleteAccImpl.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/AutoCompleteAccImpl.as	(revision 1227)
@@ -0,0 +1,238 @@
+package gov.va.med.edp.widget.accessibility
+{
+    import gov.va.med.edp.widget.AutoComplete;
+
+    import flash.accessibility.Accessibility;
+	import flash.events.Event;
+	
+	import mx.accessibility.ComboBoxAccImpl;
+	import mx.core.UIComponent;
+	import mx.core.mx_internal;
+	
+	use namespace mx_internal;
+	
+	/**
+     *  The AutoCompleteAccImpl class is the accessibility class for 
+     *  Autocomplete component.
+     *
+     *  @tiptext This is the AutoCompleteAccImpl Accessibility Class.
+     *  @created by jtorreno 6.2.2008
+     */
+	public class AutoCompleteAccImpl extends ComboBoxAccImpl
+	{
+		/**
+		 * @private
+		 */ 
+		private var lastItemName:String = "No item selected";
+		
+	
+		/**
+	    *  @private
+	    *  Default Role of Autocomplete component.
+	    */
+	   private const ROLE_SYSTEM_TEXT:uint = 0x0000002A;
+  	   
+  	   /**
+	    *  @private
+	    *  Default state for all the components.
+	    */
+  	   private static const STATE_SYSTEM_NORMAL:uint = 0x00000000;
+
+       /**
+	    *  @private
+	    */
+	   private static const STATE_SYSTEM_FOCUSED:uint = 0x00000004;
+	
+	   /**
+	    *  @private
+	    */
+	   private static const EVENT_OBJECT_FOCUS:uint = 0x8005;
+	     
+	   /**
+	    *  @private
+	    */
+	   private static const EVENT_OBJECT_VALUECHANGE:uint = 0x0000800e;
+	    
+	   /**
+	    *  @private
+	    *  Event emitted if 1 item is selected.
+	    */
+	   private static const EVENT_OBJECT_SELECTION:uint = 0x8006; 
+	
+	   /**
+	    *  Accessibility hookup
+	    *  @private
+	    */
+	   private static var accessibilityHooked:Boolean = hookAccessibility();
+	
+       /**
+       *   Constructor
+       */
+      public function  AutoCompleteAccImpl(master:UIComponent)
+	   {
+		  super(master);	
+	   }
+	
+	  /**
+	   *  @private
+	   *  Method for creating the Accessibility class.
+	   *  This method is called from UIComponent.
+	   *  @review
+	 */	 
+	  mx_internal static function createAccessibilityImplementation(
+									component:UIComponent):void
+	  {
+	      component.accessibilityImplementation =
+			  new AutoCompleteAccImpl(component);
+	  }
+		
+	  /**
+	 *  @private
+	 *  Static variable triggering the hookAccessibility() method.
+	 *  This is used for initializing AutoCompleteAccImpl class to hook its
+	 *  createAccessibilityImplementation() method to AutoComplete class 
+	 *  before it gets called from UIComponent.
+	 */	
+	  private static function hookAccessibility():Boolean
+	  {
+	      AutoComplete.createAccessibilityImplementation =
+			  createAccessibilityImplementation;
+	      
+		  return true;
+	  }
+	
+	 /**
+	 *  Method call for enabling accessibility for a component.
+	 *  this method is required for the compiler to activate
+	 *  the accessibility classes for a component.
+	 */
+	  public static function enableAccessibility():void
+	  {
+		 
+	  }
+		 
+	  /**
+	 *  @private
+	 *  method for returning the name of the Autocomplete
+	 *
+	 *  @param childID uint
+	 *
+	 *  @return Name String
+	 *  @review
+	 */
+	  override protected function getName(childID:uint):String
+	  {
+		  super.getName(childID);
+		  var name:String = "";
+			
+		  if (AutoComplete(master).selectedIndex == -1) {
+		      name = AutoComplete(master).name ;
+		  } else {
+			 var lastSelectedIndx:int = AutoComplete(master).selectedIndex + 1;
+			  name = "Item " +  lastSelectedIndx +
+				       " of " +  AutoComplete(master).dataProvider.length;
+  		  }	   
+					   			
+		  return name;
+	   }
+	  		
+	  /**
+	 *  @private
+	 *  Method for returning the value of the Autocomplete component
+	 *
+	 *  @param childID uint
+	 *
+	 *  @return Value String
+	 *  @review
+	 */	
+	  override public function get_accValue(childID:uint):String
+	  {
+	  	  super.get_accValue(childID);
+		  var accValue:String = "";
+		  accValue = AutoComplete(master).value.toString();
+		  return accValue;
+	  }
+
+     /**
+	 *  @private
+	 *  Method for returning the state of the Autocomplete component
+	 *
+	 *  @param childID uint
+	 *
+	 *  @return State uint
+	 */
+	  override public function get_accState(childID:uint):uint
+	  {
+	       var accState:uint = STATE_SYSTEM_NORMAL;
+	         
+	       if (AutoComplete(master).getFocus())
+		   {	    
+		  	   accState |= STATE_SYSTEM_FOCUSED;
+		   }	  
+		     		    
+		   return accState;
+	  }
+				
+	  /**
+	 *  @private
+	 *  Gets the role for the component.
+	 *
+	 *  @param childID uint.
+	 */
+	  override public function get_accRole(childID:uint):uint
+	  {
+		  return ROLE_SYSTEM_TEXT ;
+	   }
+	  	
+	 /**
+	 *  @private
+	 *	Array of events that we should listen for from the master component.
+	 */	
+	  override protected function get eventsToHandle():Array
+	  {
+	      return super.eventsToHandle.concat(["valueCommit","change","enter","onFocus"]);
+	  }
+		
+      /**
+	  *  @private
+	  *  Override the generic event handler.
+	  *  All AccImpl must implement this to listen for events
+	  *  from its master component. 
+	  */		
+	  override protected function eventHandler(event:Event):void
+	  {
+	      switch (event.type)
+		  {
+  		     case "valueCommit":
+			 {
+			    Accessibility.sendEvent(master, 0,  EVENT_OBJECT_FOCUS);
+			    Accessibility.sendEvent(master, 0,EVENT_OBJECT_SELECTION);
+			   //Accessibility.sendEvent(master, 0,  EVENT_OBJECT_VALUECHANGE);
+				Accessibility.updateProperties();
+			    break;
+			  }
+			  case "enter":
+			  {
+			    Accessibility.sendEvent(master, 0,EVENT_OBJECT_SELECTION);
+				Accessibility.updateProperties();
+				break;
+			  }				  
+			  case "change":
+			  {
+			     Accessibility.sendEvent(master, 0,  EVENT_OBJECT_FOCUS);
+			     Accessibility.sendEvent(master, 0,  EVENT_OBJECT_VALUECHANGE);
+				 Accessibility.updateProperties();
+				 break;
+			  }	
+			  case "onFocus":
+			  {
+			     Accessibility.sendEvent(master, 0,  EVENT_OBJECT_FOCUS);
+				 Accessibility.updateProperties();
+				 break;
+		      }			
+				   
+	 	   }
+		}
+			
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/IAccessibleComponent.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/IAccessibleComponent.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/IAccessibleComponent.as	(revision 1227)
@@ -0,0 +1,11 @@
+package gov.va.med.edp.widget.accessibility
+{
+	/**
+	 *  Interface for Accessible label
+	 */ 
+	public interface IAccessibleComponent
+	{
+		function get accessibleText():String;
+		function set accessibleText(s:String):void;
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/LinkButtonTabBarAccImpl.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/LinkButtonTabBarAccImpl.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/LinkButtonTabBarAccImpl.as	(revision 1227)
@@ -0,0 +1,110 @@
+package gov.va.med.edp.widget.accessibility
+{
+	import gov.va.med.edp.widget.LinkButtonTab;
+	import gov.va.med.edp.widget.LinkButtonTabBar;
+	
+	import mx.accessibility.TabBarAccImpl;
+	import mx.core.UIComponent;
+    import mx.core.mx_internal;
+
+    use namespace mx_internal;
+
+    public class LinkButtonTabBarAccImpl extends TabBarAccImpl
+	{
+        private static const MAX_NUM:uint = 100000;
+
+        /**
+		 *  @private
+		 *  Static variable triggering the hookAccessibility() method.
+		 *  This is used for initializing LinkButtonTabBarAccImpl class to hook its
+		 *  createAccessibilityImplementation() method to LinkButtonTabBar class
+		 *  before it gets called from UIComponent.
+		 */
+		private static var accessibilityHooked:Boolean = hookAccessibility();
+	
+		/**
+		 *  @private
+		 *  Static method for swapping the createAccessibilityImplementation()
+		 *  method of LinkButtonTabBar with LinkButtonTabBarAccImpl class.
+		 */
+		private static function hookAccessibility():Boolean
+		{
+			LinkButtonTabBar.createAccessibilityImplementation =
+				createAccessibilityImplementation;
+	
+			return true;
+		}
+		
+		/**
+		 *  @private
+		 *  Method for creating the Accessibility class.
+		 *  This method is called from UIComponent.
+		 *  @review
+		 */
+		mx_internal static function createAccessibilityImplementation(
+									component:UIComponent):void
+		{
+			component.accessibilityImplementation =
+				new LinkButtonTabBarAccImpl(component);
+		}
+	
+		/**
+		 *  Method call for enabling accessibility for a component.
+		 *  This method is required for the compiler to activate
+		 *  the accessibility classes for a component.
+		 */
+		public static function enableAccessibility():void
+		{
+		}
+		
+		/**
+		 *  Constructor.
+		 *
+		 *  @param master The UIComponent instance that this AccImpl instance
+		 *  is making accessible.
+		 */
+		public function LinkButtonTabBarAccImpl(master:UIComponent)
+		{
+			super(master);
+		}
+
+		/**
+		 *  @private
+		 *  method for returning the name of the Tab
+		 *  which is spoken out by the screen reader.
+		 *
+		 *  @param childID:uint
+		 *
+		 *  @return Name:String
+		 */
+		override protected function getName(childID:uint):String
+		{
+			if (childID == 0)
+				return "View Selector Panel";
+	
+			var name:String;
+	
+			var tabBar:LinkButtonTabBar = LinkButtonTabBar(master);
+			// Assuming childID is always ItemID + 1
+			// because getChildIDArray is not always invoked.
+			var index:int = childID < MAX_NUM ?
+							childID - 1 :
+							childID - MAX_NUM - 1;
+			//With new version of JAWS, when we add a new child, we get nonsense number
+			//not caught above. In this case, return last tab.
+			if (index > tabBar.numChildren || index < 0)
+				index = tabBar.numChildren -1;
+			var item:LinkButtonTab = LinkButtonTab(tabBar.getChildAt(index));
+	
+			name = item.label;
+	
+			if (index == tabBar.selectedIndex)
+				name += " Tab, Active";
+			else
+				name += " Tab";
+	
+			return name;
+		}
+
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/NumericStepperAccImpl.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/NumericStepperAccImpl.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/main/flex/gov/va/med/edp/widget/accessibility/NumericStepperAccImpl.as	(revision 1227)
@@ -0,0 +1,221 @@
+package gov.va.med.edp.widget.accessibility
+{
+	import flash.accessibility.Accessibility;
+	import flash.events.Event;
+	
+	import mx.accessibility.AccImpl;
+	import mx.core.UIComponent;
+	import mx.core.mx_internal;
+	
+	import gov.va.med.edp.widget.AccessibleNumericStepper;
+	
+	use namespace mx_internal;
+	
+	/**
+     *  The NumericStepperAccImpl class is the accessibility class 
+     *  the numericstepper component.
+     *
+     *  @tiptext This is the NumericStepperAccImpl Accessibility Class.
+     *  @created by jtorreno 6.2.2008
+     */
+	public class NumericStepperAccImpl extends AccImpl
+	{ 
+		
+		/**
+		 * @private
+		 * Default role for numericstepper
+		*/ 
+	    private const ROLE_SYSTEM_TEXT:uint = 0x0000002A;
+		
+		/**
+		 *  @private
+		 *  Default state for all the components.
+	    */
+  	    private static const STATE_SYSTEM_NORMAL:uint = 0x00000000;
+
+	    /**
+	     *  @private
+	    */
+	    private static const STATE_SYSTEM_FOCUSABLE:uint = 0x00100000;
+	
+	    /**
+	     *  @private
+	    */
+	    private static const STATE_SYSTEM_FOCUSED:uint = 0x00000004;
+	
+	    /**
+	     *  @private
+	    **/
+	    private static const EVENT_OBJECT_FOCUS:uint = 0x8005;
+	     
+	    /**
+	     *  @private
+	    */
+	    private static const EVENT_OBJECT_VALUECHANGE:uint = 0x0000800e;
+	
+        /**
+	     *  @private
+	     *   Accessibility hookup
+	    */
+        private static var accessibilityHooked:Boolean = hookAccessibility();
+	
+	
+	    /**
+         *  Constructor
+        */ 
+	    public function NumericStepperAccImpl(master:UIComponent)
+		{
+		    super(master);	
+	    }
+		
+		/**
+	     *  @private
+	     *  Method for creating the Accessibility class.
+	     *  This method is called from UIComponent.
+	     *  @review
+	    */ 
+		mx_internal static function createAccessibilityImplementation(
+									component:UIComponent):void
+		{
+			component.accessibilityImplementation =
+				new NumericStepperAccImpl(component);
+		}
+		
+		/**
+	     *  @private
+	     *  Static method for swapping the createAccessibilityImplementation()
+	     *  method of AccessibleNumericStepper with the NumericStepperAccImpl class.
+	     */
+		 private static function hookAccessibility():Boolean
+		 {
+		      AccessibleNumericStepper.createAccessibilityImplementation =
+				  createAccessibilityImplementation;
+	         return true;
+		 }
+		
+		/**
+	     *  Method call for enabling accessibility for a component.
+	     *  this method is required for the compiler to activate
+	     *  the accessibility classes for a component.
+	    */
+		 public static function enableAccessibility():void
+		 {
+
+		 }
+		
+		 /**
+	     *  @private
+	     *  Method for returning the name of the NumericStepper
+	     *
+	     *  @param childID uint
+	     *
+	     *  @return Name String
+	     *  @review
+	     */
+		 override protected function getName(childID:uint):String
+		 {
+			var name:String = "";
+			
+			name = AccessibleNumericStepper(master).name;
+
+			return name;
+		 }
+		 
+		 /**
+	      *  @private
+       	  *  Method for returning the value of the NumericStepper
+	      *
+	      *  @param childID uint
+	      *
+	      *  @return Value String
+	      *  @review
+	      */
+		 override public function get_accValue(childID:uint):String
+		 {
+		     var accValue:String="";
+			
+  			 accValue = AccessibleNumericStepper(master).value.toString();
+			
+			return accValue;
+		 }
+
+         /**
+	     *  @private
+	     *  IAccessible method for returning the state of the NumericStepper
+	     *
+	     *  @param childID uint
+	     *
+	     *  @return State uint
+	     */
+		 override public function get_accState(childID:uint):uint
+		 {
+		    var accState:uint = STATE_SYSTEM_NORMAL;
+	
+			if (AccessibleNumericStepper(master).getFocus())
+			{	    
+	 		  accState |= STATE_SYSTEM_FOCUSED;
+		    }	    
+		  
+		    return accState;
+		 }
+		
+		 /**
+	      *  @private
+	      *  Gets the role for the component.
+	      *
+	      *  @param childID uint.
+	     */
+		 override public function get_accRole(childID:uint):uint
+	     {
+		 	  return  ROLE_SYSTEM_TEXT;
+	     }
+	     
+	     /**
+	      *  @private
+  	      *	 Array of events that we should listen for from the master component.
+	      */
+	     override protected function get eventsToHandle():Array
+		 {
+		     return super.eventsToHandle.concat(["numericStepperFocused","stepSizeChanged","stepSizeMouseClickChanged"]);
+		 }
+		 
+		 /**
+	      *  @private
+	      *  Override the generic event handler.
+	      *  All AccImpl must implement this to listen for events
+	      *  from its master component. 
+	      */
+		 override protected function eventHandler(event:Event):void
+		  {
+		  	  //trace("&&&&&&&&&& Event Type: " + event.type);
+		      switch (event.type)
+			    {
+				    /* tell JAWS to update and reread the information */
+				    case "stepSizeChanged":
+				    {
+			  	        Accessibility.sendEvent(master, 0,  EVENT_OBJECT_FOCUS);
+					    Accessibility.sendEvent(master, 0,  EVENT_OBJECT_VALUECHANGE);
+					    Accessibility.updateProperties();
+					    break;
+				    }	
+				    case "stepSizeMouseClickChanged":
+				    {
+					    Accessibility.sendEvent(master, 0,  EVENT_OBJECT_FOCUS);
+					    //Accessibility.sendEvent(master, 0, EVENT_OBJECT_STATECHANGE);
+					    Accessibility.sendEvent(master, 0,  EVENT_OBJECT_VALUECHANGE);
+					    Accessibility.updateProperties();
+					    break;
+				    }					   
+				    case "numericStepperFocused":
+				    {
+					    Accessibility.sendEvent(master, 0,  EVENT_OBJECT_FOCUS);
+					    Accessibility.sendEvent(master, 0,  EVENT_OBJECT_VALUECHANGE);
+					    Accessibility.updateProperties();
+					    break;
+				    }
+				   				   
+	 	        }
+		   }
+			
+	}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/control/TestPatientChecksController.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/control/TestPatientChecksController.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/control/TestPatientChecksController.as	(revision 1227)
@@ -0,0 +1,78 @@
+package gov.va.med.edp.pt.demog.control {
+import mx.rpc.IResponder;
+import gov.va.med.edp.pt.demog.IPatientChecksDao;
+import gov.va.med.edp.pt.demog.model.PatientSelectVO;
+import gov.va.med.edp.pt.demog.model.PatientCheckVO;
+import gov.va.med.edp.pt.demog.model.PatientChecksModel;
+
+import flexunit.framework.TestCase;
+
+public class TestPatientChecksController extends TestCase implements IPatientChecksDao {
+
+    private var loadCalledWithThisPt:PatientSelectVO;
+    private var logAccessCalledWithThisDfn:String;
+
+    public function testResetPatientChecks():void {
+        var model:PatientChecksModel = new PatientChecksModel();
+        model.patientChecks = new PatientCheckVO();
+        model.patientChecksReady = true;
+
+        var c:PatientChecksController = new PatientChecksController();
+        c.model = model;
+
+        c.resetPatientChecks();
+
+        assertNull(model.patientChecks);
+        assertFalse(model.patientChecksReady);
+    }
+
+    public function testLoadPatientChecks():void {
+        var model:PatientChecksModel = new PatientChecksModel();
+        var c:PatientChecksController = new PatientChecksController();
+        c.model = model;
+        c.dao = this;
+
+        var pt:PatientSelectVO = new PatientSelectVO();
+        pt.dfn = "FOO";
+        pt.name = "BAR";
+
+        c.loadPatientChecks(pt);
+
+        assertEquals(PatientChecksModel.STATE_LOADING, model.checkState);
+        assertFalse(model.patientChecksReady);
+        assertTrue(pt === loadCalledWithThisPt);
+    }
+
+    public function testLogSensitivePatientAccess():void {
+        var model:PatientChecksModel = new PatientChecksModel();
+        model.checkState = PatientChecksModel.STATE_LOADING;
+        model.patientChecks = new PatientCheckVO();
+        model.patientChecks.dfn = "foobar";
+        model.patientChecks.sensitive = true;
+        model.patientChecks.warningText = "Patient FOO,BAR is sensitive.  Continue";
+        model.patientChecks.logAccess = true;
+        model.patientChecksReady = true;
+
+        var c:PatientChecksController = new PatientChecksController();
+        c.model = model;
+        c.dao = this;
+
+        c.forwardPatientCheck();
+        assertEquals(PatientChecksModel.STATE_SENSITIVE, model.checkState);
+
+        c.forwardPatientCheck();
+        assertEquals("foobar", logAccessCalledWithThisDfn);
+    }
+
+    //
+    // methods to mock the patient checks DAO
+    //
+    public function loadPatientChecks(responder:IResponder, pt:PatientSelectVO):void {
+        loadCalledWithThisPt = pt;
+    }
+
+    public function logPatientAccess(responder:IResponder, dfn:String):void {
+        logAccessCalledWithThisDfn = dfn;
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/model/TestPatientCheckVO.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/model/TestPatientCheckVO.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/model/TestPatientCheckVO.as	(revision 1227)
@@ -0,0 +1,65 @@
+package gov.va.med.edp.pt.demog.model {
+import gov.va.med.edp.pt.demog.*;
+
+import flexunit.framework.TestCase;
+import mx.collections.ArrayCollection;
+
+public class TestPatientCheckVO extends TestCase {
+
+    public function testOnBoard():void {
+        var c:PatientCheckVO = new PatientCheckVO();
+        assertFalse(c.isOnBoard());
+        c.onBoardText = "foo";
+        assertTrue(c.isOnBoard());
+    }
+
+    public function testIsDeceased():void {
+        var c:PatientCheckVO = new PatientCheckVO();
+        assertFalse(c.isOnBoard());
+        c.deceasedText = "foo";
+        assertTrue(c.isDeceased());
+    }
+
+    public function testHasSimilarNames():void {
+        var c:PatientCheckVO = new PatientCheckVO();
+        assertFalse(c.hasSimilarNames());
+        c.similarNames = [];
+        assertFalse(c.hasSimilarNames());
+        c.similarNames = createPtList();
+        assertTrue(c.hasSimilarNames());
+    }
+
+    public function testHasFlags():void {
+        var c:PatientCheckVO = new PatientCheckVO();
+        assertFalse(c.hasFlags());
+        c.flags = new ArrayCollection();
+        assertFalse(c.hasFlags());
+        c.flags = createPtFlags();
+        assertTrue(c.hasFlags());
+    }
+
+    public static function createPtList():Array {
+        var pt1:PatientSelectVO = new PatientSelectVO();
+        pt1.dfn = "fefefef"
+
+        var pt2:PatientSelectVO = new PatientSelectVO();
+        pt2.dfn = "efeerfer";
+
+        var pt3:PatientSelectVO = new PatientSelectVO();
+        pt3.dfn = "fe34ef"
+
+        return [pt1, pt2, pt3];
+    }
+
+    public static function createPtFlags():ArrayCollection {
+        var flag1:PatientRecordFlagVO = new PatientRecordFlagVO();
+        flag1.name = "foo";
+        flag1.type = "bar";
+        flag1.status = "baz";
+
+        var flags:ArrayCollection = new ArrayCollection();
+        flags.addItem(flag1);
+        return flags;
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/model/TestPatientChecksModel.as
===================================================================
--- EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/model/TestPatientChecksModel.as	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-core/src/test/flex/gov/va/med/edp/pt/demog/model/TestPatientChecksModel.as	(revision 1227)
@@ -0,0 +1,139 @@
+package gov.va.med.edp.pt.demog.model {
+
+import gov.va.med.edp.pt.demog.model.TestPatientCheckVO;
+import gov.va.med.edp.pt.demog.model.PatientCheckVO;
+
+import flexunit.framework.TestCase;
+
+public class TestPatientChecksModel extends TestCase {
+
+    private var m:PatientChecksModel = new PatientChecksModel();
+
+    public override function setUp():void {
+        // this setup simulates patient checks
+        m = new PatientChecksModel();
+        m.checkState = PatientChecksModel.STATE_LOADING; // simulate loading
+
+        m.patientChecks = new PatientCheckVO();
+        m.patientChecks.dfn = "foobar";
+    }
+
+    public function testCreate():void {
+        m = new PatientChecksModel();
+        assertEquals(PatientChecksModel.STATE_NONE, m.checkState);
+        assertNull(m.patientChecks);
+        assertFalse(m.patientChecksReady);
+        assertFalse(m.continueEnabled);
+        assertFalse(m.backEnabled);
+    }
+
+    public function testReset():void {
+        m.reset();
+        assertNull(m.patientChecks);
+        assertFalse(m.patientChecksReady);
+        assertFalse(m.continueEnabled);
+        assertFalse(m.backEnabled);
+    }
+
+    public function testAlreadyOnBoardCheck():void {
+        m.patientChecks.onBoardText = "FOO,BAR";
+        m.patientChecksReady = true;
+
+        assertEquals(PatientChecksModel.STATE_LOADED, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertFalse(m.backEnabled);
+
+        m.forward();
+
+        assertEquals(PatientChecksModel.STATE_ONBOARD, m.checkState);
+        assertFalse(m.continueEnabled);
+        assertTrue(m.backEnabled);
+
+        m.back();
+
+        assertEquals(PatientChecksModel.STATE_LOADED, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertFalse(m.backEnabled);
+    }
+
+    public function testCycleThroughSimilarNamesSensitiveDeceasedAndFlagsPatientChecks():void {
+        m.patientChecks.similarNames = TestPatientCheckVO.createPtList();
+        m.patientChecks.deceasedText = "This patient died on Jan 24, 2007.\nDo you wish to continue?";
+        m.patientChecks.flags = TestPatientCheckVO.createPtFlags();
+        m.patientChecksReady = true;
+
+        assertEquals(PatientChecksModel.STATE_LOADED, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertFalse(m.backEnabled);
+
+        m.forward();
+
+        assertEquals(PatientChecksModel.STATE_SIMILAR, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertTrue(m.backEnabled);
+
+        m.forward();
+
+        assertEquals(PatientChecksModel.STATE_DECEASED, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertTrue(m.backEnabled);
+
+        m.forward();
+
+        assertEquals(PatientChecksModel.STATE_FLAGS, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertTrue(m.backEnabled);
+
+        m.back();
+
+        assertEquals(PatientChecksModel.STATE_DECEASED, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertTrue(m.backEnabled);
+
+        m.back();
+
+        assertEquals(PatientChecksModel.STATE_SIMILAR, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertTrue(m.backEnabled);
+
+        m.back();
+
+        assertEquals(PatientChecksModel.STATE_LOADED, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertFalse(m.backEnabled);
+
+        m.forward();
+        m.forward();
+        m.forward();
+
+        m.forward();
+
+        assertEquals(PatientChecksModel.STATE_ALLOW, m.checkState);
+        assertFalse(m.continueEnabled);
+        assertFalse(m.backEnabled);
+    }
+
+    public function testMayAccessSensitivePatient():void {
+        m.patientChecks.sensitive = true;
+        m.patientChecks.warningText = "unable to access this patient";
+        m.patientChecks.mayAccess = false;
+        m.patientChecksReady = true;
+
+        assertEquals(PatientChecksModel.STATE_LOADED, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertFalse(m.backEnabled);
+
+        m.forward();
+
+        assertEquals(PatientChecksModel.STATE_SENSITIVE, m.checkState);
+        assertFalse(m.continueEnabled);
+        assertTrue(m.backEnabled);
+
+        m.back();
+
+        assertEquals(PatientChecksModel.STATE_LOADED, m.checkState);
+        assertTrue(m.continueEnabled);
+        assertFalse(m.backEnabled);
+    }
+}
+}
Index: EDIS/trunk/java/tracking-ui-main/.actionScriptProperties
===================================================================
--- EDIS/trunk/java/tracking-ui-main/.actionScriptProperties	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/.actionScriptProperties	(revision 1227)
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<actionScriptProperties mainApplicationPath="tracking.mxml" version="3">
+  <compiler additionalCompilerArguments="-locale en_US" copyDependentFiles="true" enableModuleDebug="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="true" htmlHistoryManagement="false" htmlPlayerVersion="9.0.0" htmlPlayerVersionCheck="true" outputFolderPath="target" sourceFolderPath="src/main/flex" strict="true" useApolloConfig="false" verifyDigests="true" warn="true">
+    <compilerSourcePath>
+      <compilerSourcePathEntry kind="1" linkType="1" path="src/main/resources"/>
+    </compilerSourcePath>
+    <libraryPath defaultLinkType="1">
+      <libraryPathEntry kind="4" path="">
+        <modifiedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/>
+        </modifiedEntries>
+        <excludedEntries>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
+          <libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
+        </excludedEntries>
+      </libraryPathEntry>
+      <libraryPathEntry kind="3" linkType="1" path="C:/Documents and Settings/vhaislbelids/.m2/repository/com/adobe/cairngorm/2.2.1/cairngorm-2.2.1.swc" useDefaultLinkType="false"/>
+      <libraryPathEntry kind="3" linkType="1" path="C:/dev/reeng/main/ed/tracking-ui-core/target/edis-tracking-ui-core-1.0.swc" useDefaultLinkType="false"/>
+    </libraryPath>
+    <sourceAttachmentPath/>
+  </compiler>
+  <applications>
+    <application path="tracking.mxml"/>
+  </applications>
+  <modules/>
+  <buildCSSFiles/>
+</actionScriptProperties>
Index: EDIS/trunk/java/tracking-ui-main/.flexProperties
===================================================================
--- EDIS/trunk/java/tracking-ui-main/.flexProperties	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/.flexProperties	(revision 1227)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<flexProperties flexServerType="0" toolCompile="true" useServerFlexSDK="false" version="1"/>
Index: EDIS/trunk/java/tracking-ui-main/.p4ignore
===================================================================
--- EDIS/trunk/java/tracking-ui-main/.p4ignore	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/.p4ignore	(revision 1227)
@@ -0,0 +1,1 @@
+target
Index: EDIS/trunk/java/tracking-ui-main/html-template/AC_OETags.js
===================================================================
--- EDIS/trunk/java/tracking-ui-main/html-template/AC_OETags.js	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/html-template/AC_OETags.js	(revision 1227)
@@ -0,0 +1,276 @@
+// Flash Player Version Detection - Rev 1.6
+// Detect Client Browser type
+// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
+var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
+var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
+var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
+
+function ControlVersion()
+{
+	var version;
+	var axo;
+	var e;
+
+	// NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
+
+	try {
+		// version will be set for 7.X or greater players
+		axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
+		version = axo.GetVariable("$version");
+	} catch (e) {
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 6.X players only
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
+			
+			// installed player is some revision of 6.0
+			// GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
+			// so we have to be careful. 
+			
+			// default to the first public version
+			version = "WIN 6,0,21,0";
+
+			// throws if AllowScripAccess does not exist (introduced in 6.0r47)		
+			axo.AllowScriptAccess = "always";
+
+			// safe to call for 6.0r47 or greater
+			version = axo.GetVariable("$version");
+
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 4.X or 5.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = axo.GetVariable("$version");
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 3.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
+			version = "WIN 3,0,18,0";
+		} catch (e) {
+		}
+	}
+
+	if (!version)
+	{
+		try {
+			// version will be set for 2.X player
+			axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
+			version = "WIN 2,0,0,11";
+		} catch (e) {
+			version = -1;
+		}
+	}
+	
+	return version;
+}
+
+// JavaScript helper required to detect Flash Player PlugIn version information
+function GetSwfVer(){
+	// NS/Opera version >= 3 check for Flash plugin in plugin array
+	var flashVer = -1;
+	
+	if (navigator.plugins != null && navigator.plugins.length > 0) {
+		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
+			var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
+			var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
+			var descArray = flashDescription.split(" ");
+			var tempArrayMajor = descArray[2].split(".");			
+			var versionMajor = tempArrayMajor[0];
+			var versionMinor = tempArrayMajor[1];
+			var versionRevision = descArray[3];
+			if (versionRevision == "") {
+				versionRevision = descArray[4];
+			}
+			if (versionRevision[0] == "d") {
+				versionRevision = versionRevision.substring(1);
+			} else if (versionRevision[0] == "r") {
+				versionRevision = versionRevision.substring(1);
+				if (versionRevision.indexOf("d") > 0) {
+					versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
+				}
+			}
+			var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
+		}
+	}
+	// MSN/WebTV 2.6 supports Flash 4
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
+	// WebTV 2.5 supports Flash 3
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
+	// older WebTV supports Flash 2
+	else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
+	else if ( isIE && isWin && !isOpera ) {
+		flashVer = ControlVersion();
+	}	
+	return flashVer;
+}
+
+// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
+function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
+{
+	versionStr = GetSwfVer();
+	if (versionStr == -1 ) {
+		return false;
+	} else if (versionStr != 0) {
+		if(isIE && isWin && !isOpera) {
+			// Given "WIN 2,0,0,11"
+			tempArray         = versionStr.split(" "); 	// ["WIN", "2,0,0,11"]
+			tempString        = tempArray[1];			// "2,0,0,11"
+			versionArray      = tempString.split(",");	// ['2', '0', '0', '11']
+		} else {
+			versionArray      = versionStr.split(".");
+		}
+		var versionMajor      = versionArray[0];
+		var versionMinor      = versionArray[1];
+		var versionRevision   = versionArray[2];
+
+        	// is the major.revision >= requested major.revision AND the minor version >= requested minor
+		if (versionMajor > parseFloat(reqMajorVer)) {
+			return true;
+		} else if (versionMajor == parseFloat(reqMajorVer)) {
+			if (versionMinor > parseFloat(reqMinorVer))
+				return true;
+			else if (versionMinor == parseFloat(reqMinorVer)) {
+				if (versionRevision >= parseFloat(reqRevision))
+					return true;
+			}
+		}
+		return false;
+	}
+}
+
+function AC_AddExtension(src, ext)
+{
+  if (src.indexOf('?') != -1)
+    return src.replace(/\?/, ext+'?'); 
+  else
+    return src + ext;
+}
+
+function AC_Generateobj(objAttrs, params, embedAttrs) 
+{ 
+    var str = '';
+    if (isIE && isWin && !isOpera)
+    {
+  		str += '<object ';
+  		for (var i in objAttrs)
+  			str += i + '="' + objAttrs[i] + '" ';
+  		str += '>';
+  		for (var i in params)
+  			str += '<param name="' + i + '" value="' + params[i] + '" /> ';
+  		str += '</object>';
+    } else {
+  		str += '<embed ';
+  		for (var i in embedAttrs)
+  			str += i + '="' + embedAttrs[i] + '" ';
+  		str += '> </embed>';
+    }
+
+    document.write(str);
+}
+
+function AC_FL_RunContent(){
+  var ret = 
+    AC_GetArgs
+    (  arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
+     , "application/x-shockwave-flash"
+    );
+  AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
+}
+
+function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
+  var ret = new Object();
+  ret.embedAttrs = new Object();
+  ret.params = new Object();
+  ret.objAttrs = new Object();
+  for (var i=0; i < args.length; i=i+2){
+    var currArg = args[i].toLowerCase();    
+
+    switch (currArg){	
+      case "classid":
+        break;
+      case "pluginspage":
+        ret.embedAttrs[args[i]] = args[i+1];
+        break;
+      case "src":
+      case "movie":	
+        args[i+1] = AC_AddExtension(args[i+1], ext);
+        ret.embedAttrs["src"] = args[i+1];
+        ret.params[srcParamName] = args[i+1];
+        break;
+      case "onafterupdate":
+      case "onbeforeupdate":
+      case "onblur":
+      case "oncellchange":
+      case "onclick":
+      case "ondblClick":
+      case "ondrag":
+      case "ondragend":
+      case "ondragenter":
+      case "ondragleave":
+      case "ondragover":
+      case "ondrop":
+      case "onfinish":
+      case "onfocus":
+      case "onhelp":
+      case "onmousedown":
+      case "onmouseup":
+      case "onmouseover":
+      case "onmousemove":
+      case "onmouseout":
+      case "onkeypress":
+      case "onkeydown":
+      case "onkeyup":
+      case "onload":
+      case "onlosecapture":
+      case "onpropertychange":
+      case "onreadystatechange":
+      case "onrowsdelete":
+      case "onrowenter":
+      case "onrowexit":
+      case "onrowsinserted":
+      case "onstart":
+      case "onscroll":
+      case "onbeforeeditfocus":
+      case "onactivate":
+      case "onbeforedeactivate":
+      case "ondeactivate":
+      case "type":
+      case "codebase":
+        ret.objAttrs[args[i]] = args[i+1];
+        break;
+      case "id":
+      case "width":
+      case "height":
+      case "align":
+      case "vspace": 
+      case "hspace":
+      case "class":
+      case "title":
+      case "accesskey":
+      case "name":
+      case "tabindex":
+        ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
+        break;
+      default:
+        ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
+    }
+  }
+  ret.objAttrs["classid"] = classid;
+  if (mimeType) ret.embedAttrs["type"] = mimeType;
+  return ret;
+}
+
+
Index: EDIS/trunk/java/tracking-ui-main/html-template/index.template.html
===================================================================
--- EDIS/trunk/java/tracking-ui-main/html-template/index.template.html	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/html-template/index.template.html	(revision 1227)
@@ -0,0 +1,152 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html lang="en">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Cache-Control" content="no-cache,no-store" />
+<meta http-equiv="Pragma" content="no-cache" />
+<meta http-equiv="Expires" content="0" />
+<title>${title}</title>
+<script src="AC_OETags.js" language="javascript"></script>
+<!-- BEGIN added by jtorreno 2008.05.12
+    // Utility to auto maximize browser when screen reader is activated -->
+<script src="utilities/autoMaximizeBrowser.js" language="JavaScript"></script>
+<!-- END  2008.05.12 -->
+
+<style>
+    html, body {
+        height: 100%;
+        margin: 0;
+        padding: 0;
+    }
+    body {
+        overflow:hidden;
+    }
+</style>
+<script language="JavaScript" type="text/javascript">
+<!--
+// -----------------------------------------------------------------------------
+// Globals
+// Major version of Flash required
+var requiredMajorVersion = ${version_major};
+// Minor version of Flash required
+var requiredMinorVersion = ${version_minor};
+// Minor version of Flash required
+var requiredRevision = ${version_revision};
+// -----------------------------------------------------------------------------
+// -->
+</script>
+
+<!-- BEGIN call Flex function on browser close -->
+<script language="JavaScript" type="text/javascript">
+function shutdownHook()
+{
+	var fxControl = document.${application} || window.${application};
+	var warning = fxControl.getUnsavedDataWarning();
+	if (warning != '')
+		return warning;
+	else
+		return;
+}
+
+window.onbeforeunload = shutdownHook;
+</script>
+<!-- END call Flex function on browser close -->
+
+</head>
+
+<body scroll="no">
+<script language="JavaScript" type="text/javascript">
+<!--
+// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65)
+var hasProductInstall = DetectFlashVer(6, 0, 65);
+
+// Version check based upon the values defined in globals
+var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
+
+
+// Check to see if a player with Flash Product Install is available and the version does not meet the requirements for playback
+if ( hasProductInstall && !hasRequestedVersion ) {
+	// MMdoctitle is the stored document.title value used by the installation process to close the window that started the process
+	// This is necessary in order to close browser windows that are still utilizing the older version of the player after installation has completed
+	// DO NOT MODIFY THE FOLLOWING FOUR LINES
+	// Location visited after installation is complete if installation is required
+	var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
+	var MMredirectURL = window.location;
+    document.title = document.title.slice(0, 47) + " - Flash Player Installation";
+    var MMdoctitle = document.title;
+
+	AC_FL_RunContent(
+		"src", "playerProductInstall",
+		"FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
+		"width", "${width}",
+		"height", "${height}",
+		"align", "middle",
+		"id", "${application}",
+		"quality", "high",
+		"bgcolor", "${bgcolor}",
+		"allowFullScreen", "true",
+		"name", "${application}",
+		"allowScriptAccess","sameDomain",
+		"type", "application/x-shockwave-flash",
+		"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+} else if (hasRequestedVersion) {
+	// if we've detected an acceptable version
+	// embed the Flash Content SWF when all tests are passed
+	
+	// Cache Server Page namespace should be set here (don't forget the ampersand)
+	//var edpVars = "cspNmsp=CPM&cspDemo=500^10vehu^vehu10&";
+	//var edpVars = "cspServ=vhaislcfgm2.vha.med.va.gov/csp/CPM&cspToken=20012^662&";
+	//var edpVars = "vljServ=10.5.17.153:7001&";
+	//var edpVars = "vljServ=10.5.17.225:7001&";
+	//var edpVars = "vljServ=localhost:7001&";
+	var edpVars = "vljServ=vhaislbll2.vha.med.va.gov:7141&contextRoot=%2Fmain&helpContextRoot=%2Fhelp&"
+	//var edpVars = "vljServ=localhost:7001&contextRoot=%2Fmain&helpContextRoot=%2Fhelp&"
+	//var edpVars = "";
+	
+	AC_FL_RunContent(
+			"src", "${swf}",
+			"width", "${width}",
+			"height", "${height}",
+			"align", "middle",
+			"id", "${application}",
+			"quality", "high",
+			"bgcolor", "${bgcolor}",
+			"allowFullScreen", "true",
+			"name", "${application}",
+			"flashvars", edpVars,
+			"allowScriptAccess","sameDomain",
+			"type", "application/x-shockwave-flash",
+			"pluginspage", "http://www.adobe.com/go/getflashplayer"
+	);
+  } else {  // flash is too old or we can't detect the plugin
+    var alternateContent = 'Alternate HTML content should be placed here. '
+  	+ 'This content requires the Adobe Flash Player. '
+   	+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
+    document.write(alternateContent);  // insert non-flash content
+  }
+// -->
+</script>
+<noscript>
+  	<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+			id="${application}" width="${width}" height="${height}"
+			codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
+			<param name="movie" value="${swf}.swf" />
+			<param name="quality" value="high" />
+			<param name="allowFullScreen" value="true" />
+			<param name="bgcolor" value="${bgcolor}" />
+			<param name="allowScriptAccess" value="sameDomain" />
+			<embed src="${swf}.swf" quality="high" bgcolor="${bgcolor}"
+				width="${width}" height="${height}" name="${application}" align="middle"
+				play="true"
+				loop="false"
+				quality="high"
+				allowScriptAccess="sameDomain"
+				type="application/x-shockwave-flash"
+				pluginspage="http://www.adobe.com/go/getflashplayer">
+			</embed>
+	</object>
+</noscript>
+</body>
+</html>
Index: EDIS/trunk/java/tracking-ui-main/html-template/utilities/autoMaximizeBrowser.js
===================================================================
--- EDIS/trunk/java/tracking-ui-main/html-template/utilities/autoMaximizeBrowser.js	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/html-template/utilities/autoMaximizeBrowser.js	(revision 1227)
@@ -0,0 +1,10 @@
+ 
+ /** 
+  * Maximize browser to show all components to screen reader 
+  * created by jtorreno 2008.5.12
+  **/
+ function maximizeBrowser() {
+    window.moveTo(0,0);
+    window.resizeTo(screen.width,screen.height);
+ }
+
Index: EDIS/trunk/java/tracking-ui-main/pom.xml
===================================================================
--- EDIS/trunk/java/tracking-ui-main/pom.xml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/pom.xml	(revision 1227)
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+		 xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+	<modelVersion>4.0.0</modelVersion>
+	<parent>
+		<groupId>gov.va.med.edp</groupId>
+		<artifactId>edis-tracking-parent</artifactId>
+		<version>1.0-T29-SNAPSHOT</version>
+		<relativePath>../tracking-parent</relativePath>
+	</parent>
+	<groupId>gov.va.med.edp</groupId>
+	<artifactId>edis-tracking-ui-main</artifactId>
+	<packaging>swf</packaging>
+	<name>EDIS Tracking UI Application</name>
+	<version>1.0-T29-SNAPSHOT</version>
+	<dependencies>
+		<dependency>
+			<groupId>gov.va.med.edp</groupId>
+			<artifactId>edis-tracking-ui-core</artifactId>
+			<version>${project.version}</version>
+			<type>swc</type>
+		</dependency>
+	</dependencies>
+	<build>
+		<sourceDirectory>src/main/flex</sourceDirectory>
+		<resources>
+			<resource>
+				<directory>src/main/resources</directory>
+				<filtering>true</filtering>
+			</resource>
+		</resources>
+		<plugins>
+			<plugin>
+				<groupId>info.flex-mojos</groupId>
+				<artifactId>flex-compiler-mojo</artifactId>
+			</plugin>
+		</plugins>
+	</build>
+	<profiles>
+		<profile>
+			<id>dev</id>
+			<build>
+				<plugins>
+					<plugin>
+						<groupId>info.flex-mojos</groupId>
+						<artifactId>html-wrapper-mojo</artifactId>
+						<configuration>
+							<templateURI>folder:${basedir}/html-template</templateURI>
+						</configuration>
+						<executions>
+							<execution>
+								<goals>
+									<goal>wrapper</goal>
+								</goals>
+							</execution>
+						</executions>
+					</plugin>
+				</plugins>
+			</build>
+		</profile>
+	</profiles>
+</project>
Index: EDIS/trunk/java/tracking-ui-main/src/main/flex/META-INF/MANIFEST.MF
===================================================================
--- EDIS/trunk/java/tracking-ui-main/src/main/flex/META-INF/MANIFEST.MF	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/src/main/flex/META-INF/MANIFEST.MF	(revision 1227)
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+
Index: EDIS/trunk/java/tracking-ui-main/src/main/flex/edp.css
===================================================================
--- EDIS/trunk/java/tracking-ui-main/src/main/flex/edp.css	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/src/main/flex/edp.css	(revision 1227)
@@ -0,0 +1,206 @@
+/* CSS file */
+global {
+    focusThickness: 2;
+    focusBlendMode: difference;
+    letterSpacing: .5;
+    fontThickness: -25;
+}
+
+Application {
+    backgroundColor: #CCCCCC;
+    backgroundGradientColors: #CCCCCC, #EEEEEE;
+    backgroundGradientAlphas: 0.6, 0.4;
+    themeColor: #CCCCCC;
+    font-size: 10;
+    color: black;
+}
+
+Label {
+    font-size: 10;
+	paddingBottom:-1;
+}
+
+Button {
+	paddingBottom:0;
+}
+
+DataGrid {
+    selectionColor: #3366CC;
+    textSelectedColor: white;
+    use-roll-over: false;
+    headerColors: #FFFFFF, #CCCCCC;
+    headerStyleName: gridHeader;
+}
+
+List {
+    selectionColor: #3366CC;
+    textSelectedColor: white;
+    use-roll-over: false;
+}
+
+ComboBox {
+    selection-color: #3366CC;
+    roll-over-color: #3366CC;
+    text-selected-color: white;
+    text-roll-over-color: white;
+	font-weight: normal;
+	paddingBottom:-2;
+}
+
+TextInput {
+    borderColor: #666666;
+	font-weight: normal;
+	paddingBottom:-2;
+}
+
+LinkBar {
+    color: #6B5B5B;
+    disabledColor: #186CDD;
+    text-roll-over-color: #186CDD;
+}
+
+LinkButton {
+    font-weight: bold;
+    font-size: 10;
+    color: #186CDD;
+    roll-over-color: white;
+    selection-color: white;
+	paddingBottom:0;
+}
+
+FormItem {
+    font-weight: bold;
+    font-size: 10;
+    color: #6B5B5B;
+	paddingBottom:-1;
+}
+
+FormHeading {
+	color: #6B5B5B;
+	font-size: 10;
+	paddingBottom:-1;
+}
+
+.linkSelected {
+    font-weight: bold;
+    font-size: 10;
+    color: #6B5B5B;
+    text-roll-over-color: #6B5B5B;
+    text-align: left;
+    padding-left: 2;
+    padding-right: 2;
+	paddingBottom:0;
+    focusRoundedCorners: "tl bl tr br";
+}
+
+.linkUnSelected {
+    color: #186CDD;
+    text-roll-over-color: #186CDD;
+    roll-over-color: white;
+    font-size: 10;
+    font-weight: bold;
+    text-align: left;
+    padding-left: 2;
+    padding-right: 2;
+	paddingBottom:0;
+    focusRoundedCorners: "tl bl tr br";
+}
+
+.reportLabel {
+    font-weight: bold;
+    font-size: 10;
+    color: #6B5B5B;
+}
+
+.controlLabel {
+    font-weight: bold;
+    font-size: 10;
+    color: #6B5B5B;
+}
+
+/** added by jtorreno 2008.02.12 for JAWS accessibility (508) **/
+.accessibleControlLabel {
+    background-color: #F0F0F0;
+    border-color: #F0F0F0;
+    border-style: none;
+    font-size: 10;
+    font-weight: bold;
+    color: #6B5B5B;
+}
+
+.normalLabel {
+    font-weight: normal;
+    font-size: 10;
+    color: black;
+}
+
+.lightLabel {
+    font-weight: normal;
+    font-size: 10;
+    color: gray;
+}
+
+.formField {
+    color: black;
+	font-weight: normal;
+}
+
+.contentArea {
+    background-color: #F0F0F0;
+}
+
+.viewTitle {
+    font-size: 14;
+    font-weight: bold;
+    color: black;
+}
+
+/** added by jtorreno 2008.02.12 for JAWS accessibility (508) **/
+.accessibleViewTitle {
+    font-size: 14;
+    font-weight: bold;
+    color: black;
+    background-color: #CCCCCC;
+    border-color: #CCCCCC;
+    border-style: none;
+}
+
+/** added by jtorreno 2008.02.14 for JAWS accessibility (508) **/
+.accessibleViewReportTitle {
+    font-size: 14;
+    font-weight: bold;
+    color: black;
+    background-color: white;
+    border-color: white;
+    border-style: none;
+}
+
+.subTitle {
+    font-size: 10;
+    font-weight: bold;
+    color: black;
+}
+
+.bottomRightButton {
+    vertical-align: bottom;
+    horizontal-align: right;
+    padding-right: 16;
+    padding-bottom: 16;
+}
+
+.errorText {
+    font-size: 10;
+    font-weight: bold;
+    color: red;
+}
+
+.sessionTimeoutLabel {
+    font-size: 14;
+    font-weight: bold;
+    color: red;
+}
+
+.gridHeader {
+	font-weight: bold;
+	color: #6B5B5B;
+}
Index: EDIS/trunk/java/tracking-ui-main/src/main/flex/tracking.mxml
===================================================================
--- EDIS/trunk/java/tracking-ui-main/src/main/flex/tracking.mxml	(revision 1227)
+++ EDIS/trunk/java/tracking-ui-main/src/main/flex/tracking.mxml	(revision 1227)
@@ -0,0 +1,284 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--tracking.mxml -->
+
+<mx:Application
+		xmlns:mx="http://www.adobe.com/2006/mxml"
+		xmlns:control="gov.va.med.edp.control.*"
+		xmlns:business="gov.va.med.edp.business.*"
+		xmlns:view="gov.va.med.edp.view.*"
+		xmlns:log="gov.va.med.edp.view.log.*"
+		pageTitle="Patient Tracking"
+		height="100%" width="100%" frameRate="100"
+		paddingLeft="0" paddingRight="0" paddingBottom="0" paddingTop="6"
+		creationComplete="initApp()" xmlns:debug="gov.va.med.edp.view.debug.*"
+		initialize="callJSmaxBrowser();">
+
+	<mx:Style source="edp.css"/>
+
+	<mx:Script>
+	<![CDATA[
+import mx.managers.FocusManager;
+import mx.managers.IFocusManagerContainer;
+		import mx.accessibility.ButtonAccImpl;
+		import gov.va.med.edp.widget.LinkButtonTab;
+		import gov.va.med.edp.util.AccessibilityTools;
+		import gov.va.med.edp.control.ModalDialogEvent;
+		import flash.utils.getTimer;
+		import gov.va.med.edp.control.ClearUnsavedViewsModelEvent;
+		import mx.binding.utils.ChangeWatcher;
+		import mx.core.Container;
+		import mx.utils.URLUtil;
+		import com.adobe.cairngorm.control.CairngormEventDispatcher;
+		import com.adobe.cairngorm.control.CairngormEvent;
+		import gov.va.med.edp.model.TrackingModelLocator;
+		import gov.va.med.edp.control.InitAppEvent;
+		import gov.va.med.edp.control.SwitchAppViewEvent;
+		import gov.va.med.edp.control.TrackingEvent;
+		import com.adobe.cairngorm.business.ServiceLocator;
+		import gov.va.med.edp.business.Services;
+		import gov.va.med.edp.vo.LookupVO;
+		import gov.va.med.edp.util.InactivityTimeout;
+		import gov.va.med.edp.view.DisconnectedDialog;
+		import gov.va.med.edp.widget.InfoDialog;
+
+		[Bindable]
+		public var model:TrackingModelLocator = TrackingModelLocator.getInstance();
+
+		[Bindable]
+		private var inactivityTimeout:InactivityTimeout = new InactivityTimeout();
+
+		private var modalCount: int = 0;
+
+		/**
+		 *  Function: callJSmaxBrowser()
+		 *  Parameters:
+		 *			  NA
+		 *  Description:
+		 *	 Calls external javascript to maximize browser and makescreen
+		 *	 component visible if screen reader is activated
+		 *
+		 *  Created by: jtorreno
+		 *
+		 *  Date: 2008.05.12
+		 *
+		 **/
+		private function callJSmaxBrowser():void {
+			trace("** Is screen reader active: " + AccessibilityTools.isAccessibilityActive());
+
+			if (AccessibilityTools.isAccessibilityActive()) {
+				trace("** Calls external javascript to maximize browser and " +
+					  "makescreen component visible")
+				ExternalInterface.call("maximizeBrowser");
+			}
+		}
+
+
+		private function initApp():void
+		{
+			ChangeWatcher.watch(model, "disconnected", connectionStatusChanged);
+			model.reconnectFunction = reconnect;
+
+			var e: InitAppEvent = new InitAppEvent(InitAppEvent.EVENT_INIT_APP);
+			e.appName = TrackingModelLocator.APP_NAME_TRACKING;
+			e.contextRoot = Application.application.parameters.contextRoot;
+			e.helpContextRoot = Application.application.parameters.helpContextRoot;
+			e.protocol = URLUtil.getProtocol(Application.application.url);
+			if (e.protocol == "file") e.protocol = "http";
+
+			// first check the vljServ parameter
+			if (Application.application.parameters.hasOwnProperty("vljServ")) {
+				e.server = Application.application.parameters.vljServ;
+				e.mode = InitAppEvent.SERVICE_USE_VLJ;
+			}
+			// then check the cspServ parameter
+			if ((e.server.length == 0) && Application.application.parameters.hasOwnProperty("cspServ")) {
+				e.server = Application.application.parameters.cspServ;
+				e.mode = InitAppEvent.SERVICE_USE_CSP;
+				e.token = Application.application.parameters.cspToken;
+			}
+			// if running in development mode try localhost
+			if ((e.server.length == 0) && (Application.application.url.substr(0, 7) == "file://")) {
+				e.server = "localhost:7001";
+				e.mode = InitAppEvent.SERVICE_USE_VLJ;
+			}
+			// default:  use the server and port of the HTML wrapper with VLJ
+			if (e.server.length == 0) {
+				e.server = URLUtil.getServerNameWithPort(Application.application.url);
+				e.mode = InitAppEvent.SERVICE_USE_VLJ;
+			}
+			e.dispatch();
+
+			Application.application.pageTitle = "Tracking System: " + e.server;
+
+			if (AccessibilityTools.isAccessibilityActive()) {
+				this.addEventListener(gov.va.med.edp.control.ModalDialogEvent.OPEN, setModalBackground);
+				this.addEventListener(gov.va.med.edp.control.ModalDialogEvent.CLOSE, clearModalBackground);
+			}
+
+			if (ExternalInterface.available) {
+				ExternalInterface.addCallback("getUnsavedDataWarning",
+						function(): String {
+							var x: String = model.modifiedViews();
+							if (x.length > 0) {
+								x = "The following views have unsaved changes: \n\n" + x +
+									"\nDo you want to continue and lose these changes?";
+								return x;
+							}
+							return "";
+						}
+						);
+			}
+		}
+
+		private function connectionStatusChanged(e:Event):void {
+			if (model.disconnected)
+				DisconnectedDialog.show();
+			else
+				DisconnectedDialog.hide();
+		}
+
+		private function reconnect():void {
+			new TrackingEvent(TrackingEvent.EVENT_INIT_TRACKING).dispatch();
+		}
+
+		private function proceed(): void {
+			var e:SwitchAppViewEvent = new SwitchAppViewEvent(SwitchAppViewEvent.EVENT_SWITCH_APP_VIEW);
+			if (model.appViewList.length > 0) {
+				e.view = (model.appViewList[0] as LookupVO).data;
+			}
+			e.dispatch();
+		}
+
+		private function getView(view:Number): Container
+		{
+			if (view == TrackingModelLocator.VIEW_APP_INTRO) {
+				return introView;
+			} else if (view == TrackingModelLocator.VIEW_APP_VERSION_INCOMPATIBILITY) {
+				return versionIncompatibilityView;
+			} else {
+				return trackingViews;
+			}
+		}
+
+		private function set initSessionTimeout(value: uint):void
+		{
+			inactivityTimeout.start();
+		}
+
+		public function set workingStatus(bText:String):void
+		{
+			if (bText.length > 0) {
+/* 				if (lblWorkingStatus.text == "") {   // true when starting timeout
+					ExternalInterface.call("indicateTimeout");
+					trace("done calling indicate timeout");
+				} */
+				currentState = 'sessionTimeOutState';
+				lblWorkingStatus.text = bText;
+			} else {
+				currentState = "";
+				lblWorkingStatus.text = "";
+			}
+		}
+
+		private function setModalBackground(e: ModalDialogEvent): void
+		{
+			if (modalCount == 0) {
+				if (e.dialogPanel != null) {
+//										if (e.dialogPanel is IFocusManagerContainer) {
+					//						if (IFocusManagerContainer(e.dialogPanel).focusManager)
+					//							e.dialogPanel.systemManager.addFocusManager(IFocusManagerContainer(e.dialogPanel));
+					//						else // Popups get their own focus loop
+					//							IFocusManagerContainer(e.dialogPanel).focusManager = new FocusManager(IFocusManagerContainer(e.dialogPanel));
+					//					}
+
+					e.dialogPanel.setStyle("horizontalCenter", 0);
+					e.dialogPanel.setStyle("verticalCenter", 0);
+					emptyBackground.addChild(e.dialogPanel);
+
+				}
+				appView.selectedChild = emptyBackground;
+
+			}
+			modalCount++;
+		}
+
+		private function clearModalBackground(e: ModalDialogEvent): void
+		{
+			modalCount--;
+			if (modalCount == 0) {
+				
+				emptyBackground.removeAllChildren();
+				appView.selectedChild = getView(model.appViewState);
+				callLater(resetSelectionForJaws);
+			}
+		}
+
+		private function resetSelectionForJaws(): void
+		{
+			if (trackingViews != null && trackingViews.appList != null) {
+
+				//            var selectedIndex:int = trackingViews.appList.selectedIndex;
+				//            var dispObj:DisplayObject = trackingViews.appList.getChildAt(selectedIndex);
+				//		      var lbt:LinkButtonTab = LinkButtonTab(dispObj);
+				//			  lbt.setFocus();
+				trackingViews.appList.setFocus();
+			}
+		}
+        
+		
+	]]>
+	</mx:Script>
+
+	<!-- ========================================================================== -->
+
+	<!-- the ServiceLocator where we specify the remote services -->
+	<business:Services id="services"/>
+
+	<!-- the FrontController, containing Commands specific to this appliation -->
+	<control:TrackingController id="controller"/>
+
+	<!-- ========================================================================== -->
+
+	<mx:ViewStack
+			id="appView"
+			width="100%"
+			height="100%"
+			selectedChild="{getView(model.appViewState)}">
+
+		<mx:TitleWindow id="introView" title="Emergency Department Integration Software"/>
+		<mx:Canvas id="emptyBackground" width="100%" height="100%"/>
+		<mx:Canvas id="versionIncompatibilityView">
+			<mx:Panel title="EDIS Version Incompatibility"
+					  paddingTop="10" paddingLeft="10" paddingRight="10" horizontalCenter="0" verticalCenter="0"
+					  width="75%">
+				<mx:Text width="100%">
+					<mx:text>
+						This is EDIS client version '{model.appClientVersion}'.
+						The EDIS server package version running in your VistA account is
+						'{model.session.serverPackageVersion}'.
+						It appears that the web server has served you the wrong version of the user interface for your
+						configuration.
+					</mx:text>
+				</mx:Text>
+				<mx:ControlBar horizontalAlign="right">
+					<mx:Button label="Proceed (Not Recommended)" click="proceed()"/>
+					<mx:Button label="Exit" click="model.logout()"/>
+				</mx:ControlBar>
+			</mx:Panel>
+		</mx:Canvas>
+		<view:TrackingViews id="trackingViews"/>
+	</mx:ViewStack>
+
+	<mx:states>
+		<mx:State name="sessionTimeOutState">
+			<mx:AddChild relativeTo="{appView}" position="after">
+				<mx:target>
+					<mx:Label id="lblWorkingStatus" width="90%" text="" textAlign="center"
+							  styleName="sessionTimeoutLabel"/>
+				</mx:target>
+			</mx:AddChild>
+		</mx:State>
+	</mx:states>
+	<mx:Binding source="model.session.timeOut" destination="initSessionTimeout"/>
+	<mx:Binding source="inactivityTimeout.status" destination="workingStatus"/>
+</mx:Application>
Index: EDIS/trunk/kids/EDP1_0.KID
===================================================================
--- EDIS/trunk/kids/EDP1_0.KID	(revision 1227)
+++ EDIS/trunk/kids/EDP1_0.KID	(revision 1227)
@@ -0,0 +1,16346 @@
+KIDS Distribution saved on Sep 02, 2010@13:17:32
+EDP1_0 RELEASED
+**KIDS**:EMERGENCY DEPARTMENT 1.0^
+
+**INSTALL NAME**
+EMERGENCY DEPARTMENT 1.0
+"BLD",6763,0)
+EMERGENCY DEPARTMENT 1.0^EMERGENCY DEPARTMENT^0^3100902^y
+"BLD",6763,1,0)
+^^4^4^3081118^
+"BLD",6763,1,1,0)
+This is the initial installation of the Emergency Department Information 
+"BLD",6763,1,2,0)
+System (EDIS).  This is the module that handles tracking of a patient 
+"BLD",6763,1,3,0)
+through an emergency department visit.  The user interface for this 
+"BLD",6763,1,4,0)
+application is a web application.
+"BLD",6763,4,0)
+^9.64PA^233.2^7
+"BLD",6763,4,230,0)
+230
+"BLD",6763,4,230,222)
+y^y^f^^^^n
+"BLD",6763,4,230.1,0)
+230.1
+"BLD",6763,4,230.1,222)
+y^y^f^^^^n
+"BLD",6763,4,231.7,0)
+231.7
+"BLD",6763,4,231.7,222)
+y^y^f^^^^n
+"BLD",6763,4,231.8,0)
+231.8
+"BLD",6763,4,231.8,222)
+y^y^f^^^^n
+"BLD",6763,4,231.9,0)
+231.9
+"BLD",6763,4,231.9,222)
+y^y^f^^^^n
+"BLD",6763,4,233.1,0)
+233.1
+"BLD",6763,4,233.1,222)
+y^y^f^^y^^y^r^n
+"BLD",6763,4,233.1,224)
+I $E(^(0),1,4)="edp."
+"BLD",6763,4,233.2,0)
+233.2
+"BLD",6763,4,233.2,222)
+y^y^f^^y^^y^r^n
+"BLD",6763,4,233.2,224)
+I $E(^(0),1,4)="edp."
+"BLD",6763,4,"B",230,230)
+
+"BLD",6763,4,"B",230.1,230.1)
+
+"BLD",6763,4,"B",231.7,231.7)
+
+"BLD",6763,4,"B",231.8,231.8)
+
+"BLD",6763,4,"B",231.9,231.9)
+
+"BLD",6763,4,"B",233.1,233.1)
+
+"BLD",6763,4,"B",233.2,233.2)
+
+"BLD",6763,6.3)
+74
+"BLD",6763,"ABPKG")
+n
+"BLD",6763,"INI")
+EDPYPRE
+"BLD",6763,"INIT")
+EDPYPST
+"BLD",6763,"KRN",0)
+^9.67PA^8989.52^19
+"BLD",6763,"KRN",.4,0)
+.4
+"BLD",6763,"KRN",.401,0)
+.401
+"BLD",6763,"KRN",.402,0)
+.402
+"BLD",6763,"KRN",.403,0)
+.403
+"BLD",6763,"KRN",.5,0)
+.5
+"BLD",6763,"KRN",.84,0)
+.84
+"BLD",6763,"KRN",3.6,0)
+3.6
+"BLD",6763,"KRN",3.8,0)
+3.8
+"BLD",6763,"KRN",9.2,0)
+9.2
+"BLD",6763,"KRN",9.8,0)
+9.8
+"BLD",6763,"KRN",9.8,"NM",0)
+^9.68A^57^53
+"BLD",6763,"KRN",9.8,"NM",1,0)
+EDPFAA^^0^B5372812
+"BLD",6763,"KRN",9.8,"NM",2,0)
+EDPFLEX^^0^B1745474
+"BLD",6763,"KRN",9.8,"NM",3,0)
+EDPFMON^^0^B27211876
+"BLD",6763,"KRN",9.8,"NM",5,0)
+EDPFPER^^0^B3427509
+"BLD",6763,"KRN",9.8,"NM",6,0)
+EDPFPTL^^0^B4915038
+"BLD",6763,"KRN",9.8,"NM",9,0)
+EDPX^^0^B9797287
+"BLD",6763,"KRN",9.8,"NM",10,0)
+EDPRPT^^0^B17619722
+"BLD",6763,"KRN",9.8,"NM",11,0)
+EDPRPT1^^0^B33605254
+"BLD",6763,"KRN",9.8,"NM",12,0)
+EDPRPT10^^0^B19172294
+"BLD",6763,"KRN",9.8,"NM",13,0)
+EDPRPT11^^0^B8054102
+"BLD",6763,"KRN",9.8,"NM",14,0)
+EDPRPT2^^0^B15843773
+"BLD",6763,"KRN",9.8,"NM",15,0)
+EDPRPT3^^0^B8721424
+"BLD",6763,"KRN",9.8,"NM",16,0)
+EDPRPT4^^0^B24084771
+"BLD",6763,"KRN",9.8,"NM",17,0)
+EDPRPT5^^0^B35383693
+"BLD",6763,"KRN",9.8,"NM",18,0)
+EDPRPT6^^0^B9613057
+"BLD",6763,"KRN",9.8,"NM",19,0)
+EDPRPT7^^0^B19582712
+"BLD",6763,"KRN",9.8,"NM",20,0)
+EDPRPT7C^^0^B19611509
+"BLD",6763,"KRN",9.8,"NM",21,0)
+EDPRPT8^^0^B14454195
+"BLD",6763,"KRN",9.8,"NM",22,0)
+EDPRPT9^^0^B1592058
+"BLD",6763,"KRN",9.8,"NM",23,0)
+EDPFMOVE^^0^B43728958
+"BLD",6763,"KRN",9.8,"NM",24,0)
+EDPCONV^^0^B47887788
+"BLD",6763,"KRN",9.8,"NM",25,0)
+EDPBCF^^0^B25096927
+"BLD",6763,"KRN",9.8,"NM",26,0)
+EDPBCM^^0^B17076528
+"BLD",6763,"KRN",9.8,"NM",27,0)
+EDPBPM^^0^B6216911
+"BLD",6763,"KRN",9.8,"NM",28,0)
+EDPBRM^^0^B24385375
+"BLD",6763,"KRN",9.8,"NM",29,0)
+EDPBRS^^0^B19077772
+"BLD",6763,"KRN",9.8,"NM",30,0)
+EDPBSL^^0^B20029785
+"BLD",6763,"KRN",9.8,"NM",31,0)
+EDPBST^^0^B8664749
+"BLD",6763,"KRN",9.8,"NM",32,0)
+EDPCBRD^^0^B4350223
+"BLD",6763,"KRN",9.8,"NM",34,0)
+EDPCTRL^^0^B33410398
+"BLD",6763,"KRN",9.8,"NM",35,0)
+EDPDD^^0^B1560959
+"BLD",6763,"KRN",9.8,"NM",36,0)
+EDPFPTC^^0^B14885802
+"BLD",6763,"KRN",9.8,"NM",37,0)
+EDPLOG^^0^B42149061
+"BLD",6763,"KRN",9.8,"NM",38,0)
+EDPLOG1^^0^B2583250
+"BLD",6763,"KRN",9.8,"NM",39,0)
+EDPLOGA^^0^B10789313
+"BLD",6763,"KRN",9.8,"NM",40,0)
+EDPLOGH^^0^B9457380
+"BLD",6763,"KRN",9.8,"NM",41,0)
+EDPMAIL^^0^B7335309
+"BLD",6763,"KRN",9.8,"NM",42,0)
+EDPQAR^^0^B6639632
+"BLD",6763,"KRN",9.8,"NM",43,0)
+EDPQDB^^0^B37231235
+"BLD",6763,"KRN",9.8,"NM",44,0)
+EDPQDBS^^0^B3113182
+"BLD",6763,"KRN",9.8,"NM",45,0)
+EDPQLE^^0^B40300302
+"BLD",6763,"KRN",9.8,"NM",46,0)
+EDPQLE1^^0^B9736825
+"BLD",6763,"KRN",9.8,"NM",47,0)
+EDPQLP^^0^B12368052
+"BLD",6763,"KRN",9.8,"NM",48,0)
+EDPCSV^^0^B906612
+"BLD",6763,"KRN",9.8,"NM",49,0)
+EDPLPCE^^0^B32802123
+"BLD",6763,"KRN",9.8,"NM",50,0)
+EDPRPT12^^0^B7797789
+"BLD",6763,"KRN",9.8,"NM",51,0)
+EDPRPTBV^^0^B21129991
+"BLD",6763,"KRN",9.8,"NM",52,0)
+EDPCONV1^^0^B10237522
+"BLD",6763,"KRN",9.8,"NM",53,0)
+EDPCDBG^^0^B4038807
+"BLD",6763,"KRN",9.8,"NM",54,0)
+EDPQPCE^^0^B2442064
+"BLD",6763,"KRN",9.8,"NM",55,0)
+EDPBLK^^0^B7330093
+"BLD",6763,"KRN",9.8,"NM",56,0)
+EDPBDL^^0^B11063047
+"BLD",6763,"KRN",9.8,"NM",57,0)
+EDPBKS^^0^B15371728
+"BLD",6763,"KRN",9.8,"NM","B","EDPBCF",25)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPBCM",26)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPBDL",56)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPBKS",57)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPBLK",55)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPBPM",27)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPBRM",28)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPBRS",29)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPBSL",30)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPBST",31)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPCBRD",32)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPCDBG",53)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPCONV",24)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPCONV1",52)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPCSV",48)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPCTRL",34)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPDD",35)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPFAA",1)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPFLEX",2)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPFMON",3)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPFMOVE",23)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPFPER",5)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPFPTC",36)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPFPTL",6)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPLOG",37)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPLOG1",38)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPLOGA",39)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPLOGH",40)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPLPCE",49)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPMAIL",41)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPQAR",42)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPQDB",43)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPQDBS",44)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPQLE",45)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPQLE1",46)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPQLP",47)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPQPCE",54)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT",10)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT1",11)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT10",12)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT11",13)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT12",50)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT2",14)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT3",15)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT4",16)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT5",17)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT6",18)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT7",19)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT7C",20)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT8",21)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPT9",22)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPRPTBV",51)
+
+"BLD",6763,"KRN",9.8,"NM","B","EDPX",9)
+
+"BLD",6763,"KRN",19,0)
+19
+"BLD",6763,"KRN",19,"NM",0)
+^9.68A^18^17
+"BLD",6763,"KRN",19,"NM",1,0)
+EDPF TRACKING MENU ALL^^0
+"BLD",6763,"KRN",19,"NM",2,0)
+EDPF TRACKING MENU CLINICIAN^^0
+"BLD",6763,"KRN",19,"NM",3,0)
+EDPF TRACKING MENU SIGNIN^^0
+"BLD",6763,"KRN",19,"NM",4,0)
+EDPF TRACKING MENU TRIAGE^^0
+"BLD",6763,"KRN",19,"NM",5,0)
+EDPF TRACKING SYSTEM^^0
+"BLD",6763,"KRN",19,"NM",6,0)
+EDPF TRACKING VIEW BOARD^^0
+"BLD",6763,"KRN",19,"NM",7,0)
+EDPF TRACKING VIEW CONFIGURE^^0
+"BLD",6763,"KRN",19,"NM",8,0)
+EDPF TRACKING VIEW DISPOSITION^^0
+"BLD",6763,"KRN",19,"NM",9,0)
+EDPF TRACKING VIEW EDIT CLOSED^^0
+"BLD",6763,"KRN",19,"NM",10,0)
+EDPF TRACKING VIEW REPORTS^^0
+"BLD",6763,"KRN",19,"NM",11,0)
+EDPF TRACKING VIEW SIGNIN^^0
+"BLD",6763,"KRN",19,"NM",12,0)
+EDPF TRACKING VIEW STAFF^^0
+"BLD",6763,"KRN",19,"NM",13,0)
+EDPF TRACKING VIEW TRIAGE^^0
+"BLD",6763,"KRN",19,"NM",14,0)
+EDPF TRACKING VIEW UPDATE^^0
+"BLD",6763,"KRN",19,"NM",16,0)
+EDP CONVERSION^^0
+"BLD",6763,"KRN",19,"NM",17,0)
+EDPS BOARD CONTEXT^^0
+"BLD",6763,"KRN",19,"NM",18,0)
+EDPF BIGBOARD KIOSKS^^0
+"BLD",6763,"KRN",19,"NM","B","EDP CONVERSION",16)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF BIGBOARD KIOSKS",18)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING MENU ALL",1)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING MENU CLINICIAN",2)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING MENU SIGNIN",3)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING MENU TRIAGE",4)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING SYSTEM",5)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW BOARD",6)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW CONFIGURE",7)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW DISPOSITION",8)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW EDIT CLOSED",9)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW REPORTS",10)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW SIGNIN",11)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW STAFF",12)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW TRIAGE",13)
+
+"BLD",6763,"KRN",19,"NM","B","EDPF TRACKING VIEW UPDATE",14)
+
+"BLD",6763,"KRN",19,"NM","B","EDPS BOARD CONTEXT",17)
+
+"BLD",6763,"KRN",19.1,0)
+19.1
+"BLD",6763,"KRN",19.1,"NM",0)
+^9.68A^4^4
+"BLD",6763,"KRN",19.1,"NM",1,0)
+EDPR EXPORT^^0
+"BLD",6763,"KRN",19.1,"NM",2,0)
+EDPR PROVIDER^^0
+"BLD",6763,"KRN",19.1,"NM",3,0)
+EDPR XREF^^0
+"BLD",6763,"KRN",19.1,"NM",4,0)
+EDPF KIOSKS^^0
+"BLD",6763,"KRN",19.1,"NM","B","EDPF KIOSKS",4)
+
+"BLD",6763,"KRN",19.1,"NM","B","EDPR EXPORT",1)
+
+"BLD",6763,"KRN",19.1,"NM","B","EDPR PROVIDER",2)
+
+"BLD",6763,"KRN",19.1,"NM","B","EDPR XREF",3)
+
+"BLD",6763,"KRN",101,0)
+101
+"BLD",6763,"KRN",101,"NM",0)
+^9.68A^25^25
+"BLD",6763,"KRN",101,"NM",1,0)
+EDP CHECK-IN^^0
+"BLD",6763,"KRN",101,"NM",2,0)
+EDP MONITOR^^0
+"BLD",6763,"KRN",101,"NM",3,0)
+FH EVSEND OR^^2
+"BLD",6763,"KRN",101,"NM",4,0)
+GMRC EVSEND OR^^2
+"BLD",6763,"KRN",101,"NM",5,0)
+LR7O CH EVSEND OR^^2
+"BLD",6763,"KRN",101,"NM",6,0)
+OR EVSEND ORG^^2
+"BLD",6763,"KRN",101,"NM",7,0)
+PS EVSEND OR^^2
+"BLD",6763,"KRN",101,"NM",8,0)
+RA EVSEND OR^^2
+"BLD",6763,"KRN",101,"NM",9,0)
+SDAM APPOINTMENT EVENTS^^2
+"BLD",6763,"KRN",101,"NM",10,0)
+EDP OR MONITOR^^0
+"BLD",6763,"KRN",101,"NM",11,0)
+OR EVSEND FH^^2
+"BLD",6763,"KRN",101,"NM",12,0)
+OR EVSEND GMRC^^2
+"BLD",6763,"KRN",101,"NM",13,0)
+OR EVSEND LRCH^^2
+"BLD",6763,"KRN",101,"NM",14,0)
+OR EVSEND PS^^2
+"BLD",6763,"KRN",101,"NM",15,0)
+OR EVSEND RA^^2
+"BLD",6763,"KRN",101,"NM",16,0)
+EDP NEW PATIENT^^0
+"BLD",6763,"KRN",101,"NM",17,0)
+EDPF ADD BOARD^^0
+"BLD",6763,"KRN",101,"NM",18,0)
+EDPF BIGBOARD MENU^^0
+"BLD",6763,"KRN",101,"NM",19,0)
+EDPF BLANK 1^^0
+"BLD",6763,"KRN",101,"NM",20,0)
+EDPF BLANK 2^^0
+"BLD",6763,"KRN",101,"NM",21,0)
+EDPF BLANK 3^^0
+"BLD",6763,"KRN",101,"NM",22,0)
+EDPF CHANGE BOARD^^0
+"BLD",6763,"KRN",101,"NM",23,0)
+EDPF QUIT^^0
+"BLD",6763,"KRN",101,"NM",24,0)
+EDPF REMOVE BOARD^^0
+"BLD",6763,"KRN",101,"NM",25,0)
+EDPF SELECT DIVISION^^0
+"BLD",6763,"KRN",101,"NM","B","EDP CHECK-IN",1)
+
+"BLD",6763,"KRN",101,"NM","B","EDP MONITOR",2)
+
+"BLD",6763,"KRN",101,"NM","B","EDP NEW PATIENT",16)
+
+"BLD",6763,"KRN",101,"NM","B","EDP OR MONITOR",10)
+
+"BLD",6763,"KRN",101,"NM","B","EDPF ADD BOARD",17)
+
+"BLD",6763,"KRN",101,"NM","B","EDPF BIGBOARD MENU",18)
+
+"BLD",6763,"KRN",101,"NM","B","EDPF BLANK 1",19)
+
+"BLD",6763,"KRN",101,"NM","B","EDPF BLANK 2",20)
+
+"BLD",6763,"KRN",101,"NM","B","EDPF BLANK 3",21)
+
+"BLD",6763,"KRN",101,"NM","B","EDPF CHANGE BOARD",22)
+
+"BLD",6763,"KRN",101,"NM","B","EDPF QUIT",23)
+
+"BLD",6763,"KRN",101,"NM","B","EDPF REMOVE BOARD",24)
+
+"BLD",6763,"KRN",101,"NM","B","EDPF SELECT DIVISION",25)
+
+"BLD",6763,"KRN",101,"NM","B","FH EVSEND OR",3)
+
+"BLD",6763,"KRN",101,"NM","B","GMRC EVSEND OR",4)
+
+"BLD",6763,"KRN",101,"NM","B","LR7O CH EVSEND OR",5)
+
+"BLD",6763,"KRN",101,"NM","B","OR EVSEND FH",11)
+
+"BLD",6763,"KRN",101,"NM","B","OR EVSEND GMRC",12)
+
+"BLD",6763,"KRN",101,"NM","B","OR EVSEND LRCH",13)
+
+"BLD",6763,"KRN",101,"NM","B","OR EVSEND ORG",6)
+
+"BLD",6763,"KRN",101,"NM","B","OR EVSEND PS",14)
+
+"BLD",6763,"KRN",101,"NM","B","OR EVSEND RA",15)
+
+"BLD",6763,"KRN",101,"NM","B","PS EVSEND OR",7)
+
+"BLD",6763,"KRN",101,"NM","B","RA EVSEND OR",8)
+
+"BLD",6763,"KRN",101,"NM","B","SDAM APPOINTMENT EVENTS",9)
+
+"BLD",6763,"KRN",409.61,0)
+409.61
+"BLD",6763,"KRN",409.61,"NM",0)
+^9.68A^1^1
+"BLD",6763,"KRN",409.61,"NM",1,0)
+EDPF BIGBOARD KIOSKS^^0
+"BLD",6763,"KRN",409.61,"NM","B","EDPF BIGBOARD KIOSKS",1)
+
+"BLD",6763,"KRN",771,0)
+771
+"BLD",6763,"KRN",870,0)
+870
+"BLD",6763,"KRN",8989.51,0)
+8989.51
+"BLD",6763,"KRN",8989.51,"NM",0)
+^9.68A^6^6
+"BLD",6763,"KRN",8989.51,"NM",1,0)
+EDPF LOCATION^^0
+"BLD",6763,"KRN",8989.51,"NM",2,0)
+EDPF SCREEN SIZES^^0
+"BLD",6763,"KRN",8989.51,"NM",3,0)
+EDPF NURSE STAFF SCREEN^^0
+"BLD",6763,"KRN",8989.51,"NM",4,0)
+EDPF DEBUG START TIME^^0
+"BLD",6763,"KRN",8989.51,"NM",5,0)
+EDPF SCHEDULING TRIGGER^^0
+"BLD",6763,"KRN",8989.51,"NM",6,0)
+EDPF BIGBOARD KIOSKS^^0
+"BLD",6763,"KRN",8989.51,"NM","B","EDPF BIGBOARD KIOSKS",6)
+
+"BLD",6763,"KRN",8989.51,"NM","B","EDPF DEBUG START TIME",4)
+
+"BLD",6763,"KRN",8989.51,"NM","B","EDPF LOCATION",1)
+
+"BLD",6763,"KRN",8989.51,"NM","B","EDPF NURSE STAFF SCREEN",3)
+
+"BLD",6763,"KRN",8989.51,"NM","B","EDPF SCHEDULING TRIGGER",5)
+
+"BLD",6763,"KRN",8989.51,"NM","B","EDPF SCREEN SIZES",2)
+
+"BLD",6763,"KRN",8989.52,0)
+8989.52
+"BLD",6763,"KRN",8994,0)
+8994
+"BLD",6763,"KRN",8994,"NM",0)
+^9.68A^2^2
+"BLD",6763,"KRN",8994,"NM",1,0)
+EDPCBRD RPC^^0
+"BLD",6763,"KRN",8994,"NM",2,0)
+EDPCTRL RPC^^0
+"BLD",6763,"KRN",8994,"NM","B","EDPCBRD RPC",1)
+
+"BLD",6763,"KRN",8994,"NM","B","EDPCTRL RPC",2)
+
+"BLD",6763,"KRN","B",.4,.4)
+
+"BLD",6763,"KRN","B",.401,.401)
+
+"BLD",6763,"KRN","B",.402,.402)
+
+"BLD",6763,"KRN","B",.403,.403)
+
+"BLD",6763,"KRN","B",.5,.5)
+
+"BLD",6763,"KRN","B",.84,.84)
+
+"BLD",6763,"KRN","B",3.6,3.6)
+
+"BLD",6763,"KRN","B",3.8,3.8)
+
+"BLD",6763,"KRN","B",9.2,9.2)
+
+"BLD",6763,"KRN","B",9.8,9.8)
+
+"BLD",6763,"KRN","B",19,19)
+
+"BLD",6763,"KRN","B",19.1,19.1)
+
+"BLD",6763,"KRN","B",101,101)
+
+"BLD",6763,"KRN","B",409.61,409.61)
+
+"BLD",6763,"KRN","B",771,771)
+
+"BLD",6763,"KRN","B",870,870)
+
+"BLD",6763,"KRN","B",8989.51,8989.51)
+
+"BLD",6763,"KRN","B",8989.52,8989.52)
+
+"BLD",6763,"KRN","B",8994,8994)
+
+"BLD",6763,"PRE")
+
+"BLD",6763,"QUES",0)
+^9.62^^
+"BLD",6763,"REQB",0)
+^9.611^^
+"DATA",233.1,1,0)
+edp.acuity.esi1^1^1
+"DATA",233.1,1,2,0)
+^^1^1^3070720^
+"DATA",233.1,1,2,1,0)
+Most critical
+"DATA",233.1,2,0)
+edp.acuity.esi2^2^2
+"DATA",233.1,3,0)
+edp.acuity.esi3^3^3
+"DATA",233.1,4,0)
+edp.acuity.esi4^4^4
+"DATA",233.1,5,0)
+edp.acuity.esi5^5^5
+"DATA",233.1,6,0)
+edp.source.nhcu-onsite^On-Site Nursing Home
+"DATA",233.1,6,2,0)
+^^1^1^3080605^
+"DATA",233.1,6,2,1,0)
+Transfer from on-site nursing home.
+"DATA",233.1,7,0)
+edp.disposition.error^Patient Name Entered in Error^ERR
+"DATA",233.1,8,0)
+edp.status.admitted^Admitted^Admit^^A
+"DATA",233.1,8,2,0)
+^^1^1^3080605^
+"DATA",233.1,8,2,1,0)
+Patient admitted, still in ED.
+"DATA",233.1,9,0)
+edp.status.edobs^ED Observation Unit^EDObs^^AO
+"DATA",233.1,9,2,0)
+^^1^1^3080605^
+"DATA",233.1,9,2,1,0)
+Observation patient under care of the ED.
+"DATA",233.1,15,0)
+edp.delay.inptbed^Obtain Inpatient Bed^13k
+"DATA",233.1,15,2,0)
+^^2^2^3080606^
+"DATA",233.1,15,2,1,0)
+Delay from time admit order written to  Bed Control or House Supervisor 
+"DATA",233.1,15,2,2,0)
+assigns pt to a (eg. ICU pt waiting on ICU bed to open up).
+"DATA",233.1,16,0)
+edp.delay.overcrowd^Overcrowding of ED^13a
+"DATA",233.1,16,2,0)
+^^3^3^3080606^
+"DATA",233.1,16,2,1,0)
+Delay  for an ED bed to become available, includes hallway beds, or beds 
+"DATA",233.1,16,2,2,0)
+unavailable due to staffing issues.  No beds available for inbound 
+"DATA",233.1,16,2,3,0)
+ambulances, including hallway beds.
+"DATA",233.1,17,0)
+edp.delay.admiteval^Admitting Physician Evaluation^13c
+"DATA",233.1,17,2,0)
+^^4^4^3080606^
+"DATA",233.1,17,2,1,0)
+Delay related to admitting doctor's evaluation and confirmation of 
+"DATA",233.1,17,2,2,0)
+disposition. Starts when physician sees patient and ends when H&P done, 
+"DATA",233.1,17,2,3,0)
+ancillary studies necessary to dispo pt done & resulted, pt ready to be 
+"DATA",233.1,17,2,4,0)
+dispositioned.
+"DATA",233.1,18,0)
+edp.delay.admitdispo^Admit Physician Writing Dispo^13h
+"DATA",233.1,18,2,0)
+^^3^3^3080606^
+"DATA",233.1,18,2,1,0)
+Delay due to failure of the physician to Orders write the admit/discharge 
+"DATA",233.1,18,2,2,0)
+order.  Includes time from pt ready for dispo to order written to 
+"DATA",233.1,18,2,3,0)
+admit/discharge.
+"DATA",233.1,19,0)
+edp.delay.admitobs^Patient Admitted to Observation^OBS
+"DATA",233.1,19,2,0)
+^^2^2^3080606^
+"DATA",233.1,19,2,1,0)
+Delay because of pt being admitted to Obs. Includes time from pt ready 
+"DATA",233.1,19,2,2,0)
+for dispo to time order written to admit patient to 23 hours ED/floor obs.
+"DATA",233.1,20,0)
+edp.delay.stafflimit^ED Staff Limits^13b
+"DATA",233.1,20,2,0)
+^^3^3^3080606^
+"DATA",233.1,20,2,1,0)
+Delay in processing pt (seeing or accomplishing orders) timely due to 
+"DATA",233.1,20,2,2,0)
+lack of staff. From time order written to time order accomplished (eg. 
+"DATA",233.1,20,2,3,0)
+splint ankle).
+"DATA",233.1,21,0)
+edp.delay.interfacility^Interfacility Transfer^13m
+"DATA",233.1,21,2,0)
+^^2^2^3080606^
+"DATA",233.1,21,2,1,0)
+Delay caused by inability to transfer patient to another facility in a 
+"DATA",233.1,21,2,2,0)
+timely manner.
+"DATA",233.1,22,0)
+edp.delay.ambulance^Obtain Ambulance Services^13n
+"DATA",233.1,22,2,0)
+^^1^1^3080606^
+"DATA",233.1,22,2,1,0)
+Delay from ambulance request to arrival.
+"DATA",233.1,23,0)
+edp.delay.imageresult^Obtain Imaging Results^13g
+"DATA",233.1,23,2,0)
+^^1^1^3080606^
+"DATA",233.1,23,2,1,0)
+Delay from time study done to time study resulted.
+"DATA",233.1,24,0)
+edp.delay.imagestudy^Obtain Imaging Studies^13f
+"DATA",233.1,24,2,0)
+^^2^2^3080606^
+"DATA",233.1,24,2,1,0)
+Delay from time study ordered to time study is done and available for 
+"DATA",233.1,24,2,2,0)
+interpretation.
+"DATA",233.1,25,0)
+edp.delay.pharm^Obtain Drugs/Pharmacology^13j
+"DATA",233.1,25,2,0)
+^^2^2^3080606^
+"DATA",233.1,25,2,1,0)
+Delay caused by inability to get ordered drugs from Pharmacy.  Includes 
+"DATA",233.1,25,2,2,0)
+delay from time meds ordered to meds received.
+"DATA",233.1,26,0)
+edp.delay.labresult^Obtain Lab Results^13e
+"DATA",233.1,26,2,0)
+^^2^2^3080606^
+"DATA",233.1,26,2,1,0)
+Delay due to lack of timely turn around for labs ordered.  Includes time 
+"DATA",233.1,26,2,2,0)
+from labsdrawn/obtained to labs resulted.
+"DATA",233.1,27,0)
+edp.delay.labstudy^Obtain Lab Studies^13d
+"DATA",233.1,27,2,0)
+^^2^2^3080606^
+"DATA",233.1,27,2,1,0)
+Delay caused by inability to get labs drawn in a timely fashion.Time from 
+"DATA",233.1,27,2,2,0)
+lab order to lab draw.
+"DATA",233.1,28,0)
+edp.delay.supplies^Obtain Medical Supplies^13i
+"DATA",233.1,28,2,0)
+^^3^3^3080606^
+"DATA",233.1,28,2,1,0)
+Delay caused by inability to get medical supplies in a timely fashion. 
+"DATA",233.1,28,2,2,0)
+Includes time from order (or need identified) to receipt of supplies (eg. 
+"DATA",233.1,28,2,3,0)
+splints, crutches, c-line kits).
+"DATA",233.1,29,0)
+edp.delay.surgery^Arrange Emergency Surgery^13l
+"DATA",233.1,29,2,0)
+^^1^1^3080606^
+"DATA",233.1,29,2,1,0)
+Delay in getting pt needing surgery to the OR. 
+"DATA",233.1,30,0)
+edp.delay.home^Patient Transport Home^13p
+"DATA",233.1,30,2,0)
+^^3^3^3080606^
+"DATA",233.1,30,2,1,0)
+Delays caused by inability to find transportation for discharged patient 
+"DATA",233.1,30,2,2,0)
+or delays in identified patient transportation arriving at the EDTime 
+"DATA",233.1,30,2,3,0)
+from pt ready for discharge to pt out of ED.
+"DATA",233.1,31,0)
+edp.delay.transport^Patient Transport Other^13o
+"DATA",233.1,31,2,0)
+^^1^1^3080606^
+"DATA",233.1,31,2,1,0)
+Same as above for destinations other than home.
+"DATA",233.1,35,0)
+edp.disposition.home^Home^H
+"DATA",233.1,35,2,0)
+^^1^1^3080606^
+"DATA",233.1,35,2,1,0)
+Patient discharge to his/her previous living arrangement.
+"DATA",233.1,36,0)
+edp.disposition.admitva^Admitted to VA Ward^VA^^VA
+"DATA",233.1,36,2,0)
+^^1^1^3080606^
+"DATA",233.1,36,2,1,0)
+Patient admitted to an inpatient location, not including ICU/Tele/Psych.
+"DATA",233.1,37,0)
+edp.disposition.left^Left Without Being Treated/Seen^L^^M
+"DATA",233.1,37,2,0)
+^^1^1^3080606^
+"DATA",233.1,37,2,1,0)
+Patient leaves the ED before being treated. Not AMA, as no form signed.
+"DATA",233.1,38,0)
+edp.disposition.xferva^Transferred to VA Facility^O^^A
+"DATA",233.1,38,2,0)
+^^1^1^3080606^
+"DATA",233.1,38,2,1,0)
+Patient is discharged from the ED and sent to another VA facility.
+"DATA",233.1,39,0)
+edp.disposition.ama^AMA^AMA^^M
+"DATA",233.1,39,2,0)
+^^2^2^3080606^
+"DATA",233.1,39,2,1,0)
+Patient left against medical advice; form signed; patient may or may not 
+"DATA",233.1,39,2,2,0)
+have been evaluated medically.
+"DATA",233.1,40,0)
+edp.disposition.clinic^Sent to Urgent Care Clinic^CL
+"DATA",233.1,40,2,0)
+^^3^3^3080606^
+"DATA",233.1,40,2,1,0)
+Patient discharged from the ED and referred to another evaluation clinic 
+"DATA",233.1,40,2,2,0)
+at the same site. Some degree of triage is necessary to make this 
+"DATA",233.1,40,2,3,0)
+judgement.
+"DATA",233.1,41,0)
+edp.disposition.deceased^Deceased^D
+"DATA",233.1,41,2,0)
+^^1^1^3080606^
+"DATA",233.1,41,2,1,0)
+Dead
+"DATA",233.1,42,0)
+edp.disposition.telemetry^Admitted to Telemetry^T^^VA
+"DATA",233.1,42,2,0)
+^^1^1^3080606^
+"DATA",233.1,42,2,1,0)
+Patient admitted to an inpatient telemetry unit.
+"DATA",233.1,43,0)
+edp.disposition.icu^Admitted to ICU^ICU^^VA
+"DATA",233.1,43,2,0)
+^^1^1^3080606^
+"DATA",233.1,43,2,1,0)
+Patient admitted to an inpatient critical care unit.
+"DATA",233.1,44,0)
+edp.disposition.nec^Sent to Nurse Eval / Drop-In Clinic^NEC
+"DATA",233.1,44,2,0)
+^^3^3^3080606^
+"DATA",233.1,44,2,1,0)
+Patient discharged from the ED and referred to another evaluation clinic 
+"DATA",233.1,44,2,2,0)
+at the same site. Some degree of triage is necessary to make this 
+"DATA",233.1,44,2,3,0)
+judgement.
+"DATA",233.1,45,0)
+edp.disposition.eloped^Eloped^E^^M
+"DATA",233.1,45,2,0)
+^^2^2^3080606^
+"DATA",233.1,45,2,1,0)
+Patient left the ED and disposition unknown; patient may have been seen 
+"DATA",233.1,45,2,2,0)
+and evaluated by nurse/doc.
+"DATA",233.1,46,0)
+edp.reserved.novalue^   
+"DATA",233.1,53,0)
+edp.source.clinic-onsite^On-Site Clinic
+"DATA",233.1,53,2,0)
+^^2^2^3080605^
+"DATA",233.1,53,2,1,0)
+Sent by on-site doc, NP, PA, or nurse or other care provider for 
+"DATA",233.1,53,2,2,0)
+evaluation
+"DATA",233.1,54,0)
+edp.source.clinic-offsite^VA Clinic, Off-Site
+"DATA",233.1,54,2,0)
+^^1^1^3080605^
+"DATA",233.1,54,2,1,0)
+Sent by off-site clinic, e.g., CBOC
+"DATA",233.1,55,0)
+edp.source.nhci^NHCI
+"DATA",233.1,57,0)
+edp.disposition.xfernon^Transferred to Non-VA Facility^NVA
+"DATA",233.1,57,2,0)
+^^1^1^3080606^
+"DATA",233.1,57,2,1,0)
+Patient is discharge from the ED and sent to another non-VA facility.
+"DATA",233.1,58,0)
+edp.disposition.psych^Admitted to Psychiatry^PSY^^VA
+"DATA",233.1,58,2,0)
+^^1^1^3080606^
+"DATA",233.1,58,2,1,0)
+Patient admitted to an inpatient psychiatric unit.
+"DATA",233.1,59,0)
+edp.delay.consult^Obtain Consultant^CSLT
+"DATA",233.1,59,2,0)
+^^2^2^3080606^
+"DATA",233.1,59,2,1,0)
+Delay caused by lack of completion of a consult ordered.  Includes time 
+"DATA",233.1,59,2,2,0)
+elapsed from consult requested to consult obtained.
+"DATA",233.1,64,0)
+edp.source.non-referred^Self-Referred
+"DATA",233.1,64,2,0)
+^233.12^2^2^3081003^^
+"DATA",233.1,64,2,1,0)
+From outside community without referral no matter what mode of 
+"DATA",233.1,64,2,2,0)
+transportation.
+"DATA",233.1,65,0)
+edp.source.nhcu-offsite^VA Nursing Home, Off-Site
+"DATA",233.1,65,2,0)
+^^1^1^3080605^
+"DATA",233.1,65,2,1,0)
+Transfer from off-site nursing home.
+"DATA",233.1,66,0)
+edp.source.clinic-nonva^Non-VA Clinic/Office
+"DATA",233.1,66,2,0)
+^^1^1^3080605^
+"DATA",233.1,66,2,1,0)
+Sent by a non-VA clinic, primary care or other providers.
+"DATA",233.1,67,0)
+edp.source.nhcu-nonva^Non-VA Nursing Home
+"DATA",233.1,67,2,0)
+^^1^1^3080605^
+"DATA",233.1,67,2,1,0)
+Sent from a non-VA nursing home.
+"DATA",233.1,68,0)
+edp.source.other^Transfer, Other
+"DATA",233.1,68,2,0)
+^^1^1^3080605^
+"DATA",233.1,68,2,1,0)
+Other transfers, like VA ED-to-ED transfer for specific subspecialty care.
+"DATA",233.1,69,0)
+edp.status.enroute^En Route/Prearrival
+"DATA",233.1,69,2,0)
+^^1^1^3080605^
+"DATA",233.1,69,2,1,0)
+En-route to the ED.
+"DATA",233.1,70,0)
+edp.status.waiting^Awaiting Triage
+"DATA",233.1,70,2,0)
+^^1^1^3080605^
+"DATA",233.1,70,2,1,0)
+At the ED, awaiting triage.
+"DATA",233.1,71,0)
+edp.status.edpatient^ED Patient
+"DATA",233.1,71,2,0)
+^^1^1^3080605^
+"DATA",233.1,71,2,1,0)
+ED patient, after triage.
+"DATA",233.1,72,0)
+edp.status.boarding^ED Boarding [Hold]
+"DATA",233.1,72,2,0)
+^^1^1^3080605^
+"DATA",233.1,72,2,1,0)
+Admitted and designated as a Holder (extended time in ED).
+"DATA",233.1,73,0)
+edp.status.discharged^Discharged
+"DATA",233.1,73,2,0)
+^^1^1^3080605^
+"DATA",233.1,73,2,1,0)
+Discharged, still in ED.
+"DATA",233.1,74,0)
+edp.delay.edtobed^ED to Hospital Bed
+"DATA",233.1,74,2,0)
+^233.12^2^2^3080606^^
+"DATA",233.1,74,2,1,0)
+Delay from time hospital bed assigned to pt transported from 
+"DATA",233.1,74,2,2,0)
+ED(eg.waiting on escort).
+"DATA",233.1,75,0)
+edp.delay.physicianlimit^ED Physician Limits
+"DATA",233.1,75,2,0)
+^^3^3^3080606^
+"DATA",233.1,75,2,1,0)
+Delay caused by physicians seeing patients. Includes elapsed time from pt 
+"DATA",233.1,75,2,2,0)
+placed in bed to pt seen by provider(eg. five chest pains arrive in 10 
+"DATA",233.1,75,2,3,0)
+minutes).
+"DATA",233.1,76,0)
+edp.delay.oncall^On-call Staff
+"DATA",233.1,76,2,0)
+^^1^1^3080606^
+"DATA",233.1,76,2,1,0)
+Delays caused by inability to contact on-call staff.
+"DATA",233.1,77,0)
+edp.delay.acceptphysician^Obtain Accepting Physician
+"DATA",233.1,77,2,0)
+^^3^3^3080606^
+"DATA",233.1,77,2,1,0)
+Delay caused by inability to find an accepting physician to admit 
+"DATA",233.1,77,2,2,0)
+patient.Includes elapsed time to obtain accepting physician after need 
+"DATA",233.1,77,2,3,0)
+for pt admission determined.
+"DATA",233.1,78,0)
+edp.delay.escort^Obtain Escort
+"DATA",233.1,78,2,0)
+^^3^3^3080606^
+"DATA",233.1,78,2,1,0)
+Delay in getting escort to transport pt.  Includes elapsed time from time 
+"DATA",233.1,78,2,2,0)
+escort called to time escort arrives to transport patient to inpatient 
+"DATA",233.1,78,2,3,0)
+unit, clinic, or radiology.
+"DATA",233.2,1,0)
+edp.acuity
+"DATA",233.2,1,1,0)
+^233.21A^5^5
+"DATA",233.2,1,1,1,0)
+1^1
+"DATA",233.2,1,1,2,0)
+2^2
+"DATA",233.2,1,1,3,0)
+3^3
+"DATA",233.2,1,1,4,0)
+4^4
+"DATA",233.2,1,1,5,0)
+5^5
+"DATA",233.2,3,0)
+edp.status
+"DATA",233.2,3,1,0)
+^233.21A^11^7
+"DATA",233.2,3,1,1,0)
+10^69
+"DATA",233.2,3,1,2,0)
+20^70
+"DATA",233.2,3,1,7,0)
+30^71
+"DATA",233.2,3,1,8,0)
+40^8
+"DATA",233.2,3,1,9,0)
+50^72
+"DATA",233.2,3,1,10,0)
+60^9
+"DATA",233.2,3,1,11,0)
+70^73
+"DATA",233.2,4,0)
+edp.delay
+"DATA",233.2,4,1,0)
+^233.21A^23^23
+"DATA",233.2,4,1,1,0)
+10^15
+"DATA",233.2,4,1,2,0)
+20^74
+"DATA",233.2,4,1,3,0)
+30^16
+"DATA",233.2,4,1,4,0)
+40^17
+"DATA",233.2,4,1,5,0)
+50^18
+"DATA",233.2,4,1,6,0)
+60^19
+"DATA",233.2,4,1,7,0)
+70^20
+"DATA",233.2,4,1,8,0)
+80^75
+"DATA",233.2,4,1,9,0)
+90^21
+"DATA",233.2,4,1,10,0)
+100^22
+"DATA",233.2,4,1,11,0)
+110^23
+"DATA",233.2,4,1,12,0)
+120^24
+"DATA",233.2,4,1,13,0)
+130^25
+"DATA",233.2,4,1,14,0)
+140^26
+"DATA",233.2,4,1,15,0)
+150^27
+"DATA",233.2,4,1,16,0)
+160^28
+"DATA",233.2,4,1,17,0)
+170^29
+"DATA",233.2,4,1,18,0)
+180^59
+"DATA",233.2,4,1,19,0)
+190^76
+"DATA",233.2,4,1,20,0)
+200^30
+"DATA",233.2,4,1,21,0)
+210^31
+"DATA",233.2,4,1,22,0)
+220^77
+"DATA",233.2,4,1,23,0)
+230^78
+"DATA",233.2,5,0)
+edp.arrival
+"DATA",233.2,5,1,0)
+^233.21A^8^8
+"DATA",233.2,5,1,1,0)
+10^64
+"DATA",233.2,5,1,2,0)
+20^53
+"DATA",233.2,5,1,3,0)
+30^6
+"DATA",233.2,5,1,4,0)
+40^54
+"DATA",233.2,5,1,5,0)
+50^65
+"DATA",233.2,5,1,6,0)
+60^66
+"DATA",233.2,5,1,7,0)
+70^67
+"DATA",233.2,5,1,8,0)
+80^68
+"DATA",233.2,6,0)
+edp.disposition
+"DATA",233.2,6,1,0)
+^233.21A^14^14
+"DATA",233.2,6,1,1,0)
+10^36
+"DATA",233.2,6,1,2,0)
+60^39
+"DATA",233.2,6,1,3,0)
+130^40
+"DATA",233.2,6,1,4,0)
+110^41
+"DATA",233.2,6,1,5,0)
+80^45
+"DATA",233.2,6,1,6,0)
+50^35
+"DATA",233.2,6,1,7,0)
+30^43
+"DATA",233.2,6,1,8,0)
+70^37
+"DATA",233.2,6,1,9,0)
+120^44
+"DATA",233.2,6,1,10,0)
+20^42
+"DATA",233.2,6,1,11,0)
+90^38
+"DATA",233.2,6,1,12,0)
+100^57
+"DATA",233.2,6,1,13,0)
+40^58
+"DATA",233.2,6,1,14,0)
+300^7
+"FIA",230)
+ED LOG
+"FIA",230,0)
+^EDP(230,
+"FIA",230,0,0)
+230D
+"FIA",230,0,1)
+y^y^f^^^^n
+"FIA",230,0,10)
+
+"FIA",230,0,11)
+
+"FIA",230,0,"RLRO")
+
+"FIA",230,0,"VR")
+1.0^EMERGENCY DEPARTMENT
+"FIA",230,230)
+0
+"FIA",230,230.04)
+0
+"FIA",230,230.08)
+0
+"FIA",230.1)
+ED LOG HISTORY
+"FIA",230.1,0)
+^EDP(230.1,
+"FIA",230.1,0,0)
+230.1P
+"FIA",230.1,0,1)
+y^y^f^^^^n
+"FIA",230.1,0,10)
+
+"FIA",230.1,0,11)
+
+"FIA",230.1,0,"RLRO")
+
+"FIA",230.1,0,"VR")
+1.0^EMERGENCY DEPARTMENT
+"FIA",230.1,230.1)
+0
+"FIA",231.7)
+TRACKING STAFF
+"FIA",231.7,0)
+^EDPB(231.7,
+"FIA",231.7,0,0)
+231.7P
+"FIA",231.7,0,1)
+y^y^f^^^^n
+"FIA",231.7,0,10)
+
+"FIA",231.7,0,11)
+
+"FIA",231.7,0,"RLRO")
+
+"FIA",231.7,0,"VR")
+1.0^EMERGENCY DEPARTMENT
+"FIA",231.7,231.7)
+0
+"FIA",231.8)
+TRACKING ROOM-BED
+"FIA",231.8,0)
+^EDPB(231.8,
+"FIA",231.8,0,0)
+231.8
+"FIA",231.8,0,1)
+y^y^f^^^^n
+"FIA",231.8,0,10)
+
+"FIA",231.8,0,11)
+
+"FIA",231.8,0,"RLRO")
+
+"FIA",231.8,0,"VR")
+1.0^EMERGENCY DEPARTMENT
+"FIA",231.8,231.8)
+0
+"FIA",231.9)
+TRACKING AREA
+"FIA",231.9,0)
+^EDPB(231.9,
+"FIA",231.9,0,0)
+231.9
+"FIA",231.9,0,1)
+y^y^f^^^^n
+"FIA",231.9,0,10)
+
+"FIA",231.9,0,11)
+
+"FIA",231.9,0,"RLRO")
+
+"FIA",231.9,0,"VR")
+1.0^EMERGENCY DEPARTMENT
+"FIA",231.9,231.9)
+0
+"FIA",231.9,231.93)
+0
+"FIA",231.9,231.94)
+0
+"FIA",231.9,231.941)
+0
+"FIA",233.1)
+TRACKING CODE
+"FIA",233.1,0)
+^EDPB(233.1,
+"FIA",233.1,0,0)
+233.1
+"FIA",233.1,0,1)
+y^y^f^^y^^y^r^n
+"FIA",233.1,0,10)
+
+"FIA",233.1,0,11)
+I $E(^(0),1,4)="edp."
+"FIA",233.1,0,"RLRO")
+
+"FIA",233.1,0,"VR")
+1.0^EMERGENCY DEPARTMENT
+"FIA",233.1,233.1)
+0
+"FIA",233.1,233.12)
+0
+"FIA",233.2)
+TRACKING CODE SET
+"FIA",233.2,0)
+^EDPB(233.2,
+"FIA",233.2,0,0)
+233.2
+"FIA",233.2,0,1)
+y^y^f^^y^^y^r^n
+"FIA",233.2,0,10)
+
+"FIA",233.2,0,11)
+I $E(^(0),1,4)="edp."
+"FIA",233.2,0,"RLRO")
+
+"FIA",233.2,0,"VR")
+1.0^EMERGENCY DEPARTMENT
+"FIA",233.2,233.2)
+0
+"FIA",233.2,233.21)
+0
+"FRV1",233.2,"1,1,1,0",2)
+edp.acuity.esi1
+"FRV1",233.2,"1,1,1,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"1,1,2,0",2)
+edp.acuity.esi2
+"FRV1",233.2,"1,1,2,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"1,1,3,0",2)
+edp.acuity.esi3
+"FRV1",233.2,"1,1,3,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"1,1,4,0",2)
+edp.acuity.esi4
+"FRV1",233.2,"1,1,4,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"1,1,5,0",2)
+edp.acuity.esi5
+"FRV1",233.2,"1,1,5,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"3,1,1,0",2)
+edp.status.enroute
+"FRV1",233.2,"3,1,1,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"3,1,10,0",2)
+edp.status.edobs
+"FRV1",233.2,"3,1,10,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"3,1,11,0",2)
+edp.status.discharged
+"FRV1",233.2,"3,1,11,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"3,1,2,0",2)
+edp.status.waiting
+"FRV1",233.2,"3,1,2,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"3,1,7,0",2)
+edp.status.edpatient
+"FRV1",233.2,"3,1,7,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"3,1,8,0",2)
+edp.status.admitted
+"FRV1",233.2,"3,1,8,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"3,1,9,0",2)
+edp.status.boarding
+"FRV1",233.2,"3,1,9,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,1,0",2)
+edp.delay.inptbed
+"FRV1",233.2,"4,1,1,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,10,0",2)
+edp.delay.ambulance
+"FRV1",233.2,"4,1,10,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,11,0",2)
+edp.delay.imageresult
+"FRV1",233.2,"4,1,11,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,12,0",2)
+edp.delay.imagestudy
+"FRV1",233.2,"4,1,12,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,13,0",2)
+edp.delay.pharm
+"FRV1",233.2,"4,1,13,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,14,0",2)
+edp.delay.labresult
+"FRV1",233.2,"4,1,14,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,15,0",2)
+edp.delay.labstudy
+"FRV1",233.2,"4,1,15,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,16,0",2)
+edp.delay.supplies
+"FRV1",233.2,"4,1,16,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,17,0",2)
+edp.delay.surgery
+"FRV1",233.2,"4,1,17,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,18,0",2)
+edp.delay.consult
+"FRV1",233.2,"4,1,18,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,19,0",2)
+edp.delay.oncall
+"FRV1",233.2,"4,1,19,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,2,0",2)
+edp.delay.edtobed
+"FRV1",233.2,"4,1,2,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,20,0",2)
+edp.delay.home
+"FRV1",233.2,"4,1,20,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,21,0",2)
+edp.delay.transport
+"FRV1",233.2,"4,1,21,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,22,0",2)
+edp.delay.acceptphysician
+"FRV1",233.2,"4,1,22,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,23,0",2)
+edp.delay.escort
+"FRV1",233.2,"4,1,23,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,3,0",2)
+edp.delay.overcrowd
+"FRV1",233.2,"4,1,3,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,4,0",2)
+edp.delay.admiteval
+"FRV1",233.2,"4,1,4,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,5,0",2)
+edp.delay.admitdispo
+"FRV1",233.2,"4,1,5,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,6,0",2)
+edp.delay.admitobs
+"FRV1",233.2,"4,1,6,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,7,0",2)
+edp.delay.stafflimit
+"FRV1",233.2,"4,1,7,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,8,0",2)
+edp.delay.physicianlimit
+"FRV1",233.2,"4,1,8,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"4,1,9,0",2)
+edp.delay.interfacility
+"FRV1",233.2,"4,1,9,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"5,1,1,0",2)
+edp.source.non-referred
+"FRV1",233.2,"5,1,1,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"5,1,2,0",2)
+edp.source.clinic-onsite
+"FRV1",233.2,"5,1,2,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"5,1,3,0",2)
+edp.source.nhcu-onsite
+"FRV1",233.2,"5,1,3,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"5,1,4,0",2)
+edp.source.clinic-offsite
+"FRV1",233.2,"5,1,4,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"5,1,5,0",2)
+edp.source.nhcu-offsite
+"FRV1",233.2,"5,1,5,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"5,1,6,0",2)
+edp.source.clinic-nonva
+"FRV1",233.2,"5,1,6,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"5,1,7,0",2)
+edp.source.nhcu-nonva
+"FRV1",233.2,"5,1,7,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"5,1,8,0",2)
+edp.source.other
+"FRV1",233.2,"5,1,8,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,1,0",2)
+edp.disposition.admitva
+"FRV1",233.2,"6,1,1,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,10,0",2)
+edp.disposition.telemetry
+"FRV1",233.2,"6,1,10,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,11,0",2)
+edp.disposition.xferva
+"FRV1",233.2,"6,1,11,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,12,0",2)
+edp.disposition.xfernon
+"FRV1",233.2,"6,1,12,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,13,0",2)
+edp.disposition.psych
+"FRV1",233.2,"6,1,13,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,14,0",2)
+edp.disposition.error
+"FRV1",233.2,"6,1,14,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,2,0",2)
+edp.disposition.ama
+"FRV1",233.2,"6,1,2,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,3,0",2)
+edp.disposition.clinic
+"FRV1",233.2,"6,1,3,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,4,0",2)
+edp.disposition.deceased
+"FRV1",233.2,"6,1,4,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,5,0",2)
+edp.disposition.eloped
+"FRV1",233.2,"6,1,5,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,6,0",2)
+edp.disposition.home
+"FRV1",233.2,"6,1,6,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,7,0",2)
+edp.disposition.icu
+"FRV1",233.2,"6,1,7,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,8,0",2)
+edp.disposition.left
+"FRV1",233.2,"6,1,8,0",2,"F")
+;EDPB(233.1,
+"FRV1",233.2,"6,1,9,0",2)
+edp.disposition.nec
+"FRV1",233.2,"6,1,9,0",2,"F")
+;EDPB(233.1,
+"INI")
+EDPYPRE
+"INIT")
+EDPYPST
+"IX",230,230,"AC",0)
+230^AC^SITE,AREA,IEN when entry is active (not closed)^R^^R^IR^I^230^^^^^S
+"IX",230,230,"AC",.1,0)
+^^1^1^3080912^
+"IX",230,230,"AC",.1,1,0)
+List the patients that are currently active on the display board.
+"IX",230,230,"AC",1)
+S ^EDP(230,"AC",$E(X(1),1,30),$E(X(2),1,30),DA)=""
+"IX",230,230,"AC",1.4)
+S X='X2(3)
+"IX",230,230,"AC",2)
+K ^EDP(230,"AC",$E(X(1),1,30),$E(X(2),1,30),DA)
+"IX",230,230,"AC",2.5)
+K ^EDP(230,"AC")
+"IX",230,230,"AC",11.1,0)
+^.114IA^3^3
+"IX",230,230,"AC",11.1,1,0)
+1^F^230^.02^30^1^F
+"IX",230,230,"AC",11.1,2,0)
+2^F^230^.03^30^2^F
+"IX",230,230,"AC",11.1,3,0)
+3^F^230^.07^2^^F
+"IX",230,230,"ADUP1",0)
+230^ADUP1^SITE,AREA,LASTNAME,IEN for active patients^MU^^R^IR^I^230^^^^^S
+"IX",230,230,"ADUP1",.1,0)
+^^3^3^3081003^
+"IX",230,230,"ADUP1",.1,1,0)
+This contributes the last name to the ADUP xref, which helps in 
+"IX",230,230,"ADUP1",.1,2,0)
+identifying patients with similar names or similar brief identifiers.  
+"IX",230,230,"ADUP1",.1,3,0)
+Only active (not closed) entries are in the cross reference.
+"IX",230,230,"ADUP1",1)
+S ^EDP(230,"ADUP",X(1),X(2),X(3),DA)=""
+"IX",230,230,"ADUP1",1.4)
+S X='X2(4)
+"IX",230,230,"ADUP1",2)
+K ^EDP(230,"ADUP",X(1),X(2),X(3),DA)
+"IX",230,230,"ADUP1",2.5)
+
+"IX",230,230,"ADUP1",11.1,0)
+^.114IA^4^4
+"IX",230,230,"ADUP1",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"ADUP1",11.1,2,0)
+2^F^230^.03^^2^F
+"IX",230,230,"ADUP1",11.1,3,0)
+3^F^230^.04^^3^F
+"IX",230,230,"ADUP1",11.1,3,2)
+S X=$P(X,",")
+"IX",230,230,"ADUP1",11.1,4,0)
+4^F^230^.07^^^F
+"IX",230,230,"ADUP2",0)
+230^ADUP2^SITE,AREA,LAST4,IEN for active patients^MU^^R^IR^I^230^^^^^S
+"IX",230,230,"ADUP2",.1,0)
+^^3^3^3081003^
+"IX",230,230,"ADUP2",.1,1,0)
+This contributes the last initial / last 4 to the ADUP xref, which helps
+"IX",230,230,"ADUP2",.1,2,0)
+in identifying patients with similar names or similar brief identifiers.
+"IX",230,230,"ADUP2",.1,3,0)
+Only active (not closed) entries are in the cross reference.
+"IX",230,230,"ADUP2",1)
+S ^EDP(230,"ADUP",X(1),X(2),X(3),DA)=""
+"IX",230,230,"ADUP2",1.4)
+S X='X2(4)
+"IX",230,230,"ADUP2",2)
+K ^EDP(230,"ADUP",X(1),X(2),X(3),DA)
+"IX",230,230,"ADUP2",2.5)
+
+"IX",230,230,"ADUP2",11.1,0)
+^.114IA^4^4
+"IX",230,230,"ADUP2",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"ADUP2",11.1,2,0)
+2^F^230^.03^^2^F
+"IX",230,230,"ADUP2",11.1,3,0)
+3^F^230^.11^^3^F
+"IX",230,230,"ADUP2",11.1,4,0)
+4^F^230^.07^^^F
+"IX",230,230,"AL",0)
+230^AL^SITE, AREA, LOC, IEN when entry is active^R^^R^IR^I^230^^^^^S
+"IX",230,230,"AL",.1,0)
+^^1^1^3080912^
+"IX",230,230,"AL",.1,1,0)
+Allows checking for beds / areas that are currently occupied.
+"IX",230,230,"AL",1)
+S ^EDP(230,"AL",X(1),X(2),X(3),DA)=""
+"IX",230,230,"AL",1.4)
+S X='X2(4)
+"IX",230,230,"AL",2)
+K ^EDP(230,"AL",X(1),X(2),X(3),DA)
+"IX",230,230,"AL",2.5)
+K ^EDP(230,"AL")
+"IX",230,230,"AL",11.1,0)
+^.114IA^4^4
+"IX",230,230,"AL",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"AL",11.1,2,0)
+2^F^230^.03^^2^F
+"IX",230,230,"AL",11.1,3,0)
+3^F^230^3.4^^3^F
+"IX",230,230,"AL",11.1,4,0)
+4^F^230^.07^^^F
+"IX",230,230,"AN",0)
+230^AN^SITE,AREA,PTNAME,IEN for active patients^R^^R^IR^I^230^^^^^S
+"IX",230,230,"AN",.1,0)
+^^8^8^3081003^
+"IX",230,230,"AN",.1,1,0)
+Allows for checking to see if the patient is already active in the case 
+"IX",230,230,"AN",.1,2,0)
+where the patient does not have a DFN (i.e., humanitarian).  It is 
+"IX",230,230,"AN",.1,3,0)
+referenced when adding a new patient to the board.
+"IX",230,230,"AN",.1,4,0)
+ 
+"IX",230,230,"AN",.1,5,0)
+The AN cross reference contains the full name.  It differs from the ADUP 
+"IX",230,230,"AN",.1,6,0)
+cross reference in that the ADUP cross reference contains specific 
+"IX",230,230,"AN",.1,7,0)
+attributes that are to be monitored (such as last name & last initial / 
+"IX",230,230,"AN",.1,8,0)
+last 4) for special indication on the display board.
+"IX",230,230,"AN",1)
+S ^EDP(230,"AN",X(1),X(2),X(3),DA)=""
+"IX",230,230,"AN",1.4)
+S X='X2(4)
+"IX",230,230,"AN",2)
+K ^EDP(230,"AN",X(1),X(2),X(3),DA)
+"IX",230,230,"AN",2.5)
+K ^EDP(230,"AN")
+"IX",230,230,"AN",11.1,0)
+^.114IA^4^4
+"IX",230,230,"AN",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"AN",11.1,2,0)
+2^F^230^.03^^2^F
+"IX",230,230,"AN",11.1,3,0)
+3^F^230^.04^^3^F
+"IX",230,230,"AN",11.1,4,0)
+4^F^230^.07^^^F
+"IX",230,230,"AO",0)
+230^AO^ORDER,IEN for all patients^R^^F^IR^W^230.08^^^^^S
+"IX",230,230,"AO",.1,0)
+^^2^2^3080912^
+"IX",230,230,"AO",.1,1,0)
+This is used to locate orders when they need to be updated from the event 
+"IX",230,230,"AO",.1,2,0)
+monitor.
+"IX",230,230,"AO",1)
+S ^EDP(230,"AO",$E(X,1,30),DA(1),DA)=""
+"IX",230,230,"AO",2)
+K ^EDP(230,"AO",$E(X,1,30),DA(1),DA)
+"IX",230,230,"AO",2.5)
+K ^EDP(230,"AO")
+"IX",230,230,"AO",11.1,0)
+^.114IA^1^1
+"IX",230,230,"AO",11.1,1,0)
+1^F^230.08^.01^30^1^F
+"IX",230,230,"AP",0)
+230^AP^SITE,AREA,DFN,IEN for active patients at site (not closed)^R^^R^IR^I^230^^^^^S
+"IX",230,230,"AP",.1,0)
+^^3^3^3081004^
+"IX",230,230,"AP",.1,1,0)
+Allows testing of duplicate patient entry when selecting patients to add 
+"IX",230,230,"AP",.1,2,0)
+to the display board in the case where the patient has a DFN.  The cross 
+"IX",230,230,"AP",.1,3,0)
+reference is set only for entries that are active (not closed).
+"IX",230,230,"AP",1)
+S ^EDP(230,"AP",X(1),X(2),X(3),DA)=""
+"IX",230,230,"AP",1.4)
+S X='X2(4)
+"IX",230,230,"AP",2)
+K ^EDP(230,"AP",X(1),X(2),X(3),DA)
+"IX",230,230,"AP",2.5)
+K ^EDP(230,"AP")
+"IX",230,230,"AP",11.1,0)
+^.114IA^5^4
+"IX",230,230,"AP",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"AP",11.1,1,3)
+
+"IX",230,230,"AP",11.1,3,0)
+2^F^230^.03^^2^F
+"IX",230,230,"AP",11.1,3,3)
+
+"IX",230,230,"AP",11.1,4,0)
+3^F^230^.06^^3^F
+"IX",230,230,"AP",11.1,4,3)
+
+"IX",230,230,"AP",11.1,5,0)
+4^F^230^.07^^^F
+"IX",230,230,"AP",11.1,5,3)
+
+"IX",230,230,"APA",0)
+230^APA^DFN,IEN for currently active patients^R^^R^IR^I^230^^^^^S
+"IX",230,230,"APA",.1,0)
+^^2^2^3080912^
+"IX",230,230,"APA",.1,1,0)
+Used by the event monitors to identify a patient that is actively being 
+"IX",230,230,"APA",.1,2,0)
+tracked through a visit (regardless of area).
+"IX",230,230,"APA",1)
+S ^EDP(230,"APA",X(1),DA)=""
+"IX",230,230,"APA",1.4)
+S X='X2(2)
+"IX",230,230,"APA",2)
+K ^EDP(230,"APA",X(1),DA)
+"IX",230,230,"APA",2.5)
+K ^EDP(230,"APA")
+"IX",230,230,"APA",11.1,0)
+^.114IA^2^2
+"IX",230,230,"APA",11.1,1,0)
+1^F^230^.06^^1^F
+"IX",230,230,"APA",11.1,2,0)
+2^F^230^.07^^^F
+"IX",230,230,"AS",0)
+230^AS^SITE,AREA,SSN,IEN for active patients^R^^R^IR^I^230^^^^^S
+"IX",230,230,"AS",.1,0)
+^^3^3^3081004^
+"IX",230,230,"AS",.1,1,0)
+Allows for checking to see if the patient is already on the display board 
+"IX",230,230,"AS",.1,2,0)
+in the case where there is no DFN and a social security number is used to 
+"IX",230,230,"AS",.1,3,0)
+identify the patient.
+"IX",230,230,"AS",1)
+S ^EDP(230,"AS",X(1),X(2),X(3),DA)=""
+"IX",230,230,"AS",1.4)
+S X='X2(4)
+"IX",230,230,"AS",2)
+K ^EDP(230,"AS",X(1),X(2),X(3),DA)
+"IX",230,230,"AS",2.5)
+K ^EDP(230,"AS")
+"IX",230,230,"AS",11.1,0)
+^.114IA^4^4
+"IX",230,230,"AS",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"AS",11.1,2,0)
+2^F^230^.03^^2^F
+"IX",230,230,"AS",11.1,3,0)
+3^F^230^.05^^3^F
+"IX",230,230,"AS",11.1,4,0)
+4^F^230^.07^^^F
+"IX",230,230,"ATI",0)
+230^ATI^SITE,TIME IN for reports^MU^^R^IR^I^230^^^^^S
+"IX",230,230,"ATI",.1,0)
+^^1^1^3080912^
+"IX",230,230,"ATI",.1,1,0)
+Used for reports to get a range of visits within a time range.
+"IX",230,230,"ATI",1)
+S ^EDP(230,"ATI",X(1),+X(2),DA)=""
+"IX",230,230,"ATI",2)
+K ^EDP(230,"ATI",X(1),+X(2),DA)
+"IX",230,230,"ATI",2.5)
+K ^EDP(230,"ATI")
+"IX",230,230,"ATI",11.1,0)
+^.114IA^2^2
+"IX",230,230,"ATI",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"ATI",11.1,2,0)
+2^F^230^.08^^2^F
+"IX",230,230,"ATO",0)
+230^ATO^SITE,TIME OUT for reports^R^^R^IR^I^230^^^^^S
+"IX",230,230,"ATO",.1,0)
+^^2^2^3080912^
+"IX",230,230,"ATO",.1,1,0)
+Used for reports to get a range of visits that were closed within a time 
+"IX",230,230,"ATO",.1,2,0)
+range.
+"IX",230,230,"ATO",1)
+S ^EDP(230,"ATO",X(1),X(2),DA)=""
+"IX",230,230,"ATO",2)
+K ^EDP(230,"ATO",X(1),X(2),DA)
+"IX",230,230,"ATO",2.5)
+K ^EDP(230,"ATO")
+"IX",230,230,"ATO",11.1,0)
+^.114IA^2^2
+"IX",230,230,"ATO",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"ATO",11.1,2,0)
+2^F^230^.09^^2^F
+"IX",230,230,"PDFN",0)
+230^PDFN^SITE,AREA,DFN,IEN for all patients^R^^R^IR^I^230^^^^^LS
+"IX",230,230,"PDFN",.1,0)
+^^4^4^3081222^
+"IX",230,230,"PDFN",.1,1,0)
+Indexes all entries by patient DFN.  When special lookups are done 
+"IX",230,230,"PDFN",.1,2,0)
+against the patient file (by SSN, for example), a DFN is returned.  This 
+"IX",230,230,"PDFN",.1,3,0)
+index allows finding the visits for the DFN.  This index contains all 
+"IX",230,230,"PDFN",.1,4,0)
+visits (closed or active) where a DFN has been assigned.
+"IX",230,230,"PDFN",1)
+S ^EDP(230,"PDFN",X(1),X(2),X(3),DA)=""
+"IX",230,230,"PDFN",2)
+K ^EDP(230,"PDFN",X(1),X(2),X(3),DA)
+"IX",230,230,"PDFN",2.5)
+K ^EDP(230,"PDFN")
+"IX",230,230,"PDFN",11.1,0)
+^.114IA^3^3
+"IX",230,230,"PDFN",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"PDFN",11.1,1,3)
+
+"IX",230,230,"PDFN",11.1,2,0)
+2^F^230^.03^^2^F
+"IX",230,230,"PDFN",11.1,2,3)
+
+"IX",230,230,"PDFN",11.1,3,0)
+3^F^230^.06^^3^F
+"IX",230,230,"PDFN",11.1,3,3)
+
+"IX",230,230,"PN",0)
+230^PN^SITE,AREA,PTNAME,IEN for all patients^R^^R^IR^I^230^^^^^LS
+"IX",230,230,"PN",.1,0)
+^^5^5^3081003^
+"IX",230,230,"PN",.1,1,0)
+Indexes all patient names.  This is for selecting patients when a visit
+"IX",230,230,"PN",.1,2,0)
+(closed or otherwise) needs to be corrected.  Since some of the visits 
+"IX",230,230,"PN",.1,3,0)
+may be patients without DFN's, this index allows them to be included in 
+"IX",230,230,"PN",.1,4,0)
+the selection.  All visits (with and without DFN's) are included in the 
+"IX",230,230,"PN",.1,5,0)
+index.
+"IX",230,230,"PN",1)
+S ^EDP(230,"PN",X(1),X(2),X(3),DA)=""
+"IX",230,230,"PN",2)
+K ^EDP(230,"PN",X(1),X(2),X(3),DA)
+"IX",230,230,"PN",2.5)
+K ^EDP(230,"PN")
+"IX",230,230,"PN",11.1,0)
+^.114IA^3^3
+"IX",230,230,"PN",11.1,1,0)
+1^F^230^.02^^1^F
+"IX",230,230,"PN",11.1,2,0)
+2^F^230^.03^^2^F
+"IX",230,230,"PN",11.1,3,0)
+3^F^230^.04^^3^F
+"IX",230.1,230.1,"ADF",0)
+230.1^ADF^Log History by time (LOG, TIME, IEN)^R^^R^IR^I^230.1^^^^^S
+"IX",230.1,230.1,"ADF",.1,0)
+^^6^6^3081004^
+"IX",230.1,230.1,"ADF",.1,1,0)
+This cross reference provides, for a single emergency department log 
+"IX",230.1,230.1,"ADF",.1,2,0)
+record (entry in the ED LOG file) a forward chronological list of updates 
+"IX",230.1,230.1,"ADF",.1,3,0)
+to the record.
+"IX",230.1,230.1,"ADF",.1,4,0)
+ 
+"IX",230.1,230.1,"ADF",.1,5,0)
+The storage transform S X=+X ensures that numeric collation is used for 
+"IX",230.1,230.1,"ADF",.1,6,0)
+all entries in the cross reference.
+"IX",230.1,230.1,"ADF",1)
+S ^EDP(230.1,"ADF",X(1),X(2),DA)=""
+"IX",230.1,230.1,"ADF",2)
+K ^EDP(230.1,"ADF",X(1),X(2),DA)
+"IX",230.1,230.1,"ADF",2.5)
+K ^EDP(230.1,"ADF")
+"IX",230.1,230.1,"ADF",11.1,0)
+^.114IA^2^2
+"IX",230.1,230.1,"ADF",11.1,1,0)
+1^F^230.1^.01^^1^F
+"IX",230.1,230.1,"ADF",11.1,2,0)
+2^F^230.1^.02^^2^F
+"IX",230.1,230.1,"ADF",11.1,2,2)
+S X=+X
+"IX",230.1,230.1,"ADR",0)
+230.1^ADR^Log History by inverse time (LOG, INVTIME, IEN)^R^^R^IR^I^230.1^^^^^S
+"IX",230.1,230.1,"ADR",.1,0)
+^^8^8^3081004^
+"IX",230.1,230.1,"ADR",.1,1,0)
+This cross reference provides, for a single emergency department log 
+"IX",230.1,230.1,"ADR",.1,2,0)
+record (entry in the ED LOG file) a reverse chronological list of updates 
+"IX",230.1,230.1,"ADR",.1,3,0)
+to the record.
+"IX",230.1,230.1,"ADR",.1,4,0)
+ 
+"IX",230.1,230.1,"ADR",.1,5,0)
+Since the display board is refreshed frequently, this cross reference 
+"IX",230.1,230.1,"ADR",.1,6,0)
+helps that happen as fast as possible.  It allows forward $O to be used 
+"IX",230.1,230.1,"ADR",.1,7,0)
+to search back in time.  This is a much faster operation than reverse $O 
+"IX",230.1,230.1,"ADR",.1,8,0)
+on most M systems.
+"IX",230.1,230.1,"ADR",1)
+S ^EDP(230.1,"ADR",X(1),X(2),DA)=""
+"IX",230.1,230.1,"ADR",2)
+K ^EDP(230.1,"ADR",X(1),X(2),DA)
+"IX",230.1,230.1,"ADR",2.5)
+K ^EDP(230.1,"ADR")
+"IX",230.1,230.1,"ADR",11.1,0)
+^.114IA^2^2
+"IX",230.1,230.1,"ADR",11.1,1,0)
+1^F^230.1^.01^^1^F
+"IX",230.1,230.1,"ADR",11.1,2,0)
+2^F^230.1^.02^^2^F
+"IX",230.1,230.1,"ADR",11.1,2,2)
+S X=9999999-X
+"IX",230.1,230.1,"C",0)
+230.1^C^Indexes changes for a log entry by inverse time.^R^^R^IR^I^230.1^^^^^LS
+"IX",230.1,230.1,"C",1)
+S ^EDP(230.1,"C",X(1),X(2),DA)=""
+"IX",230.1,230.1,"C",2)
+K ^EDP(230.1,"C",X(1),X(2),DA)
+"IX",230.1,230.1,"C",2.5)
+K ^EDP(230.1,"C")
+"IX",230.1,230.1,"C",11.1,0)
+^.114IA^2^2
+"IX",230.1,230.1,"C",11.1,1,0)
+1^F^230.1^.01^^1^F
+"IX",230.1,230.1,"C",11.1,1,3)
+
+"IX",230.1,230.1,"C",11.1,2,0)
+2^F^230.1^.02^^2^F
+"IX",230.1,230.1,"C",11.1,2,2)
+S X=9999999-X
+"IX",230.1,230.1,"C",11.1,2,3)
+
+"IX",231.7,231.7,"AC",0)
+231.7^AC^SITE,AREA,ROLE,IEN if the entry is active^R^^R^IR^I^231.7^^^^^S
+"IX",231.7,231.7,"AC",.1,0)
+^^6^6^3081005^
+"IX",231.7,231.7,"AC",.1,1,0)
+This cross reference supports constructing a list of currently active 
+"IX",231.7,231.7,"AC",.1,2,0)
+staff for a particular role.
+"IX",231.7,231.7,"AC",.1,3,0)
+ 
+"IX",231.7,231.7,"AC",.1,4,0)
+For this record level cross reference, the kill logic should always be 
+"IX",231.7,231.7,"AC",.1,5,0)
+executed when any value changes.  The set logic is then executed 
+"IX",231.7,231.7,"AC",.1,6,0)
+conditionally, allowing the cross reference to hold only active values.
+"IX",231.7,231.7,"AC",1)
+S ^EDPB(231.7,"AC",X(1),X(2),X(3),DA)=""
+"IX",231.7,231.7,"AC",1.4)
+S X='X2(4)
+"IX",231.7,231.7,"AC",2)
+K ^EDPB(231.7,"AC",X(1),X(2),X(3),DA)
+"IX",231.7,231.7,"AC",2.5)
+K ^EDPB(231.7,"AC")
+"IX",231.7,231.7,"AC",11.1,0)
+^.114IA^4^4
+"IX",231.7,231.7,"AC",11.1,1,0)
+1^F^231.7^.02^^1^F
+"IX",231.7,231.7,"AC",11.1,2,0)
+2^F^231.7^.03^^2^F
+"IX",231.7,231.7,"AC",11.1,3,0)
+3^F^231.7^.06^^3^F
+"IX",231.7,231.7,"AC",11.1,4,0)
+4^F^231.7^.04^^^F
+"IX",231.7,231.7,"AD",0)
+231.7^AD^SITE,AREA,DUZ,IEN^R^^R^IR^I^231.7^^^^^S
+"IX",231.7,231.7,"AD",.1,0)
+^^4^4^3081005^
+"IX",231.7,231.7,"AD",.1,1,0)
+This cross reference allows searching the file for an entry matching a 
+"IX",231.7,231.7,"AD",.1,2,0)
+particular DUZ (say, to look up a color map).  Since a person may work as 
+"IX",231.7,231.7,"AD",.1,3,0)
+staff in multiple areas, this cross reference allows finding the staff 
+"IX",231.7,231.7,"AD",.1,4,0)
+record that applies to the person's activity in a specific area.
+"IX",231.7,231.7,"AD",1)
+S ^EDPB(231.7,"AD",X(1),X(2),X(3),DA)=""
+"IX",231.7,231.7,"AD",2)
+K ^EDPB(231.7,"AD",X(1),X(2),X(3),DA)
+"IX",231.7,231.7,"AD",2.5)
+K ^EDPB(231.7,"AD")
+"IX",231.7,231.7,"AD",11.1,0)
+^.114IA^3^3
+"IX",231.7,231.7,"AD",11.1,1,0)
+1^F^231.7^.02^^1^F
+"IX",231.7,231.7,"AD",11.1,2,0)
+2^F^231.7^.03^^2^F
+"IX",231.7,231.7,"AD",11.1,3,0)
+3^F^231.7^.01^^3^F
+"IX",231.8,231.8,"AC",0)
+231.8^AC^SITE,AREA,DISPLAYNAME,IEN^R^^R^IR^I^231.8^^^^^S
+"IX",231.8,231.8,"AC",.1,0)
+^^2^2^3080915^
+"IX",231.8,231.8,"AC",.1,1,0)
+Allows looking for a room with a specific abbreviation, such as AMBU or 
+"IX",231.8,231.8,"AC",.1,2,0)
+WAIT (when setting baseline parameters for example).
+"IX",231.8,231.8,"AC",1)
+S ^EDPB(231.8,"AC",X(1),X(2),X(3),DA)=""
+"IX",231.8,231.8,"AC",2)
+K ^EDPB(231.8,"AC",X(1),X(2),X(3),DA)
+"IX",231.8,231.8,"AC",2.5)
+K ^EDPB(231.8,"AC")
+"IX",231.8,231.8,"AC",11.1,0)
+^.114IA^3^3
+"IX",231.8,231.8,"AC",11.1,1,0)
+1^F^231.8^.02^^1^F
+"IX",231.8,231.8,"AC",11.1,2,0)
+2^F^231.8^.03^^2^F
+"IX",231.8,231.8,"AC",11.1,3,0)
+3^F^231.8^.06^^3^F
+"IX",231.8,231.8,"C",0)
+231.8^C^Index by site and area.^R^^R^IR^I^231.8^^^^^LS
+"IX",231.8,231.8,"C",.1,0)
+^^2^2^3080915^
+"IX",231.8,231.8,"C",.1,1,0)
+Allows collecting all of the rooms for a specific area within a division 
+"IX",231.8,231.8,"C",.1,2,0)
+(station number).
+"IX",231.8,231.8,"C",1)
+S ^EDPB(231.8,"C",X(1),X(2),DA)=""
+"IX",231.8,231.8,"C",2)
+K ^EDPB(231.8,"C",X(1),X(2),DA)
+"IX",231.8,231.8,"C",2.5)
+K ^EDPB(231.8,"C")
+"IX",231.8,231.8,"C",11.1,0)
+^.114IA^2^2
+"IX",231.8,231.8,"C",11.1,1,0)
+1^F^231.8^.02^^1^F
+"IX",231.8,231.8,"C",11.1,2,0)
+2^F^231.8^.03^^2^F
+"IX",233.1,233.1,"AB",0)
+233.1^AB^NAME (without prefix), ABBREVIATION^R^^R^IR^I^233.1^^^^^S
+"IX",233.1,233.1,"AB",.1,0)
+^^3^3^3081010^
+"IX",233.1,233.1,"AB",.1,1,0)
+This allows finding all the abbreviations for a name without regard to 
+"IX",233.1,233.1,"AB",.1,2,0)
+the site prefix.  (The prefix is "edp." when nationally exported, "nnn." 
+"IX",233.1,233.1,"AB",.1,3,0)
+for locally defined, where nnn is the station number.)
+"IX",233.1,233.1,"AB",1)
+S ^EDPB(233.1,"AB",$E(X(1),1,30),$E(X(2),1,30),DA)=""
+"IX",233.1,233.1,"AB",2)
+K ^EDPB(233.1,"AB",$E(X(1),1,30),$E(X(2),1,30),DA)
+"IX",233.1,233.1,"AB",2.5)
+K ^EDPB(233.1,"AB")
+"IX",233.1,233.1,"AB",11.1,0)
+^.114IA^2^2
+"IX",233.1,233.1,"AB",11.1,1,0)
+1^F^233.1^.01^30^1^F
+"IX",233.1,233.1,"AB",11.1,1,2)
+S X=$P(X,".",2)
+"IX",233.1,233.1,"AB",11.1,2,0)
+2^F^233.1^.03^30^2^F
+"IX",233.1,233.1,"AB",11.1,2,2)
+S X=$$UP^XLFSTR(X)
+"IX",233.1,233.1,"AC",0)
+233.1^AC^NAME (without prefix), DISPLAY NAME^R^^R^IR^I^233.1^^^^^S
+"IX",233.1,233.1,"AC",.1,0)
+^^3^3^3081010^
+"IX",233.1,233.1,"AC",.1,1,0)
+This allows finding all the display names for a name without regard to the
+"IX",233.1,233.1,"AC",.1,2,0)
+site prefix.  (The prefix is "edp." when nationally exported, "nnn." for
+"IX",233.1,233.1,"AC",.1,3,0)
+locally defined, where nnn is the station number.)
+"IX",233.1,233.1,"AC",1)
+S ^EDPB(233.1,"AC",$E(X(1),1,30),$E(X(2),1,60),DA)=""
+"IX",233.1,233.1,"AC",2)
+K ^EDPB(233.1,"AC",$E(X(1),1,30),$E(X(2),1,60),DA)
+"IX",233.1,233.1,"AC",2.5)
+K ^EDPB(233.1,"AC")
+"IX",233.1,233.1,"AC",11.1,0)
+^.114IA^2^2
+"IX",233.1,233.1,"AC",11.1,1,0)
+1^F^233.1^.01^30^1^F
+"IX",233.1,233.1,"AC",11.1,1,2)
+S X=$P(X,".",2)
+"IX",233.1,233.1,"AC",11.1,2,0)
+2^F^233.1^.02^60^2^F
+"IX",233.1,233.1,"AC",11.1,2,2)
+S X=$$UP^XLFSTR(X)
+"KRN",19,13496,-1)
+0^5
+"KRN",19,13496,0)
+EDPF TRACKING SYSTEM^EDIS version 1.0^^B^^^^^^^^KERNEL
+"KRN",19,13496,1,0)
+^19.06^1^1^3080423^^^^
+"KRN",19,13496,1,1,0)
+Context option for ED Tracking System RPC calls at local facility.
+"KRN",19,13496,99.1)
+61001,51187
+"KRN",19,13496,"RPC",0)
+^19.05P^8^8
+"KRN",19,13496,"RPC",7,0)
+EDPCTRL RPC
+"KRN",19,13496,"RPC",8,0)
+EDPCBRD RPC
+"KRN",19,13496,"U")
+EDIS VERSION 1.0
+"KRN",19,13497,-1)
+0^11
+"KRN",19,13497,0)
+EDPF TRACKING VIEW SIGNIN^Sign In Patient^^M^^^^^^^^
+"KRN",19,13497,10,0)
+^19.01IP^1^1
+"KRN",19,13497,10,1,0)
+13496
+"KRN",19,13497,10,1,"^")
+EDPF TRACKING SYSTEM
+"KRN",19,13497,99)
+61970,67192
+"KRN",19,13497,99.1)
+61236,65283
+"KRN",19,13497,"U")
+SIGN IN PATIENT
+"KRN",19,13498,-1)
+0^13
+"KRN",19,13498,0)
+EDPF TRACKING VIEW TRIAGE^Triage Patient^^M^^^^^^^^
+"KRN",19,13498,10,0)
+^19.01IP^1^1
+"KRN",19,13498,10,1,0)
+13496
+"KRN",19,13498,10,1,"^")
+EDPF TRACKING SYSTEM
+"KRN",19,13498,99)
+61970,67192
+"KRN",19,13498,99.1)
+61129,51343
+"KRN",19,13498,"U")
+TRIAGE PATIENT
+"KRN",19,13499,-1)
+0^14
+"KRN",19,13499,0)
+EDPF TRACKING VIEW UPDATE^Update Tracking Board^^M^^^^^^^^
+"KRN",19,13499,10,0)
+^19.01IP^1^1
+"KRN",19,13499,10,1,0)
+13496
+"KRN",19,13499,10,1,"^")
+EDPF TRACKING SYSTEM
+"KRN",19,13499,99)
+61970,67192
+"KRN",19,13499,99.1)
+61130,49249
+"KRN",19,13499,"U")
+UPDATE TRACKING BOARD
+"KRN",19,13500,-1)
+0^8
+"KRN",19,13500,0)
+EDPF TRACKING VIEW DISPOSITION^Disposition Patient^^M^^^^^^^^
+"KRN",19,13500,10,0)
+^19.01IP^1^1
+"KRN",19,13500,10,1,0)
+13496
+"KRN",19,13500,10,1,"^")
+EDPF TRACKING SYSTEM
+"KRN",19,13500,99)
+61970,67192
+"KRN",19,13500,99.1)
+61129,60766
+"KRN",19,13500,"U")
+DISPOSITION PATIENT
+"KRN",19,13501,-1)
+0^9
+"KRN",19,13501,0)
+EDPF TRACKING VIEW EDIT CLOSED^Edit Closed Patient^^M^^^^^^^^
+"KRN",19,13501,10,0)
+^19.01IP^1^1
+"KRN",19,13501,10,1,0)
+13496
+"KRN",19,13501,10,1,"^")
+EDPF TRACKING SYSTEM
+"KRN",19,13501,99)
+61970,67192
+"KRN",19,13501,"U")
+EDIT CLOSED PATIENT
+"KRN",19,13502,-1)
+0^6
+"KRN",19,13502,0)
+EDPF TRACKING VIEW BOARD^Display Board^^M^^^^^^^^
+"KRN",19,13502,10,0)
+^19.01IP^1^1
+"KRN",19,13502,10,1,0)
+13496
+"KRN",19,13502,10,1,"^")
+EDPF TRACKING SYSTEM
+"KRN",19,13502,99)
+61970,67192
+"KRN",19,13502,99.1)
+61619,57151
+"KRN",19,13502,"U")
+DISPLAY BOARD
+"KRN",19,13503,-1)
+0^10
+"KRN",19,13503,0)
+EDPF TRACKING VIEW REPORTS^Tracking Reports^^M^^^^^^^^
+"KRN",19,13503,10,0)
+^19.01IP^1^1
+"KRN",19,13503,10,1,0)
+13496
+"KRN",19,13503,10,1,"^")
+EDPF TRACKING SYSTEM
+"KRN",19,13503,99)
+61970,67192
+"KRN",19,13503,"U")
+TRACKING REPORTS
+"KRN",19,13504,-1)
+0^7
+"KRN",19,13504,0)
+EDPF TRACKING VIEW CONFIGURE^Configure Tracking Board^^M^^^^^^^^
+"KRN",19,13504,10,0)
+^19.01IP^1^1
+"KRN",19,13504,10,1,0)
+13496
+"KRN",19,13504,10,1,"^")
+EDPF TRACKING SYSTEM
+"KRN",19,13504,99)
+61970,67192
+"KRN",19,13504,99.1)
+61236,65283
+"KRN",19,13504,"U")
+CONFIGURE TRACKING BOARD
+"KRN",19,13505,-1)
+0^12
+"KRN",19,13505,0)
+EDPF TRACKING VIEW STAFF^Assign Staff^^M^^^^^^^^
+"KRN",19,13505,10,0)
+^19.01IP^1^1
+"KRN",19,13505,10,1,0)
+13496
+"KRN",19,13505,10,1,"^")
+EDPF TRACKING SYSTEM
+"KRN",19,13505,99)
+61970,67192
+"KRN",19,13505,99.1)
+61236,65283
+"KRN",19,13505,"U")
+ASSIGN STAFF
+"KRN",19,13506,-1)
+0^1
+"KRN",19,13506,0)
+EDPF TRACKING MENU ALL^All Tracking Views^^M^^^^^^^^
+"KRN",19,13506,10,0)
+^19.01IP^9^9
+"KRN",19,13506,10,1,0)
+13497^^10
+"KRN",19,13506,10,1,"^")
+EDPF TRACKING VIEW SIGNIN
+"KRN",19,13506,10,2,0)
+13498^^20
+"KRN",19,13506,10,2,"^")
+EDPF TRACKING VIEW TRIAGE
+"KRN",19,13506,10,3,0)
+13499^^30
+"KRN",19,13506,10,3,"^")
+EDPF TRACKING VIEW UPDATE
+"KRN",19,13506,10,4,0)
+13500^^40
+"KRN",19,13506,10,4,"^")
+EDPF TRACKING VIEW DISPOSITION
+"KRN",19,13506,10,5,0)
+13501^^50
+"KRN",19,13506,10,5,"^")
+EDPF TRACKING VIEW EDIT CLOSED
+"KRN",19,13506,10,6,0)
+13502^^60
+"KRN",19,13506,10,6,"^")
+EDPF TRACKING VIEW BOARD
+"KRN",19,13506,10,7,0)
+13505^^70
+"KRN",19,13506,10,7,"^")
+EDPF TRACKING VIEW STAFF
+"KRN",19,13506,10,8,0)
+13503^^80
+"KRN",19,13506,10,8,"^")
+EDPF TRACKING VIEW REPORTS
+"KRN",19,13506,10,9,0)
+13504^^90
+"KRN",19,13506,10,9,"^")
+EDPF TRACKING VIEW CONFIGURE
+"KRN",19,13506,99)
+61619,57148
+"KRN",19,13506,99.1)
+61619,57151
+"KRN",19,13506,"U")
+ALL TRACKING VIEWS
+"KRN",19,13508,-1)
+0^3
+"KRN",19,13508,0)
+EDPF TRACKING MENU SIGNIN^Sign-in Tracking Views^^M^^^^^^^^
+"KRN",19,13508,10,0)
+^19.01IP^2^2
+"KRN",19,13508,10,1,0)
+13497^^10
+"KRN",19,13508,10,1,"^")
+EDPF TRACKING VIEW SIGNIN
+"KRN",19,13508,10,2,0)
+13502^^20
+"KRN",19,13508,10,2,"^")
+EDPF TRACKING VIEW BOARD
+"KRN",19,13508,99)
+61619,57148
+"KRN",19,13508,99.1)
+61619,57151
+"KRN",19,13508,"U")
+SIGN-IN TRACKING VIEWS
+"KRN",19,13509,-1)
+0^4
+"KRN",19,13509,0)
+EDPF TRACKING MENU TRIAGE^Triage Tracking Views^^M^^^^^^^^
+"KRN",19,13509,10,0)
+^19.01IP^2^2
+"KRN",19,13509,10,1,0)
+13498^^10
+"KRN",19,13509,10,1,"^")
+EDPF TRACKING VIEW TRIAGE
+"KRN",19,13509,10,2,0)
+13502^^20
+"KRN",19,13509,10,2,"^")
+EDPF TRACKING VIEW BOARD
+"KRN",19,13509,99)
+61619,57148
+"KRN",19,13509,99.1)
+61619,57151
+"KRN",19,13509,"U")
+TRIAGE TRACKING VIEWS
+"KRN",19,13510,-1)
+0^2
+"KRN",19,13510,0)
+EDPF TRACKING MENU CLINICIAN^Clinician Tracking Views^^M^^^^^^^^
+"KRN",19,13510,10,0)
+^19.01IP^3^3
+"KRN",19,13510,10,1,0)
+13499^^10
+"KRN",19,13510,10,1,"^")
+EDPF TRACKING VIEW UPDATE
+"KRN",19,13510,10,2,0)
+13500^^20
+"KRN",19,13510,10,2,"^")
+EDPF TRACKING VIEW DISPOSITION
+"KRN",19,13510,10,3,0)
+13502^^30
+"KRN",19,13510,10,3,"^")
+EDPF TRACKING VIEW BOARD
+"KRN",19,13510,99)
+61619,57148
+"KRN",19,13510,99.1)
+61619,57151
+"KRN",19,13510,"U")
+CLINICIAN TRACKING VIEWS
+"KRN",19,13511,-1)
+0^17
+"KRN",19,13511,0)
+EDPS BOARD CONTEXT^ED Tracking Board Context^^B^^^^^^^^
+"KRN",19,13511,"RPC",0)
+^19.05P^1^1
+"KRN",19,13511,"RPC",1,0)
+EDPCBRD RPC
+"KRN",19,13511,"U")
+ED TRACKING BOARD CONTEXT
+"KRN",19,13512,-1)
+0^16
+"KRN",19,13512,0)
+EDP CONVERSION^Convert local ER data to EDIS files^^R^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",19,13512,1,0)
+^^6^6^3080305^
+"KRN",19,13512,1,1,0)
+This option allows a site to trigger the conversion of its local data in
+"KRN",19,13512,1,2,0)
+^DIZ(1720xx) files to the new Emergency Department Information System
+"KRN",19,13512,1,3,0)
+files.  Local configuration data will be transferred first, followed by
+"KRN",19,13512,1,4,0)
+all currently open visits; a task will also be queued to copy closed
+"KRN",19,13512,1,5,0)
+visits as well, to permit the reporting features to continue functioning
+"KRN",19,13512,1,6,0)
+normally.
+"KRN",19,13512,25)
+EDPFMOVE
+"KRN",19,13512,"U")
+CONVERT LOCAL ER DATA TO EDIS 
+"KRN",19,13514,-1)
+0^18
+"KRN",19,13514,0)
+EDPF BIGBOARD KIOSKS^Display Board Kiosks^^A^^EDPF KIOSKS^^^^^^EMERGENCY DEPARTMENT^^1
+"KRN",19,13514,1,0)
+^^2^2^3090224^
+"KRN",19,13514,1,1,0)
+This option allows editing the EDPF BIGBOARD KIOSKS parameter; editing
+"KRN",19,13514,1,2,0)
+these values via the XPAR utilities is prohibited.
+"KRN",19,13514,20)
+D EN^EDPBKS
+"KRN",19,13514,"U")
+DISPLAY BOARD KIOSKS
+"KRN",19.1,594,-1)
+0^1
+"KRN",19.1,594,0)
+EDPR EXPORT^Allows CSV Export of Report
+"KRN",19.1,594,1,0)
+^^2^2^3071221^
+"KRN",19.1,594,1,1,0)
+Allows export of report using tab delimited values for use in Excel and 
+"KRN",19.1,594,1,2,0)
+other products.
+"KRN",19.1,595,-1)
+0^2
+"KRN",19.1,595,0)
+EDPR PROVIDER^Allow Provider Report
+"KRN",19.1,595,1,0)
+^^2^2^3071221^
+"KRN",19.1,595,1,1,0)
+Allows access to the provider report in the reports menu for the ED 
+"KRN",19.1,595,1,2,0)
+package.
+"KRN",19.1,596,-1)
+0^3
+"KRN",19.1,596,0)
+EDPR XREF^Allow Pt Xref Report
+"KRN",19.1,596,1,0)
+^^2^2^3071221^
+"KRN",19.1,596,1,1,0)
+Allows use of the patient cross reference report in the list of reports 
+"KRN",19.1,596,1,2,0)
+for the emergency department.
+"KRN",19.1,597,-1)
+0^4
+"KRN",19.1,597,0)
+EDPF KIOSKS
+"KRN",19.1,597,1,0)
+^19.11^2^2^3090817^^
+"KRN",19.1,597,1,1,0)
+This key grants access to access to the EDPF BIGBOARD KIOSKS option to
+"KRN",19.1,597,1,2,0)
+edit the values for the parameter of the same name.
+"KRN",101,1302,-1)
+2^9
+"KRN",101,1302,0)
+SDAM APPOINTMENT EVENTS^Appointment Event Driver^^X^10000000179^^^^^^^16
+"KRN",101,1302,10,0)
+^101.01PA^20^20
+"KRN",101,1302,10,20,0)
+5601^^^
+"KRN",101,1302,10,20,"^")
+EDP CHECK-IN
+"KRN",101,2690,-1)
+2^8
+"KRN",101,2690,0)
+RA EVSEND OR^Radiology event sent to OE/RR^^X^10000000179^^^^^^^31
+"KRN",101,2690,10,0)
+^101.01PA^4^4
+"KRN",101,2690,10,4,0)
+5600^^^
+"KRN",101,2690,10,4,"^")
+EDP MONITOR
+"KRN",101,3336,-1)
+2^5
+"KRN",101,3336,0)
+LR7O CH EVSEND OR^LAB => OE/RR ORDER MESSAGE EVENT^^X^10000000179^^^^^^^
+"KRN",101,3336,10,0)
+^101.01PA^4^4
+"KRN",101,3336,10,4,0)
+5600^^^
+"KRN",101,3336,10,4,"^")
+EDP MONITOR
+"KRN",101,3373,-1)
+2^7
+"KRN",101,3373,0)
+PS EVSEND OR^Send Pharmacy orders to CPRS.^^X^10000000179^^^^^^^18
+"KRN",101,3373,10,0)
+^101.01PA^6^6
+"KRN",101,3373,10,6,0)
+5600^^^
+"KRN",101,3373,10,6,"^")
+EDP MONITOR
+"KRN",101,3392,-1)
+2^4
+"KRN",101,3392,0)
+GMRC EVSEND OR^Consults event sent to OE/RR^^X^10000000179^^^^^^^294
+"KRN",101,3392,10,0)
+^101.01PA^5^5
+"KRN",101,3392,10,5,0)
+5600^^^
+"KRN",101,3392,10,5,"^")
+EDP MONITOR
+"KRN",101,3411,-1)
+2^3
+"KRN",101,3411,0)
+FH EVSEND OR^FH --> OR event messages^^X^10000000179^^^^^^^
+"KRN",101,3411,10,0)
+^101.01PA^3^3
+"KRN",101,3411,10,3,0)
+5600^^^
+"KRN",101,3411,10,3,"^")
+EDP MONITOR
+"KRN",101,3529,-1)
+2^15
+"KRN",101,3529,0)
+OR EVSEND RA^OE/RR => RAD/NM MESSAGE EVENT^^X^10000000179^^^^^^^
+"KRN",101,3529,10,0)
+^101.01PA^3^3
+"KRN",101,3529,10,3,0)
+5602^^^
+"KRN",101,3529,10,3,"^")
+EDP OR MONITOR
+"KRN",101,3530,-1)
+2^13
+"KRN",101,3530,0)
+OR EVSEND LRCH^OE/RR => LAB MESSAGE EVENT^^X^10000000179^^^^^^^
+"KRN",101,3530,10,0)
+^101.01PA^3^3
+"KRN",101,3530,10,3,0)
+5602^^^
+"KRN",101,3530,10,3,"^")
+EDP OR MONITOR
+"KRN",101,3535,-1)
+2^11
+"KRN",101,3535,0)
+OR EVSEND FH^OE/RR => DIET MESSAGE EVENT^^X^10000000179^^^^^^^
+"KRN",101,3535,10,0)
+^101.01PA^3^3
+"KRN",101,3535,10,3,0)
+5602^^^
+"KRN",101,3535,10,3,"^")
+EDP OR MONITOR
+"KRN",101,3536,-1)
+2^6
+"KRN",101,3536,0)
+OR EVSEND ORG^OE/RR => GENERIC MESSAGE EVENT^^X^10000000179^^^^^^^
+"KRN",101,3536,10,0)
+^101.01PA^3^3
+"KRN",101,3536,10,3,0)
+5600^^^
+"KRN",101,3536,10,3,"^")
+EDP MONITOR
+"KRN",101,3537,-1)
+2^14
+"KRN",101,3537,0)
+OR EVSEND PS^OE/RR => PHARMACY MESSAGE EVENT^^X^10000000179^^^^^^^
+"KRN",101,3537,10,0)
+^101.01PA^3^3
+"KRN",101,3537,10,3,0)
+5602^^^
+"KRN",101,3537,10,3,"^")
+EDP OR MONITOR
+"KRN",101,3539,-1)
+2^12
+"KRN",101,3539,0)
+OR EVSEND GMRC^OE/RR => CONSULTS MESSAGE EVENT^^X^10000000179^^^^^^^
+"KRN",101,3539,10,0)
+^101.01PA^4^4
+"KRN",101,3539,10,4,0)
+5602^^^
+"KRN",101,3539,10,4,"^")
+EDP OR MONITOR
+"KRN",101,5600,-1)
+0^2
+"KRN",101,5600,0)
+EDP MONITOR^Monitor order messages for EDP Log^^A^^^^^^^^
+"KRN",101,5600,1,0)
+^^4^4^3080612^
+"KRN",101,5600,1,1,0)
+This protocol monitors ordering events for the Emergency Department
+"KRN",101,5600,1,2,0)
+tracking board.  It is placed on the * EVSEND OR protocols to check for
+"KRN",101,5600,1,3,0)
+updates being sent from ancillary packages to order entry; it monitors
+"KRN",101,5600,1,4,0)
+when orders are transmitted and when orders are completed.
+"KRN",101,5600,20)
+D EN^EDPFMON(.XQORMSG)
+"KRN",101,5600,99)
+61619,57148
+"KRN",101,5601,-1)
+0^1
+"KRN",101,5601,0)
+EDP CHECK-IN^Monitor for ED check-in^^A^^^^^^^^
+"KRN",101,5601,1,0)
+^101.06^3^3^3080321^^
+"KRN",101,5601,1,1,0)
+This protocol will monitor Scheduling events for patients being checked-in
+"KRN",101,5601,1,2,0)
+to the Emergency Department.  It is placed on the SDAM APPOINTMENT EVENTS
+"KRN",101,5601,1,3,0)
+protocol.
+"KRN",101,5601,20)
+D SDAM^EDPFMON
+"KRN",101,5601,99)
+61619,57148
+"KRN",101,5602,-1)
+0^10
+"KRN",101,5602,0)
+EDP OR MONITOR^Monitor order messages for EDP Log^^A^^^^^^^^
+"KRN",101,5602,1,0)
+^^3^3^3080612^
+"KRN",101,5602,1,1,0)
+This protocol monitors ordering events for the Emergency Department
+"KRN",101,5602,1,2,0)
+tracking board.  It is placed on the OR EVSEND * protocols to look for
+"KRN",101,5602,1,3,0)
+order numbers assigned to new orders placed from the ancillary packages.
+"KRN",101,5602,20)
+D ENOR^EDPFMON(.XQORMSG)
+"KRN",101,5602,99)
+61619,57148
+"KRN",101,5603,-1)
+0^16
+"KRN",101,5603,0)
+EDP NEW PATIENT^New EDIS Patient Event^^X^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5603,1,0)
+^^13^13^3090126^
+"KRN",101,5603,1,1,0)
+This extended action protocol will be processed when a new patient is
+"KRN",101,5603,1,2,0)
+added to the EDIS Patient Board.  Items added to this event may look for:
+"KRN",101,5603,1,3,0)
+ 
+"KRN",101,5603,1,4,0)
+ EDPDATA = ED Log ien ^ DFN ^ Time In ^ Hospital Location ien
+"KRN",101,5603,1,5,0)
+ 
+"KRN",101,5603,1,6,0)
+To support some devices that previously monitored SDAM APPOINTMENT EVENTS,
+"KRN",101,5603,1,7,0)
+the following variables will also be defined:
+"KRN",101,5603,1,8,0)
+ 
+"KRN",101,5603,1,9,0)
+     DFN = Patient file #2 ien
+"KRN",101,5603,1,10,0)
+     SDT = Time In
+"KRN",101,5603,1,11,0)
+    SDCL = Hospital Location file #44 ien
+"KRN",101,5603,1,12,0)
+   SDATA = ^DFN ^ SDT ^ SDCL
+"KRN",101,5603,1,13,0)
+ SDAMEVT = 1 (unscheduled new visit)
+"KRN",101,5603,10,0)
+^101.01PA
+"KRN",101,5603,99)
+61619,57148
+"KRN",101,5604,-1)
+0^17
+"KRN",101,5604,0)
+EDPF ADD BOARD^Add^^A^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5604,1,0)
+^^1^1^3090224^
+"KRN",101,5604,1,1,0)
+This action adds a display board.
+"KRN",101,5604,20)
+D ADD^EDPBKS
+"KRN",101,5604,99)
+61619,57148
+"KRN",101,5605,-1)
+0^24
+"KRN",101,5605,0)
+EDPF REMOVE BOARD^Remove^^A^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5605,1,0)
+^^1^1^3090224^
+"KRN",101,5605,1,1,0)
+This action removes a display board.
+"KRN",101,5605,20)
+D REM^EDPBKS
+"KRN",101,5605,99)
+61619,57148
+"KRN",101,5606,-1)
+0^22
+"KRN",101,5606,0)
+EDPF CHANGE BOARD^Change^^A^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5606,1,0)
+^^1^1^3090224^
+"KRN",101,5606,1,1,0)
+This action can change a computer name or display board.
+"KRN",101,5606,20)
+D CHG^EDPBKS
+"KRN",101,5606,99)
+61619,57148
+"KRN",101,5607,-1)
+0^25
+"KRN",101,5607,0)
+EDPF SELECT DIVISION^Select Division^^A^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5607,1,0)
+^^1^1^3090224^
+"KRN",101,5607,1,1,0)
+This action allows the editor to switch to values for another division.
+"KRN",101,5607,20)
+D NEWDIV^EDPBKS
+"KRN",101,5607,99)
+61619,57148
+"KRN",101,5608,-1)
+0^18
+"KRN",101,5608,0)
+EDPF BIGBOARD MENU^Board Kiosk parameter edit menu^^M^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5608,1,0)
+^101.06^2^2^3090224^^
+"KRN",101,5608,1,1,0)
+This is the menu of actions for the EDPF BIGBOARD KIOSK list template,
+"KRN",101,5608,1,2,0)
+which allows editing of the parameter of the same name.
+"KRN",101,5608,4)
+26
+"KRN",101,5608,10,0)
+^101.01PA^8^8
+"KRN",101,5608,10,1,0)
+5604^^11^
+"KRN",101,5608,10,1,"^")
+EDPF ADD BOARD
+"KRN",101,5608,10,2,0)
+5605^^12^
+"KRN",101,5608,10,2,"^")
+EDPF REMOVE BOARD
+"KRN",101,5608,10,3,0)
+5606^^21^
+"KRN",101,5608,10,3,"^")
+EDPF CHANGE BOARD
+"KRN",101,5608,10,4,0)
+5607^^31^
+"KRN",101,5608,10,4,"^")
+EDPF SELECT DIVISION
+"KRN",101,5608,10,5,0)
+5612^^32^
+"KRN",101,5608,10,5,"^")
+EDPF QUIT
+"KRN",101,5608,10,6,0)
+5609^^22^
+"KRN",101,5608,10,6,"^")
+EDPF BLANK 1
+"KRN",101,5608,10,7,0)
+5610^^13^
+"KRN",101,5608,10,7,"^")
+EDPF BLANK 2
+"KRN",101,5608,10,8,0)
+5611^^23^
+"KRN",101,5608,10,8,"^")
+EDPF BLANK 3
+"KRN",101,5608,26)
+D SHOW^VALM
+"KRN",101,5608,28)
+Select action: 
+"KRN",101,5608,99)
+61619,57148
+"KRN",101,5609,-1)
+0^19
+"KRN",101,5609,0)
+EDPF BLANK 1^   ^^A^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5609,1,0)
+^101.06^2^2^3090305^^^^
+"KRN",101,5609,1,1,0)
+Displays a blank line; used for whitespace on menus.  (Item text is 3
+"KRN",101,5609,1,2,0)
+spaces.)
+"KRN",101,5609,2,0)
+^101.02A^1^1
+"KRN",101,5609,2,1,0)
+BLANK
+"KRN",101,5609,2,"B","BLANK",1)
+
+"KRN",101,5609,99)
+61619,57148
+"KRN",101,5610,-1)
+0^20
+"KRN",101,5610,0)
+EDPF BLANK 2^   ^^A^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5610,1,0)
+^101.06^2^2^3090305^^^^
+"KRN",101,5610,1,1,0)
+Displays a blank line; used for whitespace on menus.  (Item text is 3
+"KRN",101,5610,1,2,0)
+spaces.)
+"KRN",101,5610,2,0)
+^101.02A^1^1
+"KRN",101,5610,2,1,0)
+BLANK
+"KRN",101,5610,2,"B","BLANK",1)
+
+"KRN",101,5610,99)
+61619,57148
+"KRN",101,5611,-1)
+0^21
+"KRN",101,5611,0)
+EDPF BLANK 3^   ^^A^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5611,1,0)
+^101.06^2^2^3090305^^^^
+"KRN",101,5611,1,1,0)
+Displays a blank line; used for whitespace on menus.  (Item text is 3
+"KRN",101,5611,1,2,0)
+spaces.)
+"KRN",101,5611,2,0)
+^101.02A^1^1
+"KRN",101,5611,2,1,0)
+BLANK
+"KRN",101,5611,2,"B","BLANK",1)
+
+"KRN",101,5611,99)
+61619,57148
+"KRN",101,5612,-1)
+0^23
+"KRN",101,5612,0)
+EDPF QUIT^Quit^^A^^^^^^^^EMERGENCY DEPARTMENT
+"KRN",101,5612,1,0)
+^^1^1^3090305^
+"KRN",101,5612,1,1,0)
+This action exits the list template.
+"KRN",101,5612,2,0)
+^101.02A^1^1
+"KRN",101,5612,2,1,0)
+QUIT
+"KRN",101,5612,2,"B","QUIT",1)
+
+"KRN",101,5612,20)
+Q
+"KRN",101,5612,99)
+61619,57148
+"KRN",409.61,733,-1)
+0^1
+"KRN",409.61,733,0)
+EDPF BIGBOARD KIOSKS^1^^80^5^19^0^1^^EDPF BIGBOARD MENU^EDPF BIGBOARD KIOSKS^1^^0
+"KRN",409.61,733,1)
+^VALM HIDDEN ACTIONS
+"KRN",409.61,733,"ARRAY")
+ EDPB
+"KRN",409.61,733,"COL",0)
+^409.621^2^2
+"KRN",409.61,733,"COL",1,0)
+NAME^5^40^Computer Name
+"KRN",409.61,733,"COL",2,0)
+VALUE^45^30^Display Board
+"KRN",409.61,733,"COL","B","NAME",1)
+
+"KRN",409.61,733,"COL","B","VALUE",2)
+
+"KRN",409.61,733,"FNL")
+D EXIT^EDPBKS
+"KRN",409.61,733,"HDR")
+D HDR^EDPBKS
+"KRN",409.61,733,"HLP")
+D HELP^EDPBKS
+"KRN",409.61,733,"INIT")
+D INIT^EDPBKS
+"KRN",8989.5,12668,0)
+562;DIC(9.4,^EDPF SCREEN SIZES^10
+"KRN",8989.5,12668,1)
+640x480
+"KRN",8989.5,12669,0)
+562;DIC(9.4,^EDPF SCREEN SIZES^20
+"KRN",8989.5,12669,1)
+800x600
+"KRN",8989.5,12670,0)
+562;DIC(9.4,^EDPF SCREEN SIZES^30
+"KRN",8989.5,12670,1)
+1024x768
+"KRN",8989.5,12671,0)
+562;DIC(9.4,^EDPF SCREEN SIZES^50
+"KRN",8989.5,12671,1)
+1280x1024
+"KRN",8989.5,12672,0)
+562;DIC(9.4,^EDPF SCREEN SIZES^40
+"KRN",8989.5,12672,1)
+1280x800
+"KRN",8989.5,12673,0)
+562;DIC(9.4,^EDPF NURSE STAFF SCREEN^1
+"KRN",8989.5,12673,1)
+3
+"KRN",8989.5,12675,0)
+562;DIC(9.4,^EDPF SCHEDULING TRIGGER^1
+"KRN",8989.5,12675,1)
+4
+"KRN",8989.51,510,-1)
+0^1
+"KRN",8989.51,510,0)
+EDPF LOCATION^Location(s) for Emergency Department^1^Time Range (ex. 0800-1200) or Sequence^Emergency Department Location
+"KRN",8989.51,510,1)
+P^44^Enter a HOSPITAL LOCATION used by the Emergency Department.
+"KRN",8989.51,510,3)
+I $P(^(0),U,3)'="W"
+"KRN",8989.51,510,6)
+F^^Enter a time range (like 0800-1200) or a sequential number.
+"KRN",8989.51,510,7)
+I '((X?1.3N)!(X?4N1"-"4N)) K X
+"KRN",8989.51,510,20,0)
+^^18^18^3080506^
+"KRN",8989.51,510,20,1,0)
+This parameter lists the entry or entries from the Hospital Location 
+"KRN",8989.51,510,20,2,0)
+file (#44) that are used by the Emergency Department.  If there are 
+"KRN",8989.51,510,20,3,0)
+multiple Hospital Location file entries for the Emergency Department 
+"KRN",8989.51,510,20,4,0)
+there are two choices when prompted for "Time Range or Sequence":
+"KRN",8989.51,510,20,5,0)
+ 
+"KRN",8989.51,510,20,6,0)
+Time Range allows you to map Hospital Location entries by time of day.  
+"KRN",8989.51,510,20,7,0)
+When creating an encounter in PCE, EDIS will match the Hospital Location 
+"KRN",8989.51,510,20,8,0)
+based on the current time of day.  You may enter the time range in 
+"KRN",8989.51,510,20,9,0)
+military time.  For example, 0800-1600 or 1800-2400 would be two possible 
+"KRN",8989.51,510,20,10,0)
+time range entries.
+"KRN",8989.51,510,20,11,0)
+ 
+"KRN",8989.51,510,20,12,0)
+Sequence allows you to map Hospital Location entries in a preferred 
+"KRN",8989.51,510,20,13,0)
+order.  When creating an encounter in PCE, EDIS will use the entry with 
+"KRN",8989.51,510,20,14,0)
+the lowest sequence number to create the visit.
+"KRN",8989.51,510,20,15,0)
+ 
+"KRN",8989.51,510,20,16,0)
+When creating the encounter by using the scheduling package to check-in, 
+"KRN",8989.51,510,20,17,0)
+any matches to the list (whether time range or sequence based) will cause 
+"KRN",8989.51,510,20,18,0)
+the checked-in patient to be added to the display board.
+"KRN",8989.51,510,30,0)
+^8989.513I^2^1
+"KRN",8989.51,510,30,2,0)
+2^4
+"KRN",8989.51,512,-1)
+0^2
+"KRN",8989.51,512,0)
+EDPF SCREEN SIZES^Available Screen Sizes^1^Sequence^Screen Size (WIDTHxHEIGHT)
+"KRN",8989.51,512,1)
+F^^Enter the width by height of the screen size (640x480, for example).
+"KRN",8989.51,512,2)
+S X=$TR(X,"X","x") I '(X?1.5N1"x"1.5N) K X
+"KRN",8989.51,512,6)
+N^1:999^Enter a number, 1-999 as the sequence for this screen size.
+"KRN",8989.51,512,20,0)
+^8989.512^3^3^3080502^^
+"KRN",8989.51,512,20,1,0)
+This list contains the screen sizes that are selectable for the EDIS 
+"KRN",8989.51,512,20,2,0)
+display board.  It generally lists the sizes of LCD or Plasma screens 
+"KRN",8989.51,512,20,3,0)
+that may be used for the large display.
+"KRN",8989.51,512,30,0)
+^8989.513I^3^3
+"KRN",8989.51,512,30,1,0)
+10^9.4
+"KRN",8989.51,512,30,2,0)
+7^4.2
+"KRN",8989.51,512,30,3,0)
+5^4
+"KRN",8989.51,513,-1)
+0^3
+"KRN",8989.51,513,0)
+EDPF NURSE STAFF SCREEN^Nursing Staff Screen for EDIS^0^^Allow Persons
+"KRN",8989.51,513,1)
+S^0:Active in NURS STAFF (210);1:Hold ORELSE Key;2:Hold PSJ RNURSE Key;3:All Persons (No Screen)^Enter the type of screen that should be applied to the NEW PERSON file.
+"KRN",8989.51,513,20,0)
+^^9^9^3090602^
+"KRN",8989.51,513,20,1,0)
+This allows a site to select which type of filtering, or screening, that 
+"KRN",8989.51,513,20,2,0)
+should be applied to the New Person file (200) when selecting nurses in 
+"KRN",8989.51,513,20,3,0)
+EDIS.  The default is to allow all entries in the NEW PERSON file.  The 
+"KRN",8989.51,513,20,4,0)
+options are:
+"KRN",8989.51,513,20,5,0)
+ 
+"KRN",8989.51,513,20,6,0)
+  0:  Allow only persons present and active in the NURS STAFF file (210).
+"KRN",8989.51,513,20,7,0)
+  1:  Allow only persons holding the ORELSE key.
+"KRN",8989.51,513,20,8,0)
+  2:  Allow only persons holding the PSJ RNURSE key.
+"KRN",8989.51,513,20,9,0)
+  3:  Allow selection from all entries in the NEW PERSON file (200).
+"KRN",8989.51,513,30,0)
+^8989.513I^3^3
+"KRN",8989.51,513,30,1,0)
+10^9.4
+"KRN",8989.51,513,30,2,0)
+5^4.2
+"KRN",8989.51,513,30,3,0)
+3^4
+"KRN",8989.51,514,-1)
+0^4
+"KRN",8989.51,514,0)
+EDPF DEBUG START TIME^Debug Log Timestamp^0^^Start Time ($H Format)
+"KRN",8989.51,514,1)
+F^7:11^Enter the start time for 30 minutes of logging in $H format.
+"KRN",8989.51,514,2)
+K:X'?1.5N1","1.5N X
+"KRN",8989.51,514,20,0)
+^^2^2^3080910^
+"KRN",8989.51,514,20,1,0)
+This sets a $H timestamp to signal that EDIS RPC's should be logged for 
+"KRN",8989.51,514,20,2,0)
+the 30 minutes following the timestamp.
+"KRN",8989.51,514,30,0)
+^8989.513I^1^1
+"KRN",8989.51,514,30,1,0)
+10^4.2
+"KRN",8989.51,515,-1)
+0^5
+"KRN",8989.51,515,0)
+EDPF SCHEDULING TRIGGER^Scheduling Trigger for EDIS^0^^Trigger Addition to Board On
+"KRN",8989.51,515,1)
+S^1:Make Appointment;4:Check-in;D:Disable^Enter which scheduling event should add the patient to the board or Disable.
+"KRN",8989.51,515,20,0)
+^^8^8^3090911^
+"KRN",8989.51,515,20,1,0)
+This allows a site to select which scheduling event should trigger an 
+"KRN",8989.51,515,20,2,0)
+automatic addition of the patient to the board.
+"KRN",8989.51,515,20,3,0)
+ 
+"KRN",8989.51,515,20,4,0)
+  1: Patient will be added to the board when an appointment is made
+"KRN",8989.51,515,20,5,0)
+  4: Patient will be added to the board when checked-in
+"KRN",8989.51,515,20,6,0)
+ 
+"KRN",8989.51,515,20,7,0)
+  D: Disable automatic adding of the patient to the board via appointment
+"KRN",8989.51,515,20,8,0)
+     management
+"KRN",8989.51,515,30,0)
+^8989.513I^3^3
+"KRN",8989.51,515,30,1,0)
+10^9.4
+"KRN",8989.51,515,30,2,0)
+5^4.2
+"KRN",8989.51,515,30,3,0)
+3^4
+"KRN",8989.51,516,-1)
+0^6
+"KRN",8989.51,516,0)
+EDPF BIGBOARD KIOSKS^Display Board Kiosk^1^Computer Name^Display Board Name^
+"KRN",8989.51,516,1)
+F^^Enter the name of the display board for this kiosk.
+"KRN",8989.51,516,2)
+
+"KRN",8989.51,516,6)
+F^^Use the EDPF BIGBOARD KIOSKS option to edit this parameter!
+"KRN",8989.51,516,7)
+K:'$G(EDPSITE) X
+"KRN",8989.51,516,20,0)
+^8989.512^3^3^3090224^^^^
+"KRN",8989.51,516,20,1,0)
+This parameter maps fully qualified computer names to the display board 
+"KRN",8989.51,516,20,2,0)
+that they should show.  Values must be added or changed via the option
+"KRN",8989.51,516,20,3,0)
+EDPF BIGBOARD KIOSKS.
+"KRN",8989.51,516,30,0)
+^8989.513I^1^1
+"KRN",8989.51,516,30,1,0)
+2^4
+"KRN",8994,2518,-1)
+0^2
+"KRN",8994,2518,0)
+EDPCTRL RPC^RPC^EDPCTRL^2^R^^^^1^^0
+"KRN",8994,2518,1,0)
+^^5^5^3080307^
+"KRN",8994,2518,1,1,0)
+This RPC acts as the "front controller" for the EDIS Tracking Application.
+"KRN",8994,2518,1,2,0)
+It accepts requests that are initially passed into a web server.  The RPC
+"KRN",8994,2518,1,3,0)
+uses the parameters that are passed in to determine which command to 
+"KRN",8994,2518,1,4,0)
+execute.  The returned data is formatted as XML.  The XML structure varies
+"KRN",8994,2518,1,5,0)
+based a what data were requested.
+"KRN",8994,2518,2,0)
+^8994.02A^1^1
+"KRN",8994,2518,2,1,0)
+PARAMS^2^^1^1
+"KRN",8994,2518,2,1,1,0)
+^^2^2^3080307^
+"KRN",8994,2518,2,1,1,1,0)
+This is a list of parameters that were passed to the Java middle tier via 
+"KRN",8994,2518,2,1,1,2,0)
+an HTTP Post message.
+"KRN",8994,2518,2,"B","PARAMS",1)
+
+"KRN",8994,2518,2,"B","REQ",1)
+
+"KRN",8994,2518,2,"PARAMSEQ",1,1)
+
+"KRN",8994,2518,3,0)
+^^1^1^3080307^
+"KRN",8994,2518,3,1,0)
+The return results are formatted as an XML document.
+"KRN",8994,2519,-1)
+0^1
+"KRN",8994,2519,0)
+EDPCBRD RPC^RPC^EDPCBRD^2^R^^^^^^1
+"KRN",8994,2519,1,0)
+^^8^8^3080307^
+"KRN",8994,2519,1,1,0)
+This RPC acts as the "front controller" for the EDIS Display Board.  It 
+"KRN",8994,2519,1,2,0)
+accepts requests that are initially passed into a web server.  The RPC 
+"KRN",8994,2519,1,3,0)
+uses the parameters that are passed in to determine which command to 
+"KRN",8994,2519,1,4,0)
+execute.  The returned data is formatted as XML.  The XML structure 
+"KRN",8994,2519,1,5,0)
+varies based a what data were requested.
+"KRN",8994,2519,1,6,0)
+ 
+"KRN",8994,2519,1,7,0)
+Since the Display Board runs in a "kiosk" mode, this RPC allows proxy 
+"KRN",8994,2519,1,8,0)
+user access.
+"KRN",8994,2519,2,0)
+^8994.02A^2^2
+"KRN",8994,2519,2,1,0)
+SESS^1^^1^1
+"KRN",8994,2519,2,1,1,0)
+^^3^3^3080307^
+"KRN",8994,2519,2,1,1,1,0)
+This identifies the user and site that are passed in from the Java middle 
+"KRN",8994,2519,2,1,1,2,0)
+tier.  In cases when the display board is running with a proxy user (in 
+"KRN",8994,2519,2,1,1,3,0)
+kiosk mode), the SSL configuration will determine the user and site.
+"KRN",8994,2519,2,2,0)
+PARAMS^2^^^2
+"KRN",8994,2519,2,2,1,0)
+^^2^2^3080307^
+"KRN",8994,2519,2,2,1,1,0)
+This is a list of parameters that were passed to the Java middle tier via 
+"KRN",8994,2519,2,2,1,2,0)
+an HTTP Post message.
+"KRN",8994,2519,2,"B","PARAMS",2)
+
+"KRN",8994,2519,2,"B","SESS",1)
+
+"KRN",8994,2519,2,"PARAMSEQ",1,1)
+
+"KRN",8994,2519,2,"PARAMSEQ",2,2)
+
+"KRN",8994,2519,3,0)
+^^1^1^3080307^
+"KRN",8994,2519,3,1,0)
+The return results are formatted as an XML document.
+"MBREQ")
+0
+"ORD",3,19.1)
+19.1;3;1;;KEY^XPDTA1;;;KEYF2^XPDIA1;;KEYDEL^XPDIA1
+"ORD",3,19.1,0)
+SECURITY KEY
+"ORD",15,101)
+101;15;;;PRO^XPDTA;PROF1^XPDIA;PROE1^XPDIA;PROF2^XPDIA;;PRODEL^XPDIA
+"ORD",15,101,0)
+PROTOCOL
+"ORD",16,8994)
+8994;16;1;;;;;;;RPCDEL^XPDIA1
+"ORD",16,8994,0)
+REMOTE PROCEDURE
+"ORD",17,409.61)
+409.61;17;1;;;;;;;LMDEL^XPDIA1
+"ORD",17,409.61,0)
+LIST TEMPLATE
+"ORD",18,19)
+19;18;;;OPT^XPDTA;OPTF1^XPDIA;OPTE1^XPDIA;OPTF2^XPDIA;;OPTDEL^XPDIA
+"ORD",18,19,0)
+OPTION
+"ORD",20,8989.51)
+8989.51;20;;;PAR1E1^XPDTA2;PAR1F1^XPDIA3;PAR1E1^XPDIA3;PAR1F2^XPDIA3;;PAR1DEL^XPDIA3(%)
+"ORD",20,8989.51,0)
+PARAMETER DEFINITION
+"PGL",233.1,0,4,.04)
+NATIONAL CODE^P233.1'^EDPB(233.1,^0;4^Q
+"PGL",233.21,0,2,.02)
+CODE^P233.1'^EDPB(233.1,^0;2^Q
+"PKG",562,-1)
+1^1
+"PKG",562,0)
+EMERGENCY DEPARTMENT^EDP^Emergency Department Information System
+"PKG",562,1,0)
+^^1^1^3080111^
+"PKG",562,1,1,0)
+This is the Emergency Department Information System (EDIS).
+"PKG",562,20,0)
+^9.402P^^
+"PKG",562,22,0)
+^9.49I^1^1
+"PKG",562,22,1,0)
+1.0^3100902^3090915^10000000179
+"PKG",562,22,1,1,0)
+^^4^4^3100902
+"PKG",562,22,1,1,1,0)
+This is the initial installation of the Emergency Department Information 
+"PKG",562,22,1,1,2,0)
+System (EDIS).  This is the module that handles tracking of a patient 
+"PKG",562,22,1,1,3,0)
+through an emergency department visit.  The user interface for this 
+"PKG",562,22,1,1,4,0)
+application is a web application.
+"PKG",562,"VERSION")
+1.0
+"QUES","XPF1",0)
+Y
+"QUES","XPF1","??")
+^D REP^XPDH
+"QUES","XPF1","A")
+Shall I write over your |FLAG| File
+"QUES","XPF1","B")
+YES
+"QUES","XPF1","M")
+D XPF1^XPDIQ
+"QUES","XPF2",0)
+Y
+"QUES","XPF2","??")
+^D DTA^XPDH
+"QUES","XPF2","A")
+Want my data |FLAG| yours
+"QUES","XPF2","B")
+YES
+"QUES","XPF2","M")
+D XPF2^XPDIQ
+"QUES","XPI1",0)
+YO
+"QUES","XPI1","??")
+^D INHIBIT^XPDH
+"QUES","XPI1","A")
+Want KIDS to INHIBIT LOGONs during the install
+"QUES","XPI1","B")
+YES
+"QUES","XPI1","M")
+D XPI1^XPDIQ
+"QUES","XPM1",0)
+PO^VA(200,:EM
+"QUES","XPM1","??")
+^D MG^XPDH
+"QUES","XPM1","A")
+Enter the Coordinator for Mail Group '|FLAG|'
+"QUES","XPM1","B")
+
+"QUES","XPM1","M")
+D XPM1^XPDIQ
+"QUES","XPO1",0)
+Y
+"QUES","XPO1","??")
+^D MENU^XPDH
+"QUES","XPO1","A")
+Want KIDS to Rebuild Menu Trees Upon Completion of Install
+"QUES","XPO1","B")
+YES
+"QUES","XPO1","M")
+D XPO1^XPDIQ
+"QUES","XPZ1",0)
+Y
+"QUES","XPZ1","??")
+^D OPT^XPDH
+"QUES","XPZ1","A")
+Want to DISABLE Scheduled Options, Menu Options, and Protocols
+"QUES","XPZ1","B")
+YES
+"QUES","XPZ1","M")
+D XPZ1^XPDIQ
+"QUES","XPZ2",0)
+Y
+"QUES","XPZ2","??")
+^D RTN^XPDH
+"QUES","XPZ2","A")
+Want to MOVE routines to other CPUs
+"QUES","XPZ2","B")
+NO
+"QUES","XPZ2","M")
+D XPZ2^XPDIQ
+"RTN")
+55
+"RTN","EDPBCF")
+0^25^B25096927
+"RTN","EDPBCF",1,0)
+EDPBCF ;SLC/KCM - Display Board Configuration
+"RTN","EDPBCF",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBCF",3,0)
+ ;
+"RTN","EDPBCF",4,0)
+LOAD(AREA) ; Load General Configuration for an Area
+"RTN","EDPBCF",5,0)
+ N I,NODE
+"RTN","EDPBCF",6,0)
+ ;
+"RTN","EDPBCF",7,0)
+ D XML^EDPX("<colorMaps>")
+"RTN","EDPBCF",8,0)
+ D COLORS^EDPBCM
+"RTN","EDPBCF",9,0)
+ D XML^EDPX("</colorMaps>")
+"RTN","EDPBCF",10,0)
+ D LOAD^EDPBCM(AREA)   ; load the color spec
+"RTN","EDPBCF",11,0)
+ ;
+"RTN","EDPBCF",12,0)
+ D LOAD^EDPBRM(AREA)   ; load rooms/beds
+"RTN","EDPBCF",13,0)
+ D DFLTRM^EDPBRM(AREA) ; load multi rooms
+"RTN","EDPBCF",14,0)
+ ;
+"RTN","EDPBCF",15,0)
+ D LOAD^EDPBPM(AREA)   ; load parameters
+"RTN","EDPBCF",16,0)
+ ;
+"RTN","EDPBCF",17,0)
+ D XML^EDPX("<columnList>") ; load available columns
+"RTN","EDPBCF",18,0)
+ F I=1:1 S NODE=$P($T(COLUMNS+I),";",3,99) Q:$E(NODE,1,5)="zzzzz"  D
+"RTN","EDPBCF",19,0)
+ . N X
+"RTN","EDPBCF",20,0)
+ . S X("label")=$P(NODE,U)
+"RTN","EDPBCF",21,0)
+ . S X("att")=$P(NODE,U,2)
+"RTN","EDPBCF",22,0)
+ . S X("header")=$P(NODE,U,3)
+"RTN","EDPBCF",23,0)
+ . S X("width")=50
+"RTN","EDPBCF",24,0)
+ . D XML^EDPX($$XMLA^EDPX("col",.X))
+"RTN","EDPBCF",25,0)
+ D XML^EDPX("</columnList>")
+"RTN","EDPBCF",26,0)
+ ;
+"RTN","EDPBCF",27,0)
+ D CHOICES^EDPBRM      ; load 'display when' choices
+"RTN","EDPBCF",28,0)
+ ;
+"RTN","EDPBCF",29,0)
+ N EDPSCRNS D GETLST^XPAR(.EDPSCRNS,"ALL","EDPF SCREEN SIZES","I")
+"RTN","EDPBCF",30,0)
+ D XML^EDPX("<screenSizes>")
+"RTN","EDPBCF",31,0)
+ S I=0 F  S I=$O(EDPSCRNS(I)) Q:'I  D
+"RTN","EDPBCF",32,0)
+ . S EDPSCRNS(I)=$TR(EDPSCRNS(I),"X","x")
+"RTN","EDPBCF",33,0)
+ . N X
+"RTN","EDPBCF",34,0)
+ . S X("label")=EDPSCRNS(I)
+"RTN","EDPBCF",35,0)
+ . S X("width")=$P(EDPSCRNS(I),"x")
+"RTN","EDPBCF",36,0)
+ . S X("height")=$P(EDPSCRNS(I),"x",2)
+"RTN","EDPBCF",37,0)
+ . D XML^EDPX($$XMLA^EDPX("size",.X))
+"RTN","EDPBCF",38,0)
+ D XML^EDPX("</screenSizes>")
+"RTN","EDPBCF",39,0)
+ Q
+"RTN","EDPBCF",40,0)
+LOADBRD(AREA,IEN) ; Load Named Board Spec
+"RTN","EDPBCF",41,0)
+ N I,X,TOKEN
+"RTN","EDPBCF",42,0)
+ S:'IEN IEN=$O(^EDPB(231.9,AREA,4,0)) Q:'IEN
+"RTN","EDPBCF",43,0)
+ ;
+"RTN","EDPBCF",44,0)
+ D READL^EDPBLK(AREA,"board",.TOKEN)  ; read lock the board config
+"RTN","EDPBCF",45,0)
+ D XML^EDPX("<boardToken>"_TOKEN_"</boardToken>")
+"RTN","EDPBCF",46,0)
+ D BRDLST(AREA)
+"RTN","EDPBCF",47,0)
+ S X("boardID")=IEN,X("boardName")=$P(^EDPB(231.9,AREA,4,IEN,0),U)
+"RTN","EDPBCF",48,0)
+ D XML^EDPX($$XMLA^EDPX("spec",.X,""))
+"RTN","EDPBCF",49,0)
+ S I=0 F  S I=$O(^EDPB(231.9,AREA,4,IEN,1,I)) Q:'I  D
+"RTN","EDPBCF",50,0)
+ . D XML^EDPX(^EDPB(231.9,AREA,4,IEN,1,I,0))
+"RTN","EDPBCF",51,0)
+ D XML^EDPX("</spec>")
+"RTN","EDPBCF",52,0)
+ D READU^EDPBLK(AREA,"board",.TOKEN)  ; read unlock the board config
+"RTN","EDPBCF",53,0)
+ Q
+"RTN","EDPBCF",54,0)
+BRDLST(AREA) ; List of boards
+"RTN","EDPBCF",55,0)
+ N I,X
+"RTN","EDPBCF",56,0)
+ D XML^EDPX("<boards>")
+"RTN","EDPBCF",57,0)
+ S I=0 F  S I=$O(^EDPB(231.9,AREA,4,I)) Q:'I  D
+"RTN","EDPBCF",58,0)
+ . S X=$P(^EDPB(231.9,AREA,4,I,0),U)
+"RTN","EDPBCF",59,0)
+ . D XML^EDPX($$XMLS^EDPX("board",I,X))
+"RTN","EDPBCF",60,0)
+ D XML^EDPX("</boards>")
+"RTN","EDPBCF",61,0)
+ Q
+"RTN","EDPBCF",62,0)
+SAVEBRD(REQ) ; Save Configuration
+"RTN","EDPBCF",63,0)
+ N X,AREA,DFLTNM
+"RTN","EDPBCF",64,0)
+ S X="col-",AREA=$G(REQ("area",1)),DFLTNM="Main (default)"
+"RTN","EDPBCF",65,0)
+ I 'AREA D SAVERR^EDPX("fail","Missing area") Q
+"RTN","EDPBCF",66,0)
+ ;
+"RTN","EDPBCF",67,0)
+ N NAME,IEN,WP,MSG
+"RTN","EDPBCF",68,0)
+ S NAME=$G(REQ("boardName",1)),IEN=+$G(REQ("boardID",1))
+"RTN","EDPBCF",69,0)
+ I (IEN>0),($P(^EDPB(231.9,AREA,4,IEN,0),U)=DFLTNM),(NAME'=DFLTNM) D  Q
+"RTN","EDPBCF",70,0)
+ . D SAVERR^EDPX("fail","Default name may not be changed.")
+"RTN","EDPBCF",71,0)
+ I NAME="" D  Q
+"RTN","EDPBCF",72,0)
+ . D SAVERR^EDPX("fail","Missing name")
+"RTN","EDPBCF",73,0)
+ I (IEN=0),$O(^EDPB(231.9,AREA,4,"B",NAME,0)) D  Q
+"RTN","EDPBCF",74,0)
+ . D SAVERR^EDPX("fail","Board name must be unique")
+"RTN","EDPBCF",75,0)
+ ;
+"RTN","EDPBCF",76,0)
+ ; save XML spec as word processing
+"RTN","EDPBCF",77,0)
+ N TOKEN,LOCKERR
+"RTN","EDPBCF",78,0)
+ S TOKEN=$G(REQ("boardToken",1))
+"RTN","EDPBCF",79,0)
+ D SAVEL^EDPBLK(AREA,"board",.TOKEN,.LOCKERR) ; save board config -- LOCK
+"RTN","EDPBCF",80,0)
+ I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOADBRD(AREA,IEN) Q
+"RTN","EDPBCF",81,0)
+ ;
+"RTN","EDPBCF",82,0)
+ F  S X=$O(REQ(X)) Q:$E(X,1,4)'="col-"  S WP(+$P(X,"-",2))=REQ(X,1)
+"RTN","EDPBCF",83,0)
+ D UPDBRD(AREA,.IEN,NAME,.WP,.MSG)
+"RTN","EDPBCF",84,0)
+ D SAVEU^EDPBLK(AREA,"board",.TOKEN)          ; save board config -- UNLOCK
+"RTN","EDPBCF",85,0)
+ ;
+"RTN","EDPBCF",86,0)
+ I $L(MSG) D SAVERR^EDPX("fail",MSG) Q
+"RTN","EDPBCF",87,0)
+ D UPDLAST(AREA) ; update last config save date
+"RTN","EDPBCF",88,0)
+ ;
+"RTN","EDPBCF",89,0)
+ D XML^EDPX("<save status='ok' boardID='"_+IEN_"' />")
+"RTN","EDPBCF",90,0)
+ D LOADBRD(AREA,+IEN)
+"RTN","EDPBCF",91,0)
+ Q
+"RTN","EDPBCF",92,0)
+UPDLAST(AREA) ; update last config save date
+"RTN","EDPBCF",93,0)
+ N FDA,FDAIEN,DIERR
+"RTN","EDPBCF",94,0)
+ S FDA(231.9,AREA_",",.03)=$$NOW^XLFDT
+"RTN","EDPBCF",95,0)
+ D FILE^DIE("","FDA","ERR")
+"RTN","EDPBCF",96,0)
+ D CLEAN^DILF
+"RTN","EDPBCF",97,0)
+ Q
+"RTN","EDPBCF",98,0)
+UPDBRD(AREA,EDPIEN,NAME,SPEC,MSG) ; Add/Update a Spec
+"RTN","EDPBCF",99,0)
+ S MSG=""
+"RTN","EDPBCF",100,0)
+ S:'EDPIEN EDPIEN="+1" S EDPIEN=EDPIEN_","_AREA_","
+"RTN","EDPBCF",101,0)
+ ;
+"RTN","EDPBCF",102,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPBCF",103,0)
+ S FDA(231.94,EDPIEN,.01)=NAME
+"RTN","EDPBCF",104,0)
+ I $E(EDPIEN,1,2)="+1" D
+"RTN","EDPBCF",105,0)
+ . D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPBCF",106,0)
+ E  D
+"RTN","EDPBCF",107,0)
+ . D FILE^DIE("","FDA","ERR")
+"RTN","EDPBCF",108,0)
+ I $D(DIERR) S MSG="save board name failed: "_$G(EDPIEN)
+"RTN","EDPBCF",109,0)
+ I '$D(DIERR) D
+"RTN","EDPBCF",110,0)
+ . I $E(EDPIEN,1,2)="+1" S EDPIEN=+FDAIEN(1)_","_AREA_","
+"RTN","EDPBCF",111,0)
+ . D WP^DIE(231.94,EDPIEN,1,"","SPEC")
+"RTN","EDPBCF",112,0)
+ . I $D(DIERR) S MSG="save board spec failed: "_$G(EDPIEN)
+"RTN","EDPBCF",113,0)
+ D CLEAN^DILF
+"RTN","EDPBCF",114,0)
+ Q
+"RTN","EDPBCF",115,0)
+COLUMNS ;; Available Columns
+"RTN","EDPBCF",116,0)
+ ;;Room / Bed^@bedNm^Room
+"RTN","EDPBCF",117,0)
+ ;;Patient Name^@ptNm^Patient
+"RTN","EDPBCF",118,0)
+ ;;Patient X9999^@last4^Patient
+"RTN","EDPBCF",119,0)
+ ;;Visit Created^@visit^Visit
+"RTN","EDPBCF",120,0)
+ ;;Clinic^@clinicNm^Clinic
+"RTN","EDPBCF",121,0)
+ ;;Complaint^@complaint^Complaint
+"RTN","EDPBCF",122,0)
+ ;;Comment^@comment^Comment
+"RTN","EDPBCF",123,0)
+ ;;Provider Initials^@mdNm^Prv
+"RTN","EDPBCF",124,0)
+ ;;Resident Initials^@resNm^Res
+"RTN","EDPBCF",125,0)
+ ;;Nurse Initials^@rnNm^RN
+"RTN","EDPBCF",126,0)
+ ;;Acuity^@acuityNm^Acuity
+"RTN","EDPBCF",127,0)
+ ;;Status^@statusNm^Status
+"RTN","EDPBCF",128,0)
+ ;;Lab Active/Complete^@lab^L
+"RTN","EDPBCF",129,0)
+ ;;Imaging Active/Complete^@rad^I
+"RTN","EDPBCF",130,0)
+ ;;New (Unverified) Orders^@ordNew^New
+"RTN","EDPBCF",131,0)
+ ;;Total Minutes^@emins^E Mins
+"RTN","EDPBCF",132,0)
+ ;;Minutes at Location^@lmins^Mins
+"RTN","EDPBCF",133,0)
+ ;;zzzzz
+"RTN","EDPBCM")
+0^26^B17076528
+"RTN","EDPBCM",1,0)
+EDPBCM ;SLC/KCM - Available color maps
+"RTN","EDPBCM",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBCM",3,0)
+ ;
+"RTN","EDPBCM",4,0)
+LOAD(AREA) ; Load Color Spec
+"RTN","EDPBCM",5,0)
+ N I,TOKEN
+"RTN","EDPBCM",6,0)
+ ;
+"RTN","EDPBCM",7,0)
+ D READL^EDPBLK(AREA,"color",.TOKEN)  ; read color config -- LOCK
+"RTN","EDPBCM",8,0)
+ D XML^EDPX("<colorToken>"_TOKEN_"</colorToken>")
+"RTN","EDPBCM",9,0)
+ D XML^EDPX("<colorSpec>")
+"RTN","EDPBCM",10,0)
+ S I=0 F  S I=$O(^EDPB(231.9,AREA,3,I)) Q:'I  D
+"RTN","EDPBCM",11,0)
+ . D XML^EDPX(^EDPB(231.9,AREA,3,I,0))
+"RTN","EDPBCM",12,0)
+ D XML^EDPX("</colorSpec>")
+"RTN","EDPBCM",13,0)
+ D READU^EDPBLK(AREA,"color",.TOKEN)  ; read color config -- UNLOCK
+"RTN","EDPBCM",14,0)
+ Q
+"RTN","EDPBCM",15,0)
+SAVE(REQ) ; Save Configuration
+"RTN","EDPBCM",16,0)
+ N X,WP,AREA,TOKEN,LOCKERR
+"RTN","EDPBCM",17,0)
+ S X="xml-",AREA=$G(REQ("area",1))
+"RTN","EDPBCM",18,0)
+ I 'AREA D SAVERR^EDPX("fail","Missing area") Q
+"RTN","EDPBCM",19,0)
+ ;
+"RTN","EDPBCM",20,0)
+ S TOKEN=$G(REQ("colorToken",1))
+"RTN","EDPBCM",21,0)
+ D SAVEL^EDPBLK(AREA,"color",.TOKEN,.LOCKERR)  ; save color config -- LOCK
+"RTN","EDPBCM",22,0)
+ I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(AREA) Q
+"RTN","EDPBCM",23,0)
+ ;
+"RTN","EDPBCM",24,0)
+ F  S X=$O(REQ(X)) Q:$E(X,1,4)'="xml-"  S WP(+$P(X,"-",2))=REQ(X,1)
+"RTN","EDPBCM",25,0)
+ D WP^DIE(231.9,AREA_",",3,"","WP")
+"RTN","EDPBCM",26,0)
+ D SAVEU^EDPBLK(AREA,"color",.TOKEN)           ; save color config -- UNLOCK
+"RTN","EDPBCM",27,0)
+ ;
+"RTN","EDPBCM",28,0)
+ I $D(DIERR) D SAVERR^EDPX("fail","save failed") Q
+"RTN","EDPBCM",29,0)
+ D XML^EDPX("<save status='ok' />")
+"RTN","EDPBCM",30,0)
+ D LOAD(AREA)  ; return updated list of colors
+"RTN","EDPBCM",31,0)
+ D UPDLAST^EDPBCF(AREA) ; update last config date
+"RTN","EDPBCM",32,0)
+ Q
+"RTN","EDPBCM",33,0)
+COLORS ;; Available Color Maps
+"RTN","EDPBCM",34,0)
+ D ENMAP("none"," ","none")  ; for no selection
+"RTN","EDPBCM",35,0)
+ ;
+"RTN","EDPBCM",36,0)
+ D ENMAP("stsAcuity","Status / Acuity","val")
+"RTN","EDPBCM",37,0)
+ D CODES("status"),CODES("acuity"),EXMAP
+"RTN","EDPBCM",38,0)
+ ;
+"RTN","EDPBCM",39,0)
+ D ENMAP("status","Status","val")
+"RTN","EDPBCM",40,0)
+ D CODES("status"),EXMAP
+"RTN","EDPBCM",41,0)
+ ;
+"RTN","EDPBCM",42,0)
+ D ENMAP("acuity","Acuity","val")
+"RTN","EDPBCM",43,0)
+ D CODES("acuity"),EXMAP
+"RTN","EDPBCM",44,0)
+ ;
+"RTN","EDPBCM",45,0)
+ D ENMAP("bed","Room / Bed","bed")
+"RTN","EDPBCM",46,0)
+ D ENMAP("md","Provider","staff")
+"RTN","EDPBCM",47,0)
+ D ENMAP("res","Resident","staff")
+"RTN","EDPBCM",48,0)
+ D ENMAP("rn","Nurse","staff")
+"RTN","EDPBCM",49,0)
+ ;
+"RTN","EDPBCM",50,0)
+ D ENMAP("labUrg","Urgency - Lab","val")
+"RTN","EDPBCM",51,0)
+ D URG("labUrg"),EXMAP
+"RTN","EDPBCM",52,0)
+ ;D ENMAP("medUrg","Urgency - Medications","val")
+"RTN","EDPBCM",53,0)
+ ;D URG("medUrg"),EXMAP
+"RTN","EDPBCM",54,0)
+ D ENMAP("radUrg","Urgency - Radiology","val")
+"RTN","EDPBCM",55,0)
+ D URG("radUrg"),EXMAP
+"RTN","EDPBCM",56,0)
+ ;
+"RTN","EDPBCM",57,0)
+ D ENMAP("emins","Total Elapsed Minutes","rng")
+"RTN","EDPBCM",58,0)
+ D ENMAP("lmins","Minutes at Location","rng")
+"RTN","EDPBCM",59,0)
+ D ENMAP("minLab","Minutes for Lab Order","rng")
+"RTN","EDPBCM",60,0)
+ ;D ENMAP("minMed","Minutes for Medication Order","rng")
+"RTN","EDPBCM",61,0)
+ D ENMAP("minRad","Minutes for Imaging Order","rng")
+"RTN","EDPBCM",62,0)
+ D ENMAP("minVer","Minutes for Unverified Order","rng")
+"RTN","EDPBCM",63,0)
+ Q
+"RTN","EDPBCM",64,0)
+ENMAP(ID,NM,TYP) ; create element for colormap
+"RTN","EDPBCM",65,0)
+ N X,END
+"RTN","EDPBCM",66,0)
+ S END="/" S:TYP="val" END=""
+"RTN","EDPBCM",67,0)
+ S X("id")=ID
+"RTN","EDPBCM",68,0)
+ S X("nm")=NM
+"RTN","EDPBCM",69,0)
+ S X("type")=TYP
+"RTN","EDPBCM",70,0)
+ D XML^EDPX($$XMLA^EDPX("colors",.X,END))
+"RTN","EDPBCM",71,0)
+ Q
+"RTN","EDPBCM",72,0)
+EXMAP ; create closing tag
+"RTN","EDPBCM",73,0)
+ D XML^EDPX("</colors>")
+"RTN","EDPBCM",74,0)
+ Q
+"RTN","EDPBCM",75,0)
+CODES(NM) ; create map elements for a set of codes
+"RTN","EDPBCM",76,0)
+ N CODESET,IEN
+"RTN","EDPBCM",77,0)
+ S CODESET=EDPSTA_"."_NM
+"RTN","EDPBCM",78,0)
+ I '$D(^EDPB(233.2,"B",CODESET)) S CODESET="edp."_NM
+"RTN","EDPBCM",79,0)
+ S IEN=$O(^EDPB(233.2,"B",CODESET,0))
+"RTN","EDPBCM",80,0)
+ Q:'IEN
+"RTN","EDPBCM",81,0)
+ ;
+"RTN","EDPBCM",82,0)
+ N SEQ,CODE,DA
+"RTN","EDPBCM",83,0)
+ S SEQ=0 F  S SEQ=$O(^EDPB(233.2,IEN,1,"B",SEQ)) Q:'SEQ  D
+"RTN","EDPBCM",84,0)
+ . S DA=0 F  S DA=$O(^EDPB(233.2,IEN,1,"B",SEQ,DA)) Q:'DA  D
+"RTN","EDPBCM",85,0)
+ . . S CODE=$P(^EDPB(233.2,IEN,1,DA,0),U,2)
+"RTN","EDPBCM",86,0)
+ . . Q:'CODE
+"RTN","EDPBCM",87,0)
+ . . D MAP(NM,CODE,$P(^EDPB(233.1,CODE,0),U,2))
+"RTN","EDPBCM",88,0)
+ Q
+"RTN","EDPBCM",89,0)
+URG(ATT) ; create map elements for standard urgencies
+"RTN","EDPBCM",90,0)
+ D MAP(ATT,0,"No Orders")
+"RTN","EDPBCM",91,0)
+ D MAP(ATT,1,"Active Orders")
+"RTN","EDPBCM",92,0)
+ D MAP(ATT,2,"STAT Orders")
+"RTN","EDPBCM",93,0)
+ Q
+"RTN","EDPBCM",94,0)
+MAP(ATT,VAL,NM) ; create a single map element
+"RTN","EDPBCM",95,0)
+ N X
+"RTN","EDPBCM",96,0)
+ S X("att")="@"_ATT
+"RTN","EDPBCM",97,0)
+ S X("val")=VAL
+"RTN","EDPBCM",98,0)
+ S X("nm")=NM
+"RTN","EDPBCM",99,0)
+ S X("clr")=0
+"RTN","EDPBCM",100,0)
+ D XML^EDPX($$XMLA^EDPX("map",.X))
+"RTN","EDPBCM",101,0)
+ Q
+"RTN","EDPBCM",102,0)
+LIST ; Build selection list for color maps -- OBSOLETE?
+"RTN","EDPBCM",103,0)
+ N I,X
+"RTN","EDPBCM",104,0)
+ F I=1:1 S X=$P($T(MAPLST+I),";",3,99) Q:$E(X,1,5)="zzzzz"  D
+"RTN","EDPBCM",105,0)
+ . S X("data")=$P(X,U,1),X("label")=$P(X,U,2)
+"RTN","EDPBCM",106,0)
+ . D XML^EDPX($$XMLA^EDPX("colors",.X))
+"RTN","EDPBCM",107,0)
+ Q
+"RTN","EDPBCM",108,0)
+MAPLST ; list of available color maps
+"RTN","EDPBCM",109,0)
+ ;;^ ^
+"RTN","EDPBCM",110,0)
+ ;;stsAcuity^Status / Acuity
+"RTN","EDPBCM",111,0)
+ ;;status^Status
+"RTN","EDPBCM",112,0)
+ ;;acuity^Acuity
+"RTN","EDPBCM",113,0)
+ ;;bed^Room / Bed
+"RTN","EDPBCM",114,0)
+ ;;staff^Staff
+"RTN","EDPBCM",115,0)
+ ;;labUrg^Urgency - Lab
+"RTN","EDPBCM",116,0)
+ ;;radUrg^Urgency - Imaging
+"RTN","EDPBCM",117,0)
+ ;;emins^Total Minutes
+"RTN","EDPBCM",118,0)
+ ;;lmins^Minutes at Location
+"RTN","EDPBCM",119,0)
+ ;;minLab^Minutes for Lab Order
+"RTN","EDPBCM",120,0)
+ ;;minRad^Minutes for Imaging Order
+"RTN","EDPBCM",121,0)
+ ;;minVer^Minutes for Unverified Order
+"RTN","EDPBCM",122,0)
+ ;;zzzzz
+"RTN","EDPBDL")
+0^56^B11063047
+"RTN","EDPBDL",1,0)
+EDPBDL ;SLC/KCM - Delete/Inactivate Config Entries
+"RTN","EDPBDL",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBDL",3,0)
+ ;
+"RTN","EDPBDL",4,0)
+BED ; Delete Room/Area entries
+"RTN","EDPBDL",5,0)
+ N AREA,IEN
+"RTN","EDPBDL",6,0)
+ D SETAREA(.AREA) Q:'AREA
+"RTN","EDPBDL",7,0)
+ W !,"EDIS Delete Room-Bed Tool",!
+"RTN","EDPBDL",8,0)
+ W !,"This will delete or inactivate an entry from the TRACKING ROOM-BED file."
+"RTN","EDPBDL",9,0)
+ W !,"This may take time, as it must search for usage of the Room-Bed entry."
+"RTN","EDPBDL",10,0)
+ W !,"If the entry has been referenced, it will be inactivated."
+"RTN","EDPBDL",11,0)
+ W !,"Otherwise the entry will be deleted.",!
+"RTN","EDPBDL",12,0)
+ F  S IEN=$$LKBED(AREA) Q:'IEN  D DELBED(IEN)
+"RTN","EDPBDL",13,0)
+ Q
+"RTN","EDPBDL",14,0)
+LKBED(AREA) ; Lookup a bed
+"RTN","EDPBDL",15,0)
+ N DIC,X,Y,DTOUT,DUOUT
+"RTN","EDPBDL",16,0)
+ S DIC="^EDPB(231.8,",DIC(0)="AEMQ"
+"RTN","EDPBDL",17,0)
+ S DIC("S")="I ($P(^(0),U,2)=DUZ(2)),($P(^(0),U,3)=AREA)"
+"RTN","EDPBDL",18,0)
+ D ^DIC
+"RTN","EDPBDL",19,0)
+ Q:+Y>0 +Y
+"RTN","EDPBDL",20,0)
+ Q ""
+"RTN","EDPBDL",21,0)
+ ;
+"RTN","EDPBDL",22,0)
+DELBED(IEN) ; Delete bed if nothing references it, otherwise inactivate
+"RTN","EDPBDL",23,0)
+ N NM,DA,DIE,DR,DIK,DTOUT,DUOUT
+"RTN","EDPBDL",24,0)
+ S NM=$P($G(^EDPB(231.8,IEN,0)),U)
+"RTN","EDPBDL",25,0)
+ I $$BEDUSED(IEN) D
+"RTN","EDPBDL",26,0)
+ . S DA=IEN,DR=".01///Z"_NM_";.04///1",DIE="^EDPB(231.8,"
+"RTN","EDPBDL",27,0)
+ . D ^DIE W !,NM," inactivated and renamed 'Z"_NM_"'.",!
+"RTN","EDPBDL",28,0)
+ E  D
+"RTN","EDPBDL",29,0)
+ . S DA=IEN,DIK="^EDPB(231.8," D ^DIK
+"RTN","EDPBDL",30,0)
+ . W !,$S($D(^EDPB(231.8,DA,0)):" not",1:"")_" deleted.",!
+"RTN","EDPBDL",31,0)
+ Q
+"RTN","EDPBDL",32,0)
+BEDUSED(IEN) ; Return true if log entry references bed
+"RTN","EDPBDL",33,0)
+ W !,"Searching for usages of ",$P(^EDPB(231.8,IEN,0),U)
+"RTN","EDPBDL",34,0)
+ N I,FOUND,COUNT
+"RTN","EDPBDL",35,0)
+ S I=0,FOUND=0,COUNT=0
+"RTN","EDPBDL",36,0)
+ F  S I=$O(^EDP(230.1,I)) Q:'I  D  Q:FOUND
+"RTN","EDPBDL",37,0)
+ . I $P($G(^EDP(230.1,I,3)),U,4)=IEN W "...found" S FOUND=1
+"RTN","EDPBDL",38,0)
+ . S COUNT=COUNT+1 I COUNT#100=0 W "."
+"RTN","EDPBDL",39,0)
+ Q FOUND
+"RTN","EDPBDL",40,0)
+BOARD ; Delete Board entries
+"RTN","EDPBDL",41,0)
+ Q
+"RTN","EDPBDL",42,0)
+CODE ; Delete Selection entries
+"RTN","EDPBDL",43,0)
+ N AREA,SET
+"RTN","EDPBDL",44,0)
+ D SETAREA(.AREA) Q:'AREA
+"RTN","EDPBDL",45,0)
+ W !,"EDIS Delete Selection Tool",!
+"RTN","EDPBDL",46,0)
+ W !,"This will delete a locally defined selection from"
+"RTN","EDPBDL",47,0)
+ W !,"an EDIS selection list.",!
+"RTN","EDPBDL",48,0)
+ S SET=$$LKSEL(AREA) Q:'SET
+"RTN","EDPBDL",49,0)
+ ;
+"RTN","EDPBDL",50,0)
+ N DIC,X,Y,X0,NM,DTOUT,DUOUT
+"RTN","EDPBDL",51,0)
+ S DIC="^EDPB(233.2,"_SET_",1,",DIC(0)="AEMQ"
+"RTN","EDPBDL",52,0)
+ S DIC("W")="W $P(^(0),U,4)"
+"RTN","EDPBDL",53,0)
+ D ^DIC
+"RTN","EDPBDL",54,0)
+ Q:Y<1
+"RTN","EDPBDL",55,0)
+ S X0=^EDPB(233.2,SET,1,+Y,0),NM=$P(^EDPB(233.1,+$P(X0,U,2),0),U)
+"RTN","EDPBDL",56,0)
+ I $E(NM,1,3)="edp" W !,"Cannot delete nationally defined item." Q
+"RTN","EDPBDL",57,0)
+ D DELCODE(SET,+Y)
+"RTN","EDPBDL",58,0)
+ Q
+"RTN","EDPBDL",59,0)
+LKSEL(AREA) ; Choose selection list for deletion
+"RTN","EDPBDL",60,0)
+ N DIR,X,Y,DTOUT,DUOUT,DIRUT
+"RTN","EDPBDL",61,0)
+ S DIR(0)="SABO^1:Status;2:Disposition;3:Delay Reason;4:Source"
+"RTN","EDPBDL",62,0)
+ S DIR("A")="Selection List (1/2/3/4):"
+"RTN","EDPBDL",63,0)
+ S DIR("A",1)="Choose the list you with to delete from -"
+"RTN","EDPBDL",64,0)
+ S DIR("A",2)="1:  Status",DIR("A",3)="2:  Disposition"
+"RTN","EDPBDL",65,0)
+ S DIR("A",4)="3:  Delay Reason",DIR("A",5)="4:  Source"
+"RTN","EDPBDL",66,0)
+ D ^DIR
+"RTN","EDPBDL",67,0)
+ Q:'Y ""
+"RTN","EDPBDL",68,0)
+ ;
+"RTN","EDPBDL",69,0)
+ N SETNM,IEN
+"RTN","EDPBDL",70,0)
+ S SETNM=$S(1:".status",2:".disposition",3:".delay",4:".arrival",1:"")
+"RTN","EDPBDL",71,0)
+ Q:SETNM="" ""
+"RTN","EDPBDL",72,0)
+ S SETNM=$$STA^XUAF4(DUZ(2))_SETNM
+"RTN","EDPBDL",73,0)
+ S IEN=$O(^EDPB(233.2,"B",SETNM,0))
+"RTN","EDPBDL",74,0)
+ I 'IEN W !,"No locally defined selections found." Q ""
+"RTN","EDPBDL",75,0)
+ Q IEN
+"RTN","EDPBDL",76,0)
+ ;
+"RTN","EDPBDL",77,0)
+DELCODE(SET,DA) ; Delete from inside selection multiple
+"RTN","EDPBDL",78,0)
+ N DIK
+"RTN","EDPBDL",79,0)
+ W !,$P(^EDPB(233.2,SET,1,DA,0),U,4)
+"RTN","EDPBDL",80,0)
+ S DIK="^EDPB(233.2,"_SET_",1,",DA(1)=SET D ^DIK
+"RTN","EDPBDL",81,0)
+ W "  ",$S($D(^EDPB(233.2,SET,1,DA,0)):" not",1:"")," deleted",!
+"RTN","EDPBDL",82,0)
+ Q
+"RTN","EDPBDL",83,0)
+ ;
+"RTN","EDPBDL",84,0)
+SETAREA(AREA) ; Set to default area for institution in DUZ(2)
+"RTN","EDPBDL",85,0)
+ S AREA=$O(^EDPB(231.9,"C",DUZ(2),0))
+"RTN","EDPBDL",86,0)
+ I 'AREA W !,"No tracking area is configured."
+"RTN","EDPBDL",87,0)
+ Q
+"RTN","EDPBKS")
+0^57^B15371728
+"RTN","EDPBKS",1,0)
+EDPBKS ;SLC/MKB -- EDPF BIGBOARD KIOSKS list template
+"RTN","EDPBKS",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBKS",3,0)
+ ;
+"RTN","EDPBKS",4,0)
+EN ; -- main entry point
+"RTN","EDPBKS",5,0)
+ S EDPSITE=$$DIV Q:EDPSITE<1
+"RTN","EDPBKS",6,0)
+ D EN^VALM("EDPF BIGBOARD KIOSKS")
+"RTN","EDPBKS",7,0)
+ Q
+"RTN","EDPBKS",8,0)
+ ;
+"RTN","EDPBKS",9,0)
+HDR ; -- header code
+"RTN","EDPBKS",10,0)
+ N X S X=$$NS^XUAF4(EDPSITE)
+"RTN","EDPBKS",11,0)
+ S VALMHDR(1)="Division: "_$P(X,U)_" ("_$P(X,U,2)_")"
+"RTN","EDPBKS",12,0)
+ Q
+"RTN","EDPBKS",13,0)
+ ;
+"RTN","EDPBKS",14,0)
+INIT ; -- init variables and list array EDPB
+"RTN","EDPBKS",15,0)
+ N EDPX,I,X K EDPB
+"RTN","EDPBKS",16,0)
+ D GETLST^XPAR(.EDPX,"DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS")
+"RTN","EDPBKS",17,0)
+ S VALMCNT=EDPX I EDPX F I=1:1:EDPX D
+"RTN","EDPBKS",18,0)
+ . S X=EDPX(I),EDPB("IDX",I)=X
+"RTN","EDPBKS",19,0)
+ . N X1,X2 S X1=$P(X,U),X2=$P(X,U,2)
+"RTN","EDPBKS",20,0)
+ . S:$L(X1)>37 X1=$E(X1,1,37)_"..." S:$L(X2)>27 X2=$E(X2,1,27)_"..."
+"RTN","EDPBKS",21,0)
+ . S EDPB(I,0)=$$LJ^XLFSTR(I,4)_$$LJ^XLFSTR(X1,40)_X2
+"RTN","EDPBKS",22,0)
+ Q
+"RTN","EDPBKS",23,0)
+ ;
+"RTN","EDPBKS",24,0)
+HELP ; -- help code
+"RTN","EDPBKS",25,0)
+ S X="?" D DISP^XQORM1 W !!
+"RTN","EDPBKS",26,0)
+ Q
+"RTN","EDPBKS",27,0)
+ ;
+"RTN","EDPBKS",28,0)
+EXIT ; -- exit code
+"RTN","EDPBKS",29,0)
+ K EDPSITE
+"RTN","EDPBKS",30,0)
+ Q
+"RTN","EDPBKS",31,0)
+ ;
+"RTN","EDPBKS",32,0)
+DIV() ; -- select division
+"RTN","EDPBKS",33,0)
+ N X,Y,DIC
+"RTN","EDPBKS",34,0)
+ S DIC=4,DIC(0)="AEQM"
+"RTN","EDPBKS",35,0)
+ ; DIC("S")= only local divisions ??
+"RTN","EDPBKS",36,0)
+ D ^DIC S Y=$S(Y<1:"",1:+Y)
+"RTN","EDPBKS",37,0)
+ Q Y
+"RTN","EDPBKS",38,0)
+ ;
+"RTN","EDPBKS",39,0)
+ENTER(NAME,DEFAULT) ; -- prompt for NAME
+"RTN","EDPBKS",40,0)
+ N X,Y,DIR,DTOUT,DUOUT
+"RTN","EDPBKS",41,0)
+ S DIR(0)="FAO",DIR("A")=NAME_": " S:$L($G(DEFAULT)) DIR("B")=DEFAULT
+"RTN","EDPBKS",42,0)
+ I $E(NAME)="C" S DIR("?")="Enter a fully specified computer name; this will be saved in lowercase."
+"RTN","EDPBKS",43,0)
+ E  S DIR("?")="Enter the name of the board to be displayed on this computer; this value is case-sensitive."
+"RTN","EDPBKS",44,0)
+ D ^DIR I $G(DTOUT)!$G(DUOUT) S Y=""
+"RTN","EDPBKS",45,0)
+ Q Y
+"RTN","EDPBKS",46,0)
+ ;
+"RTN","EDPBKS",47,0)
+SELECT() ; -- select item from list by number
+"RTN","EDPBKS",48,0)
+ N X,Y,DIR,DTOUT,DUOUT
+"RTN","EDPBKS",49,0)
+ S DIR(0)="NAO^1:"_VALMCNT,DIR("A")="Select computer/board: "
+"RTN","EDPBKS",50,0)
+ D ^DIR
+"RTN","EDPBKS",51,0)
+ Q Y
+"RTN","EDPBKS",52,0)
+ ;
+"RTN","EDPBKS",53,0)
+SURE(NAME) ; -- are you sure?
+"RTN","EDPBKS",54,0)
+ N X,Y,DIR,DTOUT,DUOUT W !
+"RTN","EDPBKS",55,0)
+ S DIR("A",1)="Deletions are done immediately!"
+"RTN","EDPBKS",56,0)
+ S DIR(0)="YA",DIR("A")="Are you sure"_$S($L($G(NAME)):" you want to remove "_NAME,1:"")_"? "
+"RTN","EDPBKS",57,0)
+ D ^DIR
+"RTN","EDPBKS",58,0)
+ Q Y
+"RTN","EDPBKS",59,0)
+ ;
+"RTN","EDPBKS",60,0)
+ ; -- EDPF BIGBOARD MENU actions --
+"RTN","EDPBKS",61,0)
+ ;
+"RTN","EDPBKS",62,0)
+NEWDIV ; -- select new division
+"RTN","EDPBKS",63,0)
+ N X D FULL^VALM1 S VALMBCK="R"
+"RTN","EDPBKS",64,0)
+ S X=$$DIV I X,X'=EDPSITE D
+"RTN","EDPBKS",65,0)
+ . W !,"Rebuilding list ..." H 1
+"RTN","EDPBKS",66,0)
+ . S EDPSITE=X D INIT
+"RTN","EDPBKS",67,0)
+ . K VALMHDR
+"RTN","EDPBKS",68,0)
+ Q
+"RTN","EDPBKS",69,0)
+ ;
+"RTN","EDPBKS",70,0)
+ADD ; -- add a computer/board
+"RTN","EDPBKS",71,0)
+ N INST,VAL,DONE,EDPERR,MORE
+"RTN","EDPBKS",72,0)
+ D FULL^VALM1 S VALMBCK="R" W !
+"RTN","EDPBKS",73,0)
+ S (DONE,MORE)=0 F  D  Q:DONE
+"RTN","EDPBKS",74,0)
+ . S INST=$$ENTER("Computer Name") I '$L(INST) S DONE=1 Q
+"RTN","EDPBKS",75,0)
+ . S INST=$$LOW^XLFSTR(INST) ;enforce lowercase
+"RTN","EDPBKS",76,0)
+ . S VAL=$$ENTER("Display Board") I '$L(VAL) S DONE=1 Q
+"RTN","EDPBKS",77,0)
+ . D ADD^XPAR("DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS",INST,VAL,.EDPERR)
+"RTN","EDPBKS",78,0)
+ . I EDPERR W !,$P(EDPERR,U,2),! H 2 Q
+"RTN","EDPBKS",79,0)
+ . S MORE=1 W !
+"RTN","EDPBKS",80,0)
+ D:MORE INIT
+"RTN","EDPBKS",81,0)
+ Q
+"RTN","EDPBKS",82,0)
+ ;
+"RTN","EDPBKS",83,0)
+REM ; -- remove a computer/board
+"RTN","EDPBKS",84,0)
+ N NUM,INST,EDPERR S VALMBCK=""
+"RTN","EDPBKS",85,0)
+ S NUM=$$SELECT Q:NUM<1
+"RTN","EDPBKS",86,0)
+ S INST=$P($G(EDPB("IDX",NUM)),U)
+"RTN","EDPBKS",87,0)
+ I '$L(INST) W !,"Invalid selection" H 1 Q
+"RTN","EDPBKS",88,0)
+ Q:'$$SURE(INST)
+"RTN","EDPBKS",89,0)
+ D DEL^XPAR("DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS",INST,.EDPERR)
+"RTN","EDPBKS",90,0)
+ I EDPERR W !,$P(EDPERR,U,2) H 2 Q
+"RTN","EDPBKS",91,0)
+ W !,"Board removed." H 1
+"RTN","EDPBKS",92,0)
+ D INIT S VALMBCK="R"
+"RTN","EDPBKS",93,0)
+ Q
+"RTN","EDPBKS",94,0)
+ ;
+"RTN","EDPBKS",95,0)
+CHG ; -- change a computer or board name
+"RTN","EDPBKS",96,0)
+ N NUM,OLD,INST,VAL,EDPERR S VALMBCK=""
+"RTN","EDPBKS",97,0)
+ S NUM=$$SELECT Q:NUM<1
+"RTN","EDPBKS",98,0)
+ S OLD=$G(EDPB("IDX",NUM)),VALMBCK="R"
+"RTN","EDPBKS",99,0)
+ S INST=$$ENTER("Computer Name",$P(OLD,U)) Q:'$L(INST)
+"RTN","EDPBKS",100,0)
+ S INST=$$LOW^XLFSTR(INST) ;enforce lowercase
+"RTN","EDPBKS",101,0)
+ S VAL=$$ENTER("Display Board",$P(OLD,U,2)) Q:'$L(VAL)
+"RTN","EDPBKS",102,0)
+ I OLD=(INST_U_VAL) Q  ;no change
+"RTN","EDPBKS",103,0)
+ I INST'=$P(OLD,U) D  Q:EDPERR
+"RTN","EDPBKS",104,0)
+ . D REP^XPAR("DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS",$P(OLD,U),INST,.EDPERR)
+"RTN","EDPBKS",105,0)
+ . I EDPERR W !,$P(EDPERR,U,2) H 2
+"RTN","EDPBKS",106,0)
+ I VAL'=$P(OLD,U,2) D
+"RTN","EDPBKS",107,0)
+ . D CHG^XPAR("DIV.`"_EDPSITE,"EDPF BIGBOARD KIOSKS",INST,VAL,.EDPERR)
+"RTN","EDPBKS",108,0)
+ . I EDPERR W !,$P(EDPERR,U,2) H 2 Q
+"RTN","EDPBKS",109,0)
+ D INIT
+"RTN","EDPBKS",110,0)
+ Q
+"RTN","EDPBLK")
+0^55^B7330093
+"RTN","EDPBLK",1,0)
+EDPBLK ;SLC/KCM - Handle locking for configuration
+"RTN","EDPBLK",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBLK",3,0)
+ ;
+"RTN","EDPBLK",4,0)
+READL(AREA,PART,TOKEN) ; lock for reading
+"RTN","EDPBLK",5,0)
+ N DAY,SEQ
+"RTN","EDPBLK",6,0)
+ S DAY=$$INITLOCK
+"RTN","EDPBLK",7,0)
+ L +^XTMP("EDP-LOCK-"_DAY,AREA,PART):10 E  Q ""
+"RTN","EDPBLK",8,0)
+ S SEQ=+$G(^XTMP("EDP-LOCK-"_DAY,AREA,PART,"READ"))+1
+"RTN","EDPBLK",9,0)
+ S ^XTMP("EDP-LOCK-"_DAY,AREA,PART,"READ")=SEQ
+"RTN","EDPBLK",10,0)
+ S TOKEN=DAY_"-"_SEQ
+"RTN","EDPBLK",11,0)
+ Q
+"RTN","EDPBLK",12,0)
+READU(AREA,PART,TOKEN) ; unlock for reading
+"RTN","EDPBLK",13,0)
+ Q:$G(TOKEN)=""
+"RTN","EDPBLK",14,0)
+ L -^XTMP("EDP-LOCK-"_$P(TOKEN,"-"),AREA,PART)
+"RTN","EDPBLK",15,0)
+ Q
+"RTN","EDPBLK",16,0)
+INITLOCK() ; returns lock table id, initializing new table if necessary
+"RTN","EDPBLK",17,0)
+ S DAY=+$H
+"RTN","EDPBLK",18,0)
+ I '$D(^XTMP("EDP-LOCK-"_DAY,0)) D
+"RTN","EDPBLK",19,0)
+ . S ^XTMP("EDP-LOCK-"_DAY,0)=$$FMADD^XLFDT(DT,2)_U_DT_U_"ED Locks"
+"RTN","EDPBLK",20,0)
+ . N X S X=DAY-3  ; delete any older than 3 days
+"RTN","EDPBLK",21,0)
+ . F  S X=$O(^XTMP("EDP-LOCK-"_X),-1) Q:$E(X,1,8)'="EDP-LOCK"  D
+"RTN","EDPBLK",22,0)
+ . . S X=$P(X,"-",3)
+"RTN","EDPBLK",23,0)
+ . . K ^XTMP("EDP-LOCK-"_X)
+"RTN","EDPBLK",24,0)
+ Q DAY
+"RTN","EDPBLK",25,0)
+ ;
+"RTN","EDPBLK",26,0)
+SAVEL(AREA,PART,TOKEN,ERR) ; lock for saving configuration
+"RTN","EDPBLK",27,0)
+ ; ERR is return, empty if successful, message if lock fails
+"RTN","EDPBLK",28,0)
+ ; TOKEN is returned with save token, contains read token initially 
+"RTN","EDPBLK",29,0)
+ S ERR=""
+"RTN","EDPBLK",30,0)
+ I '$L(TOKEN) S ERR="Unable to update with empty token" Q
+"RTN","EDPBLK",31,0)
+ ;
+"RTN","EDPBLK",32,0)
+ ; extract from token the time of the GET
+"RTN","EDPBLK",33,0)
+ N GDAY,GSEQ
+"RTN","EDPBLK",34,0)
+ S GDAY=$P(TOKEN,"-"),GSEQ=$P(TOKEN,"-",2)
+"RTN","EDPBLK",35,0)
+ ;
+"RTN","EDPBLK",36,0)
+ ; lock out all reads during the update
+"RTN","EDPBLK",37,0)
+ N DAY
+"RTN","EDPBLK",38,0)
+ S DAY=$$INITLOCK
+"RTN","EDPBLK",39,0)
+ L +^XTMP("EDP-LOCK-"_DAY,AREA,PART):10 E  S ERR="Unable to obtain lock" Q
+"RTN","EDPBLK",40,0)
+ ;
+"RTN","EDPBLK",41,0)
+ ; look backwards for interfering updates since GET
+"RTN","EDPBLK",42,0)
+ N COLLIDE,SEQ,X,Y
+"RTN","EDPBLK",43,0)
+ S COLLIDE="",X="EDP-LOCK-?"
+"RTN","EDPBLK",44,0)
+ F  S X=$O(^XTMP(X),-1) Q:$E(X,1,8)'="EDP-LOCK"  Q:$P(X,"-",3)<GDAY  D
+"RTN","EDPBLK",45,0)
+ . S Y=$O(^XTMP(X,AREA,PART,"SAVE"," "),-1) Q:'Y  ; no puts
+"RTN","EDPBLK",46,0)
+ . I (GDAY=$P(X,"-",3)),(Y<GSEQ) Q                ; put earlier than get token
+"RTN","EDPBLK",47,0)
+ . S COLLIDE=^XTMP(X,AREA,PART,"SAVE",Y)
+"RTN","EDPBLK",48,0)
+ ;
+"RTN","EDPBLK",49,0)
+ I COLLIDE D
+"RTN","EDPBLK",50,0)
+ . L -^XTMP("EDP-LOCK-"_DAY,AREA,PART)
+"RTN","EDPBLK",51,0)
+ . I COLLIDE=TOKEN S ERR="These changes have already been saved." Q
+"RTN","EDPBLK",52,0)
+ . S ERR="Only one person should edit the configuration at a time.  "
+"RTN","EDPBLK",53,0)
+ . S ERR=ERR_"The configuration has been modified since you began.  "
+"RTN","EDPBLK",54,0)
+ . S ERR=ERR_"You will need to re-enter the changes you have made."
+"RTN","EDPBLK",55,0)
+ E  D
+"RTN","EDPBLK",56,0)
+ . S SEQ=+$G(^XTMP("EDP-LOCK-"_DAY,AREA,PART,"READ"))+1
+"RTN","EDPBLK",57,0)
+ . S ^XTMP("EDP-LOCK-"_DAY,AREA,PART,"READ")=SEQ
+"RTN","EDPBLK",58,0)
+ . S ^XTMP("EDP-LOCK-"_DAY,AREA,PART,"SAVE",SEQ)=TOKEN
+"RTN","EDPBLK",59,0)
+ . S TOKEN=DAY_"-"_SEQ
+"RTN","EDPBLK",60,0)
+ ;
+"RTN","EDPBLK",61,0)
+ ; return & do the actual update now, unlocking afterwards
+"RTN","EDPBLK",62,0)
+ Q
+"RTN","EDPBLK",63,0)
+SAVEU(AREA,PART,TOKEN) ; Unlock for saving
+"RTN","EDPBLK",64,0)
+ L -^XTMP("EDP-LOCK-"_$P(TOKEN,"-"),AREA,PART)
+"RTN","EDPBLK",65,0)
+ Q
+"RTN","EDPBPM")
+0^27^B6216911
+"RTN","EDPBPM",1,0)
+EDPBPM ;SLC/KCM - Parameters for Tracking Area
+"RTN","EDPBPM",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBPM",3,0)
+ ;
+"RTN","EDPBPM",4,0)
+LOAD(AREA) ; load parameters for area
+"RTN","EDPBPM",5,0)
+ N X,X1,TOKEN
+"RTN","EDPBPM",6,0)
+ D READL^EDPBLK(AREA,"param",.TOKEN)  ; read param config -- LOCK
+"RTN","EDPBPM",7,0)
+ D XML^EDPX("<paramToken>"_TOKEN_"</paramToken>")
+"RTN","EDPBPM",8,0)
+ S X1=$G(^EDPB(231.9,AREA,1))
+"RTN","EDPBPM",9,0)
+ S X("reqDiag")=+$P(X1,U,1)
+"RTN","EDPBPM",10,0)
+ S X("codedDiag")=+$P(X1,U,2)
+"RTN","EDPBPM",11,0)
+ S X("reqDisp")=+$P(X1,U,3)
+"RTN","EDPBPM",12,0)
+ S X("reqDelay")=+$P(X1,U,4)
+"RTN","EDPBPM",13,0)
+ S X("minDelay")=+$P(X1,U,5)
+"RTN","EDPBPM",14,0)
+ S X("shiftOne")=$P(X1,U,6)
+"RTN","EDPBPM",15,0)
+ S X("shiftLen")=$P(X1,U,7)
+"RTN","EDPBPM",16,0)
+ S X("residents")=$P(X1,U,8)
+"RTN","EDPBPM",17,0)
+ S X("clinics")=$P(X1,U,9)
+"RTN","EDPBPM",18,0)
+ S X("ambulance")=$P(X1,U,11)
+"RTN","EDPBPM",19,0)
+ S X("dfltroom")=$P(X1,U,12)
+"RTN","EDPBPM",20,0)
+ D XML^EDPX($$XMLA^EDPX("params",.X))
+"RTN","EDPBPM",21,0)
+ D READU^EDPBLK(AREA,"param",.TOKEN)  ; read param config -- UNLOCK
+"RTN","EDPBPM",22,0)
+ Q
+"RTN","EDPBPM",23,0)
+SAVE(AREA,PARAM) ; save updated parameters
+"RTN","EDPBPM",24,0)
+ I '$D(^EDPB(231.9,AREA,0)) D SAVERR^EDPX("fail","Area not set up") Q
+"RTN","EDPBPM",25,0)
+ ;
+"RTN","EDPBPM",26,0)
+ N TOKEN,LOCKERR
+"RTN","EDPBPM",27,0)
+ S TOKEN=$G(REQ("paramToken",1))
+"RTN","EDPBPM",28,0)
+ D SAVEL^EDPBLK(AREA,"param",.TOKEN,.LOCKERR) ; save param config -- LOCK
+"RTN","EDPBPM",29,0)
+ I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(AREA) Q
+"RTN","EDPBPM",30,0)
+ ;
+"RTN","EDPBPM",31,0)
+ N FLD D NVPARSE^EDPX(.FLD,PARAM)
+"RTN","EDPBPM",32,0)
+ N FDA,FDAIEN,DIERR
+"RTN","EDPBPM",33,0)
+ S AREA=AREA_","
+"RTN","EDPBPM",34,0)
+ I FLD("ambulance")=-1 S FLD("ambulance")="@"
+"RTN","EDPBPM",35,0)
+ I FLD("dfltroom")=-1 S FLD("dfltroom")="@"
+"RTN","EDPBPM",36,0)
+ S FDA(231.9,AREA,1.1)=FLD("reqDiag")
+"RTN","EDPBPM",37,0)
+ S FDA(231.9,AREA,1.2)=FLD("codedDiag")
+"RTN","EDPBPM",38,0)
+ S FDA(231.9,AREA,1.3)=FLD("reqDisp")
+"RTN","EDPBPM",39,0)
+ S FDA(231.9,AREA,1.4)=FLD("reqDelay")
+"RTN","EDPBPM",40,0)
+ S FDA(231.9,AREA,1.5)=FLD("minDelay")
+"RTN","EDPBPM",41,0)
+ S FDA(231.9,AREA,1.6)=FLD("shiftOne")
+"RTN","EDPBPM",42,0)
+ S FDA(231.9,AREA,1.7)=FLD("shiftLen")
+"RTN","EDPBPM",43,0)
+ S FDA(231.9,AREA,1.8)=FLD("residents")
+"RTN","EDPBPM",44,0)
+ S FDA(231.9,AREA,1.9)=FLD("clinics")
+"RTN","EDPBPM",45,0)
+ S FDA(231.9,AREA,1.11)=FLD("ambulance")
+"RTN","EDPBPM",46,0)
+ S FDA(231.9,AREA,1.12)=FLD("dfltroom")
+"RTN","EDPBPM",47,0)
+ D FILE^DIE("","FDA","ERR")
+"RTN","EDPBPM",48,0)
+ D SAVEU^EDPBLK(+AREA,"param",.TOKEN)         ; save param config -- UNLOCK
+"RTN","EDPBPM",49,0)
+ ;
+"RTN","EDPBPM",50,0)
+ I $D(DIERR) D SAVERR^EDPX("fail",$G(ERR("DIERR",1,"TEXT",1))) Q
+"RTN","EDPBPM",51,0)
+ D XML^EDPX("<save status='ok' />")
+"RTN","EDPBPM",52,0)
+ D LOAD(+AREA)
+"RTN","EDPBPM",53,0)
+ Q
+"RTN","EDPBPM",54,0)
+TZSAVE(AREA,TZDIFF) ; save time zone difference in minutes
+"RTN","EDPBPM",55,0)
+ N FDA,FDAIEN,DIERR
+"RTN","EDPBPM",56,0)
+ S AREA=AREA_","
+"RTN","EDPBPM",57,0)
+ S FDA(231.9,AREA,.03)=TZDIFF
+"RTN","EDPBPM",58,0)
+ D FILE^DIE("","FDA","ERR")
+"RTN","EDPBPM",59,0)
+ Q
+"RTN","EDPBRM")
+0^28^B24385375
+"RTN","EDPBRM",1,0)
+EDPBRM ;SLC/KCM - Room/Bed Configuration
+"RTN","EDPBRM",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBRM",3,0)
+ ;
+"RTN","EDPBRM",4,0)
+LOAD(AREA) ; Load the list of rooms/beds for this area
+"RTN","EDPBRM",5,0)
+ N BED,SEQ,BEDS,X0,TOKEN
+"RTN","EDPBRM",6,0)
+ ;
+"RTN","EDPBRM",7,0)
+ D READL^EDPBLK(AREA,"bed",.TOKEN) ; read bed config -- LOCK
+"RTN","EDPBRM",8,0)
+ D XML^EDPX("<bedToken>"_TOKEN_"</bedToken>")
+"RTN","EDPBRM",9,0)
+ ;
+"RTN","EDPBRM",10,0)
+ ; Get a list of all the beds in sequence for this area
+"RTN","EDPBRM",11,0)
+ S BED=0 F  S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED  D
+"RTN","EDPBRM",12,0)
+ . S SEQ=$P(^EDPB(231.8,BED,0),U,5) S:'SEQ SEQ=99999
+"RTN","EDPBRM",13,0)
+ . S BEDS(SEQ,BED)=""
+"RTN","EDPBRM",14,0)
+ ;
+"RTN","EDPBRM",15,0)
+ ; Build the XML for each bed in sequence
+"RTN","EDPBRM",16,0)
+ D XML^EDPX("<beds>")
+"RTN","EDPBRM",17,0)
+ S SEQ=0 F  S SEQ=$O(BEDS(SEQ)) Q:'SEQ  D
+"RTN","EDPBRM",18,0)
+ . S BED=0 F  S BED=$O(BEDS(SEQ,BED)) Q:'BED  D
+"RTN","EDPBRM",19,0)
+ . . S X0=^EDPB(231.8,BED,0)
+"RTN","EDPBRM",20,0)
+ . . N X
+"RTN","EDPBRM",21,0)
+ . . S X("id")=BED
+"RTN","EDPBRM",22,0)
+ . . S X("name")=$P(X0,U)
+"RTN","EDPBRM",23,0)
+ . . S X("site")=$P(X0,U,2)
+"RTN","EDPBRM",24,0)
+ . . S X("area")=$P(X0,U,3)
+"RTN","EDPBRM",25,0)
+ . . S X("inactive")=$P(X0,U,4)
+"RTN","EDPBRM",26,0)
+ . . S X("seq")=$P(X0,U,5)
+"RTN","EDPBRM",27,0)
+ . . S X("display")=$P(X0,U,6)
+"RTN","EDPBRM",28,0)
+ . . S X("when")=$P(X0,U,7)
+"RTN","EDPBRM",29,0)
+ . . S X("status")=$P(X0,U,8)
+"RTN","EDPBRM",30,0)
+ . . S X("category")=$P(X0,U,9)
+"RTN","EDPBRM",31,0)
+ . . S X("shared")=$P(X0,U,10)
+"RTN","EDPBRM",32,0)
+ . . S X("board")=$P(X0,U,11)
+"RTN","EDPBRM",33,0)
+ . . S X("color")=$P(X0,U,12)
+"RTN","EDPBRM",34,0)
+ . . D XML^EDPX($$XMLA^EDPX("bed",.X))
+"RTN","EDPBRM",35,0)
+ D XML^EDPX("</beds>")
+"RTN","EDPBRM",36,0)
+ ;
+"RTN","EDPBRM",37,0)
+ D READU^EDPBLK(AREA,"bed",.TOKEN) ; read bed config -- UNLOCK
+"RTN","EDPBRM",38,0)
+ Q
+"RTN","EDPBRM",39,0)
+SAVE(REQ,AREA) ; Save the updated bed list
+"RTN","EDPBRM",40,0)
+ ; loop thru the records and update where changed
+"RTN","EDPBRM",41,0)
+ N X,BED,ERR,TOKEN,LOCKERR
+"RTN","EDPBRM",42,0)
+ ;
+"RTN","EDPBRM",43,0)
+ S TOKEN=$G(REQ("bedToken",1))
+"RTN","EDPBRM",44,0)
+ D SAVEL^EDPBLK(AREA,"bed",.TOKEN,.LOCKERR)  ; save bed config -- LOCK
+"RTN","EDPBRM",45,0)
+ I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(AREA),DFLTRM(AREA) Q
+"RTN","EDPBRM",46,0)
+ ;
+"RTN","EDPBRM",47,0)
+ S X="bed-",ERR=""
+"RTN","EDPBRM",48,0)
+ F  S X=$O(REQ(X)) Q:$E(X,1,4)'="bed-"  D
+"RTN","EDPBRM",49,0)
+ . K BED S BED=""
+"RTN","EDPBRM",50,0)
+ . D NVPARSE^EDPX(.BED,REQ(X,1))
+"RTN","EDPBRM",51,0)
+ . S BED("name")=$$TRIM^XLFSTR(BED("name"))
+"RTN","EDPBRM",52,0)
+ . I '$L(BED("name")) S ERR=ERR_"Name may not be blank.  " Q
+"RTN","EDPBRM",53,0)
+ . I BED("changed") D UPD(.BED,.ERR)
+"RTN","EDPBRM",54,0)
+ D SAVEU^EDPBLK(AREA,"bed",.TOKEN)           ; save bed config -- UNLOCK
+"RTN","EDPBRM",55,0)
+ ;
+"RTN","EDPBRM",56,0)
+ I $L(ERR) D SAVERR^EDPX("fail",ERR) Q
+"RTN","EDPBRM",57,0)
+ D XML^EDPX("<save status='ok' />")
+"RTN","EDPBRM",58,0)
+ D LOAD(AREA)    ; return updated list of beds
+"RTN","EDPBRM",59,0)
+ D DFLTRM(AREA)  ; return new default lists of beds
+"RTN","EDPBRM",60,0)
+ Q
+"RTN","EDPBRM",61,0)
+UPD(FLD,ERRMSG) ; Add/Update Record
+"RTN","EDPBRM",62,0)
+ N EDPIEN
+"RTN","EDPBRM",63,0)
+ S EDPIEN=FLD("id")_","
+"RTN","EDPBRM",64,0)
+ I FLD("id")=0 S EDPIEN="+1,"
+"RTN","EDPBRM",65,0)
+ ;
+"RTN","EDPBRM",66,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPBRM",67,0)
+ S FDA(231.8,EDPIEN,.01)=FLD("name")
+"RTN","EDPBRM",68,0)
+ S FDA(231.8,EDPIEN,.02)=EDPSITE
+"RTN","EDPBRM",69,0)
+ S FDA(231.8,EDPIEN,.03)=FLD("area")
+"RTN","EDPBRM",70,0)
+ S FDA(231.8,EDPIEN,.04)=FLD("inactive")
+"RTN","EDPBRM",71,0)
+ S FDA(231.8,EDPIEN,.05)=FLD("seq")
+"RTN","EDPBRM",72,0)
+ S FDA(231.8,EDPIEN,.06)=FLD("display")
+"RTN","EDPBRM",73,0)
+ S FDA(231.8,EDPIEN,.07)=FLD("when")
+"RTN","EDPBRM",74,0)
+ S FDA(231.8,EDPIEN,.08)=FLD("status")
+"RTN","EDPBRM",75,0)
+ S FDA(231.8,EDPIEN,.09)=FLD("category")
+"RTN","EDPBRM",76,0)
+ S FDA(231.8,EDPIEN,.1)=FLD("shared")
+"RTN","EDPBRM",77,0)
+ S FDA(231.8,EDPIEN,.11)=FLD("board")
+"RTN","EDPBRM",78,0)
+ S FDA(231.8,EDPIEN,.12)=FLD("color")
+"RTN","EDPBRM",79,0)
+ I EDPIEN="+1," D
+"RTN","EDPBRM",80,0)
+ . D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPBRM",81,0)
+ . I $D(DIERR) S ERRMSG=ERRMSG_"Adding "_FLD("name")_" failed.  "
+"RTN","EDPBRM",82,0)
+ E  D
+"RTN","EDPBRM",83,0)
+ . D FILE^DIE("","FDA","ERR")
+"RTN","EDPBRM",84,0)
+ . I $D(DIERR) S ERRMSG=ERRMSG_"Updating "_FLD("name")_" failed.  "
+"RTN","EDPBRM",85,0)
+ D CLEAN^DILF
+"RTN","EDPBRM",86,0)
+ Q
+"RTN","EDPBRM",87,0)
+DFLTRM(AREA) ; Load the multi-areas
+"RTN","EDPBRM",88,0)
+ N BED,X,X0,ALPHA
+"RTN","EDPBRM",89,0)
+ D XML^EDPX("<defaultRoomList>")
+"RTN","EDPBRM",90,0)
+ D XML^EDPX($$XMLS^EDPX("item",-1,"(None Selected)"))   ;non-selected (-1 will delete)
+"RTN","EDPBRM",91,0)
+ S BED=0 F  S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED  D
+"RTN","EDPBRM",92,0)
+ . S X0=^EDPB(231.8,BED,0)
+"RTN","EDPBRM",93,0)
+ . I $P(X0,U,4) Q  ; inactive
+"RTN","EDPBRM",94,0)
+ . I ($P(X0,U,9)=1)!($P(X0,U,9)=2) S ALPHA($P(X0,U)_"  ("_$P(X0,U,6)_")")=BED
+"RTN","EDPBRM",95,0)
+ S X="" F  S X=$O(ALPHA(X)) Q:X=""  D XML^EDPX($$XMLS^EDPX("item",ALPHA(X),X))
+"RTN","EDPBRM",96,0)
+ D XML^EDPX("</defaultRoomList>")
+"RTN","EDPBRM",97,0)
+ Q
+"RTN","EDPBRM",98,0)
+CHOICES ; Load the choice lists
+"RTN","EDPBRM",99,0)
+ N I,X
+"RTN","EDPBRM",100,0)
+ F I=1:1 S X=$P($T(WHEN+I),";",3,99) Q:X="ZZZZZ"  D XML^EDPX(X)
+"RTN","EDPBRM",101,0)
+ F I=1:1 S X=$P($T(CATS+I),";",3,99) Q:X="ZZZZZ"  D XML^EDPX(X)
+"RTN","EDPBRM",102,0)
+ D CODES^EDPQLE1("status","status")
+"RTN","EDPBRM",103,0)
+ Q
+"RTN","EDPBRM",104,0)
+WHEN ; Display When Choices
+"RTN","EDPBRM",105,0)
+ ;;<displayWhen>
+"RTN","EDPBRM",106,0)
+ ;;<when label="Occupied" data="0" />
+"RTN","EDPBRM",107,0)
+ ;;<when label="Always" data="1" />
+"RTN","EDPBRM",108,0)
+ ;;<when label="Never" data="2" />
+"RTN","EDPBRM",109,0)
+ ;;</displayWhen>
+"RTN","EDPBRM",110,0)
+ ;;ZZZZZ
+"RTN","EDPBRM",111,0)
+CATS ; Category Choices
+"RTN","EDPBRM",112,0)
+ ;;<roomCategories>
+"RTN","EDPBRM",113,0)
+ ;;<item abbr="Single Pt" data="0" label="Single Pt (one patient assigned)" />
+"RTN","EDPBRM",114,0)
+ ;;<item abbr="Multiple Pt" data="1" label="Multiple Pt (multiple patients assigned)" />
+"RTN","EDPBRM",115,0)
+ ;;<item abbr="Waiting Area" data="2" label="Waiting Area (multiple patients assigned)" />
+"RTN","EDPBRM",116,0)
+ ;;<item abbr="Single Non-ED" data="3" label="Single Non-ED (one patient assigned, outside of ED)" />
+"RTN","EDPBRM",117,0)
+ ;;<item abbr="Multiple Non-ED" data="4" label="Multiple Non-ED (multiple patients assigned, outside of ED)" />
+"RTN","EDPBRM",118,0)
+ ;;</roomCategories>
+"RTN","EDPBRM",119,0)
+ ;;ZZZZZ
+"RTN","EDPBRS")
+0^29^B19077772
+"RTN","EDPBRS",1,0)
+EDPBRS ;SLC/KCM - Reset Board Configuration
+"RTN","EDPBRS",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBRS",3,0)
+ ;
+"RTN","EDPBRS",4,0)
+RESET(AREA) ; Set initial configuration for site & area
+"RTN","EDPBRS",5,0)
+ D SPEC(AREA),COLOR(AREA),ROOMS(AREA),PARAMS(AREA)
+"RTN","EDPBRS",6,0)
+ S ^EDPB(231.9,AREA,231)=$H
+"RTN","EDPBRS",7,0)
+ Q
+"RTN","EDPBRS",8,0)
+SPEC(AREA) ; Set up default board spec
+"RTN","EDPBRS",9,0)
+ ; assumes site, area passed in
+"RTN","EDPBRS",10,0)
+ N I,X,WP,MSG
+"RTN","EDPBRS",11,0)
+ F I=1:1 S X=$P($T(BRDXML+I),";",3,99) Q:$E(X,1,5)="zzzzz"  S WP(I)=X
+"RTN","EDPBRS",12,0)
+ D UPDBRD^EDPBCF(AREA,0,"Main (default)",.WP,.MSG)
+"RTN","EDPBRS",13,0)
+ Q
+"RTN","EDPBRS",14,0)
+BRDXML ; XML for the board spec
+"RTN","EDPBRS",15,0)
+ ;;<row color="stsAcuity"/>
+"RTN","EDPBRS",16,0)
+ ;;<displayProperties fontSize="10" displayWidth="1024" displayLabel="1024x768" scrollDelay="7" />
+"RTN","EDPBRS",17,0)
+ ;;<col att="@bedNm" header="Room" color="" width="48" label="Room / Bed"/>
+"RTN","EDPBRS",18,0)
+ ;;<col att="@last4" header="Patient" color="" width="58" label="Patient X9999"/>
+"RTN","EDPBRS",19,0)
+ ;;<col att="@complaint" header="Complaint" color="" width="406" label="Complaint"/>
+"RTN","EDPBRS",20,0)
+ ;;<col att="@mdNm" header="Prv" color="" width="51" label="Provider Initials"/>
+"RTN","EDPBRS",21,0)
+ ;;<col att="@resNm" header="Res" color="" width="51" label="Resident Initials"/>
+"RTN","EDPBRS",22,0)
+ ;;<col att="@rnNm" header="RN" color="" width="51" label="Nurse Initials"/>
+"RTN","EDPBRS",23,0)
+ ;;<col att="@acuityNm" header="Acuity" color="" width="51" label="Acuity"/>
+"RTN","EDPBRS",24,0)
+ ;;<col att="@emins" header="E Mins" color="" width="51" label="Total Minutes"/>
+"RTN","EDPBRS",25,0)
+ ;;<col att="@lab" header="L" color="labUrg" width="51" label="Lab Active/Complete"/>
+"RTN","EDPBRS",26,0)
+ ;;<col att="@rad" header="I" color="radUrg" width="61" label="Imaging Active/Complete"/>
+"RTN","EDPBRS",27,0)
+ ;;zzzzz
+"RTN","EDPBRS",28,0)
+ ;;
+"RTN","EDPBRS",29,0)
+COLOR(AREA) ; Set up default colors
+"RTN","EDPBRS",30,0)
+ N I,X,WP
+"RTN","EDPBRS",31,0)
+ F I=1:1 S X=$P($T(CLRXML+I),";",3,99) Q:$E(X,1,5)="zzzzz"  S WP(I)=X
+"RTN","EDPBRS",32,0)
+ D WP^DIE(231.9,AREA_",",3,"","WP")
+"RTN","EDPBRS",33,0)
+ I $D(DIERR) W !,"spec update failed"
+"RTN","EDPBRS",34,0)
+ D CLEAN^DILF
+"RTN","EDPBRS",35,0)
+ Q
+"RTN","EDPBRS",36,0)
+CLRXML ; XML for the color spec
+"RTN","EDPBRS",37,0)
+ ;;<colors id="stsAcuity" type="val" >
+"RTN","EDPBRS",38,0)
+ ;;<map att="@status" clr="1,0xffffff,0x808000" val="8" />
+"RTN","EDPBRS",39,0)
+ ;;<map att="@status" clr="0" val="9" />
+"RTN","EDPBRS",40,0)
+ ;;<map att="@status" clr="0" val="10" />
+"RTN","EDPBRS",41,0)
+ ;;<map att="@status" clr="0" val="11" />
+"RTN","EDPBRS",42,0)
+ ;;<map att="@status" clr="1,0xffffff,0x800000" val="12" />
+"RTN","EDPBRS",43,0)
+ ;;<map att="@status" clr="1,0x000000,0xfffbf0" val="13" />
+"RTN","EDPBRS",44,0)
+ ;;<map att="@status" clr="1,0xff0000,0xc0dcc0" val="14" />
+"RTN","EDPBRS",45,0)
+ ;;<map att="@acuity" clr="1,0x000000,0xff0000" val="1" />
+"RTN","EDPBRS",46,0)
+ ;;<map att="@acuity" clr="1,0xffffff,0x0000ff" val="2" />
+"RTN","EDPBRS",47,0)
+ ;;<map att="@acuity" clr="1,0x000000,0xff00ff" val="3" />
+"RTN","EDPBRS",48,0)
+ ;;<map att="@acuity" clr="1,0x000000,0x00ff00" val="4" />
+"RTN","EDPBRS",49,0)
+ ;;<map att="@acuity" clr="0" nm="5" val="5" />
+"RTN","EDPBRS",50,0)
+ ;;</colors>
+"RTN","EDPBRS",51,0)
+ ;;<colors id="labUrg" nm="Urgency - Lab" type="val" >
+"RTN","EDPBRS",52,0)
+ ;;<map att="@labUrg" clr="1,0x000000,0x00ff00" val="0" />
+"RTN","EDPBRS",53,0)
+ ;;<map att="@labUrg" clr="1,0x000000,0xffff00" val="1" />
+"RTN","EDPBRS",54,0)
+ ;;<map att="@labUrg" clr="1,0x000000,0xff0000" val="2" />
+"RTN","EDPBRS",55,0)
+ ;;</colors>
+"RTN","EDPBRS",56,0)
+ ;;<colors id="radUrg" nm="Urgency - Radiology" type="val" >
+"RTN","EDPBRS",57,0)
+ ;;<map att="@radUrg" clr="1,0x000000,0x00ff00" val="0" />
+"RTN","EDPBRS",58,0)
+ ;;<map att="@radUrg" clr="1,0x000000,0xffff00" val="1" />
+"RTN","EDPBRS",59,0)
+ ;;<map att="@radUrg" clr="1,0x000000,0xff0000" val="2" />
+"RTN","EDPBRS",60,0)
+ ;;</colors>
+"RTN","EDPBRS",61,0)
+ ;;zzzzz
+"RTN","EDPBRS",62,0)
+ ;;
+"RTN","EDPBRS",63,0)
+ROOMS(AREA) ; baseline rooms
+"RTN","EDPBRS",64,0)
+ N I,X
+"RTN","EDPBRS",65,0)
+ F I=1:1 S X=$P($T(ROOMLST+I),";",3,99) Q:$E(X,1,5)="zzzzz"  D
+"RTN","EDPBRS",66,0)
+ . N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPBRS",67,0)
+ . S FDA(231.8,"+1,",.01)=$P(X,U)
+"RTN","EDPBRS",68,0)
+ . S FDA(231.8,"+1,",.02)=EDPSITE
+"RTN","EDPBRS",69,0)
+ . S FDA(231.8,"+1,",.03)=AREA
+"RTN","EDPBRS",70,0)
+ . S FDA(231.8,"+1,",.05)=$P(X,U,3)
+"RTN","EDPBRS",71,0)
+ . S FDA(231.8,"+1,",.06)=$P(X,U,2)
+"RTN","EDPBRS",72,0)
+ . S FDA(231.8,"+1,",.07)=$P(X,U,4)
+"RTN","EDPBRS",73,0)
+ . S FDA(231.8,"+1,",.09)=$P(X,U,5)
+"RTN","EDPBRS",74,0)
+ . D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPBRS",75,0)
+ D CLEAN^DILF
+"RTN","EDPBRS",76,0)
+ Q
+"RTN","EDPBRS",77,0)
+ROOMLST ; Name^Display Name^Seq^When^Category
+"RTN","EDPBRS",78,0)
+ ;;Waiting^WAIT^1^0^2
+"RTN","EDPBRS",79,0)
+ ;;Ambulance^AMBU^5^0^1
+"RTN","EDPBRS",80,0)
+ ;;Hallway^HALL^10^0^1
+"RTN","EDPBRS",81,0)
+ ;;General Radiology^RAD^110^0^1
+"RTN","EDPBRS",82,0)
+ ;;CT^CT^120^0^1
+"RTN","EDPBRS",83,0)
+ ;;MRI^MRI^130^0^1
+"RTN","EDPBRS",84,0)
+ ;;Cardiac Cath^CATH^140^0^1
+"RTN","EDPBRS",85,0)
+ ;;Cardiac Stress Test^STEST^150^0^1
+"RTN","EDPBRS",86,0)
+ ;;Dialysis^DIAL^160^0^1
+"RTN","EDPBRS",87,0)
+ ;;Subspecialty Clinic^SCLIN^170^0^1
+"RTN","EDPBRS",88,0)
+ ;;zzzzz
+"RTN","EDPBRS",89,0)
+PARAMS(AREA) ; baseline parameters
+"RTN","EDPBRS",90,0)
+ N FDA,DIERR
+"RTN","EDPBRS",91,0)
+ S AREA=AREA_","
+"RTN","EDPBRS",92,0)
+ S FDA(231.9,AREA,1.1)=1
+"RTN","EDPBRS",93,0)
+ S FDA(231.9,AREA,1.2)=1
+"RTN","EDPBRS",94,0)
+ S FDA(231.9,AREA,1.3)=1
+"RTN","EDPBRS",95,0)
+ S FDA(231.9,AREA,1.4)=1
+"RTN","EDPBRS",96,0)
+ S FDA(231.9,AREA,1.5)=300
+"RTN","EDPBRS",97,0)
+ S FDA(231.9,AREA,1.6)=420
+"RTN","EDPBRS",98,0)
+ S FDA(231.9,AREA,1.7)=480
+"RTN","EDPBRS",99,0)
+ S FDA(231.9,AREA,1.8)=1
+"RTN","EDPBRS",100,0)
+ S FDA(231.9,AREA,1.11)=$O(^EDPB(231.8,"AC",EDPSITE,+AREA,"AMBU",0))
+"RTN","EDPBRS",101,0)
+ S FDA(231.9,AREA,1.12)=$O(^EDPB(231.8,"AC",EDPSITE,+AREA,"WAIT",0))
+"RTN","EDPBRS",102,0)
+ D FILE^DIE("","FDA","ERR")
+"RTN","EDPBRS",103,0)
+ D CLEAN^DILF
+"RTN","EDPBRS",104,0)
+ Q
+"RTN","EDPBSL")
+0^30^B20029785
+"RTN","EDPBSL",1,0)
+EDPBSL ;SLC/KCM - Selection List Configuration
+"RTN","EDPBSL",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBSL",3,0)
+ ;
+"RTN","EDPBSL",4,0)
+LOAD(AREA) ; Load selection lists for area
+"RTN","EDPBSL",5,0)
+ N TOKEN
+"RTN","EDPBSL",6,0)
+ D READL^EDPBLK(AREA,"selection",.TOKEN) ; read selection config -- LOCK
+"RTN","EDPBSL",7,0)
+ D XML^EDPX("<selectionToken>"_TOKEN_"</selectionToken>")
+"RTN","EDPBSL",8,0)
+ ;D LIST("acuity","Acuity")
+"RTN","EDPBSL",9,0)
+ D LIST("status","Status")
+"RTN","EDPBSL",10,0)
+ D LIST("arrival","Source")
+"RTN","EDPBSL",11,0)
+ D LIST("disposition","Disposition")
+"RTN","EDPBSL",12,0)
+ D LIST("delay","Delay Reason")
+"RTN","EDPBSL",13,0)
+ D READU^EDPBLK(AREA,"selection",.TOKEN) ; read selection config -- UNLOCK
+"RTN","EDPBSL",14,0)
+ Q
+"RTN","EDPBSL",15,0)
+LIST(NM,TITLE) ; build XML for selection list
+"RTN","EDPBSL",16,0)
+ N SETNM S SETNM=EDPSTA_"."_NM
+"RTN","EDPBSL",17,0)
+ I '$D(^EDPB(233.2,"B",SETNM)) S SETNM="edp."_NM
+"RTN","EDPBSL",18,0)
+ D XML^EDPX("<"_NM_" title='"_TITLE_"'>")
+"RTN","EDPBSL",19,0)
+ N IEN,SEQ,DA,X0
+"RTN","EDPBSL",20,0)
+ S IEN=$O(^EDPB(233.2,"B",SETNM,0))
+"RTN","EDPBSL",21,0)
+ S SEQ=0 F  S SEQ=$O(^EDPB(233.2,IEN,1,"B",SEQ)) Q:'SEQ  D
+"RTN","EDPBSL",22,0)
+ . S DA=0 F  S DA=$O(^EDPB(233.2,IEN,1,"B",SEQ,DA)) Q:'DA  D
+"RTN","EDPBSL",23,0)
+ . . S X0=^EDPB(233.2,IEN,1,DA,0)
+"RTN","EDPBSL",24,0)
+ . . N X
+"RTN","EDPBSL",25,0)
+ . . S X("seq")=SEQ
+"RTN","EDPBSL",26,0)
+ . . S X("id")=$P(X0,U,2)
+"RTN","EDPBSL",27,0)
+ . . S X("inact")=$P(X0,U,3)
+"RTN","EDPBSL",28,0)
+ . . S X("show")=$P(X0,U,4)
+"RTN","EDPBSL",29,0)
+ . . S X("abbr")=$P(X0,U,5)
+"RTN","EDPBSL",30,0)
+ . . ; switch to entry in 233.1 now
+"RTN","EDPBSL",31,0)
+ . . S X0=^EDPB(233.1,X("id"),0)
+"RTN","EDPBSL",32,0)
+ . . I X("show")="" S X("show")=$P(X0,U,2)
+"RTN","EDPBSL",33,0)
+ . . I X("abbr")="" S X("abbr")=$P(X0,U,3)
+"RTN","EDPBSL",34,0)
+ . . S X("flag")=$P(X0,U,5)
+"RTN","EDPBSL",35,0)
+ . . S X("natl")=$S($E(X0,1,3)="edp":$P(X0,U,2),1:"(local)")
+"RTN","EDPBSL",36,0)
+ . . D XML^EDPX($$XMLA^EDPX("code",.X))
+"RTN","EDPBSL",37,0)
+ D XML^EDPX("</"_NM_">")
+"RTN","EDPBSL",38,0)
+ Q
+"RTN","EDPBSL",39,0)
+SAVE(EDPAREA,REQ) ; save the selection changes
+"RTN","EDPBSL",40,0)
+ N CTYP,SET,SETNM,CODE,X,EDPERR,TOKEN,LOCKERR
+"RTN","EDPBSL",41,0)
+ ;
+"RTN","EDPBSL",42,0)
+ S TOKEN=$G(REQ("selectionToken",1))
+"RTN","EDPBSL",43,0)
+ D SAVEL^EDPBLK(EDPAREA,"selection",.TOKEN,.LOCKERR) ; save selection config -- LOCK
+"RTN","EDPBSL",44,0)
+ I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(EDPAREA) Q
+"RTN","EDPBSL",45,0)
+ ; 
+"RTN","EDPBSL",46,0)
+ S EDPERR=""
+"RTN","EDPBSL",47,0)
+ F CTYP="status","disposition","delay","arrival" D
+"RTN","EDPBSL",48,0)
+ . I $E($O(REQ(CTYP)),1,$L(CTYP))'=CTYP Q
+"RTN","EDPBSL",49,0)
+ . S SETNM=EDPSTA_"."_CTYP,SET=$O(^EDPB(233.2,"B",SETNM,0))
+"RTN","EDPBSL",50,0)
+ . I 'SET D NEWSET(SETNM) S SET=$O(^EDPB(233.2,"B",SETNM,0))
+"RTN","EDPBSL",51,0)
+ . D CLEARSET(SET)
+"RTN","EDPBSL",52,0)
+ . S X=CTYP F  S X=$O(REQ(X)) Q:$E(X,1,$L(CTYP))'=CTYP  D
+"RTN","EDPBSL",53,0)
+ . . K CODE S CODE="" D NVPARSE^EDPX(.CODE,REQ(X,1))
+"RTN","EDPBSL",54,0)
+ . . ; I CODE("id")>0 D UPDCODE(CTYP,.CODE) -- want to keep codes matched to nat'l --KCM
+"RTN","EDPBSL",55,0)
+ . . I CODE("id")<1 D ADDCODE(CTYP,.CODE)
+"RTN","EDPBSL",56,0)
+ . . D ADD2SET(SET,.CODE)
+"RTN","EDPBSL",57,0)
+ D SAVEU^EDPBLK(EDPAREA,"selection",.TOKEN)          ; save selection config -- UNLOCK
+"RTN","EDPBSL",58,0)
+ ; 
+"RTN","EDPBSL",59,0)
+ I $L(EDPERR) D SAVERR^EDPX("fail",EDPERR) Q
+"RTN","EDPBSL",60,0)
+ D XML^EDPX("<save status='ok' />")
+"RTN","EDPBSL",61,0)
+ D LOAD(EDPAREA)
+"RTN","EDPBSL",62,0)
+ S ^EDPB(231.9,EDPAREA,231)=$H  ; update choices timestamp
+"RTN","EDPBSL",63,0)
+ Q
+"RTN","EDPBSL",64,0)
+NEWSET(SETNM) ; Create a new code set for a site
+"RTN","EDPBSL",65,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPBSL",66,0)
+ S FDA(233.2,"+1,",.01)=SETNM
+"RTN","EDPBSL",67,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPBSL",68,0)
+ I $D(DIERR) S EDPERR=EDPERR_"new code set failed;"
+"RTN","EDPBSL",69,0)
+ Q
+"RTN","EDPBSL",70,0)
+CLEARSET(SET) ; Clear the CODES mulitple
+"RTN","EDPBSL",71,0)
+ I '$O(^EDPB(233.2,SET,1,0)) Q  ; no child nodes
+"RTN","EDPBSL",72,0)
+ N DA,DIK S DA=0,DA(1)=SET,DIK="^EDPB(233.2,"_DA(1)_",1,"
+"RTN","EDPBSL",73,0)
+ F  S DA=$O(^EDPB(233.2,SET,1,DA)) Q:'DA  D ^DIK
+"RTN","EDPBSL",74,0)
+ Q
+"RTN","EDPBSL",75,0)
+UPDCODE(CTYP,X) ; Update an existing code in the TRACKING CODE file
+"RTN","EDPBSL",76,0)
+ Q:+$G(X("id"))'>0
+"RTN","EDPBSL",77,0)
+ N OLD,DIFF,I
+"RTN","EDPBSL",78,0)
+ S OLD=$G(^EDPB(233.1,+$G(X("id")),0)),DIFF=0
+"RTN","EDPBSL",79,0)
+ F I="2^show","3^abbr","5^flag" I $P(OLD,U,+I)'=$G(X($P(I,U,2))) S DIFF=1 Q
+"RTN","EDPBSL",80,0)
+ Q:'DIFF  ;no change
+"RTN","EDPBSL",81,0)
+ I $E(OLD,1,4)="edp." S X("id")=0 D ADDCODE(CTYP,.X) Q
+"RTN","EDPBSL",82,0)
+ ; update local code
+"RTN","EDPBSL",83,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPBSL",84,0)
+ S FDAIEN=+X("id")_","
+"RTN","EDPBSL",85,0)
+ S FDA(233.1,FDAIEN,.02)=X("show")
+"RTN","EDPBSL",86,0)
+ S FDA(233.1,FDAIEN,.03)=X("abbr")
+"RTN","EDPBSL",87,0)
+ S FDA(233.1,FDAIEN,.05)=X("flag")
+"RTN","EDPBSL",88,0)
+ D FILE^DIE("","FDA","ERR")
+"RTN","EDPBSL",89,0)
+ I $D(DIERR) S EDPERR=EDPERR_"update code "_NAME_"failed;"
+"RTN","EDPBSL",90,0)
+ S X("nm")=$P(OLD,U)
+"RTN","EDPBSL",91,0)
+ Q
+"RTN","EDPBSL",92,0)
+ADDCODE(CTYP,X) ; Add a new code to the TRACKING CODE file
+"RTN","EDPBSL",93,0)
+ Q:X("id")'=0
+"RTN","EDPBSL",94,0)
+ N NAME,DNAME,I
+"RTN","EDPBSL",95,0)
+ S NAME=EDPSTA_"."_CTYP_"."_$TR(X("show")," ","")
+"RTN","EDPBSL",96,0)
+ I $O(^EDPB(233.1,"B",NAME,0)) D
+"RTN","EDPBSL",97,0)
+ . F I=1:1:99 Q:'$O(^EDPB(233.1,"B",NAME_I,0))
+"RTN","EDPBSL",98,0)
+ . S NAME=NAME_I
+"RTN","EDPBSL",99,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPBSL",100,0)
+ S FDA(233.1,"+1,",.01)=NAME
+"RTN","EDPBSL",101,0)
+ S FDA(233.1,"+1,",.02)=X("show")
+"RTN","EDPBSL",102,0)
+ S FDA(233.1,"+1,",.03)=X("abbr")
+"RTN","EDPBSL",103,0)
+ S FDA(233.1,"+1,",.05)=X("flag")
+"RTN","EDPBSL",104,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPBSL",105,0)
+ I $D(DIERR) S EDPERR=EDPERR_"add code "_NAME_"failed;"
+"RTN","EDPBSL",106,0)
+ S X("id")=FDAIEN(1),X("nm")=NAME
+"RTN","EDPBSL",107,0)
+ Q
+"RTN","EDPBSL",108,0)
+ADD2SET(SET,X) ; Add a new code to the CODES multiple
+"RTN","EDPBSL",109,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPBSL",110,0)
+ S FDA(233.21,"+1,"_SET_",",.01)=X("seq")
+"RTN","EDPBSL",111,0)
+ S FDA(233.21,"+1,"_SET_",",.02)=X("id")
+"RTN","EDPBSL",112,0)
+ S FDA(233.21,"+1,"_SET_",",.03)=X("inact")
+"RTN","EDPBSL",113,0)
+ S FDA(233.21,"+1,"_SET_",",.04)=X("show")
+"RTN","EDPBSL",114,0)
+ S FDA(233.21,"+1,"_SET_",",.05)=X("abbr")
+"RTN","EDPBSL",115,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPBSL",116,0)
+ I $D(DIERR) S EDPERR=EDPERR_"add to set "_X("show")_" failed;"
+"RTN","EDPBSL",117,0)
+ Q
+"RTN","EDPBST")
+0^31^B8664749
+"RTN","EDPBST",1,0)
+EDPBST ;SLC/KCM - Staff Configuration
+"RTN","EDPBST",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPBST",3,0)
+ ;
+"RTN","EDPBST",4,0)
+MATCH(X) ; Return matching providers
+"RTN","EDPBST",5,0)
+ Q
+"RTN","EDPBST",6,0)
+LOAD(AREA) ; Return nurse and provider sources, staff config
+"RTN","EDPBST",7,0)
+ N TOKEN
+"RTN","EDPBST",8,0)
+ D READL^EDPBLK(AREA,"staff",.TOKEN)  ; read staff config -- LOCK
+"RTN","EDPBST",9,0)
+ D XML^EDPX("<staffToken>"_TOKEN_"</staffToken>")
+"RTN","EDPBST",10,0)
+ D XML^EDPX("<providers>"),ACTIVE(AREA,"P"),XML^EDPX("</providers>")
+"RTN","EDPBST",11,0)
+ D XML^EDPX("<residents>"),ACTIVE(AREA,"R"),XML^EDPX("</residents>")
+"RTN","EDPBST",12,0)
+ D XML^EDPX("<nurses>"),ACTIVE(AREA,"N"),XML^EDPX("</nurses>")
+"RTN","EDPBST",13,0)
+ D READU^EDPBLK(AREA,"staff",.TOKEN)  ; read staff config -- UNLOCK
+"RTN","EDPBST",14,0)
+ Q
+"RTN","EDPBST",15,0)
+ACTIVE(AREA,ROLE) ; build list of active for a role
+"RTN","EDPBST",16,0)
+ N IEN,X0,X,EDPNURS
+"RTN","EDPBST",17,0)
+ I ROLE="N" S EDPNURS=$$GET^XPAR("ALL","EDPF NURSE STAFF SCREEN")
+"RTN","EDPBST",18,0)
+ S IEN=0 F  S IEN=$O(^EDPB(231.7,"AC",EDPSITE,AREA,ROLE,IEN)) Q:'IEN  D
+"RTN","EDPBST",19,0)
+ . S X0=^EDPB(231.7,IEN,0)
+"RTN","EDPBST",20,0)
+ . I '$$ALLOW^EDPFPER(+X0,ROLE) Q
+"RTN","EDPBST",21,0)
+ . S X("duz")=$P(X0,U)
+"RTN","EDPBST",22,0)
+ . S X("nm")=$P(^VA(200,X("duz"),0),U)
+"RTN","EDPBST",23,0)
+ . S X("role")=$P(X0,U,6)
+"RTN","EDPBST",24,0)
+ . S X("itl")=$P(^VA(200,X("duz"),0),U,2)
+"RTN","EDPBST",25,0)
+ . S X("clr")=$P(X0,U,8)
+"RTN","EDPBST",26,0)
+ . D XML^EDPX($$XMLA^EDPX("staff",.X))
+"RTN","EDPBST",27,0)
+ Q
+"RTN","EDPBST",28,0)
+SAVE(REQ) ; save updated staff members
+"RTN","EDPBST",29,0)
+ N X,STAFF,ERR,EDPAREA,TOKEN,LOCKERR
+"RTN","EDPBST",30,0)
+ S EDPAREA=$G(REQ("area",1))
+"RTN","EDPBST",31,0)
+ I EDPAREA="" D SAVERR^EDPX("fail","Missing Area") Q
+"RTN","EDPBST",32,0)
+ ;
+"RTN","EDPBST",33,0)
+ S TOKEN=$G(REQ("staffToken",1))
+"RTN","EDPBST",34,0)
+ D SAVEL^EDPBLK(EDPAREA,"staff",.TOKEN,.LOCKERR) ; save staff config -- LOCK
+"RTN","EDPBST",35,0)
+ I $L(LOCKERR) D SAVERR^EDPX("collide",LOCKERR),LOAD(EDPAREA) Q
+"RTN","EDPBST",36,0)
+ ; 
+"RTN","EDPBST",37,0)
+ S X="staff-",ERR=""
+"RTN","EDPBST",38,0)
+ F  S X=$O(REQ(X)) Q:$E(X,1,6)'="staff-"  D
+"RTN","EDPBST",39,0)
+ . K STAFF S STAFF=""
+"RTN","EDPBST",40,0)
+ . D NVPARSE^EDPX(.STAFF,REQ(X,1))
+"RTN","EDPBST",41,0)
+ . I STAFF("chg") D UPD(.STAFF,.ERR)
+"RTN","EDPBST",42,0)
+ D SAVEU^EDPBLK(EDPAREA,"staff",.TOKEN)          ; save staff config -- UNLOCK 
+"RTN","EDPBST",43,0)
+ ;
+"RTN","EDPBST",44,0)
+ I $L(ERR) D SAVERR^EDPX("fail",ERR) Q
+"RTN","EDPBST",45,0)
+ D XML^EDPX("<save status='ok' />")
+"RTN","EDPBST",46,0)
+ D LOAD(EDPAREA)
+"RTN","EDPBST",47,0)
+ S ^EDPB(231.9,EDPAREA,231)=$H  ; update choices timestamp
+"RTN","EDPBST",48,0)
+ Q
+"RTN","EDPBST",49,0)
+UPD(FLD,ERRMSG) ; Add/Update Record (expects EDPAREA, EDPSITE to be defined)
+"RTN","EDPBST",50,0)
+ N EDPIEN
+"RTN","EDPBST",51,0)
+ S EDPIEN=$O(^EDPB(231.7,"AD",EDPSITE,EDPAREA,+FLD("duz"),0))_","
+"RTN","EDPBST",52,0)
+ I 'EDPIEN,FLD("inact") Q  ; don't add inactive selection
+"RTN","EDPBST",53,0)
+ I 'EDPIEN S EDPIEN="+1,"
+"RTN","EDPBST",54,0)
+ ;
+"RTN","EDPBST",55,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPBST",56,0)
+ S FDA(231.7,EDPIEN,.01)=FLD("duz")
+"RTN","EDPBST",57,0)
+ S FDA(231.7,EDPIEN,.02)=EDPSITE
+"RTN","EDPBST",58,0)
+ S FDA(231.7,EDPIEN,.03)=EDPAREA
+"RTN","EDPBST",59,0)
+ S FDA(231.7,EDPIEN,.04)=FLD("inact")
+"RTN","EDPBST",60,0)
+ S FDA(231.7,EDPIEN,.06)=FLD("role")
+"RTN","EDPBST",61,0)
+ ;S FDA(231.7,EDPIEN,.07)=FLD("itl") --NtoL
+"RTN","EDPBST",62,0)
+ S FDA(231.7,EDPIEN,.08)=FLD("clr")
+"RTN","EDPBST",63,0)
+ I EDPIEN="+1," D
+"RTN","EDPBST",64,0)
+ . D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPBST",65,0)
+ . I $D(DIERR) S ERRMSG=ERRMSG_"Adding "_FLD("name")_" failed.  "
+"RTN","EDPBST",66,0)
+ E  D
+"RTN","EDPBST",67,0)
+ . D FILE^DIE("","FDA","ERR")
+"RTN","EDPBST",68,0)
+ . I $D(DIERR) S ERRMSG=ERRMSG_"Updating "_FLD("name")_" failed.  "
+"RTN","EDPBST",69,0)
+ Q
+"RTN","EDPCBRD")
+0^32^B4350223
+"RTN","EDPCBRD",1,0)
+EDPCBRD ;SLC/KCM - Controller for ED Tracking Board
+"RTN","EDPCBRD",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPCBRD",3,0)
+ ;
+"RTN","EDPCBRD",4,0)
+RPC(EDPXML,SESS,PARAMS) ; Process request via RPC instead of CSP
+"RTN","EDPCBRD",5,0)
+ N X,REQ,EDPSITE,EDPUSER,EDPDBUG
+"RTN","EDPCBRD",6,0)
+ K EDPXML
+"RTN","EDPCBRD",7,0)
+ S EDPUSER=$P($G(SESS),U),EDPSTA=$P($G(SESS),U,2),EDPSITE=$$IEN^XUAF4(EDPSTA)
+"RTN","EDPCBRD",8,0)
+ S X="" F  S X=$O(PARAMS(X)) Q:X=""  S REQ(X,1)=PARAMS(X)
+"RTN","EDPCBRD",9,0)
+ S EDPDBUG=$$DEBUG^EDPCDBG("board")
+"RTN","EDPCBRD",10,0)
+ I EDPDBUG D PUTREQ^EDPCDBG(EDPDBUG,.PARAMS)
+"RTN","EDPCBRD",11,0)
+ ;
+"RTN","EDPCBRD",12,0)
+COMMON ; Come here for both CSP and RPC Mode
+"RTN","EDPCBRD",13,0)
+ ;
+"RTN","EDPCBRD",14,0)
+ N EDPFAIL,CMD
+"RTN","EDPCBRD",15,0)
+ S CMD=$G(REQ("command",1))
+"RTN","EDPCBRD",16,0)
+ I $L($G(REQ("machine",1))) D  G:$D(EDPXML)>0 OUT  ; exit on error
+"RTN","EDPCBRD",17,0)
+ . N BRD
+"RTN","EDPCBRD",18,0)
+ . S REQ("machine",1)=$$LOW^XLFSTR(REQ("machine",1))
+"RTN","EDPCBRD",19,0)
+ . S BRD=$$GET^XPAR(EDPSITE_";DIC(4,","EDPF BIGBOARD KIOSKS",REQ("machine",1),"I")
+"RTN","EDPCBRD",20,0)
+ . I '$L(BRD) D XML^EDPX("<error>Computer name not found.</error>") Q
+"RTN","EDPCBRD",21,0)
+ . S REQ("board",1)=BRD
+"RTN","EDPCBRD",22,0)
+ ;
+"RTN","EDPCBRD",23,0)
+ ; switch on command
+"RTN","EDPCBRD",24,0)
+ ; 
+"RTN","EDPCBRD",25,0)
+ ; ---------------------------------
+"RTN","EDPCBRD",26,0)
+ ;
+"RTN","EDPCBRD",27,0)
+ ; initTracking
+"RTN","EDPCBRD",28,0)
+ ; return <user area="" areaNm="" />...
+"RTN","EDPCBRD",29,0)
+ I CMD="initTracking" D DFLTAREA^EDPQAR($$VAL("area")) G OUT
+"RTN","EDPCBRD",30,0)
+ ;
+"RTN","EDPCBRD",31,0)
+ ; ---------------------------------
+"RTN","EDPCBRD",32,0)
+ ; 
+"RTN","EDPCBRD",33,0)
+ ; initDisplayBoard
+"RTN","EDPCBRD",34,0)
+ ; return <spec>
+"RTN","EDPCBRD",35,0)
+ ;        <color><map />...</color>...
+"RTN","EDPCBRD",36,0)
+ ;        <rows><row />...</rows>
+"RTN","EDPCBRD",37,0)
+ I CMD="initDisplayBoard" D  G OUT
+"RTN","EDPCBRD",38,0)
+ . D GET^EDPQDBS($$VAL("area"),$$VAL("board"))
+"RTN","EDPCBRD",39,0)
+ . D GET^EDPQDB($$VAL("area"),$$VAL("board"),-1)
+"RTN","EDPCBRD",40,0)
+ ;
+"RTN","EDPCBRD",41,0)
+ ; ---------------------------------
+"RTN","EDPCBRD",42,0)
+ ; 
+"RTN","EDPCBRD",43,0)
+ ; refreshDisplayBoard
+"RTN","EDPCBRD",44,0)
+ ; return <rows><row />...</rows>
+"RTN","EDPCBRD",45,0)
+ I CMD="refreshDisplayBoard" D  G OUT
+"RTN","EDPCBRD",46,0)
+ . D GET^EDPQDB($$VAL("area"),$$VAL("board"),$$VAL("last"))
+"RTN","EDPCBRD",47,0)
+ ;
+"RTN","EDPCBRD",48,0)
+ ; ---------------------------------
+"RTN","EDPCBRD",49,0)
+ ; else
+"RTN","EDPCBRD",50,0)
+ D XML^EDPX("<error msg='"_$$MSG^EDPX(2300010)_"' />")
+"RTN","EDPCBRD",51,0)
+ ; end switch
+"RTN","EDPCBRD",52,0)
+ ; 
+"RTN","EDPCBRD",53,0)
+OUT ; output the XML
+"RTN","EDPCBRD",54,0)
+ I EDPDBUG D PUTXML^EDPCDBG(EDPDBUG,.EDPXML)
+"RTN","EDPCBRD",55,0)
+ I $L($G(EDPHTTP)) D        ; if in CSP mode
+"RTN","EDPCBRD",56,0)
+ . U EDPHTTP
+"RTN","EDPCBRD",57,0)
+ . W "<results>",!
+"RTN","EDPCBRD",58,0)
+ . N I S I=0 F  S I=$O(EDPXML(I)) Q:'I  W EDPXML(I),!
+"RTN","EDPCBRD",59,0)
+ . W "</results>",!
+"RTN","EDPCBRD",60,0)
+END Q
+"RTN","EDPCBRD",61,0)
+ ;
+"RTN","EDPCBRD",62,0)
+VAL(X) ; return value from request
+"RTN","EDPCBRD",63,0)
+ Q $G(REQ(X,1))
+"RTN","EDPCDBG")
+0^53^B4038807
+"RTN","EDPCDBG",1,0)
+EDPCDBG ;SLC/KCM - Debugging for Controller
+"RTN","EDPCDBG",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPCDBG",3,0)
+ ;
+"RTN","EDPCDBG",4,0)
+DEBUG(SWFID) ; return TRUE if debugging
+"RTN","EDPCDBG",5,0)
+ N CTS,DTS,DIF
+"RTN","EDPCDBG",6,0)
+ S CTS=$H,DTS=$$GET^XPAR("SYS","EDPF DEBUG START TIME",1,"I")
+"RTN","EDPCDBG",7,0)
+ Q:'DTS 0                           ;no debug param
+"RTN","EDPCDBG",8,0)
+ Q:($P(CTS,",")'=$P(DTS,",")) 0     ;not the same day
+"RTN","EDPCDBG",9,0)
+ S DIF=$P(CTS,",",2)-$P(DTS,",",2)
+"RTN","EDPCDBG",10,0)
+ I DIF<0 Q 0                        ;future debug time
+"RTN","EDPCDBG",11,0)
+ I DIF<1800 Q $$NEXTSEQ(SWFID)      ;TRUE, within 30 minutes of start
+"RTN","EDPCDBG",12,0)
+ Q 0
+"RTN","EDPCDBG",13,0)
+ ;
+"RTN","EDPCDBG",14,0)
+NEXTSEQ(LOGID) ; return sequence for this session as EDPF-DEBUG-LOG-swfid^sequence
+"RTN","EDPCDBG",15,0)
+ S:'$L(LOGID) LOGID="init"
+"RTN","EDPCDBG",16,0)
+ I '$D(^XTMP("EDP-DEBUG-LOG",0)) S ^XTMP("EDP-DEBUG-LOG",0)=$$FMADD^XLFDT(DT,1)_U_DT_U_"ED debug log"
+"RTN","EDPCDBG",17,0)
+ L +^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ"):2 E  Q 0
+"RTN","EDPCDBG",18,0)
+ S ^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ")=+$G(^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ"))+1
+"RTN","EDPCDBG",19,0)
+ L -^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ")
+"RTN","EDPCDBG",20,0)
+ Q ^XTMP("EDP-DEBUG-LOG",LOGID,"SEQ")_U_LOGID
+"RTN","EDPCDBG",21,0)
+ ;
+"RTN","EDPCDBG",22,0)
+PUTREQ(SEQ,REQ) ; save the request at this sequence number
+"RTN","EDPCDBG",23,0)
+ M ^XTMP("EDP-DEBUG-LOG",$P(SEQ,U,2),+SEQ,"REQ")=REQ
+"RTN","EDPCDBG",24,0)
+ Q
+"RTN","EDPCDBG",25,0)
+PUTXML(SEQ,XML) ; save the XML result at this sequence number
+"RTN","EDPCDBG",26,0)
+ M ^XTMP("EDP-DEBUG-LOG",$P(SEQ,U,2),+SEQ,"XML")=XML
+"RTN","EDPCDBG",27,0)
+ Q
+"RTN","EDPCDBG",28,0)
+ ;
+"RTN","EDPCDBG",29,0)
+SETON ; turn on debugging for EDIS
+"RTN","EDPCDBG",30,0)
+ N DIR,X,Y
+"RTN","EDPCDBG",31,0)
+ W !,"Enable EDIS Debugging Log"
+"RTN","EDPCDBG",32,0)
+ W !,"Logging will occur for 30 minutes after start time."
+"RTN","EDPCDBG",33,0)
+ W !,"Log is stored in ^XTMP(""EDP-DEBUG-LOG"")",!
+"RTN","EDPCDBG",34,0)
+ S DIR(0)="DO^::EFR"
+"RTN","EDPCDBG",35,0)
+ S DIR("A")="Logging Start Time"
+"RTN","EDPCDBG",36,0)
+ S DIR("B")="NOW"
+"RTN","EDPCDBG",37,0)
+ D ^DIR
+"RTN","EDPCDBG",38,0)
+ Q:'Y
+"RTN","EDPCDBG",39,0)
+ K ^XTMP("EDP-DEBUG-LOG")
+"RTN","EDPCDBG",40,0)
+ D EN^XPAR("SYS","EDPF DEBUG START TIME",1,$$FMTH^XLFDT(Y))
+"RTN","EDPCDBG",41,0)
+ Q
+"RTN","EDPCDBG",42,0)
+SETOFF ; turn off debugging for EDIS
+"RTN","EDPCDBG",43,0)
+ W !,"EDIS Debugging Log Stopped"
+"RTN","EDPCDBG",44,0)
+ D DEL^XPAR("SYS","EDPF DEBUG START TIME",1)
+"RTN","EDPCDBG",45,0)
+ Q
+"RTN","EDPCONV")
+0^24^B47887788
+"RTN","EDPCONV",1,0)
+EDPCONV ;SLC/MKB - Process incoming mail to convert local ED Visits
+"RTN","EDPCONV",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPCONV",3,0)
+ ;
+"RTN","EDPCONV",4,0)
+AREA(DIV) ; -- Return #231.9 ien for DIVision (#4 ien)
+"RTN","EDPCONV",5,0)
+ Q +$O(^EDPB(231.9,"C",DIV,0))
+"RTN","EDPCONV",6,0)
+ ;
+"RTN","EDPCONV",7,0)
+VST(OLD) ; -- Copy OLD(node) ER visit entry into ^EDP(230)
+"RTN","EDPCONV",8,0)
+ N X,I,EDPY,EDPSITE,EDPDIFF,EDPAREA,EDPSTA,EDPLOG,EDPI,PNM,SSN
+"RTN","EDPCONV",9,0)
+ S EDPSITE=$G(OLD("SITE")),X=$G(OLD("TZ")),EDPDIFF=0 ;$$TZONE(X)
+"RTN","EDPCONV",10,0)
+ S EDPAREA=$$AREA(EDPSITE) Q:EDPAREA<1
+"RTN","EDPCONV",11,0)
+ S EDPSTA=$$STA^XUAF4(EDPSITE)            ;station number
+"RTN","EDPCONV",12,0)
+ F I=0,1,2,3,4,6,9 S OLD(I)=$G(OLD(I))    ;defined
+"RTN","EDPCONV",13,0)
+ S X=$P(OLD(0),U,5),EDPY=$$NEW(230,X) Q:EDPY<1
+"RTN","EDPCONV",14,0)
+ S PNM=$P(OLD(0),U),SSN=$P(OLD(0),U,3)    ;patient name, ssn
+"RTN","EDPCONV",15,0)
+ S EDPLOG(0)=X_U_EDPSITE_U_EDPAREA_U_PNM_U_SSN_U_$P(OLD(6),U,2)_U_$G(OLD("CLOSED"))_U_$P(OLD(4),U,4,5)_U_$$ARR($P(OLD(0),U,6))_U_$$PID(PNM,SSN) ;_U_EDPDIFF
+"RTN","EDPCONV",16,0)
+ S X=$P(OLD(9),U,3) S:'X X=$P(OLD(6),U,3) ;disposition
+"RTN","EDPCONV",17,0)
+ S EDPLOG(1)=$P(OLD(1),U)_U_$$DISP(X)_U_$P(OLD(9),U,2)_U_$P(OLD(9),U)_U_$$DEL($P(OLD(4),U,7))
+"RTN","EDPCONV",18,0)
+ S X=$P(OLD(2),U) S:$L(X) EDPLOG(2)=X
+"RTN","EDPCONV",19,0)
+ S EDPLOG(3)=U_$$STS($P(OLD(0),U,4))_U_$$ACU($P(OLD(4),U,3))_U_$$LOC($P(OLD(3),U,2))_U_$P(OLD(4),U)_U_$P(OLD(4),U,2)_U_$P(OLD(4),U,6)_U_$P(OLD(6),U)
+"RTN","EDPCONV",20,0)
+ I $D(OLD(8)) M EDPLOG(4)=OLD(8) S $P(EDPLOG(4,0),U,2)="230.04A"
+"RTN","EDPCONV",21,0)
+ ; Save/Xref log entry
+"RTN","EDPCONV",22,0)
+ M ^EDP(230,EDPY)=EDPLOG
+"RTN","EDPCONV",23,0)
+ D XREF(230,EDPY)
+"RTN","EDPCONV",24,0)
+ ;
+"RTN","EDPCONV",25,0)
+ ; Set History from Movement nodes
+"RTN","EDPCONV",26,0)
+ S EDPI="MVT" F  S EDPI=$O(OLD(EDPI)) Q:EDPI'?1"MVT"1.N  D HIST(EDPI,EDPY)
+"RTN","EDPCONV",27,0)
+ ;
+"RTN","EDPCONV",28,0)
+ ; Create Orders list for active visits
+"RTN","EDPCONV",29,0)
+ I '$G(OLD("CLOSED")) S X=EDPLOG(0) D ORDERS(EDPY,X)
+"RTN","EDPCONV",30,0)
+ ;
+"RTN","EDPCONV",31,0)
+ S OLD(230)=EDPY ;return new ien
+"RTN","EDPCONV",32,0)
+ Q
+"RTN","EDPCONV",33,0)
+ ;
+"RTN","EDPCONV",34,0)
+HIST(MVTI,LOG) ; -- Copy OLD(MVTI) into ^EDP(230.1)
+"RTN","EDPCONV",35,0)
+ N EDPY,MVT,ACT
+"RTN","EDPCONV",36,0)
+ S EDPY=$$NEW(230.1,LOG) Q:EDPY<1
+"RTN","EDPCONV",37,0)
+ S MVT=OLD(MVTI)
+"RTN","EDPCONV",38,0)
+ S ACT(0)=LOG_U_$P(MVT,U,2)_U_U_$P($G(^EDP(230,LOG,0)),U,4,6)
+"RTN","EDPCONV",39,0)
+ S ACT(3)=U_$$STS($P(MVT,U,3))_U_$$ACU($P(MVT,U,4))_U_$$LOC($P(MVT,U,5))_U_$P(MVT,U,6,8)
+"RTN","EDPCONV",40,0)
+ ; Save/Xref history
+"RTN","EDPCONV",41,0)
+ M ^EDP(230.1,EDPY)=ACT
+"RTN","EDPCONV",42,0)
+ D XREF(230.1,EDPY)
+"RTN","EDPCONV",43,0)
+ Q
+"RTN","EDPCONV",44,0)
+ ;
+"RTN","EDPCONV",45,0)
+NEW(FILE,X) ; -- Return ien of new entry in FILE
+"RTN","EDPCONV",46,0)
+ N DO,DIC,DA,Y
+"RTN","EDPCONV",47,0)
+ S DIC="^EDP("_FILE_",",DIC(0)="LF" D FILE^DICN
+"RTN","EDPCONV",48,0)
+ Q +Y
+"RTN","EDPCONV",49,0)
+ ;
+"RTN","EDPCONV",50,0)
+XREF(FILE,DA) ; -- Set all xrefs for DA in FILE
+"RTN","EDPCONV",51,0)
+ N DIK
+"RTN","EDPCONV",52,0)
+ S DIK="^EDP("_FILE_"," D IX1^DIK
+"RTN","EDPCONV",53,0)
+ Q
+"RTN","EDPCONV",54,0)
+ ;
+"RTN","EDPCONV",55,0)
+PID(NM,ID) ; -- Return brief id (L0000) for patient
+"RTN","EDPCONV",56,0)
+ N Y S Y=$E(NM)_$E(ID,6,9)
+"RTN","EDPCONV",57,0)
+ Q Y
+"RTN","EDPCONV",58,0)
+ ;
+"RTN","EDPCONV",59,0)
+TZONE(X) ; -- Return #minutes local offset for time zone
+"RTN","EDPCONV",60,0)
+ N Y S Y=$E(X)_(60*$E(X,2,3)+$E(X,4,5))
+"RTN","EDPCONV",61,0)
+ Q Y
+"RTN","EDPCONV",62,0)
+ ;
+"RTN","EDPCONV",63,0)
+ACU(X) ; -- Return[/add] #233.1 ien for Acuity X
+"RTN","EDPCONV",64,0)
+ I $G(X)="" Q ""
+"RTN","EDPCONV",65,0)
+ N Y,NODE S NODE=$G(OLD("ACU"_+X)) Q:NODE="" $$NOVALUE
+"RTN","EDPCONV",66,0)
+ S X=$P(NODE,U,2),Y=""
+"RTN","EDPCONV",67,0)
+ S:$L(X) Y=+$O(^EDPB(233.1,"AB","acuity",X,0)) Q:Y Y
+"RTN","EDPCONV",68,0)
+ ; add local item
+"RTN","EDPCONV",69,0)
+ N FDA,FDAIEN,DIERR,ERR,NM
+"RTN","EDPCONV",70,0)
+ S NM=$P(NODE,U),NM=$S(NM["-":$P(NM,"-",2),1:NM)
+"RTN","EDPCONV",71,0)
+ S FDA(233.1,"+1,",.01)=EDPSTA_".acuity."_$$LOW^XLFSTR(NM)
+"RTN","EDPCONV",72,0)
+ S FDA(233.1,"+1,",.02)=X
+"RTN","EDPCONV",73,0)
+ S FDA(233.1,"+1,",.03)=X
+"RTN","EDPCONV",74,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPCONV",75,0)
+ S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"")
+"RTN","EDPCONV",76,0)
+ Q Y
+"RTN","EDPCONV",77,0)
+ ;
+"RTN","EDPCONV",78,0)
+STS(X) ; -- Return[/add] #233.1 ien for Status X
+"RTN","EDPCONV",79,0)
+ I $G(X)="" Q ""
+"RTN","EDPCONV",80,0)
+ N Y,NODE
+"RTN","EDPCONV",81,0)
+ S NODE=$G(OLD("STS"_+X)),Y="" Q:NODE="" $$NOVALUE
+"RTN","EDPCONV",82,0)
+ S X=$P(NODE,U,1) S:$L(X) Y=+$O(^EDPB(233.1,"AC","status",X,0)) Q:Y Y
+"RTN","EDPCONV",83,0)
+ S X=$P(NODE,U,4) S:$L(X) Y=+$O(^EDPB(233.1,"AB","status",X,0)) Q:Y Y
+"RTN","EDPCONV",84,0)
+ ; add local item
+"RTN","EDPCONV",85,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPCONV",86,0)
+ S FDA(233.1,"+1,",.01)=EDPSTA_".status."_$$LOW^XLFSTR(X)
+"RTN","EDPCONV",87,0)
+ S FDA(233.1,"+1,",.02)=$P(NODE,U)           ;text
+"RTN","EDPCONV",88,0)
+ S FDA(233.1,"+1,",.03)=X                    ;display/abbreviation
+"RTN","EDPCONV",89,0)
+ S:$P(NODE,U,6)="Y" FDA(233.1,"+1,",.05)="A" ;admission flag
+"RTN","EDPCONV",90,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPCONV",91,0)
+ S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"")
+"RTN","EDPCONV",92,0)
+ Q Y
+"RTN","EDPCONV",93,0)
+ ;
+"RTN","EDPCONV",94,0)
+DEL(X) ; -- Return[/add] #233.1 ien for Delay Reason X
+"RTN","EDPCONV",95,0)
+ I $G(X)="" Q ""
+"RTN","EDPCONV",96,0)
+ N Y,NODE
+"RTN","EDPCONV",97,0)
+ S NODE=$G(OLD("DEL"_+X)),Y="" Q:NODE="" $$NOVALUE
+"RTN","EDPCONV",98,0)
+ S X=$P(NODE,U,1) S:$L(X) Y=+$O(^EDPB(233.1,"AC","delay",X,0)) Q:Y Y
+"RTN","EDPCONV",99,0)
+ S X=$P(NODE,U,3) S:$L(X) Y=+$O(^EDPB(233.1,"AB","delay",X,0)) Q:Y Y
+"RTN","EDPCONV",100,0)
+ ; add local item
+"RTN","EDPCONV",101,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPCONV",102,0)
+ S FDA(233.1,"+1,",.01)=EDPSTA_".delay."_$$LOW^XLFSTR(X)
+"RTN","EDPCONV",103,0)
+ S FDA(233.1,"+1,",.02)=$P(NODE,U)     ;name
+"RTN","EDPCONV",104,0)
+ S FDA(233.1,"+1,",.03)=$P(NODE,U,3)   ;abbreviation
+"RTN","EDPCONV",105,0)
+ S FDA(233.1,"+1,",.05)=$P(NODE,U,5)   ;report flag
+"RTN","EDPCONV",106,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPCONV",107,0)
+ S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"")
+"RTN","EDPCONV",108,0)
+ Q Y
+"RTN","EDPCONV",109,0)
+ ;
+"RTN","EDPCONV",110,0)
+ARR(X) ; -- Return[/add] #233.1 ien for Arrival Mode X
+"RTN","EDPCONV",111,0)
+ I $G(X)="" Q ""
+"RTN","EDPCONV",112,0)
+ N Y,NODE
+"RTN","EDPCONV",113,0)
+ S NODE=$G(OLD("ARR"_+X)),Y="" Q:NODE="" $$NOVALUE
+"RTN","EDPCONV",114,0)
+ S X=$P($P(NODE,U)," ") S:$L(X) Y=+$O(^EDPB(233.1,"AC","source",X,0)) Q:Y Y
+"RTN","EDPCONV",115,0)
+ ; add local item
+"RTN","EDPCONV",116,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPCONV",117,0)
+ S FDA(233.1,"+1,",.01)=EDPSTA_".source."_$$LOW^XLFSTR(X)
+"RTN","EDPCONV",118,0)
+ S FDA(233.1,"+1,",.02)=X
+"RTN","EDPCONV",119,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPCONV",120,0)
+ S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"")
+"RTN","EDPCONV",121,0)
+ Q Y
+"RTN","EDPCONV",122,0)
+ ;
+"RTN","EDPCONV",123,0)
+DISP(X) ; -- Return[/add] #233.1 ien for Disposition code X
+"RTN","EDPCONV",124,0)
+ I $G(X)="" Q ""
+"RTN","EDPCONV",125,0)
+ N Y,NODE
+"RTN","EDPCONV",126,0)
+ S NODE=$G(OLD("DIS"_X)),Y="" Q:NODE="" $$NOVALUE
+"RTN","EDPCONV",127,0)
+ S:X X=$P(NODE,U,5) ;ien -> abbreviation
+"RTN","EDPCONV",128,0)
+ I $L(X) S Y=+$O(^EDPB(233.1,"AB","disposition",X,0)) Q:Y Y
+"RTN","EDPCONV",129,0)
+ E  S X=$P(NODE,U) S:$L(X) Y=+$O(^EDPB(233.1,"AC","disposition",X,0)) Q:Y Y
+"RTN","EDPCONV",130,0)
+ ; add local item
+"RTN","EDPCONV",131,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPCONV",132,0)
+ S X=$P($P(NODE,U)," ") ;1st word, for name
+"RTN","EDPCONV",133,0)
+ S FDA(233.1,"+1,",.01)=EDPSTA_".disposition."_$$LOW^XLFSTR(X)
+"RTN","EDPCONV",134,0)
+ S FDA(233.1,"+1,",.02)=$P(NODE,U)        ;Display Name
+"RTN","EDPCONV",135,0)
+ S FDA(233.1,"+1,",.03)=$P(NODE,U,5)      ;Abbreviation
+"RTN","EDPCONV",136,0)
+ S:$P(NODE,U,7) FDA(233.1,"+1,",.05)="M"  ;Missed Opportunity
+"RTN","EDPCONV",137,0)
+ S:$P(NODE,U,6) FDA(233.1,"+1,",.05)="A"  ;Admission
+"RTN","EDPCONV",138,0)
+ S:$P(NODE,U,8) FDA(233.1,"+1,",.05)="VA" ;VA Admission
+"RTN","EDPCONV",139,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPCONV",140,0)
+ S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"")
+"RTN","EDPCONV",141,0)
+ Q Y
+"RTN","EDPCONV",142,0)
+ ;
+"RTN","EDPCONV",143,0)
+LOC(X) ; -- Return[/add] #231.8 ien for Location X
+"RTN","EDPCONV",144,0)
+ I $G(X)="" Q ""
+"RTN","EDPCONV",145,0)
+ N Y,NODE
+"RTN","EDPCONV",146,0)
+ S NODE=$G(OLD("LOC"_+X)) S:NODE="" NODE="UNKNOWN^UNK^^0^^^0"
+"RTN","EDPCONV",147,0)
+ S X=$P(NODE,U,2),Y=""
+"RTN","EDPCONV",148,0)
+ S:$L(X) Y=+$O(^EDPB(231.8,"AC",EDPSITE,EDPAREA,X,0)) Q:Y Y
+"RTN","EDPCONV",149,0)
+ ; add local item
+"RTN","EDPCONV",150,0)
+ N FDA,FDAIEN,DIERR,ERR,X
+"RTN","EDPCONV",151,0)
+ S FDA(231.8,"+1,",.01)=$TR($P(NODE,U),"-") ;Name
+"RTN","EDPCONV",152,0)
+ S FDA(231.8,"+1,",.02)=EDPSTA              ;Station#
+"RTN","EDPCONV",153,0)
+ S FDA(231.8,"+1,",.03)=EDPAREA             ;Area ien
+"RTN","EDPCONV",154,0)
+ S FDA(231.8,"+1,",.04)='$P(NODE,U,4)       ;Inactive
+"RTN","EDPCONV",155,0)
+ S FDA(231.8,"+1,",.05)=$P(NODE,U,6)        ;Sequence
+"RTN","EDPCONV",156,0)
+ S FDA(231.8,"+1,",.06)=$P(NODE,U,2)        ;Display Name
+"RTN","EDPCONV",157,0)
+ S X=$P(NODE,U,7),X=$S(X=2:0,X=0:2,1:1)
+"RTN","EDPCONV",158,0)
+ S FDA(231.8,"+1,",.07)=X                   ;Display When
+"RTN","EDPCONV",159,0)
+ S FDA(231.8,"+1,",.08)=$$STS($P(NODE,U,8)) ;Default Status ien
+"RTN","EDPCONV",160,0)
+ S FDA(231.8,"+1,",.1)=$P(NODE,U,9)         ;Shared Name [Room]
+"RTN","EDPCONV",161,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPCONV",162,0)
+ S Y=$S('$D(DIERR):+$G(FDAIEN(1)),1:"")
+"RTN","EDPCONV",163,0)
+LCQ ;exit
+"RTN","EDPCONV",164,0)
+ Q Y
+"RTN","EDPCONV",165,0)
+ ;
+"RTN","EDPCONV",166,0)
+NOVALUE() Q $O(^EDPB(233.1,"B","edp.reserved.novalue",0))
+"RTN","EDPCONV",167,0)
+ ;
+"RTN","EDPCONV",168,0)
+ORDERS(LOG,NODE) ; -- build Orders multiple
+"RTN","EDPCONV",169,0)
+ N ORLIST,DFN,IN,OUT,ORI,ORIFN,STS,REL,PKG,X,Y,DIC,DA
+"RTN","EDPCONV",170,0)
+ S DFN=+$P(NODE,U,6) Q:DFN<1
+"RTN","EDPCONV",171,0)
+ S IN=$P(NODE,U,8) Q:IN<1  Q:IN<$$FMADD^XLFDT(DT,-1)  ;old
+"RTN","EDPCONV",172,0)
+ S OUT=$P(NODE,U,9) S:OUT<1 OUT=$$NOW^XLFDT
+"RTN","EDPCONV",173,0)
+ K ^TMP("ORR",$J) D EN^ORQ1(DFN_";DPT(",,1,,IN,OUT) S ORI=0
+"RTN","EDPCONV",174,0)
+ F  S ORI=$O(^TMP("ORR",$J,ORLIST,ORI)) Q:ORI<1  S ORIFN=+$G(^(ORI)) D
+"RTN","EDPCONV",175,0)
+ . Q:$O(^EDP(230,LOG,8,"B",ORIFN,0))
+"RTN","EDPCONV",176,0)
+ . S X=$$GET1^DIQ(100,ORIFN_",",5,"I") Q:(X=10)!(X=11)  ;unreleased
+"RTN","EDPCONV",177,0)
+ . S STS=$S("^1^2^7^12^13^14^"[(U_X_U):"C","^3^6^9^15^"[(U_X_U):"A",1:"N")
+"RTN","EDPCONV",178,0)
+ . S REL=$$GET1^DIQ(100.008,"1,"_ORIFN_",",16,"I")
+"RTN","EDPCONV",179,0)
+ . S X=$$GET1^DIQ(100,ORIFN_",","12:1")
+"RTN","EDPCONV",180,0)
+ . S PKG=$S($E(X,1,2)="LR":"L",$E(X,1,2)="PS":"M",$E(X,1,2)="RA":"R",X="GMRC":"C",1:"A")
+"RTN","EDPCONV",181,0)
+ . ; add to subfile
+"RTN","EDPCONV",182,0)
+ . K X,Y,DIC,DA
+"RTN","EDPCONV",183,0)
+ . S DIC="^EDP(230,"_LOG_",8,",DIC(0)="LZ",DA(1)=LOG,X=+ORIFN
+"RTN","EDPCONV",184,0)
+ . S DIC("DR")=".02///"_PKG_";.03///"_STS_";.05///"_REL
+"RTN","EDPCONV",185,0)
+ . ;S:$$VAL("stat") DIC("DR")=DIC("DR")_";.04///1"
+"RTN","EDPCONV",186,0)
+ . D FILE^DICN
+"RTN","EDPCONV",187,0)
+ K ^TMP("ORR",$J,ORLIST)
+"RTN","EDPCONV",188,0)
+ Q
+"RTN","EDPCONV1")
+0^52^B10237522
+"RTN","EDPCONV1",1,0)
+EDPCONV1 ;SLC/MKB - Convert local ED configuration
+"RTN","EDPCONV1",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPCONV1",3,0)
+ ;
+"RTN","EDPCONV1",4,0)
+CONFIG(OLD) ; -- Save local OLD(NODE) configuration into ^EDPB(231.9)
+"RTN","EDPCONV1",5,0)
+ N EDPSITE,TZDIFF,EDPAREA,X,X2,X3,X5,Y,NODE
+"RTN","EDPCONV1",6,0)
+ S EDPSITE=$G(OLD("SITE")),X=$G(OLD("TZ")),TZDIFF=0 ;$$TZONE(X)
+"RTN","EDPCONV1",7,0)
+ S EDPAREA=+$O(^EDPB(231.9,"C",EDPSITE,0)) Q:EDPAREA<1
+"RTN","EDPCONV1",8,0)
+ S X2=$G(OLD(2)),X3=$G(OLD(3)),X5=$G(OLD(5))
+"RTN","EDPCONV1",9,0)
+ ; update entry
+"RTN","EDPCONV1",10,0)
+ S:$L(TZDIFF) $P(^EDPB(231.9,EDPAREA,0),U,3)=TZDIFF
+"RTN","EDPCONV1",11,0)
+ S NODE=$G(^EDPB(231.9,EDPAREA,1))
+"RTN","EDPCONV1",12,0)
+ S X=$P(X5,U,1) S:$L(X) $P(NODE,U,1)=X ;Dx Reqd
+"RTN","EDPCONV1",13,0)
+ S X=$P(X5,U,4) S:$L(X) $P(NODE,U,3)=X ;Disp Reqd
+"RTN","EDPCONV1",14,0)
+ S X=$P(X5,U,5) S:$L(X) $P(NODE,U,4)=X ;Delay Reqd
+"RTN","EDPCONV1",15,0)
+ S X=$P(X5,U,6) S:$L(X) $P(NODE,U,5)=X ;Delay Minutes
+"RTN","EDPCONV1",16,0)
+ S X=$P(X2,U,4) I $L(X) D
+"RTN","EDPCONV1",17,0)
+ . S Y=(+$P(X,":")*60)+$P(X,":",2)     ;HH:MM -> minutes since Midnight
+"RTN","EDPCONV1",18,0)
+ . S $P(NODE,U,6)=Y                    ;First Shift Start
+"RTN","EDPCONV1",19,0)
+ S X=$P(X2,U,5) I X D
+"RTN","EDPCONV1",20,0)
+ . S Y=X*60                            ;hours -> minutes
+"RTN","EDPCONV1",21,0)
+ . S $P(NODE,U,7)=Y                    ;Shift Duration
+"RTN","EDPCONV1",22,0)
+ S ^EDPB(231.9,EDPAREA,1)=NODE
+"RTN","EDPCONV1",23,0)
+C1 ; Color Spec
+"RTN","EDPCONV1",24,0)
+ N CSPEC,N,I,BACK,FONT
+"RTN","EDPCONV1",25,0)
+ S CSPEC(1,0)="<colors id=""stsAcuity"" type=""val"" >",N=1
+"RTN","EDPCONV1",26,0)
+ S I="STS" F  S I=$O(OLD(I)) Q:I'?1"STS"1.N  D
+"RTN","EDPCONV1",27,0)
+ . S NODE=$G(OLD(I)),FONT=$P(NODE,U,2),BACK=$P(NODE,U,3)
+"RTN","EDPCONV1",28,0)
+ . S X="<map att=""@status"" clr=""",Y=$$STS^EDPCONV(+$P(I,"STS",2))
+"RTN","EDPCONV1",29,0)
+ . I '$L(FONT)!'$L(BACK) S X=X_"0"" val="""_Y_""" />"
+"RTN","EDPCONV1",30,0)
+ . E  S X=X_"1,"_$$CLR(BACK)_","_$$CLR(FONT)_""" val="""_Y_""" />"
+"RTN","EDPCONV1",31,0)
+ . S N=N+1,CSPEC(N,0)=X
+"RTN","EDPCONV1",32,0)
+ S I="ACU" F  S I=$O(OLD(I)) Q:I'?1"ACU"1.N  D
+"RTN","EDPCONV1",33,0)
+ . S NODE=$G(OLD(I)),FONT=$$CLR($P(NODE,U,3)),BACK=$$CLR($P(NODE,U,4))
+"RTN","EDPCONV1",34,0)
+ . S X="<map att=""@acuity"" clr=""",Y=$$ACU^EDPCONV(+$P(I,"ACU",2))
+"RTN","EDPCONV1",35,0)
+ . I '$L(FONT)!'$L(BACK) S X=X_"0"" val="""_Y_""" />"
+"RTN","EDPCONV1",36,0)
+ . E  S X=X_"1,"_BACK_","_FONT_""" val="""_Y_""" />"
+"RTN","EDPCONV1",37,0)
+ . S N=N+1,CSPEC(N,0)=X
+"RTN","EDPCONV1",38,0)
+ S N=N+1,CSPEC(N,0)="</colors>"
+"RTN","EDPCONV1",39,0)
+ F I=1:1 S X=$P($T(ORDCLR+I),";",3) Q:X="ZZZZ"  S N=N+1,CSPEC(N,0)=X
+"RTN","EDPCONV1",40,0)
+ S CSPEC(0)="^^"_N_U_N_U_DT
+"RTN","EDPCONV1",41,0)
+ K ^EDPB(231.9,EDPAREA,3) M ^(3)=CSPEC
+"RTN","EDPCONV1",42,0)
+ Q
+"RTN","EDPCONV1",43,0)
+ ;
+"RTN","EDPCONV1",44,0)
+CLR(X) ; -- Return code for color X
+"RTN","EDPCONV1",45,0)
+ I X="CLRED" Q "0xff0000"
+"RTN","EDPCONV1",46,0)
+ I X="CLBLUE" Q "0x0000ff"
+"RTN","EDPCONV1",47,0)
+ I X="CLGREEN" Q "0x00ff00"
+"RTN","EDPCONV1",48,0)
+ I X="CLYELLOW" Q "0xffff00"
+"RTN","EDPCONV1",49,0)
+ I X="CLWHITE" Q "0xffffff"
+"RTN","EDPCONV1",50,0)
+ I X="CLBLACK" Q "0x000000"
+"RTN","EDPCONV1",51,0)
+ I X="CLNAVY" Q "0x000088"
+"RTN","EDPCONV1",52,0)
+ I X="CLFUCHSIA" Q "0xff00ff"
+"RTN","EDPCONV1",53,0)
+ I X="CLMONEYGREEN" Q "0xc0dcc0"
+"RTN","EDPCONV1",54,0)
+ I X="CLSKYBLUE" Q "0xa6caf0"
+"RTN","EDPCONV1",55,0)
+ I X="CLCREAM" Q "0xfffbf0"
+"RTN","EDPCONV1",56,0)
+ I X="CLMAROON" Q "0x880000"
+"RTN","EDPCONV1",57,0)
+ I X="CLTEAL" Q "0x008888"
+"RTN","EDPCONV1",58,0)
+ I X="CLOLIVE" Q "0x888800"
+"RTN","EDPCONV1",59,0)
+ Q ""
+"RTN","EDPCONV1",60,0)
+ ;
+"RTN","EDPCONV1",61,0)
+ORDCLR ; -- default color scheme for order urgencies
+"RTN","EDPCONV1",62,0)
+ ;;<colors id="labUrg" nm="Urgency - Lab" type="val" >
+"RTN","EDPCONV1",63,0)
+ ;;<map att="@labUrg" clr="1,0x000000,0x00ff00" val="0" />
+"RTN","EDPCONV1",64,0)
+ ;;<map att="@labUrg" clr="1,0x000000,0xffff00" val="1" />
+"RTN","EDPCONV1",65,0)
+ ;;<map att="@labUrg" clr="1,0x000000,0xff0000" val="2" />
+"RTN","EDPCONV1",66,0)
+ ;;</colors>
+"RTN","EDPCONV1",67,0)
+ ;;<colors id="radUrg" nm="Urgency - Radiology" type="val" >
+"RTN","EDPCONV1",68,0)
+ ;;<map att="@radUrg" clr="1,0x000000,0x00ff00" val="0" />
+"RTN","EDPCONV1",69,0)
+ ;;<map att="@radUrg" clr="1,0x000000,0xffff00" val="1" />
+"RTN","EDPCONV1",70,0)
+ ;;<map att="@radUrg" clr="1,0x000000,0xff0000" val="2" />
+"RTN","EDPCONV1",71,0)
+ ;;</colors>
+"RTN","EDPCONV1",72,0)
+ ;;ZZZZ
+"RTN","EDPCONV1",73,0)
+ Q
+"RTN","EDPCSV")
+0^48^B906612
+"RTN","EDPCSV",1,0)
+EDPCSV ;SLC/MKB - CSV format utilities
+"RTN","EDPCSV",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPCSV",3,0)
+ ;
+"RTN","EDPCSV",4,0)
+EN(REQ) ; Controller for HTTP request
+"RTN","EDPCSV",5,0)
+ ;
+"RTN","EDPCSV",6,0)
+ ;S:'$G(EDPTEST) $ETRAP="D ^%ZTER H"
+"RTN","EDPCSV",7,0)
+ ;
+"RTN","EDPCSV",8,0)
+ N EDPSITE,EDPHTTP,EDPNULL,EDPFAIL,EDPCSV,I
+"RTN","EDPCSV",9,0)
+ D UESREQ^EDPX(.REQ) ; unescape the posted data
+"RTN","EDPCSV",10,0)
+ ;
+"RTN","EDPCSV",11,0)
+ ;D SET^EDPZCTRL       ; set up the environment, use null device
+"RTN","EDPCSV",12,0)
+ ;
+"RTN","EDPCSV",13,0)
+ D EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id"),1)
+"RTN","EDPCSV",14,0)
+ ;
+"RTN","EDPCSV",15,0)
+ U EDPHTTP
+"RTN","EDPCSV",16,0)
+ ;W "<results>",!
+"RTN","EDPCSV",17,0)
+ S I=0 F  S I=$O(EDPCSV(I)) Q:'I  W EDPCSV(I),!
+"RTN","EDPCSV",18,0)
+ ;W "</results>",!
+"RTN","EDPCSV",19,0)
+ Q
+"RTN","EDPCSV",20,0)
+ ;
+"RTN","EDPCSV",21,0)
+VAL(X) ; return value from request
+"RTN","EDPCSV",22,0)
+ Q $G(REQ(X,1))
+"RTN","EDPCSV",23,0)
+ ;
+"RTN","EDPCSV",24,0)
+ADD(X) ; -- add line X
+"RTN","EDPCSV",25,0)
+ S EDPCSV=+$G(EDPCSV)+1,EDPCSV(EDPCSV)=X
+"RTN","EDPCSV",26,0)
+ Q
+"RTN","EDPCSV",27,0)
+ ;
+"RTN","EDPCSV",28,0)
+BLANK ; -- add blank line
+"RTN","EDPCSV",29,0)
+ S EDPCSV=+$G(EDPCSV)+1,EDPCSV(EDPCSV)=""
+"RTN","EDPCSV",30,0)
+ Q
+"RTN","EDPCTRL")
+0^34^B33410398
+"RTN","EDPCTRL",1,0)
+EDPCTRL ;SLC/KCM - Controller for ED Tracking
+"RTN","EDPCTRL",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPCTRL",3,0)
+ ;
+"RTN","EDPCTRL",4,0)
+RPC(EDPXML,PARAMS) ; Process request via RPC instead of CSP
+"RTN","EDPCTRL",5,0)
+ N X,REQ,EDPSITE,EDPUSER,EDPDBUG
+"RTN","EDPCTRL",6,0)
+ K EDPXML
+"RTN","EDPCTRL",7,0)
+ S EDPUSER=DUZ,EDPSITE=DUZ(2),EDPSTA=$$STA^XUAF4(DUZ(2))
+"RTN","EDPCTRL",8,0)
+ S X="" F  S X=$O(PARAMS(X)) Q:X=""  S REQ(X,1)=PARAMS(X)
+"RTN","EDPCTRL",9,0)
+ S EDPDBUG=$$DEBUG^EDPCDBG($G(PARAMS("swfID")))
+"RTN","EDPCTRL",10,0)
+ I EDPDBUG D PUTREQ^EDPCDBG(EDPDBUG,.PARAMS)
+"RTN","EDPCTRL",11,0)
+ ;
+"RTN","EDPCTRL",12,0)
+COMMON ; Come here for both CSP and RPC Mode
+"RTN","EDPCTRL",13,0)
+ ;
+"RTN","EDPCTRL",14,0)
+ N EDPFAIL,CMD
+"RTN","EDPCTRL",15,0)
+ S CMD=$G(REQ("command",1))
+"RTN","EDPCTRL",16,0)
+ ;
+"RTN","EDPCTRL",17,0)
+ ; switch on command
+"RTN","EDPCTRL",18,0)
+ ; 
+"RTN","EDPCTRL",19,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",20,0)
+ ; 
+"RTN","EDPCTRL",21,0)
+ ; initUser
+"RTN","EDPCTRL",22,0)
+ ; return <user />
+"RTN","EDPCTRL",23,0)
+ ;        <view />...
+"RTN","EDPCTRL",24,0)
+ I CMD="initUser" D  G OUT
+"RTN","EDPCTRL",25,0)
+ . D SESS^EDPFAA,VIEWS^EDPFAA
+"RTN","EDPCTRL",26,0)
+ ;
+"RTN","EDPCTRL",27,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",28,0)
+ ;
+"RTN","EDPCTRL",29,0)
+ ; matchPatients
+"RTN","EDPCTRL",30,0)
+ ; return <ptlk />...<ptlk />
+"RTN","EDPCTRL",31,0)
+ I CMD="matchPatients" D  G OUT
+"RTN","EDPCTRL",32,0)
+ . D MATCH^EDPFPTL($$VAL("partial"))
+"RTN","EDPCTRL",33,0)
+ ;
+"RTN","EDPCTRL",34,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",35,0)
+ ; 
+"RTN","EDPCTRL",36,0)
+ ; getPatientChecks
+"RTN","EDPCTRL",37,0)
+ ; return <checks />
+"RTN","EDPCTRL",38,0)
+ ;        <similar />
+"RTN","EDPCTRL",39,0)
+ ;        <warning> </warning>
+"RTN","EDPCTRL",40,0)
+ ;        <patientRecordFlags><flag> <text> </text></flag>...</patientRecordFlags>
+"RTN","EDPCTRL",41,0)
+ I CMD="getPatientChecks" D  G OUT
+"RTN","EDPCTRL",42,0)
+ . D CHK^EDPFPTC($$VAL("area"),$$VAL("patient"),$$VAL("name"))
+"RTN","EDPCTRL",43,0)
+ ; 
+"RTN","EDPCTRL",44,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",45,0)
+ ; 
+"RTN","EDPCTRL",46,0)
+ ; saveSecurityLog
+"RTN","EDPCTRL",47,0)
+ ; return <save />
+"RTN","EDPCTRL",48,0)
+ I CMD="saveSecurityLog" D  G OUT
+"RTN","EDPCTRL",49,0)
+ . D LOG^EDPFPTC($$VAL("patient"))
+"RTN","EDPCTRL",50,0)
+ ; 
+"RTN","EDPCTRL",51,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",52,0)
+ ; 
+"RTN","EDPCTRL",53,0)
+ ; getLexiconMatches
+"RTN","EDPCTRL",54,0)
+ ; return <items><item />...</items>
+"RTN","EDPCTRL",55,0)
+ I CMD="getLexiconMatches" D  G OUT
+"RTN","EDPCTRL",56,0)
+ . D ICD^EDPFLEX($$VAL("text"))
+"RTN","EDPCTRL",57,0)
+ ; 
+"RTN","EDPCTRL",58,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",59,0)
+ ; 
+"RTN","EDPCTRL",60,0)
+ ; initLogArea
+"RTN","EDPCTRL",61,0)
+ ; return <udp />
+"RTN","EDPCTRL",62,0)
+ ;        <params disposition="" diagnosis="" delay="" delayMinutes="" />
+"RTN","EDPCTRL",63,0)
+ ;        <logEntries><log />...</logEntries>
+"RTN","EDPCTRL",64,0)
+ I CMD="initLogArea" D  G OUT
+"RTN","EDPCTRL",65,0)
+ . I $L($$VAL("logEntry")) D UPD^EDPLOG($$VAL("logEntry")) Q:$G(EDPFAIL)
+"RTN","EDPCTRL",66,0)
+ . D PARAM^EDPQAR($$VAL("area"))
+"RTN","EDPCTRL",67,0)
+ . D GET^EDPQLP($$VAL("area"),-1)  ;-1 = force refresh
+"RTN","EDPCTRL",68,0)
+ ;
+"RTN","EDPCTRL",69,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",70,0)
+ ; 
+"RTN","EDPCTRL",71,0)
+ ; checkLogin  -- OBSOLETE
+"RTN","EDPCTRL",72,0)
+ ; return <user />
+"RTN","EDPCTRL",73,0)
+ I CMD="checkLogin" D SESS^EDPFAA G OUT
+"RTN","EDPCTRL",74,0)
+ ;
+"RTN","EDPCTRL",75,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",76,0)
+ ; 
+"RTN","EDPCTRL",77,0)
+ ; refreshLogSelector
+"RTN","EDPCTRL",78,0)
+ ; return <logEntries><log />...</logEntries>
+"RTN","EDPCTRL",79,0)
+ I CMD="refreshLogSelector" D  G OUT
+"RTN","EDPCTRL",80,0)
+ . D GET^EDPQLP($$VAL("area"),$$VAL("token"))
+"RTN","EDPCTRL",81,0)
+ ;
+"RTN","EDPCTRL",82,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",83,0)
+ ; 
+"RTN","EDPCTRL",84,0)
+ ; switchLogEntry
+"RTN","EDPCTRL",85,0)
+ ; return <udp />
+"RTN","EDPCTRL",86,0)
+ ;        <logEntry>log fields...</logEntry>
+"RTN","EDPCTRL",87,0)
+ ;        <choices>choice lists...</choices>
+"RTN","EDPCTRL",88,0)
+ I CMD="switchLogEntry" D  G OUT
+"RTN","EDPCTRL",89,0)
+ . I $L($$VAL("logEntry")) D UPD^EDPLOG($$VAL("logEntry")) Q:$G(EDPFAIL)
+"RTN","EDPCTRL",90,0)
+ . D GET^EDPQLE($$VAL("logID"),$$VAL("choiceTS"))
+"RTN","EDPCTRL",91,0)
+ ;
+"RTN","EDPCTRL",92,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",93,0)
+ ; 
+"RTN","EDPCTRL",94,0)
+ ; saveLogEntry
+"RTN","EDPCTRL",95,0)
+ ; return <upd />
+"RTN","EDPCTRL",96,0)
+ I CMD="saveLogEntry" D  G OUT
+"RTN","EDPCTRL",97,0)
+ . D UPD^EDPLOG($$VAL("logEntry")) Q:$G(EDPFAIL)
+"RTN","EDPCTRL",98,0)
+ ;
+"RTN","EDPCTRL",99,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",100,0)
+ ; 
+"RTN","EDPCTRL",101,0)
+ ; addPatientToLog
+"RTN","EDPCTRL",102,0)
+ ; return <upd />
+"RTN","EDPCTRL",103,0)
+ ;        <add />
+"RTN","EDPCTRL",104,0)
+ ;        <logEntry>log fields...</logEntry>
+"RTN","EDPCTRL",105,0)
+ ;        <choices>choice lists...</choices>
+"RTN","EDPCTRL",106,0)
+ ;        <logEntries><log />...</logEntries>
+"RTN","EDPCTRL",107,0)
+ I CMD="addPatientToLog" D  G OUT
+"RTN","EDPCTRL",108,0)
+ . D ADD^EDPLOGA($$VAL("addPatient"),$$VAL("area"),$$VAL("localTime"),$$VAL("choiceTS"))
+"RTN","EDPCTRL",109,0)
+ . Q:$G(EDPFAIL)
+"RTN","EDPCTRL",110,0)
+ . D GET^EDPQLP($$VAL("area"),-1)
+"RTN","EDPCTRL",111,0)
+ ;
+"RTN","EDPCTRL",112,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",113,0)
+ ;
+"RTN","EDPCTRL",114,0)
+ ; deleteStubEntry
+"RTN","EDPCTRL",115,0)
+ ; return <upd />
+"RTN","EDPCTRL",116,0)
+ I CMD="deleteStubEntry" D  G OUT
+"RTN","EDPCTRL",117,0)
+ . D DEL^EDPLOGA($$VAL("area"),$$VAL("logID"))
+"RTN","EDPCTRL",118,0)
+ ;
+"RTN","EDPCTRL",119,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",120,0)
+ ; 
+"RTN","EDPCTRL",121,0)
+ ; removeLogEntry
+"RTN","EDPCTRL",122,0)
+ ; return <upd />
+"RTN","EDPCTRL",123,0)
+ ;        <logEntries><log />...</logEntries>
+"RTN","EDPCTRL",124,0)
+ I CMD="removeLogEntry" D  G OUT
+"RTN","EDPCTRL",125,0)
+ . D UPD^EDPLOG($$VAL("logEntry"),1) Q:$G(EDPFAIL)
+"RTN","EDPCTRL",126,0)
+ . D GET^EDPQLP($$VAL("area"),-1)
+"RTN","EDPCTRL",127,0)
+ ;
+"RTN","EDPCTRL",128,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",129,0)
+ ;
+"RTN","EDPCTRL",130,0)
+ ; matchClosed
+"RTN","EDPCTRL",131,0)
+ ; return <visit />...
+"RTN","EDPCTRL",132,0)
+ I CMD="matchClosed" D  G OUT
+"RTN","EDPCTRL",133,0)
+ . D CLOSED^EDPQLP($$VAL("area"),$$VAL("partial"))
+"RTN","EDPCTRL",134,0)
+ ;
+"RTN","EDPCTRL",135,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",136,0)
+ ;
+"RTN","EDPCTRL",137,0)
+ ; loadConfiguration
+"RTN","EDPCTRL",138,0)
+ ; return <color><map />...</color>...
+"RTN","EDPCTRL",139,0)
+ ;        <columnList><col />...</columnList>
+"RTN","EDPCTRL",140,0)
+ ;        <colorMapList><colorMap><map />...</colorMapList>
+"RTN","EDPCTRL",141,0)
+ ;        <beds><bed />...</beds>
+"RTN","EDPCTRL",142,0)
+ ;        <params />
+"RTN","EDPCTRL",143,0)
+ ;        <defaultRoomList><item />...</defaultRoomList>
+"RTN","EDPCTRL",144,0)
+ ;        <displayWhen><when />...</displayWhen>
+"RTN","EDPCTRL",145,0)
+ ;        <statusList><status />...</statusList>
+"RTN","EDPCTRL",146,0)
+ I CMD="loadConfiguration" D  G OUT
+"RTN","EDPCTRL",147,0)
+ . D LOAD^EDPBCF($$VAL("area"))
+"RTN","EDPCTRL",148,0)
+ ;
+"RTN","EDPCTRL",149,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",150,0)
+ ;
+"RTN","EDPCTRL",151,0)
+ ; loadBoardConfig
+"RTN","EDPCTRL",152,0)
+ ; return <spec><row /><col />...</spec>
+"RTN","EDPCTRL",153,0)
+ I CMD="loadBoardConfig" D  G OUT
+"RTN","EDPCTRL",154,0)
+ . D LOADBRD^EDPBCF($$VAL("area"),$$VAL("boardID"))
+"RTN","EDPCTRL",155,0)
+ ;
+"RTN","EDPCTRL",156,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",157,0)
+ ;
+"RTN","EDPCTRL",158,0)
+ ; saveConfigBoard
+"RTN","EDPCTRL",159,0)
+ ; return <save />
+"RTN","EDPCTRL",160,0)
+ I CMD="saveConfigBoard" D  G OUT
+"RTN","EDPCTRL",161,0)
+ . D SAVEBRD^EDPBCF(.REQ) ; pass whole request for parsing
+"RTN","EDPCTRL",162,0)
+ ;
+"RTN","EDPCTRL",163,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",164,0)
+ ;
+"RTN","EDPCTRL",165,0)
+ ; saveBedConfig
+"RTN","EDPCTRL",166,0)
+ ; return <save />
+"RTN","EDPCTRL",167,0)
+ I CMD="saveBedConfig" D  G OUT
+"RTN","EDPCTRL",168,0)
+ . D SAVE^EDPBRM(.REQ,$$VAL("area")) ; pass whole request for parsing
+"RTN","EDPCTRL",169,0)
+ ;
+"RTN","EDPCTRL",170,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",171,0)
+ ;
+"RTN","EDPCTRL",172,0)
+ ; saveColorConfig
+"RTN","EDPCTRL",173,0)
+ ; return <save />
+"RTN","EDPCTRL",174,0)
+ I CMD="saveColorConfig" D  G OUT
+"RTN","EDPCTRL",175,0)
+ . D SAVE^EDPBCM(.REQ) ; pass whole request for parsing
+"RTN","EDPCTRL",176,0)
+ ;
+"RTN","EDPCTRL",177,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",178,0)
+ ;
+"RTN","EDPCTRL",179,0)
+ ; loadSelectionConfig
+"RTN","EDPCTRL",180,0)
+ ; return <selectionName><code />....</selectionName>...
+"RTN","EDPCTRL",181,0)
+ I CMD="loadSelectionConfig" D  G OUT
+"RTN","EDPCTRL",182,0)
+ . D LOAD^EDPBSL($$VAL("area"))
+"RTN","EDPCTRL",183,0)
+ ;
+"RTN","EDPCTRL",184,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",185,0)
+ ; 
+"RTN","EDPCTRL",186,0)
+ ; loadStaffConfig
+"RTN","EDPCTRL",187,0)
+ ; return providers, nurses, staff for area
+"RTN","EDPCTRL",188,0)
+ I CMD="loadStaffConfig" D  G OUT
+"RTN","EDPCTRL",189,0)
+ . D LOAD^EDPBST($$VAL("area"))
+"RTN","EDPCTRL",190,0)
+ ;
+"RTN","EDPCTRL",191,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",192,0)
+ ;
+"RTN","EDPCTRL",193,0)
+ ; saveStaffConfig
+"RTN","EDPCTRL",194,0)
+ ; return <save />
+"RTN","EDPCTRL",195,0)
+ I CMD="saveStaffConfig" D  G OUT
+"RTN","EDPCTRL",196,0)
+ . D SAVE^EDPBST(.REQ) ; pass whole request for parsing
+"RTN","EDPCTRL",197,0)
+ ;
+"RTN","EDPCTRL",198,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",199,0)
+ ;
+"RTN","EDPCTRL",200,0)
+ ; matchPersons
+"RTN","EDPCTRL",201,0)
+ ; return <per />...<per />
+"RTN","EDPCTRL",202,0)
+ I CMD="matchPersons" D  G OUT
+"RTN","EDPCTRL",203,0)
+ . D MATCH^EDPFPER($$VAL("partial"),$$VAL("personType"))
+"RTN","EDPCTRL",204,0)
+ ;
+"RTN","EDPCTRL",205,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",206,0)
+ ;
+"RTN","EDPCTRL",207,0)
+ ; saveParamConfig
+"RTN","EDPCTRL",208,0)
+ ; return <save />
+"RTN","EDPCTRL",209,0)
+ I CMD="saveParamConfig" D  G OUT
+"RTN","EDPCTRL",210,0)
+ . D SAVE^EDPBPM($$VAL("area"),$$VAL("param"))
+"RTN","EDPCTRL",211,0)
+ ;
+"RTN","EDPCTRL",212,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",213,0)
+ ;
+"RTN","EDPCTRL",214,0)
+ ; saveSelectionConfig
+"RTN","EDPCTRL",215,0)
+ ; return <save />
+"RTN","EDPCTRL",216,0)
+ I CMD="saveSelectionConfig" D  G OUT
+"RTN","EDPCTRL",217,0)
+ . D SAVE^EDPBSL($$VAL("area"),.REQ)
+"RTN","EDPCTRL",218,0)
+ ;
+"RTN","EDPCTRL",219,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",220,0)
+ ; 
+"RTN","EDPCTRL",221,0)
+ ; getReport
+"RTN","EDPCTRL",222,0)
+ ; return <logEntries><log />...</logEntries>
+"RTN","EDPCTRL",223,0)
+ ;        <averages><all /><not /><adm /></averages>
+"RTN","EDPCTRL",224,0)
+ ;        <providers><md />...</providers>
+"RTN","EDPCTRL",225,0)
+ I CMD="getReport" D  G OUT
+"RTN","EDPCTRL",226,0)
+ . D EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id"))
+"RTN","EDPCTRL",227,0)
+ ;
+"RTN","EDPCTRL",228,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",229,0)
+ ; 
+"RTN","EDPCTRL",230,0)
+ ; getCSV
+"RTN","EDPCTRL",231,0)
+ ; return TAB separated values for report
+"RTN","EDPCTRL",232,0)
+ I CMD="getCSV" D  G OUT
+"RTN","EDPCTRL",233,0)
+ . N EDPCSV   ; CSV mode uses EDPCSV instead of EDPXML
+"RTN","EDPCTRL",234,0)
+ . D EN^EDPRPT($$VAL("start"),$$VAL("stop"),$$VAL("report"),$$VAL("id"),1)
+"RTN","EDPCTRL",235,0)
+ . M EDPXML=EDPCSV
+"RTN","EDPCTRL",236,0)
+ ;
+"RTN","EDPCTRL",237,0)
+ ; ---------------------------------
+"RTN","EDPCTRL",238,0)
+ ; else
+"RTN","EDPCTRL",239,0)
+ D XML^EDPX("<error msg='"_$$MSG^EDPX(2300010)_CMD_"' />")
+"RTN","EDPCTRL",240,0)
+ ; end switch
+"RTN","EDPCTRL",241,0)
+ ; 
+"RTN","EDPCTRL",242,0)
+OUT ; output the XML
+"RTN","EDPCTRL",243,0)
+ I EDPDBUG D PUTXML^EDPCDBG(EDPDBUG,.EDPXML)
+"RTN","EDPCTRL",244,0)
+ I $L($G(EDPHTTP)) D        ; if in CSP mode
+"RTN","EDPCTRL",245,0)
+ . U EDPHTTP
+"RTN","EDPCTRL",246,0)
+ . W "<results>",!
+"RTN","EDPCTRL",247,0)
+ . N I S I=0 F  S I=$O(EDPXML(I)) Q:'I  W EDPXML(I),!
+"RTN","EDPCTRL",248,0)
+ . W "</results>",!
+"RTN","EDPCTRL",249,0)
+END Q
+"RTN","EDPCTRL",250,0)
+ ;
+"RTN","EDPCTRL",251,0)
+VAL(X) ; return value from request
+"RTN","EDPCTRL",252,0)
+ Q $G(REQ(X,1))
+"RTN","EDPDD")
+0^35^B1560959
+"RTN","EDPDD",1,0)
+EDPDD ;SLC/KCM - Test Update ED Log - Update
+"RTN","EDPDD",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPDD",3,0)
+ ;
+"RTN","EDPDD",4,0)
+ISGONE(STS) ;
+"RTN","EDPDD",5,0)
+ Q STS=$O(^EDPB(233.1,"B","edp.status.gone",0))
+"RTN","EDPDD",6,0)
+ ;
+"RTN","EDPDD",7,0)
+LFS ; Local form set logic from code field
+"RTN","EDPDD",8,0)
+ N LST,X0,NM,ABB
+"RTN","EDPDD",9,0)
+ S LST=$P(^EDPB(233.2,DA(1),0),U)
+"RTN","EDPDD",10,0)
+ S X0=$G(^EDPB(233.2,DA(1),1,DA,0))
+"RTN","EDPDD",11,0)
+ S NM=$P(X0,U,4),ABB=$P(X0,U,5)
+"RTN","EDPDD",12,0)
+ Q:LST=""  Q:X=""
+"RTN","EDPDD",13,0)
+ S ^EDPB(233.2,"AS",LST,X,DA)=ABB_U_NM
+"RTN","EDPDD",14,0)
+ Q
+"RTN","EDPDD",15,0)
+LFK ; Local form kill logic from code field
+"RTN","EDPDD",16,0)
+ N LST
+"RTN","EDPDD",17,0)
+ S LST=$P(^EDPB(233.2,DA(1),0),U)
+"RTN","EDPDD",18,0)
+ S CODE=$P(^EDPB(233.2,DA(1),1,DA,0),U,2)
+"RTN","EDPDD",19,0)
+ Q:LST=""  Q:X=""
+"RTN","EDPDD",20,0)
+ K ^EDPB(233.2,"AS",LST,X,DA)
+"RTN","EDPDD",21,0)
+ Q
+"RTN","EDPDD",22,0)
+LFS1 ; Local form set logic from name, abbreviation
+"RTN","EDPDD",23,0)
+ N X0,LST,CODE,NM,ABB
+"RTN","EDPDD",24,0)
+ S LST=$P(^EDPB(233.2,DA(1),0),U)
+"RTN","EDPDD",25,0)
+ S X0=$G(^EDPB(233.2,DA(1),1,DA,0))
+"RTN","EDPDD",26,0)
+ S CODE=$P(X0,U,2),NM=$P(X0,U,4),ABB=$P(X0,U,5)
+"RTN","EDPDD",27,0)
+ Q:LST=""  Q:CODE=""
+"RTN","EDPDD",28,0)
+ S ^EDPB(233.2,"AS",LST,CODE,DA)=ABB_U_NM
+"RTN","EDPDD",29,0)
+ Q
+"RTN","EDPDD",30,0)
+LFK1 ; Local form kill logic name, abbreviation
+"RTN","EDPDD",31,0)
+ N LST,CODE
+"RTN","EDPDD",32,0)
+ S LST=$P(^EDPB(233.2,DA(1),0),U)
+"RTN","EDPDD",33,0)
+ S CODE=$P($G(^EDPB(233.2,DA(1),1,DA,0)),U,2)
+"RTN","EDPDD",34,0)
+ Q:LST=""  Q:CODE=""
+"RTN","EDPDD",35,0)
+ K ^EDPB(233.2,"AS",LST,CODE,DA)
+"RTN","EDPDD",36,0)
+ Q
+"RTN","EDPFAA")
+0^1^B5372812
+"RTN","EDPFAA",1,0)
+EDPFAA ;SLC/KCM - RPC Calls to Facility
+"RTN","EDPFAA",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPFAA",3,0)
+ ;
+"RTN","EDPFAA",4,0)
+SESS ; set up session
+"RTN","EDPFAA",5,0)
+ N X
+"RTN","EDPFAA",6,0)
+ S X("duz")=DUZ
+"RTN","EDPFAA",7,0)
+ S X("userNm")=$P($G(^VA(200,DUZ,0)),U)
+"RTN","EDPFAA",8,0)
+ S X("site")=DUZ(2)
+"RTN","EDPFAA",9,0)
+ S X("siteNm")=$$NAME^XUAF4(X("site"))
+"RTN","EDPFAA",10,0)
+ S X("station")=$$STA^XUAF4(DUZ(2))
+"RTN","EDPFAA",11,0)
+ S X("time")=$$NOW^XLFDT
+"RTN","EDPFAA",12,0)
+ S X("rptExport")=($D(^XUSEC("EDPR EXPORT",DUZ))>0)
+"RTN","EDPFAA",13,0)
+ S X("rptProvider")=($D(^XUSEC("EDPR PROVIDER",DUZ))>0)
+"RTN","EDPFAA",14,0)
+ S X("rptXRef")=($D(^XUSEC("EDPR XREF",DUZ))>0)
+"RTN","EDPFAA",15,0)
+ S X("progMode")=($D(^XUSEC("XUPROGMODE",DUZ))>0)
+"RTN","EDPFAA",16,0)
+ S X("version")=$$VERSRV^EDPQAR
+"RTN","EDPFAA",17,0)
+ ;
+"RTN","EDPFAA",18,0)
+ ; This code to enable VEHU training.
+"RTN","EDPFAA",19,0)
+ ;N AREA
+"RTN","EDPFAA",20,0)
+ ;S AREA=$$GET^XPAR(DUZ_";VA(200,","EDPF USER AREA",1,"Q")
+"RTN","EDPFAA",21,0)
+ ;I AREA S X("area")=AREA,X("areaNm")=$P($G(^EDPB(231.9,AREA,0)),U)
+"RTN","EDPFAA",22,0)
+ ;
+"RTN","EDPFAA",23,0)
+ S X("timeOut")=$$GET^XPAR("USR^DIV^SYS","ORWOR TIMEOUT CHART",1,"I")
+"RTN","EDPFAA",24,0)
+ S:'X("timeOut") X("timeOut")=$$DTIME^XUP(DUZ)
+"RTN","EDPFAA",25,0)
+ S:'X("timeOut") X("timeOut")=300
+"RTN","EDPFAA",26,0)
+ S X("timeOut")=X("timeOut")*1000        ; milliseconds
+"RTN","EDPFAA",27,0)
+ S X("countDown")=$$GET^XPAR("USR^SYS^PKG","ORWOR TIMEOUT COUNTDOWN",1,"I")
+"RTN","EDPFAA",28,0)
+ S:'X("countDown") X("countDown")=10
+"RTN","EDPFAA",29,0)
+ S X("countDown")=X("countDown")*1000    ; milliseconds
+"RTN","EDPFAA",30,0)
+ D XML^EDPX($$XMLA^EDPX("user",.X))
+"RTN","EDPFAA",31,0)
+ Q
+"RTN","EDPFAA",32,0)
+ ;
+"RTN","EDPFAA",33,0)
+VIEWS ; Return views allowed for this user
+"RTN","EDPFAA",34,0)
+ N I,X,ID
+"RTN","EDPFAA",35,0)
+ F I=1:1 S X=$P($T(OPTIONS+I),";",3,99) Q:X="zzzzz"  D
+"RTN","EDPFAA",36,0)
+ . I $$ACCESS^XQCHK(DUZ,$$LKOPT^XPDMENU($P(X,U)))>0 D
+"RTN","EDPFAA",37,0)
+ . . D XML^EDPX($$XMLS^EDPX("view",$P(X,U,3),$P(X,U,2)))
+"RTN","EDPFAA",38,0)
+ Q
+"RTN","EDPFAA",39,0)
+OPTIONS ;; options visible in Tracking System
+"RTN","EDPFAA",40,0)
+ ;;EDPF TRACKING VIEW SIGNIN^Sign In^1
+"RTN","EDPFAA",41,0)
+ ;;EDPF TRACKING VIEW TRIAGE^Triage^2
+"RTN","EDPFAA",42,0)
+ ;;EDPF TRACKING VIEW UPDATE^Update^3
+"RTN","EDPFAA",43,0)
+ ;;EDPF TRACKING VIEW DISPOSITION^Disposition^4
+"RTN","EDPFAA",44,0)
+ ;;EDPF TRACKING VIEW EDIT CLOSED^Edit Closed^5
+"RTN","EDPFAA",45,0)
+ ;;EDPF TRACKING VIEW BOARD^Display Board^6
+"RTN","EDPFAA",46,0)
+ ;;EDPF TRACKING VIEW STAFF^Assign Staff^7
+"RTN","EDPFAA",47,0)
+ ;;EDPF TRACKING VIEW REPORTS^Reports^8
+"RTN","EDPFAA",48,0)
+ ;;EDPF TRACKING VIEW CONFIGURE^Configure^9
+"RTN","EDPFAA",49,0)
+ ;;zzzzz
+"RTN","EDPFLEX")
+0^2^B1745474
+"RTN","EDPFLEX",1,0)
+EDPFLEX ;SLC/KCM - Lexicon Utilities
+"RTN","EDPFLEX",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPFLEX",3,0)
+ ;
+"RTN","EDPFLEX",4,0)
+ICD(TEXT) ; Return Lexicon hits for TEXT
+"RTN","EDPFLEX",5,0)
+ N LEX,X,Y,I,ICD,CPT,NAME,IEN
+"RTN","EDPFLEX",6,0)
+ ;D CONFIG^LEXSET("GMPL","PL1",DT)
+"RTN","EDPFLEX",7,0)
+ ;D LOOK^LEXA(TEXT,"GMPL",999,"",DT)
+"RTN","EDPFLEX",8,0)
+ ; (just do diagnoses until we figure out CPT modifiers)
+"RTN","EDPFLEX",9,0)
+ D CONFIG^LEXSET("ICD","ICD",DT)
+"RTN","EDPFLEX",10,0)
+ D LOOK^LEXA(TEXT,"ICD",999,"",DT)
+"RTN","EDPFLEX",11,0)
+ D XML^EDPX("<items>")
+"RTN","EDPFLEX",12,0)
+ S I=0 F  S I=$O(LEX("LIST",I)) Q:I<1  D
+"RTN","EDPFLEX",13,0)
+ . N ITEM
+"RTN","EDPFLEX",14,0)
+ . S IEN=$P(LEX("LIST",I),U),X=$P(LEX("LIST",I),U,2),CPT=""
+"RTN","EDPFLEX",15,0)
+ . S ICD=$P($P(X,"ICD-9-CM ",2),")") I $L(ICD) S NAME=X ;$P(X," (ICD-9-CM")
+"RTN","EDPFLEX",16,0)
+ . E  S CPT=$P($P(X,"CPT-4 ",2),")"),NAME=X ;$P(X," (CPT-4")
+"RTN","EDPFLEX",17,0)
+ . I '$L(ICD),'$L(CPT) Q
+"RTN","EDPFLEX",18,0)
+ . S:$E(NAME,$L(NAME))="*" NAME=$E(NAME,1,$L(NAME)-2)
+"RTN","EDPFLEX",19,0)
+ . S ITEM("text")=NAME,ITEM("ien")=IEN
+"RTN","EDPFLEX",20,0)
+ . I $L(ICD) S ITEM("code")=ICD,ITEM("type")="POV",ITEM("icd")=ICD
+"RTN","EDPFLEX",21,0)
+ . I $L(CPT) S ITEM("code")=CPT,ITEM("type")="CPT",ITEM("cpt")=CPT
+"RTN","EDPFLEX",22,0)
+ . S Y=$$XMLA^EDPX("item",.ITEM) D XML^EDPX(Y)
+"RTN","EDPFLEX",23,0)
+ D XML^EDPX("</items>")
+"RTN","EDPFLEX",24,0)
+ Q
+"RTN","EDPFMON")
+0^3^B27211876
+"RTN","EDPFMON",1,0)
+EDPFMON ;SLC/MKB - ED Monitor at facility
+"RTN","EDPFMON",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPFMON",3,0)
+ ;
+"RTN","EDPFMON",4,0)
+EN(MSG) ; -- main entry point for EDP MONITOR where MSG contains HL7 msg
+"RTN","EDPFMON",5,0)
+ N EDMSG,PKG,MSH,PID,PV1,ORC,DFN,LOG
+"RTN","EDPFMON",6,0)
+ S EDMSG=$S($L($G(MSG)):MSG,1:"MSG"),MSH=0       ;MSG="NAME" or MSG(#)
+"RTN","EDPFMON",7,0)
+ F  S MSH=$O(@EDMSG@(MSH)) Q:MSH'>0  Q:$E(@EDMSG@(MSH),1,3)="MSH"
+"RTN","EDPFMON",8,0)
+ Q:'MSH                                          ;no message/header
+"RTN","EDPFMON",9,0)
+ S PKG=$$PKG($P(@EDMSG@(MSH),"|",3)) Q:'$L(PKG)  ;unknown or not tracked
+"RTN","EDPFMON",10,0)
+ S DFN=$$PID Q:DFN<1                             ;missing patient
+"RTN","EDPFMON",11,0)
+ S LOG=+$O(^EDP(230,"APA",DFN,0)) Q:LOG<1        ;not in ED now
+"RTN","EDPFMON",12,0)
+ S ORC=0 F  S ORC=$O(@EDMSG@(+ORC)) Q:ORC'>0  I $E(@EDMSG@(ORC),1,3)="ORC" D
+"RTN","EDPFMON",13,0)
+ . N ORDCNTRL,ORIFN,STS,RTN
+"RTN","EDPFMON",14,0)
+ . S ORC=ORC_U_@EDMSG@(ORC),ORDCNTRL=$TR($P(ORC,"|",2),"@","P")
+"RTN","EDPFMON",15,0)
+ . Q:'$L(ORDCNTRL)
+"RTN","EDPFMON",16,0)
+ . S ORIFN=$P($P(ORC,"|",3),U),STS=$P(ORC,"|",6)
+"RTN","EDPFMON",17,0)
+ . S RTN=$S("NW^OK^XR"[ORDCNTRL:"NEW",1:"UPD")
+"RTN","EDPFMON",18,0)
+ . D @RTN
+"RTN","EDPFMON",19,0)
+ Q
+"RTN","EDPFMON",20,0)
+ ;
+"RTN","EDPFMON",21,0)
+ENOR(MSG) ; -- main entry point for EDP OR MONITOR where MSG contains HL7 msg
+"RTN","EDPFMON",22,0)
+ N EDMSG,PKG,MSH,PID,PV1,ORC,DFN,LOG
+"RTN","EDPFMON",23,0)
+ S EDMSG=$S($L($G(MSG)):MSG,1:"MSG"),MSH=0       ;MSG="NAME" or MSG(#)
+"RTN","EDPFMON",24,0)
+ F  S MSH=$O(@EDMSG@(MSH)) Q:MSH'>0  Q:$E(@EDMSG@(MSH),1,3)="MSH"
+"RTN","EDPFMON",25,0)
+ Q:'MSH                                          ;no message/header
+"RTN","EDPFMON",26,0)
+ S PKG=$$PKG($P(@EDMSG@(MSH),"|",5)) Q:'$L(PKG)  ;unknown or not tracked
+"RTN","EDPFMON",27,0)
+ S DFN=$$PID Q:DFN<1                             ;missing patient
+"RTN","EDPFMON",28,0)
+ S LOG=+$O(^EDP(230,"APA",DFN,0)) Q:LOG<1        ;not in ED now
+"RTN","EDPFMON",29,0)
+ S ORC=0 F  S ORC=$O(@EDMSG@(+ORC)) Q:ORC'>0  I $E(@EDMSG@(ORC),1,3)="ORC" D
+"RTN","EDPFMON",30,0)
+ . N ORDCNTRL,ORIFN
+"RTN","EDPFMON",31,0)
+ . S ORC=ORC_U_@EDMSG@(ORC),ORDCNTRL=$TR($P(ORC,"|",2),"@","P")
+"RTN","EDPFMON",32,0)
+ . Q:ORDCNTRL'="NA"                              ;new backdoor ack
+"RTN","EDPFMON",33,0)
+ . S ORIFN=$P($P(ORC,"|",3),U)
+"RTN","EDPFMON",34,0)
+ . D NEW
+"RTN","EDPFMON",35,0)
+ Q
+"RTN","EDPFMON",36,0)
+ ;
+"RTN","EDPFMON",37,0)
+PKG(NAME) ; -- Returns package code
+"RTN","EDPFMON",38,0)
+ I NAME="RADIOLOGY"!(NAME="IMAGING") Q "R"
+"RTN","EDPFMON",39,0)
+ I NAME="LABORATORY" Q "L"
+"RTN","EDPFMON",40,0)
+ I NAME="PHARMACY" Q "M"
+"RTN","EDPFMON",41,0)
+ I NAME="CONSULTS" Q "C"
+"RTN","EDPFMON",42,0)
+ I NAME="PROCEDURES" Q "C"
+"RTN","EDPFMON",43,0)
+ I NAME="DIETETICS" Q "A"
+"RTN","EDPFMON",44,0)
+ I NAME="ORDER ENTRY" Q "A"
+"RTN","EDPFMON",45,0)
+ Q ""
+"RTN","EDPFMON",46,0)
+ ;
+"RTN","EDPFMON",47,0)
+PID() ; -- Returns patient DFN from PID segment in current msg
+"RTN","EDPFMON",48,0)
+ N I,Y,SEG S I=MSH,Y=""
+"RTN","EDPFMON",49,0)
+ F  S I=$O(@EDMSG@(I)) Q:I'>0  S SEG=$E(@EDMSG@(I),1,3) Q:SEG="ORC"  I SEG="PID" S Y=+$P(@EDMSG@(I),"|",4) Q
+"RTN","EDPFMON",50,0)
+ Q Y
+"RTN","EDPFMON",51,0)
+ ;
+"RTN","EDPFMON",52,0)
+PV1() ; -- Returns patient location from PV1 segment in current msg
+"RTN","EDPFMON",53,0)
+ N I,Y,SEG S I=MSH,Y=""
+"RTN","EDPFMON",54,0)
+ F  S I=$O(@EDMSG@(I)) Q:I'>0  S SEG=$E(@EDMSG@(I),1,3) Q:SEG="ORC"  I SEG="PV1" S Y=+$P(@EDMSG@(I),"|",4) Q
+"RTN","EDPFMON",55,0)
+ Q Y
+"RTN","EDPFMON",56,0)
+ ;
+"RTN","EDPFMON",57,0)
+NEW ; -- add new order to patient log
+"RTN","EDPFMON",58,0)
+ Q:'$G(ORIFN)  Q:$$START(ORIFN)>DT  ;no future orders
+"RTN","EDPFMON",59,0)
+ N MSG,URG,ORL
+"RTN","EDPFMON",60,0)
+ S ORL=+$$GET1^DIQ(100,+ORIFN_",",6,"I")
+"RTN","EDPFMON",61,0)
+ I ORL,'$$ED(ORL) Q  ;not ED location
+"RTN","EDPFMON",62,0)
+ S URG=$$VALUE^ORCSAVE2(+ORIFN,"URGENCY") S:'URG URG=9 ;routine
+"RTN","EDPFMON",63,0)
+ S MSG(1)="command=newOrder"
+"RTN","EDPFMON",64,0)
+ S MSG(2)="id="_LOG
+"RTN","EDPFMON",65,0)
+ S MSG(3)="orifn="_+ORIFN
+"RTN","EDPFMON",66,0)
+ S MSG(4)="pkg="_PKG
+"RTN","EDPFMON",67,0)
+ S MSG(5)="sts="_"N"
+"RTN","EDPFMON",68,0)
+ S MSG(6)="stat="_(URG<3) ;1=STAT or 2=ASAP
+"RTN","EDPFMON",69,0)
+ S MSG(7)="release="_$$NOW^XLFDT
+"RTN","EDPFMON",70,0)
+ D SEND(.MSG)
+"RTN","EDPFMON",71,0)
+ Q
+"RTN","EDPFMON",72,0)
+ ;
+"RTN","EDPFMON",73,0)
+ED(LOC) ; -- Return 1 or 0 if LOCation is part of ED
+"RTN","EDPFMON",74,0)
+ N EDLOC,I,Y
+"RTN","EDPFMON",75,0)
+ D GETLST^XPAR(.EDLOC,"ALL","EDPF LOCATION")
+"RTN","EDPFMON",76,0)
+ S (I,Y)=0 F  S I=$O(EDLOC(I)) Q:I<1  I $P(EDLOC(I),U,2)=LOC S Y=1 Q
+"RTN","EDPFMON",77,0)
+ Q Y
+"RTN","EDPFMON",78,0)
+ ;
+"RTN","EDPFMON",79,0)
+START(IFN) ; -- return start date (day only) of order
+"RTN","EDPFMON",80,0)
+ N X,Y,%DT
+"RTN","EDPFMON",81,0)
+ S Y=+$$GET1^DIQ(100,+$G(IFN)_",",21,"I") I Y<1 D
+"RTN","EDPFMON",82,0)
+ . S X=$$VALUE^ORCSAVE2(+IFN,"START")
+"RTN","EDPFMON",83,0)
+ . I '$L(X) S Y=DT Q  ;assume NOW
+"RTN","EDPFMON",84,0)
+ . S %DT="T" D ^%DT S:Y<1 Y=""
+"RTN","EDPFMON",85,0)
+ S Y=$P(Y,".")
+"RTN","EDPFMON",86,0)
+ Q Y
+"RTN","EDPFMON",87,0)
+ ;
+"RTN","EDPFMON",88,0)
+UPD ; -- update state of order in log
+"RTN","EDPFMON",89,0)
+ I ORDCNTRL="RE" D STS("C") Q
+"RTN","EDPFMON",90,0)
+ I "CA^DC^OC^OD^CR^DR"[ORDCNTRL D DEL Q  ;??
+"RTN","EDPFMON",91,0)
+ I PKG="L",ORDCNTRL="SC" D STS("A") Q
+"RTN","EDPFMON",92,0)
+ I PKG="R",ORDCNTRL="SC" D STS("A") Q
+"RTN","EDPFMON",93,0)
+ I PKG="C","SC^XX"[ORDCNTRL D STS("A") Q
+"RTN","EDPFMON",94,0)
+ I PKG="M" D  Q
+"RTN","EDPFMON",95,0)
+ . I "RO^XX^ZV"[ORDCNTRL D STS("A") Q
+"RTN","EDPFMON",96,0)
+ . Q:ORDCNTRL'="SC"  Q:'$L(STS)
+"RTN","EDPFMON",97,0)
+ . I "DC^ZE^RP"[STS D STS("C") Q
+"RTN","EDPFMON",98,0)
+ . D STS("A")
+"RTN","EDPFMON",99,0)
+ I PKG="A","SC^XX"[ORDCNTRL D  Q
+"RTN","EDPFMON",100,0)
+ . I "DC^ZE"[STS D STS("C") Q
+"RTN","EDPFMON",101,0)
+ . D STS("A")
+"RTN","EDPFMON",102,0)
+ Q
+"RTN","EDPFMON",103,0)
+ ;
+"RTN","EDPFMON",104,0)
+STS(X) ; -- update status
+"RTN","EDPFMON",105,0)
+ N MSG
+"RTN","EDPFMON",106,0)
+ S MSG(1)="command=updateOrder"
+"RTN","EDPFMON",107,0)
+ S MSG(2)="id="_LOG
+"RTN","EDPFMON",108,0)
+ S MSG(3)="orifn="_+ORIFN
+"RTN","EDPFMON",109,0)
+ S MSG(4)="sts="_X
+"RTN","EDPFMON",110,0)
+ D SEND(.MSG)
+"RTN","EDPFMON",111,0)
+ Q
+"RTN","EDPFMON",112,0)
+ ;
+"RTN","EDPFMON",113,0)
+DEL ; -- remove order
+"RTN","EDPFMON",114,0)
+ N MSG
+"RTN","EDPFMON",115,0)
+ S MSG(1)="command=deleteOrder"
+"RTN","EDPFMON",116,0)
+ S MSG(2)="id="_LOG
+"RTN","EDPFMON",117,0)
+ S MSG(3)="orifn="_+ORIFN
+"RTN","EDPFMON",118,0)
+ D SEND(.MSG)
+"RTN","EDPFMON",119,0)
+ Q
+"RTN","EDPFMON",120,0)
+ ;
+"RTN","EDPFMON",121,0)
+VER(ORIFN) ; -- update status when ORIFN verified
+"RTN","EDPFMON",122,0)
+ N LOG,MSG S ORIFN=+$G(ORIFN)
+"RTN","EDPFMON",123,0)
+ S LOG=+$O(^EDP(230,"AO",ORIFN,0)) Q:LOG<1  ;not in ED
+"RTN","EDPFMON",124,0)
+ S MSG(1)="command=verifyOrder"
+"RTN","EDPFMON",125,0)
+ S MSG(2)="id="_LOG
+"RTN","EDPFMON",126,0)
+ S MSG(3)="orifn="_ORIFN
+"RTN","EDPFMON",127,0)
+ D SEND(.MSG)
+"RTN","EDPFMON",128,0)
+ Q
+"RTN","EDPFMON",129,0)
+ ;
+"RTN","EDPFMON",130,0)
+COMP(ORIFN) ; -- update status when ORIFN completed
+"RTN","EDPFMON",131,0)
+ N LOG,MSG S ORIFN=+$G(ORIFN)
+"RTN","EDPFMON",132,0)
+ S LOG=+$O(^EDP(230,"AO",ORIFN,0)) Q:LOG<1  ;not in ED
+"RTN","EDPFMON",133,0)
+ S MSG(1)="command=completeOrder"
+"RTN","EDPFMON",134,0)
+ S MSG(2)="id="_LOG
+"RTN","EDPFMON",135,0)
+ S MSG(3)="orifn="_ORIFN
+"RTN","EDPFMON",136,0)
+ D SEND(.MSG)
+"RTN","EDPFMON",137,0)
+ Q
+"RTN","EDPFMON",138,0)
+ ;
+"RTN","EDPFMON",139,0)
+ ; -- Monitor SDAM APPOINTMENT EVENTS for patients checking-in to ED
+"RTN","EDPFMON",140,0)
+ ; 
+"RTN","EDPFMON",141,0)
+SDAM ; -- send bulletin on check-in
+"RTN","EDPFMON",142,0)
+ N EDPEVENT
+"RTN","EDPFMON",143,0)
+ S EDPEVENT=$$GET^XPAR("ALL","EDPF SCHEDULING TRIGGER",1,"Q")
+"RTN","EDPFMON",144,0)
+ Q:EDPEVENT="D"  ; adding via scheduling disabled
+"RTN","EDPFMON",145,0)
+ S:'EDPEVENT EDPEVENT=4
+"RTN","EDPFMON",146,0)
+ Q:$G(SDAMEVT)'=EDPEVENT
+"RTN","EDPFMON",147,0)
+ ;
+"RTN","EDPFMON",148,0)
+ N EDPLST,X,FOUND
+"RTN","EDPFMON",149,0)
+ D GETLST^XPAR(.EDPLST,"ALL","EDPF LOCATION","I")
+"RTN","EDPFMON",150,0)
+ S X="",FOUND=0
+"RTN","EDPFMON",151,0)
+ F  S X=$O(EDPLST(X)) Q:X=""  I $P(SDATA,U,4)=EDPLST(X) S FOUND=1 Q
+"RTN","EDPFMON",152,0)
+ Q:'FOUND
+"RTN","EDPFMON",153,0)
+ ;
+"RTN","EDPFMON",154,0)
+ N DFN,DATE,HLOC
+"RTN","EDPFMON",155,0)
+ S DFN=+$P(SDATA,U,2),DATE=+$P(SDATA,U,3),HLOC=+$P(SDATA,U,4)
+"RTN","EDPFMON",156,0)
+ ; your code goes here :)
+"RTN","EDPFMON",157,0)
+ N MSG
+"RTN","EDPFMON",158,0)
+ S MSG(1)="command=patientCheckIn"
+"RTN","EDPFMON",159,0)
+ S MSG(2)="dfn="_DFN
+"RTN","EDPFMON",160,0)
+ S MSG(3)="ptNm="_$P(^DPT(DFN,0),U)
+"RTN","EDPFMON",161,0)
+ S MSG(4)="ssn="_$P(^DPT(DFN,0),U,9)
+"RTN","EDPFMON",162,0)
+ S MSG(5)="hloc="_HLOC
+"RTN","EDPFMON",163,0)
+ S MSG(6)="site="_DUZ(2)
+"RTN","EDPFMON",164,0)
+ S MSG(7)="time="_DATE  ; appt date to match PCE
+"RTN","EDPFMON",165,0)
+ D SEND(.MSG)
+"RTN","EDPFMON",166,0)
+ Q
+"RTN","EDPFMON",167,0)
+ ;
+"RTN","EDPFMON",168,0)
+SEND(MSG) ; Transfer control to message handler
+"RTN","EDPFMON",169,0)
+ D MSG^EDPMAIL(.MSG)
+"RTN","EDPFMON",170,0)
+ Q
+"RTN","EDPFMOVE")
+0^23^B43728958
+"RTN","EDPFMOVE",1,0)
+EDPFMOVE ;SLC/MKB - Move local ER Visits to EDIS
+"RTN","EDPFMOVE",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPFMOVE",3,0)
+ ;
+"RTN","EDPFMOVE",4,0)
+EN ; -- Option EDP CONVERSION to copy local data
+"RTN","EDPFMOVE",5,0)
+ I '$D(^DIZ(172006,0)) W !!,"You have no ER data to convert." H 1 Q
+"RTN","EDPFMOVE",6,0)
+ I $G(^XTMP("EDP-CONV","X"))="DONE" W !!,"The data conversion has completed." H 1 Q
+"RTN","EDPFMOVE",7,0)
+ ;
+"RTN","EDPFMOVE",8,0)
+ N X,Y,DIR,DTOUT,DUOUT,DIRUT,DIROUT,EDPDIV
+"RTN","EDPFMOVE",9,0)
+ W !!,"This option will copy ER configuration and visit data at your site"
+"RTN","EDPFMOVE",10,0)
+ W !,"to the new Emergency Department application.  For each division,"
+"RTN","EDPFMOVE",11,0)
+ W !,"your local configuration data will be copied first, followed by all"
+"RTN","EDPFMOVE",12,0)
+ W !,"currently active patient visits.  A task will then be queued to"
+"RTN","EDPFMOVE",13,0)
+ W !,"populate previous, closed visits in the national application files"
+"RTN","EDPFMOVE",14,0)
+ W !,"to allow reports to continue to function."
+"RTN","EDPFMOVE",15,0)
+ S EDPDIV=$$SELDIV Q:'EDPDIV
+"RTN","EDPFMOVE",16,0)
+ I '$$AREA(EDPDIV) W !!,"Please create a Tracking Area for this division.",! Q
+"RTN","EDPFMOVE",17,0)
+ D SELCVT Q:EDPDIV="^"
+"RTN","EDPFMOVE",18,0)
+ W !!,"DO NOT PROCEED UNTIL YOU ARE READY TO USE THE NEW EDIS PACKAGE!!",!
+"RTN","EDPFMOVE",19,0)
+ S DIR(0)="YA",DIR("A")="Are you ready? ",DIR("B")="NO"
+"RTN","EDPFMOVE",20,0)
+ D ^DIR Q:'Y
+"RTN","EDPFMOVE",21,0)
+ ;
+"RTN","EDPFMOVE",22,0)
+E1 ; -- start here
+"RTN","EDPFMOVE",23,0)
+ D CONFIG
+"RTN","EDPFMOVE",24,0)
+ D ACTIVE
+"RTN","EDPFMOVE",25,0)
+ ; -- task LOOP
+"RTN","EDPFMOVE",26,0)
+ N ZTRTN,ZTDESC,ZTDTH,ZTIO,ZTUCI,ZTCPU,ZTPRI,ZTSAVE,ZTKIL,ZTSYNC,ZTSK
+"RTN","EDPFMOVE",27,0)
+ S ZTSK=$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U,4) I ZTSK D  Q:$G(ZTSK)
+"RTN","EDPFMOVE",28,0)
+ . D STAT^%ZTLOAD N STS S STS=+$G(ZTSK(1))
+"RTN","EDPFMOVE",29,0)
+ . I STS=1!(STS=2) W !,"Visit conversion is still running." Q
+"RTN","EDPFMOVE",30,0)
+ . K ZTSK
+"RTN","EDPFMOVE",31,0)
+ . ; STS=4!(STS=5) K ZTSK Q  ;never ran or errored out
+"RTN","EDPFMOVE",32,0)
+ . ; STS=3!(STS=0) K ZTSK Q  ;completed or undefined
+"RTN","EDPFMOVE",33,0)
+ S ZTRTN="LOOP^EDPFMOVE",ZTIO="",ZTDTH=$H,ZTSAVE("EDPDIV")=""
+"RTN","EDPFMOVE",34,0)
+ S ZTDESC="Copy old ER data to new EDIS application"
+"RTN","EDPFMOVE",35,0)
+ D ^%ZTLOAD I $G(ZTSK) D  Q
+"RTN","EDPFMOVE",36,0)
+ . W !,"Task #"_ZTSK_" started to copy closed visits."
+"RTN","EDPFMOVE",37,0)
+ . S $P(^XTMP("EDP-CONV","D",EDPDIV),U,4)=ZTSK
+"RTN","EDPFMOVE",38,0)
+ W !,"ERROR -- Task to copy closed visits NOT started!"
+"RTN","EDPFMOVE",39,0)
+ Q
+"RTN","EDPFMOVE",40,0)
+ ;
+"RTN","EDPFMOVE",41,0)
+CONFIG ; -- convert site configuration
+"RTN","EDPFMOVE",42,0)
+ N EDPI,MSG,N,I,X0,XMZ K XMMG
+"RTN","EDPFMOVE",43,0)
+ S EDPI=$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U) ; = ien^0^0 in post-init
+"RTN","EDPFMOVE",44,0)
+ I EDPI="" W !,"Configuration data for "_$$NAME^XUAF4(EDPDIV)_" has already been copied." Q
+"RTN","EDPFMOVE",45,0)
+ I EDPI=-1 W !,"Configuration data for "_$$NAME^XUAF4(EDPDIV)_" will not be copied." Q
+"RTN","EDPFMOVE",46,0)
+ W !,"Copying local configuration ... "
+"RTN","EDPFMOVE",47,0)
+ F  S EDPI=$O(^DIZ(172012,EDPI)) Q:EDPI<1  D  Q:$D(XMMG)
+"RTN","EDPFMOVE",48,0)
+ . K MSG S MSG(1)="command=convertConfiguration",N=1
+"RTN","EDPFMOVE",49,0)
+ . S X0=$G(^DIZ(172012,EDPI,0))
+"RTN","EDPFMOVE",50,0)
+ . S N=N+1,MSG(N)="SITE="_EDPDIV
+"RTN","EDPFMOVE",51,0)
+ . S N=N+1,MSG(N)="TZ="_$$TZ^XLFDT
+"RTN","EDPFMOVE",52,0)
+ . F I=2,3,5 S N=N+1,MSG(N)=I_"="_$G(^DIZ(172012,EDPI,I))
+"RTN","EDPFMOVE",53,0)
+ . ; include acuities and statuses for default colors
+"RTN","EDPFMOVE",54,0)
+ . S I=0 F  S I=$O(^DIZ(172007,"D",EDPDIV,I)) Q:I<1  D
+"RTN","EDPFMOVE",55,0)
+ .. S X0=$G(^DIZ(172007,I,0)) Q:'$P(X0,U,6)  ;inactive
+"RTN","EDPFMOVE",56,0)
+ .. S $P(X0,U,3)=$$EXTERNAL^DILFD(172007,2,"",$P(X0,U,3))
+"RTN","EDPFMOVE",57,0)
+ .. S $P(X0,U,4)=$$EXTERNAL^DILFD(172007,3,"",$P(X0,U,4))
+"RTN","EDPFMOVE",58,0)
+ .. S N=N+1,MSG(N)="ACU"_I_"="_X0
+"RTN","EDPFMOVE",59,0)
+ . S I=0 F  S I=$O(^DIZ(172009,I)) Q:I<1  S X0=$G(^(I,0)) D
+"RTN","EDPFMOVE",60,0)
+ .. S $P(X0,U,2)=$$EXTERNAL^DILFD(172009,1,"",$P(X0,U,2))
+"RTN","EDPFMOVE",61,0)
+ .. S $P(X0,U,3)=$$EXTERNAL^DILFD(172009,2,"",$P(X0,U,3))
+"RTN","EDPFMOVE",62,0)
+ .. S N=N+1,MSG(N)="STS"_I_"="_X0
+"RTN","EDPFMOVE",63,0)
+ . D SEND^EDPFMON(.MSG)
+"RTN","EDPFMOVE",64,0)
+ S $P(^XTMP("EDP-CONV","D",EDPDIV),U)="" ;done
+"RTN","EDPFMOVE",65,0)
+ Q
+"RTN","EDPFMOVE",66,0)
+ ;
+"RTN","EDPFMOVE",67,0)
+ACTIVE ; -- Loop through ER Locations, convert open visits first
+"RTN","EDPFMOVE",68,0)
+ N EDPL,VST,XMZ
+"RTN","EDPFMOVE",69,0)
+ S EDPL=$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U,2) ; = ien^0^0 in post-init
+"RTN","EDPFMOVE",70,0)
+ I EDPL="" Q  ;W !,"Active visits already copied." Q
+"RTN","EDPFMOVE",71,0)
+ W !,"Copying currently active visits ... "
+"RTN","EDPFMOVE",72,0)
+ F  S EDPL=$O(^DIZ(172008,"C",EDPDIV,EDPL)) Q:EDPL<1  D
+"RTN","EDPFMOVE",73,0)
+ . S VST=$P($G(^DIZ(172008,EDPL,0)),U,5) Q:'VST
+"RTN","EDPFMOVE",74,0)
+ . D EN1(VST,1) S ^XTMP("EDP-CONV",VST)=""
+"RTN","EDPFMOVE",75,0)
+ . S $P(^XTMP("EDP-CONV","D",EDPDIV),U,2)=EDPL
+"RTN","EDPFMOVE",76,0)
+ S $P(^XTMP("EDP-CONV","D",EDPDIV),U,2)="" ;done
+"RTN","EDPFMOVE",77,0)
+ Q
+"RTN","EDPFMOVE",78,0)
+ ;
+"RTN","EDPFMOVE",79,0)
+LOOP ; -- Queued loop to send previous [closed] visits
+"RTN","EDPFMOVE",80,0)
+ N EDPI
+"RTN","EDPFMOVE",81,0)
+ S EDPI=$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U,3)
+"RTN","EDPFMOVE",82,0)
+ F  S EDPI=$O(^DIZ(172006,"E",EDPDIV,EDPI)) Q:EDPI<1  D
+"RTN","EDPFMOVE",83,0)
+ . I $D(^XTMP("EDP-CONV",EDPI)) S $P(^XTMP("EDP-CONV","D",EDPDIV),U,3)=EDPI Q
+"RTN","EDPFMOVE",84,0)
+ . D EN1(EDPI)
+"RTN","EDPFMOVE",85,0)
+ . S $P(^XTMP("EDP-CONV","D",EDPDIV),U,3)=EDPI
+"RTN","EDPFMOVE",86,0)
+ ;S ^XTMP("EDP-CONV","X")="DONE"
+"RTN","EDPFMOVE",87,0)
+ Q
+"RTN","EDPFMOVE",88,0)
+ ;
+"RTN","EDPFMOVE",89,0)
+EN1(IEN,OPEN) ; -- convert single ER visit
+"RTN","EDPFMOVE",90,0)
+ N I,X,Y,X0,DIZ
+"RTN","EDPFMOVE",91,0)
+ F I=0,1,2,3,4,6,9 S DIZ(I)=$G(^DIZ(172006,IEN,I))
+"RTN","EDPFMOVE",92,0)
+ I $O(^DIZ(172006,IEN,8,0)) M DIZ(8)=^DIZ(172006,IEN,8)
+"RTN","EDPFMOVE",93,0)
+ S X=$P(DIZ(3),U),DIZ("SITE")=X                 ;Institution file ien
+"RTN","EDPFMOVE",94,0)
+ S DIZ("TZ")=$$TZ^XLFDT                         ;Time Zone difference
+"RTN","EDPFMOVE",95,0)
+ ; S:'$G(OPEN) DIZ("CLOSED")=1                  ;Closed visit
+"RTN","EDPFMOVE",96,0)
+ ;
+"RTN","EDPFMOVE",97,0)
+ ;include static file nodes used:
+"RTN","EDPFMOVE",98,0)
+ S X=$P(DIZ(0),U,4) S:X DIZ("STS"_X)=$$STS(X)   ;Status
+"RTN","EDPFMOVE",99,0)
+ I '$G(OPEN),X,$P($G(DIZ("STS"_X)),U,4)="GONE" S DIZ("CLOSED")=1
+"RTN","EDPFMOVE",100,0)
+ S X=$P(DIZ(0),U,6) S:X DIZ("ARR"_X)=$$ARR(X)   ;Arrival Mode
+"RTN","EDPFMOVE",101,0)
+ S X=$P(DIZ(3),U,2) S:X DIZ("LOC"_X)=$$LOC(X)   ;Location
+"RTN","EDPFMOVE",102,0)
+ S X=$P(DIZ(4),U,2) S:X $P(DIZ(4),U,2)=$$NUR(X) ;RN->200
+"RTN","EDPFMOVE",103,0)
+ S X=$P(DIZ(4),U,3) S:X DIZ("ACU"_X)=$$ACU(X)   ;Acuity
+"RTN","EDPFMOVE",104,0)
+ S X=$P(DIZ(4),U,7) S:X DIZ("DEL"_X)=$$DEL(X)   ;Delay Reason
+"RTN","EDPFMOVE",105,0)
+ S X=$P(DIZ(9),U,3) S:X DIZ("DIS"_X)=$$DIS(X)   ;Disposition
+"RTN","EDPFMOVE",106,0)
+ I 'X S X=$P(DIZ(6),U,3) S:$L(X) DIZ("DIS"_X)=$$EXTERNAL^DILFD(172006,16,,X)_"^1^^^"_X
+"RTN","EDPFMOVE",107,0)
+ S I=0 F  S I=$O(^DIZ(172006,IEN,7,I)) Q:I<1  S X0=$G(^(I,0)) D
+"RTN","EDPFMOVE",108,0)
+ . S X=$P(X0,U,3) I X,'$D(DIZ("STS"_X)) S DIZ("STS"_X)=$$STS(X)
+"RTN","EDPFMOVE",109,0)
+ . S X=$P(X0,U,4) I X,'$D(DIZ("ACU"_X)) S DIZ("ACU"_X)=$$ACU(X)
+"RTN","EDPFMOVE",110,0)
+ . S X=$P(X0,U,5) I X,'$D(DIZ("LOC"_X)) S DIZ("LOC"_X)=$$LOC(X)
+"RTN","EDPFMOVE",111,0)
+ . S X=$P(X0,U,7) S:X $P(X0,U,7)=$$NUR(X)       ;RN->200
+"RTN","EDPFMOVE",112,0)
+ . S DIZ("MVT"_I)=X0
+"RTN","EDPFMOVE",113,0)
+ ;
+"RTN","EDPFMOVE",114,0)
+ ;send to nat'l file
+"RTN","EDPFMOVE",115,0)
+ ;N MSG S MSG(1)="command=convertVisit",I=1
+"RTN","EDPFMOVE",116,0)
+ ;S X="" F  S X=$O(DIZ(X)) Q:X=""  S I=I+1,MSG(I)=X_"="_DIZ(X)
+"RTN","EDPFMOVE",117,0)
+ ;D SEND^EDPFMON(.MSG)
+"RTN","EDPFMOVE",118,0)
+ ;
+"RTN","EDPFMOVE",119,0)
+ D VST^EDPCONV(.DIZ)
+"RTN","EDPFMOVE",120,0)
+ I $G(DIZ(230)) S ^DIZ(172006,IEN,230)=DIZ(230)
+"RTN","EDPFMOVE",121,0)
+ Q
+"RTN","EDPFMOVE",122,0)
+ ;
+"RTN","EDPFMOVE",123,0)
+LOC(X) ; -- Return 0-node for Location ien X
+"RTN","EDPFMOVE",124,0)
+ N NODE,S S NODE=$G(^DIZ(172008,+$G(X),0))
+"RTN","EDPFMOVE",125,0)
+ S S=$P(NODE,U,8) I S,'$D(DIZ("STS"_S)) S DIZ("STS"_S)=$$STS(S)
+"RTN","EDPFMOVE",126,0)
+ Q NODE
+"RTN","EDPFMOVE",127,0)
+ ;
+"RTN","EDPFMOVE",128,0)
+ACU(X)    ; -- Return 0-node for Acuity ien X
+"RTN","EDPFMOVE",129,0)
+ Q $G(^DIZ(172007,+$G(X),0))
+"RTN","EDPFMOVE",130,0)
+ ;
+"RTN","EDPFMOVE",131,0)
+STS(X) ; -- Return 0-node for Status ien X
+"RTN","EDPFMOVE",132,0)
+ Q $G(^DIZ(172009,+$G(X),0))
+"RTN","EDPFMOVE",133,0)
+ ;
+"RTN","EDPFMOVE",134,0)
+DEL(X) ; -- Return 0-node for Delay Reason ien X
+"RTN","EDPFMOVE",135,0)
+ Q $G(^DIZ(172011,+$G(X),0))
+"RTN","EDPFMOVE",136,0)
+ ;
+"RTN","EDPFMOVE",137,0)
+ARR(X) ; -- Return 0-node for Arrival Mode ien X
+"RTN","EDPFMOVE",138,0)
+ Q $G(^DIZ(172014,+$G(X),0))
+"RTN","EDPFMOVE",139,0)
+ ;
+"RTN","EDPFMOVE",140,0)
+DIS(X) ; -- Return 0-node for Disposition ien X
+"RTN","EDPFMOVE",141,0)
+ Q $G(^DIZ(172015,+$G(X),0))
+"RTN","EDPFMOVE",142,0)
+ ;
+"RTN","EDPFMOVE",143,0)
+PER(X) ; -- Return NAME^INITIALS for New Person ien X
+"RTN","EDPFMOVE",144,0)
+ Q $P($G(^VA(200,+$G(X),0)),U,1,2)
+"RTN","EDPFMOVE",145,0)
+ ;
+"RTN","EDPFMOVE",146,0)
+NUR(X) ; -- Return #200 ptr for Nurse Staff ien X
+"RTN","EDPFMOVE",147,0)
+ Q $P($G(^NURSF(210,+$G(X),0)),U)
+"RTN","EDPFMOVE",148,0)
+ ;
+"RTN","EDPFMOVE",149,0)
+SELDIV() ; -- Select division ien to convert
+"RTN","EDPFMOVE",150,0)
+ N I,DIV,CNT,X,Y,DIC,DTOUT,DUOUT
+"RTN","EDPFMOVE",151,0)
+ S I=0 F  S I=$O(^XTMP("EDP-CONV","D",I)) Q:I<1  S X=$G(^(I)) D
+"RTN","EDPFMOVE",152,0)
+ . I $P(X,U)<1,$O(^DIZ(172006,"E",I,"A"),-1)'>$P(X,U,3) Q
+"RTN","EDPFMOVE",153,0)
+ . S DIV(I)=$$NS^XUAF4(I),CNT=+$G(CNT)+1
+"RTN","EDPFMOVE",154,0)
+ I '$O(DIV(0)) W !!,"There is no data to convert." Q
+"RTN","EDPFMOVE",155,0)
+ S DIC=4,DIC(0)="AEQMN",DIC("S")="I $D(DIV(Y))"
+"RTN","EDPFMOVE",156,0)
+ I $G(CNT)=1 S I=$O(DIV(0)),DIC("B")=$P(DIV(I),U,2)
+"RTN","EDPFMOVE",157,0)
+ S DIC("A")="Select the division you wish to convert: "
+"RTN","EDPFMOVE",158,0)
+ W !!,"Available divisions: "
+"RTN","EDPFMOVE",159,0)
+ S I=0 F  S I=$O(DIV(I)) Q:I<1  W !,$P(DIV(I),U,2),?10,$P(DIV(I),U)
+"RTN","EDPFMOVE",160,0)
+ D ^DIC S Y=$S(Y>0:+Y,1:0)
+"RTN","EDPFMOVE",161,0)
+ Q Y
+"RTN","EDPFMOVE",162,0)
+ ;
+"RTN","EDPFMOVE",163,0)
+AREA(D) ; -- Return Tracking Area #231.9 ien for Division ien
+"RTN","EDPFMOVE",164,0)
+ Q +$O(^EDPB(231.9,"C",+$G(D),0))
+"RTN","EDPFMOVE",165,0)
+ ;
+"RTN","EDPFMOVE",166,0)
+SELCVT ; -- Select what to convert: configuration, data, or both
+"RTN","EDPFMOVE",167,0)
+ Q:$P($G(^XTMP("EDP-CONV","D",EDPDIV)),U)=""
+"RTN","EDPFMOVE",168,0)
+ N X,Y,DIR,DTOUT,DUOUT
+"RTN","EDPFMOVE",169,0)
+ S DIR(0)="YA" W !
+"RTN","EDPFMOVE",170,0)
+ S DIR("A")="Do you wish to convert the configuration as well as the data? "
+"RTN","EDPFMOVE",171,0)
+ S DIR("?",1)="Enter YES if you wish to convert this division's configuration as well"
+"RTN","EDPFMOVE",172,0)
+ S DIR("?")="as the patient data, otherwise enter NO to convert only the data."
+"RTN","EDPFMOVE",173,0)
+ D ^DIR I Y'=1,Y'=0 S EDPDIV="^" Q
+"RTN","EDPFMOVE",174,0)
+ S $P(^XTMP("EDP-CONV","D",EDPDIV),U)=$S(Y=0:-1,1:+$O(^DIZ(172012,"B",EDPDIV,0)))
+"RTN","EDPFMOVE",175,0)
+ Q
+"RTN","EDPFPER")
+0^5^B3427509
+"RTN","EDPFPER",1,0)
+EDPFPER ;SLC/KCM - Lookup Persons at Facility
+"RTN","EDPFPER",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPFPER",3,0)
+ ;
+"RTN","EDPFPER",4,0)
+MATCH(MATCH,PTYP) ; Return a matching list of providers
+"RTN","EDPFPER",5,0)
+ S MATCH=$$UP^XLFSTR(MATCH)
+"RTN","EDPFPER",6,0)
+ S MATCH=$TR(MATCH,"_"," ")  ; underscore replaces space in flex widget
+"RTN","EDPFPER",7,0)
+ D XML^EDPX("<personType>"_PTYP_"</personType>")
+"RTN","EDPFPER",8,0)
+ I PTYP="N" D NURS
+"RTN","EDPFPER",9,0)
+ I PTYP'="N" D PROV
+"RTN","EDPFPER",10,0)
+ Q
+"RTN","EDPFPER",11,0)
+PROV ; match providers
+"RTN","EDPFPER",12,0)
+ N NM,PRV
+"RTN","EDPFPER",13,0)
+ S NM=$O(^VA(200,"AK.PROVIDER",MATCH),-1)
+"RTN","EDPFPER",14,0)
+ F  S NM=$O(^VA(200,"AK.PROVIDER",NM)) Q:$E(NM,1,$L(MATCH))'=MATCH  D
+"RTN","EDPFPER",15,0)
+ . S PRV=0 F  S PRV=$O(^VA(200,"AK.PROVIDER",NM,PRV)) Q:'PRV  D
+"RTN","EDPFPER",16,0)
+ .. I $$ALLOW(PRV,"P") D ADD(PRV,NM)
+"RTN","EDPFPER",17,0)
+ Q
+"RTN","EDPFPER",18,0)
+NURS ; match nurses
+"RTN","EDPFPER",19,0)
+ N NM,NRS,EDPNURS
+"RTN","EDPFPER",20,0)
+ S EDPNURS=$$GET^XPAR("ALL","EDPF NURSE STAFF SCREEN")
+"RTN","EDPFPER",21,0)
+ S NM=$O(^VA(200,"B",MATCH),-1)
+"RTN","EDPFPER",22,0)
+ F  S NM=$O(^VA(200,"B",NM)) Q:$E(NM,1,$L(MATCH))'=MATCH  D
+"RTN","EDPFPER",23,0)
+ . S NRS=0 F  S NRS=$O(^VA(200,"B",NM,NRS)) Q:'NRS  D
+"RTN","EDPFPER",24,0)
+ .. I $$ALLOW(NRS,"N") D ADD(NRS,NM)
+"RTN","EDPFPER",25,0)
+ Q
+"RTN","EDPFPER",26,0)
+ADD(PER,NM) ; Add the person to the list of staff
+"RTN","EDPFPER",27,0)
+ N X,X0,TITLE
+"RTN","EDPFPER",28,0)
+ S X0=^VA(200,PER,0),TITLE=$P(X0,U,9)
+"RTN","EDPFPER",29,0)
+ S X("nm")=NM
+"RTN","EDPFPER",30,0)
+ S X("itl")=$P(X0,U,2)
+"RTN","EDPFPER",31,0)
+ I X("itl")="" S X("itl")=$E($P(NM,",",2))_$E(NM)
+"RTN","EDPFPER",32,0)
+ S X("duz")=PER
+"RTN","EDPFPER",33,0)
+ I TITLE S X("title")=$P($G(^DIC(3.1,TITLE,0)),U)
+"RTN","EDPFPER",34,0)
+ D XML^EDPX($$XMLA^EDPX("staff",.X))
+"RTN","EDPFPER",35,0)
+ Q
+"RTN","EDPFPER",36,0)
+ALLOW(PER,ROLE) ; Screen when selecting persons
+"RTN","EDPFPER",37,0)
+ ; PER is IEN for file 200, ROLE is P(rovider),R(esident), or N(urse)
+"RTN","EDPFPER",38,0)
+ ; Expects EDPNURS to be defined for nurses (EDPF NURSE STAFF FILTER)
+"RTN","EDPFPER",39,0)
+ I '$$ACTIVE^XUSER(PER) Q 0
+"RTN","EDPFPER",40,0)
+ I ("PR"[ROLE),'$$PROVIDER^XUSER(PER) Q 0
+"RTN","EDPFPER",41,0)
+ Q:ROLE'="N" 1
+"RTN","EDPFPER",42,0)
+ ;
+"RTN","EDPFPER",43,0)
+ I '$G(EDPNURS),'$D(^NURSF(210,"B",PER)) Q 0
+"RTN","EDPFPER",44,0)
+ I ($G(EDPNURS)=1),'$D(^XUSEC("ORELSE",PER)) Q 0
+"RTN","EDPFPER",45,0)
+ I ($G(EDPNURS)=2),'$D(^XUSEC("PSJ RNURSE",PER)) Q 0
+"RTN","EDPFPER",46,0)
+ Q 1
+"RTN","EDPFPTC")
+0^36^B14885802
+"RTN","EDPFPTC",1,0)
+EDPFPTC ;SLC/MKB - Patient look-up Utilities at Facility
+"RTN","EDPFPTC",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPFPTC",3,0)
+ ;
+"RTN","EDPFPTC",4,0)
+CHK(AREA,DFN,NAME) ; perform patient select checks
+"RTN","EDPFPTC",5,0)
+ ;
+"RTN","EDPFPTC",6,0)
+ ; check for active on board
+"RTN","EDPFPTC",7,0)
+ N IEN,X0,CHK S NAME=$$UP^XLFSTR(NAME)
+"RTN","EDPFPTC",8,0)
+ S IEN=0 F  S IEN=$O(^EDP(230,"AC",EDPSITE,AREA,IEN)) Q:'IEN  D  Q:$D(CHK("onBoard"))
+"RTN","EDPFPTC",9,0)
+ . S X0=^EDP(230,IEN,0)
+"RTN","EDPFPTC",10,0)
+ . I DFN,($P(X0,U,6)=DFN) S CHK("onBoard")=$P(^DPT(DFN,0),U)
+"RTN","EDPFPTC",11,0)
+ . I 'DFN,($E(NAME,1,10)'="(AMBULANCE"),($$UP^XLFSTR($P(X0,U,4))=NAME) S CHK("onBoard")=NAME
+"RTN","EDPFPTC",12,0)
+ ;
+"RTN","EDPFPTC",13,0)
+ ; stop here if no DFN
+"RTN","EDPFPTC",14,0)
+ I 'DFN D  Q
+"RTN","EDPFPTC",15,0)
+ . S CHK("sensitive")=0,CHK("mayAccess")=1,CHK("logAccess")=0
+"RTN","EDPFPTC",16,0)
+ . D XML^EDPX($$XMLA^EDPX("checks",.CHK,"/"))
+"RTN","EDPFPTC",17,0)
+ ;
+"RTN","EDPFPTC",18,0)
+ ; check for sensitive record
+"RTN","EDPFPTC",19,0)
+ N EDPY,WARN,I,X
+"RTN","EDPFPTC",20,0)
+ D PTSEC^DGSEC4(.EDPY,DFN,1)  ;IA #3027
+"RTN","EDPFPTC",21,0)
+ S CHK("dfn")=DFN
+"RTN","EDPFPTC",22,0)
+ S CHK("sensitive")=(EDPY(1)>0)
+"RTN","EDPFPTC",23,0)
+ S CHK("mayAccess")=(EDPY(1)<3)
+"RTN","EDPFPTC",24,0)
+ S CHK("logAccess")=(EDPY(1)>1)
+"RTN","EDPFPTC",25,0)
+ M WARN=EDPY K WARN(1)
+"RTN","EDPFPTC",26,0)
+ ;
+"RTN","EDPFPTC",27,0)
+ ; check for deceased patient
+"RTN","EDPFPTC",28,0)
+ N DIED S DIED=0
+"RTN","EDPFPTC",29,0)
+ I +$G(^DPT(DFN,.35)) D
+"RTN","EDPFPTC",30,0)
+ . S DIED(1)="This patient died on "_$$FMTE^XLFDT(^DPT(DFN,.35),"D")_"."
+"RTN","EDPFPTC",31,0)
+ . S DIED(2)="Do you wish to continue?"
+"RTN","EDPFPTC",32,0)
+ ;
+"RTN","EDPFPTC",33,0)
+ ; check for similar patients
+"RTN","EDPFPTC",34,0)
+ K EDPY
+"RTN","EDPFPTC",35,0)
+ N MSG,SIM S MSG=0,SIM=0
+"RTN","EDPFPTC",36,0)
+ D GUIBS5A^DPTLK6(.EDPY,DFN)  ;IA #3593
+"RTN","EDPFPTC",37,0)
+ S CHK("similar")=(EDPY(1)>0)
+"RTN","EDPFPTC",38,0)
+ S I=1 F  S I=$O(EDPY(I)) Q:'I  S X=EDPY(I) D
+"RTN","EDPFPTC",39,0)
+ . I $E(X)=0 S MSG=MSG+1,MSG(MSG)=$P(X,U,2)
+"RTN","EDPFPTC",40,0)
+ . I $E(X)=1 D
+"RTN","EDPFPTC",41,0)
+ .. S X("dfn")=$P(X,U,2)
+"RTN","EDPFPTC",42,0)
+ .. S X("name")=$P(X,U,3)
+"RTN","EDPFPTC",43,0)
+ .. S X("dob")=$$FMTE^XLFDT($P(X,U,4),"D")
+"RTN","EDPFPTC",44,0)
+ .. S X("ssn")=$P(X,U,5)
+"RTN","EDPFPTC",45,0)
+ .. S SIM=SIM+1,SIM(SIM)=$$XMLA^EDPX("similar",.X,"/")
+"RTN","EDPFPTC",46,0)
+ ;
+"RTN","EDPFPTC",47,0)
+ ; possibly check means test: GUIMTD^DPTLK6
+"RTN","EDPFPTC",48,0)
+ ; possibly check legacy data: I $L($T(HXDATA^A7RDPAGU)...
+"RTN","EDPFPTC",49,0)
+ ;
+"RTN","EDPFPTC",50,0)
+ ; put it all together
+"RTN","EDPFPTC",51,0)
+ D XML^EDPX($$XMLA^EDPX("checks",.CHK,"/"))
+"RTN","EDPFPTC",52,0)
+ I $D(WARN) D
+"RTN","EDPFPTC",53,0)
+ . D XML^EDPX("<warning>")
+"RTN","EDPFPTC",54,0)
+ . S I=0 F  S I=$O(WARN(I)) Q:'I  D XML^EDPX(WARN(I))
+"RTN","EDPFPTC",55,0)
+ . I CHK("logAccess"),CHK("mayAccess") D XML^EDPX("Are you sure you wish to continue?")
+"RTN","EDPFPTC",56,0)
+ . D XML^EDPX("</warning>")
+"RTN","EDPFPTC",57,0)
+ S I=0 F  S I=$O(SIM(I)) Q:'I  D XML^EDPX(SIM(I))
+"RTN","EDPFPTC",58,0)
+ I $D(MSG) D
+"RTN","EDPFPTC",59,0)
+ . D XML^EDPX("<warnSimilar>")
+"RTN","EDPFPTC",60,0)
+ . S I=0 F  S I=$O(MSG(I)) Q:'I  D XML^EDPX(MSG(I))
+"RTN","EDPFPTC",61,0)
+ . D XML^EDPX("</warnSimilar>")
+"RTN","EDPFPTC",62,0)
+ I $D(DIED) D
+"RTN","EDPFPTC",63,0)
+ . D XML^EDPX("<died>")
+"RTN","EDPFPTC",64,0)
+ . S I=0 F  S I=$O(DIED(I)) Q:'I  D XML^EDPX(DIED(I))
+"RTN","EDPFPTC",65,0)
+ . D XML^EDPX("</died>")
+"RTN","EDPFPTC",66,0)
+ I CHK("mayAccess") D PRF(DFN)
+"RTN","EDPFPTC",67,0)
+ Q
+"RTN","EDPFPTC",68,0)
+PRF(DFN) ; get Patient Record Flags
+"RTN","EDPFPTC",69,0)
+ N EDPY,EDI,PRF,N,X
+"RTN","EDPFPTC",70,0)
+ Q:$$GETACT^DGPFAPI(DFN,"EDPY")'>0
+"RTN","EDPFPTC",71,0)
+ D XML^EDPX("<patientRecordFlags>")
+"RTN","EDPFPTC",72,0)
+ S EDI=0 F  S EDI=$O(EDPY(EDI)) Q:EDI<1  K PRF D
+"RTN","EDPFPTC",73,0)
+ . S PRF("assignmentStatus")="Active"
+"RTN","EDPFPTC",74,0)
+ . S PRF("assignTS")=$P($G(EDPY(EDI,"ASSIGNDT")),U)
+"RTN","EDPFPTC",75,0)
+ . S PRF("approved")=$P($G(EDPY(EDI,"APPRVBY")),U,2)
+"RTN","EDPFPTC",76,0)
+ . S PRF("nextReviewDT")=$P($G(EDPY(EDI,"REVIEWDT")),U)
+"RTN","EDPFPTC",77,0)
+ . S PRF("name")=$P($G(EDPY(EDI,"FLAG")),U,2)
+"RTN","EDPFPTC",78,0)
+ . S PRF("type")=$P($G(EDPY(EDI,"FLAGTYPE")),U,2)
+"RTN","EDPFPTC",79,0)
+ . S PRF("category")=$P($G(EDPY(EDI,"CATEGORY")),U,2)
+"RTN","EDPFPTC",80,0)
+ . S PRF("ownerSite")=$P($G(EDPY(EDI,"OWNER")),U,2)
+"RTN","EDPFPTC",81,0)
+ . S PRF("originatingSite")=$P($G(EDPY(EDI,"ORIGSITE")),U,2)
+"RTN","EDPFPTC",82,0)
+ . D XML^EDPX($$XMLA^EDPX("flag",.PRF,""))
+"RTN","EDPFPTC",83,0)
+ . S N=1,X=$G(EDPY(EDI,"NARR",1,0))
+"RTN","EDPFPTC",84,0)
+ . F  S N=$O(EDPY(EDI,"NARR",N)) Q:N<1  S X=X_$C(13,10)_$G(EDPY(EDI,"NARR",N,0))
+"RTN","EDPFPTC",85,0)
+ . D XML^EDPX("<text>"_$$ESC^EDPX(X)_"</text>")
+"RTN","EDPFPTC",86,0)
+ . D XML^EDPX("</flag>")
+"RTN","EDPFPTC",87,0)
+ D XML^EDPX("</patientRecordFlags>")
+"RTN","EDPFPTC",88,0)
+ Q
+"RTN","EDPFPTC",89,0)
+ ;
+"RTN","EDPFPTC",90,0)
+LOG(DFN) ; Make entry in security log for sensitive patient access
+"RTN","EDPFPTC",91,0)
+ N EDPY,X
+"RTN","EDPFPTC",92,0)
+ D NOTICE^DGSEC4(.EDPY,DFN) ;IA #3027
+"RTN","EDPFPTC",93,0)
+ S X=$S(EDPY:"ok",1:"fail")
+"RTN","EDPFPTC",94,0)
+ D XML^EDPX("<save status='"_X_"' />")
+"RTN","EDPFPTC",95,0)
+ Q
+"RTN","EDPFPTC",96,0)
+ ;
+"RTN","EDPFPTC",97,0)
+TEST ; 
+"RTN","EDPFPTC",98,0)
+ S EDPSITE=$$IEN^XUAF4(442),NAME="doe,john"
+"RTN","EDPFPTC",99,0)
+ D CHK(1,"",NAME)
+"RTN","EDPFPTC",100,0)
+ ;N PID S EDPSITE=$$IEN^XUAF4(442)
+"RTN","EDPFPTC",101,0)
+ ;R "DFN:",PID Q:PID=""  W !
+"RTN","EDPFPTC",102,0)
+ ;D CHK(1,PID,$P(^DPT(PID,0),U))
+"RTN","EDPFPTC",103,0)
+ N I S I=0 F  S I=$O(EDPXML(I)) Q:'I  W !,EDPXML(I)
+"RTN","EDPFPTC",104,0)
+ K EDPXML
+"RTN","EDPFPTC",105,0)
+ Q
+"RTN","EDPFPTC",106,0)
+TEST1 ;
+"RTN","EDPFPTC",107,0)
+ S EDPSITE=$$IEN^XUAF4(442),NAME="doe,john"
+"RTN","EDPFPTC",108,0)
+ D CHK(1,"",NAME)
+"RTN","EDPFPTC",109,0)
+ ;
+"RTN","EDPFPTC",110,0)
+ ;DO LATER?  -- linked progress notes
+"RTN","EDPFPTC",111,0)
+ ;D GETTITLE^TIUPRF2(.EDPT,DFN,EDI),GETNOTES^TIUPRF2(.EDPN,DFN,EDPT,1)
+"RTN","EDPFPTC",112,0)
+ ;I $O(EDPN(0)) D
+"RTN","EDPFPTC",113,0)
+ ;. D XML^EDPX("<notes>")
+"RTN","EDPFPTC",114,0)
+ ;. S N=0 F  S N=$O(EDPN(N)) Q:N<1  K PN S X=EDPN(N) D
+"RTN","EDPFPTC",115,0)
+ ;.. S PN("id")=+X,PN("action")=$P(X,U,2),PN("author")=$P(X,U,4)
+"RTN","EDPFPTC",116,0)
+ ;.. S PN("noteTS")=9999999-N
+"RTN","EDPFPTC",117,0)
+ ;.. D TGET^TIUSRVR1(.EDPX,+X)
+"RTN","EDPFPTC",118,0)
+ ;.. S X=$$XMLA^EDPX("note",.PN),X=$TR(X,"/") D XML^EDPX(X)
+"RTN","EDPFPTC",119,0)
+ ;.. S I=1,X=$G(@EDPX@(1))
+"RTN","EDPFPTC",120,0)
+ ;.. F  S I=$O(@EDPX@(I)) Q:I<1  S X=X_$C(13,10)_$G(@EDPX@(I))
+"RTN","EDPFPTC",121,0)
+ ;.. S X="<text>"_$$ESC^EDPX(X)_"</text>" D XML^EDPX(X)
+"RTN","EDPFPTC",122,0)
+ ;.. D XML^EDPX("</note>")
+"RTN","EDPFPTC",123,0)
+ ;. D XML^EDPX("</notes>")
+"RTN","EDPFPTL")
+0^6^B4915038
+"RTN","EDPFPTL",1,0)
+EDPFPTL ;SLC/KCM - Select Patient at Facility
+"RTN","EDPFPTL",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPFPTL",3,0)
+ ;
+"RTN","EDPFPTL",4,0)
+MATCH(MATCH) ; return XML of matching patients
+"RTN","EDPFPTL",5,0)
+ S MATCH=$$UP^XLFSTR(MATCH)
+"RTN","EDPFPTL",6,0)
+ Q:MATCH=""
+"RTN","EDPFPTL",7,0)
+ ;
+"RTN","EDPFPTL",8,0)
+ S:+MATCH MATCH=$TR(MATCH,"-","")
+"RTN","EDPFPTL",9,0)
+ ;
+"RTN","EDPFPTL",10,0)
+ N LST S LST=0
+"RTN","EDPFPTL",11,0)
+ N LIMIT S LIMIT=100
+"RTN","EDPFPTL",12,0)
+ I MATCH?4N D BS(MATCH)
+"RTN","EDPFPTL",13,0)
+ I MATCH?1U4N D BS5(MATCH)
+"RTN","EDPFPTL",14,0)
+ I MATCH?9N.1U D SSN(MATCH)
+"RTN","EDPFPTL",15,0)
+ D LNAM(MATCH)
+"RTN","EDPFPTL",16,0)
+ I LST=0 D NONE("No matches found.")
+"RTN","EDPFPTL",17,0)
+ I LST>0 D LIST(.LST)
+"RTN","EDPFPTL",18,0)
+ I LIMIT<1 D
+"RTN","EDPFPTL",19,0)
+ . D NONE("Limit of 100 matches reached.")
+"RTN","EDPFPTL",20,0)
+ . D XML^EDPX("<matchesTruncated>true</matchesTruncated>")
+"RTN","EDPFPTL",21,0)
+ Q
+"RTN","EDPFPTL",22,0)
+ ;
+"RTN","EDPFPTL",23,0)
+NONE(MSG) ; create a "no match" entry
+"RTN","EDPFPTL",24,0)
+ N X
+"RTN","EDPFPTL",25,0)
+ S X("name")=MSG
+"RTN","EDPFPTL",26,0)
+ S X("ssn")="",X("dob")="",X("dfn")=0
+"RTN","EDPFPTL",27,0)
+ D XML^EDPX($$XMLA^EDPX("ptlk",.X))
+"RTN","EDPFPTL",28,0)
+ Q
+"RTN","EDPFPTL",29,0)
+LIST(LST) ; list names that match
+"RTN","EDPFPTL",30,0)
+ N I,X,DFN,NAME
+"RTN","EDPFPTL",31,0)
+ S NAME="" F  S NAME=$O(LST(NAME)) Q:NAME=""  D
+"RTN","EDPFPTL",32,0)
+ . S DFN=0 F  S DFN=$O(LST(NAME,DFN)) Q:'DFN  D
+"RTN","EDPFPTL",33,0)
+ .. S X("name")=NAME
+"RTN","EDPFPTL",34,0)
+ .. S X("ssn")=$$SSN^DPTLK1(DFN)  ; DG249
+"RTN","EDPFPTL",35,0)
+ .. S X("dob")=$$DOB^DPTLK1(DFN)  ; DG249
+"RTN","EDPFPTL",36,0)
+ .. S X("dfn")=DFN
+"RTN","EDPFPTL",37,0)
+ .. D XML^EDPX($$XMLA^EDPX("ptlk",.X))
+"RTN","EDPFPTL",38,0)
+ Q
+"RTN","EDPFPTL",39,0)
+BS(X) ; find matches on 9999 (BS)
+"RTN","EDPFPTL",40,0)
+ ; expects LST,LIMIT to be defined
+"RTN","EDPFPTL",41,0)
+ N DFN S DFN=0
+"RTN","EDPFPTL",42,0)
+ F  S DFN=$O(^DPT("BS",X,DFN)) Q:'DFN  D
+"RTN","EDPFPTL",43,0)
+ . S LIMIT=LIMIT-1 I LIMIT<1 Q
+"RTN","EDPFPTL",44,0)
+ . S LST=LST+1,LST($P(^DPT(DFN,0),U),DFN)=""
+"RTN","EDPFPTL",45,0)
+ Q
+"RTN","EDPFPTL",46,0)
+BS5(X) ; find matches on X9999 (BS5)
+"RTN","EDPFPTL",47,0)
+ ; expects LST,LIMIT to be defined
+"RTN","EDPFPTL",48,0)
+ N DFN S DFN=0
+"RTN","EDPFPTL",49,0)
+ F  S DFN=$O(^DPT("BS5",X,DFN)) Q:'DFN  D
+"RTN","EDPFPTL",50,0)
+ . S LIMIT=LIMIT-1 I LIMIT<1 Q
+"RTN","EDPFPTL",51,0)
+ . S LST=LST+1,LST($P(^DPT(DFN,0),U),DFN)=""
+"RTN","EDPFPTL",52,0)
+ Q
+"RTN","EDPFPTL",53,0)
+SSN(X) ; find matches on 999999999 (SSN)
+"RTN","EDPFPTL",54,0)
+ ; expects LST,LIMIT to be defined
+"RTN","EDPFPTL",55,0)
+ N DFN S DFN=0
+"RTN","EDPFPTL",56,0)
+ F  S DFN=$O(^DPT("SSN",X,DFN)) Q:'DFN  D
+"RTN","EDPFPTL",57,0)
+ . S LIMIT=LIMIT-1 I LIMIT<1 Q
+"RTN","EDPFPTL",58,0)
+ . S LST=LST+1,LST($P(^DPT(DFN,0),U),DFN)=""
+"RTN","EDPFPTL",59,0)
+ Q
+"RTN","EDPFPTL",60,0)
+LNAM(X) ; find matches on name (B)
+"RTN","EDPFPTL",61,0)
+ ; expects LST,LIMIT to be defined
+"RTN","EDPFPTL",62,0)
+ N DFN,NAME
+"RTN","EDPFPTL",63,0)
+ S NAME=$O(^DPT("B",X),-1)
+"RTN","EDPFPTL",64,0)
+ F  S NAME=$O(^DPT("B",NAME)) Q:$E(NAME,1,$L(X))'=X  Q:NAME=""  Q:LIMIT<1  D
+"RTN","EDPFPTL",65,0)
+ . S DFN=0 F  S DFN=$O(^DPT("B",NAME,DFN)) Q:'DFN  D
+"RTN","EDPFPTL",66,0)
+ .. S LIMIT=LIMIT-1 I LIMIT<1 Q
+"RTN","EDPFPTL",67,0)
+ .. S LST=LST+1,LST(NAME,DFN)=""
+"RTN","EDPFPTL",68,0)
+ Q
+"RTN","EDPLOG")
+0^37^B42149061
+"RTN","EDPLOG",1,0)
+EDPLOG ;SLC/KCM - Update ED Log - Update ;1/26/09  14:14
+"RTN","EDPLOG",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPLOG",3,0)
+ ;
+"RTN","EDPLOG",4,0)
+ ;TODO:  add transaction processing
+"RTN","EDPLOG",5,0)
+ ;
+"RTN","EDPLOG",6,0)
+UPD(REQ,REMOVE) ; Update a record
+"RTN","EDPLOG",7,0)
+ N REC D NVPARSE^EDPX(.REC,REQ)
+"RTN","EDPLOG",8,0)
+ N IEN S IEN=$$VAL("id")
+"RTN","EDPLOG",9,0)
+ I '$G(IEN) D FAIL("upd",2300007) Q
+"RTN","EDPLOG",10,0)
+ I '$D(^EDP(230,IEN,0)) D FAIL("upd",2300006) Q
+"RTN","EDPLOG",11,0)
+ N ERR S ERR=$$VALID^EDPLOG1(.REC) I $L(ERR) D FAIL("upd",ERR) Q
+"RTN","EDPLOG",12,0)
+ N AMB S AMB="(ambulance en route)"
+"RTN","EDPLOG",13,0)
+ ;
+"RTN","EDPLOG",14,0)
+ ; compute the local time & "no value" ien
+"RTN","EDPLOG",15,0)
+ N TIME S TIME=$$NOW^XLFDT
+"RTN","EDPLOG",16,0)
+ N EDPNOVAL S EDPNOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0))
+"RTN","EDPLOG",17,0)
+ ; before allowing remove, check the required fields
+"RTN","EDPLOG",18,0)
+ S REMOVE=$G(REMOVE,0)!$P(^EDP(230,IEN,0),U,7)  ; removing or closed
+"RTN","EDPLOG",19,0)
+ I REMOVE D RDY2RMV Q:'REC("closed")
+"RTN","EDPLOG",20,0)
+ ;
+"RTN","EDPLOG",21,0)
+ ; get the existing log entry
+"RTN","EDPLOG",22,0)
+ N X0,X1,X2,X3,AREA,I
+"RTN","EDPLOG",23,0)
+ S X0=^EDP(230,IEN,0),X1=$G(^(1)),X2=$G(^(2)),X3=$G(^(3))
+"RTN","EDPLOG",24,0)
+ S AREA=$P(X0,U,3),^EDPB(231.9,AREA,230)=$H  ; last update timestamp
+"RTN","EDPLOG",25,0)
+ ;
+"RTN","EDPLOG",26,0)
+ N NAME,DFN,SSN,PCE
+"RTN","EDPLOG",27,0)
+ S NAME=$$VAL("name"),DFN=$$VAL("dfn"),SSN=""
+"RTN","EDPLOG",28,0)
+ I DFN S SSN=$P(^DPT(DFN,0),U,9)
+"RTN","EDPLOG",29,0)
+ I '$P(X0,U,8),((NAME'=AMB)!DFN) S REC("inTS")=TIME
+"RTN","EDPLOG",30,0)
+ ; Update any fields that have values passed in
+"RTN","EDPLOG",31,0)
+ N FDA,FDAIEN,DIERR,HIST
+"RTN","EDPLOG",32,0)
+ D SETFDA(X0,4,"name",.04)
+"RTN","EDPLOG",33,0)
+ ;D SETFDA(X0,5,"ssn",.05) -- NtoL
+"RTN","EDPLOG",34,0)
+ D SETFDA(X0,6,"dfn",.06)
+"RTN","EDPLOG",35,0)
+ D SETFDA(X0,7,"closed",.07)
+"RTN","EDPLOG",36,0)
+ D SETFDA(X0,8,"inTS",.08)
+"RTN","EDPLOG",37,0)
+ D SETFDA(X0,9,"outTS",.09)
+"RTN","EDPLOG",38,0)
+ D SETFDA(X0,10,"arrival",.1)
+"RTN","EDPLOG",39,0)
+ D SETFDA(X0,14,"clinic",.14)
+"RTN","EDPLOG",40,0)
+ D SETFDA(X1,1,"complaint",1.1)
+"RTN","EDPLOG",41,0)
+ D SETFDA(X2,1,"compLong",2)
+"RTN","EDPLOG",42,0)
+ D SETFDA(X3,2,"status",3.2)
+"RTN","EDPLOG",43,0)
+ D SETFDA(X3,3,"acuity",3.3)
+"RTN","EDPLOG",44,0)
+ D SETFDA(X3,4,"bed",3.4)
+"RTN","EDPLOG",45,0)
+ D SETFDA(X3,5,"provider",3.5)
+"RTN","EDPLOG",46,0)
+ D SETFDA(X3,6,"nurse",3.6)
+"RTN","EDPLOG",47,0)
+ D SETFDA(X3,7,"resident",3.7)
+"RTN","EDPLOG",48,0)
+ D SETFDA(X3,8,"comment",3.8)
+"RTN","EDPLOG",49,0)
+ D SETFDA(X1,5,"delay",1.5)
+"RTN","EDPLOG",50,0)
+ D SETFDA(X1,2,"disposition",1.2)
+"RTN","EDPLOG",51,0)
+ I $G(FDA(230,IEN_",",1.2)) S FDA(230,IEN_",",1.3)=TIME
+"RTN","EDPLOG",52,0)
+ I $L(NAME)&$L(SSN) S FDA(230,IEN_",",.11)=$E(NAME)_$E(SSN,6,9)
+"RTN","EDPLOG",53,0)
+ I $$VAL("updDiag") S HIST(230.1,"+1,",9.1)=$G(HIST(230.1,"+1,",9.1))_"4;"
+"RTN","EDPLOG",54,0)
+ ;
+"RTN","EDPLOG",55,0)
+ L +^EDP(230,IEN):3 E  D FAIL("upd",2300015) Q
+"RTN","EDPLOG",56,0)
+ ; be sure to unlock before quitting!
+"RTN","EDPLOG",57,0)
+ I $$COLLIDE^EDPLOGH(IEN,$$VAL("loadTS")) L -^EDP(230,IEN) Q
+"RTN","EDPLOG",58,0)
+ I $$BEDGONE^EDPLOGH(AREA,$P(X3,U,4),$$VAL("bed")) D FAIL("upd",2300016) L -^EDP(230,IEN) Q
+"RTN","EDPLOG",59,0)
+ I $D(HIST)>9 D SAVE^EDPLOGH(IEN,TIME,.HIST)
+"RTN","EDPLOG",60,0)
+ I $D(FDA)>9 D FILE^DIE("","FDA","ERR")
+"RTN","EDPLOG",61,0)
+ I '$D(DIERR),$$VAL("updDiag") D UPDDIAG
+"RTN","EDPLOG",62,0)
+ L -^EDP(230,IEN)
+"RTN","EDPLOG",63,0)
+ I $D(DIERR) D FAIL("upd",2300008) Q
+"RTN","EDPLOG",64,0)
+ ;
+"RTN","EDPLOG",65,0)
+ D UPDVISIT^EDPLPCE(IEN,.PCE)
+"RTN","EDPLOG",66,0)
+ ;
+"RTN","EDPLOG",67,0)
+ I (DFN&'$P(X0,U,6))!($G(REC("inTS"))&'$P(X0,U,8)) D EVT^EDPLOGA(IEN)
+"RTN","EDPLOG",68,0)
+ ;
+"RTN","EDPLOG",69,0)
+ D XML^EDPX("<upd status='ok' id='"_IEN_"' />")
+"RTN","EDPLOG",70,0)
+ Q
+"RTN","EDPLOG",71,0)
+UPDDIAG ; process diagnoses
+"RTN","EDPLOG",72,0)
+ ; called from UPD^EDPLOG
+"RTN","EDPLOG",73,0)
+ ; expects REC,PCE,IEN,TIME,AREA to be defined
+"RTN","EDPLOG",74,0)
+ N DIAG,I,FDA,FDAIEN,ERR,CODED,CODE
+"RTN","EDPLOG",75,0)
+ S DIAG="diagnosis-0",I=0,CODED=$P($G(^EDPB(231.9,AREA,1)),U,2)
+"RTN","EDPLOG",76,0)
+ F  S DIAG=$O(REC(DIAG)) Q:$E(DIAG,1,10)'="diagnosis-"  D
+"RTN","EDPLOG",77,0)
+ . S I=I+1,REC("diagnosis",I)=REC(DIAG)
+"RTN","EDPLOG",78,0)
+ . I CODED S PCE($P(REC(DIAG),U),I)=REC(DIAG)
+"RTN","EDPLOG",79,0)
+ I $D(REC("diagnosis"))<10 Q
+"RTN","EDPLOG",80,0)
+ ; replace the diagnosis multiple
+"RTN","EDPLOG",81,0)
+ D DELDIAG(IEN)
+"RTN","EDPLOG",82,0)
+ S FDA(230,IEN_",",1.4)=TIME
+"RTN","EDPLOG",83,0)
+ S I=0 F  S I=$O(REC("diagnosis",I)) Q:'I  D
+"RTN","EDPLOG",84,0)
+ . Q:$P(REC("diagnosis",I),U,6)  ; entry being removed
+"RTN","EDPLOG",85,0)
+ . S CODE=$P(REC("diagnosis",I),U,2)
+"RTN","EDPLOG",86,0)
+ . S CODE=$S(+CODE:$$ICDONE^LEXU(CODE,TIME),1:"")
+"RTN","EDPLOG",87,0)
+ . S:'$L(CODE) CODE=$P($P(REC("diagnosis",I),U,3),"/",1)
+"RTN","EDPLOG",88,0)
+ . S:$L(CODE) CODE=+$O(^ICD9("BA",CODE_" ",0))
+"RTN","EDPLOG",89,0)
+ . S FDA(230.04,"+"_I_","_IEN_",",.01)=$P(REC("diagnosis",I),U,4)
+"RTN","EDPLOG",90,0)
+ . S FDA(230.04,"+"_I_","_IEN_",",.02)=CODE
+"RTN","EDPLOG",91,0)
+ . S FDA(230.04,"+"_I_","_IEN_",",.03)=$P(REC("diagnosis",I),U,8)
+"RTN","EDPLOG",92,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPLOG",93,0)
+ Q
+"RTN","EDPLOG",94,0)
+DELDIAG(IEN) ; delete the diagnosis multiple
+"RTN","EDPLOG",95,0)
+ I '$O(^EDP(230,IEN,4,0)) Q  ; no child nodes
+"RTN","EDPLOG",96,0)
+ N DA,DIK S DA=0,DA(1)=IEN,DIK="^EDP(230,"_DA(1)_",4,"
+"RTN","EDPLOG",97,0)
+ F  S DA=$O(^EDP(230,IEN,4,DA)) Q:'DA  D ^DIK
+"RTN","EDPLOG",98,0)
+ Q
+"RTN","EDPLOG",99,0)
+HAVEDIAG() ; return true if a diagnosis is present
+"RTN","EDPLOG",100,0)
+ ; expects REC to be defined
+"RTN","EDPLOG",101,0)
+ N FOUND S FOUND=0
+"RTN","EDPLOG",102,0)
+ N DIAG S DIAG="diagnosis-0"
+"RTN","EDPLOG",103,0)
+ F  S DIAG=$O(REC(DIAG)) Q:$E(DIAG,1,10)'="diagnosis-"  D  Q:FOUND
+"RTN","EDPLOG",104,0)
+ . I '$P(REC(DIAG),U,6) S FOUND=1  ; 6th piece is delete flag
+"RTN","EDPLOG",105,0)
+ Q FOUND
+"RTN","EDPLOG",106,0)
+ ;
+"RTN","EDPLOG",107,0)
+RDY2RMV ; check required fields & set up so ready to remove
+"RTN","EDPLOG",108,0)
+ ; called from UPD, expects REC and IEN and TIME
+"RTN","EDPLOG",109,0)
+ ;
+"RTN","EDPLOG",110,0)
+ ; check special dispositions first
+"RTN","EDPLOG",111,0)
+ N DISP,CLOSE
+"RTN","EDPLOG",112,0)
+ S DISP=+$$VAL("disposition"),CLOSE=0
+"RTN","EDPLOG",113,0)
+ I DISP=+$O(^EDPB(233.1,"B","edp.disposition.error",0)) S CLOSE=1
+"RTN","EDPLOG",114,0)
+ I DISP=+$O(^EDPB(233.1,"B","edp.disposition.nec",0)) S CLOSE=1
+"RTN","EDPLOG",115,0)
+ I DISP=+$O(^EDPB(233.1,"B","edp.disposition.left",0)) S CLOSE=1
+"RTN","EDPLOG",116,0)
+ I CLOSE S:'$$VAL("outTS") REC("outTS")=TIME S REC("closed")=1 Q
+"RTN","EDPLOG",117,0)
+ ;
+"RTN","EDPLOG",118,0)
+ ; check the generally required fields
+"RTN","EDPLOG",119,0)
+ N MISSING S MISSING=""
+"RTN","EDPLOG",120,0)
+ S REC("closed")=0
+"RTN","EDPLOG",121,0)
+ I '$L($$VAL("complaint")) S MISSING=MISSING_"Complaint "
+"RTN","EDPLOG",122,0)
+ I '$$VAL("bed") S MISSING=MISSING_"Room/Area "
+"RTN","EDPLOG",123,0)
+ I '$$VAL("provider") S MISSING=MISSING_"Provider "
+"RTN","EDPLOG",124,0)
+ I $$NOVAL("acuity") S MISSING=MISSING_"Acuity "
+"RTN","EDPLOG",125,0)
+ ;
+"RTN","EDPLOG",126,0)
+ ; check the other disposition required fields
+"RTN","EDPLOG",127,0)
+ N X1,AREA,MIN,STS,OUT
+"RTN","EDPLOG",128,0)
+ S AREA=$P(^EDP(230,IEN,0),U,3),STS=$P($G(^(3)),U,2)
+"RTN","EDPLOG",129,0)
+ S X1=$G(^EDPB(231.9,AREA,1))
+"RTN","EDPLOG",130,0)
+ S MIN=$$VAL("inTS") S:'MIN MIN=$P(^EDP(230,IEN,0),U,8)
+"RTN","EDPLOG",131,0)
+ S OUT=$$VAL("outTS") S:'OUT OUT=TIME
+"RTN","EDPLOG",132,0)
+ S MIN=$$FMDIFF^XLFDT(OUT,MIN,2)\60
+"RTN","EDPLOG",133,0)
+ I $P(X1,U,1),'$$HAVEDIAG S MISSING=MISSING_"Diagnosis "
+"RTN","EDPLOG",134,0)
+ I $P(X1,U,3),$$NOVAL("disposition") S MISSING=MISSING_"Disposition "
+"RTN","EDPLOG",135,0)
+ ; (client parses for string "Delay Reason" to know whether to enable delay reason control)
+"RTN","EDPLOG",136,0)
+ I $P(X1,U,4),(MIN>$P(X1,U,5)),$$NOVAL("delay"),'$$OBS(STS) S MISSING=MISSING_"Delay Reason "
+"RTN","EDPLOG",137,0)
+ I $L(MISSING) D FAIL("upd","Fields required for removal are missing:  "_MISSING) Q
+"RTN","EDPLOG",138,0)
+ S:'$$VAL("outTS") REC("outTS")=TIME S REC("closed")=1
+"RTN","EDPLOG",139,0)
+ Q
+"RTN","EDPLOG",140,0)
+VAL(X) ; Returns parameter value or null
+"RTN","EDPLOG",141,0)
+ ; HTTP passes HTML-escaped values in an array as REC(param)
+"RTN","EDPLOG",142,0)
+ Q $G(REC(X))
+"RTN","EDPLOG",143,0)
+ ;
+"RTN","EDPLOG",144,0)
+NOVAL(X) ; Returns true if value is empty, 0, or edp.reserved.novalue
+"RTN","EDPLOG",145,0)
+ ; expects EDPNOVAL to be defined
+"RTN","EDPLOG",146,0)
+ I +$G(REC(X))=0 Q 1
+"RTN","EDPLOG",147,0)
+ I +$G(REC(X))=EDPNOVAL Q 1
+"RTN","EDPLOG",148,0)
+ Q 0
+"RTN","EDPLOG",149,0)
+ ;
+"RTN","EDPLOG",150,0)
+OBS(X) ; Returns 1 or 0, if observation status X
+"RTN","EDPLOG",151,0)
+ Q ($P($G(^EDPB(233.1,+$G(X),0)),U,5)["O")
+"RTN","EDPLOG",152,0)
+ ;
+"RTN","EDPLOG",153,0)
+SETFDA(NODE,P,SUB,FLD) ; Creates value in FDA & HIST arrays as appropriate
+"RTN","EDPLOG",154,0)
+ ; from UPD, expects REC, FDA, HIST to be defined
+"RTN","EDPLOG",155,0)
+ Q:'$D(REC(SUB))               ; value not sent in message
+"RTN","EDPLOG",156,0)
+ Q:$P(NODE,U,P)=REC(SUB)       ; value is the same
+"RTN","EDPLOG",157,0)
+ ; don't save switch from null to 0 or NOVAL to 0
+"RTN","EDPLOG",158,0)
+ ; since 0 is always sent as none value for combo box fields
+"RTN","EDPLOG",159,0)
+ I (REC(SUB)=0),($P(NODE,U,P)=""),("^.1^1.2^1.5^3.2^3.3^3.4^3.5^3.6^3.7^"[(U_FLD_U)) Q
+"RTN","EDPLOG",160,0)
+ I (REC(SUB)=0),($P(NODE,U,P)=EDPNOVAL),("^.1^1.2^1.5^3.2^3.3^"[(U_FLD_U)) Q
+"RTN","EDPLOG",161,0)
+ ;
+"RTN","EDPLOG",162,0)
+ I REC(SUB)="" S REC(SUB)="@"  ; we must be deleting field if empty
+"RTN","EDPLOG",163,0)
+ S FDA(230,IEN_",",FLD)=REC(SUB)
+"RTN","EDPLOG",164,0)
+ ; save the changed fields in the history
+"RTN","EDPLOG",165,0)
+ I $L(REC(SUB)) D
+"RTN","EDPLOG",166,0)
+ . S HIST(230.1,"+1,",9.1)=$G(HIST(230.1,"+1,",9.1))_FLD_";"
+"RTN","EDPLOG",167,0)
+ . S:FLD=1.1 FLD=.07      ; complaint
+"RTN","EDPLOG",168,0)
+ . S:FLD=1.2 FLD=.11      ; disposition
+"RTN","EDPLOG",169,0)
+ . S:FLD=1.5 FLD=.12      ; delay
+"RTN","EDPLOG",170,0)
+ . S HIST(230.1,"+1,",FLD)=REC(SUB)
+"RTN","EDPLOG",171,0)
+ . ; check for updated providers
+"RTN","EDPLOG",172,0)
+ . S:FLD=3.5 PCE("PRV",1)=REC(SUB),PCE("PRI")=REC(SUB)  ; primary provider
+"RTN","EDPLOG",173,0)
+ . S:FLD=3.6 PCE("PRV",2)=REC(SUB)                      ; nurse
+"RTN","EDPLOG",174,0)
+ . S:FLD=3.7 PCE("PRV",3)=REC(SUB)                      ; resident
+"RTN","EDPLOG",175,0)
+ Q
+"RTN","EDPLOG",176,0)
+FAIL(ELEM,MSG) ; creates failure node for returned XML
+"RTN","EDPLOG",177,0)
+ N X
+"RTN","EDPLOG",178,0)
+ I +MSG S MSG=$$MSG^EDPX(MSG)
+"RTN","EDPLOG",179,0)
+ S X="<"_ELEM_" id='"_$$VAL("id")_"' status='fail' msg='"_MSG_"' />"
+"RTN","EDPLOG",180,0)
+ D XML^EDPX(X)
+"RTN","EDPLOG",181,0)
+ S EDPFAIL=1
+"RTN","EDPLOG",182,0)
+ Q
+"RTN","EDPLOG1")
+0^38^B2583250
+"RTN","EDPLOG1",1,0)
+EDPLOG1 ;SLC/KCM - Update ED Log - Validate
+"RTN","EDPLOG1",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPLOG1",3,0)
+ ;
+"RTN","EDPLOG1",4,0)
+VALID(REC) ; validate the entries passed in REC
+"RTN","EDPLOG1",5,0)
+ D XLATE("arrival")
+"RTN","EDPLOG1",6,0)
+ D XLATE("clinic")
+"RTN","EDPLOG1",7,0)
+ D XLATE("bed")
+"RTN","EDPLOG1",8,0)
+ D XLATE("acuity")
+"RTN","EDPLOG1",9,0)
+ D XLATE("status")
+"RTN","EDPLOG1",10,0)
+ D XLATE("provider")
+"RTN","EDPLOG1",11,0)
+ D XLATE("nurse")
+"RTN","EDPLOG1",12,0)
+ D XLATE("resident")
+"RTN","EDPLOG1",13,0)
+ D XLATE("disposition")
+"RTN","EDPLOG1",14,0)
+ D XLATE("delay")
+"RTN","EDPLOG1",15,0)
+ ;
+"RTN","EDPLOG1",16,0)
+ N ERR S ERR=""
+"RTN","EDPLOG1",17,0)
+ D ADDTXT(.ERR,$$CHECK("name",230,.04,"Patient Name"))
+"RTN","EDPLOG1",18,0)
+ D ADDTXT(.ERR,$$CHECK("complaint",230,1.1,"Complaint"))
+"RTN","EDPLOG1",19,0)
+ D ADDTXT(.ERR,$$CHECK("compLong",230,2,"Long Complaint"))
+"RTN","EDPLOG1",20,0)
+ D ADDTXT(.ERR,$$CHECK("comment",230,3.8,"Comment"))
+"RTN","EDPLOG1",21,0)
+ ;
+"RTN","EDPLOG1",22,0)
+ N DIAG S DIAG="diagnosis-0"
+"RTN","EDPLOG1",23,0)
+ F  S DIAG=$O(REC(DIAG)) Q:$E(DIAG,1,10)'="diagnosis-"  D
+"RTN","EDPLOG1",24,0)
+ . S REC("edpDiagnosis")=$P(REC(DIAG),U,2)
+"RTN","EDPLOG1",25,0)
+ . D ADDTXT(ERR,$$CHECK("edpDiagnosis",230.04,.01,"Diagnosis"))
+"RTN","EDPLOG1",26,0)
+ Q ERR
+"RTN","EDPLOG1",27,0)
+ ;
+"RTN","EDPLOG1",28,0)
+CHECK(NAME,FILE,FIELD,MSG) ; return error msg if field is not valid
+"RTN","EDPLOG1",29,0)
+ ; called from VALID, assumes REC is defined
+"RTN","EDPLOG1",30,0)
+ N VAL,EDPRSLT
+"RTN","EDPLOG1",31,0)
+ S VAL=$G(REC(NAME))
+"RTN","EDPLOG1",32,0)
+ I VAL="" Q ""
+"RTN","EDPLOG1",33,0)
+ D CHK^DIE(FILE,FIELD,"",VAL,.EDPRSLT)
+"RTN","EDPLOG1",34,0)
+ I EDPRSLT="^" Q MSG_" is not valid."
+"RTN","EDPLOG1",35,0)
+ Q ""
+"RTN","EDPLOG1",36,0)
+ADDTXT(X,NEW) ; add new text comma delimited
+"RTN","EDPLOG1",37,0)
+ I $L(NEW),$L(X) S X=X_", "_NEW
+"RTN","EDPLOG1",38,0)
+ I $L(NEW),'$L(X) S X=NEW
+"RTN","EDPLOG1",39,0)
+ Q
+"RTN","EDPLOG1",40,0)
+XLATE(NAME) ; set up pointer fields for FDA array
+"RTN","EDPLOG1",41,0)
+ Q:'$D(REC(NAME))
+"RTN","EDPLOG1",42,0)
+ ;I REC(NAME)=0 S REC(NAME)="" ; store 0 when removing staff
+"RTN","EDPLOG1",43,0)
+ I REC(NAME)=-1 S REC(NAME)="@"
+"RTN","EDPLOG1",44,0)
+ Q
+"RTN","EDPLOGA")
+0^39^B10789313
+"RTN","EDPLOGA",1,0)
+EDPLOGA ;SLC/KCM - Add Entry to ED Log
+"RTN","EDPLOGA",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPLOGA",3,0)
+ ;
+"RTN","EDPLOGA",4,0)
+ ;TODO:  add transaction processing
+"RTN","EDPLOGA",5,0)
+ ;
+"RTN","EDPLOGA",6,0)
+ADD(NEWPT,AREA,TIME,CHOICES) ; Create a new ED Log record for a patient
+"RTN","EDPLOGA",7,0)
+ ; add the new record to the returned XML
+"RTN","EDPLOGA",8,0)
+ ; NEWPT = dfn \T name \T dob \T ssn
+"RTN","EDPLOGA",9,0)
+ N DFN,NAME,SSN,STATUS,BED,ARR,REC,AMB,CLINIC
+"RTN","EDPLOGA",10,0)
+ S AMB="(ambulance en route)"
+"RTN","EDPLOGA",11,0)
+ ;
+"RTN","EDPLOGA",12,0)
+ ; Set up the patient fields that were passed in
+"RTN","EDPLOGA",13,0)
+ D NVPARSE^EDPX(.REC,NEWPT)
+"RTN","EDPLOGA",14,0)
+ S DFN=REC("dfn"),NAME=REC("name"),SSN="",CLINIC=$G(REC("clinic"))
+"RTN","EDPLOGA",15,0)
+ I DFN S REC("name")=$P(^DPT(DFN,0),U),REC("ssn")=$P(^DPT(DFN,0),U,9)
+"RTN","EDPLOGA",16,0)
+ ;S SSN=REC("ssn") S:SSN="*SENSITIVE*" SSN="" --NtoL
+"RTN","EDPLOGA",17,0)
+ I 'DFN,(NAME="") D FAIL^EDPLOG("add",2300014) Q
+"RTN","EDPLOGA",18,0)
+ ;
+"RTN","EDPLOGA",19,0)
+ ; Add default values to stub entry (should be based on config for area)
+"RTN","EDPLOGA",20,0)
+ S BED=$P(^EDPB(231.9,AREA,1),U,12)
+"RTN","EDPLOGA",21,0)
+ I $G(REC("name"))=AMB D
+"RTN","EDPLOGA",22,0)
+ . S ARR=$O(^EDPB(233.1,"B","edp.arrival.ambulance",0))
+"RTN","EDPLOGA",23,0)
+ . S BED=$P(^EDPB(231.9,AREA,1),U,11)
+"RTN","EDPLOGA",24,0)
+ S STATUS="" I BED S STATUS=$P(^EDPB(231.8,BED,0),U,8)
+"RTN","EDPLOGA",25,0)
+ ;
+"RTN","EDPLOGA",26,0)
+ I +DFN,$D(^EDP(230,"AP",EDPSITE,AREA,DFN)) D FAIL^EDPLOG("add",2300002) Q
+"RTN","EDPLOGA",27,0)
+ I 'DFN,(NAME'=AMB),$D(^EDP(230,"AN",EDPSITE,AREA,NAME)) D FAIL^EDPLOG("add",2300002) Q
+"RTN","EDPLOGA",28,0)
+ N ERR S ERR=$$VALID^EDPLOG1(.REC) I $L(ERR) D FAIL^EDPLOG("add",ERR) Q
+"RTN","EDPLOGA",29,0)
+ S ^EDPB(231.9,AREA,230)=$H  ; last update timestamp
+"RTN","EDPLOGA",30,0)
+ ;
+"RTN","EDPLOGA",31,0)
+ ; Create a current log record
+"RTN","EDPLOGA",32,0)
+ N FDA,FDAIEN,DIERR,HIST,HISTIEN,LOGIEN
+"RTN","EDPLOGA",33,0)
+ S FDA(230,"+1,",.01)=TIME
+"RTN","EDPLOGA",34,0)
+ S FDA(230,"+1,",.02)=EDPSITE
+"RTN","EDPLOGA",35,0)
+ S FDA(230,"+1,",.03)=AREA
+"RTN","EDPLOGA",36,0)
+ S FDA(230,"+1,",.04)=NAME
+"RTN","EDPLOGA",37,0)
+ ;S FDA(230,"+1,",.05)=SSN --NtoL
+"RTN","EDPLOGA",38,0)
+ S FDA(230,"+1,",.06)=DFN
+"RTN","EDPLOGA",39,0)
+ S FDA(230,"+1,",3.2)=STATUS
+"RTN","EDPLOGA",40,0)
+ S FDA(230,"+1,",3.4)=BED
+"RTN","EDPLOGA",41,0)
+ I $L(SSN) S FDA(230,"+1,",.11)=$E(NAME)_$E(SSN,6,9)
+"RTN","EDPLOGA",42,0)
+ I NAME=AMB S FDA(230,"+1,",.11)="(amb)"
+"RTN","EDPLOGA",43,0)
+ I NAME'=AMB S FDA(230,"+1,",.08)=TIME
+"RTN","EDPLOGA",44,0)
+ I $G(ARR) S FDA(230,"+1,",.1)=ARR
+"RTN","EDPLOGA",45,0)
+ I CLINIC S FDA(230,"+1,",.14)=CLINIC
+"RTN","EDPLOGA",46,0)
+ I $G(REC("create")) S FDA(230,"+1,",.13)=REC("create")
+"RTN","EDPLOGA",47,0)
+ M HIST(230.1)=FDA(230)
+"RTN","EDPLOGA",48,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPLOGA",49,0)
+ I $D(DIERR) D FAIL^EDPLOG("add",2300004) Q
+"RTN","EDPLOGA",50,0)
+ S LOGIEN=FDAIEN(1)
+"RTN","EDPLOGA",51,0)
+ ;
+"RTN","EDPLOGA",52,0)
+ ; Post new patient event
+"RTN","EDPLOGA",53,0)
+ I DFN,TIME D EVT(LOGIEN)
+"RTN","EDPLOGA",54,0)
+ ;
+"RTN","EDPLOGA",55,0)
+ ; Create the first history entry
+"RTN","EDPLOGA",56,0)
+ S HIST(230.1,"+1,",.01)=LOGIEN
+"RTN","EDPLOGA",57,0)
+ S HIST(230.1,"+1,",.02)=TIME
+"RTN","EDPLOGA",58,0)
+ S HIST(230.1,"+1,",.03)=EDPUSER
+"RTN","EDPLOGA",59,0)
+ K HIST(230.1,"+1,",.11) ; don't need last4
+"RTN","EDPLOGA",60,0)
+ K HIST(230.1,"+1,",.13) ; don't need creation source
+"RTN","EDPLOGA",61,0)
+ D UPDATE^DIE("","HIST","HISTIEN","ERR")
+"RTN","EDPLOGA",62,0)
+ I $D(DIERR) D FAIL^EDPLOG("add",2300004) Q
+"RTN","EDPLOGA",63,0)
+ ;
+"RTN","EDPLOGA",64,0)
+ D XML^EDPX("<add status='ok' id='"_FDAIEN(1)_"' />")
+"RTN","EDPLOGA",65,0)
+ D GET^EDPQLE(FDAIEN(1),CHOICES)
+"RTN","EDPLOGA",66,0)
+ Q
+"RTN","EDPLOGA",67,0)
+ ;
+"RTN","EDPLOGA",68,0)
+DEL(AREA,LOGID) ; Delete Stub Log Entry
+"RTN","EDPLOGA",69,0)
+ N I,CNT,DIK,DA
+"RTN","EDPLOGA",70,0)
+ S I=0,CNT=0 F  S I=$O(^EDP(230.1,"B",LOGID,I)) Q:'I  S CNT=CNT+1
+"RTN","EDPLOGA",71,0)
+ I $L($P($G(^EDP(230,LOGID,1)),U))!(CNT>1) D  Q
+"RTN","EDPLOGA",72,0)
+ . D FAIL^EDPLOG("upd","Does not appear to be a stub entry")
+"RTN","EDPLOGA",73,0)
+ ;
+"RTN","EDPLOGA",74,0)
+ ; Delete initial history entry
+"RTN","EDPLOGA",75,0)
+ S DIK="^EDP(230.1,",DA=$O(^EDP(230.1,"B",LOGID,0))
+"RTN","EDPLOGA",76,0)
+ I DA D ^DIK
+"RTN","EDPLOGA",77,0)
+ ; Delete stub log entry
+"RTN","EDPLOGA",78,0)
+ S DIK="^EDP(230,",DA=LOGID
+"RTN","EDPLOGA",79,0)
+ D ^DIK
+"RTN","EDPLOGA",80,0)
+ ;
+"RTN","EDPLOGA",81,0)
+ D XML^EDPX("<upd status='ok' />")
+"RTN","EDPLOGA",82,0)
+ Q
+"RTN","EDPLOGA",83,0)
+ ;
+"RTN","EDPLOGA",84,0)
+EVT(LOG) ; -- post new patient event [expects EDPSITE]
+"RTN","EDPLOGA",85,0)
+ N X0,DFN,SDT,SDCL,SDATA,SDAMEVT,X
+"RTN","EDPLOGA",86,0)
+ S X0=$G(^EDP(230,+$G(LOG),0)),DFN=+$P(X0,U,6),SDT=+$P(X0,U,8)
+"RTN","EDPLOGA",87,0)
+ I 'DFN!'SDT Q  ;missing data
+"RTN","EDPLOGA",88,0)
+ S SDCL=$$DFLTLOC^EDPLPCE(DFN) Q:'SDCL
+"RTN","EDPLOGA",89,0)
+ ; have patient, time, hosp loc -> post event
+"RTN","EDPLOGA",90,0)
+ S SDATA=U_DFN_U_SDT_U_SDCL,SDAMEVT=1
+"RTN","EDPLOGA",91,0)
+ S EDPDATA=LOG_SDATA
+"RTN","EDPLOGA",92,0)
+ S X=+$O(^ORD(101,"B","EDP NEW PATIENT",0))_";ORD(101,"
+"RTN","EDPLOGA",93,0)
+ D EN^XQOR
+"RTN","EDPLOGA",94,0)
+ Q
+"RTN","EDPLOGH")
+0^40^B9457380
+"RTN","EDPLOGH",1,0)
+EDPLOGH ;SLC/KCM - Add History Entry for ED Log
+"RTN","EDPLOGH",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPLOGH",3,0)
+ ;
+"RTN","EDPLOGH",4,0)
+ ;TODO:  add transaction processing
+"RTN","EDPLOGH",5,0)
+ ;
+"RTN","EDPLOGH",6,0)
+SAVE(IEN,TIME,HIST) ; save a new history entry for changed fields
+"RTN","EDPLOGH",7,0)
+ Q:$D(HIST)<10
+"RTN","EDPLOGH",8,0)
+ ;
+"RTN","EDPLOGH",9,0)
+ N HISTIEN,DIERR
+"RTN","EDPLOGH",10,0)
+ S HIST(230.1,"+1,",.01)=IEN
+"RTN","EDPLOGH",11,0)
+ S HIST(230.1,"+1,",.02)=TIME
+"RTN","EDPLOGH",12,0)
+ S HIST(230.1,"+1,",.03)=EDPUSER
+"RTN","EDPLOGH",13,0)
+ D UPDATE^DIE("","HIST","HISTIEN","ERR")
+"RTN","EDPLOGH",14,0)
+ Q
+"RTN","EDPLOGH",15,0)
+COLLIDE(LOG,LOADTS) ; return true if new updates since load time
+"RTN","EDPLOGH",16,0)
+ N I,J,TS,IEN,FLDS,MODS
+"RTN","EDPLOGH",17,0)
+ S TS=LOADTS-0.000001
+"RTN","EDPLOGH",18,0)
+ F  S TS=$O(^EDP(230.1,"ADF",LOG,TS)) Q:'TS  D
+"RTN","EDPLOGH",19,0)
+ . S IEN=0 F  S IEN=$O(^EDP(230.1,"ADF",LOG,TS,IEN)) Q:'IEN  D
+"RTN","EDPLOGH",20,0)
+ .. S MODS=$P($G(^EDP(230.1,IEN,9)),U)
+"RTN","EDPLOGH",21,0)
+ .. F J=1:1:$L(MODS,";") I $L($P(MODS,";",J)) S FLDS($P(MODS,";",J))=""
+"RTN","EDPLOGH",22,0)
+ ; no collisions
+"RTN","EDPLOGH",23,0)
+ I $D(FLDS)<10 Q 0
+"RTN","EDPLOGH",24,0)
+ ;
+"RTN","EDPLOGH",25,0)
+ ; handle collisions
+"RTN","EDPLOGH",26,0)
+ D XML^EDPX("<upd id='"_LOG_"' status='collision' loadTS='"_$$NOW^XLFDT_"'>")
+"RTN","EDPLOGH",27,0)
+ D XML^EDPX("Since you loaded this entry, changes have been made by someone else:")
+"RTN","EDPLOGH",28,0)
+ D XML^EDPX(" ")
+"RTN","EDPLOGH",29,0)
+ N X,X0,X1,X2,X3,PT
+"RTN","EDPLOGH",30,0)
+ S X0=^EDP(230,LOG,0),X1=$G(^(1)),X2=$G(^(2)),X3=$G(^(3)),PT=0
+"RTN","EDPLOGH",31,0)
+ S I=0 F  S I=$O(FLDS(I)) Q:'I  D
+"RTN","EDPLOGH",32,0)
+ . I I=.04 S X=$P(X0,U,4) D MSG(X,"Patient Name") S PT=1
+"RTN","EDPLOGH",33,0)
+ . I (I=.06),'PT S X=$P(X0,U,6) D MSG($P($G(^DPT(+X,0)),U),"Patient Name")
+"RTN","EDPLOGH",34,0)
+ . I I=.1 S X=$P(X0,U,10) D MSG($$CODE(X),"Source")
+"RTN","EDPLOGH",35,0)
+ . I I=1.1 S X=$P(X1,U,1) D MSG(X,"Complaint")
+"RTN","EDPLOGH",36,0)
+ . I I=1.2 S X=$P(X1,U,2) D MSG($$CODE(X),"Disposition")
+"RTN","EDPLOGH",37,0)
+ . I I=1.5 S X=$P(X1,U,5) D MSG($$CODE(X),"Delay Reason")
+"RTN","EDPLOGH",38,0)
+ . I I=2 S X=$P(X2,U,1) D MSG(X,"Long Complaint")
+"RTN","EDPLOGH",39,0)
+ . I I=3.2 S X=$P(X3,U,2) D MSG($$CODE(X),"Status")
+"RTN","EDPLOGH",40,0)
+ . I I=3.3 S X=$P(X3,U,3) D MSG($$CODE(X),"Acuity")
+"RTN","EDPLOGH",41,0)
+ . I I=3.4 S X=$P(X3,U,4) D MSG($P($G(^EDPB(231.8,+X,0)),U),"Room/Area")
+"RTN","EDPLOGH",42,0)
+ . I I=3.5 S X=$P(X3,U,5) D MSG($$NP(X),"Provider")
+"RTN","EDPLOGH",43,0)
+ . I I=3.6 S X=$P(X3,U,6) D MSG($$NP(X),"Nurse")
+"RTN","EDPLOGH",44,0)
+ . I I=3.7 S X=$P(X3,U,7) D MSG($$NP(X),"Resident")
+"RTN","EDPLOGH",45,0)
+ . I I=3.8 S X=$P(X3,U,8) D MSG(X,"Comment")
+"RTN","EDPLOGH",46,0)
+ . I I=4 D MSG($$DIAG(LOG),"Diagnosis")
+"RTN","EDPLOGH",47,0)
+ D XML^EDPX(" ")
+"RTN","EDPLOGH",48,0)
+ D XML^EDPX("If you wish to overwrite with your changes,")
+"RTN","EDPLOGH",49,0)
+ D XML^EDPX("close this window and click SAVE again.")
+"RTN","EDPLOGH",50,0)
+ D XML^EDPX("If you wish to leave this entry as is,")
+"RTN","EDPLOGH",51,0)
+ D XML^EDPX("close this window and click CANCEL.")
+"RTN","EDPLOGH",52,0)
+ D XML^EDPX("</upd>")
+"RTN","EDPLOGH",53,0)
+ Q 1
+"RTN","EDPLOGH",54,0)
+ ;
+"RTN","EDPLOGH",55,0)
+BEDGONE(AREA,CURBED,BED) ; return true if bed is no longer available
+"RTN","EDPLOGH",56,0)
+ I 'BED Q 0
+"RTN","EDPLOGH",57,0)
+ I BED=CURBED Q 0
+"RTN","EDPLOGH",58,0)
+ N MULTI S MULTI=$P(^EDPB(231.8,BED,0),U,9) S:MULTI=3 MULTI=0
+"RTN","EDPLOGH",59,0)
+ I MULTI Q 0
+"RTN","EDPLOGH",60,0)
+ I '$D(^EDP(230,"AL",EDPSITE,AREA,BED)) Q 0
+"RTN","EDPLOGH",61,0)
+ Q 1
+"RTN","EDPLOGH",62,0)
+ ;
+"RTN","EDPLOGH",63,0)
+MSG(VAL,LBL) ; add to XML message
+"RTN","EDPLOGH",64,0)
+ D XML^EDPX(LBL_" changed to:  "_VAL)
+"RTN","EDPLOGH",65,0)
+ Q
+"RTN","EDPLOGH",66,0)
+CODE(IEN) ; return coded value
+"RTN","EDPLOGH",67,0)
+ I IEN Q $P(^EDPB(233.1,IEN,0),U,2)
+"RTN","EDPLOGH",68,0)
+ Q ""
+"RTN","EDPLOGH",69,0)
+NP(IEN) ; return New Person name
+"RTN","EDPLOGH",70,0)
+ I IEN Q $P(^VA(200,IEN,0),U)
+"RTN","EDPLOGH",71,0)
+ Q ""
+"RTN","EDPLOGH",72,0)
+DIAG(LOG) ; return list of diagnoses
+"RTN","EDPLOGH",73,0)
+ N I,X
+"RTN","EDPLOGH",74,0)
+ S I=0,X=""
+"RTN","EDPLOGH",75,0)
+ F  S I=$O(^EDP(230,LOG,4,I)) Q:'I  S X=X_$S($L(X):",",1:"")_$P($G(^EDP(230,LOG,4,I,0)),U)
+"RTN","EDPLOGH",76,0)
+ Q X
+"RTN","EDPLPCE")
+0^49^B32802123
+"RTN","EDPLPCE",1,0)
+EDPLPCE ;SLC/KCM - Create a Visit
+"RTN","EDPLPCE",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPLPCE",3,0)
+ ;
+"RTN","EDPLPCE",4,0)
+UPDVISIT(LOG,PCE) ; Get / Create a Visit
+"RTN","EDPLPCE",5,0)
+ ; PCE is list of potential updates to the visit
+"RTN","EDPLPCE",6,0)
+ ; PCE(TYP,n)=type^ien^code^label^add^del^upd^prim^qty
+"RTN","EDPLPCE",7,0)
+ N DFN,TS,LOC,X0
+"RTN","EDPLPCE",8,0)
+ S X0=^EDP(230,LOG,0),DFN=$P(X0,U,6),TS=$P(X0,U,8),LOC=$P(X0,U,14)
+"RTN","EDPLPCE",9,0)
+ I 'LOC S LOC=$$DFLTLOC(DFN)
+"RTN","EDPLPCE",10,0)
+ I 'DFN!('TS)!('LOC) Q 0  ; not enough info
+"RTN","EDPLPCE",11,0)
+ ;
+"RTN","EDPLPCE",12,0)
+ N EDPDATA,EDPVISIT,EDPPCHG
+"RTN","EDPLPCE",13,0)
+ S EDPVISIT=$P(X0,U,12),EDPPCHG=0 S:'EDPVISIT TS=$$TS4VISIT(DFN,LOC,TS)
+"RTN","EDPLPCE",14,0)
+ ;
+"RTN","EDPLPCE",15,0)
+ ; if closed record and no visit, bail
+"RTN","EDPLPCE",16,0)
+ I $P(X0,U,7),'EDPVISIT Q 0
+"RTN","EDPLPCE",17,0)
+ ;
+"RTN","EDPLPCE",18,0)
+ ; if no visit, but diagnoses exist, xfer the diagnoses
+"RTN","EDPLPCE",19,0)
+ I 'EDPVISIT D XFERDIAG(LOG,.PCE)
+"RTN","EDPLPCE",20,0)
+ ; remove current primary provider(s) if there is a new one
+"RTN","EDPLPCE",21,0)
+ I EDPVISIT,$G(PCE("PRI")) D
+"RTN","EDPLPCE",22,0)
+ . N IPRV,XPRV,OLDPRI
+"RTN","EDPLPCE",23,0)
+ . K ^TMP("PXKENC",$J)
+"RTN","EDPLPCE",24,0)
+ . D ENCEVENT^PXAPI(EDPVISIT)
+"RTN","EDPLPCE",25,0)
+ . S IPRV=0 F  S IPRV=$O(^TMP("PXKENC",$J,EDPVISIT,"PRV",IPRV)) Q:'IPRV  D
+"RTN","EDPLPCE",26,0)
+ .. S XPRV=^TMP("PXKENC",$J,EDPVISIT,"PRV",IPRV,0)
+"RTN","EDPLPCE",27,0)
+ .. Q:$P(XPRV,U,4)'="P"
+"RTN","EDPLPCE",28,0)
+ .. I +XPRV'=$G(PCE("PRI")) S EDPDATA("PROVIDER",IPRV,"NAME")=+XPRV,EDPDATA("PROVIDER",IPRV,"PRIMARY")=0
+"RTN","EDPLPCE",29,0)
+ ; add any new providers that were entered
+"RTN","EDPLPCE",30,0)
+ S I=0 F  S I=$O(PCE("PRV",I)) Q:'I  D
+"RTN","EDPLPCE",31,0)
+ . S EDPDATA("PROVIDER",I,"NAME")=+PCE("PRV",I)
+"RTN","EDPLPCE",32,0)
+ . I +PCE("PRV",I)=$G(PCE("PRI")) S EDPDATA("PROVIDER",I,"PRIMARY")=1,EDPPCHG=1
+"RTN","EDPLPCE",33,0)
+ ; update diagnoses
+"RTN","EDPLPCE",34,0)
+ S I=0 F  S I=$O(PCE("POV",I)) Q:'I  D
+"RTN","EDPLPCE",35,0)
+ . S X=PCE("POV",I)
+"RTN","EDPLPCE",36,0)
+ . Q:'($P(X,U,5)!$P(X,U,6)!$P(X,U,7))  ; no updates for this diagnosis
+"RTN","EDPLPCE",37,0)
+ . I $P(X,U,2) D
+"RTN","EDPLPCE",38,0)
+ .. N CODE S CODE=$$ICDONE^LEXU($P(X,U,2),TS)
+"RTN","EDPLPCE",39,0)
+ .. S $P(X,U,3)=CODE
+"RTN","EDPLPCE",40,0)
+ . Q:'$L($P(X,U,3))                   ; not coded
+"RTN","EDPLPCE",41,0)
+ . S IEN=+$O(^ICD9("BA",$P(X,U,3)_" ",0)) Q:'IEN
+"RTN","EDPLPCE",42,0)
+ . S EDPDATA("DX/PL",I,"DIAGNOSIS")=IEN
+"RTN","EDPLPCE",43,0)
+ . S EDPDATA("DX/PL",I,"NARRATIVE")=$P(X,U,4)
+"RTN","EDPLPCE",44,0)
+ . I $P(X,U,8) S EDPDATA("DX/PL",I,"PRIMARY")=1
+"RTN","EDPLPCE",45,0)
+ . I $P(X,U,6) S EDPDATA("DX/PL",I,"DELETE")=1
+"RTN","EDPLPCE",46,0)
+ ; update procedures
+"RTN","EDPLPCE",47,0)
+ S I=0 F  S I=$O(PCE("CPT",I)) Q:'I  D
+"RTN","EDPLPCE",48,0)
+ . S X=PCE("CPT",I)
+"RTN","EDPLPCE",49,0)
+ . Q:'($P(X,U,5)!$P(X,U,6)!$P(X,U,7))  ; no updates for this procedure
+"RTN","EDPLPCE",50,0)
+ . I $P(X,U,2) D
+"RTN","EDPLPCE",51,0)
+ .. N CODE S CODE=$$CPTONE^LEXU($P(X,U,2),TS)
+"RTN","EDPLPCE",52,0)
+ .. S $P(X,U,3)=CODE
+"RTN","EDPLPCE",53,0)
+ . Q:'$L($P(X,U,3))                   ; not coded
+"RTN","EDPLPCE",54,0)
+ . S IEN=+$O(^ICPT("B",$P(X,U,3),0))
+"RTN","EDPLPCE",55,0)
+ . S EDPDATA("PROCEDURE",I,"PROCEDURE")=IEN
+"RTN","EDPLPCE",56,0)
+ . S EDPDATA("PROCEDURE",I,"QTY")=$S($P(X,U,9):$P(X,U,9),1:1)
+"RTN","EDPLPCE",57,0)
+ . S EDPDATA("PROCEDURE",I,"NARRATIVE")=$P(X,U,4)
+"RTN","EDPLPCE",58,0)
+ . I $P(X,U,6) S EDPDATA("PROCEDURE",I,"DELETE")=1
+"RTN","EDPLPCE",59,0)
+ ; exit if no updates
+"RTN","EDPLPCE",60,0)
+ Q:'$D(EDPDATA) 0
+"RTN","EDPLPCE",61,0)
+ ;
+"RTN","EDPLPCE",62,0)
+ N EDPKG,EDPSRC,EDPERR,OK
+"RTN","EDPLPCE",63,0)
+ S EDPKG=$O(^DIC(9.4,"B","EMERGENCY DEPARTMENT",0))
+"RTN","EDPLPCE",64,0)
+ S EDPSRC="EDP TRACKING LOG"
+"RTN","EDPLPCE",65,0)
+ S EDPDATA("ENCOUNTER",1,"PATIENT")=DFN
+"RTN","EDPLPCE",66,0)
+ S EDPDATA("ENCOUNTER",1,"HOS LOC")=LOC
+"RTN","EDPLPCE",67,0)
+ S EDPDATA("ENCOUNTER",1,"SERVICE CATEGORY")="A"
+"RTN","EDPLPCE",68,0)
+ S EDPDATA("ENCOUNTER",1,"ENCOUNTER TYPE")="P"
+"RTN","EDPLPCE",69,0)
+ I 'EDPVISIT S EDPDATA("ENCOUNTER",1,"ENC D/T")=TS
+"RTN","EDPLPCE",70,0)
+ S OK=$$DATA2PCE^PXAPI("EDPDATA",EDPKG,EDPSRC,.EDPVISIT,,,,EDPPCHG,.EDPERR)
+"RTN","EDPLPCE",71,0)
+ I OK<1 D
+"RTN","EDPLPCE",72,0)
+ . N NOW S NOW=$$NOW^XLFDT
+"RTN","EDPLPCE",73,0)
+ . S ^XTMP("EDPERR-PCE-"_LOG,0)=$$FMADD^XLFDT(NOW,7)_U_NOW_U_"ED PCE Error"
+"RTN","EDPLPCE",74,0)
+ . S ^XTMP("EDPERR-PCE-"_LOG,"VISIT")=EDPVISIT_U_OK
+"RTN","EDPLPCE",75,0)
+ . M ^XTMP("EDPERR-PCE-"_LOG,"DATA")=EDPDATA
+"RTN","EDPLPCE",76,0)
+ . M ^XTMP("EDPERR-PCE-"_LOG,"ERR")=EDPERR
+"RTN","EDPLPCE",77,0)
+ ;
+"RTN","EDPLPCE",78,0)
+ ; update the visit pointer in 230
+"RTN","EDPLPCE",79,0)
+ I EDPVISIT,OK,($P(X0,U,12)'=EDPVISIT) D
+"RTN","EDPLPCE",80,0)
+ . N FDA,DIERR,ERR
+"RTN","EDPLPCE",81,0)
+ . S FDA(230,LOG_",",.12)=EDPVISIT
+"RTN","EDPLPCE",82,0)
+ . D FILE^DIE("","FDA","ERR")
+"RTN","EDPLPCE",83,0)
+ Q
+"RTN","EDPLPCE",84,0)
+XFERDIAG(LOG,PCE) ; Setup diagnosis list based on entries in 230
+"RTN","EDPLPCE",85,0)
+ N IEN,X0,CODE
+"RTN","EDPLPCE",86,0)
+ K PCE("POV")  ; not worried about adds & subtracts, so start over
+"RTN","EDPLPCE",87,0)
+ S IEN=0 F  S IEN=$O(^EDP(230,LOG,4,IEN)) Q:'IEN  D
+"RTN","EDPLPCE",88,0)
+ . S X0=$G(^EDP(230,LOG,4,IEN,0))
+"RTN","EDPLPCE",89,0)
+ . S PCE("POV",IEN)="POV^^^^1"
+"RTN","EDPLPCE",90,0)
+ . S CODE=$P(X0,U,2) S:CODE CODE=$P(^ICD9(CODE,0),U)
+"RTN","EDPLPCE",91,0)
+ . S $P(PCE("POV",IEN),U,3)=CODE        ; code
+"RTN","EDPLPCE",92,0)
+ . S $P(PCE("POV",IEN),U,4)=$P(X0,U)    ; text
+"RTN","EDPLPCE",93,0)
+ . S $P(PCE("POV",IEN),U,8)=$P(X0,U,3)  ; primary
+"RTN","EDPLPCE",94,0)
+ Q
+"RTN","EDPLPCE",95,0)
+DELVISIT(LOG) ; Delete visit for stub entry
+"RTN","EDPLPCE",96,0)
+ N EDPVISIT S EDPVISIT=$P(^EDP(230,LOG,0),U,12)
+"RTN","EDPLPCE",97,0)
+ Q:'EDPVISIT
+"RTN","EDPLPCE",98,0)
+ ;
+"RTN","EDPLPCE",99,0)
+ N FDA,DIERR,ERR
+"RTN","EDPLPCE",100,0)
+ S FDA(230,LOG_",",.12)="@"
+"RTN","EDPLPCE",101,0)
+ D FILE^DIE("","FDA","ERR")
+"RTN","EDPLPCE",102,0)
+ ;
+"RTN","EDPLPCE",103,0)
+ S OK=$$DELVFILE^PXAPI("ALL",EDPVISIT,"EMERGENCY DEPARTMENT","EDP TRACKING LOG")
+"RTN","EDPLPCE",104,0)
+ Q
+"RTN","EDPLPCE",105,0)
+DFLTLOC(DFN) ; Return the default location for the ED
+"RTN","EDPLPCE",106,0)
+ N EDPLST,I,LST,TM,BEG,END,LOCS
+"RTN","EDPLPCE",107,0)
+ D GETLST^XPAR(.EDPLST,EDPSITE_";DIC(4,","EDPF LOCATION","Q")
+"RTN","EDPLPCE",108,0)
+ S TM=$E($P($$NOW^XLFDT,".",2)_"0000",1,4)
+"RTN","EDPLPCE",109,0)
+ ; put time ranges first, then sequence
+"RTN","EDPLPCE",110,0)
+ S I=0 F  S I=$O(EDPLST(I)) Q:'I  D
+"RTN","EDPLPCE",111,0)
+ . ; put sequence at end of list
+"RTN","EDPLPCE",112,0)
+ . I EDPLST(I)'["-" S LST(+EDPLST(I)*1000)=EDPLST(I),LOCS(+$P(EDPLST(I),U,2))="" Q
+"RTN","EDPLPCE",113,0)
+ . ; put time ranges at top of list
+"RTN","EDPLPCE",114,0)
+ . S BEG=+$P(EDPLST(I),"-"),END=+$P(EDPLST(I),"-",2)
+"RTN","EDPLPCE",115,0)
+ . I (TM<BEG)!(TM>END) Q  ; eliminating times that don't include NOW
+"RTN","EDPLPCE",116,0)
+ . S LST(I)=EDPLST(I),LOCS(+$P(EDPLST(I),U,2))=""
+"RTN","EDPLPCE",117,0)
+ ;
+"RTN","EDPLPCE",118,0)
+ ; look for visits to ED locations within the last hour
+"RTN","EDPLPCE",119,0)
+ N BACKTO,VTM,VLOC,LOC
+"RTN","EDPLPCE",120,0)
+ S BACKTO=$$FMADD^XLFDT($$NOW^XLFDT,0,-1),LOC=0
+"RTN","EDPLPCE",121,0)
+ I $G(DFN) D
+"RTN","EDPLPCE",122,0)
+ . S VTM="" F  S VTM=$O(^AUPNVSIT("AET",DFN,VTM),-1) Q:VTM<BACKTO  D
+"RTN","EDPLPCE",123,0)
+ .. S VLOC=0 F  S VLOC=$O(^AUPNVSIT("AET",DFN,VTM,VLOC)) Q:'VLOC  D  Q:LOC
+"RTN","EDPLPCE",124,0)
+ ... I $D(LOCS(VLOC)) S LOC=VLOC
+"RTN","EDPLPCE",125,0)
+ Q:LOC LOC
+"RTN","EDPLPCE",126,0)
+ ;
+"RTN","EDPLPCE",127,0)
+ ; otherwise, return the highest ranked location
+"RTN","EDPLPCE",128,0)
+ S I=$O(LST(0)) S:I LOC=$P(LST(I),U,2)
+"RTN","EDPLPCE",129,0)
+ Q LOC
+"RTN","EDPLPCE",130,0)
+ ;
+"RTN","EDPLPCE",131,0)
+TS4VISIT(DFN,LOC,TS) ; Return visit time if there is already a visit
+"RTN","EDPLPCE",132,0)
+ N BACKTO,VTM,VLOC,VCAT,NEWTS
+"RTN","EDPLPCE",133,0)
+ S BACKTO=$$FMADD^XLFDT($$NOW^XLFDT,0,-1),NEWTS=""
+"RTN","EDPLPCE",134,0)
+ S VTM="" F  S VTM=$O(^AUPNVSIT("AET",DFN,VTM),-1) Q:VTM<BACKTO  D
+"RTN","EDPLPCE",135,0)
+ . S VLOC=0 F  S VLOC=$O(^AUPNVSIT("AET",DFN,VTM,VLOC)) Q:'VLOC  Q:VLOC'=LOC  D
+"RTN","EDPLPCE",136,0)
+ .. S VCAT="" F  S VCAT=$O(^AUPNVSIT("AET",DFN,VTM,VLOC,VCAT)) Q:VCAT'="P"  D
+"RTN","EDPLPCE",137,0)
+ ... S NEWTS=VTM
+"RTN","EDPLPCE",138,0)
+ Q:NEWTS NEWTS
+"RTN","EDPLPCE",139,0)
+ Q TS
+"RTN","EDPLPCE",140,0)
+ ;
+"RTN","EDPLPCE",141,0)
+TEST ; Test creation of encounter
+"RTN","EDPLPCE",142,0)
+ N DFN S DFN=100679
+"RTN","EDPLPCE",143,0)
+ S LOC=$$GET^XPAR(DUZ(2)_";DIC(4,","EDPF LOCATION")
+"RTN","EDPLPCE",144,0)
+ ;
+"RTN","EDPLPCE",145,0)
+ N EDPKG,EDPSRC,OK
+"RTN","EDPLPCE",146,0)
+ S EDPKG=$O(^DIC(9.4,"B","EMERGENCY DEPARTMENT",0))
+"RTN","EDPLPCE",147,0)
+ S EDPSRC="EDP TRACKING LOG"
+"RTN","EDPLPCE",148,0)
+ S EDPDATA("ENCOUNTER",1,"PATIENT")=DFN
+"RTN","EDPLPCE",149,0)
+ S EDPDATA("ENCOUNTER",1,"HOS LOC")=LOC
+"RTN","EDPLPCE",150,0)
+ S EDPDATA("ENCOUNTER",1,"SERVICE CATEGORY")="A"
+"RTN","EDPLPCE",151,0)
+ S EDPDATA("ENCOUNTER",1,"ENCOUNTER TYPE")="P"
+"RTN","EDPLPCE",152,0)
+ S EDPDATA("ENCOUNTER",1,"ENC D/T")=$$NOW^XLFDT
+"RTN","EDPLPCE",153,0)
+ ;
+"RTN","EDPLPCE",154,0)
+ ;S EDPDATA("DX/PL",1,"DIAGNOSIS")=$O(^ICD9("BA","V70.3 ",0))
+"RTN","EDPLPCE",155,0)
+ ;S EDPDATA("PROCEDURE",1,"PROCEDURE")=$O(^ICPT("B","99201",0))
+"RTN","EDPLPCE",156,0)
+ S EDPDATA("PROVIDER",1,"NAME")=9066
+"RTN","EDPLPCE",157,0)
+ ;
+"RTN","EDPLPCE",158,0)
+ S OK=$$DATA2PCE^PXAPI("EDPDATA",EDPKG,EDPSRC,.EDPVISIT)
+"RTN","EDPLPCE",159,0)
+ Q
+"RTN","EDPMAIL")
+0^41^B7335309
+"RTN","EDPMAIL",1,0)
+EDPMAIL ;SLC/KCM - Process incoming mail for posted events
+"RTN","EDPMAIL",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPMAIL",3,0)
+ ;
+"RTN","EDPMAIL",4,0)
+MSG(MSG) ; parse message passed in from SEND^EDPFMON
+"RTN","EDPMAIL",5,0)
+ N I,PARAM,LOG,ORIFN,EDPDBUG
+"RTN","EDPMAIL",6,0)
+ S EDPDBUG=$$DEBUG^EDPCDBG("messages")
+"RTN","EDPMAIL",7,0)
+ I EDPDBUG D PUTREQ^EDPCDBG(EDPDBUG,.MSG)
+"RTN","EDPMAIL",8,0)
+ ;
+"RTN","EDPMAIL",9,0)
+ S I=0 F  S I=$O(MSG(I)) Q:'I  S PARAM($P(MSG(I),"="))=$P(MSG(I),"=",2,99)
+"RTN","EDPMAIL",10,0)
+ S LOG=$$VAL("id"),ORIFN=$$VAL("orifn")
+"RTN","EDPMAIL",11,0)
+ I $$VAL("command")="newOrder" D NEW
+"RTN","EDPMAIL",12,0)
+ I $$VAL("command")="updateOrder" D UPD
+"RTN","EDPMAIL",13,0)
+ I $$VAL("command")="deleteOrder" D DEL
+"RTN","EDPMAIL",14,0)
+ I $$VAL("command")="verifyOrder" D VER
+"RTN","EDPMAIL",15,0)
+ I $$VAL("command")="completeOrder" D COMP
+"RTN","EDPMAIL",16,0)
+ I $$VAL("command")="patientCheckIn" D CHKIN
+"RTN","EDPMAIL",17,0)
+ I $$VAL("command")="convertVisit" D VST^EDPCONV(.PARAM)
+"RTN","EDPMAIL",18,0)
+ I $$VAL("command")="convertConfiguration" D CONFIG^EDPCONV1(.PARAM)
+"RTN","EDPMAIL",19,0)
+ Q
+"RTN","EDPMAIL",20,0)
+ ;
+"RTN","EDPMAIL",21,0)
+NEW ; add new order
+"RTN","EDPMAIL",22,0)
+ Q:'LOG  Q:'ORIFN
+"RTN","EDPMAIL",23,0)
+ N X,Y,DIC,DA
+"RTN","EDPMAIL",24,0)
+ S DIC="^EDP(230,"_LOG_",8,",DIC(0)="LZ",DA(1)=LOG,X=+ORIFN
+"RTN","EDPMAIL",25,0)
+ S DIC("DR")=".02///"_$$VAL("pkg")_";.03///N;.05///"_$$VAL("release")
+"RTN","EDPMAIL",26,0)
+ S:$$VAL("stat") DIC("DR")=DIC("DR")_";.04///1"
+"RTN","EDPMAIL",27,0)
+ D FILE^DICN
+"RTN","EDPMAIL",28,0)
+ Q
+"RTN","EDPMAIL",29,0)
+UPD ; update order
+"RTN","EDPMAIL",30,0)
+ Q:'LOG  Q:'ORIFN  Q:'$L($$VAL("sts"))
+"RTN","EDPMAIL",31,0)
+ N IEN S IEN=$$FIND Q:IEN<1
+"RTN","EDPMAIL",32,0)
+ I $D(^EDP(230,LOG,8,+IEN,0)) S $P(^(0),U,3)=$$VAL("sts")
+"RTN","EDPMAIL",33,0)
+ Q
+"RTN","EDPMAIL",34,0)
+DEL ; delete order
+"RTN","EDPMAIL",35,0)
+ Q:'LOG  Q:'ORIFN
+"RTN","EDPMAIL",36,0)
+ N DIK,DA
+"RTN","EDPMAIL",37,0)
+ S DA=$$FIND Q:DA<1
+"RTN","EDPMAIL",38,0)
+ S DIK="^EDP(230,"_LOG_",8,",DA(1)=LOG
+"RTN","EDPMAIL",39,0)
+ D ^DIK
+"RTN","EDPMAIL",40,0)
+ Q
+"RTN","EDPMAIL",41,0)
+VER ; verify order
+"RTN","EDPMAIL",42,0)
+ Q:'LOG  Q:'ORIFN
+"RTN","EDPMAIL",43,0)
+ N IEN S IEN=$$FIND Q:IEN<1
+"RTN","EDPMAIL",44,0)
+ I $P($G(^EDP(230,LOG,8,IEN,0)),U,3)'="C" S $P(^(0),U,3)="A"
+"RTN","EDPMAIL",45,0)
+ Q
+"RTN","EDPMAIL",46,0)
+COMP ; complete order
+"RTN","EDPMAIL",47,0)
+ Q:'LOG  Q:'ORIFN
+"RTN","EDPMAIL",48,0)
+ N IEN S IEN=$$FIND Q:IEN<1
+"RTN","EDPMAIL",49,0)
+ S $P(^EDP(230,LOG,8,IEN,0),U,3)="C"
+"RTN","EDPMAIL",50,0)
+ Q
+"RTN","EDPMAIL",51,0)
+ ;
+"RTN","EDPMAIL",52,0)
+FIND() ; -- return ien of ORIFN in multiple
+"RTN","EDPMAIL",53,0)
+ N Y S Y=+$O(^EDP(230,LOG,8,"B",+ORIFN,0))
+"RTN","EDPMAIL",54,0)
+ Q Y
+"RTN","EDPMAIL",55,0)
+ ;
+"RTN","EDPMAIL",56,0)
+VAL(X) ; -- return parameter value or null if undefined
+"RTN","EDPMAIL",57,0)
+ Q $G(PARAM(X))
+"RTN","EDPMAIL",58,0)
+ ;
+"RTN","EDPMAIL",59,0)
+CHKIN ; check in a patient
+"RTN","EDPMAIL",60,0)
+ Q:'$$VAL("dfn")  Q:'$$VAL("ssn")  Q:'$L($$VAL("ptNm"))  Q:'$L($$VAL("site"))
+"RTN","EDPMAIL",61,0)
+ N NEWPT
+"RTN","EDPMAIL",62,0)
+ S NEWPT="dfn="_$$VAL("dfn")_$C(9)_"name="_$$VAL("ptNm")_$C(9)_"dob="_$$VAL("dob")_$C(9)_"ssn="_$$VAL("ssn")_$C(9)_"clinic="_$$VAL("hloc")
+"RTN","EDPMAIL",63,0)
+ S NEWPT=NEWPT_$C(9)_"create=1"  ; set Creation Source to Scheduling
+"RTN","EDPMAIL",64,0)
+ N AREA
+"RTN","EDPMAIL",65,0)
+ S AREA=$O(^EDPB(231.9,"C",$$VAL("site"),0)) Q:'AREA
+"RTN","EDPMAIL",66,0)
+ N EDPXML,EDPSITE,EDPSTA
+"RTN","EDPMAIL",67,0)
+ S EDPUSER=DUZ,EDPSITE=DUZ(2),EDPSTA=$$STA^XUAF4(DUZ(2))
+"RTN","EDPMAIL",68,0)
+ D ADD^EDPLOGA(NEWPT,AREA,$$VAL("time"),0)
+"RTN","EDPMAIL",69,0)
+ Q
+"RTN","EDPQAR")
+0^42^B6639632
+"RTN","EDPQAR",1,0)
+EDPQAR ;SLC/KCM - Log Area Information
+"RTN","EDPQAR",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPQAR",3,0)
+ ;
+"RTN","EDPQAR",4,0)
+PARAM(AREA) ; return parameters for area
+"RTN","EDPQAR",5,0)
+ N X,X1
+"RTN","EDPQAR",6,0)
+ S X1=$G(^EDPB(231.9,AREA,1))
+"RTN","EDPQAR",7,0)
+ S X("reqDiag")=+$P(X1,U,1)
+"RTN","EDPQAR",8,0)
+ S X("codedDiag")=+$P(X1,U,2)
+"RTN","EDPQAR",9,0)
+ S X("reqDisp")=+$P(X1,U,3)
+"RTN","EDPQAR",10,0)
+ S X("reqDelay")=+$P(X1,U,4)
+"RTN","EDPQAR",11,0)
+ S X("minDelay")=+$P(X1,U,5)
+"RTN","EDPQAR",12,0)
+ S X("residents")=+$P(X1,U,8)
+"RTN","EDPQAR",13,0)
+ S X("clinics")=+$P(X1,U,9)
+"RTN","EDPQAR",14,0)
+ S X("emptyIEN")=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0))
+"RTN","EDPQAR",15,0)
+ S X("errorIEN")=+$O(^EDPB(233.1,"B","edp.disposition.error",0))
+"RTN","EDPQAR",16,0)
+ S X("evalIEN")=+$O(^EDPB(233.1,"B","edp.disposition.nec",0))
+"RTN","EDPQAR",17,0)
+ S X("leftIEN")=+$O(^EDPB(233.1,"B","edp.disposition.left",0))
+"RTN","EDPQAR",18,0)
+ D XML^EDPX($$XMLA^EDPX("params",.X))
+"RTN","EDPQAR",19,0)
+ Q
+"RTN","EDPQAR",20,0)
+ ; BYPASS & LSTIENS not implemented yet, perhaps in T25?
+"RTN","EDPQAR",21,0)
+ ; This would require changing the params VO to have a list
+"RTN","EDPQAR",22,0)
+ ; of IEN's that would be checked when enabling the remove from
+"RTN","EDPQAR",23,0)
+ ; board button.  EDPLOG would also need to check the flags of
+"RTN","EDPQAR",24,0)
+ ; the disposition when validating in RDY2RMV
+"RTN","EDPQAR",25,0)
+BYPASS(AREA) ; list IEN's for bypass dispositions
+"RTN","EDPQAR",26,0)
+ N ROOT
+"RTN","EDPQAR",27,0)
+ D XML^EDPX("<bypassRemoveChecks>")
+"RTN","EDPQAR",28,0)
+ S ROOT="edp.disposition" D LSTIENS(ROOT)
+"RTN","EDPQAR",29,0)
+ S ROOT=EDPSTA_".disposition" D LSTIENS(ROOT)
+"RTN","EDPQAR",30,0)
+ D XML^EDPX("</bypassRemoveChecks>")
+"RTN","EDPQAR",31,0)
+ Q
+"RTN","EDPQAR",32,0)
+LSTIENS(ROOT) ; list IEN's that should bypass remove-from-board checks
+"RTN","EDPQAR",33,0)
+ N X,IEN,FLAGS
+"RTN","EDPQAR",34,0)
+ S X=ROOT F  S X=$O(^EDPB(233.1,"B",X)) Q:$E(X,1,$L(ROOT))'=ROOT  D
+"RTN","EDPQAR",35,0)
+ . S IEN=0 F  S IEN=$O(^EDPB(233.1,"B",X,IEN)) Q:'IEN  D
+"RTN","EDPQAR",36,0)
+ .. S FLAGS=$P(^EDPB(233.1,IEN,0),U,5) Q:FLAGS'["B"
+"RTN","EDPQAR",37,0)
+ .. D XML^EDPX("<ien>"_IEN_"</ien>")
+"RTN","EDPQAR",38,0)
+ Q
+"RTN","EDPQAR",39,0)
+DFLTAREA(AREA) ; return the default area for a site
+"RTN","EDPQAR",40,0)
+ N X,DFLT
+"RTN","EDPQAR",41,0)
+ I $L($G(AREA)),(+AREA'=AREA) D
+"RTN","EDPQAR",42,0)
+ . S AREA=$O(^EDPB(231.9,"B",AREA,0))
+"RTN","EDPQAR",43,0)
+ . ; need to check for matching site!!
+"RTN","EDPQAR",44,0)
+ S DFLT=$S($G(AREA):AREA,1:$O(^EDPB(231.9,"C",EDPSITE,0)))
+"RTN","EDPQAR",45,0)
+ ;
+"RTN","EDPQAR",46,0)
+ I 'DFLT D ADDAREA S DFLT=$O(^EDPB(231.9,"C",EDPSITE,0))
+"RTN","EDPQAR",47,0)
+ S X("area")=DFLT
+"RTN","EDPQAR",48,0)
+ I X("area") S X("areaNm")=$P(^EDPB(231.9,X("area"),0),U)
+"RTN","EDPQAR",49,0)
+ S X("version")=$$VERSRV
+"RTN","EDPQAR",50,0)
+ D XML^EDPX($$XMLA^EDPX("user",.X))
+"RTN","EDPQAR",51,0)
+ Q
+"RTN","EDPQAR",52,0)
+ADDAREA ; add area if none is defined for this site
+"RTN","EDPQAR",53,0)
+ N FDA,FDAIEN,DIERR,ERR
+"RTN","EDPQAR",54,0)
+ S FDA(231.9,"+1,",.01)="Emergency Department"
+"RTN","EDPQAR",55,0)
+ S FDA(231.9,"+1,",.02)=EDPSITE
+"RTN","EDPQAR",56,0)
+ D UPDATE^DIE("","FDA","FDAIEN","ERR")
+"RTN","EDPQAR",57,0)
+ Q:$D(DIERR)
+"RTN","EDPQAR",58,0)
+ ;
+"RTN","EDPQAR",59,0)
+ N AREA S AREA=FDAIEN(1)
+"RTN","EDPQAR",60,0)
+ D RESET^EDPBRS(AREA)
+"RTN","EDPQAR",61,0)
+ Q
+"RTN","EDPQAR",62,0)
+VERSRV()   ; Return server version of option name
+"RTN","EDPQAR",63,0)
+ N EDPLST,VAL
+"RTN","EDPQAR",64,0)
+ D FIND^DIC(19,"",1,"X","EDPF TRACKING SYSTEM",1,,,,"EDPLST")
+"RTN","EDPQAR",65,0)
+ S VAL=$G(EDPLST("DILIST","ID",1,1))
+"RTN","EDPQAR",66,0)
+ S VAL=$P(VAL,"version ",2)
+"RTN","EDPQAR",67,0)
+ I 'VAL Q "1.0T?"
+"RTN","EDPQAR",68,0)
+ Q VAL
+"RTN","EDPQDB")
+0^43^B37231235
+"RTN","EDPQDB",1,0)
+EDPQDB ;SLC/KCM - Display Active Log Entries
+"RTN","EDPQDB",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPQDB",3,0)
+ ;
+"RTN","EDPQDB",4,0)
+GET(AREA,BOARD,LAST) ; Get display board contents
+"RTN","EDPQDB",5,0)
+ ;I $G(^EDPB(231.9,AREA,230))=TOKEN D XML^EDPX("<rows status='same' />") Q
+"RTN","EDPQDB",6,0)
+ ;
+"RTN","EDPQDB",7,0)
+ N EDPTIME S EDPTIME=$$NOW^XLFDT
+"RTN","EDPQDB",8,0)
+ N SEQ,BED,LOG,BEDS,DWHEN,DUP,ACU,LSTUPD,RELOAD,ATT
+"RTN","EDPQDB",9,0)
+ ;
+"RTN","EDPQDB",10,0)
+ S LSTUPD=$P($G(^EDPB(231.9,AREA,0)),U,3),RELOAD="true",LAST=$G(LAST)
+"RTN","EDPQDB",11,0)
+ I (LAST="")!(LAST=LSTUPD) S RELOAD="false"
+"RTN","EDPQDB",12,0)
+ S ATT("status")="new"
+"RTN","EDPQDB",13,0)
+ S ATT("reloadConfig")=RELOAD
+"RTN","EDPQDB",14,0)
+ S ATT("configLastUpdated")=LSTUPD
+"RTN","EDPQDB",15,0)
+ S ATT("version")=$$VERSRV^EDPQAR
+"RTN","EDPQDB",16,0)
+ D XML^EDPX($$XMLA^EDPX("rows",.ATT,""))
+"RTN","EDPQDB",17,0)
+ ;
+"RTN","EDPQDB",18,0)
+ ; Get a list of all the beds in sequence for this area
+"RTN","EDPQDB",19,0)
+ S BOARD=$G(BOARD)
+"RTN","EDPQDB",20,0)
+ S BED=0 F  S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED  D
+"RTN","EDPQDB",21,0)
+ . S SEQ=$P(^EDPB(231.8,BED,0),U,5) S:'SEQ SEQ=99999
+"RTN","EDPQDB",22,0)
+ . Q:$P(^EDPB(231.8,BED,0),U,4)  ; inactive bed
+"RTN","EDPQDB",23,0)
+ . S BEDS(SEQ,BED)="",BEDS("B",BED,SEQ)=""
+"RTN","EDPQDB",24,0)
+ ;
+"RTN","EDPQDB",25,0)
+ ; Insert the active log entries into the correct sequence for the beds 
+"RTN","EDPQDB",26,0)
+ S BED=0 F  S BED=$O(^EDP(230,"AL",EDPSITE,AREA,BED)) Q:'BED  D
+"RTN","EDPQDB",27,0)
+ . S LOG=0 F  S LOG=$O(^EDP(230,"AL",EDPSITE,AREA,BED,LOG)) Q:'LOG  D
+"RTN","EDPQDB",28,0)
+ . . I '$D(BEDS("B",BED)) S BEDS(99999,BED)="",BEDS("B",BED,99999)=""
+"RTN","EDPQDB",29,0)
+ . . S SEQ=$O(BEDS("B",BED,0))
+"RTN","EDPQDB",30,0)
+ . . S ACU=$P($G(^EDP(230,LOG,3)),U,3) S:'ACU ACU=99
+"RTN","EDPQDB",31,0)
+ . . S BEDS(SEQ,BED,ACU,LOG)=""
+"RTN","EDPQDB",32,0)
+ ;
+"RTN","EDPQDB",33,0)
+ ; Loop thru the sequence of beds to create display board rows
+"RTN","EDPQDB",34,0)
+ D BLDDUP^EDPQLP(.DUP,AREA)
+"RTN","EDPQDB",35,0)
+ S SEQ=0 F  S SEQ=$O(BEDS(SEQ)) Q:'SEQ  D
+"RTN","EDPQDB",36,0)
+ . S BED=0 F  S BED=$O(BEDS(SEQ,BED)) Q:'BED  D
+"RTN","EDPQDB",37,0)
+ . . I $L(BOARD),($P(^EDPB(231.8,BED,0),U,11)'=BOARD) Q
+"RTN","EDPQDB",38,0)
+ . . S DWHEN=$P(^EDPB(231.8,BED,0),U,7)
+"RTN","EDPQDB",39,0)
+ . . ; never display DWHEN=2
+"RTN","EDPQDB",40,0)
+ . . Q:DWHEN=2
+"RTN","EDPQDB",41,0)
+ . . ; always display DWHEN=1
+"RTN","EDPQDB",42,0)
+ . . I ($D(BEDS(SEQ,BED))<10)&(DWHEN=1) D EMPTY(BED) Q
+"RTN","EDPQDB",43,0)
+ . . ; display if occupied DWHEN=0
+"RTN","EDPQDB",44,0)
+ . . S ACU=0 F  S ACU=$O(BEDS(SEQ,BED,ACU)) Q:'ACU  D
+"RTN","EDPQDB",45,0)
+ . . . S LOG=0 F  S LOG=$O(BEDS(SEQ,BED,ACU,LOG)) Q:'LOG  D OCCUPIED(LOG,.DUP)
+"RTN","EDPQDB",46,0)
+ ;
+"RTN","EDPQDB",47,0)
+ D XML^EDPX("</rows>")
+"RTN","EDPQDB",48,0)
+ Q
+"RTN","EDPQDB",49,0)
+EMPTY(BED) ; add row if unoccupied be should show
+"RTN","EDPQDB",50,0)
+ N ROW
+"RTN","EDPQDB",51,0)
+ S ROW("bed")=BED
+"RTN","EDPQDB",52,0)
+ S ROW("bedNm")=$P(^EDPB(231.8,BED,0),U,6)
+"RTN","EDPQDB",53,0)
+ D XML^EDPX($$XMLA^EDPX("row",.ROW))
+"RTN","EDPQDB",54,0)
+ Q
+"RTN","EDPQDB",55,0)
+OCCUPIED(LOG,DUP) ; add log entry row
+"RTN","EDPQDB",56,0)
+ N X0,X1,X3,ROW
+"RTN","EDPQDB",57,0)
+ S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3))
+"RTN","EDPQDB",58,0)
+ S ROW("id")=LOG
+"RTN","EDPQDB",59,0)
+ S ROW("bed")=BED
+"RTN","EDPQDB",60,0)
+ S ROW("bedNm")=$P(^EDPB(231.8,BED,0),U,6)
+"RTN","EDPQDB",61,0)
+ S ROW("ptNm")=$P($P(X0,U,4),",")
+"RTN","EDPQDB",62,0)
+ S ROW("last4")=$P(X0,U,11)
+"RTN","EDPQDB",63,0)
+ S ROW("visit")=($P(X0,U,12)!$P(X0,U,13))
+"RTN","EDPQDB",64,0)
+ S ROW("clinic")=$P(X0,U,14)
+"RTN","EDPQDB",65,0)
+ S ROW("clinicNm")=$$LOCNM($P(X0,U,14))
+"RTN","EDPQDB",66,0)
+ S ROW("complaint")=$P(X1,U,1)
+"RTN","EDPQDB",67,0)
+ S ROW("comment")=$P(X3,U,8)
+"RTN","EDPQDB",68,0)
+ S ROW("md")=$P(X3,U,5)
+"RTN","EDPQDB",69,0)
+ S ROW("mdNm")=$$INITIAL($P(X3,U,5))
+"RTN","EDPQDB",70,0)
+ S ROW("rn")=$P(X3,U,6)
+"RTN","EDPQDB",71,0)
+ S ROW("rnNm")=$$INITIAL($P(X3,U,6))
+"RTN","EDPQDB",72,0)
+ S ROW("res")=$P(X3,U,7)
+"RTN","EDPQDB",73,0)
+ S ROW("resNm")=$$INITIAL($P(X3,U,7))
+"RTN","EDPQDB",74,0)
+ S ROW("status")=$P(X3,U,2)
+"RTN","EDPQDB",75,0)
+ S ROW("statusNm")=$$CAB(EDPSTA_".status",$P(X3,U,2))
+"RTN","EDPQDB",76,0)
+ S ROW("acuity")=$P(X3,U,3)
+"RTN","EDPQDB",77,0)
+ S ROW("acuityNm")=$$CAB(EDPSTA_".acuity",$P(X3,U,3))
+"RTN","EDPQDB",78,0)
+ S ROW("emins")=$$HHMM($$MIN($P(X0,U,8)))
+"RTN","EDPQDB",79,0)
+ S ROW("lmins")=$$HHMM($$LMIN(LOG))
+"RTN","EDPQDB",80,0)
+ S ROW("similar")=$$SIM^EDPQLP(ROW("ptNm"),ROW("last4"),.DUP)
+"RTN","EDPQDB",81,0)
+ ;
+"RTN","EDPQDB",82,0)
+ N STS D ORDSTS(LOG,.STS)
+"RTN","EDPQDB",83,0)
+ S ROW("lab")=STS("LP")_"/"_STS("LC")             ; lab pending / lab complete
+"RTN","EDPQDB",84,0)
+ S ROW("labUrg")=$S(STS("LS"):2,STS("LP"):1,1:0)  ; any STAT labs?
+"RTN","EDPQDB",85,0)
+ S ROW("rad")=STS("RP")_"/"_STS("RC")             ; img pending / img complete
+"RTN","EDPQDB",86,0)
+ S ROW("radUrg")=$S(STS("RS"):2,STS("RP"):1,1:0)  ; any STAT imgs?
+"RTN","EDPQDB",87,0)
+ S ROW("ordNew")=STS("ON")                        ; number of new orders
+"RTN","EDPQDB",88,0)
+ S ROW("minLab")=STS("LO")                        ; oldest pending/active lab
+"RTN","EDPQDB",89,0)
+ S ROW("minRad")=STS("RO")                        ; oldest pending/active img
+"RTN","EDPQDB",90,0)
+ S ROW("minVer")=STS("OO")                        ; oldest "new" order
+"RTN","EDPQDB",91,0)
+ D XML^EDPX($$XMLA^EDPX("row",.ROW))
+"RTN","EDPQDB",92,0)
+ Q
+"RTN","EDPQDB",93,0)
+INITIAL(LOCID) ; Return initials
+"RTN","EDPQDB",94,0)
+ Q:'LOCID ""
+"RTN","EDPQDB",95,0)
+ Q $P(^VA(200,LOCID,0),U,2)
+"RTN","EDPQDB",96,0)
+ ;
+"RTN","EDPQDB",97,0)
+LOCNM(LOC) ; Return clinic name from 44
+"RTN","EDPQDB",98,0)
+ Q:'LOC ""
+"RTN","EDPQDB",99,0)
+ N X S X=$G(^SC(LOC,0))  ; IA#10040
+"RTN","EDPQDB",100,0)
+ Q:'$L(X) ""
+"RTN","EDPQDB",101,0)
+ I $L($P(X,U,2)) Q $P(X,U,2)
+"RTN","EDPQDB",102,0)
+ Q $P(X,U)
+"RTN","EDPQDB",103,0)
+ ;
+"RTN","EDPQDB",104,0)
+CAB(LST,IEN) ; Return code abbreviation
+"RTN","EDPQDB",105,0)
+ Q:'IEN ""
+"RTN","EDPQDB",106,0)
+ N LSTDA,ABB,XSITE,XNATL
+"RTN","EDPQDB",107,0)
+ S LSTDA=$O(^EDPB(233.2,"AS",LST,IEN,0))
+"RTN","EDPQDB",108,0)
+ S ABB="",XSITE="",XNATL=""
+"RTN","EDPQDB",109,0)
+ I LSTDA S XSITE=^EDPB(233.2,"AS",LST,IEN,LSTDA)
+"RTN","EDPQDB",110,0)
+ S ABB=$P(XSITE,U,1) Q:$L(ABB) ABB  ;site abbreviation
+"RTN","EDPQDB",111,0)
+ S XNATL=^EDPB(233.1,IEN,0)
+"RTN","EDPQDB",112,0)
+ S ABB=$P(XNATL,U,3) Q:$L(ABB) ABB  ;nat'l abbreviation
+"RTN","EDPQDB",113,0)
+ S ABB=$P(XSITE,U,2) Q:$L(ABB) ABB  ;site name
+"RTN","EDPQDB",114,0)
+ S ABB=$P(XNATL,U,2) Q:$L(ABB) ABB  ;nat'l name
+"RTN","EDPQDB",115,0)
+ Q ""
+"RTN","EDPQDB",116,0)
+ ;
+"RTN","EDPQDB",117,0)
+MIN(START) ; Return elapse time
+"RTN","EDPQDB",118,0)
+ I 'START Q ""
+"RTN","EDPQDB",119,0)
+ Q $$FMDIFF^XLFDT(EDPTIME,START,2)\60
+"RTN","EDPQDB",120,0)
+ ;
+"RTN","EDPQDB",121,0)
+LMIN(LOG) ; Return time at location
+"RTN","EDPQDB",122,0)
+ N IEN,TS,TM S TM=0
+"RTN","EDPQDB",123,0)
+ S TS="" F  S TS=$O(^EDP(230.1,"ADF",LOG,TS),-1) Q:'TS  D  Q:TM
+"RTN","EDPQDB",124,0)
+ . S IEN=0 F  S IEN=$O(^EDP(230.1,"ADF",LOG,TS,IEN)) Q:'IEN  D  Q:TM
+"RTN","EDPQDB",125,0)
+ . . I +$P($G(^EDP(230.1,IEN,3)),U,4) S TM=$P($G(^EDP(230.1,IEN,0)),U,2)
+"RTN","EDPQDB",126,0)
+ I TM Q $$FMDIFF^XLFDT(EDPTIME,TM,2)\60
+"RTN","EDPQDB",127,0)
+ Q 0
+"RTN","EDPQDB",128,0)
+ ;
+"RTN","EDPQDB",129,0)
+HHMM(MIN) ; Format as hours:minutes
+"RTN","EDPQDB",130,0)
+ Q MIN  ;(the colon messed up the calculations for elapsed time)
+"RTN","EDPQDB",131,0)
+ ;
+"RTN","EDPQDB",132,0)
+ N H,M
+"RTN","EDPQDB",133,0)
+ S H=MIN\60,M=MIN#60
+"RTN","EDPQDB",134,0)
+ S:$L(M)=1 M="0"_M
+"RTN","EDPQDB",135,0)
+ Q H_":"_M
+"RTN","EDPQDB",136,0)
+ ;
+"RTN","EDPQDB",137,0)
+ORDSTS(LOG,STS) ; compute statuses of orders
+"RTN","EDPQDB",138,0)
+ N IEN,X0
+"RTN","EDPQDB",139,0)
+ S STS("OO")=9999999,STS("ON")=0 ; oldest order, new orders
+"RTN","EDPQDB",140,0)
+ S STS("LP")=0,STS("LO")=9999999,STS("LS")=0,STS("LC")=0
+"RTN","EDPQDB",141,0)
+ S STS("RP")=0,STS("RO")=9999999,STS("RS")=0,STS("RC")=0
+"RTN","EDPQDB",142,0)
+ S IEN=0 F  S IEN=$O(^EDP(230,LOG,8,IEN)) Q:'IEN  D
+"RTN","EDPQDB",143,0)
+ . S X0=^EDP(230,LOG,8,IEN,0)
+"RTN","EDPQDB",144,0)
+ . I ($P(X0,U,3)="N")!($P(X0,U,3)="A") D
+"RTN","EDPQDB",145,0)
+ . . I $P(X0,U,5)<STS("OO") S STS("OO")=$P(X0,U,5)      ; oldest order
+"RTN","EDPQDB",146,0)
+ . . I $P(X0,U,2)="L" D
+"RTN","EDPQDB",147,0)
+ . . . S STS("LP")=STS("LP")+1                          ; pending labs
+"RTN","EDPQDB",148,0)
+ . . . I $P(X0,U,5)<STS("LO") S STS("LO")=$P(X0,U,5)    ; oldest lab
+"RTN","EDPQDB",149,0)
+ . . . I $P(X0,U,4) S STS("LS")=1                       ; stat lab
+"RTN","EDPQDB",150,0)
+ . . I $P(X0,U,2)="R" D
+"RTN","EDPQDB",151,0)
+ . . . S STS("RP")=STS("RP")+1                          ; pending radiology
+"RTN","EDPQDB",152,0)
+ . . . I $P(X0,U,5)<STS("RO") S STS("RO")=$P(X0,U,5)    ; oldest radiology
+"RTN","EDPQDB",153,0)
+ . . . I $P(X0,U,4) S STS("RS")=1                       ; stat radiology
+"RTN","EDPQDB",154,0)
+ . I $P(X0,U,3)="N" S STS("ON")=STS("ON")+1
+"RTN","EDPQDB",155,0)
+ . I $P(X0,U,3)="C" D
+"RTN","EDPQDB",156,0)
+ . . I $P(X0,U,2)="L" S STS("LC")=STS("LC")+1           ; completed labs
+"RTN","EDPQDB",157,0)
+ . . I $P(X0,U,2)="R" S STS("RC")=STS("RC")+1           ; completed radiology
+"RTN","EDPQDB",158,0)
+ S STS("OO")=$S(STS("OO")=9999999:0,1:$$MIN(STS("OO")))
+"RTN","EDPQDB",159,0)
+ S STS("LO")=$S(STS("LO")=9999999:0,1:$$MIN(STS("LO")))
+"RTN","EDPQDB",160,0)
+ S STS("RO")=$S(STS("RO")=9999999:0,1:$$MIN(STS("RO")))
+"RTN","EDPQDB",161,0)
+ Q
+"RTN","EDPQDBS")
+0^44^B3113182
+"RTN","EDPQDBS",1,0)
+EDPQDBS ;SLC/KCM - Display Board Specs
+"RTN","EDPQDBS",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPQDBS",3,0)
+ ;
+"RTN","EDPQDBS",4,0)
+GET(AREA,BOARD) ; Get Display Board Specs
+"RTN","EDPQDBS",5,0)
+ ;N I S I=0
+"RTN","EDPQDBS",6,0)
+ ;F  S I=$O(^EDPB(231.9,AREA,2,I)) Q:'I  D XML^EDPX(^EDPB(231.9,AREA,2,I,0))
+"RTN","EDPQDBS",7,0)
+ I '$L($G(BOARD)) S BOARD="Main (default)"
+"RTN","EDPQDBS",8,0)
+ S BOARD=$O(^EDPB(231.9,AREA,4,"B",BOARD,0))
+"RTN","EDPQDBS",9,0)
+ D LOADBRD^EDPBCF(AREA,BOARD)
+"RTN","EDPQDBS",10,0)
+ ;
+"RTN","EDPQDBS",11,0)
+ D XML^EDPX("<colorSpec>")
+"RTN","EDPQDBS",12,0)
+ D CLRBED(AREA)
+"RTN","EDPQDBS",13,0)
+ D CLRSTAFF(AREA,"md","P")
+"RTN","EDPQDBS",14,0)
+ D CLRSTAFF(AREA,"res","R")
+"RTN","EDPQDBS",15,0)
+ D CLRSTAFF(AREA,"rn","N")
+"RTN","EDPQDBS",16,0)
+ N I S I=0
+"RTN","EDPQDBS",17,0)
+ F  S I=$O(^EDPB(231.9,AREA,3,I)) Q:'I  D XML^EDPX(^EDPB(231.9,AREA,3,I,0))
+"RTN","EDPQDBS",18,0)
+ D XML^EDPX("</colorSpec>")
+"RTN","EDPQDBS",19,0)
+ Q
+"RTN","EDPQDBS",20,0)
+CLRBED(AREA) ; add bed colors
+"RTN","EDPQDBS",21,0)
+ D XML^EDPX("<colors id='bed' type='bed' >")
+"RTN","EDPQDBS",22,0)
+ N BED
+"RTN","EDPQDBS",23,0)
+ S BED=0 F  S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED  D
+"RTN","EDPQDBS",24,0)
+ . S X0=^EDPB(231.8,BED,0)
+"RTN","EDPQDBS",25,0)
+ . I $P(X0,U,12)="" Q
+"RTN","EDPQDBS",26,0)
+ . N X
+"RTN","EDPQDBS",27,0)
+ . S X("att")="@bed"
+"RTN","EDPQDBS",28,0)
+ . S X("clr")=$P(X0,U,12)
+"RTN","EDPQDBS",29,0)
+ . S X("val")=BED
+"RTN","EDPQDBS",30,0)
+ . D XML^EDPX($$XMLA^EDPX("map",.X))
+"RTN","EDPQDBS",31,0)
+ D XML^EDPX("</colors>")
+"RTN","EDPQDBS",32,0)
+ Q
+"RTN","EDPQDBS",33,0)
+CLRSTAFF(AREA,ROLEID,ROLE) ; add staff colors
+"RTN","EDPQDBS",34,0)
+ D XML^EDPX("<colors id='"_ROLEID_"' type='staff' >")
+"RTN","EDPQDBS",35,0)
+ N IEN
+"RTN","EDPQDBS",36,0)
+ S IEN="" F  S IEN=$O(^EDPB(231.7,"AC",EDPSITE,AREA,ROLE,IEN)) Q:'IEN  D
+"RTN","EDPQDBS",37,0)
+ . S X0=^EDPB(231.7,IEN,0) Q:'$P(X0,U,8)
+"RTN","EDPQDBS",38,0)
+ . N X
+"RTN","EDPQDBS",39,0)
+ . S X("att")=$S(ROLE="P":"@md",ROLE="N":"@rn",ROLE="R":"@res",1:"nop")
+"RTN","EDPQDBS",40,0)
+ . S X("clr")=$P(X0,U,8)
+"RTN","EDPQDBS",41,0)
+ . S X("val")=$P(X0,U)
+"RTN","EDPQDBS",42,0)
+ . D XML^EDPX($$XMLA^EDPX("map",.X))
+"RTN","EDPQDBS",43,0)
+ D XML^EDPX("</colors>")
+"RTN","EDPQDBS",44,0)
+ Q
+"RTN","EDPQLE")
+0^45^B40300302
+"RTN","EDPQLE",1,0)
+EDPQLE ;SLC/KCM - Retrieve Log Entry
+"RTN","EDPQLE",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPQLE",3,0)
+ ;
+"RTN","EDPQLE",4,0)
+GET(LOG,CHOICES) ; Get a log entry by request
+"RTN","EDPQLE",5,0)
+ N CURBED,CURVAL,PERSON,CODED,CHTS,CHLOAD,CLINIC
+"RTN","EDPQLE",6,0)
+ S AREA=$P(^EDP(230,LOG,0),U,3)
+"RTN","EDPQLE",7,0)
+ S CHTS=$P($G(^EDPB(231.9,AREA,231)),U),CHLOAD=(CHTS'=CHOICES)
+"RTN","EDPQLE",8,0)
+ N EDPTIME S EDPTIME=$$NOW^XLFDT
+"RTN","EDPQLE",9,0)
+ N EDPNOVAL S EDPNOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0))
+"RTN","EDPQLE",10,0)
+ D LOG(LOG)
+"RTN","EDPQLE",11,0)
+ D XML^EDPX("<choices ts='"_CHTS_"' >")
+"RTN","EDPQLE",12,0)
+ D BEDS,PERSONS,CODED,CLINICS
+"RTN","EDPQLE",13,0)
+ D:CHLOAD CHOICES^EDPQLE1(AREA)
+"RTN","EDPQLE",14,0)
+ D CLINLST^EDPQLE1($P(^EDP(230,LOG,0),U,14)) ; time-sensitive, get every time
+"RTN","EDPQLE",15,0)
+ D XML^EDPX("</choices>")
+"RTN","EDPQLE",16,0)
+ Q
+"RTN","EDPQLE",17,0)
+LOG(LOG) ; return the log entry as XML
+"RTN","EDPQLE",18,0)
+ N X,X0,X1,X3
+"RTN","EDPQLE",19,0)
+ ;
+"RTN","EDPQLE",20,0)
+ L +^EDP(230,LOG):3
+"RTN","EDPQLE",21,0)
+ S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3))
+"RTN","EDPQLE",22,0)
+ S X("loadTS")=$$NOW^XLFDT
+"RTN","EDPQLE",23,0)
+ L -^EDP(230,LOG)
+"RTN","EDPQLE",24,0)
+ ;
+"RTN","EDPQLE",25,0)
+ ; Set up encounter info into ^TMP if necessary so we can use it later
+"RTN","EDPQLE",26,0)
+ ;   see if visit present, if diagnosis coded or missing provider
+"RTN","EDPQLE",27,0)
+ I $P(X0,U,12),($P($G(^EDPB(231.9,AREA,1)),U,2)!('$P(X3,U,5))) D
+"RTN","EDPQLE",28,0)
+ . K ^TMP("PXKENC",$J)
+"RTN","EDPQLE",29,0)
+ . D ENCEVENT^PXAPI($P(X0,U,12))
+"RTN","EDPQLE",30,0)
+ ;
+"RTN","EDPQLE",31,0)
+ ; Get Provider from PCE if we don't have one
+"RTN","EDPQLE",32,0)
+ ;    this is commented out for now since we don't have a way to
+"RTN","EDPQLE",33,0)
+ ;    let the user know the provider was pulled in and needed to be saved
+"RTN","EDPQLE",34,0)
+ ; I '$P(X3,U,5),$P(X0,U,12) S X("md")=$$PRIMPCE($P(X0,U,12)),PERSON("provider")=X("md")
+"RTN","EDPQLE",35,0)
+ ;
+"RTN","EDPQLE",36,0)
+ S X("id")=LOG
+"RTN","EDPQLE",37,0)
+ S X("site")=$P(X0,U,2)
+"RTN","EDPQLE",38,0)
+ S X("area")=$P(X0,U,3)
+"RTN","EDPQLE",39,0)
+ S X("name")=$P(X0,U,4)
+"RTN","EDPQLE",40,0)
+ S X("dfn")=$P(X0,U,6)
+"RTN","EDPQLE",41,0)
+ S X("ssn")=$S(X("dfn"):$P(^DPT(X("dfn"),0),U,9),1:"")
+"RTN","EDPQLE",42,0)
+ S X("dob")=$$DOB(X("dfn"))
+"RTN","EDPQLE",43,0)
+ S X("closed")=$P(X0,U,7)
+"RTN","EDPQLE",44,0)
+ S X("inTS")=$P(X0,U,8)
+"RTN","EDPQLE",45,0)
+ S X("outTS")=$P(X0,U,9)
+"RTN","EDPQLE",46,0)
+ S X("arrival")=$$CODE($P(X0,U,10)),CODED("arrival")=X("arrival")
+"RTN","EDPQLE",47,0)
+ S X("visit")=$P(X0,U,12)
+"RTN","EDPQLE",48,0)
+ S X("clinic")=$P(X0,U,14),CLINIC=X("clinic")
+"RTN","EDPQLE",49,0)
+ S X("complaint")=$P(X1,U,1)
+"RTN","EDPQLE",50,0)
+ S X("compLong")=$G(^EDP(230,LOG,2))
+"RTN","EDPQLE",51,0)
+ S X("status")=$$CODE($P(X3,U,2)),CODED("status")=X("status")
+"RTN","EDPQLE",52,0)
+ S X("acuity")=$$CODE($P(X3,U,3))
+"RTN","EDPQLE",53,0)
+ S X("bed")=+$P(X3,U,4)
+"RTN","EDPQLE",54,0)
+ S X("md")=+$P(X3,U,5),PERSON("provider")=X("md")
+"RTN","EDPQLE",55,0)
+ S X("nurse")=+$P(X3,U,6),PERSON("nurse")=X("nurse")
+"RTN","EDPQLE",56,0)
+ S X("res")=+$P(X3,U,7),PERSON("resident")=X("res")
+"RTN","EDPQLE",57,0)
+ S X("comment")=$P(X3,U,8)
+"RTN","EDPQLE",58,0)
+ S X("delay")=$$CODE($P(X1,U,5)),CODED("delay")=X("delay")
+"RTN","EDPQLE",59,0)
+ S X("disposition")=$$CODE($P(X1,U,2)),CODED("disposition")=X("disposition")
+"RTN","EDPQLE",60,0)
+ S X("required")=$$REQ(.X)
+"RTN","EDPQLE",61,0)
+ S CURBED=X("bed")  ; for later use by BEDS
+"RTN","EDPQLE",62,0)
+ ;
+"RTN","EDPQLE",63,0)
+ D XML^EDPX("<logEntry>")
+"RTN","EDPQLE",64,0)
+ D XMLE^EDPX(.X)
+"RTN","EDPQLE",65,0)
+ ;
+"RTN","EDPQLE",66,0)
+ ; Get diagnosis from PCE if it is coded entry required AND patient has a VISIT
+"RTN","EDPQLE",67,0)
+ I $P($G(^EDPB(231.9,AREA,1)),U,2),$P(X0,U,12) D
+"RTN","EDPQLE",68,0)
+ . D DIAGPCE($P(X0,U,12))
+"RTN","EDPQLE",69,0)
+ E  D
+"RTN","EDPQLE",70,0)
+ . D DIAGFREE(LOG)
+"RTN","EDPQLE",71,0)
+ ;
+"RTN","EDPQLE",72,0)
+ I X("dfn") D PRF^EDPFPTC(X("dfn"))  ; patient record flags
+"RTN","EDPQLE",73,0)
+ ;
+"RTN","EDPQLE",74,0)
+ D XML^EDPX("</logEntry>")
+"RTN","EDPQLE",75,0)
+ Q
+"RTN","EDPQLE",76,0)
+PRIMPCE(EDPVISIT) ; return primary provider from PCE
+"RTN","EDPQLE",77,0)
+ ;for provider
+"RTN","EDPQLE",78,0)
+ ; LST(n)="PRV"^ien^^^name^primary/secondary flag
+"RTN","EDPQLE",79,0)
+ N I,X,PRIM
+"RTN","EDPQLE",80,0)
+ S PRIM=""
+"RTN","EDPQLE",81,0)
+ S I=0 F  S I=$O(^TMP("PXKENC",$J,EDPVISIT,"PRV",I)) Q:'I  D  Q:PRIM
+"RTN","EDPQLE",82,0)
+ . S X=^TMP("PXKENC",$J,EDPVISIT,"PRV",I,0)
+"RTN","EDPQLE",83,0)
+ . Q:$P(X,U,4)'="P"
+"RTN","EDPQLE",84,0)
+ . S PRIM=$P(X,U)
+"RTN","EDPQLE",85,0)
+ Q:'PRIM ""
+"RTN","EDPQLE",86,0)
+ Q:'$D(^XUSEC("PROVIDER",PRIM)) ""
+"RTN","EDPQLE",87,0)
+ Q:'$$ALLOW^EDPFPER(PRIM,"P") ""
+"RTN","EDPQLE",88,0)
+ Q PRIM
+"RTN","EDPQLE",89,0)
+ ;
+"RTN","EDPQLE",90,0)
+DIAGPCE(EDPVISIT) ; add PCE diagnoses
+"RTN","EDPQLE",91,0)
+ Q:'EDPVISIT
+"RTN","EDPQLE",92,0)
+ N I,X,CODE
+"RTN","EDPQLE",93,0)
+ S I=0 F  S I=$O(^TMP("PXKENC",$J,EDPVISIT,"POV",I)) Q:'I  D
+"RTN","EDPQLE",94,0)
+ . K X S X=^TMP("PXKENC",$J,EDPVISIT,"POV",I,0)
+"RTN","EDPQLE",95,0)
+ . S X("type")="POV"
+"RTN","EDPQLE",96,0)
+ . S CODE=$P(X,U) S:CODE CODE=$P(^ICD9(CODE,0),U)
+"RTN","EDPQLE",97,0)
+ . S X("code")=$P(^ICD9($P(X,U),0),U)
+"RTN","EDPQLE",98,0)
+ . S X("label")=^AUTNPOV($P(X,U,4),0)
+"RTN","EDPQLE",99,0)
+ . S X("primary")=($P(X,U,12)="P")
+"RTN","EDPQLE",100,0)
+ . D XML^EDPX($$XMLA^EDPX("diagnosis",.X))
+"RTN","EDPQLE",101,0)
+ S I=0 F  S I=$O(^TMP("PXKENC",$J,EDPVISIT,"CPT",I)) Q:'I  D
+"RTN","EDPQLE",102,0)
+ . K X S X=^TMP("PXKENC",$J,EDPVISIT,"CPT",I,0)
+"RTN","EDPQLE",103,0)
+ . S X("type")="CPT"
+"RTN","EDPQLE",104,0)
+ . S CODE=$O(^ICPT("B",$P(X,U),0)) S:CODE CODE=$P(^ICPT(CODE,0),U)
+"RTN","EDPQLE",105,0)
+ . S X("code")=CODE
+"RTN","EDPQLE",106,0)
+ . S X("label")=^AUTNPOV($P(X,U,4),0)
+"RTN","EDPQLE",107,0)
+ . S X("quantity")=$P(X,U,16)
+"RTN","EDPQLE",108,0)
+ . D XML^EDPX($$XMLA^EDPX("proc",.X))
+"RTN","EDPQLE",109,0)
+ Q
+"RTN","EDPQLE",110,0)
+DIAGFREE(LOG) ; add free text diagnoses
+"RTN","EDPQLE",111,0)
+ N DIAG,CODE,LABEL,X4
+"RTN","EDPQLE",112,0)
+ S DIAG=0 F  S DIAG=$O(^EDP(230,LOG,4,DIAG)) Q:'DIAG  D
+"RTN","EDPQLE",113,0)
+ . S X4=^EDP(230,LOG,4,DIAG,0)
+"RTN","EDPQLE",114,0)
+ . S X4("type")="POV"
+"RTN","EDPQLE",115,0)
+ . S CODE=$P(X4,U,2) S:CODE CODE=$P(^ICD9(CODE,0),U)
+"RTN","EDPQLE",116,0)
+ . S X4("code")=CODE
+"RTN","EDPQLE",117,0)
+ . S X4("label")=$P(X4,U,1)
+"RTN","EDPQLE",118,0)
+ . S X4("primary")=+$P(X4,U,3)
+"RTN","EDPQLE",119,0)
+ . D XML^EDPX($$XMLA^EDPX("diagnosis",.X4))
+"RTN","EDPQLE",120,0)
+ Q
+"RTN","EDPQLE",121,0)
+DOB(DFN) ; Return date of birth (external)
+"RTN","EDPQLE",122,0)
+ I 'DFN Q ""
+"RTN","EDPQLE",123,0)
+ N VA,VADM,X,Y
+"RTN","EDPQLE",124,0)
+ D DEM^VADPT
+"RTN","EDPQLE",125,0)
+ Q $P(VADM(3),U,2)_"   Age "_VADM(4)
+"RTN","EDPQLE",126,0)
+ ;
+"RTN","EDPQLE",127,0)
+CODE(IEN) ; set NOVAL code to 0 when returning code
+"RTN","EDPQLE",128,0)
+ Q:IEN=EDPNOVAL 0
+"RTN","EDPQLE",129,0)
+ Q +IEN
+"RTN","EDPQLE",130,0)
+ ;
+"RTN","EDPQLE",131,0)
+BEDS ; add a list of available room/beds for this area
+"RTN","EDPQLE",132,0)
+ D XML^EDPX("<bedList>")
+"RTN","EDPQLE",133,0)
+ D XML^EDPX($$XMLS^EDPX("bed",0,"None"))   ;non-selected
+"RTN","EDPQLE",134,0)
+ N BED,X0,MULTI,SEQ
+"RTN","EDPQLE",135,0)
+ S BED=0 F  S BED=$O(^EDPB(231.8,"C",EDPSITE,AREA,BED)) Q:'BED  D
+"RTN","EDPQLE",136,0)
+ . S SEQ=$P(^EDPB(231.8,BED,0),U,5) S:'SEQ SEQ=99999
+"RTN","EDPQLE",137,0)
+ . S SEQ(SEQ,BED)=""
+"RTN","EDPQLE",138,0)
+ S SEQ=0 F  S SEQ=$O(SEQ(SEQ)) Q:'SEQ  D
+"RTN","EDPQLE",139,0)
+ . S BED=0 F  S BED=$O(SEQ(SEQ,BED)) Q:'BED  D
+"RTN","EDPQLE",140,0)
+ .. S X0=^EDPB(231.8,BED,0)
+"RTN","EDPQLE",141,0)
+ .. ; QUIT if inactive bed
+"RTN","EDPQLE",142,0)
+ .. I $P(X0,U,4) Q
+"RTN","EDPQLE",143,0)
+ .. ; QUIT if occupied, unless own bed or multi-assign
+"RTN","EDPQLE",144,0)
+ .. S MULTI=+$P(X0,U,9) S:MULTI=3 MULTI=0 ; single non-ed
+"RTN","EDPQLE",145,0)
+ .. I $D(^EDP(230,"AL",EDPSITE,AREA,BED)),((BED'=CURBED)&'MULTI) Q
+"RTN","EDPQLE",146,0)
+ .. ;
+"RTN","EDPQLE",147,0)
+ .. S X("data")=BED
+"RTN","EDPQLE",148,0)
+ .. S X("label")=$P(X0,U,6)_"  ("_$P(X0,U)_")"
+"RTN","EDPQLE",149,0)
+ .. S X("ref")=$P(X0,U,8)
+"RTN","EDPQLE",150,0)
+ .. D XML^EDPX($$XMLA^EDPX("bed",.X))
+"RTN","EDPQLE",151,0)
+ D XML^EDPX("</bedList>")
+"RTN","EDPQLE",152,0)
+ Q
+"RTN","EDPQLE",153,0)
+PERSONS ; add the internal/external values for persons
+"RTN","EDPQLE",154,0)
+ N ROLE,NAME,LOCID,IEN,X
+"RTN","EDPQLE",155,0)
+ D XML^EDPX("<persons>")
+"RTN","EDPQLE",156,0)
+ F ROLE="provider","nurse","resident" S LOCID=$G(PERSON(ROLE)) D
+"RTN","EDPQLE",157,0)
+ . Q:'LOCID
+"RTN","EDPQLE",158,0)
+ . S NAME=$P(^VA(200,LOCID,0),U)
+"RTN","EDPQLE",159,0)
+ . S X("data")=LOCID,X("label")=NAME
+"RTN","EDPQLE",160,0)
+ . D XML^EDPX($$XMLA^EDPX(ROLE,.X))
+"RTN","EDPQLE",161,0)
+ D XML^EDPX("</persons>")
+"RTN","EDPQLE",162,0)
+ Q
+"RTN","EDPQLE",163,0)
+CODED ; add internal/external values for codes
+"RTN","EDPQLE",164,0)
+ N NAME,X
+"RTN","EDPQLE",165,0)
+ D XML^EDPX("<selected>")
+"RTN","EDPQLE",166,0)
+ S X="" F  S X=$O(CODED(X)) Q:X=""  I CODED(X) D
+"RTN","EDPQLE",167,0)
+ . S NAME=$P($G(^EDPB(233.1,CODED(X),0)),U,2) Q:NAME=""
+"RTN","EDPQLE",168,0)
+ . D XML^EDPX($$XMLS^EDPX(X,CODED(X),NAME))
+"RTN","EDPQLE",169,0)
+ D XML^EDPX("</selected>")
+"RTN","EDPQLE",170,0)
+ Q
+"RTN","EDPQLE",171,0)
+CLINICS ; add internal/external values for clinic
+"RTN","EDPQLE",172,0)
+ Q:'CLINIC
+"RTN","EDPQLE",173,0)
+ N NAME,X
+"RTN","EDPQLE",174,0)
+ D XML^EDPX("<clinics>")
+"RTN","EDPQLE",175,0)
+ S NAME=$P($G(^SC(CLINIC,0)),U)
+"RTN","EDPQLE",176,0)
+ S X("data")=CLINIC,X("label")=NAME
+"RTN","EDPQLE",177,0)
+ D XML^EDPX($$XMLA^EDPX("clinic",.X))
+"RTN","EDPQLE",178,0)
+ D XML^EDPX("</clinics>")
+"RTN","EDPQLE",179,0)
+ Q
+"RTN","EDPQLE",180,0)
+REQ(VAL) ; return the fields required to close this entry
+"RTN","EDPQLE",181,0)
+ ; called from LOG, AREA is assumed to be defined
+"RTN","EDPQLE",182,0)
+ N NEED,PARAM
+"RTN","EDPQLE",183,0)
+ S PARAM=$G(^EDPB(231.9,AREA,1)),NEED=""
+"RTN","EDPQLE",184,0)
+ I $P(PARAM,U,1) S $P(NEED,",",1)="diag"
+"RTN","EDPQLE",185,0)
+ I $P(PARAM,U,3) S $P(NEED,",",2)="disp"
+"RTN","EDPQLE",186,0)
+ I $$DLYREQ,$$NOTOBS,$$EXCEED S $P(NEED,",",3)="delay"
+"RTN","EDPQLE",187,0)
+ Q NEED
+"RTN","EDPQLE",188,0)
+ ;
+"RTN","EDPQLE",189,0)
+DLYREQ() ; return true if delay params set to required
+"RTN","EDPQLE",190,0)
+ ; called from REQ, PARAM is assumed to be defined
+"RTN","EDPQLE",191,0)
+ Q $P(PARAM,U,4)&$P(PARAM,U,5)
+"RTN","EDPQLE",192,0)
+ ;
+"RTN","EDPQLE",193,0)
+NOTOBS() ; return true if not in observation status
+"RTN","EDPQLE",194,0)
+ ; called from REQ, VAL is assumed to be defined
+"RTN","EDPQLE",195,0)
+ N STS S STS=+$G(VAL("status"))
+"RTN","EDPQLE",196,0)
+ Q:'STS 1
+"RTN","EDPQLE",197,0)
+ Q:$P(^EDPB(233.1,STS,0),U,5)["O" 0
+"RTN","EDPQLE",198,0)
+ Q 1
+"RTN","EDPQLE",199,0)
+ ;
+"RTN","EDPQLE",200,0)
+EXCEED() ; return true if delay time exceeded
+"RTN","EDPQLE",201,0)
+ ; called from REQ, VAL and PARAM are assumed to be defined
+"RTN","EDPQLE",202,0)
+ N IN S IN=$G(VAL("inTS"))
+"RTN","EDPQLE",203,0)
+ N OUT S OUT=$G(VAL("outTS")) S:'OUT OUT=EDPTIME
+"RTN","EDPQLE",204,0)
+ N MAX S MAX=$P(PARAM,U,5)
+"RTN","EDPQLE",205,0)
+ Q ($$FMDIFF^XLFDT(OUT,IN,2)\60)>MAX
+"RTN","EDPQLE1")
+0^46^B9736825
+"RTN","EDPQLE1",1,0)
+EDPQLE1 ;SLC/KCM - Retrive Log Entry - Supporting Info
+"RTN","EDPQLE1",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPQLE1",3,0)
+ ;
+"RTN","EDPQLE1",4,0)
+CHOICES(AREA) ; Add choice lists for editing log entry to XML
+"RTN","EDPQLE1",5,0)
+ ; called from EDPQLE
+"RTN","EDPQLE1",6,0)
+ ; 
+"RTN","EDPQLE1",7,0)
+ D STAFF("md","P")
+"RTN","EDPQLE1",8,0)
+ D STAFF("res","R")
+"RTN","EDPQLE1",9,0)
+ D STAFF("nurse","N")
+"RTN","EDPQLE1",10,0)
+ ;
+"RTN","EDPQLE1",11,0)
+ D CODES("arrival","arrival")
+"RTN","EDPQLE1",12,0)
+ D CODES("acuity","acuity")
+"RTN","EDPQLE1",13,0)
+ D CODES("status","status")
+"RTN","EDPQLE1",14,0)
+ D CODES("disposition","disposition")
+"RTN","EDPQLE1",15,0)
+ D CODES("delay","delay")
+"RTN","EDPQLE1",16,0)
+ Q
+"RTN","EDPQLE1",17,0)
+STAFF(LABEL,ROLE) ; add staff for this area to XML
+"RTN","EDPQLE1",18,0)
+ N IEN,X0,NM,PER,ALPHA,EDPNURS
+"RTN","EDPQLE1",19,0)
+ I ROLE="N" S EDPNURS=$$GET^XPAR("ALL","EDPF NURSE STAFF SCREEN")
+"RTN","EDPQLE1",20,0)
+ D XML^EDPX("<"_LABEL_"List>")
+"RTN","EDPQLE1",21,0)
+ D XML^EDPX($$XMLS^EDPX(LABEL,0,"None"))   ;non-selected (-1 will delete)
+"RTN","EDPQLE1",22,0)
+ S IEN=0 F  S IEN=$O(^EDPB(231.7,"AC",EDPSITE,AREA,ROLE,IEN)) Q:'IEN  D
+"RTN","EDPQLE1",23,0)
+ . S X0=^EDPB(231.7,IEN,0),PER=$P(X0,U)
+"RTN","EDPQLE1",24,0)
+ . I '$$ALLOW^EDPFPER(PER,ROLE) Q
+"RTN","EDPQLE1",25,0)
+ . S ALPHA($P(^VA(200,PER,0),U),PER)=""
+"RTN","EDPQLE1",26,0)
+ S NM="" F  S NM=$O(ALPHA(NM)) Q:NM=""  D
+"RTN","EDPQLE1",27,0)
+ . S PER=0 F  S PER=$O(ALPHA(NM,PER)) Q:'PER  D
+"RTN","EDPQLE1",28,0)
+ . . D XML^EDPX($$XMLS^EDPX(LABEL,PER,NM))
+"RTN","EDPQLE1",29,0)
+ D XML^EDPX("</"_LABEL_"List>")
+"RTN","EDPQLE1",30,0)
+ Q
+"RTN","EDPQLE1",31,0)
+CODES(LABEL,SETNM) ; build nodes for set of codes
+"RTN","EDPQLE1",32,0)
+ D XML^EDPX("<"_LABEL_"List>")
+"RTN","EDPQLE1",33,0)
+ I "^arrival^acuity^status^disposition^delay^"[(U_LABEL_U) D
+"RTN","EDPQLE1",34,0)
+ . ;N NOVAL S NOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0))
+"RTN","EDPQLE1",35,0)
+ . ;D XML^EDPX($$XMLS^EDPX(LABEL,NOVAL,"None"))   ; non-selected value
+"RTN","EDPQLE1",36,0)
+ . D XML^EDPX($$XMLS^EDPX(LABEL,0,"None"))   ; non-selected value ;
+"RTN","EDPQLE1",37,0)
+ I $D(^EDPB(233.2,"B",EDPSTA_"."_SETNM)) S SETNM=EDPSTA_"."_SETNM I 1
+"RTN","EDPQLE1",38,0)
+ E  S SETNM="edp."_SETNM
+"RTN","EDPQLE1",39,0)
+ ;
+"RTN","EDPQLE1",40,0)
+ N SET,SEQ,I,X0,IEN,SHOW
+"RTN","EDPQLE1",41,0)
+ S SET=$O(^EDPB(233.2,"B",SETNM,0))
+"RTN","EDPQLE1",42,0)
+ S SEQ=0 F  S SEQ=$O(^EDPB(233.2,SET,1,"B",SEQ)) Q:'SEQ  D
+"RTN","EDPQLE1",43,0)
+ . S I=0 F  S I=$O(^EDPB(233.2,SET,1,"B",SEQ,I)) Q:'I  D
+"RTN","EDPQLE1",44,0)
+ . . S X0=^EDPB(233.2,SET,1,I,0)
+"RTN","EDPQLE1",45,0)
+ . . Q:$P(X0,U,3)  ; inactive
+"RTN","EDPQLE1",46,0)
+ . . S IEN=$P(X0,U,2)
+"RTN","EDPQLE1",47,0)
+ . . S SHOW=$P(X0,U,4)
+"RTN","EDPQLE1",48,0)
+ . . I SHOW="" S SHOW=$P(^EDPB(233.1,IEN,0),U,2)
+"RTN","EDPQLE1",49,0)
+ . . D XML^EDPX($$XMLS^EDPX(LABEL,IEN,SHOW))
+"RTN","EDPQLE1",50,0)
+ ;
+"RTN","EDPQLE1",51,0)
+ D XML^EDPX("</"_LABEL_"List>")
+"RTN","EDPQLE1",52,0)
+ Q
+"RTN","EDPQLE1",53,0)
+CLINLST(USEALL) ; build nodes for selectable clinics
+"RTN","EDPQLE1",54,0)
+ N EDPLST,INSTANCE,IEN,NAME,LST,CURTM
+"RTN","EDPQLE1",55,0)
+ D GETLST^XPAR(.EDPLST,EDPSITE_";DIC(4,","EDPF LOCATION","N")
+"RTN","EDPQLE1",56,0)
+ S CURTM=$E($P($$NOW^XLFDT,".",2)_"0000",1,4)
+"RTN","EDPQLE1",57,0)
+ S INSTANCE="" F  S INSTANCE=$O(EDPLST(INSTANCE)) Q:INSTANCE=""  D
+"RTN","EDPQLE1",58,0)
+ . S IEN=+EDPLST(INSTANCE),NAME=$P(EDPLST(INSTANCE),U,2)
+"RTN","EDPQLE1",59,0)
+ . I 'USEALL,$$OUTSIDE(CURTM,INSTANCE) Q  ; outside time range, get next
+"RTN","EDPQLE1",60,0)
+ . S LST(NAME)=IEN
+"RTN","EDPQLE1",61,0)
+ ;
+"RTN","EDPQLE1",62,0)
+ D XML^EDPX("<clinicList>")
+"RTN","EDPQLE1",63,0)
+ D XML^EDPX($$XMLS^EDPX("clinic",0,"None"))   ;non-selected (-1 will delete)
+"RTN","EDPQLE1",64,0)
+ S NAME="" F  S NAME=$O(LST(NAME)) Q:NAME=""  D
+"RTN","EDPQLE1",65,0)
+ . D XML^EDPX($$XMLS^EDPX("clinic",LST(NAME),NAME))
+"RTN","EDPQLE1",66,0)
+ D XML^EDPX("</clinicList>")
+"RTN","EDPQLE1",67,0)
+ Q
+"RTN","EDPQLE1",68,0)
+OUTSIDE(TM,RNG) ; return true if the time is OUTSIDE of the range
+"RTN","EDPQLE1",69,0)
+ I RNG'["-" Q 0
+"RTN","EDPQLE1",70,0)
+ ;
+"RTN","EDPQLE1",71,0)
+ S BEG=+$P(RNG,"-"),END=+$P(RNG,"-",2)
+"RTN","EDPQLE1",72,0)
+ I (TM<BEG)!(TM>END) Q 1
+"RTN","EDPQLE1",73,0)
+ Q 0
+"RTN","EDPQLP")
+0^47^B12368052
+"RTN","EDPQLP",1,0)
+EDPQLP ;SLC/KCM - Log Entry Patients
+"RTN","EDPQLP",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPQLP",3,0)
+ ;
+"RTN","EDPQLP",4,0)
+GET(AREA,TOKEN) ; Return lists for edit context
+"RTN","EDPQLP",5,0)
+ ;
+"RTN","EDPQLP",6,0)
+ ; don't rebuild the list if it is unchanged
+"RTN","EDPQLP",7,0)
+ ;I $G(^EDPB(231.9,AREA,230))=TOKEN D  Q
+"RTN","EDPQLP",8,0)
+ ;. D XML^EDPX("<logEntries status='same' />")
+"RTN","EDPQLP",9,0)
+ ;
+"RTN","EDPQLP",10,0)
+ ; build sequence based on bed sequence
+"RTN","EDPQLP",11,0)
+ N IEN,X0,NAME,SSN,LAST4,BED,SEQ,DUP,LST,DFN
+"RTN","EDPQLP",12,0)
+ D BLDDUP(.DUP,AREA)
+"RTN","EDPQLP",13,0)
+ S IEN=0 F  S IEN=$O(^EDP(230,"AC",EDPSITE,AREA,IEN)) Q:'IEN  D
+"RTN","EDPQLP",14,0)
+ . S X0=^EDP(230,IEN,0)
+"RTN","EDPQLP",15,0)
+ . S NAME=$P(X0,U,4),LAST4=$P(X0,U,11),DFN=$P(X0,U,6)
+"RTN","EDPQLP",16,0)
+ . S SSN="" I DFN S SSN=$P(^DPT(DFN,0),U,9)
+"RTN","EDPQLP",17,0)
+ . S BED=$P($G(^EDP(230,IEN,3)),U,4)
+"RTN","EDPQLP",18,0)
+ . S SEQ=0
+"RTN","EDPQLP",19,0)
+ . I BED S SEQ=$P($G(^EDPB(231.8,BED,0)),U,5)
+"RTN","EDPQLP",20,0)
+ . I 'SEQ S SEQ=999999
+"RTN","EDPQLP",21,0)
+ . I BED S BED=$P(^EDPB(231.8,BED,0),U,6)
+"RTN","EDPQLP",22,0)
+ . S LST(SEQ,IEN)=NAME_U_SSN_U_LAST4_U_BED_U_$$SIM(NAME,LAST4,.DUP)
+"RTN","EDPQLP",23,0)
+ ;
+"RTN","EDPQLP",24,0)
+ D XML^EDPX("<logEntries status='new' token='"_$G(^EDPB(231.9,AREA,230))_"' >")
+"RTN","EDPQLP",25,0)
+ S SEQ=0 F  S SEQ=$O(LST(SEQ)) Q:'SEQ  D
+"RTN","EDPQLP",26,0)
+ . S IEN=0 F  S IEN=$O(LST(SEQ,IEN)) Q:'IEN  D
+"RTN","EDPQLP",27,0)
+ . . S X("id")=IEN
+"RTN","EDPQLP",28,0)
+ . . S X("seq")=SEQ
+"RTN","EDPQLP",29,0)
+ . . S X("name")=$P(LST(SEQ,IEN),U)
+"RTN","EDPQLP",30,0)
+ . . S X("ssn")=$P(LST(SEQ,IEN),U,2)
+"RTN","EDPQLP",31,0)
+ . . S X("last4")=$P(LST(SEQ,IEN),U,3)
+"RTN","EDPQLP",32,0)
+ . . S X("bed")=$P(LST(SEQ,IEN),U,4)
+"RTN","EDPQLP",33,0)
+ . . S X("same")=$P(LST(SEQ,IEN),U,5)
+"RTN","EDPQLP",34,0)
+ . . D XML^EDPX($$XMLA^EDPX("log",.X))
+"RTN","EDPQLP",35,0)
+ D XML^EDPX("</logEntries>")
+"RTN","EDPQLP",36,0)
+ Q
+"RTN","EDPQLP",37,0)
+BLDDUP(DUP,AREA) ; Build duplicate name/last4 counters
+"RTN","EDPQLP",38,0)
+ ; called from GET^EDPQLP, GET^EDPQDB -- expect EDPSITE
+"RTN","EDPQLP",39,0)
+ N X,IEN,CNT
+"RTN","EDPQLP",40,0)
+ S X="" F  S X=$O(^EDP(230,"ADUP",EDPSITE,AREA,X)) Q:X=""  D
+"RTN","EDPQLP",41,0)
+ . S IEN=0,CNT=0
+"RTN","EDPQLP",42,0)
+ . F  S IEN=$O(^EDP(230,"ADUP",EDPSITE,AREA,X,IEN)) Q:'IEN  S CNT=CNT+1
+"RTN","EDPQLP",43,0)
+ . S DUP(X)=CNT
+"RTN","EDPQLP",44,0)
+ Q
+"RTN","EDPQLP",45,0)
+SIM(NAME,LAST4,DUP) ; Return true if similar patient name/last4
+"RTN","EDPQLP",46,0)
+ I $L(LAST4),$G(DUP(LAST4))>1 Q 1
+"RTN","EDPQLP",47,0)
+ I $L(NAME),$G(DUP($P(NAME,",")))>1 Q 1
+"RTN","EDPQLP",48,0)
+ Q 0
+"RTN","EDPQLP",49,0)
+ ;
+"RTN","EDPQLP",50,0)
+CLOSED(AREA,PARTIAL) ; find matches on name
+"RTN","EDPQLP",51,0)
+ S PARTIAL=$$UP^XLFSTR(PARTIAL)
+"RTN","EDPQLP",52,0)
+ Q:PARTIAL=""
+"RTN","EDPQLP",53,0)
+ ;
+"RTN","EDPQLP",54,0)
+ I PARTIAL?1U4N D BS5(PARTIAL) G XCLOSED
+"RTN","EDPQLP",55,0)
+ I PARTIAL?9N.1U D SSN(PARTIAL) G XCLOSED
+"RTN","EDPQLP",56,0)
+ I PARTIAL?1.2N1"/"1.2N1"/"2.4N D DAY(PARTIAL) G XCLOSED
+"RTN","EDPQLP",57,0)
+ I PARTIAL?1"T"1"-"1.4N D DAY(PARTIAL) G XCLOSED
+"RTN","EDPQLP",58,0)
+ I (PARTIAL="TODAY") D DAY(PARTIAL) ; fall thru LNAM in case TODAY is a name
+"RTN","EDPQLP",59,0)
+ D LNAM(PARTIAL)
+"RTN","EDPQLP",60,0)
+ ;
+"RTN","EDPQLP",61,0)
+XCLOSED ; exit case statement
+"RTN","EDPQLP",62,0)
+ Q
+"RTN","EDPQLP",63,0)
+ ;
+"RTN","EDPQLP",64,0)
+BS5(X) ; find matches by last inital, last 4
+"RTN","EDPQLP",65,0)
+ N DFN,IEN
+"RTN","EDPQLP",66,0)
+ S DFN=0 F  S DFN=$O(^DPT("BS5",X,DFN)) Q:'DFN  D
+"RTN","EDPQLP",67,0)
+ . S IEN=0 F  S IEN=$O(^EDP(230,"PDFN",EDPSITE,AREA,DFN,IEN)) Q:'IEN  D ADDVST(IEN)
+"RTN","EDPQLP",68,0)
+ Q
+"RTN","EDPQLP",69,0)
+SSN(X) ; find matches by SSN
+"RTN","EDPQLP",70,0)
+ N DFN,IEN
+"RTN","EDPQLP",71,0)
+ S DFN=0 F  S DFN=$O(^DPT("SSN",X,DFN)) Q:'DFN  D
+"RTN","EDPQLP",72,0)
+ . S IEN=0 F  S IEN=$O(^EDP(230,"PDFN",EDPSITE,AREA,DFN,IEN)) Q:'IEN  D ADDVST(IEN)
+"RTN","EDPQLP",73,0)
+ Q
+"RTN","EDPQLP",74,0)
+DAY(X) ; find matches by DATE
+"RTN","EDPQLP",75,0)
+ N %DT,Y,DTOUT,END,INTS
+"RTN","EDPQLP",76,0)
+ D ^%DT
+"RTN","EDPQLP",77,0)
+ S INTS=$P(Y,"."),END=INTS_".999999"
+"RTN","EDPQLP",78,0)
+ Q:INTS'>0
+"RTN","EDPQLP",79,0)
+ F  S INTS=$O(^EDP(230,"ATI",EDPSITE,INTS)) Q:'INTS  Q:INTS>END  D
+"RTN","EDPQLP",80,0)
+ . S IEN=0 F  S IEN=$O(^EDP(230,"ATI",EDPSITE,INTS,IEN)) Q:'IEN  D
+"RTN","EDPQLP",81,0)
+ . . Q:$P(^EDP(230,IEN,0),U,3)'=AREA
+"RTN","EDPQLP",82,0)
+ . . D ADDVST(IEN)
+"RTN","EDPQLP",83,0)
+ Q
+"RTN","EDPQLP",84,0)
+LNAM(PARTIAL) ; find matches by name
+"RTN","EDPQLP",85,0)
+ N IEN,NAME,X,X0
+"RTN","EDPQLP",86,0)
+ S NAME=$O(^EDP(230,"PN",EDPSITE,AREA,PARTIAL),-1)
+"RTN","EDPQLP",87,0)
+ F  S NAME=$O(^EDP(230,"PN",EDPSITE,AREA,NAME)) Q:$E(NAME,1,$L(PARTIAL))'=PARTIAL  Q:NAME=""  D
+"RTN","EDPQLP",88,0)
+ . S IEN=0 F  S IEN=$O(^EDP(230,"PN",EDPSITE,AREA,NAME,IEN)) Q:'IEN  D ADDVST(IEN)
+"RTN","EDPQLP",89,0)
+ Q
+"RTN","EDPQLP",90,0)
+ADDVST(IEN) ; add node for visit
+"RTN","EDPQLP",91,0)
+ N X0,X,NAME
+"RTN","EDPQLP",92,0)
+ S X0=^EDP(230,IEN,0),NAME=$P(X0,U,4)
+"RTN","EDPQLP",93,0)
+ I '$P(X0,U,7) Q  ; not closed
+"RTN","EDPQLP",94,0)
+ S X("id")=IEN,X("name")=NAME,X("inTS")=$P(X0,U,8)
+"RTN","EDPQLP",95,0)
+ D XML^EDPX($$XMLA^EDPX("visit",.X))
+"RTN","EDPQLP",96,0)
+ Q
+"RTN","EDPQPCE")
+0^54^B2442064
+"RTN","EDPQPCE",1,0)
+EDPQPCE ;SLC/KCM - Retrieve PCE information for ED Visits
+"RTN","EDPQPCE",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPQPCE",3,0)
+ ;
+"RTN","EDPQPCE",4,0)
+DXPRI(AREA,LOG) ; return primary diagnosis
+"RTN","EDPQPCE",5,0)
+ N DXLST
+"RTN","EDPQPCE",6,0)
+ D DXALL(AREA,LOG,.DXLST)
+"RTN","EDPQPCE",7,0)
+ Q $G(DXLST(1)) ;$P( ,U,2)
+"RTN","EDPQPCE",8,0)
+ ;
+"RTN","EDPQPCE",9,0)
+DXALL(AREA,LOG,DXLST) ; build list of diagnoses for a visit
+"RTN","EDPQPCE",10,0)
+ N EDPVISIT S EDPVISIT=$P(^EDP(230,LOG,0),U,12)
+"RTN","EDPQPCE",11,0)
+ I EDPVISIT,$P($G(^EDPB(231.9,AREA,1)),U,2) D DXPCE(EDPVISIT,.DXLST) I 1
+"RTN","EDPQPCE",12,0)
+ E  D DXFREE(LOG,.DXLST)
+"RTN","EDPQPCE",13,0)
+ Q
+"RTN","EDPQPCE",14,0)
+DXPCE(EDPVISIT,DXLST) ; return a list of diagnoses from PCE
+"RTN","EDPQPCE",15,0)
+ N I,X,CODE,NAME,DX
+"RTN","EDPQPCE",16,0)
+ K ^TMP("PXKENC",$J)
+"RTN","EDPQPCE",17,0)
+ D ENCEVENT^PXAPI(EDPVISIT)
+"RTN","EDPQPCE",18,0)
+ S I=0,DX=0 F  S I=$O(^TMP("PXKENC",$J,EDPVISIT,"POV",I)) Q:'I  D
+"RTN","EDPQPCE",19,0)
+ . S X=^TMP("PXKENC",$J,EDPVISIT,"POV",I,0)
+"RTN","EDPQPCE",20,0)
+ . S CODE=$P(^ICD9($P(X,U),0),U)
+"RTN","EDPQPCE",21,0)
+ . S NAME=^AUTNPOV($P(X,U,4),0)
+"RTN","EDPQPCE",22,0)
+ . S DX=DX+1,DX($S($P(X,U,12)="P":DX,1:DX*10000))=CODE_U_NAME
+"RTN","EDPQPCE",23,0)
+ S X="",DXLST=DX F I=1:1 S X=$O(DX(X)) Q:X=""  S DXLST(I)=DX(X)
+"RTN","EDPQPCE",24,0)
+ Q
+"RTN","EDPQPCE",25,0)
+DXFREE(LOG,DXLST) ; return free text diagnoses from ED LOG file
+"RTN","EDPQPCE",26,0)
+ N I,CODE,NAME,X4,DX
+"RTN","EDPQPCE",27,0)
+ S I=0,DX=0 F  S I=$O(^EDP(230,LOG,4,I)) Q:'I  D
+"RTN","EDPQPCE",28,0)
+ . S X4=^EDP(230,LOG,4,I,0)
+"RTN","EDPQPCE",29,0)
+ . S CODE=$P(X4,U,2) S:CODE CODE=$P(^ICD9(CODE,0),U)
+"RTN","EDPQPCE",30,0)
+ . S NAME=$P(X4,U,1)
+"RTN","EDPQPCE",31,0)
+ . S DX=DX+1,DX($S(+$P(X4,U,3):DX,1:DX*10000))=CODE_U_NAME
+"RTN","EDPQPCE",32,0)
+ S X="",DXLST=DX F I=1:1 S X=$O(DX(X)) Q:X=""  S DXLST(I)=DX(X)
+"RTN","EDPQPCE",33,0)
+ Q
+"RTN","EDPRPT")
+0^10^B17619722
+"RTN","EDPRPT",1,0)
+EDPRPT ;SLC/MKB - Reports
+"RTN","EDPRPT",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT",3,0)
+ ;
+"RTN","EDPRPT",4,0)
+EN(BEG,END,RPT,ID,CSV) ; Get RPT data for EDPSITE by date range
+"RTN","EDPRPT",5,0)
+ N NOW S NOW=$$NOW
+"RTN","EDPRPT",6,0)
+ I BEG,END D  ;check
+"RTN","EDPRPT",7,0)
+ . N X I END<BEG S X=BEG,BEG=END,END=X ;switch
+"RTN","EDPRPT",8,0)
+ . S:$L(END,".")<2 END=END_".2359"
+"RTN","EDPRPT",9,0)
+ S RPT=$$UP^XLFSTR($G(RPT))
+"RTN","EDPRPT",10,0)
+ ; switch on report type
+"RTN","EDPRPT",11,0)
+ I RPT="EXPOSURE"   D EXP^EDPRPT7(ID)       G CONT
+"RTN","EDPRPT",12,0)
+ I BEG<1            D ERR(2300012)          G CONT
+"RTN","EDPRPT",13,0)
+ I RPT="SHIFT"      D SFT^EDPRPT5(BEG)      G CONT
+"RTN","EDPRPT",14,0)
+ I END<1            D ERR(2300012)          G CONT
+"RTN","EDPRPT",15,0)
+ I RPT="ACTIVITY"   D ACT^EDPRPT1(BEG,END)  G CONT
+"RTN","EDPRPT",16,0)
+ I RPT["DELAY"      D DEL^EDPRPT2(BEG,END)  G CONT
+"RTN","EDPRPT",17,0)
+ I RPT="SUMMARY"    D SUM^EDPRPT4(BEG,END)  G CONT
+"RTN","EDPRPT",18,0)
+ I RPT="MISSEDOP"   D MO^EDPRPT3(BEG,END)   G CONT
+"RTN","EDPRPT",19,0)
+ I RPT="PROVIDER"   D PRV^EDPRPT6(BEG,END)  G CONT
+"RTN","EDPRPT",20,0)
+ I RPT="ACUITY"     D ACU^EDPRPT8(BEG,END)  G CONT
+"RTN","EDPRPT",21,0)
+ I RPT="PATIENT"    D XRF^EDPRPT9(BEG,END)  G CONT
+"RTN","EDPRPT",22,0)
+ I RPT="ADMISSIONS" D ADM^EDPRPT10(BEG,END) G CONT
+"RTN","EDPRPT",23,0)
+ I RPT="INTAKE"     D CNT^EDPRPT11(BEG,END) G CONT
+"RTN","EDPRPT",24,0)
+ I RPT="ORDERS"     D ORD^EDPRPT12(BEG,END) G CONT
+"RTN","EDPRPT",25,0)
+ I RPT="BVAC"       D EN^EDPRPTBV(BEG,END)  G CONT
+"RTN","EDPRPT",26,0)
+ ; else
+"RTN","EDPRPT",27,0)
+ D ERR(2300011)
+"RTN","EDPRPT",28,0)
+CONT ; end switch
+"RTN","EDPRPT",29,0)
+ Q
+"RTN","EDPRPT",30,0)
+ ;
+"RTN","EDPRPT",31,0)
+ERR(MSG) ; -- return error MSG
+"RTN","EDPRPT",32,0)
+ N X S X=$$MSG^EDPX(MSG)
+"RTN","EDPRPT",33,0)
+ I $G(CSV) D ADD^EDPCSV(X) Q
+"RTN","EDPRPT",34,0)
+ D XML^EDPX("<error msg='"_X_"' />")
+"RTN","EDPRPT",35,0)
+ Q
+"RTN","EDPRPT",36,0)
+ ;
+"RTN","EDPRPT",37,0)
+NOW() ; -- Return local value of NOW, based on EDPSITE
+"RTN","EDPRPT",38,0)
+ Q $$NOW^XLFDT
+"RTN","EDPRPT",39,0)
+ ;
+"RTN","EDPRPT",40,0)
+PROV(MD) ; add list of assigned providers to XML
+"RTN","EDPRPT",41,0)
+ N I,X0,X
+"RTN","EDPRPT",42,0)
+ D XML^EDPX("<providers>")
+"RTN","EDPRPT",43,0)
+ S I=0 F  S I=$O(MD(I)) Q:I<1  D
+"RTN","EDPRPT",44,0)
+ . S X0=$G(^VA(200,I,0)),X="<md id='"_I_"' name='"_$$ESC^EDPX($P(X0,U))_"' initials='"_$$ESC^EDPX($P(X0,U,2))_"'/>"
+"RTN","EDPRPT",45,0)
+ . D XML^EDPX(X)
+"RTN","EDPRPT",46,0)
+ D XML^EDPX("</providers>")
+"RTN","EDPRPT",47,0)
+ Q
+"RTN","EDPRPT",48,0)
+ ;
+"RTN","EDPRPT",49,0)
+ECODE(IEN) ; Return external value for a Code
+"RTN","EDPRPT",50,0)
+ ;Q:$G(IEN) $P($G(^EDPB(233.1,+IEN,0)),U,3) ;code
+"RTN","EDPRPT",51,0)
+ N X0,LIST,DA,Y S IEN=+$G(IEN)
+"RTN","EDPRPT",52,0)
+ S X0=$G(^EDPB(233.1,IEN,0)),LIST=EDPSTA_"."_$P($P(X0,U),".",2)
+"RTN","EDPRPT",53,0)
+ S DA=+$O(^EDPB(233.2,"AS",LIST,IEN,0)),Y=""
+"RTN","EDPRPT",54,0)
+ I DA S Y=$P($G(^EDPB(233.2,"AS",LIST,IEN,DA)),U)
+"RTN","EDPRPT",55,0)
+ I Y="" S Y=$P(X0,U,3) ;use nat'l value if no local
+"RTN","EDPRPT",56,0)
+ Q Y
+"RTN","EDPRPT",57,0)
+ ;
+"RTN","EDPRPT",58,0)
+ENAME(IEN) ; Return external value for a code Name
+"RTN","EDPRPT",59,0)
+ N X0,LIST,DA,Y S IEN=+$G(IEN)
+"RTN","EDPRPT",60,0)
+ S X0=$G(^EDPB(233.1,IEN,0)),LIST=EDPSTA_"."_$P($P(X0,U),".",2)
+"RTN","EDPRPT",61,0)
+ S DA=$O(^EDPB(233.2,"AS",LIST,IEN,0)),Y=""
+"RTN","EDPRPT",62,0)
+ I DA S Y=$P($G(^EDPB(233.2,"AS",LIST,IEN,DA)),U,2)
+"RTN","EDPRPT",63,0)
+ I Y="" S Y=$P(X0,U,2) ;use nat'l value if no local
+"RTN","EDPRPT",64,0)
+ Q Y
+"RTN","EDPRPT",65,0)
+ ;
+"RTN","EDPRPT",66,0)
+EPERS(IEN) ; Return external value for a Person (file 200)
+"RTN","EDPRPT",67,0)
+ Q:$G(IEN) $P($G(^VA(200,+IEN,0)),U)
+"RTN","EDPRPT",68,0)
+ Q ""
+"RTN","EDPRPT",69,0)
+ ;
+"RTN","EDPRPT",70,0)
+EDATE(FMDT) ; Return external value for a Date/Time
+"RTN","EDPRPT",71,0)
+ Q:$G(FMDT) $TR($$FMTE^XLFDT(FMDT,"2M"),"@"," ") ;MM/DD/YY HH:MM
+"RTN","EDPRPT",72,0)
+ Q ""
+"RTN","EDPRPT",73,0)
+ ;
+"RTN","EDPRPT",74,0)
+ETIME(MINS) ; Return #minutes as HH:MM
+"RTN","EDPRPT",75,0)
+ N H,M,Y S MINS=+$G(MINS)
+"RTN","EDPRPT",76,0)
+ S H=MINS\60,M=MINS#60
+"RTN","EDPRPT",77,0)
+ S Y=H_":"_$S($L(M)=1:"0"_M,1:M)
+"RTN","EDPRPT",78,0)
+ Q Y
+"RTN","EDPRPT",79,0)
+ ;
+"RTN","EDPRPT",80,0)
+MD(LOG) ; Return time physician was first assigned
+"RTN","EDPRPT",81,0)
+ N IDX,ROOT,D,X,Y S Y="",LOG=+$G(LOG)
+"RTN","EDPRPT",82,0)
+ S IDX=$NA(^EDP(230.1,"ADF",LOG)),ROOT=$TR(IDX,")")
+"RTN","EDPRPT",83,0)
+ F  S IDX=$Q(@IDX) Q:$P(IDX,",",1,3)'=ROOT  D  Q:Y
+"RTN","EDPRPT",84,0)
+ . S D=+$P(IDX,",",4),X=$P($G(^EDP(230.1,+$P(IDX,",",5),3)),U,5)
+"RTN","EDPRPT",85,0)
+ . I X'="" S Y=D
+"RTN","EDPRPT",86,0)
+ Q Y
+"RTN","EDPRPT",87,0)
+ ;
+"RTN","EDPRPT",88,0)
+ACUITY(LOG) ; Return time acuity was first assigned
+"RTN","EDPRPT",89,0)
+ N IDX,ROOT,D,X,Y S Y="",LOG=+$G(LOG)
+"RTN","EDPRPT",90,0)
+ S IDX=$NA(^EDP(230.1,"ADF",LOG)),ROOT=$TR(IDX,")")
+"RTN","EDPRPT",91,0)
+ F  S IDX=$Q(@IDX) Q:$P(IDX,",",1,3)'=ROOT  D  Q:Y
+"RTN","EDPRPT",92,0)
+ . S D=+$P(IDX,",",4),X=$P($G(^EDP(230.1,+$P(IDX,",",5),3)),U,3)
+"RTN","EDPRPT",93,0)
+ . S:X Y=D
+"RTN","EDPRPT",94,0)
+ Q Y
+"RTN","EDPRPT",95,0)
+ ;
+"RTN","EDPRPT",96,0)
+LVWAITRM(LOG) ; Return time patient left waiting room
+"RTN","EDPRPT",97,0)
+ N IDX,ROOT,D,D1,X,ROOM S Y="",LOG=+$G(LOG)
+"RTN","EDPRPT",98,0)
+ ; get list of room changes in ROOM(time)= 231.8 ien
+"RTN","EDPRPT",99,0)
+ S IDX=$NA(^EDP(230.1,"ADF",LOG)),ROOT=$TR(IDX,")")
+"RTN","EDPRPT",100,0)
+ F  S IDX=$Q(@IDX) Q:$P(IDX,",",1,3)'=ROOT  D
+"RTN","EDPRPT",101,0)
+ . S D=+$P(IDX,",",4),X=+$P($G(^EDP(230.1,+$P(IDX,",",5),3)),U,4)
+"RTN","EDPRPT",102,0)
+ . I X,D S ROOM(D)=X
+"RTN","EDPRPT",103,0)
+ ; look for movement in and out of waiting room
+"RTN","EDPRPT",104,0)
+ S D=0 F  S D=$O(ROOM(D)) Q:D<1  S D1=$O(ROOM(D)) D  Q:Y
+"RTN","EDPRPT",105,0)
+ . N RM,NXT S RM=ROOM(D),NXT=$S(D1:ROOM(D1),1:0)
+"RTN","EDPRPT",106,0)
+ . I NXT,NXT'=RM,$$WAIT(RM),'$$WAIT(NXT) S Y=D1 ;$S(D1:D1,1:OUT)
+"RTN","EDPRPT",107,0)
+ Q Y
+"RTN","EDPRPT",108,0)
+ ;
+"RTN","EDPRPT",109,0)
+WAIT(X) ; Return 1 or 0, if X is a waiting room
+"RTN","EDPRPT",110,0)
+ Q $P($G(^EDPB(231.8,+$G(X),0)),U,9)=2
+"RTN","EDPRPT",111,0)
+ ;
+"RTN","EDPRPT",112,0)
+ADMIT(LOG) ; Return 1st time admitting disposition was assigned
+"RTN","EDPRPT",113,0)
+ N D,I,X0,X,Y,OUT S Y="",LOG=+$G(LOG)
+"RTN","EDPRPT",114,0)
+ S D=0 F  S D=$O(^EDP(230.1,"ADF",LOG,D)) Q:D<1  S I=+$O(^(D,0)) D  Q:Y
+"RTN","EDPRPT",115,0)
+ . S X0=$G(^EDP(230.1,I,0))
+"RTN","EDPRPT",116,0)
+ . I $P(X0,U,11),$P($G(^EDPB(233.1,+$P(X0,U,11),0)),U,5)["A" S Y=D
+"RTN","EDPRPT",117,0)
+ I Y="" D  ;ck old format
+"RTN","EDPRPT",118,0)
+ . N X1 S X1=$G(^EDP(230,LOG,1))
+"RTN","EDPRPT",119,0)
+ . I $P(X1,U,2),$P($G(^EDPB(233.1,+$P(X1,U,2),0)),U,5)["A" S Y=$P(X1,U,3)
+"RTN","EDPRPT",120,0)
+ I Y S OUT=$P($G(^EDP(230,LOG,0)),U,9) S:OUT&(OUT<Y) Y=OUT ;use Time Out if earlier
+"RTN","EDPRPT",121,0)
+ Q Y
+"RTN","EDPRPT1")
+0^11^B33605254
+"RTN","EDPRPT1",1,0)
+EDPRPT1 ;SLC/MKB - Activity Report
+"RTN","EDPRPT1",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;**1**;Sep 30, 2009;Build 74
+"RTN","EDPRPT1",3,0)
+ ;
+"RTN","EDPRPT1",4,0)
+ACT(BEG,END) ; Get Activity Report for EDPSITE by date range
+"RTN","EDPRPT1",5,0)
+ N LOG,X,X0,X1,X3,DX,IN,OUT,ROW,PROV,I
+"RTN","EDPRPT1",6,0)
+ N ELAPSE,TRIAGE,WAIT,ADMDEC,ADMDEL,ALL,ADM,NOT,DISP
+"RTN","EDPRPT1",7,0)
+ D INIT ;set counters, sums to 0
+"RTN","EDPRPT1",8,0)
+ D:'$G(CSV) XML^EDPX("<logEntries>") I $G(CSV) D  ;headers
+"RTN","EDPRPT1",9,0)
+ . N TAB S TAB=$C(9)
+"RTN","EDPRPT1",10,0)
+ . S X="ED"_TAB_"Time In"_TAB_"Time Out"_TAB_"Complaint"_TAB_"MD"_TAB_"Acuity"_TAB_"Elapsed"_TAB_"Triage"_TAB_"Wait"_TAB_"Dispo"_TAB_"Adm Dec"_TAB_"Adm Delay"_TAB_"Arrival"_TAB_"Diagnosis"_TAB_"ICD9"
+"RTN","EDPRPT1",11,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT1",12,0)
+ S IN=BEG-.000001
+"RTN","EDPRPT1",13,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT1",14,0)
+ . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3))
+"RTN","EDPRPT1",15,0)
+ . S OUT=$P(X0,U,9),DX=$$DXPRI^EDPQPCE(+$P(X0,U,3),LOG)
+"RTN","EDPRPT1",16,0)
+ . K ROW S ROW("id")=LOG,ALL=ALL+1
+"RTN","EDPRPT1",17,0)
+ . S ROW("inTS")=$S($G(CSV):$$EDATE^EDPRPT(IN),1:IN)
+"RTN","EDPRPT1",18,0)
+ . S ROW("outTS")=$S($G(CSV):$$EDATE^EDPRPT(OUT),1:OUT)
+"RTN","EDPRPT1",19,0)
+ . S ROW("complaint")=$P(X1,U)
+"RTN","EDPRPT1",20,0)
+ . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),ROW("disposition")=DISP
+"RTN","EDPRPT1",21,0)
+ . S ROW("arrival")=$$ENAME^EDPRPT($P(X1,U,10))
+"RTN","EDPRPT1",22,0)
+ . S ROW("acuity")=$$ECODE^EDPRPT($P(X3,U,3))
+"RTN","EDPRPT1",23,0)
+ . S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5))
+"RTN","EDPRPT1",24,0)
+ . S:$P(X3,U,5) PROV(+$P(X3,U,5))=""
+"RTN","EDPRPT1",25,0)
+ . S ROW("icd")=$P(DX,U),ROW("dx")=$P(DX,U,2)
+"RTN","EDPRPT1",26,0)
+ . S:'$L(DISP) DISP="none" S DISP(DISP)=DISP(DISP)+1
+"RTN","EDPRPT1",27,0)
+ . ;
+"RTN","EDPRPT1",28,0)
+A1 . ; calculate times
+"RTN","EDPRPT1",29,0)
+ . ; S:OUT="" OUT=NOW ;for calculations
+"RTN","EDPRPT1",30,0)
+ . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0)
+"RTN","EDPRPT1",31,0)
+ . S ROW("elapsed")=ELAPSE_$S(ELAPSE>359:" *",1:"")
+"RTN","EDPRPT1",32,0)
+ . S ALL("elapsed")=ALL("elapsed")+ELAPSE
+"RTN","EDPRPT1",33,0)
+ . S DISP(DISP,"elapsed")=DISP(DISP,"elapsed")+ELAPSE
+"RTN","EDPRPT1",34,0)
+ . ;
+"RTN","EDPRPT1",35,0)
+ . S X=$$ACUITY^EDPRPT(LOG),TRIAGE=0 ;S:X<1 X=OUT
+"RTN","EDPRPT1",36,0)
+ . S:X TRIAGE=($$FMDIFF^XLFDT(X,IN,2)\60)
+"RTN","EDPRPT1",37,0)
+ . S ROW("triage")=TRIAGE,ALL("triage")=ALL("triage")+TRIAGE
+"RTN","EDPRPT1",38,0)
+ . S DISP(DISP,"triage")=DISP(DISP,"triage")+TRIAGE
+"RTN","EDPRPT1",39,0)
+ . ;
+"RTN","EDPRPT1",40,0)
+ . S X=$$LVWAITRM^EDPRPT(LOG),WAIT=0
+"RTN","EDPRPT1",41,0)
+ . S:X WAIT=($$FMDIFF^XLFDT(X,IN,2)\60)
+"RTN","EDPRPT1",42,0)
+ . S ROW("wait")=WAIT,ALL("wait")=ALL("wait")+WAIT
+"RTN","EDPRPT1",43,0)
+ . S DISP(DISP,"wait")=DISP(DISP,"wait")+WAIT
+"RTN","EDPRPT1",44,0)
+ . ;
+"RTN","EDPRPT1",45,0)
+ . S X=$$ADMIT^EDPRPT(LOG) I X<1 D
+"RTN","EDPRPT1",46,0)
+ .. S NOT=NOT+1,NOT("elapsed")=NOT("elapsed")+ELAPSE
+"RTN","EDPRPT1",47,0)
+ .. S NOT("triage")=NOT("triage")+TRIAGE
+"RTN","EDPRPT1",48,0)
+ .. S NOT("wait")=NOT("wait")+WAIT
+"RTN","EDPRPT1",49,0)
+ . E  D  ;decision to admit
+"RTN","EDPRPT1",50,0)
+ .. S ADMDEC=($$FMDIFF^XLFDT(X,IN,2)\60)
+"RTN","EDPRPT1",51,0)
+ .. S ADMDEL=$S(OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0)
+"RTN","EDPRPT1",52,0)
+ .. S ROW("admDec")=ADMDEC,ROW("admDel")=ADMDEL
+"RTN","EDPRPT1",53,0)
+ .. S ADM=ADM+1,ADM("elapsed")=ADM("elapsed")+ELAPSE
+"RTN","EDPRPT1",54,0)
+ .. S ADM("triage")=ADM("triage")+TRIAGE
+"RTN","EDPRPT1",55,0)
+ .. S ADM("wait")=ADM("wait")+WAIT
+"RTN","EDPRPT1",56,0)
+ .. S ADM("admDec")=ADM("admDec")+ADMDEC
+"RTN","EDPRPT1",57,0)
+ .. S ADM("admDel")=ADM("admDel")+ADMDEL
+"RTN","EDPRPT1",58,0)
+ .. S DISP(DISP,"admDec")=DISP(DISP,"admDec")+ADMDEC
+"RTN","EDPRPT1",59,0)
+ .. S DISP(DISP,"admDel")=DISP(DISP,"admDel")+ADMDEL
+"RTN","EDPRPT1",60,0)
+ . ;
+"RTN","EDPRPT1",61,0)
+ . I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q
+"RTN","EDPRPT1",62,0)
+ . S X=ROW("id")
+"RTN","EDPRPT1",63,0)
+ . F I="inTS","outTS","complaint","md","acuity","elapsed","triage","wait","disposition","admDec","admDel","arrival","dx","icd" S X=X_$C(9)_$G(ROW(I))
+"RTN","EDPRPT1",64,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT1",65,0)
+ D:'$G(CSV) XML^EDPX("</logEntries>")
+"RTN","EDPRPT1",66,0)
+ ;
+"RTN","EDPRPT1",67,0)
+A2 ; calculate & include averages
+"RTN","EDPRPT1",68,0)
+ Q:ALL<1  ;no visits found
+"RTN","EDPRPT1",69,0)
+ S ALL("type")="All Patients",NOT("type")="Not Admitted",ADM("type")="Admitted"
+"RTN","EDPRPT1",70,0)
+ F I="elapsed","triage","wait" S ALL(I)=$$ETIME^EDPRPT(ALL(I)\ALL)
+"RTN","EDPRPT1",71,0)
+ F I="elapsed","triage","wait" S NOT(I)=$S(NOT:$$ETIME^EDPRPT(NOT(I)\NOT),1:"00:00")
+"RTN","EDPRPT1",72,0)
+ F I="elapsed","triage","wait","admDec","admDel" S ADM(I)=$S(ADM:$$ETIME^EDPRPT(ADM(I)\ADM),1:"00:00")
+"RTN","EDPRPT1",73,0)
+ F I="admDec","admDel" S ALL(I)=ADM(I)
+"RTN","EDPRPT1",74,0)
+ S ALL("total")=ALL,NOT("total")=NOT,ADM("total")=ADM
+"RTN","EDPRPT1",75,0)
+ S X="" F  S X=$O(DISP(X)) Q:X=""  I DISP(X) D
+"RTN","EDPRPT1",76,0)
+ . S DISP(X,"total")=DISP(X),DISP(X,"type")=X
+"RTN","EDPRPT1",77,0)
+ . F I="elapsed","triage","wait","admDec","admDel" S DISP(X,I)=$$ETIME^EDPRPT(DISP(X,I)\DISP(X))
+"RTN","EDPRPT1",78,0)
+ ;
+"RTN","EDPRPT1",79,0)
+A3 I $G(CSV) D  Q  ;CSV format
+"RTN","EDPRPT1",80,0)
+ . N TAB,D S TAB=$C(9)
+"RTN","EDPRPT1",81,0)
+ . D BLANK^EDPCSV
+"RTN","EDPRPT1",82,0)
+ . S X=TAB_"Total Patients"_TAB_ALL_TAB_TAB_TAB_TAB_ALL("elapsed")_TAB_ALL("triage")_TAB_ALL("wait")_TAB_TAB_ALL("admDec")_TAB_ALL("admDel")
+"RTN","EDPRPT1",83,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT1",84,0)
+ . S X=TAB_TAB_TAB_TAB_"Total"_TAB_"Visit"_TAB_"Triage"_TAB_"Wait"_TAB_"Adm Dec"_TAB_"Adm Del"
+"RTN","EDPRPT1",85,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT1",86,0)
+ . S X=TAB_TAB_TAB_"Patients Not Admitted"_TAB_NOT_TAB_NOT("elapsed")_TAB_NOT("triage")_TAB_NOT("wait")
+"RTN","EDPRPT1",87,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT1",88,0)
+ . S X=TAB_TAB_TAB_"Patients Admitted"_TAB_ADM_TAB_ADM("elapsed")_TAB_ADM("triage")_TAB_ADM("wait")_TAB_ADM("admDec")_TAB_ADM("admDel")
+"RTN","EDPRPT1",89,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT1",90,0)
+ . S X=TAB_TAB_TAB_"Disposition" D ADD^EDPCSV(X)
+"RTN","EDPRPT1",91,0)
+ . S D="" F  S D=$O(DISP(D)) Q:D=""  I DISP(D) D
+"RTN","EDPRPT1",92,0)
+ .. S X=D_TAB_DISP(D)_TAB_DISP(D,"elapsed")_TAB_DISP(D,"triage")_TAB_DISP(D,"wait")_TAB_DISP(D,"admDec")_TAB_DISP(D,"admDel")
+"RTN","EDPRPT1",93,0)
+ .. D ADD^EDPCSV(X)
+"RTN","EDPRPT1",94,0)
+ D XML^EDPX("<averages>")
+"RTN","EDPRPT1",95,0)
+ S X=$$XMLA^EDPX("average",.ALL) D XML^EDPX(X)
+"RTN","EDPRPT1",96,0)
+ S X=$$XMLA^EDPX("average",.NOT) D XML^EDPX(X)
+"RTN","EDPRPT1",97,0)
+ S X=$$XMLA^EDPX("average",.ADM) D XML^EDPX(X)
+"RTN","EDPRPT1",98,0)
+ S I="" F  S I=$O(DISP(I)) Q:I=""  I DISP(I) K ROW M ROW=DISP(I) S X=$$XMLA^EDPX("average",.ROW) D XML^EDPX(X)
+"RTN","EDPRPT1",99,0)
+ D XML^EDPX("</averages>")
+"RTN","EDPRPT1",100,0)
+ ; include list of providers assigned
+"RTN","EDPRPT1",101,0)
+ I $O(PROV(0)) D PROV^EDPRPT(.PROV)
+"RTN","EDPRPT1",102,0)
+ Q
+"RTN","EDPRPT1",103,0)
+ ;
+"RTN","EDPRPT1",104,0)
+INIT ; Initialize counters and sums
+"RTN","EDPRPT1",105,0)
+ N I,DA,X,Y S (ALL,ADM,NOT)=0
+"RTN","EDPRPT1",106,0)
+ F I="elapsed","triage","wait" S (ALL(I),NOT(I),ADM(I))=0
+"RTN","EDPRPT1",107,0)
+ F I="admDec","admDel" S ADM(I)=0
+"RTN","EDPRPT1",108,0)
+ S X="" F  S X=$O(^EDPB(233.1,"AB","disposition",X)) Q:X=""  D
+"RTN","EDPRPT1",109,0)
+ . S DA=0 F  S DA=$O(^EDPB(233.1,"AB","disposition",X,DA)) Q:DA<1  D
+"RTN","EDPRPT1",110,0)
+ .. S Y=$$ECODE^EDPRPT(DA) Q:'$L(Y)  S DISP(Y)=0
+"RTN","EDPRPT1",111,0)
+ .. F I="elapsed","triage","wait","admDec","admDel" S DISP(Y,I)=0
+"RTN","EDPRPT1",112,0)
+ S DISP("none")=0 F I="elapsed","triage","wait","admDec","admDel" S DISP("none",I)=0
+"RTN","EDPRPT1",113,0)
+ Q
+"RTN","EDPRPT10")
+0^12^B19172294
+"RTN","EDPRPT10",1,0)
+EDPRPT10 ;SLC/MKB - Admissions Report
+"RTN","EDPRPT10",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT10",3,0)
+ ;
+"RTN","EDPRPT10",4,0)
+ADM(BEG,END) ; Get Admissions Report for EDPSITE by date range
+"RTN","EDPRPT10",5,0)
+ N IN,OUT,LOG,X,X0,X1,X3,DX,DISP,ROW,TAB
+"RTN","EDPRPT10",6,0)
+ N ELAPSE,TRIAGE,WAIT,ADMDEC,ADMDEL
+"RTN","EDPRPT10",7,0)
+ D INIT ;set counters, sums to 0
+"RTN","EDPRPT10",8,0)
+ D:'$G(CSV) XML^EDPX("<logEntries>") I $G(CSV) D  ;headers
+"RTN","EDPRPT10",9,0)
+ . S TAB=$C(9)
+"RTN","EDPRPT10",10,0)
+ . S X="ED"_TAB_"Time Out"_TAB_"Complaint"_TAB_"MD"_TAB_"Acuity"_TAB_"Dispo"_TAB_"Adm Dec"_TAB_"Adm Delay"_TAB_"Diagnosis"_TAB_"ICD9" ;_TAB_"ER Spec Visit"
+"RTN","EDPRPT10",11,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT10",12,0)
+ S IN=BEG-.000001
+"RTN","EDPRPT10",13,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT10",14,0)
+ . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3))
+"RTN","EDPRPT10",15,0)
+ . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),OUT=$P(X0,U,9)
+"RTN","EDPRPT10",16,0)
+ . Q:DISP=""  Q:'$D(CNT($$UP^XLFSTR(DISP)))  ;visits w/admit disp
+"RTN","EDPRPT10",17,0)
+ . S DX=$$DXPRI^EDPQPCE(+$P(X0,U,3),LOG)
+"RTN","EDPRPT10",18,0)
+ . K ROW S ROW("id")=LOG
+"RTN","EDPRPT10",19,0)
+ . S ROW("outTS")=$S($G(CSV):$$EDATE^EDPRPT(OUT),1:OUT)
+"RTN","EDPRPT10",20,0)
+ . S ROW("complaint")=$P(X1,U)
+"RTN","EDPRPT10",21,0)
+ . S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5))
+"RTN","EDPRPT10",22,0)
+ . S ROW("acuity")=$$ECODE^EDPRPT($P(X3,U,3))
+"RTN","EDPRPT10",23,0)
+ . S ROW("disposition")=DISP,DISP=$$UP^XLFSTR(DISP)
+"RTN","EDPRPT10",24,0)
+ . S ROW("icd")=$P(DX,U),ROW("dx")=$P(DX,U,2)
+"RTN","EDPRPT10",25,0)
+ . ; ER Special Visit ?? -- ck ^DPT dispositions
+"RTN","EDPRPT10",26,0)
+ . S CNT("ALL")=CNT("ALL")+1,CNT(DISP)=CNT(DISP)+1
+"RTN","EDPRPT10",27,0)
+ . ;
+"RTN","EDPRPT10",28,0)
+A1 . ; calculate times
+"RTN","EDPRPT10",29,0)
+ . ; S:OUT="" OUT=NOW
+"RTN","EDPRPT10",30,0)
+ . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0)
+"RTN","EDPRPT10",31,0)
+ . F I="ALL",DISP S MIN(I,"elapsed")=MIN(I,"elapsed")+ELAPSE
+"RTN","EDPRPT10",32,0)
+ . ;
+"RTN","EDPRPT10",33,0)
+ . S X=$$ACUITY^EDPRPT(LOG),TRIAGE=0 ;S:X<1 X=OUT
+"RTN","EDPRPT10",34,0)
+ . S:X TRIAGE=($$FMDIFF^XLFDT(X,IN,2)\60)
+"RTN","EDPRPT10",35,0)
+ . F I="ALL",DISP S MIN(I,"triage")=MIN(I,"triage")+TRIAGE
+"RTN","EDPRPT10",36,0)
+ . ;
+"RTN","EDPRPT10",37,0)
+ . S X=$$LVWAITRM^EDPRPT(LOG),WAIT=0 ;leave waiting room
+"RTN","EDPRPT10",38,0)
+ . S:X WAIT=($$FMDIFF^XLFDT(X,IN,2)\60)
+"RTN","EDPRPT10",39,0)
+ . F I="ALL",DISP S MIN(I,"wait")=MIN(I,"wait")+WAIT
+"RTN","EDPRPT10",40,0)
+ . ;
+"RTN","EDPRPT10",41,0)
+ . S X=$$ADMIT^EDPRPT(LOG) ;decision to admit
+"RTN","EDPRPT10",42,0)
+ . S ADMDEC=$S(X:($$FMDIFF^XLFDT(X,IN,2)\60),1:0)
+"RTN","EDPRPT10",43,0)
+ . F I="ALL",DISP S MIN(I,"admDec")=MIN(I,"admDec")+ADMDEC
+"RTN","EDPRPT10",44,0)
+ . S ROW("admDec")=ADMDEC
+"RTN","EDPRPT10",45,0)
+ . ;
+"RTN","EDPRPT10",46,0)
+ . S ADMDEL=$S(X:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0)
+"RTN","EDPRPT10",47,0)
+ . F I="ALL",DISP S MIN(I,"admDel")=MIN(I,"admDel")+ADMDEL
+"RTN","EDPRPT10",48,0)
+ . S ROW("admDel")=ADMDEL
+"RTN","EDPRPT10",49,0)
+ . ;
+"RTN","EDPRPT10",50,0)
+ . I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q
+"RTN","EDPRPT10",51,0)
+ . S X=ROW("id")
+"RTN","EDPRPT10",52,0)
+ . F I="outTS","complaint","md","acuity","disposition","admDec","admDel","dx","icd" S X=X_$C(9)_$G(ROW(I))
+"RTN","EDPRPT10",53,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT10",54,0)
+ D:'$G(CSV) XML^EDPX("</logEntries>")
+"RTN","EDPRPT10",55,0)
+ ;
+"RTN","EDPRPT10",56,0)
+A2 ; calculate & include averages
+"RTN","EDPRPT10",57,0)
+ Q:CNT("ALL")<1  ;no visits found
+"RTN","EDPRPT10",58,0)
+ I $G(CSV) D  Q  ;return as CSV
+"RTN","EDPRPT10",59,0)
+ . S X=TAB_TAB_TAB_"     Activity Summary"_TAB_"Total"_TAB_"Visit"_TAB_"Triage"_TAB_"Wait"_TAB_"Adm Dec"_TAB_"Adm Delay"
+"RTN","EDPRPT10",60,0)
+ . D BLANK^EDPCSV,ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT10",61,0)
+ . S X=TAB_TAB_TAB_"Total Patients VA Admitted"_TAB_CNT("ALL")
+"RTN","EDPRPT10",62,0)
+ . F I="elapsed","triage","wait","admDec","admDel" D
+"RTN","EDPRPT10",63,0)
+ .. S Y=MIN("ALL",I)\CNT("ALL"),X=X_TAB_$S(Y:$$ETIME^EDPRPT(Y),1:"0:00")
+"RTN","EDPRPT10",64,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT10",65,0)
+ . S X=TAB_TAB_TAB_"     Disposition" D ADD^EDPCSV(X)
+"RTN","EDPRPT10",66,0)
+ . S DISP="" F  S DISP=$O(CNT(DISP)) Q:DISP=""  I DISP'="ALL",CNT(DISP) D
+"RTN","EDPRPT10",67,0)
+ .. S X=TAB_TAB_TAB_DISP_TAB_CNT(DISP)
+"RTN","EDPRPT10",68,0)
+ .. F I="elapsed","triage","wait","admDec","admDel" D
+"RTN","EDPRPT10",69,0)
+ ... S Y=MIN(DISP,I)\CNT(DISP),X=X_TAB_$S(Y:$$ETIME^EDPRPT(Y),1:"0:00")
+"RTN","EDPRPT10",70,0)
+ .. D ADD^EDPCSV(X)
+"RTN","EDPRPT10",71,0)
+ ; or as XML
+"RTN","EDPRPT10",72,0)
+ D XML^EDPX("<averages>")
+"RTN","EDPRPT10",73,0)
+ S DISP="" F  S DISP=$O(CNT(DISP)) Q:DISP=""  I CNT(DISP) D
+"RTN","EDPRPT10",74,0)
+ . S MIN(DISP,"type")=$S(DISP="ALL":"Total Patients VA Admitted",1:DISP)
+"RTN","EDPRPT10",75,0)
+ . S MIN(DISP,"total")=CNT(DISP)
+"RTN","EDPRPT10",76,0)
+ . F I="elapsed","triage","wait","admDec","admDel" D
+"RTN","EDPRPT10",77,0)
+ .. S X=MIN(DISP,I)\CNT(DISP)
+"RTN","EDPRPT10",78,0)
+ .. S MIN(DISP,I)=$S(X:$$ETIME^EDPRPT(X),1:"0:00")
+"RTN","EDPRPT10",79,0)
+ . K ROW M ROW=MIN(DISP)
+"RTN","EDPRPT10",80,0)
+ . S X=$$XMLA^EDPX("average",.ROW) D XML^EDPX(X)
+"RTN","EDPRPT10",81,0)
+ D XML^EDPX("</averages>")
+"RTN","EDPRPT10",82,0)
+ Q
+"RTN","EDPRPT10",83,0)
+ ;
+"RTN","EDPRPT10",84,0)
+INIT ; Initialize counters and sums
+"RTN","EDPRPT10",85,0)
+ N I,DISP
+"RTN","EDPRPT10",86,0)
+ ;F D="VA","T","ICU","OBS","ALL" D
+"RTN","EDPRPT10",87,0)
+ S DISP="" F  S DISP=$O(^EDPB(233.1,"AB","disposition",DISP)) Q:DISP=""  D
+"RTN","EDPRPT10",88,0)
+ . Q:'$$VADMIT^EDPRPT2(DISP)
+"RTN","EDPRPT10",89,0)
+ . S CNT(DISP)=0
+"RTN","EDPRPT10",90,0)
+ . F I="elapsed","triage","wait","admDec","admDel" S MIN(DISP,I)=0
+"RTN","EDPRPT10",91,0)
+ S CNT("ALL")=0
+"RTN","EDPRPT10",92,0)
+ F I="elapsed","triage","wait","admDec","admDel" S MIN("ALL",I)=0
+"RTN","EDPRPT10",93,0)
+ Q
+"RTN","EDPRPT10",94,0)
+ ;
+"RTN","EDPRPT10",95,0)
+ECODE(IEN) ; Return external value for a Code
+"RTN","EDPRPT10",96,0)
+ Q:IEN $P($G(^EDPB(233.1,IEN,0)),U,2) ;name
+"RTN","EDPRPT10",97,0)
+ Q ""
+"RTN","EDPRPT11")
+0^13^B8054102
+"RTN","EDPRPT11",1,0)
+EDPRPT11 ;SLC/MKB - Patient Intake Report
+"RTN","EDPRPT11",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT11",3,0)
+ ;
+"RTN","EDPRPT11",4,0)
+CNT(BEG,END) ; Get Patient Intake Report for EDPSITE by date range
+"RTN","EDPRPT11",5,0)
+ ;   CNT = counters
+"RTN","EDPRPT11",6,0)
+ N IN,LOG,LAST,X,CNT,HR,DAY,%H,%T,%Y,H,D,ROW,AVG,NM,TAB,DAYS
+"RTN","EDPRPT11",7,0)
+ D INIT S LAST="" ;set counters to 0
+"RTN","EDPRPT11",8,0)
+ S IN=BEG-.000001,TAB=$C(9)
+"RTN","EDPRPT11",9,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT11",10,0)
+ . S X=$P($G(^EDP(230,LOG,0)),U,8) Q:X<1
+"RTN","EDPRPT11",11,0)
+ . D H^%DTC S H=%T\3600,D=%Y
+"RTN","EDPRPT11",12,0)
+ . S CNT=CNT+1,HR(H)=HR(H)+1,CNT(H,D)=CNT(H,D)+1
+"RTN","EDPRPT11",13,0)
+ . S DAY(D)=DAY(D)+1
+"RTN","EDPRPT11",14,0)
+ . I LAST=""!($P(LAST,".")'=$P(IN,".")) S DAYS(D)=DAYS(D)+1,LAST=IN
+"RTN","EDPRPT11",15,0)
+C1 ; return counts and averages
+"RTN","EDPRPT11",16,0)
+ D:'$G(CSV) XML^EDPX("<averages>") I $G(CSV) D  ;headers
+"RTN","EDPRPT11",17,0)
+ . S X="Time/Day"_TAB_"Sunday"_TAB_"Monday"_TAB_"Tuesday"_TAB_"Wednesday"_TAB_"Thursday"_TAB_"Friday"_TAB_"Saturday"_TAB_"Totals"_TAB_"Avg/Day"
+"RTN","EDPRPT11",18,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT11",19,0)
+ F H=0:1:23 D
+"RTN","EDPRPT11",20,0)
+ . K ROW S ROW("time")=$$TIME(H)_"-"_$$TIME(H+1)
+"RTN","EDPRPT11",21,0)
+ . S ROW=ROW("time") ;CSV
+"RTN","EDPRPT11",22,0)
+ . F D=0:1:6 S NM=$$NAME(D) D
+"RTN","EDPRPT11",23,0)
+ .. S ROW(NM)=CNT(H,D)
+"RTN","EDPRPT11",24,0)
+ .. S ROW=ROW_TAB_ROW(NM) ;CSV
+"RTN","EDPRPT11",25,0)
+ . S ROW("total")=HR(H),ROW("average")=$$ROUND(HR(H)/DAYS)
+"RTN","EDPRPT11",26,0)
+ . I '$G(CSV) S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) Q
+"RTN","EDPRPT11",27,0)
+ . S ROW=ROW_TAB_ROW("total")_TAB_ROW("average") D ADD^EDPCSV(ROW)
+"RTN","EDPRPT11",28,0)
+ ; total & average rows
+"RTN","EDPRPT11",29,0)
+ K ROW S ROW("time")="Totals",ROW=ROW("time")
+"RTN","EDPRPT11",30,0)
+ S AVG("time")="Avg/Hour",AVG=AVG("time")
+"RTN","EDPRPT11",31,0)
+ F D=0:1:6 S NM=$$NAME(D) D
+"RTN","EDPRPT11",32,0)
+ . S ROW(NM)=DAY(D),X=0
+"RTN","EDPRPT11",33,0)
+ . S:DAYS(D) X=DAY(D)/(24*DAYS(D))
+"RTN","EDPRPT11",34,0)
+ . S AVG(NM)=$$ROUND(X)
+"RTN","EDPRPT11",35,0)
+ . S ROW=ROW_TAB_ROW(NM) ;CSV
+"RTN","EDPRPT11",36,0)
+ . S AVG=AVG_TAB_AVG(NM) ;CSV
+"RTN","EDPRPT11",37,0)
+ S ROW("total")=CNT,ROW("average")=$$ROUND(CNT/DAYS)
+"RTN","EDPRPT11",38,0)
+ S ROW=ROW_TAB_ROW("total")_TAB_ROW("average")
+"RTN","EDPRPT11",39,0)
+ I $G(CSV) D BLANK^EDPCSV,ADD^EDPCSV(ROW),ADD^EDPCSV(AVG) Q
+"RTN","EDPRPT11",40,0)
+ S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X)
+"RTN","EDPRPT11",41,0)
+ S X=$$XMLA^EDPX("row",.AVG) D XML^EDPX(X)
+"RTN","EDPRPT11",42,0)
+ D XML^EDPX("</averages>")
+"RTN","EDPRPT11",43,0)
+ Q
+"RTN","EDPRPT11",44,0)
+ ;
+"RTN","EDPRPT11",45,0)
+INIT ; Initialize counters and sums
+"RTN","EDPRPT11",46,0)
+ N H,D S CNT=0
+"RTN","EDPRPT11",47,0)
+ F H=0:1:23 S HR(H)=0 F D=0:1:6 S CNT(H,D)=0
+"RTN","EDPRPT11",48,0)
+ F D=0:1:6 S DAY(D)=0,DAYS(D)=0
+"RTN","EDPRPT11",49,0)
+ S DAYS=$$FMDIFF^XLFDT(END,BEG)+1
+"RTN","EDPRPT11",50,0)
+ Q
+"RTN","EDPRPT11",51,0)
+ ;
+"RTN","EDPRPT11",52,0)
+ROUND(X) ; Round X to one decimal place
+"RTN","EDPRPT11",53,0)
+ N Y1,Y2,Y S X=+$G(X)
+"RTN","EDPRPT11",54,0)
+ S Y1=+$P(X,"."),Y2=$E($P(X,".",2)_"00",1,2)
+"RTN","EDPRPT11",55,0)
+ S:$E(Y2,2)'>4 Y2=+$E(Y2) I $E(Y2,2)>4 D
+"RTN","EDPRPT11",56,0)
+ . I $E(Y2)=9 S Y1=Y1+1,Y2=0 Q
+"RTN","EDPRPT11",57,0)
+ . S Y2=$E(Y2)+1
+"RTN","EDPRPT11",58,0)
+ S Y=Y1_"."_Y2
+"RTN","EDPRPT11",59,0)
+ Q Y
+"RTN","EDPRPT11",60,0)
+ ;
+"RTN","EDPRPT11",61,0)
+ZROUND(X) ; Round X to nearest integer
+"RTN","EDPRPT11",62,0)
+ N Y S Y=+$E($P(X,".",2)),X=X\1
+"RTN","EDPRPT11",63,0)
+ S:Y>4 X=X+1
+"RTN","EDPRPT11",64,0)
+ Q X
+"RTN","EDPRPT11",65,0)
+ ;
+"RTN","EDPRPT11",66,0)
+TIME(X) ; Return 0000 form of hour# X
+"RTN","EDPRPT11",67,0)
+ N Y S Y=$S($L(X)=1:"0"_X,1:X)_"00"
+"RTN","EDPRPT11",68,0)
+ Q Y
+"RTN","EDPRPT11",69,0)
+ ;
+"RTN","EDPRPT11",70,0)
+NAME(X) ; Return name of day# X
+"RTN","EDPRPT11",71,0)
+ I X=1 Q "Monday"
+"RTN","EDPRPT11",72,0)
+ I X=2 Q "Tuesday"
+"RTN","EDPRPT11",73,0)
+ I X=3 Q "Wednesday"
+"RTN","EDPRPT11",74,0)
+ I X=4 Q "Thursday"
+"RTN","EDPRPT11",75,0)
+ I X=5 Q "Friday"
+"RTN","EDPRPT11",76,0)
+ I X=6 Q "Saturday"
+"RTN","EDPRPT11",77,0)
+ Q "Sunday"
+"RTN","EDPRPT12")
+0^50^B7797789
+"RTN","EDPRPT12",1,0)
+EDPRPT12 ;SLC/MKB - Orders by Acuity Report
+"RTN","EDPRPT12",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT12",3,0)
+ ;
+"RTN","EDPRPT12",4,0)
+ORD(BEG,END) ; Get Acuity Report for EDPSITE by date range
+"RTN","EDPRPT12",5,0)
+ ;   CNT = counters by acuity
+"RTN","EDPRPT12",6,0)
+ N IN,OUT,X,X0,I,SERV,ACU,CNT,ROW,EDLOC
+"RTN","EDPRPT12",7,0)
+ D INIT ;set counters, sums to 0
+"RTN","EDPRPT12",8,0)
+ S IN=BEG-.000001
+"RTN","EDPRPT12",9,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT12",10,0)
+ . S X=$P($G(^EDP(230,LOG,3)),U,3),ACU=$$ECODE(X)
+"RTN","EDPRPT12",11,0)
+ . I '$D(^EDP(230,LOG,8)) D FIND(LOG,ACU) Q  ;old/converted visit
+"RTN","EDPRPT12",12,0)
+ . S I=0 F  S I=$O(^EDP(230,LOG,8,I)) Q:I<1  S X0=$G(^(I,0)) D
+"RTN","EDPRPT12",13,0)
+ .. S SERV=$$ENAME($P(X0,U,2))
+"RTN","EDPRPT12",14,0)
+ .. S CNT(ACU,SERV)=CNT(ACU,SERV)+1
+"RTN","EDPRPT12",15,0)
+ ;
+"RTN","EDPRPT12",16,0)
+OR1 ; return counts
+"RTN","EDPRPT12",17,0)
+ I $G(CSV) D  Q  ;as CSV
+"RTN","EDPRPT12",18,0)
+ . N TAB S TAB=$C(9)
+"RTN","EDPRPT12",19,0)
+ . S X="Acuity"_TAB_"Labs"_TAB_"Images"_TAB_"Consults"_TAB_"Meds"_TAB_"Other"
+"RTN","EDPRPT12",20,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT12",21,0)
+ . F ACU=0,1,2,3,4,5 D
+"RTN","EDPRPT12",22,0)
+ .. K ROW S ROW("acuity")=ACU M ROW=CNT(ACU)
+"RTN","EDPRPT12",23,0)
+ .. D ROW(ACU,.ROW)
+"RTN","EDPRPT12",24,0)
+ ; or as XML
+"RTN","EDPRPT12",25,0)
+ D XML^EDPX("<statistics>")
+"RTN","EDPRPT12",26,0)
+ F ACU=0,1,2,3,4,5 D
+"RTN","EDPRPT12",27,0)
+ . K ROW S ROW("acuity")=ACU M ROW=CNT(ACU)
+"RTN","EDPRPT12",28,0)
+ . S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X)
+"RTN","EDPRPT12",29,0)
+ D XML^EDPX("</statistics>")
+"RTN","EDPRPT12",30,0)
+ Q
+"RTN","EDPRPT12",31,0)
+ ;
+"RTN","EDPRPT12",32,0)
+ROW(NAME,LIST) ; add line
+"RTN","EDPRPT12",33,0)
+ N I S X=NAME
+"RTN","EDPRPT12",34,0)
+ F I="labs","images","consults","meds","other" S X=X_TAB_LIST(I)
+"RTN","EDPRPT12",35,0)
+ D ADD^EDPCSV(X)
+"RTN","EDPRPT12",36,0)
+ Q
+"RTN","EDPRPT12",37,0)
+ ;
+"RTN","EDPRPT12",38,0)
+INIT ; Initialize acuity/service counters
+"RTN","EDPRPT12",39,0)
+ N A,S
+"RTN","EDPRPT12",40,0)
+ F A=0,1,2,3,4,5 D
+"RTN","EDPRPT12",41,0)
+ . F S="meds","labs","images","consults","other" S CNT(A,S)=0
+"RTN","EDPRPT12",42,0)
+ Q
+"RTN","EDPRPT12",43,0)
+ ;
+"RTN","EDPRPT12",44,0)
+ECODE(IEN) ; Return external value for an Acuity code
+"RTN","EDPRPT12",45,0)
+ N X0,X,Y S X0=$G(^EDPB(233.1,+IEN,0))
+"RTN","EDPRPT12",46,0)
+ S X=$P(X0,U,3) S:X<1 X=$P(X0,U,4) ;code or nat'l code
+"RTN","EDPRPT12",47,0)
+ ;S Y=$S(X=1:"one",X=2:"two",X=3:"three",X=4:"four",X=5:"five",1:"none")
+"RTN","EDPRPT12",48,0)
+ S Y=+X I (Y<1)!(Y>5) S Y=0
+"RTN","EDPRPT12",49,0)
+ Q Y
+"RTN","EDPRPT12",50,0)
+ ;
+"RTN","EDPRPT12",51,0)
+ENAME(X) ; Return external name for a Service code
+"RTN","EDPRPT12",52,0)
+ I X="L"!($E(X,1,2)="LR") Q "labs"
+"RTN","EDPRPT12",53,0)
+ I X="R"!($E(X,1,2)="RA") Q "images"
+"RTN","EDPRPT12",54,0)
+ I X="C"!(X="GMRC")       Q "consults"
+"RTN","EDPRPT12",55,0)
+ I X="M"!($E(X,1,2)="PS") Q "meds"
+"RTN","EDPRPT12",56,0)
+ I X="A"                  Q "other"
+"RTN","EDPRPT12",57,0)
+ Q "other"
+"RTN","EDPRPT12",58,0)
+ ;
+"RTN","EDPRPT12",59,0)
+FIND(LOG,ACU) ; find/count orders placed during visit LOG
+"RTN","EDPRPT12",60,0)
+ ;  (for converted data)
+"RTN","EDPRPT12",61,0)
+ N ORLIST,X0,DFN,IN,OUT,ORI,ORIFN,ORL,PKG,SERV
+"RTN","EDPRPT12",62,0)
+ S X0=$G(^EDP(230,LOG,0)),DFN=+$P(X0,U,6) Q:DFN<1
+"RTN","EDPRPT12",63,0)
+ S IN=$P(X0,U,8),OUT=$P(X0,U,9)
+"RTN","EDPRPT12",64,0)
+ D:'$D(EDLOC) GETLST^XPAR(.EDLOC,"ALL","EDPF LOCATION")
+"RTN","EDPRPT12",65,0)
+ K ^TMP("ORR",$J) D EN^ORQ1(DFN_";DPT(",,1,,IN,OUT) S ORI=0
+"RTN","EDPRPT12",66,0)
+ F  S ORI=$O(^TMP("ORR",$J,ORLIST,ORI)) Q:ORI<1  S ORIFN=+$G(^(ORI)) D
+"RTN","EDPRPT12",67,0)
+ . S ORL=$$GET1^DIQ(100,ORIFN_",",6,"I") Q:'$$ED(+ORL)
+"RTN","EDPRPT12",68,0)
+ . S PKG=$$GET1^DIQ(100,ORIFN_",","12:1")
+"RTN","EDPRPT12",69,0)
+ . S SERV=$$ENAME(PKG)
+"RTN","EDPRPT12",70,0)
+ . S CNT(ACU,SERV)=CNT(ACU,SERV)+1
+"RTN","EDPRPT12",71,0)
+ Q
+"RTN","EDPRPT12",72,0)
+ ;
+"RTN","EDPRPT12",73,0)
+ED(LOC) ; -- Return 1 or 0, if LOCation is part of ED
+"RTN","EDPRPT12",74,0)
+ ; Expects EDLOC(n) = seq ^ #44 ien
+"RTN","EDPRPT12",75,0)
+ N I,Y S (I,Y)=0
+"RTN","EDPRPT12",76,0)
+ F  S I=$O(EDLOC(I)) Q:I<1  I $P(EDLOC(I),U,2)=LOC S Y=1 Q
+"RTN","EDPRPT12",77,0)
+ Q Y
+"RTN","EDPRPT2")
+0^14^B15843773
+"RTN","EDPRPT2",1,0)
+EDPRPT2 ;SLC/MKB - Delay Report
+"RTN","EDPRPT2",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT2",3,0)
+ ;
+"RTN","EDPRPT2",4,0)
+DEL(BEG,END) ; Get Delay Report for EDPSITE by date range
+"RTN","EDPRPT2",5,0)
+ ;   CNT = counters
+"RTN","EDPRPT2",6,0)
+ ;   MIN = accumulate #minutes
+"RTN","EDPRPT2",7,0)
+ N IN,OUT,LOG,X,X0,X1,X3,DX,ELAPSE,ADMDEC,ADMDEL,DISP,VADISP,CNT,MIN,DEL,ACU
+"RTN","EDPRPT2",8,0)
+ D INIT ;set counters, sums to 0
+"RTN","EDPRPT2",9,0)
+ D:'$G(CSV) XML^EDPX("<logEntries>") I $G(CSV) D  ;headers
+"RTN","EDPRPT2",10,0)
+ . N TAB S TAB=$C(9)
+"RTN","EDPRPT2",11,0)
+ . S X="ED IEN"_TAB_"Time In"_TAB_"Elapsed"_TAB_"Dispo"_TAB_"Delay Reason"_TAB_"MD"_TAB_"Adm Dec"_TAB_"Adm Delay"_TAB_"Acuity"_TAB_"Diagnosis"
+"RTN","EDPRPT2",12,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT2",13,0)
+ S IN=BEG-.000001
+"RTN","EDPRPT2",14,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT2",15,0)
+ . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3))
+"RTN","EDPRPT2",16,0)
+ . S ACU=$$ECODE^EDPRPT($P(X3,U,3)),DEL=+$P(X1,U,5),CNT=CNT+1
+"RTN","EDPRPT2",17,0)
+ . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),VADISP=$$VADMIT(DISP)
+"RTN","EDPRPT2",18,0)
+ . S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW
+"RTN","EDPRPT2",19,0)
+ . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0),MIN=MIN+ELAPSE
+"RTN","EDPRPT2",20,0)
+D1 . ; all admissions
+"RTN","EDPRPT2",21,0)
+ . S (ADMDEC,ADMDEL)=0
+"RTN","EDPRPT2",22,0)
+ . S X=$$ADMIT^EDPRPT(LOG) I X D
+"RTN","EDPRPT2",23,0)
+ .. S ADMDEC=$$FMDIFF^XLFDT(X,IN,2)\60
+"RTN","EDPRPT2",24,0)
+ .. S:ADMDEC CNT("DEC")=CNT("DEC")+1,MIN("DEC")=MIN("DEC")+ADMDEC
+"RTN","EDPRPT2",25,0)
+ .. S ADMDEL=$S(OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0)
+"RTN","EDPRPT2",26,0)
+D2 . ; VA admissions only
+"RTN","EDPRPT2",27,0)
+ . I VADISP D
+"RTN","EDPRPT2",28,0)
+ .. S CNT("VA")=CNT("VA")+1
+"RTN","EDPRPT2",29,0)
+ .. S MIN("VA")=MIN("VA")+ELAPSE
+"RTN","EDPRPT2",30,0)
+ .. S MIN("VADEC")=MIN("VADEC")+ADMDEC
+"RTN","EDPRPT2",31,0)
+ .. S MIN("VADEL")=MIN("VADEL")+ADMDEL
+"RTN","EDPRPT2",32,0)
+ .. S:ADMDEL>359 CNT("VADEL6")=CNT("VADEL6")+1
+"RTN","EDPRPT2",33,0)
+D3 . ; elapsed visit time >=6 hrs
+"RTN","EDPRPT2",34,0)
+ . S:ELAPSE>1380 CNT("23+")=CNT("23+")+1
+"RTN","EDPRPT2",35,0)
+ . I ELAPSE>359 D
+"RTN","EDPRPT2",36,0)
+ .. S CNT("6+")=CNT("6+")+1
+"RTN","EDPRPT2",37,0)
+ .. S:VADISP CNT("VA6")=CNT("VA6")+1
+"RTN","EDPRPT2",38,0)
+ .. S DX=$$DXPRI^EDPQPCE(+$P(X0,U,3),LOG)
+"RTN","EDPRPT2",39,0)
+ .. N ROW S ROW("id")=LOG
+"RTN","EDPRPT2",40,0)
+ .. S ROW("inTS")=$S($G(CSV):$$EDATE^EDPRPT(IN),1:IN)
+"RTN","EDPRPT2",41,0)
+ .. S ROW("elapsed")=$$ETIME^EDPRPT(ELAPSE)_" *"
+"RTN","EDPRPT2",42,0)
+ .. S ROW("disposition")=DISP
+"RTN","EDPRPT2",43,0)
+ .. S ROW("acuity")=ACU
+"RTN","EDPRPT2",44,0)
+ .. S ROW("delayReason")=$$ENAME^EDPRPT(DEL)
+"RTN","EDPRPT2",45,0)
+ .. S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5))
+"RTN","EDPRPT2",46,0)
+ .. S ROW("dx")=$P(DX,U,2)
+"RTN","EDPRPT2",47,0)
+ .. S ROW("admDec")=ADMDEC
+"RTN","EDPRPT2",48,0)
+ .. S ROW("admDel")=ADMDEL
+"RTN","EDPRPT2",49,0)
+ .. I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q
+"RTN","EDPRPT2",50,0)
+ .. S X=ROW("id")
+"RTN","EDPRPT2",51,0)
+ .. F I="inTS","elapsed","disposition","delayReason","md","admDec","admDel","acuity","dx" S X=X_$C(9)_$G(ROW(I))
+"RTN","EDPRPT2",52,0)
+ .. D ADD^EDPCSV(X)
+"RTN","EDPRPT2",53,0)
+ D:'$G(CSV) XML^EDPX("</logEntries>")
+"RTN","EDPRPT2",54,0)
+ Q
+"RTN","EDPRPT2",55,0)
+ ;
+"RTN","EDPRPT2",56,0)
+D4 ; return counts and averages
+"RTN","EDPRPT2",57,0)
+ D XML^EDPX("<averages>")
+"RTN","EDPRPT2",58,0)
+ S X="<average type='All Patients' total='"_CNT_"' avgTime='"_$S(CNT:$$ETIME^EDPRPT(MIN/CNT),1:0)_"' num6hr='"_CNT("6+")_"' num23hr='"_CNT("23+")_"' avgAdmDec='"_$S(CNT("DEC"):$$ETIME^EDPRPT(MIN("DEC")/CNT("DEC")),1:0)_"' />"
+"RTN","EDPRPT2",59,0)
+ D XML^EDPX(X)
+"RTN","EDPRPT2",60,0)
+ S X="<average type='Not VA Admitted' total='"_(CNT-CNT("VA"))_"' avgTime='"_$S(CNT-CNT("VA"):$$ETIME^EDPRPT((MIN-MIN("VA")/(CNT-CNT("VA")))),1:0)_"' />"
+"RTN","EDPRPT2",61,0)
+ D XML^EDPX(X)
+"RTN","EDPRPT2",62,0)
+ S X="<average type='VA Admitted' total='"_CNT("VA")_"' num6hr='"_CNT("VA6")_"' numAdmDel6hr='"_CNT("VADEL6")
+"RTN","EDPRPT2",63,0)
+ S X=X_"' avgAdmDel='"_$S(CNT("VA"):$$ETIME^EDPRPT(MIN("VADEL")/CNT("VA")),1:0)_"' avgAdmDec='"_$S(CNT("VA"):$$ETIME^EDPRPT(MIN("VADEC")/CNT("VA")),1:0)_"' />"
+"RTN","EDPRPT2",64,0)
+ D XML^EDPX(X)
+"RTN","EDPRPT2",65,0)
+ D XML^EDPX("</averages>")
+"RTN","EDPRPT2",66,0)
+ Q
+"RTN","EDPRPT2",67,0)
+ ;
+"RTN","EDPRPT2",68,0)
+INIT ; Initialize counters and sums
+"RTN","EDPRPT2",69,0)
+ N I S (CNT,MIN)=0
+"RTN","EDPRPT2",70,0)
+ F I="DEC","VA","VA6","VADEL6","6+","23+" S CNT(I)=0
+"RTN","EDPRPT2",71,0)
+ F I="DEC","VA","VADEC","VADEL" S MIN(I)=0
+"RTN","EDPRPT2",72,0)
+ Q
+"RTN","EDPRPT2",73,0)
+ ;
+"RTN","EDPRPT2",74,0)
+VADMIT(X) ; -- Return 1 or 0, if disposition indicates a VA admission
+"RTN","EDPRPT2",75,0)
+ I $G(X)="" Q 0
+"RTN","EDPRPT2",76,0)
+ N I,Y S X=$$UP^XLFSTR(X)
+"RTN","EDPRPT2",77,0)
+ S I=+$O(^EDPB(233.1,"AB","disposition",X,0))
+"RTN","EDPRPT2",78,0)
+ S Y=$S($P($G(^EDPB(233.1,I,0)),U,5)["V":1,1:0)
+"RTN","EDPRPT2",79,0)
+ Q Y
+"RTN","EDPRPT3")
+0^15^B8721424
+"RTN","EDPRPT3",1,0)
+EDPRPT3 ;SLC/MKB - Missed Opportunity Report
+"RTN","EDPRPT3",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT3",3,0)
+ ;
+"RTN","EDPRPT3",4,0)
+MO(BEG,END) ; Get Missed Opp Report for EDPSITE by date range
+"RTN","EDPRPT3",5,0)
+ ;   CNT = counters
+"RTN","EDPRPT3",6,0)
+ N IN,OUT,LOG,DISP,X,X0,X1,X3,X4,I,CNT,ROW
+"RTN","EDPRPT3",7,0)
+ D INIT ;set counters to 0
+"RTN","EDPRPT3",8,0)
+ D:'$G(CSV) XML^EDPX("<logEntries>") I $G(CSV) D  ;headers
+"RTN","EDPRPT3",9,0)
+ . N TAB S TAB=$C(9)
+"RTN","EDPRPT3",10,0)
+ . S X="ED"_TAB_"Time In"_TAB_"Complaint"_TAB_"MD"_TAB_"Acuity"_TAB_"Elapsed"_TAB_"Triage"_TAB_"Wait"_TAB_"Dispo"_TAB_"Adm Dec"_TAB_"Adm Del"_TAB_"Delay"
+"RTN","EDPRPT3",11,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT3",12,0)
+ S IN=BEG-.000001
+"RTN","EDPRPT3",13,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT3",14,0)
+ . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0))
+"RTN","EDPRPT3",15,0)
+ . S DISP=$$ECODE^EDPRPT($P(X1,U,2)) Q:'$$MISSEDOP(DISP)
+"RTN","EDPRPT3",16,0)
+ . S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW
+"RTN","EDPRPT3",17,0)
+ . K ROW S ROW("id")=LOG
+"RTN","EDPRPT3",18,0)
+ . S ROW("inTS")=$S($G(CSV):$$EDATE^EDPRPT(IN),1:IN)
+"RTN","EDPRPT3",19,0)
+ . S ROW("complaint")=$P(X1,U)
+"RTN","EDPRPT3",20,0)
+ . S ROW("acuity")=$$ECODE^EDPRPT($P(X3,U,3))
+"RTN","EDPRPT3",21,0)
+ . S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5))
+"RTN","EDPRPT3",22,0)
+ . S ROW("disposition")=DISP
+"RTN","EDPRPT3",23,0)
+ . S DISP=$$UP^XLFSTR(DISP),CNT(DISP)=CNT(DISP)+1
+"RTN","EDPRPT3",24,0)
+ . ;
+"RTN","EDPRPT3",25,0)
+ . ; calculate times
+"RTN","EDPRPT3",26,0)
+ . S ROW("elapsed")=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0)
+"RTN","EDPRPT3",27,0)
+ . S X=$$ACUITY^EDPRPT(LOG) ;S:X<1 X=OUT
+"RTN","EDPRPT3",28,0)
+ . S ROW("triage")=$S(X:($$FMDIFF^XLFDT(X,IN,2)\60),1:0)
+"RTN","EDPRPT3",29,0)
+ . S X=$$LVWAITRM^EDPRPT(LOG) ;S:X<1 X=IN
+"RTN","EDPRPT3",30,0)
+ . S ROW("wait")=$S(X:($$FMDIFF^XLFDT(X,IN,2)\60),1:0)
+"RTN","EDPRPT3",31,0)
+ . S X=$$ADMIT^EDPRPT(LOG)
+"RTN","EDPRPT3",32,0)
+ . S ROW("admDec")=$S(X:($$FMDIFF^XLFDT(X,IN,2)\60),1:0)
+"RTN","EDPRPT3",33,0)
+ . S ROW("admDel")=$S(X&OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0)
+"RTN","EDPRPT3",34,0)
+ . S ROW("delayReason")=$$ENAME^EDPRPT(+$P(X1,U,5))
+"RTN","EDPRPT3",35,0)
+ . I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q
+"RTN","EDPRPT3",36,0)
+ . S X=ROW("id")
+"RTN","EDPRPT3",37,0)
+ . F I="inTS","complaint","md","acuity","elapsed","triage","wait","disposition","admDec","admDel","delayReason" S X=X_$C(9)_$G(ROW(I))
+"RTN","EDPRPT3",38,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT3",39,0)
+ D:'$G(CSV) XML^EDPX("</logEntries>")
+"RTN","EDPRPT3",40,0)
+ ;
+"RTN","EDPRPT3",41,0)
+ ; return totals, as XML or CSV
+"RTN","EDPRPT3",42,0)
+ I '$G(CSV) S X=$$XMLA^EDPX("totals",.CNT) D XML^EDPX(X) Q
+"RTN","EDPRPT3",43,0)
+ N TAB S TAB=$C(9)
+"RTN","EDPRPT3",44,0)
+ S I="" F  S I=$O(CNT(I)) Q:I=""  D 
+"RTN","EDPRPT3",45,0)
+ . D BLANK^EDPCSV
+"RTN","EDPRPT3",46,0)
+ . S X=TAB_TAB_TAB_TAB_"Total "_CNT(I,0)_": "_CNT(I)
+"RTN","EDPRPT3",47,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT3",48,0)
+ Q
+"RTN","EDPRPT3",49,0)
+ ;
+"RTN","EDPRPT3",50,0)
+INIT ; -- initialize counters
+"RTN","EDPRPT3",51,0)
+ N I,X,X2 S CNT=0
+"RTN","EDPRPT3",52,0)
+ S X="" F  S X=$O(^EDPB(233.1,"AB","disposition",X)) Q:X=""  S I=+$O(^(X,0)) D
+"RTN","EDPRPT3",53,0)
+ . S X2=$P($G(^EDPB(233.1,I,0)),U,2)
+"RTN","EDPRPT3",54,0)
+ . I $$MISSEDOP(X) S CNT(X)=0,CNT(X,0)=X2
+"RTN","EDPRPT3",55,0)
+ Q
+"RTN","EDPRPT3",56,0)
+ ;
+"RTN","EDPRPT3",57,0)
+MISSEDOP(X) ; -- Return 1 or 0, if disposition indicates a missed opportunity
+"RTN","EDPRPT3",58,0)
+ I $G(X)="" Q 0
+"RTN","EDPRPT3",59,0)
+ N I,Y S X=$$UP^XLFSTR(X)
+"RTN","EDPRPT3",60,0)
+ S I=+$O(^EDPB(233.1,"AB","disposition",X,0))
+"RTN","EDPRPT3",61,0)
+ S Y=$S($P($G(^EDPB(233.1,I,0)),U,5)["M":1,1:0)
+"RTN","EDPRPT3",62,0)
+ Q Y
+"RTN","EDPRPT4")
+0^16^B24084771
+"RTN","EDPRPT4",1,0)
+EDPRPT4 ;SLC/MKB - Delay Summary Report
+"RTN","EDPRPT4",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT4",3,0)
+ ;
+"RTN","EDPRPT4",4,0)
+SUM(BEG,END) ; Get Delay Report for EDPSITE by date range
+"RTN","EDPRPT4",5,0)
+ ;   CNT = counters
+"RTN","EDPRPT4",6,0)
+ ;   MIN = accumulate #minutes
+"RTN","EDPRPT4",7,0)
+ N IN,OUT,LOG,X,X0,X1,X3,X4,ELAPSE,ADMDEC,ADMDEL,DISP,STS,VADM,CNT,MIN,PROV,DEL,ACU,Y
+"RTN","EDPRPT4",8,0)
+ D INIT ;set counters, sums to 0
+"RTN","EDPRPT4",9,0)
+ S IN=BEG-.000001
+"RTN","EDPRPT4",10,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT4",11,0)
+ . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0))
+"RTN","EDPRPT4",12,0)
+ . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),VADM=$$VADMIT^EDPRPT2(DISP)
+"RTN","EDPRPT4",13,0)
+ . S ACU=$$ECODE($P(X3,U,3)),STS=$P(X3,U,2)
+"RTN","EDPRPT4",14,0)
+ . S DEL=+$P(X1,U,5),CNT=CNT+1
+"RTN","EDPRPT4",15,0)
+ . S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW
+"RTN","EDPRPT4",16,0)
+ . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0),MIN=MIN+ELAPSE
+"RTN","EDPRPT4",17,0)
+D1 . ; all admissions
+"RTN","EDPRPT4",18,0)
+ . S (ADMDEC,ADMDEL)=0
+"RTN","EDPRPT4",19,0)
+ . S X=$$ADMIT^EDPRPT(LOG) I X D
+"RTN","EDPRPT4",20,0)
+ .. S ADMDEC=$$FMDIFF^XLFDT(X,IN,2)\60
+"RTN","EDPRPT4",21,0)
+ .. S:ADMDEC CNT("DEC")=CNT("DEC")+1,MIN("DEC")=MIN("DEC")+ADMDEC
+"RTN","EDPRPT4",22,0)
+ .. S ADMDEL=$S(OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0)
+"RTN","EDPRPT4",23,0)
+ . S:$$OBS(STS) CNT("OBS")=CNT("OBS")+1
+"RTN","EDPRPT4",24,0)
+D2 . ; VA admissions only
+"RTN","EDPRPT4",25,0)
+ . I VADM D
+"RTN","EDPRPT4",26,0)
+ .. S CNT("VA")=CNT("VA")+1
+"RTN","EDPRPT4",27,0)
+ .. S MIN("VA")=MIN("VA")+ELAPSE
+"RTN","EDPRPT4",28,0)
+ .. S MIN("VADEC")=MIN("VADEC")+ADMDEC
+"RTN","EDPRPT4",29,0)
+ .. S MIN("VADEL")=MIN("VADEL")+ADMDEL
+"RTN","EDPRPT4",30,0)
+ .. S:ADMDEL>359 CNT("VADEL6")=CNT("VADEL6")+1
+"RTN","EDPRPT4",31,0)
+D3 . ; elapsed visit time >=6 hrs
+"RTN","EDPRPT4",32,0)
+ . S:ELAPSE>1380 CNT("23+")=CNT("23+")+1
+"RTN","EDPRPT4",33,0)
+ . I ELAPSE>359 D
+"RTN","EDPRPT4",34,0)
+ .. S CNT("6+")=CNT("6+")+1
+"RTN","EDPRPT4",35,0)
+ .. S:VADM CNT("VA6")=CNT("VA6")+1
+"RTN","EDPRPT4",36,0)
+ . S:DEL CNT(DEL,ACU)=+$G(CNT(DEL,ACU))+1,CNT(DEL)=+$G(CNT(DEL))+1
+"RTN","EDPRPT4",37,0)
+ ;
+"RTN","EDPRPT4",38,0)
+D4 ; return counts and averages as CSV
+"RTN","EDPRPT4",39,0)
+ I $G(CSV) D  Q
+"RTN","EDPRPT4",40,0)
+ . N TAB S TAB=$C(9)
+"RTN","EDPRPT4",41,0)
+ . S X=TAB_TAB_"Delay Reason"_TAB_"0"_TAB_"1"_TAB_"2"_TAB_"3"_TAB_"4"_TAB_"5"_TAB_"Total"
+"RTN","EDPRPT4",42,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV ;headers
+"RTN","EDPRPT4",43,0)
+ . S X="Total ED Visits: "_CNT_TAB
+"RTN","EDPRPT4",44,0)
+ . S X=X_"Average ED Visit Time: "_$S(CNT:$$ETIME^EDPRPT(MIN\CNT),1:0)
+"RTN","EDPRPT4",45,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT4",46,0)
+ . S X="Total Visits over Six Hours: "_CNT("6+")_TAB
+"RTN","EDPRPT4",47,0)
+ . S X=X_"Total Visits over 23 Hours: "_CNT("23+")
+"RTN","EDPRPT4",48,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT4",49,0)
+ . S X="Total Admitted to Observation: "_CNT("OBS")
+"RTN","EDPRPT4",50,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT4",51,0)
+ . S Y=CNT-CNT("VA"),X="Total Visits Not VA Admitted: "_Y_TAB
+"RTN","EDPRPT4",52,0)
+ . S X=X_"Average Visit Time for Not VA Admitted: "_$S(Y:$$ETIME^EDPRPT((MIN-MIN("VA")\Y)),1:0)
+"RTN","EDPRPT4",53,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT4",54,0)
+ . S Y=CNT("VA"),X="Total VA Admits: "_Y_TAB
+"RTN","EDPRPT4",55,0)
+ . S X=X_"Total VA Admit Delay over Six Hours: "_CNT("VADEL6")
+"RTN","EDPRPT4",56,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT4",57,0)
+ . S X="Average VA Admit Decision Time: "_$S(Y:$$ETIME^EDPRPT(MIN("VADEC")\Y),1:0)_TAB
+"RTN","EDPRPT4",58,0)
+ . S X=X_"Average VA Admit Delay Time: "_$S(Y:$$ETIME^EDPRPT(MIN("VADEL")\Y),1:0)
+"RTN","EDPRPT4",59,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT4",60,0)
+ . S Y=CNT("DEC"),X="Average All Admit Decision Time: "_$S(Y:$$ETIME^EDPRPT(MIN("DEC")\Y),1:0)
+"RTN","EDPRPT4",61,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT4",62,0)
+ . S X=TAB_TAB_"Delay Chart" D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT4",63,0)
+ . S X=TAB_TAB_"Acuity"_TAB_"None"_TAB_"1"_TAB_"2"_TAB_"3"_TAB_"4"_TAB_"5"_TAB_"Total"
+"RTN","EDPRPT4",64,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT4",65,0)
+ . S DEL=0 F  S DEL=$O(CNT(DEL)) Q:+DEL'=DEL  D
+"RTN","EDPRPT4",66,0)
+ .. S X=$$ENAME^EDPRPT(DEL) Q:X=""  Q:X?1." "  S X=TAB_TAB_X ;novalue
+"RTN","EDPRPT4",67,0)
+ .. F I="none","one","two","three","four","five" S X=X_TAB_+$G(CNT(DEL,I))
+"RTN","EDPRPT4",68,0)
+ .. S X=X_TAB_CNT(DEL) D ADD^EDPCSV(X)
+"RTN","EDPRPT4",69,0)
+D5 ; or return counts and averages as XML
+"RTN","EDPRPT4",70,0)
+ D XML^EDPX("<averages>")
+"RTN","EDPRPT4",71,0)
+ S X="<average type='All Patients' total='"_CNT
+"RTN","EDPRPT4",72,0)
+ S X=X_"' avgTime='"_$S(CNT:$$ETIME^EDPRPT(MIN\CNT),1:0)
+"RTN","EDPRPT4",73,0)
+ S X=X_"' num6hr='"_CNT("6+")_"' num23hr='"_CNT("23+"),Y=CNT("DEC")
+"RTN","EDPRPT4",74,0)
+ S X=X_"' avgAdmDec='"_$S(Y:$$ETIME^EDPRPT(MIN("DEC")\Y),1:0)
+"RTN","EDPRPT4",75,0)
+ S X=X_"' numObs='"_CNT("OBS")_"' />"
+"RTN","EDPRPT4",76,0)
+ D XML^EDPX(X)
+"RTN","EDPRPT4",77,0)
+ S Y=CNT-CNT("VA")
+"RTN","EDPRPT4",78,0)
+ S X="<average type='Not VA Admitted' total='"_Y_"' avgTime='"_$S(Y:$$ETIME^EDPRPT((MIN-MIN("VA")\Y)),1:0)_"' />"
+"RTN","EDPRPT4",79,0)
+ D XML^EDPX(X)
+"RTN","EDPRPT4",80,0)
+ S Y=CNT("VA"),X="<average type='VA Admitted' total='"_Y
+"RTN","EDPRPT4",81,0)
+ S X=X_"' num6hr='"_CNT("VA6")_"' numAdmDel6hr='"_CNT("VADEL6")
+"RTN","EDPRPT4",82,0)
+ S X=X_"' avgAdmDel='"_$S(Y:$$ETIME^EDPRPT(MIN("VADEL")\Y),1:0)
+"RTN","EDPRPT4",83,0)
+ S X=X_"' avgAdmDec='"_$S(Y:$$ETIME^EDPRPT(MIN("VADEC")\Y),1:0)_"' />"
+"RTN","EDPRPT4",84,0)
+ D XML^EDPX(X)
+"RTN","EDPRPT4",85,0)
+ D XML^EDPX("</averages>")
+"RTN","EDPRPT4",86,0)
+ D XML^EDPX("<delayChart>")
+"RTN","EDPRPT4",87,0)
+ S DEL=0 F  S DEL=$O(CNT(DEL)) Q:+DEL'=DEL  D
+"RTN","EDPRPT4",88,0)
+ . S X=$$ENAME^EDPRPT(DEL) Q:X=""  Q:X?1." "  ;novalue
+"RTN","EDPRPT4",89,0)
+ . S CNT(DEL,"reason")=X,CNT(DEL,"total")=CNT(DEL)
+"RTN","EDPRPT4",90,0)
+ . F I="none","one","two","three","four","five" S CNT(DEL,I)=+$G(CNT(DEL,I))
+"RTN","EDPRPT4",91,0)
+ . K ROW M ROW=CNT(DEL)
+"RTN","EDPRPT4",92,0)
+ . S X=$$XMLA^EDPX("delay",.ROW) D XML^EDPX(X)
+"RTN","EDPRPT4",93,0)
+ D XML^EDPX("</delayChart>")
+"RTN","EDPRPT4",94,0)
+ Q
+"RTN","EDPRPT4",95,0)
+ ;
+"RTN","EDPRPT4",96,0)
+INIT ; Initialize counters and sums
+"RTN","EDPRPT4",97,0)
+ N I S (CNT,MIN)=0
+"RTN","EDPRPT4",98,0)
+ F I="DEC","VA","VA6","VADEL6","6+","23+","OBS" S CNT(I)=0
+"RTN","EDPRPT4",99,0)
+ F I="DEC","VA","VADEC","VADEL" S MIN(I)=0
+"RTN","EDPRPT4",100,0)
+ Q
+"RTN","EDPRPT4",101,0)
+ ;
+"RTN","EDPRPT4",102,0)
+ECODE(IEN) ; Return external value for an Acuity code
+"RTN","EDPRPT4",103,0)
+ N X,Y S X=$P($G(^EDPB(233.1,+IEN,0)),U,3) ;code
+"RTN","EDPRPT4",104,0)
+ S Y=$S(X="":"none",X=1:"one",X=2:"two",X=3:"three",X=4:"four",X=5:"five",1:"X")
+"RTN","EDPRPT4",105,0)
+ Q Y
+"RTN","EDPRPT4",106,0)
+ ;
+"RTN","EDPRPT4",107,0)
+OBS(IEN) ; Return 1 or 0, if status IEN indicates Observation
+"RTN","EDPRPT4",108,0)
+ I $G(IEN),$P($G(^EDPB(233.1,+IEN,0)),U,5)["O" Q 1
+"RTN","EDPRPT4",109,0)
+ Q 0
+"RTN","EDPRPT5")
+0^17^B35383693
+"RTN","EDPRPT5",1,0)
+EDPRPT5 ;SLC/MKB - Shift Report
+"RTN","EDPRPT5",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT5",3,0)
+ ;
+"RTN","EDPRPT5",4,0)
+SFT(DAY) ; Get Shift Report for EDPSITE on DAY
+"RTN","EDPRPT5",5,0)
+ N BEG,END,IN,OUT,LOG,X,X0,X1,X3,X4,S,SOUT,SHIFT
+"RTN","EDPRPT5",6,0)
+ N CNT,VA,DX,OTH,HR6,TRG,OCB,MO,DIE,UNK,PREV,NEXT,SUB
+"RTN","EDPRPT5",7,0)
+ N ELAPSE,ADMDEC,STS,DISP,COL
+"RTN","EDPRPT5",8,0)
+ D INIT ;set counters to 0, SHIFT(#) = start time in seconds
+"RTN","EDPRPT5",9,0)
+ I 'SHIFT D ERR^EDPRPT(2300013) Q
+"RTN","EDPRPT5",10,0)
+ S BEG=$S(SHIFT(1)>0:$$FMADD^XLFDT(DAY,-1,,,SHIFT(SHIFT)),1:DAY)
+"RTN","EDPRPT5",11,0)
+ S END=$S(SHIFT(1)>0:$$FMADD^XLFDT(DAY,,,,SHIFT(SHIFT)),1:DAY_".2359")
+"RTN","EDPRPT5",12,0)
+ S IN=BEG-.000001 F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  D
+"RTN","EDPRPT5",13,0)
+ . S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT5",14,0)
+ .. S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0))
+"RTN","EDPRPT5",15,0)
+ .. S STS=$$ECODE^EDPRPT($P(X3,U,2))
+"RTN","EDPRPT5",16,0)
+ .. S DISP=$$ECODE^EDPRPT($P(X1,U,2)),DISP=$$UP^XLFSTR(DISP)
+"RTN","EDPRPT5",17,0)
+ .. S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW
+"RTN","EDPRPT5",18,0)
+ .. S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0) ;#min
+"RTN","EDPRPT5",19,0)
+ .. S ADMDEC=$$ADMIT^EDPRPT(LOG)
+"RTN","EDPRPT5",20,0)
+D1 .. ; all visits
+"RTN","EDPRPT5",21,0)
+ .. S S=$$SHIFT(IN,1),SOUT=$$SHIFT(OUT,1)
+"RTN","EDPRPT5",22,0)
+ .. S CNT(S)=CNT(S)+1
+"RTN","EDPRPT5",23,0)
+ .. S:'$P(X3,U,3) TRG(S)=TRG(S)+1
+"RTN","EDPRPT5",24,0)
+ .. S:ELAPSE>359 HR6(S)=HR6(S)+1
+"RTN","EDPRPT5",25,0)
+ .. S:DISP="O"!(DISP="NVA") OTH(S)=OTH(S)+1
+"RTN","EDPRPT5",26,0)
+ .. S:DISP="D" DIE(S)=DIE(S)+1
+"RTN","EDPRPT5",27,0)
+ .. S:$$MISSEDOP^EDPRPT3(DISP) MO(S)=MO(S)+1
+"RTN","EDPRPT5",28,0)
+ .. S:DISP="" UNK(S)=UNK(S)+1
+"RTN","EDPRPT5",29,0)
+ .. I $L(STS),$$UP^XLFSTR(STS)'="GONE",S'=SOUT S OCB(S)=OCB(S)+1
+"RTN","EDPRPT5",30,0)
+D2 S OUT=BEG-.000001 F  S OUT=$O(^EDP(230,"ATO",EDPSITE,OUT)) Q:'OUT  Q:OUT>END  D
+"RTN","EDPRPT5",31,0)
+ . S LOG=0 F  S LOG=+$O(^EDP(230,"ATO",EDPSITE,OUT,LOG)) Q:LOG<1  D
+"RTN","EDPRPT5",32,0)
+ .. S X0=^EDP(230,LOG,0),X1=$G(^(1))
+"RTN","EDPRPT5",33,0)
+ .. S SOUT=$$SHIFT(OUT,1),DX(SOUT)=DX(SOUT)+1
+"RTN","EDPRPT5",34,0)
+ .. S IN=$P(X0,U,8) S:IN<BEG PREV=PREV+1
+"RTN","EDPRPT5",35,0)
+ .. S DISP=$$ECODE^EDPRPT($P(X1,U,2))
+"RTN","EDPRPT5",36,0)
+ .. S ADMDEC=$$ADMIT^EDPRPT(LOG)
+"RTN","EDPRPT5",37,0)
+ .. I ADMDEC,ADMDEC>BEG,$$VADMIT^EDPRPT2(DISP) S S=$$SHIFT(ADMDEC,1),VA(S)=VA(S)+1
+"RTN","EDPRPT5",38,0)
+D3 ; calculate #carried over
+"RTN","EDPRPT5",39,0)
+ S S=SUB(SHIFT),NEXT(S)=PREV+CNT(S)-DX(S)
+"RTN","EDPRPT5",40,0)
+ S PREV("one")=NEXT(S),PREV(S)=PREV
+"RTN","EDPRPT5",41,0)
+ F I=1:1:(SHIFT-1) S S=SUB(I),X=SUB($S(I>1:I-1,1:SHIFT)),NEXT(S)=NEXT(X)+CNT(S)-DX(S)
+"RTN","EDPRPT5",42,0)
+ F I=2:1:(SHIFT-1) S PREV(SUB(I))=NEXT(SUB(I-1))
+"RTN","EDPRPT5",43,0)
+ ;S NEXT("three")=PREV+CNT("three")-DX("three")
+"RTN","EDPRPT5",44,0)
+ ;S NEXT("one")=NEXT("three")+CNT("one")-DX("one")
+"RTN","EDPRPT5",45,0)
+ ;S NEXT("two")=NEXT("one")+CNT("two")-DX("two")
+"RTN","EDPRPT5",46,0)
+ ;S PREV("one")=NEXT("three"),PREV("two")=NEXT("one"),PREV("three")=PREV
+"RTN","EDPRPT5",47,0)
+D4 ; return column info
+"RTN","EDPRPT5",48,0)
+ F I=1:1:SHIFT D  ;convert #seconds to HH[:MM]
+"RTN","EDPRPT5",49,0)
+ . N X,Y S X=SHIFT(I),Y=X\60
+"RTN","EDPRPT5",50,0)
+ . ;S Y=X\3600 S:Y=0 Y=12 S:Y>12 Y=Y-12
+"RTN","EDPRPT5",51,0)
+ . S SHIFT(I)=$$ETIME^EDPRPT(Y) ;Y_$S(X#3600:":"_(X#3600)\60,1:"")
+"RTN","EDPRPT5",52,0)
+ F I=1:1:SHIFT D  ;build column captions
+"RTN","EDPRPT5",53,0)
+ . S COL(I,"name")=SHIFT(I)_" to "_SHIFT($S(I+1>SHIFT:1,1:I+1))
+"RTN","EDPRPT5",54,0)
+ . S COL(I,"shiftId")=SUB(I)
+"RTN","EDPRPT5",55,0)
+ ;S COL(1,"name")="7 to 3",COL(1,"shiftId")="one"
+"RTN","EDPRPT5",56,0)
+ ;S COL(2,"name")="3 to 11",COL(2,"shiftId")="two"
+"RTN","EDPRPT5",57,0)
+ ;S COL(3,"name")="11 to 7",COL(3,"shiftId")="three"
+"RTN","EDPRPT5",58,0)
+ I $G(CSV) D CSV Q
+"RTN","EDPRPT5",59,0)
+ D XML^EDPX("<columns>")
+"RTN","EDPRPT5",60,0)
+ F S=1:1:SHIFT K X M X=COL(S) S X=$$XMLA^EDPX("column",.X) D XML^EDPX(X)
+"RTN","EDPRPT5",61,0)
+ D XML^EDPX("</columns>")
+"RTN","EDPRPT5",62,0)
+D5 ; return counts and averages as XML
+"RTN","EDPRPT5",63,0)
+ D XML^EDPX("<categories>")
+"RTN","EDPRPT5",64,0)
+ S X=$$XMLA^EDPX("category",.PREV) D XML^EDPX(X)
+"RTN","EDPRPT5",65,0)
+ S X=$$XMLA^EDPX("category",.CNT) D XML^EDPX(X)
+"RTN","EDPRPT5",66,0)
+ S X=$$XMLA^EDPX("category",.DX) D XML^EDPX(X)
+"RTN","EDPRPT5",67,0)
+ S X=$$XMLA^EDPX("category",.VA) D XML^EDPX(X)
+"RTN","EDPRPT5",68,0)
+ S X=$$XMLA^EDPX("category",.OTH) D XML^EDPX(X)
+"RTN","EDPRPT5",69,0)
+ S X=$$XMLA^EDPX("category",.HR6) D XML^EDPX(X)
+"RTN","EDPRPT5",70,0)
+ S X=$$XMLA^EDPX("category",.TRG) D XML^EDPX(X)
+"RTN","EDPRPT5",71,0)
+ S X=$$XMLA^EDPX("category",.OCB) D XML^EDPX(X)
+"RTN","EDPRPT5",72,0)
+ S X=$$XMLA^EDPX("category",.MO) D XML^EDPX(X)
+"RTN","EDPRPT5",73,0)
+ S X=$$XMLA^EDPX("category",.DIE) D XML^EDPX(X)
+"RTN","EDPRPT5",74,0)
+ S X=$$XMLA^EDPX("category",.UNK) D XML^EDPX(X)
+"RTN","EDPRPT5",75,0)
+ S X=$$XMLA^EDPX("category",.NEXT) D XML^EDPX(X)
+"RTN","EDPRPT5",76,0)
+ D XML^EDPX("</categories>")
+"RTN","EDPRPT5",77,0)
+ Q
+"RTN","EDPRPT5",78,0)
+ ;
+"RTN","EDPRPT5",79,0)
+CSV ; Return headers, counts and averages as CSV
+"RTN","EDPRPT5",80,0)
+ N X,TAB S TAB=$C(9)
+"RTN","EDPRPT5",81,0)
+ S X="Category"_TAB_COL(SHIFT,"name")
+"RTN","EDPRPT5",82,0)
+ F I=1:1:(SHIFT-1) S X=X_TAB_COL(I,"name")
+"RTN","EDPRPT5",83,0)
+ D ADD^EDPCSV(X) ;headers
+"RTN","EDPRPT5",84,0)
+ D ROW("Carried over at Report Start",.PREV)
+"RTN","EDPRPT5",85,0)
+ D ROW("Number of New Patients",.CNT)
+"RTN","EDPRPT5",86,0)
+ D ROW("Number of Patients Discharged",.DX)
+"RTN","EDPRPT5",87,0)
+ D ROW("Number Dec to Admit to VA",.VA)
+"RTN","EDPRPT5",88,0)
+ D ROW("Number Dec to Admit to Other",.OTH)
+"RTN","EDPRPT5",89,0)
+ D ROW("Number over Six Hours",.HR6)
+"RTN","EDPRPT5",90,0)
+ D ROW("Number Waiting for Triage",.TRG)
+"RTN","EDPRPT5",91,0)
+ D ROW("Number of Occupied Beds",.OCB)
+"RTN","EDPRPT5",92,0)
+ D ROW("Number of Missed Opportunities",.MO)
+"RTN","EDPRPT5",93,0)
+ D ROW("Number Deceased",.DIE)
+"RTN","EDPRPT5",94,0)
+ D ROW("Number With No Disposition",.UNK)
+"RTN","EDPRPT5",95,0)
+ D ROW("Carry over to Next Shift",.NEXT)
+"RTN","EDPRPT5",96,0)
+ Q
+"RTN","EDPRPT5",97,0)
+ ;
+"RTN","EDPRPT5",98,0)
+ROW(NAME,LIST) ; add row
+"RTN","EDPRPT5",99,0)
+ N S,I
+"RTN","EDPRPT5",100,0)
+ S S=SUB(SHIFT),X=NAME_TAB_LIST(S)
+"RTN","EDPRPT5",101,0)
+ F I=1:1:(SHIFT-1) S S=SUB(I),X=X_TAB_LIST(S)
+"RTN","EDPRPT5",102,0)
+ D ADD^EDPCSV(X)
+"RTN","EDPRPT5",103,0)
+ Q
+"RTN","EDPRPT5",104,0)
+ ;
+"RTN","EDPRPT5",105,0)
+INIT ; Initialize counters and sums
+"RTN","EDPRPT5",106,0)
+ N I,S
+"RTN","EDPRPT5",107,0)
+ S PREV=0,DAY=$P(DAY,".")
+"RTN","EDPRPT5",108,0)
+ D SETUP F I=1:1:SHIFT D
+"RTN","EDPRPT5",109,0)
+ . S S=$$WORD(I),SUB(I)=S
+"RTN","EDPRPT5",110,0)
+ . S CNT(S)=0,CNT("category")="Number of New Patients"
+"RTN","EDPRPT5",111,0)
+ . S DX(S)=0,DX("category")="Number of Patients Discharged"
+"RTN","EDPRPT5",112,0)
+ . S VA(S)=0,VA("category")="Number Dec to Admit to VA"
+"RTN","EDPRPT5",113,0)
+ . S OTH(S)=0,OTH("category")="Number Dec to Admit to Other"
+"RTN","EDPRPT5",114,0)
+ . S HR6(S)=0,HR6("category")="Number over Six Hours"
+"RTN","EDPRPT5",115,0)
+ . S TRG(S)=0,TRG("category")="Number Waiting for Triage" ;no acuity
+"RTN","EDPRPT5",116,0)
+ . S OCB(S)=0,OCB("category")="Number of Occupied Beds"
+"RTN","EDPRPT5",117,0)
+ . S MO(S)=0,MO("category")="Number of Missed Opportunities"
+"RTN","EDPRPT5",118,0)
+ . S DIE(S)=0,DIE("category")="Number Deceased"
+"RTN","EDPRPT5",119,0)
+ . S UNK(S)=0,UNK("category")="Number With No Disposition"
+"RTN","EDPRPT5",120,0)
+ . S PREV(S)=0,PREV("category")="Carried over at Report Start"
+"RTN","EDPRPT5",121,0)
+ . S NEXT(S)=0,NEXT("category")="Carry over to Next Shift"
+"RTN","EDPRPT5",122,0)
+ Q
+"RTN","EDPRPT5",123,0)
+ ;
+"RTN","EDPRPT5",124,0)
+WORD(X) ; Return name of number X
+"RTN","EDPRPT5",125,0)
+ N Y S Y=$S(X=1:"one",X=2:"two",X=3:"three",X=4:"four",X=5:"five",X=6:"six",X=7:"seven",X=8:"eight",X=9:"nine",X=10:"ten",X=11:"eleven",X=12:"twelve",1:"none")
+"RTN","EDPRPT5",126,0)
+ Q Y
+"RTN","EDPRPT5",127,0)
+ ;
+"RTN","EDPRPT5",128,0)
+SETUP ; Create SHIFT(#) list of shift times
+"RTN","EDPRPT5",129,0)
+ N TA,X1,X,DUR
+"RTN","EDPRPT5",130,0)
+ S TA=+$O(^EDPB(231.9,"C",EDPSITE,0)),X1=$G(^EDPB(231.9,TA,1))
+"RTN","EDPRPT5",131,0)
+ S X=$P(X1,U,6),DUR=$P(X1,U,7)*60 I DUR'>0 S SHIFT=0 Q
+"RTN","EDPRPT5",132,0)
+ S SHIFT=1,SHIFT(1)=X*60 ;seconds
+"RTN","EDPRPT5",133,0)
+ F  S X=SHIFT(SHIFT)+DUR Q:X>86340  S SHIFT=SHIFT+1,SHIFT(SHIFT)=X
+"RTN","EDPRPT5",134,0)
+ Q
+"RTN","EDPRPT5",135,0)
+ ;
+"RTN","EDPRPT5",136,0)
+SHIFT(X,TXT) ; Return shift # for time X using SHIFT(#)
+"RTN","EDPRPT5",137,0)
+ I $G(X)="" Q 0
+"RTN","EDPRPT5",138,0)
+ N TM,Y
+"RTN","EDPRPT5",139,0)
+ S TM=$P($$FMTH^XLFDT(X),",",2) ;#seconds since midnight
+"RTN","EDPRPT5",140,0)
+ I TM<SHIFT(1)!(TM>=SHIFT(SHIFT)) S Y=SHIFT
+"RTN","EDPRPT5",141,0)
+ E  F I=2:1:SHIFT I TM<SHIFT(I) S Y=I-1 Q
+"RTN","EDPRPT5",142,0)
+ S:$G(TXT) Y=$$WORD(Y)
+"RTN","EDPRPT5",143,0)
+ ;S Y=$S(TM<25200:"three",TM<54000:"one",TM<82800:"two",1:"three")
+"RTN","EDPRPT5",144,0)
+ Q Y
+"RTN","EDPRPT5",145,0)
+ ;
+"RTN","EDPRPT5",146,0)
+ECODE(IEN) ; Return external value for an Acuity code
+"RTN","EDPRPT5",147,0)
+ N X,Y S X=$P($G(^EDPB(233.1,IEN,0)),U,3) ;code
+"RTN","EDPRPT5",148,0)
+ S Y=$S(X="":"none",'X:X,X=1:"one",X=2:"two",X=3:"three",X=4:"four",X=5:"five",1:"X")
+"RTN","EDPRPT5",149,0)
+ Q Y
+"RTN","EDPRPT6")
+0^18^B9613057
+"RTN","EDPRPT6",1,0)
+EDPRPT6 ;SLC/MKB - Provider Report
+"RTN","EDPRPT6",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT6",3,0)
+ ;
+"RTN","EDPRPT6",4,0)
+PRV(BEG,END) ; Get Provider Report for EDPSITE by date range
+"RTN","EDPRPT6",5,0)
+ N IN,LOG,X,X0,X1,X3,X4,MD,MDTIME,DISP,S,ACU
+"RTN","EDPRPT6",6,0)
+ N CNT,IN2MD,MD2DS,ROW,SHIFT
+"RTN","EDPRPT6",7,0)
+ S IN=BEG-.000001 D SETUP^EDPRPT5 ;build SHIFT(#)
+"RTN","EDPRPT6",8,0)
+ I 'SHIFT D ERR^EDPRPT(2300013) Q
+"RTN","EDPRPT6",9,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT6",10,0)
+ . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0))
+"RTN","EDPRPT6",11,0)
+ . S MD=$P(X3,U,5) Q:MD<1  ;no provider
+"RTN","EDPRPT6",12,0)
+ . S DISP=$P(X1,U,3),ACU=$$ACUITY($P(X3,U,3))
+"RTN","EDPRPT6",13,0)
+ . S MDTIME=$$MD^EDPRPT(LOG)
+"RTN","EDPRPT6",14,0)
+ . D:'$D(CNT(MD)) INIT(MD) ;set counters,sums to 0 per provider
+"RTN","EDPRPT6",15,0)
+D1 . ; all visits
+"RTN","EDPRPT6",16,0)
+ . S S=$$SHIFT^EDPRPT5(MDTIME)
+"RTN","EDPRPT6",17,0)
+ . S CNT(MD)=CNT(MD)+1,CNT(MD,S,ACU)=CNT(MD,S,ACU)+1
+"RTN","EDPRPT6",18,0)
+ . S IN2MD=$$FMDIFF^XLFDT(MDTIME,IN,2)\60
+"RTN","EDPRPT6",19,0)
+ . S IN2MD(MD)=IN2MD(MD)+IN2MD,IN2MD(MD,S,ACU)=IN2MD(MD,S,ACU)+IN2MD
+"RTN","EDPRPT6",20,0)
+ . S MD2DS=$S(DISP:$$FMDIFF^XLFDT(DISP,MDTIME,2)\60,1:0)
+"RTN","EDPRPT6",21,0)
+ . S MD2DS(MD)=MD2DS(MD)+MD2DS,MD2DS(MD,S,ACU)=MD2DS(MD,S,ACU)+MD2DS
+"RTN","EDPRPT6",22,0)
+D2 ; calculate & return averages as CSV
+"RTN","EDPRPT6",23,0)
+ I $G(CSV) D  Q
+"RTN","EDPRPT6",24,0)
+ . N TAB,NM,SFT S TAB=$C(9)
+"RTN","EDPRPT6",25,0)
+ . S X="MD Name"_TAB_"Shift"_TAB_"Acuity"_TAB_"# Patients"_TAB_"Time In to MD Assigned"_TAB_"MD Assign to Dispo"
+"RTN","EDPRPT6",26,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT6",27,0)
+ . S MD=0 F  S MD=$O(CNT(MD)) Q:MD<1  I CNT(MD) D
+"RTN","EDPRPT6",28,0)
+ .. S NM=$$EPERS^EDPRPT(MD) F S=1:1:SHIFT D
+"RTN","EDPRPT6",29,0)
+ ... S SFT=S F ACU=0:1:5 I CNT(MD,S,ACU) D
+"RTN","EDPRPT6",30,0)
+ .... S X=NM_TAB_SFT_TAB_ACU_TAB_CNT(MD,S,ACU)
+"RTN","EDPRPT6",31,0)
+ .... S X=X_TAB_$$ETIME^EDPRPT(IN2MD(MD,S,ACU)\CNT(MD,S,ACU))
+"RTN","EDPRPT6",32,0)
+ .... S X=X_TAB_$$ETIME^EDPRPT(MD2DS(MD,S,ACU)\CNT(MD,S,ACU))
+"RTN","EDPRPT6",33,0)
+ .... D ADD^EDPCSV(X) S (NM,SFT)=""
+"RTN","EDPRPT6",34,0)
+ .. S X="  MD TOTALS"_TAB_TAB_TAB_CNT(MD)
+"RTN","EDPRPT6",35,0)
+ .. S X=X_TAB_$$ETIME^EDPRPT(IN2MD(MD)\CNT(MD))
+"RTN","EDPRPT6",36,0)
+ .. S X=X_TAB_$$ETIME^EDPRPT(MD2DS(MD)\CNT(MD))
+"RTN","EDPRPT6",37,0)
+ .. D ADD^EDPCSV(X)
+"RTN","EDPRPT6",38,0)
+D3 ; or as XML
+"RTN","EDPRPT6",39,0)
+ D XML^EDPX("<providers>")
+"RTN","EDPRPT6",40,0)
+ S MD=0 F  S MD=$O(CNT(MD)) Q:MD<1  I CNT(MD) D
+"RTN","EDPRPT6",41,0)
+ . K ROW S ROW("name")=$$EPERS^EDPRPT(MD),ROW("total")=CNT(MD)
+"RTN","EDPRPT6",42,0)
+ . S ROW("timeMD")=$$ETIME^EDPRPT(IN2MD(MD)\CNT(MD))
+"RTN","EDPRPT6",43,0)
+ . S ROW("timeDisp")=$$ETIME^EDPRPT(MD2DS(MD)\CNT(MD))
+"RTN","EDPRPT6",44,0)
+ . S X=$$XMLA^EDPX("md",.ROW),X=$TR(X,"/") D XML^EDPX(X)
+"RTN","EDPRPT6",45,0)
+ . D XML^EDPX("<shifts>")
+"RTN","EDPRPT6",46,0)
+ . F S=1:1:SHIFT D
+"RTN","EDPRPT6",47,0)
+ .. F ACU=0:1:5 I CNT(MD,S,ACU) D
+"RTN","EDPRPT6",48,0)
+ ... K ROW S ROW("total")=CNT(MD,S,ACU)
+"RTN","EDPRPT6",49,0)
+ ... S ROW("number")=S,ROW("acuity")=ACU
+"RTN","EDPRPT6",50,0)
+ ... S ROW("timeMD")=$$ETIME^EDPRPT(IN2MD(MD,S,ACU)\CNT(MD,S,ACU))
+"RTN","EDPRPT6",51,0)
+ ... S ROW("timeDisp")=$$ETIME^EDPRPT(MD2DS(MD,S,ACU)\CNT(MD,S,ACU))
+"RTN","EDPRPT6",52,0)
+ ... S X=$$XMLA^EDPX("shift",.ROW) D XML^EDPX(X)
+"RTN","EDPRPT6",53,0)
+ . D XML^EDPX("</shifts>"),XML^EDPX("</md>")
+"RTN","EDPRPT6",54,0)
+ D XML^EDPX("</providers>")
+"RTN","EDPRPT6",55,0)
+ Q
+"RTN","EDPRPT6",56,0)
+ ;
+"RTN","EDPRPT6",57,0)
+INIT(DR) ; Initialize counters and sums
+"RTN","EDPRPT6",58,0)
+ N S,A
+"RTN","EDPRPT6",59,0)
+ S (CNT(DR),IN2MD(DR),MD2DS(DR))=0
+"RTN","EDPRPT6",60,0)
+ F S=1:1:SHIFT D
+"RTN","EDPRPT6",61,0)
+ . F A=0:1:5 S (CNT(DR,S,A),IN2MD(DR,S,A),MD2DS(DR,S,A))=0
+"RTN","EDPRPT6",62,0)
+ Q
+"RTN","EDPRPT6",63,0)
+ ;
+"RTN","EDPRPT6",64,0)
+ACUITY(IEN) ; Return external value [0-5] for an Acuity code
+"RTN","EDPRPT6",65,0)
+ N X0,Y S X0=$G(^EDPB(233.1,+IEN,0))
+"RTN","EDPRPT6",66,0)
+ S Y=$P(X0,U,3) S:Y<1 Y=+$P(X0,U,4) ;code or nat'l code
+"RTN","EDPRPT6",67,0)
+ Q Y
+"RTN","EDPRPT7")
+0^19^B19582712
+"RTN","EDPRPT7",1,0)
+EDPRPT7 ;SLC/MKB - Exposure Report
+"RTN","EDPRPT7",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT7",3,0)
+ ;
+"RTN","EDPRPT7",4,0)
+EXP(IEN) ; Get Exposure Report for IEN at EDPSITE
+"RTN","EDPRPT7",5,0)
+ S IEN=+$G(IEN)  Q:IEN<1  Q:'$D(^EDP(230,IEN,0))
+"RTN","EDPRPT7",6,0)
+ I $G(CSV) D EXP^EDPRPT7C(IEN) Q  ;CSV format instead
+"RTN","EDPRPT7",7,0)
+ N BEG,END,LIST,LOG,IN,OUT,X,X0,Y,RLIST,TREAT,OTHER,MD,RN,RES,I,J,RIN,ROUT
+"RTN","EDPRPT7",8,0)
+ N SHIFT D SETUP^EDPRPT5 ;build SHIFT(#)
+"RTN","EDPRPT7",9,0)
+ I 'SHIFT D ERR^EDPRPT(2300013) Q
+"RTN","EDPRPT7",10,0)
+ S X0=^EDP(230,IEN,0),BEG=$P(X0,U,8),END=$P(X0,U,9)
+"RTN","EDPRPT7",11,0)
+ S:'BEG BEG=$P(X0,U) S:'END END=$$NOW^EDPRPT
+"RTN","EDPRPT7",12,0)
+ D ROOMS(IEN,END)
+"RTN","EDPRPT7",13,0)
+ ; put IEN info into XML
+"RTN","EDPRPT7",14,0)
+ D XML^EDPX("<patient>")
+"RTN","EDPRPT7",15,0)
+ D ADD(IEN),STAFF(IEN)
+"RTN","EDPRPT7",16,0)
+ D XML^EDPX("</patient>")
+"RTN","EDPRPT7",17,0)
+E1 ; look for patients also in ED between BEG and END
+"RTN","EDPRPT7",18,0)
+ D FIND(BEG,END) ;create LIST(#) list of ien's to check
+"RTN","EDPRPT7",19,0)
+ S LOG=0 F  S LOG=+$O(LIST(LOG)) Q:'LOG  I LOG'=IEN D
+"RTN","EDPRPT7",20,0)
+ . S X0=$G(^EDP(230,LOG,0)),IN=$P(X0,U,8),OUT=$P(X0,U,9)
+"RTN","EDPRPT7",21,0)
+ . D ROOMS(LOG,OUT)
+"RTN","EDPRPT7",22,0)
+ . ; compare treatment rooms
+"RTN","EDPRPT7",23,0)
+ . S I=0 F  S I=$O(RLIST(IEN,I)) Q:I<1  D
+"RTN","EDPRPT7",24,0)
+ .. S RIN=$P(RLIST(IEN,I),U,2),ROUT=$P(RLIST(IEN,I),U,3)
+"RTN","EDPRPT7",25,0)
+ .. S J=0 F  S J=$O(RLIST(LOG,J)) Q:J<1  I +RLIST(IEN,I)=+RLIST(LOG,J) D
+"RTN","EDPRPT7",26,0)
+ ... S X=$P(RLIST(LOG,J),U,2) Q:X>ROUT     ;in to room after IEN left
+"RTN","EDPRPT7",27,0)
+ ... ;I (RIN<=X)&(X<=ROUT) S TREAT(LOG)="" Q
+"RTN","EDPRPT7",28,0)
+ ... S X=$P(RLIST(LOG,J),U,3) Q:X&(X<RIN)  ;out of room before IEN came
+"RTN","EDPRPT7",29,0)
+ ... ;I (RIN<=X)&(X<=ROUT) S TREAT(LOG)="" Q
+"RTN","EDPRPT7",30,0)
+ ... S TREAT(LOG)=""
+"RTN","EDPRPT7",31,0)
+ . I '$D(TREAT(LOG)) S OTHER(LOG)=""
+"RTN","EDPRPT7",32,0)
+E2 ; return treatment room patients
+"RTN","EDPRPT7",33,0)
+ I $O(TREAT(0)) D
+"RTN","EDPRPT7",34,0)
+ . D XML^EDPX("<treatmentRoom>")
+"RTN","EDPRPT7",35,0)
+ . S LOG=0 F  S LOG=$O(TREAT(LOG)) Q:LOG<1  D ADD(LOG),STAFF(LOG)
+"RTN","EDPRPT7",36,0)
+ . D XML^EDPX("</treatmentRoom>")
+"RTN","EDPRPT7",37,0)
+ ; return other ED patients
+"RTN","EDPRPT7",38,0)
+ I $O(OTHER(0)) D
+"RTN","EDPRPT7",39,0)
+ . D XML^EDPX("<otherPatients>")
+"RTN","EDPRPT7",40,0)
+ . S LOG=0 F  S LOG=$O(OTHER(LOG)) Q:LOG<1  D ADD(LOG),STAFF(LOG)
+"RTN","EDPRPT7",41,0)
+ . D XML^EDPX("</otherPatients>")
+"RTN","EDPRPT7",42,0)
+E3 ; return staff on duty
+"RTN","EDPRPT7",43,0)
+ D XML^EDPX("<onDutyStaff>")
+"RTN","EDPRPT7",44,0)
+ I $O(MD(0)) D
+"RTN","EDPRPT7",45,0)
+ . D XML^EDPX("<doctors>")
+"RTN","EDPRPT7",46,0)
+ . S I=0 F  S I=$O(MD(I)) Q:I<1  D
+"RTN","EDPRPT7",47,0)
+ .. S X="<md name='"_$$ESC^EDPX(MD(I))_"' />"
+"RTN","EDPRPT7",48,0)
+ .. D XML^EDPX(X)
+"RTN","EDPRPT7",49,0)
+ . D XML^EDPX("</doctors>")
+"RTN","EDPRPT7",50,0)
+ I $O(RN(0)) D
+"RTN","EDPRPT7",51,0)
+ . D XML^EDPX("<nurses>")
+"RTN","EDPRPT7",52,0)
+ . S I=0 F  S I=$O(RN(I)) Q:I<1  D
+"RTN","EDPRPT7",53,0)
+ .. S X="<rn name='"_$$ESC^EDPX(RN(I))_"' />"
+"RTN","EDPRPT7",54,0)
+ .. D XML^EDPX(X)
+"RTN","EDPRPT7",55,0)
+ . D XML^EDPX("</nurses>")
+"RTN","EDPRPT7",56,0)
+ I $O(RES(0)) D
+"RTN","EDPRPT7",57,0)
+ . D XML^EDPX("<residents>")
+"RTN","EDPRPT7",58,0)
+ . S I=0 F  S I=$O(RES(I)) Q:I<1  D
+"RTN","EDPRPT7",59,0)
+ .. S X="<md name='"_$$ESC^EDPX(RES(I))_"' />"
+"RTN","EDPRPT7",60,0)
+ .. D XML^EDPX(X)
+"RTN","EDPRPT7",61,0)
+ . D XML^EDPX("</residents>")
+"RTN","EDPRPT7",62,0)
+ D XML^EDPX("</onDutyStaff>")
+"RTN","EDPRPT7",63,0)
+ Q
+"RTN","EDPRPT7",64,0)
+ ;
+"RTN","EDPRPT7",65,0)
+FIND(IN,OUT) ; create LIST(#) of visits at same time
+"RTN","EDPRPT7",66,0)
+ N TIME,I,X K LIST
+"RTN","EDPRPT7",67,0)
+ S TIME=+$P(IN,".") ;ck today's arrivals
+"RTN","EDPRPT7",68,0)
+ F  S TIME=$O(^EDP(230,"ATI",EDPSITE,TIME)) Q:TIME<1!(TIME>OUT)  D
+"RTN","EDPRPT7",69,0)
+ . S I=0 F  S I=$O(^EDP(230,"ATI",EDPSITE,TIME,I)) Q:I<1  D
+"RTN","EDPRPT7",70,0)
+ .. S X=$P($G(^EDP(230,I,0)),U,9) I X,X<IN Q  ;left before IEN arrived
+"RTN","EDPRPT7",71,0)
+ .. S LIST(I)=""
+"RTN","EDPRPT7",72,0)
+ Q
+"RTN","EDPRPT7",73,0)
+ ;
+"RTN","EDPRPT7",74,0)
+ROOMS(LOG,OUT) ; Return RLIST(LOG,n) = room ^ time in ^ time out
+"RTN","EDPRPT7",75,0)
+ N N,D,I,X,LAST S N=0,LAST=""
+"RTN","EDPRPT7",76,0)
+ S D=0 F  S D=$O(^EDP(230.1,"ADF",LOG,D)) Q:D<1  S I=+$O(^(D,0)) D
+"RTN","EDPRPT7",77,0)
+ . S X=+$P($G(^EDP(230.1,I,3)),U,4) Q:'X  Q:X=LAST  ;no location change
+"RTN","EDPRPT7",78,0)
+ . S:N $P(RLIST(LOG,N),U,3)=D ;time in of next room = time out of prev
+"RTN","EDPRPT7",79,0)
+ . S N=N+1,RLIST(LOG,N)=X_U_D,LAST=X ;new room
+"RTN","EDPRPT7",80,0)
+ I N,'$P(RLIST(LOG,N),U,3) S $P(RLIST(LOG,N),U,3)=OUT
+"RTN","EDPRPT7",81,0)
+ Q
+"RTN","EDPRPT7",82,0)
+ ;
+"RTN","EDPRPT7",83,0)
+ADD(LOG) ; Add row to XML for each room used during visit
+"RTN","EDPRPT7",84,0)
+ N EDPI,EDPX,ROW,LABS,XRAY,X,X0
+"RTN","EDPRPT7",85,0)
+ S EDPI=0 F  S EDPI=$O(RLIST(LOG,EDPI)) Q:EDPI<1  S EDPX=RLIST(LOG,EDPI) D
+"RTN","EDPRPT7",86,0)
+ . K ROW S ROW("id")=LOG ;only return for EDPI=1 ??
+"RTN","EDPRPT7",87,0)
+ . S ROW("roomName")=$P($G(^EDPB(231.8,+EDPX,0)),U)
+"RTN","EDPRPT7",88,0)
+ . S X=$P(EDPX,U,2)
+"RTN","EDPRPT7",89,0)
+ . S ROW("shiftIn")=$$SHIFT^EDPRPT5(X),ROW("inTS")=X
+"RTN","EDPRPT7",90,0)
+ . S X=$P(EDPX,U,3)
+"RTN","EDPRPT7",91,0)
+ . S ROW("shiftOut")=$$SHIFT^EDPRPT5(X),ROW("outTS")=X
+"RTN","EDPRPT7",92,0)
+ . S X=$P($G(^EDP(230,LOG,1)),U,2),ROW("disposition")=$$ECODE^EDPRPT(X)
+"RTN","EDPRPT7",93,0)
+ . S X0=$G(^EDP(230,LOG,0)),X=$P(X0,U,10),ROW("arrival")=$$ENAME^EDPRPT(X)
+"RTN","EDPRPT7",94,0)
+ . S X=$$DXPRI^EDPQPCE(+$P(X0,U,3),LOG),ROW("dx")=$P(X,U,2)
+"RTN","EDPRPT7",95,0)
+ . S LABS=$D(^EDP(230,LOG,8,"AC","L")),XRAY=$D(^("R")),X=""
+"RTN","EDPRPT7",96,0)
+ . I LABS!XRAY D  S X=X_" ordered"
+"RTN","EDPRPT7",97,0)
+ .. I LABS&XRAY S X="Labs and Imaging" Q
+"RTN","EDPRPT7",98,0)
+ .. S:LABS X="Labs" S:XRAY X="Imaging"
+"RTN","EDPRPT7",99,0)
+ . S ROW("notes")=X
+"RTN","EDPRPT7",100,0)
+ . S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X)
+"RTN","EDPRPT7",101,0)
+ Q
+"RTN","EDPRPT7",102,0)
+ ;
+"RTN","EDPRPT7",103,0)
+STAFF(LOG) ; save staff involved in patient care
+"RTN","EDPRPT7",104,0)
+ N D,I,X,ACT S LOG=+$G(LOG)
+"RTN","EDPRPT7",105,0)
+ S D=0 F  S D=$O(^EDP(230.1,"ADF",LOG,D)) Q:D<1  S I=+$O(^(D,0)) D
+"RTN","EDPRPT7",106,0)
+ . S ACT=$G(^EDP(230.1,I,3))
+"RTN","EDPRPT7",107,0)
+ . S X=+$P(ACT,U,5) S:X MD(X)=$$EPERS^EDPRPT(X)
+"RTN","EDPRPT7",108,0)
+ . S X=+$P(ACT,U,6) S:X RN(X)=$$EPERS^EDPRPT(X)
+"RTN","EDPRPT7",109,0)
+ . S X=+$P(ACT,U,7) S:X RES(X)=$$EPERS^EDPRPT(X)
+"RTN","EDPRPT7",110,0)
+ Q
+"RTN","EDPRPT7C")
+0^20^B19611509
+"RTN","EDPRPT7C",1,0)
+EDPRPT7C ;SLC/MKB - Exposure Report (CSV format)
+"RTN","EDPRPT7C",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT7C",3,0)
+ ;
+"RTN","EDPRPT7C",4,0)
+EXP(IEN) ; Get Exposure Report for IEN at EDPSITE
+"RTN","EDPRPT7C",5,0)
+ S IEN=+$G(IEN)  Q:IEN<1  Q:'$D(^EDP(230,IEN,0))
+"RTN","EDPRPT7C",6,0)
+ N BEG,END,LIST,LOG,IN,OUT,X,X0,Y,RLIST,TREAT,OTHER,MD,RN,RES,I,J,RIN,ROUT,TAB
+"RTN","EDPRPT7C",7,0)
+ N SHIFT D SETUP^EDPRPT5 ;build SHIFT(#)
+"RTN","EDPRPT7C",8,0)
+ I 'SHIFT D ERR^EDPRPT(2300013) Q
+"RTN","EDPRPT7C",9,0)
+ S X0=^EDP(230,IEN,0),BEG=$P(X0,U,8),END=$P(X0,U,9),TAB=$C(9)
+"RTN","EDPRPT7C",10,0)
+ S:'BEG BEG=$P(X0,U) S:'END END=$$NOW^EDPRPT
+"RTN","EDPRPT7C",11,0)
+ D ROOMS(IEN,END)
+"RTN","EDPRPT7C",12,0)
+ ; put IEN info into CSV
+"RTN","EDPRPT7C",13,0)
+ S X="ED"_TAB_"Room"_TAB_"Shift - Time In"_TAB_"Shift - Time Out"_TAB_"Diagnosis"_TAB_"Dispo"_TAB_"Arr Mode"_TAB_"Notes"
+"RTN","EDPRPT7C",14,0)
+ D ADD^EDPCSV(X),BLANK^EDPCSV ;headers
+"RTN","EDPRPT7C",15,0)
+ S X=TAB_TAB_"Contagious Patient Information"
+"RTN","EDPRPT7C",16,0)
+ D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPT7C",17,0)
+ D ADD(IEN),STAFF(IEN)
+"RTN","EDPRPT7C",18,0)
+ D BLANK^EDPCSV
+"RTN","EDPRPT7C",19,0)
+E1 ; look for patients also in ED between BEG and END
+"RTN","EDPRPT7C",20,0)
+ D FIND(BEG,END) ;create LIST(#) list of ien's to check
+"RTN","EDPRPT7C",21,0)
+ S LOG=0 F  S LOG=+$O(LIST(LOG)) Q:'LOG  I LOG'=IEN D
+"RTN","EDPRPT7C",22,0)
+ . S X0=$G(^EDP(230,LOG,0)),IN=$P(X0,U,8),OUT=$P(X0,U,9)
+"RTN","EDPRPT7C",23,0)
+ . D ROOMS(LOG,OUT)
+"RTN","EDPRPT7C",24,0)
+ . ; compare treatment rooms
+"RTN","EDPRPT7C",25,0)
+ . S I=0 F  S I=$O(RLIST(IEN,I)) Q:I<1  D
+"RTN","EDPRPT7C",26,0)
+ .. S RIN=$P(RLIST(IEN,I),U,2),ROUT=$P(RLIST(IEN,I),U,3)
+"RTN","EDPRPT7C",27,0)
+ .. S J=0 F  S J=$O(RLIST(LOG,J)) Q:J<1  I +RLIST(IEN,I)=+RLIST(LOG,J) D
+"RTN","EDPRPT7C",28,0)
+ ... S X=$P(RLIST(LOG,J),U,2) Q:X>ROUT     ;in to room after IEN left
+"RTN","EDPRPT7C",29,0)
+ ... ;I (RIN<=X)&(X<=ROUT) S TREAT(LOG)="" Q
+"RTN","EDPRPT7C",30,0)
+ ... S X=$P(RLIST(LOG,J),U,3) Q:X&(X<RIN)  ;out of room before IEN came
+"RTN","EDPRPT7C",31,0)
+ ... ;I (RIN<=X)&(X<=ROUT) S TREAT(LOG)="" Q
+"RTN","EDPRPT7C",32,0)
+ ... S TREAT(LOG)=""
+"RTN","EDPRPT7C",33,0)
+ . I '$D(TREAT(LOG)) S OTHER(LOG)=""
+"RTN","EDPRPT7C",34,0)
+E2 ; return treatment room patients
+"RTN","EDPRPT7C",35,0)
+ D ADD^EDPCSV(TAB_TAB_"Exposed in Treatment Room"),BLANK^EDPCSV
+"RTN","EDPRPT7C",36,0)
+ I '$O(TREAT(0)) D ADD^EDPCSV(TAB_TAB_"  None")
+"RTN","EDPRPT7C",37,0)
+ E  S LOG=0 F  S LOG=$O(TREAT(LOG)) Q:LOG<1  D ADD(LOG),STAFF(LOG)
+"RTN","EDPRPT7C",38,0)
+ D BLANK^EDPCSV
+"RTN","EDPRPT7C",39,0)
+ ; return other ED patients
+"RTN","EDPRPT7C",40,0)
+ D ADD^EDPCSV(TAB_TAB_"Other ED Patients"),BLANK^EDPCSV
+"RTN","EDPRPT7C",41,0)
+ I '$O(OTHER(0)) D ADD^EDPCSV(TAB_TAB_"  None")
+"RTN","EDPRPT7C",42,0)
+ E  S LOG=0 F  S LOG=$O(OTHER(LOG)) Q:LOG<1  D ADD(LOG),STAFF(LOG)
+"RTN","EDPRPT7C",43,0)
+ D BLANK^EDPCSV
+"RTN","EDPRPT7C",44,0)
+E3 ; return staff on duty
+"RTN","EDPRPT7C",45,0)
+ N MAX,MORE D ADD^EDPCSV(TAB_TAB_"On Duty Staff")
+"RTN","EDPRPT7C",46,0)
+ D ADD^EDPCSV(TAB_"Doctors"_TAB_"Nurses"_TAB_"Residents")
+"RTN","EDPRPT7C",47,0)
+ S MAX=+$G(RN) S:$G(MD)>MAX MAX=+MD S:$G(RES)>MAX MAX=+RES
+"RTN","EDPRPT7C",48,0)
+ S MORE=1,(MD,RN,RES)=0 F  D  Q:'MORE
+"RTN","EDPRPT7C",49,0)
+ . S:MD'="" MD=$O(MD(MD)) S:RN'="" RN=$O(RN(RN))
+"RTN","EDPRPT7C",50,0)
+ . S:RES'="" RES=$O(RES(RES)) ;get next
+"RTN","EDPRPT7C",51,0)
+ . I MD="",RN="",RES="" S MORE=0 Q  ;done
+"RTN","EDPRPT7C",52,0)
+ . S X=TAB_$S(MD:MD(MD),1:"")_TAB_$S(RN:RN(RN),1:"")_TAB_$S(RES:RES(RES),1:"")
+"RTN","EDPRPT7C",53,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT7C",54,0)
+ Q
+"RTN","EDPRPT7C",55,0)
+ ;
+"RTN","EDPRPT7C",56,0)
+FIND(IN,OUT) ; create LIST(#) of visits at same time
+"RTN","EDPRPT7C",57,0)
+ N TIME,I,X K LIST
+"RTN","EDPRPT7C",58,0)
+ S TIME=+$P(IN,".") ;ck today's arrivals
+"RTN","EDPRPT7C",59,0)
+ F  S TIME=$O(^EDP(230,"ATI",EDPSITE,TIME)) Q:TIME<1!(TIME>OUT)  D
+"RTN","EDPRPT7C",60,0)
+ . S I=0 F  S I=$O(^EDP(230,"ATI",EDPSITE,TIME,I)) Q:I<1  D
+"RTN","EDPRPT7C",61,0)
+ .. S X=$P($G(^EDP(230,I,0)),U,9) I X,X<IN Q  ;left before IEN arrived
+"RTN","EDPRPT7C",62,0)
+ .. S LIST(I)=""
+"RTN","EDPRPT7C",63,0)
+ Q
+"RTN","EDPRPT7C",64,0)
+ ;
+"RTN","EDPRPT7C",65,0)
+ROOMS(LOG,OUT) ; Return RLIST(LOG,n)= room ^ time in ^ time out
+"RTN","EDPRPT7C",66,0)
+ N N,D,I,X,LAST S N=0,LAST=""
+"RTN","EDPRPT7C",67,0)
+ S D=0 F  S D=$O(^EDP(230.1,"ADF",LOG,D)) Q:D<1  S I=+$O(^(D,0)) D
+"RTN","EDPRPT7C",68,0)
+ . S X=+$P($G(^EDP(230.1,I,3)),U,4) Q:'X  Q:X=LAST  ;no location change
+"RTN","EDPRPT7C",69,0)
+ . S:N $P(RLIST(LOG,N),U,3)=D ;time in of next room = time out of prev
+"RTN","EDPRPT7C",70,0)
+ . S N=N+1,RLIST(LOG,N)=X_U_D,LAST=X ;new room
+"RTN","EDPRPT7C",71,0)
+ I N,'$P(RLIST(LOG,N),U,3) S $P(RLIST(LOG,N),U,3)=OUT
+"RTN","EDPRPT7C",72,0)
+ Q
+"RTN","EDPRPT7C",73,0)
+ ;
+"RTN","EDPRPT7C",74,0)
+ADD(LOG) ; Add row to CSV for each room used during visit
+"RTN","EDPRPT7C",75,0)
+ N EDPI,EDPX,ROW,LABS,XRAY,X,X0
+"RTN","EDPRPT7C",76,0)
+ S EDPI=0 F  S EDPI=$O(RLIST(LOG,EDPI)) Q:EDPI<1  S EDPX=RLIST(LOG,EDPI) D
+"RTN","EDPRPT7C",77,0)
+ . S ROW=$S(EDPI=1:LOG,1:"")_TAB_$P($G(^EDPB(231.8,+EDPX,0)),U)
+"RTN","EDPRPT7C",78,0)
+ . S X=$P(EDPX,U,2) ;shiftTimeIn
+"RTN","EDPRPT7C",79,0)
+ . S ROW=ROW_TAB_$$SHIFT^EDPRPT5(X)_" - "_$$EDATE^EDPRPT(X)
+"RTN","EDPRPT7C",80,0)
+ . S X=$P(EDPX,U,3) ;shiftTimeOut
+"RTN","EDPRPT7C",81,0)
+ . S ROW=ROW_TAB_$$SHIFT^EDPRPT5(X)_" - "_$$EDATE^EDPRPT(X)
+"RTN","EDPRPT7C",82,0)
+ . S X0=$G(^EDP(230,LOG,0)),X=$$DXPRI^EDPQPCE(+$P(X0,U,3),LOG)
+"RTN","EDPRPT7C",83,0)
+ . S ROW=ROW_TAB_$P(X,U,2) ;Dx
+"RTN","EDPRPT7C",84,0)
+ . S X=$P($G(^EDP(230,LOG,1)),U,2),ROW=ROW_TAB_$$ECODE^EDPRPT(X) ;dis
+"RTN","EDPRPT7C",85,0)
+ . S X=$P(X0,U,10),ROW=ROW_TAB_$$ENAME^EDPRPT(X) ;arrival
+"RTN","EDPRPT7C",86,0)
+ . S LABS=$D(^EDP(230,LOG,8,"AC","L")),XRAY=$D(^("R")),X=""
+"RTN","EDPRPT7C",87,0)
+ . I LABS!XRAY D  S X=X_" ordered"
+"RTN","EDPRPT7C",88,0)
+ .. I LABS&XRAY S X="Labs and Imaging" Q
+"RTN","EDPRPT7C",89,0)
+ .. S:LABS X="Labs" S:XRAY X="Imaging"
+"RTN","EDPRPT7C",90,0)
+ . S ROW=ROW_TAB_X ;notes
+"RTN","EDPRPT7C",91,0)
+ . D ADD^EDPCSV(ROW)
+"RTN","EDPRPT7C",92,0)
+ Q
+"RTN","EDPRPT7C",93,0)
+ ;
+"RTN","EDPRPT7C",94,0)
+STAFF(LOG) ; save staff involved in patient care
+"RTN","EDPRPT7C",95,0)
+ N D,I,X,ACT S LOG=+$G(LOG)
+"RTN","EDPRPT7C",96,0)
+ S D=0 F  S D=$O(^EDP(230.1,"ADF",LOG,D)) Q:D<1  S I=+$O(^(D,0)) D
+"RTN","EDPRPT7C",97,0)
+ . S ACT=$G(^EDP(230.1,I,3))
+"RTN","EDPRPT7C",98,0)
+ . S X=+$P(ACT,U,5) S:X MD(X)=$$EPERS^EDPRPT(X)
+"RTN","EDPRPT7C",99,0)
+ . S X=+$P(ACT,U,6) S:X RN(X)=$$EPERS^EDPRPT(X)
+"RTN","EDPRPT7C",100,0)
+ . S X=+$P(ACT,U,7) S:X RES(X)=$$EPERS^EDPRPT(X)
+"RTN","EDPRPT7C",101,0)
+ Q
+"RTN","EDPRPT8")
+0^21^B14454195
+"RTN","EDPRPT8",1,0)
+EDPRPT8 ;SLC/MKB - Acuity Report
+"RTN","EDPRPT8",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT8",3,0)
+ ;
+"RTN","EDPRPT8",4,0)
+ACU(BEG,END) ; Get Acuity Report for EDPSITE by date range
+"RTN","EDPRPT8",5,0)
+ ;   CNT = counters by acuity
+"RTN","EDPRPT8",6,0)
+ ;   ADM = counters for all admissions
+"RTN","EDPRPT8",7,0)
+ ;   VA  = counters for VA  admissions
+"RTN","EDPRPT8",8,0)
+ ;   MIN = accumulate #minutes
+"RTN","EDPRPT8",9,0)
+ N IN,OUT,X,X0,X1,X3,X4,DISP,ACU,CNT,ADM,MIN,VA,ROW
+"RTN","EDPRPT8",10,0)
+ D INIT ;set counters, sums to 0
+"RTN","EDPRPT8",11,0)
+ S IN=BEG-.000001
+"RTN","EDPRPT8",12,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT8",13,0)
+ . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3)),X4=$G(^(4,1,0))
+"RTN","EDPRPT8",14,0)
+ . S DISP=$$ECODE^EDPRPT($P(X1,U,2)),ACU=$$ECODE($P(X3,U,3))
+"RTN","EDPRPT8",15,0)
+ . S CNT=CNT+1,CNT(ACU)=CNT(ACU)+1
+"RTN","EDPRPT8",16,0)
+ . ; all admissions
+"RTN","EDPRPT8",17,0)
+ . S (ADMDEC,ADMDEL)=0
+"RTN","EDPRPT8",18,0)
+ . S X=$$ADMIT^EDPRPT(LOG) I X D  ;decision to admit
+"RTN","EDPRPT8",19,0)
+ .. S ADM=ADM+1,ADM(ACU)=ADM(ACU)+1
+"RTN","EDPRPT8",20,0)
+ .. S ADMDEC=$$FMDIFF^XLFDT(X,IN,2)\60
+"RTN","EDPRPT8",21,0)
+ .. S:ADMDEC MIN("DEC")=MIN("DEC")+ADMDEC,MIN("DEC",ACU)=MIN("DEC",ACU)+ADMDEC
+"RTN","EDPRPT8",22,0)
+ .. S OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW
+"RTN","EDPRPT8",23,0)
+ .. S:OUT ADMDEL=$$FMDIFF^XLFDT(OUT,X,2)\60
+"RTN","EDPRPT8",24,0)
+ . I $$VADMIT^EDPRPT2(DISP) D  ;VA admissions
+"RTN","EDPRPT8",25,0)
+ .. S VA=VA+1,VA(ACU)=VA(ACU)+1
+"RTN","EDPRPT8",26,0)
+ .. S MIN("VADEC")=MIN("VADEC")+ADMDEC
+"RTN","EDPRPT8",27,0)
+ .. S MIN("VADEC",ACU)=MIN("VADEC",ACU)+ADMDEC
+"RTN","EDPRPT8",28,0)
+ .. S MIN("VADEL")=MIN("VADEL")+ADMDEL
+"RTN","EDPRPT8",29,0)
+ .. S MIN("VADEL",ACU)=MIN("VADEL",ACU)+ADMDEL
+"RTN","EDPRPT8",30,0)
+A1 ; return counts and averages
+"RTN","EDPRPT8",31,0)
+ S I="" F  S I=$O(ADM(I)) Q:I=""  D  ;avg #min admit dec by acuity
+"RTN","EDPRPT8",32,0)
+ . S MIN("DEC",I)=$S(ADM(I):$$ETIME^EDPRPT(MIN("DEC",I)\ADM(I)),1:0)
+"RTN","EDPRPT8",33,0)
+ . S MIN("VADEC",I)=$S(VA(I):$$ETIME^EDPRPT(MIN("VADEC",I)\VA(I)),1:0)
+"RTN","EDPRPT8",34,0)
+ . S MIN("VADEL",I)=$S(VA(I):$$ETIME^EDPRPT(MIN("VADEL",I)\VA(I)),1:0)
+"RTN","EDPRPT8",35,0)
+ S CNT("total")=CNT,ADM("total")=ADM,VA("total")=VA
+"RTN","EDPRPT8",36,0)
+ S CNT("type")="Number of Patients",ADM("type")="Number Admitted",VA("type")="Number VA Admitted"
+"RTN","EDPRPT8",37,0)
+ S MIN("DEC","type")="Avg All Admit Dec Time",MIN("VADEC","type")="Avg VA Admit Dec Time",MIN("VADEL","type")="Avg VA Admit Delay Time"
+"RTN","EDPRPT8",38,0)
+ S MIN("DEC","total")=$S(ADM:$$ETIME^EDPRPT(MIN("DEC")\ADM),1:0)
+"RTN","EDPRPT8",39,0)
+ S MIN("VADEC","total")=$S(VA:$$ETIME^EDPRPT(MIN("VADEC")\VA),1:0)
+"RTN","EDPRPT8",40,0)
+ S MIN("VADEL","total")=$S(VA:$$ETIME^EDPRPT(MIN("VADEL")\VA),1:0)
+"RTN","EDPRPT8",41,0)
+ ; as CSV
+"RTN","EDPRPT8",42,0)
+ I $G(CSV) D  Q
+"RTN","EDPRPT8",43,0)
+ . N TAB S TAB=$C(9)
+"RTN","EDPRPT8",44,0)
+ . S X="Acuity->"_TAB_"0"_TAB_"1"_TAB_"2"_TAB_"3"_TAB_"4"_TAB_"5"_TAB_"Total/Average"
+"RTN","EDPRPT8",45,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT8",46,0)
+ . D ROW("Number of Patients",.CNT)
+"RTN","EDPRPT8",47,0)
+ . D ROW("Number Admitted",.ADM)
+"RTN","EDPRPT8",48,0)
+ . D ROW("Number VA Admitted",.VA)
+"RTN","EDPRPT8",49,0)
+ . M ROW=MIN("DEC")   D ROW("Avg All Admit Dec Time",.ROW)  K ROW
+"RTN","EDPRPT8",50,0)
+ . M ROW=MIN("VADEC") D ROW("Avg VA Admit Dec Time",.ROW)   K ROW
+"RTN","EDPRPT8",51,0)
+ . M ROW=MIN("VADEL") D ROW("Avg VA Admit Delay Time",.ROW) K ROW
+"RTN","EDPRPT8",52,0)
+ ; or as XML
+"RTN","EDPRPT8",53,0)
+ D XML^EDPX("<statistics>")
+"RTN","EDPRPT8",54,0)
+ S X=$$XMLA^EDPX("row",.CNT) D XML^EDPX(X)
+"RTN","EDPRPT8",55,0)
+ S X=$$XMLA^EDPX("row",.ADM) D XML^EDPX(X)
+"RTN","EDPRPT8",56,0)
+ S X=$$XMLA^EDPX("row",.VA)  D XML^EDPX(X)
+"RTN","EDPRPT8",57,0)
+ M ROW=MIN("DEC")   S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) K ROW
+"RTN","EDPRPT8",58,0)
+ M ROW=MIN("VADEC") S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) K ROW
+"RTN","EDPRPT8",59,0)
+ M ROW=MIN("VADEL") S X=$$XMLA^EDPX("row",.ROW) D XML^EDPX(X) K ROW
+"RTN","EDPRPT8",60,0)
+ D XML^EDPX("</statistics>")
+"RTN","EDPRPT8",61,0)
+ Q
+"RTN","EDPRPT8",62,0)
+ ;
+"RTN","EDPRPT8",63,0)
+ROW(NAME,LIST) ; add line
+"RTN","EDPRPT8",64,0)
+ N I S X=NAME
+"RTN","EDPRPT8",65,0)
+ F I="none","one","two","three","four","five","total" S X=X_TAB_LIST(I)
+"RTN","EDPRPT8",66,0)
+ D ADD^EDPCSV(X)
+"RTN","EDPRPT8",67,0)
+ Q
+"RTN","EDPRPT8",68,0)
+ ;
+"RTN","EDPRPT8",69,0)
+INIT ; Initialize acuity counters
+"RTN","EDPRPT8",70,0)
+ N X S (CNT,ADM,VA)=0
+"RTN","EDPRPT8",71,0)
+ F X="none","one","two","three","four","five" D
+"RTN","EDPRPT8",72,0)
+ . S (CNT(X),ADM(X),VA(X),MIN("DEC",X),MIN("VADEC",X),MIN("VADEL",X))=0
+"RTN","EDPRPT8",73,0)
+ F X="DEC","VADEC","VADEL" S MIN(X)=0
+"RTN","EDPRPT8",74,0)
+ Q
+"RTN","EDPRPT8",75,0)
+ ;
+"RTN","EDPRPT8",76,0)
+ECODE(IEN) ; Return external value for an Acuity code
+"RTN","EDPRPT8",77,0)
+ N X0,X,Y S X0=$G(^EDPB(233.1,+IEN,0))
+"RTN","EDPRPT8",78,0)
+ S X=$P(X0,U,3) S:X<1 X=$P(X0,U,4) ;code or nat'l code
+"RTN","EDPRPT8",79,0)
+ S Y=$S(X=1:"one",X=2:"two",X=3:"three",X=4:"four",X=5:"five",1:"none")
+"RTN","EDPRPT8",80,0)
+ Q Y
+"RTN","EDPRPT9")
+0^22^B1592058
+"RTN","EDPRPT9",1,0)
+EDPRPT9 ;SLC/MKB - Patient Xref Report
+"RTN","EDPRPT9",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPT9",3,0)
+ ;
+"RTN","EDPRPT9",4,0)
+XRF(BEG,END) ; Get Patient Xref Report for EDPSITE by date range
+"RTN","EDPRPT9",5,0)
+ ;   CNT = counters
+"RTN","EDPRPT9",6,0)
+ N IN,LOG,DFN,ID,X,ROW,TAB
+"RTN","EDPRPT9",7,0)
+ D:'$G(CSV) XML^EDPX("<patients>") I $G(CSV) D  ;headers
+"RTN","EDPRPT9",8,0)
+ . S TAB=$C(9),X="ED"_TAB_"Patient ID"_TAB_"Patient DFN"
+"RTN","EDPRPT9",9,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPT9",10,0)
+ S IN=BEG-.000001
+"RTN","EDPRPT9",11,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPT9",12,0)
+ . S DFN=$P($G(^EDP(230,LOG,0)),U,6),ID=$P($G(^(0)),U,11) Q:DFN<1
+"RTN","EDPRPT9",13,0)
+ . I $G(CSV) S X=LOG_TAB_ID_TAB_DFN D ADD^EDPCSV(X) Q
+"RTN","EDPRPT9",14,0)
+ . K ROW S ROW("id")=LOG
+"RTN","EDPRPT9",15,0)
+ . S ROW("patientDfn")=DFN
+"RTN","EDPRPT9",16,0)
+ . S ROW("patientId")=ID
+"RTN","EDPRPT9",17,0)
+ . S X=$$XMLA^EDPX("patient",.ROW) D XML^EDPX(X)
+"RTN","EDPRPT9",18,0)
+ D:'$G(CSV) XML^EDPX("</patients>")
+"RTN","EDPRPT9",19,0)
+ Q
+"RTN","EDPRPTBV")
+0^51^B21129991
+"RTN","EDPRPTBV",1,0)
+EDPRPTBV ;SLC/MKB - BVAC Report
+"RTN","EDPRPTBV",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPRPTBV",3,0)
+ ;
+"RTN","EDPRPTBV",4,0)
+EN(BEG,END) ; Get Activity Report for EDPSITE by date range
+"RTN","EDPRPTBV",5,0)
+ N LOG,X,X0,X1,X3,DX,IN,OUT,ROW,ICD,I
+"RTN","EDPRPTBV",6,0)
+ N ELAPSE,TRIAGE,ADMDEC,ADMDEL,CNT,ADM,MIN,AVG
+"RTN","EDPRPTBV",7,0)
+ D INIT ;set counters, sums to 0
+"RTN","EDPRPTBV",8,0)
+ D:'$G(CSV) XML^EDPX("<logEntries>") I $G(CSV) D  ;headers
+"RTN","EDPRPTBV",9,0)
+ . N TAB S TAB=$C(9)
+"RTN","EDPRPTBV",10,0)
+ . S X="Patient"_TAB_"Time In"_TAB_"Time Out"_TAB_"Complaint"_TAB_"MD"_TAB_"Acuity"_TAB_"Elapsed"_TAB_"Triage"_TAB_"Dispo"_TAB_"Admit Dec"_TAB_"Admit Delay"_TAB_"Diagnosis"_TAB_"ICD9"
+"RTN","EDPRPTBV",11,0)
+ . S X=X_TAB_"Viet Vet"_TAB_"Agent Orange"_TAB_"OEF/OIF"_TAB_"Pers Gulf"_TAB_"VA Pension"_TAB_"POW"_TAB_"Serv Conn %"_TAB_"Purp Hrt"_TAB_"Unemploy"_TAB_"Combat End"
+"RTN","EDPRPTBV",12,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPTBV",13,0)
+ S IN=BEG-.000001
+"RTN","EDPRPTBV",14,0)
+ F  S IN=$O(^EDP(230,"ATI",EDPSITE,IN)) Q:'IN  Q:IN>END  S LOG=0 F  S LOG=+$O(^EDP(230,"ATI",EDPSITE,IN,LOG)) Q:LOG<1  D
+"RTN","EDPRPTBV",15,0)
+ . S X0=^EDP(230,LOG,0),X1=$G(^(1)),X3=$G(^(3))
+"RTN","EDPRPTBV",16,0)
+ . S DX=$$BVAC(+$P(X0,U,3),LOG) Q:DX=""  ;no codes in range
+"RTN","EDPRPTBV",17,0)
+ . S CNT=CNT+1,OUT=$P(X0,U,9) ;S:OUT="" OUT=NOW
+"RTN","EDPRPTBV",18,0)
+ . S ELAPSE=$S(OUT:($$FMDIFF^XLFDT(OUT,IN,2)\60),1:0)
+"RTN","EDPRPTBV",19,0)
+ . S MIN("elapsed")=MIN("elapsed")+ELAPSE
+"RTN","EDPRPTBV",20,0)
+ . S X=$$ACUITY^EDPRPT(LOG),TRIAGE=0 ;S:X<1 X=OUT
+"RTN","EDPRPTBV",21,0)
+ . S:X TRIAGE=($$FMDIFF^XLFDT(X,IN,2)\60)
+"RTN","EDPRPTBV",22,0)
+ . S MIN("triage")=MIN("triage")+TRIAGE
+"RTN","EDPRPTBV",23,0)
+ . S (ADMDEC,ADMDEL)=""
+"RTN","EDPRPTBV",24,0)
+ . S X=$$ADMIT^EDPRPT(LOG) I X S ADM=ADM+1 D   ;decision to admit
+"RTN","EDPRPTBV",25,0)
+ .. S ADMDEC=($$FMDIFF^XLFDT(X,IN,2)\60)
+"RTN","EDPRPTBV",26,0)
+ .. S ADMDEL=$S(OUT:($$FMDIFF^XLFDT(OUT,X,2)\60),1:0)
+"RTN","EDPRPTBV",27,0)
+ .. S MIN("admDec")=MIN("admDec")+ADMDEC
+"RTN","EDPRPTBV",28,0)
+ .. S MIN("admDel")=MIN("admDel")+ADMDEL
+"RTN","EDPRPTBV",29,0)
+ . ;
+"RTN","EDPRPTBV",30,0)
+BV1 . ; add row to report
+"RTN","EDPRPTBV",31,0)
+ . ;S ICD=$P($G(^ICD9(+$P(X4,U,2),0)),U) Q:ICD<290  Q:ICD>316
+"RTN","EDPRPTBV",32,0)
+ . K ROW S ROW("patient")=$P(X0,U,4)
+"RTN","EDPRPTBV",33,0)
+ . S ROW("inTS")=$S($G(CSV):$$EDATE^EDPRPT(IN),1:IN)
+"RTN","EDPRPTBV",34,0)
+ . S ROW("outTS")=$S($G(CSV):$$EDATE^EDPRPT(OUT),1:OUT)
+"RTN","EDPRPTBV",35,0)
+ . S ROW("complaint")=$P(X1,U)
+"RTN","EDPRPTBV",36,0)
+ . S ROW("md")=$$EPERS^EDPRPT($P(X3,U,5))
+"RTN","EDPRPTBV",37,0)
+ . S ROW("acuity")=$$ECODE^EDPRPT($P(X3,U,3))
+"RTN","EDPRPTBV",38,0)
+ . S ROW("elapsed")=ELAPSE_$S(ELAPSE>359:" *",1:"")
+"RTN","EDPRPTBV",39,0)
+ . S ROW("triage")=TRIAGE
+"RTN","EDPRPTBV",40,0)
+ . S ROW("disposition")=$$ECODE^EDPRPT($P(X1,U,2))
+"RTN","EDPRPTBV",41,0)
+ . S ROW("admDec")=ADMDEC,ROW("admDel")=ADMDEL
+"RTN","EDPRPTBV",42,0)
+ . S ROW("icd")=$P(DX,U),ROW("dx")=$P(DX,U,2)
+"RTN","EDPRPTBV",43,0)
+ . ; get other patient attributes from VADPT
+"RTN","EDPRPTBV",44,0)
+ . N DFN,VAEL,VASV,VAMB,VAERR
+"RTN","EDPRPTBV",45,0)
+ . S DFN=$P(X0,U,6) I DFN D 8^VADPT D
+"RTN","EDPRPTBV",46,0)
+ .. S ROW("vietnam")=$S(VASV(1):"Y",1:"N")
+"RTN","EDPRPTBV",47,0)
+ .. S ROW("agentOrange")=$S(VASV(2):"Y",1:"N")
+"RTN","EDPRPTBV",48,0)
+ .. S ROW("iraq")=$S(VASV(11)!VASV(12)!VASV(13):"Y",1:"N")
+"RTN","EDPRPTBV",49,0)
+ .. S ROW("persGulf")=$P($G(^DPT(DFN,.322)),U,10)
+"RTN","EDPRPTBV",50,0)
+ .. S ROW("vaPension")=$S(VAMB(4):"Y",1:"N")
+"RTN","EDPRPTBV",51,0)
+ .. S ROW("pow")=$S(VASV(4):"Y",1:"N")
+"RTN","EDPRPTBV",52,0)
+ .. S ROW("servConnPct")=+$P(VAEL(3),U,2)
+"RTN","EDPRPTBV",53,0)
+ .. S ROW("purpleHeart")=$S(VASV(9):"Y",1:"N")
+"RTN","EDPRPTBV",54,0)
+ .. ; ROW("unemployable")=$P($G(^DGEN(27.11,DFN,"E")),U,17) ;or VAPD(7)=3^NOT EMPLOYED ??
+"RTN","EDPRPTBV",55,0)
+ .. S ROW("combatEndDT")=$P($G(VASV(10,1)),U)
+"RTN","EDPRPTBV",56,0)
+BV2 . ;
+"RTN","EDPRPTBV",57,0)
+ . I '$G(CSV) S X=$$XMLA^EDPX("log",.ROW) D XML^EDPX(X) Q
+"RTN","EDPRPTBV",58,0)
+ . S X=ROW("patient")
+"RTN","EDPRPTBV",59,0)
+ . F I="inTS","outTS","complaint","md","acuity","elapsed","triage","disposition","admDec","admDel","dx","icd" S X=X_$C(9)_$G(ROW(I))
+"RTN","EDPRPTBV",60,0)
+ . F I="vietnam","agentOrange","iraq","persGulf","vaPension","pow","servConn%","purpleHeart","unemployable","combatEndDT" S X=X_$C(9)_$G(ROW(I))
+"RTN","EDPRPTBV",61,0)
+ . D ADD^EDPCSV(X)
+"RTN","EDPRPTBV",62,0)
+ D:'$G(CSV) XML^EDPX("</logEntries>")
+"RTN","EDPRPTBV",63,0)
+ ;
+"RTN","EDPRPTBV",64,0)
+BV3 ; calculate & include averages
+"RTN","EDPRPTBV",65,0)
+ Q:CNT<1  ;no visits found
+"RTN","EDPRPTBV",66,0)
+ S ELAPSE=$$ETIME^EDPRPT(MIN("elapsed")\CNT),AVG("elapsed")=ELAPSE
+"RTN","EDPRPTBV",67,0)
+ S TRIAGE=$$ETIME^EDPRPT(MIN("triage")\CNT),AVG("triage")=TRIAGE
+"RTN","EDPRPTBV",68,0)
+ S ADMDEC=$S(ADM:$$ETIME^EDPRPT(MIN("admDec")\ADM),1:"00:00")
+"RTN","EDPRPTBV",69,0)
+ S ADMDEL=$S(ADM:$$ETIME^EDPRPT(MIN("admDel")\ADM),1:"00:00")
+"RTN","EDPRPTBV",70,0)
+ S AVG("admDec")=ADMDEC,AVG("admDel")=ADMDEL,AVG("total")=CNT
+"RTN","EDPRPTBV",71,0)
+ ;
+"RTN","EDPRPTBV",72,0)
+ I $G(CSV) D  Q  ;CSV format
+"RTN","EDPRPTBV",73,0)
+ . N TAB,D S TAB=$C(9)
+"RTN","EDPRPTBV",74,0)
+ . D BLANK^EDPCSV
+"RTN","EDPRPTBV",75,0)
+ . S X=TAB_"Total Patients"_TAB_CNT_TAB_"Averages Per Patient"_TAB_TAB_TAB_ELAPSE_TAB_TRIAGE_TAB_ADMDEC_TAB_ADMDEL
+"RTN","EDPRPTBV",76,0)
+ . D ADD^EDPCSV(X),BLANK^EDPCSV
+"RTN","EDPRPTBV",77,0)
+ D XML^EDPX("<averages>")
+"RTN","EDPRPTBV",78,0)
+ S X=$$XMLA^EDPX("average",.AVG) D XML^EDPX(X)
+"RTN","EDPRPTBV",79,0)
+ D XML^EDPX("</averages>")
+"RTN","EDPRPTBV",80,0)
+ Q
+"RTN","EDPRPTBV",81,0)
+ ;
+"RTN","EDPRPTBV",82,0)
+INIT ; Initialize counters and sums
+"RTN","EDPRPTBV",83,0)
+ N I,X S (CNT,ADM)=0
+"RTN","EDPRPTBV",84,0)
+ F I="elapsed","triage","admDec","admDel" S MIN(I)=0
+"RTN","EDPRPTBV",85,0)
+ Q
+"RTN","EDPRPTBV",86,0)
+ ;
+"RTN","EDPRPTBV",87,0)
+ECODE(IEN) ; Return external value for a Code
+"RTN","EDPRPTBV",88,0)
+ Q:IEN $P($G(^EDPB(233.1,IEN,0)),U,2) ;name
+"RTN","EDPRPTBV",89,0)
+ Q ""
+"RTN","EDPRPTBV",90,0)
+ ;
+"RTN","EDPRPTBV",91,0)
+BVAC(AREA,LOG) ; -- Return ICD^text of diagnosis in range, else null
+"RTN","EDPRPTBV",92,0)
+ N X,Y,I,EDPDX S Y=""
+"RTN","EDPRPTBV",93,0)
+ D DXALL^EDPQPCE(AREA,LOG,.EDPDX)
+"RTN","EDPRPTBV",94,0)
+ S I=0 F  S I=$O(EDPDX(I)) Q:I<1  S X=$G(EDPDX(I)) I 290<=+X,+X<=316 S Y=X Q
+"RTN","EDPRPTBV",95,0)
+ Q Y
+"RTN","EDPX")
+0^9^B9797287
+"RTN","EDPX",1,0)
+EDPX ;SLC/KCM - Common Utilities
+"RTN","EDPX",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPX",3,0)
+ ;
+"RTN","EDPX",4,0)
+ESC(X) ; Escape for XML transmission
+"RTN","EDPX",5,0)
+ ; Q $ZCONVERT(X,"O","HTML")  ; uncomment for fastest performance on Cache
+"RTN","EDPX",6,0)
+ ;
+"RTN","EDPX",7,0)
+ N I,Y,QOT S QOT=""""
+"RTN","EDPX",8,0)
+ S Y=$P(X,"&") F I=2:1:$L(X,"&") S Y=Y_"&amp;"_$P(X,"&",I)
+"RTN","EDPX",9,0)
+ S X=Y,Y=$P(X,"<") F I=2:1:$L(X,"<") S Y=Y_"&lt;"_$P(X,"<",I)
+"RTN","EDPX",10,0)
+ S X=Y,Y=$P(X,">") F I=2:1:$L(X,">") S Y=Y_"&gt;"_$P(X,">",I)
+"RTN","EDPX",11,0)
+ S X=Y,Y=$P(X,"'") F I=2:1:$L(X,"'") S Y=Y_"&apos;"_$P(X,"'",I)
+"RTN","EDPX",12,0)
+ S X=Y,Y=$P(X,QOT) F I=2:1:$L(X,QOT) S Y=Y_"&quot;"_$P(X,QOT,I)
+"RTN","EDPX",13,0)
+ Q Y
+"RTN","EDPX",14,0)
+ ;
+"RTN","EDPX",15,0)
+UES(X) ; Unescape XML
+"RTN","EDPX",16,0)
+ Q X  ; java side is unescaping this already
+"RTN","EDPX",17,0)
+ ; Q $ZCONVERT(X,"I","HTML")
+"RTN","EDPX",18,0)
+ ;
+"RTN","EDPX",19,0)
+UESREQ(REQ) ; Unescape HTTP post
+"RTN","EDPX",20,0)
+ N I,X
+"RTN","EDPX",21,0)
+ S X="" F  S X=$O(REQ(X)) Q:X=""  D
+"RTN","EDPX",22,0)
+ . S I=0 F  S I=$O(REQ(X,I)) Q:'I  D
+"RTN","EDPX",23,0)
+ . . S REQ(X,I)=$$UES(REQ(X,I))
+"RTN","EDPX",24,0)
+ Q
+"RTN","EDPX",25,0)
+VAL(X,R) ; Returns parameter value or null
+"RTN","EDPX",26,0)
+ ; HTTP passes HTML-escaped values in an array as REC(param,1)
+"RTN","EDPX",27,0)
+ Q $G(R(X,1))
+"RTN","EDPX",28,0)
+ ;
+"RTN","EDPX",29,0)
+NVPARSE(LST,IN) ; Parses tab delimited name-value pairs into array
+"RTN","EDPX",30,0)
+ N I,X,TAB,NM,VAL
+"RTN","EDPX",31,0)
+ S TAB=$C(9)
+"RTN","EDPX",32,0)
+ F I=1:1:$L(IN,TAB) S X=$P(IN,TAB,I),NM=$P(X,"="),VAL=$P(X,"=",2,999) S:$L(NM) LST(NM)=VAL
+"RTN","EDPX",33,0)
+ Q
+"RTN","EDPX",34,0)
+XMLS(TAG,DATA,LBL) ; Return XML node as <TAG data="9" label="XXX" />
+"RTN","EDPX",35,0)
+ Q "<"_TAG_" data="""_$$ESC(DATA)_""" label="""_$$ESC(LBL)_""" />"
+"RTN","EDPX",36,0)
+ ;
+"RTN","EDPX",37,0)
+XMLA(TAG,ATT,END) ; Return XML node as <TAG att1="a" att2="b"... />
+"RTN","EDPX",38,0)
+ N NODE S NODE="<"_TAG_" "
+"RTN","EDPX",39,0)
+ N X
+"RTN","EDPX",40,0)
+ S X="" F  S X=$O(ATT(X)) Q:X=""  I $L(ATT(X)) S NODE=NODE_X_"="""_$$ESC(ATT(X))_""" "
+"RTN","EDPX",41,0)
+ S NODE=NODE_$G(END,"/")_">"
+"RTN","EDPX",42,0)
+ Q NODE
+"RTN","EDPX",43,0)
+ ;
+"RTN","EDPX",44,0)
+XMLE(SRC) ; Append list to XML array as elements
+"RTN","EDPX",45,0)
+ N X,NODE
+"RTN","EDPX",46,0)
+ S X="" F  S X=$O(SRC(X)) Q:X=""  D
+"RTN","EDPX",47,0)
+ . S NODE="<"_X_">"_$$ESC(SRC(X))_"</"_X_">"
+"RTN","EDPX",48,0)
+ . D XML(NODE)
+"RTN","EDPX",49,0)
+ Q
+"RTN","EDPX",50,0)
+XML(X) ; Add a line of XML to be returned
+"RTN","EDPX",51,0)
+ S EDPXML=$G(EDPXML)+1
+"RTN","EDPX",52,0)
+ S EDPXML(EDPXML)=X
+"RTN","EDPX",53,0)
+ Q
+"RTN","EDPX",54,0)
+CODE(X) ; Return internal value for a code
+"RTN","EDPX",55,0)
+ Q $O(^EDPB(233.1,"B",X,0))
+"RTN","EDPX",56,0)
+ ;
+"RTN","EDPX",57,0)
+SAVERR(TYP,ERR) ; Output a save error
+"RTN","EDPX",58,0)
+ D XML^EDPX("<save status='"_TYP_"' >"_ERR_"</save>")
+"RTN","EDPX",59,0)
+ Q
+"RTN","EDPX",60,0)
+MSG(MSG) ; Write out error message
+"RTN","EDPX",61,0)
+ I MSG=1       S X="some error"
+"RTN","EDPX",62,0)
+ I MSG=2300001 S X="Station Number is missing"
+"RTN","EDPX",63,0)
+ I MSG=2300002 S X="Patient is already active in log"
+"RTN","EDPX",64,0)
+ I MSG=2300003 S X="Unable to create lock for new record"
+"RTN","EDPX",65,0)
+ I MSG=2300004 S X="Error creating new record"
+"RTN","EDPX",66,0)
+ I MSG=2300005 S X="Error creating sub-record"
+"RTN","EDPX",67,0)
+ I MSG=2300006 S X="Missing log record"
+"RTN","EDPX",68,0)
+ I MSG=2300007 S X="Missing log IEN"
+"RTN","EDPX",69,0)
+ I MSG=2300008 S X="Error updating record"
+"RTN","EDPX",70,0)
+ I MSG=2300009 S X="Error updating sub-record"
+"RTN","EDPX",71,0)
+ I MSG=2300010 S X="Command missing or not recognized:  "
+"RTN","EDPX",72,0)
+ I MSG=2300011 S X="Unknown report type"
+"RTN","EDPX",73,0)
+ I MSG=2300012 S X="Missing or invalid date range"
+"RTN","EDPX",74,0)
+ I MSG=2300013 S X="Shift times not defined for this site"
+"RTN","EDPX",75,0)
+ I MSG=2300014 S X="Name missing"
+"RTN","EDPX",76,0)
+ I MSG=2300015 S X="Unable to lock record"
+"RTN","EDPX",77,0)
+ I MSG=2300016 S X="The selected room/area is now occupied."
+"RTN","EDPX",78,0)
+ Q $$ESC^EDPX(X)
+"RTN","EDPYPRE")
+0^^B8226400
+"RTN","EDPYPRE",1,0)
+EDPYPRE ;SLC/KCM - Pre-init for facility install
+"RTN","EDPYPRE",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPYPRE",3,0)
+ ;
+"RTN","EDPYPRE",4,0)
+ S ^TMP("EDP-LAST-VERSION")=+$P($$VERSRV,"1.0-T",2)
+"RTN","EDPYPRE",5,0)
+ ;
+"RTN","EDPYPRE",6,0)
+ D FIXT5,DELFLDS,DELCODES,CHGNAMES
+"RTN","EDPYPRE",7,0)
+ Q
+"RTN","EDPYPRE",8,0)
+ ;
+"RTN","EDPYPRE",9,0)
+DELFLDS ; delete obsolete fields
+"RTN","EDPYPRE",10,0)
+ I $$VERGTE(20) Q  ; only convert if version <20
+"RTN","EDPYPRE",11,0)
+ ;
+"RTN","EDPYPRE",12,0)
+ N DIK,DA
+"RTN","EDPYPRE",13,0)
+ I $D(^DD(230.1,1)) D
+"RTN","EDPYPRE",14,0)
+ . S DIK="^DD(230.1,",DA=1,DA(1)=230.1
+"RTN","EDPYPRE",15,0)
+ . D ^DIK
+"RTN","EDPYPRE",16,0)
+ I $D(^DD(231.9,.04)) D
+"RTN","EDPYPRE",17,0)
+ . S DIK="^DD(231.9,",DA=.04,DA(1)=231.9
+"RTN","EDPYPRE",18,0)
+ . D ^DIK
+"RTN","EDPYPRE",19,0)
+ Q
+"RTN","EDPYPRE",20,0)
+DELCODES ; delete site code sets
+"RTN","EDPYPRE",21,0)
+ I $$VERGTE(16) Q  ; only convert if version <16
+"RTN","EDPYPRE",22,0)
+ ;
+"RTN","EDPYPRE",23,0)
+ N X,DIK,DA
+"RTN","EDPYPRE",24,0)
+ S X="" F  S X=$O(^EDPB(233.2,"B",X)) Q:X=""  D
+"RTN","EDPYPRE",25,0)
+ . I $P(X,".")="edp" Q
+"RTN","EDPYPRE",26,0)
+ . S DA=$O(^EDPB(233.2,"B",X,0)) Q:'DA
+"RTN","EDPYPRE",27,0)
+ . S DIK="^EDPB(233.2,"
+"RTN","EDPYPRE",28,0)
+ . D ^DIK
+"RTN","EDPYPRE",29,0)
+ Q
+"RTN","EDPYPRE",30,0)
+CHGNAMES ; change code names
+"RTN","EDPYPRE",31,0)
+ I $$VERGTE(20) Q  ; only convert if version <20
+"RTN","EDPYPRE",32,0)
+ ;
+"RTN","EDPYPRE",33,0)
+ D CHG("edp.source.ambulance","zzedp.source.ambulance")
+"RTN","EDPYPRE",34,0)
+ D CHG("edp.source.code","zzedp.source.code")
+"RTN","EDPYPRE",35,0)
+ D CHG("edp.source.walk-in","zzedp.source.walk-in")
+"RTN","EDPYPRE",36,0)
+ D CHG("edp.source.cboc","edp.source.clinic-offsite")
+"RTN","EDPYPRE",37,0)
+ D CHG("edp.source.clinic","edp.source.clinic-onsite")
+"RTN","EDPYPRE",38,0)
+ D CHG("edp.source.nhcu","edp.source.nhcu-onsite")
+"RTN","EDPYPRE",39,0)
+ D CHG("edp.status.observation","zzedp.status.observation")
+"RTN","EDPYPRE",40,0)
+ D CHG("edp.status.overflow","zzedp.status.overflow")
+"RTN","EDPYPRE",41,0)
+ D CHG("edp.status.gone","zzedp.status.gone")
+"RTN","EDPYPRE",42,0)
+ D CHG("edp.delay.admitorders","edp.delay.admitdispo")
+"RTN","EDPYPRE",43,0)
+ Q
+"RTN","EDPYPRE",44,0)
+CHG(OLD,NEW) ; change old to new name
+"RTN","EDPYPRE",45,0)
+ Q:'$D(^EDPB(233.1,"B",OLD))
+"RTN","EDPYPRE",46,0)
+ N IEN
+"RTN","EDPYPRE",47,0)
+ S IEN=$O(^EDPB(233.1,"B",OLD,0)) Q:'IEN
+"RTN","EDPYPRE",48,0)
+ N FDA,DIERR
+"RTN","EDPYPRE",49,0)
+ S IEN=IEN_","
+"RTN","EDPYPRE",50,0)
+ S FDA(233.1,IEN,.01)=NEW
+"RTN","EDPYPRE",51,0)
+ D FILE^DIE("","FDA","ERR")
+"RTN","EDPYPRE",52,0)
+ D CLEAN^DILF
+"RTN","EDPYPRE",53,0)
+ Q
+"RTN","EDPYPRE",54,0)
+ ;
+"RTN","EDPYPRE",55,0)
+ ; VERSRV copied from EDPQAR to avoid $T(VERSRV^EDPQAR) error
+"RTN","EDPYPRE",56,0)
+ ;
+"RTN","EDPYPRE",57,0)
+VERSRV()   ; Return server version of option name
+"RTN","EDPYPRE",58,0)
+ N EDPLST,VAL
+"RTN","EDPYPRE",59,0)
+ D FIND^DIC(19,"",1,"X","EDPF TRACKING SYSTEM",1,,,,"EDPLST")
+"RTN","EDPYPRE",60,0)
+ S VAL=$G(EDPLST("DILIST","ID",1,1))
+"RTN","EDPYPRE",61,0)
+ S VAL=$P(VAL,"version ",2)
+"RTN","EDPYPRE",62,0)
+ I 'VAL Q "1.0T?"
+"RTN","EDPYPRE",63,0)
+ Q VAL
+"RTN","EDPYPRE",64,0)
+ ;
+"RTN","EDPYPRE",65,0)
+VERGTE(HIGH) ; Return 1 if existing version and greater than HIGH
+"RTN","EDPYPRE",66,0)
+ I $G(^TMP("EDP-LAST-VERSION"))<1 Q 1      ; no prior version
+"RTN","EDPYPRE",67,0)
+ I $G(^TMP("EDP-LAST-VERSION"))>=HIGH Q 1  ; don't convert
+"RTN","EDPYPRE",68,0)
+ Q 0                                       ; convert
+"RTN","EDPYPRE",69,0)
+ ;
+"RTN","EDPYPRE",70,0)
+FIXT5 ; convert the timezone offset to visit string
+"RTN","EDPYPRE",71,0)
+ ; (change occurred between T5 and T6)
+"RTN","EDPYPRE",72,0)
+ I $$VERGTE(6) Q  ; only convert if version <6
+"RTN","EDPYPRE",73,0)
+ ;
+"RTN","EDPYPRE",74,0)
+ N LOG,X0
+"RTN","EDPYPRE",75,0)
+ S LOG=0 F  S LOG=$O(^EDP(230,LOG)) Q:'LOG  D
+"RTN","EDPYPRE",76,0)
+ . S X0=^EDP(230,LOG,0)
+"RTN","EDPYPRE",77,0)
+ . I $P(X0,U,12)="0" S $P(^EDP(230,LOG,0),U,12)=""
+"RTN","EDPYPRE",78,0)
+ Q
+"RTN","EDPYPRE",79,0)
+ ;. To convert VSTR to VISIT
+"RTN","EDPYPRE",80,0)
+ ;. I $L($P(X0,U,12),";")=3 D
+"RTN","EDPYPRE",81,0)
+ ;.. N VSTR,VISIT,DFN,VISITIEN,I
+"RTN","EDPYPRE",82,0)
+ ;.. S VSTR=$P(X0,U,12),DFN=$P(X0,U,6)
+"RTN","EDPYPRE",83,0)
+ ;.. Q:'DFN
+"RTN","EDPYPRE",84,0)
+ ;.. K ^TMP("PXKENC",$J)
+"RTN","EDPYPRE",85,0)
+ ;.. S VISIT=+$$GETENC^PXAPI(DFN,$P(VSTR,";",2),$P(VSTR,";"))
+"RTN","EDPYPRE",86,0)
+ ;.. I VISIT<0 S $P(^EDP(230,LOG,0),U,12)="" Q
+"RTN","EDPYPRE",87,0)
+ ;.. S VISITIEN=""
+"RTN","EDPYPRE",88,0)
+ ;.. F I=1:1:$L(VISIT,U) I $P(^TMP("PXKENC",$J,$P(VISIT,U,I),"VST",$P(VISIT,U,I),0),U,6)=DUZ(2) S VISITIEN=$P(VISIT,U,I) Q
+"RTN","EDPYPRE",89,0)
+ ;.. S $P(^EDP(230,LOG,0),U,12)=VISITIEN
+"RTN","EDPYPRE",90,0)
+ Q
+"RTN","EDPYPST")
+0^^B35872203
+"RTN","EDPYPST",1,0)
+EDPYPST ;SLC/KCM - Post-init for facility install
+"RTN","EDPYPST",2,0)
+ ;;1.0;EMERGENCY DEPARTMENT;;Sep 30, 2009;Build 74
+"RTN","EDPYPST",3,0)
+ ;
+"RTN","EDPYPST",4,0)
+ D PROXY,CONVERT,FIXSPEC,FIXWAIT,FIXDFLT,AO,CHOICES,DELBRD,FIXAPX,FIXSTA,FIXICD,FIXPDFN
+"RTN","EDPYPST",5,0)
+ K ^TMP("EDP-LAST-VERSION")
+"RTN","EDPYPST",6,0)
+ Q
+"RTN","EDPYPST",7,0)
+ ;
+"RTN","EDPYPST",8,0)
+PROXY ; Create proxy user
+"RTN","EDPYPST",9,0)
+ Q:$O(^VA(200,"B","EDPTRACKING,PROXY",0))
+"RTN","EDPYPST",10,0)
+ N X
+"RTN","EDPYPST",11,0)
+ S X=$$CREATE^XUSAP("EDPTRACKING,PROXY","","EDPS BOARD CONTEXT")
+"RTN","EDPYPST",12,0)
+ Q
+"RTN","EDPYPST",13,0)
+ ;
+"RTN","EDPYPST",14,0)
+CONVERT ; set ^XTMP for tracking conversion
+"RTN","EDPYPST",15,0)
+ Q:'$D(^DIZ(172006,0))  Q:$G(^XTMP("EDP-CONV"))="DONE"
+"RTN","EDPYPST",16,0)
+ I '$D(^XTMP("EDP-CONV")) S ^XTMP("EDP-CONV",0)=$$FMADD^XLFDT(DT,365)_U_DT_"^Copy ED data to EDIS files"
+"RTN","EDPYPST",17,0)
+ N I,DIV,X S X=$G(^XTMP("EDP-CONV","X")) ;old format
+"RTN","EDPYPST",18,0)
+ S I=0 F  S I=$O(^DIZ(172012,I)) Q:I<1  D
+"RTN","EDPYPST",19,0)
+ . S DIV=$$DIV(I) Q:'DIV  Q:$D(^XTMP("EDP-CONV","D",DIV))
+"RTN","EDPYPST",20,0)
+ . N X1,X2,X3 S (X2,X3)=0
+"RTN","EDPYPST",21,0)
+ . S X1=$S($L(X):"",1:I)
+"RTN","EDPYPST",22,0)
+ . S:$P(X,U,2) X2="" I $P(X,U,3) S X2="" D  ;old format - active done
+"RTN","EDPYPST",23,0)
+ .. N L S L=$P(X,U,3)+1
+"RTN","EDPYPST",24,0)
+ .. F  S L=$O(^DIZ(172006,L),-1) Q:L<1  I +$G(^(L,3))=DIV S X3=L Q
+"RTN","EDPYPST",25,0)
+ . S ^XTMP("EDP-CONV","D",DIV)=X1_U_X2_U_X3 ; I^0^0
+"RTN","EDPYPST",26,0)
+ Q
+"RTN","EDPYPST",27,0)
+DIV(X) ; return file 4 ien for Configuration
+"RTN","EDPYPST",28,0)
+ N X0,Y
+"RTN","EDPYPST",29,0)
+ S X0=$G(^DIZ(172012,+$G(X),0)),Y=+X0
+"RTN","EDPYPST",30,0)
+ I Y<1 S Y=+$S($P(X0,U,2):$P(X0,U,2),1:$$SITE^VASITE)
+"RTN","EDPYPST",31,0)
+ Q Y
+"RTN","EDPYPST",32,0)
+ ;
+"RTN","EDPYPST",33,0)
+FIXSPEC ; add the display properties to existing spec
+"RTN","EDPYPST",34,0)
+ I $$VERGTE^EDPYPRE(16) Q  ; only convert if version <16
+"RTN","EDPYPST",35,0)
+ ;
+"RTN","EDPYPST",36,0)
+ N SPEC
+"RTN","EDPYPST",37,0)
+ S SPEC=0 F  S SPEC=$O(^EDPB(231.9,SPEC)) Q:'SPEC  D ADDPROP(SPEC),MOVEBRD(SPEC)
+"RTN","EDPYPST",38,0)
+ Q
+"RTN","EDPYPST",39,0)
+ADDPROP(SPEC) ; add display properties to spec
+"RTN","EDPYPST",40,0)
+ N I,X,WP,ORIG,SKIP,DIERR
+"RTN","EDPYPST",41,0)
+ S SKIP=0
+"RTN","EDPYPST",42,0)
+ S I=0 F  S I=$O(^EDPB(231.9,SPEC,2,I)) Q:'I  D
+"RTN","EDPYPST",43,0)
+ . S ORIG(I)=^EDPB(231.9,SPEC,2,I,0)
+"RTN","EDPYPST",44,0)
+ . I ORIG(I)["displayProperties" S SKIP=1
+"RTN","EDPYPST",45,0)
+ Q:SKIP
+"RTN","EDPYPST",46,0)
+ ;
+"RTN","EDPYPST",47,0)
+ N LN S LN=0
+"RTN","EDPYPST",48,0)
+ S I=0 F  S I=$O(ORIG(I)) Q:'I  D
+"RTN","EDPYPST",49,0)
+ . S LN=LN+1 S WP(LN)=ORIG(I)
+"RTN","EDPYPST",50,0)
+ . I ORIG(I)["<spec>" S LN=LN+1,WP(LN)=$P($T(DP+1),";",3,99)
+"RTN","EDPYPST",51,0)
+ D WP^DIE(231.9,SPEC_",",2,"","WP")
+"RTN","EDPYPST",52,0)
+ D CLEAN^DILF
+"RTN","EDPYPST",53,0)
+ Q
+"RTN","EDPYPST",54,0)
+MOVEBRD(AREA) ; move the display board spec into a multiple
+"RTN","EDPYPST",55,0)
+ I $P($G(^EDPB(231.9,AREA,4,0)),U,4) Q  ; already entries in the multiple
+"RTN","EDPYPST",56,0)
+ I '$O(^EDPB(231.9,AREA,2,0)) Q         ; no spec to move
+"RTN","EDPYPST",57,0)
+ ;
+"RTN","EDPYPST",58,0)
+ N I,X0,WP,MSG
+"RTN","EDPYPST",59,0)
+ S I=0 F  S I=$O(^EDPB(231.9,AREA,2,I)) Q:'I  D
+"RTN","EDPYPST",60,0)
+ . S X0=^EDPB(231.9,AREA,2,I,0)
+"RTN","EDPYPST",61,0)
+ . Q:X0="<spec>"  Q:X0="</spec>"
+"RTN","EDPYPST",62,0)
+ . S WP(I)=X0
+"RTN","EDPYPST",63,0)
+ D UPDBRD^EDPBCF(AREA,0,"Main (default)",.WP,.MSG)
+"RTN","EDPYPST",64,0)
+ Q
+"RTN","EDPYPST",65,0)
+DP ; default display properties
+"RTN","EDPYPST",66,0)
+ ;;<displayProperties fontSize="10" displayWidth="1024" displayLabel="1024x768" scrollDelay="7" />
+"RTN","EDPYPST",67,0)
+ ;
+"RTN","EDPYPST",68,0)
+FIXWAIT ; change the category of waiting room to "waiting"
+"RTN","EDPYPST",69,0)
+ I $$VERGTE^EDPYPRE(14) Q  ; only convert if version <14
+"RTN","EDPYPST",70,0)
+ ;
+"RTN","EDPYPST",71,0)
+ N IEN
+"RTN","EDPYPST",72,0)
+ S IEN=0 F  S IEN=$O(^EDPB(231.8,"B","Waiting",IEN)) Q:'IEN  D
+"RTN","EDPYPST",73,0)
+ . S $P(^EDPB(231.8,IEN,0),U,9)=2
+"RTN","EDPYPST",74,0)
+ Q
+"RTN","EDPYPST",75,0)
+FIXDFLT ; create initial default rooms
+"RTN","EDPYPST",76,0)
+ N AREA,X1,AMB,DFLT,STN
+"RTN","EDPYPST",77,0)
+ S AREA=0 F  S AREA=$O(^EDPB(231.9,AREA)) Q:'AREA  D
+"RTN","EDPYPST",78,0)
+ . S X1=$G(^EDPB(231.9,AREA,1)),AMB=$P(X1,U,11),DFLT=$P(X1,U,12)
+"RTN","EDPYPST",79,0)
+ . S STN=$P(^EDPB(231.9,AREA,0),U,2)
+"RTN","EDPYPST",80,0)
+ . I 'AMB D
+"RTN","EDPYPST",81,0)
+ . . S AMB=$O(^EDPB(231.8,"AC",STN,AREA,"AMBU",0))
+"RTN","EDPYPST",82,0)
+ . . S:AMB $P(^EDPB(231.9,AREA,1),U,11)=AMB
+"RTN","EDPYPST",83,0)
+ . I 'DFLT D
+"RTN","EDPYPST",84,0)
+ . . S DFLT=$O(^EDPB(231.8,"AC",STN,AREA,"WAIT",0))
+"RTN","EDPYPST",85,0)
+ . . S $P(^EDPB(231.9,AREA,1),U,12)=DFLT
+"RTN","EDPYPST",86,0)
+ Q
+"RTN","EDPYPST",87,0)
+ ;
+"RTN","EDPYPST",88,0)
+DELBRD ; delete the DD and data for the old display board spec
+"RTN","EDPYPST",89,0)
+ I $$VERGTE^EDPYPRE(20) Q  ; only convert if version <20
+"RTN","EDPYPST",90,0)
+ ;
+"RTN","EDPYPST",91,0)
+ I $$GET1^DID(231.9,2,,"TYPE")'="WORD-PROCESSING" Q
+"RTN","EDPYPST",92,0)
+ N DIU
+"RTN","EDPYPST",93,0)
+ S DIU=231.92,DIU(0)="SD"
+"RTN","EDPYPST",94,0)
+ D EN^DIU2
+"RTN","EDPYPST",95,0)
+ Q
+"RTN","EDPYPST",96,0)
+AO ; build AO index on #230
+"RTN","EDPYPST",97,0)
+ Q:$D(^EDP(230,"AO"))
+"RTN","EDPYPST",98,0)
+ N LOG,IEN,ORD
+"RTN","EDPYPST",99,0)
+ S LOG=0 F  S LOG=+$O(^EDP(230,LOG)) Q:LOG<1  D
+"RTN","EDPYPST",100,0)
+ . S IEN=0 F  S IEN=+$O(^EDP(230,LOG,8,IEN)) Q:IEN<1  S ORD=+$G(^(IEN,0)) D
+"RTN","EDPYPST",101,0)
+ .. S:ORD ^EDP(230,"AO",ORD,LOG,IEN)=""
+"RTN","EDPYPST",102,0)
+ Q
+"RTN","EDPYPST",103,0)
+CHOICES ; initialize choices timestamps
+"RTN","EDPYPST",104,0)
+ N AREA
+"RTN","EDPYPST",105,0)
+ S AREA=0 F  S AREA=$O(^EDPB(231.9,AREA)) Q:'AREA  S ^EDPB(231.9,AREA,231)=$H
+"RTN","EDPYPST",106,0)
+ Q
+"RTN","EDPYPST",107,0)
+FIXNV ; convert the "no value" codes to 0
+"RTN","EDPYPST",108,0)
+ Q  ; maybe do this later....
+"RTN","EDPYPST",109,0)
+ N NOVAL,LOG
+"RTN","EDPYPST",110,0)
+ S NOVAL=+$O(^EDPB(233.1,"B","edp.reserved.novalue",0))
+"RTN","EDPYPST",111,0)
+ Q:'NOVAL
+"RTN","EDPYPST",112,0)
+ S LOG=0 F  S LOG=$O(^EDP(230,LOG)) Q:'LOG  D
+"RTN","EDPYPST",113,0)
+ . D CHGNV(230,LOG,0,10)
+"RTN","EDPYPST",114,0)
+ . D CHGNV(230,LOG,1,2)
+"RTN","EDPYPST",115,0)
+ . D CHGNV(230,LOG,1,5)
+"RTN","EDPYPST",116,0)
+ . D CHGNV(230,LOG,3,2)
+"RTN","EDPYPST",117,0)
+ . D CHGNV(230,LOG,3,3)
+"RTN","EDPYPST",118,0)
+ S LOG=0 F  S LOG=$O(^EDP(230.1,LOG)) Q:'LOG  D
+"RTN","EDPYPST",119,0)
+ . D CHGNV(230.1,LOG,0,10)
+"RTN","EDPYPST",120,0)
+ . D CHGNV(230.1,LOG,0,11)
+"RTN","EDPYPST",121,0)
+ . D CHGNV(230.1,LOG,0,12)
+"RTN","EDPYPST",122,0)
+ . D CHGNV(230.1,LOG,3,2)
+"RTN","EDPYPST",123,0)
+ . D CHGNV(230.1,LOG,3,3)
+"RTN","EDPYPST",124,0)
+ Q
+"RTN","EDPYPST",125,0)
+CHGNV(FN,LOG,SUB,P) ; convert individual piece, expects NOVAL defined
+"RTN","EDPYPST",126,0)
+ Q  ; maybe do this later....
+"RTN","EDPYPST",127,0)
+ I $P($G(^EDP(FN,LOG,SUB)),U,P)=NOVAL S $P(^EDP(FN,LOG,SUB),U,P)=0
+"RTN","EDPYPST",128,0)
+ Q
+"RTN","EDPYPST",129,0)
+FIXAPX ; fix the AP xref in 230
+"RTN","EDPYPST",130,0)
+ I $$VERGTE^EDPYPRE(21) Q  ; only convert if version <21
+"RTN","EDPYPST",131,0)
+ ;
+"RTN","EDPYPST",132,0)
+ K ^EDP(230,"AP")
+"RTN","EDPYPST",133,0)
+ N DIK,DA
+"RTN","EDPYPST",134,0)
+ S DIK="^EDP(230,",DIK(1)=".06^AP"
+"RTN","EDPYPST",135,0)
+ D ENALL^DIK
+"RTN","EDPYPST",136,0)
+ Q
+"RTN","EDPYPST",137,0)
+FIXPDFN ; create the DFN xref in 230
+"RTN","EDPYPST",138,0)
+ I $$VERGTE^EDPYPRE(24) Q  ; only convert if last version <24
+"RTN","EDPYPST",139,0)
+ ;
+"RTN","EDPYPST",140,0)
+ K ^EDP(230,"PDFN")
+"RTN","EDPYPST",141,0)
+ N DIK,DA
+"RTN","EDPYPST",142,0)
+ S DIK="^EDP(230,",DIK(1)=".06^PDFN"
+"RTN","EDPYPST",143,0)
+ D ENALL^DIK
+"RTN","EDPYPST",144,0)
+ Q
+"RTN","EDPYPST",145,0)
+FIXSTA ; convert the station number field to an institution pointer
+"RTN","EDPYPST",146,0)
+ I $$VERGTE^EDPYPRE(22) Q  ; only convert if version <22
+"RTN","EDPYPST",147,0)
+ ;
+"RTN","EDPYPST",148,0)
+ N IEN
+"RTN","EDPYPST",149,0)
+ S IEN=0 F  S IEN=$O(^EDP(230,IEN)) Q:'IEN  D CHGSTA(230,IEN)
+"RTN","EDPYPST",150,0)
+ S IEN=0 F  S IEN=$O(^EDPB(231.7,IEN)) Q:'IEN  D CHGSTA(231.7,IEN)
+"RTN","EDPYPST",151,0)
+ S IEN=0 F  S IEN=$O(^EDPB(231.8,IEN)) Q:'IEN  D CHGSTA(231.8,IEN)
+"RTN","EDPYPST",152,0)
+ S IEN=0 F  S IEN=$O(^EDPB(231.9,IEN)) Q:'IEN  D CHGSTA(231.9,IEN)
+"RTN","EDPYPST",153,0)
+ D CLEAN^DILF
+"RTN","EDPYPST",154,0)
+ Q
+"RTN","EDPYPST",155,0)
+CHGSTA(EDPFILE,EDPIEN) ; convert station number to institution pointer withing file
+"RTN","EDPYPST",156,0)
+ N STA,INST
+"RTN","EDPYPST",157,0)
+ S STA=$P($S(EDPFILE<231:^EDP(EDPFILE,EDPIEN,0),1:^EDPB(EDPFILE,EDPIEN,0)),U,2)
+"RTN","EDPYPST",158,0)
+ S INST=$$IEN^XUAF4(STA)
+"RTN","EDPYPST",159,0)
+ ;
+"RTN","EDPYPST",160,0)
+ N FDA,DIERR,ERR
+"RTN","EDPYPST",161,0)
+ S FDA(EDPFILE,EDPIEN_",",.02)=INST
+"RTN","EDPYPST",162,0)
+ D FILE^DIE("","FDA","ERR")
+"RTN","EDPYPST",163,0)
+ I $D(DIERR) W !,"STA Error, File=",EDPFILE,"  IEN=",EDPIEN,"  STA=",STN,"  INST=",INST
+"RTN","EDPYPST",164,0)
+ Q
+"RTN","EDPYPST",165,0)
+FIXICD ; convert the ICD Code file to a pointer to the ICD file
+"RTN","EDPYPST",166,0)
+ I $$VERGTE^EDPYPRE(22) Q  ; only convert if version <22
+"RTN","EDPYPST",167,0)
+ ;
+"RTN","EDPYPST",168,0)
+ N LOG,IEN
+"RTN","EDPYPST",169,0)
+ S LOG=0 F  S LOG=$O(^EDP(230,LOG)) Q:'LOG  D
+"RTN","EDPYPST",170,0)
+ . S IEN=0 F  S IEN=$O(^EDP(230,LOG,4,IEN)) Q:'IEN  D CHGICD(LOG,IEN)
+"RTN","EDPYPST",171,0)
+ D CLEAN^DILF
+"RTN","EDPYPST",172,0)
+ Q
+"RTN","EDPYPST",173,0)
+CHGICD(LOG,IEN) ; convert individual ICD Code to ICD Pointer
+"RTN","EDPYPST",174,0)
+ N ICDCODE,ICDIEN
+"RTN","EDPYPST",175,0)
+ S ICDCODE=$P($P(^EDP(230,LOG,4,IEN,0),U,2),"/",1)
+"RTN","EDPYPST",176,0)
+ Q:'$L(ICDCODE)
+"RTN","EDPYPST",177,0)
+ S ICDIEN=+$O(^ICD9("BA",ICDCODE_" ",0))
+"RTN","EDPYPST",178,0)
+ ;
+"RTN","EDPYPST",179,0)
+ N FDA,DIERR,ERR
+"RTN","EDPYPST",180,0)
+ S FDA(230.04,IEN_","_LOG_",",.02)=ICDIEN
+"RTN","EDPYPST",181,0)
+ D FILE^DIE("","FDA","ERR")
+"RTN","EDPYPST",182,0)
+ I $D(DIERR) W !,"STA Error, File=",EDPFILE,"  IEN=",EDPIEN,"  STA=",STN,"  INST=",INST
+"RTN","EDPYPST",183,0)
+ Q
+"SEC","^DIC",230,230,0,"AUDIT")
+@
+"SEC","^DIC",230,230,0,"DD")
+@
+"SEC","^DIC",230,230,0,"DEL")
+@
+"SEC","^DIC",230,230,0,"LAYGO")
+@
+"SEC","^DIC",230,230,0,"RD")
+@
+"SEC","^DIC",230,230,0,"WR")
+@
+"SEC","^DIC",230.1,230.1,0,"AUDIT")
+@
+"SEC","^DIC",230.1,230.1,0,"DD")
+@
+"SEC","^DIC",230.1,230.1,0,"DEL")
+@
+"SEC","^DIC",230.1,230.1,0,"LAYGO")
+@
+"SEC","^DIC",230.1,230.1,0,"RD")
+@
+"SEC","^DIC",230.1,230.1,0,"WR")
+@
+"SEC","^DIC",231.7,231.7,0,"AUDIT")
+@
+"SEC","^DIC",231.7,231.7,0,"DD")
+@
+"SEC","^DIC",231.7,231.7,0,"DEL")
+@
+"SEC","^DIC",231.7,231.7,0,"LAYGO")
+@
+"SEC","^DIC",231.7,231.7,0,"RD")
+@
+"SEC","^DIC",231.7,231.7,0,"WR")
+@
+"SEC","^DIC",231.8,231.8,0,"AUDIT")
+@
+"SEC","^DIC",231.8,231.8,0,"DD")
+@
+"SEC","^DIC",231.8,231.8,0,"DEL")
+@
+"SEC","^DIC",231.8,231.8,0,"LAYGO")
+@
+"SEC","^DIC",231.8,231.8,0,"RD")
+@
+"SEC","^DIC",231.8,231.8,0,"WR")
+@
+"SEC","^DIC",231.9,231.9,0,"AUDIT")
+@
+"SEC","^DIC",231.9,231.9,0,"DD")
+@
+"SEC","^DIC",231.9,231.9,0,"DEL")
+@
+"SEC","^DIC",231.9,231.9,0,"LAYGO")
+@
+"SEC","^DIC",231.9,231.9,0,"RD")
+@
+"SEC","^DIC",231.9,231.9,0,"WR")
+@
+"SEC","^DIC",233.1,233.1,0,"AUDIT")
+@
+"SEC","^DIC",233.1,233.1,0,"DD")
+@
+"SEC","^DIC",233.1,233.1,0,"DEL")
+@
+"SEC","^DIC",233.1,233.1,0,"LAYGO")
+@
+"SEC","^DIC",233.1,233.1,0,"RD")
+@
+"SEC","^DIC",233.1,233.1,0,"WR")
+@
+"SEC","^DIC",233.2,233.2,0,"AUDIT")
+@
+"SEC","^DIC",233.2,233.2,0,"DD")
+@
+"SEC","^DIC",233.2,233.2,0,"DEL")
+@
+"SEC","^DIC",233.2,233.2,0,"LAYGO")
+@
+"SEC","^DIC",233.2,233.2,0,"RD")
+@
+"SEC","^DIC",233.2,233.2,0,"WR")
+@
+"VER")
+8.0^22.0
+"^DD",230,230,0)
+FIELD^^.14^29
+"^DD",230,230,0,"DDA")
+N
+"^DD",230,230,0,"DT")
+3081215
+"^DD",230,230,0,"IX","AVISIT",230,.12)
+
+"^DD",230,230,0,"IX","B",230,.01)
+
+"^DD",230,230,0,"IX","V",230,.12)
+
+"^DD",230,230,0,"NM","ED LOG")
+
+"^DD",230,230,0,"PT",230.1,.01)
+
+"^DD",230,230,0,"VRPK")
+EMERGENCY DEPARTMENT
+"^DD",230,230,.01,0)
+LOG ENTRY TIME^RD^^0;1^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X
+"^DD",230,230,.01,1,0)
+^.1
+"^DD",230,230,.01,1,1,0)
+230^B
+"^DD",230,230,.01,1,1,1)
+S ^EDP(230,"B",$E(X,1,30),DA)=""
+"^DD",230,230,.01,1,1,2)
+K ^EDP(230,"B",$E(X,1,30),DA)
+"^DD",230,230,.01,3)
+Enter the time the record was created.
+"^DD",230,230,.01,21,0)
+^^1^1^3080912^
+"^DD",230,230,.01,21,1,0)
+This is the date/time that this log record was added to the file.
+"^DD",230,230,.01,"DT")
+3070721
+"^DD",230,230,.02,0)
+INSTITUTION^RP4'^DIC(4,^0;2^Q
+"^DD",230,230,.02,1,0)
+^.1^^0
+"^DD",230,230,.02,3)
+Select the institution for this log entry.
+"^DD",230,230,.02,21,0)
+^^3^3^3081008^
+"^DD",230,230,.02,21,1,0)
+This allows the log entry to be associated with the station that 
+"^DD",230,230,.02,21,2,0)
+originated it.  It allows multiple institutions to be served by the same 
+"^DD",230,230,.02,21,3,0)
+system.
+"^DD",230,230,.02,"DT")
+3081222
+"^DD",230,230,.03,0)
+AREA^RP231.9'^EDPB(231.9,^0;3^Q
+"^DD",230,230,.03,1,0)
+^.1^^0
+"^DD",230,230,.03,3)
+Select the area for this record.
+"^DD",230,230,.03,21,0)
+^^3^3^3080912^
+"^DD",230,230,.03,21,1,0)
+This is the area in the hospital for which this record applies.  
+"^DD",230,230,.03,21,2,0)
+Initially, the only area is the emergency department.  This field allows 
+"^DD",230,230,.03,21,3,0)
+use to be expanded into other departments.
+"^DD",230,230,.03,23,0)
+^^3^3^3080912^
+"^DD",230,230,.03,23,1,0)
+The area field is also used for training classes.  In the class, each 
+"^DD",230,230,.03,23,2,0)
+user may be assigned a separate area so as to avoid conflicts when 
+"^DD",230,230,.03,23,3,0)
+setting up configurations.
+"^DD",230,230,.03,"DT")
+3081222
+"^DD",230,230,.04,0)
+PATIENT NAME^F^^0;4^K:$L(X)>30!($L(X)<3) X
+"^DD",230,230,.04,3)
+Answer must be 3-30 characters in length.
+"^DD",230,230,.04,21,0)
+^^5^5^3081003^
+"^DD",230,230,.04,21,1,0)
+This is the name of the patient.  It allows a name to be entered in the 
+"^DD",230,230,.04,21,2,0)
+case of humanitarian care when the patient has not been entered into 
+"^DD",230,230,.04,21,3,0)
+VistA yet.
+"^DD",230,230,.04,21,4,0)
+ 
+"^DD",230,230,.04,21,5,0)
+LastName,FirstName is the name format that should be used.
+"^DD",230,230,.04,23,0)
+^^13^13^3081003^
+"^DD",230,230,.04,23,1,0)
+This field also assists in checking for duplicates and similar names on 
+"^DD",230,230,.04,23,2,0)
+the display board within a single area.  This allows appropriate 
+"^DD",230,230,.04,23,3,0)
+indicators to be shown on the display board.
+"^DD",230,230,.04,23,4,0)
+ 
+"^DD",230,230,.04,23,5,0)
+The clerk only enters the name in this field if the patient is not in 
+"^DD",230,230,.04,23,6,0)
+VistA.  If the patient gets added to VistA during the visit, the name 
+"^DD",230,230,.04,23,7,0)
+used in VistA replaces the clerk-entered name.  If the patient is 
+"^DD",230,230,.04,23,8,0)
+selected from VistA, the software gets the VistA name and places it 
+"^DD",230,230,.04,23,9,0)
+here.  This allows the software to flag patients with similar names that 
+"^DD",230,230,.04,23,10,0)
+might be active in the Emergency Department simultaneously.
+"^DD",230,230,.04,23,11,0)
+ 
+"^DD",230,230,.04,23,12,0)
+This field is set to "(ambulance en route)" in the case where an 
+"^DD",230,230,.04,23,13,0)
+ambulance is arriving but the name of the patient is unknown.
+"^DD",230,230,.04,"DT")
+3081003
+"^DD",230,230,.05,0)
+PATIENT SSN*^F^^0;5^K:$L(X)>9!($L(X)<1) X
+"^DD",230,230,.05,1,0)
+^.1^^0
+"^DD",230,230,.05,3)
+Answer must be 1-9 characters in length.
+"^DD",230,230,.05,21,0)
+^.001^2^2^3081003^^
+"^DD",230,230,.05,21,1,0)
+This is the patient social security number in the case of humanitarian 
+"^DD",230,230,.05,21,2,0)
+care for a patient that does not exist in VistA.
+"^DD",230,230,.05,23,0)
+^.001^2^2^3081003^^
+"^DD",230,230,.05,23,1,0)
+It was part of the class 3 product, but is not currently used.  It may be
+"^DD",230,230,.05,23,2,0)
+used in the future again, but is currently marked for deletion.
+"^DD",230,230,.05,"DT")
+3081003
+"^DD",230,230,.06,0)
+PATIENT ID^P2'^DPT(^0;6^Q
+"^DD",230,230,.06,3)
+Select a patient.
+"^DD",230,230,.06,21,0)
+^.001^1^1^3081003^^
+"^DD",230,230,.06,21,1,0)
+This is the patient in VistA for whom this log record is created.
+"^DD",230,230,.06,23,0)
+^^9^9^3081003^
+"^DD",230,230,.06,23,1,0)
+This field may be absent in the case of an arriving ambulance, where the 
+"^DD",230,230,.06,23,2,0)
+patient is not yet known.  It may also be absent when humanitarian aid is 
+"^DD",230,230,.06,23,3,0)
+rendered for a non-VA patient.
+"^DD",230,230,.06,23,4,0)
+ 
+"^DD",230,230,.06,23,5,0)
+If the patient is in VistA, the software gets the name field from file 2 
+"^DD",230,230,.06,23,6,0)
+and places it in the PATIENT NAME field in this file. This allows the
+"^DD",230,230,.06,23,7,0)
+software to flag patients with similar names who are active in the
+"^DD",230,230,.06,23,8,0)
+emergency department at the same time.  The clerk does not enter the
+"^DD",230,230,.06,23,9,0)
+PATIENT NAME field directly if the patient is in VistA.
+"^DD",230,230,.06,"DT")
+3081222
+"^DD",230,230,.07,0)
+CLOSED^S^1:YES;0:NO;^0;7^Q
+"^DD",230,230,.07,1,0)
+^.1^^0
+"^DD",230,230,.07,3)
+Enter "Yes" when the patient should be removed from the board.
+"^DD",230,230,.07,9)
+^
+"^DD",230,230,.07,21,0)
+^^3^3^3081003^
+"^DD",230,230,.07,21,1,0)
+This flag is set to YES when the patient has left the area (Emergency
+"^DD",230,230,.07,21,2,0)
+Department) and has been properly dispositioned.  At this time, the entry 
+"^DD",230,230,.07,21,3,0)
+no longer appears on the display board.
+"^DD",230,230,.07,"DT")
+3081004
+"^DD",230,230,.08,0)
+TIME IN^D^^0;8^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
+"^DD",230,230,.08,3)
+Enter the actual time of arrival.
+"^DD",230,230,.08,21,0)
+^^2^2^3080912^
+"^DD",230,230,.08,21,1,0)
+This is the time that the patient actually arrived at the emergency 
+"^DD",230,230,.08,21,2,0)
+department.  The length of the visit is measured from this point in time.
+"^DD",230,230,.08,"DT")
+3071120
+"^DD",230,230,.09,0)
+TIME OUT^D^^0;9^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
+"^DD",230,230,.09,3)
+Enter the time the patient left.
+"^DD",230,230,.09,21,0)
+^^2^2^3080912^
+"^DD",230,230,.09,21,1,0)
+This is the time that the patient was discharged from the emergency 
+"^DD",230,230,.09,21,2,0)
+department (sent home, admitted, transferred somewhere else).
+"^DD",230,230,.09,23,0)
+^^2^2^3080912^
+"^DD",230,230,.09,23,1,0)
+Prompting for delay reasons is based on the difference between the time 
+"^DD",230,230,.09,23,2,0)
+in and the time out.
+"^DD",230,230,.09,"DT")
+3071018
+"^DD",230,230,.1,0)
+ARRIVAL MODE^P233.1'^EDPB(233.1,^0;10^Q
+"^DD",230,230,.1,3)
+Select the source of the patient visit.
+"^DD",230,230,.1,21,0)
+^^2^2^3081003^
+"^DD",230,230,.1,21,1,0)
+This is the source of the emergency department visit.  For example, the 
+"^DD",230,230,.1,21,2,0)
+patient may have arrived from a nursing home, VA Hospital, walked in, etc.
+"^DD",230,230,.1,23,0)
+^.001^2^2^3081003^^
+"^DD",230,230,.1,23,1,0)
+The values for this field are associated with the <stn>.arrival and the 
+"^DD",230,230,.1,23,2,0)
+edp.arrival code sets.
+"^DD",230,230,.1,"DT")
+3070913
+"^DD",230,230,.11,0)
+PATIENT BRIEF ID^F^^0;11^K:$L(X)>10!($L(X)<4) X
+"^DD",230,230,.11,3)
+Answer must be 4-10 characters in length.
+"^DD",230,230,.11,21,0)
+^^5^5^3081015^
+"^DD",230,230,.11,21,1,0)
+This is a patient identifier that shows on the display board.  In the case
+"^DD",230,230,.11,21,2,0)
+of an ambulance or non-VA patient, this identifier may be constructed and
+"^DD",230,230,.11,21,3,0)
+stored here.  The identifier should be in the format:  last initial + last
+"^DD",230,230,.11,21,4,0)
+4 of ssn.  For example, given a fictional patient named TWENTY VEHU with
+"^DD",230,230,.11,21,5,0)
+an SSN of 000-00-0020, this field would be V0020.
+"^DD",230,230,.11,23,0)
+^.001^9^9^3081015^^
+"^DD",230,230,.11,23,1,0)
+Since last initial + last 4 digits of the social security number are 
+"^DD",230,230,.11,23,2,0)
+commonly used to identify patients, this field assists in checking for
+"^DD",230,230,.11,23,3,0)
+patients with the same last initial / last 4.  When a VistA patient is
+"^DD",230,230,.11,23,4,0)
+selected, the last initial / last 4 is constructed from information in 
+"^DD",230,230,.11,23,5,0)
+file 2 and stored here.  This allows patients with the same last initial /
+"^DD",230,230,.11,23,6,0)
+last 4 to be indicated on the display board.
+"^DD",230,230,.11,23,7,0)
+ 
+"^DD",230,230,.11,23,8,0)
+If an ambulance is en route and the patient is not known, the value of 
+"^DD",230,230,.11,23,9,0)
+this field is "(amb)".
+"^DD",230,230,.11,"DT")
+3071129
+"^DD",230,230,.12,0)
+VISIT^P9000010'^AUPNVSIT(^0;12^Q
+"^DD",230,230,.12,1,0)
+^.1
+"^DD",230,230,.12,1,1,0)
+230^AVISIT^MUMPS
+"^DD",230,230,.12,1,1,1)
+D ADD^AUPNVSIT
+"^DD",230,230,.12,1,1,2)
+D SUB^AUPNVSIT
+"^DD",230,230,.12,1,1,"%D",0)
+^^2^2^3080318^
+"^DD",230,230,.12,1,1,"%D",1,0)
+This increments and decrements the dependency counter in the VISIT file 
+"^DD",230,230,.12,1,1,"%D",2,0)
+(9000010).
+"^DD",230,230,.12,1,1,"DT")
+3080318
+"^DD",230,230,.12,1,2,0)
+230^V
+"^DD",230,230,.12,1,2,1)
+S ^EDP(230,"V",$E(X,1,30),DA)=""
+"^DD",230,230,.12,1,2,2)
+K ^EDP(230,"V",$E(X,1,30),DA)
+"^DD",230,230,.12,1,2,"%D",0)
+^^1^1^3080418^
+"^DD",230,230,.12,1,2,"%D",1,0)
+This is used by PCE to help identify dependent entries.
+"^DD",230,230,.12,1,2,"DT")
+3080418
+"^DD",230,230,.12,3)
+Select a visit.
+"^DD",230,230,.12,21,0)
+^^1^1^3081010^
+"^DD",230,230,.12,21,1,0)
+This is the VISIT associated with this emergency department encounter.
+"^DD",230,230,.12,23,0)
+^.001^6^6^3081010^^
+"^DD",230,230,.12,23,1,0)
+Since emergency departments don't use appointments, the arrival of the 
+"^DD",230,230,.12,23,2,0)
+patient is recorded in the emergency department tracking system itself.  
+"^DD",230,230,.12,23,3,0)
+The tracking system can then create a visit in PCE so that subsequent 
+"^DD",230,230,.12,23,4,0)
+care givers can associate orders and progress notes with that same 
+"^DD",230,230,.12,23,5,0)
+visit.  The visit is created once any PCE related field is collected so 
+"^DD",230,230,.12,23,6,0)
+that DATA2PCE may be called.  This is usually the triage nurse.
+"^DD",230,230,.12,"DT")
+3080418
+"^DD",230,230,.13,0)
+CREATION SOURCE^S^0:EDIS;1:SCHEDULING;2:CPRS;^0;13^Q
+"^DD",230,230,.13,3)
+Enter the mechanism which caused this entry to be created.
+"^DD",230,230,.13,21,0)
+^^1^1^3080912^
+"^DD",230,230,.13,21,1,0)
+This field identifies the route by which the visit was created.
+"^DD",230,230,.13,23,0)
+^^5^5^3080912^
+"^DD",230,230,.13,23,1,0)
+Generally the VISIT field is populated by calling DATA2PCE from EDIS.  It 
+"^DD",230,230,.13,23,2,0)
+is possible that the visit may be created by entering an appointment to 
+"^DD",230,230,.13,23,3,0)
+the emergency department or writing a progress note for the emergency 
+"^DD",230,230,.13,23,4,0)
+department location.  This field records which mechanism was responsible 
+"^DD",230,230,.13,23,5,0)
+for creating the entry in the VISIT file.
+"^DD",230,230,.13,"DT")
+3080722
+"^DD",230,230,.14,0)
+CLINIC^P44'^SC(^0;14^Q
+"^DD",230,230,.14,3)
+Select a clinic.
+"^DD",230,230,.14,21,0)
+^.001^2^2^3081215^^
+"^DD",230,230,.14,21,1,0)
+This is the specific clinic within the department (if multiple clinics 
+"^DD",230,230,.14,21,2,0)
+are used) that will be associated with this visit.
+"^DD",230,230,.14,23,0)
+^^3^3^3081215^
+"^DD",230,230,.14,23,1,0)
+When a patient is checked in via scheduling, the selected clinic is 
+"^DD",230,230,.14,23,2,0)
+stored here until a visit can be created.  When the visit is created, the 
+"^DD",230,230,.14,23,3,0)
+location stored here is used.
+"^DD",230,230,.14,"DT")
+3081215
+"^DD",230,230,1.1,0)
+COMPLAINT^F^^1;1^K:$L(X)>50!($L(X)<1) X
+"^DD",230,230,1.1,3)
+Answer must be 1-50 characters in length.
+"^DD",230,230,1.1,21,0)
+^^3^3^3081003^
+"^DD",230,230,1.1,21,1,0)
+This is the complaint that the patient presents with.  It is usually 
+"^DD",230,230,1.1,21,2,0)
+shown on the display board, so it should be brief enough to fit in the 
+"^DD",230,230,1.1,21,3,0)
+column on the display board.
+"^DD",230,230,1.1,"DT")
+3070720
+"^DD",230,230,1.2,0)
+DISPOSITION^P233.1'^EDPB(233.1,^1;2^Q
+"^DD",230,230,1.2,3)
+Select the disposition of the patient.
+"^DD",230,230,1.2,21,0)
+^^1^1^3080912^
+"^DD",230,230,1.2,21,1,0)
+This is how the patient is dispositioned at the end of the visit.
+"^DD",230,230,1.2,23,0)
+^^2^2^3080912^
+"^DD",230,230,1.2,23,1,0)
+The values for this field are associated with the <stn>.disposition and
+"^DD",230,230,1.2,23,2,0)
+the edp.disposition code sets.
+"^DD",230,230,1.2,"DT")
+3070720
+"^DD",230,230,1.3,0)
+DISPOSITION TIME^D^^1;3^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
+"^DD",230,230,1.3,3)
+Enter the time of disposition.
+"^DD",230,230,1.3,21,0)
+^^1^1^3080912^
+"^DD",230,230,1.3,21,1,0)
+This is the time that the disposition field was last updated.
+"^DD",230,230,1.3,"DT")
+3070720
+"^DD",230,230,1.4,0)
+DIAGNOSIS TIME^D^^1;4^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
+"^DD",230,230,1.4,3)
+Enter the time the diagnosis was made.
+"^DD",230,230,1.4,21,0)
+^^1^1^3080912^
+"^DD",230,230,1.4,21,1,0)
+This is the time that the diagnoses were last updated.
+"^DD",230,230,1.4,"DT")
+3070720
+"^DD",230,230,1.5,0)
+DELAY REASON^P233.1'^EDPB(233.1,^1;5^Q
+"^DD",230,230,1.5,3)
+Select a delay reason.
+"^DD",230,230,1.5,21,0)
+^^2^2^3081010^
+"^DD",230,230,1.5,21,1,0)
+This is the reason for delay in the case where the visit has taken longer 
+"^DD",230,230,1.5,21,2,0)
+than the time recommended.
+"^DD",230,230,1.5,23,0)
+^.001^1^1^3081010^^^
+"^DD",230,230,1.5,23,1,0)
+This field is associated with the <stn>.delay and edp.delay code sets.
+"^DD",230,230,1.5,"DT")
+3081003
+"^DD",230,230,2,0)
+COMPLAINT (LONG)^F^^2;1^K:$L(X)>220!($L(X)<1) X
+"^DD",230,230,2,3)
+Answer must be 1-220 characters in length.
+"^DD",230,230,2,21,0)
+^^3^3^3080912^
+"^DD",230,230,2,21,1,0)
+This is an optional field that allows the complaint to be entered in a 
+"^DD",230,230,2,21,2,0)
+form that is longer than that allowed by the complaint column on the 
+"^DD",230,230,2,21,3,0)
+display board.
+"^DD",230,230,2,"DT")
+3070720
+"^DD",230,230,3.2,0)
+STATUS^P233.1'^EDPB(233.1,^3;2^Q
+"^DD",230,230,3.2,1,0)
+^.1^^0
+"^DD",230,230,3.2,3)
+Select a patient status.
+"^DD",230,230,3.2,21,0)
+^^2^2^3080912^
+"^DD",230,230,3.2,21,1,0)
+This is the status of the patient during the course of the emergency 
+"^DD",230,230,3.2,21,2,0)
+department visit (awaiting triage, ed patient, etc.).
+"^DD",230,230,3.2,23,0)
+^^2^2^3080912^
+"^DD",230,230,3.2,23,1,0)
+This field is associated with the <stn>.status and the edp.status code 
+"^DD",230,230,3.2,23,2,0)
+sets.
+"^DD",230,230,3.2,"DT")
+3080305
+"^DD",230,230,3.3,0)
+ACUITY^P233.1'^EDPB(233.1,^3;3^Q
+"^DD",230,230,3.3,3)
+Select an acuity level.
+"^DD",230,230,3.3,21,0)
+^^2^2^3080912^
+"^DD",230,230,3.3,21,1,0)
+This is the acuity of the patient.  The acuity is based on the ESI scale 
+"^DD",230,230,3.3,21,2,0)
+with acuity levels 1-5.
+"^DD",230,230,3.3,23,0)
+^^1^1^3080912^
+"^DD",230,230,3.3,23,1,0)
+This field is associated with the edp.acuity code set.
+"^DD",230,230,3.3,"DT")
+3071129
+"^DD",230,230,3.4,0)
+LOC^P231.8'^EDPB(231.8,^3;4^Q
+"^DD",230,230,3.4,3)
+Select a room or area.
+"^DD",230,230,3.4,21,0)
+^^4^4^3080912^
+"^DD",230,230,3.4,21,1,0)
+This is the room / area where the patient is.  This may be a physical 
+"^DD",230,230,3.4,21,2,0)
+room or a specific bed.  It may also be a "conceptual area", such as the 
+"^DD",230,230,3.4,21,3,0)
+hallway, parking lot, x-ray, etc.  It does not necessarily need to be a 
+"^DD",230,230,3.4,21,4,0)
+physical location.
+"^DD",230,230,3.4,"DT")
+3071129
+"^DD",230,230,3.5,0)
+MD ASSIGNED^P200'^VA(200,^3;5^Q
+"^DD",230,230,3.5,3)
+Select a provider.
+"^DD",230,230,3.5,21,0)
+^^1^1^3080912^
+"^DD",230,230,3.5,21,1,0)
+This is the provider currently assigned to the patient.
+"^DD",230,230,3.5,"DT")
+3080305
+"^DD",230,230,3.6,0)
+NURSE ASSIGNED^P200'^VA(200,^3;6^Q
+"^DD",230,230,3.6,3)
+Select a nurse.
+"^DD",230,230,3.6,21,0)
+^^1^1^3080912^
+"^DD",230,230,3.6,21,1,0)
+This is the nurse assigned to the patient.
+"^DD",230,230,3.6,"DT")
+3080305
+"^DD",230,230,3.7,0)
+RESIDENT ASSIGNED^P200'^VA(200,^3;7^Q
+"^DD",230,230,3.7,3)
+Select a resident.
+"^DD",230,230,3.7,21,0)
+^^1^1^3080912^
+"^DD",230,230,3.7,21,1,0)
+This is the resident assigned to the patient.
+"^DD",230,230,3.7,"DT")
+3080305
+"^DD",230,230,3.8,0)
+COMMENT^F^^3;8^K:$L(X)>80!($L(X)<1) X
+"^DD",230,230,3.8,3)
+Answer must be 1-80 characters in length.
+"^DD",230,230,3.8,21,0)
+^^2^2^3080912^
+"^DD",230,230,3.8,21,1,0)
+This is a comment that may be entered or updated for this particular 
+"^DD",230,230,3.8,21,2,0)
+visit.  The comment may be optionally shown on the display board.
+"^DD",230,230,3.8,"DT")
+3071129
+"^DD",230,230,4,0)
+DISCHARGE DIAGNOSIS^230.04A^^4;0
+"^DD",230,230,4,21,0)
+^^1^1^3081010^
+"^DD",230,230,4,21,1,0)
+This multiple contains the diagnosis or diagnoses for the visit.
+"^DD",230,230,4,23,0)
+^^13^13^3081010^
+"^DD",230,230,4,23,1,0)
+This multiple serves two purposes:
+"^DD",230,230,4,23,2,0)
+ 
+"^DD",230,230,4,23,3,0)
+1)  If the site has chosen to allow free text diagnoses, the list of 
+"^DD",230,230,4,23,4,0)
+diagnoses entered is stored here.  In this case there will be no ICD 9 
+"^DD",230,230,4,23,5,0)
+code.  Clerical staff will enter the diagnosis list into PCE at a later 
+"^DD",230,230,4,23,6,0)
+time using information from this list.
+"^DD",230,230,4,23,7,0)
+ 
+"^DD",230,230,4,23,8,0)
+2)  If the site has chosen to use coded diagnoses, this multiple is used 
+"^DD",230,230,4,23,9,0)
+to hold the selected diagnoses until a PCE visit is created.  In that 
+"^DD",230,230,4,23,10,0)
+case, PCE becomes the real holder of the diagnosis list.
+"^DD",230,230,4,23,11,0)
+ 
+"^DD",230,230,4,23,12,0)
+The parameter that controls the behavior of this list is in the TRACKING 
+"^DD",230,230,4,23,13,0)
+AREA file (231.9).
+"^DD",230,230,8,0)
+ORDERS^230.08A^^8;0
+"^DD",230,230,8,21,0)
+^^2^2^3080912^
+"^DD",230,230,8,21,1,0)
+This multiple tracks orders during the course of the patient stay in the 
+"^DD",230,230,8,21,2,0)
+emergency department.
+"^DD",230,230,8,23,0)
+^^6^6^3080912^
+"^DD",230,230,8,23,1,0)
+This multiple is populated by an order entry event monitor, which
+"^DD",230,230,8,23,2,0)
+identifies orders related to the current emergency department visit.  The
+"^DD",230,230,8,23,3,0)
+display board is refreshed frequently (every few seconds).  The board 
+"^DD",230,230,8,23,4,0)
+constantly shows the status of emergency department related orders, and
+"^DD",230,230,8,23,5,0)
+this multiple allows a quick up to date display.  It allows the reports to
+"^DD",230,230,8,23,6,0)
+track the history of orders related to an emergency department visit.
+"^DD",230,230.04,0)
+DISCHARGE DIAGNOSIS SUB-FIELD^^.03^3
+"^DD",230,230.04,0,"DT")
+3081008
+"^DD",230,230.04,0,"IX","B",230.04,.01)
+
+"^DD",230,230.04,0,"NM","DISCHARGE DIAGNOSIS")
+
+"^DD",230,230.04,0,"UP")
+230
+"^DD",230,230.04,.01,0)
+DISCHARGE DIAGNOSIS^MF^^0;1^K:$L(X)>50!($L(X)<1) X
+"^DD",230,230.04,.01,1,0)
+^.1
+"^DD",230,230.04,.01,1,1,0)
+230.04^B
+"^DD",230,230.04,.01,1,1,1)
+S ^EDP(230,DA(1),4,"B",$E(X,1,30),DA)=""
+"^DD",230,230.04,.01,1,1,2)
+K ^EDP(230,DA(1),4,"B",$E(X,1,30),DA)
+"^DD",230,230.04,.01,3)
+Answer must be 1-50 characters in length.
+"^DD",230,230.04,.01,21,0)
+^.001^1^1^3081010^^^
+"^DD",230,230.04,.01,21,1,0)
+This is the free text of the diagnosis.
+"^DD",230,230.04,.01,23,0)
+^^4^4^3081010^
+"^DD",230,230.04,.01,23,1,0)
+If the parameters are set so that coded diagnoses will be required, the
+"^DD",230,230.04,.01,23,2,0)
+text will match the Clinical Lexicon text.  Some Clinical Lexicon entries 
+"^DD",230,230.04,.01,23,3,0)
+map to more than one ICD code.  $$ICDONE^LEXU is used to determine which 
+"^DD",230,230.04,.01,23,4,0)
+code to store here.
+"^DD",230,230.04,.01,"DT")
+3070720
+"^DD",230,230.04,.02,0)
+ICD9 CODE^P80'^ICD9(^0;2^Q
+"^DD",230,230.04,.02,3)
+Select the ICD Code for this diagnosis.
+"^DD",230,230.04,.02,21,0)
+^.001^1^1^3081010^^^^
+"^DD",230,230.04,.02,21,1,0)
+This is the ICD code for the diagnosis.
+"^DD",230,230.04,.02,23,0)
+^^4^4^3081010^
+"^DD",230,230.04,.02,23,1,0)
+Clinical Lexicon utilities are used by the application to look up 
+"^DD",230,230.04,.02,23,2,0)
+diagnoses.  Some Clinical Lexicon entries map to more than one ICD code.  
+"^DD",230,230.04,.02,23,3,0)
+$$ICDONE^LEXU is used to determine which code to store here.  This also 
+"^DD",230,230.04,.02,23,4,0)
+becomes the code that is stored in PCE.
+"^DD",230,230.04,.02,"DT")
+3081008
+"^DD",230,230.04,.03,0)
+PRIMARY^S^0:NO (secondary);1:YES (primary);^0;3^Q
+"^DD",230,230.04,.03,3)
+Enter 'yes' if this is the primary diagnosis.
+"^DD",230,230.04,.03,21,0)
+^^2^2^3080912^
+"^DD",230,230.04,.03,21,1,0)
+This flag indicates which of the diagnoses is to be considered the 
+"^DD",230,230.04,.03,21,2,0)
+primary diagnosis.
+"^DD",230,230.04,.03,"DT")
+3080605
+"^DD",230,230.08,0)
+ORDERS SUB-FIELD^^.05^5
+"^DD",230,230.08,0,"DT")
+3081003
+"^DD",230,230.08,0,"IX","AC",230.08,.02)
+
+"^DD",230,230.08,0,"IX","B",230.08,.01)
+
+"^DD",230,230.08,0,"NM","ORDERS")
+
+"^DD",230,230.08,0,"UP")
+230
+"^DD",230,230.08,.01,0)
+ORDER^MF^^0;1^K:$L(X)>30!($L(X)<1) X
+"^DD",230,230.08,.01,1,0)
+^.1
+"^DD",230,230.08,.01,1,1,0)
+230.08^B
+"^DD",230,230.08,.01,1,1,1)
+S ^EDP(230,DA(1),8,"B",$E(X,1,30),DA)=""
+"^DD",230,230.08,.01,1,1,2)
+K ^EDP(230,DA(1),8,"B",$E(X,1,30),DA)
+"^DD",230,230.08,.01,3)
+Answer must be 1-30 characters in length.
+"^DD",230,230.08,.01,21,0)
+^^1^1^3080912^
+"^DD",230,230.08,.01,21,1,0)
+This is the order id for an emergency department related order.
+"^DD",230,230.08,.01,"DT")
+3080527
+"^DD",230,230.08,.02,0)
+SERVICE^S^M:Medication;L:Lab;R:Radiology;C:Consult;A:All Other;^0;2^Q
+"^DD",230,230.08,.02,1,0)
+^.1
+"^DD",230,230.08,.02,1,1,0)
+230.08^AC
+"^DD",230,230.08,.02,1,1,1)
+S ^EDP(230,DA(1),8,"AC",$E(X,1,30),DA)=""
+"^DD",230,230.08,.02,1,1,2)
+K ^EDP(230,DA(1),8,"AC",$E(X,1,30),DA)
+"^DD",230,230.08,.02,1,1,"%D",0)
+^^2^2^3071115^
+"^DD",230,230.08,.02,1,1,"%D",1,0)
+Allows quick check for the existence of various types of orders for this
+"^DD",230,230.08,.02,1,1,"%D",2,0)
+ED visit.
+"^DD",230,230.08,.02,1,1,"DT")
+3071115
+"^DD",230,230.08,.02,3)
+Select the service filling the order.
+"^DD",230,230.08,.02,21,0)
+^.001^2^2^3081003^^
+"^DD",230,230.08,.02,21,1,0)
+This is a general identification of the service to which the order is 
+"^DD",230,230.08,.02,21,2,0)
+related.
+"^DD",230,230.08,.02,"DT")
+3081003
+"^DD",230,230.08,.03,0)
+STATUS^S^N:New;A:Active;C:Complete;^0;3^Q
+"^DD",230,230.08,.03,3)
+Select the current status of the order.
+"^DD",230,230.08,.03,21,0)
+^.001^1^1^3081003^^
+"^DD",230,230.08,.03,21,1,0)
+This is the general status of the order.
+"^DD",230,230.08,.03,23,0)
+^.001^2^2^3081003^^
+"^DD",230,230.08,.03,23,1,0)
+The status may be used to highlight orders on the display board and 
+"^DD",230,230.08,.03,23,2,0)
+monitor for those that have been outstanding too long.
+"^DD",230,230.08,.03,"DT")
+3081003
+"^DD",230,230.08,.04,0)
+STAT^S^1:Stat;0:Not Stat;^0;4^Q
+"^DD",230,230.08,.04,3)
+Enter stat if this is a stat order.
+"^DD",230,230.08,.04,21,0)
+^.001^1^1^3081003^^
+"^DD",230,230.08,.04,21,1,0)
+This flag identifies the order as being STAT.
+"^DD",230,230.08,.04,23,0)
+^.001^1^1^3081003^^
+"^DD",230,230.08,.04,23,1,0)
+STAT orders may be optionally highlighted by color on the display board.
+"^DD",230,230.08,.04,"DT")
+3081003
+"^DD",230,230.08,.05,0)
+RELEASE TIME^D^^0;5^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X
+"^DD",230,230.08,.05,3)
+Enter the date/time the order was released to the filling service.
+"^DD",230,230.08,.05,21,0)
+^^2^2^3080912^
+"^DD",230,230.08,.05,21,1,0)
+This is the time the order was released to the service.  It is used to 
+"^DD",230,230.08,.05,21,2,0)
+monitor orders that may be delayed.
+"^DD",230,230.08,.05,"DT")
+3071115
+"^DD",230.1,230.1,0)
+FIELD^^.14^22
+"^DD",230.1,230.1,0,"DDA")
+N
+"^DD",230.1,230.1,0,"DT")
+3081215
+"^DD",230.1,230.1,0,"IX","B",230.1,.01)
+
+"^DD",230.1,230.1,0,"NM","ED LOG HISTORY")
+
+"^DD",230.1,230.1,0,"VRPK")
+EMERGENCY DEPARTMENT
+"^DD",230.1,230.1,.01,0)
+LOG ENTRY^RP230'^EDP(230,^0;1^Q
+"^DD",230.1,230.1,.01,1,0)
+^.1
+"^DD",230.1,230.1,.01,1,1,0)
+230.1^B
+"^DD",230.1,230.1,.01,1,1,1)
+S ^EDP(230.1,"B",$E(X,1,30),DA)=""
+"^DD",230.1,230.1,.01,1,1,2)
+K ^EDP(230.1,"B",$E(X,1,30),DA)
+"^DD",230.1,230.1,.01,3)
+Select ED LOG entry.
+"^DD",230.1,230.1,.01,21,0)
+^^2^2^3080912^
+"^DD",230.1,230.1,.01,21,1,0)
+This references an entry in the ED LOG file.  Entries in this file record 
+"^DD",230.1,230.1,.01,21,2,0)
+modifications to entries in the ED LOG file.
+"^DD",230.1,230.1,.01,"DT")
+3081016
+"^DD",230.1,230.1,.02,0)
+TIME^RD^^0;2^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X
+"^DD",230.1,230.1,.02,3)
+Enter time of modification.
+"^DD",230.1,230.1,.02,21,0)
+^.001^1^1^3080912^^
+"^DD",230.1,230.1,.02,21,1,0)
+This is the time that the log record was modified.
+"^DD",230.1,230.1,.02,"DT")
+3081016
+"^DD",230.1,230.1,.03,0)
+ENTERED BY^RP200'^VA(200,^0;3^Q
+"^DD",230.1,230.1,.03,3)
+Select the person responsible for this update.
+"^DD",230.1,230.1,.03,21,0)
+^.001^1^1^3081004^^
+"^DD",230.1,230.1,.03,21,1,0)
+This is the person who updated the log.
+"^DD",230.1,230.1,.03,"DT")
+3080912
+"^DD",230.1,230.1,.04,0)
+PATIENT NAME^F^^0;4^K:$L(X)>40!($L(X)<3) X
+"^DD",230.1,230.1,.04,3)
+Answer must be 3-40 characters in length.
+"^DD",230.1,230.1,.04,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,.04,21,1,0)
+If updated, this is the updated value of the patient name.
+"^DD",230.1,230.1,.04,"DT")
+3071123
+"^DD",230.1,230.1,.05,0)
+PATIENT SSN*^F^^0;5^K:$L(X)>10!($L(X)<1) X
+"^DD",230.1,230.1,.05,3)
+Answer must be 1-10 characters in length.
+"^DD",230.1,230.1,.05,21,0)
+^^2^2^3080912^
+"^DD",230.1,230.1,.05,21,1,0)
+If updated, this is the updated value of the patient social security 
+"^DD",230.1,230.1,.05,21,2,0)
+number.
+"^DD",230.1,230.1,.05,23,0)
+^^3^3^3080912^
+"^DD",230.1,230.1,.05,23,1,0)
+The social security number was recorded in the class 3 product in the 
+"^DD",230.1,230.1,.05,23,2,0)
+case that a patient without a DFN came to the emergency room.  It is not 
+"^DD",230.1,230.1,.05,23,3,0)
+currently used, but is here for compatibility with the class 3 version.
+"^DD",230.1,230.1,.05,"DT")
+3080305
+"^DD",230.1,230.1,.06,0)
+PATIENT ID^P2'^DPT(^0;6^Q
+"^DD",230.1,230.1,.06,3)
+Select the patient.
+"^DD",230.1,230.1,.06,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,.06,21,1,0)
+If updated, this is the updated value of the patient DFN.
+"^DD",230.1,230.1,.06,"DT")
+3080305
+"^DD",230.1,230.1,.07,0)
+COMPLAINT^F^^0;7^K:$L(X)>50!($L(X)<1) X
+"^DD",230.1,230.1,.07,3)
+Answer must be 1-50 characters in length.
+"^DD",230.1,230.1,.07,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,.07,21,1,0)
+If updated, this is the updated value of the complaint.
+"^DD",230.1,230.1,.07,"DT")
+3071123
+"^DD",230.1,230.1,.08,0)
+TIME IN^D^^0;8^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
+"^DD",230.1,230.1,.08,3)
+Enter the arrival time of the patient.
+"^DD",230.1,230.1,.08,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,.08,21,1,0)
+If updated, this is the updated value of the arrival time of the patient.
+"^DD",230.1,230.1,.08,"DT")
+3071123
+"^DD",230.1,230.1,.09,0)
+TIME OUT^D^^0;9^S %DT="ETXR" D ^%DT S X=Y K:Y<1 X
+"^DD",230.1,230.1,.09,3)
+Enter the departure time.
+"^DD",230.1,230.1,.09,21,0)
+^^2^2^3080912^
+"^DD",230.1,230.1,.09,21,1,0)
+If updated, this is the updated value of the departure time of the 
+"^DD",230.1,230.1,.09,21,2,0)
+patient.
+"^DD",230.1,230.1,.09,"DT")
+3071123
+"^DD",230.1,230.1,.1,0)
+ARRIVAL MODE^P233.1'^EDPB(233.1,^0;10^Q
+"^DD",230.1,230.1,.1,3)
+Enter the source of the patient visit.
+"^DD",230.1,230.1,.1,21,0)
+^.001^2^2^3080912^^
+"^DD",230.1,230.1,.1,21,1,0)
+If updated, this is the updated value of the source of the patient visit 
+"^DD",230.1,230.1,.1,21,2,0)
+(came from nursing home, hospital ward, walk-in).
+"^DD",230.1,230.1,.1,"DT")
+3071123
+"^DD",230.1,230.1,.11,0)
+DISPOSITION^P233.1'^EDPB(233.1,^0;11^Q
+"^DD",230.1,230.1,.11,3)
+Enter the disposition.
+"^DD",230.1,230.1,.11,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,.11,21,1,0)
+If updated, this is the updated value of the disposition.
+"^DD",230.1,230.1,.11,"DT")
+3071123
+"^DD",230.1,230.1,.12,0)
+DELAY^P233.1'^EDPB(233.1,^0;12^Q
+"^DD",230.1,230.1,.12,3)
+Enter the delay reason.
+"^DD",230.1,230.1,.12,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,.12,21,1,0)
+If updated, this is the updated value of the delay reason.
+"^DD",230.1,230.1,.12,"DT")
+3071123
+"^DD",230.1,230.1,.14,0)
+CLINIC^P44'^SC(^0;14^Q
+"^DD",230.1,230.1,.14,3)
+Select a clinic.
+"^DD",230.1,230.1,.14,21,0)
+^^1^1^3081215^
+"^DD",230.1,230.1,.14,21,1,0)
+If updated, this is the updated value of the clinic.
+"^DD",230.1,230.1,.14,"DT")
+3081215
+"^DD",230.1,230.1,2,0)
+COMPLAINT (LONG)^F^^2;1^K:$L(X)>220!($L(X)<1) X
+"^DD",230.1,230.1,2,3)
+Answer must be 1-220 characters in length.
+"^DD",230.1,230.1,2,21,0)
+^^2^2^3080912^
+"^DD",230.1,230.1,2,21,1,0)
+If updated, this is the updated value of the long complaint (the optional 
+"^DD",230.1,230.1,2,21,2,0)
+complaint that may be longer than the display board allows).
+"^DD",230.1,230.1,2,"DT")
+3071129
+"^DD",230.1,230.1,3.2,0)
+STATUS^P233.1'^EDPB(233.1,^3;2^Q
+"^DD",230.1,230.1,3.2,3)
+Select a status.
+"^DD",230.1,230.1,3.2,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,3.2,21,1,0)
+If updated, this is the updated value of the status.
+"^DD",230.1,230.1,3.2,"DT")
+3071129
+"^DD",230.1,230.1,3.3,0)
+ACUITY^P233.1'^EDPB(233.1,^3;3^Q
+"^DD",230.1,230.1,3.3,3)
+Select an acuity level.
+"^DD",230.1,230.1,3.3,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,3.3,21,1,0)
+If updated, this is the updated value of the acuity.
+"^DD",230.1,230.1,3.3,"DT")
+3071129
+"^DD",230.1,230.1,3.4,0)
+LOC^P231.8'^EDPB(231.8,^3;4^Q
+"^DD",230.1,230.1,3.4,3)
+Select a room/area
+"^DD",230.1,230.1,3.4,21,0)
+^.001^1^1^3080912^^
+"^DD",230.1,230.1,3.4,21,1,0)
+If updated, this is the updated value of the room / area.
+"^DD",230.1,230.1,3.4,"DT")
+3071129
+"^DD",230.1,230.1,3.5,0)
+MD ASSIGNED^P200'^VA(200,^3;5^Q
+"^DD",230.1,230.1,3.5,3)
+Select a provider.
+"^DD",230.1,230.1,3.5,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,3.5,21,1,0)
+If updated, this is the updated provider.
+"^DD",230.1,230.1,3.5,"DT")
+3080305
+"^DD",230.1,230.1,3.6,0)
+NURSE ASSIGNED^P200'^VA(200,^3;6^Q
+"^DD",230.1,230.1,3.6,3)
+Select a nurse.
+"^DD",230.1,230.1,3.6,21,0)
+^.001^1^1^3080912^^
+"^DD",230.1,230.1,3.6,21,1,0)
+If updated, this is the updated nurse.
+"^DD",230.1,230.1,3.6,"DT")
+3080305
+"^DD",230.1,230.1,3.7,0)
+RESIDENT ASSIGNED^P200'^VA(200,^3;7^Q
+"^DD",230.1,230.1,3.7,3)
+Select a resident.
+"^DD",230.1,230.1,3.7,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,3.7,21,1,0)
+If updated, this is the updated resident.
+"^DD",230.1,230.1,3.7,"DT")
+3080305
+"^DD",230.1,230.1,3.8,0)
+COMMENT^F^^3;8^K:$L(X)>80!($L(X)<1) X
+"^DD",230.1,230.1,3.8,3)
+Answer must be 1-80 characters in length.
+"^DD",230.1,230.1,3.8,21,0)
+^^1^1^3080912^
+"^DD",230.1,230.1,3.8,21,1,0)
+If updated, this is the updated comment.
+"^DD",230.1,230.1,3.8,"DT")
+3071129
+"^DD",230.1,230.1,9.1,0)
+MODIFIED FIELDS^F^^9;1^K:$L(X)>100!($L(X)<1) X
+"^DD",230.1,230.1,9.1,3)
+Answer must be 1-100 characters in length.
+"^DD",230.1,230.1,9.1,21,0)
+^^3^3^3080912^
+"^DD",230.1,230.1,9.1,21,1,0)
+This lists the fields that were modified in the corresponding ED LOG 
+"^DD",230.1,230.1,9.1,21,2,0)
+record at the time of this update.  The list contains the field numbers 
+"^DD",230.1,230.1,9.1,21,3,0)
+and is semi-colon delimited.
+"^DD",230.1,230.1,9.1,"DT")
+3080411
+"^DD",231.7,231.7,0)
+FIELD^^.08^8
+"^DD",231.7,231.7,0,"DDA")
+N
+"^DD",231.7,231.7,0,"DT")
+3081008
+"^DD",231.7,231.7,0,"IX","B",231.7,.01)
+
+"^DD",231.7,231.7,0,"NM","TRACKING STAFF")
+
+"^DD",231.7,231.7,0,"VRPK")
+EMERGENCY DEPARTMENT
+"^DD",231.7,231.7,.01,0)
+PERSON^RP200'^VA(200,^0;1^Q
+"^DD",231.7,231.7,.01,1,0)
+^.1
+"^DD",231.7,231.7,.01,1,1,0)
+231.7^B
+"^DD",231.7,231.7,.01,1,1,1)
+S ^EDPB(231.7,"B",$E(X,1,30),DA)=""
+"^DD",231.7,231.7,.01,1,1,2)
+K ^EDPB(231.7,"B",$E(X,1,30),DA)
+"^DD",231.7,231.7,.01,3)
+Select a provider, resident, or nurse.
+"^DD",231.7,231.7,.01,21,0)
+^^2^2^3080912^
+"^DD",231.7,231.7,.01,21,1,0)
+This is a person who is assigned to work as staff in the emergency 
+"^DD",231.7,231.7,.01,21,2,0)
+department.
+"^DD",231.7,231.7,.01,"DT")
+3080305
+"^DD",231.7,231.7,.02,0)
+INSTITUTION^RP4'^DIC(4,^0;2^Q
+"^DD",231.7,231.7,.02,3)
+Select the institution for this staff list.
+"^DD",231.7,231.7,.02,21,0)
+^^1^1^3081008^
+"^DD",231.7,231.7,.02,21,1,0)
+This allows each station to have its own set of staff assignments.
+"^DD",231.7,231.7,.02,"DT")
+3081008
+"^DD",231.7,231.7,.03,0)
+AREA^P231.9'^EDPB(231.9,^0;3^Q
+"^DD",231.7,231.7,.03,3)
+Select an area for this person.
+"^DD",231.7,231.7,.03,21,0)
+^^1^1^3080912^
+"^DD",231.7,231.7,.03,21,1,0)
+This is the area to which the person is assigned as staff.
+"^DD",231.7,231.7,.03,23,0)
+^^2^2^3080912^
+"^DD",231.7,231.7,.03,23,1,0)
+The only area currently supported is the emergency department, but
+"^DD",231.7,231.7,.03,23,2,0)
+expansion into other areas is anticipated.
+"^DD",231.7,231.7,.03,"DT")
+3080305
+"^DD",231.7,231.7,.04,0)
+INACTIVE^S^0:ACTIVE;1:INACTIVE;^0;4^Q
+"^DD",231.7,231.7,.04,3)
+Enter 'active' or 'inactive'.
+"^DD",231.7,231.7,.04,21,0)
+^^2^2^3080912^
+"^DD",231.7,231.7,.04,21,1,0)
+This flag is set to 'inactive' when the person is no longer an active
+"^DD",231.7,231.7,.04,21,2,0)
+member of the staff for this area.
+"^DD",231.7,231.7,.04,"DT")
+3071124
+"^DD",231.7,231.7,.05,0)
+LOCAL ID*^F^^0;5^K:$L(X)>12!($L(X)<1) X
+"^DD",231.7,231.7,.05,3)
+Answer must be 1-12 characters in length.
+"^DD",231.7,231.7,.05,"DT")
+3080305
+"^DD",231.7,231.7,.06,0)
+ROLE^S^P:Provider;R:Resident;N:Nurse;^0;6^Q
+"^DD",231.7,231.7,.06,3)
+Enter the role (provider, nurse, resident).
+"^DD",231.7,231.7,.06,21,0)
+^^2^2^3080912^
+"^DD",231.7,231.7,.06,21,1,0)
+This is the role the person has on the staff.  The roles currently 
+"^DD",231.7,231.7,.06,21,2,0)
+supported are provider, nurse, and resident.
+"^DD",231.7,231.7,.06,"DT")
+3081005
+"^DD",231.7,231.7,.07,0)
+INITIALS*^F^^0;7^K:$L(X)>7!($L(X)<1) X
+"^DD",231.7,231.7,.07,3)
+Answer must be 1-7 characters in length.
+"^DD",231.7,231.7,.07,"DT")
+3080305
+"^DD",231.7,231.7,.08,0)
+COLOR^F^^0;8^K:$L(X)>20!($L(X)<1) X
+"^DD",231.7,231.7,.08,3)
+Answer must be 1-20 characters in length.
+"^DD",231.7,231.7,.08,21,0)
+^^2^2^3080912^
+"^DD",231.7,231.7,.08,21,1,0)
+This contains the RGB values for the foreground and background colors 
+"^DD",231.7,231.7,.08,21,2,0)
+used to highlight this person on the display board.
+"^DD",231.7,231.7,.08,23,0)
+^^9^9^3080912^
+"^DD",231.7,231.7,.08,23,1,0)
+The format of the color map for a person is:
+"^DD",231.7,231.7,.08,23,2,0)
+ 
+"^DD",231.7,231.7,.08,23,3,0)
+  <use color?>,<foreground color>,<background color>
+"^DD",231.7,231.7,.08,23,4,0)
+ 
+"^DD",231.7,231.7,.08,23,5,0)
+All colors are represented in hexadecimal.  For example, 
+"^DD",231.7,231.7,.08,23,6,0)
+ 
+"^DD",231.7,231.7,.08,23,7,0)
+  1,0xff0000,0xffffff
+"^DD",231.7,231.7,.08,23,8,0)
+ 
+"^DD",231.7,231.7,.08,23,9,0)
+means to use color, foreground color is red, background color is white.
+"^DD",231.7,231.7,.08,"DT")
+3071124
+"^DD",231.8,231.8,0)
+FIELD^^.12^12
+"^DD",231.8,231.8,0,"DDA")
+N
+"^DD",231.8,231.8,0,"DT")
+3081008
+"^DD",231.8,231.8,0,"IX","B",231.8,.01)
+
+"^DD",231.8,231.8,0,"NM","TRACKING ROOM-BED")
+
+"^DD",231.8,231.8,0,"PT",230,3.4)
+
+"^DD",231.8,231.8,0,"PT",230.1,3.4)
+
+"^DD",231.8,231.8,0,"PT",231.9,1.11)
+
+"^DD",231.8,231.8,0,"PT",231.9,1.12)
+
+"^DD",231.8,231.8,0,"VRPK")
+EMERGENCY DEPARTMENT
+"^DD",231.8,231.8,.01,0)
+NAME^RF^^0;1^K:$L(X)>30!($L(X)<2)!'(X'?1P.E) X
+"^DD",231.8,231.8,.01,1,0)
+^.1
+"^DD",231.8,231.8,.01,1,1,0)
+231.8^B
+"^DD",231.8,231.8,.01,1,1,1)
+S ^EDPB(231.8,"B",$E(X,1,30),DA)=""
+"^DD",231.8,231.8,.01,1,1,2)
+K ^EDPB(231.8,"B",$E(X,1,30),DA)
+"^DD",231.8,231.8,.01,3)
+Answer must be 2-30 characters in length.
+"^DD",231.8,231.8,.01,21,0)
+^^2^2^3080915^
+"^DD",231.8,231.8,.01,21,1,0)
+This is the internal name of the room, bed, or area that a patient may be 
+"^DD",231.8,231.8,.01,21,2,0)
+during the course of their visit.
+"^DD",231.8,231.8,.01,"DT")
+3080915
+"^DD",231.8,231.8,.02,0)
+INSTITUTION^P4'^DIC(4,^0;2^Q
+"^DD",231.8,231.8,.02,3)
+Select the institution for this bed, room, or area.
+"^DD",231.8,231.8,.02,21,0)
+^^2^2^3081008^
+"^DD",231.8,231.8,.02,21,1,0)
+This allows each station (division, for example) to manage its own set of
+"^DD",231.8,231.8,.02,21,2,0)
+rooms / beds / areas.
+"^DD",231.8,231.8,.02,"DT")
+3081008
+"^DD",231.8,231.8,.03,0)
+AREA^P231.9'^EDPB(231.9,^0;3^Q
+"^DD",231.8,231.8,.03,3)
+Enter the hospital area for this room/bed/area.
+"^DD",231.8,231.8,.03,21,0)
+^^3^3^3080915^
+"^DD",231.8,231.8,.03,21,1,0)
+This is the area in the hospital associated with this room or bed.  
+"^DD",231.8,231.8,.03,21,2,0)
+Initially, the only area supported is the emergency department.  It is 
+"^DD",231.8,231.8,.03,21,3,0)
+expected that additional areas will be supported in the future.
+"^DD",231.8,231.8,.03,23,0)
+^^2^2^3080915^
+"^DD",231.8,231.8,.03,23,1,0)
+For training classes, a separate area may be set up for each user so that 
+"^DD",231.8,231.8,.03,23,2,0)
+they may configure their own set of rooms/beds.
+"^DD",231.8,231.8,.03,"DT")
+3080111
+"^DD",231.8,231.8,.04,0)
+INACTIVE^S^0:ACTIVE;1:INACTIVE;^0;4^Q
+"^DD",231.8,231.8,.04,3)
+Enter 'INACTIVE' to disallow use of this room/bed/area.
+"^DD",231.8,231.8,.04,21,0)
+^^1^1^3080915^
+"^DD",231.8,231.8,.04,21,1,0)
+This flag is used to mark a room/bed/area as out of service.
+"^DD",231.8,231.8,.04,23,0)
+^^3^3^3080915^
+"^DD",231.8,231.8,.04,23,1,0)
+When a room is marked inactive, it is no longer available for selection 
+"^DD",231.8,231.8,.04,23,2,0)
+in EDIS.  However, the room will still show up on reports and entry 
+"^DD",231.8,231.8,.04,23,3,0)
+screens for previous entries.
+"^DD",231.8,231.8,.04,"DT")
+3070911
+"^DD",231.8,231.8,.05,0)
+SEQUENCE^NJ7,2^^0;5^K:+X'=X!(X>9999)!(X<1)!(X?.E1"."3N.N) X
+"^DD",231.8,231.8,.05,3)
+Type a Number between 1 and 9999, 2 Decimal Digits
+"^DD",231.8,231.8,.05,21,0)
+^^2^2^3080915^
+"^DD",231.8,231.8,.05,21,1,0)
+This is the sequence for displaying the room/bed/area on the large 
+"^DD",231.8,231.8,.05,21,2,0)
+display board.
+"^DD",231.8,231.8,.05,"DT")
+3070911
+"^DD",231.8,231.8,.06,0)
+DISPLAY NAME^F^^0;6^K:$L(X)>30!($L(X)<1) X
+"^DD",231.8,231.8,.06,3)
+Answer must be 1-30 characters in length.
+"^DD",231.8,231.8,.06,21,0)
+^^2^2^3080915^
+"^DD",231.8,231.8,.06,21,1,0)
+This is the name that is shown on the large display board.  It should be 
+"^DD",231.8,231.8,.06,21,2,0)
+concise or abbreviated to save space on the display board.
+"^DD",231.8,231.8,.06,"DT")
+3080111
+"^DD",231.8,231.8,.07,0)
+DISPLAY WHEN^S^0:OCCUPIED;1:ALWAYS;2:NEVER;^0;7^Q
+"^DD",231.8,231.8,.07,3)
+Enter when this room/bed/area should be shown on the display board.
+"^DD",231.8,231.8,.07,21,0)
+^^3^3^3081010^
+"^DD",231.8,231.8,.07,21,1,0)
+This indicates when the room/bed/area should show up on the large display 
+"^DD",231.8,231.8,.07,21,2,0)
+board.  The room may always show, show only if currently occupied by a 
+"^DD",231.8,231.8,.07,21,3,0)
+patient, or never show.
+"^DD",231.8,231.8,.07,"DT")
+3070912
+"^DD",231.8,231.8,.08,0)
+DEFAULT STATUS^P233.1'^EDPB(233.1,^0;8^Q
+"^DD",231.8,231.8,.08,3)
+Enter the status that should be assigned, if any, when this room/area is selected.
+"^DD",231.8,231.8,.08,21,0)
+^^4^4^3080915^
+"^DD",231.8,231.8,.08,21,1,0)
+If populated, the default status is automatically assigned to the entry 
+"^DD",231.8,231.8,.08,21,2,0)
+in the ED LOG file when the room/bed/area is selected.  For example, you 
+"^DD",231.8,231.8,.08,21,3,0)
+might want to automatically assign the status, Awaiting Triage, when the 
+"^DD",231.8,231.8,.08,21,4,0)
+patient is assigned to the waiting room.
+"^DD",231.8,231.8,.08,"DT")
+3070911
+"^DD",231.8,231.8,.09,0)
+MULTIPLE ASSIGN^S^0:Single;1:Multiple;2:Waiting;3:Single Non-ED;4:Multiple Non-ED;^0;9^Q
+"^DD",231.8,231.8,.09,3)
+Enter 'single' to allow only one patient at a time, 'waiting' for waiting areas, 'non-ED' for areas outside the emergency department.
+"^DD",231.8,231.8,.09,21,0)
+^^6^6^3080915^
+"^DD",231.8,231.8,.09,21,1,0)
+This field affects the behavior of the room for data entry and reports.  
+"^DD",231.8,231.8,.09,21,2,0)
+If single, only one patient at a time may be assigned to the room.  Exam
+"^DD",231.8,231.8,.09,21,3,0)
+rooms are a common example.  If multiple, multiple patients may be 
+"^DD",231.8,231.8,.09,21,4,0)
+simultaneously assigned to the room.  Waiting is a special case to 
+"^DD",231.8,231.8,.09,21,5,0)
+identify waiting areas in the reports.  Non-ED indicates an area where the
+"^DD",231.8,231.8,.09,21,6,0)
+patient may be that is outside the emergency department itself.
+"^DD",231.8,231.8,.09,"DT")
+3080512
+"^DD",231.8,231.8,.1,0)
+SHARED NAME^F^^0;10^K:$L(X)>30!($L(X)<1) X
+"^DD",231.8,231.8,.1,3)
+Answer must be 1-30 characters in length.
+"^DD",231.8,231.8,.1,21,0)
+^^3^3^3080915^
+"^DD",231.8,231.8,.1,21,1,0)
+If several beds or areas share the same physical space, use this field to 
+"^DD",231.8,231.8,.1,21,2,0)
+create a common name for these beds/areas.  By having this shared name, 
+"^DD",231.8,231.8,.1,21,3,0)
+the reports may by used to identify exposures to contagious organisms.
+"^DD",231.8,231.8,.1,"DT")
+3070911
+"^DD",231.8,231.8,.11,0)
+BOARD^F^^0;11^K:$L(X)>30!($L(X)<1) X
+"^DD",231.8,231.8,.11,3)
+Answer must be 1-30 characters in length.
+"^DD",231.8,231.8,.11,21,0)
+^^2^2^3080915^
+"^DD",231.8,231.8,.11,21,1,0)
+An entry in this field indicates that the room/area should be displayed 
+"^DD",231.8,231.8,.11,21,2,0)
+on a specific board that uses the name entered here.
+"^DD",231.8,231.8,.11,"DT")
+3071030
+"^DD",231.8,231.8,.12,0)
+COLOR^F^^0;12^K:$L(X)>20!($L(X)<1) X
+"^DD",231.8,231.8,.12,3)
+Answer must be 1-20 characters in length.
+"^DD",231.8,231.8,.12,21,0)
+^^2^2^3080915^
+"^DD",231.8,231.8,.12,21,1,0)
+A specific room/area may be mapped to a particular foreground and 
+"^DD",231.8,231.8,.12,21,2,0)
+background color for use with the display board.
+"^DD",231.8,231.8,.12,23,0)
+^^9^9^3080915^
+"^DD",231.8,231.8,.12,23,1,0)
+The format for color is:
+"^DD",231.8,231.8,.12,23,2,0)
+ 
+"^DD",231.8,231.8,.12,23,3,0)
+  <use color?>,<foreground>,<background>
+"^DD",231.8,231.8,.12,23,4,0)
+ 
+"^DD",231.8,231.8,.12,23,5,0)
+For example,
+"^DD",231.8,231.8,.12,23,6,0)
+ 
+"^DD",231.8,231.8,.12,23,7,0)
+  1,0x0,0xff0000
+"^DD",231.8,231.8,.12,23,8,0)
+ 
+"^DD",231.8,231.8,.12,23,9,0)
+is a red font on a black background.
+"^DD",231.8,231.8,.12,"DT")
+3071123
+"^DD",231.9,231.9,0)
+FIELD^^1.9^18
+"^DD",231.9,231.9,0,"DDA")
+N
+"^DD",231.9,231.9,0,"DT")
+3081215
+"^DD",231.9,231.9,0,"IX","B",231.9,.01)
+
+"^DD",231.9,231.9,0,"IX","C",231.9,.02)
+
+"^DD",231.9,231.9,0,"NM","TRACKING AREA")
+
+"^DD",231.9,231.9,0,"PT",230,.03)
+
+"^DD",231.9,231.9,0,"PT",231.7,.03)
+
+"^DD",231.9,231.9,0,"PT",231.8,.03)
+
+"^DD",231.9,231.9,0,"VRPK")
+EMERGENCY DEPARTMENT
+"^DD",231.9,231.9,.01,0)
+NAME^RF^^0;1^K:$L(X)>30!($L(X)<3)!'(X'?1P.E) X
+"^DD",231.9,231.9,.01,1,0)
+^.1
+"^DD",231.9,231.9,.01,1,1,0)
+231.9^B
+"^DD",231.9,231.9,.01,1,1,1)
+S ^EDPB(231.9,"B",$E(X,1,30),DA)=""
+"^DD",231.9,231.9,.01,1,1,2)
+K ^EDPB(231.9,"B",$E(X,1,30),DA)
+"^DD",231.9,231.9,.01,3)
+Answer must be 3-30 characters in length.
+"^DD",231.9,231.9,.01,21,0)
+^^2^2^3080915^
+"^DD",231.9,231.9,.01,21,1,0)
+This is the name for an area within the hospital.  Emergency Department 
+"^DD",231.9,231.9,.01,21,2,0)
+is the only area currently supported.
+"^DD",231.9,231.9,.01,"DT")
+3080915
+"^DD",231.9,231.9,.02,0)
+INSTITUTION^RP4'^DIC(4,^0;2^Q
+"^DD",231.9,231.9,.02,1,0)
+^.1
+"^DD",231.9,231.9,.02,1,1,0)
+231.9^C
+"^DD",231.9,231.9,.02,1,1,1)
+S ^EDPB(231.9,"C",$E(X,1,30),DA)=""
+"^DD",231.9,231.9,.02,1,1,2)
+K ^EDPB(231.9,"C",$E(X,1,30),DA)
+"^DD",231.9,231.9,.02,1,1,"%D",0)
+^^1^1^3081010^
+"^DD",231.9,231.9,.02,1,1,"%D",1,0)
+This allows finding an area within a specific division.
+"^DD",231.9,231.9,.02,1,1,"DT")
+3070913
+"^DD",231.9,231.9,.02,3)
+Select the instutition for this area.
+"^DD",231.9,231.9,.02,21,0)
+^^2^2^3081008^
+"^DD",231.9,231.9,.02,21,1,0)
+This allows each station served by the VistA system to have its own set of
+"^DD",231.9,231.9,.02,21,2,0)
+areas.
+"^DD",231.9,231.9,.02,"DT")
+3081008
+"^DD",231.9,231.9,.03,0)
+LAST UPDATE^D^^0;3^S %DT="ESTXR" D ^%DT S X=Y K:Y<1 X
+"^DD",231.9,231.9,.03,3)
+Enter the date/time the configuration changed.
+"^DD",231.9,231.9,.03,21,0)
+^^3^3^3080915^
+"^DD",231.9,231.9,.03,21,1,0)
+This is the date/time that the configuration was last updated.  This 
+"^DD",231.9,231.9,.03,21,2,0)
+helps the client or display board know whether it is necessary to reload 
+"^DD",231.9,231.9,.03,21,3,0)
+the configuration parameters.
+"^DD",231.9,231.9,.03,"DT")
+3080502
+"^DD",231.9,231.9,1.1,0)
+DIAGNOSIS REQUIRED^S^0:NO;1:YES;^1;1^Q
+"^DD",231.9,231.9,1.1,3)
+Enter 'YES' if a diagnosis must be entered before removing the patient from the board.
+"^DD",231.9,231.9,1.1,21,0)
+^^2^2^3080915^
+"^DD",231.9,231.9,1.1,21,1,0)
+This is true if a diagnosis must be entered before removing a patient 
+"^DD",231.9,231.9,1.1,21,2,0)
+from the display board.
+"^DD",231.9,231.9,1.1,"DT")
+3071015
+"^DD",231.9,231.9,1.11,0)
+AMBULANCE^P231.8'^EDPB(231.8,^1;11^Q
+"^DD",231.9,231.9,1.11,3)
+Select the room/area that represents an arriving ambulance.
+"^DD",231.9,231.9,1.11,21,0)
+^^2^2^3080915^
+"^DD",231.9,231.9,1.11,21,1,0)
+This field identifies which entry in the TRACKING ROOM-BED represents an 
+"^DD",231.9,231.9,1.11,21,2,0)
+arriving ambulance.
+"^DD",231.9,231.9,1.11,"DT")
+3080514
+"^DD",231.9,231.9,1.12,0)
+INITIAL ROOM^P231.8'^EDPB(231.8,^1;12^Q
+"^DD",231.9,231.9,1.12,3)
+Enter the room/area that is initially assigned.
+"^DD",231.9,231.9,1.12,21,0)
+^^3^3^3080915^
+"^DD",231.9,231.9,1.12,21,1,0)
+This field refers to the entry in the TRACKING ROOM-BED file that should 
+"^DD",231.9,231.9,1.12,21,2,0)
+be initially assigned to a patient when the patient is first added to the 
+"^DD",231.9,231.9,1.12,21,3,0)
+board (the default room).  Often this is the waiting room.
+"^DD",231.9,231.9,1.12,"DT")
+3080514
+"^DD",231.9,231.9,1.2,0)
+CODED DIAGNOSIS^S^0:NO;1:YES;^1;2^Q
+"^DD",231.9,231.9,1.2,3)
+Enter YES if the diagnosis is required to be an ICD9 code.
+"^DD",231.9,231.9,1.2,21,0)
+^^2^2^3080922^
+"^DD",231.9,231.9,1.2,21,1,0)
+This is set to YES if the diagnosis is required to be an ICD9 code.  
+"^DD",231.9,231.9,1.2,21,2,0)
+Otherwise, the diagnosis may be free text.
+"^DD",231.9,231.9,1.2,"DT")
+3071015
+"^DD",231.9,231.9,1.3,0)
+DISPOSITION REQUIRED^S^0:NO;1:YES;^1;3^Q
+"^DD",231.9,231.9,1.3,3)
+Enter 'YES' if a disposition must be entered before removing patient from the board.
+"^DD",231.9,231.9,1.3,21,0)
+^^2^2^3080915^
+"^DD",231.9,231.9,1.3,21,1,0)
+This is true if a disposition must be entered before removing a patient 
+"^DD",231.9,231.9,1.3,21,2,0)
+from the display board.
+"^DD",231.9,231.9,1.3,"DT")
+3071015
+"^DD",231.9,231.9,1.4,0)
+DELAY REQUIRED^S^0:NO;1:YES;^1;4^Q
+"^DD",231.9,231.9,1.4,3)
+Enter 'YES' if a delay reason is required for visits exceeding the pre-set number of minutes allowed.
+"^DD",231.9,231.9,1.4,21,0)
+^^3^3^3080915^
+"^DD",231.9,231.9,1.4,21,1,0)
+This is true if a delay reason must be entered for visits that have 
+"^DD",231.9,231.9,1.4,21,2,0)
+lasted longer than the number of minutes identified in DELAY MINUTES 
+"^DD",231.9,231.9,1.4,21,3,0)
+before removing the patient from the board.
+"^DD",231.9,231.9,1.4,"DT")
+3071015
+"^DD",231.9,231.9,1.5,0)
+DELAY MINUTES^NJ4,0^^1;5^K:+X'=X!(X>1440)!(X<1)!(X?.E1"."1N.N) X
+"^DD",231.9,231.9,1.5,3)
+Type a Number between 1 and 1440, 0 Decimal Digits
+"^DD",231.9,231.9,1.5,21,0)
+^^2^2^3080915^
+"^DD",231.9,231.9,1.5,21,1,0)
+This represents the number of minutes a visit may last before a delay 
+"^DD",231.9,231.9,1.5,21,2,0)
+reason is required.
+"^DD",231.9,231.9,1.5,"DT")
+3081010
+"^DD",231.9,231.9,1.6,0)
+FIRST SHIFT START^NJ4,0^^1;6^K:+X'=X!(X>1440)!(X<0)!(X?.E1"."1N.N) X
+"^DD",231.9,231.9,1.6,3)
+Type a Number between 0 and 1440, 0 Decimal Digits
+"^DD",231.9,231.9,1.6,21,0)
+^^5^5^3081010^
+"^DD",231.9,231.9,1.6,21,1,0)
+Some of the reports may be generated by shift.  This is the time that the 
+"^DD",231.9,231.9,1.6,21,2,0)
+first shift of the day begins.  It is currently assumed that the shifts 
+"^DD",231.9,231.9,1.6,21,3,0)
+have equal length.
+"^DD",231.9,231.9,1.6,21,4,0)
+ 
+"^DD",231.9,231.9,1.6,21,5,0)
+This is the number of minutes past midnight when the first shift begins.
+"^DD",231.9,231.9,1.6,"DT")
+3081010
+"^DD",231.9,231.9,1.7,0)
+SHIFT DURATION^NJ4,0^^1;7^K:+X'=X!(X>1440)!(X<0)!(X?.E1"."1N.N) X
+"^DD",231.9,231.9,1.7,3)
+Type a Number between 0 and 1440, 0 Decimal Digits
+"^DD",231.9,231.9,1.7,21,0)
+^^2^2^3080915^
+"^DD",231.9,231.9,1.7,21,1,0)
+This represents the number of minutes the comprise a shift.  If the shift 
+"^DD",231.9,231.9,1.7,21,2,0)
+is 8 hours long, this value would be 480 (8*60).
+"^DD",231.9,231.9,1.7,"DT")
+3081010
+"^DD",231.9,231.9,1.8,0)
+PROMPT RESIDENTS^S^0:NO;1:YES;^1;8^Q
+"^DD",231.9,231.9,1.8,3)
+Enter 'YES' if residents should be prompted for.
+"^DD",231.9,231.9,1.8,21,0)
+^^2^2^3081010^
+"^DD",231.9,231.9,1.8,21,1,0)
+This flag is set to YES if residents should be prompted for in addition to
+"^DD",231.9,231.9,1.8,21,2,0)
+providers (i.e., the attending provider).
+"^DD",231.9,231.9,1.8,"DT")
+3071130
+"^DD",231.9,231.9,1.9,0)
+PROMPT CLINICS^S^0:NO;1:YES;^1;9^Q
+"^DD",231.9,231.9,1.9,3)
+Enter 'YES' if clinics should be prompted for.
+"^DD",231.9,231.9,1.9,21,0)
+^^2^2^3081215^
+"^DD",231.9,231.9,1.9,21,1,0)
+This flag is set to YES if clinics should be prompted for.  This allows 
+"^DD",231.9,231.9,1.9,21,2,0)
+the visit to be created based on an explicitly selected clinic.
+"^DD",231.9,231.9,1.9,"DT")
+3081215
+"^DD",231.9,231.9,3,0)
+COLOR SPEC^231.93^^3;0
+"^DD",231.9,231.9,3,21,0)
+^^2^2^3080922^
+"^DD",231.9,231.9,3,21,1,0)
+This contains an XML document that is a map of the colors to be used for 
+"^DD",231.9,231.9,3,21,2,0)
+the display board.
+"^DD",231.9,231.9,4,0)
+DISPLAY BOARD CONFIG^231.94A^^4;0
+"^DD",231.9,231.9,4,21,0)
+^^2^2^3080922^
+"^DD",231.9,231.9,4,21,1,0)
+This multiple contains the XML descriptions of each display board 
+"^DD",231.9,231.9,4,21,2,0)
+definition.
+"^DD",231.9,231.9,230.1,0)
+TRACKING UPDATED^F^^230;1^K:$L(X)>30!($L(X)<1) X
+"^DD",231.9,231.9,230.1,3)
+Answer must be 1-30 characters in length.
+"^DD",231.9,231.9,230.1,21,0)
+^.001^2^2^3081017^^^
+"^DD",231.9,231.9,230.1,21,1,0)
+This timestamp is set whenever the data that is shown on any display board
+"^DD",231.9,231.9,230.1,21,2,0)
+for an area has been updated.
+"^DD",231.9,231.9,230.1,23,0)
+^^2^2^3081017^
+"^DD",231.9,231.9,230.1,23,1,0)
+The timestamp kept in this field is $H.  The $H value is used as a token 
+"^DD",231.9,231.9,230.1,23,2,0)
+by the client to know that tracking data has changed.
+"^DD",231.9,231.9,230.1,"DT")
+3071006
+"^DD",231.9,231.9,231.1,0)
+CHOICES UPDATED^F^^231;1^K:$L(X)>30!($L(X)<1) X
+"^DD",231.9,231.9,231.1,3)
+Answer must be 1-30 characters in length.
+"^DD",231.9,231.9,231.1,21,0)
+^.001^2^2^3081017^^^
+"^DD",231.9,231.9,231.1,21,1,0)
+This is a timestamp that is set whenever the definition of any display 
+"^DD",231.9,231.9,231.1,21,2,0)
+board for a given area has been modified.
+"^DD",231.9,231.9,231.1,23,0)
+^^2^2^3081017^
+"^DD",231.9,231.9,231.1,23,1,0)
+The timestamp kept in this field is $H.  The $H value is used as a token 
+"^DD",231.9,231.9,231.1,23,2,0)
+by the client to know that display choices have been updated.
+"^DD",231.9,231.9,231.1,"DT")
+3080727
+"^DD",231.9,231.93,0)
+COLOR SPEC SUB-FIELD^^.01^1
+"^DD",231.9,231.93,0,"DT")
+3071027
+"^DD",231.9,231.93,0,"NM","COLOR SPEC")
+
+"^DD",231.9,231.93,0,"UP")
+231.9
+"^DD",231.9,231.93,.01,0)
+COLOR SPEC^WL^^0;1^Q
+"^DD",231.9,231.93,.01,3)
+Enter the XML-based color map.
+"^DD",231.9,231.93,.01,21,0)
+^^2^2^3080922^
+"^DD",231.9,231.93,.01,21,1,0)
+This contains an XML document that is a map of the colors to be used for 
+"^DD",231.9,231.93,.01,21,2,0)
+the display board.
+"^DD",231.9,231.93,.01,"DT")
+3071027
+"^DD",231.9,231.94,0)
+DISPLAY BOARD CONFIG SUB-FIELD^^1^2
+"^DD",231.9,231.94,0,"DT")
+3080514
+"^DD",231.9,231.94,0,"IX","B",231.94,.01)
+
+"^DD",231.9,231.94,0,"NM","DISPLAY BOARD CONFIG")
+
+"^DD",231.9,231.94,0,"UP")
+231.9
+"^DD",231.9,231.94,.01,0)
+NAME^F^^0;1^K:$L(X)>30!($L(X)<1) X
+"^DD",231.9,231.94,.01,1,0)
+^.1
+"^DD",231.9,231.94,.01,1,1,0)
+231.94^B
+"^DD",231.9,231.94,.01,1,1,1)
+S ^EDPB(231.9,DA(1),4,"B",$E(X,1,30),DA)=""
+"^DD",231.9,231.94,.01,1,1,2)
+K ^EDPB(231.9,DA(1),4,"B",$E(X,1,30),DA)
+"^DD",231.9,231.94,.01,3)
+Enter a unique name for this display board configuration.
+"^DD",231.9,231.94,.01,21,0)
+^^1^1^3080922^
+"^DD",231.9,231.94,.01,21,1,0)
+This is the name of the specific display board.
+"^DD",231.9,231.94,.01,"DT")
+3080514
+"^DD",231.9,231.94,1,0)
+SPEC^231.941^^1;0
+"^DD",231.9,231.94,1,21,0)
+^^1^1^3080922^
+"^DD",231.9,231.94,1,21,1,0)
+This is the XML description for a specific display board.
+"^DD",231.9,231.941,0)
+SPEC SUB-FIELD^^.01^1
+"^DD",231.9,231.941,0,"DT")
+3080514
+"^DD",231.9,231.941,0,"NM","SPEC")
+
+"^DD",231.9,231.941,0,"UP")
+231.94
+"^DD",231.9,231.941,.01,0)
+SPEC^WL^^0;1^Q
+"^DD",231.9,231.941,.01,3)
+Enter the XML that represents the board specification.
+"^DD",231.9,231.941,.01,21,0)
+^^1^1^3080922^
+"^DD",231.9,231.941,.01,21,1,0)
+This is the XML-based description of a specific display board definition.
+"^DD",231.9,231.941,.01,"DT")
+3080514
+"^DD",233.1,233.1,0)
+FIELD^^2^6
+"^DD",233.1,233.1,0,"DT")
+3081010
+"^DD",233.1,233.1,0,"IX","B",233.1,.01)
+
+"^DD",233.1,233.1,0,"NM","TRACKING CODE")
+
+"^DD",233.1,233.1,0,"PT",230,.1)
+
+"^DD",233.1,233.1,0,"PT",230,1.2)
+
+"^DD",233.1,233.1,0,"PT",230,1.5)
+
+"^DD",233.1,233.1,0,"PT",230,3.2)
+
+"^DD",233.1,233.1,0,"PT",230,3.3)
+
+"^DD",233.1,233.1,0,"PT",230.1,.1)
+
+"^DD",233.1,233.1,0,"PT",230.1,.11)
+
+"^DD",233.1,233.1,0,"PT",230.1,.12)
+
+"^DD",233.1,233.1,0,"PT",230.1,3.2)
+
+"^DD",233.1,233.1,0,"PT",230.1,3.3)
+
+"^DD",233.1,233.1,0,"PT",231.8,.08)
+
+"^DD",233.1,233.1,0,"PT",233.1,.04)
+
+"^DD",233.1,233.1,0,"PT",233.21,.02)
+
+"^DD",233.1,233.1,0,"VRPK")
+EMERGENCY DEPARTMENT
+"^DD",233.1,233.1,.01,0)
+NAME^RF^^0;1^K:$L(X)>30!(X?.N)!($L(X)<3)!'(X'?1P.E) X
+"^DD",233.1,233.1,.01,1,0)
+^.1
+"^DD",233.1,233.1,.01,1,1,0)
+233.1^B
+"^DD",233.1,233.1,.01,1,1,1)
+S ^EDPB(233.1,"B",$E(X,1,30),DA)=""
+"^DD",233.1,233.1,.01,1,1,2)
+K ^EDPB(233.1,"B",$E(X,1,30),DA)
+"^DD",233.1,233.1,.01,3)
+NAME MUST BE 3-30 CHARACTERS, NOT NUMERIC OR STARTING WITH PUNCTUATION
+"^DD",233.1,233.1,.01,21,0)
+^^4^4^3081010^
+"^DD",233.1,233.1,.01,21,1,0)
+This is a unique name for a value in a selection list used by the patient 
+"^DD",233.1,233.1,.01,21,2,0)
+tracking system.  Each name is made unique by a prefix.  This prefix is 
+"^DD",233.1,233.1,.01,21,3,0)
+"edp." for nationally exported names.  Names that are added by the site 
+"^DD",233.1,233.1,.01,21,4,0)
+are prefixed with the station number and a period -- "500.", for example.
+"^DD",233.1,233.1,.01,"DT")
+3080122
+"^DD",233.1,233.1,.02,0)
+DISPLAY NAME^F^^0;2^K:$L(X)>60!($L(X)<1) X
+"^DD",233.1,233.1,.02,3)
+Answer must be 1-60 characters in length.
+"^DD",233.1,233.1,.02,21,0)
+^^1^1^3080922^
+"^DD",233.1,233.1,.02,21,1,0)
+This is the name of the selection that should appear on the display board.
+"^DD",233.1,233.1,.02,"DT")
+3080122
+"^DD",233.1,233.1,.03,0)
+ABBREVIATION^F^^0;3^K:$L(X)>30!($L(X)<1) X
+"^DD",233.1,233.1,.03,3)
+Answer must be 1-30 characters in length.
+"^DD",233.1,233.1,.03,21,0)
+^^1^1^3080922^
+"^DD",233.1,233.1,.03,21,1,0)
+This is an abbreviation of the display name that is used in some reports.
+"^DD",233.1,233.1,.03,"DT")
+3080122
+"^DD",233.1,233.1,.04,0)
+NATIONAL CODE^P233.1'^EDPB(233.1,^0;4^Q
+"^DD",233.1,233.1,.04,3)
+Enter the national code that most closely matches this local code.
+"^DD",233.1,233.1,.04,21,0)
+^^2^2^3080922^
+"^DD",233.1,233.1,.04,21,1,0)
+This will allow a mapping from a site defined code to a national code when
+"^DD",233.1,233.1,.04,21,2,0)
+such a code exists.
+"^DD",233.1,233.1,.04,"DT")
+3070719
+"^DD",233.1,233.1,.05,0)
+FLAGS^F^^0;5^K:$L(X)>4!($L(X)<1) X
+"^DD",233.1,233.1,.05,3)
+Answer must be 1-4 characters in length.
+"^DD",233.1,233.1,.05,21,0)
+^^11^11^3081010^
+"^DD",233.1,233.1,.05,21,1,0)
+The flags are used to further classify a specific code.  
+"^DD",233.1,233.1,.05,21,2,0)
+The possible flags are:
+"^DD",233.1,233.1,.05,21,3,0)
+ 
+"^DD",233.1,233.1,.05,21,4,0)
+   M: Missed Opportunity
+"^DD",233.1,233.1,.05,21,5,0)
+   A: Admission
+"^DD",233.1,233.1,.05,21,6,0)
+  VA: VA Admission
+"^DD",233.1,233.1,.05,21,7,0)
+   O: Observation
+"^DD",233.1,233.1,.05,21,8,0)
+ 
+"^DD",233.1,233.1,.05,21,9,0)
+Multiple flags are allowed.  No delimiters are required, as each 
+"^DD",233.1,233.1,.05,21,10,0)
+character has a specific meaning.  In the case of "VA", the "A" indicates 
+"^DD",233.1,233.1,.05,21,11,0)
+an admission and the "V" indicates that the admission was to the VA.  
+"^DD",233.1,233.1,.05,"DT")
+3081010
+"^DD",233.1,233.1,2,0)
+DESCRIPTION^233.12^^2;0
+"^DD",233.1,233.1,2,21,0)
+^^1^1^3080922^
+"^DD",233.1,233.1,2,21,1,0)
+This allows the code to be further described.
+"^DD",233.1,233.12,0)
+DESCRIPTION SUB-FIELD^^.01^1
+"^DD",233.1,233.12,0,"DT")
+3070720
+"^DD",233.1,233.12,0,"NM","DESCRIPTION")
+
+"^DD",233.1,233.12,0,"UP")
+233.1
+"^DD",233.1,233.12,.01,0)
+DESCRIPTION^W^^0;1^Q
+"^DD",233.1,233.12,.01,21,0)
+^^1^1^3080922^
+"^DD",233.1,233.12,.01,21,1,0)
+This allows the code to be further described.
+"^DD",233.1,233.12,.01,"DT")
+3070720
+"^DD",233.2,233.2,0)
+FIELD^^1^2
+"^DD",233.2,233.2,0,"DDA")
+N
+"^DD",233.2,233.2,0,"DT")
+3071229
+"^DD",233.2,233.2,0,"IX","AS",233.21,.02)
+
+"^DD",233.2,233.2,0,"IX","AS",233.21,.04)
+
+"^DD",233.2,233.2,0,"IX","AS",233.21,.05)
+
+"^DD",233.2,233.2,0,"IX","B",233.2,.01)
+
+"^DD",233.2,233.2,0,"NM","TRACKING CODE SET")
+
+"^DD",233.2,233.2,0,"VRPK")
+EMERGENCY DEPARTMENT
+"^DD",233.2,233.2,.01,0)
+NAME^RF^^0;1^K:$L(X)>30!(X?.N)!($L(X)<3)!'(X'?1P.E) X
+"^DD",233.2,233.2,.01,1,0)
+^.1
+"^DD",233.2,233.2,.01,1,1,0)
+233.2^B
+"^DD",233.2,233.2,.01,1,1,1)
+S ^EDPB(233.2,"B",$E(X,1,30),DA)=""
+"^DD",233.2,233.2,.01,1,1,2)
+K ^EDPB(233.2,"B",$E(X,1,30),DA)
+"^DD",233.2,233.2,.01,3)
+NAME MUST BE 3-30 CHARACTERS, NOT NUMERIC OR STARTING WITH PUNCTUATION
+"^DD",233.2,233.2,.01,21,0)
+^^3^3^3080922^
+"^DD",233.2,233.2,.01,21,1,0)
+This is the name for this set of tracking codes.  The set is used as a 
+"^DD",233.2,233.2,.01,21,2,0)
+selection list in the patient tracking software.  The selection lists may 
+"^DD",233.2,233.2,.01,21,3,0)
+be modifed at each site.
+"^DD",233.2,233.2,1,0)
+CODES^233.21A^^1;0
+"^DD",233.2,233.2,1,21,0)
+^^1^1^3080922^
+"^DD",233.2,233.2,1,21,1,0)
+This is the list of codes that are available in the selection list.
+"^DD",233.2,233.21,0)
+CODES SUB-FIELD^^.05^5
+"^DD",233.2,233.21,0,"DT")
+3071229
+"^DD",233.2,233.21,0,"IX","B",233.21,.01)
+
+"^DD",233.2,233.21,0,"NM","CODES")
+
+"^DD",233.2,233.21,0,"UP")
+233.2
+"^DD",233.2,233.21,.01,0)
+SEQUENCE^MNJ4,0^^0;1^K:+X'=X!(X>9999)!(X<1)!(X?.E1"."1N.N) X
+"^DD",233.2,233.21,.01,1,0)
+^.1
+"^DD",233.2,233.21,.01,1,1,0)
+233.21^B
+"^DD",233.2,233.21,.01,1,1,1)
+S ^EDPB(233.2,DA(1),1,"B",$E(X,1,30),DA)=""
+"^DD",233.2,233.21,.01,1,1,2)
+K ^EDPB(233.2,DA(1),1,"B",$E(X,1,30),DA)
+"^DD",233.2,233.21,.01,3)
+Type a Number between 1 and 9999, 0 Decimal Digits
+"^DD",233.2,233.21,.01,21,0)
+^^1^1^3080922^
+"^DD",233.2,233.21,.01,21,1,0)
+This is the order in which the code should appear in the list.
+"^DD",233.2,233.21,.01,"DT")
+3070719
+"^DD",233.2,233.21,.02,0)
+CODE^P233.1'^EDPB(233.1,^0;2^Q
+"^DD",233.2,233.21,.02,1,0)
+^.1
+"^DD",233.2,233.21,.02,1,1,0)
+233.2^AS^MUMPS
+"^DD",233.2,233.21,.02,1,1,1)
+D LFS^EDPDD
+"^DD",233.2,233.21,.02,1,1,2)
+D LFK^EDPDD
+"^DD",233.2,233.21,.02,1,1,"%D",0)
+^^2^2^3080924^
+"^DD",233.2,233.21,.02,1,1,"%D",1,0)
+Allows quick access to the local display name.
+"^DD",233.2,233.21,.02,1,1,"%D",2,0)
+ListName,CodePtr,IEN)=Abbreviation^Name
+"^DD",233.2,233.21,.02,1,1,"DT")
+3080723
+"^DD",233.2,233.21,.02,3)
+Select a code to include in the selection list.
+"^DD",233.2,233.21,.02,21,0)
+^^1^1^3080922^
+"^DD",233.2,233.21,.02,21,1,0)
+This is the code to include in the selection list.
+"^DD",233.2,233.21,.02,"DT")
+3080723
+"^DD",233.2,233.21,.03,0)
+INACTIVE^S^1:INACTIVE;0:ACTIVE;^0;3^Q
+"^DD",233.2,233.21,.03,3)
+Enter INACTIVE if selection of the code should be disallowed.
+"^DD",233.2,233.21,.03,21,0)
+^^2^2^3080922^
+"^DD",233.2,233.21,.03,21,1,0)
+This may be used to indicate that the code is to be temporarily 
+"^DD",233.2,233.21,.03,21,2,0)
+inactivated.
+"^DD",233.2,233.21,.03,"DT")
+3071228
+"^DD",233.2,233.21,.04,0)
+NAME AT SITE^F^^0;4^K:$L(X)>60!($L(X)<1) X
+"^DD",233.2,233.21,.04,1,0)
+^.1
+"^DD",233.2,233.21,.04,1,1,0)
+233.2^AS^MUMPS
+"^DD",233.2,233.21,.04,1,1,1)
+D LFS1^EDPDD
+"^DD",233.2,233.21,.04,1,1,2)
+D LFK1^EDPDD
+"^DD",233.2,233.21,.04,1,1,"%D",0)
+^^2^2^3080924^
+"^DD",233.2,233.21,.04,1,1,"%D",1,0)
+Allows quick access to the local display name.
+"^DD",233.2,233.21,.04,1,1,"%D",2,0)
+ListName,CodePtr,IEN)=Abbreviation^Name
+"^DD",233.2,233.21,.04,1,1,"DT")
+3080723
+"^DD",233.2,233.21,.04,3)
+Answer must be 1-60 characters in length.
+"^DD",233.2,233.21,.04,21,0)
+^^3^3^3081010^
+"^DD",233.2,233.21,.04,21,1,0)
+This field allows a site to use a name that is different from the 
+"^DD",233.2,233.21,.04,21,2,0)
+nationally exported display name.  This name should not change the
+"^DD",233.2,233.21,.04,21,3,0)
+underlying meaning of the nationally exported name.
+"^DD",233.2,233.21,.04,"DT")
+3080723
+"^DD",233.2,233.21,.05,0)
+ABBREVIATION AT SITE^F^^0;5^K:$L(X)>30!($L(X)<1) X
+"^DD",233.2,233.21,.05,1,0)
+^.1
+"^DD",233.2,233.21,.05,1,1,0)
+233.2^AS^MUMPS
+"^DD",233.2,233.21,.05,1,1,1)
+D LFS1^EDPDD
+"^DD",233.2,233.21,.05,1,1,2)
+D LFK1^EDPDD
+"^DD",233.2,233.21,.05,1,1,"%D",0)
+^.101^2^2^3081010^^
+"^DD",233.2,233.21,.05,1,1,"%D",1,0)
+Allows quick access to the local display names.
+"^DD",233.2,233.21,.05,1,1,"%D",2,0)
+ListName,CodePtr,IEN)=Abbreviation^Name
+"^DD",233.2,233.21,.05,1,1,"DT")
+3080723
+"^DD",233.2,233.21,.05,3)
+Answer must be 1-30 characters in length.
+"^DD",233.2,233.21,.05,21,0)
+^^2^2^3080922^
+"^DD",233.2,233.21,.05,21,1,0)
+This allows a site to use a different abbreviation for a national code 
+"^DD",233.2,233.21,.05,21,2,0)
+without changing the underlying meaning of the code.
+"^DD",233.2,233.21,.05,"DT")
+3080723
+"^DIC",230,230,0)
+ED LOG^230
+"^DIC",230,230,0,"GL")
+^EDP(230,
+"^DIC",230,230,"%D",0)
+^^12^12^3081004^
+"^DIC",230,230,"%D",1,0)
+This file serves as the log of emergency department visits.  It works 
+"^DIC",230,230,"%D",2,0)
+together with the ED LOG HISTORY file to track when activities of a
+"^DIC",230,230,"%D",3,0)
+typical emergency department visit are done.  It records where the patient
+"^DIC",230,230,"%D",4,0)
+went, who was responsible, and when key things happened (such as triage
+"^DIC",230,230,"%D",5,0)
+and disposition).
+"^DIC",230,230,"%D",6,0)
+ 
+"^DIC",230,230,"%D",7,0)
+This file serves as the key source of information for data that is
+"^DIC",230,230,"%D",8,0)
+displayed on the emergency department display board (an electronic "white
+"^DIC",230,230,"%D",9,0)
+board").  Patient visits that are currently active are shown on the
+"^DIC",230,230,"%D",10,0)
+display board.  The display board is refreshed every 30 seconds.  Many of
+"^DIC",230,230,"%D",11,0)
+the indexes in this file assist in making the refresh code as efficient as
+"^DIC",230,230,"%D",12,0)
+possible.
+"^DIC",230,"B","ED LOG",230)
+
+"^DIC",230.1,230.1,0)
+ED LOG HISTORY^230.1
+"^DIC",230.1,230.1,0,"GL")
+^EDP(230.1,
+"^DIC",230.1,230.1,"%D",0)
+^^13^13^3081004^
+"^DIC",230.1,230.1,"%D",1,0)
+This file contains a history of changes to key fields in the ED LOG 
+"^DIC",230.1,230.1,"%D",2,0)
+file.  When a record is first created in the ED LOG file, and each time 
+"^DIC",230.1,230.1,"%D",3,0)
+that record is updated, a record is also created in this file that
+"^DIC",230.1,230.1,"%D",4,0)
+contains the values of the fields that actually changed.  This gives a
+"^DIC",230.1,230.1,"%D",5,0)
+thorough history of what was changed when and by whom.  A major purpose to
+"^DIC",230.1,230.1,"%D",6,0)
+the Emergency Department Tracking System is to measure how long it takes
+"^DIC",230.1,230.1,"%D",7,0)
+to do things.  By keeping this history file, with all the time stamps, it
+"^DIC",230.1,230.1,"%D",8,0)
+is possible to generate a variety of reports.  These include information
+"^DIC",230.1,230.1,"%D",9,0)
+such as wait times, lengths of visit, number of delayed visits, etc.
+"^DIC",230.1,230.1,"%D",10,0)
+ 
+"^DIC",230.1,230.1,"%D",11,0)
+The fields in this file correspond to the identically named fields in the 
+"^DIC",230.1,230.1,"%D",12,0)
+ED LOG file (230).  For more detail in the field description, please 
+"^DIC",230.1,230.1,"%D",13,0)
+refer to the matching field in the ED LOG file.
+"^DIC",230.1,"B","ED LOG HISTORY",230.1)
+
+"^DIC",231.7,231.7,0)
+TRACKING STAFF^231.7
+"^DIC",231.7,231.7,0,"GL")
+^EDPB(231.7,
+"^DIC",231.7,231.7,"%D",0)
+^^6^6^3081005^
+"^DIC",231.7,231.7,"%D",1,0)
+This file contains staff assigned to a particular area (e.g., the 
+"^DIC",231.7,231.7,"%D",2,0)
+emergency department).  It allows for concise selection lists when 
+"^DIC",231.7,231.7,"%D",3,0)
+updating the tracking log.  It also allows for particular colors to be 
+"^DIC",231.7,231.7,"%D",4,0)
+associated with staff.  When that person is shown on the display board, 
+"^DIC",231.7,231.7,"%D",5,0)
+the colors may be used to more easily tell who is assigned to which 
+"^DIC",231.7,231.7,"%D",6,0)
+patient.
+"^DIC",231.7,"B","TRACKING STAFF",231.7)
+
+"^DIC",231.8,231.8,0)
+TRACKING ROOM-BED^231.8
+"^DIC",231.8,231.8,0,"GL")
+^EDPB(231.8,
+"^DIC",231.8,231.8,"%D",0)
+^^6^6^3080915^
+"^DIC",231.8,231.8,"%D",1,0)
+As the patient moves thru a visit, such as a visit to the emergency 
+"^DIC",231.8,231.8,"%D",2,0)
+department, there are a number of areas the patient may stop at.  This 
+"^DIC",231.8,231.8,"%D",3,0)
+file allows the department to set up places a patient may be, physical or 
+"^DIC",231.8,231.8,"%D",4,0)
+conceptual, so that the patient may be tracked throughout their visit. 
+"^DIC",231.8,231.8,"%D",5,0)
+These places may include specific beds, waiting areas, other areas of the 
+"^DIC",231.8,231.8,"%D",6,0)
+hospital such as radiology, exam rooms, etc.
+"^DIC",231.8,"B","TRACKING ROOM-BED",231.8)
+
+"^DIC",231.9,231.9,0)
+TRACKING AREA^231.9
+"^DIC",231.9,231.9,0,"GL")
+^EDPB(231.9,
+"^DIC",231.9,231.9,"%D",0)
+^^4^4^3080922^
+"^DIC",231.9,231.9,"%D",1,0)
+This file contains the parameters that control the behavior of the 
+"^DIC",231.9,231.9,"%D",2,0)
+tracking software.  It also contains XML descriptions that are used by 
+"^DIC",231.9,231.9,"%D",3,0)
+the client display board software to control column appearance, row 
+"^DIC",231.9,231.9,"%D",4,0)
+content, and cell color.
+"^DIC",231.9,"B","TRACKING AREA",231.9)
+
+"^DIC",233.1,233.1,0)
+TRACKING CODE^233.1
+"^DIC",233.1,233.1,0,"GL")
+^EDPB(233.1,
+"^DIC",233.1,233.1,"%D",0)
+^^3^3^3080922^
+"^DIC",233.1,233.1,"%D",1,0)
+This file contains entries that are used in selection lists within the 
+"^DIC",233.1,233.1,"%D",2,0)
+tracking software.  The entries for these selection lists may eventually 
+"^DIC",233.1,233.1,"%D",3,0)
+be rolled up for reporting to the Emergency Department director.
+"^DIC",233.1,"B","TRACKING CODE",233.1)
+
+"^DIC",233.2,233.2,0)
+TRACKING CODE SET^233.2
+"^DIC",233.2,233.2,0,"GL")
+^EDPB(233.2,
+"^DIC",233.2,233.2,"%D",0)
+^^3^3^3080922^
+"^DIC",233.2,233.2,"%D",1,0)
+This file contains collections of codes that represent a specific 
+"^DIC",233.2,233.2,"%D",2,0)
+selection list (acuities, patient statuses, dispositions, delay reasons, 
+"^DIC",233.2,233.2,"%D",3,0)
+etc.) used within the patient tracking software.
+"^DIC",233.2,"B","TRACKING CODE SET",233.2)
+
+**END**
+**END**
