We currently have a read-only objective-c app for GoogleHealth and are
trying to integrate posting capability using the current API. Other
than a very simple record we are unable to post consistently.
Below is the code we are using.
(The service below is the same service used for fetching and is
obtained through ClientLogin authentication. The object root,
referenced below, is an GDataXMLElement.)
------------------------------------------------------
//Create CCR
GDataContinuityOfCareRecord* newCCR =
[GDataContinuityOfCareRecord
objectWithXMLElement:root];
//Create health register entry
GDataEntryHealthRegister* entry = [GDataEntryHealthRegister
registerEntry];
[entry setContinuityOfCareRecord:newCCR];
//Get register feed url
GDataEntryHealthProfile* profile = [profileList objectAtIndex:0];
NSString* profileID = [[profile content] stringValue];
NSURL* registerFeedURL =
[GDataServiceGoogleHealthSandbox
registerFeedURLForProfileID:profileID];
//Insert entry
[self.service fetchEntryByInsertingEntry:entry
forFeedURL:registerFeedURL
delegate:self
didFinishSelector:@selector(insertTicket:finishedWithEntry:error:)];
-----------------------------------------------
When root is a simple GDataXMLElement, without any children, posting
to the sandbox appears to work. A notice is generated in the sandbox
indicating that the post has been received. The XML fragment for the
simple element is:
GDataXMLElement* root = [GDataXMLElement
elementWithName:@"ContinuityOfCareRecord"];
GDataXMLNode* attribute = [GDataXMLNode attributeWithName:@"xmlns"
stringValue:@"'urn:astm-org:CCR'"];
[root addAttribute:attribute];
If even a single child is added to the root an error is generated (500
error). Sample code for this fragment would be the above XML plus:
childNode = [GDataXMLNode elementWithName:@"Body"];
[root addChild:childNode];
Based on debugging a valid CCR is being generated. Any help on why
these tags are being rejected would be appreciated.
Thanks in advance,
DT
--
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.