Skip to content

Commit e5d18b6

Browse files
Updated NewAnimalData for SourceInstitutionLocation (#352)
Added column for source Institution 04.05.2021 srr
1 parent afce71c commit e5d18b6

4 files changed

Lines changed: 72 additions & 2 deletions

File tree

snprc_ehr/resources/queries/snprc_ehr/ExportNewAnimalData.sql

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@
66
77
88
srr 07.07.2020
9-
Syncing with current table structure 02.02.21
9+
Syncing with current table structure
10+
srr 02.02.2021
11+
Adding SourceInstitution column to hold source institution for
12+
non-birth acquisitions.
13+
srr 03.31.2021
1014
********************************************************/
1115

1216
SELECT
@@ -15,6 +19,7 @@ SELECT
1519
n.BirthCode as Bd_Status,
1620
n.AcquisitionType,
1721
n.AcqDate AS AcquisitionDate,
22+
n.SourceInstitutionLocation,
1823
n.species,
1924
n.Gender,
2025
n.sire,
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*******************************************************
2+
New table to load data from new animal wizard.
3+
Data will be ETLed back down to animal database
4+
5+
srr 01.28.2020
6+
7+
May not use all columns.
8+
I defaulted to nvarchar(400) if unsure of datatype.
9+
May need to change datatypes to match those in lookup tables.
10+
11+
srr 03.09.2020 version 20.003
12+
Changed to ints for values that have a dropdown.
13+
No Real data, therefore dropping table and re-recreating.
14+
srr 06.08.2020 version 20.007
15+
Added column for BirthCode.
16+
1 DOB accurate
17+
2 Month-Year accurate
18+
3 Year accurate
19+
No Real data, therefore dropping table and re-recreating.
20+
21+
srr 06.24.2020
22+
Changed Diet, AnimalAccount and IACUC to strings
23+
srr 04012021 version 21.000
24+
*******************************************************/
25+
26+
EXEC core.fn_dropifexists 'NewAnimalData','snprc_ehr', 'TABLE';
27+
28+
29+
CREATE TABLE snprc_ehr.NewAnimalData
30+
(
31+
Id nvarchar(32) NOT NULL,
32+
BirthDate datetime NULL,
33+
BirthCode int NULL,
34+
AcquisitionType int NULL,
35+
AcqDate datetime NULL,
36+
SourceInstitutionLocation nvarchar(10) NULL,
37+
Gender nvarchar(10) NULL,
38+
Sire nvarchar(32) NULL,
39+
Dam nvarchar(32) NULL,
40+
Species nvarchar(3) NULL,
41+
Colony int NULL,
42+
AnimalAccount nvarchar(16) NULL,
43+
OwnerInstitution int NULL,
44+
ResponsibleInstitution int NULL,
45+
Room int NULL,
46+
Cage int NULL,
47+
Diet nvarchar(20) NULL,
48+
Pedigree int NULL,
49+
IACUC nvarchar(200) NULL,
50+
Created datetime NULL,
51+
CreatedBy dbo.USERID NULL,
52+
Modified datetime NULL,
53+
ModifiedBy dbo.USERID NULL,
54+
Container dbo.ENTITYID NOT NULL,
55+
objectid uniqueidentifier NOT NULL,
56+
CONSTRAINT PK_snprc_NEWANIMALDATA PRIMARY KEY (Id)
57+
);

snprc_ehr/resources/source_queries/create_CAMP_NewAnimalData.sql

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ EXEC('CREATE SCHEMA [TAC_src] AUTHORIZATION [DBO]');
3131
-- new schema
3232
DROP TABLE IF EXISTS TAC_src.NewAnimalData;
3333

34+
/*****************************************************
35+
Added SourceInstitutionLocation to hold
36+
source location for non-birth acquisitions
37+
04.01.2021 srr
38+
******************************************************/
39+
40+
3441
CREATE TABLE TAC_src.NewAnimalData
3542
(
3643
tid INT IDENTITY,
@@ -39,6 +46,7 @@ CREATE TABLE TAC_src.NewAnimalData
3946
Bd_Status INT NULL,
4047
AcquisitionType INT NULL,
4148
AcquisitionDate DATETIME NULL, -- Start date for Data Tables
49+
SourceInstitutionLocation VARCHAR(10) NULL, -- handle as room
4250
Gender CHAR(1) NULL,
4351
Sire VARCHAR(6) NULL,
4452
Dam VARCHAR(6) NULL,

snprc_ehr/src/org/labkey/snprc_ehr/SNPRC_EHRModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ public String getName()
119119
@Override
120120
public @Nullable Double getSchemaVersion()
121121
{
122-
return 21.000;
122+
return 21.001;
123123
}
124124

125125
@Override

0 commit comments

Comments
 (0)