diff --git a/onprc_ehr/resources/queries/ehr/protocol_counts.js b/onprc_ehr/resources/queries/ehr/protocol_counts.js index 13bd324a8..6b199fc88 100644 --- a/onprc_ehr/resources/queries/ehr/protocol_counts.js +++ b/onprc_ehr/resources/queries/ehr/protocol_counts.js @@ -10,4 +10,24 @@ function onUpsert(helper, scriptErrors, row, oldRow){ if (row && row.project){ EHR.Server.Utils.addError(scriptErrors, 'project', 'You should probably leave this field blank. Animal counts are usually associated with the IACUC itself. The project field was left in place to support IRIS data, but should not be used unless there is a good reason to do so.', 'INFO'); } -} \ No newline at end of file +} +//Validate dates. Kollil, 1/19/2021 +EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.BEFORE_UPSERT, 'ehr', 'protocol_counts', function(helper, scriptErrors, row, oldRow) +{ + var start = row.start; + var end = row.enddate; + //console.log ("In 11"); + + // Check if startdate and enddate are not empty + if ((start == null && end == null) || (start == null && end != null) || (start != null && end == null)) { + EHR.Server.Utils.addError(scriptErrors, 'start', 'Must enter Start and End dates', 'ERROR'); + } + + //enddate: verify enddate not prior to startdate + if (start != null && end != null) { + if (start.getTime() > end.getTime()) { + EHR.Server.Utils.addError(scriptErrors, 'enddate', 'End date must be after Start date', 'ERROR'); + } + } + +}); \ No newline at end of file diff --git a/onprc_ehr/resources/queries/onprc_ehr/housing_transfers.query.xml b/onprc_ehr/resources/queries/onprc_ehr/housing_transfers.query.xml index c90fabf37..2d304d87a 100644 --- a/onprc_ehr/resources/queries/onprc_ehr/housing_transfers.query.xml +++ b/onprc_ehr/resources/queries/onprc_ehr/housing_transfers.query.xml @@ -38,13 +38,13 @@ Housing Type - column> + Housing Condition - column> + Reason For Move - column> + diff --git a/onprc_ehr/resources/queries/study/PMIC_ChargeTypes.sql b/onprc_ehr/resources/queries/study/PMIC_ChargeTypes.sql index 02ca552fa..90edf3d2a 100644 --- a/onprc_ehr/resources/queries/study/PMIC_ChargeTypes.sql +++ b/onprc_ehr/resources/queries/study/PMIC_ChargeTypes.sql @@ -1,3 +1,3 @@ SELECT chargetype -From Site.{substitutePath moduleProperty('onprc_billing','BillingContainer')}.onprc_billing.chargeUnits -Where servicecenter is null or servicecenter like 'PMIC' \ No newline at end of file +From Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing.chargeUnits +Where servicecenter is null or servicecenter like 'PMIC' diff --git a/onprc_ehr/resources/views/PMIC_Wiki.html b/onprc_ehr/resources/views/PMIC_Wiki.html new file mode 100644 index 000000000..db50c8c4e --- /dev/null +++ b/onprc_ehr/resources/views/PMIC_Wiki.html @@ -0,0 +1,47 @@ +

This page contains the links related to the PMIC data entry services.

+

 

+ +

This screen contains the PMIC services request data entry form

+ +

This screen contains the data entry panels for PET Scan, CT Scan, SPECT, Angio, Ultrasound and DEXA procedures.

+ +

New tabs are created for each PMIC procedure under "Imaging" tab on the Animal history form. 

+
    +
  1. PMIC - PET:  Click on this tab to view the animal's PET Imaging data.
  2. +
  3. PMIC - CT:  Click on this tab to view the animal's CT Imaging data.
  4. +
  5. PMIC - SPECT:  Click on this tab to view the animal's SPECT Imaging data.
  6. +
  7. PMIC - Angio:  Click on this tab to view the animal's Angio Imaging data.
  8. +
  9. PMIC - Ultrasound:  Click on this tab to view the animal's Ultrasound Imaging data.
  10. +
  11. PMIC - DEXA:  Click on this tab to view the animal's DEXA Imaging data.
  12. +
+ +

This is the maintenance screen for the PMIC reference data such as PET radioisotopes, SPECT radioisotopes, Ultrasound procedures, DEXA values & Animal position values and etc. The PMIC admin can add/edit any of these items.

+

A new item is added by clicking the "IMPORT BULK DATA" on the top panel and entering valid "Value" and "Name" fields with a blank "End Date" field .

+

An item can be disabled by clicking the "EDIT" button and set a valid "End Date". The item will be deleted from the appropriate drop down list(s). 

+ +
    +
  1. Click here to view, Today's scheduled events
  2. +
  3. Click here to view, Weekly scheduled events 
  4. +
+

 

+

 

