From 85910c3ff26688e8c695b039aad7f62b44566d2e Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 27 Jul 2026 10:55:50 -0700 Subject: [PATCH 1/2] =?UTF-8?q?Modified=20Pregnancy=20Confirmation=20to=20?= =?UTF-8?q?the=20Clinical=20Snapshot=20reports=20to=20e=E2=80=A6=20(#1782)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Excluded Gestation days from the requirements for displaying a female pregnancy records. --------- Co-authored-by: blasar --- onprc_ehr/resources/queries/study/pregnancyGestation.sql | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/onprc_ehr/resources/queries/study/pregnancyGestation.sql b/onprc_ehr/resources/queries/study/pregnancyGestation.sql index 5fbcd63eb..685b967ca 100644 --- a/onprc_ehr/resources/queries/study/pregnancyGestation.sql +++ b/onprc_ehr/resources/queries/study/pregnancyGestation.sql @@ -18,16 +18,17 @@ SELECT m.id, m.date, m.gestation_days as gestation_days, -TIMESTAMPADD('SQL_TSI_DAY',(p.Gestation - m.gestation_days), m.date) as ExpectedDelivery, -m.QCState + TIMESTAMPADD('SQL_TSI_DAY',(p.Gestation - m.gestation_days), m.date) as ExpectedDelivery, + m.QCState FROM study.pregnancyConfirmation m INNER JOIN ehr_lookups.species p on (m.Id.DataSet.demographics.species = p.common ) And m.date in (select max(s.date) AS d from study.pregnancyConfirmation s where s.id = m.id) And m.Id.DataSet.demographics.calculated_status.code = 'Alive' -And p.Gestation is not null And (m.outcome.birthDate >= cast(now() as date) or m.outcome.birthDate is null) And (Select count(*) from ehr.snomed_tags stg where stg.code.code = 'F-30980' And stg.id = m.id And stg.date >= m.date ) = 0 And m.gestation_days is not null +And p.Gestation is not null + From 3117a7b751d2438c098a7db232fc861d94c8dbe2 Mon Sep 17 00:00:00 2001 From: Ohsudev <76500320+Ohsudev@users.noreply.github.com> Date: Mon, 27 Jul 2026 14:59:15 -0700 Subject: [PATCH 2/2] 26.3 fb master problem updates (#1798) Created a new program that will update historical Master Problem Wound records to a different name. --- .../sqlserver/onprc_ehr-26.001-26.002.sql | 141 ++++++++++++++++++ onprc_ehr/resources/schemas/onprc_ehr.xml | 21 +++ .../org/labkey/onprc_ehr/ONPRC_EHRModule.java | 2 +- 3 files changed, 163 insertions(+), 1 deletion(-) create mode 100644 onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-26.001-26.002.sql diff --git a/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-26.001-26.002.sql b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-26.001-26.002.sql new file mode 100644 index 000000000..3f19b9955 --- /dev/null +++ b/onprc_ehr/resources/schemas/dbscripts/sqlserver/onprc_ehr-26.001-26.002.sql @@ -0,0 +1,141 @@ + +CREATE TABLE onprc_ehr.Rpt_TempProblemList( + searchid integer IDENTITY(100,1) NOT NULL, + animalid varchar(200) NULL, + date smalldatetime NULL, + objectid varchar(4000) NULL, + caseid varchar(4000) NULL + + ) ON [PRIMARY] + GO + +CREATE TABLE onprc_ehr.Rpt_TempProblemListMaster( + searchid integer IDENTITY(100,1) NOT NULL, + animalid varchar(200) NULL, + date smalldatetime NULL, + objectid varchar(4000) NULL, + caseid varchar(4000) NULL + +) ON [PRIMARY] + GO + + + + +/* +** +** Created by Date Comment +** +** blasa 7-7-2026 Process to update historical problem list records +** +** +** +**/ + +CREATE Procedure onprc_ehr.s_MasterProblemHistoricalProcess + + +AS + + +declare + + + @TempSearchKey Int, + @Searchkey Int, + @AnimalID varchar(100), + @date smalldatetime, + @objectid varchar(4000), + @caseid varchar(4000) + + +Begin + + + ----- Reset the last two months only + + Delete onprc_ehr.Rpt_TempProblemList + + If @@Error <> 0 + GoTo Err_Proc + + + + Set @Tempsearchkey = 0 + Set @Searchkey = 0 + Set @Animalid = '' + Set @date = null + Set @objectid = null + Set @caseid = null + + --- Set initial processing + + Insert into onprc_ehr.Rpt_TempProblemList + select participantid, + date, + objectid, + caseid + from studydataset.c6d200_problem + Where category = 'Wound' + And subcategory = 'Digit Amputation' + And qcstate = 18 + + Order by participantid + + Select top 1 @SearchKey = searchID from onprc_ehr.Rpt_TempProblemList + Order by searchid + + + While @Tempsearchkey < @SearchKey + Begin + + Set @Animalid = '' + Set @date = null + Set @objectid = null + + select @animalid = animalid, @Date = date, @Objectid = objectid + from Rpt_TempProblemList Where searchid = @Searchkey + + -------Begin updating records + + + Update pb + Set pb.subcategory = 'Digit Removal/Caudectomy' + From studydataset.c6d200_problem pb + Where pb.Participantid = @Animalid + And pb.objectid = @objectid + + + If @@Error <> 0 + GoTo Err_Proc + + + Set @TempSearchkey = @Searchkey + + Select Top 1 @SearchKey = searchid From onprc_ehr.Rpt_TempProblemList + Where searchid > @Tempsearchkey + Order by searchid + + + + + End ------(While @tempsearchkey < @Searchkey) + + ---- Create an audit record of these entries + + insert into onprc_ehr.Rpt_TempProblemListMaster + Select animalid, date, objectid, caseid + from onprc_ehr.Rpt_TempProblemList + + + Return 0 + + Err_Proc: Return 1 + + + +END + + + + diff --git a/onprc_ehr/resources/schemas/onprc_ehr.xml b/onprc_ehr/resources/schemas/onprc_ehr.xml index fc32decdf..2e4c069f5 100644 --- a/onprc_ehr/resources/schemas/onprc_ehr.xml +++ b/onprc_ehr/resources/schemas/onprc_ehr.xml @@ -1537,5 +1537,26 @@ + + + + + + + + +
+ + + + + + + + + +
+ + diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java index 1e5ce0399..5d014e1b8 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/ONPRC_EHRModule.java @@ -124,7 +124,7 @@ public String getName() @Override public @Nullable Double getSchemaVersion() { - return 26.001; + return 26.002; } @Override