Skip Headers
Oracle® Healthcare Master Person Index Relationship Management REST APIs Reference Guide
Release 4.0

E71322-01
Go to Table of Contents
Contents
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
PDF · Mobi · ePub

2 Metadata Resources

The metadata resources contain the following APIs:

2.1 GET /metadata

This API is used to get metadata REST API versioning information and user roles.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata

Request Type

HTTP GET

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
roles true or false Option for including user ID and user roles in the response. The default option is false. If the option is not given, the default option is used.

Response Parameters

Parameter Description
version OHMPI-RM version number
description The description of metadata resources
url The URL of this REST API
roles When the request roles' parameter is set to true, the highest role of the logged-in user is displayed.
userId The logged-in user ID

Response Status Code

Status Code Description
200 Success
404 Incorrect URI

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata?roles=true

Sample Response Body

{
 "version": "1.0.0",
 "description": "OHMPI RM Entity and Relationship Metadata Resources",
 "url": "http://localhost:7001/ohmpi-rm/1.0.0/metadata?roles=true",
 "roles": "RmAdministrator",
 "userId": "rm1"
}

Sample Response Code

200

2.2 GET /metadata/entities

This API is used to retrieve the list of entity types.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/entities

Request Type

HTTP GET

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
status all, inactive, or active Filter entity types based on the status.
expand all View more details of the entity type. If expand is not passed, API sends compacted information in response.
totalResults true or false View total records count.

Response Parameters

Parameter Description
items An array containing entity types.
entity type For information on the entity type attributes in response, see Section A.2.1, "Entity Type Response Structure".
totalResults Value is set to the total number of entity types based on status filter. The value is displayed if totalResults is set to true in the request parameter. Otherwise, the value is null.

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument
500 Error while processing

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/entities?status=Active&expand=all&totalResults=true

Sample Response Body

{
  "items": [
  {
    "attributes": [
    {
      "attributeTypeId": 6,
      "defaultValue": null,
      "description": "First Name",
      "indexed": "Y",
      "links": [
      {
        "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
        "mediaType": "application/json",
        "rel": "canonical"
      }
    ],
    "mandatory": "N",
    "maxValue": null,
    "minValue": null,
    "name": "FirstName",
    "readOnly": "N",
    "sizeValue": 15,
    "status": "Active",
    "type": "String"
  },
  {
    "attributeTypeId": 7,
    "defaultValue": null,
    "description": "Last Name",
    "indexed": "Y",
    "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
      "mediaType": "application/json",
      "rel": "canonical"
    }
    ],
    "mandatory": "N",
    "maxValue": null,
    "minValue": null,
    "name": "LastName",
    "readOnly": "N",
    "sizeValue": 20,
    "status": "Active",
    "type": "String"
  },
  {
    "attributeTypeId": 8,
    "defaultValue": null,
    "description": "Gender",
    "indexed": "Y",
    "links": [
      {
        "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
        "mediaType": "application/json",
        "rel": "canonical"
      }
    ],
    "mandatory": "N",
    "maxValue": null,
    minValue": null,
    "name": "Gender",
    "readOnly": "N",
    "sizeValue": 10,
    "status": "Active",
    "type": "String"
  },
  {
    "attributeTypeId": 9,
    "defaultValue": null,
    "description": "Specialty",
    "indexed": "Y",
    "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "mandatory": "N",
  "maxValue": null,
  "minValue": null,
  "name": "Specialty",
  "readOnly": "N",
  "sizeValue": 25,
  "status": "Active",
  "type": "String"
},
{
  "attributeTypeId": 10,
  "defaultValue": null,
  "description": "Specialty License",
  "indexed": "Y",
  "links": [
  {
    "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
    "mediaType": "application/json",
    "rel": "canonical"
  }
 ],
 "mandatory": "N",
 "maxValue": null,
 "minValue": null,
 "name": "License",
 "readOnly": "N",
 "sizeValue": 15,
 "status": "Active",
 "type": "String"
}
],
"description": "IndProvider Entity Type",
"entityTypeId": 2,
"id": "EUID",
"links": [
{
  "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
  "mediaType": "application/json",
  "rel": "canonical"
 }
 ],
 "name": "IndProvider",
 "status": "Active"
},
{
  "attributes": [
    {
      "attributeTypeId": 1,
      "defaultValue": null,
      "description": "First Name",
      "indexed": "Y",
      "links": [
      {
        "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
        "mediaType": "application/json",
        "rel": "canonical"
      }
    ],
    "mandatory": "N",
    "maxValue": null,
    "minValue": null,
    "name": "FirstName",
    "readOnly": "N",
    "sizeValue": 15,
    "status": "Active",
    "type": "String"
  },
{
  "attributeTypeId": 2,
  "defaultValue": null,
  "description": "Last Name",
  "indexed": "Y",
  "links": [
  {
    "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
    "mediaType": "application/json",
    rel": "canonical"
  }
 ],
 "mandatory": "N",
 "maxValue": null,
 "minValue": null,
 "name": "LastName",
 "readOnly": "N",
 "sizeValue": 20,
 "status": "Active",
 "type": "String"
},
{
  "attributeTypeId": 3,
  "defaultValue": null,
  "description": "Gender",
  "indexed": "Y",
  "links": [
  {
    "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
    "mediaType": "application/json",
    "rel": "canonical"
  }
 ],
 "mandatory": "N",
 "maxValue": null,
 "minValue": null,
 "name": "Gender",
 "readOnly": "N",
 "sizeValue": 10,
 "status": "Active",
 "type": "String"
},
{
  "attributeTypeId": 4,
  "defaultValue": null,
  "description": "City of Residence",
  "indexed": "Y",
  "links": [
  {
    "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
    "mediaType": "application/json",
    "rel": "canonical"
  }
 ],
 "mandatory": "N",
 "maxValue": null,
 "minValue": null,
 "name": "City",
 "readOnly": "N",
 "sizeValue": 20,
 "status": "Active",
 "type": "String"
},
{
  "attributeTypeId": 5,
  "defaultValue": null,
  "description": "License of PCP",
  "indexed": "Y",
  "links": [
  {
    "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
    "mediaType": "application/json",
    "rel": "canonical"
   }
 ],
 "mandatory": "N",
 "maxValue": null,
 "minValue": null,
 "name": "Doctor",
 "readOnly": "N",
 "sizeValue": 15,
 "status": "Active",
 "type": "String"
}
],
"description": "USPatient Entity Type",
"entityTypeId": 1,
"id": "EUID",
"links": [
{
    "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
    "mediaType": "application/json",
    "rel": "canonical"
   }
  ],
 "name": "USPatient",
 "status": "Active"
 }
],
"links": [
  {
    "href": "/ohmpi-rm/1.0.0/metadata/entities",
    "mediaType": "application/json",
    "rel": "canonical"
   }
  ],
  "totalResults": 2
}

