|
An AI-Built Headache Diary: Visualizing Headache and Medication Records in an Annual Calendar
This is a fully functional web application with multiple screens and features for importing, organizing, analyzing, and displaying headache records. Rather than showing the entire application, this article highlights a selection of representative screens and functions.
Headache records tend to become fragmented across medication dates, clinic visits, preventive injections, travel, and changes in health. Even when daily records exist, it is not always easy to understand long-term patterns or explain them clearly during a short medical appointment.
To address this problem, I used ChatGPT and Codex to build a personal web tool that organizes headache-related records into a single annual calendar.
The project had two main goals:
- To create a document that could be shown directly to a doctor
- To make it easier to understand my own headache and medication patterns
Consolidating a Year of Headache Records into One Calendar
The calendar displays all 12 months, from January to December, side by side. Each day displays information such as headache medication use, visits to a headache clinic, preventive injections such as Emgality, and related events including travel or changes in health.
To keep the dense annual layout readable, medication names are shown using short labels:
- T = Triptan
- L = Loxoprofen
- R = Reyvow
- CL = Headache clinic visit
- EMG = Emgality
At the bottom of each month, the calendar shows the number of headache days and the number of days on which each medication type was used. If the same medication was taken more than once on the same day, it is still counted as one medication-use day.
In this tool, a “headache day” means a day on which medication for a headache was recorded. Headaches for which no medication was used are not included.

Designed to Be Shown Directly to a Doctor
The most important design objective was not to add as many functions as possible, but to make the record easy to explain during a medical appointment.
Because the entire year can be viewed on one page, it is possible to quickly identify months with more headache days, periods of concentrated medication use, and the timing of preventive injections.
The print layout is designed for a single A4 landscape page. It does not rely on color, so the information remains readable in black and white. Avoiding hidden, truncated, or overlapping text was also treated as an essential requirement.
Using AI as the Input Method Instead of Building a Form
Most headache diary apps include a form for entering symptoms and medication every day. I intentionally chose not to build a conventional input interface.
Record formats vary from person to person, and medication abbreviations or additional notes are rarely consistent. Rather than forcing every record into a fixed form, I found it more efficient to describe the date and content to ChatGPT, review the result, and organize the confirmed information into CSV data.
The current workflow is:
- Provide the date, medication use, and related information to the AI
- Let the AI structure the record
- Review the result manually and correct any mistakes
- Save the confirmed data in a CSV file
- Use the web application to generate the annual calendar and printable output
In other words, AI acts as the input interface, while the web application is dedicated to display and printing.
Viewing the Most Recent 12 Months in the Same Format
In addition to the standard January-to-December annual view, the tool can display the most recent 12 months, with the current month shown as the final column.
This makes it possible to review a continuous one-year period across calendar years while keeping the same visual structure.

Building a Personal Tool with AI
Rather than adapting my record-keeping method to an existing headache app, I designed the tool by working backward from the output I actually needed.
ChatGPT was used to organize records and refine the specifications. Codex was used to implement the web application, print layout, and validation processes. The PDF output was reviewed repeatedly, with gradual adjustments to typography, grid lines, spacing, monthly summaries, and the presentation of multi-day events.
One of the major advantages of AI-assisted development is the ability to create a small, highly specific tool for a particular problem instead of relying entirely on a general-purpose service.
Possible Future Developments
The current priority is to display headache and medication records accurately.
In the future, the data could potentially be combined with weather, temperature, atmospheric pressure, seasons, travel, and business trips to explore patterns such as:
- Changes in headache frequency by season or temperature
- Possible relationships with weather or atmospheric pressure
- Medication-use patterns during travel or business trips
- Headache days between one preventive injection and the next clinic visit
- Long-term patterns specific to the individual
The goal would not be to make broad claims about headache patterns, but to investigate whether long-term personal records reveal patterns unique to the individual.
Summary
This headache calendar was created to organize previously scattered headache, medication, and clinic-visit records into an annual document that can be shown directly to a doctor.
Instead of building a manual input form, the data is structured through conversations with AI, while the web application focuses on clear display and printing.
AI makes it possible to build a practical personal tool around an individual record-keeping method—something that would be difficult to achieve with a standard, general-purpose service.
This tool is intended only to organize and display personal headache and medication records. It does not provide medical diagnosis, treatment decisions, or medication recommendations. All images published on this page use completely fictional sample data.
This is currently a personal tool. If you would be interested in using it, or if you think features like these would be useful, please let me know in the comments. Depending on the response, I may explore how the project could develop in the future. (Contact me by DM on X)
AIで作った頭痛ダイアリー|頭痛・服薬記録を年間カレンダーで可視化
この頭痛記録・分析ツールは、記録の読み込み、内容の整理、期間ごとの分析、結果の表示など、複数の画面と機能を備えた実際に動作するWebアプリです。本記事では、そのすべてではなく、主な特徴が伝わりやすい画面と機能を抜粋して紹介します。
頭痛の記録は、服薬日、頭痛外来の受診日、予防注射、旅行や体調の変化など、複数の情報に分かれがちです。日々の記録が残っていても、長期的な変化を把握し、診察時に短時間で説明することは簡単ではありません。
そこで、ChatGPTとCodexを使い、頭痛に関する記録を年間カレンダー形式で一覧表示する個人用Webツールを作成しました。
目的は、単に記録を蓄積することではなく、次の2点です。
- 医師にそのまま見せられる資料にする
- 自分自身が頭痛と服薬の傾向を把握できるようにする
頭痛記録を1年分のカレンダーに集約
画面には、1月から12月までの12カ月を横並びで表示します。各日には、頭痛薬の服用、頭痛外来の受診、エムガルティなどの予防注射、旅行や体調に関する情報を表示します。
狭い年間カレンダーでも一覧性を保つため、薬剤名は短い記号で表示します。
- ト = トリプタン
- ロ = ロキソニン
- レイ = レイボー
- 診 = 頭痛外来
- エムガ = エムガルティ
月の下部には、頭痛日数と薬剤別の使用日数を表示します。同日に同じ薬を複数回使用しても、薬剤別日数としては1日と数えます。
ここでいう「頭痛日数」は、頭痛目的の服薬が記録された日数です。薬を使用しなかった頭痛は含みません。

