microsoft / microsoft/fhir-server

Cannot create an AuditEvent resource via a PUT request

Open
#1,306 5 comments 0 reactions 1 assignee Claimed by @brendankowitz View on GitHub
Enhancement Specification Up for grabs
Dominant language
TSQL
Stars
1.4k
Forks
592
Avg merge
2d 7h
Merged PRs (30d)
41

Description

**Describe the bug**
To preface: this might be intended behaviour but I wanted to check.
I am working on an application where we write AuditEvents to more than one place. We would like to choose the Id of the AuditEvent in the FhirServer in order to keep it consistent across the different places (i.e. use a client defined id). Although the server is configured with updateCreate = true, it rejects the PUT request for a new AuditEvent. I think this is due to the AuditEvent special case in the [CapabilityStatementBuilder](https://github.com/microsoft/fhir-server/blob/1e8468ce27ad9e9f0816ed761b5f33413a4cfa61/src/Microsoft.Health.Fhir.Core/Features/Conformance/CapabilityStatementBuilder.cs#L163), combined with the upsert code path always checking for update permissions on the resource.

**To Reproduce**
Steps to reproduce the behavior:
1. Send a PUT request with the appropriate body to /AuditEvent/{some new id}

**Expected behavior**
An AuditEvent with the specified id is created and 201 Created is returned.

**Actual behavior**
The AuditEvent isn't created and a response of 405 Method Not Allowed is returned.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.