Compare commits
	
		
			4 Commits
		
	
	
		
			a3fef1c38c
			...
			LireCarteV
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					b61634fea9 | ||
| 
						 | 
					6b6658f56d | ||
| 
						 | 
					d56f7a2249 | ||
| 
						 | 
					2b45f5aa7e | 
										
											Binary file not shown.
										
									
								
							@@ -4,7 +4,6 @@ use std::ptr;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
use crate::libssv::SSV_LireDroitsVitale;
 | 
					use crate::libssv::SSV_LireDroitsVitale;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
use crate::ssv_memory::{decode_ssv_memory, Block};
 | 
					use crate::ssv_memory::{decode_ssv_memory, Block};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
@@ -15,73 +14,68 @@ pub struct CarteVitale {
 | 
				
			|||||||
    donneesBeneficiaire: Vec<DonneesBeneficiaire>,
 | 
					    donneesBeneficiaire: Vec<DonneesBeneficiaire>,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
// 1. CB = Caractères Binaires »
 | 
					// 1. CB = Caractères Binaires »
 | 
				
			||||||
// 2. CE = Caractères « Etendus » (ISO 8859-1)
 | 
					// 2. CE = Caractères « Etendus » (ISO 8859-1)
 | 
				
			||||||
// 3. CA = Caractères Alphanumériques (ASCII?)
 | 
					// 3. CA = Caractères Alphanumériques (ASCII?)
 | 
				
			||||||
// 4. CN = Caractères Numériques
 | 
					// 4. CN = Caractères Numériques
 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct DonneesAssure {
 | 
					struct DonneesAssure {
 | 
				
			||||||
    type_de_carte_vitale: char,                       // CA
 | 
					    type_de_carte_vitale: char,                // CA
 | 
				
			||||||
    numero_de_serie: String,                          // CN - 1 -> 20
 | 
					    numero_de_serie: String,                   // CN - 1 -> 20
 | 
				
			||||||
    date_de_fin_de_validite: String,                  // CN - Format AAAAMMJJ0000
 | 
					    date_de_fin_de_validite: String,           // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    donnees_administration_ruf1: char,                // CN
 | 
					    donnees_administration_ruf1: char,         // CN
 | 
				
			||||||
    donnees_administration_ruf2: String,              // CA - 24
 | 
					    donnees_administration_ruf2: String,       // CA - 24
 | 
				
			||||||
    donnees_ruf_administration: String,               // CE - 10
 | 
					    donnees_ruf_administration: String,        // CE - 10
 | 
				
			||||||
    type_d_identification_du_porteur: char,           // CA
 | 
					    type_d_identification_du_porteur: char,    // CA
 | 
				
			||||||
    numero_national_d_immatriculation: String,        // CA - 13
 | 
					    numero_national_d_immatriculation: String, // CA - 13
 | 
				
			||||||
    cle_du_nir: String,                               // CA - 2
 | 
					    cle_du_nir: String,                        // CA - 2
 | 
				
			||||||
    code_regime: String,                              // CN - 2
 | 
					    code_regime: String,                       // CN - 2
 | 
				
			||||||
    caisse_gestionnaire: String,                      // CN - 3
 | 
					    caisse_gestionnaire: String,               // CN - 3
 | 
				
			||||||
    centre_gestionnaire: String,                      // CN - 4
 | 
					    centre_gestionnaire: String,               // CN - 4
 | 
				
			||||||
    code_gestion: String,                             // CA - 2
 | 
					    code_gestion: String,                      // CA - 2
 | 
				
			||||||
    donnees_ruf_famille: String,                      // CE - 55
 | 
					    donnees_ruf_famille: String,               // CE - 55
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct ServiceAMOFamille {
 | 
					struct ServiceAMOFamille {
 | 
				
			||||||
    code_service_amo_famille: String,                 // CN - 2
 | 
					    code_service_amo_famille: String,          // CN - 2
 | 
				
			||||||
    date_de_debut_service_amo_famille: String,        // CN - Format AAAAMMJJ0000
 | 
					    date_de_debut_service_amo_famille: String, // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    date_de_fin_service_amo_famille: String,          // CN - Format AAAAMMJJ0000
 | 
					    date_de_fin_service_amo_famille: String,   // CN - Format AAAAMMJJ0000
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct DonneesAccidentTravail {
 | 
					struct DonneesAccidentTravail {
 | 
				
			||||||
    organisme_gestionnaire_risque_at: String,         // CN - 9
 | 
					    organisme_gestionnaire_risque_at: String, // CN - 9
 | 
				
			||||||
    code_at: char,                                    // CA - 2
 | 
					    code_at: char,                            // CA - 2
 | 
				
			||||||
    identifiant_at: String,                           // CN - 9
 | 
					    identifiant_at: String,                   // CN - 9
 | 
				
			||||||
    organisme_gestionnaire_at1: String,               // CN - 9
 | 
					    organisme_gestionnaire_at1: String,       // CN - 9
 | 
				
			||||||
    code_at1: char,                                   // CA - 2
 | 
					    code_at1: char,                           // CA - 2
 | 
				
			||||||
    identifiant_at1: String,                          // CN - 9
 | 
					    identifiant_at1: String,                  // CN - 9
 | 
				
			||||||
    organisme_gestionnaire_at2: String,               // CN - 9
 | 
					    organisme_gestionnaire_at2: String,       // CN - 9
 | 
				
			||||||
    code_at2: char,                                   // CA - 2
 | 
					    code_at2: char,                           // CA - 2
 | 
				
			||||||
    identifiant_at2: String,                          // CN - 9
 | 
					    identifiant_at2: String,                  // CN - 9
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct DonneesBeneficiaire {
 | 
					struct DonneesBeneficiaire {
 | 
				
			||||||
    nom_usuel: String,                                // CE - 27
 | 
					    nom_usuel: String,                    // CE - 27
 | 
				
			||||||
    nom_de_famille: String,                           // CE - 27
 | 
					    nom_de_famille: String,               // CE - 27
 | 
				
			||||||
    prenom: String,                                   // CE - 27
 | 
					    prenom: String,                       // CE - 27
 | 
				
			||||||
    adresse_ligne_1: String,                          // CE - 32
 | 
					    adresse_ligne_1: String,              // CE - 32
 | 
				
			||||||
    adresse_ligne_2: String,                          // CE - 32
 | 
					    adresse_ligne_2: String,              // CE - 32
 | 
				
			||||||
    adresse_ligne_3: String,                          // CE - 32
 | 
					    adresse_ligne_3: String,              // CE - 32
 | 
				
			||||||
    adresse_ligne_4: String,                          // CE - 32
 | 
					    adresse_ligne_4: String,              // CE - 32
 | 
				
			||||||
    adresse_ligne_5: String,                          // CE - 32
 | 
					    adresse_ligne_5: String,              // CE - 32
 | 
				
			||||||
    nir_certifie: String,                             // CA - 13
 | 
					    nir_certifie: String,                 // CA - 13
 | 
				
			||||||
    cle_du_nir_certifie: String,                      // CN - 2
 | 
					    cle_du_nir_certifie: String,          // CN - 2
 | 
				
			||||||
    date_de_certification_du_nir: String,             // CN - Format AAAAMMJJ0000
 | 
					    date_de_certification_du_nir: String, // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    date_de_naissance: String,                        // CN - Format AAAAMMJJ0000
 | 
					    date_de_naissance: String,            // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    rang_de_naissance: String,                        // CN - 1
 | 
					    rang_de_naissance: String,            // CN - 1
 | 
				
			||||||
    qualite: String,                                  // CN - 2
 | 
					    qualite: String,                      // CN - 2
 | 
				
			||||||
    code_service_amo_beneficiaire: char,              // CA - 2
 | 
					    code_service_amo_beneficiaire: char,  // CA - 2
 | 
				
			||||||
    date_de_debut_service_amo: String,                // CN - Format AAAAMMJJ0000
 | 
					    date_de_debut_service_amo: String,    // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    date_de_fin_service_amo: String,                  // CN - Format AAAAMMJJ0000
 | 
					    date_de_fin_service_amo: String,      // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    donnees_ruf_amo: String,                          // CE - 30
 | 
					    donnees_ruf_amo: String,              // CE - 30
 | 
				
			||||||
    periodeDroitsAMO: Vec<PeriodeDroitsAMO>,
 | 
					    periodeDroitsAMO: Vec<PeriodeDroitsAMO>,
 | 
				
			||||||
    periodeCodeCouverture: Vec<PeriodeCodeCouverture>,
 | 
					    periodeCodeCouverture: Vec<PeriodeCodeCouverture>,
 | 
				
			||||||
    donneesMutuelle: DonneesMutuelle,
 | 
					    donneesMutuelle: DonneesMutuelle,
 | 
				
			||||||
@@ -89,65 +83,64 @@ struct DonneesBeneficiaire {
 | 
				
			|||||||
    donneesRUFBeneficiaireComplementaire: DonneesRUFBeneficiaireComplementaire,
 | 
					    donneesRUFBeneficiaireComplementaire: DonneesRUFBeneficiaireComplementaire,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct PeriodeDroitsAMO {
 | 
					struct PeriodeDroitsAMO {
 | 
				
			||||||
    date_de_debut_droits_amo: String,                 // CN - Format AAAAMMJJ0000
 | 
					    date_de_debut_droits_amo: String, // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    date_de_fin_droits_amo: String,                   // CN - Format AAAAMMJJ0000
 | 
					    date_de_fin_droits_amo: String,   // CN - Format AAAAMMJJ0000
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct PeriodeCodeCouverture {
 | 
					struct PeriodeCodeCouverture {
 | 
				
			||||||
    date_de_debut_code_couverture: String,            // CN - Format AAAAMMJJ0000
 | 
					    date_de_debut_code_couverture: String, // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    date_de_fin_code_couverture: String,              // CN - Format AAAAMMJJ0000
 | 
					    date_de_fin_code_couverture: String,   // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    code_ald: String,                                 // CN - 1
 | 
					    code_ald: String,                      // CN - 1
 | 
				
			||||||
    code_situation: String,                           // CN - 4
 | 
					    code_situation: String,                // CN - 4
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct DonneesMutuelle {
 | 
					struct DonneesMutuelle {
 | 
				
			||||||
    identification_mutuelle: String,                  // CN - 8
 | 
					    identification_mutuelle: String,           // CN - 8
 | 
				
			||||||
    garanties_effectives: String,                     // CA - 8
 | 
					    garanties_effectives: String,              // CA - 8
 | 
				
			||||||
    indicateur_de_traitement_mutuelle: String,        // CN - 2
 | 
					    indicateur_de_traitement_mutuelle: String, // CN - 2
 | 
				
			||||||
    type_de_services_associes: char,                  // CA - 1
 | 
					    type_de_services_associes: char,           // CA - 1
 | 
				
			||||||
    services_associes_au_contrat: String,             // CA - 17
 | 
					    services_associes_au_contrat: String,      // CA - 17
 | 
				
			||||||
    code_aiguillage_sts: char,                        // CA - 1
 | 
					    code_aiguillage_sts: char,                 // CA - 1
 | 
				
			||||||
    periodeDroitsMutuelle: Vec<PeriodeDroitsMutuelle>,
 | 
					    periodeDroitsMutuelle: Vec<PeriodeDroitsMutuelle>,
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct PeriodeDroitsMutuelle {
 | 
					struct PeriodeDroitsMutuelle {
 | 
				
			||||||
    date_de_debut_droits_mutuelle: String,            // CN - Format AAAAMMJJ0000
 | 
					    date_de_debut_droits_mutuelle: String, // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    date_de_fin_droits_mutuelle: String,              // CN - Format AAAAMMJJ0000
 | 
					    date_de_fin_droits_mutuelle: String,   // CN - Format AAAAMMJJ0000
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct DonneesComplementaire {
 | 
					struct DonneesComplementaire {
 | 
				
			||||||
    numero_complementaire_b2: String,                 // CA - 10
 | 
					    numero_complementaire_b2: String,     // CA - 10
 | 
				
			||||||
    numero_complementaire_edi: String,                // CA - 19
 | 
					    numero_complementaire_edi: String,    // CA - 19
 | 
				
			||||||
    numero_adherent_amc: String,                      // CA - 8
 | 
					    numero_adherent_amc: String,          // CA - 8
 | 
				
			||||||
    indicateur_de_traitement_amc: String,             // CN - 2
 | 
					    indicateur_de_traitement_amc: String, // CN - 2
 | 
				
			||||||
    date_de_debut_validite_amc: String,               // CN - Format AAAAMMJJ0000
 | 
					    date_de_debut_validite_amc: String,   // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    date_de_fin_validite_amc: String,                 // CN - Format AAAAMMJJ0000
 | 
					    date_de_fin_validite_amc: String,     // CN - Format AAAAMMJJ0000
 | 
				
			||||||
    code_routage_flux_amc: String,                    // CA - 2
 | 
					    code_routage_flux_amc: String,        // CA - 2
 | 
				
			||||||
    identifiant_hote: String,                         // CA - 3
 | 
					    identifiant_hote: String,             // CA - 3
 | 
				
			||||||
    nom_de_domaine_amc: String,                       // CE - 20
 | 
					    nom_de_domaine_amc: String,           // CE - 20
 | 
				
			||||||
    code_aiguillage_sts: char,                        // CA - 1
 | 
					    code_aiguillage_sts: char,            // CA - 1
 | 
				
			||||||
    type_de_services_associes: char,                  // CA - 1
 | 
					    type_de_services_associes: char,      // CA - 1
 | 
				
			||||||
    services_associes_au_contrat: String,             // CE - 17
 | 
					    services_associes_au_contrat: String, // CE - 17
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#[derive(Debug, Default)]
 | 
					#[derive(Debug, Default)]
 | 
				
			||||||
struct DonneesRUFBeneficiaireComplementaire {
 | 
					struct DonneesRUFBeneficiaireComplementaire {
 | 
				
			||||||
    donnees_ruf_beneficiaire_complementaire: String,  // CE - 115
 | 
					    donnees_ruf_beneficiaire_complementaire: String, // CE - 115
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pub fn LireDroitsVitale(
 | 
				
			||||||
pub fn LireDroitsVitale(lecteurPS: &str, lecteurVitale: &str, codePorteurPS: &str, dateConsultation: &str) -> Result<CarteVitale, String> {
 | 
					    lecteurPS: &str,
 | 
				
			||||||
 | 
					    lecteurVitale: &str,
 | 
				
			||||||
 | 
					    codePorteurPS: &str,
 | 
				
			||||||
 | 
					    dateConsultation: &str,
 | 
				
			||||||
 | 
					) -> Result<CarteVitale, String> {
 | 
				
			||||||
    let resource_ps = CString::new(lecteurPS).expect("CString::new failed");
 | 
					    let resource_ps = CString::new(lecteurPS).expect("CString::new failed");
 | 
				
			||||||
    let resource_vitale = CString::new(lecteurVitale).expect("CString::new failed");
 | 
					    let resource_vitale = CString::new(lecteurVitale).expect("CString::new failed");
 | 
				
			||||||
    let card_number = CString::new(codePorteurPS).expect("CString::new failed");
 | 
					    let card_number = CString::new(codePorteurPS).expect("CString::new failed");
 | 
				
			||||||
@@ -155,7 +148,7 @@ pub fn LireDroitsVitale(lecteurPS: &str, lecteurVitale: &str, codePorteurPS: &st
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    let mut buffer: *mut c_void = ptr::null_mut();
 | 
					    let mut buffer: *mut c_void = ptr::null_mut();
 | 
				
			||||||
    let mut size: size_t = 0;
 | 
					    let mut size: size_t = 0;
 | 
				
			||||||
    let mut hex_values: &[u8] = &[];
 | 
					   let mut hex_values: &[u8] = &[];
 | 
				
			||||||
    unsafe {
 | 
					    unsafe {
 | 
				
			||||||
        let result = SSV_LireDroitsVitale(
 | 
					        let result = SSV_LireDroitsVitale(
 | 
				
			||||||
            resource_ps.as_ptr(),
 | 
					            resource_ps.as_ptr(),
 | 
				
			||||||
@@ -165,137 +158,566 @@ pub fn LireDroitsVitale(lecteurPS: &str, lecteurVitale: &str, codePorteurPS: &st
 | 
				
			|||||||
            &mut buffer,
 | 
					            &mut buffer,
 | 
				
			||||||
            &mut size,
 | 
					            &mut size,
 | 
				
			||||||
        );
 | 
					        );
 | 
				
			||||||
        println!("SSV_LireCartePS result: {}", result);
 | 
					        println!("SSV_LireDroitsVitale result: {}", result);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if !buffer.is_null() {
 | 
					        if !buffer.is_null() {
 | 
				
			||||||
            hex_values = std::slice::from_raw_parts(buffer as *const u8, size);
 | 
					            hex_values = std::slice::from_raw_parts(buffer as *const u8, size);
 | 
				
			||||||
            libc::free(buffer);
 | 
					 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    let groups = decode_ssv_memory(hex_values, hex_values.len());
 | 
					    let groups = decode_ssv_memory(hex_values, hex_values.len());
 | 
				
			||||||
    decode_carte_vitale(groups)
 | 
					
 | 
				
			||||||
 | 
					  let OUT =  decode_carte_vitale(groups);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    unsafe {
 | 
				
			||||||
 | 
					        if !buffer.is_null() {
 | 
				
			||||||
 | 
					            libc::free(buffer); // ??? si liberer avant decode_ssv_memory et decode_carte_vitale alors hex_values n'est plus correct ???
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					OUT
 | 
				
			||||||
 | 
					 
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
fn decode_carte_vitale(groups: Vec<Block>) -> Result<CarteVitale, String> {
 | 
					fn decode_carte_vitale(groups: Vec<Block>) -> Result<CarteVitale, String> {
 | 
				
			||||||
    let mut cartevitale = CarteVitale::default();
 | 
					    let mut cartevitale = CarteVitale::default();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    // let lastBlock :u16;
 | 
					 | 
				
			||||||
    // let lastField :u16;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
    for group in groups {
 | 
					    for group in groups {
 | 
				
			||||||
        for field in group.content {
 | 
					        for field in group.content {
 | 
				
			||||||
 | 
					 | 
				
			||||||
            match (group.id, field.id) {
 | 
					            match (group.id, field.id) {
 | 
				
			||||||
                (101, 1) => {
 | 
					                (104, 1) => {
 | 
				
			||||||
                    let byte = field.content[0];
 | 
					                    cartevitale
 | 
				
			||||||
                    cartevitale.donneesAssure.type_de_carte_vitale = byte as char;
 | 
					                        .donneesBeneficiaire
 | 
				
			||||||
 | 
					                        .push(DonneesBeneficiaire::default());
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                (101, 2) => {
 | 
					                (105, 1) => {
 | 
				
			||||||
                    cartevitale.donneesAssure.numero_de_serie =
 | 
					                    cartevitale
 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					                        .donneesBeneficiaire
 | 
				
			||||||
 | 
					                        .last_mut()
 | 
				
			||||||
 | 
					                        .unwrap()
 | 
				
			||||||
 | 
					                        .periodeDroitsAMO
 | 
				
			||||||
 | 
					                        .push(PeriodeDroitsAMO::default());
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                (101, 3) => {
 | 
					                (106, 1) => {
 | 
				
			||||||
                    cartevitale.donneesAssure.date_de_fin_de_validite =
 | 
					                    cartevitale
 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					                        .donneesBeneficiaire
 | 
				
			||||||
 | 
					                        .last_mut()
 | 
				
			||||||
 | 
					                        .unwrap()
 | 
				
			||||||
 | 
					                        .periodeCodeCouverture
 | 
				
			||||||
 | 
					                        .push(PeriodeCodeCouverture::default());
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                (101, 4) => {
 | 
					                (108, 1) => {
 | 
				
			||||||
                    let byte = field.content[0];
 | 
					                    cartevitale
 | 
				
			||||||
                    cartevitale.donneesAssure.donnees_administration_ruf1 = byte as char;
 | 
					                        .donneesBeneficiaire
 | 
				
			||||||
 | 
					                        .last_mut()
 | 
				
			||||||
 | 
					                        .unwrap()
 | 
				
			||||||
 | 
					                        .donneesMutuelle
 | 
				
			||||||
 | 
					                        .periodeDroitsMutuelle
 | 
				
			||||||
 | 
					                        .push(PeriodeDroitsMutuelle::default());
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                (101, 5) => {
 | 
					                _ => {}
 | 
				
			||||||
                    cartevitale.donneesAssure.donnees_administration_ruf2 =
 | 
					            }
 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					            if field.content.len() > 0 {
 | 
				
			||||||
 | 
					                match (group.id, field.id) {
 | 
				
			||||||
 | 
					                    (101, 1) => {
 | 
				
			||||||
 | 
					                        let byte = field.content[0];
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.type_de_carte_vitale = byte as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 2) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.numero_de_serie =  //bytes_to_decimal_string(&field.content);
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 3) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.date_de_fin_de_validite =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 4) => {
 | 
				
			||||||
 | 
					                        println!("101.4  field.size: {:#?}", field.size);
 | 
				
			||||||
 | 
					                        let byte = field.content[0];
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.donnees_administration_ruf1 = byte as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 5) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.donnees_administration_ruf2 =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 6) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.donnees_ruf_administration =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 7) => {
 | 
				
			||||||
 | 
					                        let byte = field.content[0];
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.type_d_identification_du_porteur = byte as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 8) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.numero_national_d_immatriculation =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 9) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.cle_du_nir =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 10) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.code_regime =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 11) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.caisse_gestionnaire =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 12) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.centre_gestionnaire =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 13) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.code_gestion =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (101, 14) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAssure.donnees_ruf_famille =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (102, 1) => {
 | 
				
			||||||
 | 
					                        cartevitale.serviceAMOFamille.code_service_amo_famille =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (102, 2) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .serviceAMOFamille
 | 
				
			||||||
 | 
					                            .date_de_debut_service_amo_famille =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (102, 3) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .serviceAMOFamille
 | 
				
			||||||
 | 
					                            .date_de_fin_service_amo_famille =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (103, 1) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesAccidentTravail
 | 
				
			||||||
 | 
					                            .organisme_gestionnaire_risque_at =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (103, 2) => {
 | 
				
			||||||
 | 
					                        let byte = field.content[0];
 | 
				
			||||||
 | 
					                        cartevitale.donneesAccidentTravail.code_at = byte as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (103, 3) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAccidentTravail.identifiant_at =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (103, 4) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesAccidentTravail
 | 
				
			||||||
 | 
					                            .organisme_gestionnaire_at1 =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (103, 5) => {
 | 
				
			||||||
 | 
					                        let byte = field.content[0];
 | 
				
			||||||
 | 
					                        cartevitale.donneesAccidentTravail.code_at1 = byte as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (103, 6) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAccidentTravail.identifiant_at1 =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (103, 7) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesAccidentTravail
 | 
				
			||||||
 | 
					                            .organisme_gestionnaire_at2 =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (103, 8) => {
 | 
				
			||||||
 | 
					                        let byte = field.content[0];
 | 
				
			||||||
 | 
					                        cartevitale.donneesAccidentTravail.code_at2 = byte as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (103, 9) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesAccidentTravail.identifiant_at2 =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 1) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .nom_usuel = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 2) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .nom_de_famille = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 3) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesBeneficiaire.last_mut().unwrap().prenom =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 4) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .adresse_ligne_1 = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 5) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .adresse_ligne_2 = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 6) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .adresse_ligne_3 = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 7) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .adresse_ligne_4 = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 8) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .adresse_ligne_5 = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 9) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .nir_certifie = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 10) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .cle_du_nir_certifie =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 11) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_certification_du_nir =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 12) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_naissance = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 13) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .rang_de_naissance = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 14) => {
 | 
				
			||||||
 | 
					                        cartevitale.donneesBeneficiaire.last_mut().unwrap().qualite =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 15) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .code_service_amo_beneficiaire = field.content[0] as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 16) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_debut_service_amo =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 17) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_fin_service_amo =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (104, 18) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donnees_ruf_amo = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (105, 1) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .periodeDroitsAMO
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_debut_droits_amo =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (105, 2) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .periodeDroitsAMO
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_fin_droits_amo =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (106, 1) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .periodeCodeCouverture
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_debut_code_couverture =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (106, 2) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .periodeCodeCouverture
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_fin_code_couverture =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (106, 3) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .periodeCodeCouverture
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .code_ald = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (106, 4) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .periodeCodeCouverture
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .code_situation = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (107, 1) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesMutuelle
 | 
				
			||||||
 | 
					                            .identification_mutuelle =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (107, 2) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesMutuelle
 | 
				
			||||||
 | 
					                            .garanties_effectives =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (107, 3) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesMutuelle
 | 
				
			||||||
 | 
					                            .indicateur_de_traitement_mutuelle =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (107, 4) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesMutuelle
 | 
				
			||||||
 | 
					                            .type_de_services_associes = field.content[0] as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (107, 5) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesMutuelle
 | 
				
			||||||
 | 
					                            .services_associes_au_contrat =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (107, 6) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesMutuelle
 | 
				
			||||||
 | 
					                            .code_aiguillage_sts = field.content[0] as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (108, 1) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesMutuelle
 | 
				
			||||||
 | 
					                            .periodeDroitsMutuelle
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_debut_droits_mutuelle =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (108, 2) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesMutuelle
 | 
				
			||||||
 | 
					                            .periodeDroitsMutuelle
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .date_de_fin_droits_mutuelle =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 1) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .numero_complementaire_b2 =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 2) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .numero_complementaire_edi =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 3) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .numero_adherent_amc =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 4) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .indicateur_de_traitement_amc =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 5) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .date_de_debut_validite_amc =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 6) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .date_de_fin_validite_amc =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 7) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .code_routage_flux_amc =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 8) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .identifiant_hote = String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 9) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .nom_de_domaine_amc =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 10) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .code_aiguillage_sts = field.content[0] as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 11) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .type_de_services_associes = field.content[0] as char;
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (109, 12) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesComplementaire
 | 
				
			||||||
 | 
					                            .services_associes_au_contrat =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                    (111, 1) => {
 | 
				
			||||||
 | 
					                        cartevitale
 | 
				
			||||||
 | 
					                            .donneesBeneficiaire
 | 
				
			||||||
 | 
					                            .last_mut()
 | 
				
			||||||
 | 
					                            .unwrap()
 | 
				
			||||||
 | 
					                            .donneesRUFBeneficiaireComplementaire
 | 
				
			||||||
 | 
					                            .donnees_ruf_beneficiaire_complementaire =
 | 
				
			||||||
 | 
					                            String::from_utf8_lossy(field.content).to_string();
 | 
				
			||||||
 | 
					                    }
 | 
				
			||||||
 | 
					                     _ =>  {
 | 
				
			||||||
 | 
					                                return Err(format!(
 | 
				
			||||||
 | 
					                                    "Unknown (group, field) pair: ({}, {})",
 | 
				
			||||||
 | 
					                                    group.id, field.id
 | 
				
			||||||
 | 
					                                ))
 | 
				
			||||||
 | 
					                            }
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                (101, 6) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAssure.donnees_ruf_administration =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (101, 7) => {
 | 
					 | 
				
			||||||
                    let byte = field.content[0];
 | 
					 | 
				
			||||||
                    cartevitale.donneesAssure.type_d_identification_du_porteur = byte as char;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (101, 8) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAssure.numero_national_d_immatriculation =
 | 
					 | 
				
			||||||
                    String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (101, 9) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAssure.cle_du_nir =
 | 
					 | 
				
			||||||
                    String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (101, 10) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAssure.code_regime =
 | 
					 | 
				
			||||||
                    String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (101, 11) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAssure.caisse_gestionnaire =
 | 
					 | 
				
			||||||
                    String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (101, 12) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAssure.centre_gestionnaire =
 | 
					 | 
				
			||||||
                    String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (101, 13) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAssure.code_gestion =
 | 
					 | 
				
			||||||
                    String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (101, 14) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAssure.donnees_ruf_famille =
 | 
					 | 
				
			||||||
                    String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (102, 1) => {
 | 
					 | 
				
			||||||
                    cartevitale.serviceAMOFamille.code_service_amo_famille =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (102, 2) => {
 | 
					 | 
				
			||||||
                    cartevitale.serviceAMOFamille.date_de_debut_service_amo_famille =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (102, 3) => {
 | 
					 | 
				
			||||||
                    cartevitale.serviceAMOFamille.date_de_fin_service_amo_famille =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (103, 1) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAccidentTravail.organisme_gestionnaire_risque_at =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (103, 2) => {
 | 
					 | 
				
			||||||
                    let byte = field.content[0];
 | 
					 | 
				
			||||||
                    cartevitale.donneesAccidentTravail.code_at = byte as char;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (103, 3) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAccidentTravail.identifiant_at =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (103, 4) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAccidentTravail.organisme_gestionnaire_at1 =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (103, 5) => {
 | 
					 | 
				
			||||||
                    let byte = field.content[0];
 | 
					 | 
				
			||||||
                    cartevitale.donneesAccidentTravail.code_at1 = byte as char;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (103, 6) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAccidentTravail.identifiant_at1 =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (103, 7) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAccidentTravail.organisme_gestionnaire_at2 =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (103, 8) => {
 | 
					 | 
				
			||||||
                    let byte = field.content[0];
 | 
					 | 
				
			||||||
                    cartevitale.donneesAccidentTravail.code_at2 = byte as char;
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                (103, 9) => {
 | 
					 | 
				
			||||||
                    cartevitale.donneesAccidentTravail.identifiant_at2 =
 | 
					 | 
				
			||||||
                        String::from_utf8_lossy(field.content).to_string();
 | 
					 | 
				
			||||||
                }
 | 
					 | 
				
			||||||
                 _ =>{} //{
 | 
					 | 
				
			||||||
                //     return Err(format!(
 | 
					 | 
				
			||||||
                //         "Unknown (group, field) pair: ({}, {})",
 | 
					 | 
				
			||||||
                //         group.id, field.id
 | 
					 | 
				
			||||||
                //     ))
 | 
					 | 
				
			||||||
                // }
 | 
					 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,5 +1,5 @@
 | 
				
			|||||||
mod cps;
 | 
					mod cps;
 | 
				
			||||||
mod carteVitale;
 | 
					mod cartevitale;
 | 
				
			||||||
mod libssv;
 | 
					mod libssv;
 | 
				
			||||||
mod ssv_memory;
 | 
					mod ssv_memory;
 | 
				
			||||||
mod ssvlib_demo;
 | 
					mod ssvlib_demo;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -71,6 +71,8 @@ impl<'a> From<&'a [u8]> for Block<'a> {
 | 
				
			|||||||
        let mut field_id = 1;
 | 
					        let mut field_id = 1;
 | 
				
			||||||
        while field_offset < block_size {
 | 
					        while field_offset < block_size {
 | 
				
			||||||
            let mut field: Field<'a> = raw_content[field_offset..].into();
 | 
					            let mut field: Field<'a> = raw_content[field_offset..].into();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
            field.id = field_id;
 | 
					            field.id = field_id;
 | 
				
			||||||
            field_offset += field.size;
 | 
					            field_offset += field.size;
 | 
				
			||||||
            field_id += 1;
 | 
					            field_id += 1;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										26
									
								
								scripts/compile_win_headers - Copie.bat
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										26
									
								
								scripts/compile_win_headers - Copie.bat
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,26 @@
 | 
				
			|||||||
 | 
					@echo off
 | 
				
			||||||
 | 
					rem Set variables
 | 
				
			||||||
 | 
					set LIB_DIR=crates/sesam-vitale/lib
 | 
				
			||||||
 | 
					set DEF_DIR=crates/sesam-vitale/src/win/fsv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if "%1"=="/clean" (
 | 
				
			||||||
 | 
					    goto clean
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem Set the environment for the x64 platform
 | 
				
			||||||
 | 
					call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem Create a ssvw64.lib file from the ssvw64.def file
 | 
				
			||||||
 | 
					lib /def:ssvw64.def /out:%LIB_DIR%\ssvw64.lib /machine:x64
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem Build complete
 | 
				
			||||||
 | 
					pause
 | 
				
			||||||
 | 
					exit /b 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					:clean
 | 
				
			||||||
 | 
					del %LIB_DIR%\*.lib
 | 
				
			||||||
 | 
					del %LIB_DIR%\*.exp
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rem Clean complete
 | 
				
			||||||
 | 
					pause
 | 
				
			||||||
 | 
					exit /b 0
 | 
				
			||||||
@@ -1,7 +1,7 @@
 | 
				
			|||||||
@echo off
 | 
					@echo off
 | 
				
			||||||
rem Set variables
 | 
					rem Set variables
 | 
				
			||||||
set LIB_DIR=crates/sesam-vitale/lib
 | 
					set LIB_DIR=F:\PAPILLON\Krys4lideCopie\crates\sesam-vitale\lib
 | 
				
			||||||
set DEF_DIR=crates/sesam-vitale/src/win/fsv
 | 
					set DEF_DIR=F:\PAPILLON\Krys4lideCopie\crates\sesam-vitale\src\win\fsv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if "%1"=="/clean" (
 | 
					if "%1"=="/clean" (
 | 
				
			||||||
    goto clean
 | 
					    goto clean
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										6
									
								
								scripts/ssvw64.def
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								scripts/ssvw64.def
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
				
			|||||||
 | 
					LIBRARY "ssvw64"
 | 
				
			||||||
 | 
					EXPORTS
 | 
				
			||||||
 | 
					    SSV_InitLIB2
 | 
				
			||||||
 | 
					    SSV_LireCartePS
 | 
				
			||||||
 | 
					    SSV_LireConfig
 | 
				
			||||||
 | 
					    SSV_LireDroitsVitale
 | 
				
			||||||
		Reference in New Issue
	
	Block a user