I am working on a medical application based on HL7 FHIR. I am trying to add new record using XML and JSON both. But all I get is the '500 Internal Server Error'. The XML I am trying to POST is:
<?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>
I am posting this XML to API Server using PHP-CURL but getting 500 Internal Server Error.
I tried with JSON too but no luck. Here is the 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"
}
]
}
}
}
]
}
]
I have spent almost 3 days to fix this issue but couldn't find any solution. Any help would be appreciated. Thanks!