FHIR Chat · FHIR Server Requirements to work with ClinFHIR · clinFHIR

Stream: clinFHIR

Topic: FHIR Server Requirements to work with ClinFHIR


view this post on Zulip Chuck Feltner (Oct 22 2016 at 15:20):

Is there a basic set of FHIR resources and operations that need to be supported by a FHIR server for it to work with ClinFHIR? Once I select a patient from our server (https://fhirsandbox1.tsysinteropsvcs.net/sites/123/), the icon in the top right keeps spinning like it is in the process of loading something but I don't see any outstanding requests. Is it requiring $everything, Basic, or List to load the associated resources for the patient? Thanks.

view this post on Zulip David Hay (Oct 22 2016 at 18:17):

Hi Chuck - yes, it does use the $everything operation to retrieve all the data for that patient - will that be difficult to add? (I need to at least give a better error message) rather than just hanging - if you check the browser console you'll see the errors that occurred...

btw - you'll also need to enable CORS if you want to be able to write data...

view this post on Zulip David Hay (Oct 22 2016 at 18:46):

OK - have pushed a fix that means it will load specific resources - currently these are: Observation, Encounter ,Appointment, Condition, List, Basic (I can add others, but needs a code update to do so). It does assume that the server supports a query on patient/subject - eg Encounter?patient={id}...

view this post on Zulip David Hay (Oct 22 2016 at 18:46):

You'll still need CORS to write though...

view this post on Zulip Chuck Feltner (Oct 22 2016 at 23:25):

Thanks David! I will look into adding $everything. So far we just have support for calling each one of the resources. What are you expecting returned for List and Basic? The spec seems to suggest several different uses for them. Here again we were expecting the data to be retrieved from the individual resource routes. Will check the console and make some more updates to improve the interaction. Thanks for the help.

view this post on Zulip David Hay (Oct 23 2016 at 07:35):

Well, they can both be used for all sorts of useful things! clinFHIR just retrieves them for display..
If you want me to add other resources in the mean time just ask - it's only a single line to add for each resource type to retrieve!

view this post on Zulip Chuck Feltner (Oct 24 2016 at 16:00):

Hi David. Thanks for the info. How about adding AllergyIntolerance and MedicationStatement?

view this post on Zulip David Hay (Oct 24 2016 at 17:58):

done...

view this post on Zulip Chuck Feltner (Oct 24 2016 at 21:15):

Great. Thanks David.

view this post on Zulip Chuck Feltner (Oct 25 2016 at 12:57):

David. I enabled the CORS support on the server. When adding a patient it is getting added fine to the server but it appears that ClinFHIR is having trouble extracting the id from the returned resource; "err":"The server did not return a valid id".

view this post on Zulip Brian Postlethwaite (Oct 25 2016 at 18:43):

Hey Chuck, you might want to consider running some of the online test tools like ProjectCrucible.org, or the Aegis touchstone test tools.
They should be able to assist with testing server creates of resources really well.

view this post on Zulip David Hay (Oct 25 2016 at 22:57):

Hi Chuck - which patient? (But Brians suggestion is an excellent one)...

view this post on Zulip Chuck Feltner (Oct 26 2016 at 17:31):

Yes, I have run the Aegis Touchstone Add Patient test and that works. When I use ClinFHIR to create a patient, I can see in the Chrome developer tools that a Patient resource with an id is getting returned from the FHIR server (https://fhirsandbox1.tsysinteropsvcs.net/sites/123/) but ClinFHIR is throwing an error that it can not find a valid id. Here is the returned json: {"resourceType":"Patient","id":"56","text":{"status":"generated","div":"<div xmlns='http://www.w3.org
/1999/xhtml'>Ivy Wright</div>"},"name":[{"use":"official","text":"Ivy Wright","family":["Wright"],"given"
:["Ivy"]}],"gender":"female","birthDate":"1951-08-27"}

view this post on Zulip David Hay (Oct 26 2016 at 20:20):

id=56? lemme go look...

view this post on Zulip David Hay (Oct 26 2016 at 20:29):

