RESTful Web Services Interface (legacy API)

RESTClient tool

2 min read

RESTClient is a Java application to test RESTful webservices. RESTClient2.4 can be downloaded from http://code.google.com/p/rest-client/downloads/detail?name=restclient-ui-2.4-jar-with-dependencies.jar

RESTClient tool screenshot

1. Before testng REST interface of OpenEMPI, get a session key from REST interface of OpenEMPI by following method and configured the session key in the HTTP Headers in each test cases for authentication.

(1). Get session key through authenticate method

URL:  http://localhost:8080/openempi-admin/openempi-ws-rest/security-resource/authenticate

HTTP Method: PUT

Content-type: application/xml

Body:

adminadmin

Response: 70394B59A140CCA6A9B32998BAC85086

RESTClient tool screenshot

(2). Add session key to the HTTP header in each test cases for authentication.

RESTClient tool screenshot

2. Test cases.

(1) person-query-resource/loadPerson

URL: http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/loadPerson?personId=44800

HTTP Method: GET

Content-type: application/xml

(2) person-query-resource/findPersonById

URL: http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/findPersonById

HTTP Method: POST

Content-type: application/xml

Body:

    

        865e7370-a045-11e1-a160-005056c00008

        

            2.16.840.1.113883.4.357

            2.16.840.1.113883.4.357

            hl7

        

    

(3) person-query-resource/getIdentifierDomains

URL: http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/getIdentifierDomains

HTTP Method: GET

Content-type: application/xml

(4) person-query-resource/getIdentifierDomainAttributes

URL: http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/getIdentifierDomainAttributes

HTTP Method: POST

Content-type: application/xml

Body:

    2009-06-17T11:45:54-04:00

    2.16.840.1.113883.4.2

    11

    2.16.840.1.113883.4.2

    2.16.840.1.113883.4.2

    2.16.840.1.113883.4.2

    TIN

(5) person-query-resource/getGlobalIdentifierById

URL:http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/getGlobalIdentifierById

HTTP Method: POST

Content-type: application/xml

Body:

    

        865e7370-a045-11e1-a160-005056c00008

        

            2.16.840.1.113883.4.357

            2.16.840.1.113883.4.357

            hl7

        

    

(6) person-query-resource/findPersonsByAttributes

URL: http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/findPersonsByAttributes

HTTP Method: POST

Content-type: application/xml

Body:

    WhiteCampbell

    1982-05-29T00:00:00-04:00

(6) person-query-resource/getPersonLinks

URL:http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/getPersonLinks

HTTP Method: POST

Content-type: application/xml

Body:

    WhiteCampbell

    1982-05-29T00:00:00-04:00

    45099

(7) person-query-resource/loadReviewRecordPair

URL:http://localhost:8080/openempi-admin/openempi-ws-rest/person-query-resource/loadReviewRecordPair?personLinkReviewId=23450

HTTP Method: GET

Content-type: application/xml

(8) person-manager-resource/updatePersonById

Before calling updatePersonById, make sure the 2012-06-07T09:33:19.796-04:00 should be greater than that of record in the database.

URL:http://localhost:8080/openempi-admin/openempi-ws-rest/person-manager-resource/updatePersonById

HTTP Method: PUT

Content-type: application/xml

Body:

    15 Barrett Street     Aleon     Westland     JFRSSMLJeff10.1974     2012-06-07T09:33:19.796-04:00     2012-05-17T13:27:06.165-04:00     1974-10-18T00:00:00-04:00     JeffriesSamuel     44800              2012-05-17T13:27:06.535-04:00         865e7370-a045-11e1-a160-005056c00008                      2012-02-10T13:44:24.755-05:00             OpenEMPI Domain             56             OpenEMPI Domain             2.16.840.1.113883.4.357             2.16.840.1.113883.4.357             hl7                              false                 false                 
2930 Oak Shadow Drive
                HerndonUS20171VA                 
                false                 [odysseas@sysnetint.com](mailto:odysseas@sysnetint.com)                 true                 Odysseas                 1                 Pentakalos                 d033e22ae348aeb5660fc2140aec35850c4da997                 A male kitty.                 testuser                 [http://www.sysnetint.com](http://www.sysnetint.com)             
        
        29411                              false                 false                 
                RestonUS20191VA                 
                false                 [admin@sysnetint.com](mailto:admin@sysnetint.com)                 true                 Open                 -1                 Empi                 d033e22ae348aeb5660fc2140aec35850c4da997                 A male kitty.                                  admin                 [http://www.sysnetint.com](http://www.sysnetint.com)             
    
    665     201229147630     189718658     TX              false         false         
        Reston         US         20191         VA         
        false         [admin@sysnetint.com](mailto:admin@sysnetint.com)         true         Open-1         Empi         d033e22ae348aeb5660fc2140aec35850c4da997         A male kitty.                  admin         [http://www.sysnetint.com](http://www.sysnetint.com)     
             false         false         
        Reston         US         20191         VA         
        false         [admin@sysnetint.com](mailto:admin@sysnetint.com)         true         Open         -1         Empi         d033e22ae348aeb5660fc2140aec35850c4da997         A male kitty.                  admin         [http://www.sysnetint.com](http://www.sysnetint.com)

Up to RESTful Web Services Interface (legacy API)