FHIR.NET API 中的 Matches() 和 Is Exactly() 有什么区别

Whats the difference between the Matches() and IsExactly() in FHIR.NET API

我正在使用此处的 Fhir.NET API:https://fire.ly/fhir-api/

我试图找出在两个 IDeepComparable 实例之间使用 Matches() 方法与在两个 IDeepComparable 实例之间使用 IsExactly() 之间的区别。

当左操作数与右模式操作数匹配时,

Matches() 将产生 true。例如,Coding 资源有几个属性,如 SystemCodeDisplay

当右操作数只有 SystemCode 的值时,它将匹配具有相同 SystemCode 值的左操作数以及 Display值。

下面的单元测试会更清楚:

        [TestMethod]
        public void CodeableConceptMatching()
        {
            var c1 = new Coding("http://example.com/system", "code1");
            var c2 = new Coding("http://example.com/system", "code1", "Display Text");

            Assert.IsTrue(c2.Matches(c1));
            Assert.IsFalse(c1.Matches(c2));
            Assert.IsFalse(c2.IsExactly(c1));
            Assert.IsFalse(c1.IsExactly(c2));
        }