Hi @sashrika, @harsha89,
I’ve just had a conversation with @wyclif around conditional creates and updates.
So the problem we have is that basically, OpenMRS needs to be the deciding factor here. For example, if a conditional create says “do X”, and the OpenMRS db says “sorry, we don’t allow that”, then OpenMRS gets priority, and we have to go with what OpenMRS says.
But if OpenMRS has no issue with what the conditional create / update asks, then we can go ahead.
So basically, conditional creates are ok, but they are restricted by the internal validations built into the OpenMRS core
And also, it might make sense to re-think our use case around conditional creates.
In our case, if someone sends OpenMRS a new resources with a unique UUID, then it doesn’t matter what conditions we try to specify… I mean. Should someone be allowed to say, “we’re sending you a brand new Patient resource, but only create it if the OpenMRS db doesn’t already have a patient with a patient identifier.type = xyz and patient identifier.value=123” ?