Thanks. I'm glad you got things working. I think the Java Developer's Guide also uses Entry: http://code.google.com/apis/health/developers_guide_java.html
That being said, we'd love to hear what's working and what isnt'. If you have a second, take our survey: http://spreadsheets.google.com/viewform?key=pFrmMi8feTQYCgZp4pwUwUQ Eric On Sep 26, 3:04 pm, amishera <[EMAIL PROTECTED]> wrote: > You know what the insertion worked. Though I have to go through a lot > of pains trying different permutation-combinations. The thing is that > if I use Entry instead of ProfileEntry then it works. Besides I need > to add <ContinuityOfCareRecord> tags too. The correct code is > > Entry entry = new Entry(); > > entry.setTitle(new PlainTextConstruct("Test Notice from SG")); > entry.setContent(new PlainTextConstruct("10th Notice")); > > entry.getAuthors().add(new Person("iamugi")); > > ContinuityOfCareRecord ccr = new ContinuityOfCareRecord(); > XmlBlob x = new XmlBlob(); > String ccrStr = "<ContinuityOfCareRecord xmlns=\"urn:astm-org:CCR > \"><Language/><DateTime><Type/></DateTime><Patient/><Body><Alerts><Alert><Type><Text>Allergy</Text></ > > Type><Description><Text>A-Fil</Text><Code><Value>7890-6</ > Value><CodingSystem>FDB</CodingSystem></Code><Code><Value>8.1511</ > Value><CodingSystem>Google</CodingSystem></Code></ > Description><Status><Text>ACTIVE</Text></ > Status><Source><Actor><ActorID>[EMAIL PROTECTED]</ > ActorID><ActorRole><Text>Patient</Text></ActorRole></Actor></ > Source><Reaction><Description/><Severity><Text>Severe</Text></ > Severity></Reaction></Alert></Alerts></Body></ > ContinuityOfCareRecord>"; > x.setBlob(ccrStr); > ccr.setXmlBlob(x); > entry.setXmlBlob(x); > > Entry e = service.insert(postUrl, entry); > > I am still frustrated with the lack of appropriate documentations. > > But anyway you are the NICEST GUY, ERIC. I really appreciate your > responses to my posts. > > On Sep 26, 2:57 pm, "Eric (Google)" <[EMAIL PROTECTED]> wrote: > > > Turn off validating the CCR xml. > > > Eric > > > On Sep 25, 8:33 pm, amishera <[EMAIL PROTECTED]> wrote: > > > > I used the tool. And when I use validation it shows some parse > > > exception. > > > > Now this is disconcerting. Because what google is offering is ok, but > > > if we use the very same data that is not accepted by google. > > > > Everything would be ok if there were some working examples. If things > > > are not that straightforward, then would not it be necessary to have > > > codes that demonstrate them? > > > > On Sep 25, 2:07 pm, "Eric (Google)" <[EMAIL PROTECTED]> wrote: > > > > > I would imagine the problem is with your CCR. > > > > > You can test that it will be reconciled into the profile > > > > by using Mt.Tabor's > > > > tool:https://h9demo.mttaboronline.com/health/index.html > > > > > Eric > > > > > On Sep 23, 8:24 pm, amishera <[EMAIL PROTECTED]> wrote: > > > > > > Also the insert code here is not working as well: > > > > > > URL postUrl = new URL(PROFILE_FEED_PATH + "ui/"+profileId); > > > > > ProfileEntry entry = new ProfileEntry(); > > > > > entry.getAuthors().add(new Person("amishera")); > > > > > > ContinuityOfCareRecord ccr = new ContinuityOfCareRecord(); > > > > > XmlBlob x = new XmlBlob(); > > > > > String ccrStr = > > > > > "<Language/><DateTime><Type/></DateTime><Patient/><Body><Alerts><Alert><Type><Text>Allergy</Text></ > > > > > > Type><Description><Text>A-Fil</Text><Code><Value>7890-6</ > > > > > Value><CodingSystem>FDB</CodingSystem></Code><Code><Value>8.1511</ > > > > > Value><CodingSystem>Google</CodingSystem></Code></ > > > > > Description><Status><Text>ACTIVE</Text></ > > > > > Status><Source><Actor><ActorID>[EMAIL PROTECTED]</ > > > > > ActorID><ActorRole><Text>Patient</Text></ActorRole></Actor></ > > > > > Source><Reaction><Description/><Severity><Text>Severe</Text></ > > > > > Severity></Reaction></Alert></Alerts></Body>"; > > > > > x.setBlob(ccrStr); > > > > > ccr.setXmlBlob(x); > > > > > entry.setContinuityOfCareRecord(ccr); > > > > > > service.insert(postUrl, entry); > > > > > > On Sep 23, 9:09 pm, amishera <[EMAIL PROTECTED]> wrote: > > > > > > > Hi, > > > > > > I have wrote this code to update an alergy record: > > > > > > > Query q = new Query(new URL(PROFILE_FEED_PATH + > > > > > > "ui/"+profileId)); > > > > > > > Category myCategory = new Category("Alerts"); > > > > > > > myCategory.setScheme("http://schemas.google.com/health/item"); > > > > > > myCategory.setTerm("Abbokinase"); > > > > > > CategoryFilter myCategoryFilter = new > > > > > > CategoryFilter(myCategory); > > > > > > > q.addCategoryFilter(myCategoryFilter); > > > > > > ProfileFeed myCategoryResultsFeed = service.query(q, > > > > > > ProfileFeed.class); > > > > > > > if (myCategoryResultsFeed.getEntries().size() > 0) { > > > > > > ProfileEntry firstMatchEntry = > > > > > > myCategoryResultsFeed.getEntries().get(0); > > > > > > String ccrOld = > > > > > > firstMatchEntry.getContinuityOfCareRecord().getXmlBlob().getBlob(); > > > > > > System.out.println("OLD CCR: "+ccrOld); > > > > > > > ContinuityOfCareRecord ccr = new ContinuityOfCareRecord(); > > > > > > XmlBlob x = new XmlBlob(); > > > > > > x.setBlob(new > > > > > > String(firstMatchEntry.getContinuityOfCareRecord().getXmlBlob().getBlob())); > > > > > > ccr.setXmlBlob(x); > > > > > > firstMatchEntry.setContinuityOfCareRecord(ccr); > > > > > > > System.out.println("NEW CCR: > > > > > > "+firstMatchEntry.getContinuityOfCareRecord().getXmlBlob().getBlob()); > > > > > > > URL editUrl = new > > > > > > URL(firstMatchEntry.getEditLink().getHref()); > > > > > > > ProfileEntry updatedEntry = service.update(editUrl, > > > > > > firstMatchEntry); > > > > > > > System.out.println(updatedEntry.getContinuityOfCareRecord().getXmlBlob().getBlob()); > > > > > > } > > > > > > > The output is; > > > > > > > OLD CCR: > > > > > > <Language/><DateTime><Type/></DateTime><Patient/><Body><Alerts><Alert><Type><Text>Allergy</Text></ > > > > > > > Type><Description><Text>Abbokinase</Text><Code><Value>8437-2</ > > > > > > Value><CodingSystem>FDB</CodingSystem></Code></ > > > > > > Description><Status><Text>ACTIVE</Text></ > > > > > > Status><Source><Actor><ActorID>[EMAIL PROTECTED]</ > > > > > > ActorID><ActorRole><Text>Patient</Text></ActorRole></Actor></ > > > > > > Source><Reaction><Description/><Severity><Text>Severe</Text></ > > > > > > Severity></Reaction></Alert></Alerts></Body> > > > > > > NEW CCR: > > > > > > <Language/><DateTime><Type/></DateTime><Patient/><Body><Alerts><Alert><Type><Text>Allergy</Text></ > > > > > > > Type><Description><Text>Abbokinase</Text><Code><Value>8437-2</ > > > > > > Value><CodingSystem>FDB</CodingSystem></Code></ > > > > > > Description><Status><Text>ACTIVE</Text></ > > > > > > Status><Source><Actor><ActorID>[EMAIL PROTECTED]</ > > > > > > ActorID><ActorRole><Text>Patient</Text></ActorRole></Actor></ > > > > > > Source><Reaction><Description/><Severity><Text>Severe</Text></ > > > > > > Severity></Reaction></Alert></Alerts></Body> > > > > > > null > > > > > > > And from the google health web site the corresponding entry gets > > > > > > vanished. > > > > > > > Here in this code, I have explicitly set the old CCR as the new CCR. > > > > > > That means I am sending back exactly what google health is sending > > > > > > and > > > > > > the update code is also adapted from google data api sample's page: > > > > > > >http://code.google.com/apis/gdata/client-java.html#Update_Item > > > > > > > retrievedEntry.setTitle(new PlainTextConstruct("Important > > > > > > meeting")); > > > > > > URL editUrl = new URL(retrievedEntry.getEditLink().getHref()); > > > > > > EventEntry updatedEntry = myService.update(editUrl, myEntry); > > > > > > > That means the code and data both are taken from google. I double > > > > > > checked so that there is not typo on my part. But still it is not > > > > > > working. > > > > > > > So I am not sure what I should do on my part to make this working. > > > > > > > Please help here. > > > > > > > Thanks in advance.- Hide quoted text - > > > > > - Show quoted text -- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Health Developers" group. To post to this group, send email to googlehealthdevelopers@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---