From 73ee19d0aa02d3382021b3a70fa943170d9f912e Mon Sep 17 00:00:00 2001 From: kollil Date: Mon, 23 Sep 2024 18:06:44 -0700 Subject: [PATCH 01/24] Sla weaning project. --- sla/resources/queries/sla/weaning/.qview.xml | 18 +++ .../dbscripts/sqlserver/sla-23.002-23.003.sql | 148 ++++++++++++++++++ sla/resources/schemas/sla.xml | 100 ++++++++++++ sla/resources/views/SLA_LandingPage.html | 12 +- sla/src/org/labkey/sla/SLAModule.java | 2 +- 5 files changed, 275 insertions(+), 5 deletions(-) create mode 100644 sla/resources/queries/sla/weaning/.qview.xml create mode 100644 sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql diff --git a/sla/resources/queries/sla/weaning/.qview.xml b/sla/resources/queries/sla/weaning/.qview.xml new file mode 100644 index 000000000..5c41515c0 --- /dev/null +++ b/sla/resources/queries/sla/weaning/.qview.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql new file mode 100644 index 000000000..fe74457ed --- /dev/null +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -0,0 +1,148 @@ +-- ================================================================================================= +--Created by Kollil +--These tables and stored proc was created to enter weaning data into SLA tables +--Refer to ticket #11233 +-- ================================================================================================= + +--Drop table if exists +EXEC core.fn_dropifexists 'weaning','sla','TABLE'; +EXEC core.fn_dropifexists 'TempWeaning','sla','TABLE'; + +--Drop Stored proc if exists +EXEC core.fn_dropifexists 'SLAWeaningDataTransfer', 'sla', 'PROCEDURE'; +GO + +CREATE TABLE sla.weaning ( + rowid int IDENTITY(1,1) NOT NULL, + investigator varchar(250), + date DATETIME, + project INTEGER, + vendorLocation varchar(200), + DOB DATETIME, + DOM DATETIME, + species varchar(100), + sex varchar(100), + strain varchar (200), + numAlive INTEGER, + numDead INTEGER, + totalPups INTEGER, + dateofTransfer DATETIME, + createdBy USERID, + created DATETIME, + modifiedBy USERID, + modified DATETIME, + + CONSTRAINT PK_weaning PRIMARY KEY (rowid) +); + +CREATE TABLE sla.TempWeaning ( + rowid int IDENTITY(1,1) NOT NULL, + investigator varchar(250), + date DATETIME, + project INTEGER, + vendorLocation varchar(200), + DOB DATETIME, + DOM DATETIME, + species varchar(100), + sex varchar(100), + strain varchar (200), + numAlive INTEGER, + created DATETIME +); + +-- Alter the stored proc +/****** Object: StoredProcedure onprc_ehr . SLAWeaningDataTransfer Script Date: 8/24/2024 *****/ +-- ================================================================================= +-- Author: Lakshmi Kolli +-- Create date: 8/24/2024 +-- Description: Create a stored proc to check for any rodents with age of 21 days after the DOB. +-- ================================================================================= + +CREATE PROCEDURE sla.SLAWeaningDataTransfer +AS + +DECLARE + @WCount Int, + @project varchar(100), + @center_project int, + @PI varchar(250), + @investigaorid int, + @vendorlocation varchar(250), + @DOB smalldatetime, + @DOM smalldatetime, + @strain varchar(250), + @sex varchar(100), + @species varchar(100), + @numAlive int, + @numDead int, + @totalPups int, + @dateofTransfer smalldatetime, + @alias varchar(100), + @purchaseId entityid, + @ageindays int, + @count int + +BEGIN + --Check if any rodents that were not recorded in the SLA tables and + Select @WCount = COUNT(*) From sla.weaning + Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, GETDATE(), DOB) >= 21 + + --Found entries, so, insert those records into SLA.purchase and SLA.purchasedetails tables + If @WCount > 0 + Begin + --Delete the rows from temp table before loading new data + Delete From onprc_ehr.Temp_ClnRemarks + + --Move the weaning entries into a temp table + INSERT INTO sla.TempWeaning (investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) + Select investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, GETDATE() From sla.weaning + Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, GETDATE(), DOB) >= 21 + + While @count <= @WCount + Begin + /* Requestorid - (Kati Marshall ) - 7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B + Userid - (Kati Marshall) - 1294 + vendor - (ONPRC Weaning - SLA) - E1EE1B64-B7BE-1035-BFC4-5107380AE41E + Container - (SLA) - 4831D09C-4169-1034-BAD2-5107380A9819 + created - (onprc-is) - 1003 + */ + -- Get projectid , PI and account + Select @center_project = project, @alias = account From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @count) + + --Get the age of the rodent + Select @ageindays = DateDiff(dd, GETDATE(), DOB) From sla.TempWeaning Where rowid = @count + + --Insert weaning data into sla.purchase table as pending order + INSERT INTO sla.purchase + (project, account, requestorid, vendorid, hazardslist, dobrequired, comments , confirmationnum , housingconfirmed, + iacucconfirmed , requestdate , orderdate , orderedby , objectid , container , createdby , created , modifiedby , modified , DARComments , VendorContact ) + Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'','',null,null,null,null,'',NEWID(), + '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' + + --Get the latest purchaseid from sla.purchase + Select top 1 @purchaseid = objectid From sla.purchase order by created desc + + --Get the specis, sex and strain + Select @species = species, @sex = sex, @strain = strain From sla.TempWeaning Where rowid = @count + + --Insert data into purchasedetails with the newly created purchaseid above + INSERT INTO sla.purchaseDetails + (purchaseid, species ,age,weight ,weight_units,gestation,gender,strain,room ,animalsordered ,animalsreceived,boxesquantity,costperanimal,shippingcost, + totalcost,housingInstructions ,requestedarrivaldate ,expectedarrivaldate ,receiveddate ,receivedby ,cancelledby ,datecancelled, + objectid, container, createdby ,created ,modifiedby ,modified ,sla_DOB ,vendorLocation) + VALUES + (@purchaseId, @species ,'','','','',@sex, @strain, '',null,null,null,'','', + '','',null,null,null,'','',null, + NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,null,'') + + SET @count = @count + 1 + End --End while + + --Update the sla.weaning table with the date of transfer date set for the transferred animals + Update sla.weaning + Set dateofTransfer = GETDATE() Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, GETDATE(), DOB) >= 21 + + End +End + +GO \ No newline at end of file diff --git a/sla/resources/schemas/sla.xml b/sla/resources/schemas/sla.xml index 0353a95a8..7c1ec4199 100644 --- a/sla/resources/schemas/sla.xml +++ b/sla/resources/schemas/sla.xml @@ -461,4 +461,104 @@ + + Weaning + DETAILED + + + + + + + + + PI + + + Date + + + Center Project + + + Vendor Location + + + DOB + + + DOM + + + Species + + + Sex + + + Strain + + + Alive Pups + + + Dead Pups + + + Total Pups + + + Date moved to SLA pending orders + + + + + + +
+ + + TempWeaning + DETAILED + + + + + + + + + PI + + + Date + + + Center Project + + + Vendor Location + + + DOB + + + DOM + + + Species + + + Sex + + + Strain + + + Alive Pups + + + +
+ \ No newline at end of file diff --git a/sla/resources/views/SLA_LandingPage.html b/sla/resources/views/SLA_LandingPage.html index 50899e09d..ba6444cf7 100644 --- a/sla/resources/views/SLA_LandingPage.html +++ b/sla/resources/views/SLA_LandingPage.html @@ -5,23 +5,27 @@

SLA Purchase

Click the link below to view the SLA groups & breeding information for the protocols. This information is retrieved daily from the eIACUC database.

SLA Groups & Breeding Information 


+

SLA Weaning

+

SLA weaning module is used by SLAU staff to record the rodent births and documenting the number of animals weaned.
Weaned mice are entered into SLA purchase module as they need to be subtracted from the protocol's SLA allowance numbers.

+

Click here to view/upload the weaning data 

+ +

SLA Census

SLA census module is used by SLAU staff to maintain rodent demographic and location data and billing. Please click on the links below for specific operations.

-
-

Entering Animals

+

Entering Animals:

SLA Census - Entry Screen

SLA Census - Edit Previous Record Menu  - Choose "All Tasks" navigational tab and click the mouse on the task id to edit a record.

SLA Census - Bulk Editing Grid  - Allows editing more than one Census records.

SLA - Entry Grid for Rabbits / Guinea Pigs  - Web link to enter new Rabbits and Guinea Pig records.

-

Entering Charges

+

Entering Charges:

Misc Charges - Grid - This format is best for export to Excel.

Misc Charges - Entry Form

Return to "My Task/All Task" Page 

-

Reports

+

Reports:

SLA Census - Grid

SLA Census - Printed Report - Center Project & Date Range required.

diff --git a/sla/src/org/labkey/sla/SLAModule.java b/sla/src/org/labkey/sla/SLAModule.java index b56b90d7e..51f654a8e 100644 --- a/sla/src/org/labkey/sla/SLAModule.java +++ b/sla/src/org/labkey/sla/SLAModule.java @@ -57,7 +57,7 @@ public String getName() @Override public @Nullable Double getSchemaVersion() { - return 23.002; + return 23.003; } @Override From 4655b3eaa34a96df80d6828256ff56e0398ceb0c Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 24 Sep 2024 12:27:57 -0700 Subject: [PATCH 02/24] Added Go statement after the db tables creation --- sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index fe74457ed..039194ca0 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -50,6 +50,8 @@ CREATE TABLE sla.TempWeaning ( created DATETIME ); +GO + -- Alter the stored proc /****** Object: StoredProcedure onprc_ehr . SLAWeaningDataTransfer Script Date: 8/24/2024 *****/ -- ================================================================================= From 874b37a8ae81f8c66b4f4722651252435f9d80a4 Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 24 Sep 2024 21:30:28 -0700 Subject: [PATCH 03/24] Updated the weaning page link --- sla/resources/views/SLA_LandingPage.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sla/resources/views/SLA_LandingPage.html b/sla/resources/views/SLA_LandingPage.html index ba6444cf7..fff9ef3d7 100644 --- a/sla/resources/views/SLA_LandingPage.html +++ b/sla/resources/views/SLA_LandingPage.html @@ -7,9 +7,10 @@

