Split PT/OT/ST into separate service_category_3 values (#1016)#1352
Open
gopidaxhealthcaresolutions wants to merge 2 commits into
Open
Conversation
) Previously the therapy service-category models set both service_category_2 and service_category_3 to the same 'pt/ot/st' umbrella, so PT, OT and ST could not be distinguished at the most granular level. service_category_2 stays the 'outpatient pt/ot/st' / 'office-based pt/ot/st' umbrella; service_category_3 now resolves to the individual discipline: physical therapy, occupational therapy, or speech therapy. Discipline is determined by the HCPCS therapy modifiers Medicare requires on therapy lines (GP = physical, GO = occupational, GN = speech), surfaced once as a therapy_modifier_discipline column in service_category__stg_medical_claim. The professional and office-based models fall back to the rendering provider specialty when no modifier is present, and all three fall back to the existing pt/ot/st umbrella when neither signal is conclusive (so category membership is unchanged - only service_category_3 is refined). Adds a unit test covering modifier precedence, specialty fallback, and the umbrella default, and updates the service-categories docs.
✅ Deploy Preview for thetuvaproject ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1016
What changed
The therapy service-category models set both
service_category_2andservice_category_3to the same umbrella value (outpatient pt/ot/st/office-based pt/ot/st), so the individual disciplines couldn't be told apart.service_category_2is unchanged — it stays thept/ot/stumbrella.service_category_3now resolves tophysical therapy,occupational therapy, orspeech therapy.This mirrors how
service_category_2 = 'outpatient radiology'already fans out intoct/general/mri/petinservice_category_3.How the discipline is determined
GP= physical,GO= occupational,GN= speech. This is surfaced once as atherapy_modifier_disciplinecolumn inservice_category__stg_medical_claim(works for institutional claims too, which carry no rendering specialty).Physical Therapist→ physical therapy.pt/ot/stvalue, so category membership is unchanged; onlyservice_category_3is refined.Files
service_category__stg_medical_claim.sql— addtherapy_modifier_discipline(additive).service_category__outpatient_physical_therapy_institutional.sql,...outpatient_physical_therapy_professional.sql,...office_based_physical_therapy_professional.sql— setservice_category_3from the discipline.core-platform/service-categories.mdandknowledge/claims-groupers-and-algos/service-categories.mdupdated to list the new values.Testing
Added
service_category__pt_ot_st_unit_tests.ymlcovering modifier precedence, specialty fallback, and the umbrella default. Passes locally on DuckDB:The modifier
IN-list expression was also verified directly on DuckDB (including NULL handling). No downstream model filters onservice_category_3 = '...pt/ot/st', and there is noaccepted_valuestest on the column, so nothing downstream breaks.Note
Discipline assignment depends on therapy modifiers / provider specialty being populated in the source data. Lines lacking both stay in the
pt/ot/stumbrella rather than being misclassified.