Record update date

Oct 16, 2012 at 2:51 PM

Hi,

I am trying to get a record last modified date.

So I have Weight value which is updated from my website and I would like to check whether my website value is most recent or HV value is most recent. How can I compare?

Thanks for your help in advance.

Coordinator
Oct 23, 2012 at 10:09 PM
Edited Oct 23, 2012 at 10:09 PM

Hi,

When you call GetThings, all items are returned sorted by effective date in descending order.  By limiting your result set to a single item, you will get the latest weight measurment.

ThingRequestGroup group = new ThingRequestGroup();
    	
ThingFilterSpec filter = new ThingFilterSpec();
filter.getTypeId().add("3d34d87e-7fc1-4153-800f-f56592cb0d17");
group.getFilter().add(filter);
group.setMax(1);
    	
ThingFormatSpec format = new ThingFormatSpec();
format.getSection().add(ThingSectionSpec.CORE);
format.getXml().add("");
group.setFormat(format);    	
    	
GetThingsRequest info = new GetThingsRequest();
info.getGroup().add(group);
    	
GetThingsResponse response = 
	(GetThingsResponse)requestTemplate.makeRequest(info);
    	
Weight weight = 
     (Weight)response.getGroup().get(0).getThing().get(0).getData();

 

Oct 31, 2012 at 1:45 PM
Edited Oct 31, 2012 at 1:46 PM

Hi,

Thanks for your response.

I want to know the hv record last updated date so that I can compare my 'database' record date and hv record date then I can decide which is most recent value and update accordingly.

With your solution I can only that record is most recent record in healthvault.

Thanks,