Ejemplo n.º 1
0
    private void GetParticipantData(Participant participant)
    {
        try
        {
            HVDataAccessor accessor = new HVDataAccessor(participant);
            AddAllFilters(accessor);

            string nullText = "No information available";
            lblPatientWeight.Text = accessor.GetItemString(Weight.TypeId, nullText);
            lblPatientHeight.Text = accessor.GetItemString(Height.TypeId, nullText);
            lblPatientGlucose.Text = accessor.GetItemString(BloodGlucose.TypeId, nullText);
            lblPatientPressure.Text = accessor.GetItemString(BloodPressure.TypeId, nullText);
            lblPatientCondition.Text = accessor.GetItemString(Condition.TypeId, nullText);
            lblPatientProcedure.Text = accessor.GetItemString(Procedure.TypeId, nullText);

            lstPatientMedication.DataSource = accessor.GetItemCollection(Medication.TypeId);
            lstPatientMedication.DataBind();

            lstPatientAllergy.DataSource = accessor.GetItemCollection(Allergy.TypeId);
            lstPatientAllergy.DataBind();

            lblPatientBasicInfo.Text = accessor.BuildBasicInfoString();
        }
        catch (HealthServiceException ex)
        {
            String msg = String.Empty;
            if (ex is HealthServiceAccessDeniedException)
                msg = "The application may be trying to read user data from an anonymous connection.\n";
            msg += ex.Error.ErrorInfo + "\n" + ex.Message.ToString();
            Debug.WriteLine(msg);
        }
    }