Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sla/resources/queries/sla/ProtocolProjectsUsage.sql
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.pr
--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_BreedingGroups aa1
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
Expand Down Expand Up @@ -107,7 +107,7 @@ LEFT JOIN Site.{substitutePath moduleProperty('EHR','EHRStudyContainer')}.ehr.pr
-- 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_BreedingGroups aa1
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
Expand Down