Sample Response Code

200

2.3 GET /metadata/entities/{name}

This API is used to retrieve the details of an existing entity type.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/entities/{name}

Request Type

HTTP GET

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
name Matching the regex [a-zA-Z][a-zA-Z_0-9]+ Name of the entity type to be searched.
expand all View more details of the entity type. If expand is not passed, API sends compacted information in response.

Response Parameters

Parameter Description
entity type For information on the entity type attributes in response, see Section A.2.1, "Entity Type Response Structure".

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument/Resource Not Exists
500 Error while processing

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/entities/IndProvider?expand=all

Sample Response Body

{
  "attributes": [
    {
      "attributeTypeId": 6,
      "defaultValue": null,
      "description": "First Name",
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": null,
      "minValue": null,
      "name": "FirstName",
      "readOnly": "N",
      "sizeValue": 15,
      "status": "Active",
      "type": "String"
    },
    {
      "attributeTypeId": 7,
      "defaultValue": null,
      "description": "Last Name",
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": null,
      "minValue": null,
      "name": "LastName",
      "readOnly": "N",
      "sizeValue": 20,
      "status": "Active",
      "type": "String"
    },
    {
      "attributeTypeId": 8,
      "defaultValue": null,
      "description": "Gender",
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": null,
      "minValue": null,
      "name": "Gender",
      "readOnly": "N",
      "sizeValue": 10,
      "status": "Active",
      "type": "String"
    },
    {
      "attributeTypeId": 9,
      "defaultValue": null,
      "description": "Specialty",
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": null,
      "minValue": null,
      "name": "Specialty",
      "readOnly": "N",
      "sizeValue": 25,
      "status": "Active",
      "type": "String"
    },
    {
      "attributeTypeId": 10,
      "defaultValue": null,
      "description": "Specialty License",
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": null,
      "minValue": null,
      "name": "License",
      "readOnly": "N",
      "sizeValue": 15,
      "status": "Active",
      "type": "String"
    }
  ],
  "description": "IndProvider Entity Type",
  "entityTypeId": 2,
  "id": "EUID",
  "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/entities/IndProvider",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "name": "IndProvider",
  "status": "Active"
}

