Skip to content

Conversation

@clovis517
Copy link
Contributor

Schema changes to enforce constraints which were being bypassed due to dependencies on unsupported JSON Schema draft-07 functionality.

Unsupported functionality replaced :

   const
   if .. then
   exclusiveMinimum

Replace "const" with "enum"
Replace "if" "then" with "oneOf"
Replace "exclusiveMinumim" with slightly larger "minimum"

Replace some "pattern" with "enum" for improved performance
Replace "const" with "enum"
Replace "if" "then" with "oneOf"

Change service_code pattern to match in-network
Replace "if" "then" with "oneOf"
Move "Plan Sponsor Name" to match the field position in README
@blakehice4
Copy link

@shaselton do we know if/when we can expect this to be approved?

@clovis517
Copy link
Contributor Author

clovis517 commented Jan 26, 2026

@shaselton do we know if/when we can expect this to be approved?

FYI ... I just re-patched the TOC schema in my pull request, my first attempt was not enforcing the plan_sponsor_name requirement as intended.

Example files to test with :
This should FAIL: ... "Message: Object is missing the following members required by the schema: 'plan_sponsor_name'."
/schema-repo/examples/table-of-contents/INVALID.table-of-contents-sample.ein.MISSING_plan_sponsor_name.json

{
  "reporting_entity_name": "ACME Health Insurance",
  "reporting_entity_type": "Health Insurance Issuer",
  "last_updated_on": "2023-04-19",
  "version": "2.0.0",
  "reporting_structure": [
    {
      "reporting_plans": [
        {
          "plan_name": "ACME PPO Plan",
          "issuer_name": "ACME Health Insurance Corporation",
          "plan_id_type": "ein",
          "plan_id": "123456789",
          "plan_market_type": "group"
        }
      ],
      "in_network_files": [
        {
          "description": "in-network file",
          "location": "https://raw.githubusercontent.com/CMSgov/price-transparency-guide/refs/heads/master/examples/in-network-rates/in-network-rates-all-negotiated-types-sample.json"
        }
      ]
    }
  ]
}

This should PASS:
/schema-repo/examples/table-of-contents/table-of-contents-sample.ein.json

{
  "reporting_entity_name": "ACME Health Insurance",
  "reporting_entity_type": "Health Insurance Issuer",
  "last_updated_on": "2023-04-19",
  "version": "2.0.0",
  "reporting_structure": [
    {
      "reporting_plans": [
        {
          "plan_name": "ACME PPO Plan",
          "issuer_name": "ACME Health Insurance Corporation",
          "plan_id_type": "ein",
          "plan_id": "123456789",
          "plan_sponsor_name": "Anvil Corp",
          "plan_market_type": "group"
        }
      ],
      "in_network_files": [
        {
          "description": "in-network file",
          "location": "https://raw.githubusercontent.com/CMSgov/price-transparency-guide/refs/heads/master/examples/in-network-rates/in-network-rates-all-negotiated-types-sample.json"
        }
      ]
    }
  ]
}

"oneOf"  .. "required": ["plan_sponsor_name"] was disregarded when placed within the object definition.   Moving it outside of the object definition enforces the constraint as intended.
…definition

in-network-rates schema  : Move plan_id_type "ein" plan_sponsor_name constraint outside of the object definition to prevent it from being disregarded.
The oneOf added in the last change for ein+plan_sponsor_name did not handle the multi-plan scenario where plan information is reported in the Table of Contents instead of in the in-network-rates file.
@clovis517
Copy link
Contributor Author

The in-network-allowed schema had the same plan_sponsor_name constraint issue. Fixed that (on my second try - ugh!) in the latest commit.
The issue this fixes : The following in-network file currently passes but should FAIL due to missing plan_sponsor_name :
/schema-repo/examples/in-network-rates/in-network-rates-bundle-single-plan-sample.FAIL.no_plan_sponsor_name.json

{
  "reporting_entity_name": "ACME Health",
  "reporting_entity_type": "health insurance issuer",
  "plan_name": "ACME PPO Plan",
  "issuer_name": "ACME Health Insurance Corporation",
  "plan_id_type": "ein",
  "plan_id": "123456789",
  "plan_market_type": "group",
  "version": "2.0.0",
  "last_updated_on": "2023-04-19",
  "provider_references": [
    {
      "provider_group_id": 1,
      "network_name": ["ACME Choice Provider Group"],
      "provider_groups": [
        {
          "npi": [1111111111, 2222222222, 3333333333, 4444444444, 5555555555],
          "tin": {
            "type": "ein",
            "value": "11-1111111",
            "business_name": "ACME Provider Group"
          }
        },
        {
          "npi": [1111111111, 2222222222, 3333333333, 4444444444, 5555555555],
          "tin": {
            "type": "ein",
            "value": "22-2222222",
            "business_name": "Midland Medical Group"
          }
        }
      ]
    },
    {
      "provider_group_id": 2,
      "network_name": ["ACME Choice Provider Group Plus"],
      "provider_groups": [
        {
          "npi": [1111111111, 2222222222, 3333333333, 4444444444, 5555555555],
          "tin": {
            "type": "ein",
            "value": "22-2222222",
            "business_name": "Midland Medical Group"
          }
        }
      ]
    }
  ],
  "in_network": [
    {
      "negotiation_arrangement": "bundle",
      "name": "Total Knee Replacement",
      "billing_code_type": "ICD",
      "billing_code_type_version": "9",
      "billing_code": "81.54",
      "description": "Total Knee Replacement",
      "negotiated_rates": [
        {
          "provider_references": [1],
          "negotiated_prices": [
            {
              "setting": "inpatient",
              "negotiated_type": "negotiated",
              "negotiated_rate": 20000.0,
              "expiration_date": "2022-01-01",
              "service_code": ["05", "06", "07"],
              "billing_class": "professional"
            }
          ]
        },
        {
          "provider_references": [1],
          "negotiated_prices": [
            {
              "setting": "inpatient",
              "negotiated_type": "negotiated",
              "negotiated_rate": 25000.0,
              "expiration_date": "2022-01-01",
              "service_code": ["05", "06", "07"],
              "billing_class": "professional"
            }
          ]
        }
      ],
      "bundled_codes": [
        {
          "billing_code_type": "CPT",
          "billing_code_type_version": "2020",
          "billing_code": "27447",
          "description": "Under Repair, Revision, and/or Reconstruction Procedures on the Femur (Thigh Region) and Knee Joint"
        },
        {
          "billing_code_type": "CPT",
          "billing_code_type_version": "2020",
          "billing_code": "27446",
          "description": "Under Repair, Revision, and/or Reconstruction Procedures on the Femur (Thigh Region) and Knee Joint"
        }
      ]
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants