none
What is the difference between and Medication and and Medication(V1) in Application configuration? RRS feed

  • Question

  • Hi,

    I enabled Medication and Medication(V1) for Medications, Immunization and
    Immunization (V1) for Immunizations ,   Procedure and Procedure(V1) in application permissions.

    If I tried to crate any
    of Medication(V1) or Immunization (V1) or  Procedure(V1) item in "https://xray.getrealconsulting.com/PPE" environment. But when  I click on Create button I got the following error message
    "An error occurred while processing your request
    The error has been logged. If you continue to experience this error, please contact technical support.
    Error Message:Object reference not set to an instance of an object. "


    But the record was added to My HealthVault Account and if tried to Import that record "Unable to cast object" exception is coming.

    Is there any difference between Medication and Medication(V1)?
    I am thinking that because we are creating Medication(V1)   type item we are getting this exception. But if I created Medication  type it is working fine.

    What Exactly causes this exception?

    Thanks and Regards
    ChellamNaidu


    Tuesday, October 27, 2009 1:28 PM

Answers

  • Hi

    Thanks for your support. My issue is resolved.  I unchecked the MedicationV1,ImmunizationV1 and ConditionV1 check boxes in the Application configuration.It works for me.

    Thank you,
    Chellamnaidu
    • Marked as answer by chellamnaidu Wednesday, October 28, 2009 5:54 AM
    Wednesday, October 28, 2009 5:54 AM

All replies

  • I just fixed the error you saw on Xray.  Thanks for pointing it out.

    Regarding the difference b/w Medication and MedicationV1,   MedicationV1 was the first data type introduced in HealthVault.  Medication is an improved data type of the same version.  Read about Versioning here

    If you are working on a new application it is recommended that you use Medication as against MedicationV1.

    Btw, the fix for you make MedicationV1 work (which is the same fix I just did on Xray) is to add the following lines of code to Global.asax.  Note that the earlier fix I had recommended contained only one line of code - After the recent code refactoring of SDK, the additional call is required.


     protected void Application_Start(object sender, EventArgs e)
      {
                Microsoft.Health.ItemTypes.ItemTypeRegistrar.RegisterAssemblyHealthRecordItemTypes();
                Microsoft.Health.ItemTypes.ItemTypeRegistrar.Old.RegisterAssemblyHealthRecordItemTypes();

      }



    Let me know if this worked

    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, October 27, 2009 1:52 PM
  • Hi Rajesh,

          Thanks for your Quick reply.
    I am getting a Compilation error if I added Microsoft.Health.ItemTypes.ItemTypeRegistrar.Old.RegisterAssemblyHealthRecordItemTypes();

    in global.asax
    Error is Microsoft.Health.ItemTypes.ItemTypeRegistrar' does not contain a definition for 'Old'



    Thank you
    Chellamnaidu
    Tuesday, October 27, 2009 2:50 PM
  • My bad for the mixup.. I directly typed in the code..

    Here is the right code


    protected void Application_Start(object sender, EventArgs e)
      {
                Microsoft.Health.ItemTypes.ItemTypeRegistrar.RegisterAssemblyHealthRecordItemTypes();
               
    Microsoft.Health.ItemTypes.Old.ItemTypeRegistrar.RegisterAssemblyHealthRecordItemTypes();

      }


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, October 27, 2009 3:16 PM
  • Hi,
    Still I am getting the error

    Message:  "The type or namespace name 'Old' does not exist in the namespace 'Microsoft.Health.ItemTypes' "


    Thank you
    Chellamnaidu
    Tuesday, October 27, 2009 3:39 PM
  • I think you might not have added the assembly reference Microsoft.Health.ItemTypes.Old.dll to the solution.
    The using directive looks like below,
    using Microsoft.Health.ItemTypes.Old;

    Hope this helps,
    Aneesh D.
    Tuesday, October 27, 2009 3:53 PM
    Moderator
  • I directly cut pasted the working code now... (I dont believe in my typing skills anymore)


    protected

     

    void Application_Start(object sender, EventArgs e)

    {

    Microsoft.Health.ItemTypes.

    ItemTypeRegistrar.RegisterAssemblyHealthRecordItemTypes();

    Microsoft.Health.ItemTypes.Old.

    ItemTypeOldRegistrar.RegisterAssemblyHealthRecordItemTypes();

    }


    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Tuesday, October 27, 2009 4:04 PM
  • Hi Aneesh,

    i build the aplication in HealthVault SDK and added the Microsoft.Health.ItemTypes.Old.dll.
    Build is succeded but when I run the application I got the error message

    "Could not load file or assembly 'Microsoft.Health, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"

    Where can i get the correct dll?

    Thank you
    chellamnaidu

    Tuesday, October 27, 2009 4:24 PM
  • Hi,

    Now i am able to run the application but still i am getting the error

    "Unable to cast object of type 'Microsoft.Health.HealthRecordItem' to type 'Microsoft.Health.ItemTypes.Immunization'."

    here while converting to Immunization do we need to use " Immunization" class or " Immunization(V1)"
     

    Type id I am passing is "cd3587b5-b6e1-4565-ab3b-1c3ad45eb04f"

    Thank you
    chellamnaidu
    Tuesday, October 27, 2009 4:54 PM
  • Hi

    Thanks for your support. My issue is resolved.  I unchecked the MedicationV1,ImmunizationV1 and ConditionV1 check boxes in the Application configuration.It works for me.

    Thank you,
    Chellamnaidu
    • Marked as answer by chellamnaidu Wednesday, October 28, 2009 5:54 AM
    Wednesday, October 28, 2009 5:54 AM