Open illume opened 2 years ago
Here is an updated procedure to run this and mark its errors in the CMVErrors table! Function's been reviewed with GPT so it should work as intended, but full testing is still pending:
create
definer = azureroot@`%` procedure ValidateScreenMeasuredDiameterMinMax(IN minDBH decimal(10, 2), IN maxDBH decimal(10, 2))
BEGIN
INSERT INTO forestgeo_bci.cmverrors (CoreMeasurementID, ValidationErrorID)
SELECT
CoreMeasurementID,
2 AS ValidationErrorID
FROM
forestgeo_bci.coremeasurements
WHERE
MeasuredDBH < minDBH OR MeasuredDBH > maxDBH;
END;
This is still pending because it needs to be integrated with the species limits table.
See "instructions for writing a validation function". Below are notes from the spec, the original validation function (in the PHP language), and the SQL table structure.
Some was done on this already: see https://github.com/ForestGeoHack/ForestGEO/issues/107#issuecomment-1284336104