none
Medications Entry RRS feed

  • Question

  • How do I create a page for medications entry?
    I have created an aspx page that contains the following data collection fields:
    Medication name, Strength (Number, Units, Notes), Dosage (Number, Units), How Often Taken (Number, Units), Reasons for taking, Date Started, Date Discontinued, Prescribed or OTC, Notes, Prescribed By, Date Prescribed, Amount Prescribed (Number, Units, Notes), Prescription Expiration Date, Instructions and Generic Name.

    On the aspx.cs I want to create the two methods: AddMedicationsEntry() and PopulateMedicationsTable().
    I created the respective String, Int32 or Datetime fields for each of the above fields in the AddMedicationsEntry method. What do I do next for AddMedicationsEntry()?

    Thanks.



    Deep
    Tuesday, February 17, 2009 6:04 PM

Answers

  • If you're asking how to create a Medication entry and add it to a record, you'll want to use the Medication ItemType:
        http://msdn.microsoft.com/en-us/library/dd124288.aspx

    The code to add it would look something like this:

    1     private void AddRandomMedication()  
    2     {  
    3         Medication med = new Medication();  
    4         med.DateStarted = new ApproximateDateTime(...);  
    5         med.Dose = ...;  
    6         med.Frequency = ...;  
    7         med.GenericName = ...;  
    8         // etc, etc, etc  
    9  
    10         PersonInfo.SelectedRecord.NewItem(med);  
    11     } 
    Tuesday, February 17, 2009 7:25 PM
    Moderator

All replies

  •  I'm not sure I entirely understand the question-- what problem are you running into, or what are you trying to do?

    If you're just trying to add new Medication entries to a HealthVault record, please take a look at the sample applications and the How-To guides on the MSDN HealthVault Development Center.  There are lots of great examples of how to both read and write items from HealthVault records in both of those places.
    Tuesday, February 17, 2009 7:14 PM
    Moderator
  • If you're asking how to create a Medication entry and add it to a record, you'll want to use the Medication ItemType:
        http://msdn.microsoft.com/en-us/library/dd124288.aspx

    The code to add it would look something like this:

    1     private void AddRandomMedication()  
    2     {  
    3         Medication med = new Medication();  
    4         med.DateStarted = new ApproximateDateTime(...);  
    5         med.Dose = ...;  
    6         med.Frequency = ...;  
    7         med.GenericName = ...;  
    8         // etc, etc, etc  
    9  
    10         PersonInfo.SelectedRecord.NewItem(med);  
    11     } 
    Tuesday, February 17, 2009 7:25 PM
    Moderator