高血壓在台灣與全球皆為常見的慢性疾病。早期高血壓常缺乏明顯症狀,卻會增加心血管疾病、腦中風及腎臟病風險。因此,若能利用長期電子病歷提早辨識高風險病人,將有助於後續追蹤與健康管理。然而,區域醫院的門診紀錄常有資料稀疏與回診不規則等問題。一般表格或單一時間序列方法,也較難保留不同臨床實體之間的關係。 本研究將門診紀錄整理為病人季度事件,並建構病人-季度時間異質圖。圖中包含病人、病人季度、疾病、藥物、臨床系統、年齡層、性別及日曆季度等節點。模型使用 Heterogeneous Graph Transformer 整合不同節點與關係,再由多層感知器預測未來一年高血壓風險。研究比較不同觀察期與最低看診季度數,並選用一年觀察期至少三季看診,以及三年觀察期至少五季看診作為主要設定。兩組模型的 AUROC 分別為 0.878 與 0.860。 本研究使用 HeteroPGExplainer 解釋訓練完成的模型。解釋器依不同關係建立遮罩,並將結果彙整為單一特徵重要性與特徵組合共同重要性。分析範圍包含疾病、藥物、臨床系統、年齡、性別及季度等特徵。結果顯示,兩個觀察期的上層臨床系統大致一致,但具體特徵呈現不同的時間脈絡。一年模型較偏向近期感染、急性循環事件及短期治療。三年模型則涵蓋較廣的神經與感覺器官疾病、消化疾病、腫瘤及長期用藥背景。 模型錯誤分析顯示,一年模型在 45-74 歲族群的病例辨識率高於三年模型。20-44 歲則是兩組模型較容易漏判的族群。糖尿病、脂質代謝異常及慢性缺血性心臟病有助於病例辨識。心衰竭與慢性腎臟病則可能提高部分對照組的偽陽性率。整體而言,時間異質圖可整合長期門診資料,HeteroPGExplainer 則可呈現模型使用的單一特徵與特徵組合。這些結果屬於模型歸因,不代表臨床因果關係。;Hypertension is a common chronic disease in Taiwan and worldwide. Early hypertension is often asymptomatic, but it increases the risks of cardiovascular disease, stroke, and kidney disease. Longitudinal electronic health records may support the early identification of patients at increased risk and improve subsequent monitoring. However, outpatient records from regional hospitals are often sparse and irregular. Conventional tabular and sequential approaches may also fail to preserve relationships among different clinical entities. This study aggregated outpatient records into patient-quarter events and constructed a patient-quarter temporal heterogeneous graph. The graph included patients, patient quarters, diseases, medications, clinical systems, age groups, sex, and calendar quarters as node types. A Heterogeneous Graph Transformer integrated information across different node and relation types. A multilayer perceptron then predicted the risk of hypertension within the following year. Different observation windows and minimum numbers of active visit quarters were compared. The final settings were a one-year observation window with at least three active quarters and a three-year observation window with at least five active quarters. Their AUROC values were 0.878 and 0.860, respectively. HeteroPGExplainer was applied to the trained models. The explainer learned relation-specific masks and aggregated them into single-feature importance and joint importance of feature combinations. The analysis included diseases, medications, clinical systems, age groups, sex, and calendar quarters. The main clinical systems were generally consistent across the two observation windows, whereas the specific features reflected different temporal contexts. The one-year model emphasized recent infections, acute circulatory events, and short-term treatments. The three-year model captured broader histories involving nervous system and sense organ disorders, digestive diseases, neoplasms, and long-term medication use. The error analysis showed that the one-year model had higher case sensitivity than the three-year model among patients aged 45-74 years. Patients aged 20-44 years were more likely to be missed by both models. Diabetes, dyslipidemia, and chronic ischemic heart disease supported the identification of hypertension cases. In contrast, heart failure and chronic kidney disease were associated with higher false-positive rates among some controls. Overall, the temporal heterogeneous graph integrated longitudinal outpatient information, while HeteroPGExplainer identified the single features and feature combinations used by the model. These findings represent model attribution and should not be interpreted as causal clinical effects.