标签: hapi-fhir

使用 Qt 的 RESTful API 请求

我正在尝试从此链接中找到示例以使其工作。

GETandDELETE方法正在起作用,但我对PUTand有一些问题POST。我得到服务器回复:Bad Request。随着qDebug()我得到这个错误:

QNetworkReply::NetworkError(ProtocolInvalidOperationError)

对于httprequestworker.cpp,我已将请求类型更改为:

request_content.append("Content-Type: application/fhir+json");
Run Code Online (Sandbox Code Playgroud)

这是我从计算机获取 JSON 文件内容并为服务器执行整个请求输入的函数:

void MainWindow::on_pushButton_clicked()
{
    QString url_str = "http://hapi.fhir.org/baseDstu3/Patient/4705560";

    HttpRequestInput input(url_str, "PUT");

    QString settings;
    QFile file;

    file.setFileName("C:/Users/Lauri/Desktop/FHIR/Omia testeja/themostsimplepatientJSON.json");
    file.open(QIODevice::ReadOnly | QIODevice::Text);
    settings = file.readAll();
    file.close();

    settings.remove(QRegExp("[\\n]"));
    qDebug() << settings;
    settings.toUtf8();
    input.add_var("key1", settings);


    HttpRequestWorker *worker = new HttpRequestWorker(this);
    connect(worker, SIGNAL(on_execution_finished(HttpRequestWorker*)), this, SLOT(handle_result(HttpRequestWorker*)));
    worker->execute(&input);
}
Run Code Online (Sandbox Code Playgroud)

这是我要上传的简单 JSON:

