{
  "resourceType": "StructureDefinition",
  "id": "5a3085ad-5f55-4956-9819-20e0ddbaf3ac",
  "meta": {
    "lastUpdated": "2023-04-18T06:58:58.6096369+00:00"
  },
  "url": "https://simplifier.net/winningtest/account-profile",
  "name": "Account",
  "title": "账户",
  "status": "draft",
  "date": "2023-04-18T06:59:09.8310354+00:00",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Account",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Account",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Account.extension",
        "path": "Account.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Account.extension:balance",
        "path": "Account.extension",
        "sliceName": "balance",
        "short": "账户余额",
        "definition": "FHIR官方宣称，由于定价的复杂性，Account目前没有直接在资源属性上表示余额，但会在将来考虑获取当前余额的操作。因此在这里，我们只好使用扩展来表示余额。但这一设计可能会根据将来FHIR的资源变更而做出调整。",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-balance"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:communityContract",
        "path": "Account.extension",
        "sliceName": "communityContract",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-community-contract"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:reminderAmount",
        "path": "Account.extension",
        "sliceName": "reminderAmount",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-reminder-amount"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:avaliableBalance",
        "path": "Account.extension",
        "sliceName": "avaliableBalance",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-available-balance"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:controlLineAmount",
        "path": "Account.extension",
        "sliceName": "controlLineAmount",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-control-line-amount"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:expensedAmount",
        "path": "Account.extension",
        "sliceName": "expensedAmount",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-expensed-amount"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:depositAmount",
        "path": "Account.extension",
        "sliceName": "depositAmount",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-deposit-amount"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:paymentCount",
        "path": "Account.extension",
        "sliceName": "paymentCount",
        "definition": "住院患者就诊过程中的结算次数",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-payment-count"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:deductibleAmount",
        "path": "Account.extension",
        "sliceName": "deductibleAmount",
        "short": "起付标准金额",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-deductible-amount"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:avaliableReliefAmount",
        "path": "Account.extension",
        "sliceName": "avaliableReliefAmount",
        "short": "救助余额",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-avaliable-relief-amount"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:settledTotal",
        "path": "Account.extension",
        "sliceName": "settledTotal",
        "short": "已结算累计审核金额",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-settled-total"
            ]
          }
        ]
      },
      {
        "id": "Account.extension:payable",
        "path": "Account.extension",
        "sliceName": "payable",
        "short": "待充值金额",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-payable"
            ]
          }
        ]
      },
      {
        "id": "Account.identifier",
        "path": "Account.identifier",
        "max": "0"
      },
      {
        "id": "Account.status",
        "path": "Account.status",
        "fixedCode": "active"
      },
      {
        "id": "Account.subject",
        "path": "Account.subject",
        "short": "挂账患者",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://simplifier.net/winningtest/patient-profile"
            ],
            "aggregation": [
              "referenced",
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Account.servicePeriod",
        "path": "Account.servicePeriod",
        "max": "0"
      },
      {
        "id": "Account.coverage",
        "path": "Account.coverage",
        "short": "医保"
      },
      {
        "id": "Account.coverage.coverage",
        "path": "Account.coverage.coverage",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://simplifier.net/winningtest/medical-insurance-profile"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Account.coverage.priority",
        "path": "Account.coverage.priority",
        "max": "0"
      },
      {
        "id": "Account.owner",
        "path": "Account.owner",
        "max": "0"
      },
      {
        "id": "Account.description",
        "path": "Account.description",
        "max": "0"
      },
      {
        "id": "Account.guarantor",
        "path": "Account.guarantor",
        "short": "担保人/挂账单位",
        "definition": "判断guarantor下reference为Organization的值是否为空，如果为空为普通患者，否则为挂账患者"
      },
      {
        "id": "Account.guarantor.extension",
        "path": "Account.guarantor.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Account.guarantor.extension:amount",
        "path": "Account.guarantor.extension",
        "sliceName": "amount",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://simplifier.net/winningtest/extension-guaranteed-amount"
            ]
          }
        ]
      },
      {
        "id": "Account.guarantor.extension:amount.value[x]:valueMoney",
        "path": "Account.guarantor.extension.value[x]",
        "sliceName": "valueMoney"
      },
      {
        "id": "Account.guarantor.extension:amount.value[x]:valueMoney.currency",
        "path": "Account.guarantor.extension.value[x].currency",
        "max": "0"
      },
      {
        "id": "Account.guarantor.party",
        "path": "Account.guarantor.party",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson",
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ],
            "aggregation": [
              "contained",
              "referenced"
            ]
          }
        ]
      },
      {
        "id": "Account.guarantor.party.reference",
        "path": "Account.guarantor.party.reference",
        "max": "0"
      },
      {
        "id": "Account.guarantor.party.type",
        "path": "Account.guarantor.party.type",
        "max": "0"
      },
      {
        "id": "Account.guarantor.party.identifier",
        "path": "Account.guarantor.party.identifier",
        "max": "0"
      },
      {
        "id": "Account.guarantor.party.display",
        "path": "Account.guarantor.party.display",
        "short": "担保人"
      },
      {
        "id": "Account.guarantor.onHold",
        "path": "Account.guarantor.onHold",
        "max": "0"
      },
      {
        "id": "Account.guarantor.period",
        "path": "Account.guarantor.period",
        "max": "0"
      },
      {
        "id": "Account.partOf",
        "path": "Account.partOf",
        "max": "0"
      }
    ]
  }
}