The source configuration screen for the Hach WIMS Direct Server-Side Interface to Perkin Elmer Labworks LIMS is used to define the connection to the LIMS database and set options for how data is imported.
In order to configure source connection from the interface, click Configuration and select Source Configuration.
The next screen will display parameters on two tabs. The first is Database Connection:
The second tab is Advanced Settings:
Sample Validation - We want records where the sample has been validated (not just individual results). Labworks sets the Sample.VALUSER when the Sample is verified. Depending on your version of Labworks and your labs particular workflow you can use either the SAMPLE.VALDATE or the RESULT.RMODDATE to detect modified records for import. Example query to retrieve records from the LIMS:
Use VALDATE:
MS SQL Server Example:
SELECT SAMPLE.SAMPNO, SAMPLE.COLDATE, RESULT.RESULT, RESULT.RESULT2,RESULT.RLTUNIT as UNITS, RESULT.QUALIFY,SAMPLE.LOCCODE, RESULT.ACODE, RESULT.ANALYTE as ANALYTE, RESULT.RMODDATE, SAMPLE.VALUSER as VALIDATION from DBO.SAMPLE, DBO.RESULT where SAMPLE.SAMPNO=RESULT.SAMPNO and SAMPLE.VALDATE >= '2012-02-28 00:00:00' and SAMPLE.VALDATE < '2012-02-29 00:00:00' ORDER BY SAMPLE.SAMPNO, SAMPLE.VALDATE
Oracle Example:
SELECT SAMPLE.SAMPNO, SAMPLE.COLDATE, RESULT.RESULT, RESULT.RESULT2,ANL_LIST.AUNIT as UNITS, RESULT.QUALIFY,SAMPLE.LOCCODE, RESULT.ACODE, RESULT.ANALYTE as ANALYTE, RESULT.RMODDATE, SAMPLE.VALUSER as VALIDATION from LABWORKS.SAMPLE, LABWORKS.RESULT, LABWORKS.ANL_LIST where SAMPLE.SAMPNO=RESULT.SAMPNO and RESULT.ACODE=ANL_LIST.ACODE and SAMPLE.VALDATE >= TO_DATE('04-Mar-2012 12:00:00 AM', 'dd-Mon-yyyy HH:MI:SS AM') and SAMPLE.VALDATE < TO_DATE('05-Mar-2012 12:00:00 AM', 'dd-Mon-yyyy HH:MI:SS AM') ORDER BY SAMPLE.SAMPNO, SAMPLE.VALDATE
Use RMODDATE:
MS SQL Server Example:
SELECT SAMPLE.SAMPNO, SAMPLE.COLDATE, RESULT.RESULT, RESULT.RESULT2,RESULT.RLTUNIT as UNITS, RESULT.QUALIFY,SAMPLE.LOCCODE, RESULT.ACODE, RESULT.ANALYTE as ANALYTE, RESULT.RMODDATE, SAMPLE.VALUSER as VALIDATION from DBO.SAMPLE, DBO.RESULT where SAMPLE.SAMPNO=RESULT.SAMPNO and RESULT.RMODDATE >= '2012-02-28 00:00:00' and RESULT.RMODDATE < '2012-02-29 00:00:00' ORDER BY SAMPLE.SAMPNO, RESULT.RMODDATE
Oracle Example:
SELECT SAMPLE.SAMPNO, SAMPLE.COLDATE, RESULT.RESULT, RESULT.RESULT2,ANL_LIST.AUNIT as UNITS, RESULT.QUALIFY,SAMPLE.LOCCODE, RESULT.ACODE, RESULT.ANALYTE as ANALYTE, RESULT.RMODDATE, SAMPLE.VALUSER as VALIDATION from LABWORKS.SAMPLE, LABWORKS.RESULT, LABWORKS.ANL_LIST where SAMPLE.SAMPNO=RESULT.SAMPNO and RESULT.ACODE=ANL_LIST.ACODE and RESULT.RMODDATE >= TO_DATE('04-Mar-2012 12:00:00 AM', 'dd-Mon-yyyy HH:MI:SS AM') and RESULT.RMODDATE < TO_DATE('05-Mar-2012 12:00:00 AM', 'dd-Mon-yyyy HH:MI:SS AM') ORDER BY SAMPLE.SAMPNO, RESULT.RMODDATE
Analysis Validation is selected (or Import Unvalidated Results is YES or blank), then ANALYSIS.AVALUSER field will be used to verify validation.
Use AVALDATE:
MS SQL Server Example:
SELECT SAMPLE.SAMPNO, SAMPLE.COLDATE, RESULT.RESULT, RESULT.RESULT2,RESULT.RLTUNIT as UNITS, RESULT.QUALIFY,SAMPLE.LOCCODE, RESULT.ACODE, RESULT.ANALYTE as ANALYTE, ANALYSIS.AVALDATE,ANALYSIS.AVALUSER as VALIDATION from SAMPLE, RESULT, ANALYSIS where (SAMPLE.SAMPNO=RESULT.SAMPNO and SAMPLE.SAMPNO=ANALYSIS.SAMPNO and ANALYSIS.ACODE=RESULT.ACODE) and ANALYSIS.AVALDATE >= '2012-02-28 00:00:00' and ANALYSIS.AVALDATE < '2012-02-29 00:00:00' ORDER BY SAMPLE.SAMPNO, ANALYSIS.AVALDATE
Oracle Example:
SELECT SAMPLE.SAMPNO, SAMPLE.COLDATE, RESULT.RESULT, RESULT.RESULT2,ANL_LIST.AUNIT as UNITS, RESULT.QUALIFY,SAMPLE.LOCCODE, RESULT.ACODE, RESULT.ANALYTE as ANALYTE, ANALYSIS.AVALDATE,ANALYSIS.AVALUSER as VALIDATION from LABWORKS.SAMPLE, LABWORKS.RESULT, LABWORKS.ANALYSIS, LABWORKS.ANL_LIST where (SAMPLE.SAMPNO=RESULT.SAMPNO and RESULT.ACODE=ANL_LIST.ACODE and SAMPLE.SAMPNO=ANALYSIS.SAMPNO and ANALYSIS.ACODE=RESULT.ACODE) and ANALYSIS.AVALDATE >= TO_DATE('04-Mar-2012 12:00:00 AM', 'dd-Mon-yyyy HH:MI:SS AM') and ANALYSIS.AVALDATE < TO_DATE('05-Mar-2012 12:00:00 AM', 'dd-Mon-yyyy HH:MI:SS AM') ORDER BY SAMPLE.SAMPNO, ANALYSIS.AVALDATE
Use RMODDATE:
MS SQL Server Example:
SELECT SAMPLE.SAMPNO, SAMPLE.COLDATE, RESULT.RESULT, RESULT.RESULT2,RESULT.RLTUNIT as UNITS, RESULT.QUALIFY,SAMPLE.LOCCODE, RESULT.ACODE, RESULT.ANALYTE as ANALYTE, RESULT.RMODDATE,ANALYSIS.AVALUSER as VALIDATION from SAMPLE, RESULT, ANALYSIS where (SAMPLE.SAMPNO=RESULT.SAMPNO and SAMPLE.SAMPNO=ANALYSIS.SAMPNO and ANALYSIS.ACODE=RESULT.ACODE) and RESULT.RMODDATE >= '2012-02-28 00:00:00' and RESULT.RMODDATE < '2012-02-29 00:00:00' ORDER BY SAMPLE.SAMPNO, RESULT.RMODDATE
Oracle Example: SELECT SAMPLE.SAMPNO, SAMPLE.COLDATE, RESULT.RESULT, RESULT.RESULT2,ANL_LIST.AUNIT as UNITS, RESULT.QUALIFY,SAMPLE.LOCCODE, RESULT.ACODE, RESULT.ANALYTE as ANALYTE, RESULT.RMODDATE,ANALYSIS.AVALUSER as VALIDATION from LABWORKS.SAMPLE, LABWORKS.RESULT, LABWORKS.ANALYSIS, LABWORKS.ANL_LIST where (SAMPLE.SAMPNO=RESULT.SAMPNO and RESULT.ACODE=ANL_LIST.ACODE and SAMPLE.SAMPNO=ANALYSIS.SAMPNO and ANALYSIS.ACODE=RESULT.ACODE) and RESULT.RMODDATE >= TO_DATE('04-Mar-2012 12:00:00 AM', 'dd-Mon-yyyy HH:MI:SS AM') and RESULT.RMODDATE < TO_DATE('05-Mar-2012 12:00:00 AM', 'dd-Mon-yyyy HH:MI:SS AM') ORDER BY SAMPLE.SAMPNO, RESULT.RMODDATE
-
Source Tables Owner - Owner or schema (Oracle) of the Labworks database tables.
- Units Table - Sets where to get the units for the result from. Set to RESULT to use the RESULT.UNITS field, or set to ANL_LIST to use the ANL_LIST.UNITS field. The units are used when Units Conversion option is enabled.
- Ignore Case when matching between Source Identifiers and WIMS Variable Cross References - enable this setting when you need to ignore case during matching to WIMS variable cross references.
-
Import Hach WIMS Comments - Enables or disables importing of comments into Hach WIMS Result Comments. Comments can come from two sources, the Labworks COMMENTS.COMMENTS field and/or invalid results. For example, we combine the Labworks RESULT.QUALIFY and RESULT.RESULT (or RAWRESULT depending) and import that string as if we are entering that data into WIMS. If value to be import is <2 and ā<ā is a valid symbol (data qualifier) in WIMS the result is imported. If the value to be imported is E2 and āEā is NOT a valid symbol in WIMS no value is imported and a result comment of E2 is created. If a Labworks Comment exists for the Sample/Analyte in the COMMENTS.COMMENTS field and the result is invalid the WIMS Result comment will be set to the invalid result followed by ";" followed by the Labworks Comment (e.g. "E2;Sample is invalid as the hold time was exceeded")
When the Use Custom SQL Query button is clicked, the following appears:
- Reset Default Query button resets the query back to the default query sample:
Select SAMPLE.SAMPNO as SAMPNO, SAMPLE.COLDATE as COLDATE, RESULT.RESULT as RESULT, RESULT.RLTUNIT as UNITS, RESULT.QUALIFY as QUALIFY, SAMPLE.LOCCODE as LOCCODE, RESULT.ACODE as ACODE, RESULT.ANALYTE as ANALYTE, ANALYSIS.AVALDATE as RMODDATE, ANALYSIS.AVALUSER as VALIDATION FROM SAMPLE, RESULT, ANALYSIS WHERE (SAMPLE.SAMPNO=RESULT.SAMPNO and SAMPLE.SAMPNO=ANALYSIS.SAMPNO and ANALYSIS.ACODE=RESULT.ACODE) and SAMPLE.VALDATE>= #SD# and SAMPLE.VALDATE < #ED# order by SAMPLE.SAMPNO, SAMPLE.VALDATE
NOTE: In order to import data from the following fields into additional info fields, they must be added to your custom query:
- RESULT.MDL
- RESULT.PQL
- RESULT.StartDate
- RESULT.EndDate
- RESULT.RESULT2
- RESULT.Analyst
For example: SELECT RESULT.MDL, RESULT.PQL, RESULT.StartDate, RESULT.Analyst, SAMPLE.SAMPNO as SAMPNO, SAMPLE.COLDATE as COLDATE ......
NOTE: The RESULT.PQL field is not in all Labworks databases!
Example query when Import Hach WIMS Comments is enabled.
In order to import the Labworks comments, you MUST add a comments field into the query:
Select SAMPLE.SAMPNO as SAMPNO, COMMENTS.COMMENTS, SAMPLE.COLDATE as COLDATE, RESULT.RESULT as RESULT, RESULT.RLTUNIT as UNITS, RESULT.QUALIFY as QUALIFY, SAMPLE.LOCCODE as LOCCODE, RESULT.ACODE as ACODE, RESULT.ANALYTE as ANALYTE, ANALYSIS.AVALDATE as RMODDATE, ANALYSIS.AVALUSER as VALIDATION FROM SAMPLE, ANALYSIS, RESULT LEFT OUTER JOIN COMMENTS ON RESULT.SAMPNO=COMMENTS.SAMPNO and RESULT.ACODE = COMMENTS.ACODE WHERE (SAMPLE.SAMPNO=RESULT.SAMPNO and SAMPLE.SAMPNO=ANALYSIS.SAMPNO and ANALYSIS.ACODE=RESULT.ACODE) and SAMPLE.VALDATE>= #SD# and SAMPLE.VALDATE < #ED# order by SAMPLE.SAMPNO, SAMPLE.VALDATE
Using UserDefined1 and UserDefined2 as Additional Info fields in the Custom Query
You can map any field in the database to an Additional Info field using the UserDefined1 and UserDefined2 fields. For example, to import data from the SAMPLE.SAMPCOL field you would add the field to your query aliased as UserDefined1:
Select SAMPLE.SAMPNO as SAMPNO, SAMPLE.SAMPCOL as USERDEFINED1, SAMPLE.COLDATE AS ...
Test button will test the query and return up to 500 records and will let you know if the query will work, or report where it will have problems.
When you have a successful SQL Query, you will see the following message:
NOTE: The following must have fields associated with them: RESULT, COLDATE, LOCCODE, ANALYTE, ACODE, UNITS, VALIDATION, SAMPNO, and RMODDATE. Also there must be at least one #SD# which signifies the start date parameter, and at least one #ED# which signifies the end date parameter.
The message box between Test button and Hide Test Results button will display an error if any fields are missing. For example, the following screen shows that we do not have a field identified for COLDATE:
RULES
Rules are used to fix results/qualifiers that are in a different format from WIMS. Typically, it is used to replace results to match what WIMS needs. Examples:
- The table contains a 0 (zero) for E COLI results, WIMS has a text variable that expects an "A" (Absent). The first rule will convert the zero(s) to A for Analytes equal to E COLI.
- The second rule handles values from the lab such as L 0.45 which means <0.45. Notice also the space between the L and 0.45. To specify leading or trailing spaces use <sp>. So L 0.45 will be imported as <0.45
- The third rule will look for a " I" after the result value (0.45 I). <mdl> in the with column tells the rule to use the MDL value for the result.
- The fourth rule will look for a " U" after the result value (0.45 U). The < in the with column will be placed before the result value. Result will be <0.45.
When specifying, the value "Anything" means all records will be looked at. If you need to also replace zeros with A for Total Coliform, you would need to add the rule for Total Coliform as you would not want to change all zeros to A.
|
|
|
|
No Related Articles Available.
|
|
|
|
No Attachments Available.
|
|
|
|
No Related Links Available.
|
|
|
|
|
|
|
No user comments available for this article.
|
|
|
|
|
|
Created on 6/25/2009 12:01 PM. |
|
Last Modified on 8/13/2020 12:09 PM. |
|
Last Modified by Steve Fifer. |
|
Article has been viewed 7488 times. |
|
Rated 8 out of 10 based on 12 votes. |
|
Print Article |
|
Email Article
|
|
|