001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2024 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.consent;
011
012import ca.uhn.fhir.model.primitive.IdDt;
013import ca.uhn.fhir.rest.api.server.RequestDetails;
014
015public class ConsentRequestService {
016
017        public static final String KEY_BASE = "ca.cdr.api.consent.ConsentRequestService";
018        public static final String CONSENT_ACTOR_KEY = KEY_BASE + "_CONSENT_ACTOR";
019        public static final String CONSENT_PATIENT_KEY = KEY_BASE + "_CONSENT_PATIENT";
020
021        private ConsentRequestService() {}
022
023        public static IdDt getConsentActor(RequestDetails theRequestDetails) {
024                return (IdDt) theRequestDetails.getUserData().get(CONSENT_ACTOR_KEY);
025        }
026
027        public static void setConsentActor(RequestDetails theRequestDetails, IdDt theConsentActor) {
028                theRequestDetails.getUserData().put(CONSENT_ACTOR_KEY, theConsentActor);
029        }
030
031        public static IdDt getConsentPatient(RequestDetails theRequestDetails) {
032                return (IdDt) theRequestDetails.getUserData().get(CONSENT_PATIENT_KEY);
033        }
034
035        public static void setConsentPatient(RequestDetails theRequestDetails, IdDt theConsentPatient) {
036                theRequestDetails.getUserData().put(CONSENT_PATIENT_KEY, theConsentPatient);
037        }
038}