private void RenderSection(IComponent3Choice section) { // At some point in every CDA document we get to this... // We have a section that could one of any number of section types (in this case one of 28 sections(!)). // There is no "good" way to model this that would allow us to avoid having to query each section to see what it is. // Fortunately, MB can *usually* merge many similar sections into a single model class, so in many cases this code can be reused for some/all document types. if (section is AllergiesSectionentriesOptionalComponent3) { AllergiesSectionentriesOptionalComponent3 optionalAllergies = (AllergiesSectionentriesOptionalComponent3)section; Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Allergiessectionentriesoptional.Section allergies = optionalAllergies.Section; ProcessOptionalAlergies(allergies); } else if (section is AllergiesSectionentriesRequiredComponent3) { // no required allergies section for this sample CDA document AllergiesSectionentriesRequiredComponent3 optionalAllergies = (AllergiesSectionentriesRequiredComponent3)section; Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Allergiessectionentriesrequired.Section allergies = optionalAllergies.Section; ProcessRequiredAlergies(allergies); } else if (section is AssessmentAndPlanSectionComponent3) { // etc. } else if (section is AssessmentSectionComponent3) { } else if (section is ChiefComplaintAndReasonForVisitSectionComponent3) { } else if (section is ChiefComplaintSectionComponent3) { } else if (section is FamilyHistorySectionComponent3) { FamilyHistorySectionComponent3 familyHistory = (FamilyHistorySectionComponent3)section; Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Familyhistorysection.Section familyHistorySection = familyHistory.Section; ProcessFamilyHistory(familyHistorySection); } else if (section is GeneralStatusSectionComponent3) { } else if (section is HistoryOfPastIllnessSectionComponent3) { } else if (section is HistoryOfPresentIllnessSectionComponent3) { } else if (section is ImmunizationsSectionentriesOptionalComponent3) { } else if (section is ImmunizationsSectionentriesRequiredComponent3) { } else if (section is MedicationsSectionentriesOptionalComponent3) { } else if (section is MedicationsSectionentriesRequiredComponent3) { } else if (section is PhysicalExamSectionComponent3) { } else if (section is PlanOfCareSectionComponent3) { } else if (section is ProblemSectionentriesOptionalComponent3) { } else if (section is ProblemSectionentriesRequiredComponent3) { } else if (section is ProceduresSectionentriesOptionalComponent3) { } else if (section is ProceduresSectionentriesRequiredComponent3) { } else if (section is ReasonForReferralSectionComponent3) { } else if (section is ReasonForVisitSectionComponent3) { } else if (section is ResultsSectionentriesOptionalComponent3) { } else if (section is ResultsSectionentriesRequiredComponent3) { } else if (section is ReviewOfSystemsSectionComponent3) { } else if (section is SocialHistorySectionComponent3) { } else if (section is VitalSignsSectionentriesOptionalComponent3) { } else if (section is VitalSignsSectionentriesRequiredComponent3) { } else { if (section != null) { Console.WriteLine("Unexpected section type encountered: " + section.GetType()); } } }
private void ProcessRequiredAlergies(Ca.Infoway.Messagebuilder.Model.Ccda_r1_1.Allergiessectionentriesrequired.Section allergies) { // TODO fill in as appropriate }