IDMP属性スキル(医薬品情報の属性を扱う機能) 定義と値の読み取り、履歴の確認、式の評価、名前の予約、テストデータの安全な書き込みを行うためのスキルです。
IDMP attribute skill for reading definitions and values, checking history, evaluating expressions, reserving names, and safely writing test data.
まず../idmp-shared/SKILL.mdを読んでください。
書き込み操作の前に: 🛑 破壊的操作の確認プロトコルに従ってください。読み取り専用コマンドはここで読み取り専用のままですが、削除・書き込み・更新の処理には、共有の承認ゲートが必要です。
| ショートカット | 目的 |
|---|---|
+list |
値または履歴の操作を始める前に、属性の定義を読む。 |
+get |
ある属性の現在の値を読む。 |
+data |
複数の現在の値を1つのリクエストで読む。 |
+history |
ある属性の履歴データを読む。 |
attributesで定義を読む。data-getまたはdata-postで現在の値を読む。--ack-riskなしでnew-nameを実行する。attribute evaluate-expression createを実行する。write-dataを使う。| 情報 | 属性の作成または書き込みの前に解決が必要な理由 |
|---|---|
| 所有元素 | 名前の確保、属性の作成、定義と値の再読み込みを行うには、最終的なelementIdが必要です。 |
| 候補となる属性名 | attribute attributes new-nameは、所有元素が確定した後でのみ機能します。 |
| 属性タイプ計画 | 属性のvalueType(値の種類)と、その属性がメタデータのみ、計算式に基づくもの、またはメトリックに基づいた書き込み可能な参照かを決める必要があります。 |
| 書き込み先 | write-dataを新規に作成した属性ではなく、既存のTDengine(時系列データベース)メトリック参照に向けるかを判断します。 |
| 検証とクリーンアップの対象 | 作成の成功を証明する方法、書き込まれたデータを再読み込みする方法、最後に削除する必要がある一時的な属性を決めます。 |
attribute attributes new-nameは所有元素のスコープのみが必要ですが、attributes-postは確保済みの最終的な名前と実際のvalueTypeを使う必要があります。attribute evaluate-expression createであり、スキーマパスはattribute.evaluate-expression.createです。古い推測値であるattribute.attributes.evaluate-expressionパスは間違っています。attribute.attributes.evaluate-expressionパスが記載されている場合があります。実際のリクエストにはidmp-cli attribute evaluate-expression create --dry-run --ack-risk --paramsを使ってください。attribute evaluate-expression createには、最低限dataReferenceTypeとexpressionを含むリクエスト本文が必要です。実運用での安全な開始は{"dataReferenceType":"Formula","expression":"..."}です。attributeIdとuomIdはオプションの文脈ヘルパーであり、計算式テキストの代替ではありません。attribute write-data createはetda390037エラーで失敗することがあります。attribute historydata listは周囲のデフォルト値に頼るのではなく、明示的なstartとendの範囲を使うべきです。attributesの再読み込みで新しい定義が同じ所有元素の下に表示されるまで、完了しません。attrTempIdを持つ場合、汎用のattribute elements attributes-deleteパスはバックアップのテンプレートが存在するため、削除を拒否することが予想されます。write-data検証で異なる既存のメトリック基盤属性を使った場合でも、ワークフロー後に削除すべきです。attribute elements attributes --paramsで新しい定義が同じ所有元素の下で再読み込みされた時のみ完了します。data-get、data-post、または範囲指定されたhistorydata listが意図した属性データを返すときのみ完了します。idmp-cli schema attribute.elements.attributes
idmp-cli attribute elements attributes --params '{"elementId":1}'
idmp-cli schema attribute.attributes.new-name
# new-nameは読み取り専用(名前を確保)。--ack-riskは不要です
idmp-cli attribute attributes new-name --params '{"elementId":1}'
idmp-cli schema attribute.elements.attributes-post
idmp-cli attribute elements attributes-post --ack-risk --params '{"elementId":1}' --data '{"name":"probe-attribute","valueType":"Double"}'
idmp-cli schema attribute.evaluate-expression.create
idmp-cli attribute evaluate-expression create --params '{"elementId":1}' --data '{...}' --dry-run --ack-risk
idmp-cli schema attribute.attributes.data-get
idmp-cli attribute attributes data-get --params '{"elementId":1,"attributeId":2}'
idmp-cli schema attribute.historydata.list
idmp-cli attribute historydata list --params '{"elementId":1,"attributeId":2,"current":1,"size":20,"start":1704067200000,"end":1704153600000}'
attributesで属性が返されない場合、古いノートやスクリプトからIDを推測しないでください。new-nameが別の候補を返す場合は、元の名前を無理に使わず、確保済みの値を使ってください。etda390037などのエラーで拒否された場合、新規に作成した属性が書き込み可能だと仮定せず、判明済みのメトリック基盤属性に切り替えてください。idmp-cli schema attribute.elements.attributesとidmp-cli attribute elements attributes --params '{"elementId":1}'で属性定義を読む。idmp-cli attribute attributes new-name --params '{"elementId":1}'で作成安全な名前を確保する。idmp-cli attribute attributes data-get --params '{"elementId":1,"attributeId":2}'で1つの実運用値を読む。idmp-cli attribute attributes new-name --params '{"elementId":1}'の後、プローブ属性を作成する。次にidmp-cli attribute elements attributes-post --ack-risk --params '{"elementId":1}' --data '{"name":"probe-attribute","valueType":"Double"}'で作成パスを検証する。idmp-cli attribute historydata list --params '{"elementId":1,"attributeId":2,"current":1,"size":20,"start":1704067200000,"end":1704153600000}'で履歴ページングを確認してから、対象属性が書き込み可能なメトリック参照であることが確認でき、かつidmp-cli attribute evaluate-expression create --params '{"elementId":1}' --data '{"dataReferenceType":"Formula","expression":"AVG(${attributes['"'"'Current'"'"']})"}' --dry-run --ack-riskが既に成功した後、idmp-cli attribute write-data create --dry-run --ack-risk --params '{"elementId":1}' --data '{"probe":"example"}'のみを使う。Read ../idmp-shared/SKILL.md first.
Before any write: Follow the 🛑 Destructive op confirmation protocol. Read-only commands stay read-only here, but delete / write / patch flows still require the shared yes-gate.
| Shortcut | Purpose |
|---|---|
+list |
Read attribute definitions before value or history work. |
+get |
Read one attribute's current value. |
+data |
Read multiple current values in one request. |
+history |
Read historical data for one attribute. |
attributes.data-get or data-post only when needed.new-name without --ack-risk before creating an attribute.attribute evaluate-expression create before saving a formula or expression.write-data only when you need controlled test input on a metric-backed attribute.| Context | Why it must be resolved before create or write |
|---|---|
| Owner element | You need the final elementId before you can reserve names, create the attribute, or reread definitions and values. |
| Candidate attribute name | attribute attributes new-name only works after the owner is fixed. |
| Attribute type plan | You need the intended valueType and whether the attribute is only metadata, expression-backed, or a metric-backed writable reference. |
| Write target | Decide whether write-data should target an existing TDengine metric reference rather than the newly created attribute. |
| Verification and cleanup target | Decide how you will prove create success, how you will reread written data, and which temporary attribute must be deleted at the end. |
attribute attributes new-name only needs the owner scope, but attributes-post must use the final reserved name and a real valueType.attribute evaluate-expression create, and the schema path is attribute.evaluate-expression.create; the older guessed attribute.attributes.evaluate-expression path is wrong.attribute.attributes.evaluate-expression path; use idmp-cli attribute evaluate-expression create --dry-run --ack-risk --params for the real request.attribute evaluate-expression create needs a request body with at least dataReferenceType and expression. The live-safe starter is {"dataReferenceType":"Formula","expression":"..."}; attributeId and uomId are optional context helpers, not substitutes for the formula text.attribute write-data create can fail with etda390037 unless the target attribute is backed by writable metric storage.attribute historydata list should use explicit start and end bounds instead of relying on ambient defaults.attributes reread shows the new definition.attrTempId, the generic attribute elements attributes-delete path is expected to reject the delete while the backing template exists.attribute elements attributes --params rereads the new definition under the same owner.data-get, data-post, or bounded historydata list returns the intended attribute data.idmp-cli schema attribute.elements.attributes
idmp-cli attribute elements attributes --params '{"elementId":1}'
idmp-cli schema attribute.attributes.new-name
# new-name is read-only (reserves a name); no --ack-risk required
idmp-cli attribute attributes new-name --params '{"elementId":1}'
idmp-cli schema attribute.elements.attributes-post
idmp-cli attribute elements attributes-post --ack-risk --params '{"elementId":1}' --data '{"name":"probe-attribute","valueType":"Double"}'
idmp-cli schema attribute.evaluate-expression.create
idmp-cli attribute evaluate-expression create --params '{"elementId":1}' --data '{...}' --dry-run --ack-risk
idmp-cli schema attribute.attributes.data-get
idmp-cli attribute attributes data-get --params '{"elementId":1,"attributeId":2}'
idmp-cli schema attribute.historydata.list
idmp-cli attribute historydata list --params '{"elementId":1,"attributeId":2,"current":1,"size":20,"start":1704067200000,"end":1704153600000}'
attributes, do not guess the ID from older notes or scripts.new-name returns a different candidate, use the reserved value instead of forcing the original name.etda390037, switch to a known metric-backed attribute; do not assume the newly created attribute is writable.idmp-cli schema attribute.elements.attributes and idmp-cli attribute elements attributes --params '{"elementId":1}'.idmp-cli attribute attributes new-name --params '{"elementId":1}'.idmp-cli attribute attributes data-get --params '{"elementId":1,"attributeId":2}'.idmp-cli attribute attributes new-name --params '{"elementId":1}', then verify the create path with idmp-cli attribute elements attributes-post --ack-risk --params '{"elementId":1}' --data '{"name":"probe-attribute","valueType":"Double"}'.idmp-cli attribute historydata list --params '{"elementId":1,"attributeId":2,"current":1,"size":20,"start":1704067200000,"end":1704153600000}', then use idmp-cli attribute write-data create --dry-run --ack-risk --params '{"elementId":1}' --data '{"probe":"example"}' only after confirming the target attribute is a writable metric reference and idmp-cli attribute evaluate-expression create --params '{"elementId":1}' --data '{"dataReferenceType":"Formula","expression":"AVG(${attributes['"'"'Current'"'"']})"}' --dry-run --ack-risk already succeeded.原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。