22
33import org .apache .xmlbeans .XmlException ;
44import org .jetbrains .annotations .NotNull ;
5+ import org .labkey .api .collections .CaseInsensitiveHashMap ;
56import org .labkey .api .data .CompareType ;
67import org .labkey .api .data .SimpleFilter ;
78import org .labkey .api .data .TableInfo ;
@@ -158,8 +159,8 @@ private void updateChallengeAnchorDates(PipelineJob pipelineJob) throws Pipeline
158159 TableInfo ad = QueryService .get ().getUserSchema (_containerUser .getUser (), _containerUser .getContainer (), "studies" ).getTable ("subjectAnchorDates" );
159160
160161 Map <String , Set <Date >> existingRecords = new HashMap <>();
161- new TableSelector (ad , PageFlowUtil .set ("Id " , "date" , "rowid" ), new SimpleFilter (FieldKey .fromString ("eventLabel" ), "SIV Infection" ), null ).forEachResults (rs -> {
162- String id = rs .getString (FieldKey .fromString ("Id " ));
162+ new TableSelector (ad , PageFlowUtil .set ("subjectId " , "date" , "rowid" ), new SimpleFilter (FieldKey .fromString ("eventLabel" ), "SIV Infection" ), null ).forEachResults (rs -> {
163+ String id = rs .getString (FieldKey .fromString ("subjectId " ));
163164 if (!existingRecords .containsKey (id ))
164165 {
165166 existingRecords .put (id , new HashSet <>());
@@ -183,7 +184,7 @@ private void updateChallengeAnchorDates(PipelineJob pipelineJob) throws Pipeline
183184 if (!existingRecords .containsKey (id ) | !existingRecords .get (id ).contains (date ))
184185 {
185186 toInsert .add (Map .of (
186- "Id " , id ,
187+ "subjectId " , id ,
187188 "date" , date ,
188189 "category" , "SIV Infection" ,
189190 "sourceRecord" , rs .getString (FieldKey .fromString ("objectId" ))
@@ -212,12 +213,12 @@ private void updateChallengeAnchorDates(PipelineJob pipelineJob) throws Pipeline
212213 }
213214
214215 final List <Map <String , Object >> toDelete = new ArrayList <>();
215- new TableSelector (ad , PageFlowUtil .set ("Id " , "date" , "rowid" ), new SimpleFilter (FieldKey .fromString ("eventLabel" ), "SIV Infection" ), null ).forEachResults (rs -> {
216- String id = rs .getString (FieldKey .fromString ("Id " ));
216+ new TableSelector (ad , PageFlowUtil .set ("subjectId " , "date" , "rowid" ), new SimpleFilter (FieldKey .fromString ("eventLabel" ), "SIV Infection" ), null ).forEachResults (rs -> {
217+ String id = rs .getString (FieldKey .fromString ("subjectId " ));
217218 Date date = rs .getDate (FieldKey .fromString ("date" ));
218219 if (!sourceRecords .containsKey (id ) | !sourceRecords .get (id ).contains (date ))
219220 {
220- toDelete .add (Map .of ("rowId " , rs .getInt (FieldKey .fromString ("rowId" ))));
221+ toDelete .add (new CaseInsensitiveHashMap <>( Map .of ("rowid " , rs .getInt (FieldKey .fromString ("rowId" ) ))));
221222 }
222223 });
223224
0 commit comments