haste_server/
lib.rs

1mod extract;
2mod fhir_http;
3
4pub mod auth_n;
5pub mod fhir_client;
6pub mod load_artifacts;
7mod mcp;
8mod middleware;
9pub mod server;
10pub mod services;
11mod static_assets;
12pub mod tenants;
13mod ui;
14
15pub enum ServerEnvironmentVariables {
16    AllowArtifactMutations,
17    // Used for JWT
18    CertificationDir,
19    // Main repo config
20    DataBaseURL,
21    // Search variable config.
22    ElasticSearchURL,
23    ElasticSearchUsername,
24    ElasticSearchPassword,
25    // Main root where the FHIR Server is hosted.
26    APIURI,
27    // Where to redirect for hardcoded admin app.
28    AdminAppRedirectURI,
29    // Email
30    SendGridAPIKey,
31    EmailFromAddress,
32    // Data Limits
33    MaxRequestBodySize,
34}
35
36impl From<ServerEnvironmentVariables> for String {
37    fn from(value: ServerEnvironmentVariables) -> Self {
38        match value {
39            ServerEnvironmentVariables::CertificationDir => "CERTIFICATION_DIR".to_string(),
40            ServerEnvironmentVariables::AllowArtifactMutations => {
41                "ALLOW_ARTIFACT_MUTATIONS".to_string()
42            }
43            ServerEnvironmentVariables::DataBaseURL => "DATABASE_URL".to_string(),
44            ServerEnvironmentVariables::ElasticSearchURL => "ELASTICSEARCH_URL".to_string(),
45            ServerEnvironmentVariables::ElasticSearchUsername => {
46                "ELASTICSEARCH_USERNAME".to_string()
47            }
48            ServerEnvironmentVariables::ElasticSearchPassword => {
49                "ELASTICSEARCH_PASSWORD".to_string()
50            }
51            ServerEnvironmentVariables::APIURI => "API_URI".to_string(),
52            ServerEnvironmentVariables::AdminAppRedirectURI => "ADMIN_APP_REDIRECT_URI".to_string(),
53            ServerEnvironmentVariables::SendGridAPIKey => "SG_API_KEY".to_string(),
54            ServerEnvironmentVariables::EmailFromAddress => "EMAIL_FROM".to_string(),
55            ServerEnvironmentVariables::MaxRequestBodySize => "MAX_REQUEST_BODY_SIZE".to_string(),
56        }
57    }
58}