Skip to content

Send SMS API #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: abdm_emr
Choose a base branch
from
Open

Conversation

Rustix69
Copy link

Fixes : Issue #10

Implementation :

  1. Gets patient details: Extracts the patient ID and ABHA address from the validated data.
  2. Retrieves the patient's phone number: Queries the database to get the patient record using the external_id field, which allows us to access the patient's phone number.
  3. Generates a random 6-digit OTP: Creates a secure random OTP instead of the hardcoded "000000".
  4. Sends an SMS to the patient: If the patient record is found and has a phone number, it sends an SMS with the OTP and ABHA address using the existing send_sms function from the care core.
  5. Stores the OTP in the cache: Updates the cache with the generated OTP and other necessary information.

The SMS message includes :

  • The OTP
  • The ABHA address being linked
  • A note about the OTP's validity period (10 minutes)

Copy link
Collaborator

@khavinshankar khavinshankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs changes,

  • Use the abdm_emr branch as the base instead of main
  • Use emr.Patient instead of facility.PatientRegistration
  • Remove the comments unless you want to highlight something that is not a standard practice.

@khavinshankar
Copy link
Collaborator

@Rustix69 The logic looks good to me but some changes are required which I have highlighted above

@Rustix69 Rustix69 requested a review from khavinshankar March 11, 2025 12:28
@khavinshankar khavinshankar changed the base branch from main to abdm_emr March 12, 2025 01:31
@Rustix69 Rustix69 requested a review from khavinshankar March 12, 2025 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants