pfehlinger / risk_adjustment_model

Python implementation of Healthcare Risk Adjustment Models
MIT License
2 stars 0 forks source link

Tim changes #9

Closed Timfrazer closed 6 months ago

Timfrazer commented 6 months ago

Moved the files -

it would be helpful to understand what the expected input is for the module and output, so a pytest would help me understand this from an n00b view.

Your class is massive, for each one v24/v28. I'm not a huge fan of such massive classes but whatever floats your boat but I think there is room to make it smaller.

Refactoring would be a ton faster if you had a really basic setup of tests - and examples of inputs and expected outputs. would allow for faster development and testing for sure.

for your score model, it's prime for using a python dataclass I've done a quick refactor as an example


@dataclass
        class OutputDict:
            gender: str
            orec: str
            medicaid: bool
            age: int
            dob: str
            diagnosis_codes: list
            year: int
            population: str
            risk_model_age: int
            risk_model_population: str
            model_version: str
            model_year: int
            coding_intensity_adjuster: float
            normalization_factor: float

        output_dict = OutputDict(
            gender=gender,
            orec=orec,
            medicaid=medicaid,
            age=age,
            dob=dob,
            diagnosis_codes=diagnosis_codes,
            year=self.year,
            population=population,
            risk_model_age=risk_model_age,
            risk_model_population=risk_model_population,
            model_version=self.version,
            model_year=self.model_year,
            coding_intensity_adjuster=self.coding_intesity_adjuster,
            normalization_factor=self.normalization_factor
        )