Write Vital on Smart on FHIR

Write Vital on Smart on FHIR

我正在寻找 curl 请求示例以在 FHIR (hir-open-api-dstu2.smarthealthit.org) 数据库上编写 Vitals on Smart。

这是我在 http://docs.smarthealthit.org/tutorials/server-quick-start/

上找到的内容

读取患者人口统计数据的示例:

curl 'https://fhir-open-api-dstu2.smarthealthit.org/Patient/1482713' -H 'Accept: application/json'

检索生命体征的示例:

curl 'https://fhir-open-api-dstu2.smarthealthit.org/Observation?subject%3APatient=1482713&code=3141-9%2C8302-2%2C8287-5%2C39156-5&_count=50' -H 'Accept: application/json'

患者 ID=1482713 和 LOINC 代码:3141-9、8302-2、8287-5、39156-5(生命体征)

如何写 - 这当然是可能的,如下所述:

https://fhirblog.com/2015/03/06/smart-writing/

https://fhirblog.com/2016/03/23/smart-scopes-and-profiles/

写 vitals 的 curl 请求看起来像这样(一个不起作用的例子):

curl 'https://fhir-open-api-dstu2.smarthealthit.org/Observation.write?subject%3APatient=1482713&code=3141-9=10&_count=50' -H 'Accept: application/json'

感谢您的帮助!

要写作,您需要使用:

curl \
  -X POST \
  https://fhir-open-api-dstu2.smarthealthit.org/Observation \
  -H 'Content-type: application/json+fhir' \
  -H 'Accept: application/json+fhir' \
  --data '{"resourceType": "Observation"}'

当然,您应该在数据负载中提供更多关于您的观察的详细信息:-)

这是基于 Josh M 的回复:

 curl   -X POST  \
  https://fhir-open-api-dstu2.smarthealthit.org/Observation \
  -H 'Content-type: application/json+fhir'  \
  -H 'Accept: application/json+fhir' \
  --data @payload.json 

一个更明确的负载文件,包含生效日期、血压及其两个组成部分: --payload.json 文件 ---

 {
  "resourceType": "Observation",
  "status": "final",
  "subject": {
    "reference": "Patient/1951076"
  },
  "category": {
    "coding": [
      {
        "system": "http://hl7.org/fhir/observation-category",
        "code": "vital-signs",
        "display": "Vital Signs"
      }
    ],
    "text": "Vital Signs"
  },
  "code": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "55284-4",
        "display": "SBlood pressure systolic and diastolic"
      }
    ],
    "text": "Blood pressure systolic and diastolic"
  },
        "encounter": {
          "reference": "Encounter/787"
        },
        "effectiveDateTime": "2016-08-17",
        "component": [
          {
                "code": {
                  "coding": [
                        {
                          "system": "http://loinc.org",
                          "code": "8480-6",
                          "display": "Systolic blood pressure"
                        }
                  ],
                  "text": "Systolic blood pressure"
                },
                "valueQuantity": {
                  "value": 125,
                  "unit": "mmHg",
                  "system": "http://unitsofmeasure.org",
                  "code": "mm[Hg]"
                }
          },
          {
                "code": {
                  "coding": [
                        {
                          "system": "http://loinc.org",
                          "code": "8462-4",
                          "display": "Diastolic blood pressure"
                        }
                  ],
                  "text": "Diastolic blood pressure"
                },
                "valueQuantity": {
                  "value": 75,
                  "unit": "mmHg",
                  "system": "http://unitsofmeasure.org",
                  "code": "mm[Hg]"
                }
          }
        ]
}