How can I transform datatype from HealthRecordItemCollection to Height?

Unanswered How can I transform datatype from HealthRecordItemCollection to Height?

  • Wednesday, January 23, 2013 8:30 AM
     
     

    Dear Sir,

            I already get items from HealthRecordItemCollection, but I should get Height properties. How can I transform??

    Best Regards,                 Ariel Liu

All Replies

  • Wednesday, January 23, 2013 5:27 PM
     
      Has Code
    Hi,

    Can you modify the for loop this way:
    foreach Height ht in items)
    {
        // Get the value of ht.EffectiveDate;
        // Get the value of ht.EffectivePermissions.Value;
    }
    

  • Thursday, January 24, 2013 1:23 AM
     
     

    Dear Santhosh,

            Now, I change the way to like this, and it's work. But I think this is not the best solution.

    Any advice for me? Appreciated your help.

    Best Regards,                Ariel Liu

  • Thursday, January 24, 2013 1:39 AM
     
      Has Code

    Why are you using an intermediate list?

    HealthRecordItemCollection items = searcher.GetMatchingItems()[0];

    foreach Height ht in items) { DataRow row; row = dt.NewRow(); row["DateTime"] = ht.When.ToString(); row["Value"] = String.Format("{0:F2}", ht.Value.Meters); dt.Rows.Add(row); }