Skip to content

Instantly share code, notes, and snippets.

@bijay-shrestha
Last active May 27, 2020 10:13
Show Gist options
  • Save bijay-shrestha/09acc920d6260ce6a30d1fe434909b5a to your computer and use it in GitHub Desktop.
Save bijay-shrestha/09acc920d6260ce6a30d1fe434909b5a to your computer and use it in GitHub Desktop.
Gist for Server side Integration
  1. Send integrationChannelId (eg. Backend channel, Frontend Channel) in Appointment Check-In datatable response.
  2. Create client-integration-connector module. (Middleware) 2.1-> because, if some changes needs to be reflected in bheri integrated apis .. only reflect change in bheri-integraiton-connector and not the entire application.
  3. For, integrationChannelId of Backend Channel for a provided 'client_id & feature_code', call it's corresponding integration module's service. 3.1 -> Perhaps a switch case.
  4. i.e., Call check-in service of bheri hospital
  5. Create a QueryCreator class in query package of client-integratoin-connector.
  6. Create a query to construct a requestBody as expected by Client's API and set the values in ClientCheckInRequestDTO. 6.1 -> Also, add hospitalNumber in the REQUEST DTO. 6.2 -> Get the value for hospitalNumber from the STEP 6 query in 12131313 or null.
  7. Fetch all the necessary API parameters for the logged-in client with. 7.1-> we need to see if this can be cached, since we're developing a seperate middleware
  8. Call the client's API using ClientCheckInRequestDTO and API parameters from STEP 7.
  9. if hospitalNumber has null value from STEP 6.2, INSERT STEP 8's 'responseData' i.e., patient ID value in patient_hospital_info
  10. Send the success or error response back to the client module.
  11. For success change Appointment Status to approved.
  12. For error throw exception ThirdPartyIntegrationException.

integration_request_body_parameters id, name, status, remarks example: ['name', 'age', 'ageDay', 'ageMonth']

api_integration_format_request_body id, api_integration_format_id, api_request_body_parameters_id, status

convert object


appointmentCheckInObj.patientName -> name, appointmentCheckInObj.age -> age, appointmentChekInObj.ageMonth -> ageMonth

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment