public void D_Observation_HasMemberTest() { GlobalSettings.IgnoreCardinalityErrors = true; Bundle b; { BreastRadiologyDocument doc = MakeDoc(); { BreastRadReport report = doc.Index.Report.Set(new BreastRadReport(doc)); SectionFindingsLeftBreast findLeft = doc.Index.FindingsLeftBreast.Set(new SectionFindingsLeftBreast(doc)); MGFinding mgFinding = findLeft.MGFinding.Set(new MGFinding(doc)); MGAbnormalityAsymmetry asymmetry = mgFinding.MGAbnormalityAsymmetry.Append(new MGAbnormalityAsymmetry(doc)); asymmetry = mgFinding.MGAbnormalityAsymmetry.Append(new MGAbnormalityAsymmetry(doc)); asymmetry = mgFinding.MGAbnormalityAsymmetry.Append(new MGAbnormalityAsymmetry(doc)); } b = doc.Write(); } { BreastRadiologyDocument doc = BreastRadiologyDocument.Read(b); BreastRadReport report = doc.Index.Report.Get(); Assert.IsTrue(report != null); SectionFindingsLeftBreast findLeft = doc.Index.FindingsLeftBreast.Get(); Assert.IsTrue(findLeft != null); MGFinding mgFinding = findLeft.MGFinding.Get(); Assert.IsTrue(mgFinding != null); MGAbnormalityAsymmetry[] asymmetry = mgFinding.MGAbnormalityAsymmetry.All().ToArray(); Assert.IsTrue(asymmetry.Length == 3); } }
public void C_Observation_ComponentTest() { GlobalSettings.IgnoreCardinalityErrors = true; Bundle b; { BreastRadiologyDocument doc = MakeDoc(); { BreastRadReport report = doc.Index.Report.Set(new BreastRadReport(doc)); SectionFindingsLeftBreast findLeft = doc.Index.FindingsLeftBreast.Set(new SectionFindingsLeftBreast(doc)); MGFinding mgFinding = findLeft.MGFinding.Set(new MGFinding(doc)); MGAbnormalityAsymmetry asymmetry = mgFinding.MGAbnormalityAsymmetry.Append(new MGAbnormalityAsymmetry(doc)); asymmetry.ObsChanges.Append(ObservedChangesVS.Code_DecreaseInCalcifications); asymmetry.ObsChanges.Append(ObservedChangesVS.Code_DecreaseInSize); } b = doc.Write(); } { BreastRadiologyDocument doc = BreastRadiologyDocument.Read(b); BreastRadReport report = doc.Index.Report.Get(); Assert.IsTrue(report != null); SectionFindingsLeftBreast findLeft = doc.Index.FindingsLeftBreast.Get(); Assert.IsTrue(findLeft != null); MGFinding mgFinding = findLeft.MGFinding.Get(); Assert.IsTrue(mgFinding != null); MGAbnormalityAsymmetry[] asymmetry = mgFinding.MGAbnormalityAsymmetry.All().ToArray(); Assert.IsTrue(asymmetry.Length == 1); Assert.IsTrue(asymmetry[0].ObsChanges.Count == 2); Assert.IsTrue(BLMisc.SameConcept(asymmetry[0].ObsChanges.GetAt(0), ObservedChangesVS.Code_DecreaseInCalcifications)); Assert.IsTrue(BLMisc.SameConcept(asymmetry[0].ObsChanges.GetAt(1), ObservedChangesVS.Code_DecreaseInSize)); } }