{
 "openapi": "3.1.0",
 "info": {
  "title": "シルギア 高額療養費の自己負担の上限API",
  "version": "1.0.0",
  "description": "登録不要・無料の高額療養費のAPI。1か月の自己負担の上限（base + (総医療費 − floor) × 1%・1円未満四捨五入）・多数回該当・70歳以上の外来の特例・年間の上限・外来の年間の上限を、療養のあった月の時期（2018年8月〜2026年7月・2026年8月〜2027年7月・2027年8月から）ごとに返します。区分ごとに健康保険・国民健康保険・後期高齢者医療での決め方つき。健康保険法施行令・国民健康保険法施行令・高齢者の医療の確保に関する法律施行令の条文と照らし合わせて作成し、照合した日を data_version で返します。説明: https://api.shirugear.com/kogaku/ 。v1 の中では項目や区分・時期を足すことはあっても、名前や意味は変えません（知らない項目は無視してください）。",
  "termsOfService": "https://api.shirugear.com/terms/",
  "contact": {
   "name": "アナライズギア株式会社（シルギア）",
   "url": "https://shirugear.com/contact"
  }
 },
 "servers": [
  {
   "url": "https://api.shirugear.com"
  }
 ],
 "paths": {
  "/kogaku/v1/under70.json": {
   "get": {
    "summary": "70歳未満の上限（時期ごとの区分と決まり）",
    "operationId": "getUnder70",
    "responses": {
     "200": {
      "description": "70歳未満",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Under70"
          },
          {
           "$ref": "#/components/schemas/Version"
          }
         ]
        }
       }
      }
     },
     "403": {
      "description": "日本国内以外から",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "無いファイル",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "GET/HEAD以外",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/kogaku/v1/over70.json": {
   "get": {
    "summary": "70歳以上の上限（外来の特例・外来の年間の上限つき）",
    "operationId": "getOver70",
    "responses": {
     "200": {
      "description": "70歳以上",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Over70"
          },
          {
           "$ref": "#/components/schemas/Version"
          }
         ]
        }
       }
      }
     },
     "403": {
      "description": "日本国内以外から",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "無いファイル",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "GET/HEAD以外",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/kogaku/v1/rates.json": {
   "get": {
    "summary": "時期・70歳未満・70歳以上・決まりの全部",
    "operationId": "getRates",
    "responses": {
     "200": {
      "description": "全部",
      "content": {
       "application/json": {
        "schema": {
         "allOf": [
          {
           "$ref": "#/components/schemas/Rates"
          },
          {
           "$ref": "#/components/schemas/Version"
          }
         ]
        }
       }
      }
     },
     "403": {
      "description": "日本国内以外から",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "無いファイル",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "GET/HEAD以外",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  },
  "/kogaku/v1/meta.json": {
   "get": {
    "summary": "データの版・時期・ファイルの一覧・出典",
    "operationId": "getMeta",
    "responses": {
     "200": {
      "description": "メタ情報",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Meta"
        }
       }
      }
     },
     "403": {
      "description": "日本国内以外から",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "404": {
      "description": "無いファイル",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     },
     "405": {
      "description": "GET/HEAD以外",
      "content": {
       "application/json": {
        "schema": {
         "$ref": "#/components/schemas/Error"
        }
       }
      }
     }
    }
   }
  }
 },
 "components": {
  "schemas": {
   "Period": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string"
     },
     "from": {
      "type": "string"
     },
     "until": {
      "anyOf": [
       {
        "type": "string"
       },
       {
        "type": "null"
       }
      ]
     },
     "note": {
      "type": "string"
     }
    },
    "required": [
     "key",
     "from",
     "until",
     "note"
    ]
   },
   "Under70Bracket": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string"
     },
     "label": {
      "type": "string"
     },
     "guide": {
      "type": "string"
     },
     "kenpo": {
      "type": "object",
      "properties": {
       "label": {
        "type": "string"
       },
       "min": {
        "anyOf": [
         {
          "type": "integer"
         },
         {
          "type": "null"
         }
        ]
       },
       "max": {
        "anyOf": [
         {
          "type": "null"
         },
         {
          "type": "integer"
         }
        ]
       },
       "nontaxable": {
        "type": "boolean"
       }
      },
      "required": [
       "label"
      ]
     },
     "kokuho": {
      "type": "object",
      "properties": {
       "label": {
        "type": "string"
       },
       "over": {
        "anyOf": [
         {
          "type": "integer"
         },
         {
          "type": "null"
         }
        ]
       },
       "upto": {
        "anyOf": [
         {
          "type": "null"
         },
         {
          "type": "integer"
         }
        ]
       },
       "nontaxable": {
        "type": "boolean"
       }
      },
      "required": [
       "label"
      ]
     },
     "base": {
      "type": "integer"
     },
     "floor": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ]
     },
     "multi": {
      "type": "integer"
     },
     "annual": {
      "anyOf": [
       {
        "type": "null"
       },
       {
        "type": "integer"
       }
      ]
     },
     "specified_disease": {
      "type": "integer"
     }
    },
    "required": [
     "key",
     "label",
     "kenpo",
     "kokuho",
     "base",
     "floor",
     "multi",
     "annual",
     "specified_disease"
    ]
   },
   "Over70Bracket": {
    "type": "object",
    "properties": {
     "key": {
      "type": "string"
     },
     "label": {
      "type": "string"
     },
     "kind": {
      "type": "string"
     },
     "guide": {
      "type": "string"
     },
     "criteria": {
      "type": "object",
      "properties": {
       "kenpo": {
        "type": "string"
       },
       "kokuho": {
        "type": "string"
       },
       "koki": {
        "type": "string"
       }
      },
      "required": [
       "kenpo",
       "kokuho",
       "koki"
      ]
     },
     "base": {
      "type": "integer"
     },
     "floor": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ]
     },
     "multi": {
      "anyOf": [
       {
        "type": "integer"
       },
       {
        "type": "null"
       }
      ]
     },
     "outpatient": {
      "anyOf": [
       {
        "type": "null"
       },
       {
        "type": "integer"
       }
      ]
     },
     "annual": {
      "anyOf": [
       {
        "type": "null"
       },
       {
        "type": "integer"
       }
      ]
     },
     "outpatient_annual": {
      "anyOf": [
       {
        "type": "null"
       },
       {
        "type": "integer"
       }
      ]
     }
    },
    "required": [
     "key",
     "label",
     "kind",
     "criteria",
     "base",
     "floor",
     "multi",
     "outpatient",
     "annual",
     "outpatient_annual"
    ]
   },
   "Rules": {
    "type": "object",
    "properties": {
     "monthly": {
      "type": "object",
      "properties": {
       "formula": {
        "type": "string"
       },
       "rounding": {
        "type": "string"
       },
       "cost": {
        "type": "string"
       },
       "unit": {
        "type": "string"
       }
      },
      "required": [
       "formula",
       "rounding",
       "cost",
       "unit"
      ]
     },
     "multi": {
      "type": "object",
      "properties": {
       "rule": {
        "type": "string"
       },
       "note": {
        "type": "string"
       }
      },
      "required": [
       "rule",
       "note"
      ]
     },
     "household_under70": {
      "type": "object",
      "properties": {
       "min_per_claim": {
        "type": "integer"
       },
       "rule": {
        "type": "string"
       }
      },
      "required": [
       "min_per_claim",
       "rule"
      ]
     },
     "over70": {
      "type": "object",
      "properties": {
       "outpatient": {
        "type": "string"
       },
       "outpatient_annual": {
        "type": "string"
       },
       "copay_note": {
        "type": "string"
       }
      },
      "required": [
       "outpatient",
       "outpatient_annual",
       "copay_note"
      ]
     },
     "annual": {
      "type": "object",
      "properties": {
       "from": {
        "type": "string"
       },
       "period": {
        "type": "string"
       },
       "base_date": {
        "type": "string"
       },
       "rule": {
        "type": "string"
       },
       "first": {
        "type": "string"
       },
       "transitional": {
        "type": "string"
       }
      },
      "required": [
       "from",
       "period",
       "base_date",
       "rule",
       "first",
       "transitional"
      ]
     },
     "turning75": {
      "type": "string"
     },
     "specified_disease": {
      "type": "string"
     },
     "dependents": {
      "type": "string"
     }
    },
    "required": [
     "monthly",
     "multi",
     "household_under70",
     "over70",
     "annual",
     "turning75",
     "specified_disease",
     "dependents"
    ]
   },
   "Version": {
    "type": "object",
    "properties": {
     "currency": {
      "type": "string",
      "enum": [
       "JPY"
      ]
     },
     "data_version": {
      "type": "string"
     }
    },
    "required": [
     "currency",
     "data_version"
    ]
   },
   "Error": {
    "type": "object",
    "properties": {
     "error": {
      "type": "object",
      "properties": {
       "status": {
        "type": "integer"
       },
       "code": {
        "type": "string",
        "enum": [
         "invalid_request",
         "not_found",
         "region_not_allowed",
         "method_not_allowed"
        ]
       },
       "message": {
        "type": "string"
       }
      },
      "required": [
       "status",
       "code",
       "message"
      ]
     }
    },
    "required": [
     "error"
    ]
   },
   "Under70": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "periods": {
      "type": "array",
      "items": {
       "allOf": [
        {
         "$ref": "#/components/schemas/Period"
        },
        {
         "type": "object",
         "properties": {
          "brackets": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Under70Bracket"
           }
          }
         },
         "required": [
          "brackets"
         ]
        }
       ]
      }
     },
     "rules": {
      "type": "object",
      "description": "Rules のうち monthly・multi・household_under70・annual・turning75・specified_disease・dependents"
     }
    },
    "required": [
     "name",
     "periods",
     "rules"
    ]
   },
   "Over70": {
    "type": "object",
    "properties": {
     "name": {
      "type": "string"
     },
     "periods": {
      "type": "array",
      "items": {
       "allOf": [
        {
         "$ref": "#/components/schemas/Period"
        },
        {
         "type": "object",
         "properties": {
          "brackets": {
           "type": "array",
           "items": {
            "$ref": "#/components/schemas/Over70Bracket"
           }
          }
         },
         "required": [
          "brackets"
         ]
        }
       ]
      }
     },
     "rules": {
      "type": "object",
      "description": "Rules のうち monthly・multi・over70・annual・turning75・specified_disease"
     }
    },
    "required": [
     "name",
     "periods",
     "rules"
    ]
   },
   "Rates": {
    "type": "object",
    "properties": {
     "periods": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Period"
      }
     },
     "under70": {
      "type": "object",
      "description": "時期の key（\"2018-08\"・\"2026-08\"・\"2027-08\"）ごとの区分",
      "additionalProperties": {
       "type": "array",
       "items": {
        "$ref": "#/components/schemas/Under70Bracket"
       }
      }
     },
     "over70": {
      "type": "object",
      "description": "時期の key（\"2018-08\"・\"2026-08\"・\"2027-08\"）ごとの区分",
      "additionalProperties": {
       "type": "array",
       "items": {
        "$ref": "#/components/schemas/Over70Bracket"
       }
      }
     },
     "rules": {
      "$ref": "#/components/schemas/Rules"
     }
    },
    "required": [
     "periods",
     "under70",
     "over70",
     "rules"
    ]
   },
   "Meta": {
    "type": "object",
    "properties": {
     "data_version": {
      "type": "string"
     },
     "checked_at": {
      "type": "string"
     },
     "files": {
      "type": "array",
      "items": {
       "type": "string"
      }
     },
     "periods": {
      "type": "array",
      "items": {
       "$ref": "#/components/schemas/Period"
      }
     },
     "scope": {
      "type": "string"
     },
     "sources": {
      "type": "array",
      "items": {
       "type": "object",
       "properties": {
        "label": {
         "type": "string"
        },
        "url": {
         "type": "string"
        }
       },
       "required": [
        "label",
        "url"
       ]
      }
     }
    },
    "required": [
     "data_version",
     "checked_at",
     "files",
     "periods",
     "scope",
     "sources"
    ]
   }
  }
 }
}
