{
    "OrthancExplorer2" : {
        // enables or disables the plugin completely
        "Enable": true,

        // Prefix URL of the OE2 application (and API)
        // A value of '/my-ui' means that the app will be available under /my-ui/app/
        // and the api will be available under /my-ui/api/...
        // Should start and end with a '/'
        "Root" : "/ui/",

        // Whether OE2 shall replace the default Orthanc Explorer interface ('/' URL will redirect to OE2)
        "IsDefaultOrthancUI": true,

        // Base theme for the UI (before custom CSS are applied).
        // Allowed values: "light", "dark"
        "Theme": "light",

        // Path to custom CSS file or logo.
        // The custom CSS are applied after these default files and they are loaded after all other CSS.  
        // You may actually override any CSS value or variable from the application. 
        //   - https://github.com/orthanc-server/orthanc-explorer-2/blob/master/WebApplication/src/assets/css/defaults-dark.css
        //   - https://github.com/orthanc-server/orthanc-explorer-2/blob/master/WebApplication/src/assets/css/defaults-light.css
        // "CustomCssPath": "/home/my/path/to/custom.css",
        // "CustomLogoUrl": "https://my.company/logo.png",
        // "CustomLogoPath": "/home/my/path/to/logo.png",
        // "CustomFavIconPath": "/home/my/path/to/favicon.ico",     // note: this can be a .png, .svg or .ico file
        
        // Custom Window/Tab Title
        // "CustomTitle": "Orthanc Explorer 2",

        // This block of configuration is transmitted as is to the frontend application.
        // Make sure not to store any secret here
        "UiOptions" : {
            // note: all the "Enable..." variables can be set to false by the user-profile (if using the authorization plugin)

            "EnableStudyList": true,                    // Enables the access to the study list (TODO)
            "EnableUpload": true,                       // Enables the upload menu/interface
            "EnableDicomModalities": true,              // Enables the 'DICOM Modalities' interface in the side menu
            "EnableDeleteResources": true,              // Enables the delete button for Studies/Series/Instances
            "EnableDownloadZip": true,                  // Enables the download zip button for Studies/Series
            "EnableDownloadDicomDir": false,            // Enables the download DICOM DIR button for Studies/Series
            "EnableDownloadDicomFile": true,            // Enables the download DICOM file button for Instances
            "EnableAnonymization": true,                // Enables the anonymize button
            "EnableModification": true,                 // Enables the modify button
            "EnableSendTo": true,                       // Enables the 'SendTo' button for Studies/Series/Instances
            "EnableApiViewMenu": false,                 // Enables the API button to open API routes for Studies/Series/Instances (developer mode) 
            "EnableWorklists": true,                    // Enables the Worklist menu (provided that the worklist plugin is enabled)
            "EnableSettings": true,                     // Enables the settings menu/interface
            "EnableAuditLogs": true,                    // Enables the audit logs menu/interface (provided that the authorization plugin has audit logs enabled)
            "EnableJobsList": true,                     // Enables the jobs list menu/interface
            "EnableLinkToLegacyUi": true,               // Enables a link to the legacy Orthanc UI
            "EnableChangePassword": true,               // Enables the 'change password' button in the side bar.  Only applicable if Keycloak is enabled
            "EnableViewerQuickButton": true,            // Enables a button in the study list to directly open a viewer
            "EnableReportQuickButton": false,           // Enables a button in the study list to directly open a PDF report if available in the study

            "EnableEditLabels": true,                   // Enables labels management (create/delete/assign/unassign)
            "AvailableLabels": [],                      // If not empty, this list prevents the creation of new labels and only allows add/remove of the listed labels.
                                                        // This configuration may be overriden when you use Keycloak and an auth-service that implements roles/permissions API.
            "EnableLabelsCount": true,                  // Enables display of study count next to the each label (this might slow down the UI)
            "EnableMultiLabelsSearch": false,           // Enables an additional Labels filter in the study list

            "EnableShares": false,                      // Enables sharing studies.  See "Tokens" section below.
            "ShareDuration": 15,                         // The share duration (in days)
            "EnableSharesByEmail": false,                     // Enables sending emails when sharing studies.  
                                                              // Note that you must have an external web-service configured in the "Emails" section.
            "ShareEmailContentTemplate": "TO BE DEFINED",     // The name of the HTML template to use when sharing a study by email 
                                                              // (only the content part that is editable in the text editor).  
                                                              // Your email web-service must provide the HTML template at {Emails.ServerRootUrl}/templates/{UiOptions.ShareEmailContentTemplate}
            "ShareEmailLayoutTemplate": null,                 // The name of the HTML layout template to use when sharing a study by email.
                                                              // This identifier is included in the 'layout-template' field of the payload sent to {Emails.ServerRootUrl}/send 
                                                              // of the external email web-service
            "ShareEmailTitle": "TO BE DEFINED",               // Default title for the email

            "EnableAddSeries": true,                    // Enables the "Add series" button
            "AddSeriesDefaultTags": {                   // Default tag values when adding a new series of each type ("pdf", "image" or "stl")
                "pdf" : {
                    "SeriesDescription": "Report",
                    "Modality": "DOC",
                    "SeriesDate": "$TODAY$"             // Allowed keywords: $TODAY$, $STUDY_DATE$, $FILE_DATE$
                },
                "image" : {
                    "SeriesDescription": "Picture",
                    "Modality": "XC",
                    "SeriesDate": "$TODAY$"
                },
                "stl" : {
                    "SeriesDescription": "Model",
                    "Modality": "M3D",
                    "SeriesDate": "$TODAY$"
                }
            },

            // If both OHIF viewer configurations are enabled, only the v3 is taken into account
            "EnableOpenInOhifViewer": false,            // Enables a "open in OHIF viewer" button.  Note: OHIF can not be used together with KeyCloak (https://community.ohif.org/t/ohif-orthanc-token-to-access-a-single-study/727)
            "OhifViewerPublicRoot" : "http://to-be-defined/",  // must end with a '/'.  e.g: "http://ohif.my.site/" means that link to OHIF will look like http://ohif.my.site/Viewer/1.2.3.444.5555....
            "EnableOpenInOhifViewer3": false,           // Enables a "open in OHIF viewer" button.  If the OHIF plugin is loaded, the default value is 'true'
            "OhifViewer3PublicRoot" : "/ohif/",         // must end with a '/'.  e.g: "http://ohif.my.site/" means that link to OHIF will look like http://ohif.my.site/viewer?StudyInstanceUIDs=1.2.3.444.5555....

            "EnableOpenInMedDreamViewer": false,        // Enables a "open in MedDream viewer" button
            "MedDreamViewerPublicRoot" : "http://to-be-defined/",  // must end with a '/'.  e.g: "http://meddream.my.site/Viewer/" means that link to MedDream will look like http://meddream.my.site/?study=1.2.3.444.5555....

            "EnableOpenInWeasisViewer": false,          // Enables a "open in Weasis viewer" button.  
                                                        // Note that the DICOMWeb plugin must be enabled, Weasis must be installed on your PC and must have been configured to open weasis:// URLs.
                                                        // Also note that Weasis won't be able to retrieve the data if Orthanc requires authentication.

            // Defines which icons is used by which enabled viewer.
            // Allowed keys: "meddream", "osimis-web-viewer", "stone-webviewer", "ohif", "ohif-vr", "ohif-tmtv"
            // Allowed values: CSS class that defines the viewer icons (only from bootstrap icons)
            "ViewersIcons" : {
                "osimis-web-viewer": "bi bi-eye",
                "stone-webviewer": "bi bi-eye-fill",
                "ohif": "bi bi-grid",
                "ohif-vr": "bi bi-grid-1x2",
                "ohif-tmtv": "bi bi-grid-3x3-gap",
                "ohif-seg": "fa-solid fa-shapes fa-button",
                "ohif-micro": "fa-solid fa-microscope fa-button",
                "meddream": "bi bi-columns-gap",
                "volview": "bi bi-box",
                "wsi": "fa-solid fa-microscope fa-button",
                "stl": "fa-solid fa-cubes",
                "weasis": "bi bi-eye"
            },
            // Defines the order in which the viewer icons should appear in the interface
            // OHIF viewers modes that are not listed here, won't appear in the interface.
            "ViewersOrdering" : [
                // "osimis-web-viewer",  // now deprecated
                "stone-webviewer",
                "ohif",
                "ohif-vr",
                "ohif-tmtv",
                "ohif-seg",
                // "ohif-micro", // currently disabled, this is still experimental in OHIF
                "meddream",
                "volview",
                "wsi",
                "stl", // only at instance level
                "weasis"
            ],

            "MaxStudiesDisplayed": 100,                 // The maximum number of studies displayed in the study list.
                                                        // From v 1.7.0, this option is not used anymore in the local study list when using 
                                                        // a DB backend that supports ExtendedFind (SQLite and PostgreSQL)
                                                        // but is still used in the DicomWeb queries.
            "PageLoadSize": 50,                         // The number of items that are loaded when scrolling the study or instance list.
                                                        // Only applicable with a DB backend that supports ExtendedFind.
            
                                                        "MaxMyJobsHistorySize": 5,                  // The maximum number of jobs appearing under 'my jobs' in side bar (0 = unlimited)

            "StudyListSearchMode": "search-as-you-type",// mode to trigger a search in the StudyList.  Accepted values: 'search-as-you-type' or 'search-button'
            "StudyListSearchAsYouTypeMinChars": 3,      // minimum number of characters to enter in a text search field before it starts searching the DB
            "StudyListSearchAsYouTypeDelay": 400,       // Delay [ms] between the last key stroke and the trigger of the search
            "StudyListContentIfNoSearch": "default-ordering",   // Defines what to show if no search criteria has been entered.
                                                                // Allowed values: 
                                                                // - "default-ordering" (new in 1.8.2) applies the "DefaultOrdering"
                                                                // - "most-recents" (was the default value up to 1.8.1), equivalent to "DefaultOrdering"="Metadata,LastUpdate,DESC".
                                                                //                  It is kept for compatibility reasons.  Note that the "DefaultOrdering" config is ignored if you use "most-recents".
                                                                // - "empty"

            "DefaultOrdering": "Metadata,LastUpdate,DESC", // Defines the default ordering in the local study list.  Each order is made of 3 values separated by commas.
                                                           // Orders are separated by semicolons.  E.g:
                                                           // - DicomTag,StudyDate,DESC;Metadata,LastUpdate,DESC
                                                           // - DicomTag,StudyDate,DESC;DicomTag,PatientName,ASC

            "AutoAddWildcardsToSearchFields": true,     // Automatically adds wildcards to textual search fields in the local and remote study tables.
                                                        // When this is set to true (default), searching for 123 in the UI actually searches
                                                        // for *123* in DICOM and Rest API.  Searching for "123" in the UI actually removes the
                                                        // wildcard and performs an exact-match.
                                                        // When this is set to false, the value used in the DICOM and Rest API filters exactly matches
                                                        // the input in the UI.  Adding double-quotes is meaningless in this configuration and will
                                                        // very likely lead to no results.
                                                        // New in v 1.7.2

            // Default settings are ok for "small" Orthanc Databases.  For large databases, it is recommended to use these settings:
            // "StudyListSearchMode": "search-button"
            // "StudyListContentIfNoSearch": "empty"

            "ShowOrthancName": true,                    // display the Orthanc Name in the side menu
            
            // The list of tags to be displayed in the upload dialog result list
            // (the first N defined tags in the list are displayed on the UI)
            // Allowed values are: "StudyDate", "AccessionNumber", "PatientID",
            // "PatientName", "PatientBirthDate", "StudyDescription"
            "UploadReportTags" : [                      
                "PatientName", 
                "StudyDescription",
                "PatientID",
                "AccessionNumber", 
                "StudyDate" 
            ],
            "UploadReportMaxTags" : 2,                  // See above, the max number of tags displayed in the upload report

            // The ordered list of columns to display in the study list.
            // Allowed values are:
            //  - Dicom Tags: "StudyDate", "AccessionNumber", "PatientID"
            //                "PatientName", "PatientBirthDate", "StudyDescription" 
            //                or any other Study level MainDicomTags (or ExtraMainDicomTags)
            //  - special columns:
            //    - "modalities": the list of modalities in the study
            //    - "seriesCount": the number of series in the study
            //    - "instancesCount": the number of instances in the study
            //    - "seriesAndInstancesCount": a combined value with the number of series/instances in the study
            "StudyListColumns" : [
                "PatientBirthDate",
                "PatientName",
                "PatientID",
                "StudyDescription",
                "StudyDate",
                "modalities",
                "AccessionNumber",
                "seriesAndInstancesCount"
            ],

            // The list of patient level tags that are displayed in the study details and in the modification dialog.
            // Note that these tags must be defined in the Orthanc main dicom tags (https://orthanc.uclouvain.be/book/faq/main-dicom-tags.html)
            "PatientMainTags" : [
                "PatientID",
                "PatientName",
                "PatientBirthDate",
                "PatientSex",
                "OtherPatientIDs"
            ],

            // The list of study level tags that are displayed in the study details and in the modification dialog.
            // Note that these tags must be defined in the Orthanc main dicom tags (https://orthanc.uclouvain.be/book/faq/main-dicom-tags.html)
            "StudyMainTags" : [
                "StudyDate",
                "StudyTime",
                "StudyDescription",
                "AccessionNumber",
                "StudyID",
                "StudyInstanceUID",
                "RequestingPhysician",
                "ReferringPhysicianName",
                "InstitutionName"
            ],

            // The list of series level tags that are displayed in the study details and in the modification dialog.
            // Note that these tags must be defined in the Orthanc main dicom tags (https://orthanc.uclouvain.be/book/faq/main-dicom-tags.html)
            "SeriesMainTags" : [
                "SeriesDate",
                "SeriesTime",
                "SeriesDescription",
                "SeriesNumber",
                "BodyPartExamined",
                "ProtocolName",
                "SeriesInstanceUID"
            ],

            // The modalities to display in the Modalities filter dropdown in the Study List
            "ModalitiesFilter": [
                "CR", "CT", "DOC", "DR", "DX", "KO", "MG", "MR", "NM", "OT", "PR", "PT", "PX", "RTDOSE", "RTSTRUCT", "RTPLAN", "SEG", "SR", "US", "XA", "XC"
            ],

            // The ordered list of columns to display in the worklists table.
            // Allowed values are:
            //  - Dicom Tags: "AccessionNumber", "PatientID"
            //                "PatientName", "PatientBirthDate", "PatientSex"
            //                or any other top level Tag from the Worklist
            //  - special columns:
            //    - "modalities": the list of modalities in the study
            //    - "startDate": the first value of ScheduledProcedureStepStartDate
            //    - "modalities": the concatenation of the Modality tags found in all ScheduledProcedureStepSequence
            "WorklistsColumns" : [
                "PatientBirthDate",
                "PatientName",
                "PatientID",
                "startDate",
				"startTime",
                "description",
                "modalities",
                "AccessionNumber"
            ],

            // The initial list of tags that are displayed in the dialog to create a worklist.
            // For each tag, you may define:
            // - a "DefaultValue" field with a few keywords:
            //      - $TODAY$  (YYMMDD)
            //      - $GENERATE_DICOM_UUID$
            //      - $NOW$  (YYMMDDhhmmss)
            //      - $NOW-M$  (YYMMDDhhmmss.ms)
            // - if it is "Required" to be filled or not (default = false)
            // - if it is "Editable" (default = true)
            // - if you want to offer "Choices" to select amongst
            // - a "Placeholder" to display a suggestion text
            "NewWorklistDefaultTags" : {
                "AccessionNumber": {
                    "Required": true,
                    "DefaultValue": "$NOW$"
                },
                "PatientID": {
                    "Required": true
                },
                "PatientBirthDate": {
                },
                "PatientName": {
                    "Required": true
                },
                // other valid configurations for "PatientName" to split the encoding
                // of the first name and last name in 2 separate fields:
                // "PatientName": {
                //     "Required": true,
                //     "PatientNameType": "Computed",
                //     "ComputedFrom": ["lastName", "firstName"] // allowed values: lastName, firstName, owner, animalName
                // },
                // "PatientName": {
                //     "Required": true,
                //     "PatientNameType": "Computed",
                //     "ComputedFrom": ["owner", "animalName"] // allowed values: lastName, firstName, owner, animalName
                // },
                "PatientSex": {
                    "Choices": ["F", "M", "U", "O"]
                },
                "StudyInstanceUID": {
                    "DefaultValue": "$GENERATE_DICOM_UUID$",
                    "Editable": false
                },
                "InstitutionName": {
                    // "DefaultValue": "My institution",
                    // "Editable": false
                },
                "ScheduledProcedureStepSequence": {
                    "DefaultValue": [
                        {
                            "ScheduledProcedureStepStartDate": {
                                "DefaultValue": "$TODAY$",
                                "Required": true
                            },
							"ScheduledProcedureStepStartTime": {
                                "DefaultValue": "123300",
                                "Required": true
                            },
                            "Modality": {
                                "Choices": ["CR", "CT", "DR", "DX", "MG", "MR", "OT", "PX", "US", "XA", "XC"]
                            },
                            "ScheduledProcedureStepDescription": {
                            }
                        }
                    ]
                }
            },

            // Defines the list of languages available in the language picker
            // ex: "AvailableLanguages" : ["en", "fr"],
            // ex: "AvailableLanguages" : []  -> this won't show the language picker at all and force usage of the DefaultLanguage
            "AvailableLanguages": ["en", "ar", "de", "es", "fr", "it", "ja", "ka", "ro", "ru", "si", "uk", "vi", "zh", "pt"],
            
            // Force the default language.  If null (default), the language is the language from the visitor's browser.
            // ex: "DefaultLanguage" : "en"
            "DefaultLanguage" : null,

            // Should DicomTags be translated (true) or shall we use the English symbolic name whatever the selected language (false)
            // if true: "PatientID" is displayed as e.g "ID Patient" in french
            // if false: "PatientID" is displayed as "PatientID" in all languages
            "TranslateDicomTags" : true,

            // Display format for dates in the study list based on these definitions: https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
            // example: "dd/MM/yyyy" for European Format,
            //          "yyyyMMdd" for DICOM format
            "DateFormat": "yyyyMMdd",

            // PatientName transformation for display.  This requires a Regex for capturing and one expression for formatting.
            // If PatientNameFormatting is not defined, no transformation occurs (this is the default behaviour).
            // The Regex is a Javascript regex and is applied this way:
            // FormattedName = PatientName.replace(new RegExp(PatientNameCapture), PatientNameFormatting);
            // in example, to capture carets separated names and re-order them, one would use:
            // FormattedName = PatientName.replace(new RegExp("([^\\^]+)\\^?([^\\^]+)?\\^?([^\\^]+)?\\^?([^\\^]+)?\\^?([^\\^]+)?"), '$1 $3 $2');
            "PatientNameCapture" : "([^\\^]+)\\^?([^\\^]+)?\\^?([^\\^]+)?\\^?([^\\^]+)?\\^?([^\\^]+)?",
            // "PatientNameFormatting": "$1 $3 $2"

            // modifications dialog options
            "Modifications": {
                // Modes define options to the /modify route:
                // "modify-keep-uids" is equivalent to KeepSource=True and Keep=["StudyInstanceUID", "SeriesInstanceUID", "SOPInstanceUID"]
                // "modify-new-uids" is equivalent to KeepSource=False
                // "duplicate" is equivalent to KeepSource=True
                // "AllowedModes" and "DefaultMode" apply to studies modification
                "AllowedModes": ["modify-new-uids", "modify-keep-uids", "duplicate"],
                "DefaultMode": "modify-new-uids",

                // same configurations for Series (introduced in 1.2.0)
                "SeriesAllowedModes": ["modify-new-uids", "modify-keep-uids", "duplicate"],
                "SeriesDefaultMode": "modify-new-uids"

            },

            // List of tags that are used to identify studies belonging to the same patient.
            // This appears as "This patient has {count} studies in total" in the study details.
            // ex: "ShowSamePatientStudiesFilter" : ["PatientID", "PatientBirthDate", "PatientSex"]
            "ShowSamePatientStudiesFilter" : [
                "PatientID"
            ],

            // Defines the names of archives downloaded at study and series level.
            // DicomTag values are replaced in the template string. "{UUID}.zip" is equivalent to the archive name.
            "DownloadStudyFileNameTemplate": "{PatientID}-{PatientName}-{StudyDate}-{StudyDescription}.zip",
            "DownloadSeriesFileNameTemplate": "{PatientID}-{PatientName}-{SeriesDate}-{SeriesDescription}.zip",
            "DownloadInstanceFileNameTemplate": "{PatientID}-{PatientName}-{StudyDate}-{SeriesDescription}-{InstanceNumber}.dcm",

            // Defines a set of custom buttons for each level of resources in the local study list
            "CustomButtons": {
                "study": [],
                "instance": [],
                "series": [],
                "bulk-studies": []
                // For each button, you must provide the following items.
                // Example for a GET button:
                // {
                //   "HttpMethod": "GET",                                   // The HTTP method that will be triggered
                //   "Id": "custom-series-get",                             // A unique HTML identifier for the button 
                //   "Tooltip": "Apply custom action to series",            // The tooltip displayed when hovering the button
                //   "Target": "_blank",                                    // The HTML target for the link
                //   "Icon": "bi bi-alarm",                                 // The CSS class that defines the button icon (only from bootstrap icons)
                //   "Url": "http://localhost:3001/my-url?series={UUID}&patient={PatientID}"    // The template url.
                //                                                                              // For "study", "instance" & "series" level:
                //                                                                              //   {DicomTag} values are replaced in the template string. 
                //                                                                              //   {UUID} is the orthanc ID of the resource.
                //                                                                              //   {study-resource-token/download-instant-link} is replaced by a token that is valid to download the study (if tokens authentication is enabled)
                //                                                                              //   {study-resource-token/viewer-instant-link}, {study-resource-token/meddream-instant-link}
                //                                                                              // For "bulkd-study" level:
                //                                                                              //   {CommaSeparatedUUIDs} is a comma separated list of the orthanc IDs of the selected studies "abc...,bcd..."
                //                                                                              //   {CommaSeparatedDicomIds} is a comma separated list of the StudyInstanceUIDs of the selected studies "1.2.3,2.3.4"
                //                                                                              //   {studies-resource-token/download-instant-link} is replaced by a token that is valid to download the selected studies (if tokens authentication is enabled)
                //                                                                              //   {studies-resource-token/viewer-instant-link}, {studies-resource-token/meddream-instant-link}
                // },
                // Example for a POST button:
                // {
                //     "HttpMethod": "POST",
                //     "Id": "my-custom-post",
                //     "Tooltip": "Perform a custom 'post' operation",
                //     "Icon": "bi-broadcast",
                //     "Url": "../../my-python-plugin/{UUID}/process",
                //     "Payload": {                                         // The payload template to include in the POST request
                //                                                          // For "study", "instance" & "series" level:
                //         "id": "{UUID}",                                  //   {UUID} is the orthanc ID of the resource.
                //         "patient-name": "{PatientName}",                 //   {DicomTag} values are replaced in the template string. 
                //                                                          // For "bulk-studies" level:
                //         "orthanc-ids": "{JsonArrayUUIDs}",               //   this will be replaced by a json array with the Orthanc IDS of the selected studies ("orthanc-ids": ["abc...", "bcd..."])
                //         "dicom-ids": "{JsonArrayDicomIds}",              //   this will be replaced by a json array with the StudyInstanceUIDs of the selected studies ("dicom-ids": ["1.2.3", "2.3.4"])
                //     },
                //     "Refresh": true,                                     // Refresh the resource in the UI after having received the answer from the POST request
                //     "StartMessage": "my action has started"              // A custom message to display in an ephemeral notification (aka Toast message)
                // },
                // Example for a PUT button:
                // {
                //     "HttpMethod": "PUT",
                //     "Id": "add-label-1",
                //     "Tooltip": "Add the 'label-1' label",
                //     "Icon": "bi bi-1-circle",
                //     "Url": "../../studies/{UUID}/labels/label-1",
                //     "Payload": null,                                     
                //     "Refresh": false
                // },
            }
        },


        // When using Keycloak for user management
        "Keycloak" : {
            "Enable": false,
            "Url": "http://change-me:8080/",
            "Realm": "change-me",
            "ClientId": "change-me"
        },

        
        // This section is only relevant if the authorization plugin is enabled and user-profile based permissions are implemented.
        "Tokens" : {
            "InstantLinksValidity": 200,                // the duration, in seconds an 'instant' token is valid (e.g. used to download a study, open a study in a viewer)
            "ShareType": "stone-viewer-publication"     // allowed values: "stone-viewer-publication", "osimis-viewer-publication", "meddream-viewer-publication", "volview-viewer-publication"
            //"RequiredForLinks": false                 // Set it to false when using basic-auth together with the auth-plugin (https://discourse.orthanc-server.org/t/user-based-access-control-with-label-based-resource-access/5454)

            // When opening a share link, the user actually lands on the token "landing" page.  By default, it will be redirected to the viewer directly.
            // However, if you set "LandingOptions", you may display a landing page with e.g: a download button and a link to open the viewer.
            // Optionally, you can also add a custom button to open custom link.
            // "LandingOptions" : [
            //     {
            //         "Type" : "open-viewer-button"                            // Valid values are "open-viewer-button", "download-study" and "custom"
            //     },
            //     {
            //         "Type" : "download-study"
            //     },
            //     {
            //         "Type": "custom",
            //         "Id": "custom-download-as-jpeg",                         // A unique HTML identifier for the button 
            //         "Icon": "bi bi-filetype-jpg",                            // The CSS class that defines the button icon (only from bootstrap icons)
            //         "Title": "Download study as jpeg",                       // The Title to display on the button
            //         "Url": "../../studies/{UUID}/download-as-jpeg?token={token}", // The Url to open when the button is clicked.  Note: the url is relative to /ui/app/token-landing.html
            //         "EnableForMultipleResources": false                      // Should this button be enabled when the token relates to multiple studies ? (default: false)
            //     }
            // ]
        },

        // Very specific advanced options
        "AdvancedOptions" : {
            // if Keycloak is enabled, 'download-instant-link's are supposed to use tokens in the url in <a> links.
            // When "Tokens.RequiredForLinks" is set to false, they are replaced with standard <a> links without tokens and without HTTP headers (since this is not possible to
            // include auth headers in an <a> link).
            // So, if you need the 'download-instant-link's to use auth headers, you can set this option to true.
            // OE2 will then display a "Save As" dialog (for security reasons, the browser can not initiate writing to local disk without a user interaction)
            // and the HTTP response will stream to disk.  Note that this might not work on all browsers.
            "DownloadInstantLinksUseRestApiWithAuthHeaders": false,

            // if Keycloak is disabled and if tokens are being passed in the OE2 query arguments (?token=tutu),
            // this configuration tells OE2 which query arguments to re-used when opening a viewer or when
            // downloading a resource (aka 'viewer-instant-link' and 'download-instant-link')
            //"InstantLinksReuseTokenFromUri": "token",
            
            // By default, on ReadOnly systems, many UI components are disabled (like upload, delete, modify, ...).
            // However, on very specific cases, some users might want to have the full UI available although the
            // system is ReadOnly; this can be achived by setting AdaptUiOnReadOnlySystems to false.
            "AdaptUiOnReadOnlySystems": true
        },

        // Configure the /ui/app/inbox.html page where users can fill a form and drop files that are then processed by a custom plugin (that you need to provide).
        // Check this repo for a real life sample: https://github.com/orthanc-team/orthanc-auth-service/tree/main/minimal-setup/keycloak-inbox
        "Inbox": {
            "Enable": false,
            
            // If Keycloack is enabled, this configuration allows unauthenticated users to access the inbox page.
            "EnableAnonymousAccess": false,
            
            // Title to display on the inbox page
            "Title": "Welcome on the Orthanc inbox",
            
            // Various texts to display on the inbox page
            "IntroTextHtml": "<p>Welcome to this inbox.</p><p>First fill the form and once all fields are valid, upload your DICOM files.</p><p>Wait for the processing to complete.</p>",
            "SuccessTextHtml": "<p>All files have been processed successfully.</p><p></p>",
            "FailureTextHtml": "<p>A problem occurred while processing the DICOM Files.</p><p>Please try again or contact the administrator</p>",
            
            // The route that is called after all files have been uploaded.  You must implement it in a plugin.  Check the sample repo for a real life example.
            // "CommitUrl": "../../plugins/inbox/commit",
            
            // The route that is called to validate the form.  You must implement it in a plugin.  Check the sample repo for a real life example.
            // "FormValidationUrl": "../../plugins/inbox/validate-form",
            
            // The route that is called to display the process progress.  You must implement it in a plugin.  Check the sample repo for a real life example.
            // "ProcessingMonitoringUrl": "../../plugins/inbox/monitor-processing",
            
            // Define the form fields that the user must fill before uploading the files
            // "FormFields": [
            //{
            //     "Type" : "Text",  // A standard text field
            //     "Title": "Subject ID",
            //     "Id": "SubjectId",
            //     "Placeholder": "ex: SUB-253"
            // }, {
            //     "Type" : "Choice", // A drop-down box
            //     "Title": "Visit ID",
            //     "Id": "VisitId",
            //     "Choices": ["T0", "T0 + 6 months", "T0 + 12 months", "T0 + 18 months", "T0 + 24 months"],
            //     "Placeholder": "Select a visit"
            // }, {
            //     "Type" : "UserGroupsChoice", // A drop-down allowing to select one of the groups from the user profile
            //     "Title": "Site ID",
            //     "Id": "SiteId",
            //     "GroupsRegex": "\/site-groups-(.*)",  // e.g: if group is "/site-groups-hospital-a", "hospital-a" is captured and displayed
            //     "Placeholder": "Select your site"
            // }, {
            //     "Type" : "MultilineText", // A multiline form
            //     "Title": "Comments",
            //     "Id": "Comments",
            //     "Placeholder": "Any comments ?"
            // }, {
            //     "Type" : "File",  // An upload button to select a file
            //     "Title": "PDF form",
            //     "Id": "PdfForm"
            // }
        // ]
        }

        // // Email server configuration (when using UiOptions.EnableSharesByEmail)
        // "Emails": {
        //     "Server": {
        //         "Url": "http://localhost:8000/emails/"  // The root url of a web-service that must implement a Rest API (as defined in this sample project: https://github.com/orthanc-team/orthanc-auth-service/blob/main/sources/orthanc_auth_service/app.py):
        //                                                 // {Emails.ServerRootUrl}/templates/{...} to retrieve HTML templates that can then be edited in a text editor
        //                                                 // {Emails.ServerRootUrl}/send to send an email
        //         //   "Username" : "alice",
        //         //   "Password" : "alicePassword",
        //         //   "HttpHeaders" : { "Token" : "Hello world" },
        //         //   "CertificateFile" : "client.crt",
        //         //   "CertificateKeyFile" : "client.key",
        //         //   "CertificateKeyPassword" : "certpass",
        //         //   "Pkcs11" : false,
        //         //   "Timeout" : 42
        //     }
        // }
    }
}