“I am unable to generate Exception you mentioned in the issue”: you mean you don’t know how to bring a ‘mismatch’ between the visit and the encounter?
If so, it looks like any of the encounters ID’d 3, 4, 5 and 6 would do the trick as they seem to be visit-less, see here. So you could for instance use visit (
id=1) and encounter (
id=3) to bring a test case with the mismatch scenario.
Remember that you should also have a case that shows that if the visit and encounter are provided and match (= the visit is indeed the one of the encounter), then all should be fine.
- If mismatch between visit and encounter ⇒
- If only encounter ⇒ verify that the underlying obs is saved and points to that encounter.
- If visit and encounter match ⇒ verify that the underlying obs is saved and points to that encounter, and the encounter points to that visit.