So I get some resources back when I select that patient directly (Condition & Encounter) but a 404 (with an html response) for th others - try https://fhirsandbox1.tsysinteropsvcs.net/sites/123/Appointment?patient=56&_count=100

should return an OperationOutcome (ideally) - but not html...

view this post on Zulip David Hay (Oct 26 2016 at 20:32):

I also get a CORS error on some of the others as well.
But I don't get any error being thrown by CF - can you list the sequence of events that results in the error?

view this post on Zulip Brian Postlethwaite (Oct 26 2016 at 20:57):

Does the clinFHIR read the id from the resource, or check the location header value?
(as not all servers return the complete resource, but all should return the location header)
http://hl7.org/fhir/http.html#create (covers the location header)
http://hl7.org/fhir/http.html#2.1.0.5.2 (the prefer header in the request)

view this post on Zulip Chuck Feltner (Oct 26 2016 at 21:09):

Here is the sequence of events:
1. On the main ClinFHIR page, click on "Select Patient"
2. On "Search for Patient" popup, click on "Add new patient"
3. Values for new patient get auto-populated. Click on "Add patient" button.
4. ClinFHIR sends POST to FHIR server to create patient.
5. FHIR server creates patient and returns patient resource with ID now populated.
6. ClinFHIR issues error message that it can not extract the ID.

view this post on Zulip David Hay (Oct 26 2016 at 21:18):

I think brian has it - here's the code:

var serverId;
serverId = headers('Content-Location');
if (! serverId) {
serverId = headers('Location');
}
(serverId is the id the server allocates...)

view this post on Zulip Chuck Feltner (Oct 26 2016 at 21:40):

The server is returning the following Location header in the response.
Location: https://fhirsandbox1.tsysinteropsvcs.net/sites/123/Patient/56
Is it perhaps expecting the version id as well? We do not support history so that is why it is not included.
Location: [base]/[type]/[id]/_history/[vid]

view this post on Zulip David Hay (Oct 26 2016 at 22:50):

Yeah - that's the issue, it expects a version specific id. I'll make the parsing more robust and let you know when that's been done...

view this post on Zulip Chuck Feltner (Oct 26 2016 at 23:23):

Great. Thanks David and Brian.

view this post on Zulip David Hay (Oct 26 2016 at 23:25):

So I'm getting a weird error where the save works, but I can't read your headers from within the app (angular based). I note that in your cors response you return "Access-Control-Allow-Origin:http://clinfhir.com " but this is https - Could that be the issue? Can you change it to Access-Control-Allow-Origin:* and see if that helps...

view this post on Zulip Chuck Feltner (Oct 27 2016 at 13:16):

David, changed it to Access-Control-Allow-Origin:*. Still seeing the issue.

view this post on Zulip David Hay (Oct 29 2016 at 18:10):

I may have it. According to this post (http://stackoverflow.com/questions/32404092/response-header-is-present-in-browser-but-not-parsed-by-angular-http-response-h ) you also need to include the "Access-Control-Expose-Headers" response header to something like Content-Location,Location.

Can you try that?

view this post on Zulip Brian Postlethwaite (Nov 02 2016 at 01:59):

That rings a bell here for something I had to do on my server too. Will check

view this post on Zulip Chuck Feltner (Nov 02 2016 at 16:38):

Thanks David. Looks like that did it. I included the "Access-Control-Expose-Headers" response header and am now able to add patient without generating the samples. Looks like that requires some dependent resources we do not currently support. Thanks for the help.

view this post on Zulip David Hay (Nov 02 2016 at 17:17):

Glad to hear it! Hopefully will help out the next person :)

Looking through the responses, a query like: https://fhirsandbox1.tsysinteropsvcs.net/sites/123/Appointment?patient=71&_count=100 returns a 404, but also an html page with no cors data - hence the message. You might want to consider returning an OperationOutcome resource rather than html (and I should read your conformance - soon to be CapabilityStatement and adjust accordingly....)

You might also want to consider the $everything operation...


Last updated: Apr 12 2022 at 19:14 UTC