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
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:
osHostname
: the hostname as reported by the operating system (os.hostname
, see https://nodejs.org/api/os.html#os_os_hostname)osUsername
: the username as reported by the operating system (username
, see https://www.npmjs.com/package/username)allow
: an array of samedi usernames to allow loging in. Can also betrue
to allow all usernames.[]
disallows all usernames
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": [] }
]
}