locked
Healthvault RRS feed

  • Question

  • Programattically how to add new person  in healthvaultaccount page?
    Tuesday, November 3, 2009 7:07 AM

Answers

  • Hello,

    In Healthvault, users own accounts and records. You can do a shell redirect to allow a user to create an account or record while they try to use HealthVault from your application.  The actual record creation should be done by the user using the pages provided by HealthVault. Here is the code that may be useful for you to create a person.

    Code Block

        /// <SUMMARY>
        /// Redirect a user to create a new healthvault record
        /// </SUMMARY>
        public void RedirectForRecordCreation()
        {
            StringBuilder query = new StringBuilder(128);
            query.Append(HealthVaultShellRedirect.CreateRecord.AppId);
            query.Append(WebApplicationConfiguration.AppId);
            // We are doing this for only one record
            query.Append("&" + HealthVaultShellRedirect.CreateRecord.IsMRA + "false");
            // We dont need a persistent token, it might be useful for managing campaigns
            query.Append("&" + HealthVaultShellRedirect.CreateRecord.PersistWCToken + " ");
            RedirectToShellUrl(HealthVaultShellRedirect.To.CreateRecord,
                query.ToString());
         }

        /// <summary>
        /// Template class for HealthVaultShellRedirects
        /// NOTE: Does not include all possible redirections
        /// </summary>
        public static class HealthVaultShellRedirect
        {
            public static class To
            {
                public const string Help = "help";
                public const string AppAuth = "appauth";
                public const string CreateRecord = "createrecord";
            }

            public static class Help
            {
                public const string FAQ = "topicid=faq";
            }
            public static class AppAuth
            {
                public const string AppId = "appid=";
                public const string Redirect = "redirect=";
            }
            public static class CreateRecord
            {
                public const string AppId = "appid=";
                public const string IsMRA = "ismra=";
                public const string PersistWCToken = "persistwctoken=";
            }
        }

    Hope this helps..


    -Mahesh
    Tuesday, November 3, 2009 9:46 AM
  • Exactly-- you cannot programmatically create accounts or records in HealthVault.  Those actions must be performed by an actual user manually.
    Tuesday, November 3, 2009 10:51 PM

All replies

  • Hello,

    In Healthvault, users own accounts and records. You can do a shell redirect to allow a user to create an account or record while they try to use HealthVault from your application.  The actual record creation should be done by the user using the pages provided by HealthVault. Here is the code that may be useful for you to create a person.

    Code Block

        /// <SUMMARY>
        /// Redirect a user to create a new healthvault record
        /// </SUMMARY>
        public void RedirectForRecordCreation()
        {
            StringBuilder query = new StringBuilder(128);
            query.Append(HealthVaultShellRedirect.CreateRecord.AppId);
            query.Append(WebApplicationConfiguration.AppId);
            // We are doing this for only one record
            query.Append("&" + HealthVaultShellRedirect.CreateRecord.IsMRA + "false");
            // We dont need a persistent token, it might be useful for managing campaigns
            query.Append("&" + HealthVaultShellRedirect.CreateRecord.PersistWCToken + " ");
            RedirectToShellUrl(HealthVaultShellRedirect.To.CreateRecord,
                query.ToString());
         }

        /// <summary>
        /// Template class for HealthVaultShellRedirects
        /// NOTE: Does not include all possible redirections
        /// </summary>
        public static class HealthVaultShellRedirect
        {
            public static class To
            {
                public const string Help = "help";
                public const string AppAuth = "appauth";
                public const string CreateRecord = "createrecord";
            }

            public static class Help
            {
                public const string FAQ = "topicid=faq";
            }
            public static class AppAuth
            {
                public const string AppId = "appid=";
                public const string Redirect = "redirect=";
            }
            public static class CreateRecord
            {
                public const string AppId = "appid=";
                public const string IsMRA = "ismra=";
                public const string PersistWCToken = "persistwctoken=";
            }
        }

    Hope this helps..


    -Mahesh
    Tuesday, November 3, 2009 9:46 AM
  • Exactly-- you cannot programmatically create accounts or records in HealthVault.  Those actions must be performed by an actual user manually.
    Tuesday, November 3, 2009 10:51 PM