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 A_CreateBreastRadiologyDocument()
        {
            Bundle b;
            {
                BreastRadiologyDocument doc = MakeDoc();
                Assert.IsTrue(doc.Index != null);
                {
                    BreastRadReport report = doc.Index.Report.Set(new BreastRadReport(doc));
                    Assert.IsTrue(report.Resource.Meta.Profile.Count() == 1);
                    Assert.IsTrue(report.Resource.Meta.Profile.First() == "http://hl7.org/fhir/us/breast-radiology/StructureDefinition/BreastRadReport");
                    Assert.IsTrue(report.Resource.Code.Coding[0].System == "http://loinc.org");
                    Assert.IsTrue(report.Resource.Code.Coding[0].Code == "10193-1");
                }
                b = doc.Write();
            }

            {
                BreastRadiologyDocument doc = BreastRadiologyDocument.Read(b);
                Assert.IsTrue(doc.Index != null);
                {
                    BreastRadReport report = doc.Index.Report.Set(new BreastRadReport(doc));
                    Assert.IsTrue(report != null);
                    Assert.IsTrue(report.Resource.Meta.Profile.Count() == 1);
                    Assert.IsTrue(report.Resource.Meta.Profile.First() == "http://hl7.org/fhir/us/breast-radiology/StructureDefinition/BreastRadReport");
                    Assert.IsTrue(report.Resource.Code.Coding[0].System == "http://loinc.org");
                    Assert.IsTrue(report.Resource.Code.Coding[0].Code == "10193-1");
                }
            }
        }
        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));
            }
        }
Esempio n. 5
0
        void SimpleNarrative()
        {
            const String prefix = "SimpleNarrativeOnlyReport";

            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       = "Simple Narrative Only 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);
                }
                b = doc.Write();
                String path = this.ExamplePath(prefix, b);
                b.SaveJson(path);

                this.SplitExampleBundle(b, prefix);
            }
        }
