【发布时间】:2015-08-18 09:09:04
【问题描述】:
我正在开发基于 HL7 FHIR 的医疗应用程序。我正在尝试使用 XML 和 JSON 添加新记录。但我得到的只是“500 内部服务器错误”。 我要发布的 XML 是:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Patient Data</title>
<id>urn:uuid:20</id>
<updated>2015-05-21T16:33:58.030533</updated>
<entry>
<title>Patient Dummy Data</title>
<id>Other/p21-disease-activity-score-1439917023</id>
<updated>2015-08-18T18:57:03</updated>
<published>2015-08-18T18:57:03</published>
<content type="text/xml">
<Other xmlns="http://hl7.org/fhir">
<identifier>
<value value="p21-disease-activity-score-1439917023" />
</identifier>
<text>
<status value="generated" />
</text>
<subject>
<reference value="patient/21" />
<display value="4" />
</subject>
<code>
<coding>
<system value="http://hl7.org/fhir/other-resource-type" />
<code value="RA_DISEASE_ACTIVITY" />
</coding>
</code>
</Other>
</content>
</entry>
</feed>
我正在使用 PHP-CURL 将此 XML 发布到 API 服务器,但出现 500 内部服务器错误。
我也尝试过使用 JSON,但没有运气。这是 JSON:
[
{
"resourceType": "Bundle",
"title": "PatientData",
"id": "urn:uuid:21",
"updated": "2015-05-21T16:33:58.030533",
"entry": [
{
"title": "MyTitle",
"id": "Other/p007-shoulder-lt-1439220540",
"updated": "2015-08-10T11:29:00",
"published": "2015-08-10T11:29:00",
"author": {
"name": "Medtak"
},
"content": {
"resourceType": "Other",
"identifier": "007",
"text": {
"status": "generated"
},
"subject": {
"reference": "patient/007",
"display": "true"
},
"code": {
"coding": [
{
"system": "http://hl7.org/fhir/other-resource-type",
"code": "RA_DISEASE_ACTIVITY"
}
]
}
}
}
]
}
]
我花了将近 3 天的时间来解决这个问题,但找不到任何解决方案。任何帮助,将不胜感激。谢谢!
【问题讨论】:
-
你累了什么,3天我们可以拿些样品
-
为什么需要将 XML 转换为 JSON?
-
我尝试使用 Curl 将 XML 文件发布到 API 服务器。我也尝试过使用 JSON。
-
您发帖到哪个服务器,地址是什么?请尝试使用其中一台公共服务器