Client Configuration
This page is intended to help set up a client to consume the MyWinMed API. A client is defined as any application that can make HTTP Get and Post Requests.
- Prerequisite: Contact vender to retrieve login credentials, URL, and the unique identity of the entity you wish to gather information for.
- Create a HTTP Get Request with the login credentials and URL that have been provided from step one. The provided login credentials should be included in the HTTP Authorization Header. An example of setting up the Authorization Header would be;
var auth = base64.encode(user.userName + ':' + user.passWord); $http.defaults.headers.common['Authorization'] = 'Basic ' + auth;
Append '/Ehr-Api/ActionApi/Login/Login' to the provided URL to perform the Get request. This will call the Login method of the Login Controller. On a successful login, the server will return a 200 Status Code and a ServerResponse with a ResponseStatus of 1. If unsuccessful, a 401(Unauthorized) Status Code will be returned.
- After a successful step 2, you will then use the unique identity provided in step 1 to create and HTTP Post Request. The provided login credentials should be included in the HTTP Authorization Header(See step 2 for example). Append '/Ehr-Api/ActionApi/Patient/FindPatient' to the provided URL to perform the Post request. Construct a RequestDto object setting the AccountNumber as the unique identity provided in step 1; this is the parameter you will use with your Post Request. This will call the FindPatient method of the Patient Controller. On a successful Post, the server will return a 200 Status Code and a ServerResponse with a ResponseStatus of 1. If unsuccessful, a ServerResponse with a ResponseStatus of 0 will be returned. The ServerResponse's message property will give information as to why the Post may have failed.
- After a successful step 3, you will then construct a RequestDto object using the unique identity provided(as the AccountNumber) in step 1 to create and HTTP Post Request. You will then need to set the Category property of the RequestDto. This property(int) can be chosen from the ClinicalDataSetCategory. You can optionally set a StartDate and EndDate as to filter the data return from the Post. The provided login credentials should be included in the HTTP Authorization Header(See step 2 for example). Append '/Ehr-Api/ActionApi/Patient/GetDataCategory' to the provided URL to perform the Post Request. On a successful Post, the server will return a 200 Status Code and a ServerResponse with a ResponseStatus of 1. The Result property of the ServerResponse will be an XML representation of the data requested. If unsuccessful, a ServerResponse with a ResponseStatus of 0 will be returned. The ServerResponse's message property will give information as to why the Post may have failed.