mco_classify {drdR} | R Documentation

## Classify MCO stays

### Description

This function takes a classifier object (with its table and authorization set) and loaded stays as input and classifies them according to the revelant ATIH algorithm. Final GHM, GHS, supplements, pricings are calculated (among others). Stays with the same bill_id (RSS id) are fused together and produce a single result.

### Usage

    mco_classify(
      classifier,
      stays,
      diagnoses = NULL,
      procedures = NULL,
      sector = NULL,
      options = character(0),
      results = TRUE,
      dispense_mode = NULL,
      apply_coefficient = FALSE,
      supplement_columns = "both"
    )

### Arguments

`classifier` | Classifier object created by `mco_init()`.
`stays` | Data.frame of stays, or a list with three objects (stays, diagnoses, procedures).
`diagnoses` | Data.frame of diagnoses, or NULL is you pass a list of data.frames to stays.
`procedures` | Data.frame of procedures, or NULL is you pass a list of data.frames to stays.
`sector` | Sector 'Public' or 'Private', by default the `default_sector` value specified in `mco_init()` will be used.
`options` | List of options to alter classifier algorithm.
`results` | Return results for each RSS as a data.frame.
`dispense_mode` | Retribute paiements to individual stays (RUM), several algorithms are available: "J", "Ex", "Ex'", "ExJ", "Ex'J". Individual results will be available in the `$mono_results` component of the returned list.
`apply_coefficient` | Apply GHS coefficients to results.
`supplement_columns` | Change returned supplement columns, the following values can be used: "none", "count", "cents" or "both".

### Details

The stays must be presented in three data.frames: stays, diagnoses, procedures. These are linked by an id column which must be sorted before calling `mco_classify()` otherwise the call will fail. While each data.frame must be sorted by this column, they don't have to match perfectly. For example, you can filter out stays from the first data.frame without having to do the same in the two other data.frames.

Several options can be used to control the algorithm used to classify stays:

- MonoOrigStay: Use original stays in mono algorithm

- IgnoreConfirm: Ignore RSS confirmation flag

- IgnoreCompProc: Ignore complementary procedure check

- IgnoreProcExt: Ignore ATIH procedure extension check

You can use the `dispense_mode` parameter to redistribute pricings from multi-stay results to individual stays, the following algorithms can be used:

- J: Proportional to each stay duration

- E: Proportional to pseudo-GHS pricing of each stay

- Ex: Proportional to pseudo-GHS-EXB+EXH pricing of each stay

- Ex': Proportional to pseudo-GHS-EXB+EXH pricing of each stay if duration < EXB or pseudo-GHS pricing otherwise

- ExJ: Combine J and Ex algorithms

- Ex'J: Combine J and Ex' algorithms

After loading stays with `mco_load_stays()`, you can use a shortcut call `mco_classify(m, l)` instead of the longer `mco_classify(m, l$stays, l$diagnoses, l$procedures)`.

### Value

A list containing one to three data.frames: `$summary`, `$results` (if `results = TRUE`) and `$mono_results` (if `dispense_mode != NULL`).

### Examples

    library(drdR)

    # Load tables and authorizations, the resulting object can be reused as many
    # times as necessary.
    m <- mco_init('path/to/tables/', 'path/to/FICUM.txt', default_sector = 'Public')

    # Load stays, diagnoses and procedures from a file (RSS, GRP or RSA), the
    # returned object is a list containing three data.frames: l$stays, l$diagnoses
    # and l$procedures. A sorted id column links all three together.
    l <- mco_load_stays('fichier.rss')

    c <- mco_classify(m, l)

    summary(c)
    summary(c, by = 'ghm')
    summary(c$results, by = 'ghm') # This does the same
    head(c$results)

[Package drdR version 2020.09.21 Index]