How it works?
A cron job is scheduled in the Recommendation service to run the GMC sync every night to update the list of doctors in doctorsForDB.
Cron expression is stored in Parameter Store for Stage and Prod
Stage:/tis/revalidation/preprod/recommendation/cron/nightlysync
Prod:/tis/revalidation/prod/recommendation/cron/nightlysync
The recommendation service would start preparing the data for the GMC sync job. The doctors in the DoctorsForDB database have the field “existsInGmc” set to false. (Effectively this marks all doctors as “disconnected” as GMC only sends us connected doctors)
After that, a message will be pushed to the Rabbit queue to notify the GMC-client service to start the overnight sync job.Code Block exchange: reval.exchange queue: reval.queue.gmcsync.requested.gmcclient routingKey: reval.gmcsync.requested
GMC-Client would send SOAP requests
GetDoctorsForDB
to GMC for retrieving the list of doctors with their designated body.GMC-Client would push GMC doctors' data to the RabbitMQ with routingKey
reval.gmcsync
which is binding to two queues, one for Recommendation and one for Connection service.Recommendation service would listen to the queue
reval.queue.gmcsync.recommendation
for updating the MongoDBDoctorsForDB
document.
Doctors' data will be updated with their updated designated body. Any doctors who are not sent back from the queue, means they are not connected to any office. This would leave the disconnected doctors with aexistsInGmc
set to false, and their record will not be shown in recommendation summary page anymore (but will still show up in connections discrepancies).Code Block exchange: reval.exchange.gmcsync queue: reval.queue.gmcsync.recommendation routingKey: reval.gmcsync
At the same time, the Connection service would listen to the queue reval.queue.gmcsync.connection for updating the Elastic Search Master index and the corresponding Connection indexes. Please find the document Elastic Search Index Update Event for Connections (outdated)
for more information.At the time of writing, the connections application uses masterdoctorindex via an aliasthis point, the GMC (DocumentDB) Change Data Capture process copies the data from MongoDB/DocumentDB over to elasticsearch
How to Trigger GMC Sync Manually?
...