0

EPIC FHIR serviceRequest API requires category be included in the call. They describe setting category:
"Set category to the following token construction: system | code, where:

system: “http://snomed.info/sct”
code: “307835004”

The code SCTID: 307835004 represents the ‘Referral by service’, in order to find CRRN type of ServiceRequests. Either the patient, subject, or encounter must be provided."

Although in their request sample they use an oid in the category string:
https://hostname/instance/api/FHIR/R4/ServiceRequest?encounter=eTRU2xhVTNrmz..7ddqsWcES0.AzzXNW2l10ZVSu70KU3&category=1.2.840.114350.1.13.861.1.7.10.798268.30|7

A little confusing. We are looking for imaging studies. In the sandbox any call made not including the category, and only using patient id returns a valid json response of the test patient sent. Forming the category as they describe "http://snomed.info/sct|183829003" 183829003 Being snomed code for "Refer for imaging" returns same data including an added index stating:

:entry[9]:resource:issue[1]:details:coding[1]:code --- 59109
:entry[9]:resource:issue[1]:details:coding[1]:display --- An element value is invalid.
:entry[9]:resource:issue[1]:details:coding[1]:system --- urn:oid:1.2.840.114350.1.13.0.1.7.2.657369
:entry[9]:resource:issue[1]:details:text --- An element value is invalid.
:entry[9]:resource:issue[1]:diagnostics --- Invalid category: 183829003

Using code 721965002 "Laboratory Order" Returns the same informational warning along with record set. I have been stumped by this all day yesterday. I guess i am looking for a better understanding of this SNOMED category so i am able to build it correctly in code. Sending calls to this API in curl right now testing. Any explanation of this would be really helpful at this juncture.

Amit Joshi
  • 15,448
  • 21
  • 77
  • 141

1 Answers1

0

That's just an example to show how you would pass in the system and value for the identifier. Providers are accustomed to placing orders for things, so referrals are usually entered as orders. And non-medication orders are returned by the ServiceRequest resource in Epic (as opposed to MedicationRequest for medications). That SNOMED code could be used to referrals to community services, for example,. That said, you don't have to use that particular category. As you've seen, usually an OID is used for the system within Epic, and the category would represent the order type (e.g., cardiology, pulmonary).

Ashavan
  • 623
  • 3
  • 8
  • Sorry still confused. Small brain. How would this translate to code? Would i set category=pulmonary ... ? I have tried many variations and usually end up getting an error with curl... – SquishyBrain Mar 03 '23 at 21:48
  • You would use "category=system|code" as you noted in their request sample. So a call to https:///api/FHIR/R4/ServiceRequest?patient=&category=urn:oid:1.2.840.114350.1.13.0.1.7.10.798268.30|7 would retrieve all ServiceRequests for the patient with that particular category. You would not use the display/text value (e.g., "pulmonary"). With Epic, the system is usually an OID. With other EHRs, that may not be the case. For example, Cerner uses a URL for the system: https://fhir.cerner.com/millennium/r4/clinical/care-provision/service-request/#search. – Ashavan Mar 05 '23 at 16:59
  • Ok. That is where i was. I am able to get returns using system|code but its not specific to that category. If one is supposed to use the OID for the system section is that returned from the Patient.Search or Patient.Read API? If so which OID there are multiple. From a quick glance it looks like the R4 and STU3 OID's are the same. Second what is code 7? Code 7 looks like a EPIC specific code for a Lab. If that is the case why are the instructions stating to use a SNOMED code? I apologize for my confusion all the other API's so far have been a breeze. This one is stumping me. – SquishyBrain Mar 06 '23 at 17:02
  • https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4/ServiceRequest?category=1.2.840.114350.1.13.0.1.7.2.698084|7&patient=erXuFYUfucBZaryVksYEcMg3 --> Returns same informational warning as before :entry[12]:resource:issue[1]:details:coding[1]:code --- 59109 :entry[12]:resource:issue[1]:details:coding[1]:display --- An element value is invalid. :entry[12]:resource:issue[1]:details:coding[1]:system --- urn:oid:1.2.840.114350.1.13.0.1.7.2.657369 :entry[12]:resource:issue[1]:details:text --- An element value is invalid. :entry[12]:resource:issue[1]:diagnostics --- Invalid category: 7 – SquishyBrain Mar 06 '23 at 17:11
  • Regarding your most recent post where you're getting the warning still, it doesn't look like you included the full system. Include the "urn:oid:" part as well. The OID to use will vary based on exactly which code you are looking at. The OID for the SSN, for example, is different from the OID for a ServiceRequest category. OIDs follow a certain pattern; Epic has some information on their structure at https://fhir.epic.com/Documentation?docId=epicidtypes. Usually you determine the correct OID for a particular code by making a test request to the server you are trying to connect to. (part 1/2) – Ashavan Mar 07 '23 at 15:22
  • Regarding what code 7 is, yes, it is an Epic-specific code for lab in that environment. 7 may represent something completely different in a different environment, as some code lists in Epic are changeable and can vary by environment. In this particular case, the category for a ServiceRequest represents the type of order in Epic. The list of order types can vary by environment. (part 2/2) – Ashavan Mar 07 '23 at 15:25
  • Awesome. I will include the unr:oid as well. Emailed epic about this and they responded "You should pay attention to the ServiceRequest sub resources. If you do not provide a category, you’re very likely simply searching on a different sub resource." Not sure about the sub resources. It does not seem to list any sub resources. – SquishyBrain Mar 07 '23 at 17:00