在FHIR上为Smart写下重要的东西

时间:2017-01-04 17:45:25

标签: hl7-fhir

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

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

上找到的内容

阅读患者人口统计学的示例:

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

检索Vitals的示例:

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

PatientID = 1482713和LOINC代码:3141-9,8302-2,8287-5,39156-5(Vitals)

如何写 - 这肯定是可能的,如下所述:

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

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

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

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

感谢您的帮助!

2 个答案:

答案 0 :(得分:2)

要写,您需要使用:

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"}'

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

答案 1 :(得分:0)

这是基于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]"
                }
          }
        ]
}