Good job.
Are you certain that a particular patient can have no more of one OfficeN column with BAL value? If this is the case you soluton works like a charm.