001/*- 002 * #%L 003 * Smile CDR - CDR 004 * %% 005 * Copyright (C) 2016 - 2025 Smile CDR, Inc. 006 * %% 007 * All rights reserved. 008 * #L% 009 */ 010package ca.cdr.api.consent; 011 012import org.hl7.fhir.instance.model.api.IDomainResource; 013 014import java.util.ArrayList; 015import java.util.Collection; 016import java.util.List; 017 018/** 019 * Accumulator for the CONSENT_ACTIVE_CONSENT_RESOURCES_RESOLVE pointcut. 020 * Used to support custom Consent sources besides local search. 021 */ 022public class ConsentActiveResourceResolutionRequest { 023 private final List<IDomainResource> myConsents = new ArrayList<>(); 024 025 public void addActiveConsent(IDomainResource theConsent) { 026 myConsents.add(theConsent); 027 } 028 029 public void addActiveConsents(Collection<IDomainResource> theConsents) { 030 myConsents.addAll(theConsents); 031 } 032 033 public List<IDomainResource> getActiveConsents() { 034 return myConsents; 035 } 036 037 public boolean isEmpty() { 038 return myConsents.isEmpty(); 039 } 040}