Sending a bundle as a transaction to the SMART on FHIR starter server

303 views
Skip to first unread message

Ye Wang

unread,
Dec 12, 2016, 1:44:43 PM12/12/16
to SMART on FHIR
We are trying to use the starter server for some experiments. This is to includes a list of Obversation resources in a bundle and send it to the starter server as a transaction. It seems only the bundle itself is created, not the individual resources that it includes. I wonder if the capability of processing resources in a bundle is available on the starter server. If it does, is there a code sample or a doc for this kind of operation? It might we are not making the calls correctly.

Thanks,

Ye Wang

Michele Mottini

unread,
Dec 14, 2016, 10:45:08 AM12/14/16
to SMART on FHIR
Transactions are not widely implemented - I guess the SMART sandbox server does not properly support them.

If you want to experiment with transaction the HAPI test server supports it, and ours (CareEvolution) does as well.

  - Michele
  CareEvolution Inc

--
You received this message because you are subscribed to the Google Groups "SMART on FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smart-on-fhir+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Travis Cummings

unread,
Dec 14, 2016, 12:10:24 PM12/14/16
to Michele Mottini, SMART on FHIR
Hi All,

The most recent SMART sandbox server uses the HSPC stack and HAPI persistence tier.  The SMART sandbox server does support transaction bundles.  

Would you be able to provide a sample of the bundle you are trying to load, and I can test it?

Thanks,
Travis Cummings

To unsubscribe from this group and stop receiving emails from it, send an email to smart-on-fhi...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "SMART on FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to smart-on-fhi...@googlegroups.com.

Nikolai Schwertner

unread,
Dec 14, 2016, 12:14:48 PM12/14/16
to smart-...@googlegroups.com
Correct. Both the current and upcoming SMART sandboxes support transactions via bundles. In fact, the sample patients which are used to populate the server are expressed as transaction bundles (see https://github.com/smart-on-fhir/sample-patients).

-Nikolai

Ye Wang

unread,
Dec 14, 2016, 12:29:30 PM12/14/16
to SMART on FHIR
I have confirmed with SMART team that their servers do support transactions. 

The problem I am having is that when I use the "transaction" function in the fhir.js (or fhir-client.js of SMART), the bundle is not sent back to the server. The payload of this ajax call seems empty. The server returns an error saying the JSON object is null. I am working on it. If anyone has suggestions on the possible causes, it will be really helpful.

The bundle I used is for a DiagnosticReport, which includes a list of Observation resources. Thank you all for helps.

Ye

Ye Wang

unread,
Dec 15, 2016, 10:51:17 AM12/15/16
to SMART on FHIR, mi...@careevolution.com
Hi Travis,

I am still having troubles to get it work. I wonder if you can take a look. 

When I sent a bundle with just one Observation resource, using api.transaction({data: aBundle}), the server returned an error: 
Cannot cast object '5852b7460cf2878b2b12f9b1' with class 'java.lang.String' to class 'org.hl7.fhir.instance.model.api.IIdType'

The the sample data is listed below:
{
   "resourceType":"Bundle",
   "type":"transaction",
   "id":"a_bundle_id",
   "entry":[
      {
         "resource":{
            "resourceType":"Observation",
            "status":"final",
            "code":{
               "coding":[
                  {
                     "system":"http://loinc.org",
                     "code":"2710-2"
                  }
               ],
               "text":"SaO2 % BldC Oximetry"
            },
            "valueQuantity":{
               "value":"5",
               "unit":"%",
               "system":"http://unitsofmeasure.org",
               "code":"%"
            },
            "subject":{
               "reference":"Patient/hca-pat-32",
               "display":"Brittany Newman"
            }
         },
         "request":{
            "method":"POST",
            "url":"Observation"
         }
      }
   ]
}

I tried to changing some data in the above sample, like adding/removing "id"/subject/fullUrl and etc. It didn't make a difference.

However it works fine when I send the same resource in the "entry" to be created directly using api.create({resource: aResource}).

The SMART sandbox server used is https://fhir-api-dstu2.smarthealthit.org/.

Thank you.

Ye

Travis Cummings

unread,
Dec 15, 2016, 3:26:46 PM12/15/16
to Ye Wang, SMART on FHIR, mi...@careevolution.com
Nikolai,

Could you look at this issue on https://fhir-api-dstu2.smarthealthit.org?

Thanks,
Travis

Nikolai Schwertner

unread,
Dec 15, 2016, 9:17:21 PM12/15/16
to smart-...@googlegroups.com
Folks,

I replicated the same error message on my end when executing the transaction on the SMART sandbox. I managed to fix it by updating the transaction to:


{
   "resourceType":"Bundle",
   "type":"transaction",
   "entry":[
      {
         "resource":{
            "resourceType":"Observation",
            "id":"ABCD12345",

            "status":"final",
            "code":{
               "coding":[
                  {
                     "system":"http://loinc.org",
                     "code":"2710-2"
                  }
               ],
               "text":"SaO2 % BldC Oximetry"
            },
            "valueQuantity":{
               "value":"5",
               "unit":"%",
               "system":"http://unitsofmeasure.org",
               "code":"%"
            },
            "subject":{
               "reference":"Patient/hca-pat-32",
               "display":"Brittany Newman"
            }
         },
         "request":{
            "method": "PUT",
            "url": "Observation/ABCD12345"
         }
      }
   ]
}

I believe the reason why the original transaction did not work is that the current legacy SMART sandbox likely only supports "update" requests in a transaction bundle. Since it will get replaced soon enough by the HAPI-based sandbox, it's probably not worth investigating further than this. Once the switch happens, all the features and supported transactions in HAPI will become available. If anyone is interested in trying the bundle on the new (HAPI) sandbox, you can build a working stack from https://github.com/smart-on-fhir/installer

Hope this helps
Nikolai

Ye Wang

unread,
Dec 16, 2016, 10:06:45 AM12/16/16
to SMART on FHIR
Nikolai and Travis,

Thanks for taking care of this. We will make a version of our app ready for the new HAPI server. Let us know when the new server is ready.

Regards,

Ye
Reply all
Reply to author
Forward
0 new messages