Esempio n. 6
0
        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);
            }
        }
        public void B_Composition_Sections()
        {
            GlobalSettings.IgnoreCardinalityErrors = true;
            Bundle b;
            {
                BreastRadiologyDocument doc = MakeDoc();
                {
                    BreastRadReport report = doc.Index.Report.Set(new BreastRadReport(doc));
                    Assert.IsTrue(doc.Index.FindingsLeftBreast.Get() == null);
                    Assert.IsTrue(doc.Index.FindingsRightBreast.Get() == null);
                    {
                        SectionFindingsLeftBreast findLeft = doc.Index.FindingsLeftBreast.Set(new SectionFindingsLeftBreast(doc));
                        Assert.IsTrue(doc.Index.FindingsLeftBreast.Get() != null);
                        Assert.IsTrue(doc.Index.FindingsLeftBreast.Get().Resource.Code.Coding[0].System == "http://hl7.org/fhir/us/breast-radiology/CodeSystem/ObservationCodes");
                        Assert.IsTrue(doc.Index.FindingsLeftBreast.Get().Resource.Code.Coding[0].Code == "findingsLeftBreastObservation");
                    }
                    {
                        SectionFindingsRightBreast findRight = doc.Index.FindingsRightBreast.Set(new SectionFindingsRightBreast(doc));
                        Assert.IsTrue(doc.Index.FindingsRightBreast.Get() != null);
                        Assert.IsTrue(doc.Index.FindingsRightBreast.Get().Resource.Code.Coding[0].System == "http://hl7.org/fhir/us/breast-radiology/CodeSystem/ObservationCodes");
                        Assert.IsTrue(doc.Index.FindingsRightBreast.Get().Resource.Code.Coding[0].Code == "findingsRightBreastObservation");
                    }
                    {
                        ServiceRecommendation rec = doc.Index.Recommendations.Append(new ServiceRecommendation(doc));
                        Assert.IsTrue(rec.Resource.Meta.Profile.Count() == 1);
                        Assert.IsTrue(rec.Resource.Meta.Profile.First() == "http://hl7.org/fhir/us/breast-radiology/StructureDefinition/ServiceRecommendation");
                        rec.SetCode(RecommendationsVS.Code_3DSpotCC);
                        Assert.IsTrue(rec.Resource.Code.Coding[0].System == RecommendationsVS.Code_3DSpotCC.Value.System);
                        Assert.IsTrue(rec.Resource.Code.Coding[0].Code == RecommendationsVS.Code_3DSpotCC.Value.Code);
                    }
                    {
                        ServiceRecommendation rec = doc.Index.Recommendations.Append(new ServiceRecommendation(doc));
                        Assert.IsTrue(rec.Resource.Meta.Profile.Count() == 1);
                        Assert.IsTrue(rec.Resource.Meta.Profile.First() == "http://hl7.org/fhir/us/breast-radiology/StructureDefinition/ServiceRecommendation");
                        rec.SetCode(RecommendationsVS.Code_3DSpotLM);
                        Assert.IsTrue(rec.Resource.Code.Coding[0].System == RecommendationsVS.Code_3DSpotLM.Value.System);
                        Assert.IsTrue(rec.Resource.Code.Coding[0].Code == RecommendationsVS.Code_3DSpotLM.Value.Code);
                    }
                }
                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(doc.Index.FindingsLeftBreast.Get() != null);
                    Assert.IsTrue(doc.Index.FindingsLeftBreast.Get().Resource.Code.Coding[0].System == "http://hl7.org/fhir/us/breast-radiology/CodeSystem/ObservationCodes");
                    Assert.IsTrue(doc.Index.FindingsLeftBreast.Get().Resource.Code.Coding[0].Code == "findingsLeftBreastObservation");
                }
                {
                    SectionFindingsRightBreast findRight = doc.Index.FindingsRightBreast.Get();
                    Assert.IsTrue(doc.Index.FindingsRightBreast.Get() != null);
                    Assert.IsTrue(doc.Index.FindingsRightBreast.Get().Resource.Code.Coding[0].System == "http://hl7.org/fhir/us/breast-radiology/CodeSystem/ObservationCodes");
                    Assert.IsTrue(doc.Index.FindingsRightBreast.Get().Resource.Code.Coding[0].Code == "findingsRightBreastObservation");
                }
                Assert.IsTrue(doc.Index.Recommendations.Count == 2);
                {
                    ServiceRecommendation rec = doc.Index.Recommendations.GetAt(0) as ServiceRecommendation;
                    Assert.IsTrue(rec != null);
                    Assert.IsTrue(rec.Resource.Meta.Profile.Count() == 1);
                    Assert.IsTrue(rec.Resource.Meta.Profile.First() == "http://hl7.org/fhir/us/breast-radiology/StructureDefinition/ServiceRecommendation");
                    Assert.IsTrue(rec.Resource.Code.Coding[0].System == RecommendationsVS.Code_3DSpotCC.Value.System);
                    Assert.IsTrue(rec.Resource.Code.Coding[0].Code == RecommendationsVS.Code_3DSpotCC.Value.Code);
                }
                {
                    ServiceRecommendation rec = doc.Index.Recommendations.GetAt(1) as ServiceRecommendation;
                    Assert.IsTrue(rec != null);
                    Assert.IsTrue(rec.Resource.Meta.Profile.Count() == 1);
                    Assert.IsTrue(rec.Resource.Meta.Profile.First() == "http://hl7.org/fhir/us/breast-radiology/StructureDefinition/ServiceRecommendation");
                    Assert.IsTrue(rec.Resource.Code.Coding[0].System == RecommendationsVS.Code_3DSpotLM.Value.System);
                    Assert.IsTrue(rec.Resource.Code.Coding[0].Code == RecommendationsVS.Code_3DSpotLM.Value.Code);
                }
            }
        }