diff --git a/scripts/allow_retest_backdated.py b/scripts/allow_retest_backdated.py index c5730ac..a6f709a 100644 --- a/scripts/allow_retest_backdated.py +++ b/scripts/allow_retest_backdated.py @@ -17,7 +17,7 @@ db = firestore.client() patient_collection = db.collection("patientData") test_collection = db.collection("testData") -query = patient_collection.where(filter=FieldFilter("createdAt", ">=", "2023-10-30")).where(filter=FieldFilter("createdAt", "<", "2023-10-31")) +query = patient_collection.where(filter=FieldFilter("createdAt", ">=", "2023-10-20")).where(filter=FieldFilter("createdAt", "<", "2023-10-21")) #.where(filter=FieldFilter("registrationCenterName", "==", "SCS high school")) patient_docs = query.stream() @@ -27,12 +27,12 @@ data = [] for patient_doc in patient_docs: patient_data = patient_doc.to_dict() data.append(patient_data) - if "MAT" in patient_data['_id']: + if "BHI" in patient_data['_id']: print(patient_data['_id']) doc_ref = db.collection("patientData").document(patient_doc.id) delete_field_name = 'incubationTime' - batch.update(doc_ref, {"_idSearch": '20231201' + patient_data['_id'], delete_field_name: firestore.DELETE_FIELD, "incubationModified": True}) + batch.update(doc_ref, {"_idSearch": '20231209' + patient_data['_id'], delete_field_name: firestore.DELETE_FIELD, "allowFreshTest": True, "testStatus": False}) batch.commit()