none
New Medication Type problem RRS feed

  • Question

  • There are two Medication types with typeId = '5c5f1223-f63c-4464-870c-3e36ba471def' and typeId = '30cafccc-047d-4288-94ef-643571f7919d'.
    The new one supports form transformation while the old one doesn't.

    For the data that we enter for Medication object using Microsoft Health Explorer, we will not be able to get back those data using getThings either by the old typeId or the new typeId.

     

    For the data that we enter for the old Medication object in this page: http://developer.healthvault.com/types/types.aspx
    we can get the data using getThings using the old typeId.

    I have tried to use the above link to enter some data for the new Medication object, and I saw the error page.

    Here is the url:

    http://developer.healthvault.com/view/tgrid.aspx?types=30cafccc-047d-4288-94ef-643571f7919d

    and here is the error:

    Server Error in '/' Application.

    Runtime Error
    Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

     

    Thanks

     

    Elaine

    Friday, September 5, 2008 6:42 PM

Answers

  • Elaine,

     

    I verified the behavior you are seeing. The form transform for the old medication type will show up in a future release (probably the next one, though I'm not positive). The problem on developer.healthvault.com will take a bit more investigation.

     

    You should be able to do any of the operations that the developer site does through the SDK. If you can post a bit more detail, I'd be happy to provide some guidance there.

     

    You might also find Get Real's XRay viewer to be useful.

     

    Friday, September 12, 2008 5:33 PM
  • hi Elain -

    Eric beat me to this..Smile.

    I tried the following:
    a. Added a medication item using HealthVault shell:
    https://account.healthvault-ppe.com/viewitems.aspx?typeid=30cafccc-047d-4288-94ef-643571f7919d&action=add

    b, I was able to view the information i added at:
    http://developer.healthvault.com/view/tgrid.aspx?types=5c5f1223-f63c-4464-870c-3e36ba471def

    c. However,
    http://developer.healthvault.com/view/tgrid.aspx?types=30cafccc-047d-4288-94ef-643571f7919d  crashes.
    We have a bug assigned for this problem and it will be fixed.

    As Eric mentioned, you can also try GetReals XRay tool: http://xray.getrealconsulting.com/

    We are curious about you not being able to fetch the Medication data which you put via HealthVault shell with GetThings. You should be able to get that information the step (b) above uses GetThings so the type data did make in and out. As Eric pointed, can you post the relevant code you are using?

    Hope this helps.

    regards,
    Vaibhav
    Friday, September 12, 2008 5:47 PM
  • This is expected behavior in some situations. It depends on how your application authorization is defined.

     

    If you only have access to one type (say, for the sake of argument, the new one), when you make a query the system will do an upconversion or downconversion to give you only that type. So, if there were instances of the old type, they would look like new types to you.

     

    If your app is authorized to both versions of the type, the system assumes that you care about the difference between the types, and will return the types in whatever versions they are stored in.

     

    We currently don't provide a way for you to get more control of this behavior, though we're considering it for the future.

     

    If you only want to deal with the new medication type (and that's probably easier than dealing with both), you can modify your app auth so it doesn't have access to the old type, and things should work for you then.

    Friday, September 12, 2008 8:30 PM

All replies

  • hi Elain -

    Thank a lot for bring up the issues. If i'm correct their following problems:

    1. Their is no form transform for old Medication type
    2. You are not seeing the data you enter from Microsoft Health Explorer in neither old not new data type.
    3. Type browser does not accept your medication data.

    Can you please elaborate

    On 2: Can you send a link to the Microsoft Health Explore you are using? If this is from CUI then i dont think its a HealthVault application.
    On 3: What is the data you are trying to put in type browser. It only accepts valid XML.

    Hope this helps.

    regards,
    Vaibhav

    Friday, September 5, 2008 8:07 PM
  • hi,

     

    for #2: here is the url:

     

    https://account.healthvault-ppe.com/viewitems.aspx?typeid=30cafccc-047d-4288-94ef-643571f7919d&action=add

     

    for #3:

    Yeah, I understand that it only accepts the valid xml. However, the error is even before I can see the page and Add Thing. for the new Medication object with type id = '30cafccc-047d-4288-94ef-643571f7919d', if you click the View things link, then you will see the error that I sent in the last message.

     

    Thanks

     

    Elaine 

     

    Friday, September 5, 2008 8:20 PM
  • Steps to reproduce #3:

     

    1) go to this link: http://developer.healthvault.com/types/types.aspx

     

    2) Look for the Medication with typeId = '30cafccc-047d-4288-94ef-643571f7919d', click the View Things link, then we will see the error. We are supposed to be able to view a list of existing things for that type and also be able to add Medication object in valid xml.

    Friday, September 5, 2008 8:26 PM
  •  

    Any new updates on this?

     

    Thanks

     

    Elaine

    Monday, September 8, 2008 5:31 PM
  • Elaine,

     

    I verified the behavior you are seeing. The form transform for the old medication type will show up in a future release (probably the next one, though I'm not positive). The problem on developer.healthvault.com will take a bit more investigation.

     

    You should be able to do any of the operations that the developer site does through the SDK. If you can post a bit more detail, I'd be happy to provide some guidance there.

     

    You might also find Get Real's XRay viewer to be useful.

     

    Friday, September 12, 2008 5:33 PM
  • hi Elain -

    Eric beat me to this..Smile.

    I tried the following:
    a. Added a medication item using HealthVault shell:
    https://account.healthvault-ppe.com/viewitems.aspx?typeid=30cafccc-047d-4288-94ef-643571f7919d&action=add

    b, I was able to view the information i added at:
    http://developer.healthvault.com/view/tgrid.aspx?types=5c5f1223-f63c-4464-870c-3e36ba471def

    c. However,
    http://developer.healthvault.com/view/tgrid.aspx?types=30cafccc-047d-4288-94ef-643571f7919d  crashes.
    We have a bug assigned for this problem and it will be fixed.

    As Eric mentioned, you can also try GetReals XRay tool: http://xray.getrealconsulting.com/

    We are curious about you not being able to fetch the Medication data which you put via HealthVault shell with GetThings. You should be able to get that information the step (b) above uses GetThings so the type data did make in and out. As Eric pointed, can you post the relevant code you are using?

    Hope this helps.

    regards,
    Vaibhav
    Friday, September 12, 2008 5:47 PM
  • Eric:

     

    Since the old Medication type will be eventually replaced by the new Medication type, we decide to use the new Medication type.

    Currently, we are using the XML api to pull HealthVault data and display them in our application. We use getThings to get a list of items, and use getThingType to get the form transformed template, and then do the transformation.

    For new Medication type, we can get back the form transformed template by using getThingType, but can't get back any items by using getThings.

    I posted the Medication items through developer.healthvault.com, none of those medication items show up in the getThings response using the new Medication type id.
    (Note: if you post old typed Medication items through type browser: http://developer.healthvault.com/types/types.aspx, those items will show up in the Medication object in developer.healthvault.com too. In other words, there is only one Medication object in this developer.healthvault.com, both old typed Medicaiton items and the Medication items that you post through the add will show up into the same place)

     

    For the View things link in the type browser for the New Medication type:
    When can you guys fix that error?


    Thanks

     

    Elaine

    Friday, September 12, 2008 6:04 PM
  •  

    Hi, Vaibhav

    I was aware of what you exactly showed in the message.

    If we add a medication item through this, https://account.healthvault-ppe.com/viewitems.aspx?typeid=30cafccc-047d-4288-94ef-643571f7919d&action=add, it should be the new Medication typed item, then it should not show up in the View Thing link in the old Medication typed object: http://developer.healthvault.com/view/tgrid.aspx?types=5c5f1223-f63c-4464-870c-3e36ba471def,
    it should be under the crashed link: http://developer.healthvault.com/view/tgrid.aspx?types=30cafccc-047d-4288-94ef-643571f7919d

     

    I can fetch the old Medication items back using getThings by old type id if I import the old typed Medication items through this type browser link:
    http://developer.healthvault.com/view/tgrid.aspx?types=5c5f1223-f63c-4464-870c-3e36ba471def

     

    If I enter Medication item through https://account.healthvault-ppe.com/viewitems.aspx?typeid=30cafccc-047d-4288-94ef-643571f7919d&action=add, we can not get back any data either using getThings by the old type id or the new type id

    Friday, September 12, 2008 6:19 PM
  • Thanks for the addtioinal information.

     

    I agree with your decision to use the new medication type.

     

    If you aren't getting any items back when you are calling getThings, my *guess* is that there is a problem on your side. If you'd like me to run my test code against your account (and you're willing to give me temporary access to it), you can email it to me at ericgu@microsoft.com. Or, alternatively, you could create an empty account and send it to me and I'll run my code to populate it.

     

    I don't have an ETA for a fix on the developer site yet. If you're just looking to view and enter Medication types, the newly-released PB8 version of the shell (https://account.healthvault-ppe.com) will let you do that.

     

    Friday, September 12, 2008 6:25 PM
  • Eric:

     

    I have sent you my HealthVault account info, can you run your codes to populate some new typed Medication data for me so that I can test it?

    I have tried to populate data through this the newly-released PB8 version of the shell (https://account.healthvault-ppe.com),

     Those Medication items wouldn’t show up in the getThings either by old and new type id.

     

    Thanks

     

    Elaine

     

    Friday, September 12, 2008 6:32 PM
  • By the way:

     

    Here is our codes:

     

     public String displayHealthVaultObject(final String personId, final String recordId,
       final ThingType type) throws HealthVaultException {
      List<Thing> things = getThingsByType(personId, recordId, type);
      String xslStr = getThingTypeXsl(type);
      StringBuffer html = new StringBuffer();
      for (Thing thing : things) {
       thing.createHtml(xslStr);
       html.append(thing.getHtml());
      }
      return html.toString();
     }


     public List<Thing> getThingsByType(final String personId,
       final String recordId, final ThingType type)
       throws HealthVaultException {
      List<Thing> things = getThingsByTypeMap(personId, recordId, makeTypeList(type)).get(type);
      return things != null ? things : new ArrayList<Thing>(0);
     }


     public Map<ThingType, List<Thing>> getThingsByTypeMap(final String personId,
       final String recordId, final List<ThingType> types)
       throws HealthVaultException {
      GetThingsRequest request = new GetThingsRequest();

      for (ThingType type : types) {
       final ThingsRequestGroup group = new ThingsRequestGroup();
       request.addGroup(group);
       group.addFilterType(type);
       group.setSection(ThingsSection.CORE);
      }
      request.getHeader().setPersonId(personId);
      request.getHeader().setRecordId(recordId);

      GetThingsResponse response = (GetThingsResponse)sendOfflineRequest(request);
      return response.getThingsByTypeMap();
     }

     

    I have tested Allergy, Condition, Procedure, and Immunization object types. They all worked fine.

    Even the old Medication object type worked fine, I could back a list of items, but just no form transformed template.

    However, for the new Medicaiton type id, I got no items back with getThings, but could get back the form transformed template.

     

     

     

    Friday, September 12, 2008 6:38 PM
  • Eric:

     

    I think I finally figured out why:

     

    We have been using jibx binding to bind the xml to the object. Now I just debugged that and looked through the response more carefully and found out:

     

    There are data in the response, but not the right type id.

    I posted the Medication item in the https://account.healthvault-ppe.com/viewitems.aspx?typeid=30cafccc-047d-4288-94ef-643571f7919d, it looks like it is with the new type id,

     

    so I sent a request with a new type id 30cafccc-047d-4288-94ef-643571f7919d, in the response, it seems the typeId = 5C5F1223-F63C-4464-870C-3E36BA471DEF in the response instead of the new id.

     

    We have been using jibx binding in the response and only pull the list of with the type id that we send in the request. That is reason why we are not seeing any items if we send a request with the new type id = 30cafccc-047d-4288-94ef-643571f7919d.

     

    Is that a bug in the response?

     

    Thanks

     

    Elaine

     

    The following is the data in the response.

     

    <response><status><code>0</code></status><wc:info xmlns:wc="urn:com.microsoft.wc.methods.response.GetThings">
    <group>
    <thing><thing-id version-stamp="98f7f4e3-ce5e-4f66-bb7f-2efa0a23ff62">4736c0d6-75bf-4ecb-9a21-443de97472b9</thing-id>
    <type-id name="Medication">5C5F1223-F63C-4464-870C-3E36BA471DEF</type-id>
    <thing-state>Active</thing-state><flags>2</flags><eff-date>2008-09-10T08:05:41.981</eff-date><updated><timestamp>2008-09-10T15:05:42.05Z</timestamp><app-id name="Microsoft Health Explorer">9ca84d74-1473-471d-940f-2699cb7198df</app-id><person-id name="Elaine Mei">08a8b959-4f11-4cf3-bc3f-81cd9f989d90</person-id><access-avenue>Online</access-avenue><audit-action>Created</audit-action></updated><data-xml><medication><name>My Test</name><date-discontinued><structured><date><y>2008</y><m>9</m><d>12</d></date></structured></date-discontinued><indication>Reason test</indication><strength-value>1</strength-value><strength-unit><text>bottle</text><code><value>BO</value><family>x12-de</family><type>x12-de-355-filtered</type><version>1.0</version></code></strength-unit><frequency>1 day</frequency><route><text>both eyes</text><code><value>ou</value><family>wc</family><type>medication-routes</type><version>1</version></code></route></medication><common><note>Note test</note></common></data-xml></thing>

    <thing><thing-id version-stamp="7d323d1b-8608-497e-8abd-25c131fc505d">079beb5d-76bc-468e-b270-829752c85838</thing-id><type-id name="Medication">5C5F1223-F63C-4464-870C-3E36BA471DEF</type-id><thing-state>Active</thing-state><flags>2</flags><eff-date>2008-09-09T07:04:17.45</eff-date><updated><timestamp>2008-09-09T14:04:17.503Z</timestamp><app-id name="Microsoft Health Explorer">9ca84d74-1473-471d-940f-2699cb7198df</app-id><person-id name="Elaine Mei">08a8b959-4f11-4cf3-bc3f-81cd9f989d90</person-id><access-avenue>Online</access-avenue><audit-action>Created</audit-action></updated><data-xml><medication><name>New Medication name test</name><date-discontinued><structured><date><y>2008</y><m>9</m><d>11</d></date></structured></date-discontinued><indication>Reason test</indication><strength-value>1</strength-value><strength-unit><text>box</text><code><value>BX</value><family>x12-de</family><type>x12-de-355-filtered</type><version>1.0</version></code></strength-unit><frequency>2 a day</frequency><route><text>oral and injectable</text><code><value>poinj</value><family>wc</family><type>medication-routes</type><version>1</version></code></route></medication><common><note>Note test</note></common></data-xml></thing>

    <thing><thing-id version-stamp="58a387e5-142b-4c79-bb17-5832e9f71f33">2767f2b7-3a63-407a-a69b-51ff64c8819a</thing-id><type-id name="Medication">5C5F1223-F63C-4464-870C-3E36BA471DEF</type-id><thing-state>Active</thing-state><flags>2</flags><eff-date>2008-09-05T06:47:07.756</eff-date><updated><timestamp>2008-09-05T13:47:08.04Z</timestamp><app-id name="Microsoft Health Explorer">9ca84d74-1473-471d-940f-2699cb7198df</app-id><person-id name="Elaine Mei">08a8b959-4f11-4cf3-bc3f-81cd9f989d90</person-id><access-avenue>Online</access-avenue><audit-action>Created</audit-action></updated><data-xml><medication><name>Medication Name</name><date-discontinued><structured><date><y>2008</y><m>9</m><d>1</d></date></structured></date-discontinued><indication>Reason for taking text</indication><dose-value><description>dosage text</description><exact-dose>1</exact-dose></dose-value><dose-unit><text>bottle</text><code><value>BO</value><family>x12-de</family><type>x12-de-355-filtered</type><version>1.0</version></code></dose-unit><strength-value>1</strength-value><strength-unit><text>box</text><code><value>BX</value><family>x12-de</family><type>x12-de-355-filtered</type><version>1.0</version></code></strength-unit><frequency>often text</frequency><route><text>oral and injectable</text><code><value>poinj</value><family>wc</family><type>medication-routes</type><version>1</version></code></route></medication><common><note>Note text</note></common></data-xml></thing>

    </group></wc:info></response>

     

    Friday, September 12, 2008 7:27 PM
  • To be more clear about what I have found:

     

    If the items get posted using https://account.healthvault-ppe.com/viewitems.aspx?typeid=30cafccc-047d-4288-94ef-643571f7919d, the items will be added with the new type id.

     

    However, when we send the request using getThings by the new type id, we will get back those items that we posted with the new type ids, but with the old type id value in the response.

     

    Is that a bug?

     

    If you have any questions, please let me know.

     

    Thanks

     

    Elaine

    Friday, September 12, 2008 7:38 PM
  • This is expected behavior in some situations. It depends on how your application authorization is defined.

     

    If you only have access to one type (say, for the sake of argument, the new one), when you make a query the system will do an upconversion or downconversion to give you only that type. So, if there were instances of the old type, they would look like new types to you.

     

    If your app is authorized to both versions of the type, the system assumes that you care about the difference between the types, and will return the types in whatever versions they are stored in.

     

    We currently don't provide a way for you to get more control of this behavior, though we're considering it for the future.

     

    If you only want to deal with the new medication type (and that's probably easier than dealing with both), you can modify your app auth so it doesn't have access to the old type, and things should work for you then.

    Friday, September 12, 2008 8:30 PM
  • Eric:

     

    In the authorization page, there is only one Medicaiton object that we can choose. I do not not see two Medication types. Since you have access to my account, can you update to change that to have access to only the new type?

     

    Also, this does not really make a lot of sense to me. The old one and the new one have different schemas. If we post the item with new type id and send a getThings request with new type id, and we will get back a list of items with a different type id, but still have the right schema version..

    Friday, September 12, 2008 8:44 PM
  •  

    Eric:

      I have talked to my team here. We have configured that in app to allow the user to have access to both types. In this case, if we sent the request with the new type id, we will only get back the items with the new type id. (Before this, we only grant access to the old Medication type).

    That solves the problem.

     

    Thank you very much

     

    Elaine

    Friday, September 12, 2008 9:16 PM