Sample Response Code

200

2.4 POST /metadata/entities/{name}

This API is used to create a new entity type.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/entities/{name}

Request Content Type

application/json

Request Type

HTTP POST

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
name Matching the regex [a-zA-Z][a-zA-Z_0-9]+ Name of the entity type to be created.
entityTypeResource - Details of the entity type to be created. For details on the fields for the entity type request body, see Section A.1.1, "Entity Type Resource".

Response Parameters

Parameter Description
entity type For information on the entity type attributes in response, see Section A.2.1, "Entity Type Response Structure". To display all the attributes of the entity type, use the GET /metadata/entities/{name} API with expand=all.

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument/Resource Exists
500 Error while processing

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/entities/PatientNew

Sample Request Body

{
"name": "PatientNew",
"description": "PatientNew Entity Type",
"id": "EUID",
"attributes": [
  {
    "name": "FirstName",
    "type": "String",
    "sizeValue": "80",
    "defaultValue": "Unknown"
  },
  {
    "name": "Age",
    "description": "Patient Age",
    "type": "Integer",
    "minValue" : "0",
    "maxValue" : "200"
  }
  ]
}

Sample Response Body

{
  "attributes": null,
  "description": null,
  "entityTypeId": 41,
  "id": null,
  "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/entities/PatientNew",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "name": "PatientNew",
  "status": "Active"
}

Sample Response Code

200

2.5 PUT /metadata/entities/{name}

This API is used to update an existing entity type.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/entities/{name}

Request Content Type

application/json

Request Type

HTTP PUT

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
name Matching the regex [a-zA-Z][a-zA-Z_0-9]+ Name of the entity type to be updated.
status active or inactive To activate or deactivate the entity type. When status is passed, the body (entityTypeResource) details are ignored. But, the body must be passed as {}.
entityTypeResource - Details of the entity type to be updated. This is considered for updating the entity type if the status parameter is not set to any value. For details on the fields for the entity type request body, see Section A.1.1, "Entity Type Resource".

Response Parameters

Parameter Description
entity type For information on the entity type attributes in response, see Section A.2.1, "Entity Type Response Structure". To display all the attributes of the entity type, use the GET /metadata/entities/{name} API with expand=all.

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument/Resource Not Exists
500 Error while processing

2.5.1 To Update Entity Type Status

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/entities/PatientNew?status=Active

Sample Request Body

{ }

Sample Response Body

{
  "attributes": [
    {
      "attributeTypeId": 61,
      "defaultValue": "Unknown",
      "description": null,
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/PatientNew",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": null,
      "minValue": null,
      "name": "FirstName",
      "readOnly": "N",
      "sizeValue": 80,
      "status": "Active",
      "type": "String"
    },
    {
      "attributeTypeId": 62,
      "defaultValue": null,
      "description": "Patient Age",
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/PatientNew",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": "200",
      "minValue": "0",
      "name": "Age",
      "readOnly": "N",
      "sizeValue": 3,
      "status": "Active",
      "type": "Integer"
    }
  ],
  "description": null,
  "entityTypeId": 41,
  "id": "EUID",
  "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/entities/PatientNew",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "name": "PatientNew",
  "status": "Active"
}

Sample Response Code

200

2.5.2 To Update Entity Type Attributes and Other Details

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/entities/PatientNew

Sample Request Body

{
"name": "PatientNew",
"description": "PatientNew Entity Type",
"attributes": [
  {
    "name": "FirstName",
    "description": "Patient First Name",
    "sizeValue": "60"
  },
  {
    "name": "Age",
    "maxValue" : "150"
  }
 ]
}

Sample Response Body

{
  "attributes": [
    {
      "attributeTypeId": 61,
      "defaultValue": "Unknown",
      "description": "Patient First Name",
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/PatientNew",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": null,
      "minValue": null,
      "name": "First Name",
      "readOnly": "N",
      "sizeValue": 60,
      "status": "Active",
      "type": "String"
    },
    {
      "attributeTypeId": 62,
      "defaultValue": null,
      "description": "Patient Age",
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/PatientNew",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": "150",
      "minValue": "0",
      "name": "Age",
      "readOnly": "N",
      "sizeValue": 3,
      "status": "Active",
      "type": "Integer"
    }
  ],
  "description": "PatientNew Entity Type",
  "entityTypeId": 41,
  "id": "EUID",
  "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/entities/PatientNew",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "name": "PatientNew",
  "status": "Active"
}

