diff --git a/onprc_ehr/resources/queries/ehr_lookups/cageReview.sql b/onprc_ehr/resources/queries/ehr_lookups/cageReview.sql index 38007587f..9a661dd1b 100644 --- a/onprc_ehr/resources/queries/ehr_lookups/cageReview.sql +++ b/onprc_ehr/resources/queries/ehr_lookups/cageReview.sql @@ -87,7 +87,7 @@ SELECT CASE WHEN hf.Id is not null AND c1.height >= pc.cage_type.height THEN 'ERROR: According to the monkeys weight-- it needs a height step taller than required.' WHEN hf.Id is not null AND c1.height < pc.cage_type.height THEN 'NOTE: According to the monkeys weight-- it needs a height step taller than required.' - WHEN (pc.cage_type.height < c1.height AND f.heightExemption IS NULL) THEN ('ERROR: Insufficient height, ' || h.id ||' needs at least: ' || cast(c1.height AS varchar(50))) + WHEN (pc.cage_type.height < c1.height AND (f.heightExemption IS NULL AND wf.weightExemption iS NULL ) )THEN ('ERROR: Insufficient height, ' || h.id ||' needs at least: ' || cast(c1.height AS varchar(50))) WHEN (pc.cage_type.height < c1.height AND f.heightExemption IS NOT NULL) THEN cast(('NOTE: Height Exemption: ' || h.Id) as varchar(500)) ELSE null END as heightStatus,