Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
MATCH (r:Recipient)
OPTIONAL MATCH (r)-[:MUST_AVOID]->(ng:NgApproach)
OPTIONAL MATCH (r)-[:FACES_RISK]->(er:EconomicRisk)
WHERE er IS NULL OR er.status = 'Active'
OPTIONAL MATCH (r)-[:HAS_CONDITION]->(mh:MentalHealthStatus)
OPTIONAL MATCH (r)-[:HAS_KEY_PERSON]->(kp:KeyPerson)
RETURN
r.name AS 氏名,
r.dob AS 生年月日,
r.caseNumber AS ケース番号,
count(DISTINCT ng) AS 禁忌登録数,
count(DISTINCT er) AS 経済的リスク数,
count(DISTINCT mh) AS 精神疾患登録数,
count(DISTINCT kp) AS キーパーソン数
ORDER BY r.name
出力加工: 生年月日から年齢を計算して併記。
2. 受給者プロフィール取得(7本柱一括)
7本柱すべての情報を取得するため、複数クエリに分割して実行する。
2a. 基本情報 + 第3の柱(関わり方の知恵)★最優先で実行★
MATCH (r:Recipient)
WHERE r.name CONTAINS $recipientName
OPTIONAL MATCH (r)-[:MUST_AVOID]->(ng:NgApproach)
OPTIONAL MATCH (r)-[:RESPONDS_WELL_TO]->(ea:EffectiveApproach)
OPTIONAL MATCH (r)-[:HAS_TRIGGER]->(ts:TriggerSituation)
RETURN
r.name AS 氏名,
r.dob AS 生年月日,
r.caseNumber AS ケース番号,
r.gender AS 性別,
r.address AS 住所,
r.protectionStartDate AS 保護開始日,
collect(DISTINCT {
description: ng.description,
reason: ng.reason,
riskLevel: ng.riskLevel,
consequence: ng.consequence
}) AS 避けるべき関わり方,
collect(DISTINCT {
description: ea.description,
context: ea.context
}) AS 効果的な関わり方,
collect(DISTINCT {
description: ts.description,
signs: ts.signs,
response: ts.recommendedResponse
}) AS 注意が必要な状況
2b. 第7の柱(金銭的安全)
MATCH (r:Recipient)
WHERE r.name CONTAINS $recipientName
OPTIONAL MATCH (r)-[:FACES_RISK]->(er:EconomicRisk)
WHERE er.status = 'Active'
OPTIONAL MATCH (r)-[:HAS_MONEY_STATUS]->(mms:MoneyManagementStatus)
OPTIONAL MATCH (r)-[:USES_SERVICE]->(dlss:DailyLifeSupportService)
RETURN
collect(DISTINCT {
type: er.type,
perpetrator: er.perpetrator,
relationship: er.perpetratorRelationship,
severity: er.severity,
description: er.description
}) AS 経済的リスク,
mms.capability AS 金銭管理能力,
mms.pattern AS 金銭管理パターン,
mms.riskLevel AS 金銭管理リスク,
mms.observations AS 金銭管理所見,
dlss.socialWelfareCouncil AS 社協名,
dlss.services AS 日自支援サービス,
dlss.status AS 日自支援状態,
dlss.specialist AS 日自支援担当者
2c. 第2の柱(本人像)+ 第1の柱(最近のケース記録)
MATCH (r:Recipient)
WHERE r.name CONTAINS $recipientName
OPTIONAL MATCH (r)-[:HAS_CONDITION]->(mh:MentalHealthStatus)
OPTIONAL MATCH (r)-[:HAS_STRENGTH]->(s:Strength)
OPTIONAL MATCH (r)-[:HAS_RECORD]->(cr:CaseRecord)
WITH r, mh,
collect(DISTINCT {description: s.description, context: s.context}) AS 強み,
cr ORDER BY cr.date DESC
WITH r, mh, 強み,
collect(DISTINCT {
date: cr.date,
category: cr.category,
content: cr.content,
response: cr.recipientResponse
})[..5] AS 最近のケース記録
RETURN
mh.diagnosis AS 精神疾患_診断,
mh.currentStatus AS 精神疾患_状態,
mh.symptoms AS 精神疾患_症状,
mh.treatmentStatus AS 治療状況,
強み,
最近のケース記録
2d. 第5の柱(社会的ネットワーク)
MATCH (r:Recipient)
WHERE r.name CONTAINS $recipientName
OPTIONAL MATCH (r)-[kpRel:HAS_KEY_PERSON]->(kp:KeyPerson)
OPTIONAL MATCH (r)-[:RECEIVES_SUPPORT_FROM]->(so:SupportOrganization)
OPTIONAL MATCH (r)-[:TREATED_AT]->(mi:MedicalInstitution)
RETURN
collect(DISTINCT {
rank: kpRel.rank,
name: kp.name,
relationship: kp.relationship,
contactInfo: kp.contactInfo,
role: kp.role
}) AS キーパーソン,
collect(DISTINCT {
name: so.name,
type: so.type,
contact: so.contactPerson
}) AS 支援機関,
collect(DISTINCT {
name: mi.name,
department: mi.department,
doctor: mi.doctor
}) AS 医療機関
MATCH (n)
WHERE n:Recipient OR n:NgApproach OR n:EffectiveApproach OR n:EconomicRisk
OR n:MoneyManagementStatus OR n:MentalHealthStatus OR n:CaseRecord
OR n:KeyPerson OR n:FamilyMember OR n:SupportOrganization
OR n:Certificate OR n:CollaborationRecord OR n:AuditLog
OR n:Strength OR n:DailyLifeSupportService
WITH labels(n)[0] AS label
RETURN label AS ノード種別, count(*) AS 登録数
ORDER BY 登録数 DESC
4. 証明書の更新期限チェック
MATCH (r:Recipient)-[:HOLDS]->(cert:Certificate)
WHERE cert.expiryDate IS NOT NULL
AND ($recipientName = '' OR r.name CONTAINS $recipientName)
WITH r, cert,
duration.inDays(date(), cert.expiryDate).days AS daysUntilExpiry
WHERE daysUntilExpiry <= $days AND daysUntilExpiry >= 0
RETURN
r.name AS 受給者,
cert.type AS 証明書種類,
cert.grade AS 等級,
cert.expiryDate AS 有効期限,
daysUntilExpiry AS 残り日数
ORDER BY daysUntilExpiry ASC
パラメータ: $recipientName(空文字で全員), $days(デフォルト90)
出力加工: 残り日数で緊急度をグループ化
5. ケース記録の取得
MATCH (r:Recipient)-[:HAS_RECORD]->(cr:CaseRecord)
WHERE r.name CONTAINS $recipientName
RETURN cr.date AS 日付,
cr.category AS 区分,
cr.content AS 内容,
cr.caseworker AS 記録者,
cr.recipientResponse AS 本人の反応
ORDER BY cr.date DESC
LIMIT $limit
パラメータ: $recipientName, $limit(デフォルト10、最大50)
6. 効果的ケアパターンの発見
MATCH (r:Recipient)-[:RESPONDS_WELL_TO]->(ea:EffectiveApproach)
WHERE r.name CONTAINS $recipientName
RETURN ea.description AS 効果的な関わり方,
ea.context AS 状況,
ea.frequency AS 頻度
パラメータ: $recipientName
7. 監査ログ取得
MATCH (al:AuditLog)
WHERE ($recipientName = '' OR al.clientId CONTAINS $recipientName)
AND ($userName = '' OR al.username CONTAINS $userName)
RETURN al.timestamp AS 日時,
al.username AS 操作者,
al.action AS 操作,
al.resourceType AS 対象種別,
al.resourceId AS 対象名,
al.details AS 詳細,
al.clientId AS 受給者,
al.sequenceNumber AS 連番,
al.entryHash AS ハッシュ
ORDER BY al.timestamp DESC
LIMIT $limit
MATCH (al:AuditLog)
WHERE al.clientId CONTAINS $recipientName
RETURN al.timestamp AS 日時,
al.username AS 操作者,
al.action AS 操作,
al.resourceType AS 対象種別,
al.resourceId AS 内容,
al.details AS 詳細
ORDER BY al.timestamp DESC
LIMIT $limit
パラメータ: $recipientName, $limit(デフォルト20)
9. 訪問前ブリーフィング
訪問前に必ず確認すべき情報を Safety First 順で取得。
MATCH (r:Recipient)
WHERE r.name CONTAINS $recipientName
OPTIONAL MATCH (r)-[:MUST_AVOID]->(ng:NgApproach)
OPTIONAL MATCH (r)-[:FACES_RISK]->(er:EconomicRisk)
WHERE er.status = 'Active'
OPTIONAL MATCH (r)-[:HAS_CONDITION]->(mh:MentalHealthStatus)
OPTIONAL MATCH (r)-[:HAS_MONEY_STATUS]->(mms:MoneyManagementStatus)
OPTIONAL MATCH (r)-[:USES_SERVICE]->(dlss:DailyLifeSupportService)
OPTIONAL MATCH (r)-[:RESPONDS_WELL_TO]->(ea:EffectiveApproach)
RETURN r.name AS 受給者名,
collect(DISTINCT {
description: ng.description,
reason: ng.reason,
risk: ng.riskLevel
}) AS 避けるべき関わり方,
collect(DISTINCT {
type: er.type,
perpetrator: er.perpetrator,
severity: er.severity
}) AS 経済的リスク,
mh.diagnosis AS 精神疾患,
mh.currentStatus AS 疾患の状態,
mms.capability AS 金銭管理能力,
mms.pattern AS 金銭管理パターン,
dlss.services AS 自立支援サービス,
collect(DISTINCT {
description: ea.description,
context: ea.context
}) AS 効果的な関わり方
MATCH (target:Recipient)
WHERE target.name CONTAINS $recipientName
MATCH (target)-[:FACES_RISK]->(er:EconomicRisk)
WITH target, collect(er.type) AS targetRiskTypes
MATCH (other:Recipient)-[:FACES_RISK]->(otherRisk:EconomicRisk)
WHERE other.name <> target.name
AND otherRisk.type IN targetRiskTypes
OPTIONAL MATCH (other)-[:USES_SERVICE]->(dlss:DailyLifeSupportService)
RETURN DISTINCT
other.name AS 類似ケース,
collect(DISTINCT otherRisk.type) AS 共通リスク,
dlss.services AS 利用サービス,
otherRisk.status AS リスク状態
パラメータ: $recipientName
12. 多機関連携履歴
MATCH (cr:CollaborationRecord)-[:ABOUT]->(r:Recipient)
WHERE r.name CONTAINS $recipientName
OPTIONAL MATCH (cr)-[:INVOLVED]->(so:SupportOrganization)
RETURN cr.date AS 日付,
cr.type AS 種別,
cr.participants AS 参加者,
cr.decisions AS 決定事項,
cr.nextActions AS 次回アクション,
collect(so.name) AS 関係機関
ORDER BY cr.date DESC
LIMIT $limit
パラメータ: $recipientName, $limit(デフォルト10)
データ登録パターン(書き込みクエリ)
★重要: AI構造化プロセス
旧システムでは Gemini API でケース記録テキストを構造化していたが、スキルベースの新システムでは Claude自身がテキストを構造化 してからCypherで登録する。
構造化の手順
ユーザーからケース記録テキストを受け取る
以下の情報を抽出:
category: 相談/訪問/電話/来所/同行/会議/その他
content: 記録内容
caseworker: 記録者名
recipientResponse: 本人の反応
observations: 観察された事実のリスト
同時に以下も検出:
避けるべき関わり方(NgApproach)
経済的リスクのサイン
効果的だった関わり方
多機関連携のサイン
批判的表現(変換が必要)
ケース記録の登録
MATCH (r:Recipient {name: $recipientName})
CREATE (cr:CaseRecord {
date: date($date),
category: $category,
content: $content,
caseworker: $caseworker,
recipientResponse: $response,
createdAt: datetime()
})
CREATE (r)-[:HAS_RECORD]->(cr)
RETURN cr.date AS 日付, cr.category AS 区分
MATCH (r:Recipient {name: $recipientName})
CREATE (er:EconomicRisk {
type: $type,
perpetrator: $perpetrator,
perpetratorRelationship: $relationship,
severity: $severity,
description: $description,
discoveredDate: date($discoveredDate),
status: $status,
createdAt: datetime()
})
CREATE (r)-[:FACES_RISK]->(er)
WITH r, er
OPTIONAL MATCH (fm:FamilyMember {recipientName: $recipientName})
WHERE fm.relationship = $relationship OR fm.name = $perpetrator
FOREACH (_ IN CASE WHEN fm IS NOT NULL THEN [1] ELSE [] END |
MERGE (fm)-[:POSES_RISK]->(er)
SET fm.riskFlag = true
)
RETURN er.type AS 種類, er.severity AS 深刻度