Skip to content

Prescreening Data and Integrations ​

MongoDB ​

The backend selects three collections from the configured database. Production data is in Atlas project DMIND Production, cluster dmind-prescreen-backend-prod. Open the current environment mapping → for variant-to-database names.

interview ​

One document represents a participant case. Important groups are:

  • Identity and routing: _id, case_id, corp_id, data_source, tracking_data.
  • Participant details: recipient name, age, academic year, gender, phone, province, zone, and user agent.
  • AI lifecycle: prediction ID, question configuration, AI status/result, depression level, and result source.
  • Self-rating: partner-supplied Agnos HAMD-7/8Q fields, deprecated compatibility AIMET 9Q fields, suicidal response, and low-depression survey.
  • Staff workflow: case status, staff assessment, contact/result logs, last-contact date.
  • Partner workflow: AllTime 1323 progress/related ID, last selected terminal service, available services, and SROI survey.

Key embedded structures are:

StructureImportant fields
question_configInterview type and avatar ID.
result_aiprocessing/finish status, depression level, two-question flags, suicidal score/level/detail, and chief complaints.
self_rating_score_agnosPartner-supplied HAMD-7 total/level/section scores, 8Q score/level, and choice-key answer details; external runtime use is unverified.
self_rating_score_aimetDeprecated AIMET 9Q total/severity and question/choice pairs retained for compatibility.
result_staff_agnosstaff 8Q/9Q scores/levels, unreachable count, invalid-phone flag, staff ID, and first assessment time.
result_log_agnos[]staff ID, text, creation time, edit count, and soft-delete flag.
tracking_dataUTM source/platform/medium/campaign and GA user ID.
available_low_depression_terminal_servicelast fetch time and service names.
low_depression_surveychatbot experience, interest, trust, and help-seeking situations.
sroi_surveysubmission time, mental-health behavior, and willingness-to-pay fields.

Top-level enum families include:

  • status: NEW, FOLLOW_UP, DONE
  • depression_level: LOW, MODERATE, SEVERE
  • depression_level_source: partner AGNOS_SELF_RATING, participant FALLBACK and AI_SERVICE, deprecated compatibility source AIMET_SELF_RATING
  • interview type: current TEXT, AUDIO, VIDEO; deprecated compatibility type CHOICE, which is excluded from configured method selection
  • terminal service: ASA, 1323_ALLTIME, 1323_DASHBOARD, DMIND_CHATBOT, SATI, HERE_TO_HEAL, EMMIND

staff ​

Stores dashboard username/password hash, identity/contact information, role, province/affiliation, active status, and last login.

incrementor ​

Contains the atomic case_id counter used when creating interviews.

Redis key catalog ​

Keys are namespaced by application name.

PatternValueLifetime/purpose
<APP>:session:<token>Serialized interview sessionStart/default/end TTLs control an in-progress participant journey.
<APP>:refresh_token:<staff_id>:<token_uuid>Refresh counterJWT refresh lifetime; supports rotation/invalidation checks.
<APP>:otp_session:<token>OTP answer payloadThree minutes.
<APP>:content:<content_id>S3 content URLPersistent cache until refreshed.
<APP>:question_path:<APP>Serialized question pathsPersistent cached interview ordering.

The serialized participant session contains workflow state, including phone and national ID used during 1323 verification.

AWS-backed data ​

ServiceCurrent use
S3Interview content and corp frontend artifacts. Live buckets exist for main/dev and TU, MDCU, CPIRD, THPF, KKU, Thangrath, TSU, and TU UAT frontends.
SSM Parameter StoreCorp feature configurations and some backend runtime configuration names.
Secrets Manager / ECS task environmentJWT, system, and partner secret references; active production tasks provide the MongoDB connection setting through the task environment.
SNSTransactional SMS/OTP delivery from the backend.
CloudWatchBackend logs, response metrics, alarms, and corp-specific log groups.

External integrations ​

IntegrationDirectionPurpose
AI controllerBackend → AI platformCreate predictions, submit answers, fetch results and question paths.
Mental Med/AgnosPartner → POST /interview/submit-self-ratingAccepts HAMD-7/8Q self-rating submissions. The current participant frontend does not call this registered endpoint; external runtime use is unverified.
Corp systemsBackend ↔ corpCorp-specific start and redirect flows.
AllTime 1323Backend ↔ 1323Progress, related ID, verification, OTP, and service routing.
ASABackend → serviceFollow-up service option.
DMIND chatbotBrowser/backend → chatbotTerminal-service redirect and optional survey.
Sati / Emmind / Here to HealBrowser/backend → serviceWeighted or configured follow-up options.
Cloudflare TurnstileBrowser/backend → CloudflareParticipant-start bot validation where enabled.