Skip to content

Using this Bundle for Good.

Ronil edited this page Aug 28, 2017 · 3 revisions

Questions:

  1. How to use this Bundle and how do i figure out what method to use and its response?
  2. How to access a new concept?

Lets answer above questions. Starting with the first one.

How to use this Bundle and how do i figure out what method to use and its response?

  1. Assuming you have already completed adding and configuring this bundle to your symfony project. (If not, README section will help you with that).

  2. Now you want integrate (Search, add, fetch, fetchAll, etc) a concept. To start with each concept has its own client, request and response model classes. Lets take an example to understand this.

    Consider you are integrating DrugProduct concept and you want to search whether a concept entry is available in MDS and if not you want to add to it.

  • First you will have to create an instance of DrugProductClient, which is required to interact with the MDS service (If you have a closer look, its specific to a concept DrugProduct and that does mean each concept has its own client to interact with MDS service)
  • Then create a DrugProductSearchRequest (Which is a request specific to concept DrugProduct) while providing required search parameters. (This is the actual search request you are making to the MDS service)
  • Then call the instantiated DrugProductClient object with instance of DrugProductSearchRequest model as the parameter and followed by a wait method to make it a synchronous call to MDS service.
  • As a response the client will return instance of FetchAllDrugProductResponse (Response class depends on the type of request you make and in our case Search will yield a FetchAllDrugProductResponse) which has a method getDrugProduct which returns a DrugProductModelList which is the iterable list of DrugProductModel.
  • If you get empty list of DrugProductModelList then it does mean the search failed to retrieve any response. Now as per the example problem statement you want to add this entry to MDS service, which is again similar to search but by using different set of methods and will yield different result models.

Below, I have shared what methods to call on a client for search, add, fetch, fetchExtended, fetchAll, fetchAllExtended (Wondering what does extended signify? I will explain this below, for now consider this as one more method in your arsenal).

As i mentioned above each concept has its own client, request model, response model. [ * ] below signifies any concept type (Such as DrugProduct, Specialisation, Country etc)

Client

  • [ * ]Client

RequestModels

  • [ * ]Search -> [ * ]SearchRequest
  • [ * ]Add -> Add[ * ]Request
  • [ * ]Fetch -> FetchRequest
  • [ * ]FetchExtended -> FetchRequest
  • [ * ]FetchAll -> FetchAllRequest
  • [ * ]FetchExtendAll -> FetchAllRequest

Action, Response and Response models

  • [ * ]Search -> FetchAll[ * ]Response -> [ * ]ModelList -> [ * ]Model
  • [ * ]Add -> AddResponse -> AddResponseModel
  • [ * ]Fetch -> Fetch[ * ]Response -> [ * ]Model
  • [ * ]FetchExtended -> Fetch[ * ]ExtendedResponse -> [ * ]Model
  • [ * ]FetchAll -> FetchAll[ * ]Response -> [ * ]ModelList -> [ * ]Model
  • [ * ]FetchExtendAll -> FetchAll[ * ]ExtendedResponse -> [ * ]ModelList -> [ * ]Model

Additional Info:

  • Extended: When you operate extended, you will get one level of relationship object data. E.g. If you perform extended on Cities concept, then you will get country data (such as Name, currency etc) with the response and whereas without extend you will receive on id of the country.

Second question, How to access a new concept?

  • For any new concept addition a new SDK version will be generated and hence tenant needs to use appropriate version to access newly added concept.