Add "If-Match" Header Using Smart On FHIR Javascript Library

169 views
Skip to first unread message

IMO Dev Team

unread,
Apr 18, 2018, 4:42:32 PM4/18/18
to Cerner FHIR Developers
HI, I'm trying to update a condition(set the "verificationStatus" to "entered-in-error") using Smart On FHIR javascript library, it gives a "412 Precondition Failed" error which indicates that the "If-Match" header is missing, I can send the request successfully using a tool with the "If-Match" header in it.

The question is how do I add the header when I use the smart client library?

Here is some snippets of the code:
function DeleteCondition(id) {
let entries = conditions.data.entry;
let index = entries.findIndex(x => x.resource.id == id);
if (index >= 0) {
let condition = entries[index].resource;
condition.verificationStatus = "entered-in-error";
smart.api.update({ resource: condition }).done(function (r) {
console.log("problem deleted!");
});
}
}

Thanks!

--Steven Wu

Kol Kheang (Cerner)

unread,
Apr 20, 2018, 2:15:00 PM4/20/18
to Cerner FHIR Developers
Hi Steven,

Since this library is owned by SMART ON FHIR group, can you post your question to their group here?
They should be able to give you information on that.

Feel free to take a look at their repos and log issues:


Thanks,
Kol

Reply all
Reply to author
Forward
0 new messages