\ No newline at end of file diff --git a/onprc_ehr/resources/views/PMIC_Wiki.view.xml b/onprc_ehr/resources/views/PMIC_Wiki.view.xml new file mode 100644 index 000000000..c35f7ebb7 --- /dev/null +++ b/onprc_ehr/resources/views/PMIC_Wiki.view.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/onprc_ehr/resources/views/PMIC_Wiki.webpart.xml b/onprc_ehr/resources/views/PMIC_Wiki.webpart.xml new file mode 100644 index 000000000..c732962af --- /dev/null +++ b/onprc_ehr/resources/views/PMIC_Wiki.webpart.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PMICRequestFormType.java b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PMICRequestFormType.java index 1ab3e5eff..a263f146b 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PMICRequestFormType.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/dataentry/PMICRequestFormType.java @@ -15,6 +15,7 @@ */ package org.labkey.onprc_ehr.dataentry; +import org.json.JSONObject; import org.labkey.api.ehr.dataentry.AnimalDetailsFormSection; import org.labkey.api.ehr.dataentry.DataEntryFormContext; import org.labkey.api.ehr.dataentry.FormSection; @@ -24,6 +25,8 @@ import org.labkey.api.view.template.ClientDependency; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; //Created: 5/23/2019 Kollil public class PMICRequestFormType extends RequestForm @@ -48,6 +51,18 @@ public PMICRequestFormType(DataEntryFormContext ctx, Module owner) } + //This function has a property that allows to schedule PMIC service requests in future with no num days restriction - By Kollil, 4/20/21 + @Override + public JSONObject toJSON() + { + JSONObject ret = super.toJSON(); + Map map = new HashMap<>(); + map.put("allowRequestsInDistantFuture", true); + ret.put("extraContext", map); + return ret; + } + + // // Added: 12-5-2019 R.Blasa Allow access only to PMIC Access group. // @Override // protected boolean canInsert() diff --git a/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java b/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java index 832cd6336..1e9f12afa 100644 --- a/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java +++ b/onprc_ehr/src/org/labkey/onprc_ehr/notification/ColonyAlertsNotification.java @@ -1110,18 +1110,31 @@ protected void pmicSchedulerAlert(final Container c, User u, final StringBuilder TableSelector ts1 = new TableSelector(ti1, null, null); long count1 = ts1.getRowCount(); - if (count > 0) {//Daily events count - msg.append("There are " + count + " PMIC events scheduled for today:"); - msg.append("

Click here to view them

\n"); + //Daily events count + if (count > 0) { + msg.append("" + count + " PMIC event(s) scheduled for today:"); + msg.append("

Click here to view the events in PRIME

\n"); + msg.append("
"); + } + else { + msg.append(" There are no PMIC events scheduled today! "); + msg.append("
"); + } + + //Weekly events count + if (count1 > 0) { + msg.append("" + count1 + " PMIC event(s) scheduled this week:"); + msg.append("

Click here to view the events in PRIME

\n"); msg.append("
"); } - if (count1 > 0) {//Weekly events count - msg.append("There are " + count1 + " PMIC events scheduled this week:"); - msg.append("

Click here to view them

\n"); + else { + msg.append(" There are no PMIC events scheduled this week! "); msg.append("
"); } + //Display the daily report in the email - if (count > 0) { + if (count > 0) + { Set columns = new HashSet<>(); columns.add(FieldKey.fromString("resourceid")); columns.add(FieldKey.fromString("startdate")); @@ -1136,86 +1149,76 @@ protected void pmicSchedulerAlert(final Container c, User u, final StringBuilder final Map colMap = QueryService.get().getColumns(ti, columns); TableSelector ts2 = new TableSelector(ti, colMap.values(), null, null); - count = ts2.getRowCount(); - if (count == 0) { - msg.append("There are no scheduled PMIC events"); - } - else { - msg.append("
Daily PMIC events:

\n"); - msg.append(""); - msg.append(""); - msg.append(""); - - ts2.forEach(new Selector.ForEachBlock() { - @Override - public void exec(ResultSet object) throws SQLException { - Results rs = new ResultsImpl(object, colMap); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - } - }); - msg.append("
Resource Id Start Date End Date Name Alias Quantity Comments Color Room Bldg
" + PageFlowUtil.filter(rs.getString("resourceid")) + "" + PageFlowUtil.filter(rs.getString("startdate")) + "" + PageFlowUtil.filter(rs.getString("enddate")) + "" + PageFlowUtil.filter(rs.getString("name")) + "" + PageFlowUtil.filter(rs.getString("alias")) + "" + PageFlowUtil.filter(rs.getString("quantity")) + "" + PageFlowUtil.filter(rs.getString("comments")) + "" + PageFlowUtil.filter(rs.getString("color")) + "" + PageFlowUtil.filter(rs.getString("room")) + "" + PageFlowUtil.filter(rs.getString("bldg")) + "
"); - } - //Display the weekly report in the email - if (count1 > 0) { - Set columns1 = new HashSet<>(); - columns1.add(FieldKey.fromString("resourceid")); - columns1.add(FieldKey.fromString("startdate")); - columns1.add(FieldKey.fromString("enddate")); - columns1.add(FieldKey.fromString("name")); - columns1.add(FieldKey.fromString("alias")); - columns1.add(FieldKey.fromString("quantity")); - columns1.add(FieldKey.fromString("comments")); - columns1.add(FieldKey.fromString("color")); - columns1.add(FieldKey.fromString("room")); - columns1.add(FieldKey.fromString("bldg")); - - final Map colMap1 = QueryService.get().getColumns(ti1, columns1); - TableSelector ts3 = new TableSelector(ti1, colMap1.values(), null, null); - count1 = ts3.getRowCount(); - - if (count1 == 0) { - msg.append("There are no scheduled PMIC events"); + msg.append("
Daily PMIC events:

\n"); + msg.append(""); + msg.append(""); + msg.append(""); + + ts2.forEach(new Selector.ForEachBlock() { + @Override + public void exec(ResultSet object) throws SQLException { + Results rs = new ResultsImpl(object, colMap); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); } - else { - msg.append("

Weekly PMIC events:

