openui5-fhir
Advanced tools
Comparing version 1.1.7 to 2.0.0
@@ -0,1 +1,13 @@ | ||
# [2.0.0](https://github.com/SAP/openui5-fhir/compare/v1.1.7...v2.0.0) (2020-09-07) | ||
### Features | ||
* handle bundle response more comfortable ([#176](https://github.com/SAP/openui5-fhir/issues/176)) ([518a1f0](https://github.com/SAP/openui5-fhir/commit/518a1f06ba13df6541855b910f3e182665aa5c4e)) | ||
### BREAKING CHANGES | ||
* callback parameters of `FHIRModel.submitChanges` get enhanced in case of bundle requests. See https://sap.github.io/openui5-fhir/tutorial-4%20Request%20Handling.html. | ||
## [1.1.7](https://github.com/SAP/openui5-fhir/compare/v1.1.6...v1.1.7) (2020-09-04) | ||
@@ -2,0 +14,0 @@ |
{ | ||
"name": "openui5-fhir", | ||
"version": "1.1.7", | ||
"version": "2.0.0", | ||
"author": "SAP SE", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
@@ -11,3 +11,3 @@ sap.ui.define(function() { | ||
* @author SAP SE | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
* @public | ||
@@ -17,3 +17,3 @@ */ | ||
name : "sap.fhir", | ||
version : "1.1.7", | ||
version : "2.0.0", | ||
noLibraryCSS: true, | ||
@@ -20,0 +20,0 @@ dependencies : [ "sap.ui.core" ], |
@@ -34,3 +34,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
* | ||
@@ -37,0 +37,0 @@ * @see sap.fhir.model.r4.Context.create |
@@ -36,3 +36,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -39,0 +39,0 @@ var FHIRContextBinding = ContextBinding.extend("sap.fhir.model.r4.FHIRContextBinding", { |
@@ -21,3 +21,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -24,0 +24,0 @@ var FHIRFilterOperatorUtils = {}; |
@@ -25,3 +25,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -28,0 +28,0 @@ var FHIRFilterProcessor = {}; |
@@ -48,3 +48,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -51,0 +51,0 @@ var FHIRListBinding = ListBinding.extend("sap.fhir.model.r4.FHIRListBinding", { |
@@ -33,3 +33,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -36,0 +36,0 @@ var FHIRPropertyBinding = PropertyBinding.extend("sap.fhir.model.r4.FHIRPropertyBinding", { |
@@ -27,3 +27,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -30,0 +30,0 @@ var FHIRUtils = {}; |
@@ -31,3 +31,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -34,0 +34,0 @@ var BindingInfo = function(sResourceId, sResourceType, sResourcePath, sRelativePath, sAbsolutePath, aBinding, sGroupId, sRequestPath, aResourcePath, sResourceServerPath, sETag) { |
@@ -21,3 +21,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -24,0 +24,0 @@ var FHIRBundle = function(sBundleType, sGroupId) { |
@@ -23,3 +23,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -26,0 +26,0 @@ var FHIRBundleEntry = function(sFullUrl, oResource, oRequest) { |
@@ -31,3 +31,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -34,0 +34,0 @@ var FHIRBundleRequest = function(oBinding, sMethod, sUrl, fnSuccess, fnError, sIfMatch, sIfNoneMatch, sIfNoneExist, sIfModifiedSince) { |
@@ -20,5 +20,6 @@ /*! | ||
"sap/base/util/each", | ||
"sap/base/util/merge" | ||
"sap/base/util/merge", | ||
"sap/fhir/model/r4/lib/FHIROperationOutcome" | ||
], function(jQuery, FHIRUtils, SubmitMode, FHIRBundle, | ||
FHIRBundleEntry, FHIRBundleRequest, FHIRBundleType, RequestHandle, HTTPMethod, FHIRUrl, each, merge) { | ||
FHIRBundleEntry, FHIRBundleRequest, FHIRBundleType, RequestHandle, HTTPMethod, FHIRUrl, each, merge, FHIROperationOutcome) { | ||
"use strict"; | ||
@@ -39,3 +40,3 @@ | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -69,2 +70,4 @@ var FHIRRequestor = function(sServiceUrl, oModel, bCSRF, sPrefer, oDefaultQueryParams) { | ||
* @param {string} sGroupId The group id | ||
* @param {function} fnSuccessPromise The callback function which gets invoked once the submit is successful | ||
* @param {function} fnErrorPromise The callback function which gets invoked when the submit fails | ||
* @returns {sap.fhir.model.r4.lib.RequestHandle} oRequesthandle | ||
@@ -74,5 +77,5 @@ * @protected | ||
*/ | ||
FHIRRequestor.prototype.submitBundle = function(sGroupId) { | ||
FHIRRequestor.prototype.submitBundle = function (sGroupId, fnSuccessPromise, fnErrorPromise) { | ||
var oFHIRBundle = this._mBundleQueue[sGroupId]; | ||
return this._sendBundle(oFHIRBundle); | ||
return this._sendBundle(oFHIRBundle, fnSuccessPromise, fnErrorPromise); | ||
}; | ||
@@ -165,2 +168,4 @@ | ||
* @param {sap.fhir.model.r4.lib.FHIRBundle} oFHIRBundle The bundle to send | ||
* @param {function} fnSubmitSuccessBundle The callback function which gets invoked once the submit is successful | ||
* @param {function} fnSubmitErrorBundle The callback function which gets invoked when the submit fails | ||
* @returns {sap.fhir.model.r4.lib.RequestHandle} A request handle. | ||
@@ -170,4 +175,6 @@ * @private | ||
*/ | ||
FHIRRequestor.prototype._sendBundle = function(oFHIRBundle) { | ||
var fnSuccess = function(oGivenFHIRBundle, oRequestHandle) { | ||
FHIRRequestor.prototype._sendBundle = function(oFHIRBundle, fnSubmitSuccessBundle, fnSubmitErrorBundle) { | ||
var fnSuccess = function (oGivenFHIRBundle, oRequestHandle) { | ||
var aSuccessResource = []; | ||
var aOperationOutcome = []; | ||
this._deleteBundleFromQueue(oFHIRBundle.getGroupId()); | ||
@@ -178,10 +185,23 @@ for (var i = 0; i < oGivenFHIRBundle.getNumberOfBundleEntries(); i++) { | ||
if (oResponse && oResponse.response.status.startsWith("2")) { | ||
if (oResponse.resource) { | ||
aSuccessResource.push(oResponse.resource); | ||
} else if (oFHIRBundleEntry.getResource()) { | ||
aSuccessResource.push(oFHIRBundleEntry.getResource()); | ||
} | ||
oFHIRBundleEntry.getRequest().executeSuccessCallback(oRequestHandle, oResponse, oFHIRBundleEntry); | ||
} else { | ||
if (oResponse && oResponse.response.outcome) { | ||
aOperationOutcome.push(new FHIROperationOutcome(oResponse.response.outcome)); | ||
} | ||
oFHIRBundleEntry.getRequest().executeErrorCallback(oRequestHandle, oResponse, oFHIRBundleEntry); | ||
} | ||
} | ||
if (fnSubmitErrorBundle && aOperationOutcome.length > 0) { | ||
fnSubmitErrorBundle(oRequestHandle, aSuccessResource, aOperationOutcome); | ||
} else if (fnSubmitSuccessBundle) { | ||
fnSubmitSuccessBundle(aSuccessResource); | ||
} | ||
}.bind(this, oFHIRBundle); | ||
var fnError = function(oGivenFHIRBundle, oRequestHandle) { | ||
var fnError = function (oGivenFHIRBundle, oRequestHandle) { | ||
this._deleteBundleFromQueue(oFHIRBundle.getGroupId()); | ||
@@ -192,5 +212,8 @@ for (var i = 0; i < oGivenFHIRBundle.getNumberOfBundleEntries(); i++) { | ||
} | ||
if (fnSubmitErrorBundle) { | ||
fnSubmitErrorBundle(oRequestHandle); | ||
} | ||
}.bind(this, oFHIRBundle); | ||
var oRequestHandle = this._sendRequest(HTTPMethod.POST, "", {} , {}, oFHIRBundle.getBundleData(), fnSuccess, fnError); | ||
var oRequestHandle = this._sendRequest(HTTPMethod.POST, "", {}, {}, oFHIRBundle.getBundleData(), fnSuccess, fnError); | ||
oRequestHandle.setBundle(oFHIRBundle); | ||
@@ -197,0 +220,0 @@ return oRequestHandle; |
@@ -22,3 +22,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -25,0 +25,0 @@ var FHIRUrl = function(sUrl, sServiceUrl) { |
@@ -20,3 +20,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -23,0 +23,0 @@ var HTTPMethod = { |
@@ -22,3 +22,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -25,0 +25,0 @@ var RequestHandle = function(oBinding) { |
@@ -24,3 +24,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -27,0 +27,0 @@ var Sliceable = {}; |
@@ -20,3 +20,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -23,0 +23,0 @@ var OperationMode = { |
@@ -19,3 +19,3 @@ /*! | ||
* @since 1.0.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -22,0 +22,0 @@ var SubmitMode = { |
@@ -18,3 +18,3 @@ /*! | ||
* @since 1.1.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -21,0 +21,0 @@ |
@@ -15,3 +15,3 @@ /*! | ||
* @since 1.1.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -18,0 +18,0 @@ |
@@ -15,3 +15,3 @@ /*! | ||
* @since 1.1.0 | ||
* @version 1.1.7 | ||
* @version 2.0.0 | ||
*/ | ||
@@ -18,0 +18,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
325360
36
7481