Patient_id not generated on contact

We’ve technical partner reporting that a patient_id is not being generated after a contact is created. This has been seen on some devices only. What could be the cause for this ? Is there a condition when patient_id field is generated or not ? If we look at couchdb for the contact, the patient_id is not generated at all.

CC: @gkesh , @sanjay , @gaarimasharma

1 Like

We figured that sentinel server has a lot of records to be processed. We checked it via monitoring and it has more than 2,500 backlog.

So that it’s helpful for other community memebers, we got patient_id re generated once we restarted sentinel server and it processed all remaining back logs.

1 Like

Thank you @yuv sir for your kind support. I wanted to elaborate further on the situation and provide context.

The problem was that in a test deployment of medic version 3.17.0, when new contacts were added, patient_id for those contacts were not being generated, this was noted while observing the reports submitted from the contacts. These reports were not getting linked to their respective contacts because when pulling patient_id from the contact, it was outputting empty.

This issue has far reaching implications because even if the system adds patient_id to the record once the issue is resolved, the reports linked will still remain the same, it does not fix them retroactively. This requires the system admins to perform manual corrections on the inflicted reports.

However, it should be noted that this issue is extremely rare and would not appear under normal circumstances. In our case this appeared because all the services inside the medic-os container had failed to launch when the docker container was started. Checking the logs after starting up the container to ensure that all services running successfully might be a good precautionary measure and routinely monitoring the sentinel backlog could also be a good practice when working with massive data.

This time the error was solved simply by restarting the medic-os container using the following command:

docker restart medic-os

cc: @sanjay @gaarimasharma

5 Likes

I think it might related to this specific use case Patient_id not populated when form started just after patient creation in 4.21

1 Like