001package ca.cdr.api.consent; 002 003import ca.uhn.fhir.model.primitive.IdDt; 004import ca.uhn.fhir.rest.api.server.RequestDetails; 005 006public class ConsentRequestService { 007 008 public static final String KEY_BASE = "ca.cdr.api.consent.ConsentRequestService"; 009 public static final String CONSENT_ACTOR_KEY = KEY_BASE + "_CONSENT_ACTOR"; 010 public static final String CONSENT_PATIENT_KEY = KEY_BASE + "_CONSENT_PATIENT"; 011 012 private ConsentRequestService() {} 013 014 public static IdDt getConsentActor(RequestDetails theRequestDetails) { 015 return (IdDt) theRequestDetails.getUserData().get(CONSENT_ACTOR_KEY); 016 } 017 018 public static void setConsentActor(RequestDetails theRequestDetails, IdDt theConsentActor) { 019 theRequestDetails.getUserData().put(CONSENT_ACTOR_KEY, theConsentActor); 020 } 021 022 public static IdDt getConsentPatient(RequestDetails theRequestDetails) { 023 return (IdDt) theRequestDetails.getUserData().get(CONSENT_PATIENT_KEY); 024 } 025 026 public static void setConsentPatient(RequestDetails theRequestDetails, IdDt theConsentPatient) { 027 theRequestDetails.getUserData().put(CONSENT_PATIENT_KEY, theConsentPatient); 028 } 029}