internal static void SetHeaders(this Bundle.BundleEntryResponseComponent interaction, WebHeaderCollection headers) { foreach (var key in headers.AllKeys) { interaction.AddExtension(EXTENSION_RESPONSE_HEADER, new FhirString(key + ":" + headers[key])); } }
public static byte[] GetBody(this Bundle.BundleEntryResponseComponent interaction) { if (interaction.UserData.ContainsKey(USERDATA_BODY)) { return((byte[])interaction.UserData[USERDATA_BODY]); } else { return(null); } }
public static string GetBodyAsText(this Bundle.BundleEntryResponseComponent interaction) { var body = interaction.GetBody(); if (body != null) { return(DecodeBody(body, Encoding.UTF8)); } else { return(null); } }
public static IEnumerable <Tuple <string, string> > GetHeaders(this Bundle.BundleEntryResponseComponent interaction) { foreach (var headerExt in interaction.GetExtensions(EXTENSION_RESPONSE_HEADER)) { if (headerExt.Value != null && headerExt.Value is FhirString) { var header = ((FhirString)headerExt.Value).Value; if (header != null) { yield return(header.SplitLeft(':')); } } } }
public static IEnumerable <string> GetHeader(this Bundle.BundleEntryResponseComponent interaction, string header) { return(interaction.GetHeaders().Where(h => h.Item1 == header).Select(h => h.Item2)); }
internal static void SetBody(this Bundle.BundleEntryResponseComponent interaction, byte[] data) { interaction.UserData[USERDATA_BODY] = data; }