{
  "resourceType": "OperationDefinition",
  "id": "op-coverage-application",
  "url": "https://bpcs.exchange/fhir/OperationDefinition/op-coverage-application",
  "name": "CoverageApplicationUpdate",
  "title": "Create/Update Family Coverage Application",
  "status": "active",
  "kind": "operation",
  "experimental": false,
  "description": "Commits or holds an application for BPCS family coverage",
  "affectsState": true,
  "code": "coverageApplication",
  "resource": [
    "Coverage"
  ],
  "system": false,
  "type": false,
  "instance": true,
  "inputProfile": "https://bpcs.exchange/fhir/StructureDefinition/profile-Parameters-coverage-application",
  "parameter": [
    {
      "name": "coverage",
      "use": "in",
      "min": 1,
      "max": "1",
      "documentation": "The family coverage the application is for",
      "type": "Coverage",
      "referencedFrom": [
        {
          "source": "familyMember.memberCoverage",
          "sourceId": "coverage.extension('https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-Parent').value"
        },
        {
          "source": "familyMember.privateInsurance",
          "sourceId": "coverage.extension('https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-Application').value"
        }
      ]
    },
    {
      "name": "family",
      "use": "in",
      "min": 1,
      "max": "1",
      "documentation": "The family to being covered",
      "type": "Group",
      "referencedFrom": [
        {
          "source": "coverage",
          "sourceId": "Coverage.beneficiary.extension('https://bpcs.exchange/fhir/StructureDefinition/ext-Resource-Subject').value"
        }
      ]
    },
    {
      "name": "delegate",
      "use": "in",
      "min": 1,
      "max": "1",
      "documentation": "An individual outside the family who may be used as a contact",
      "type": "RelatedPerson",
      "referencedFrom": [
        {
          "source": "coverage",
          "sourceId": "coverage.extension('https://bpcs.exchange/fhir/StructureDefinition/ext-Coverage-Delegate').value"
        }
      ]
    },
    {
      "name": "familyMember",
      "use": "in",
      "min": 1,
      "max": "*",
      "documentation": "Information about the coverage for each individiual in the family",
      "part": [
        {
          "name": "memberCoverage",
          "use": "in",
          "min": 1,
          "max": "1",
          "documentation": "Information about the coverage of this individual within the family plan",
          "type": "Coverage"
        },
        {
          "name": "recipient",
          "use": "in",
          "min": 1,
          "max": "1",
          "documentation": "Demographics for this individual",
          "type": "Patient",
          "referencedFrom": [
            {
              "source": "familyMember.memberCoverage",
              "sourceId": "subject"
            },
            {
              "source": "family",
              "sourceId": "member.entity"
            },
            {
              "source": "family",
              "sourceId": "extension('https://bpcs.exchange/fhir/StructureDefinition/ext-Group-Contact').value"
            },
            {
              "source": "familyMember.income",
              "sourceId": "subject"
            },
            {
              "source": "familyMember.consent",
              "sourceId": "subject"
            },
            {
              "source": "familyMember.consent.grantor.resolve().patient",
              "sourceId": "subject"
            },
            {
              "source": "familyMember.privateInsurance",
              "sourceId": "beneficiary"
            }
          ]
        },
        {
          "name": "income",
          "use": "in",
          "min": 1,
          "max": "1",
          "documentation": "Annual income information for this individual",
          "type": "Patient"
        },
        {
          "name": "consent",
          "use": "in",
          "min": 0,
          "max": "1",
          "documentation": "Information about whether the individual has consented for CRA to directly disclose income information for this individual",
          "type": "Patient"
        },
        {
          "name": "privateInsurance",
          "use": "in",
          "min": 0,
          "max": "2",
          "documentation": "Information about private insurance policies held by the member",
          "type": "Patient"
        }
      ]
    }
  ]
}