@Override public void validate() { super.validate(); ActiveParticipant user = getRequestingActiveParticipants(); if (user == null) { throw new IllegalStateException("No Requesting User"); } ParticipantObject patient = null; for (ParticipantObject po : participantObjects) { if (ParticipantObject.TypeCodeRole.PATIENT == po.getParticipantObjectTypeCodeRole()) { if (patient != null) { throw new IllegalStateException("Multiple Patient identification"); } patient = po; } } if (patient == null) { throw new IllegalStateException("No Patient identification"); } }
public ParticipantObject addPatient(String id, String name) { return addParticipantObject(ParticipantObject.createPatient(id, name)); }