TITAN® LIMS by Accelerated Technology Laboratories, Inc. (ATL) hosts data in a Microsoft SQL (Oracle is also supported).
Source query:
Select ISNULL(QUALIFIER,'') + REPORTEDVALUE AS FINAL,MEASUREDVALUE, Titan.Result.ReportingUnitId AS UNITS,ANALYTEIDENTIFIER.Name AS ANALYTE, SITE.Name AS SAMPLOC, SAMPLENUMBER as SAMPNUM, RESULT.EnteredBy AS ANALYZEDBY, COLLECTDATETIMEEND AS SAMPDATE, LastModifiedDateTime, EnteredDateTime, IIF(Result.StateID=135,-1024,0) AS RESULTSTATUS FROM TITAN.Sample, Titan.Result, Titan.Site, TItan.ANALYTEIDENTIFIER, TITAN.Aliquot, Titan.Container, Titan.Analyte WHERE RESULT.AliquotId = Aliquot.AliquotId AND Aliquot.ContainerId = Container.ContainerId AND Container.SampleId = SAMPLE.SAMPLEID AND SAMPLE.SITEID = SITE.SITEID AND RESULT.ANALYTEID = ANALYTE.AnalyteId and ANALYTE.ANALYTEIDENTIFIERID = ANALYTEIDENTIFIER. ANALYTEIDENTIFIERID AND IIF(Lastmodifieddatetime is null, IIF(entereddatetime is null, Analysisdate,entereddatetime), Lastmodifieddatetime) BETWEEN DATEADD(d,-14,#SD#) AND #ED# AND (RESULT.Stateid =135 or Result.Stateid = 136) AND ReportedValue is not null
NOTES:
We found that in some cases the LastModifiedDateTime and EnteredDateTime were both null. Therefore, we used the following as a workaround:
IIF(Lastmodifieddatetime is null, IIF(entereddatetime is null, Analysisdate,entereddatetime), Lastmodifieddatetime) BETWEEN DATEADD(d,-14,#SD#) AND #ED#
ISNULL(QUALIFIER,'') + REPORTEDVALUE as FINAL combines the qualifier with the ReportedValue. The ISNULL is needed to handle null values in the Qualifier field. Without isNULL function NULL + 7 = NULL. With IsNull function it becomes 7.
Stateid = 135 and 136 are site specific. In this case 135 meant validated (which we mapped to -1024, unapproved data status in WIMS) and 136 meant approved. You will need to work with the LIMS Admin to get the site specific stateids.