예제 #1
0
 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]));
     }
 }
예제 #2
0
 public static byte[] GetBody(this Bundle.BundleEntryResponseComponent interaction)
 {
     if (interaction.UserData.ContainsKey(USERDATA_BODY))
     {
         return((byte[])interaction.UserData[USERDATA_BODY]);
     }
     else
     {
         return(null);
     }
 }
예제 #3
0
        public static string GetBodyAsText(this Bundle.BundleEntryResponseComponent interaction)
        {
            var body = interaction.GetBody();

            if (body != null)
            {
                return(DecodeBody(body, Encoding.UTF8));
            }
            else
            {
                return(null);
            }
        }
예제 #4
0
        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(':'));
                    }
                }
            }
        }
예제 #5
0
 public static IEnumerable <string> GetHeader(this Bundle.BundleEntryResponseComponent interaction, string header)
 {
     return(interaction.GetHeaders().Where(h => h.Item1 == header).Select(h => h.Item2));
 }
예제 #6
0
 internal static void SetBody(this Bundle.BundleEntryResponseComponent interaction, byte[] data)
 {
     interaction.UserData[USERDATA_BODY] = data;
 }