mirror of
https://github.com/msberends/AMR.git
synced 2025-07-09 19:01:51 +02:00
(v1.5.0.9010) MDRO vignette update, get_episode for < day
This commit is contained in:
@ -21,13 +21,13 @@ library(AMR)
|
||||
|
||||
With the function `mdro()`, you can determine which micro-organisms are multi-drug resistant organisms (MDRO).
|
||||
|
||||
#### Type of input
|
||||
### Type of input
|
||||
|
||||
The `mdro()` function takes a data set as input, such as a regular `data.frame`. It tries to automatically determine the right columns for info about your isolates, like the name of the species and all columns with results of antimicrobial agents. See the help page for more info about how to set the right settings for your data with the command `?mdro`.
|
||||
The `mdro()` function takes a data set as input, such as a regular `data.frame`. It tries to automatically determine the right columns for info about your isolates, like the name of the species and all columns with results of antimicrobial agents. See the help page for more info about how to set the right settings for your data with the command `?mdro`.
|
||||
|
||||
For WHONET data (and most other data), all settings are automatically set correctly.
|
||||
|
||||
#### Guidelines
|
||||
### Guidelines
|
||||
|
||||
The function support multiple guidelines. You can select a guideline with the `guideline` parameter. Currently supported guidelines are (case-insensitive):
|
||||
|
||||
@ -56,8 +56,36 @@ The function support multiple guidelines. You can select a guideline with the `g
|
||||
The Dutch national guideline - Rijksinstituut voor Volksgezondheid en Milieu "WIP-richtlijn BRMO (Bijzonder Resistente Micro-Organismen) (ZKH)" ([link](https://www.rivm.nl/wip-richtlijn-brmo-bijzonder-resistente-micro-organismen-zkh))
|
||||
|
||||
Please suggest your own (country-specific) guidelines by letting us know: <https://github.com/msberends/AMR/issues/new>.
|
||||
|
||||
#### Custom Guidelines
|
||||
|
||||
You can also use your own custom guideline. Custom guidelines can be set with the `custom_mdro_guideline()` function. This is of great importance if you have custom rules to determine MDROs in your hospital, e.g., rules that are dependent on ward, state of contact isolation or other variables in your data.
|
||||
|
||||
If you are familiar with `case_when()` of the `dplyr` package, you will recognise the input method to set your own rules. Rules must be set using what \R considers to be the 'formula notation':
|
||||
|
||||
```{r}
|
||||
custom <- custom_mdro_guideline(CIP == "R" & age > 60 ~ "Elderly Type A",
|
||||
ERY == "R" & age > 60 ~ "Elderly Type B")
|
||||
```
|
||||
|
||||
If a row/an isolate matches the first rule, the value after the first `~` (in this case *'Elderly Type A'*) will be set as MDRO value. Otherwise, the second rule will be tried and so on. The number of rules is unlimited.
|
||||
|
||||
You can print the rules set in the console for an overview. Colours will help reading it if your console supports colours.
|
||||
|
||||
```{r}
|
||||
custom
|
||||
```
|
||||
|
||||
The outcome of the function can be used for the `guideline` argument in the [mdro()] function:
|
||||
|
||||
```{r}
|
||||
x <- mdro(example_isolates, guideline = custom)
|
||||
table(x)
|
||||
```
|
||||
|
||||
The rules set (the `custom` object in this case) could be exported to a shared file location using `saveRDS()` if you collaborate with multiple users. The custom rules set could then be imported using `readRDS()`.
|
||||
|
||||
#### Examples
|
||||
### Examples
|
||||
|
||||
The `mdro()` function always returns an ordered `factor`. For example, the output of the default guideline by Magiorakos *et al.* returns a `factor` with levels 'Negative', 'MDR', 'XDR' or 'PDR' in that order.
|
||||
|
||||
|
Reference in New Issue
Block a user