samedi-app

Version 38.0.1

Configuration

You can configure samedi-app via a JSON file called app.cfg. This JSON file must be created and stored in the following directory:

(If the directory does not exist already, you need to create it manually)

Windows

  • C:\Programme (x86)\samedi-app\app.cfg, oder
  • Installationsverzeichnis (bei systemweiter MSI-Installation)

macOS

  • ~/Library/Application Support/samedi-app/app.cfg

Linux

  • $XDG_CONFIG_HOME/samedi-app/app.cfg

This file must be a well-formed JSON document (see http://json.org for more information), otherwise, it will be ignored.

Every configuration option is a key in this file. Here’s an example file:

{
  "mongoUrl": "mongodb://192.168.15.14:27017"
}

This sets the option mongoUrl

Options

mongoUrl

This sets the mongodb connection URL for using a central patient index. Using this option is preferred over using mongoHost and mongoPort, as you can also set up replica sets for high availability, set different options, etc.

The format for mongoUrl is described in detail in the mongodb manual.

Do not set a database in this URL! This will be ignored!

Valid examples:

mongodb://192.168.15.14/
mongodb://db1.example.net,db2.example.com/?replicaSet=test

We strongly recommend enabling authentication when configuring mongodb. Information on this can be found here. Once authentication is enabled, samedi-app can’t reach the patient index without credentials. There are two ways to provide them, use only one of them:

  1. In the mongoUrl (plain text in app.cfg), see authentication options:

    {
      "mongoUrl": "mongodb://username:password@192.168.15.14:27017"
    }
    
  2. Encrypted with mongoEncryptedUser and mongoEncryptedPass, so the password isn’t readable in plain text in app.cfg. The key is built into samedi-app, so this only guards against casual reading, not against anyone with access to the file. Keep the mongoUrl without username and password, then in samedi-app open Tools > Config file > Add encrypted config (only shown once an app.cfg exists), select mongoEncryptedUser, enter the username and click Add to app.cfg. Repeat with mongoEncryptedPass and the password. Restart samedi-app afterwards.

    {
      "mongoUrl": "mongodb://192.168.15.14:27017",
      "mongoEncryptedUser": "<written by samedi-app>",
      "mongoEncryptedPass": "<written by samedi-app>"
    }
    

    The encrypted option only works with mongodb:// URLs, not with mongodb+srv://.

In the mongoUrl, special characters in the username or password (e.g. @ : / ? # [ ] %) must be percent-encoded, e.g. p@ss becomes p%40ss. The encrypted option encodes the values itself. Only a value containing % followed by two hex digits (e.g. a%41) is read as already encoded there, so enter it percent-encoded (a%2541).

samedi-app adds the database name to the URL itself. If the user was created in the admin database (the default), the mongoUrl must therefore contain authSource=admin, e.g. mongodb://192.168.15.14:27017/?authSource=admin. For any other database use authSource=<database> accordingly.

mongoHost (deprecated)

mongoHost sets the IP address or hostname for a mongodb instance for using a central patient index. This option is deprecated in favor of mongoUrl.

mongoPort (deprecated)

mongoPort sets the port for a mongodb instance for using a central patient index. This option is deprecated in favor of mongoUrl.

printProgram

The printProgram option can be used to define that samedi-app should use when printing an appointment sheet or resource overview. The format of this option is like this:

{
  "printProgram": ["Program", "Argument1", "Argument2", "ArgumentN"]
}

Theres a placeholder you can use in any of the arguments: %file%. This will be replaced with the filename of the PDF file to print. Please also take care that you might need to quote the program path.

Here’s an example which prints the appointment sheet using “Foxit Reader” to a printer named “Terminzettel”

{
  "printProgram": [
    "\"C:\\Program Files (x86)\\Foxit Software\\Foxit Reader\\FoxitReader.exe\"",
    "/t",
    "%file%",
    "Terminzettel"
  ]
}

pdfConverter

The pdfConverter option is used to configure the program used to convert word template files (docx) to PDF when exporting a Form.

{
  "pdfConverter": ["Program", "Argument1", "Argument2", "ArgumentN"]
}

You can use the following placeholders:

%input_file%: This is the input file the converter program should convert to a PDF (the “.docx” file)

%output_file%: This is the filename the converter program should write the PDF file to. This is usually the same filename as the input_file, but with a “.pdf extension”

%output_dir%: For converters which cannot handle an output file argument, you can use output_dir. The converter is expected though to output the PDF with the same filename as input_file but with a “.pdf” extension.

Here’s an example which prints the appointment sheet using LibreOffice Writer to convert a docx document to PDF

{
  "pdfConverter": [
    "\"C:\\Program Files (x86)\\LibreOffice\\program\\soffice.exe\"",
    "--convert-to",
    "pdf",
    "--outdir",
    "%output_dir%",
    "%input_file%"
  ]
}

Using PDFCreator:

{
  "pdfConverter": [
    "\"C:\\Program Files\\PDFCreator\\PDFCreator.exe\"",
    "/PrintFile=\"%input_file%\"",
    "/PrinterName=\"samedi PDF\""
  ],
  "pdfConverterOpensAfterConversion": true
}

For this to work, you need to configure PDFCreator correctly:

  • Create a new Profile “samedi PDF” in PDFCreator with the settings:
    • Automatic save
    • Choose a folder to print the PDFs to
    • Do not overwrite files
    • Open after save
  • Then, go to Printers and create a new printer “samedi PDF” which uses the profile you just created

pdfConverterOpensAfterConversion

Set this option to true when your PDF converter automatically opens the PDF after creation (e.g. above PDFCreator profile). In this case, samedi-app won’t try to open the PDF itself.

allowedUserLogins

You can use this option to restrict which users should be able to log in on which computer. IMPORTANT: This is NOT a security feature and should not be used as such. This is purely for organizational purposes.

The primary use case for this is when you have multiple users who are constantly switching their workplaces and you want to make sure that they log in to the correct account on a specific PC (because they have different group permissions for example)

The option consists of an array of entries which try to match the current computer name and user name (as reported by your operating system)

When an entry matches, only the allowed samedi users are allowed to log in (again, this is not a security feature and can be easily circumvented).

After any matching entry, the processing is stopped. Processing starts from the first entry, order is important here.

Each entry can have the following options:

If osHostname or osUsername are not present, they match all values.

Example Config:

{
  "allowedUserLogins": [
    { "osHostname": "machine2", "allow": ["peter_morgen", "peter.kasse"] },
    { "osHostname": "machine3", "osUsername": "max", "allow": ["max"] },
    { "osUsername": "admin", "allow": true },
    { "osUsername": "fred", "allow": [] },
    { "allow": [] }
  ]
}

cache

To control the maximum size of the on-disk cache for browser data, use cache.maxSizeMB (default is 1024 MB):

{
  "cache": {
    "maxSizeMB": 512
  }
}