Constructor
new FHIRModel(sServiceUrl, mParameters)
Constructor for a new FHIRModel. Model implementation for FHIR R4.
- Version:
- 2.4.0
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sServiceUrl |
string
|
The root URL of the FHIR server to request data from e.g. http://example.com/fhir |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
mParameters |
object
|
The parameters
|
Throws:
-
If no service URL is given, if the given service URL does not end with a forward slash
- Type
-
Error
Methods
bindContext(sPath, oContextopt, mParametersopt) → {sap.fhir.model.r4.FHIRContextBinding}
Creates a new context binding for the given sPath
, oContext
and mParameters
- Since:
- 1.0.0
- Source:
- See:
-
- sap.ui.model.Model#bindContext
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sPath |
string
|
The binding path in the model |
|
oContext |
sap.fhir.model.r4.Context
|
<optional> |
The context which is required as base for a relative path |
mParameters |
object
|
<optional> |
Map of binding parameters Note: Currently no FHIR specific binding parameters are used |
bindList(sPath, oContextopt, aSortersopt, aFiltersopt, mParametersopt) → {sap.fhir.model.r4.FHIRListBinding}
Creates a new list binding for the given sPath
and optional oContext
- Since:
- 1.0.0
- Source:
- See:
-
- sap.ui.model.Model#bindList
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
sPath |
string
|
The binding path in the model |
|||||||||||||
oContext |
sap.fhir.model.r4.Context
|
<optional> |
The context which is required as base for a relative path |
||||||||||||
aSorters |
Array.<sap.ui.model.Sorter>
|
<optional> |
The sorters to be used initially |
||||||||||||
aFilters |
Array.<sap.ui.model.Filter>
|
<optional> |
The filters to be used initially |
||||||||||||
mParameters |
object
|
<optional> |
Map of binding parameters which can be FHIR specific parameters or binding-specific parameters as specified below.
|
Throws:
-
if an unsupported operation mode is used
- Type
-
Error
bindProperty(sPath, oContextopt, mParametersopt) → {sap.fhir.model.r4.FHIRPropertyBinding}
Creates a new property binding for the given sPath
- Since:
- 1.0.0
- Source:
- See:
-
- sap.ui.model.Model#bindProperty
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sPath |
string
|
The binding path in the model |
|
oContext |
sap.fhir.model.r4.Context
|
<optional> |
The context which is required as base for a relative path |
mParameters |
object
|
<optional> |
Map of binding parameters Note: Currently no FHIR specific binding parameters are used |
bindTree(sPath, oContextopt, aFiltersopt, mParametersopt, aSortersopt) → {sap.fhir.model.r4.FHIRTreeBinding}
Creates a new tree binding for the given sPath
and optional oContext
- Since:
- 1.0.0
- Source:
- See:
-
- sap.ui.model.Model#bindTree
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sPath |
string
|
The binding path in the model |
|
oContext |
sap.fhir.model.r4.Context
|
<optional> |
The context which is required as base for a relative path |
aFilters |
Array.<sap.ui.model.Filter>
|
<optional> |
The filters to be used initially |
mParameters |
object
|
<optional> |
Map of binding parameters which can be FHIR specific parameters |
aSorters |
Array.<sap.ui.model.Sorter>
|
<optional> |
The sorters to be used initially |
Throws:
-
if an unsupported operation mode is used
- Type
-
Error
create(sResourceType, oDataopt, sGroupIdopt) → {string}
Creates a new resource based on the given sResourceType
with given oData
. Note: The resource will be created only on the client side, to push the created resource
to the server sap.fhir.model.r4.FHIRModel#submitChanges has to be called afterwards
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sResourceType |
string
|
The resource type |
|
oData |
object
|
<optional> |
The data of the resource |
sGroupId |
string
|
<optional> |
The group where the resource should belongs to |
Returns:
- Type:
-
string
The uuidv4 of the created resource
destroy()
Destroys this model
- Since:
- 1.0.0
- Source:
- See:
-
- sap.ui.model.Model#destroy
getBaseProfileUrl() → {string}
Determines the URL of the base profiles for all resource types
- Since:
- 1.0.0
- Source:
Returns:
- Type:
-
string
The base profile URL
getNextLink(sNextLinkUrl, sPath, mParameters) → {sap.fhir.model.r4.NextLink}
Determines the next link url should be used
This method might be overridden by the application to provide a customized next link processing because FHIR did not offer a standardized link structure.
- Since:
- 2.3.2
- Source:
Parameters:
Name | Type | Description |
---|---|---|
sNextLinkUrl |
string
|
The next link url |
sPath |
string
|
The FHIR resource path |
mParameters |
sap.fhir.model.r4.FHIRListBinding.Parameter
|
sap.fhir.model.r4.FHIRTreeBinding.Parameter
|
Existing parameters |
getProperty(sPathopt, oContextopt, oDataExtopt) → {object}
Determines the value for the property in the model based on the given sPath
and oContext
and oDataExt
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sPath |
string
|
<optional> |
The path to the desired property |
oContext |
sap.fhir.model.r4.Context
|
<optional> |
The binding context |
oDataExt |
object
|
<optional> |
The data object containing the desired property |
Returns:
- Type:
-
object
the value behind the path
getServiceUrl() → {string}
Determines the root URL of the FHIR server
- Since:
- 1.0.0
- Source:
Returns:
- Type:
-
string
The service URL
hasResourceTypePendingChanges(sResourceType) → {boolean}
Determines if there are any pending changes for the given sResourceType
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Description |
---|---|---|
sResourceType |
string
|
The FHIR resource type |
Returns:
- Type:
-
boolean
true there are changes for the given resource type.
readLatestVersionOfResource(sPath, fnSuccessopt)
Triggers a HEAD
request to the FHIR server that was specified in the model constructor. If HEAD isn't available it sends a GET request and updates the resource data in the model implicitly
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sPath |
string
|
A string containing the path to the resource which should be requested. |
|
fnSuccess |
function
|
<optional> |
The callback function which is executed after the version read was successfully |
refresh()
Refreshes the model and all associated bindings
- Since:
- 1.0.0
- Source:
- See:
remove(aResources, fnPreProcessopt, sGroupIdopt)
Mark resources for the DELETE request which have to be submitted to the server with the submitChanges() method or delete client changes
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
aResources |
Array.<string>
|
the resources which shall be deleted, e.g. ["/Patient/123", "/Organization/XYZ"] |
|
fnPreProcess |
function
|
<optional> |
to preprocess the objects of the given aResources |
sGroupId |
string
|
<optional> |
The group where the resource should belongs to |
resetChanges(sGroupIdopt, bAvoidUpdateopt)
Resets the model to the state when the model was synchronized with the server for the last time. Resetting means newly created resources are removed and changed resources are rolled backed to the earlier state.
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sGroupId |
string
|
<optional> |
The groupId which identifies the changes of a specific group |
bAvoidUpdate |
boolean
|
<optional> |
If true then checkupdate() won't be called, because it will anyway get called in furthers steps |
sendGetRequest(sPath, mParametersopt) → {sap.fhir.model.r4.lib.RequestHandle}
Triggers a GET
request to the FHIR server that was specified in the model constructor. The data will be stored in the model
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sPath |
string
|
A string containing the path to the data which should be retrieved. The path is concatenated to the service URL which was specified in the model constructor. |
|
mParameters |
sap.fhir.model.r4.RequestParameters
|
<optional> |
The additional request parameters |
sendPostRequest(sPath, oPayloadopt, mParametersopt) → {sap.fhir.model.r4.lib.RequestHandle}
Triggers a POST
request to the FHIR server that was specified in the model constructor. The data will be stored in the model
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sPath |
string
|
A string containing the path to the data which should be retrieved. The path is concatenated to the service URL which was specified in the model constructor. |
|
oPayload |
object
|
<optional> |
The request body |
mParameters |
sap.fhir.model.r4.RequestParameters
|
<optional> |
The additional request parameters |
setProperty(sPath, vValue, oContextopt, oBinding)
Sets a new value for the property on the the given sPath
in the model
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sPath |
string
|
The path of the property to set |
|
vValue |
any
|
The value to set the property to |
|
oContext |
sap.fhir.model.r4.Context
|
<optional> |
The context which will be used to set the property |
oBinding |
sap.fhir.model.r4.PropertyBinding
|
That the checkupdate method doesn't run in not associated bindings less round trips |
submitChanges(sGroupIdopt, fnSuccessCallbackopt, fnErrorCallbackopt) → {object}
Submits the client changes of the model to the FHIR service
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sGroupId |
string
|
<optional> |
The group id to submit only a specific group, leave empty when all changes should be submitted |
fnSuccessCallback |
function
|
<optional> |
The callback function which is executed with specific parameters after the changes are send successfully to the server |
fnErrorCallback |
function
|
<optional> |
The callback function which is executed with specific parameters when the transport to the server failed |
Returns:
- Type:
-
object
mRequestHandles contains all request groups and direct requests which where submitted, e.g. {"patientDetails": oFHIRBundle1, "direct": [oRequestHandle1, oRequestHandle2], "patientList": oFHIRBundle2}, if there are no changes undefined is returned
Events
requestCompleted
Fired, when a request is completed
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
oEvent |
sap.ui.base.Event
|
|
requestFailed
Fired, when a request failed
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
oEvent |
sap.ui.base.Event
|
|
requestSent
Fired, when a request was sent to the FHIR Server
- Since:
- 1.0.0
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
oEvent |
sap.ui.base.Event
|
|