From 96a70e69c91c3b5d5c2715c3ddc43953d8bd1a0e Mon Sep 17 00:00:00 2001 From: "Karl O. Pinc kop@karlpinc.com" Date: Sun, 7 Jun 2026 01:45:37 +0000 Subject: [PATCH] Create, document, index, and trigger REPRO_STATES --- db/schemas/lib/triggers/Makefile | 3 +- .../lib/triggers/create/biography_data.m4 | 99 ++++++++++ .../lib/triggers/create/repro_states.m4 | 140 ++++++++++++++ db/schemas/lib/triggers/drop/repro_states.m4 | 23 +++ db/schemas/sokwedb/indexes/Makefile | 2 +- .../sokwedb/indexes/create/repro_states.m4 | 42 +++++ .../sokwedb/indexes/drop/repro_states.m4 | 32 ++++ db/schemas/sokwedb/tables/Makefile | 3 +- .../sokwedb/tables/create/repro_states.m4 | 47 +++++ doc/src/analyzed.m4 | 1 + doc/src/analyzed/repro_states.m4 | 178 ++++++++++++++++++ doc/src/epilog.inc.m4 | 20 ++ include/global_constants.m4 | 10 + 13 files changed, 597 insertions(+), 3 deletions(-) create mode 100644 db/schemas/lib/triggers/create/repro_states.m4 create mode 100644 db/schemas/lib/triggers/drop/repro_states.m4 create mode 100644 db/schemas/sokwedb/indexes/create/repro_states.m4 create mode 100644 db/schemas/sokwedb/indexes/drop/repro_states.m4 create mode 100644 db/schemas/sokwedb/tables/create/repro_states.m4 create mode 100644 doc/src/analyzed/repro_states.m4 diff --git a/db/schemas/lib/triggers/Makefile b/db/schemas/lib/triggers/Makefile index f6b77aa..450db80 100644 --- a/db/schemas/lib/triggers/Makefile +++ b/db/schemas/lib/triggers/Makefile @@ -42,7 +42,8 @@ ORDER := comm_ids \ arrivals_a \ swelling_sources \ humans \ - species_present + species_present \ + repro_states DROP_EXISTING := true diff --git a/db/schemas/lib/triggers/create/biography_data.m4 b/db/schemas/lib/triggers/create/biography_data.m4 index d3a84ee..a351f71 100644 --- a/db/schemas/lib/triggers/create/biography_data.m4 +++ b/db/schemas/lib/triggers/create/biography_data.m4 @@ -664,6 +664,105 @@ CREATE OR REPLACE FUNCTION biography_data_func () END IF; END; + -- REPRO_STATES + DECLARE + a_reid repro_states.reid%TYPE; + a_date repro_states.date%TYPE; + a_state repro_states.state%TYPE; + a_source repro_states.source%TYPE; + a_estrusday repro_states.estrusday%TYPE; + a_estrusdaycert repro_states.estrusdaycert%TYPE; + a_lactendcert repro_states.lactendcert%TYPE; + a_parity repro_states.parity%TYPE; + + BEGIN + -- The individual must be female to have a record of reproductive state + IF NEW.sex <>'sdb_female' AND + OLD.sex = 'sdb_female' THEN + SELECT repro_states.reid, repro_states.date + , repro_states.state, repro_states.source + , repro_states.estrusday, repro_states.estrusdaycert + , repro_states.lactendcert, repro_states.parity + INTO a_reid , a_date + , a_state , a_source + , a_estrusday , a_estrusdaycert + , a_lactendcert , a_parity + FROM repro_states + WHERE repro_states.animid = NEW.animid + AND repro_states.date < NEW.entrydate + ORDER BY repro_states.date; -- consistency + + IF FOUND THEN + RAISE EXCEPTION integrity_constraint_violation USING + MESSAGE = 'Error on UPDATE of BIOGRAPHY_DATA' + , DETAIL = 'An individual cannot have records of reproductive' + || ' state unless they are female' + || ': Key (Animid) = (' + || NEW.animid + || '), Value (Sex) = (' + || NEW.sex + || ': Key (REPRO_STATES.ID) = (' + || a_reid + || '), Value (REPRO_STATES.Date) = (' + || a_date + || '), Value (State) = (' + || a_state + || '), Value (Source) = (' + || a_source + || '), Value (EstrusDay) = (' + || textualize(`a_estrusday') + || '), Value (EstrusDayCert) = (' + || a_estrusdaycert + || '), Value (LactEndCert) = (' + || a_lactendcert + || '), Value (Parity) = (' + || NEW.parity + || ')'; + END IF; + END IF; + + IF NEW.departdate <> OLD.departdate THEN + SELECT repro_states.reid, repro_states.date + , repro_states.state, repro_states.source + , repro_states.estrusday, repro_states.estrusdaycert + , repro_states.lactendcert, repro_states.parity + INTO a_reid , a_date + , a_state , a_source + , a_estrusday , a_estrusdaycert + , a_lactendcert , a_parity + WHERE repro_states.animid = NEW.animid + AND NEW.departdate < repro_states.date + ORDER BY repro_states.date; -- consistency + IF FOUND THEN + RAISE EXCEPTION integrity_constraint_violation USING + MESSAGE = 'Error on UPDATE of BIOGRAPHY_DATA' + , DETAIL = 'An individual cannot have records of reproductive' + || ' state after they are no longer under study' + || ': Key (Animid) = (' + || NEW.animid + || '), Value (EntryDate) = (' + || NEW.entrydate + || ': Key (REPRO_STATES.ID) = (' + || a_reid + || '), Value (REPRO_STATES.Date) = (' + || a_date + || '), Value (State) = (' + || a_state + || '), Value (Source) = (' + || a_source + || '), Value (EstrusDay) = (' + || textualize(`a_estrusday') + || '), Value (EstrusDayCert) = (' + || a_estrusdaycert + || '), Value (LactEndCert) = (' + || a_lactendcert + || '), Value (Parity) = (' + || NEW.parity + || ')'; + END IF; + END IF; + END; + -- ROLES DECLARE diff --git a/db/schemas/lib/triggers/create/repro_states.m4 b/db/schemas/lib/triggers/create/repro_states.m4 new file mode 100644 index 0000000..df02b11 --- /dev/null +++ b/db/schemas/lib/triggers/create/repro_states.m4 @@ -0,0 +1,140 @@ +dnl Copyright (C) 2026 The Meme Factory, Inc. http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify it +dnl under the terms of the GNU Affero General Public License as published by +dnl the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Triggers for the repro_states table +dnl +dnl Karl O. Pinc + +dnl m4 includes +include(`copyright.m4')dnl +include(`constants.m4')dnl +include(`macros.m4')dnl + + +RAISE INFO 'repro_states_func'; +CREATE OR REPLACE FUNCTION repro_states_func () + RETURNS trigger + LANGUAGE plpgsql + sdb_function_set_search_path + AS $$ + BEGIN + -- Function for repro_states insert and update triggers + -- + -- AGPL_notice(` --', `2026', + `The Meme Factory, Inc., www.karlpinc.com') + + IF TG_OP = 'UPDATE' THEN + cannot_change(`REPRO_STATES', `ReID') + END IF; + + -- An individual must be female. + IF TG_OP = 'INSERT' THEN + DECLARE + a_sex biography_data.sex%TYPE; + + BEGIN + SELECT biography_data.sex + INTO a_sex + FROM biography_data + WHERE biography_data.animid = NEW.animid + AND biography_data.sex <> 'sdb_female'; + IF FOUND THEN + RAISE EXCEPTION integrity_constraint_violation USING + MESSAGE = 'Error on ' || TG_OP || ' of REPRO_STATES' + , DETAIL = 'An individual must be female to have' + || ' a swelling measurement' + || ': Key (ReID) = (' + || NEW.reid + || '), Value (AnimID) = (' + || NEW.animid + || '), Value (Date) = (' + || NEW.date + || '), Value (State) = (' + || NEW.state + || '), Value (Source) = (' + || NEW.source + || '), Value (EstrusDay) = (' + || textualize(`NEW.estrusday') + || '), Value (EstrusDayCert) = (' + || NEW.estrusdaycert + || '), Value (LactEndCert) = (' + || NEW.lactendcert + || '), Value (Parity) = (' + || NEW.parity + || '), Value (BIOGRAPHY_DATA.Sex) = (' + || a_sex + || ')'; + END IF; + END; + END IF; + + IF TG_OP = 'INSERT' + OR NEW.date <> OLD.date THEN + DECLARE + a_entrydate biography_data.entrydate%TYPE; + a_departdate biography_data.departdate%TYPE; + + BEGIN + SELECT biography_data.entrydate, biography_data.departdate + INTO a_entrydate , a_departdate + FROM biography_data + WHERE biography_data.animid = NEW.animid + AND (NEW.date < biography_data.entrydate + OR NEW.date > biography_data.departdate); + IF FOUND THEN + RAISE EXCEPTION integrity_constraint_violation USING + MESSAGE = 'Error on ' || TG_OP || ' of REPRO_STATES' + , DETAIL = 'An individual must be under study to have' + || ' a swelling measurement,' + || ' the REPRO_STATES.Date cannot be before' + || ' BIOGRAPHY_DATA.EntryDate or after' + || ' BIOGRAPHY_DATA.DepartDate' + || ': Key (ReID) = (' + || NEW.reid + || '), Value (AnimID) = (' + || NEW.animid + || '), Value (Date) = (' + || NEW.date + || '), Value (State) = (' + || NEW.state + || '), Value (Source) = (' + || NEW.source + || '), Value (EstrusDay) = (' + || textualize(`NEW.estrusday') + || '), Value (EstrusDayCert) = (' + || NEW.estrusdaycert + || '), Value (LactEndCert) = (' + || NEW.lactendcert + || '), Value (Parity) = (' + || NEW.parity + || '), Value (BIOGRAPHY_DATA.EntryDate) = (' + || a_entrydate + || '), Value (BIOGRAPHY_DATA.DepartDate) = (' + || a_departdate + || ')'; + END IF; + END; + END IF; + + RETURN NULL; + END; +$$; + + +RAISE INFO 'repro_states_trigger'; +CREATE TRIGGER repro_states_trigger + AFTER INSERT OR UPDATE + ON repro_states FOR EACH ROW + EXECUTE PROCEDURE repro_states_func(); diff --git a/db/schemas/lib/triggers/drop/repro_states.m4 b/db/schemas/lib/triggers/drop/repro_states.m4 new file mode 100644 index 0000000..057d0d6 --- /dev/null +++ b/db/schemas/lib/triggers/drop/repro_states.m4 @@ -0,0 +1,23 @@ +dnl Copyright (C) 2026 The Meme Factory, Inc. http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU Affero General Public License as published by +dnl the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Drop triggers for repro_states table +dnl +dnl Karl O. Pinc + +dnl m4 includes +include(`copyright.m4')dnl + +DROP FUNCTION IF EXISTS repro_states_func() CASCADE; diff --git a/db/schemas/sokwedb/indexes/Makefile b/db/schemas/sokwedb/indexes/Makefile index 5e56aa5..a1bd3a9 100644 --- a/db/schemas/sokwedb/indexes/Makefile +++ b/db/schemas/sokwedb/indexes/Makefile @@ -23,7 +23,7 @@ ORDER := biography_data biography_log comm_membs comm_memb_log \ follows follow_observers follow_studies events roles arrivals \ swelling_sources swelling_states aggression_event_log sightings \ aggressions food_events groomings attendance \ - arrivals_a species_present + arrivals_a species_present repro_states ## ## CAUTION: This Makefile is not designed to be run directly. It is normally diff --git a/db/schemas/sokwedb/indexes/create/repro_states.m4 b/db/schemas/sokwedb/indexes/create/repro_states.m4 new file mode 100644 index 0000000..8665fd1 --- /dev/null +++ b/db/schemas/sokwedb/indexes/create/repro_states.m4 @@ -0,0 +1,42 @@ +dnl Copyright (C) 2026 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU Affero General Public License as published +dnl by the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Karl O. Pinc +dnl +dnl +dnl m4 includes +include(`copyright.m4')dnl +include(`constants.m4')dnl +include(`indexmacros.m4')dnl + +CREATE INDEX IF NOT EXISTS repro_states_animid ON repro_states + (animid); +CREATE INDEX IF NOT EXISTS repro_states_date ON repro_states + (date); +CREATE INDEX IF NOT EXISTS repro_states_state ON repro_states + (state); +CREATE INDEX IF NOT EXISTS repro_states_source ON repro_states + (source); +CREATE INDEX IF NOT EXISTS repro_states_estrusday ON repro_states + (estrusday); +CREATE INDEX IF NOT EXISTS repro_states_estrusdaycert ON repro_states + (estrusdaycert); +CREATE INDEX IF NOT EXISTS repro_states_lactendcert ON repro_states + (lactendcert); +CREATE INDEX IF NOT EXISTS repro_states_parity ON repro_states + (parity); + + + diff --git a/db/schemas/sokwedb/indexes/drop/repro_states.m4 b/db/schemas/sokwedb/indexes/drop/repro_states.m4 new file mode 100644 index 0000000..441ede1 --- /dev/null +++ b/db/schemas/sokwedb/indexes/drop/repro_states.m4 @@ -0,0 +1,32 @@ +dnl Copyright (C) 2025, 2026 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU Affero General Public License as published +dnl by the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Karl O. Pinc +dnl +dnl +dnl m4 includes +include(`copyright.m4')dnl +include(`constants.m4')dnl +include(`indexmacros.m4')dnl + +DROP INDEX IF EXISTS repro_states_animid; +DROP INDEX IF EXISTS repro_states_date; +DROP INDEX IF EXISTS repro_states_state; +DROP INDEX IF EXISTS repro_states_source; +DROP INDEX IF EXISTS repro_states_estrusday; +DROP INDEX IF EXISTS repro_states_estrusdaycert; +DROP INDEX IF EXISTS repro_states_lactendcert; +DROP INDEX IF EXISTS repro_states_parity; + diff --git a/db/schemas/sokwedb/tables/Makefile b/db/schemas/sokwedb/tables/Makefile index 254caac..881008f 100644 --- a/db/schemas/sokwedb/tables/Makefile +++ b/db/schemas/sokwedb/tables/Makefile @@ -42,7 +42,8 @@ ORDER := biography_data \ food_events \ groomings \ groom_scans_b \ - arrivals_a + arrivals_a \ + repro_states ## ## CAUTION: This Makefile is not designed to be run directly. It is normally ## invoked by another Makefile. diff --git a/db/schemas/sokwedb/tables/create/repro_states.m4 b/db/schemas/sokwedb/tables/create/repro_states.m4 new file mode 100644 index 0000000..4f96ef0 --- /dev/null +++ b/db/schemas/sokwedb/tables/create/repro_states.m4 @@ -0,0 +1,47 @@ +dnl Copyright (C) 2026 The Meme Factory, Inc., http://www.karlpinc.com/ +dnl +dnl This program is free software: you can redistribute it and/or modify +dnl it under the terms of the GNU Affero General Public License as published +dnl by the Free Software Foundation, either version 3 of the License, or +dnl (at your option) any later version. +dnl +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +dnl GNU Affero General Public License for more details. +dnl +dnl You should have received a copy of the GNU Affero General Public License +dnl along with this program. If not, see . +dnl +dnl Karl O. Pinc +dnl +dnl +dnl m4 includes +include(`copyright.m4')dnl +include(`constants.m4')dnl +include(`tablemacros.m4')dnl +include(`grants.m4')dnl +dnl + +CREATE TABLE repro_states ( + key_column(`REPRO_STATES', `ReID', `INT') + ,animid_column() + ,date DATE NOT NULL + ,state TEXT NOT NULL + CONSTRAINT + "State must be one of: sdb_cycling, sdb_pregnant, sdb_lactating" + CHECK (state = 'sdb_cycling' + OR state = 'sdb_pregnant' + OR state = 'sdb_lactating') + ,source TEXT NOT NULL + REFERENCES repro_state_change_sources + ,estrusday INTEGER + ,estrusdaycert TEXT NOT NULL + REFERENCES ed_certainties + ,lactendcert TEXT NOT NULL + REFERENCES le_certainties + ,parity TEXT NOT NULL + REFERENCES parities +); + +grant_priv(`REPRO_STATES') diff --git a/doc/src/analyzed.m4 b/doc/src/analyzed.m4 index 6ca9baf..f444ffd 100644 --- a/doc/src/analyzed.m4 +++ b/doc/src/analyzed.m4 @@ -31,5 +31,6 @@ a rudimentary analytical process. .. toctree:: :maxdepth: 3 + analyzed/repro_states.rst analyzed/swelling_states.rst analyzed/sightings.rst diff --git a/doc/src/analyzed/repro_states.m4 b/doc/src/analyzed/repro_states.m4 new file mode 100644 index 0000000..44b4a7b --- /dev/null +++ b/doc/src/analyzed/repro_states.m4 @@ -0,0 +1,178 @@ +.. Copyright (C) 2026 The Meme Factory, Inc. www.karlpinc.com + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as + published by the Free Software Foundation, either version 3 of the + License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +.. M4 setup +include(constants.m4)dnl +include(macros.m4)dnl +sdb_rst_quotes(`on')dnl +sdb_generated_rst()dnl + +.. _REPRO_STATES: + +REPRO_STATES +--------------- + +.. |REPRO_STATES_summary| replace:: + + REPRO_STATES contains one row for each female chimpanzee + for every day the individual's reproductive state was analyzed. + It tracks whether the female was cycling, pregnant, or lacting + and where each female is within her reproductive cycle. + +|REPRO_STATES_summary| +This table is maintained manually. + +Each female is required to be under study on the date given. +This means that the |REPRO_STATES|.\ |REPRO_STATES.Date| must be +between the |REPRO_STATES.AnimID|'s |BIOGRAPHY_DATA|.\ +|BIOGRAPHY_DATA.EntryDate| and their |BIOGRAPHY_DATA|.\ +|BIOGRAPHY_DATA.DepartDate|, inclusive of endpoints. + + +.. contents:: + :depth: 2 + + +.. _REPRO_STATES.ReID: + +ReID (REproductive State IDentifier) +```````````````````````````````````` + +.. |REPRO_STATES.ReID_summary| replace:: + |idcol| + +|REPRO_STATES.ReID_summary| |notnull| + + +.. _REPRO_STATES.AnimID: + +AnimID (Animal IDentifier) +`````````````````````````` + +.. |REPRO_STATES.AnimID_summary| replace:: + The |BIOGRAPHY_DATA|.\ |BIOGRAPHY_DATA.AnimID| of the individual + who's reproductive state was analyzed. + +|REPRO_STATES.AnimID_summary| |notnull| + + +.. _REPRO_STATES.Date: + +Date +```` + +.. |REPRO_STATES.Date_summary| replace:: + The date of the individual's reproductive state information. + +|REPRO_STATES.Date_summary| |notnull| + + +.. _REPRO_STATES.State: + +State +````` + +.. |REPRO_STATES.State_summary| replace:: + The female's reproductive state on the given day. + One of the values: ``sdb_cycling``, ``sdb_pregnant``, or ``sdb_lactating``. + +|REPRO_STATES.State_summary| + +The reproductive state codes are:: + + ``sdb_cycling`` Cycling + + ``sdb_pregnant`` Pregnant + + ``sdb_lactating`` Lactating + +|notnull| + + +.. _REPRO_STATES.Source: + +Source (reproductive state SOURCE) +`````````````````````````````````` + +.. |REPRO_STATES.Source_summary| replace:: + A code categorizing the source of a change in reproductive state. + A |REPRO_STATE_CHANGE_SOURCES|.\ |REPRO_STATE_CHANGE_SOURCES.Code| value. + +|REPRO_STATES.Source_summary| + +|notnull| + + +.. _REPRO_STATES.EstrusDay: + +EstrusDay (DAY of current ESTRUS cycle) +``````````````````````````````````````` + +.. |REPRO_STATES.EstrusDay_summary| replace:: + A number that is usually between ``-14`` and ``0``, representing the + number of days before full detumescence, which is day ``0``. + +|REPRO_STATES.EstrusDay_summary| +Despite the forgoing, there are no restrictions placed on the values +allowed in this column, nor does the system check that the individual +is cycling on the given day. + +This column may be |null| when there is no analysis of number of days +before full detumensence or when the date is such that a number lacks +meaning. + + +.. _REPRO_STATES.EstrusDayCert: + +EstrusDayCert (CERTainty of EstrusDay) +`````````````````````````````````````` + +.. |REPRO_STATES.EstrusDayCert_summary| replace:: + Certainty that the days before full detumensence are numbered + correctly. + An |ED_CERTAINTIES|.\ |ED_CERTAINTIES.Code| value. + +|REPRO_STATES.EstrusDayCert_summary| + +|notnull| + + +.. _REPRO_STATES.LactEndCert: + +LactEndCert (LACTation END CERTainty) +````````````````````````````````````` + +.. |REPRO_STATES.LactEndCert_summary| replace:: + Categorizes the certainty of the swelling used to determine the end + of lactational amenorrhea. + A |LE_CERTAINTIES|.\ |LE_CERTAINTIES.Code| value. + +|REPRO_STATES.LactEndCert_summary| + +|notnull| + + +.. _REPRO_STATES.Parity: + +Parity +`````` + +.. |REPRO_STATES.Parity_summary| replace:: + A code categorizing the parity of the female on the given date. + A |PARITIES|.\ |PARITIES.Code| value. + +|REPRO_STATES.Parity_summary| + +|notnull| diff --git a/doc/src/epilog.inc.m4 b/doc/src/epilog.inc.m4 index 51ffb62..f19c2cd 100644 --- a/doc/src/epilog.inc.m4 +++ b/doc/src/epilog.inc.m4 @@ -456,6 +456,26 @@ sdb_generated_rst()dnl .. |PEOPLE.Description| replace:: :ref:`Description ` .. |PEOPLE.Active| replace:: :ref:`Active ` +.. |REPRO_STATES| replace:: :ref:`REPRO_STATES ` +.. |REPRO_STATES.ReID| replace:: + :ref:`ReID ` +.. |REPRO_STATES.AnimID| replace:: + :ref:`AnimID ` +.. |REPRO_STATES.Date| replace:: + :ref:`Date ` +.. |REPRO_STATES.State| replace:: + :ref:`State ` +.. |REPRO_STATES.Source| replace:: + :ref:`Source ` +.. |REPRO_STATES.EstrusDay| replace:: + :ref:`EstrusDay ` +.. |REPRO_STATES.EstrusDayCert| replace:: + :ref:`EstrusDayCert ` +.. |REPRO_STATES.LactEndCert| replace:: + :ref:`LactEndCert ` +.. |REPRO_STATES.Parity| replace:: + :ref:`Parity ` + .. |REPRO_STATE_CHANGE_SOURCES| replace:: :ref:`REPRO_STATE_CHANGE_SOURCES ` .. |REPRO_STATE_CHANGE_SOURCES.Code| replace:: diff --git a/include/global_constants.m4 b/include/global_constants.m4 index adb8316..96a28f3 100644 --- a/include/global_constants.m4 +++ b/include/global_constants.m4 @@ -141,6 +141,16 @@ dnl The NestStart and NestEnd values define(`sdb_in_nest', `1') define(`sdb_out_of_nest', `0') +dnl +dnl REPRO_STATES +dnl + +dnl A female's possible reproductive states +define(`sdb_cycling', `C') +define(`sdb_pregnant', `P') +define(`sdb_lactating', `L') + + dnl dnl ROLE_CODES dnl -- 2.34.1