/// <summary>Converts a different FHIR version SubscriptionStatus to R5.</summary>
        /// <param name="status4">The SubscriptionStatus.</param>
        /// <returns>R5 SubscriptionStatus.</returns>
        public static r5.SubscriptionStatus StatusToR5(r4.Parameters status4)
        {
            if (status4 == null)
            {
                return(null);
            }

            r5.SubscriptionStatus status5 = new r5.SubscriptionStatus();

            foreach (r4.Parameters.ParameterComponent param in status4.Parameter)
            {
                switch (param.Name)
                {
                case "subscription":
                    break;

                case "topic":
                    break;

                case "events-since-subscription-start":
                    break;

                case "events-in-notification":
                    break;

                case "status":
                    break;

                case "type":
                    break;

                case "error":
                    break;
                }
            }

            return(status5);
        }
        /// <summary>Converts an R5 subscription to another FHIR version.</summary>
        /// <param name="status5">The SubscriptionStatus.</param>
        /// <returns>The desired version of a SubscriptionStatus.</returns>
        public static r4.Parameters StatusFromR5(r5.SubscriptionStatus status5)
        {
            if (status5 == null)
            {
                return(null);
            }

            r4.Parameters status4 = new r4.Parameters();

            status4.Add("subscription", new ResourceReference(Program.UrlForR5ResourceId("Subscription", status5.Subscription.Reference)));
            status4.Add("topic", new FhirUri(status5.Topic));
            status4.Add("events-since-subscription-start", new UnsignedInt((int?)status5.EventsSinceSubscriptionStart));
            status4.Add("events-in-notification", new UnsignedInt(status5.EventsInNotification));

            switch (status5.Status)
            {
            case r5.SubscriptionState.Active:
                status4.Add("status", new Code("active"));
                break;

            case r5.SubscriptionState.Error:
                status4.Add("status", new Code("error"));
                break;

            case r5.SubscriptionState.Off:
                status4.Add("status", new Code("off"));
                break;

            case r5.SubscriptionState.Requested:
                status4.Add("status", new Code("requested"));
                break;

            default:
                break;
            }

            switch (status5.Type)
            {
            case r5.SubscriptionStatus.SubscriptionNotificationType.Handshake:
                status4.Add("type", new Code("handshake"));
                break;

            case r5.SubscriptionStatus.SubscriptionNotificationType.Heartbeat:
                status4.Add("type", new Code("heartbeat"));
                break;

            case r5.SubscriptionStatus.SubscriptionNotificationType.EventNotification:
                status4.Add("type", new Code("event-notification"));
                break;

            case r5.SubscriptionStatus.SubscriptionNotificationType.QueryStatus:
                status4.Add("type", new Code("query-status"));
                break;
            }

            if ((status5.Error != null) && (status5.Error.Count > 0))
            {
                status4.Add("error", status5.Error[status5.Error.Count - 1]);
            }

            return(status4);
        }