Skip to main content
. 2021 Mar 26;117:103744. doi: 10.1016/j.jbi.2021.103744
 Procedure[patentIDList] = AbsoluteTemporalEventQuery(invertedIndexCollection,event,period)
 InputinvertedIndexCollection: The client for accessing ELII collection in MongoDB
  event: The query event
  period: The query period
 OutputpatentIDList: The list of patient IDs after query
1: queryDocuments=invertedIndexCollection.find($or:event);
2: patentIDList=[];
3: fordocumentinqueryDocumentsdo
4:  firstRecordTime=document.First_record_date;
5:  lastRecordTime=document.Last_record_date;
6:  startIndex=0
7:  endIndex=Length(document.Patient_list)
8:  ifperiod.start_dateis notNonethen
9:  startIndex=period.start_date-firstRecordTime;
10:  ifstartIndex<0then
11:   startIndex=0
12:  end if
13:  end if
14:  ifperiod.end_dateis notNonethen
15:  endIndex=period.end_date-firstRecordTime;
16:  ifendIndex>Length(document.Patient_list)then
17:   endIndex=Length(document.Patient_list)
18:  end if
19:  end if
20:  patentIDList.add(document.Patient_list[startIndex:endIndex]);
21: end for
22: patentIDList = Unique(patentIDList);
23: returnpatentIDList