# Fhir put Service Request

**URL:** https://talk.openelis-global.org/t/fhir-put-service-request/1312
**Category:** Ask OpenELIS
**Tags:** dev
**Created:** [March 12, 2025, 6:25am UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312 "2025-03-12T06:25:31Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![Kriti\_Mandal](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/kriti_mandal/32/787_2.png) [@Kriti\_Mandal](https://talk.openelis-global.org/u/Kriti_Mandal)
#### Post date: [March 12, 2025, 6:25am UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312/1 "2025-03-12T06:25:31Z")

</div>

I am trying to directly put the Service Request on openELIS 3.2.0 for adding incoming orders. But i am unable to post the requst from postman. I’m getting 500 error.

2025-03-12T08:44:26.672+0300 – WARN – Class: ModuleAuthenticationInterceptor, Method: hasPermissionForUrl(), Warning:This page has no modules assigned to it  
2025-03-12T08:44:26.672+0300 – WARN – Class: UserModuleServiceImpl, Method: getUserLogin, Warning:security context is not of type Secu rityContext  
2025-03-12T08:44:26.675+0300 – ERROR – Class: org.openelisglobal.login.daoimpl.UserModuleServiceImpl, Method: getUserLogin, Line: 173, Message: Cannot invoke "org.springframework.security.core.context.SecurityContext.getAuthentication()" because "sc" is null

---

<div class="post-metadata">

### Author: ![Moses\_Mutesasira](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/moses_mutesasira/32/72_2.png) [@Moses\_Mutesasira](https://talk.openelis-global.org/u/Moses_Mutesasira)
#### Post date: [March 14, 2025, 7:18am UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312/2 "2025-03-14T07:18:06Z")

</div>

Currently OpenELIS does accept FHIR requests directly, we are in the pipeline of adding a FHIR facade layer. Currently all FHIR exchange is done through the co-resdend FHIR server that runs in paralle to OpenELIS

---

<div class="post-metadata">

### Author: ![TimM](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@TimM](https://talk.openelis-global.org/u/TimM)
#### Post date: [May 8, 2025, 9:03pm UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312/3 "2025-05-08T21:03:14Z")

</div>

How does FHIR exchange work? I tried creating a new Patient resource in the co-resident FHIR server but OpenELIS doesn’t seem to be picking it up. I see in the settings (under Admin → Application Properties) that the

`fhir.subscriber.resources` key is set to

“Task,Patient,ServiceRequest,DiagnosticReport,Observation,Specimen,Practitioner,Encounter”

which suggests to me that OpenELIS should be pulling Patient resources from the FHIR server. Am I misreading this, and if so, is the intended flow documented somewhere?

Thanks!

edit: this is using the Docker setup from [GitHub - DIGI-UW/openelis-docker: Docker Compose setup for OpenELIS-Global2](https://github.com/DIGI-UW/openelis-docker.git) slightly modified so I have access to the FHIR server.

---

<div class="post-metadata">

### Author: ![Moses\_Mutesasira](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/moses_mutesasira/32/72_2.png) [@Moses\_Mutesasira](https://talk.openelis-global.org/u/Moses_Mutesasira)
#### Post date: [May 12, 2025, 12:25pm UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312/4 "2025-05-12T12:25:03Z")

</div>

Hello @TimM ,  
Currently OpenELIS only supports a FHIR based [EMR-LIS workflow](https://openmrs.atlassian.net/wiki/spaces/docs/pages/26937569/Lab+Integration+Workflow) through the co-resdent FHIR sever.  
We are in the process of adding a FHIR facadde so that it can directly accept FHIR data ,outside the Lab workflow

---

<div class="post-metadata">

### Author: ![TimM](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@TimM](https://talk.openelis-global.org/u/TimM)
#### Post date: [May 12, 2025, 5:25pm UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312/5 "2025-05-12T17:25:07Z")

</div>

Hi @Moses_Mutesasira,

Thank you for clarifying!

---

<div class="post-metadata">

### Author: ![TimM](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@TimM](https://talk.openelis-global.org/u/TimM)
#### Post date: [May 19, 2025, 7:16pm UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312/6 "2025-05-19T19:16:58Z")

</div>

I’ve been trying to follow the linked workflow and not having much success (I also tried to get the iSantePlus docker image running to prove out the already-tested case, but it seems to have succumbed to bit rot in several places).

I’m PUT-ing the following objects to the co-resident FHIR server:

ServiceRequest (adapted from Lab Integration Workflow example):

```auto
{
  "resourceType": "ServiceRequest",
  "id": "7712ceec-ce9d-4bdb-bb89-ac6d7a7913fe",
  "status": "active",
  "intent": "order",
  "code": {
    "coding": [
      {
        "system": "http://loinc.org",
        "code": "14682-9"
      }
    ]
  },
  "subject": {
    "reference": "Patient/bcc2e58e-29c1-4870-92cd-de5bb4b598c0",
    "type": "Patient"
  }
}

```

Task (adapted from Lab Integration Workflow example):

```auto
{
  "resourceType": "Task",
  "id": "42c542cb-bdc4-4e92-9b62-7dc574e6872c",
  "identifier": [
    {
      "system": "http://isanteplus.org/ext/task/identifier",
      "value": "42c542cb-bdc4-4e92-9b62-7dc574e6872c"
    }
  ],
  "basedOn": [
    {
      "reference": "ServiceRequest/7712ceec-ce9d-4bdb-bb89-ac6d7a7913fe",
      "type": "ServiceRequest"
    }
  ],
  "status": "requested",
  "intent": "order",
  "for": {
    "reference": "Patient/bcc2e58e-29c1-4870-92cd-de5bb4b598c0",
    "type": "Patient"
  },
  "owner": {
    "reference": "Practitioner/f9badd80-ab76-11e2-9e96-0800200c9a66",
    "type": "Practitioner"
  }
}

```

Practitioner (pulled from [fhir.org](http://fhir.org) examples):

```auto
{
  "resourceType": "Practitioner",
  "id": "f9badd80-ab76-11e2-9e96-0800200c9a66",
  "meta": {
    "versionId": "2",
    "lastUpdated": "2025-05-19T14:56:08.196-04:00",
    "source": "#7RTTafhHuvO7OdL1"
  },
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n <p>Dr Adam Careful is a Referring Practitioner for Acme Hospital from 1-Jan 2012 to 31-Mar\n 2012</p>\n </div>"
  },
  "identifier": [ {
    "system": "http://www.acme.org/practitioners",
    "value": "23"
  } ],
  "active": true,
  "name": [ {
    "family": "Careful",
    "given": ["Adam"],
    "prefix": ["Dr"]
  } ],
  "address": [ {
    "use": "home",
    "line": ["534 Erewhon St"],
    "city": "PleasantVille",
    "state": "Vic",
    "postalCode": "3999"
  } ],
  "qualification": [ {
    "identifier": [ {
      "system": "http://example.org/UniversityIdentifier",
      "value": "12345"
    } ],
    "code": {
      "coding": [ {
        "system": "http://terminology.hl7.org/CodeSystem/v2-0360/2.7",
        "code": "BS",
        "display": "Bachelor of Science"
      } ],
      "text": "Bachelor of Science"
    },
    "period": {
      "start": "1995"
    },
    "issuer": {
      "display": "Example University"
    }
  } ]
}

```

“Patient/bcc2e58e-29c1-4870-92cd-de5bb4b598c0” is a reference to a patient I manually created in the OpenELIS system.

Here are the relevant settings from Admin → Application Properties (as described [here](https://docs.openelisci.org/en/latest/deployomrs/#openelis-global-26x)):

 ![Screenshot 2025-05-19 at 12.03.53 PM](https://canada1.discourse-cdn.com/flex030/uploads/openelisci/original/1X/c2e9cba1512ae758806d47831b59643ce97c902b.png)

I’ve made sure that there is a test with the corresponding LOINC code, and that the “external orders” setting is set to “true”.

After all of that, nothing shows up in the Electronic Orders section of the OpenELIS UI.

Any insight as to what I might be doing wrong?

Thanks!

---

<div class="post-metadata">

### Author: ![Moses\_Mutesasira](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/moses_mutesasira/32/72_2.png) [@Moses\_Mutesasira](https://talk.openelis-global.org/u/Moses_Mutesasira)
#### Post date: [May 20, 2025, 8:22am UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312/7 "2025-05-20T08:22:06Z")

</div>

For OpenELIS to pull the orders, you need to set the property `org.openelisglobal.remote.source.uri` (in the properties file) to point to the fhir server where the orders reside. This could be the same co-resdent FHIR server or another FHIR server ie [here](https://github.com/DIGI-UW/OpenELIS3-OpenMRS3-HIE/blob/main/volumes/openelis/properties/common.properties#L12)

For testing purposes , here is complete [docker setup](https://github.com/DIGI-UW/OpenELIS3-OpenMRS3-HIE) for OpenMRS-3 AND OpenMELIS-3 Lab workflow you can run out of the box

---

<div class="post-metadata">

### Author: ![Moses\_Mutesasira](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.openelis-global.org/moses_mutesasira/32/72_2.png) [@Moses\_Mutesasira](https://talk.openelis-global.org/u/Moses_Mutesasira)
#### Post date: [May 20, 2025, 8:34am UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312/8 "2025-05-20T08:34:21Z")

</div>

Oh i can see you seem to have the right properties in your ADMIN page ,  
did you set those from the properties file or directly from the UI ??  
For some reason Spring doesnt correctly pick up the changes set from the UI. you need to set them directly in the properties file and restart the webapp

---

<div class="post-metadata">

### Author: ![TimM](https://avatars.discourse-cdn.com/v4/letter/t/8e8cbc/32.png) [@TimM](https://talk.openelis-global.org/u/TimM)
#### Post date: [May 21, 2025, 7:30pm UTC](https://talk.openelis-global.org/t/fhir-put-service-request/1312/9 "2025-05-21T19:30:47Z")

</div>

This was it. After setting the properties directly in common.properties and restarting, it works.

Thank you!
