Home Visit (Care Module)
Home visit records — list, stats, and nested latest visit on Student
Home Visit
Home visits capture a teacher's in-person observation of a student's household across several info sections (basic condition, observation, personal/family context, transport, misc, and visitor opinion), plus attached files and relatives.
All queries require authentication and are school-scoped. The surface is read-only — this API exposes only visit reads. Visits are captured through the care application.
Overall Classification
Every student resolves to one of these values:
| Value | Rule |
|---|---|
NOT_VISITED | No visit record exists for the student in scope |
PROBLEM | A visit exists and at least one of 12 risk flags is set |
NORMAL | A visit exists and no risk flags are set |
The 12 risk flags come from the visitor's opinion section: studyAssist, abilityAssist, mentalAssist, physicalAssist, securityAssist, drugAssist, houseAssist, drug, violence, sexual, game, electronic.
List Students
Deduped per student (prefers the row with a visit attached).
query {
visitStudents(classroomId: 42, status: "problem", limit: 50) {
studentId
code
title
firstname
lastname
classroomName
orderNumber
visitId
visitedAt
overall # NOT_VISITED | NORMAL | PROBLEM
overallText # "ยังไม่เยี่ยม" | "ปกติ" | "มีปัญหา"
}
}Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
academicYearId | Int | active year | Scope to a specific academic year |
semesterId | Int | — | Scope to a single semester (overrides academicYearId) |
classroomId | Int | — | Filter to one classroom |
status | String | all | visited | not_visited | problem | normal | all |
limit | Int | 50 | Maximum rows |
offset | Int | 0 | Skip rows |
Aggregate Stats
query {
visitStats {
total
visited
notVisited
problem
normal
}
}Latest Visit (nested on Student)
query {
student(id: 12345) {
id
fullName
classroomName
visit {
id
overall
overallText
visitedAt
infoBasic {
homeConditionEnv
homeCondition
familyRelationship
familySupport
remark
}
infoObservation {
sibling
rank
son
daughter
}
infoPersonal {
homeKind
liveWith
maritalStatus
income
job
}
infoTransport {
distance
method
isSafe
duration
}
infoMisc {
studySupport
behaviorCare
badThings
sickness
disability
}
infoOpinion {
studyAssist
drug
violence
electronic
remark
}
problemFlags {
studyAssist
drug
violence
game
electronic
anyFlag
}
relatives {
id
relativeType
title
firstname
lastname
occupation
}
files {
id
path
kind
}
}
}
}Student.visit
| Argument | Type | Description |
|---|---|---|
semesterId | Int | Optional. When omitted, returns the most recent visit across all semesters. |
Returns Visit (nullable) — null if the student has never been visited. All info* sub-sections are nullable because different schools configure different sections.
Errors
| Code | Cause |
|---|---|
UNAUTHENTICATED | No valid JWT or API key |
FORBIDDEN | JWT has no schoolId |
NOT_FOUND | Student not found in your school |