如何解决Asymmetrik FHIR mongo:存储部分患者
我正在运行 node-fhir-server-mongo
。
我正在尝试创建一个患者:
curl -X PUT "http://localhost:3000/4_0_0/Patient/example1" -H "application/fhir+json" --data "@patient.json"
我的 patient.json
是:
{
"resourceType": "Patient","id": "example","text": {
"status": "generated","div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n\t\t\t<table>\n\t\t\t\t<tbody>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Name</td>\n\t\t\t\t\t\t<td>Peter James \n <b>Chalmers</b> ("Jim")\n </td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Address</td>\n\t\t\t\t\t\t<td>534 Erewhon,Pleasantville,Vic,3999</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Contacts</td>\n\t\t\t\t\t\t<td>Home: unkNown. Work: (03) 5555 6473</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Id</td>\n\t\t\t\t\t\t<td>MRN: 12345 (Acme Healthcare)</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>"
},"identifier": [
{
"use": "usual","type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203","code": "MR"
}
]
},"system": "urn:oid:1.2.36.146.595.217.0.1","value": "12345","period": {
"start": "2001-05-06"
},"assigner": {
"display": "Acme Healthcare"
}
}
],"active": true,"name": [
{
"use": "official","family": "Chalmers","given": [
"Peter","James"
]
},{
"use": "usual","given": [
"Jim"
]
},{
"use": "maiden","family": "Windsor","James"
],"period": {
"end": "2002"
}
}
],"telecom": [
{
"use": "home"
},{
"system": "phone","value": "(03) 5555 6473","use": "work","rank": 1
},"value": "(03) 3410 5613","use": "mobile","rank": 2
},"value": "(03) 5555 8834","use": "old","period": {
"end": "2014"
}
}
],"gender": "male","birthDate": "1974-12-25","_birthDate": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDeFinition/patient-birthTime","valueDateTime": "1974-12-25T14:35:45-05:00"
}
]
},"deceasedBoolean": false,"address": [
{
"use": "home","type": "both","text": "534 Erewhon St PeasantVille,Rainbow,Vic 3999","line": [
"534 Erewhon St"
],"city": "PleasantVille","district": "Rainbow","state": "Vic","postalCode": "3999","period": {
"start": "1974-12-25"
}
}
],"contact": [
{
"relationship": [
{
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0131","code": "N"
}
]
}
],"name": {
"family": "du marché","_family": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDeFinition/humanname-own-prefix","valueString": "VV"
}
]
},"given": [
"Bénédicte"
]
},"telecom": [
{
"system": "phone","value": "+33 (237) 998327"
}
],"address": {
"use": "home","line": [
"534 Erewhon St"
],"period": {
"start": "1974-12-25"
}
},"gender": "female","period": {
"start": "2012"
}
}
],"managingOrganization": {
"reference": "Organization/1"
}
}
然而,当我尝试查看 mongo 集合时,我只会得到:
> db.Patient_4_0_0.find();
{ "_id" : "example","id" : "example","Meta" : { "versionId" : "1","lastUpdated" : "2021-04-22T12:35:57+00:00" },"resourceType" : "Patient" }
存储任何其他数据。
有什么想法吗?
解决方法
资源中的 id 应该与 PUT 的 url 上的 id 匹配。不遵守规则,服务器会报错。
因此,请将您的 Patient.id 更改为“example1”或将您的 url 更改为“http://localhost:3000/4_0_0/Patient/example”。 然后检查状态码的响应,以及反射回给你的资源,这样你就可以看到服务器是否按预期处理了请求。您还可以对您的患者执行 GET,以查看服务器存储的内容,而不是查看数据库。
,请将此标题添加到您的命令中
"Content-Type: application/fhir+json"
您似乎没有在命令中指定标题名称。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。