The newly introduced service provides an API to retrieve, for a given patient, the list of attachments
- within a given encounter
- within a given visit
What I was asking Dileka was to put together unit tests that show that it all works as expected, and he was almost there. The bottom line is: attachments are not new entities, they are just wrappers around complex obs, so they are just a special kind of obs that are mixed with the others in encounters and visits.
So writing a unit test that demonstrates that the new API does indeed list the attachments of an encounter or a visit means setting up encounters and visits that mix up complex obs with other obs ; to then show that only the expected ones are returned: the complex obs (but wrapped as attachments).
Does that make sense? Here is how you can start off from where Dileka left it. After you have cloned Attachments, you can do this:
git remote add dileka https://github.com/dilekamadushan/openmrs-module-attachments
git fetch dileka
git checkout -b ATT-24 dileka/ATT-24-1
And at that point you will be on a local branch ATT-24 that carries all latest commits from Dileka.