{
  "resourceType": "Patient",
  "text": {
    "status": "generated",
    "div": "<div xmlns='http://www.w3.org/1999/xhtml'>This is a …
Run Code Online (Sandbox Code Playgroud)

c++ qt httprequest hl7-fhir hapi-fhir

8
推荐指数
1
解决办法
1万
查看次数

设置 HAPI FHIR IGenericClient 的超时

我正在尝试使用以下代码运行 fhir 搜索;

FhirContext ctx = FhirContext.forDstu2();
ctx.getRestfulClientFactory().setConnectTimeout(2000000);
IGenericClient client = ctx.newRestfulGenericClient("http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2");

Bundle results = client.search().forResource(Basic.class).returnBundle(ca.uhn.fhir.model.dstu2.resource.Bundle.class).execute();
Run Code Online (Sandbox Code Playgroud)

然而,当它运行时,它总是抛出异常“FhirClientConnectionException”,这是由异常“SocketTimeoutException”引起的。我是否可以假设这是服务器超时,而不是我的本地连接,因为我将本地设置为 2000000?

我该如何解决问题?我在开箱即用的配置中使用 HAPI,并且在大约 10-15 秒内搜索相对少量的资源时会超时。

hl7-fhir hapi-fhir dstu2-fhir

6
推荐指数
1
解决办法
2066
查看次数

FHIR 订阅在 hapi-fhir 中不起作用

我正在使用带有 jpa 的 hapi-fhir v4.2.0 服务器,它工作得很好。我添加了一些患者,并且能够向我的 hapi-fhir 本地主机环境发送 GET/POST 请求。

我还可以使用以下 URL 创建订阅:http://localhost:8080/hapi-fhir-jpaserver/fhir/Subscription并使用以下正文:

{
  "resourceType": "Subscription",
  "criteria": "Patient",
  "reason": "Give me the patient",
  "end": "2021-01-01T00:00:00Z",
  "status": "requested",
  "channel": {
    "type": "rest-hook",
    "endpoint": "http://localhost:1337",
    "payload": "application/json"
  }
}
Run Code Online (Sandbox Code Playgroud)

每当我对 a 进行 POST 或 PUT 操作时Patient,都会触发订阅并向 a 发送 POST 请求http://localhost:1337,但没有任何反应。

我尝试过的:

  1. 更改requestedactive
  2. 将标准从 更改PatientPatient?name=John
  3. 删除payload参数
  4. 阅读文档
  5. 更改为application/fhir+json

但仍然无法工作:(我在这里缺少什么?

编辑:我的后端是一个运行的简单 Nodejs morgan,因此它将在控制台中记录每个 POST/GET/PUT 尝试。

subscription hl7-fhir hapi-fhir

6
推荐指数
1
解决办法
1865
查看次数

5
推荐指数
1
解决办法
831
查看次数

如何通过 FHIR REST api (HAPI) 添加配置文件

我查看了为 FHIR 创建配置文件的文档,并且我已经使用 Forge 创建了一些我认为可以有效描述配置文件的 xml。我在文档中找不到它实际说明我需要向 RESTful api 发出什么请求才能实际添加新配置文件的地方。

有任何想法吗?

hl7-fhir hapi-fhir

5
推荐指数
1
解决办法
1297
查看次数

成功上载后,HAPI无法返回Basic资源

我正在尝试将资源上传到HAPI.它基于资源类型基础,我已经为我想要捕获的概念创建了一个自定义配置文件(和扩展).我已将这些StructureDefinitions上传到我正在使用的服务器(托管在本地主机上),但我还没有验证它的上传(仍然试图测试我一直用于我的xml的格式是正确的).

我上传了以下软件包(实际软件包中有更多的记录,为了清晰起见,我刚刚编辑了它):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<Bundle>
  <meta>
    <lastUpdated value="2016-10-28T16:29:43Z"/>
  </meta>
  <type value="transaction"/>
  <entry>
    <resource>
      <Basic>
        <text>
          <status value="generated"/>
          <div/>
        </text>
        <extension url="http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2/StructureDefinition/DateID">
          <valueDate value="2016-11-01"/>
        </extension>
        <extension url="http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2/StructureDefinition/SptSolution">
          <valueCoding value="SptSolution.CatFurSPTSoln"/>
        </extension>
        <extension url="http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2/StructureDefinition/MethodOfFollowUp">
          <valueCoding value="FollowUpMethod.ClinicVisit"/>
        </extension>
        <extension url="http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2/StructureDefinition/SPTDefinition">
          <valueString value="A positive skin prick test result was defined as a mean wheal diameter of 3mm greater than that of the negative control"/>
        </extension>
        <extension url="http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2/StructureDefinition/SubjectNo">
          <valueString value="4320"/>
        </extension>
        <extension url="http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2/StructureDefinition/AIW">
          <valueInteger value="58"/>
        </extension>
        <extension url="http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2/StructureDefinition/FollowUp">
          <valueCoding value="FollowUp.MSAge1Y"/>
        </extension>
        <extension url="http://localhost:1080/hapi-fhir-jpaserver-example/baseDstu2/StructureDefinition/Subject">
          <valueCoding …
Run Code Online (Sandbox Code Playgroud)

hl7-fhir hapi-fhir dstu2-fhir

4
推荐指数
1
解决办法
655
查看次数

有人可以解释 FHIR 扩展吗?

我一直在尝试在 FHIR 中编写配置文件。我遇到的问题是使用扩展。

文档谈到扩展,好像它们只是为了扩展配置文件所属资源的现有元素,这在使用伪造时向我确认,因为我可以添加没有扩展的新元素。

我感觉很陌生,因为在我们的专有存储系统中,我们有等价的配置文件,并且它们有关于它们的属性(我认为这类似于 fhir 中的元素),但是属性仅用于存储一种类型的东西; 例如,您可能有一个具有 DOB、种族、标识符等属性的患者档案。我真的不明白 fhir 上下文中的档案是什么,它们与我的属性相似吗?我可以使用 来限制配置文件实例对特定元素可以具有的数据类型吗?

有比规范更好的文档吗?我发现真的很难掌握。

hl7-fhir hapi-fhir dstu2-fhir

4
推荐指数
1
解决办法
1333
查看次数

我如何根据扩展值搜索fhir资源?

我有以下形式的一组fhir资源:

<Basic>
    <meta>
      <versionId value="1.0"/>
      <lastUpdated value="2016-11-18T10:26:51Z"/>
      <profile value="http://stelar.org/StructureDefinition/stelar/profile/anthropometry"/>
    </meta>
    <text>
      <status value="generated"/>
    </text>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/const-sourceIdentifier">
      <cohortName value="TEST"/>
      <datasetName value="SEATONJEAug14A1"/>
      <archetypeName value="Abdo20wks"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/const-resourceTags">
      <valueString value="SEATON"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/anthropometryType">
      <valueCoding value="AnthropometricMeasure"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/subjectNo">
      <valueString value="5375"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/methodOfFollowUp">
      <valueCoding value="FollowUpMethod.ClinicVisit"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/followUp">
      <valueCoding value="FollowUp.SNRecruitment"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/variableLabel">
      <valueString value="Abdominal girth 20 week fetal scan (mm)"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/AIW">
      <valueDouble value="1841.0"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/subject">
      <valueCoding value="Person.StudySubject"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/clinicalType">
      <valueCoding value="ClinicalMeasurement.AnthropometricMeasure"/>
    </extension>
    <extension url="http://stelar.org/StructureDefinition/stelar/extension/dataSource">
      <valueCoding value="DataSource.ClinicalMeasurement"/>
    </extension>
    <extension …
Run Code Online (Sandbox Code Playgroud)

hl7-fhir hapi-fhir dstu2-fhir

3
推荐指数
1
解决办法
848
查看次数

使用 HAPI FHIR 发布资源包

我正在寻求有关如何将包含多个资源的包发布到 HAPI 服务器的帮助。我正在运行 [测试服务器][1],并且我尝试使用 Jetty 服务器并将其作为 Docker 容器运行。我能够成功启动服务器,转到 UI 并直接发布患者。我还可以直接从 Postman 中发布患者:

POST /hapi-fhir-jpaserver/fhir/Patient HTTP/1.1
Host: localhost:8080
Content-Type: application/fhir+json
{
  "resourceType": "Patient",
  "name": [
    {
      "use": "official",
      "family": "Solo",
      "given": [
        "Han"
      ]
    }
  ]
Run Code Online (Sandbox Code Playgroud)

这一切都很好。但是,当我尝试发布此内容时:

{
  "resourceType": "Bundle",
  "type": "transaction",
  "entry": [
    {
      "resource": {
        "resourceType": "Patient",
        "name": [
          {
            "use": "official",
            "family": "Stark",
            "given": [
              "Anthony"
            ]
          }
        ]
      },
      "request": {
        "method": "PUT",
        "url": "Patient"
      }
    }
  ]
}
Run Code Online (Sandbox Code Playgroud)

我收到“OperationOutcome”错误:“无法在此服务器上存储 Bundle 资源,其 Bundle.type 值为:事务”

我从 Web UI …

hapi dart hl7-fhir hapi-fhir flutter

2
推荐指数
1
解决办法
5098
查看次数

传输 FHIR 资源的 RSocket 与 HTTP 性能

我最近开始了一系列关于使用FHIR资源的服务到服务通信的性能调查,以确定在以下方面花费的处理时间:

  1. 有效载荷通信/交换
  2. 序列化和反序列化有效负载

在调查过程中遇到了两个我不明白的结果,因此我需要RSocket开发团队的帮助。我将详细说明结果和问题。

为了找出最快的通信方式,我分析了使用两种传输协议的三种传输方式——HTTP 和 RSocket。更准确地说 - 我已经分析和基准测试:

  1. 使用HAPI REST 服务器和 HAPI FHIR 客户端交换 FHIR 资源
  2. 通过@RestController使用RestTemplateWeb 客户端访问 Spring端点,使用 REST 通信交换字符串(序列化的 FHIR 资源)
  3. 使用RSocket消息交换 FHIR 资源

对前两种通信方法的分析产生了使用 HAPI REST 服务器交换 FHIR 资源与交换(原始)字符串有效载荷之间的巨大差异,包括将这些有效载荷反序列化为 FHIR 资源。更准确地说 - 对于大型 FHIR 资源,HAPI REST 服务器增加的开销大约是(原始)字符串通信和反序列化所带来的开销的 3-4 倍。

关于两个服务之间的 RSocket 通信 - 我尝试使用两种模式来交换 FHIR 资源:

  1. 作为原始字符串,从 FHIR 资源序列化
  2. 作为原始 FHIR 资源,让 RSocket 处理序列化和反序列化

第一种方法(使用原始字符串)产生的负载交换开销几乎与 HTTP(使用 REST)通信所产生的开销相似。更准确地说 - 通信开销比 HTTP 通信高几个百分比 (5-10%)。这让我感到惊讶,因为我认为 RSocket 通信开销将低于 HTTP …

hl7-fhir spring-boot spring-messaging hapi-fhir rsocket

-3
推荐指数
1
解决办法
759
查看次数