\n"); - msg.append("
Resource Id Start Date End Date Name Alias Quantity Comments Color Room Bldg
" + PageFlowUtil.filter(rs.getString("resourceid")) + "" + PageFlowUtil.filter(rs.getString("startdate")) + "" + PageFlowUtil.filter(rs.getString("enddate")) + "" + PageFlowUtil.filter(rs.getString("name")) + "" + PageFlowUtil.filter(rs.getString("alias")) + "" + PageFlowUtil.filter(rs.getString("quantity")) + "" + PageFlowUtil.filter(rs.getString("comments")) + "" + PageFlowUtil.filter(rs.getString("color")) + "" + PageFlowUtil.filter(rs.getString("room")) + "" + PageFlowUtil.filter(rs.getString("bldg")) + "
"); - msg.append(""); - msg.append(""); - - ts3.forEach(new Selector.ForEachBlock() { - @Override - public void exec(ResultSet object) throws SQLException { - Results rs1 = new ResultsImpl(object, colMap1); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - msg.append(""); - } - }); - msg.append("
Resource Id Start Date End Date Name Alias Quantity Comments Color Room Bldg
" + PageFlowUtil.filter(rs1.getString("resourceid")) + "" + PageFlowUtil.filter(rs1.getString("startdate")) + "" + PageFlowUtil.filter(rs1.getString("enddate")) + "" + PageFlowUtil.filter(rs1.getString("name")) + "" + PageFlowUtil.filter(rs1.getString("alias")) + "" + PageFlowUtil.filter(rs1.getString("quantity")) + "" + PageFlowUtil.filter(rs1.getString("comments")) + "" + PageFlowUtil.filter(rs1.getString("color")) + "" + PageFlowUtil.filter(rs1.getString("room")) + "" + PageFlowUtil.filter(rs1.getString("bldg")) + "
"); + }); + msg.append(""); + } + + //Display the weekly report in the email + if (count1 > 0) { + Set columns1 = new HashSet<>(); + columns1.add(FieldKey.fromString("resourceid")); + columns1.add(FieldKey.fromString("startdate")); + columns1.add(FieldKey.fromString("enddate")); + columns1.add(FieldKey.fromString("name")); + columns1.add(FieldKey.fromString("alias")); + columns1.add(FieldKey.fromString("quantity")); + columns1.add(FieldKey.fromString("comments")); + columns1.add(FieldKey.fromString("color")); + columns1.add(FieldKey.fromString("room")); + columns1.add(FieldKey.fromString("bldg")); + + final Map colMap1 = QueryService.get().getColumns(ti1, columns1); + TableSelector ts3 = new TableSelector(ti1, colMap1.values(), null, null); + + msg.append("
Weekly PMIC events:

\n"); + msg.append(""); + msg.append(""); + msg.append(""); + + ts3.forEach(new Selector.ForEachBlock() { + @Override + public void exec(ResultSet object) throws SQLException { + Results rs1 = new ResultsImpl(object, colMap1); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); + msg.append(""); } - } + }); + msg.append("
Resource Id Start Date End Date Name Alias Quantity Comments Color Room Bldg
" + PageFlowUtil.filter(rs1.getString("resourceid")) + "" + PageFlowUtil.filter(rs1.getString("startdate")) + "" + PageFlowUtil.filter(rs1.getString("enddate")) + "" + PageFlowUtil.filter(rs1.getString("name")) + "" + PageFlowUtil.filter(rs1.getString("alias")) + "" + PageFlowUtil.filter(rs1.getString("quantity")) + "" + PageFlowUtil.filter(rs1.getString("comments")) + "" + PageFlowUtil.filter(rs1.getString("color")) + "" + PageFlowUtil.filter(rs1.getString("room")) + "" + PageFlowUtil.filter(rs1.getString("bldg")) + "
"); } + } //End of PMIC alert @@ -1259,12 +1262,12 @@ protected void housingTransferAlert(final Container c, User u, final StringBuild if (count > 0) {//transfers count msg.append("
Housing Transfers:

"); msg.append("" + count + " animal transfers were found in last 24 hours:"); - msg.append("

Click here to view them

\n"); + msg.append("

Click here to view the transfers in PRIME

