Synonym Resource

Synonym Resource


URL: /openempi-ws-rest/1.0/synonyms?entityId=n&fieldName=fieldName

Methods

GET

Returns the complete list of synonyms that have been configured in the system for the entity identified by the query parameter entityId and the field specified by the query parameter fieldName.

Responses

  • 200 - application/json- Returns a JSON representation of the response based on the Accept header

  • 200 - application/xml- Returns an XML representation of the response based on the Accept header

  • 404 - Returned if there are no synonyms defined in the system for this entity and field name

Example

Version 1.0

 http://localhost:8080/openempi-admin/openempi-ws-rest/1.0/synonyms?entityId=2&fieldName=givenName

Return:

{
    "synonymEntry": [
        {
            "fieldName": "givenName",
            "synonymId": "#25:0",
            "synonyms": [
                "robert",
                "bob"
            ]
        },
        {
            "fieldName": "givenName",
            "synonymId": "#26:0",
            "synonyms": [
                "elizabeth",
                "beth"
            ]
        }
    ]
}

Example XML response (Header Accept: application/xml):

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<synonymEntries>
    <synonymEntry>
        <fieldName>givenName</fieldName>
        <synonymId>#26:0</synonymId>
        <synonyms>jon</synonyms>
        <synonyms>john</synonyms>
    </synonymEntry>
    <synonymEntry>
        <fieldName>givenName</fieldName>
        <synonymId>#28:0</synonymId>
        <synonyms>william</synonyms>
        <synonyms>will</synonyms>
        <synonyms>bill</synonyms>
    </synonymEntry>
    <synonymEntry>
        <fieldName>givenName</fieldName>
        <synonymId>#25:1</synonymId>
        <synonyms>robert</synonyms>
        <synonyms>bob</synonyms>
    </synonymEntry>
    <synonymEntry>
        <fieldName>givenName</fieldName>
        <synonymId>#27:0</synonymId>
        <synonyms>jamie</synonyms>
        <synonyms>james</synonyms>
        <synonyms>jim</synonyms>
    </synonymEntry>
</synonymEntries> 

 

URL: /openempi-ws-rest/1.0/synonyms?entityId=n

Methods

POST

Add a new list of synonyms in the system for the entity identified by the query parameter entityId.

Responses

  • 200 - application/json- Returns a JSON representation of the response based on the Accept header

  • 200 - application/xml- Returns an XML representation of the response based on the Accept header

  • 400 - Bad Request if the parameters specified in the request are invalid.

Example

Version 1.0

http://localhost:8080/openempi-admin/openempi-ws-rest/1.0/synonyms?entityId=2

POST Body in JSON format. Add the list of synonyms show in the example below to be applied to the field givenName.

{
    "fieldName": "givenName",
    "synonyms": [
        "elizabeth",
        "beth"
    ]
}

Return:

{
    "fieldName": "givenName",
    "synonyms": [
        "elizabeth",
        "beth"
    ]
}

POST Body in XML format:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<synonymEntry>
    <fieldName>givenName</fieldName>
    <synonyms>abe</synonyms>
    <synonyms>abraham</synonyms>
    <synonyms>abram</synonyms>
</synonymEntry> 

 

URL: /openempi-ws-rest/1.0/synonyms/{synonymId}/?entityId=n

http://localhost:8080/openempi-admin/openempi-ws-rest/1.0/synonyms/25:0/?entityId=2

Methods

DELETE

Delete the synonyms list in the system for the entity identified by the query parameter entityId. The specific synonym list to be deleted must be specified by the path parameter synonymId.

Responses

  • 204 - No content returned if the request is successful

  • 400 - Bad Request if the parameters specified in the request are invalid

  • 404 - Returned if there are no synonyms defined in the system for this entity and synonymId

Example

Version 1.0

http://localhost:8080/openempi-admin/openempi-ws-rest/1.0/synonyms/26:0/?entityId=2