{
  "resourceType": "StructureDefinition",
  "id": "jp-medicationquantity",
  "url": "http://jpfhir.jp/fhir/core/StructureDefinition/JP_MedicationQuantity",
  "version": "1.1.1",
  "name": "JP_MedicationQuantity",
  "title": "JP Core Medication Quantity DataType",
  "status": "active",
  "date": "2022-11-02",
  "description": "このデータタイプはQuantity DataTypeに対して、JP Coreにおける薬剤量に関する定義を行なったものである",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    }
  ],
  "kind": "complex-type",
  "abstract": false,
  "type": "Quantity",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Quantity",
  "derivation": "constraint",
  "snapshot": {
    "element": [
      {
        "id": "Quantity",
        "path": "Quantity",
        "short": "薬剤に関する数量と単位を定めたデータイプ",
        "definition": "薬剤に関する数量と単位を定めたデータイプ",
        "comment": "薬剤に関する数量と単位を定めている。ValueおよびCodeを必須としている。単位についてはMERIT9医薬品単位略号の利用を推進している。(**SHOULD**)",
        "min": 0,
        "max": "*",
        "base": {
          "path": "Quantity",
          "min": 0,
          "max": "*"
        },
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "qty-3",
            "severity": "error",
            "human": "If a code for the unit is present, the system SHALL also be present",
            "expression": "code.empty() or system.exists()",
            "xpath": "not(exists(f:code)) or exists(f:system)",
            "source": "http://hl7.org/fhir/StructureDefinition/Quantity"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "SN (see also Range) or CQ"
          },
          {
            "identity": "rim",
            "map": "PQ, IVL<PQ>, MO, CO, depending on the values"
          }
        ]
      },
      {
        "id": "Quantity.id",
        "path": "Quantity.id",
        "representation": [
          "xmlAttr"
        ],
        "short": "Unique id for inter-element referencing",
        "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ],
            "code": "http://hl7.org/fhirpath/System.String"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "Quantity.extension",
        "path": "Quantity.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "description": "Extensions are always sliced by (at least) url",
          "rules": "open"
        },
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "Element.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "Quantity.value",
        "path": "Quantity.value",
        "short": "（精度が暗示された）数値",
        "definition": "計測された量。精度を含めた値が暗示される。",
        "comment": "暗示された精度については常に尊重すべきである。貨幣計算では制度に関する独自のルールがある（会計についての標準的な教科書を参照すること）。",
        "requirements": "Precision is handled implicitly in almost all cases of measurement.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Quantity.value",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "decimal"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "SN.2  / CQ - N/A"
          },
          {
            "identity": "rim",
            "map": "PQ.value, CO.value, MO.value, IVL.high or IVL.low depending on the value"
          }
        ]
      },
      {
        "id": "Quantity.comparator",
        "path": "Quantity.comparator",
        "short": "< | <= | >= | > - 値の解釈法",
        "definition": "実際の値が計測して示された値よりも大きいのか小さいのかなど、値がどのように解釈され、表現されるのかを示している。たとえば、もし、comparatorエレメントが\"<\"であれば、実際の値は示された値よりも小さい(<)。",
        "comment": "FHIRの文字列は1MB以上の大きさとなってなはらない(SHALL NOT)。",
        "requirements": "計測法に制限があって値が<5ug/L や >400mg/L として示されるような場合でも値を扱えるようなフレームワークが必要である。",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Quantity.comparator",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "meaningWhenMissing": "If there is no comparator, then there is no modification of the value",
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": true,
        "isModifierReason": "This is labeled as \"Is Modifier\" because the comparator modifies the interpretation of the value significantly. If there is no comparator, then there is no modification of the value",
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "QuantityComparator"
            }
          ],
          "strength": "required",
          "description": "How the Quantity should be understood and represented.",
          "valueSet": "http://hl7.org/fhir/ValueSet/quantity-comparator|4.0.1"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "SN.1  / CQ.1"
          },
          {
            "identity": "rim",
            "map": "IVL properties"
          }
        ]
      },
      {
        "id": "Quantity.unit",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Quantity.unit",
        "short": "単位表現",
        "definition": "人間にも可読な単位表現",
        "comment": "FHIRの文字列は1MB以上の大きさとなってなはらない(SHALL NOT)。",
        "requirements": "コンテキストによってさまざまな単位の表現がある。固定された特定の表現が求められることがある。たとえば、mcgはmicrogramを表す。",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Quantity.unit",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "(see OBX.6 etc.) / CQ.2"
          },
          {
            "identity": "rim",
            "map": "PQ.unit"
          }
        ]
      },
      {
        "id": "Quantity.system",
        "path": "Quantity.system",
        "short": "コード化された単位表現を規定するシステム",
        "definition": "単位をコード化して表現するシステムについてのID。",
        "comment": "以下参照。 http://en.wikipedia.org/wiki/Uniform_resource_identifier",
        "requirements": "システムによって定義される単位のコードを把握しておく必要がある。",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Quantity.system",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "uri"
          }
        ],
        "condition": [
          "ele-1",
          "qty-3"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "(see OBX.6 etc.) / CQ.2"
          },
          {
            "identity": "rim",
            "map": "CO.codeSystem, PQ.translation.codeSystem"
          }
        ]
      },
      {
        "id": "Quantity.code",
        "path": "Quantity.code",
        "short": "単位のコード化された形式、【JP Core仕様】MERIT9医薬品単位略号マスタコードを推奨",
        "definition": "単位のコード化された形式、【JP Core仕様】MERIT9医薬品単位略号マスタコードを推奨(**SHOULD**)",
        "comment": "単位のコード化された形式、【JP Core仕様】MERIT9医薬品単位略号マスタコードを推奨(**SHOULD**)されるが、ローカルコード等を利用することも可能とする",
        "requirements": "Need a computable form of the unit that is fixed across all forms. UCUM provides this for quantities, but SNOMED CT provides many units of interest.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Quantity.code",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "condition": [
          "ele-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isSummary": true,
        "binding": {
          "strength": "preferred",
          "valueSet": "http://jpfhir.jp/fhir/core/ValueSet/JP_MedicationUnitMERIT9_VS"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "(see OBX.6 etc.) / CQ.2"
          },
          {
            "identity": "rim",
            "map": "PQ.code, MO.currency, PQ.translation.code"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "Quantity",
        "path": "Quantity",
        "short": "薬剤に関する数量と単位を定めたデータイプ",
        "definition": "薬剤に関する数量と単位を定めたデータイプ",
        "comment": "薬剤に関する数量と単位を定めている。ValueおよびCodeを必須としている。単位についてはMERIT9医薬品単位略号の利用を推進している。(**SHOULD**)"
      },
      {
        "id": "Quantity.value",
        "path": "Quantity.value",
        "short": "（精度が暗示された）数値",
        "definition": "計測された量。精度を含めた値が暗示される。",
        "comment": "暗示された精度については常に尊重すべきである。貨幣計算では制度に関する独自のルールがある（会計についての標準的な教科書を参照すること）。",
        "min": 1
      },
      {
        "id": "Quantity.comparator",
        "path": "Quantity.comparator",
        "short": "< | <= | >= | > - 値の解釈法",
        "definition": "実際の値が計測して示された値よりも大きいのか小さいのかなど、値がどのように解釈され、表現されるのかを示している。たとえば、もし、comparatorエレメントが\"<\"であれば、実際の値は示された値よりも小さい(<)。",
        "comment": "FHIRの文字列は1MB以上の大きさとなってなはらない(SHALL NOT)。",
        "requirements": "計測法に制限があって値が<5ug/L や >400mg/L として示されるような場合でも値を扱えるようなフレームワークが必要である。"
      },
      {
        "id": "Quantity.unit",
        "path": "Quantity.unit",
        "short": "単位表現",
        "definition": "人間にも可読な単位表現",
        "comment": "FHIRの文字列は1MB以上の大きさとなってなはらない(SHALL NOT)。",
        "requirements": "コンテキストによってさまざまな単位の表現がある。固定された特定の表現が求められることがある。たとえば、mcgはmicrogramを表す。"
      },
      {
        "id": "Quantity.system",
        "path": "Quantity.system",
        "short": "コード化された単位表現を規定するシステム",
        "definition": "単位をコード化して表現するシステムについてのID。",
        "comment": "以下参照。 http://en.wikipedia.org/wiki/Uniform_resource_identifier",
        "requirements": "システムによって定義される単位のコードを把握しておく必要がある。"
      },
      {
        "id": "Quantity.code",
        "path": "Quantity.code",
        "short": "単位のコード化された形式、【JP Core仕様】MERIT9医薬品単位略号マスタコードを推奨",
        "definition": "単位のコード化された形式、【JP Core仕様】MERIT9医薬品単位略号マスタコードを推奨(**SHOULD**)",
        "comment": "単位のコード化された形式、【JP Core仕様】MERIT9医薬品単位略号マスタコードを推奨(**SHOULD**)されるが、ローカルコード等を利用することも可能とする",
        "min": 1,
        "binding": {
          "strength": "preferred",
          "valueSet": "http://jpfhir.jp/fhir/core/ValueSet/JP_MedicationUnitMERIT9_VS"
        }
      }
    ]
  }
}