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"); } }
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)); } }
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); } }
void Complex() { const String prefix = "ComplexReport"; this.DeleteExamples(prefix); Bundle b; { BreastRadiologyDocument doc = this.MakeDoc(); BreastRadComposition index = doc.Index; { index.Resource.DateElement = doc.Date; index.Resource.Status = CompositionStatus.Final; index.Resource.Title = "Complex Breast Radiology Report"; DiagnosticReport diagnosticReport = new DiagnosticReport { Id = "Report" }; BreastRadReport report = index.Report.Set(new BreastRadReport(doc, diagnosticReport)); DiagnosticReport r = report.Resource; r.Status = DiagnosticReport.DiagnosticReportStatus.Final; r.Category.Add(new CodeableConcept("http://terminology.hl7.org/CodeSystem/observation-category", "imaging")); r.Code = new CodeableConcept("http://loinc.org", "10193-1"); r.Conclusion = "Report Narrative conclusion."; report.SetConclusionCode(BiRadsAssessmentCategoriesVS.Code_Category2); } MFindingsLeftBreast findingLeft = index.FindingsLeftBreast; SectionFindingsLeftBreast flb = findingLeft.Set(new SectionFindingsLeftBreast()); flb.Resource.Value = BiRadsAssessmentCategoriesCS.Code_Category2; MGFinding mgFinding = flb.MGFinding.Set(new MGFinding()); mgFinding.AbnormalityCyst.Append(MakeCyst()); b = doc.Write(); String path = this.ExamplePath(prefix, b); b.SaveJson(path); this.SplitExampleBundle(b, prefix); } }