If we create expression definitions in unfiltered context while processing MedicationAdministration criteria, it's possible that we create duplicates if more than one MedicationAdministration criteria with the same code was found in the structured query.
The solution is to simply use a set for the expression definitions of the unfiltered context. That will work as long as the name of such expression definitions corresponds to the content of the expression.
If we create expression definitions in unfiltered context while processing MedicationAdministration criteria, it's possible that we create duplicates if more than one MedicationAdministration criteria with the same code was found in the structured query.
The solution is to simply use a set for the expression definitions of the unfiltered context. That will work as long as the name of such expression definitions corresponds to the content of the expression.