Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP-1311 | Create 'oh_settings' table and methods in CORE #1431

Open
wants to merge 22 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
edfafb3
new:move settings to database, write methods to manage them and write…
SilverD3 Oct 8, 2024
3145d2b
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Oct 8, 2024
be6645b
fix:clean code
SilverD3 Oct 8, 2024
d6fc218
fix:include sql script to create-all script
SilverD3 Oct 8, 2024
d12d15b
fix:remove deleted column
SilverD3 Oct 8, 2024
7e6e2a1
chore:remove deleted and editable. Add category and needRestart
SilverD3 Oct 10, 2024
6a483aa
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Oct 10, 2024
3361029
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Oct 11, 2024
6fc9dcd
chore:update setting categories
SilverD3 Oct 11, 2024
3e59da4
fix:fix setting tests
SilverD3 Oct 11, 2024
a809448
chore:update load demo data and change enum order
SilverD3 Oct 11, 2024
cab0563
fix:fix tests
SilverD3 Oct 11, 2024
5d96f09
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Oct 14, 2024
c5ce9f7
chore:add exception in method signature
SilverD3 Oct 14, 2024
e99938f
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Oct 16, 2024
8b83889
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Oct 23, 2024
1ed967d
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Oct 25, 2024
170e57a
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Oct 29, 2024
8c787a8
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Nov 8, 2024
c1de136
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Nov 18, 2024
f33e6c6
Merge branch 'develop' of https://github.com/informatici/openhospital…
SilverD3 Nov 19, 2024
c2559a9
align:rename migration script
SilverD3 Nov 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sql/step_04_all_following_steps.sql
SilverD3 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,4 @@ source step_a107_add_permission_admin_access.sql;
source step_a108_audit_dicom_type_and_dicom_data.sql;
source step_a109_update_user_settings_table_constraints_and_add_usergroups_permissions.sql;
source step_a110_update_operations_table_change_ope_for_to_enum.sql;
source step_a111_settings.sql;
88 changes: 88 additions & 0 deletions sql/step_a111_settings.sql
SilverD3 marked this conversation as resolved.
Show resolved Hide resolved
SilverD3 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
-- Drop the existing table
DROP TABLE IF EXISTS OH_SETTINGS;

-- Create settings table structure
CREATE TABLE OH_SETTINGS (
SETT_ID INT(11) NOT NULL AUTO_INCREMENT COMMENT 'Default generated ID',
SETT_CODE VARCHAR(50) NOT NULL,
SETT_CATEGORY ENUM('general', 'telemetry', 'security', 'dicom', 'accounting', 'reports', 'pharmacy', 'gui', 'experimental', 'application') NOT NULL DEFAULT 'general',
SilverD3 marked this conversation as resolved.
Show resolved Hide resolved
SETT_VALUE_TYPE ENUM('bool', 'number', 'text', 'select') NOT NULL DEFAULT 'text',
SETT_VALUE_OPTIONS VARCHAR(500) NULL DEFAULT NULL COMMENT "Comma-separated list of possible values, in case of type 'select'",
SETT_DEFAULT_VALUE VARCHAR(255) NOT NULL,
SETT_VALUE VARCHAR(255) NOT NULL,
SETT_DESCRIPTION VARCHAR(500) NULL,
SETT_CREATED_BY VARCHAR(50) NULL DEFAULT NULL,
SETT_CREATED_DATE DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP(),
SETT_LAST_MODIFIED_BY VARCHAR(50) NULL DEFAULT NULL,
SETT_LAST_MODIFIED_DATE DATETIME NULL DEFAULT NULL,
SETT_ACTIVE TINYINT(1) NOT NULL DEFAULT 1,
SETT_NEED_RESTART TINYINT(1) NOT NULL DEFAULT 1,
PRIMARY KEY (SETT_ID),
CONSTRAINT setting_unique_code UNIQUE (SETT_CODE)
) ENGINE=InnoDB;

-- Create permissions for settings
INSERT INTO `oh_permissions` (`P_ID_A`, `P_NAME`, `P_DESCRIPTION`, `P_ACTIVE`, `P_CREATED_BY`, `P_CREATED_DATE`, `P_LAST_MODIFIED_BY`, `P_LAST_MODIFIED_DATE`) VALUES (172,'settings.read','','1',NULL,NULL,NULL,NULL);
INSERT INTO `oh_permissions` (`P_ID_A`, `P_NAME`, `P_DESCRIPTION`, `P_ACTIVE`, `P_CREATED_BY`, `P_CREATED_DATE`, `P_LAST_MODIFIED_BY`, `P_LAST_MODIFIED_DATE`) VALUES (173,'settings.update','','1',NULL,NULL,NULL,NULL);

