/** * Populates the answer attributes for patient info. * * @param p the parent procedure. * @param pi patient information. */ public static void populateSpecialElements(Procedure p, PatientInfo pi) { if (pi == null || !pi.isConfirmed() || !p.current().hasSpecialElement()) { return; } List<ProcedureElement> specialElements = p.current().getSpecialElements(); for (ProcedureElement element : specialElements) { String id = element.getId(); if (pi != null) { element.setAnswer(pi.getAnswerForId(id)); } } }