NextGen Knowledge Center

Sending Sample Requests

Once you've made any necessary tweaks to the channel or configuration map (like pointing it to your local database), save and deploy it. The FHIR Listener channel will be up and running, and you should be able to request the home page at the URL http://localhost:9001/r4/, or the conformance statement at the URL http://localhost:9001/r4/metadata. Note that the IP, port, or base context path may be different depending on your source connector settings. If you request a resource (like the conformance statement) in a web browser, it will return the HTML template with the resource narrative (if available):

Image of the HTML template of the CapabilityStatement Resource

Creating a Patient Resource

After verifying the /metadata endpoint works correctly, try creating a new Patient resource. To do this, POST a request to http://localhost:9001/r4/Patient. You can go here to get some example patient resources: Resource Patient - Examples.

If you choose an XML-formatted resource, use "application/fhir+xml" for the Content-Type. If you choose JSON, use "application/fhir+json".

After sending the request, the channel should receive the message, and you can view it in the message browser:

Notice how the fhirType variable contains "Patient", and the fhirInteraction variable contains "create", which is correct. Back in whatever HTTP client you're using, you should have received a 201 (Created) status code, and also a Location header. The Location header contains a URL telling the client where to issue a "vread" interaction to retrieve the same resource you just created.

Reading a Patient Resource at a Specific Version

If you copy that URL and issue a new GET request to it, it should return the same resource XML that you POSTed earlier. Again in the message browser, you can view the vread request that came in, and verify the response data that was sent back to the client:

Binary Resources

You can also create and read Binary resources. Issue another POST request, but this time to the address http://localhost:9001/r4/Binary (again, URL may change depending on source connector settings). Use the Content-Type "application/pdf", and select a testing PDF for the actual HTTP payload. You should see the same "create" request in the message browser, but the PDF will be stored as an attachment instead, and the content of the Binary resource will be a replacement token, like "${ATTACH:efe4cd42-de30-4e80-b1d4-1e15dbd646f9}".

Finally in the HTTP response, you should get the same Location header. If you copy that URL and issue a new GET request to it, it should return the same PDF that you created previously.