public void F_Observation_BodySite() { GlobalSettings.IgnoreCardinalityErrors = true; CodeableConcept bodySiteCode = new CodeableConcept("bsSys", "bsCode", "bsDisplay"); 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)); AbnormalityCyst abCyst = mgFinding.AbnormalityCyst.Append(new AbnormalityCyst(doc)); var bodySite = abCyst.BodySite.Set(new CodeableConcept("bsSystem", "bsCode")); 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); AbnormalityCyst[] abCyst = mgFinding.AbnormalityCyst.All().ToArray(); Assert.IsTrue(abCyst.Length == 1); CodeableConcept bodySite = abCyst[0].BodySite.Get(); Assert.IsTrue(bodySite.Coding.Count == 1); Assert.IsTrue(bodySite.Coding[0].System == "bsSystem"); Assert.IsTrue(bodySite.Coding[0].Code == "bsCode"); } }
AbnormalityCyst MakeCyst() { AbnormalityCyst c = new AbnormalityCyst(); return(c); }