FHIR’s Consent resource allows patients to control how their data is used and shared. ESUS uses consent records to gate access to PHI resources — the ABAC engine checks for an active Consent record before allowing practitioners to read or modify a patient’s sensitive data.

curl -X POST https://api.esus.health/fhir/Consent \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "resourceType": "Consent",
    "status": "active",
    "scope": {
      "coding": [{
        "system": "http://terminology.hl7.org/CodeSystem/consentscope",
        "code": "patient-privacy",
        "display": "Privacy Consent"
      }]
    },
    "category": [{
      "coding": [{
        "system": "http://loinc.org",
        "code": "59284-0",
        "display": "Consent Document"
      }]
    }],
    "patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "dateTime": "2026-04-21",
    "policy": [{
      "uri": "https://esus.health/privacy-policy"
    }],
    "provision": {
      "type": "permit",
      "actor": [{
        "role": {
          "coding": [{
            "system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
            "code": "PRCP",
            "display": "primary information recipient"
          }]
        },
        "reference": {
          "reference": "Practitioner/a7b1c2d3-e4f5-6789-abcd-ef0123456789"
        }
      }]
    }
  }'
StatusMeaning
proposedConsent has been proposed, awaiting patient decision
draftConsent is being drafted
activeConsent is in effect
inactiveConsent has been suspended
entered-in-errorConsent was recorded in error
expiredConsent has passed its end date
curl -X POST https://api.esus.health/fhir/Consent \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "resourceType": "Consent",
    "status": "active",
    "scope": {
      "coding": [{
        "code": "research",
        "display": "Research Consent"
      }]
    },
    "category": [{
      "coding": [{ "code": "RESEARCH" }]
    }],
    "patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "provision": {
      "type": "permit",
      "purpose": [{
        "system": "http://terminology.hl7.org/CodeSystem/v3-ActReason",
        "code": "HRESCH",
        "display": "Health Research"
      }]
    }
  }'

Data Sharing Opt-Out

curl -X POST https://api.esus.health/fhir/Consent \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "resourceType": "Consent",
    "status": "active",
    "scope": {
      "coding": [{ "code": "patient-privacy" }]
    },
    "patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "provision": {
      "type": "deny",
      "actor": [{
        "reference": { "reference": "Organization/d4e5f6a7-b8c9-0123-def4-567890abcdef" }
      }],
      "action": [{
        "coding": [{
          "system": "http://terminology.hl7.org/CodeSystem/consentaction",
          "code": "disclose",
          "display": "Disclose"
        }]
      }]
    }
  }'

To revoke an existing consent, update its status to inactive:

curl -X PUT https://api.esus.health/fhir/Consent/c1a2e3d4-5b6f-7890-abcd-ef1234567890 \
  -H "Authorization: Bearer TOKEN" \
  -H "Content-Type: application/fhir+json" \
  -d '{
    "resourceType": "Consent",
    "id": "c1a2e3d4-5b6f-7890-abcd-ef1234567890",
    "status": "inactive",
    "scope": { "coding": [{ "code": "patient-privacy" }] },
    "category": [{ "coding": [{ "code": "59284-0" }] }],
    "patientId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  }'
# Get all active consents for a patient
curl "https://api.esus.health/fhir/Consent?patient=Patient/3fa85f64-5717-4562-b3fc-2c963f66afa6&status=active" \
  -H "Authorization: Bearer TOKEN"

# Get consents by category
curl "https://api.esus.health/fhir/Consent?category=59284-0" \
  -H "Authorization: Bearer TOKEN"

When a practitioner requests a PHI resource (e.g., GET /fhir/Observation/aa11bb22-cc33-dd44-ee55-ff6677889900), the ABAC engine:

  1. Verifies the practitioner has the read permission for Observation
  2. Looks up the patient linked to that Observation
  3. Checks the Consent table for an active consent record permitting this practitioner (or their organization) access
  4. If no active consent exists → returns 403 Forbidden with a FHIR OperationOutcome

This check happens automatically — you do not need to implement it in your application.