-- Assign setting permissions to admin group
INSERT INTO `oh_grouppermission` (`GP_ID`, `GP_UG_ID_A`, `GP_P_ID_A`, `GP_ACTIVE`, `GP_CREATED_BY`, `GP_CREATED_DATE`, `GP_LAST_MODIFIED_BY`, `GP_LAST_MODIFIED_DATE`) VALUES (317,'admin',172,'1',NULL,NULL,NULL,NULL);
INSERT INTO `oh_grouppermission` (`GP_ID`, `GP_UG_ID_A`, `GP_P_ID_A`, `GP_ACTIVE`, `GP_CREATED_BY`, `GP_CREATED_DATE`, `GP_LAST_MODIFIED_BY`, `GP_LAST_MODIFIED_DATE`) VALUES (318,'admin',173,'1',NULL,NULL,NULL,NULL);

-- Load settings into the database
INSERT INTO `OH_SETTINGS` (`SETT_ID`, `SETT_CODE`, `SETT_VALUE_TYPE`, `SETT_VALUE_OPTIONS`, `SETT_DEFAULT_VALUE`, `SETT_VALUE`, `SETT_DESCRIPTION`, `SETT_CREATED_BY`, `SETT_LAST_MODIFIED_BY`, `SETT_CREATED_DATE`, `SETT_LAST_MODIFIED_DATE`, `SETT_ACTIVE`, `SETT_NEED_RESTART`, `SETT_CATEGORY`) VALUES
(NULL, 'SINGLEUSER', 'bool', NULL, 'FALSE', 'FALSE', 'Make the software to work with only one user', 'admin', NULL, NOW(), NULL, 1, 1, 'general'),
(NULL, 'LANGUAGE', 'select', 'am_ET,ar,ar_SA,de,en,es,fr,it,pt,sq,sw,zh_CN', 'en', 'en', 'Display language', 'admin', NULL, NOW(), NULL, 1, 1, 'general'),
(NULL, 'DOC_DIR', 'text', NULL, '../doc', '../doc', 'Directory path in which user guides are stored', 'admin', NULL, NOW(), NULL, 1, 1, 'general'),
(NULL, 'INTERNALVIEWER', 'bool', NULL, 'TRUE', 'TRUE', 'Use the internal viewer', 'admin', NULL, NOW(), NULL, 1, 1, 'general'),
(NULL, 'VIEWER', 'text', NULL, '', '', 'Path to custom PDF viewer', 'admin', NULL, NOW(), NULL, 1, 1, 'general'),
(NULL, 'XMPPMODULEENABLED', 'bool', NULL, 'FALSE', 'FALSE', 'Whether to enable XMPP module or not', 'admin', NULL, NOW(), NULL, 1, 1, 'general'),
(NULL, 'PATIENTPHOTOSTORAGE', 'text', NULL, '', '', 'Path to the directory where patient photos are stored', 'admin', NULL, NOW(), NULL, 1, 1, 'general'),
(NULL, 'DEBUG', 'bool', NULL, 'FALSE', 'FALSE', 'Use debug mode', 'admin', NULL, NOW(), NULL, 1, 1, 'general'),
(NULL, 'MAINMENUALWAYSONTOP', 'bool', NULL, 'FALSE', 'FALSE', 'Always display main menu window on top', 'admin', NULL, NOW(), NULL, 1, 1, 'gui'),
(NULL, 'PATIENTEXTENDED', 'bool', NULL, 'FALSE', 'FALSE', 'Enable extended patient form', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'OPDEXTENDED', 'bool', NULL, 'FALSE', 'FALSE', 'Enable extended OPD form', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'LABEXTENDED', 'bool', NULL, 'FALSE', 'FALSE', 'Enable extended laboratory', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'PATIENTVACCINEEXTENDED', 'bool', NULL, 'FALSE', 'FALSE', 'Use extended patient vaccine', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'MERGEFUNCTION', 'bool', NULL, 'TRUE', 'TRUE', 'Enable patient merge feature', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'SMSENABLED', 'bool', NULL, 'FALSE', 'FALSE', 'Enable SMS sending', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'VIDEOMODULEENABLED', 'bool', NULL, 'FALSE', 'FALSE', 'Whether to enable Video module or not', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'ENHANCEDSEARCH', 'bool', NULL, 'FALSE', 'FALSE', 'Enable enhanced search', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'LABMULTIPLEINSERT', 'bool', NULL, 'FALSE', 'FALSE', 'Use multiple insert for lab exams', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'MATERNITYRESTARTINJUNE', 'bool', NULL, 'FALSE', 'FALSE', 'Restart maternity in June', 'admin', NULL, NOW(), NULL, 1, 1, 'application'),
(NULL, 'APISERVER', 'bool', NULL, 'FALSE', 'FALSE', 'Whether API server is enabled or not', 'admin', NULL, NOW(), NULL, 1, 1, 'experimental'),
SilverD3 marked this conversation as resolved.
Show resolved Hide resolved
(NULL, 'TELEMETRYENABLED', 'bool', NULL, 'FALSE', 'FALSE', 'Enable telemetry', 'admin', NULL, NOW(), NULL, 1, 1, 'telemetry'),
(NULL, 'USERSLISTLOGIN', 'bool', NULL, 'FALSE', 'FALSE', 'Whether to show the list', 'admin', NULL, NOW(), NULL, 1, 1, 'security'),
(NULL, 'SESSIONTIMEOUT', 'number', NULL, '5', '5', 'Number in minute for session timeout', 'admin', NULL, NOW(), NULL, 1, 1, 'security'),
(NULL, 'STRONGLENGTH', 'number', NULL, '6', '6', 'The strength level of passwords', 'admin', NULL, NOW(), NULL, 1, 1, 'security'),
(NULL, 'PASSWORDTRIES', 'number', NULL, '5', '5', 'Number of password attempts before locking the account', 'admin', NULL, NOW(), NULL, 1, 1, 'security'),
(NULL, 'PASSWORDLOCKTIME', 'number', NULL, '60', '60', 'Number in minutes for password lock time', 'admin', NULL, NOW(), NULL, 1, 1, 'security'),
(NULL, 'PASSWORDIDLE', 'number', NULL, '360', '360', 'Number in days of password validity', 'admin', NULL, NOW(), NULL, 1, 1, 'security'),
(NULL, 'STRONGPASSWORD', 'bool', NULL, 'TRUE', 'FALSE', 'Whether to required strong passwords or not', 'admin', NULL, NOW(), NULL, 1, 1, 'security'),
(NULL, 'AUTOMATICLOT_IN', 'bool', NULL, 'TRUE', 'TRUE', 'Automatically create and assign lot to new stock entry mouvements', 'admin', NULL, NOW(), NULL, 1, 1, 'pharmacy'),
(NULL, 'AUTOMATICLOT_OUT', 'bool', NULL, 'TRUE', 'TRUE', 'Automatically create and assign lot to new stock out mouvements', 'admin', NULL, NOW(), NULL, 1, 1, 'pharmacy'),
(NULL, 'AUTOMATICLOTWARD_TOWARD', 'bool', NULL, 'TRUE', 'TRUE', 'Automatically create and assign lot to ward to ward stock mouvements', 'admin', NULL, NOW(), NULL, 1, 1, 'pharmacy'),
(NULL, 'INTERNALPHARMACIES', 'bool', NULL, 'FALSE', 'FALSE', 'Allow internal pharmacies', 'admin', NULL, NOW(), NULL, 1, 1, 'pharmacy'),
(NULL, 'LOTWITHCOST', 'bool', NULL, 'TRUE', 'TRUE', 'Use lot with cost', 'admin', NULL, NOW(), NULL, 1, 1, 'pharmacy'),
(NULL, 'RECEIPTPRINTER', 'bool', NULL, 'FALSE', 'FALSE', 'Enable bill receipt printing', 'admin', NULL, NOW(), NULL, 1, 1, 'accounting'),
(NULL, 'ALLOWPRINTOPENEDBILL', 'bool', NULL, 'FALSE', 'FALSE', 'Allow open bills printing', 'admin', NULL, NOW(), NULL, 1, 1, 'accounting'),
(NULL, 'ALLOWMULTIPLEOPENEDBILL', 'bool', NULL, 'FALSE', 'TRUE', 'Allow multiple open bills for a patient', 'admin', NULL, NOW(), NULL, 1, 1, 'accounting'),
(NULL, 'DICOMMODULEENABLED', 'bool', NULL, 'FALSE', 'FALSE', 'Whether to enable DICOM module or not', 'admin', NULL, NOW(), NULL, 1, 1, 'dicom'),
(NULL, 'DICOMTHUMBNAILS', 'bool', NULL, 'TRUE', 'TRUE', 'Enable DICOM thumbnails (previews)', 'admin', NULL, NOW(), NULL, 1, 1, 'dicom'),
SilverD3 marked this conversation as resolved.
Show resolved Hide resolved
(NULL, 'PATIENTSHEET', 'text', NULL, 'patient_clinical_sheet', 'patient_clinical_sheet', 'File name for patient sheet report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'VISITSHEET', 'text', NULL, 'WardVisits', 'WardVisits', 'File name for visit sheet report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'BILLSREPORTPENDING', 'text', NULL, 'BillsReportPending', 'BillsReportPending', 'File name for pending bills report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'BILLSREPORTMONTHLY', 'text', NULL, 'BillsReportMonthly', 'BillsReportMonthly', 'File name for monthly bills report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'PHARMACEUTICALORDER', 'text', NULL, 'PharmaceuticalOrder', 'PharmaceuticalOrder', 'File name for pharmaceuticals to order report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'PHARMACEUTICALSTOCK', 'text', NULL, 'PharmaceuticalStock_ver4', 'PharmaceuticalStock_ver4', 'File name for pharmaceutical stock report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'PHARMACEUTICALSTOCKLOT', 'text', NULL, 'PharmaceuticalStock_ver5', 'PharmaceuticalStock_ver5', 'File name for pharmaceutical lots stock report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'PHARMACEUTICALAMC', 'text', NULL, 'PharmaceuticalAMC', 'PharmaceuticalAMC', 'File name for pharmaceutical AMC report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'PATIENTBILLGROUPED', 'text', NULL, 'PatientBillGrouped', 'PatientBillGrouped', 'File name for patient bills grouped report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'PATIENTBILLSTATEMENT', 'text', NULL, 'PatientBillStatement', 'PatientBillStatement', 'File name for patient bills statement report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'EXAMINATIONCHART', 'text', NULL, 'patient_examination', 'patient_examination', 'File name for patient examination report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'OPDCHART', 'text', NULL, 'patient_opd_chart', 'patient_opd_chart', 'File name for OPD chart report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'ADMCHART', 'text', NULL, 'patient_adm_chart', 'patient_adm_chart', 'File name for admissions chart report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'DISCHART', 'text', NULL, 'patient_dis_chart', 'patient_dis_chart', 'File name for discharges chart report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'PATIENTBILL', 'text', NULL, 'PatientBill', 'PatientBill', 'File name for patient bill report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'BILLSREPORT', 'text', NULL, 'BillsReport', 'BillsReport', 'File name for bills report', 'admin', NULL, NOW(), NULL, 1, 1, 'reports'),
(NULL, 'PARAMSURL', 'text', NULL, '', '', NULL, 'admin', NULL, NOW(), NULL, 1, 1, 'general');
73 changes: 73 additions & 0 deletions src/main/java/org/isf/settings/manager/SettingManager.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Open Hospital (www.open-hospital.org)
* Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org)
*
* Open Hospital is a free and open source software for healthcare data management.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* https://www.gnu.org/licenses/gpl-3.0-standalone.html
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.isf.settings.manager;

