Skip to content

Commit

Permalink
fix #14
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumePressiat committed Dec 2, 2023
1 parent a8899d6 commit c0cf427
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ poetry install
avec pip

```sh
pip install https://github.com/GuillaumePressiat/pypmsi/releases/latest/download/pypmsi-0.1.8-py3-none-any.whl
pip install https://github.com/GuillaumePressiat/pypmsi/releases/latest/download/pypmsi-0.2.0-py3-none-any.whl
```


Expand Down
3 changes: 3 additions & 0 deletions pypmsi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@
from pypmsi.mco.vvs.vvs_mco import vvs_mco
from pypmsi.mco.vvs.vvs_mco_libelles_valo import vvs_mco_libelles_valo

from pypmsi.mco.vvs.vvs_mco_epmsi import vvs_mco_epmsi_sv
from pypmsi.mco.vvs.vvs_mco_epmsi import vvs_mco_epmsi_rav

from pypmsi.requetes.requetes import prepare_rsa_pour_requetes
from pypmsi.requetes.requetes import requete_rsa

Expand Down
27 changes: 27 additions & 0 deletions pypmsi/mco/vvs/vvs_mco_epmsi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

import polars as pl
import polars.selectors as cs
from pypmsi.mco.vvs.vvs_mco_libelles_valo import vvs_mco_libelles_valo

def vvs_mco_epmsi_sv(vvs_df):

return (
vvs_df
.group_by('type_fin')
.agg(pl.col('cle_rsa').count().alias('nb_rsa'),
pl.col('rec_totale').sum().round(2).alias('recette_br_avec_coeffs'))
.sort('type_fin')
.join(vvs_mco_libelles_valo()['vvs_mco_lib_type_sej'], on = 'type_fin', how = 'left')
)


def vvs_mco_epmsi_rav(vvs_df):

return (
vvs_df
.select(cs.starts_with('rec'))
.sum()
.melt(variable_name = 'rubrique', value_name = 'recette')
.join(vvs_mco_libelles_valo()['vvs_mco_lib_valo'], on = 'rubrique', how = 'left')
)

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pypmsi"
version = "0.1.9"
version = "0.2.0"
description = "parser for french PMSI files in python / pola.rs"
authors = ["GuillaumePressiat <[email protected]>"]
license = "AGPL3"
Expand Down

0 comments on commit c0cf427

Please sign in to comment.