@Test
public void testGetOriginalTherapyId()
{

  final MedicationOrderComposition originComposition =
      MedicationsTestUtils.buildTestMedicationOrderComposition("uid1::1", null, null);
  final MedicationInstructionInstruction originInstruction =
      MedicationsTestUtils.buildTestMedicationInstruction("Medication instruction");
  originComposition.getMedicationDetail().getMedicationInstruction().add(originInstruction);
  final MedicationOrderComposition composition =
      MedicationsTestUtils.buildTestMedicationOrderComposition("uid2::1", null, null);
  final MedicationInstructionInstruction instruction =
      MedicationsTestUtils.buildTestMedicationInstruction("Medication instruction");
  composition.getMedicationDetail().getMedicationInstruction().add(instruction);
  instruction.getLinks().add(
      OpenEhrRefUtils.getLinkToTdoTarget("origin", EhrLinkType.ORIGIN.getName(), originComposition, originInstruction));
  final String originalTherapyId = medicationsBo.getOriginalTherapyId(composition);
  assertEquals("uid1|Medication instruction", originalTherapyId);
}