Query show wrong data

Hello dear, we are working on Bahmni implementation and we want to list some patients record and their wound dressing per wound, we have written query and its working when we run that in the docker mysql but after uploading to the bahmni it shows wrong data even its format is changed. if you guys could help us with this. thank you.

Query result in docker mysql and in Bahmni asdasdsaf