We were programming the RWS calls using python builders for query opening, cancelling, closing and re-opening on the log fields of AETERM, AESTDAT and AEENDAT in AE form. Please find below the code:
#Declarations
URL1 = 'innovateURL' #Masked
UserID1 = 'ID1' #Masked
Password1 = 'Pass1' #Masked
Study_Name = 'Study' #Masked
Study_Env = 'UAT'
Study_Metadata = '2'
Study_site = '0001' #Masked
Subject_ID = 'TEST0005'
Folderoid_1 = 'AE'
Formoid_1 = 'AE'
ItemGroup_1 = 'AE'
ItemGroup_RepKey = '1'
ItemData1OID = 'AETERM'
ItermData1Value = 'TestItemIgnore'
ItemData2OID = 'AESTDAT'
ItermData2Value = '20 FEB 2020'
ItemData3OID = 'AEENDAT'
ItermData3Value = '25 APR 2020'
ItemDataTransactionTyp = 'Context'
#Query Text String to open
QT1 = 'TestQueryField1'
QT2 = 'TestQueryField2'
QT3 = 'TestQueryField3'
#Query Text Status
QT_Status_Open = QueryStatusType.Open
QT_Status_Close = QueryStatusType.Closed
QT_Status_Cancel = QueryStatusType.Cancelled
QT_Status_Answered = QueryStatusType.Answered
QT_Status_Forward = QueryStatusType.Forwarded
#Query Requires Response(true/false)
QT_ReqResp = 'true'
#Query Text string for the response
QT_Response = 'This is the response of the Query'
#Query Text Recipient
QT_MG = 'Site from DM'
#Query ID from the DB
QT_RepeatKey1='123' #AETERM #Masked
QT_RepeatKey2='456' #AESTDAT #Masked
QT_RepeatKey3='789' #AEENDAT #Masked
#Main Program starts here
rwscon = RWSConnection(URL1, UserID1, Password1)
Odm = ODM("TestData")
Clinical_data = ClinicalData(projectname=Study_Name, environment=Study_Env, metadata_version_oid=Study_Metadata)
subject_data = SubjectData(site_location_oid=Study_site, subject_key=Subject_ID)
event_data = StudyEventData(study_event_oid=Folderoid_1)
form_data = FormData(formoid=Formoid_1)
itemgroup1= ItemGroupData(itemgroupoid =ItemGroup_1, item_group_repeat_key=ItemGroup_RepKey)
itemdata1 = ItemData(itemoid=ItemData1OID, value=ItermData1Value, transaction_type=ItemDataTransactionTyp)
itemdata2 = ItemData(itemoid=ItemData2OID, value=ItermData2Value, transaction_type=ItemDataTransactionTyp)
itemdata3 = ItemData(itemoid=ItemData3OID, value=ItermData3Value, transaction_type=ItemDataTransactionTyp)
#Unomment the query1 variable based on the action needed before running the code.
#To Open Queries
#query1 = MdsolQuery(value=QT1, requires_response = QT_ReqResp, recipient=QT_MG, status=QT_Status_Open)
#To Cancel Queries
#query1 = MdsolQuery(query_repeat_key = QT_RepeatKey1, recipient=QT_MG, status=QT_Status_Cancel)
#To Close Queries
#query1 = MdsolQuery(query_repeat_key = QT_RepeatKey1, recipient=QT_MG, status=QT_Status_Close)
#To Requery, Note enter previous query repeat key
#query1 = MdsolQuery(value=QT1, query_repeat_key = QT_RepeatKey1, requires_response = QT_ReqResp, recipient=QT_MG, status=QT_Status_Open)
itemgroup1 << itemdata1 << query1
Odm << Clinical_data << subject_data << event_data << form_data << itemgroup1
print(str(Odm))
responseobject = rwscon.send_request(PostDataRequest(str(Odm)))
print(str(responseobject))
Could you please confirm if there is an option to re-query (along with requires response) and provide us the snippet for the same.