import java.util.List;

import org.isf.settings.model.Setting;
import org.isf.settings.service.SettingIoOperations;
import org.isf.utils.exception.OHServiceException;
import org.springframework.stereotype.Component;

@Component
public class SettingManager {

private final SettingIoOperations operations;

public SettingManager(SettingIoOperations settingIoOperations) {
this.operations = settingIoOperations;
}

public List<Setting> findAll() throws OHServiceException {
return operations.findAll();
}

public Setting update(Setting setting) throws OHServiceException {
Setting existingSetting = operations.getByCode(setting.getCode());
existingSetting.setValue(setting.getValue());

return operations.save(setting);
}

public Setting getByCode(String code) {
SilverD3 marked this conversation as resolved.
Show resolved Hide resolved
return operations.getByCode(code);
}

public Setting getById(int id) {
SilverD3 marked this conversation as resolved.
Show resolved Hide resolved
return operations.getById(id);
}

public boolean resetAll() throws OHServiceException {
List<Setting> settings = operations.findAll();

for (var setting: settings) {
setting.setValue(setting.getDefaultValue());
}

try {
operations.saveAll(settings);
return true;
} catch (OHServiceException e) {
return false;
}
}
}
152 changes: 152 additions & 0 deletions src/main/java/org/isf/settings/model/Setting.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,152 @@
/*
* Open Hospital (www.open-hospital.org)
* Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org)
*
* Open Hospital is a free and open source software for healthcare data management.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* https://www.gnu.org/licenses/gpl-3.0-standalone.html
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
package org.isf.settings.model;

import jakarta.persistence.AttributeOverride;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.EnumType;
import jakarta.persistence.Enumerated;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;

import org.isf.utils.db.Auditable;

/**
* Setting Core Entity
*
* @author Silevester D.
* @since v1.15
*/
@Entity
@Table(name = "OH_SETTINGS")
@AttributeOverride(name = "createdBy", column = @Column(name = "SETT_CREATED_BY", updatable = false))
@AttributeOverride(name = "createdDate", column = @Column(name = "SETT_CREATED_DATE", updatable = false))
@AttributeOverride(name = "lastModifiedBy", column = @Column(name = "SETT_LAST_MODIFIED_BY"))
@AttributeOverride(name = "lastModifiedDate", column = @Column(name = "SETT_LAST_MODIFIED_DATE"))
@AttributeOverride(name = "active", column = @Column(name = "SETT_ACTIVE"))
public class Setting extends Auditable<String> {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "SETT_ID")
private int id;

