Skip to content

Commit

Permalink
Merge pull request #70 from betagouv/maud/prix_honoraires_compris
Browse files Browse the repository at this point in the history
Prices with pharmacy fee
  • Loading branch information
jillro authored Jan 27, 2025
2 parents be3fd43 + c37b726 commit 3e44cd9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
9 changes: 7 additions & 2 deletions src/components/PresentationsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,14 @@ export function PresentationsList(props: {
{(p.details && presentationDetailName(p.details)) || p.PresNom01}
</b>{" "}
-{" "}
{p.Prix && p.Taux ? (
{p.PPF && p.TauxPriseEnCharge ? (
<>
Prix {p.Prix} € - remboursé à {p.Taux}
Prix{" "}
{Intl.NumberFormat("fr-FR", {
style: "currency",
currency: "EUR",
}).format(p.PPF)}{" "}
- remboursé à {p.TauxPriseEnCharge}
</>
) : (
<>Prix libre - non remboursable</>
Expand Down
12 changes: 5 additions & 7 deletions src/db/pdbmMySQL/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface PdbmMySQL {
Composant: SpecComposantTable;
Subs_Nom: Subs_NomTable;
Presentation: PresentationTable;
CNAM_InfoTarif: InfoTarifTable;
CEPS_Prix: CEPSPrixTable;
Spec_Delivrance: SpecDelivranceTable;
DicoDelivrance: DicoDelivranceTable;
StatutComm: StatutCommTable;
Expand Down Expand Up @@ -79,12 +79,10 @@ interface PresentationTable {
codeCIP13: string;
}

interface InfoTarifTable {
interface CEPSPrixTable {
Cip13: string;
Taux: string;
Prix: string;
DateEffet: Date;
IndicRestreinte: string;
TauxPriseEnCharge: string;
PPF: number;
}

interface SpecDelivranceTable {
Expand Down Expand Up @@ -139,7 +137,7 @@ export type SpecElement = Selectable<SpecElementTable>;
export type SpecComposant = Selectable<SpecComposantTable>;
export type SubstanceNom = Selectable<Subs_NomTable>;
export type Presentation = Selectable<PresentationTable>;
export type PresInfoTarif = Selectable<InfoTarifTable>;
export type PresInfoTarif = Selectable<CEPSPrixTable>;
export type SpecDelivrance = Selectable<SpecDelivranceTable> &
Selectable<DicoDelivranceTable>;
export type Patho = Selectable<PathoTable>;
Expand Down
15 changes: 2 additions & 13 deletions src/db/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,22 +57,11 @@ export const getPresentations = cache(
.selectFrom("Presentation")
.where("SpecId", "=", CIS)
.where(presentationIsComm())
.leftJoin(
"CNAM_InfoTarif",
"Presentation.codeCIP13",
"CNAM_InfoTarif.Cip13",
)
.leftJoin("CEPS_Prix", "Presentation.codeCIP13", "CEPS_Prix.Cip13")
.selectAll()
.execute()
).sort((a, b) =>
a.Prix && b.Prix
? parseFloat(a.Prix.replace(",", ".")) -
parseFloat(b.Prix.replace(",", "."))
: a.Prix
? -1
: b.Prix
? 1
: 0,
a.PPF && b.PPF ? a.PPF - b.PPF : a.PPF ? -1 : b.PPF ? 1 : 0,
);
},
);
Expand Down

0 comments on commit 3e44cd9

Please sign in to comment.