SLA Purchase


SLA Weaning

SLA weaning module is used by SLAU staff to record the rodent births and documenting the number of animals weaned.
Weaned mice are entered into SLA purchase module as they need to be subtracted from the protocol's SLA allowance numbers.

-

Click here to view/upload the weaning data 

- + +

Click here to view/upload the weaning data 


+https://primetest2.ohsu.edu/ldk/ONPRC/SLA/updateQuery.view?schemaName=sla&query.queryName=Weaning

SLA Census

SLA census module is used by SLAU staff to maintain rodent demographic and location data and billing. Please click on the links below for specific operations.

Entering Animals:

From d12252c2ec96b35b95439d7471e52ddbd6e7c069 Mon Sep 17 00:00:00 2001 From: kollil Date: Sat, 28 Sep 2024 16:25:00 -0700 Subject: [PATCH 04/24] Update DB stuff --- .../dbscripts/sqlserver/sla-23.002-23.003.sql | 114 ++++++++++-------- sla/resources/schemas/sla.xml | 1 + sla/resources/views/SLA_LandingPage.html | 5 +- 3 files changed, 65 insertions(+), 55 deletions(-) diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index 039194ca0..0e1fb64b8 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -16,7 +16,7 @@ CREATE TABLE sla.weaning ( rowid int IDENTITY(1,1) NOT NULL, investigator varchar(250), date DATETIME, - project INTEGER, + project varchar(200), vendorLocation varchar(200), DOB DATETIME, DOM DATETIME, @@ -36,32 +36,32 @@ CREATE TABLE sla.weaning ( ); CREATE TABLE sla.TempWeaning ( - rowid int IDENTITY(1,1) NOT NULL, - investigator varchar(250), - date DATETIME, - project INTEGER, - vendorLocation varchar(200), - DOB DATETIME, - DOM DATETIME, - species varchar(100), - sex varchar(100), - strain varchar (200), - numAlive INTEGER, - created DATETIME + rowid int IDENTITY(1,1) NOT NULL, + weaning_rowId int NULL, + investigator varchar(250), + date DATETIME, + project varchar(200), + vendorLocation varchar(200), + DOB DATETIME, + DOM DATETIME, + species varchar(100), + sex varchar(100), + strain varchar (200), + numAlive INTEGER, + created DATETIME ); GO --- Alter the stored proc -/****** Object: StoredProcedure onprc_ehr . SLAWeaningDataTransfer Script Date: 8/24/2024 *****/ +/****** Object: StoredProcedure sla.SLAWeaningDataTransfer Script Date: 8/24/2024 *****/ -- ================================================================================= -- Author: Lakshmi Kolli -- Create date: 8/24/2024 -- Description: Create a stored proc to check for any rodents with age of 21 days after the DOB. -- ================================================================================= -CREATE PROCEDURE sla.SLAWeaningDataTransfer -AS +CREATE PROCEDURE [sla].[SLAWeaningDataTransfer] + AS DECLARE @WCount Int, @@ -82,25 +82,35 @@ DECLARE @alias varchar(100), @purchaseId entityid, @ageindays int, - @count int + @counter int, + @weaning_rowid int BEGIN - --Check if any rodents that were not recorded in the SLA tables and + --Check if any rodents age is 21 days and above and not transferred into SLA tables Select @WCount = COUNT(*) From sla.weaning - Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, GETDATE(), DOB) >= 21 + Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, DOB, GETDATE()) >= 21 --Found entries, so, insert those records into SLA.purchase and SLA.purchasedetails tables If @WCount > 0 Begin - --Delete the rows from temp table before loading new data - Delete From onprc_ehr.Temp_ClnRemarks + --Delete the rows from temp table before loading new data + TRUNCATE TABLE sla.TempWeaning --Move the weaning entries into a temp table - INSERT INTO sla.TempWeaning (investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) - Select investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, GETDATE() From sla.weaning - Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, GETDATE(), DOB) >= 21 - - While @count <= @WCount + INSERT INTO sla.TempWeaning (weaning_rowid, investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) + Select rowid, investigator, date, project, vendorlocation, DOB, DOM, species, + CASE + WHEN sex = 'F' THEN 'Female' + WHEN sex = 'M' THEN 'Male' + ELSE 'Male or Female' + END AS sex, + strain, numAlive, GETDATE() From sla.weaning + Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, DOB, GETDATE()) >= 21 + + --Set the counter + Select top 1 @counter = rowid from sla.Tempweaning order by rowid asc + + While @counter <= @WCount Begin /* Requestorid - (Kati Marshall ) - 7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B Userid - (Kati Marshall) - 1294 @@ -108,43 +118,43 @@ BEGIN Container - (SLA) - 4831D09C-4169-1034-BAD2-5107380A9819 created - (onprc-is) - 1003 */ + -- Get projectid , PI and account - Select @center_project = project, @alias = account From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @count) + Select @center_project = project, @alias = account From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @counter) - --Get the age of the rodent - Select @ageindays = DateDiff(dd, GETDATE(), DOB) From sla.TempWeaning Where rowid = @count + --Get the age of the rodent and weaning_rowid, species, sex, strain and vendorlocation + Select @ageindays = DateDiff(dd, DOB, GETDATE()),@weaning_rowid = weaning_rowid, + @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation + From sla.TempWeaning Where rowid = @counter - --Insert weaning data into sla.purchase table as pending order - INSERT INTO sla.purchase - (project, account, requestorid, vendorid, hazardslist, dobrequired, comments , confirmationnum , housingconfirmed, - iacucconfirmed , requestdate , orderdate , orderedby , objectid , container , createdby , created , modifiedby , modified , DARComments , VendorContact ) + --Insert weaning data into sla.purchase table as a pending order + INSERT INTO sla.purchase + (project, account, requestorid, vendorid, hazardslist, dobrequired, comments, confirmationnum, housingconfirmed, + iacucconfirmed, requestdate, orderdate, orderedby, objectid, container, createdby, created, modifiedby, modified, DARComments, VendorContact) Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'','',null,null,null,null,'',NEWID(), - '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' + '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' - --Get the latest purchaseid from sla.purchase + --Get the newly created purchaseid from sla.purchase Select top 1 @purchaseid = objectid From sla.purchase order by created desc - --Get the specis, sex and strain - Select @species = species, @sex = sex, @strain = strain From sla.TempWeaning Where rowid = @count - - --Insert data into purchasedetails with the newly created purchaseid above + --Insert data into purchasedetails with the newly created purchaseid above INSERT INTO sla.purchaseDetails - (purchaseid, species ,age,weight ,weight_units,gestation,gender,strain,room ,animalsordered ,animalsreceived,boxesquantity,costperanimal,shippingcost, - totalcost,housingInstructions ,requestedarrivaldate ,expectedarrivaldate ,receiveddate ,receivedby ,cancelledby ,datecancelled, - objectid, container, createdby ,created ,modifiedby ,modified ,sla_DOB ,vendorLocation) + (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, + totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, + objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) VALUES - (@purchaseId, @species ,'','','','',@sex, @strain, '',null,null,null,'','', + (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','', @sex, @strain, '',null,null,null,'','', '','',null,null,null,'','',null, - NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,null,'') + NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,null,@vendorLocation) - SET @count = @count + 1 - End --End while + --Update the sla.weaning row with the date of transfer date set for the transferred weaning row + Update sla.weaning + Set dateofTransfer = GETDATE() + Where rowid = @weaning_rowid - --Update the sla.weaning table with the date of transfer date set for the transferred animals - Update sla.weaning - Set dateofTransfer = GETDATE() Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, GETDATE(), DOB) >= 21 + SET @counter = @counter + 1; + End --End while End End - -GO \ No newline at end of file +Go \ No newline at end of file diff --git a/sla/resources/schemas/sla.xml b/sla/resources/schemas/sla.xml index 7c1ec4199..bc1211f7b 100644 --- a/sla/resources/schemas/sla.xml +++ b/sla/resources/schemas/sla.xml @@ -527,6 +527,7 @@ + PI diff --git a/sla/resources/views/SLA_LandingPage.html b/sla/resources/views/SLA_LandingPage.html index fff9ef3d7..d95f28e5c 100644 --- a/sla/resources/views/SLA_LandingPage.html +++ b/sla/resources/views/SLA_LandingPage.html @@ -7,10 +7,9 @@

SLA Purchase


SLA Weaning

SLA weaning module is used by SLAU staff to record the rodent births and documenting the number of animals weaned.
Weaned mice are entered into SLA purchase module as they need to be subtracted from the protocol's SLA allowance numbers.

- -

Click here to view/upload the weaning data 

+

Click here to view/upload the weaning data 

+
-https://primetest2.ohsu.edu/ldk/ONPRC/SLA/updateQuery.view?schemaName=sla&query.queryName=Weaning

SLA Census

SLA census module is used by SLAU staff to maintain rodent demographic and location data and billing. Please click on the links below for specific operations.

Entering Animals:

From 059902fba8a4640f15e163a165d01e496f57a5b7 Mon Sep 17 00:00:00 2001 From: kollil Date: Sun, 29 Sep 2024 11:33:45 -0700 Subject: [PATCH 05/24] Updated URL --- sla/resources/views/SLA_LandingPage.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sla/resources/views/SLA_LandingPage.html b/sla/resources/views/SLA_LandingPage.html index d95f28e5c..49dd41406 100644 --- a/sla/resources/views/SLA_LandingPage.html +++ b/sla/resources/views/SLA_LandingPage.html @@ -7,8 +7,8 @@

SLA Purchase


SLA Weaning

SLA weaning module is used by SLAU staff to record the rodent births and documenting the number of animals weaned.
Weaned mice are entered into SLA purchase module as they need to be subtracted from the protocol's SLA allowance numbers.

-

Click here to view/upload the weaning data 

- + +

Click here to view/upload the weaning data 

-->

SLA Census

SLA census module is used by SLAU staff to maintain rodent demographic and location data and billing. Please click on the links below for specific operations.

From 28f79c9e02e6639efc949885a5247b6e1631bbd7 Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 2 Oct 2024 15:05:00 -0700 Subject: [PATCH 06/24] Updated db tables, stored proc --- .../dbscripts/sqlserver/sla-23.002-23.003.sql | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index 0e1fb64b8..cce6cda5a 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -61,7 +61,7 @@ GO -- ================================================================================= CREATE PROCEDURE [sla].[SLAWeaningDataTransfer] - AS +AS DECLARE @WCount Int, @@ -93,7 +93,7 @@ BEGIN --Found entries, so, insert those records into SLA.purchase and SLA.purchasedetails tables If @WCount > 0 Begin - --Delete the rows from temp table before loading new data + --Delete the rows from temp table before loading new data TRUNCATE TABLE sla.TempWeaning --Move the weaning entries into a temp table @@ -127,17 +127,17 @@ BEGIN @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation From sla.TempWeaning Where rowid = @counter - --Insert weaning data into sla.purchase table as a pending order - INSERT INTO sla.purchase + --Insert weaning data into sla.purchase table as a pending order + INSERT INTO sla.purchase (project, account, requestorid, vendorid, hazardslist, dobrequired, comments, confirmationnum, housingconfirmed, iacucconfirmed, requestdate, orderdate, orderedby, objectid, container, createdby, created, modifiedby, modified, DARComments, VendorContact) - Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'','',null,null,null,null,'',NEWID(), + Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'',null,null,null,null,null,'',NEWID(), '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' --Get the newly created purchaseid from sla.purchase Select top 1 @purchaseid = objectid From sla.purchase order by created desc - --Insert data into purchasedetails with the newly created purchaseid above + --Insert data into purchasedetails with the newly created purchaseid above INSERT INTO sla.purchaseDetails (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, @@ -157,4 +157,5 @@ BEGIN End --End while End End + Go \ No newline at end of file From 692bf5a5ee496ac59f2ab9b13968c93207928d93 Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 2 Oct 2024 16:09:21 -0700 Subject: [PATCH 07/24] Fixed a typo --- sla/resources/views/SLA_LandingPage.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sla/resources/views/SLA_LandingPage.html b/sla/resources/views/SLA_LandingPage.html index 49dd41406..a3fe490c1 100644 --- a/sla/resources/views/SLA_LandingPage.html +++ b/sla/resources/views/SLA_LandingPage.html @@ -8,7 +8,7 @@

SLA Purchase

SLA Weaning

SLA weaning module is used by SLAU staff to record the rodent births and documenting the number of animals weaned.
Weaned mice are entered into SLA purchase module as they need to be subtracted from the protocol's SLA allowance numbers.

-

Click here to view/upload the weaning data 

--> +

Click here to view/upload the weaning data 


SLA Census

SLA census module is used by SLAU staff to maintain rodent demographic and location data and billing. Please click on the links below for specific operations.

From 3e6ce515658800d9b09102eafd0bf3004514900c Mon Sep 17 00:00:00 2001 From: kollil Date: Thu, 3 Oct 2024 13:56:36 -0700 Subject: [PATCH 08/24] Added the ETL process --- onprc_ehr/resources/etls/SLAWeaning.xml | 27 +++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 onprc_ehr/resources/etls/SLAWeaning.xml diff --git a/onprc_ehr/resources/etls/SLAWeaning.xml b/onprc_ehr/resources/etls/SLAWeaning.xml new file mode 100644 index 000000000..1beb49ea7 --- /dev/null +++ b/onprc_ehr/resources/etls/SLAWeaning.xml @@ -0,0 +1,27 @@ + + + + + SLAWeaning + + Executes stored procedure to populate the SLA purchase datasets + + + + Runs the stored procedure to process and update the weaning data from sla.TempWeaning table to sla.purchase and sla.purchasedetails tables in prime + + + + + + + + + + \ No newline at end of file From 651d71bf901188b319a35e789c5b46d78d537990 Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 15 Oct 2024 13:27:18 -0700 Subject: [PATCH 09/24] Updated the sql comments --- .../schemas/dbscripts/sqlserver/sla-23.002-23.003.sql | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index cce6cda5a..19f514d0f 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -54,11 +54,12 @@ CREATE TABLE sla.TempWeaning ( GO /****** Object: StoredProcedure sla.SLAWeaningDataTransfer Script Date: 8/24/2024 *****/ --- ================================================================================= +-- ========================================================================================== -- Author: Lakshmi Kolli -- Create date: 8/24/2024 --- Description: Create a stored proc to check for any rodents with age of 21 days after the DOB. --- ================================================================================= +-- Description: Create a stored proc to check for any rodents with age >= 21 days and enter +-- the data into SLA tables +-- ========================================================================================== CREATE PROCEDURE [sla].[SLAWeaningDataTransfer] AS From 57b8fafca7866eadee2a0c7e9c1b19de13bd2b01 Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 16 Oct 2024 14:05:28 -0700 Subject: [PATCH 10/24] Updated the stored proc schema to point to onprc_ehr. Updated the ETL path accordingly --- onprc_ehr/resources/etls/SLAWeaning.xml | 5 +++-- .../schemas/dbscripts/sqlserver/sla-23.002-23.003.sql | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/etls/SLAWeaning.xml b/onprc_ehr/resources/etls/SLAWeaning.xml index 1beb49ea7..d7dde4095 100644 --- a/onprc_ehr/resources/etls/SLAWeaning.xml +++ b/onprc_ehr/resources/etls/SLAWeaning.xml @@ -15,13 +15,14 @@ Runs the stored procedure to process and update the weaning data from sla.TempWeaning table to sla.purchase and sla.purchasedetails tables in prime - + - + + \ No newline at end of file diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index 19f514d0f..e60cd1fe1 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -61,7 +61,7 @@ GO -- the data into SLA tables -- ========================================================================================== -CREATE PROCEDURE [sla].[SLAWeaningDataTransfer] +CREATE PROCEDURE [onprc_ehr].[SLAWeaningDataTransfer] AS DECLARE From e3d1efc9d6d903e1b110db0b4a0bd806213f5f65 Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 16 Oct 2024 16:08:26 -0700 Subject: [PATCH 11/24] updated ETL code --- onprc_ehr/resources/etls/SLAWeaning.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/onprc_ehr/resources/etls/SLAWeaning.xml b/onprc_ehr/resources/etls/SLAWeaning.xml index d7dde4095..06ca5f1ca 100644 --- a/onprc_ehr/resources/etls/SLAWeaning.xml +++ b/onprc_ehr/resources/etls/SLAWeaning.xml @@ -15,14 +15,14 @@ Runs the stored procedure to process and update the weaning data from sla.TempWeaning table to sla.purchase and sla.purchasedetails tables in prime - + - + \ No newline at end of file From 6100ead176e9d37de7afa1ce6d53db997cfc939f Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 16 Oct 2024 19:28:27 -0700 Subject: [PATCH 12/24] updated ETL code - changed the cronjob time to run every 15 mins for Kati's testing --- onprc_ehr/resources/etls/SLAWeaning.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/etls/SLAWeaning.xml b/onprc_ehr/resources/etls/SLAWeaning.xml index 06ca5f1ca..3cf3ed856 100644 --- a/onprc_ehr/resources/etls/SLAWeaning.xml +++ b/onprc_ehr/resources/etls/SLAWeaning.xml @@ -22,7 +22,7 @@ - + \ No newline at end of file From 8f750011ebe2e23c005a30901a10eab6a95a4dfb Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 16 Oct 2024 20:33:15 -0700 Subject: [PATCH 13/24] updated ETL code --- onprc_ehr/resources/etls/SLAWeaning.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/etls/SLAWeaning.xml b/onprc_ehr/resources/etls/SLAWeaning.xml index 3cf3ed856..127d66734 100644 --- a/onprc_ehr/resources/etls/SLAWeaning.xml +++ b/onprc_ehr/resources/etls/SLAWeaning.xml @@ -22,7 +22,7 @@ - + \ No newline at end of file From aa3577c96edd2e75079c24f15f501d7fdf6077b0 Mon Sep 17 00:00:00 2001 From: kollil Date: Thu, 17 Oct 2024 19:27:19 -0700 Subject: [PATCH 14/24] Updated stored proc to add expected, requested dates and numordered fields. --- .../dbscripts/sqlserver/sla-23.002-23.003.sql | 56 ++++++++++--------- 1 file changed, 31 insertions(+), 25 deletions(-) diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index e60cd1fe1..5111c9e69 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -65,26 +65,30 @@ CREATE PROCEDURE [onprc_ehr].[SLAWeaningDataTransfer] AS DECLARE - @WCount Int, - @project varchar(100), - @center_project int, - @PI varchar(250), - @investigaorid int, - @vendorlocation varchar(250), - @DOB smalldatetime, - @DOM smalldatetime, - @strain varchar(250), - @sex varchar(100), - @species varchar(100), - @numAlive int, - @numDead int, - @totalPups int, - @dateofTransfer smalldatetime, - @alias varchar(100), - @purchaseId entityid, - @ageindays int, - @counter int, - @weaning_rowid int + @WCount Int, + @project varchar(100), + @center_project int, + @PI varchar(250), + @investigaorid int, + @vendorlocation varchar(250), + @DOB smalldatetime, + @DOM smalldatetime, + @strain varchar(250), + @sex varchar(100), + @species varchar(100), + @numAlive int, + @numDead int, + @totalPups int, + @dateofTransfer smalldatetime, + @alias varchar(100), + @purchaseId entityid, + @ageindays int, + @counter int, + @weaning_rowid int, + @RequestedArrivalDate smalldatetime, + @ExpectedArrivalDate smalldatetime, + @slaDOB smalldatetime, + @numAnimalsOrdered int BEGIN --Check if any rodents age is 21 days and above and not transferred into SLA tables @@ -125,7 +129,9 @@ BEGIN --Get the age of the rodent and weaning_rowid, species, sex, strain and vendorlocation Select @ageindays = DateDiff(dd, DOB, GETDATE()),@weaning_rowid = weaning_rowid, - @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation + @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, + @RequestedArrivalDate = DateAdd(dd, 21, DOB), @ExpectedArrivalDate = DateAdd(dd, 21, DOB), + @slaDOB = DOB, @numAnimalsOrdered = numAlive From sla.TempWeaning Where rowid = @counter --Insert weaning data into sla.purchase table as a pending order @@ -133,7 +139,7 @@ BEGIN (project, account, requestorid, vendorid, hazardslist, dobrequired, comments, confirmationnum, housingconfirmed, iacucconfirmed, requestdate, orderdate, orderedby, objectid, container, createdby, created, modifiedby, modified, DARComments, VendorContact) Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'',null,null,null,null,null,'',NEWID(), - '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' + '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' --Get the newly created purchaseid from sla.purchase Select top 1 @purchaseid = objectid From sla.purchase order by created desc @@ -144,9 +150,9 @@ BEGIN totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) VALUES - (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','', @sex, @strain, '',null,null,null,'','', - '','',null,null,null,'','',null, - NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,null,@vendorLocation) + (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','', @sex, @strain, '',@numAnimalsOrdered,null,null,'','', + '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, + NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) --Update the sla.weaning row with the date of transfer date set for the transferred weaning row Update sla.weaning From d5dd277336cafb7e900129ddbc7a0b3a6a18caa0 Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 23 Oct 2024 14:41:20 -0700 Subject: [PATCH 15/24] Update the Stored proc --- .../dbscripts/sqlserver/sla-23.002-23.003.sql | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index 5111c9e69..f581a975c 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -15,18 +15,18 @@ GO CREATE TABLE sla.weaning ( rowid int IDENTITY(1,1) NOT NULL, investigator varchar(250), - date DATETIME, + date DATETIME, -- Pup's DOB project varchar(200), vendorLocation varchar(200), - DOB DATETIME, - DOM DATETIME, + DOB DATETIME, --Dam's DOB + DOM DATETIME, --Date of Mating species varchar(100), sex varchar(100), strain varchar (200), numAlive INTEGER, numDead INTEGER, totalPups INTEGER, - dateofTransfer DATETIME, + dateofTransfer DATETIME, --The date of transfer into SLA tables createdBy USERID, created DATETIME, modifiedBy USERID, @@ -93,7 +93,7 @@ DECLARE BEGIN --Check if any rodents age is 21 days and above and not transferred into SLA tables Select @WCount = COUNT(*) From sla.weaning - Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, DOB, GETDATE()) >= 21 + Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 --Found entries, so, insert those records into SLA.purchase and SLA.purchasedetails tables If @WCount > 0 @@ -103,14 +103,14 @@ BEGIN --Move the weaning entries into a temp table INSERT INTO sla.TempWeaning (weaning_rowid, investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) - Select rowid, investigator, date, project, vendorlocation, DOB, DOM, species, + Select rowid, investigator, date, project, vendorlocation, date, DOM, species, CASE WHEN sex = 'F' THEN 'Female' WHEN sex = 'M' THEN 'Male' ELSE 'Male or Female' END AS sex, strain, numAlive, GETDATE() From sla.weaning - Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, DOB, GETDATE()) >= 21 + Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 --Set the counter Select top 1 @counter = rowid from sla.Tempweaning order by rowid asc @@ -128,10 +128,10 @@ BEGIN Select @center_project = project, @alias = account From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @counter) --Get the age of the rodent and weaning_rowid, species, sex, strain and vendorlocation - Select @ageindays = DateDiff(dd, DOB, GETDATE()),@weaning_rowid = weaning_rowid, + Select @ageindays = DateDiff(dd, date, GETDATE()),@weaning_rowid = weaning_rowid, @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, - @RequestedArrivalDate = DateAdd(dd, 21, DOB), @ExpectedArrivalDate = DateAdd(dd, 21, DOB), - @slaDOB = DOB, @numAnimalsOrdered = numAlive + @RequestedArrivalDate = DateAdd(dd, 21, date), @ExpectedArrivalDate = DateAdd(dd, 21, date), + @slaDOB = date, @numAnimalsOrdered = numAlive From sla.TempWeaning Where rowid = @counter --Insert weaning data into sla.purchase table as a pending order From ca17cf1b2d12bba204ddf803da6227cbe435ec79 Mon Sep 17 00:00:00 2001 From: kollil Date: Fri, 8 Nov 2024 14:04:44 -0800 Subject: [PATCH 16/24] Label and headers change from "Gender" to "Sex" in SLA purchase module. --- sla/resources/queries/sla/ProtocolProjectsUsage.sql | 2 +- sla/resources/queries/sla_public/PurchaseOrderDetails.sql | 2 +- sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql | 2 +- sla/resources/web/sla/form/PurchaseSpeciesGrid.js | 3 ++- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/sla/resources/queries/sla/ProtocolProjectsUsage.sql b/sla/resources/queries/sla/ProtocolProjectsUsage.sql index f169ef15f..15e6336d1 100644 --- a/sla/resources/queries/sla/ProtocolProjectsUsage.sql +++ b/sla/resources/queries/sla/ProtocolProjectsUsage.sql @@ -13,7 +13,7 @@ SELECT y.grantNumber as OGAGrantNumber, y.fiscalAuthorityName As FiscalAuthorityName, aa.Species, - aa.Gender, + aa.Gender as Sex, aa.Strain, aa.Allowed AS NumAllowed, calc.NumUsed, diff --git a/sla/resources/queries/sla_public/PurchaseOrderDetails.sql b/sla/resources/queries/sla_public/PurchaseOrderDetails.sql index f0946a0d3..99146e245 100644 --- a/sla/resources/queries/sla_public/PurchaseOrderDetails.sql +++ b/sla/resources/queries/sla_public/PurchaseOrderDetails.sql @@ -10,7 +10,7 @@ p.requestorid, p.requestor, p.vendor, pd.species, -pd.gender, +pd.gender as Sex, pd.strain, pd.weight, pd.gestation, diff --git a/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql b/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql index d9c3c2f35..60a7e1fe3 100644 --- a/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql +++ b/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql @@ -11,7 +11,7 @@ p.requestorid, p.requestor, p.vendor, pd.species, -pd.gender, +pd.gender as Sex, pd.strain, pd.weight, pd.gestation, diff --git a/sla/resources/web/sla/form/PurchaseSpeciesGrid.js b/sla/resources/web/sla/form/PurchaseSpeciesGrid.js index 63b8f5408..c817252ff 100644 --- a/sla/resources/web/sla/form/PurchaseSpeciesGrid.js +++ b/sla/resources/web/sla/form/PurchaseSpeciesGrid.js @@ -150,7 +150,8 @@ Ext4.define('SLA.form.SpeciesGrid', { }, { dataIndex: 'gender', - text: 'Gender*', + // text: 'Gender*', + text: 'Sex*', width: 250, editor: this.getComboColumnEditorConfig('Reference_Data','value', 'value','gender', 'sort_order') }, From 8d64daacc8447ec6005b88e428cf16ec6461d0e8 Mon Sep 17 00:00:00 2001 From: kollil Date: Sun, 10 Nov 2024 15:44:06 -0800 Subject: [PATCH 17/24] Some more places - Label and headers change from "Gender" to "Sex" in SLA Breeding query --- .../queries/sla/ProtocolProjectsAndBreedingInfo.query.xml | 2 +- sla/resources/queries/sla/ProtocolProjectsAndBreedingInfo.sql | 2 +- sla/resources/queries/sla/ProtocolProjectsUsage.query.xml | 2 +- sla/resources/queries/sla/allowableSLA.sql | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/sla/resources/queries/sla/ProtocolProjectsAndBreedingInfo.query.xml b/sla/resources/queries/sla/ProtocolProjectsAndBreedingInfo.query.xml index 18e537ddf..670619578 100644 --- a/sla/resources/queries/sla/ProtocolProjectsAndBreedingInfo.query.xml +++ b/sla/resources/queries/sla/ProtocolProjectsAndBreedingInfo.query.xml @@ -37,7 +37,7 @@ Species
- Gender + Sex Strain diff --git a/sla/resources/queries/sla/ProtocolProjectsAndBreedingInfo.sql b/sla/resources/queries/sla/ProtocolProjectsAndBreedingInfo.sql index 160560a91..13a4ac280 100644 --- a/sla/resources/queries/sla/ProtocolProjectsAndBreedingInfo.sql +++ b/sla/resources/queries/sla/ProtocolProjectsAndBreedingInfo.sql @@ -8,7 +8,7 @@ SELECT a.title As Title, i.LastName || ', ' || i.FirstName As PIName, aa.Species, - aa.Gender, + aa.Gender as Sex, aa.Strain, aa.Allowed As NumAllowed, aa.StartDate, diff --git a/sla/resources/queries/sla/ProtocolProjectsUsage.query.xml b/sla/resources/queries/sla/ProtocolProjectsUsage.query.xml index f04eb9cd7..b88045126 100644 --- a/sla/resources/queries/sla/ProtocolProjectsUsage.query.xml +++ b/sla/resources/queries/sla/ProtocolProjectsUsage.query.xml @@ -35,7 +35,7 @@ Species - Gender + Sex Strain diff --git a/sla/resources/queries/sla/allowableSLA.sql b/sla/resources/queries/sla/allowableSLA.sql index a143558f1..f2705049b 100644 --- a/sla/resources/queries/sla/allowableSLA.sql +++ b/sla/resources/queries/sla/allowableSLA.sql @@ -4,7 +4,7 @@ SELECT a.protocol, c.protocol_id as eIACUC_protocol_name, a.species, - a.gender, + a.gender as Sex, a.strain, a.age, a.allowed, From ad20510b2abb3ba9ea9e8d53aee58f263449ac0d Mon Sep 17 00:00:00 2001 From: kollil Date: Mon, 11 Nov 2024 13:04:38 -0800 Subject: [PATCH 18/24] Some more places - Label and headers change from "Gender" to "Sex" in SLA Breeding query --- onprc_ehr/resources/etls/SLAWeaning.xml | 2 +- sla/resources/queries/sla_public/PurchaseOrderDetails.sql | 2 +- sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/etls/SLAWeaning.xml b/onprc_ehr/resources/etls/SLAWeaning.xml index 127d66734..16db8a44f 100644 --- a/onprc_ehr/resources/etls/SLAWeaning.xml +++ b/onprc_ehr/resources/etls/SLAWeaning.xml @@ -22,7 +22,7 @@ - + \ No newline at end of file diff --git a/sla/resources/queries/sla_public/PurchaseOrderDetails.sql b/sla/resources/queries/sla_public/PurchaseOrderDetails.sql index 99146e245..f0946a0d3 100644 --- a/sla/resources/queries/sla_public/PurchaseOrderDetails.sql +++ b/sla/resources/queries/sla_public/PurchaseOrderDetails.sql @@ -10,7 +10,7 @@ p.requestorid, p.requestor, p.vendor, pd.species, -pd.gender as Sex, +pd.gender, pd.strain, pd.weight, pd.gestation, diff --git a/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql b/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql index 60a7e1fe3..d9c3c2f35 100644 --- a/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql +++ b/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql @@ -11,7 +11,7 @@ p.requestorid, p.requestor, p.vendor, pd.species, -pd.gender as Sex, +pd.gender, pd.strain, pd.weight, pd.gestation, From 02e52b9aeea449a0f24f48a5250fc140f1220709 Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 12 Nov 2024 10:58:42 -0800 Subject: [PATCH 19/24] Changed the cron time to 15 mins for testing --- onprc_ehr/resources/etls/SLAWeaning.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/onprc_ehr/resources/etls/SLAWeaning.xml b/onprc_ehr/resources/etls/SLAWeaning.xml index 16db8a44f..7179e7ce9 100644 --- a/onprc_ehr/resources/etls/SLAWeaning.xml +++ b/onprc_ehr/resources/etls/SLAWeaning.xml @@ -22,7 +22,7 @@ - + \ No newline at end of file From 0961a2b6dce485984fd5bf8f7f6d6fe1aa240569 Mon Sep 17 00:00:00 2001 From: kollil Date: Wed, 8 Jan 2025 11:27:33 -0800 Subject: [PATCH 20/24] Updated th stored proc --- .../dbscripts/sqlserver/sla-23.002-23.003.sql | 143 ++++++++++++------ sla/resources/schemas/sla.xml | 3 + 2 files changed, 100 insertions(+), 46 deletions(-) diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index f581a975c..0d60faa1a 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -48,6 +48,7 @@ CREATE TABLE sla.TempWeaning ( sex varchar(100), strain varchar (200), numAlive INTEGER, + dateofTransfer DATETIME, created DATETIME ); @@ -65,9 +66,10 @@ CREATE PROCEDURE [onprc_ehr].[SLAWeaningDataTransfer] AS DECLARE - @WCount Int, +@WCount Int, @project varchar(100), @center_project int, + @center_project2 int, @PI varchar(250), @investigaorid int, @vendorlocation varchar(250), @@ -84,39 +86,41 @@ DECLARE @purchaseId entityid, @ageindays int, @counter int, + @counter2 int, @weaning_rowid int, @RequestedArrivalDate smalldatetime, @ExpectedArrivalDate smalldatetime, @slaDOB smalldatetime, - @numAnimalsOrdered int + @numAnimalsOrdered int, + @DOT smalldatetime BEGIN --Check if any rodents age is 21 days and above and not transferred into SLA tables - Select @WCount = COUNT(*) From sla.weaning - Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 +Select @WCount = COUNT(*) From sla.weaning +Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 - --Found entries, so, insert those records into SLA.purchase and SLA.purchasedetails tables - If @WCount > 0 + --Found entries, so, insert those records into SLA.purchase and SLA.purchasedetails tables + If @WCount > 0 -- start BIG If Begin - --Delete the rows from temp table before loading new data + --Delete the rows from temp table before loading new data TRUNCATE TABLE sla.TempWeaning - --Move the weaning entries into a temp table - INSERT INTO sla.TempWeaning (weaning_rowid, investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) + --Move the weaning entries into a temp table + INSERT INTO sla.TempWeaning (weaning_rowid, investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) Select rowid, investigator, date, project, vendorlocation, date, DOM, species, - CASE + CASE WHEN sex = 'F' THEN 'Female' WHEN sex = 'M' THEN 'Male' ELSE 'Male or Female' END AS sex, - strain, numAlive, GETDATE() From sla.weaning - Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 + strain, numAlive, GETDATE() From sla.weaning + Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 - --Set the counter + --Set the counter seed value Select top 1 @counter = rowid from sla.Tempweaning order by rowid asc - While @counter <= @WCount - Begin + WHILE @counter <= @WCount -- start 1st while + BEGIN /* Requestorid - (Kati Marshall ) - 7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B Userid - (Kati Marshall) - 1294 vendor - (ONPRC Weaning - SLA) - E1EE1B64-B7BE-1035-BFC4-5107380AE41E @@ -124,45 +128,92 @@ BEGIN created - (onprc-is) - 1003 */ - -- Get projectid , PI and account + -- Get projectid, PI and account Select @center_project = project, @alias = account From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @counter) --Get the age of the rodent and weaning_rowid, species, sex, strain and vendorlocation Select @ageindays = DateDiff(dd, date, GETDATE()),@weaning_rowid = weaning_rowid, @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, @RequestedArrivalDate = DateAdd(dd, 21, date), @ExpectedArrivalDate = DateAdd(dd, 21, date), - @slaDOB = date, @numAnimalsOrdered = numAlive + @slaDOB = date, @numAnimalsOrdered = numAlive, @DOT = dateofTransfer From sla.TempWeaning Where rowid = @counter - --Insert weaning data into sla.purchase table as a pending order - INSERT INTO sla.purchase - (project, account, requestorid, vendorid, hazardslist, dobrequired, comments, confirmationnum, housingconfirmed, - iacucconfirmed, requestdate, orderdate, orderedby, objectid, container, createdby, created, modifiedby, modified, DARComments, VendorContact) - Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'',null,null,null,null,null,'',NEWID(), - '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' - - --Get the newly created purchaseid from sla.purchase - Select top 1 @purchaseid = objectid From sla.purchase order by created desc - - --Insert data into purchasedetails with the newly created purchaseid above - INSERT INTO sla.purchaseDetails - (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, - totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, - objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) - VALUES - (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','', @sex, @strain, '',@numAnimalsOrdered,null,null,'','', - '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, - NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) - - --Update the sla.weaning row with the date of transfer date set for the transferred weaning row - Update sla.weaning - Set dateofTransfer = GETDATE() - Where rowid = @weaning_rowid - + -- Check if the row is already transfered into the main SLA tables. If DOT is null means the row hasn't been transferred yet. + If @DOT IS NULL -- start if, 1 + Begin + --Insert weaning data into sla.purchase table as a pending order + INSERT INTO sla.purchase + (project, account, requestorid, vendorid, hazardslist, dobrequired, comments, confirmationnum, housingconfirmed, + iacucconfirmed, requestdate, orderdate, orderedby, objectid, container, createdby, created, modifiedby, modified, DARComments, VendorContact) + Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'',null,null,null,null,null,'',NEWID(), + '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' + + --Get the newly created purchaseid from sla.purchase + Select top 1 @purchaseid = objectid From sla.purchase order by created desc + + --Insert data into purchasedetails with the newly created purchaseid above + INSERT INTO sla.purchaseDetails + (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, + totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, + objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) + VALUES + (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','', @sex, @strain, '',@numAnimalsOrdered, null, null,'','', + '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, + NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) + + --Update the sla.weaning row with the date of transfer date set for the transferred weaning row + Update sla.weaning + Set dateofTransfer = GETDATE() + Where rowid = @weaning_rowid + + Update sla.TempWeaning + Set dateofTransfer = GETDATE() + Where rowid = @weaning_rowid + + --Find if there are any rows with the same center project. Then create them under one purchaseId + --set the new counter + SET @counter2 = @counter + 1; + + WHILE @counter2 <= @Wcount -- start 2nd while + BEGIN + --Get projectid of the next row + Select @center_project2 = project From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @counter2) + + If (@center_project = @center_project2) -- start if, 2 + Begin + Select @ageindays = DateDiff(dd, date, GETDATE()),@weaning_rowid = weaning_rowid, + @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, + @RequestedArrivalDate = DateAdd(dd, 21, date), @ExpectedArrivalDate = DateAdd(dd, 21, date), + @slaDOB = date, @numAnimalsOrdered = numAlive, @DOT = dateofTransfer + From sla.TempWeaning Where rowid = @counter2 + + If @DOT IS NULL -- start if, 3 + Begin + INSERT INTO sla.purchaseDetails + (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, + totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, + objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) + VALUES + (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','',@sex,@strain, '',@numAnimalsOrdered,null,null,'','', + '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, + NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) + + Update sla.weaning + Set dateofTransfer = GETDATE() + Where rowid = @weaning_rowid + + Update sla.TempWeaning + Set dateofTransfer = GETDATE() + Where rowid = @weaning_rowid + + End -- end if, 3 + End -- end if, 2 + SET @counter2 = @counter2 + 1; + END -- end, 2nd while + End -- end if, 1 SET @counter = @counter + 1; - - End --End while - End -End + END -- end, 1st while + End -- end, BIG if +END Go \ No newline at end of file diff --git a/sla/resources/schemas/sla.xml b/sla/resources/schemas/sla.xml index bc1211f7b..4a8c21d46 100644 --- a/sla/resources/schemas/sla.xml +++ b/sla/resources/schemas/sla.xml @@ -558,6 +558,9 @@ Alive Pups + + Date of Transfer +
From 0762a269ba4116613549b30542ca4db688ae4aae Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 14 Jan 2025 13:12:08 -0800 Subject: [PATCH 21/24] Updated stored proc, ETL time. Updated the the Gender to Sex in Pend orders and recieved orders screens. --- onprc_ehr/resources/etls/SLAWeaning.xml | 4 +- .../sla_public/PurchaseOrderDetails.sql | 2 +- .../sla_public/PurchaseOrderDetailsAdmin.sql | 2 +- .../dbscripts/sqlserver/sla-23.002-23.003.sql | 169 +++++++++--------- 4 files changed, 90 insertions(+), 87 deletions(-) diff --git a/onprc_ehr/resources/etls/SLAWeaning.xml b/onprc_ehr/resources/etls/SLAWeaning.xml index 7179e7ce9..b03f7a8c5 100644 --- a/onprc_ehr/resources/etls/SLAWeaning.xml +++ b/onprc_ehr/resources/etls/SLAWeaning.xml @@ -21,8 +21,8 @@ - - + + \ No newline at end of file diff --git a/sla/resources/queries/sla_public/PurchaseOrderDetails.sql b/sla/resources/queries/sla_public/PurchaseOrderDetails.sql index f0946a0d3..99146e245 100644 --- a/sla/resources/queries/sla_public/PurchaseOrderDetails.sql +++ b/sla/resources/queries/sla_public/PurchaseOrderDetails.sql @@ -10,7 +10,7 @@ p.requestorid, p.requestor, p.vendor, pd.species, -pd.gender, +pd.gender as Sex, pd.strain, pd.weight, pd.gestation, diff --git a/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql b/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql index d9c3c2f35..5d2b264ef 100644 --- a/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql +++ b/sla/resources/queries/sla_public/PurchaseOrderDetailsAdmin.sql @@ -11,7 +11,7 @@ p.requestorid, p.requestor, p.vendor, pd.species, -pd.gender, +pd.gender As Sex, pd.strain, pd.weight, pd.gestation, diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index 0d60faa1a..54e651ab8 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -106,17 +106,17 @@ Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) TRUNCATE TABLE sla.TempWeaning --Move the weaning entries into a temp table - INSERT INTO sla.TempWeaning (weaning_rowid, investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) + INSERT INTO sla.TempWeaning (weaning_rowid, investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) Select rowid, investigator, date, project, vendorlocation, date, DOM, species, CASE WHEN sex = 'F' THEN 'Female' WHEN sex = 'M' THEN 'Male' ELSE 'Male or Female' END AS sex, - strain, numAlive, GETDATE() From sla.weaning - Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 + strain, numAlive, GETDATE() From sla.weaning + Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 - --Set the counter seed value + --Set the counter seed value Select top 1 @counter = rowid from sla.Tempweaning order by rowid asc WHILE @counter <= @WCount -- start 1st while @@ -131,87 +131,90 @@ Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) -- Get projectid, PI and account Select @center_project = project, @alias = account From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @counter) - --Get the age of the rodent and weaning_rowid, species, sex, strain and vendorlocation - Select @ageindays = DateDiff(dd, date, GETDATE()),@weaning_rowid = weaning_rowid, - @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, - @RequestedArrivalDate = DateAdd(dd, 21, date), @ExpectedArrivalDate = DateAdd(dd, 21, date), - @slaDOB = date, @numAnimalsOrdered = numAlive, @DOT = dateofTransfer - From sla.TempWeaning Where rowid = @counter - - -- Check if the row is already transfered into the main SLA tables. If DOT is null means the row hasn't been transferred yet. - If @DOT IS NULL -- start if, 1 + If @center_project IS NOT NULL -- start if, 4 Begin - --Insert weaning data into sla.purchase table as a pending order - INSERT INTO sla.purchase - (project, account, requestorid, vendorid, hazardslist, dobrequired, comments, confirmationnum, housingconfirmed, - iacucconfirmed, requestdate, orderdate, orderedby, objectid, container, createdby, created, modifiedby, modified, DARComments, VendorContact) - Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'',null,null,null,null,null,'',NEWID(), - '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' - - --Get the newly created purchaseid from sla.purchase - Select top 1 @purchaseid = objectid From sla.purchase order by created desc - - --Insert data into purchasedetails with the newly created purchaseid above - INSERT INTO sla.purchaseDetails - (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, - totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, - objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) - VALUES - (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','', @sex, @strain, '',@numAnimalsOrdered, null, null,'','', - '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, - NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) - - --Update the sla.weaning row with the date of transfer date set for the transferred weaning row - Update sla.weaning - Set dateofTransfer = GETDATE() - Where rowid = @weaning_rowid - - Update sla.TempWeaning - Set dateofTransfer = GETDATE() - Where rowid = @weaning_rowid - - --Find if there are any rows with the same center project. Then create them under one purchaseId - --set the new counter - SET @counter2 = @counter + 1; - - WHILE @counter2 <= @Wcount -- start 2nd while - BEGIN - --Get projectid of the next row - Select @center_project2 = project From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @counter2) - - If (@center_project = @center_project2) -- start if, 2 - Begin - Select @ageindays = DateDiff(dd, date, GETDATE()),@weaning_rowid = weaning_rowid, - @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, - @RequestedArrivalDate = DateAdd(dd, 21, date), @ExpectedArrivalDate = DateAdd(dd, 21, date), - @slaDOB = date, @numAnimalsOrdered = numAlive, @DOT = dateofTransfer - From sla.TempWeaning Where rowid = @counter2 - - If @DOT IS NULL -- start if, 3 + --Get the age of the rodent and weaning_rowid, species, sex, strain and vendorlocation + Select @ageindays = DateDiff(dd, date, GETDATE()),@weaning_rowid = weaning_rowid, + @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, + @RequestedArrivalDate = DateAdd(dd, 21, date), @ExpectedArrivalDate = DateAdd(dd, 21, date), + @slaDOB = date, @numAnimalsOrdered = numAlive, @DOT = dateofTransfer + From sla.TempWeaning Where rowid = @counter + + -- Check if the row is already transfered into the main SLA tables. If DOT is null means the row hasn't been transferred yet. + If @DOT IS NULL -- start if, 1 + Begin + --Insert weaning data into sla.purchase table as a pending order + INSERT INTO sla.purchase + (project, account, requestorid, vendorid, hazardslist, dobrequired, comments, confirmationnum, housingconfirmed, + iacucconfirmed, requestdate, orderdate, orderedby, objectid, container, createdby, created, modifiedby, modified, DARComments, VendorContact) + Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'',null,null,null,null,null,'',NEWID(), + '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' + + --Get the newly created purchaseid from sla.purchase + Select top 1 @purchaseid = objectid From sla.purchase order by created desc + + --Insert data into purchasedetails with the newly created purchaseid above + INSERT INTO sla.purchaseDetails + (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, + totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, + objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) + VALUES + (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','', @sex, @strain, '',@numAnimalsOrdered, null, null,'','', + '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, + NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) + + --Update the sla.weaning row with the date of transfer date set for the transferred weaning row + Update sla.weaning + Set dateofTransfer = GETDATE() + Where rowid = @weaning_rowid + + Update sla.TempWeaning + Set dateofTransfer = GETDATE() + Where rowid = @weaning_rowid + + --Find if there are any rows with the same center project. Then create them under one purchaseId + --set the new counter + SET @counter2 = @counter + 1; + + WHILE @counter2 <= @Wcount -- start 2nd while + BEGIN + --Get projectid of the next row + Select @center_project2 = project From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @counter2) + + If (@center_project = @center_project2) -- start if, 2 Begin - INSERT INTO sla.purchaseDetails - (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, - totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, - objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) - VALUES - (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','',@sex,@strain, '',@numAnimalsOrdered,null,null,'','', - '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, - NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) - - Update sla.weaning - Set dateofTransfer = GETDATE() - Where rowid = @weaning_rowid - - Update sla.TempWeaning - Set dateofTransfer = GETDATE() - Where rowid = @weaning_rowid - - End -- end if, 3 - End -- end if, 2 - SET @counter2 = @counter2 + 1; - END -- end, 2nd while - End -- end if, 1 - SET @counter = @counter + 1; + Select @ageindays = DateDiff(dd, date, GETDATE()),@weaning_rowid = weaning_rowid, + @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, + @RequestedArrivalDate = DateAdd(dd, 21, date), @ExpectedArrivalDate = DateAdd(dd, 21, date), + @slaDOB = date, @numAnimalsOrdered = numAlive, @DOT = dateofTransfer + From sla.TempWeaning Where rowid = @counter2 + + If @DOT IS NULL -- start if, 3 + Begin + INSERT INTO sla.purchaseDetails + (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, + totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, + objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) + VALUES + (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','',@sex,@strain, '',@numAnimalsOrdered,null,null,'','', + '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, + NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) + + Update sla.weaning + Set dateofTransfer = GETDATE() + Where rowid = @weaning_rowid + + Update sla.TempWeaning + Set dateofTransfer = GETDATE() + Where rowid = @weaning_rowid + + End -- end if, 3 + End -- end if, 2 + SET @counter2 = @counter2 + 1; + END -- end, 2nd while + End -- end if, 1 + SET @counter = @counter + 1; + End -- end if, 4 END -- end, 1st while End -- end, BIG if END From 16f56e5dfad843564b487c8b1061a01a516ef13b Mon Sep 17 00:00:00 2001 From: kollil Date: Sun, 19 Jan 2025 16:55:06 -0800 Subject: [PATCH 22/24] Updated stored proc, ETL time. Updated the the Gender to Sex in Pend orders and recieved orders screens. --- .../dbscripts/sqlserver/sla-23.002-23.003.sql | 245 ++++++++---------- .../web/sla/form/CreatePurchaseOrder.js | 9 +- .../web/sla/form/PurchaseOrderForm.js | 3 +- 3 files changed, 111 insertions(+), 146 deletions(-) diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index 54e651ab8..8978e293e 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -6,10 +6,8 @@ --Drop table if exists EXEC core.fn_dropifexists 'weaning','sla','TABLE'; -EXEC core.fn_dropifexists 'TempWeaning','sla','TABLE'; - --Drop Stored proc if exists -EXEC core.fn_dropifexists 'SLAWeaningDataTransfer', 'sla', 'PROCEDURE'; +EXEC core.fn_dropifexists 'SLAWeaningDataTransfer', 'onprc_ehr', 'PROCEDURE'; GO CREATE TABLE sla.weaning ( @@ -35,23 +33,6 @@ CREATE TABLE sla.weaning ( CONSTRAINT PK_weaning PRIMARY KEY (rowid) ); -CREATE TABLE sla.TempWeaning ( - rowid int IDENTITY(1,1) NOT NULL, - weaning_rowId int NULL, - investigator varchar(250), - date DATETIME, - project varchar(200), - vendorLocation varchar(200), - DOB DATETIME, - DOM DATETIME, - species varchar(100), - sex varchar(100), - strain varchar (200), - numAlive INTEGER, - dateofTransfer DATETIME, - created DATETIME -); - GO /****** Object: StoredProcedure sla.SLAWeaningDataTransfer Script Date: 8/24/2024 *****/ @@ -62,161 +43,143 @@ GO -- the data into SLA tables -- ========================================================================================== -CREATE PROCEDURE [onprc_ehr].[SLAWeaningDataTransfer] +CREATE PROCEDURE [onprc_ehr].[SLAWeaningDataTransfer] AS DECLARE -@WCount Int, - @project varchar(100), + @WCount int, @center_project int, @center_project2 int, - @PI varchar(250), - @investigaorid int, - @vendorlocation varchar(250), - @DOB smalldatetime, - @DOM smalldatetime, - @strain varchar(250), - @sex varchar(100), - @species varchar(100), - @numAlive int, - @numDead int, - @totalPups int, - @dateofTransfer smalldatetime, @alias varchar(100), @purchaseId entityid, - @ageindays int, @counter int, @counter2 int, - @weaning_rowid int, - @RequestedArrivalDate smalldatetime, - @ExpectedArrivalDate smalldatetime, - @slaDOB smalldatetime, - @numAnimalsOrdered int, - @DOT smalldatetime + @DOT DATETIME, + @DOT2 DATETIME BEGIN --Check if any rodents age is 21 days and above and not transferred into SLA tables -Select @WCount = COUNT(*) From sla.weaning -Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 + Select @WCount = COUNT(*) From sla.weaning Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 - --Found entries, so, insert those records into SLA.purchase and SLA.purchasedetails tables - If @WCount > 0 -- start BIG If + --Found entries, so, insert those records into SLA.purchase and SLA.purchasedetails tables + If @WCount > 0 -- start if, 1 Begin - --Delete the rows from temp table before loading new data - TRUNCATE TABLE sla.TempWeaning - - --Move the weaning entries into a temp table - INSERT INTO sla.TempWeaning (weaning_rowid, investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) + --Create a local temp table to process the weaning data + CREATE TABLE #TempWeaning ( + rowid int IDENTITY(1,1) NOT NULL, + orig_weaning_rowid INTEGER, + investigator varchar(250), + date DATETIME, + project varchar(200), + vendorLocation varchar(200), + DOB DATETIME, + DOM DATETIME, + species varchar(100), + sex varchar(100), + strain varchar (200), + numAlive INTEGER, + dateofTransfer DATETIME, + created DATETIME + ); + + --Move the weaning entries into a temp table + INSERT INTO #TempWeaning (orig_weaning_rowid, investigator, date, project, vendorlocation, DOB, DOM, species, sex, strain, numAlive, created) Select rowid, investigator, date, project, vendorlocation, date, DOM, species, CASE WHEN sex = 'F' THEN 'Female' WHEN sex = 'M' THEN 'Male' ELSE 'Male or Female' END AS sex, - strain, numAlive, GETDATE() From sla.weaning - Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 + strain, numAlive, GETDATE() From sla.weaning Where numAlive > 0 And dateofTransfer is null And DateDiff(dd, date, GETDATE()) >= 21 - --Set the counter seed value - Select top 1 @counter = rowid from sla.Tempweaning order by rowid asc + --Set the counter seed value + Select top 1 @counter = rowid from #TempWeaning order by rowid asc WHILE @counter <= @WCount -- start 1st while BEGIN /* Requestorid - (Kati Marshall ) - 7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B Userid - (Kati Marshall) - 1294 vendor - (ONPRC Weaning - SLA) - E1EE1B64-B7BE-1035-BFC4-5107380AE41E - Container - (SLA) - 4831D09C-4169-1034-BAD2-5107380A9819 + container - (SLA) - 4831D09C-4169-1034-BAD2-5107380A9819 created - (onprc-is) - 1003 */ - -- Get projectid, PI and account - Select @center_project = project, @alias = account From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @counter) - - If @center_project IS NOT NULL -- start if, 4 + Select @DOT = dateofTransfer From #TempWeaning Where rowid = @counter + If @DOT IS NULL --start @DOT Begin - --Get the age of the rodent and weaning_rowid, species, sex, strain and vendorlocation - Select @ageindays = DateDiff(dd, date, GETDATE()),@weaning_rowid = weaning_rowid, - @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, - @RequestedArrivalDate = DateAdd(dd, 21, date), @ExpectedArrivalDate = DateAdd(dd, 21, date), - @slaDOB = date, @numAnimalsOrdered = numAlive, @DOT = dateofTransfer - From sla.TempWeaning Where rowid = @counter - - -- Check if the row is already transfered into the main SLA tables. If DOT is null means the row hasn't been transferred yet. - If @DOT IS NULL -- start if, 1 - Begin - --Insert weaning data into sla.purchase table as a pending order - INSERT INTO sla.purchase - (project, account, requestorid, vendorid, hazardslist, dobrequired, comments, confirmationnum, housingconfirmed, - iacucconfirmed, requestdate, orderdate, orderedby, objectid, container, createdby, created, modifiedby, modified, DARComments, VendorContact) - Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'',null,null,null,null,null,'',NEWID(), - '4831D09C-4169-1034-BAD2-5107380A9819',1294,GETDATE(),null,null,'','' - - --Get the newly created purchaseid from sla.purchase - Select top 1 @purchaseid = objectid From sla.purchase order by created desc - - --Insert data into purchasedetails with the newly created purchaseid above - INSERT INTO sla.purchaseDetails - (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, - totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, - objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) - VALUES - (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','', @sex, @strain, '',@numAnimalsOrdered, null, null,'','', - '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, - NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) - - --Update the sla.weaning row with the date of transfer date set for the transferred weaning row - Update sla.weaning - Set dateofTransfer = GETDATE() - Where rowid = @weaning_rowid - - Update sla.TempWeaning - Set dateofTransfer = GETDATE() - Where rowid = @weaning_rowid - - --Find if there are any rows with the same center project. Then create them under one purchaseId - --set the new counter - SET @counter2 = @counter + 1; - - WHILE @counter2 <= @Wcount -- start 2nd while - BEGIN - --Get projectid of the next row - Select @center_project2 = project From ehr.project Where name = (Select project From sla.TempWeaning Where rowid = @counter2) - + -- Get projectid, PI and account + Select @center_project = project, @alias = account From ehr.project Where name = (Select project From #TempWeaning Where rowid = @counter) + + -- Check if the row is already transferred into the main SLA tables. If DOT is null means the row hasn't been transferred yet. + --Insert weaning data into sla.purchase table as a pending order + INSERT INTO sla.purchase + (project, account, requestorid, vendorid, hazardslist, dobrequired, comments, confirmationnum, housingconfirmed, + iacucconfirmed, requestdate, orderdate, orderedby, objectid, container, createdby, created, modifiedby, modified, DARComments, VendorContact) + Select @center_project, @alias ,'7B3F1ED1-4CD9-4D9A-AFF4-FE0618D49C4B','E1EE1B64-B7BE-1035-BFC4-5107380AE41E','',0,'',null,null,null,null,null,'',NEWID(), + '4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,'','' + + --Get the newly created purchaseid from sla.purchase + Select top 1 @purchaseid = objectid From sla.purchase order by created desc + + --Insert data into purchasedetails with the newly created purchaseid above + INSERT INTO sla.purchaseDetails + (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, + totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, + objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) + Select @purchaseid, species, CONVERT(VARCHAR, DateDiff(dd, date, GETDATE())) + ' days', '','','',sex, strain,'',numAlive,null,null,'','', + '','',DateAdd(dd, 21, date), DateAdd(dd, 21, date),null,'','',null, + NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,date,vendorLocation + From #TempWeaning Where rowid = @counter + + --Update the sla.weaning row with the date of transfer date set for the transferred weaning row + Update sla.weaning + Set dateofTransfer = GETDATE() Where rowid = (Select orig_weaning_rowid from #TempWeaning Where rowid = @counter) + + Update #TempWeaning + Set dateofTransfer = GETDATE() Where rowid = @counter + + --Find if there are any rows with the same center project. Then create them under the same purchaseId + --set the new counter + SET @counter2 = @counter + 1; + WHILE @counter2 <= @Wcount -- start 2nd while + BEGIN + Select @DOT2 = dateofTransfer From #TempWeaning Where rowid = @counter2 + If @DOT2 IS NULL + Begin + --Get projectid of the next row + Select @center_project2 = project From ehr.project Where name = (Select project From #TempWeaning Where rowid = @counter2) + + --If they are same projects, then use the the same purchaseid when creating the purchase details record If (@center_project = @center_project2) -- start if, 2 Begin - Select @ageindays = DateDiff(dd, date, GETDATE()),@weaning_rowid = weaning_rowid, - @species = species, @sex = sex, @strain = strain, @vendorlocation = vendorlocation, - @RequestedArrivalDate = DateAdd(dd, 21, date), @ExpectedArrivalDate = DateAdd(dd, 21, date), - @slaDOB = date, @numAnimalsOrdered = numAlive, @DOT = dateofTransfer - From sla.TempWeaning Where rowid = @counter2 - - If @DOT IS NULL -- start if, 3 - Begin - INSERT INTO sla.purchaseDetails - (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, - totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, - objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) - VALUES - (@purchaseId, @species, CONVERT(VARCHAR, @ageindays) + ' days','','','',@sex,@strain, '',@numAnimalsOrdered,null,null,'','', - '','',@RequestedArrivalDate,@ExpectedArrivalDate,null,'','',null, - NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,@slaDOB,@vendorLocation) - - Update sla.weaning - Set dateofTransfer = GETDATE() - Where rowid = @weaning_rowid - - Update sla.TempWeaning - Set dateofTransfer = GETDATE() - Where rowid = @weaning_rowid - - End -- end if, 3 + INSERT INTO sla.purchaseDetails + (purchaseid, species, age, weight, weight_units, gestation, gender, strain, room, animalsordered, animalsreceived, boxesquantity, costperanimal, shippingcost, + totalcost, housingInstructions, requestedarrivaldate, expectedarrivaldate, receiveddate, receivedby, cancelledby, datecancelled, + objectid, container, createdby, created, modifiedby, modified, sla_DOB, vendorLocation) + Select @purchaseid, species, CONVERT(VARCHAR, DateDiff(dd, date, GETDATE())) + ' days', '','','',sex, strain, '',numAlive,null,null,'','', + '','',DateAdd(dd, 21, date), DateAdd(dd, 21, date),null,'','',null, + NewId(),'4831D09C-4169-1034-BAD2-5107380A9819',1003,GETDATE(),null,null,date,vendorLocation + From #TempWeaning Where rowid = @counter2 + + Update sla.weaning + Set dateofTransfer = GETDATE() Where rowid = (Select orig_weaning_rowid from #TempWeaning Where rowid = @counter2) + + Update #TempWeaning + Set dateofTransfer = GETDATE() Where rowid = @counter2 End -- end if, 2 - SET @counter2 = @counter2 + 1; - END -- end, 2nd while - End -- end if, 1 - SET @counter = @counter + 1; - End -- end if, 4 + End --end DOT2 + SET @counter2 = @counter2 + 1; + END -- end, 2nd while + + End --end @DOT + SET @counter = @counter + 1; END -- end, 1st while - End -- end, BIG if -END + End -- end if, 1 + --Drop the temp table + IF EXISTS (SELECT * FROM tempdb.sys.tables WHERE name = '#TempWeaning') + BEGIN + DROP TABLE #TempWeaning; + END; +END Go \ No newline at end of file diff --git a/sla/resources/web/sla/form/CreatePurchaseOrder.js b/sla/resources/web/sla/form/CreatePurchaseOrder.js index 32faa2780..0f36414e5 100644 --- a/sla/resources/web/sla/form/CreatePurchaseOrder.js +++ b/sla/resources/web/sla/form/CreatePurchaseOrder.js @@ -458,17 +458,18 @@ Ext4.define('SLA.panel.PurchaseOrderRequest', { } //added by Kolli - //Added the new room to the list: NSI 134 by Kolli on 4/19 - if (speciesRowData.room == 'NSI 0123D' || speciesRowData.room == 'NSI 0125D' || speciesRowData.room == 'NSI 0134') + //Added the new room to the list: NSI 134 on 4/19 + //Added more locations based on the tkt #11850 on 1/16/25. Kept the NSI names too as the historical data still exists + if (speciesRowData.room == 'NSI 0123D' || speciesRowData.room == 'NSI 0125D' || speciesRowData.room == 'NSI 0134' || speciesRowData.room == 'JNB 0123D' || speciesRowData.room == 'JNB 0125D' || speciesRowData.room == 'JNB 0134') { isHazardsRequired = true; } }, this); - //if (isHazardsRequired && (purchaseData.listHazard == null || purchaseData.listHazard == '')) if (isHazardsRequired && (purchaseData.hazardslist == null || purchaseData.hazardslist == '')) { - this.showErrorMsg('You have selected Location(s): NSI 0123D or NSI 0125D or NSI 134. Please list the biological or chemical agents! '); + // this.showErrorMsg('You have selected Location(s): NSI 0123D or NSI 0125D or NSI 134. Please list the biological or chemical agents! '); + this.showErrorMsg('Please list the biological or chemical agents for this location! '); return; } diff --git a/sla/resources/web/sla/form/PurchaseOrderForm.js b/sla/resources/web/sla/form/PurchaseOrderForm.js index 98d0a12a3..4ff9a2424 100644 --- a/sla/resources/web/sla/form/PurchaseOrderForm.js +++ b/sla/resources/web/sla/form/PurchaseOrderForm.js @@ -171,7 +171,8 @@ Ext4.define('SLA.form.PurchaseForm', { name: 'hazardslist', value: this.initData['hazardslist'], disabled: this.isUpdate && !LABKEY.user.canUpdate, - fieldLabel: 'List Biological or Chemical agents (Required for NSI 0123D, NSI 0125D, NSI 0134)', + // fieldLabel: 'List Biological or Chemical agents (Required for NSI 0123D, NSI 0125D, NSI 0134)', + fieldLabel: 'List Biological or Chemical agents (Required for locations 0123D, 0125D and 0134)', labelWidth: this.FIELD_LABEL_WIDTH }); From cda6c608c9081f4e2d3cb097e631901f8da6390b Mon Sep 17 00:00:00 2001 From: kollil Date: Sun, 19 Jan 2025 19:26:16 -0800 Subject: [PATCH 23/24] Updated sql --- .../schemas/dbscripts/sqlserver/sla-23.002-23.003.sql | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql index 8978e293e..56a05ddc1 100644 --- a/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql +++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql @@ -48,10 +48,10 @@ AS DECLARE @WCount int, - @center_project int, - @center_project2 int, @alias varchar(100), @purchaseId entityid, + @center_project int, + @center_project2 int, @counter int, @counter2 int, @DOT DATETIME, @@ -64,7 +64,7 @@ BEGIN --Found entries, so, insert those records into SLA.purchase and SLA.purchasedetails tables If @WCount > 0 -- start if, 1 Begin - --Create a local temp table to process the weaning data + --Create a local temp table to process the weaning data. The table drops automatically at the end of the session CREATE TABLE #TempWeaning ( rowid int IDENTITY(1,1) NOT NULL, orig_weaning_rowid INTEGER, @@ -176,7 +176,7 @@ BEGIN END -- end, 1st while End -- end if, 1 - --Drop the temp table + --Drop the temp table incase it exists... IF EXISTS (SELECT * FROM tempdb.sys.tables WHERE name = '#TempWeaning') BEGIN DROP TABLE #TempWeaning; From a680069cb50c9ff742fdc4b4fcb4157372878446 Mon Sep 17 00:00:00 2001 From: kollil Date: Tue, 21 Jan 2025 09:50:03 -0800 Subject: [PATCH 24/24] Removed tempweaning defintion from xml. --- sla/resources/schemas/sla.xml | 50 +---------------------------------- 1 file changed, 1 insertion(+), 49 deletions(-) diff --git a/sla/resources/schemas/sla.xml b/sla/resources/schemas/sla.xml index 4a8c21d46..c37046dd1 100644 --- a/sla/resources/schemas/sla.xml +++ b/sla/resources/schemas/sla.xml @@ -517,52 +517,4 @@ - - TempWeaning - DETAILED - - - - - - - - - - PI - - - Date - - - Center Project - - - Vendor Location - - - DOB - - - DOM - - - Species - - - Sex - - - Strain - - - Alive Pups - - - Date of Transfer - - - -
- - \ No newline at end of file + \ No newline at end of file