Thanks Kevin for your response.
I tried further for implementation, I added below sample code to post the document using DocumentReference FHIR resource. BUT at line client.Create below, I can see exception like "An exception of type 'Hl7.Fhir.Rest.FhirOperationException' occurred in Hl7.Fhir.DSTU2.Core.dll but was not handled in user code
Additional information: Operation was unsuccessful, and returned status NotAcceptable. OperationOutcome: Error: Endpoint returned a body with contentType 'text/plain', while a valid FHIR xml/json body type was expected. Is this a FHIR endpoint?"
Below is the code snippet -
var cernerEhrSourceId = "d075cf8b-3261-481d-97e5-ba6c48d3b41f";
var url = $"
https://fhir-open.sandboxcernerpowerchart.com/dstu2/{cernerEhrSourceId}/";
var client = new EpreopFhirClient(url);
client.VerifyFhirVersion = true;
//client.OnBeforeRequest += ClientOnOnBeforeRequest;
client.UseFormatParam = true;
var documentReference = new DocumentReference();
documentReference.Status = DocumentReferenceStatus.Current;
documentReference.Type = new CodeableConcept("
http://loinc.org", "78280-5");
DocumentReference.ContentComponent contentItem = new DocumentReference.ContentComponent();
contentItem.Attachment = new Attachment();
contentItem.Attachment.ContentType = "application / xhtml + xml; charset = utf - 8";
//contentItem.Attachment.ContentType = "xml/json";
contentItem.Attachment.Data = new byte[10]; //TODO
documentReference.Description = "";
documentReference.Content.Add(contentItem);
var result = client.Create<DocumentReference>(documentReference);
Can you help me out here, whats wrong I am doing here...