
imranq2/node-fhir-server-mongo本项目是基于@asymmetrik/node-fhir-server-core构建的示例项目,采用MongoDB作为后端存储样本数据,支持通过Docker或Node.js环境运行。该服务器可同时服务多个FHIR版本,默认启用R4(4_0_0)版本,同时支持DSTU2(1.0.2)和STU3(3.0.1)版本,可通过配置选择支持全部或特定版本。
适用于健康领域的FHIR API服务器快速部署、开发与测试,支持系统集成、FHIR版本兼容性验证、资源自定义配置等场景,尤其适合需要快速搭建FHIR服务原型的开发人员和***机构。
shelldocker-compose up
env.json文件中定义的默认配置值是否有效。shellyarn install # 或 npm install
shellyarn start # 或 npm run start
服务启动后默认监听3000端口,成功启动后将输出以下日志信息:
shell... - verbose: Server is up and running!
默认启用R4版本的Patient和Organization资源,能力声明可通过以下链接访问:
如已启用其他版本,可访问:
使用请求工具(如Postman)执行以下操作:
创建患者(R4版本)
httpPUT /4_0_0/Patient/example HTTP/1.1 Host: localhost:3000 Content-Type: application/fhir+json Cache-Control: no-cache { "resourceType": "Patient", "id": "example", "text": { "status": "generated", "div": "<div xmlns=\"[***]\">\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: *** (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": "[***]", "code": "MR" } ] }, "system": "urn:oid:1.2.36.146.595.217.0.1", "value": "***", "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", "given": ["Peter", "James"], "period": { "end": "2002" } } ], "telecom": [ { "use": "home" }, { "system": "phone", "value": "(03) 5555 6473", "use": "work", "rank": 1 }, { "system": "phone", "value": "(03) 3410 5613", "use": "mobile", "rank": 2 }, { "system": "phone", "value": "(03) 5555 8834", "use": "old", "period": { "end": "2014" } } ], "gender": "male", "birthDate": "1974-12-25", "_birthDate": { "extension": [ { "url": "[***]", "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": "[***]", "code": "N" } ] } ], "name": { "family": "du Marché", "_family": { "extension": [ { "url": "[***]", "valueString": "VV" } ] }, "given": ["Bénédicte"] }, "telecom": [ { "system": "phone", "value": "+33 (237) 998327" } ], "address": { "use": "home", "type": "both", "line": ["534 Erewhon St"], "city": "PleasantVille", "district": "Rainbow", "state": "Vic", "postalCode": "3999", "period": { "start": "1974-12-25" } }, "gender": "female", "period": { "start": "2012" } } ], "managingOrganization": { "reference": "Organization/1" } }
读取患者(R4版本)
httpGET /4_0_0/Patient/example HTTP/1.1 Host: localhost:3000 Content-Type: application/fhir+json Cache-Control: no-cache
本示例默认仅配置Patient和Organization资源。如需支持其他FHIR资源,需为相应资源实现服务代码。仅启用的资源会生成对应的API路由。可参考@asymmetrik/node-fhir-server-core文档查看支持的资源列表。
@asymmetrik/fhir-server-mongo 采用 MIT 许可。
manifest unknown 错误
TLS 证书验证失败
DNS 解析超时
410 错误:版本过低
402 错误:流量耗尽
身份认证失败错误
429 限流错误
凭证保存错误
来自真实用户的反馈,见证轩辕镜像的优质服务