Mosaiq SQL : No entry found

Hi Stuart

For metersetmap comparison with TRF, we encounter this warning/error message:
Searched Mosaiq for an entry corresponding to this log file. No entry was found. As such, for now, patient name has been set to ‘unknown’.

Is there a way to troubleshoot?

Regards
Lip Teck

in _mosaiq/delivery.py, in the function get_mosaiq_delivery_details(…) the underlying exception is being generated.
The details of that exception are not being presented higher up (you get the message you reported).
I would try adding a print statement after
if not sql_result:

prior to the exception being raised that has the same content as what is being put in the exception.
“No Mosaiq entries were found for {}/{} at {}”.format(
field_label, field_name, delivery_time
)

either that, or higher up where you are being presented with the message maybe try adding
traceback. print_exc()
extracting the text of the exception and putting it in to the higher level response is a bit more code.

The underlying SQL query is:
execute_string = “”"
SELECT
Ident.IDA,
TxField.FLD_ID,
Patient.Last_Name,
Patient.First_Name,
Tracktreatment.WasQAMode,
TxField.Type_Enum,
Tracktreatment.WasBeamComplete
FROM TrackTreatment, Ident, Patient, TxField, Staff
WHERE
TrackTreatment.Pat_ID1 = Ident.Pat_ID1 AND
Patient.Pat_ID1 = Ident.Pat_ID1 AND
TrackTreatment.FLD_ID = TxField.FLD_ID AND
Staff.Staff_ID = TrackTreatment.Machine_ID_Staff_ID AND
REPLACE(Staff.Last_Name, ’ ', ‘’) = %(machine)s AND
TrackTreatment.Create_DtTm <= DATEADD(second, %(buffer)d, %(delivery_time)s) AND
TrackTreatment.Edit_DtTm >= DATEADD(second, -%(buffer)d, %(delivery_time)s) AND
TxField.Field_Label = %(field_label)s AND
TxField.Field_Name = %(field_name)s
“”"
so it’s the where clause that isn’t finding any joy.
If you have the means to do direct queries, you might want to simplify this or look more carefully at the field_label and field_name