chore: start implementing types from docs

This commit is contained in:
theo 2024-08-04 01:24:42 +02:00
parent 0f7a291b3c
commit e51dcc0ed0
Signed by: theo
SSH Key Fingerprint: SHA256:IbehMhSwpXrGUj7vj9iVvfdwe3g09IL9KLUz0zFzcXU
6 changed files with 251 additions and 52 deletions

120
Cargo.lock generated
View File

@ -327,9 +327,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
[[package]]
name = "bytemuck"
version = "1.16.1"
version = "1.16.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e"
checksum = "102087e286b4677862ea56cf8fc58bb2cdfa8725c40ffb80fe3a008eb7f2fc83"
[[package]]
name = "byteorder"
@ -339,9 +339,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b"
[[package]]
name = "bytes"
version = "1.6.1"
version = "1.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952"
checksum = "fca2be1d5c43812bae364ee3f30b3afcb7877cf59f4aeb94c66f313a41d2fac9"
dependencies = [
"serde",
]
@ -410,14 +410,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719"
dependencies = [
"serde",
"toml 0.8.16",
"toml 0.8.19",
]
[[package]]
name = "cc"
version = "1.1.6"
version = "1.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f"
checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc"
[[package]]
name = "cesu8"
@ -769,12 +769,6 @@ dependencies = [
"syn 2.0.72",
]
[[package]]
name = "dotenv"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f"
[[package]]
name = "dpi"
version = "0.1.1"
@ -820,7 +814,7 @@ dependencies = [
"cc",
"memchr",
"rustc_version",
"toml 0.8.16",
"toml 0.8.19",
"vswhom",
"winreg",
]
@ -1520,9 +1514,9 @@ dependencies = [
[[package]]
name = "indexmap"
version = "2.2.6"
version = "2.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0"
dependencies = [
"equivalent",
"hashbrown 0.14.5",
@ -2360,7 +2354,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016"
dependencies = [
"base64 0.22.1",
"indexmap 2.2.6",
"indexmap 2.3.0",
"quick-xml",
"serde",
"time",
@ -2387,9 +2381,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
[[package]]
name = "ppv-lite86"
version = "0.2.17"
version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f"
dependencies = [
"zerocopy",
]
[[package]]
name = "precomputed-hash"
@ -2814,11 +2811,12 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.120"
version = "1.0.121"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5"
checksum = "4ab380d7d9f22ef3f21ad3e6c1ebe8e4fc7a2000ccba2e4d71fc96f15b2cb609"
dependencies = [
"itoa 1.0.11",
"memchr",
"ryu",
"serde",
]
@ -2875,7 +2873,7 @@ dependencies = [
"chrono",
"hex",
"indexmap 1.9.3",
"indexmap 2.2.6",
"indexmap 2.3.0",
"serde",
"serde_derive",
"serde_json",
@ -2917,6 +2915,10 @@ dependencies = [
"syn 1.0.109",
]
[[package]]
name = "services-sesam-vitale-sys"
version = "0.1.0"
[[package]]
name = "servo_arc"
version = "0.1.1"
@ -2931,7 +2933,6 @@ dependencies = [
name = "sesam-vitale"
version = "0.1.0"
dependencies = [
"dotenv",
"libc",
]
@ -3142,7 +3143,7 @@ dependencies = [
"cfg-expr",
"heck 0.5.0",
"pkg-config",
"toml 0.8.16",
"toml 0.8.19",
"version-compare",
]
@ -3198,15 +3199,15 @@ dependencies = [
[[package]]
name = "target-lexicon"
version = "0.12.15"
version = "0.12.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2"
checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "tauri"
version = "2.0.0-beta.24"
version = "2.0.0-beta.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3eab508aad4ae86e23865e294b20a7bb89bd7afea523897b7478329b841d4295"
checksum = "4339c67eb7700fe4a80ad6507e3b9af0b4159959f3d74aae48feed298baf4cbf"
dependencies = [
"anyhow",
"bytes",
@ -3269,7 +3270,7 @@ dependencies = [
"serde_json",
"tauri-utils",
"tauri-winres",
"toml 0.8.16",
"toml 0.8.19",
"walkdir",
]
@ -3316,9 +3317,9 @@ dependencies = [
[[package]]
name = "tauri-runtime"
version = "2.0.0-beta.20"
version = "2.0.0-beta.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe978df03966febbebc608931dc2cf26ef94df70855a18b05f07134cf474de09"
checksum = "189510033be50f6fde35cfa50b50c7ab4e0ced0c867ae0f643b4907b8385bbe5"
dependencies = [
"dpi",
"gtk",
@ -3335,9 +3336,9 @@ dependencies = [
[[package]]
name = "tauri-runtime-wry"
version = "2.0.0-beta.20"
version = "2.0.0-beta.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "11e4d568f61095f507b3fc4254dfbfff3b20de2a1d66167ffca3f6d90b14db8f"
checksum = "6938bd63b6658e7b08f0fe2151390148ee5a8ccdba100d4dff961d2c8734d9a9"
dependencies = [
"cocoa",
"gtk",
@ -3386,7 +3387,7 @@ dependencies = [
"serde_with",
"swift-rs",
"thiserror",
"toml 0.8.16",
"toml 0.8.19",
"url",
"urlpattern",
"walkdir",
@ -3497,9 +3498,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.39.1"
version = "1.39.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a"
checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1"
dependencies = [
"backtrace",
"bytes",
@ -3549,21 +3550,21 @@ dependencies = [
[[package]]
name = "toml"
version = "0.8.16"
version = "0.8.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c"
checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e"
dependencies = [
"serde",
"serde_spanned",
"toml_datetime",
"toml_edit 0.22.17",
"toml_edit 0.22.20",
]
[[package]]
name = "toml_datetime"
version = "0.6.7"
version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db"
checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41"
dependencies = [
"serde",
]
@ -3574,7 +3575,7 @@ version = "0.19.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421"
dependencies = [
"indexmap 2.2.6",
"indexmap 2.3.0",
"serde",
"serde_spanned",
"toml_datetime",
@ -3587,22 +3588,22 @@ version = "0.20.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81"
dependencies = [
"indexmap 2.2.6",
"indexmap 2.3.0",
"toml_datetime",
"winnow 0.5.40",
]
[[package]]
name = "toml_edit"
version = "0.22.17"
version = "0.22.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16"
checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d"
dependencies = [
"indexmap 2.2.6",
"indexmap 2.3.0",
"serde",
"serde_spanned",
"toml_datetime",
"winnow 0.6.16",
"winnow 0.6.18",
]
[[package]]
@ -4453,9 +4454,9 @@ dependencies = [
[[package]]
name = "winnow"
version = "0.6.16"
version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c"
checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f"
dependencies = [
"memchr",
]
@ -4532,3 +4533,24 @@ dependencies = [
"once_cell",
"pkg-config",
]
[[package]]
name = "zerocopy"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6"
dependencies = [
"byteorder",
"zerocopy-derive",
]
[[package]]
name = "zerocopy-derive"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91"
dependencies = [
"proc-macro2",
"quote",
"syn 2.0.72",
]

View File

@ -4,4 +4,4 @@ members = [
"crates/app",
"crates/sesam-vitale",
"crates/desktop"
]
, "crates/services-sesam-vitale-sys"]

View File

@ -2,5 +2,3 @@
name = "services-sesam-vitale-sys"
version = "0.1.0"
edition = "2021"
[dependencies]

View File

@ -1,3 +1,6 @@
mod types;
use types::*;
pub fn add(left: usize, right: usize) -> usize {
left + right
}

View File

@ -0,0 +1,176 @@
struct Identification<T> {
value: T,
// Key to check the validity of the value
// TODO: implement checking algorithm
key: u8,
}
type Byte = u8;
enum IdentificationNationale {
NumeroAdeli(String),
NumeroEmployeeDansStructure(IdentificationStructure, String),
NumeroDRASS(String),
NumeroRPPS(String),
/// N° Etudiant Médecin type ADELI sur 9 caractères (information transmise par lANS)
NumeroEtudiantMedecin(String),
}
enum TypeCarteProfessionnelSante {
/// Carte de Professionnel de Santé (CPS)
CarteDeProfessionnelSante,
/// Carte de Professionnel de Santé en Formation (CPF)
CarteDeProfessionnelSanteEnFormation,
/// Carte de Personnel d'Établissement de Santé (CDE/CPE)
CarteDePersonnelEtablissementSante,
/// Carte de Personnel Autorisé (CDA/CPA)
CarteDePersonnelAutorise,
/// Carte de Personne Morale
CarteDePersonneMorale,
}
enum CategorieCarteProfessionnelSante {
Reelle,
Test,
Demonstration,
}
enum CodeCivilite {
Adjudant,
Amiral,
Aspirant,
Aumônier,
Capitaine,
Cardinal,
Chanoine,
Colonel,
Commandant,
Commissaire,
Conseiller,
Directeur,
Docteur,
Douanier,
Epouxse, // Epoux(se)
Evêque,
Général,
Gouverneur,
Ingénieur,
Inspecteur,
Lieutenant,
Madame,
Mademoiselle,
Maître,
Maréchal,
Médecin,
Mesdames,
Mesdemoiselles,
Messieurs,
Monseigneur,
Monsieur,
NotreDame,
Pasteur,
Préfet,
Président,
Professeur,
Recteur,
Sergent,
SousPréfet,
Technicien,
Veuve,
}
struct CarteProfessionnelSante {
type_carte: TypeCarteProfessionnelSante,
categorie_carte: CategorieCarteProfessionnelSante,
professionnel_sante: ProfessionnelDeSante,
}
struct ProfessionnelDeSante {
prenom: String,
nom: String,
code_civilite: CodeCivilite,
identification_nationale: Identification<IdentificationNationale>,
situations_execice: Vec<SituationDExercice>,
}
enum IdentificationStructure {
NumeroAdeliCabinet(String),
NumeroFINESS(String),
NumeroSIREN(String),
NumeroSIRET(String),
NumeroRPPSCabinet(String),
}
struct StructureMedicale {
identification: Identification<IdentificationStructure>,
raison_sociale: String, // Nom Entreprise
}
enum ModeExercice {
LiberalExploitantCommercant, // Libéral, exploitant, commerçant
Salarie,
Remplacant,
Benevole,
}
enum StatutExercice {
// TAB-Statuts géré par lANS il faut trouver la donnee
PLACEHOLDER(u8),
}
enum SecteurActivite {
EtablissementPublicDeSanté,
HopitauxMilitaires,
EtablissementPrivePSPH, // Participant au Service Public Hospitalier
EtablissementPriveNonPSPH,
DispensaireDeSoins,
AutresStructuresDeSoinsRelevantDuServiceDeSanteDesArmees,
CabinetIndividuel,
CabinetDeGroupe,
ExerciceEnSociete,
SecteurPrivePHTempsPlein,
TransportSanitaire,
EntrepriseDInterim,
EtablissementDeSoinsEtPrevention,
PreventionEtSoinsEnEntreprise,
SanteScolaireEtUniversitaire,
RecrutementEtGestionRH,
PMIPlanificationFamiliale,
EtablissementPourHandicapes,
ComMarketingConsultingMedia,
EtablissementPersonnesAgees,
EtablissementAideaLaFamille,
EtablissementDEnseignement,
EtablissementsDeProtectionDeLEnfance,
EtablissementsDHebergementEtDeReadaptation,
Recherche,
AssurancePrivee,
OrganismeDeSecuriteSociale,
MinistèreEtServicesDeconcentres,
CollectivitesTerritoriales,
AssociationsEtOrganitationsHumanitaire,
LaboratoireDeBiologieMedicale,
AutreEtablissementSanitaire,
ProductionCommercialisationGrosBienMedicaux,
CommerceDétailDeBiensMédicaux,
PharmacieDOfficine,
CentreDeDialyse,
ParaPharmacie,
AutreSecteurDActivité,
SecteurNonDefini,
CentreAntiCancer,
CentreDeTransfusionSanguine,
RépartitionDistribributionFabricationExploitationImportationMedicamentsEtDispositifsMédicaux,
IncendiesEtSecours,
EntreprisesIndustriellesEtTertiairesHorsIndustriesPharmaceutiques,
EntiteDUnTOM,
FabricationExploitationImportationMedicamentsEtDispositifsMedicaux,
}
struct SituationDExercice {
/// Numéro identifiant la situation du PS parmi ses autres situations inscrites sur sa CPS
identifiant_situation: Byte,
mode_exercice: Option<ModeExercice>,
statut_exercice: Option<StatutExercice>,
secteur_activite: Option<SecteurActivite>,
structure_d_exercice: Option<StructureMedicale>,
}