Strain
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/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,
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/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
new file mode 100644
index 000000000..56a05ddc1
--- /dev/null
+++ b/sla/resources/schemas/dbscripts/sqlserver/sla-23.002-23.003.sql
@@ -0,0 +1,185 @@
+-- =================================================================================================
+--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';
+--Drop Stored proc if exists
+EXEC core.fn_dropifexists 'SLAWeaningDataTransfer', 'onprc_ehr', 'PROCEDURE';
+GO
+
+CREATE TABLE sla.weaning (
+ rowid int IDENTITY(1,1) NOT NULL,
+ investigator varchar(250),
+ date DATETIME, -- Pup's DOB
+ project varchar(200),
+ vendorLocation varchar(200),
+ 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, --The date of transfer into SLA tables
+ createdBy USERID,
+ created DATETIME,
+ modifiedBy USERID,
+ modified DATETIME,
+
+ CONSTRAINT PK_weaning PRIMARY KEY (rowid)
+);
+
+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 >= 21 days and enter
+-- the data into SLA tables
+-- ==========================================================================================
+
+CREATE PROCEDURE [onprc_ehr].[SLAWeaningDataTransfer]
+AS
+
+DECLARE
+ @WCount int,
+ @alias varchar(100),
+ @purchaseId entityid,
+ @center_project int,
+ @center_project2 int,
+ @counter int,
+ @counter2 int,
+ @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
+
+ --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. The table drops automatically at the end of the session
+ 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
+
+ --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
+ created - (onprc-is) - 1003
+ */
+
+ Select @DOT = dateofTransfer From #TempWeaning Where rowid = @counter
+ If @DOT IS NULL --start @DOT
+ Begin
+ -- 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
+ 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
+ End --end DOT2
+ SET @counter2 = @counter2 + 1;
+ END -- end, 2nd while
+
+ End --end @DOT
+ SET @counter = @counter + 1;
+ END -- end, 1st while
+ End -- end if, 1
+
+ --Drop the temp table incase it exists...
+ 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/schemas/sla.xml b/sla/resources/schemas/sla.xml
index 0353a95a8..c37046dd1 100644
--- a/sla/resources/schemas/sla.xml
+++ b/sla/resources/schemas/sla.xml
@@ -461,4 +461,60 @@
-
\ No newline at end of file
+
+ 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
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sla/resources/views/SLA_LandingPage.html b/sla/resources/views/SLA_LandingPage.html
index 11e16ef45..a3cef8791 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/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
});
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')
},
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