locked
Fetch only the items that have changed RRS feed

All replies

  • I suggest reading that article here; tweesta is just republishing...

    The request that you list should work to fetch all weight items. If it doesn't, it could be that the application isn't authorized to fetch weight items, or that there are no weight items in the record, or something else.

    I suggest starting with the mobile sample application and then changing the application id to the one for your application.

    Tuesday, November 22, 2011 5:26 PM
  • Based on the link you provided, i should get audit info like eff-date, created, updated, etc. right?

    I am not getting that, i just get the list of medications. then what is use of writing  <section>audits</section>

    -Thank you

    Tuesday, November 22, 2011 6:23 PM
  • Yes, you should.

    Can you debug into your code, grab the request xml, and post it?

     

     

    Tuesday, November 22, 2011 7:22 PM
  • Here is Request xml
    NSString *xml = @"<info>"
        "<group>"
        "<filter>"
        "<type-id>30cafccc-047d-4288-94ef-643571f7919d</type-id>"
        "<thing-state>Active</thing-state>"
        "</filter>"
        "<format>"
        "<section>audits</section>"
        "<section>core</section>"
        "<xml/>"
        "</format>"
        "</group>"
        "</info>";
        
    	
    // Request for retrieving weights.
    HealthVaultRequest *request = [[HealthVaultRequest alloc] initWithMethodName: @"GetThings"
                             methodVersion: 3
                             infoSection: xml
                              target: target
                              callBack: callBack];
    


    Response xml

    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ccr="urn:astm-org:CCR" xmlns:h="urn:com.microsoft.wc.thing" xmlns:v="urn:com.microsoft.wc.ccrVocab">
    <CCRDocumentObjectID>fcf0bd4fd8ce41548d401bff304327fe</CCRDocumentObjectID>
    <Language>
    <Text>English</Text>
    </Language>
    <Version>V1.0</Version>
    <DateTime>
    	<ExactDateTime>2011-11-22T18:11:28.4405278Z</ExactDateTime>
    </DateTime>
    <Patient>
    	<ActorID>PatientActor</ActorID>
    </Patient>
    <From>
    <ActorLink>
    <ActorID>ID0RB</ActorID>
    <ActorRole>
    <Text>Healthcare Information ystem</Text>
    </ActorRole>
    </ActorLink>
    </From>
    <Body>
    <Medications>
    <Medication>
    <CCRDataObjectID>adc1ca2a25b54324b9798b092d705810</CCRDataObjectID>
    <Source>
    <Description>
    <Text>Unknown</Text>
    </Description>
    </Source>
    <Product>
    <ProductName>
    <Text>Albumin Human, USP 50 MG/ML [Albutein]</Text>
    <Code>
    <Value>2960382</Value>
    <CodingSystem>RxNorm Active Medicines</CodingSystem>
    <Version>09AB_091102F</Version>
    </Code>
    <Code>
    <Value>566121</Value>
    <CodingSystem>RxNorm Active Medicines oncepts</CodingSystem>
    <Version>09AB_091102F</Version>
    </Code>
    </ProductName>
    <Strength>
    <Value>50</Value>
    <Units>
    <Unit>Milligram per milliliter (mg/ml)</Unit>
    <Code>
    <Value>mgperml</Value>
    <CodingSystem>medication-strength-unit</CodingSystem>
    <Version>1</Version>
    </Code>
    </Units>
    </Strength>
    </Product>
    <Directions>
    <Direction>
    <Dose>
    <Value>1</Value>
    <Units>
    <Unit>Bars</Unit>
    <Code>
    <Value>Bars</Value>
    <CodingSystem>medication-dose-units</CodingSystem>
    <Version>1</Version>
    </Code>
    </Units>
    </Dose>
    <Route>
    <Text>By mouth</Text>
    <Code>
    <Value>po</Value>
    <CodingSystem>medication-routes</CodingSystem>
    <Version>2</Version>
    </Code>
    </Route>
    </Direction>
    </Directions>
    </Medication>
    <Medication>
    <CCRDataObjectID>ebe84b1189754ec281b17db5c0313623</CCRDataObjectID>
    <DateTime>
    <Type>
    <Text>Start date</Text>
    </Type>
    <ExactDateTime>2011-09-14</ExactDateTime>
    </DateTime>
    <DateTime>
    <Type>
    <Text>Stop date</Text>
    </Type>
    <ExactDateTime>2011-09-15</ExactDateTime>
    </DateTime>
    <Source>
    <Description>
    <Text>Unknown</Text>
    </Description>
    </Source>
    <Source>
    <Actor>
    <ActorID>ID0E6E</ActorID>
    <ActorRole>
    <Text>Prescribing provider</Text>
    </ActorRole>
    </Actor>
    </Source>
    <CommentID>ID0EMG</CommentID>
    <Product>
    <ProductName>
    <Text>Tylenol</Text>
    <Code>
    <Value>1135802</Value>
    <CodingSystem>RxNorm Active Medicines</CodingSystem>
    <Version>09AB_091102F</Version>
    </Code>
    <Code>
    <Value>202433</Value>
    <CodingSystem>RxNorm Active Medicines Concepts</CodingSystem>
    <Version>09AB_091102F</Version>
    </Code>
    </ProductName>
    <Strength>
    <Value>100</Value>
    <Units>
    <Unit>Milligram (mg)</Unit>
    <Code>
    <Value>mg</Value>
    <CodingSystem>medication-strength-unit</CodingSystem>
    <Version>1</Version>
    </Code>
    </Units>
    </Strength>
    </Product>
    <Directions>
    <Direction>
    <Dose>
    <Value>1</Value>
    <Units>
    <Unit>Bars</Unit>
    <Code>
    <Value>Bars</Value>
    <CodingSystem>medication-dose-units</CodingSystem>
    <Version>1</Version>
    </Code>
    </Units>
    </Dose>
    <Route>
    <Text>By mouth</Text>
    <Code>
    <Value>po</Value>
    <CodingSystem>medication-routes</CodingSystem>
    <Version>2</Version>
    </Code>
    </Route>
    <Frequency>
    <Value>1 time</Value>
    </Frequency>
    <Indication>
    <Description>
    <Text>Headache</Text>
    </Description>
    <Source>
    <Description>
    <Text>Unknown</Text>
    </Description>
    </Source>
    </Indication>
    </Direction>
    </Directions>
    </Medication>
    </Medications>
    </Body>
    <Actors>
    <Actor>
    <ActorObjectID>PatientActor</ActorObjectID>
    <Person>
    <Name>
    <DisplayName>Unknown</DisplayName>
    </Name>
    </Person>
    <Source>
    <Description>
    <Text>Unknown</Text>
    </Description>
    </Source>
    </Actor>
    <Actor>
    <ActorObjectID>ID0RB</ActorObjectID>
    <InformationSystem>
    <Name>Microsoft HealthVault</Name>
    </InformationSystem>
    <Source>
    <Actor>
    <ActorID>PatientActor</ActorID>
    <ActorRole>
    <Text>Patient</Text>
    </ActorRole>
    </Actor>
    </Source>
    </Actor>
    <Actor>
    <ActorObjectID>ID0E6E</ActorObjectID>
    <Person>
    <Name>
    <CurrentName>
    <Given>Jack</Given>
    <Family>Sparo</Family>
    <Suffix>Senior</Suffix>
    <Title>Dr.</Title>
    </CurrentName>
    <DisplayName>Jack sparo</DisplayName>
    </Name>
    </Person>
    <Relation>
    <Text>Dispenser</Text>
    <Code>
    <Value>3</Value>
    <CodingSystem>person-types</CodingSystem>
    <Version>1</Version>
    </Code>
    </Relation>
    <Address>
    <Type>
    <Text>Business</Text>
    </Type>
    <Line1>9711 ln</Line1>
    <City>rockville</City>
    <County>montgomery</County>
    <State>md</State>
    <Country>United States</Country>
    <PostalCode>20850</PostalCode>
    </Address>
    <Telephone>
    <Value>122222222</Value>
    <Type>
    <Text>Business</Text>
    </Type>
    </Telephone>
    <EMail>
    <Value>some@test.com</Value>
    <Type>
    <Text>Business</Text>
    </Type>
    </EMail>
    <Source>
    <Actor>
    <ActorID>PatientActor</ActorID>
    <ActorRole>
    <Text>Patient</Text>
    </ActorRole>
    </Actor>
    </Source>
    </Actor>
    </Actors>
    <Comments>
    <Comment>
    <CommentObjectID>ID0EMG</CommentObjectID>
    <DateTime>
    <ExactDateTime>2011-11-22T18:11:28.4405278Z</ExactDateTime>
    </DateTime>
    <Description>
    <Text>Take one tablet</Text>
    </Description>
    <Source>
    <ActorID>ID0RB</ActorID>
    </Source>
    </Comment>
    </Comments>
    </ContinuityOfCareRecord>
    
    


     

     

    Tuesday, November 22, 2011 9:18 PM
  • Thanks.

    The response XML that you are looking at is the type-specific XML for the instance.

    When the full response came back, it looked something like this:

    <thing>
      <thing-id>...</thing-id>
      <thing-state>...</thing-state>
      <created>(audit data)</created>
      <updated>(audit data)</updated>
      <data-xml>
        <ContinuityOfCareRecord>
        ...
        </ContinuityOfCareRecord>
      </data-xml>
    </thing>

    The part of the library that you are using parses through the full response and only hands you back the part inside of the <data-xml> element. If you want to find the audit data, you'll have to get the request xml at a lower level, before that parsing is done.

    Hope that helps.

     

    Tuesday, November 22, 2011 11:12 PM
  • Thank you Eric. The main purpose of doing this is to know what is been updated or added to HV. My application fetches whole profile data initially and gets incremental data every time user logs in. When i get the incremental data using <updated-date-min>, i don't know whether it is a newly added entry or update to existing one. If i edit something on HV then i don't know which record should i update at my end; I found that the DataObjectID keeps changing. I initially thought that the DataObjectID is the unique id given to each record so when i get update i know which record to update with.

     

    Is there any other unique id assign to each record?

    Thank you

    Wednesday, November 23, 2011 3:02 PM
  • I'm not sure what you mean by "record".

    If you mean the user's record (collection of all their data), the record-id is the unique value for that.

    If you mean an individual instance of data, the thing-id is the unique value for that.

    I'm not sure what you mean by DataObjectId, but I haven't used the iOS variant of the library.

    Tuesday, November 29, 2011 5:28 PM
  • Let me put it this way- How do i update date for entry "Injury of knee" under condition. I have thing-id for condition but what is id for "Injury of knee"?

     

    Tuesday, November 29, 2011 7:29 PM
  • Here's what we recommend:

    1. When you fetch the item, save the thing id and version timestamp away with the data.
    2. When you want to do the update, fetch the current version that item using the thing-id.
    3. If the version timestamp is different, somebody else has updated the data. You should abandon the update and get the information (you can be more sophisticated here and do a comparison to see what's changed, but this collision is pretty rare and it's better to just abandon the update to that version.
    4. If the version timestamp is different, make your change, and save the item away.
    Wednesday, November 30, 2011 6:40 PM
  • Thank you Eric. I get the response xml back in CCR formt, where i don't see any  thing id and version timestamp. Below is the response xml

    <ContinuityOfCareRecord xmlns="urn:astm-org:CCR" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:ccr="urn:astm-org:CCR" xmlns:h="urn:com.microsoft.wc.thing" xmlns:v="urn:com.microsoft.wc.ccrVocab">
    <CCRDocumentObjectID>fcf0bd4fd8ce41548d401bff304327fe</CCRDocumentObjectID>
    <Language>
    <Text>English</Text>
    </Language>
    <Version>V1.0</Version>
    <DateTime>
    	<ExactDateTime>2011-11-22T18:11:28.4405278Z</ExactDateTime>
    </DateTime>
    <Patient>
    	<ActorID>PatientActor</ActorID>
    </Patient>
    <From>
     <ActorLink>
     <ActorID>ID0RB</ActorID>
     <ActorRole>
     <Text>Healthcare Information ystem</Text>
     </ActorRole>
     </ActorLink>
    </From>
    <Body>
     <Medications>
     <Medication>
     <CCRDataObjectID>adc1ca2a25b54324b9798b092d705810</CCRDataObjectID>
     <Source>
      <Description>
       <Text>Unknown</Text>
      </Description>
      </Source>
      <Product>
        <ProductName>
            <Text>Albumin Human, USP 50 MG/ML [Albutein]</Text>
            <Code>
              <Value>2960382</Value>
              <CodingSystem>RxNorm Active Medicines</CodingSystem>
              <Version>09AB_091102F</Version>
            </Code>
            <Code>
               <Value>566121</Value>
               <CodingSystem>RxNorm Active Medicines oncepts</CodingSystem>
               <Version>09AB_091102F</Version>
             </Code>
         </ProductName>
         <Strength>
          <Value>50</Value>
          <Units>
           <Unit>Milligram per milliliter (mg/ml)</Unit>
           <Code>
            <Value>mgperml</Value>
            <CodingSystem>medication-strength-unit</CodingSystem>
            <Version>1</Version>
           </Code>
          </Units>
         </Strength>
        </Product>
        <Directions>
         <Direction>
           <Dose>
             <Value>1</Value>
             <Units>
               <Unit>Bars</Unit>
               <Code>
                <Value>Bars</Value>
                <CodingSystem>medication-dose-units</CodingSystem>
                <Version>1</Version>
               </Code>
             </Units>
           </Dose>
           <Route>
            <Text>By mouth</Text>
            <Code>
             <Value>po</Value>
             <CodingSystem>medication-routes</CodingSystem>
             <Version>2</Version>
           </Code>
          </Route>
         </Direction>
        </Directions>
      </Medication>
    </Medications>
    

    How it can be done with CCR xml format.

    Thank you

    Monday, December 5, 2011 4:39 PM
  • Sorry if I wasn't clearer.

    You are not looking at the whole response; you are only looking at the type-specific part of the xml. You'll need to look a the code of the library and figure out how to get access to the whole response. When the whole response comes back, the library is pulling out the type-specific xml and passing it on to you.

    Monday, December 5, 2011 5:03 PM