我已经从https://syntheticmass.mitre.org/download.html下载了一些 DSTU2 患者包。我正在尝试将数据上传到 FHIR 测试服务器。我的代码(使用 fhir-net-api)循环遍历多个文件并将它们编译为单个事务包。我在下面包含了构建事务包的代码段。
问题是免疫条目没有 fullUrl 元素。我以为我在循环中错过了一步,但根据https://www.hl7.org/fhir/immunization.html,免疫条目甚至不支持 fullUrl 元素。
如果我构建了一个仅包含一些人口统计详细信息的自定义患者,则该过程有效,因此我猜测我需要对免疫条目进行一些更改,但我找不到包含免疫数据的示例事务包。
public Bundle ParseTestData(List<string> list) //File data as string in list
{
var parser = new FhirJsonParser();
var parsedBundles = new List<Bundle>();
var transactionBundle = new Bundle()
{
Id = "test-data-bundle",
Type = Bundle.BundleType.Transaction
};
foreach (var str in list)
{
try
{
Bundle bundle = parser.Parse<Bundle>(str);
parsedBundles.Add(bundle);
}
catch (Exception e){/*cut for brevity*/}
}
foreach (var bundle in parsedBundles)
{
foreach (var entry in bundle.Entry)
{
entry.Request = new Bundle.RequestComponent
{
Method = Bundle.HTTPVerb.POST,
Url = "urn:uuid:" + Guid.NewGuid().ToString()
};
transactionBundle.Entry.Add(entry);
}
}
return transactionBundle;
}
我在这里的挣扎不是 c# 代码。我根本不知道如何正确地在包中构造这些数据。
这是源文件中的一些 JSON。
{
"fullUrl": "urn:uuid:05374078-2d51-4c7e-a562-273b030ba019",
"resource": {
"id": "05374078-2d51-4c7e-a562-273b030ba019",
"status": "finished",
"class": "outpatient",
"type": [
{
"coding": [
{
"system": "http://snomed.info/sct",
"code": "170258001"
}
],
"text": "Outpatient Encounter"
}
],
"patient": {
"reference": "urn:uuid:0d88250d-63c6-4ce5-aedb-91d64fa09838"
},
"period": {
"start": "2011-09-25T02:18:02-04:00",
"end": "2011-09-25T03:18:02-04:00"
},
"serviceProvider": {
"reference": "urn:uuid:a602f5c0-26a5-4288-b83d-39abc341757d"
},
"resourceType": "Encounter"
}
},
{
"resource": {
"status": "completed",
"date": "2011-09-25T02:18:02-04:00",
"vaccineCode": {
"coding": [
{
"system": "http://hl7.org/fhir/sid/cvx",
"code": "08",
"display": "Hep B, adolescent or pediatric"
}
],
"text": "Hep B, adolescent or pediatric"
},
"patient": {
"reference": "urn:uuid:0d88250d-63c6-4ce5-aedb-91d64fa09838"
},
"wasNotGiven": false,
"reported": false,
"encounter": {
"reference": "urn:uuid:05374078-2d51-4c7e-a562-273b030ba019"
},
"resourceType": "Immunization"
}
},