' Copyright (C) 2025  P4pillon.org
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero General Public License as
' published by the Free Software Foundation, either version 3 of the
' License, or (at your option) any later version.
'
' This program is distributed in the hope that it will be useful,
' but WITHOUT ANY WARRANTY; without even the implied warranty of
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
' GNU Affero General Public License for more details.
'
' You should have received a copy of the GNU Affero General Public License
' along with this program.  If not, see <https://www.gnu.org/licenses/>.
Public Class Choix_remboursement_amo

    Private Sub Choix_remboursement_amo_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        DataGridView.DefaultCellStyle.WrapMode = DataGridViewTriState.True

        Select Case Assurés.G101C10TextBox.Text
            Case "01", "03", "04", "05", "06", "08", "09", "12", "14", "15", "16", "17", "80", "90", "91", "92", "93", "94", "95", "96", "99"

                Dim r As Integer = 0
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Pas de droits"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "Pas de droits"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas de droits"
                DataGridView.Item(CodeSituation.Index, r).Value = "0000"



                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % toutes prestations"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Assuré ou bénéficiaire exonéré"
                DataGridView.Item(CodeSituation.Index, r).Value = "0101"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % sauf vignettes oranges, bleues et produits pharmaceutiques assimilés"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % sauf" & Chr(10) & "PH2, PM2 = 15 %" & Chr(10) & "PH4, MHU, PMH, PM4 = 35 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Assuré ou bénéficiaire exonéré"
                DataGridView.Item(CodeSituation.Index, r).Value = "0102"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % sauf vignettes oranges, bleues et produits pharmaceutiques assimilés" & Chr(10) & "taux rég. local frontalier"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % sauf" & Chr(10) & "PH2, PM2 = 15 %" & Chr(10) & "PH4, MHU, PMH, PM4 = 80 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Assuré ou bénéficiaire exonéré"
                DataGridView.Item(CodeSituation.Index, r).Value = "0106"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Taux rég. local frontalier"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "90 % sauf PH2, PM2 = 15%" & Chr(10) & "PH4, MHU, PMH, PM4 = 80%" & Chr(10) & "PG7 = 100%"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0105"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Taux FSV"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "PH2 = 15%" & Chr(10) & "PH4, et MHU = 35 %" & Chr(10) & "PG7, PH7, PPI = 65%" & Chr(10) & "autres = 80 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "FSV"
                DataGridView.Item(CodeSituation.Index, r).Value = "0104"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % sauf vignettes orange, bleues et produits pharmaceutiques assimilés Taux Alsace-Moselle"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % sauf" & Chr(10) & "PH2, PM2 = 15 %" & Chr(10) & "PH4, MHU, PMH, PM4 = 80%"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Assuré ou bénéficiaire exonéré"
                DataGridView.Item(CodeSituation.Index, r).Value = "0106"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Taux Alsace-Moselle"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "90 % sauf PH2, PM2 = 15%" & Chr(10) & "PH4, MHU, PMH, PM4 = 80%" & Chr(10) & "PG7 = 100%"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0108"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Non exonéré"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "ni exonération – ni modulation"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0100"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % si service médical SNCF" & Chr(10) & "ou si gynécologie K, KC, KCC, KE, Z, ZN, ADA, ADC," & Chr(10) & "ADE, ADI, ATM dentaire," & Chr(10) & "hospitalisation transport"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Exonération régimes spéciaux" & Chr(10) & "(Service médical SNCF)"
                DataGridView.Item(CodeSituation.Index, r).Value = "0401"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % transport hospitalisation Appareillage" & Chr(10) & "Autres cas 75 %"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % ou 75 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0402"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % toute prestation" & Chr(10) & "sauf 75 % pharmacie et prothèse dentaire"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % ou 75 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0402"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "90 % toute prestation" & Chr(10) & "sauf 100 % transport hospitalisation Appareillage" & Chr(10) & "15% Vignettes oranges et produits pharmaceutiques assimilés" & Chr(10) & "80 % vignettes bleues et produits pharmaceutiques assimilés"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % ou 90 % sauf PH2, PM2 =15%" & Chr(10) & "PH4, MHU, PMH, PM4 = 80%"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0411"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "80 % toute prestation" & Chr(10) & "sauf 100 % transport hospitalisation appareillage" & Chr(10) & "75 % médicament"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % ou 80% ou 75 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "FSV" & Chr(10) & "(pas de motif d’exo pour 100% THA)"
                DataGridView.Item(CodeSituation.Index, r).Value = "0410"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "taux régime Alsace-Moselle"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "90 %" & Chr(10) & "sauf(PH2, PM2 = 15%)" & Chr(10) & "PH4, MHU, PMH, PM4 = 80%" & Chr(10) & "PG7 = 100%"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0108"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % toute prestation" & Chr(10) & "Sauf vignettes orange et produits pharmaceutiques assimilés 15%" & Chr(10) & "Sauf vignettes bleues et produits pharmaceutiques assimilés 80%"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % sauf" & Chr(10) & "PH2, PM2 = 15 %" & Chr(10) & "PH4, MHU, PMH, PM4 = 80%"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Assuré ou bénéficiaire exonéré"
                DataGridView.Item(CodeSituation.Index, r).Value = "0107"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Autres cas taux régime général"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "ni exonération - ni modulation"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0100"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Régime réduit soins non couverts"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "Non remboursé"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0000"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Pas d’exo taux régime général"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "ni exonération - ni modulation"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0100"

            Case "02" 'AGRICOLE
                Dim r As Integer = 0
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Pas de droits"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "Pas de droits"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas de droits"
                DataGridView.Item(CodeSituation.Index, r).Value = "0000"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 %" & Chr(10) & "sauf vignettes orange, bleues et produits pharmaceutiques assimilés" & Chr(10) & "Taux Alsace-Moselle" & Chr(10) & "(accidents non couverts)"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % sauf" & Chr(10) & "PH2, PM2, PH4, MHU, PMH, PM4 = 90 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Assuré ou bénéficiaire exonéré"
                DataGridView.Item(CodeSituation.Index, r).Value = "0226"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Taux Alsace-Moselle"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "90 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0225"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Non exonéré" & Chr(10) & "(accidents non couverts)"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "ni exonération - ni modulation"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "0100RégAgricole"

            Case "10" 'CRPCEN
                Dim r As Integer = 0
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Pas de droits"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "Pas de droits"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas de droits"
                DataGridView.Item(CodeSituation.Index, r).Value = "0000"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % toutes prestations"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Assuré ou bénéficiaire exonéré"
                DataGridView.Item(CodeSituation.Index, r).Value = "1001"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Taux FSV"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "PH2=15%" & Chr(10) & "MHU, PH4 = 45 % autres = 85 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "FSV"
                DataGridView.Item(CodeSituation.Index, r).Value = "1004"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100 % sauf vignettes orange, bleues"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100 % sauf" & Chr(10) & "PH2, PM2 = 15 %" & Chr(10) & "PH4 , MHU, PMH, PM4 = 45 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Assuré ou bénéficiaire exonéré"
                DataGridView.Item(CodeSituation.Index, r).Value = "1003"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Non exonéré"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "PH2, PM2 = 15 %" & Chr(10) & "PH4, MHU, PMH, PM4= 45 %" & Chr(10) & "autres = 85 %"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas d’exonération"
                DataGridView.Item(CodeSituation.Index, r).Value = "1000"

            Case "07" 'Régime minier
                Dim r As Integer = 0
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "Pas de droits"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "Pas de droits"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Pas de droits"
                DataGridView.Item(CodeSituation.Index, r).Value = "0000"

                r = r + 1
                DataGridView.Rows.Add()
                DataGridView.Item(Libellé.Index, r).Value = "100% toutes prestations"
                DataGridView.Item(Taux_de_remboursement.Index, r).Value = "100%"
                DataGridView.Item(Code_justif_exo_TM.Index, r).Value = "Exonération régimes spéciaux"
                DataGridView.Item(CodeSituation.Index, r).Value = "0700"
        End Select
    End Sub

    Private Sub DataGridView_CellContentClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView.CellContentClick

        Select Case DataGridView.CurrentCellAddress.X
            Case Choisir.Index
                Assurés.CodeSituation = DataGridView.Item(CodeSituation.Index, DataGridView.CurrentCellAddress.Y).Value
                Me.Dispose()
        End Select
    End Sub
End Class