我已经从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"
}
},发布于 2019-01-14 08:42:22
fullUrl生活在捆绑资源中,而不是免疫中。捆绑包有一个"entry“元素数组。然后,每个“条目”(对于事务请求)包含一个“资源”、一个“资源”和一个"fullUrl“元素。免疫的内容放在"resource“元素中。您可以在这里看到一个示例:http://build.fhir.org/bundle-transaction.json.html。(只需将免疫内容粘贴到患者内容所在的位置即可。)
https://stackoverflow.com/questions/54174266
复制相似问题