医師に見せることを前提に設計
このツールで最も重視したのは、画面上の多機能さではなく、診察時の説明のしやすさです。
年間全体を1枚で確認できるため、頭痛日数が多かった月、薬剤の使用が集中した時期、予防注射のタイミングなどを短時間で共有できます。
印刷はA4横1ページを前提とし、カラーに依存せず、白黒でも判読できるようにしました。文字の省略や切断を避け、日付、服薬、受診情報が重ならないことも重要な設計条件です。
入力画面を作らず、AIを入力手段にした
一般的な頭痛ダイアリーには、毎日の症状や服薬を入力するフォームがあります。このツールでは、入力画面をあえて作っていません。
記録形式は人によって異なり、薬剤の略称や補足情報も一定ではありません。そのため、固定フォームへ合わせるより、日付と内容をChatGPTへ伝え、確認しながらCSVへ整理する方が効率的だと考えました。
現在の流れは次のとおりです。
- 日付と服薬内容などをAIへ伝える
- AIが記録を構造化する
- 人間が内容を確認し、誤りを修正する
- 確定したCSVをWebアプリで表示する
- 年間カレンダーやPDFを生成する
つまり、AIを入力インターフェースとして使い、Webアプリは表示と印刷へ特化しています。
直近12カ月も同じ形式で表示
通常の年間版に加え、現在月を最後にした直近12カ月表示も作成しました。
暦年ではなく、直近の診療期間に近い1年間を確認できるため、年をまたいだ変化も同じ形式で比較できます。

AIで開発した個人専用ツール
このプロジェクトでは、既存の頭痛アプリへ記録方法を合わせるのではなく、自分が必要とする出力から逆算してツールを設計しました。
ChatGPTは記録の整理と仕様の検討に使用し、CodexはWebアプリ、印刷レイアウト、検証処理の実装に使用しています。PDFを確認しながら、罫線、フォント、余白、複数日イベントの表示方法なども段階的に調整しました。
汎用サービスではなく、特定の課題に合わせて小さな専用ツールを作れることは、AIを活用した開発の大きな利点だと考えています。
今後できそうなこと
現在は、頭痛と服薬の記録を正確に表示することを優先しています。
今後、天気、気温、気圧、季節、旅行、出張などの情報を組み合わせれば、AIによって次のような傾向を調べられる可能性があります。
- 季節や気温による頭痛日数の変化
- 気圧や天候との関係
- 旅行や出張中の服薬傾向
- 予防注射から次回受診までの頭痛日数
- 自分に特有の頭痛パターン
一般論としての頭痛傾向ではなく、自分自身の長期記録から個別の特徴を見つけられるかが、今後検討したいテーマです。
まとめ
この頭痛カレンダーは、まとまっていなかった頭痛・服薬・受診の情報を、医師に見せやすい年間資料へ整理するために作成しました。
入力フォームを作らず、AIとの対話でデータを構築し、Webアプリは出力へ集中させています。
AIを使うことで、既存サービスでは対応しにくい個人的な記録方法にも合わせて、実用的な専用ツールを作れるようになりました。
このツールは、個人の頭痛・服薬記録を整理して表示するためのものです。診断、治療判断、服薬の推奨を行うものではありません。掲載画像はすべて完全な架空データです。
現在は個人用として開発しています。使ってみたいと思った方や、こうした機能があると便利だと思った方は、コメントで教えてください。皆さんの反応を見ながら、今後どのように発展させられるか考えていきたいと思います。(XのDMで連絡する)
ADVERTISEMENT
Useful Items for Travel & Long Stays
Business Trip Packing List
A practical checklist to review before an overseas business trip or international travel. It helps you check your passport, work essentials, gadgets, and in-flight items before departure.
