public async Task <IActionResult> Delete() { var request = FhirRequest.Create(null, ResourceType.DocumentReference, null, Request, RequestingAsid()); var result = await _nrlsMaintain.Delete <DocumentReference>(request); if (result != null && result.Success) { //Assume success return(Ok(result)); } return(NotFound(result)); }
public async Task <IActionResult> Delete(string logicalId = null) { var request = FhirRequest.Create(logicalId, ResourceType.DocumentReference, null, Request, RequestingAsid()); var result = await _nrlsMaintain.Delete(request); if (result != null && result.Success) { //Assume success return(Ok(result)); } var operationOutcome = result as OperationOutcome; if (operationOutcome != null && operationOutcome.Issue.Any(x => x.Details.Coding.Any(y => y.Code == "NO_RECORD_FOUND"))) { return(NotFound(operationOutcome)); } return(BadRequest(operationOutcome)); }