|
| 1 | +version: 2 |
| 2 | + |
| 3 | +models: |
| 4 | + - name: stg_cms_hcris__hospital |
| 5 | + description: > |
| 6 | + Staging model for hospital data from the CMS Healthcare Cost Report Information System (HCRIS). |
| 7 | + This model joins the report (rpt), alpha (alphanumeric), and numeric (nmrc) source tables to create |
| 8 | + a normalized hospital record with provider information, ownership details, address, bed counts, |
| 9 | + resident counts, and financial metrics. The model extracts data from specific worksheet codes and |
| 10 | + line/column combinations to build a comprehensive hospital profile from the HCRIS cost report data. |
| 11 | + |
| 12 | + columns: |
| 13 | + - name: cms_id |
| 14 | + description: > |
| 15 | + CMS Provider Number. A six-digit identifier where the first two digits represent the state code |
| 16 | + and the remaining four digits represent the assigned provider range. This is the primary identifier |
| 17 | + for hospitals in the CMS system. |
| 18 | + tests: |
| 19 | + - not_null |
| 20 | + |
| 21 | + - name: npi |
| 22 | + description: > |
| 23 | + National Provider Identifier. A unique 10-digit identifier for healthcare providers established |
| 24 | + under HIPAA. May be null for some hospitals that haven't registered an NPI. |
| 25 | + |
| 26 | + - name: ownership_code |
| 27 | + description: > |
| 28 | + Provider Control Type Code. A numeric code (1-13) indicating the type of ownership structure |
| 29 | + from Table 3A of the HCRIS specifications. Used to categorize hospitals by ownership type. |
| 30 | + tests: |
| 31 | + - accepted_values: |
| 32 | + values: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13'] |
| 33 | + |
| 34 | + - name: ownership_type |
| 35 | + description: > |
| 36 | + Human-readable ownership type description. Maps ownership codes to descriptive categories: |
| 37 | + voluntary nonprofit (church/other), proprietary (individual/corporation/partnership/other), |
| 38 | + governmental (federal/city-county/county/state/hospital district/city/other), or unknown. |
| 39 | + tests: |
| 40 | + - not_null |
| 41 | + - accepted_values: |
| 42 | + values: |
| 43 | + - 'voluntary nonprofit-church' |
| 44 | + - 'voluntary nonprofit-other' |
| 45 | + - 'proprietary-individual' |
| 46 | + - 'proprietary-corporation' |
| 47 | + - 'proprietary-partnership' |
| 48 | + - 'proprietary-other' |
| 49 | + - 'governmental-federal' |
| 50 | + - 'governmental-city-county' |
| 51 | + - 'governmental-county' |
| 52 | + - 'governmental-state' |
| 53 | + - 'governmental-hospital district' |
| 54 | + - 'governmental-city' |
| 55 | + - 'governmental-other' |
| 56 | + - 'unknown' |
| 57 | + |
| 58 | + - name: hospital_name |
| 59 | + description: > |
| 60 | + Hospital name extracted from worksheet S200001, line 00300, column 00100. The official name |
| 61 | + of the hospital as reported in the HCRIS cost report. |
| 62 | + |
| 63 | + - name: street_address |
| 64 | + description: > |
| 65 | + Street address of the hospital extracted from worksheet S200001, line 00100, column 00100. |
| 66 | + The physical street address where the hospital is located. |
| 67 | + |
| 68 | + - name: city |
| 69 | + description: > |
| 70 | + City where the hospital is located, extracted from worksheet S200001, line 00200, column 00100. |
| 71 | + The city component of the hospital's address. |
| 72 | + |
| 73 | + - name: state |
| 74 | + description: > |
| 75 | + State where the hospital is located, extracted from worksheet S200001, line 00200, column 00200. |
| 76 | + The state component of the hospital's address, typically a two-letter state code. |
| 77 | + |
| 78 | + - name: zip |
| 79 | + description: > |
| 80 | + ZIP code where the hospital is located, extracted from worksheet S200001, line 00200, column 00300. |
| 81 | + The postal code component of the hospital's address. |
| 82 | + |
| 83 | + - name: hosp_bed_count |
| 84 | + description: > |
| 85 | + Number of hospital beds, extracted from worksheet S300001, line 01400, column 00200. |
| 86 | + Represents the total number of licensed hospital beds available for patient care. |
| 87 | + |
| 88 | + - name: ld_bed_count |
| 89 | + description: > |
| 90 | + Number of long-term care (LTC) beds, extracted from worksheet S300001, line 03200, column 00200. |
| 91 | + Represents beds designated for long-term care services within the hospital facility. |
| 92 | + |
| 93 | + - name: total_bed_count |
| 94 | + description: > |
| 95 | + Total bed count calculated as the sum of hospital beds and long-term care beds. |
| 96 | + Uses COALESCE to handle null values by treating them as 0. This provides a comprehensive |
| 97 | + count of all beds in the facility. |
| 98 | + |
| 99 | + - name: resident_count |
| 100 | + description: > |
| 101 | + Number of residents (medical residents), extracted from worksheet S300001, line 01400, column 00900. |
| 102 | + Represents the count of medical residents training at the hospital, which may affect Medicare |
| 103 | + reimbursement calculations. |
| 104 | + |
| 105 | + - name: total_revenue |
| 106 | + description: > |
| 107 | + Total revenue for the hospital, extracted from worksheet G300000, line 00200, column 00100. |
| 108 | + Represents the total revenue reported in the cost report, including all sources of income. |
| 109 | + |
| 110 | + - name: net_revenue |
| 111 | + description: > |
| 112 | + Net revenue for the hospital, extracted from worksheet G300000, line 00300, column 00100. |
| 113 | + Represents the net revenue after deductions, as reported in the HCRIS cost report. |
0 commit comments