public async Task <string> PostAsync(string requestBody) { var temp = _uri .AppendPathSegment("gpconnect-demonstrator/v1/fhir/Appointment") .WithHeaders(new { Ssp_TraceID = _traceId, Ssp_From = _consumerAsid, Ssp_To = _providerAsid, Ssp_InteractionID = _sdsInteractionId, accept = "application/fhir+json", Content_Type = "application/fhir+json" }) .WithOAuthBearerToken(_tokenGenerator.GetToken(Scope.PatientWrite)); return(await temp.AllowAnyHttpStatus().PostStringAsync(requestBody).ReceiveString()); }
private IFlurlRequest SetHeadersAndQueryParam(DateTime start, DateTime end) { return(_uri .AppendPathSegment("gpconnect-demonstrator/v1/fhir/Slot") .WithHeaders(new { Ssp_TraceID = _traceId, Ssp_From = _consumerAsid, Ssp_To = _providerAsid, Ssp_InteractionID = _sdsInteractionId, Accept = "application/fhir+json" }) .WithOAuthBearerToken(_tokenGenerator.GetToken(Scope.OrgRead)) .SetQueryParams(new { start = "ge" + _dateTimeGenerator.Generate(start), end = "le" + _dateTimeGenerator.Generate(end), status = "free", _include = "Slot:schedule" }) .SetQueryParam(Url.Encode("_include:recurse"), "Schedule:actor:Practitioner", false) .SetQueryParam("searchFilter", _searchFilter, false)); }