locked
Family History Condition RRS feed

  • Question

  • Any reason why I get "Object reference not to an instance of an object"?

    It occurs on each property of RelativeCondition.

    I also tried ConditionEntry condition_entry = new ConditionEntry();
    ....
    familyhistorycondition_push.RelativeCondition.Add(condition_entry);


    FamilyHistoryCondition familyhistorycondition_push = new FamilyHistoryCondition();
                familyhistorycondition_push.RelativeCondition.Name = new CodableValue(family_history_conditions_name, new CodedValue(family_history_conditions_name_code_value, family_history_conditions_name_code_type, family_history_conditions_name_code_family, family_history_conditions_name_code_version));
                familyhistorycondition_push.RelativeCondition.Occurrence = new CodableValue(family_history_conditions_occurrence, new CodedValue(family_history_conditions_occurrence_value, family_history_conditions_occurrence_type, family_history_conditions_occurrence_family, family_history_conditions_occurrence_version));
                familyhistorycondition_push.RelativeCondition.OnsetDate = new ApproximateDate(Convert.ToInt32(family_history_conditions_onset_date.Year), Convert.ToInt32(family_history_conditions_onset_date.Month), Convert.ToInt32(family_history_conditions_onset_date.Day));
                familyhistorycondition_push.RelativeCondition.Resolution = family_history_conditions_resolution;
                familyhistorycondition_push.RelativeCondition.ResolutionDate = new ApproximateDate (Convert.ToInt32(family_history_conditions_resolution_date.Year),Convert.ToInt32(family_history_conditions_resolution_date.Month),Convert.ToInt32(family_history_conditions_resolution_date.Day));
                familyhistorycondition_push.RelativeCondition.Severity.Text = family_history_conditions_severity;
                PersonInfo.SelectedRecord.NewItem(familyhistorycondition_push);

    Thanks,
    Gary
    Thursday, October 22, 2009 3:21 PM

Answers

  • Family history condition is from an older version of the type - we recommend that you use the FamilyHistory type, which holds both the condition and the relative.

    To get your code to work you would need to modify it:

    FamilyHistoryCondition familyhistorycondition_push = new FamilyHistoryCondition();
    familyHistoryCondition_push.RelativeCondition = new ConditionEntry();
    ...

    Thursday, October 22, 2009 5:01 PM

All replies

  • Family history condition is from an older version of the type - we recommend that you use the FamilyHistory type, which holds both the condition and the relative.

    To get your code to work you would need to modify it:

    FamilyHistoryCondition familyhistorycondition_push = new FamilyHistoryCondition();
    familyHistoryCondition_push.RelativeCondition = new ConditionEntry();
    ...

    Thursday, October 22, 2009 5:01 PM
  • Thanks Eric.

    So I'll use FamilyHistory. I wasn't aware of the change. Or, at least I wasn't clear about it.

    Gary
    Thursday, October 22, 2009 6:24 PM