{
  "Logging": {
    "LogLevel": {
      "Default": "Information",
      "Microsoft.AspNetCore": "Warning"
    }
  },
  "Serilog": {
    "Using": [
      "Serilog.Sinks.Console",
      "Serilog.Sinks.File",
      "Serilog.Exceptions",
      "Serilog.Expressions",
      "Serilog.Enrichers.Thread"
    ],
    "Enrich": [
      "WithExceptionDetails",
      "WithDynamicProperty",
      "WithThreadId"
    ],
    "MinimumLevel": {
      "Default": "Information",
      "Override": {
        "adas_core": "Debug",
        "EasyNetQ": "Information",
        "Quartz": "Information",
        "Microsoft": "Warning",
        "System": "Error"
      }
    },
    "WriteTo": [
      {
        "Name": "Console",
        "Args": {
          "formatter": {
            "type": "Serilog.Templates.ExpressionTemplate, Serilog.Expressions",
            "template": "{@t:yyyy-MM-dd HH:mm:ss} [{@l:u3}]{#if SourceContext is not null} ({SourceContext,35}){#end}: {@m}\n{@x}"
          },
          "theme": "Serilog.Sinks.SystemConsole.Themes.SystemConsoleTheme::Grayscale, Serilog.Sinks.Console"
        }
      },
      {
        "Name": "File",
        "Args": {
          "path": "Logs/.log",
          "formatter": {
            "type": "Serilog.Templates.ExpressionTemplate, Serilog.Expressions",
            "template": "{@t:yyyy-MM-dd HH:mm:ss} [{@l:u3}]{#if SourceContext is not null} ({#if Length(SourceContext) > 35}{Substring(SourceContext, Length(SourceContext) - 35)}{#else}{SourceContext,35}{#end}){#end}: {@m}{#if TraceId is not null} TraceId: {TraceId}{#end}{#if TraceMessageId is not null} TraceMessageId: {TraceMessageId}{#end} TraceIdentifier: {TraceIdentifier} Thread: {ThreadId} \n{@x}"
          },
          //"outputTemplate": "[{Timestamp:o}] [{Level:u}] [{SourceContext:l}] {Message}{NewLine}{Exception}",
          "rollingInterval": 4,
          //0: Infinite, 1: Year, 2: Month, 3: Day, 4: Hour, 5: Minute
          "retainedFileCountLimit": 72,
          // 3 days
          "rollOnFileSizeLimit": true
          //"fileSizeLimitBytes": 20971520 // 20Mb
        }
      }
    ],
    "Properties": {
      "Application": "ADASCORE"
    }
  },
  "AllowedHosts": "*",
  "RedisSettings": {
    "ConnectionString": "localhost:6379",
    "EnableGroupedObservationsCache": true,
    "ExpireKeyInSeconds": 7200
    // 2h
  },
  "CacheSettings": {
    "IsEnabled": true,
    "Service": "Redis",
    "GroupedObservations": {
      "IsEnabled": true
    }
  },
  "DatabaseSettings": {
    //Producción
    //"ConnectionString": "mongodb://smacs:!HRYCM21@10.0.20.78:20907/?maxConnectionPoolSize=1000&waitQueueSize=100000&connectTimeoutMS=10000",
    //"ConnectionString": "mongodb://smacs:!HRYCM21@localhost:27017",
    //develop
    "ConnectionString": "mongodb://smacsuci:2(R*aQpu2r@10.0.20.67:18888/?maxConnectionPoolSize=1000&waitQueueSize=100000&connectTimeoutMS=10000",
    //"ConnectionString": "mongodb://smacsuci:2(R*aQpu2r@10.0.20.67:18888/?authSource=admin",
    //"DatabaseName": "smartuci"
    "DatabaseName": "MeddisPlanUciPanel"
  },
  "RabbitMQSettings": {
    "ConnectionString": "host=localhost;port=5672;username=smacs;password=smacs;publisherConfirms=true;timeout=30",
    "PatientsQueue": "patients",
    "TreatmentsQueue": "treatments",
    "ObservationsQueue": "observations",
    "PumpsQueue": "pumps",
    "RecordingQueue": "recordings",
    "AppointmentsQueue": "appointments",
    "MaxRetries": 1
  },
  "Ldap": {
    "Enabled": true,
    "Server": "bastionvpn.epigram",
    "Port": 21389,
    "SearchBase": "OU=CSCM,DC=salud,DC=madrid,DC=org",
    "PositionProperty": "CAMSanidadPuesto",
    "UserDomainName": "SALUD",
    "AuthoritiesMap": [
      {
        "Group": "CN=gHDOC_T_Philips,OU=Hospital Doce de Octubre,OU=Hospitales,OU=CSCM,DC=salud,DC=madrid,DC=org",
        "Rol": "View",
        "Actions": [
          "View"
        ],
        "DisplayId": "65c114566d5d1ac02b4f2478"
      }
    ],
    "WhiteList": [
      {
        "Name": "Fernando Igual Novella",
        "Username": "53091058C",
        "Rol": "Edit",
        "Actions": [
          "View",
          "Write"
        ],
        "DisplayId": "65c114566d5d1ac02b4f2478"
      }
    ]
  },
  "AuthSettings": {
    "JwtConfig": {
      "Key": "534224WERW�$&/($$ghdTDDTHSSDFVADFTRGW%Y&%�B&CVW$&H&$HWETGWXZ%EGX$%c",
      "Issuer": "https://www.issuer.es/healthcare",
      "Audience": "https://adas.health",
      "ValidateIssuer": false,
      "TokenValidityInMinutes": 1200,
      "RefreshTokenValidityInMinutes": 14400
    },
    "LoginMethods": [
      "Local",
      "Ldap"
    ]
  },
  "ApiSettings": {
    "Customize": "HRYC",
    "PointOfCareMapping": {
      "Key": "PV1",
      "Required": true,
      "Refresh": 600
    },
    "ConfigObservation": {
      "Key": "PV1",
      "IgnoreUnknownObservation": true,
      "IgnoreUnknownTreatment": false,
      "Refresh": 60
    },
    "RetentionPolicy": "NoDelete",
    "RetentionPolicyValue": 0,
    "CreatePatientWithORU": true,
    "CreatePatientWithSIU": true,
    "CreatePatientWithoutLocation": false,
    "CreatePatientWithADT_A08": true,
    "UpdatePatientDataWithORU": false,
    "UpdatePatientLocationWithORU": false,
    "ArchivePatientWithOru": false,
    "UpdatePatientNumberWithOru": false,
    "OnArchivePatientAction": "Archive",
    "ArchivePatientsWithoutObservationsSinceHours": 120000000,
    "CheckInactivePatientSchedulerIntervalHours": 240000000,
    "CheckActiveTreatmentsSchedulerIntervalMinutes": 10,
    "ActivateSchedulerCheckNewsJob": false,
    "SinceDischargeTimeToArchive": 48,
    //"Shift": [ "08:00", "15:00", "18:00" ],
    "FindPatientByLocationWithoutID": false,
    "PersistObservationCodes": true,
    "IccaFacility": "Philips.CIS.CVC",
    "SendingFacility": [
      "LABORATORIO"
    ],
    "AllergiesCode": [
      "473011001"
    ],
    "DrainageCode": [
      "56868008"
    ],
    "PositionCode": [
      "386053000"
    ],
    "IsolationCode": [
      "302147001"
    ],
    "HighFrequencyVentilation": [
      "HNF",
      "HIGH FLOW"
    ],
    "InvasiveVentilation": [
      "67303831",
      "67303912"
    ],
    "NonInvasiveVentilation": [
      "BIPAP",
      "CPAP"
    ],
    //"Surgery": [ "138875005", "35631009", "420419008", "370897002", "115959002", "370896006" ],
    //"SurgeryText": [ "Cirugía láser of", "Cirugía", "Cirugía", "sentidos", "Cirugía", "respirat", "Cirugía", "locomoto", "Cirugía", "renal", "Cirugía", "digestiv", "Cirugía", "neuro" ],
    //"Transcutaneous": [ "151756", "151760" ],
    //"RegionalBrainSaturation": [ "194908", "194909" ],
    //"MedicationBolus": [ "000523", "001034", "21011000140105", "322440003", "322761006", "18851000140100", "333919005", "333920004", "333922007" ],
    //"IntravenousLinesCode": "10546003",
    //"Electroencephalogram": "42803009",
    //Dejar siempre en ultima posicion el Ino code 84481000140102
    //"Respiratory": [ "361110005", "416362002", "84481000140102" ],
    //"Oni": "84481000140102",
    //"BalizaUrl": "http://10.0.10.35/info.html",
    //"BalizaPassword": "password",
    "ConfigObservationRefresh": 60,
    "ConfigUnitsRequired": false,
    "ActivateSchedulerCheckExpiredObservation": false,
    "PathUpdateFiles": [
      "C:",
      "Standard_Files",
      "UploadFromServer"
    ],
    "ActivateCheckInactivePatients": true

    //"PumpExpiresSeconds": 120
  }
}