Sample Response Code

200

2.6 PUT /metadata/entities/{name}/{attribute}

This API is used to activate or deactivate an entity type attribute.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/entities/{name}/{attribute}

Request Type

HTTP PUT

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
name Matching the regex [a-zA-Z][a-zA-Z_0-9]+ Entity Type Name of entity type whose attribute is to be activated or deactivated
attribute Matching the regex [a-zA-Z][a-zA-Z_0-9.]+ Attribute Name of the entity type attribute which needs to be activated or deactivated
status active or inactive To activate or deactivate the entity type attribute

Response Parameters

Parameter Description
entity type For information on the entity type attributes in response, see Section A.2.1, "Entity Type Response Structure". To display all the attributes of the entity type, use the GET /metadata/entities/{name} API with expand=all.

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument/Resource Not Exists
500 Error while processing

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/entities/PatientNew/Age?status=Inactive

Sample Response Body

{
  "attributes": null,
  "description": null,
  "entityTypeId": 41,
  "id": null,
  "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/entities/PatientNew",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "name": "PatientNew",
  "status": "Active"
}

Sample Response Code

200

2.7 GET /metadata/relationships

This API is used to retrieve the list of relationship types.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/relationships

Request Type

HTTP GET

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
status all, inactive, or active Filter relationship types based on status
expand all View more details of the relationship type. If expand is not passed, API sends compacted information in response.
totalResults true or false View total records count

Response Parameters

Parameter Description
items An array containing relationship types
relationship type For information on the relationship type attributes in response, see Section A.2.2, "Relationship Type Response Structure".
totalResults Value is set to the total number of relationship types based on the status filter. The value is displayed if totalResults is set to true in the request parameter. Otherwise, the value is null.

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument
500 Error while processing

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/relationships?status=Active&expand=all&totalResults=true

Sample Response Body

{
  "items": [
    {
      "attributes": null,
      "createdBy": "rm",
      "createdDate": "12/22/2015",
      "description": "Attending Physician Of",
      "direction": "UNIDIRECTIONAL",
      "effectiveDate": "07/15/2015",
      "end": {
        "attributes": null,
        "description": null,
        "entityTypeId": null,
        "id": null,
        "links": [
          {
            "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
            "mediaType": "application/json",
            "rel": "canonical"
          }
        ],
        "name": "USPatient",
        "status": "Active"
      },
      "expirationDate": "01/01/2020",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/relationships/attending-physician-of",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "modifiedBy": "rm",
      "modifiedDate": "12/22/2015",
      "multiplicity": "ONETOMANY",
      "name": "attending-physician-of",
      "relationshipTypeId": 6,
      "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
    }
  ],
  "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/relationships",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "totalResults": 1
}

Sample Response Code

200

2.8 GET /metadata/relationships/{name}

This API is used to retrieve the details of an existing relationship type.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/relationships/{name}

Request Type

HTTP GET

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
name Matching the regex [a-zA-Z][a-zA-Z_0-9-]+ Relationship Type Name of the relationship type to be searched.

Note: A "-" (hyphen) is allowed in the relationship type name.

expand all View more details of the relationship type. If expand is not passed, API sends compacted information in response.

Response Parameters

Parameter Description
relationship type For information on the relationship type attributes in response, see Section A.2.2, "Relationship Type Response Structure".

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument/Resource Not Exists
500 Error while processing

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/entities/IndProvider?expand=all

Sample Response Body

{
  "attributes": [
    {
      "attributeTypeId": 14,
      "defaultValue": null,
      "description": "Date of Marriage",
      "indexed": "Y",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/relationships/spouse-of",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": null,
      "minValue": null,
      "name": "DateOfMarriage",
      "readOnly": "N",
      "sizeValue": 10,
      "status": "Active",
      "type": "Date"
    }
  ],
  "createdBy": "rm",
  "createdDate": "12/22/2015",
  "description": "Spouse Of",
  "direction": "BIDIRECTIONAL",
  "effectiveDate": "07/15/2015",
  "end": {
    "attributes": null,
    "description": null,
    "entityTypeId": null,
    "id": null,
    "links": [
      {
        "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
        "mediaType": "application/json",
        "rel": "canonical"
      }
    ],
    "name": "USPatient",
    "status": "Active"
  },
  "expirationDate": "01/01/2020",
  "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/relationships/spouse-of",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "modifiedBy": "rm",
  "modifiedDate": "12/22/2015",
  "multiplicity": "ONETOONE",
  "name": "spouse-of",
  "relationshipTypeId": 7,
  "start": {
    "attributes": null,
    "description": null,
    "entityTypeId": null,
    "id": null,
    "links": [
      {
        "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
        "mediaType": "application/json",
        "rel": "canonical"
      }
    ],
    "name": "USPatient",
    "status": "Active"
  },
  "status": "Active",
  "task": null
}

