FHIR Chat · Patient Coverage · dotnet

Stream: dotnet

Topic: Patient Coverage


view this post on Zulip Ger Vang (Dec 09 2020 at 16:18):

I'm trying to get patient coverage using the following route:

Header:
Bearer Token <Access Token>
GET: https://apporchard.epic.com/interconnect-aocurprd-oauth/api/FHIR/R4/Coverage?patient=<patient id>

I was able to get the access token from using the following route:

POST: https://fhir.epic.com/interconnect-fhir-oauth/oauth2/token
Body:
grant_type = client_credentials
client_assertion_type = urn:ietf:params:oauth:client-assertion-type:jwt-bearer
client_assertion = <client assertion token>

For some reason when I tried calling coverage route, I always get a 401. The test user I'm using has an Aetena plan. Is there something I'm missing?

view this post on Zulip Michele Mottini (Dec 09 2020 at 16:33):

I think the problem is that you are using a fhir.epic.com token against an AppOrchard end point - they are two different systems. You should either use the fhir.epic.com end point or get a token from AppOrchard

view this post on Zulip Ger Vang (Dec 09 2020 at 17:15):

Michele Mottini said:

I think the problem is that you are using a fhir.epic.com token against an AppOrchard end point - they are two different systems. You should either use the fhir.epic.com end point or get a token from AppOrchard

I don't see an endpoint for patient coverage on fhir.epic.com. Is there one? If so, where is the documentation?

I've looked at https://fhir.epic.com/Specifications?api=1076 but I don't see an endpoint on this page.

view this post on Zulip Michele Mottini (Dec 09 2020 at 17:22):

I don't know - if it does not have Coverage you'll have to get an AppOrchard token

view this post on Zulip Ger Vang (Dec 09 2020 at 17:30):

Thanks. I'll try to look into AppOrchard.

view this post on Zulip Cooper Thompson (Dec 09 2020 at 18:58):

Coverage is available in fhir.epic. You can just use the normal R4 fhir.epic endpoint: https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4/Coverage?patient=patientID. We don't have the "Try It" available for it yet, so you won't see the template URL in the Try It utility.

view this post on Zulip Ger Vang (Dec 09 2020 at 21:02):

Cooper Thompson said:

Coverage is available in fhir.epic. You can just use the normal R4 fhir.epic endpoint: https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4/Coverage?patient=patientID. We don't have the "Try It" available for it yet, so you won't see the template URL in the Try It utility.

I tried this but I'm getting a 401 Forbidden. Could it be a permission issue with the patient profile or my app (backend and patients)?

view this post on Zulip Ger Vang (Dec 15 2020 at 16:11):

I was able to get the Coverage data from https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4/Coverage?patient=<patient id> but I'm having trouble finding the Coverage.SearchResponse model from Hl7.Fhir.Model to map with the response data from https://fhir.epic.com/Specifications?api=1078

Does anyone know if there is a model I can use or should I just build my own? I tried using Hl7.Fhir.Model.Coverage but that doesn't work since the properties are different.

view this post on Zulip Michele Mottini (Dec 15 2020 at 16:22):

https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4/Coverage?patient=<patient id> will return a Bundle containing Coverage resources, so you should use Hl7.Fhir.Model.Bundle

view this post on Zulip Ger Vang (Dec 15 2020 at 16:39):

I'm getting this error when I try to deserialize the response using Newtonsoft.Json.JsonCovert.

Could not create an instance of type Hl7.Fhir.Model.Resource. Type is an interface or abstract class and cannot be instantiated. Path 'entry[0].resource.resourceType', line 1, position 503.

Could the problem be the Newtonsoft deserializer?

JsonConvert.DeserializeObject<Bundle>(responseContent)

view this post on Zulip Michele Mottini (Dec 15 2020 at 16:41):

You cannot use Newtonsoft deserializers, use the Hl7.Fhir ones. If you use the client in Fhir .NET library you do not even have to invoke the deserialization manually

view this post on Zulip Ger Vang (Dec 15 2020 at 17:02):

That did the trick! Thank you.

In case someone ran into the same issues as me, here is an example:
https://stackoverflow.com/questions/49314247/how-to-deserialise-json-to-fhir-valueset-resource-in-net


Last updated: Apr 12 2022 at 19:14 UTC