在单个资源中插入多个观察值-FHIR

时间:2020-04-28 15:41:05

标签: hl7-fhir fhir-server-for-azure

我每小时都有这样的患者心率信息

PID Hour HR
1   1    97
1   2    89
1   3    90
1   4    100
.....
.....
1   100  93

我每小时创建一个这样的json的数据

# For Hour 1
{
  "resourceType": "Observation",
  "id": "heart-rate",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/StructureDefinition/vitalsigns"
    ]
  },
  "status": "final",
  "category": [
    {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "vital-signs",
          "display": "Vital Signs"
        }
      ],
      "text": "Vital Signs"
    }
  ],
  "code": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "8867-4",
        "display": "Heart rate"
      }
    ],
    "text": "Heart rate"
  },
  "subject": {
    "reference": "Patient/example"
  },
  "effectiveDateTime": "2020-04-21T00:00:00+05:30",
  "valueQuantity": {
    "value": 97,
    "unit": "beats/minute",
    "system": "http://unitsofmeasure.org",
    "code": "/min"
  }
}

# Hour 2
{
  "resourceType": "Observation",
  "id": "heart-rate",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/StructureDefinition/vitalsigns"
    ]
  },
  "status": "final",
  "category": [
    {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/observation-category",
          "code": "vital-signs",
          "display": "Vital Signs"
        }
      ],
      "text": "Vital Signs"
    }
  ],
  "code": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "8867-4",
        "display": "Heart rate"
      }
    ],
    "text": "Heart rate"
  },
  "subject": {
    "reference": "Patient/example"
  },
  "effectiveDateTime": "2020-04-21T01:00:00+05:30",
  "valueQuantity": {
    "value": 89,
    "unit": "beats/minute",
    "system": "http://unitsofmeasure.org",
    "code": "/min"
  }
}

我创建了一个包含100个json嵌套在入口中的资源包,并且能够将其推送到fhir-server中。

{"resourceType": "Bundle", "type": "batch", "entry": [

上面给出的示例是针对一名患者和一种观察资源(心率)的。我有2万多名患者,拥有50种不同的观察资源类型。

不是创建100个不同的json条目,而是有一种方法可以使一个json代表100个值。如果有任何方法可以用时间戳映射值数组,则可以使用值数量。这样可以节省很多时间。

1 个答案:

答案 0 :(得分:1)

对于单个观察类型和单个主题,如果定期进行观察,则可以将SampledData数据类型用作Observation.value。通常,这是针对诸如EKG,胎儿心率监测器等频繁采样的事情,但是没有什么可以阻止您进行一个小时的采样。但是,如果您没有定期采样,则必须将每个采样捕获为不同的观察值。原因是我们需要能够提取数据,但是用户选择查询它。数据需要与以后可能需要出去的相同的细粒度组织一起输入。您可能会看到使用LD-JSON的批量数据API,该API可以更高效地处理大量数据。