\n"); msg.append("
"); } if (count == 0) { - msg.append("There were no animal transfers!"); + msg.append("There are no animal transfers today!
"); } //Display the daily report in the email @@ -1294,7 +1297,7 @@ protected void housingTransferAlert(final Container c, User u, final StringBuild msg.append(""); msg.append(" Yellow row indicates animal transferred into an empty room. "); msg.append(""); - msg.append(" Blue cell indicates animal has active Clinical treatments. "); + msg.append(" Blue cell indicates animal has active Clinical treatments with no Diets. "); msg.append(""); msg.append(" Orange cell indicates animal has active Clinical treatments including Diets (or) just Diets. "); msg.append(""); diff --git a/sla/resources/queries/sla/PlandProtocols.sql b/sla/resources/queries/sla/PlandProtocols.sql index 26d5091ff..508ba6041 100644 --- a/sla/resources/queries/sla/PlandProtocols.sql +++ b/sla/resources/queries/sla/PlandProtocols.sql @@ -1,42 +1,87 @@ - SELECT a.project as ProjectID, -aa.species, -a.account as Alias, -y.grantNumber as OGAGrantNumber, -a.protocol as ParentIACUC, -a.title as Title, -a.name as IACUCCode, -a.startdate as StartDate, -a.enddate as EndDate, -i.FirstName, -i.LastName, -i.Division, -p.external_id, -i.LastName + ': ' + a.name + '('+ p.external_id +')' + ' - ' + a.title + ' (Species: ' + aa.species + ')' as PIIacuc + aa.species, + a.account as Alias, + y.grantNumber as OGAGrantNumber, + a.protocol as ParentIACUC, + a.title as Title, + a.name as IACUCCode, + a.startdate as StartDate, + a.enddate as EndDate, + i.FirstName, + i.LastName, + i.Division, + p.external_id, + i.LastName + ': ' + a.name + '('+ p.external_id +')' + ' Group Id & Name - ' + aa. Group_Id + ', '+ aa.Group_Name + ' - ' + a.title + ' (Species: ' + aa.species + ')' as PIIacuc FROM Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project a LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.protocol p ON p.protocol = a.protocol -LEFT JOIN onprc_ehr.investigators i ON i.rowId = a.investigatorId -LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa ON a.protocol = aa.protocol -LEFT JOIN Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing_public.aliases y ON y.alias = a.account + LEFT JOIN onprc_ehr.investigators i ON i.rowId = a.investigatorId + LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals_BreedingGroups aa ON a.protocol = aa.protocol + --LEFT JOIN "/onprc/admin/finance/public".onprc_billing_public.aliases y ON y.alias = a.account + LEFT JOIN Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing_public.aliases y ON y.alias = a.account WHERE - -- filter based on the current date compared with the start and end dates - ( +-- filter based on the current date compared with the start and end dates + ( (aa.StartDate IS NOT NULL AND aa.EndDate IS NULL AND now() > aa.StartDate) OR (aa.StartDate IS NULL AND aa.EndDate IS NOT NULL AND now() < aa.EndDate) OR (now() between aa.StartDate AND aa.EndDate) - ) + ) AND - --Check for the project enddate. Added by LK on 1/16/2019 - (now() between a.StartDate AND a.EndDate) - -- and filtered based on dataAccess for the given user +--Check for the project enddate. Added by LK on 1/16/2019 + (now() between a.StartDate AND a.EndDate) +-- and filtered based on dataAccess for the given user AND - ( + ( (SELECT max(rowid) as expr FROM onprc_billing.dataAccess da - -- current logged in user is the dataAccess user - WHERE isMemberOf(da.userid) - -- has access to all data - AND (da.allData = true - -- has access to the specified investigatorId and the specified project (if applicable) - OR (da.investigatorId = i.rowId AND (da.project IS NULL OR da.project = a.project))) +-- current logged in user is the dataAccess user + WHERE isMemberOf(da.userid) +-- has access to all data + AND (da.allData = true +-- has access to the specified investigatorId and the specified project (if applicable) + OR (da.investigatorId = i.rowId AND (da.project IS NULL OR da.project = a.project))) ) IS NOT NULL - ) + ) + + + +-- +-- SELECT a.project as ProjectID, +-- aa.species, +-- a.account as Alias, +-- y.grantNumber as OGAGrantNumber, +-- a.protocol as ParentIACUC, +-- a.title as Title, +-- a.name as IACUCCode, +-- a.startdate as StartDate, +-- a.enddate as EndDate, +-- i.FirstName, +-- i.LastName, +-- i.Division, +-- p.external_id, +-- i.LastName + ': ' + a.name + '('+ p.external_id +')' + ' - ' + a.title + ' (Species: ' + aa.species + ')' as PIIacuc +-- FROM Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project a +-- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.protocol p ON p.protocol = a.protocol +-- LEFT JOIN onprc_ehr.investigators i ON i.rowId = a.investigatorId +-- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa ON a.protocol = aa.protocol +-- LEFT JOIN Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing_public.aliases y ON y.alias = a.account +-- WHERE +-- -- filter based on the current date compared with the start and end dates +-- ( +-- (aa.StartDate IS NOT NULL AND aa.EndDate IS NULL AND now() > aa.StartDate) OR +-- (aa.StartDate IS NULL AND aa.EndDate IS NOT NULL AND now() < aa.EndDate) OR +-- (now() between aa.StartDate AND aa.EndDate) +-- ) +-- AND +-- --Check for the project enddate. Added by LK on 1/16/2019 +-- (now() between a.StartDate AND a.EndDate) +-- -- and filtered based on dataAccess for the given user +-- AND +-- ( +-- (SELECT max(rowid) as expr FROM onprc_billing.dataAccess da +-- -- current logged in user is the dataAccess user +-- WHERE isMemberOf(da.userid) +-- -- has access to all data +-- AND (da.allData = true +-- -- has access to the specified investigatorId and the specified project (if applicable) +-- OR (da.investigatorId = i.rowId AND (da.project IS NULL OR da.project = a.project))) +-- ) IS NOT NULL +-- ) diff --git a/sla/resources/queries/sla/ProtocolProjectsUsage.sql b/sla/resources/queries/sla/ProtocolProjectsUsage.sql index f7f7aab1f..88c336188 100644 --- a/sla/resources/queries/sla/ProtocolProjectsUsage.sql +++ b/sla/resources/queries/sla/ProtocolProjectsUsage.sql @@ -1,143 +1,286 @@ - - +--SLA usage numbers including Breeding groups data SELECT -a.project as ProjectID, -a.name AS Project, -p.external_id as eIACUCNum, -a.title as Title, -i.LastName || ', ' || i.FirstName AS PIName, -x.account as Alias, -y.projectNumber as OGAProjectNumber, -y.grantNumber as OGAGrantNumber, -f.lastname || ', ' || f.firstName as FiscalAuthorityName, -aa.Species, -aa.Gender, -aa.Strain, -aa.Allowed AS NumAllowed, -calc.NumUsed, -aa.StartDate, -aa.EndDate + a.project as ProjectID, + a.name AS Project, + p.external_id as eIACUCNum, + a.title as Title, + i.LastName || ', ' || i.FirstName AS PIName, + x.account as Alias, + y.projectNumber as OGAProjectNumber, + y.grantNumber as OGAGrantNumber, + f.lastname || ', ' || f.firstName as FiscalAuthorityName, + aa.Species, + aa.Gender, + aa.Strain, + aa.Allowed AS NumAllowed, + calc.NumUsed, + aa.StartDate, + aa.EndDate, + CASE + WHEN aa.BreedingAllowed = '1' THEN 'Yes' + ELSE 'No' + END AS BreedingAllowed, + aa.Group_Id, + aa.Group_Name FROM Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project a LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.protocol p ON p.protocol = a.protocol -LEFT JOIN onprc_ehr.investigators i ON i.rowId = a.investigatorId -LEFT JOIN onprc_billing.fiscalAuthorities f ON f.rowid = i.financialanalyst -LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa ON a.protocol = aa.protocol -LEFT JOIN (select * from onprc_billing.projectAccountHistory z where (z.StartDate IS NOT NULL AND z.EndDate IS NOT NULL AND now() between z.StartDate AND z.EndDate)) x ON a.project = x.project -LEFT JOIN Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing_public.aliases y ON y.alias = x.account -LEFT JOIN ( --- SELECT i.protocol,species,gender,sum(animalsreceived) AS NumUsed --- FROM sla.purchasedetails pd, sla.purchase p --- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i ON p.project = i.project --- WHERE p.objectid = pd.purchaseid AND animalsreceived IS NOT NULL --- GROUP BY i.protocol,species,gender - ---Changed by LK on 5/30 to get the accurate numused. + LEFT JOIN onprc_ehr.investigators i ON i.rowId = a.investigatorId + LEFT JOIN onprc_billing.fiscalAuthorities f ON f.rowid = i.financialanalyst + LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals_BreedingGroups aa ON a.protocol = aa.protocol + LEFT JOIN (select * from onprc_billing.projectAccountHistory z where (z.StartDate IS NOT NULL AND z.EndDate IS NOT NULL AND now() between z.StartDate AND z.EndDate)) x ON a.project = x.project + LEFT JOIN Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing_public.aliases y ON y.alias = x.account + LEFT JOIN ( + --Changed by LK on 5/30 to get the accurate numused. --Ignore the gender when counting the usage if the approval data gender is: "Male or Female". Count both Male and Female usage. - (SELECT i.protocol,pd.species,sum(animalsreceived) AS NumUsed - FROM sla.purchasedetails pd, sla.purchase p, Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i, - Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa1 - Where p.project = i.project AND p.objectid = pd.purchaseid - AND aa1.protocol = i.protocol AND aa1.species = pd.species AND aa1.gender = 'Male or Female' - AND animalsreceived IS NOT NULL - AND (p.orderdate between aa1.StartDate AND aa1.EndDate) AND aa1.enddate > now() - GROUP BY i.protocol, pd.species) + (SELECT i.protocol,pd.species,sum(animalsreceived) AS NumUsed + FROM sla.purchasedetails pd, sla.purchase p, Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i, + Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals_BreedingGroups aa1 + Where p.project = i.project AND p.objectid = pd.purchaseid + AND aa1.protocol = i.protocol AND aa1.species = pd.species AND aa1.gender = 'Male or Female' + AND animalsreceived IS NOT NULL + AND (p.orderdate between aa1.StartDate AND aa1.EndDate) AND aa1.enddate > now() + GROUP BY i.protocol, pd.species) -) AS calc ON a.protocol = calc.protocol - AND (aa.species = calc.species OR (aa.species IS NULL AND calc.species IS NULL)) - --AND (aa.gender = calc.gender OR (aa.gender IS NULL AND calc.gender IS NULL)) - --AND (aa.strain = calc.strain OR (aa.strain IS NULL AND calc.strain IS NULL)) + ) AS calc ON a.protocol = calc.protocol + AND (aa.species = calc.species OR (aa.species IS NULL AND calc.species IS NULL)) + --AND (aa.gender = calc.gender OR (aa.gender IS NULL AND calc.gender IS NULL)) + --AND (aa.strain = calc.strain OR (aa.strain IS NULL AND calc.strain IS NULL)) WHERE - -- filter based on the current date compared with the start and end dates - ( +-- filter based on the current date compared with the start and end dates + ( (aa.StartDate IS NOT NULL AND aa.EndDate IS NULL AND now() > aa.StartDate) OR (aa.StartDate IS NULL AND aa.EndDate IS NOT NULL AND now() < aa.EndDate) OR (aa.StartDate IS NOT NULL AND aa.EndDate IS NOT NULL AND now() between aa.StartDate AND aa.EndDate) - AND (aa.gender = 'Male or Female') - ) + AND (aa.gender = 'Male or Female') + ) AND - --Check for the project enddate. Added by LK on 1/16/2019 - (now() between a.StartDate AND a.EndDate) - -- and filtered based on dataAccess for the given user +--Check for the project enddate. Added by LK on 1/16/2019 + (now() between a.StartDate AND a.EndDate) +-- and filtered based on dataAccess for the given user AND - ( + ( (SELECT max(rowid) as expr FROM onprc_billing.dataAccess da - -- current logged in user is the dataAccess user - WHERE isMemberOf(da.userid) - -- has access to all data - AND (da.allData = true - -- has access to the specified investigatorId and the specified project (if applicable) - OR (da.investigatorId = i.rowId AND (da.project IS NULL OR da.project = a.project))) +-- current logged in user is the dataAccess user + WHERE isMemberOf(da.userid) +-- has access to all data + AND (da.allData = true +-- has access to the specified investigatorId and the specified project (if applicable) + OR (da.investigatorId = i.rowId AND (da.project IS NULL OR da.project = a.project))) ) IS NOT NULL - ) + ) UNION ALL SELECT -a.project as ProjectID, -a.name AS Project, -p.external_id as eIACUCNum, -a.title as Title, -i.LastName || ', ' || i.FirstName AS PIName, -x.account as Alias, -y.projectNumber as OGAProjectNumber, -y.grantNumber as OGAGrantNumber, -f.lastname || ', ' || f.firstName as FiscalAuthorityName, -aa.Species, -aa.Gender, -aa.Strain, -aa.Allowed AS NumAllowed, -calc.NumUsed, -aa.StartDate, -aa.EndDate + a.project as ProjectID, + a.name AS Project, + p.external_id as eIACUCNum, + a.title as Title, + i.LastName || ', ' || i.FirstName AS PIName, + x.account as Alias, + y.projectNumber as OGAProjectNumber, + y.grantNumber as OGAGrantNumber, + f.lastname || ', ' || f.firstName as FiscalAuthorityName, + aa.Species, + aa.Gender, + aa.Strain, + aa.Allowed AS NumAllowed, + calc.NumUsed, + aa.StartDate, + aa.EndDate, + CASE + WHEN aa.BreedingAllowed = '1' THEN 'Yes' + ELSE 'No' + END AS BreedingAllowed, + aa.Group_Id, + aa.Group_Name + FROM Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project a LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.protocol p ON p.protocol = a.protocol -LEFT JOIN onprc_ehr.investigators i ON i.rowId = a.investigatorId -LEFT JOIN onprc_billing.fiscalAuthorities f ON f.rowid = i.financialanalyst -LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa ON a.protocol = aa.protocol -LEFT JOIN (select * from onprc_billing.projectAccountHistory z where (z.StartDate IS NOT NULL AND z.EndDate IS NOT NULL AND now() between z.StartDate AND z.EndDate)) x ON a.project = x.project -LEFT JOIN Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing_public.aliases y ON y.alias = x.account -LEFT JOIN ( --- SELECT i.protocol,species,gender,sum(animalsreceived) AS NumUsed --- FROM sla.purchasedetails pd, sla.purchase p --- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i ON p.project = i.project --- WHERE p.objectid = pd.purchaseid AND animalsreceived IS NOT NULL --- GROUP BY i.protocol,species,gender - ---Changed by LK on 5/30 to get the accurate numused. + LEFT JOIN onprc_ehr.investigators i ON i.rowId = a.investigatorId + LEFT JOIN onprc_billing.fiscalAuthorities f ON f.rowid = i.financialanalyst + LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals_BreedingGroups aa ON a.protocol = aa.protocol + LEFT JOIN (select * from onprc_billing.projectAccountHistory z where (z.StartDate IS NOT NULL AND z.EndDate IS NOT NULL AND now() between z.StartDate AND z.EndDate)) x ON a.project = x.project + LEFT JOIN Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing_public.aliases y ON y.alias = x.account + LEFT JOIN ( + --Changed by LK on 5/30 to get the accurate numused. -- Count only the usage for the "Male" or "Female" gender - (SELECT i.protocol,pd.species,pd.gender,sum(animalsreceived) AS NumUsed - FROM sla.purchasedetails pd, sla.purchase p, Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i, - Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa1 - Where p.project = i.project AND p.objectid = pd.purchaseid - AND aa1.protocol = i.protocol AND aa1.species = pd.species AND aa1.gender = pd.gender AND aa1.gender <> 'Male or Female' - AND animalsreceived IS NOT NULL - AND (p.orderdate between aa1.StartDate AND aa1.EndDate) AND aa1.enddate > now() - GROUP BY i.protocol, pd.species, pd.gender) + (SELECT i.protocol,pd.species,pd.gender,sum(animalsreceived) AS NumUsed + FROM sla.purchasedetails pd, sla.purchase p, Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i, + Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals_BreedingGroups aa1 + Where p.project = i.project AND p.objectid = pd.purchaseid + AND aa1.protocol = i.protocol AND aa1.species = pd.species AND aa1.gender = pd.gender AND aa1.gender <> 'Male or Female' + AND animalsreceived IS NOT NULL + AND (p.orderdate between aa1.StartDate AND aa1.EndDate) AND aa1.enddate > now() + GROUP BY i.protocol, pd.species, pd.gender) -) AS calc ON a.protocol = calc.protocol - AND (aa.species = calc.species OR (aa.species IS NULL AND calc.species IS NULL)) - AND (aa.gender = calc.gender OR (aa.gender IS NULL AND calc.gender IS NULL)) - --AND (aa.strain = calc.strain OR (aa.strain IS NULL AND calc.strain IS NULL)) + ) AS calc ON a.protocol = calc.protocol + AND (aa.species = calc.species OR (aa.species IS NULL AND calc.species IS NULL)) + AND (aa.gender = calc.gender OR (aa.gender IS NULL AND calc.gender IS NULL)) + --AND (aa.strain = calc.strain OR (aa.strain IS NULL AND calc.strain IS NULL)) WHERE - -- filter based on the current date compared with the start and end dates - ( +-- filter based on the current date compared with the start and end dates + ( (aa.StartDate IS NOT NULL AND aa.EndDate IS NULL AND now() > aa.StartDate) OR (aa.StartDate IS NULL AND aa.EndDate IS NOT NULL AND now() < aa.EndDate) OR (aa.StartDate IS NOT NULL AND aa.EndDate IS NOT NULL AND now() between aa.StartDate AND aa.EndDate) - AND (aa.gender <> 'Male or Female') - ) + AND (aa.gender <> 'Male or Female') + ) AND - --Check for the project enddate. Added by LK on 1/16/2019 - (now() between a.StartDate AND a.EndDate) - -- and filtered based on dataAccess for the given user +--Check for the project enddate. Added by LK on 1/16/2019 + (now() between a.StartDate AND a.EndDate) +-- and filtered based on dataAccess for the given user AND - ( + ( (SELECT max(rowid) as expr FROM onprc_billing.dataAccess da - -- current logged in user is the dataAccess user - WHERE isMemberOf(da.userid) - -- has access to all data - AND (da.allData = true - -- has access to the specified investigatorId and the specified project (if applicable) - OR (da.investigatorId = i.rowId AND (da.project IS NULL OR da.project = a.project))) +-- current logged in user is the dataAccess user + WHERE isMemberOf(da.userid) +-- has access to all data + AND (da.allData = true +-- has access to the specified investigatorId and the specified project (if applicable) + OR (da.investigatorId = i.rowId AND (da.project IS NULL OR da.project = a.project))) ) IS NOT NULL - ) \ No newline at end of file + ) + +/* +-- SELECT +-- a.project as ProjectID, +-- a.name AS Project, +-- p.external_id as eIACUCNum, +-- a.title as Title, +-- i.LastName || ', ' || i.FirstName AS PIName, +-- x.account as Alias, +-- y.projectNumber as OGAProjectNumber, +-- y.grantNumber as OGAGrantNumber, +-- f.lastname || ', ' || f.firstName as FiscalAuthorityName, +-- aa.Species, +-- aa.Gender, +-- aa.Strain, +-- aa.Allowed AS NumAllowed, +-- calc.NumUsed, +-- aa.StartDate, +-- aa.EndDate +-- FROM Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project a +-- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.protocol p ON p.protocol = a.protocol +-- LEFT JOIN onprc_ehr.investigators i ON i.rowId = a.investigatorId +-- LEFT JOIN onprc_billing.fiscalAuthorities f ON f.rowid = i.financialanalyst +-- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa ON a.protocol = aa.protocol +-- LEFT JOIN (select * from onprc_billing.projectAccountHistory z where (z.StartDate IS NOT NULL AND z.EndDate IS NOT NULL AND now() between z.StartDate AND z.EndDate)) x ON a.project = x.project +-- LEFT JOIN Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing_public.aliases y ON y.alias = x.account +-- LEFT JOIN ( +-- -- SELECT i.protocol,species,gender,sum(animalsreceived) AS NumUsed +-- -- FROM sla.purchasedetails pd, sla.purchase p +-- -- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i ON p.project = i.project +-- -- WHERE p.objectid = pd.purchaseid AND animalsreceived IS NOT NULL +-- -- GROUP BY i.protocol,species,gender +-- +-- --Changed by LK on 5/30 to get the accurate numused. +-- --Ignore the gender when counting the usage if the approval data gender is: "Male or Female". Count both Male and Female usage. +-- (SELECT i.protocol,pd.species,sum(animalsreceived) AS NumUsed +-- FROM sla.purchasedetails pd, sla.purchase p, Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i, +-- Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa1 +-- Where p.project = i.project AND p.objectid = pd.purchaseid +-- AND aa1.protocol = i.protocol AND aa1.species = pd.species AND aa1.gender = 'Male or Female' +-- AND animalsreceived IS NOT NULL +-- AND (p.orderdate between aa1.StartDate AND aa1.EndDate) AND aa1.enddate > now() +-- GROUP BY i.protocol, pd.species) +-- +-- ) AS calc ON a.protocol = calc.protocol +-- AND (aa.species = calc.species OR (aa.species IS NULL AND calc.species IS NULL)) +-- --AND (aa.gender = calc.gender OR (aa.gender IS NULL AND calc.gender IS NULL)) +-- --AND (aa.strain = calc.strain OR (aa.strain IS NULL AND calc.strain IS NULL)) +-- WHERE +-- -- filter based on the current date compared with the start and end dates +-- ( +-- (aa.StartDate IS NOT NULL AND aa.EndDate IS NULL AND now() > aa.StartDate) OR +-- (aa.StartDate IS NULL AND aa.EndDate IS NOT NULL AND now() < aa.EndDate) OR +-- (aa.StartDate IS NOT NULL AND aa.EndDate IS NOT NULL AND now() between aa.StartDate AND aa.EndDate) +-- AND (aa.gender = 'Male or Female') +-- ) +-- AND +-- --Check for the project enddate. Added by LK on 1/16/2019 +-- (now() between a.StartDate AND a.EndDate) +-- -- and filtered based on dataAccess for the given user +-- AND +-- ( +-- (SELECT max(rowid) as expr FROM onprc_billing.dataAccess da +-- -- current logged in user is the dataAccess user +-- WHERE isMemberOf(da.userid) +-- -- has access to all data +-- AND (da.allData = true +-- -- has access to the specified investigatorId and the specified project (if applicable) +-- OR (da.investigatorId = i.rowId AND (da.project IS NULL OR da.project = a.project))) +-- ) IS NOT NULL +-- ) +-- +-- UNION ALL +-- +-- SELECT +-- a.project as ProjectID, +-- a.name AS Project, +-- p.external_id as eIACUCNum, +-- a.title as Title, +-- i.LastName || ', ' || i.FirstName AS PIName, +-- x.account as Alias, +-- y.projectNumber as OGAProjectNumber, +-- y.grantNumber as OGAGrantNumber, +-- f.lastname || ', ' || f.firstName as FiscalAuthorityName, +-- aa.Species, +-- aa.Gender, +-- aa.Strain, +-- aa.Allowed AS NumAllowed, +-- calc.NumUsed, +-- aa.StartDate, +-- aa.EndDate +-- FROM Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project a +-- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.protocol p ON p.protocol = a.protocol +-- LEFT JOIN onprc_ehr.investigators i ON i.rowId = a.investigatorId +-- LEFT JOIN onprc_billing.fiscalAuthorities f ON f.rowid = i.financialanalyst +-- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa ON a.protocol = aa.protocol +-- LEFT JOIN (select * from onprc_billing.projectAccountHistory z where (z.StartDate IS NOT NULL AND z.EndDate IS NOT NULL AND now() between z.StartDate AND z.EndDate)) x ON a.project = x.project +-- LEFT JOIN Site.{substitutePath moduleProperty('ONPRC_Billing','BillingContainer_Public')}.onprc_billing_public.aliases y ON y.alias = x.account +-- LEFT JOIN ( +-- -- SELECT i.protocol,species,gender,sum(animalsreceived) AS NumUsed +-- -- FROM sla.purchasedetails pd, sla.purchase p +-- -- LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i ON p.project = i.project +-- -- WHERE p.objectid = pd.purchaseid AND animalsreceived IS NOT NULL +-- -- GROUP BY i.protocol,species,gender +-- +-- --Changed by LK on 5/30 to get the accurate numused. +-- -- Count only the usage for the "Male" or "Female" gender +-- (SELECT i.protocol,pd.species,pd.gender,sum(animalsreceived) AS NumUsed +-- FROM sla.purchasedetails pd, sla.purchase p, Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.project i, +-- Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals aa1 +-- Where p.project = i.project AND p.objectid = pd.purchaseid +-- AND aa1.protocol = i.protocol AND aa1.species = pd.species AND aa1.gender = pd.gender AND aa1.gender <> 'Male or Female' +-- AND animalsreceived IS NOT NULL +-- AND (p.orderdate between aa1.StartDate AND aa1.EndDate) AND aa1.enddate > now() +-- GROUP BY i.protocol, pd.species, pd.gender) +-- +-- ) AS calc ON a.protocol = calc.protocol +-- AND (aa.species = calc.species OR (aa.species IS NULL AND calc.species IS NULL)) +-- AND (aa.gender = calc.gender OR (aa.gender IS NULL AND calc.gender IS NULL)) +-- --AND (aa.strain = calc.strain OR (aa.strain IS NULL AND calc.strain IS NULL)) +-- WHERE +-- -- filter based on the current date compared with the start and end dates +-- ( +-- (aa.StartDate IS NOT NULL AND aa.EndDate IS NULL AND now() > aa.StartDate) OR +-- (aa.StartDate IS NULL AND aa.EndDate IS NOT NULL AND now() < aa.EndDate) OR +-- (aa.StartDate IS NOT NULL AND aa.EndDate IS NOT NULL AND now() between aa.StartDate AND aa.EndDate) +-- AND (aa.gender <> 'Male or Female') +-- ) +-- AND +-- --Check for the project enddate. Added by LK on 1/16/2019 +-- (now() between a.StartDate AND a.EndDate) +-- -- and filtered based on dataAccess for the given user +-- AND +-- ( +-- (SELECT max(rowid) as expr FROM onprc_billing.dataAccess da +-- -- current logged in user is the dataAccess user +-- WHERE isMemberOf(da.userid) +-- -- has access to all data +-- AND (da.allData = true +-- -- has access to the specified investigatorId and the specified project (if applicable) +-- OR (da.investigatorId = i.rowId AND (da.project IS NULL OR da.project = a.project))) +-- ) IS NOT NULL +-- ) \ No newline at end of file diff --git a/sla/resources/queries/sla/allowableAnimals.js b/sla/resources/queries/sla/allowableAnimals.js index 8df5c7872..bc0ed9c35 100644 --- a/sla/resources/queries/sla/allowableAnimals.js +++ b/sla/resources/queries/sla/allowableAnimals.js @@ -1,7 +1,38 @@ +// var console = require("console"); +// var LABKEY = require("labkey"); +// +// +// function beforeInsert(row, errors){ +// row.objectid = row.objectid || LABKEY.Utils.generateUUID().toUpperCase(); +// } + var console = require("console"); var LABKEY = require("labkey"); +require("ehr/triggers").initScript(this); +var triggerHelper = new org.labkey.onprc_ehr.query.ONPRC_EHRTriggerHelper(LABKEY.Security.currentUser.id, LABKEY.Security.currentContainer.id); function beforeInsert(row, errors){ row.objectid = row.objectid || LABKEY.Utils.generateUUID().toUpperCase(); } + +//Validate dates. Kollil, 1/19/2021 +EHR.Server.TriggerManager.registerHandlerForQuery(EHR.Server.TriggerManager.Events.BEFORE_UPSERT, 'sla', 'allowableAnimals', function(helper, scriptErrors, row, oldRow) +{ + var start = row.startdate; + var end = row.enddate; + //console.log ("In 1"); + + // Check if startdate and enddate are not empty + if ((start == null && end == null) || (start == null && end != null) || (start != null && end == null)) { + EHR.Server.Utils.addError(scriptErrors, 'startdate', 'Must enter Start and End dates', 'ERROR'); + } + + //enddate: verify enddate not prior to startdate + if (start != null && end != null) { + if (start.getTime() > end.getTime()) { + EHR.Server.Utils.addError(scriptErrors, 'enddate', 'End date must be after the Start date', 'ERROR'); + } + } + +}); diff --git a/sla/resources/queries/sla/allowableAnimals_BreedingGroups.sql b/sla/resources/queries/sla/allowableAnimals_BreedingGroups.sql new file mode 100644 index 000000000..bc203f417 --- /dev/null +++ b/sla/resources/queries/sla/allowableAnimals_BreedingGroups.sql @@ -0,0 +1,14 @@ +SELECT a.protocol, + a.species, + a.gender, + a.strain, + a.age, + a.allowed, + a.startdate, + a.enddate, + b.group_id, + b.group_name, + b.breeding_colony as BreedingAllowed +FROM Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.sla.allowableAnimals a, + Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.onprc_ehr.eIACUC_PRIME_VIEW_ANIMAL_GROUPS b +Where a.protocol.displayname = b.parent_protocol \ No newline at end of file diff --git a/sla/resources/views/SLA_LandingPage.html b/sla/resources/views/SLA_LandingPage.html new file mode 100644 index 000000000..466b19567 --- /dev/null +++ b/sla/resources/views/SLA_LandingPage.html @@ -0,0 +1,29 @@ +

SLA Purchase

+

SLA purchase module is for PIs and staff to initiate purchase orders for rodents. It is administered by SLAU staff to ensure quality control and compliance with applicable federal regulations and guidelines. Only authorized personnel are allowed to place rodent orders. If you need access to the module, please contact sla_services@ohsu.edu.

+

Click here to go to SLA Purchase Module

+
+

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

+
+

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

+
+

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

+

Misc Charges - Entry Form

+

Return to "My Task/All Task" Page 

+
+

Reports

+
+

SLA Census - Grid

+

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

+

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

+

Monthly Census - Mouse Sheets

+

Monthly Census - Rat Sheets

+

Monthly Census - Rabbit or GP Sheets

+
\ No newline at end of file diff --git a/sla/resources/views/SLA_LandingPage.view.xml b/sla/resources/views/SLA_LandingPage.view.xml new file mode 100644 index 000000000..297678ea8 --- /dev/null +++ b/sla/resources/views/SLA_LandingPage.view.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/sla/resources/views/SLA_LandingPage.webpart.xml b/sla/resources/views/SLA_LandingPage.webpart.xml new file mode 100644 index 000000000..a21b09d25 --- /dev/null +++ b/sla/resources/views/SLA_LandingPage.webpart.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file