Sample Response Code

200

2.9 POST /metadata/relationships/{name}

This API is used to create a new relationship type.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/relationships/{name}

Request Content Type

application/json

Request Type

HTTP POST

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
name Matching the regex [a-zA-Z][a-zA-Z_0-9-]+ Relationship Type Name of the relationship type to be created.

Note: A "-" (hyphen) is allowed in the relationship type name.

relationshipTypeResource - Details of the relationship type to be created. For details on the fields for the relationship type request body, see Section A.1.2, "Relationship Type Resource".

Response Parameters

Parameter Description
relationship type For information on the relationship type attributes in response, see Section A.2.2, "Relationship Type Response Structure". To display all the attributes of the relationship type, use the GET /metadata/relationships/{name} API with expand=all.

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument/Resource Exists
500 Error while processing

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/relationships/patient-of?source=USPatient&target=IndProvider

Sample Request Body

{
  "name": "patient-of",
  "start": { "name": "USPatient" },
  "end": { "name": "IndProvider" },  
  "description": "Patient-to-Individual Provider relationship type",
  "direction": "UNIDIRECTIONAL",
  "multiplicity": "ONETOMANY",
  "status": "Active",
  "effectiveDate": "01/01/2016",
  "expirationDate": "12/31/2035",
  "attributes": [
    {
      "name": "Location",
      "description": "Provider Location",
      "type": "String",
      "status": "Active",
      "sizeValue": "40",
      "mandatory": "N",
      "readOnly": "N",
      "indexed": "N"
    }
  ]
}

Sample Response Body

{
  "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": 21,
  "start": {
    "attributes": null,
    "description": null,
    "entityTypeId": null,
    "id": null,
    "links": [
      {
        "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
        "mediaType": "application/json",
        "rel": "canonical"
      }
    ],
    "name": "USPatient",
    "status": "Active"
  },
  "status": "Active",
  "task": null
}

Sample Response Code

200

2.10 PUT /metadata/relationships/{name}

This API is used to update an existing relationship type.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/relationships/{name}

Request Content Type

application/json

Request Type

HTTP PUT

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
name Matching the regex [a-zA-Z][a-zA-Z_0-9-]+ Relationship Type Name of the relationship type to be updated.

Note: A "-" (hyphen) is allowed in the relationship type name.

status active or inactive To activate or deactivate the relationship type. When status is passed, the body (relationshipTypeResource) details are ignored. But, the body must be passed as {}.
relationshipTypeResource - Details of the relationship type to be updated. This is considered for updating the relationship type if the status parameter is not set to any value. For details on the fields for the relationship type request body, see Section A.1.2, "Relationship Type Resource".

Response Parameters

Parameter Description
relationship type For information on the relationship type attributes in response, see Section A.2.2, "Relationship Type Response Structure". To display all the attributes of the relationship type, use the GET /metadata/relationships/{name} API with expand=all.

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument/Resource Not Exists
500 Error while processing

2.10.1 To Update Relationship Type Status

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/relationships/patient-of?status=Inactive

Sample Request Body

{ }

Sample Response Body

{
  "attributes": [
    {
      "attributeTypeId": 81,
      "defaultValue": null,
      "description": "Provider Location",
      "indexed": "N",
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "mandatory": "N",
      "maxValue": null,
      "minValue": null,
      "name": "Location",
      "readOnly": "N",
      "sizeValue": 40,
      "status": "Active",
      "type": "String"
    }
  ],
  "createdBy": "<username>",
  "createdDate": "12/31/2015",
  "description": "Patient-to-Individual Provider relationship type",
  "direction": "UNIDIRECTIONAL",
  "effectiveDate": "01/01/2016",
  "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": "12/31/2035",
  "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "modifiedBy": "<username>",
  "modifiedDate": "12/31/2015",
  "multiplicity": "ONETOMANY",
  "name": "patient-of",
  "relationshipTypeId": 21,
  "start": {
    "attributes": null,
    "description": null,
    "entityTypeId": null,
    "id": null,
    "links": [
      {
        "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
        "mediaType": "application/json",
        "rel": "canonical"
      }
    ],
    "name": "USPatient",
    "status": "Active"
  },
  "status": "Inactive",
  "task": null
}

