Oracle® Healthcare Master Person Index Relationship Management REST APIs Reference Guide Release 4.0 E71322-01 |
|
|
PDF · Mobi · ePub |
The relationships resources contain the following APIs:
This API is used to retrieve a relationship by its ID.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/{id}
HTTP GET
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
Id | Matching the regex [a-zA-Z0-9]+ | Relationship id of the relationship to be retrieved |
expand | all | View more details of the relationship |
Parameter | Description |
---|---|
relationship | For more information on the relationship attributes in response, see Section A.2.7, "Relationship Response Structure". |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid Resource Id |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships /1?expand=all
{ "attributes": [ { "name": "Location", "relationship": { "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/1", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 1, "source": null, "status": null, "target": null, "type": null, "validity": null }, "relationshipAttributeId": 1, "value": "Bengaluru" } ], "createdBy": "rmAdmin", "createdDate": "2015-12-17 10:43:58", "effectiveDate": "2015-12-30 08:07:14", "expirationDate": "2025-12-30 08:07:14", "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/1", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": "rmAdmin", "modifiedDate": "2016-01-11 12:08:51", "relationshipId": 1, "source": { "attributes": [ { "entity": { "attributes": null, "entityId": 1, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/1", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "entityAttributeId": 1, "name": "FirstName", "value": "Dunna" } ], "entityId": 1, "id": "566022508Aaa", "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/1", "mediaType": "application/json", "rel": "canonical" } ], "status": "Active", "type": { "attributes": null, "description": null, "entityTypeId": 1, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" } }, "status": "Active", "target": { "attributes": [ { "entity": { "attributes": null, "entityId": 2, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/2", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "entityAttributeId": 9, "name": "Names.FirstName", "value": "Fedrik" } ], "entityId": 2, "id": "0000626069", "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/1", "mediaType": "application/json", "rel": "canonical" } ], "status": "Active", "type": { "attributes": null, "description": null, "entityTypeId": 2, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" } }, "type": { "attributes": [ { "attributeTypeId": 15, "defaultValue": null, "description": "Patient visit location", "indexed": "Y", "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of", "mediaType": "application/json", "rel": "canonical" } ], "mandatory": "Y", "maxValue": null, "minValue": null, "name": "Location", "readOnly": "N", "sizeValue": 70, "status": "Active", "type": "String" } ], "createdBy": "Admin", "createdDate": "2015-07-01 00:00:00", "description": "Patient-to-Individual Provider relationship type", "direction": "UNIDIRECTIONAL", "effectiveDate": "2015-07-10 00:00:00", "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" }, "expirationDate": "2020-07-10 00:00:00", "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": "Admin", "modifiedDate": "2015-07-10 00:00:00", "multiplicity": "ONETOMANY", "name": "patient-of", "relationshipTypeId": 7, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" }
200
This API is used to search relationships based on entityId.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/entities/{entityId}
HTTP GET
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
entityId | Matching the regex [a-zA-Z0-9]+ | EntityId of the entity whose relationships need to be retrieved. If the relationship direction is BIDIRECTIONAL, relationships matching the entity ID from source and target will be retrieved. For UNIDIRECTIONAL, relationships matching the entity ID only from the source will be retrieved. |
status | active or inactive | Status of the relationships to filter |
depth | - | Maximum length of the relationship path search. Currently, not in use. |
totalResults | true or false | View total records count |
expand | all | View more details of the relationship |
Parameter | Description |
---|---|
items | An array containing relationships |
relationship | For information on the relationship attributes in response, see Section A.2.7, "Relationship Response Structure". |
totalResults | Value is set to the total number of relationships based on the filter. The value is displayed if totalResults is set to true in the request parameter. Otherwise, the value is null. |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid Resource Id |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships /entities/1?totalResults=true
{ "items": [ { "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/4", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 4, "source": { "attributes": null, "entityId": 1, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/1", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 22, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/22", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": null, "createdBy": null, "createdDate": null, "description": null, "direction": null, "effectiveDate": null, "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" }, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "multiplicity": null, "name": "patient-of", "relationshipTypeId": 5, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" } ], "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/entities/1", "mediaType": "application/json", "rel": "canonical" } ], "totalResults": 1 }
200
This API is used to search relationships based on source or target entity type, entity ID, and relationship type.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/entities/{entity}
HTTP GET
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
entity | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Entity type name of entity whose relationships need to be retrieved |
id | Matching the regex [a-zA-Z0-9]+ | ID of the entity. It is mandatory and must be the EUID for the entity type. |
label | Matching the regex [a-zA-Z][a-zA-Z_0-9-]+ | Relationship type name whose relationships need to be retrieved |
status | active or inactive | Status of the relationships to filter |
depth | - | Maximum length of the relationship path search. Currently, not in use. |
totalResults | true or false | View total records count |
expand | all | View more details of the relationship |
Parameter | Description |
---|---|
items | An array containing relationships |
relationship | For information on the relationship attributes in response, see Section A.2.7, "Relationship Response Structure". |
totalResults | Value is set to the total number of relationships based on filter. The value is displayed if totalResults is set to true in the request parameter. Otherwise, the value is null. |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid Resource Name |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships /entities/Patient
{ "items": [ { "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/4", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 4, "source": { "attributes": null, "entityId": 1, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/1", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 22, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/22", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": null, "createdBy": null, "createdDate": null, "description": null, "direction": null, "effectiveDate": null, "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" }, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "multiplicity": null, "name": "patient-of", "relationshipTypeId": 5, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" } ], "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "totalResults": 1 }
200
This API is used to search relationships from the source or the target.
Difference between the POST /resources/relationships/{entity} API and the GET /resources/relationships/entities/{entity} API is that you can search by multiple entity attributes by passing them in the body of the REST API. Search in the body is done as:
If entityId is passed in the body, it will be used for search. All other content will be ignored.
If entityId is not passed but id is passed, it will be used for search. All other content will be ignored.
If entityId or id is not passed, then the search will be done based on the attributes passed in the request body.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/{entity}
application/json
HTTP POST
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
entity | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Entity type name of entity whose relationships need to be retrieved |
label | Matching the regex [a-zA-Z][a-zA-Z_0-9-]+ | Relationship type name whose relationships need to be retrieved |
status | active or inactive | Status of the relationships to filter |
depth | - | Maximum length of the relationship path search. Currently, not in use. |
totalResults | true or false | View total records count |
expand | all | View more details of the relationship |
entityResource | - | More details of the entity whose relationships need to be retrieved. For details on the fields for the entity request body, see Section A.1.6, "Entity Resource". |
Parameter | Description |
---|---|
items | An array containing relationships |
relationship | For information on the relationship attributes in response, see Section A.2.7, "Relationship Response Structure". |
totalResults | Value is set to the total number of relationships based on filter. The value is displayed if totalResults is set to true in the request parameter. Otherwise, the value is null. |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid Resource Name |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships/entities/Patient?totalResults=true
{ "entityId": "1" }
OR
{ "id": "0000000003" }
OR
{ "attributes":[ { "name":"FirstName", "value":"Mark" } ] }
{ "items": [ { "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/4", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 4, "source": { "attributes": null, "entityId": 1, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/1", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 22, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/22", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": null, "createdBy": null, "createdDate": null, "description": null, "direction": null, "effectiveDate": null, "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" }, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "multiplicity": null, "name": "patient-of", "relationshipTypeId": 5, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" } ], "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/Patient", "mediaType": "application/json", "rel": "canonical" } ], "totalResults": 1 }
200
This API is used to search relationships by using date attribute ranges and other criteria.
If relationship.management.text.index is set as true in the ohmpi_rm.properties file, then the attribute field can only be createdDate, modifiedDate, expirationDate or effectiveDate.
If relationship.management.text.index is set as false in the ohmpi_rm.properties file, then the attribute field can have custom date attributes as well as the one of the following: createdDate, modifiedDate, expirationDate or effectiveDate.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/{name}/{attribute}
application/json
HTTP POST
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
name | Matching the regex [a-zA-Z][a-zA-Z_0-9-]+ | Relationship type name of relationships to be retrieved |
attribute | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Attribute name of the relationship type to be searched using range search. It must be of type Date. |
since | Should be in the format yyyy-MM-dd | Start date from which attribute must be searched. It is a mandatory parameter. |
until | Should be in the format yyyy-MM-dd | End date till which attribute must be searched. Default is today's date. |
status | active, inactive, or all | Status of relationships to filter |
orderBy | Format: fieldname|sortOrder where, fieldname can be relationshipId, sourceId, targetId, createdBy, createdDate, modifiedBy, modifiedDate, expirationDate, effectiveDate, validity, or status; sortOrder can be asc or desc | Order by built-in attribute name. Default is the order by relationshipId in ascending order. |
limit | Any positive integer | Maximum number of results to return in the REST API response. Default value is 1000. |
offset | Any positive integer | Offset from which the results should be provided in the response. Default value is 1. |
totalResults | true or false | View total records count |
expand | all | View more details of the relationships |
relationshipResource | - | Details of the relationships to be searched. For information on the fields for the relationship request body, see Section A.1.8, "Relationship Resource". |
Parameter | Description |
---|---|
items | An array containing relationships |
relationship | For information on the relationship attributes in response, see Section A.2.7, "Relationship Response Structure". |
totalResults | Value is set to the total number of relationships based on the filter. It might be greater than the number of results displayed in the REST API response, based on the offset and limit values. The value is displayed if totalResults is set to true in the request parameter. Otherwise, the value is null. |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid Resource Name |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships/spouse-of/createdDate?since=2016-01-15&limit=1&offset=10
{ "attributes":[ { "name":"DateOfMarriage", "value":"03/17/1988" } ] }
{ "items": [ { "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/26", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 26, "source": { "attributes": null, "entityId": 6, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/6", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 8, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/8", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": null, "createdBy": null, "createdDate": null, "description": null, "direction": null, "effectiveDate": null, "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/spouse-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "multiplicity": null, "name": "spouse-of", "relationshipTypeId": 7, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" } ], "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/spouse-of/createdDate", "mediaType": "application/json", "rel": "canonical" } ], "totalResults": null }
200
This API is used to create a relationship by using source entity type, target entity type and relationship type.
Either entityId or id needs to be passed for the source and target entities in the request body.
If entityId is passed in the body, no new entity is created even if an entity with the entityId does not exist. If id is passed (along with or without other attributes) and the entity does not exist for the id, a new active entity is created based on the attributes passed in the body.
For creating a relationship, the relationship type name passed in the REST API is verified and the task id is found. If the task id is provided, corresponding task's groovy script is executed. If the task id is not provided, Default Relationship Update policy is used.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/{name}/{source}/{target}
application/json
HTTP POST
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
name | Matching the regex [a-zA-Z][a-zA-Z_0-9-]+ | Relationship type name of relationship to be created |
source | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Source Entity Type name |
target | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Target Entity Type name |
relationshipResource | - | Details of the source and target entities and the relationship to be created. For details on the fields for the relationship request body, see Section A.1.8, "Relationship Resource". |
Parameter | Description |
---|---|
relationship | For information on the relationship attributes in response, see Section A.2.7, "Relationship Response Structure". To display all the attributes of the relationship type, use the GET /resources/relationships/{id} API with expand=all. |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid Resource Name |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships/patient-of/Patient/IndProvider
{ "source":{ "id": "200000002", "type": { "name": "IndProvider" }, "attributes": [ { "name": "FirstName", "value": "Harry" } ] }, "target": { "id": "0000001000", "type": { "name": "Patient" } }, "effectiveDate": "2016-01-14", "expirationDate": "2026-01-14", "type": { "name": "patient-of" }, "attributes": [ { "name": "Location", "value": "United States" } ] }
{ "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/41", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 41, "source": { "attributes": null, "entityId": 81, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/81", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 21, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/21", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": null, "createdBy": null, "createdDate": null, "description": null, "direction": null, "effectiveDate": null, "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/doctor-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "multiplicity": null, "name": "doctor-of", "relationshipTypeId": 21, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" }
200
This API is used to create a relationship from a single source or target entity by using the configured inferring rules.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/entities/{entity}
application/json
HTTP POST
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
entity | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Entity type name of the entity for which relationship is to be created |
entityResource | - | Details of the entity whose relationship needs to be created. For details on the fields for the entity request body, see Section A.1.6, "Entity Resource". |
Parameter | Description |
---|---|
relationship | For information on the relationship attributes in response, see Section A.2.7, "Relationship Response Structure". To display all the attributes of the relationship type, use the GET /resources/relationships/{id} API with expand=all. |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid Resource Name |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships/entities/Patient
Assuming that you want to create a relationship of type primary-care-physician-of, the source entity type of the relationship type is Patient, and the target entity type is IndProvider. Also, an IndProvider entity having ID 0000000013 exists in system. Perform the following steps for the initial setup:
Create a ruleset with source as Patient and target as IndProvider.
Create a ruleset file for the ruleset and upload it using REST APIs or UI.
For sample purpose, consider the ruleset with name primary-care-physician-creation and ruleset file defined in Section A.4.1, "Sample Ruleset File 1".
Create a task with the same name as defined in the ruleset file.
Create a groovy script for the task and upload it using REST APIs or UI.
For sample purpose, consider the task with name PrimaryCarePhysicianCreationTask and the task groovy script defined in Section A.4.4, "Sample Task File 1".
Invoke the API using the following sample request body.
{ "id":"PA1301309", "attributes": [ { "name":"FirstName", "value":"John" }, { "name":"LastName", "value":"D" }, { "name":"Gender", "value":"M" }, { "name":"City", "value":"CA" }, { "name":"Provider.ID", "value":"0000000013" } }
{ "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/121", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 121, "source": { "attributes": null, "entityId": 22, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/22", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 201, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/201", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": null, "createdBy": null, "createdDate": null, "description": null, "direction": null, "effectiveDate": null, "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/primary-care-physician-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "multiplicity": null, "name": "primary-care-physician-of", "relationshipTypeId": 1, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" }
200
This API is used to create relationships between the source entity and the target entity by using the configured inferring rules.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/entities/{source}/{target}
application/json
HTTP POST
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
source | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Source entity type name of the entity for which relationship is to be created |
target | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Target entity type name of the entity for which relationship is to be created |
entityResources | - | Details of the source and target entities whose relationship needs to be created. For details on the fields for the entity request body, see Section A.1.7, "Entity Resources". |
Parameter | Description |
---|---|
relationship | For information on the relationship attributes in response, see Section A.2.7, "Relationship Response Structure". To display all the attributes of the relationship type, use the GET /resources/relationships/{id} API with expand=all. |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid Resource Name |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships/entities/Patient/IndProvider
Assuming that you want to create a relationship of type patient-of, the source entity type of the relationship type is Patient, and the target entity type is IndProvider. Perform the following steps for the initial setup:
Create a ruleset with source as Patient and target as IndProvider.
Create a ruleset file for the ruleset and upload it using REST APIs or UI.
For sample purpose, consider the ruleset with name CreatePatientOfSampleRuleset and ruleset file defined in Section A.4.2, "Sample Ruleset File 2".
Create a task with the same name as defined in the ruleset file.
Create a groovy script for the task and upload it using REST APIs or UI.
For sample purpose, consider the task with name CreatePatientOfSampleTask and the task groovy script defined in Section A.4.5, "Sample Task File 2".
Invoke the API using the following sample request body.
{ "items" : [ { "id":"PA130", "attributes": [ { "name":"FirstName", "value":"John" }, { "name":"LastName", "value":"D" }, { "name":"Gender", "value":"M" }, { "name":"City", "value":"CA" }, { "name":"Provider.ID", "value":"0000000013" }, { "name" : "Doctor", "value" : "Dr." } ] }, { "id":"DA123", "attributes": [ { "name":"FirstName", "value":"John" }, { "name":"LastName", "value":"D" }, { "name":"Gender", "value":"M" }, { "name":"License", "value":"CA" }, { "name":"Specialty", "value":"EAR" } ] } ] }
{ "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/142", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 142, "source": { "attributes": null, "entityId": 264, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/264", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 265, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/265", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": null, "createdBy": null, "createdDate": null, "description": null, "direction": null, "effectiveDate": null, "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" }, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "multiplicity": null, "name": "patient-of", "relationshipTypeId": 5, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" }
200
This API is used to update relationship by its ID.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/{id}
application/json
HTTP PUT
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
id | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Relationship id of the relationship to be updated. |
status | active or inactive | To activate or deactivate the relationship. When status is passed, the body (relationshipResource) details will be ignored. But the body needs to be passed as {} (open curly brace and closed curly brace). |
relationshipResource | - | Details of the relationship to be updated. This will be considered for updating the relationship if the status parameter is not set to any value. For details on the fields for the relationship request body, see Section A.1.8, "Relationship Resource". |
Parameter | Description |
---|---|
relationship | For information on the relationship type attributes in response, see Section A.2.7, "Relationship Response Structure". To display all the attributes of the relationship type, use theGET /resources/relationships/{id} API with expand=all. |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid resource id |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships/1?status=active
{}
{ "attributes": null, "createdBy": "ohmpi", "createdDate": "2016-01-14 15:03:20", "effectiveDate": "2016-01-14 15:03:19", "expirationDate": "2026-01-14 15:03:19", "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/1", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": "ohmpi", "modifiedDate": "2016-01-14 15:03:20", "relationshipId": 1, "source": { "attributes": null, "entityId": 21, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/21", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 22, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/22", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": null, "createdBy": "ohmpi", "createdDate": "2016-01-14 14:45:49", "description": null, "direction": "BIDIRECTIONAL", "effectiveDate": "2016-01-14 14:45:49", "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "expirationDate": "2026-01-14 14:45:49", "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": "ohmpi", "modifiedDate": "2016-01-14 14:45:49", "multiplicity": "MANYTOMANY", "name": "patient-of", "relationshipTypeId": 1, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" }
200
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships/41
{ "expirationDate":"2030-01-14 00:00:00", "attributes": [ { "name": "Location", "value": "California" } ] }
{ "attributes": [ { "name": "Location", "relationship": { "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/41", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 41, "source": null, "status": null, "target": null, "type": null, "validity": null }, "relationshipAttributeId": 1, "value": "California" } ], "createdBy": "ohmpi", "createdDate": "2016-01-18 13:31:18", "effectiveDate": "2016-01-18 13:31:17", "expirationDate": "2030-01-14 00:00:00", "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/41", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": "ohmpi", "modifiedDate": "2016-01-18 14:20:04", "relationshipId": 41, "source": { "attributes": null, "entityId": 81, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/81", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 21, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/21", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": [ { "attributeTypeId": 42, "defaultValue": null, "description": null, "indexed": "Y", "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/doctor-of", "mediaType": "application/json", "rel": "canonical" } ], "mandatory": "N", "maxValue": null, "minValue": null, "name": "Location", "readOnly": "N", "sizeValue": 40, "status": "Active", "type": "String" } ], "createdBy": "ohmpi", "createdDate": "2016-01-18 13:28:17", "description": "doctor of relationship", "direction": "BIDIRECTIONAL", "effectiveDate": "2016-01-18 13:28:17", "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "expirationDate": "2026-01-18 13:28:17", "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/doctor-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": "ohmpi", "modifiedDate": "2016-01-18 13:28:17", "multiplicity": "MANYTOMANY", "name": "doctor-of", "relationshipTypeId": 21, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" }
200
This API is used to synchronize the relationships with ADD, UPD, MRG, UMRG, DEA, and REA events.
http(s)://<server>:<port>/ohmpi-rm/1.0.0/resources/relationships/entities/{name}
application/json
HTTP PUT
application/json;charset=UTF-8
Parameter | Value | Description |
---|---|---|
name | Matching the regex [a-zA-Z][a-zA-Z_0-9]+ | Name of the entity type to be synchronized from RM Agent |
event | ADD, UPD, MRG, UMRG, DEA, or REA | Event type to be used for synchronization |
totalResults | true or false | View total records count |
expand | all | View more details of the relationships |
entityResources | - | Details of the entities that need to be synchronized. At least one entity must be passed and will be considered as the source entity. If second entity is passed, it will be considered as the target entity. For details on the fields for the entity request body, see Section A.1.7, "Entity Resources". |
Parameter | Description |
---|---|
items | An array containing relationships |
relationship | For information on the relationship attributes in response, see Section A.2.7, "Relationship Response Structure". |
totalResults | Value is set to the total number of relationships based on the filter. The value is displayed if totalResults is set to true in the request parameter. Otherwise, the value is null. |
Status Code | Description |
---|---|
200 | Success |
404 | Incorrect URI |
400 | Invalid argument/Invalid resource name |
500 | Error while processing |
http://localhost:7001/ohmpi-rm/1.0.0/resources/relationships/entities/Patient?event=ADD
Assuming that you want to create a relationship of type primary-care-physician-of, the source entity type of the relationship type is Patient, and the target entity type is IndProvider. Also, an IndProvider entity having ID CA786 exists in the RM database. Perform the following steps for the initial setup:
Create a domain with the name Patient using REST APIs or UI.
Create a ruleset with source as Patient and target as IndProvider.
Create a ruleset file for the ruleset and upload it using REST APIs or UI.
For sample purpose, consider the ruleset with name primary-care-physician-creation and ruleset file defined in Section A.4.1, "Sample Ruleset File 1".
Create a task with the same name as defined in the ruleset file.
Create a groovy script for the task and upload it using REST APIs or UI.
For sample purpose, consider the task with name PrimaryCarePhysicianCreationTask and the task groovy script defined in Section A.4.4, "Sample Task File 1".
Generate a wallet file and deploy the MPI Agent for the Patient MPI application. For information, see Oracle Healthcare Master Person Index Relationship Management User's Guide.
Create a new Patient in the MPI database, either using MIDM or MPI SOAP APIs.
Invoke the RM API using the following sample request body.
{ "items": [ { "id":"CA1002", "attributes": [ { "name":"FirstName", "value":"David" }, { "name":"LastName", "value":"K" }, { "name":"Gender", "value":"M" }, { "name":"City", "value":"CA" }, { "name":"Provider.ID", "value":"CA786" } ] } ] }
{ "items": [ { "attributes": null, "createdBy": null, "createdDate": null, "effectiveDate": null, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/122", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "relationshipId": 122, "source": { "attributes": null, "entityId": 203, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/203", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "status": "Active", "target": { "attributes": null, "entityId": 206, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/resources/entities/206", "mediaType": "application/json", "rel": "canonical" } ], "status": null, "type": null }, "type": { "attributes": null, "createdBy": null, "createdDate": null, "description": null, "direction": null, "effectiveDate": null, "end": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "name": "Patient", "status": "Active" }, "expirationDate": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/relationships/primary-care-physician-of", "mediaType": "application/json", "rel": "canonical" } ], "modifiedBy": null, "modifiedDate": null, "multiplicity": null, "name": "primary-care-physician-of", "relationshipTypeId": 1, "start": { "attributes": null, "description": null, "entityTypeId": null, "id": null, "links": [ { "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider", "mediaType": "application/json", "rel": "canonical" } ], "name": "IndProvider", "status": "Active" }, "status": "Active", "task": null }, "validity": "Resolved" } ], "links": [ { "href": "/ohmpi-rm/1.0.0/resources/relationships/entities/Patient", "mediaType": "application/json", "rel": "canonical" } ], "totalResults": null }
200