Use of the Currently Existing API

I don’t really have any PHP experience and minimal HTTP experience, so I was trying to use the written API to write and read patient info from the test environment I created using Docker as suggested. When I run the provided test code to obtain an API token, I get an error saying “URL using bad/illegal format or missing URL” (this is after changing “api” to “fhir” as it says you can do. Before doing that I got the error “Failed to connect to localhost port 8300: Connection refused”). When I navigate to URLs given in the example commands, I see the data there, but I don’t know how to get the token necessary to write data and to then use it. The document I’m referencing is the API_README. Can someone aid in using the API? The end goal is just to learn how to read and write patient data to OpenEMR from some external source.

(Possibly @robert.down ?)

The FHIR API is a fairly bleeding edge feature, @sjpadgett any recommendations on this?

Are you looking at potential import strategies from another EMR?

Yeah, exactly. Update: the specific error I am getting when I use the verbose curl is “error:1400410B:SSL routines:CONNECT_CR_SRVR_HELLO:wrong version number”, so it seems to be a problem with the security protocols. I don’t know much about these security aspects related to FHIR, but am currently just trying to make anything to transfer data between systems. (is there somehow a way to just bypass these security measures?) The full verbose output I’m getting is below:

Note: Unnecessary use of -X or --request, POST is already inferred.

  • Trying ::1…
  • TCP_NODELAY set
  • Connected to localhost (::1) port 8300 (#0)
  • ALPN, offering h2
  • ALPN, offering http/1.1
  • Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
  • successfully set certificate verify locations:
  • CAfile: /etc/ssl/cert.pem
    CApath: none
  • TLSv1.2 (OUT), TLS handshake, Client hello (1):
  • error:1400410B:SSL routines:CONNECT_CR_SRVR_HELLO:wrong version number
  • stopped the pause stream!
  • Closing connection 0
    curl: (35) error:1400410B:SSL routines:CONNECT_CR_SRVR_HELLO:wrong version number
1 Like

@hillery Try not using port 8300. Just use domain w/o port.