locked
GetItem RRS feed

  • Question

  • Can I get a specific item from a non-singleton Thing Type using the code below? (people_wc_id = item.Key.Id).

    Or, do I have to create a filter by Key.Id on a collection?

    No errors, just isn't updating the item.

    Person Person_push = (Person)PersonInfo.SelectedRecord.GetItem(new Guid(people_wc_id), HealthRecordItemSections.Xml);
    Person_push.Name.Full = people_first + " " + people_middle + people_last;
    Person_push.Organization = people_organization;
    Person_push.ProfessionalTraining = people_professional_training;
    Person_push.PersonType = new CodableValue(people_type, new CodedValue(people_type_code_value, people_type_code_type, people_type_code_family, people_type_code_version));
    PersonInfo.SelectedRecord.UpdateItem(Person_push);

    Thanks,
    Gary
    Saturday, October 17, 2009 2:24 AM

Answers

  • Ok, sorry it was unrelated issue in the case of BloodPressure. Seems to update fine. Thanks for the reply Raj. Gary
    Tuesday, October 20, 2009 5:45 PM

All replies

  • Are you sure you are not getting any exceptions while fetching the item?  (GetItem call)

    Do you see the same behaviour if you change it to following

    Person Person_push = (Person)PersonInfo.SelectedRecord.GetItem(new Guid(people_wc_id), HealthRecordItemSections.Default);
    Raj HealthVault Developer Tool http://xray.getrealconsulting.com
    Monday, October 19, 2009 9:57 AM
  • No, that doesn't seem to work.

    I tried with BloodPressure, also.

    I tested with a hard-coded Key.Id, and still didn't update the item.

    Would appreciate if anyone has ideas?

    BloodPressure BloodPressure_push = (BloodPressure)PersonInfo.SelectedRecord.GetItem(new Guid(blood_pressure_measurements_wc_id), HealthRecordItemSections.Default);
    BloodPressure_push.Diastolic = blood_pressure_measurements_diastolic;
    BloodPressure_push.Systolic = blood_pressure_measurements_diastolic;
    if (blood_pressure_measurements_irregular_heartbeat == "True")
    {
       BloodPressure_push.IrregularHeartbeatDetected = true;
    }
    else if (blood_pressure_measurements_irregular_heartbeat == "False")
    {
      BloodPressure_push.IrregularHeartbeatDetected = false;
    }
    else if (blood_pressure_measurements_irregular_heartbeat == null)
    {
      BloodPressure_push.IrregularHeartbeatDetected = null;
    }
    BloodPressure_push.Pulse = blood_pressure_measurements_pulse;
    BloodPressure_push.When = new HealthServiceDateTime(Convert.ToDateTime(blood_pressure_measurements_when_date));
    PersonInfo.SelectedRecord.UpdateItem(BloodPressure_push);
    Tuesday, October 20, 2009 5:12 PM
  • Ok, sorry it was unrelated issue in the case of BloodPressure. Seems to update fine. Thanks for the reply Raj. Gary
    Tuesday, October 20, 2009 5:45 PM