Hi
I have tried to delete multiple entry Using the Batch Operation but i
get the following ERROR:
"The markup in the document preceding the root element must be well-
formed."
& here is my CODE:
NSString *myStr = [NSString stringWithFormat:@"%...@%@", @"https://
www.google.com/health/feeds/profile/ui/", myProfileName];
NSMutableURLRequest *httpReq = [[NSMutableURLRequest alloc]
initWithURL:[NSURL URLWithString:myStr] ];
[httpReq setTimeoutInterval:30.0];
[httpReq setHTTPMethod:@"POST"];
// [httpReq addValue:@"Content-Type"
forHTTPHeaderField:@"application/
atom+xml"];
[httpReq addValue:@"application/atom+xml"
forHTTPHeaderField:@"Content-Type"];
NSString* param = [NSString stringWithFormat:@"GoogleLogin auth=%@",
[parameter valueForKey:@"Auth"]];
[httpReq setValue:param forHTTPHeaderField: @"Authorization"];
[httpReq addValue:@"Authorization" forHTTPHeaderField:param];
NSHTTPURLResponse *response = nil;
// NSString *str=[NSString stringWithFormat:@"<?xml version=\"1.0\"
encoding=\"utf-8\"?>
<entry xmlns=\"http://www.w3.org/2005/Atom\">
<title type=\"text\">sdf</title>
<content type=\"text\">sdf</content>
<ContinuityOfCareRecord xmlns=\"urn:astm-org:CCR\">
<Language><Text>English</Text><Code><Value>en</Value>
<CodingSystem>ISO-639-1</CodingSystem> </Code> </Language>
<Version>V1.0</Version> <DateTime> <Type />
<ExactDateTime>2007-05-25T11:57:20Z</ExactDateTime> </DateTime>
<Patient> <ActorID>Dipen</ActorID> </Patient> <Body> <Results>
<Result> <Description> <Text>%@</Text> <Code> <Value>24358-4</
Value> <CodingSystem>LOINC</CodingSystem> </Code> </Description>
<DateTime> <Type><Text>Collection start date</Text></Type>
<ExactDateTime>%...@t04:00:00Z</ExactDateTime> </DateTime> <Source>
<Actor> <ActorID>%@</ActorID> <ActorRole>%@</ActorRole> </Actor> </
Source> <Test> <Description> <Text>Descriptipn</Text> <Code> <Value>
%@</Value> <CodingSystem>LOINC</CodingSystem> </Code> </Description>
<TestResult> <Value>6400</Value> <Units>cells/microlite</Units> </
TestResult> <NormalResult></NormalResult> </Test> </Result> </Results>
</Body><Actors><Actor><ActorObjectID>Dipen</
ActorObjectID><Person><Name><CurrentName><Given>2</
Given><Family>Surescripts</Family></CurrentName></
Name><DateOfBirth><Type /><ExactDateTime>1955-01-02T12:00:00Z</
ExactDateTime></DateOfBirth><Gender /></
Person><Address><Type><Text>Home</Text></Type></
Address><Telephone><Value>123-456-7890</Value></
Telephone><EMail><Value>[email protected]</Value></
EMail><URL><Value>http://mttaboros.com</Value></URL><Status /><Source /
></Actor></Actors></ContinuityOfCareRecord></entry>",[self
replaceStringWith:Description],[self replaceStringWith:Value],[self
replaceStringWith:DateTime],[self replaceStringWith:ActorID],[self
replaceStringWith:ActorRole],[self replaceStringWith:Value1],[self
replaceStringWith:TestResultValue],[self replaceStringWith:uints],
[self replaceStringWith:NoramlResults]];
NSString *strRequest=@"<?xml version=\"1.0\" encoding=\"utf-8\"?
><<feed xmlns=\"http://www.w3.org/2005/Atom\""
"xmlns:openSearch=\"http://a9.com/-/spec/opensearchrss/1.0/\""
"xmlns:g=\"http://base.google.com/ns/1.0\""
"xmlns:batch=\"http://schemas.google.com/gdata/batch\">"
"<title type=\"text\">My Batch Feed</title>entry
xmlns=\"http://
www.w3.org/2005/Atom\">"
"<batch:operation type=\"delete\"/>"
"<id>https://www.google.com/health/feeds/profile/ui/qjFkYfopm8Y/
x1er2MbMqew</id>"
"<id>https://www.google.com/health/feeds/profile/ui/qjFkYfopm8Y/
zxUP5hvRwUg</id>"
"</entry></feed>";
NSString *requestBody = [[NSString alloc]
initWithFormat:strRequest ];
[httpReq setHTTPBody:[requestBody
dataUsingEncoding:NSASCIIStringEncoding]];
NSData *data = nil;
NSError *error = nil;
NSString* responseStr;
data = [NSURLConnection sendSynchronousRequest:httpReq
returningResponse:&response error:&error];
if( [data length] >0)
responseStr = [[NSString alloc] initWithData:data
encoding:NSASCIIStringEncoding];
Here
https://www.google.com/health/feeds/profile/ui/qjFkYfopm8Y/x1er2MbMqew
https://www.google.com/health/feeds/profile/ui/qjFkYfopm8Y/zxUP5hvRwUg
are the id of medication& allert ID.
Please Help Me.
Thanks in Advance.
On Mar 13, 1:19 am, "Eric (Google)" <[email protected]> wrote:
> You'll want to use category queries to fetch the
> relevant information, and then construct a
> batch feed/request:
>
> http://code.google.com/apis/health/docs/2.0/reference.html#CatQuerieshttp://code.google.com/apis/health/docs/2.0/developers_guide_protocol...
>
> Eric
>
> On Mar 9, 10:00 pm, Try <[email protected]> wrote:
>
>
>
> > Yes now i can delete the particular medication or category data.
> > Thank you eric... now i can delete one by one record using their id,
> > but is there any way to delete all medication data or other category
> > data like immunization ,condition etc.
>
> > & again thanks eric for your help.
>
> > On Mar 10, 1:46 am, "Eric (Google)" <[email protected]> wrote:
>
> > > Don't use the digest=true parameter if you're trying
> > > to delete an individual entry/record. Using digest=true
> > > consolidates the user's entire CCR in a single <atom:entry>.
> > > The server won't let you delete the entire profile :)
> > > You need a specific <entry>.
>
> > > Also, if you have an entry there's no need to
> > > construct the uri manually. Just use the edit <atom:link>
> > > that has
> > > rel='edit':http://code.google.com/apis/health/docs/2.0/developers_guide_protocol...
>
> > > Eric
>
> > > On Mar 8, 11:28 pm, Try <[email protected]> wrote:
>
> > > > sorry i forget to add error i got the following error
> > > > Oops an error has occured.
> > > > Please include the following information in your error report:
>
> > > > AP52v_QPeicgZ6_hSTJdb192uCep7KZxO-
> > > > f4OoifWXi8nfRhd6A_eWWEHUgNcp0CfI0d1Zw4ZABiwbUA
> > > > Z9aVfQ9fIG1F6GwcRiyEHmqvuI12xi49=================ZcqFRUNF6iWAsTto06yYYp7vSA
> > > > 90FTS
> > > > CB5EoPjRrK1zUNZ7HUDzlSl===================================olhmEn5s4UEEaU970
> > > > 4iKnc
> > > > UlypbA46zhUMxvdHh7K8==========================================043UhTXQGaTEN
> > > > Xl8Kz
> > > > 7z-
> > > > FWGfyynK_sQ5Be=============o11WVS3hoWTr5MFXQ2NRl==============z2Zod_lEFeOX9
> > > > jL
> > > > XT0T8uxW-FW1rk===========bdadUDhyLe-
> > > > W7lEDJyMFfPSL2epEDm3============L3yxpLhMbR84
> > > > K2o97eTy8RP===========N4WNymkiu9G32K_6A3QqyQmmCNbdy3JcZxBwa===========X7QS4
> > > > aJhZx
> > > > 5WYGzcvTl==========cBariK-
> > > > fZbm7H8Wo0TUGOwJRIhfRfw61CJHS0lWd4LR=========FiMh41Qbp
> > > > At9DICU==========qu1NoE======uQcomv_iuU-9DRDNOu9oM23======uzcTnJ=========Nd
> > > > A3fAb
> > > > DZwYOy=========DK0HpwML==qy==K_uFLh3_XvsjCKqFBOH4Piu==l3==NNgIrsh2========o
> > > > UIZXO
> > > > 18AdP========SZP0VpX0av======v3pGlccOdf5HvCMB38ytOtv======SyrgMBNIgh=======
> > > > sbP8N
> > > > X5j84======767rE2UaDYv4H3oiH1Is9tLJW0M5zTH8nP5yeoWcEdjV1ARjaY9YBsuofc======
> > > > ZF2DL
> > > > G4CR======Ju7miFioSvERCzC5ByEtkXPwsK5_x-
> > > > G_Hx-3uxR0Gq9Cve1sq4kOFXkER7St======8gbP
> > > > rs9X======Qx9VMDilq-QAvyzAb4PjgQ-
> > > > ppojHwQ_9yWRDzvNENPdGKyaCoR7Kqsm3xXz_======hCiV
> > > > cR9======EHSMB30ex0Dzy5Kx6uD30GvRc_q9xV2O0i1z1BIthnS6Ylx96_WpKHOZxVFUWB====
> > > > ==1ja
> > > > vmc======9bExVa36zSg5cSYGhaN0Xb==================91l9bdO6cBhIaPTzikj_2u====
> > > > ==zwr
> > > > X3z======KVyjN1-9DOcTmSZkiu==========================hjLt_vM5C68tH1c76n====
> > > > ==XKJ
> > > > cWZ======cQPwXfSCufT1x5w=============R0KsCj=============_1I1_0693BXz5kI====
> > > > ==F_p
> > > > dHIu======bLyBBjV-
> > > > R6aO===========fcRh2adyZ7Lkzu===========JeXAWYO9XEtS======xQ25
> > > > Quk4======9kVuWLf1b2L=========a8UOihHtOgoNQlQs40l7=========nTBAvKQGpoy=====
> > > > =ieip
> > > > 7R5Th======pEEXpe3cMv=======0NBTp0mW0J21tgHfwfhojKvF=======TGmRWy70DI======
> > > > y06Zh
> > > > uSTcy========ATLJ45qw8====XDHLTfAiUajaI77Thwv7MmYiCqinw====hXzKYW-
> > > > HB=======S_f31
> > > > pVj7In=========FcEQundGxxjPtNfTRBfUXb6CSjy3A9Hdd9-6XctPrM6obzTHBj0========L
> > > > xCtAf
> > > > L--
> > > > CZFF==========cyk8rMbB4x5ar3L9Te9NBvTysKuhTuo1Xl9GS4aOzTy2vbG=========_16L5
> > > > 8U
> > > > bIeheoUyW==========1Iqo8_OsWWniJibDBe42BUwuPifH_K23w-
> > > > R2tD_skmd=========PFh8tQfkw
> > > > mSqiiq9p8eO===========lcW1UKlGiJjXu2bldSPhBnoD7K9WUdC8INOGu===========F-8ur
> > > > 6Qj2d
> > > > DGhNRE6Dg4eoMO===========vf80mPLQ33oUEvb7YjbFhFdXridhy3y============4lSLfIq
> > > > AEv1u
> > > > 7K5xomtnhJb2ghvBC=============Br1wA2Jd97h7KGLmRtxAr==============29d8qOeTCy
> > > > 0mmq9
> > > > Y1D2ly2KRBVChwzszasf==========================================yYhGXx9el_5MN
> > > > XxMoi
> > > > 4VdB81L-
> > > > Nsofqjs0iYiYjiC===================================e6vYdQWKsNzddn8Kg04OL2
> > > > DvKSzujAUsDqxsz-
> > > > NGXv28CrSm9Lcd2_=================qZrtYO6__zdVez3pEaP7GR5Q82UmNWx
> > > > dGAQrEcpIgMG8HYOxp_YtTzPHxIMQtz_wwrWhIK9wdd6-
> > > > W79rjA0BMefDaoIiWIgvDgFNHfJc_q3X5eA
>
> > > > Mdqwo2_ZM7yw1X6RYI4qPHy-
> > > > hzmSXs3ueG9ooElm9afGc4WwnPJV3zpRawvNoVTAB0z5hxNTK301AZGZ
> > > > AztdMaPVvAIy_VnCdmqzrubjDxvgZEZ-
> > > > =================LLr7R669M1a_7uyAiilYK4bUFzNa3Pj
> > > > 1MgTPqj2LSMTzxWhjp-2lOr===================================wa7sg=
>
> > > > On Mar 9, 11:08 am, Try <[email protected]> wrote:
>
> > > > > Hi Eric
>
> > > > > Hi tried for delete entry but i get this error
>
> > > > > & i use the following code & here qjFkYfopm8Y_digest is my Entry ID
>
> > > > > NSString *myStr = [NSString stringWithFormat:@"%...@%@/
> > > > > qjFkYfopm8Y_digest", @"https://www.google.com/health/feeds/profile/
> > > > > ui/", myProfileName];
>
> > > > > NSMutableURLRequest *httpReq = [[NSMutableURLRequest alloc]
> > > > > initWithURL:[NSURL URLWithString:myStr] ];
>
> > > > > [httpReq setTimeoutInterval:30.0];
>
> > > > > [httpReq setHTTPMethod:@"GET"];
>
> > > > > [httpReq addValue:@"Content-Type"
> > > > > forHTTPHeaderField:@"application/
> > > > > atom+xml"];
>
> > > > > NSString* param = [NSString stringWithFormat:@"GoogleLogin
> > > > > auth=%@",
> > > > > [parameter objectForKey:@"Auth"]];
>
> > > > > [httpReq setValue:param forHTTPHeaderField: @"Authorization"];
>
> > > > > // [httpReq addValue:@"Authorization" forHTTPHeaderField:param];
>
> > > > > NSHTTPURLResponse *response = nil;
>
> > > > > NSData *data = nil;
>
> > > > > NSError *error = nil;
>
> > > > > NSString* responseStr;
>
> > > > > data = [NSURLConnection sendSynchronousRequest:httpReq
> > > > > returningResponse:&response error:&error];
>
> > > > > if( [data length] >0)
>
> > > > > responseStr = [[NSString alloc] initWithData:data
> > > > > encoding:NSASCIIStringEncoding];
>
> > > > > Thanks
> > > > > Dipen
>
> > > > > On Mar 9, 10:38 am, Try <[email protected]> wrote:
>
> > > > > > Hi Eric,
>
> > > > > > I tried to find my error but i can't find it so i have skip this
> > > > > > step
> > > > > > & now i m going to delete the entry like medication entry for that i
> > > > > > read the documentation but there is a question regarding the entry
> > > > > > id
> > > > > > for each & every medication there is a unique entry id???
> > > > > > & i have also not much knowledge about the entry id.
>
> > > > > > Thanks
> > > > > > Dipen
>
> > > > > > On Mar 8, 2:12 am, "Eric (Google)" <[email protected]> wrote:
>
> > > > > > > It appears that your Content-Type: application/atom+xml
> > > > > > > header isn't being honored.
>
> > > > > > > Here's a conversation for October that may
> > > > > > > help:http://groups.google.com/group/googlehealthdevelopers/browse_thread/t...
>
> > > > > > > Eric
>
> > > > > > > On Mar 6, 8:49 pm, Try <[email protected]> wrote:
>
> > > > > > > > I tried for that, but I found following error each time when I
> > > > > > > > posting
> > > > > > > > the medication data.
>
> > > > > > > > Content-Type application/x-www-form-urlencoded is not valid.
>
> > > > > > > > I am using following code to post medication data.
>
> > > > > > > > NSString *myStr = [NSString stringWithFormat:@"%...@%@",
> > > > > > > > @"https://www.google.com/health/feeds/register/ui/",
> > > > > > > > myProfileName];
>
> > > > > > > > NSMutableURLRequest *httpReq = [[NSMutableURLRequest
> > > > > > > > alloc]
> > > > > > > > initWithURL:[NSURL URLWithString:myStr] ];
>
> > > > > > > > [httpReq setTimeoutInterval:30.0];
>
> > > > > > > > [httpReq setHTTPMethod:@"POST"];
>
> > > > > > > > [httpReq addValue:@"Content-Type"
> > > > > > > > forHTTPHeaderField:@"application/
> > > > > > > > atom+xml"];
>
> > > > > > > > //NSString* param = [NSString
> > > > > > > > stringWithFormat:@"GoogleLogin
> > > > > > > > auth=
> > > > > > > > %@", [parameter objectForKey:@"Auth"]];
> > > > > > > > //
> > > > > > > > // [httpReq setValue:param forHTTPHeaderField:
> > > > > > > > @"Authorization"];
> > > > > > > > //
> > > > > > > > // [httpReq addValue:@"Authorization"
> > > > > > > > forHTTPHeaderField:param];
>
> > > > > > > > NSHTTPURLResponse *response = nil;
>
> > > > > > > > //NSString *strData=@"<?xml version='1.0'
> > > > > > > > encoding='UTF-8'?><feed
>
> > > > > > > > xmlns='http://www.w3.org/2005/Atom'xmlns:openSearch='http://a9.com/-/
> > > > > > > > spec/opensearchrss/1.0/' xmlns:ccr='urn:astm-org:CCR'
> > > > > > > > xmlns:batch='http://schemas.google.com/gdata/batch'xmlns:h9m='http://
> > > > > > > > schemas.google.com/health/metadata'><id>https://www.google.com/health/
> > > > > > > > feeds/profile/ui/qjFkYfopm8Y</id><updated>2009-03-06T09:26:46.779Z</
> > > > > > > > updated><category scheme='http://schemas.google.com/g/2005#kind'
> > > > > > > > term='http://schemas.google.com/health/kinds#profile'/><title
> > > > > > > > type='text'>Profile Feed</title><link
> > > > > > > > rel='http://schemas.google.com/
> > > > > > > > g/
> > > > > > > > 2005#feed' type='application/atom+xml'
> > > > > > > > href='https://www.google.com/
> > > > > > > > health/feeds/profile/ui/qjFkYfopm8Y'/><link rel='http://
> > > > > > > > schemas.google.com/g/2005#post' type='application/atom+xml'
> > > > > > > > href='https://www.google.com/health/feeds/profile/ui/qjFkYfopm8Y'/><link
> > > > > > > > rel='http://schemas.google.com/g/2005#batch'type='application/
>
> > > > > > > > atom+xml' href='https://www.google.com/health/feeds/profile/ui/
> > > > > > > > qjFkYfopm8Y/batch'/><link rel='self' type='application/atom+xml'
> > > > > > > > href='https://www.google.com/health/feeds/profile/ui/qjFkYfopm8Y'/><openSearch:startIndex>1</openSearch:startIndex><entry><id>https://...
>
> read more »
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---