Sample Response Code

200

2.10.2 To Update Relationship Type Attributes and Other Details

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/relationships/patient-of

Sample Request Body

{
  "name": "patient-of2",
  "direction": "BIDIRECTIONAL",
  "multiplicity": "MANYTOMANY", 
  "effectiveDate": "01/04/2016",
  "expirationDate": "11/21/2040",
  "attributes": [
    {
      "name": "Location",
      "sizeValue": "80",
      "mandatory": "Y",
      "indexed": "Y"
    }
  ]
}

Sample Response Body

{
  "attributes": [
    {
      attributeTypeId": 81,
      "defaultValue": null,
      "description": "Provider 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": 80,
      "status": "Active",
      "type": "String"
    }
  ],
  "createdBy": "<username>",
  "createdDate": "12/31/2015",
  "description": "Patient-to-Individual Provider relationship type",
  "direction": "BIDIRECTIONAL",
  "effectiveDate": "01/04/2016",
  "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": "11/21/2040",
  "links": [
    {
      "href": "/ohmpi-rm/1.0.0/metadata/relationships/patient-of",
      "mediaType": "application/json",
      "rel": "canonical"
    }
  ],
  "modifiedBy": "<username>",
  "modifiedDate": "12/31/2015",
  "multiplicity": "MANYTOMANY",
  "name": "patient-of",
  "relationshipTypeId": 21,
  "start": {
    "attributes": null,
    "description": null,
    "entityTypeId": null,
    "id": null,
    "links": [
      {
        "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
        "mediaType": "application/json",
        "rel": "canonical"
      }
    ],
    "name": "USPatient",
    "status": "Active"
  },
  "status": "Active",
  "task": null
}

Sample Response Code

200

2.11 PUT /metadata/relationships/{name}/{attribute}

This API is used to activate or deactivate a relationship type attribute.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/relationships/{name}/{attribute}

Request Type

HTTP PUT

Response Content Type

application/json;charset=UTF-8

Request Query Parameters

Parameter Value Description
name Matching the regex [a-zA-Z][a-zA-Z_0-9-]+ Relationship Type Name of relationship type whose attribute is to be activated or deactivated.

Note: A "-" (hyphen) is allowed in the relationship type name.

attribute Matching the regex [a-zA-Z][a-zA-Z_0-9.]+ Attribute Name of the relationship type attribute which needs to be activated or deactivated.
status active or inactive To activate or deactivate the relationship type attribute.

Response Parameters

Parameter Description
relationship type For information on the relationship type attributes in response, see Section A.2.2, "Relationship Type Response Structure". To display all the attributes of the relationship type, use the GET /metadata/relationships/{name} API with expand=all.

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
400 Invalid argument/Resource Not Exists
500 Error while processing

Sample Request URI

http://localhost:7001/ ohmpi-rm/1.0.0/metadata/relationships/patient-of/Location?status=Inactive

Sample Response Body

{
  "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-of2",
        "mediaType": "application/json",
        "rel": "canonical"
      }
    ],
    "modifiedBy": null,
    "modifiedDate": null,
    "multiplicity": null,
    "name": "patient-of2",
    "relationshipTypeId": 21,
    "start": {
      "attributes": null,
      "description": null,
      "entityTypeId": null,
      "id": null,
      "links": [
        {
          "href": "/ohmpi-rm/1.0.0/metadata/entities/USPatient",
          "mediaType": "application/json",
          "rel": "canonical"
        }
      ],
      "name": "USPatient",
      "status": "Active"
    },
    "status": "Active",
    "task": null
}

Sample Response Code

200

2.12 POST /metadata/logout

This API is used to logout the currently logged-in user from REST API.

Request URI

http(s)://<server>:<port>/ohmpi-rm/1.0.0/metadata/logout

Request Type

HTTP POST

Response Content Type

application/json;charset=UTF-8

Response Parameters

Parameter Description
message Provides username of the user who was logged out

Response Status Code

Status Code Description
200 Success
404 Incorrect URI
500 Error while processing

Sample Request URI

http://localhost:7001/ohmpi-rm/1.0.0/metadata/logout

Sample Response Body

{
  "message": "User 'rmAdmin' logged out successfully"
}

Sample Response Code

200