Questionnaires

Submit a standardized mdhub questionnaire (PHQ-9, GAD-7, MADRS) by raw scores

Submits a standardized questionnaire identified by mdhubType using only an array of integer scores. The server fetches the authoritative questionnaire schema from mdhub by mdhubType and maps each entry in responses to the appropriate response label (Likert scale items for PHQ-9 and GAD-7, option indexes for MADRS).

Lengths and ranges:

  • mdhub-phq-9: 9 integers, each 0..3
  • mdhub-gad-7: 7 integers, each 0..3
  • mdhub-madrs: 10 integers, each 0..6

Validation runs against the actual questionnaire stored in mdhub, so wrong array length or out-of-range entries return a 400 with detailed issues[].

Once stored, an AI summary and a numeric score are generated automatically.

post/questionnaires/submit-mdhub

Request body

patientIdstring required

ID of the patient (as returned by the create patient endpoint).

mdhubType'mdhub-phq-9' | 'mdhub-gad-7' | 'mdhub-madrs' required

Identifier of the mdhub-managed standardized questionnaire. The server resolves this to the corresponding questionnaire schema and uses it to map each entry in responses to the proper response label.

responsesinteger[] required

Raw integer scores in question order.

  • PHQ-9 / GAD-7: each entry is a 0–3 score on the 4-point frequency scale ("Not at all", "Several days", "More than half the days", "Nearly every day"). Length must be 9 (PHQ-9) or 7 (GAD-7).
  • MADRS: each entry is a 0–6 score against the item's options. Length must be 10.

Example request

{
  "patientId": "abc123",
  "mdhubType": "mdhub-gad-7",
  "responses": [
    0,
    2,
    1,
    3,
    1,
    0,
    2
  ]
}

Response

Questionnaire submitted successfully

patientQuestionnaireIdstring required

ID of the stored patient-questionnaire on the mdhub side.

Example response

{
  "patientQuestionnaireId": "pq_123abc"
}

Changes

No recorded changes to this endpoint across all 1 revision of this API.