猿问

FHIR:fhir 搜索 api 上的智能日期过滤器

我是 Smart on FHIR 的新手,并使用 fhirclient.js 创建了一个用于培训目的的演示应用程序。我需要在指定的日期(过去 3 个月)内获取患者的一些特定重要信息,例如温度、体重等。


smart.patient.api.search({

                    type: "Observation",            

                    query: {          

                      $sort: [

                          ["date",

                          "asc"]

                    ],

                    code: {

                      $or: ['http://loinc.org|8462-4',

                        'http://loinc.org|8480-6',

                        'http://loinc.org|55284-4',

                        'http://loinc.org|8310-5',

                        'http://loinc.org|3141-9',

                        'http://loinc.org|718-7']

                    }

                  }

                  }).then(results => {

让我知道如何在此搜索 api 中包含日期过滤器?


幕布斯7119047
浏览 163回答 1
1回答

慕码人8056858

这只是 .mongo 提供的类似 mongo 的语法糖fhir.js。它充当 URL 构建器,结果 FHIR URL 可能如下所示:https://r3.smarthealthit.org/Observation?_sort:asc=date&code=http://loinc.org|8462-4,http://loinc.org|8480-6,http://loinc.org| 55284-4,http://loinc.org|8310-5,http://loinc.org|3141-9,http://loinc.org|718-7最新版本fhirclient不fhir.js包含在内。如今,我们有类似的东西URLSearchParams可以帮助我们实现类似的结果。使用最新版本的fhirclient库,您正在寻找的代码可能如下所示:const client = new FHIR.client("https://r3.smarthealthit.org");const query = new URLSearchParams();query.set("_sort", "date");query.set("code", [  'http://loinc.org|8462-4',  'http://loinc.org|8480-6',  'http://loinc.org|55284-4',  'http://loinc.org|8310-5',  'http://loinc.org|3141-9',  'http://loinc.org|718-7'].join(","));query.set("date", "ge2013-03-14"); // after or equal to 2013-03-14query.set("date", "le2019-03-14"); // before or equal to 2019-03-14client.request("Observation?" + query).then(...)有关参数语法的详细信息,另请参阅http://hl7.org/fhir/search.html#datedate。
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答