How do I add new patient FHIR?

665 views
Skip to first unread message

Jeffrey Lin

unread,
Mar 9, 2015, 8:00:06 PM3/9/15
to smart-...@googlegroups.com
Just had a installer built on Ubuntu 14.04 without Vagrant.  It runs well on my localhost.  Apps can run with the default 10 sample patients.  I know I can increase the number of patients by changing sample_patients_limit and rebuild.    I was trying to add new FHIR documents in without rebuild.  Here is what I did:

cd /home/fhir/sample-patients/generated-data

curl -vvv 'http://localhost:9080/ -H 'ContentType: text/xml' --data-binary @patient-7777705.fhir-bundle.xml


Then 
I got the error message:


* Hostname was NOT found in DNS cache
*   Trying ::1...
* connect to ::1 port 9080 failed: Connection refused
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 9080 (#0)
* Server auth using Basic with user 'client'
> POST /? HTTP/1.1
> Authorization: Basic Y2xpZW50OnNlY3JldA==
> User-Agent: curl/7.35.0
> Host: localhost:9080
> Accept: */*
> ContentType: text/xml
> Content-Length: 37309
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< HTTP/1.1 500 Server Error
* Server nginx/1.6.2 is not blacklisted
< Server: nginx/1.6.2
< Date: Sat, 07 Mar 2015 18:43:27 GMT
< Content-Type: text/xml; charset=UTF-8
< Transfer-Encoding: chunked
< Connection: keep-alive
* HTTP error before end of send, stop sending
<
<?xml version="1.0" encoding="UTF-8"?>

<OperationOutcome xmlns="http://hl7.org/fhir">
  <issue>
    <severity value="error"/>
    <details value="STREAMED"/>
  </issue>
* Closing connection 0

It looks like I passed the authentication but something wrong afterwrads. 

My goal is to find a way of load FHIR documents.  I tried the sample file first.  Eventually, I would like to load FHIR I created.   Any suggestion is appreciated.

--Jeff




Nikolai Schwertner

unread,
Mar 9, 2015, 9:31:04 PM3/9/15
to smart-...@googlegroups.com
Hi Jeff,

The Ansible build script that you have used to populate your server with sample patients uses curl, so that tells me that everything is in order and most likely you have an error in your curl command. It looks like you are passing an authorization header to the server, but I don't see it in your curl command. Perhaps you deleted it before copying the command to the email? Also you are using the default password of "secret", right? And your URL should be "http://localhost:9080?" for this to work.

Could you try:

curl 'http://localhost:9080/?' -u client:secret -H 'Content-Type: text/xml' --data-binary @patient-7777705.fhir-bundle.xml

If this does not work, I would definitely check out your loopback interface.

Best,
Nikolai
--
You received this message because you are subscribed to the Google Groups "SMART on FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smart-on-fhi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jeffrey Lin

unread,
Mar 9, 2015, 9:53:35 PM3/9/15
to smart-...@googlegroups.com
Hi, Nikolai,

Thank you for your prompt reply.  You were right.  Some part of my curl was not copied completely.  The curl command you gave here works.   When I ran it, I missed the dash symbol '-' in 'Content-Type'.  After I added it, it worked.  A silly mistake :(

I also tried on other FHIR xml files.  Some returned with "Request Entity Too Large"

Here is what I ran:

curl -vvv 'http://127.0.0.1:9080/?' -u client:secret -H 'Content-Type: text/xml' --data-binary @patient-99912345.fhir-bundle.xml

The response I got
* Hostname was NOT found in DNS cache
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 9080 (#0)
* Server auth using Basic with user 'client'
> POST /? HTTP/1.1
> Authorization: Basic Y2xpZW50OnNlY3JldA==
> User-Agent: curl/7.35.0
> Accept: */*
> Content-Type: text/xml
> Content-Length: 3301563
> Expect: 100-continue
>
< HTTP/1.1 413 Request Entity Too Large
* Server nginx/1.6.2 is not blacklisted
< Server: nginx/1.6.2
< Date: Sat, 07 Mar 2015 20:36:32 GMT
< Content-Type: text/html
< Content-Length: 198
< Connection: close
<
<html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx/1.6.2</center>
</body>
</html>
* Closing connection 0

It says the entity is too large.  Is there a way to increase the allowable entity size? 

Best Regards,

Jeff

Nikolai Schwertner

unread,
Mar 9, 2015, 9:58:59 PM3/9/15
to smart-...@googlegroups.com
Sounds like an nginx problem. I haven't encountered it before, so it must be something specific to your system's configuration. Perhaps try one of these fixes:

http://stackoverflow.com/questions/24306335/413-request-entity-too-large-file-upload-issue
http://cnedelcu.blogspot.com/2013/09/nginx-error-413-request-entity-too-large.html

Josh Mandel

unread,
Mar 9, 2015, 11:32:54 PM3/9/15
to Jeffrey Lin, smart-...@googlegroups.com

Hi Jeff,

What is the size of the file you're attempting to post, by the way?

Best,

Josh

Jeff Lin

unread,
Mar 10, 2015, 1:33:52 AM3/10/15
to Josh Mandel, smart-...@googlegroups.com

Hi, Josh,

The file I was trying was sample-patients/generated-data/patient-99912345.fhir-bundle.xml, which comes with the installer build.   Its file size is 3.3 MB.  

Regards,

--Jeff

Nikolai Schwertner

unread,
Mar 10, 2015, 12:12:58 PM3/10/15
to smart-...@googlegroups.com
Hi Jeff,

The file size for this patient matches what I have in my setup, so that's not the problem. Did tweaking nginx's config work out for you?

-Nikolai

Jeffrey Lin

unread,
Mar 10, 2015, 4:20:23 PM3/10/15
to smart-...@googlegroups.com
Yes, it works.

I added the following line in http section in  /etc/nginx/nginx.conf 

client_max_body_size 500M; 

and reload the configuration

service nginx reload


Then my installer build can take those larger files.

Thanks for your great help,

--jeff 

Josh Mandel

unread,
Mar 10, 2015, 4:22:45 PM3/10/15
to Jeffrey Lin, smart-...@googlegroups.com
Thanks for the report Jeff!
Message has been deleted
Message has been deleted

Nikolai Schwertner

unread,
Apr 10, 2017, 11:17:33 AM4/10/17
to smart-...@googlegroups.com
The sample patient that you are looking for is part of the SMART sample patients repo (you will need to build the sample patients):
https://github.com/smart-on-fhir/sample-patients

You can execute DELETE/PUT/POST requests against your FHIR server using curl or any other REST client.

On 4/10/17 04:28, brajesh kumar wrote:
Is there any curl url to add/update/delete a patient on fhir database.

On Monday, 10 April 2017 13:56:13 UTC+5:30, brajesh kumar wrote:
Where can i find this file to upload a patient on our own local fhir database. patient-7777705.fhir-bundle.xml

brajesh kumar

unread,
Apr 12, 2017, 1:35:46 AM4/12/17
to SMART on FHIR
Ok Thanks

brajesh kumar

unread,
Apr 14, 2017, 4:19:09 AM4/14/17
to SMART on FHIR
Hi,

I want to upload patient on local server, but in response it says '405 Not Allowed' , what does it mean.

Please reply what is wrong in uploading patient.

curl -vvv http://45.56.84.134:9080/ -H 'ContentType: text/xml' --data-binary @patient-1032702.fhir-bundle.xml
*   Trying 45.56.84.134...
* Connected to 45.56.84.134 (45.56.84.134) port 9080 (#0)
> POST / HTTP/1.1
> User-Agent: curl/7.47.0
> Accept: */*
> ContentType: text/xml
> Content-Length: 13195
> Content-Type: application/x-www-form-urlencoded
> Expect: 100-continue
>
< HTTP/1.1 405 Not Allowed
< Server: nginx/1.10.0 (Ubuntu)
< Date: Fri, 14 Apr 2017 08:16:09 GMT
< Content-Type: text/html
< Content-Length: 182
< Connection: keep-alive
* HTTP error before end of send, stop sending
<
<html>
<head><title>405 Not Allowed</title></head>
<body bgcolor="white">
<center><h1>405 Not Allowed</h1></center>
<hr><center>nginx/1.10.0 (Ubuntu)</center>
</body>
</html>
* Closing connection 0

Thanks
Brajesh

On Monday, 10 April 2017 20:47:33 UTC+5:30, Nikolai Schwertner wrote:

Travis Cummings

unread,
Apr 14, 2017, 3:55:47 PM4/14/17
to brajesh kumar, SMART on FHIR
Hi Brajesh,

The sandbox consists of several components including a FHIR sever.  The FHIR server is running on port 9070 by default.  The FHIR API is running in the context "api/smartdstu2/open" for unsecured and "api/smartdstu2/data" for secured.  You should be able to upload a FHIR bundle at the address: http://45.56.84.134:9070/api/smartdstu2/open.  

To make sure this is the correct address on your deployment, please open this URL in your browser:


This should return a FHIR conformance statement such as:
{
    "resourceType":"Conformance",
    "publisher":"Not provided",
    "date":"2017-04-14T19:53:42+00:00",
    "kind":"instance",
    "software":{
        "name":"HAPI FHIR Server",
        "version":"1.6"
    },
...

You can see the full port mappings in the installation documents:

Travis

brajesh kumar

unread,
Apr 15, 2017, 5:27:42 AM4/15/17
to SMART on FHIR, bkj...@gmail.com
Thank you Travis, your answer is very helpful. 

brajesh kumar

unread,
Apr 15, 2017, 7:56:36 AM4/15/17
to SMART on FHIR, bkj...@gmail.com
Hi Travis,

I have few question.
1. Is the source code available for this FHIR server?
2. Is this source code in java and servlet based?

Thanks.

On Saturday, 15 April 2017 01:25:47 UTC+5:30, Travis Cummings wrote:

brajesh kumar

unread,
Apr 15, 2017, 9:34:53 AM4/15/17
to SMART on FHIR, bkj...@gmail.com
I have another question in this url : http://docs.smarthealthit.org/tutorials/server-quick-start/

In section 

Sample vitals (height, weight, BMI)

and in its json text there is a segment,

"encounter" : {
               "reference" : "Encounter/428"
            },
I want to know , what is the purpose of encounter and what is its value Encounter/428
Is this segment needed, because here it is written that 

Sample Encounter (note: app can work without encounter details)

Thanks
Brajesh
 
On Saturday, 15 April 2017 01:25:47 UTC+5:30, Travis Cummings wrote:

Travis Cummings

unread,
Apr 17, 2017, 2:47:51 PM4/17/17
to brajesh kumar, SMART on FHIR
I've added a section to the installer documents that explains the components involved in the SMART on FHIR platform.  All of these components are open-source. 

Travis Cummings

unread,
Apr 17, 2017, 2:51:47 PM4/17/17
to brajesh kumar, SMART on FHIR
Please refer here for the FHIR data model specification:


The current version of FHIR on the SMART on FHIR platform is:


The statement is saying that the encounter entries in the JSON are not required by the app and may be omitted.

Thanks,
Travis
Reply all
Reply to author
Forward
0 new messages