@@ -76,6 +76,7 @@ public String getEmailSubject(Container c)
7676 infectionAnchorDateDiscordance (c , u , msg );
7777 pvlWithoutInfectionDate (c , u , msg );
7878 idsMissingFromDemographics (c , u , msg );
79+ missingArtRecord (c , u , msg );
7980
8081 if (!msg .isEmpty ())
8182 {
@@ -148,6 +149,20 @@ private void idsMissingFromDemographics(Container c, User u, StringBuilder msg)
148149 genericQueryCheck (c , u , msg , "study" , s .getSubjectNounSingular (), "IDs with data in the study not present in the demographics table" , filter );
149150 }
150151
152+ private void missingArtRecord (Container c , User u , StringBuilder msg )
153+ {
154+ Study s = StudyService .get ().getStudy (getTargetContainer (c ));
155+ if (s == null )
156+ {
157+ return ;
158+ }
159+
160+ SimpleFilter filter = new SimpleFilter (FieldKey .fromString ("projects/studyDescription" ), "ART" , CompareType .CONTAINS );
161+ filter .addCondition (FieldKey .fromString ("projects/studyDescription" ), "No ART" , CompareType .DOES_NOT_CONTAIN );
162+ filter .addCondition (FieldKey .fromString ("sivART/artInitiationDPI" ), null , CompareType .ISBLANK );
163+ genericQueryCheck (c , u , msg , "study" , s .getSubjectNounSingular (), "IDs assigned to an ART study without a record of ART" , filter );
164+ }
165+
151166 protected Container getTargetContainer (Container c )
152167 {
153168 return c .isWorkbookOrTab () ? c .getParent () : c ;
0 commit comments