Data - Commit - TEST_ID and TEST_ID-1
Copyright © 2019 EarthSoft, Inc • Modified: 05 Mar 2019
EQuIS creates and assigns new TEST_IDs by using the FN_GET_NEXT_ID function. When EQuIS creates a new TEST_ ID, EQuIS pulls the next test value in line and assigns it a TEST_ID not already contained in EQuIS.
If a test record already exists in the database with the same value (not same TEST_ID), then it will not commit. Existing TEST_IDs are found by referencing FACILITY_ID, SAMPLE_ID, ANALYTIC_METHOD, and the Test Alternate Key (TAK, analysis_date, fraction, column_number, test_type).
Most formats will assign a -1 on create if the TEST_ID is not found, meaning that there are no parent records associated with the TEST_RECORD, and will only look in the package and not in the database, so users must submit the sample, test, and result sections together so that a complete TEST_RECORD may be compiled, helping to avoid a -1 TEST_ID.
Duplicate rows with a TEST_ID of -1 can show when the value is not constrained to be unique. This can be related to not having enough Test Alternate Keys (TAKs) selected to make the result unique.
See also: Database - Index (Test Alternate Key)