Creating SMART POST for a problem

12 views
Skip to first unread message

wc...@njit.edu

unread,
Apr 28, 2014, 11:05:01 AM4/28/14
to smart-app-...@googlegroups.com
Hi,

I'm working with a SMART Problems app, trying to create a way to populate problems via questionnaire.  I'm in early experimental phase and I created a problems view using SMART js client, but in order to see any problems,I must first put some  problems  in.  So I tried to create a SMART api call that would insert a problem:

            SMART.api_call({
                method: 'POST',
                url: "/records/" + SMART.record.id + "/problems/",
                data: {
                    startDate:             '![CDATA[2007-10-01]]',
                    endDate:             '![CDATA[2010-09-13]]',
                    name_title:         '![CDATA[Hypothyroidism]]',
                    name_system:         'http://purl.bioontology.org/ontology/SNOMEDCT/',
                    name_identifier:     '![CDATA[40930008]]' }
                },
                function(response) { alert('data received: ' + response.body); });

As far as I can tell this should be enough data to create a problem, but I may be missing something.  Executing this script ends with 'uncaught exception: error called for nonexistent message: 374997'

Please advise

Nikolai Schwertner

unread,
Apr 28, 2014, 11:15:32 AM4/28/14
to smart-app-...@googlegroups.com
Which SMART server are you working with? In general, the SMART standard does not define write API calls (with the exception of clinical notes, preferences, and scratchpad). Therefore such API implementations would be instance-specific. Also, foe the clinical notes API the POST data should be in SMART RDF format.

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

Nikolai Schwertner

unread,
Apr 28, 2014, 11:17:35 AM4/28/14
to smart-app-...@googlegroups.com
Which SMART server are you working with? In general, the SMART standard does not define write API calls (with the exception of clinical notes, preferences, and scratchpad). Therefore such API implementations would be instance-specific. Also, I would think that the POST data should be in SMART RDF format unless your SMART implementation defines an alternative REST API format.


-Nikolai

On 4/28/14 11:05 AM, wc...@njit.edu wrote:
Reply all
Reply to author
Forward
0 new messages