Since you're using ClientLogin, use the /ui feeds:
http://code.google.com/apis/health/docs/2.0/reference.html#ClientLoginFeeds

First use the profile/list feed to obtain a particular profile's id,
and then use the /register/ui/profileID or /profile/ui/profileID
feeds as needed.

Eric

On Mar 1, 6:18 am, Dub---C <[email protected]>
wrote:
> Hi All,
>
> I am trying to do a basic retrieve and update of ccr data to a
> profile
> on google health. i am getting the following: A first chance
> exception
> of type 'Google.GData.Client.GDataRequestException' occurred in
> Google.GData.Client.dll
>
> my code is shown below: thanks very much in advance to any1 who can
> see my problem.
>
> HealthService service = new HealthService("exampleCo-exampleApp-1");
>             service.setUserCredentials
> ("username", "password");
>
>             AtomEntry newNotice = new AtomEntry();
>             newNotice.Title.Text = "A test message";
>             newNotice.Content.Content = "This is a test message.";
>             // Set the content type if you're using HTML in your
> message body
>             //newNotice.Content.Type = "html";
>             String ccrXmlString =  @"<ContinuityOfCareRecord
> xmlns='urn:astm-org:CCR'>
>                                         <Body>
>                                             <Problems>
>                                                 <Problem>
>
> <DateTime>
>
> <Type>
>
> <Text>Start date</Text>
>                                                         </
> Type>
>
> <ExactDateTime>2007-04-04T07:00:00Z</ExactDateTime>
>                                                     </
> DateTime>
>
> <DateTime>
>
> <Type>
>
> <Text>Stop
> date</Text>
>                                                         </
> Type>
>
> <ExactDateTime>2008-07-20T07:00:00Z</ExactDateTime>
>                                                     </
> DateTime>
>
> <Description>
>
> <Code>
>
> <Value>346.80</Value>
>
> <CodingSystem>ICD9</CodingSystem>
>
> <Version>2004</Version>
>                                                         </
> Code>
>                                                     </
> Description>
>
> <Status><Text>Active</Text></Status>
>
> <Source>
>
> <Actor>
>
> <ActorID>Harris Smith</ActorID>
>
> <ActorRole>
>
> <Text>Treating clinician</Text>
>                                                             </
> ActorRole>
>                                                         </
> Actor>
>                                                     </
> Source>
>                                                 </Problem>
>                                             </Problems>
>                                         </Body>
>                                     </ContinuityOfCareRecord>";
>             XmlDocument ccrDoc = new XmlDocument();
>             ccrDoc.LoadXml(ccrXmlString);
>             newNotice.ExtensionElements.Add(new XmlExtension
> (ccrDoc.DocumentElement));
>             //service.Insert(new Uri("https://www.google.com/health/
> feeds/register/default"), newNotice);
>             try
>             {
>                 service.Insert(new Uri("https://www.google.com/h9/
> feeds/register/default"), newNotice);
>             }
>             catch (GDataRequestException err)
>             {
>             }
>
>             //HealthQuery profileQuery = new 
> HealthQuery("https://www.google.com/health/feeds/profile/default";);
>             HealthQuery profileQuery = new 
> HealthQuery("https://www.google.com/h9/feeds/profile/default";);
>             profileQuery.Digest = true;
>             // returns a single <atom:entry> containing the user's
> CCR
>             try
>             {
>                 HealthFeed feed = service.Query(profileQuery);
>                 foreach (HealthEntry entry in feed.Entries)
>                 {
>                     XmlNode ccr = (XmlExtension) entry.FindExtension
> ("ContinuityOfCareRecord", "urn:astm-org:CCR");
>                     if (ccr != null)
>                     {
>                         System.Web.HttpContext.Current.Response.Write
> ("<pre>");
>                         StringWriter sw = new StringWriter();
>                         XmlTextWriter xw = new XmlTextWriter
> (sw);
>                         xw.Formatting = Formatting.Indented;
>                         ccr.WriteTo(xw);
>                         System.Web.HttpContext.Current.Response.Write
> (HttpUtility.HtmlEncode(sw.ToString()));
>                         System.Web.HttpContext.Current.Response.Write
> ("</pre>");
>
>                         Console.WriteLine("ccr is not null");
>                     }
>                 }
>             }
>             catch (GDataRequestException err)
>             {
>                 }
>
> thanks very much in advance to any1 who can see my problem.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Health Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/googlehealthdevelopers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to