@Column(name="SETT_CODE", length = 50, nullable = false)
private String code;

@Column(name = "SETT_CATEGORY", nullable = false)
@Enumerated(EnumType.STRING)
private SettingCategory category;

@Column(name = "SETT_VALUE_TYPE", nullable = false)
@Enumerated(EnumType.STRING)
private SettingValueType type;

@Column(name = "SETT_VALUE_OPTIONS", length = 500)
private String valueOptions;

@Column(name="SETT_DEFAULT_VALUE", nullable = false)
private String defaultValue;

@Column(name="SETT_VALUE", nullable = false)
private String value;

@Column(name="SETT_DESCRIPTION", length = 500)
private String description;

@Column(name="SETT_NEED_RESTART", nullable = false)
private Boolean needRestart = true;

public int getId() {
return id;
}

public void setId(int id) {
this.id = id;
}

public String getCode() {
return code;
}

public void setCode(String code) {
this.code = code;
}

public SettingValueType getType() {
return type;
}

public void setType(SettingValueType type) {
this.type = type;
}

public String getValueOptions() {
return valueOptions;
}

public void setValueOptions(String valueOptions) {
this.valueOptions = valueOptions;
}

public String getDefaultValue() {
return defaultValue;
}

public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

public Boolean getNeedRestart() {
return needRestart;
}

public void setNeedRestart(Boolean needRestart) {
this.needRestart = needRestart;
}

public SettingCategory getCategory() {
return category;
}

public void setCategory(SettingCategory category) {
this.category = category;
}
}
32 changes: 32 additions & 0 deletions src/main/java/org/isf/settings/model/SettingCategory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Open Hospital (www.open-hospital.org)
* Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org)
*
* Open Hospital is a free and open source software for healthcare data management.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* https://www.gnu.org/licenses/gpl-3.0-standalone.html
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package org.isf.settings.model;

/**
* Setting Value Type Enum
* @author Silevester D.
* @since v1.15
*/
public enum SettingCategory {
general, telemetry, security, dicom, accounting, reports, pharmacy, gui, experimental, application
}
32 changes: 32 additions & 0 deletions src/main/java/org/isf/settings/model/SettingValueType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Open Hospital (www.open-hospital.org)
* Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org)
*
* Open Hospital is a free and open source software for healthcare data management.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* https://www.gnu.org/licenses/gpl-3.0-standalone.html
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package org.isf.settings.model;

/**
* Setting Value Type Enum
* @author Silevester D.
* @since v1.15
*/
public enum SettingValueType {
bool, number, text, select
}
Loading