Ask a questionAsk a question
 

AnswerProblem Updating Immunization Record

  • Sunday, June 21, 2009 6:55 AMForhad Hossain Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    I am facing a problem during updating the Immunization Record.

    First I tried to get the immunization collection, than tried to update each record. Code block is as follows:

    List<HealthRecordItem> immunizationList = GetValues<HealthRecordItem>(new
     Guid("cd3587b5-b6e1-4565-ab3b-1c3ad45eb04f"
    )); // Immunization.TypeId 
    
    if (immunizationList != null && immunizationList.Count > 0)
    {
     foreach (HealthRecordItem hrItem in immunizationList)
     {
      try { PersonInfo.SelectedRecord.UpdateItem(hrItem); } catch (Exception ex)
      { System.Diagnostics.Trace.Write( ex.Message ); } } }
    I tried to get collection by the Immunization.TypeID ("3d817dbe-af42-4a9d-a553-d1298b4d08fc ") and "cd3587b5-b6e1-4565-ab3b-1c3ad45eb04f "

    But for updating I am getting the same error as follows:

    "The thing type specified in the update, '3d817dbe-af42-4a9d-a553-d1298b4d08fc', is an older version than the type of the existing instance"

    Please give a solution to recover from this error... :( :(

Answers

  • Wednesday, June 24, 2009 4:08 PMEric GunnersonMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    There are two versions of the Immunization type. Because newer versions of types typically have additional data associated with them, the platform does not allow you to update those types with the older version - this could lead to data loss.

    The types that come back are dependent not on the typeid you ask for, but on the type(s) that your application is authorized to access. My guess is that your app is only authorized to view the old immunization version, and therefore you can't do the update.

    You currently can't see which version is which in the application configuration center, but that will be fixed in the next couple of days with our new release, and this will make that easier.

    You also need to have an SDK that has the newest version in it.





All Replies

  • Wednesday, June 24, 2009 4:08 PMEric GunnersonMSFT, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    There are two versions of the Immunization type. Because newer versions of types typically have additional data associated with them, the platform does not allow you to update those types with the older version - this could lead to data loss.

    The types that come back are dependent not on the typeid you ask for, but on the type(s) that your application is authorized to access. My guess is that your app is only authorized to view the old immunization version, and therefore you can't do the update.

    You currently can't see which version is which in the application configuration center, but that will be fixed in the next couple of days with our new release, and this will make that easier.

    You also need to have an SDK that has the newest version in it.