├── .editorconfig ├── rsc ├── xmpp.properties ├── version.properties ├── database.properties.dist ├── txtPrinter.properties ├── dicom.properties ├── telemetry.properties ├── examination.properties ├── sms.properties ├── settings.properties.dist └── log4j2-spring.properties.dist ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── .ide-settings └── eclipse │ └── OpenHospital.importorder ├── src ├── test │ ├── resources │ │ ├── database.properties │ │ └── application.properties │ └── java │ │ └── org │ │ └── isf │ │ ├── testing │ │ └── rest │ │ │ └── ControllerBaseTest.java │ │ ├── OpenHospitalApiApplicationTests.java │ │ ├── lab │ │ └── data │ │ │ └── LaboratoryRowHelper.java │ │ ├── pregtreattype │ │ └── data │ │ │ └── PregnantTreatmentTypeHelper.java │ │ └── accounting │ │ └── data │ │ ├── BillDTOHelper.java │ │ └── BillItemsDTOHelper.java └── main │ ├── resources │ ├── logback-spring.xml │ └── banner.txt │ └── java │ └── org │ └── isf │ ├── patient │ ├── dto │ │ └── PatientSTATUS.java │ └── mapper │ │ └── PatientMapper.java │ ├── security │ ├── jwt │ │ ├── TokenValidationResult.java │ │ ├── SecurityConstants.java │ │ └── AuthEntryPointJwt.java │ ├── ApiAuditorAwareImpl.java │ ├── RestAuthenticationEntryPoint.java │ ├── LogoutApi.java │ └── CustomAuthenticationManager.java │ ├── medical │ ├── dto │ │ └── MedicalSortBy.java │ └── mapper │ │ └── MedicalMapper.java │ ├── shared │ ├── Constants.java │ ├── Mapper.java │ ├── pagination │ │ ├── Page.java │ │ └── PageInfoDTO.java │ ├── exceptions │ │ └── OHAPIException.java │ └── mapper │ │ ├── converter │ │ ├── ByteArrayToBlobConverter.java │ │ ├── ModelMapperConfig.java │ │ └── BlobToByteArrayConverter.java │ │ ├── OHModelMapper.java │ │ └── mappings │ │ └── PatientMapping.java │ ├── permissions │ ├── dto │ │ ├── LitePermissionDTO.java │ │ └── PermissionDTO.java │ └── mapper │ │ ├── LitePermissionMapper.java │ │ └── PermissionMapper.java │ ├── usergroups │ ├── dto │ │ └── GroupPermissionsDTO.java │ └── mapper │ │ └── UserGroupMapper.java │ ├── sms │ └── mapper │ │ └── SmsMapper.java │ ├── ward │ └── mapper │ │ └── WardMapper.java │ ├── exam │ ├── mapper │ │ ├── ExamMapper.java │ │ └── ExamRowMapper.java │ └── dto │ │ ├── ExamWithRowsDTO.java │ │ └── ExamRowDTO.java │ ├── visits │ └── mapper │ │ └── VisitMapper.java │ ├── accounting │ ├── mapper │ │ ├── BillMapper.java │ │ ├── BillItemsMapper.java │ │ └── BillPaymentsMapper.java │ └── dto │ │ └── FullBillDTO.java │ ├── priceslist │ └── mapper │ │ ├── PriceMapper.java │ │ └── PriceListMapper.java │ ├── agetype │ ├── mapper │ │ └── AgeTypeMapper.java │ └── dto │ │ └── AgeTypeDTO.java │ ├── disease │ └── mapper │ │ └── DiseaseMapper.java │ ├── vaccine │ ├── mapper │ │ └── VaccineMapper.java │ └── dto │ │ └── VaccineDTO.java │ ├── medicalstock │ └── mapper │ │ ├── LotMapper.java │ │ └── MovementMapper.java │ ├── therapy │ └── mapper │ │ └── TherapyMapper.java │ ├── menu │ ├── mapper │ │ ├── GroupMenuMapper.java │ │ └── UserMenuItemMapper.java │ ├── rest │ │ ├── VersionService.java │ │ └── RootController.java │ └── dto │ │ └── GroupMenuDTO.java │ ├── supplier │ └── mapper │ │ └── SupplierMapper.java │ ├── exatype │ ├── mapper │ │ └── ExamTypeMapper.java │ └── dto │ │ └── ExamTypeDTO.java │ ├── operation │ └── mapper │ │ ├── OperationMapper.java │ │ └── OperationRowMapper.java │ ├── hospital │ └── mapper │ │ └── HospitalMapper.java │ ├── lab │ ├── mapper │ │ ├── LaboratoryMapper.java │ │ ├── LaboratoryRowMapper.java │ │ └── LaboratoryForPrintMapper.java │ └── dto │ │ ├── LabWithRowsDTO.java │ │ └── LaboratoryRowDTO.java │ ├── distype │ ├── mapper │ │ └── DiseaseTypeMapper.java │ └── dto │ │ └── DiseaseTypeDTO.java │ ├── patvac │ └── mapper │ │ └── PatVacMapper.java │ ├── vactype │ ├── mapper │ │ └── VaccineTypeMapper.java │ └── dto │ │ └── VaccineTypeDTO.java │ ├── medtype │ ├── mapper │ │ └── MedicalTypeMapper.java │ └── dto │ │ └── MedicalTypeDTO.java │ ├── dlvrtype │ ├── mapper │ │ └── DeliveryTypeMapper.java │ └── dto │ │ └── DeliveryTypeDTO.java │ ├── admtype │ ├── mapper │ │ └── AdmissionTypeMapper.java │ └── dto │ │ └── AdmissionTypeDTO.java │ ├── opetype │ ├── mapper │ │ └── OperationTypeMapper.java │ └── dto │ │ └── OperationTypeDTO.java │ ├── disctype │ ├── mapper │ │ └── DischargeTypeMapper.java │ └── dto │ │ └── DischargeTypeDTO.java │ ├── usersettings │ ├── mapper │ │ └── UserSettingMapper.java │ └── dto │ │ └── UserSettingDTO.java │ ├── pricesothers │ └── mapper │ │ └── PricesOthersMapper.java │ ├── login │ └── dto │ │ ├── TokenRefreshRequest.java │ │ ├── LoginRequest.java │ │ └── LoginResponse.java │ ├── malnutrition │ └── mapper │ │ └── MalnutritionMapper.java │ ├── admission │ ├── mapper │ │ ├── AdmittedPatientMapper.java │ │ └── AdmissionMapper.java │ └── dto │ │ └── AdmittedPatientDTO.java │ ├── medicalstockward │ ├── mapper │ │ ├── MedicalWardMapper.java │ │ ├── MovementWardMapper.java │ │ └── MedicalWardIdMapper.java │ └── dto │ │ ├── MedicalWardIdDTO.java │ │ └── MedicalWardDTO.java │ ├── medstockmovtype │ ├── mapper │ │ └── MovementTypeMapper.java │ └── dto │ │ └── MovementTypeDTO.java │ ├── dlvrrestype │ ├── mapper │ │ └── DeliveryResultTypeMapper.java │ └── dto │ │ └── DeliveryResultTypeDTO.java │ ├── examination │ └── mapper │ │ └── PatientExaminationMapper.java │ ├── pregtreattype │ ├── mapper │ │ └── PregnantTreatmentTypeMapper.java │ └── dto │ │ └── PregnantTreatmentTypeDTO.java │ ├── opd │ └── dto │ │ └── OpdWithOperationRowDTO.java │ ├── users │ ├── dto │ │ └── UserProfileDTO.java │ └── mapper │ │ └── UserMapper.java │ └── patconsensus │ ├── dto │ └── PatientConsensusDTO.java │ └── mapper │ └── PatientConsensusMapper.java ├── dotenv ├── .github └── dependabot.yml ├── .gitignore ├── Dockerfile.backend ├── .license-header └── license-header.txt ├── Makefile └── docker-compose.yml /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.java] 4 | indent_style = tab 5 | charset = utf-8 -------------------------------------------------------------------------------- /rsc/xmpp.properties: -------------------------------------------------------------------------------- 1 | # This file contains Xmpp Server information 2 | DOMAIN=127.0.0.1 3 | PORT=5222 -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/informatici/openhospital-api/HEAD/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /rsc/version.properties: -------------------------------------------------------------------------------- 1 | # This file is not meant to be modified by the user 2 | VER_MAJOR=1 3 | VER_MINOR=14 4 | VER_RELEASE=2 5 | -------------------------------------------------------------------------------- /.ide-settings/eclipse/OpenHospital.importorder: -------------------------------------------------------------------------------- 1 | #Organize Import Order 2 | #Wed Mar 13 13:21:30 EDT 2024 3 | 6= 4 | 5=com 5 | 4=org 6 | 3=jakarta 7 | 2=javax 8 | 1=java 9 | 0=\# 10 | -------------------------------------------------------------------------------- /rsc/database.properties.dist: -------------------------------------------------------------------------------- 1 | jdbc.url=jdbc:mariadb://localhost:3306/oh?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC 2 | jdbc.username=isf 3 | jdbc.password=isf123 -------------------------------------------------------------------------------- /src/test/resources/database.properties: -------------------------------------------------------------------------------- 1 | jdbc.class=org.h2.Driver 2 | jdbc.url=jdbc:h2:mem:myDb;DB_CLOSE_DELAY=-1 3 | 4 | hibernate.dialect=org.hibernate.dialect.H2Dialect 5 | hibernate.hbm2ddl.auto=create 6 | jdbc.username=root 7 | jdbc.password=root -------------------------------------------------------------------------------- /rsc/txtPrinter.properties: -------------------------------------------------------------------------------- 1 | # This file contains text printing information 2 | # MODE = TXT, PDF or ZPL 3 | USE_DEFAULT_PRINTER=yes 4 | PRINT_AS_PAID=no 5 | PRINT_WITHOUT_ASK=no 6 | MODE=PDF 7 | #TXT_CHAR_HEIGHT=10 8 | #TXT_CHAR_WIDTH=10 9 | ZPL_FONT_TYPE=0 10 | ZPL_ROW_HEIGHT=25 -------------------------------------------------------------------------------- /src/test/resources/application.properties: -------------------------------------------------------------------------------- 1 | api.protocol=http 2 | api.host=localhost 3 | ### 4 | spring.main.allow-bean-definition-overriding=true 5 | ### Security token secret (JWT) 6 | jwt.token.secret=+Z0E+6QXT9ri0L+PVkRTSF/tsZ/Z1yXJdrqz8FieiebiezOuIcuabJExyxCZi1bzSteaSmbCdzIaLDLPht92Bg== 7 | cors.allowed.origins=http://localhost -------------------------------------------------------------------------------- /src/main/resources/logback-spring.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /dotenv: -------------------------------------------------------------------------------- 1 | OH_MARIADB_PORT=3306 2 | OH_MARIADB_DATABASE=oh 3 | OH_MARIADB_ROOT_PASSWORD=root 4 | OH_MARIADB_USER=isf 5 | OH_MARIADB_PASSWORD=isf123 6 | OH_DB_LANG=en 7 | 8 | OH_CORE_BRANCH=develop 9 | OH_API_BRANCH=develop 10 | GITHUB_ORG=informatici 11 | API_PORT=8080 12 | API_HOST=localhost 13 | UI_PORT=3000 14 | UI_HOST=localhost 15 | JWT_TOKEN_SECRET= 16 | -------------------------------------------------------------------------------- /rsc/dicom.properties: -------------------------------------------------------------------------------- 1 | #dicom.manager.impl=org.isf.dicom.manager.FileSystemDicomManager # filesystem storage 2 | #dicom.manager.impl=org.isf.dicom.manager.SqlDicomManager # database storage 3 | #dicom.max.size=1024B, 2048B, 1M, 16M, 256M, 512M, 1024M, 1G # image size examples 4 | dicom.manager.impl=org.isf.dicom.manager.FileSystemDicomManager 5 | dicom.storage.filesystem=./data/dicom_storage 6 | dicom.max.size=4M 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: maven 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | time: "04:00" 8 | open-pull-requests-limit: 10 9 | ignore: 10 | - dependency-name: org.modelmapper:modelmapper 11 | versions: 12 | - 2.3.9 13 | - 2.4.0 14 | - 2.4.1 15 | - dependency-name: org.springframework.boot:spring-boot-starter-parent 16 | versions: 17 | - 2.4.2 18 | - 2.4.3 19 | - 2.4.4 20 | -------------------------------------------------------------------------------- /rsc/telemetry.properties: -------------------------------------------------------------------------------- 1 | # number of seconds to check if it should send a message 2 | 3 | telemetry.daemon.thread.loop.seconds=14400 4 | 5 | # enabled remote geo ip lookup service 6 | # allowed values: 7 | # - geoiplookup-remote-service 8 | # - ipapi-remote-service 9 | telemetry.enabled.geo.ip.lookup.service=geoiplookup-remote-service 10 | # endpoints remote services 11 | geoiplookup-remote-service.ribbon.base-url=https://json.geoiplookup.io 12 | ipapi-remote-service.ribbon.base-url=http://ip-api.com/json -------------------------------------------------------------------------------- /src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ____ _ _ _ _ _ ___ ___ 3 | / __ \ | | | | (_) | | | |__ \ / _ \ 4 | | | | |_ __ ___ _ __ | |__| | ___ ___ _ __ _| |_ __ _| | ) || | | | 5 | | | | | '_ \ / _ \ '_ \ | __ |/ _ \/ __| '_ \| | __/ _` | | / / | | | | 6 | | |__| | |_) | __/ | | | | | | | (_) \__ \ |_) | | || (_| | | / /_ | |_| | 7 | \____/| .__/ \___|_| |_| |_| |_|\___/|___/ .__/|_|\__\__,_|_| |____(_)___/ 8 | | | | | 9 | |_| |_| 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | /target/ 3 | /rsc/*.properties 4 | !.mvn/wrapper/maven-wrapper.jar 5 | /oh-rest-api.log.*.gz 6 | logs/ 7 | bin 8 | *.log 9 | /static 10 | !static/swagger-ui/ 11 | 12 | #Project related 13 | .env 14 | /deps/ 15 | OH_API_PID 16 | 17 | ### STS ### 18 | .apt_generated 19 | .classpath 20 | .factorypath 21 | .project 22 | .settings 23 | .springBeans 24 | .sts4-cache 25 | *.class 26 | 27 | ### IntelliJ IDEA ### 28 | .idea 29 | *.iws 30 | *.iml 31 | *.ipr 32 | *.pid 33 | 34 | ### NetBeans ### 35 | /nbproject/private/ 36 | /nbbuild/ 37 | /dist/ 38 | /nbdist/ 39 | /.nb-gradle/ 40 | /build/ 41 | 42 | ### VScode ### 43 | .vscode 44 | /deps/ 45 | OH_API_PID 46 | 47 | ### Git ### 48 | /**/.gitkeep 49 | -------------------------------------------------------------------------------- /Dockerfile.backend: -------------------------------------------------------------------------------- 1 | FROM maven:3.9-eclipse-temurin-17 2 | 3 | ARG GITHUB_ORG 4 | ARG OH_CORE_BRANCH 5 | ARG OH_API_BRANCH 6 | 7 | RUN apt-get update 8 | RUN apt-get install -y git 9 | 10 | ADD ./deps/openhospital-core /openhospital-core 11 | WORKDIR ./openhospital-core 12 | RUN --mount=type=cache,target=/root/.m2 mvn clean install -DskipTests=true 13 | 14 | WORKDIR / 15 | RUN git clone --depth=1 -b $OH_API_BRANCH https://github.com/informatici/openhospital-api.git 16 | ADD ./rsc /openhospital-api/rsc 17 | WORKDIR ./openhospital-api 18 | RUN --mount=type=cache,target=/root/.m2 mvn clean install -DskipTests=true 19 | 20 | WORKDIR ./target 21 | CMD java -cp "openhospital-api-0.1.0.jar:rsc/:static/" org.springframework.boot.loader.launch.JarLauncher -------------------------------------------------------------------------------- /rsc/examination.properties: -------------------------------------------------------------------------------- 1 | # This file contains PatientExamination module settings 2 | LIST_SIZE = 10 3 | HEIGHT_MIN = 0 4 | HEIGHT_MAX = 250 5 | HEIGHT_INIT = 0 6 | #HEIGHT_STEP = 1 7 | #WEIGHT_UNIT = Kg 8 | WEIGHT_MIN = 0 9 | WEIGHT_MAX = 200 10 | WEIGHT_INIT = 0 11 | WEIGHT_STEP = 0.1 12 | #AP_UNIT = mmHg 13 | AP_MIN_INIT = 80 14 | AP_MAX_INIT = 120 15 | #HR_UNIT = bpm 16 | HR_MIN = 0 17 | HR_MAX = 240 18 | HR_INIT = 60 19 | #TEMP_UNIT = °C 20 | TEMP_INIT = 36 21 | TEMP_MIN = 30 22 | TEMP_MAX = 50 23 | TEMP_STEP = 0.1 24 | #SAT_UNIT = % 25 | SAT_INIT = 98 26 | SAT_MIN = 50 27 | #SAT_MAX = 100 28 | SAT_STEP = 0.1 29 | HGT_MIN = 30 30 | HGT_MAX = 600 31 | HGT_INIT = 80 32 | DIURESIS_MIN = 0 33 | DIURESIS_MAX = 2500 34 | DIURESIS_INIT = 100 35 | RR_INIT = 20 36 | RR_MIN = 0 37 | RR_MAX = 100 38 | -------------------------------------------------------------------------------- /.license-header/license-header.txt: -------------------------------------------------------------------------------- 1 | ${project.name} (${project.url}) 2 | Copyright © ${license.git.copyrightYears} ${owner} (${email}) 3 | 4 | ${project.description} 5 | 6 | This program is free software: you can redistribute it and/or modify 7 | it under the terms of the GNU General Public License as published by 8 | the Free Software Foundation, either version 3 of the License, or 9 | (at your option) any later version. 10 | 11 | https://www.gnu.org/licenses/gpl-3.0-standalone.html 12 | 13 | This program is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | GNU General Public License for more details. 17 | 18 | You should have received a copy of the GNU General Public License 19 | along with this program. If not, see . -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip 18 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar -------------------------------------------------------------------------------- /src/main/java/org/isf/patient/dto/PatientSTATUS.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.patient.dto; 23 | 24 | public enum PatientSTATUS { 25 | I, O; 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/org/isf/security/jwt/TokenValidationResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.security.jwt; 23 | 24 | public enum TokenValidationResult { 25 | VALID, EXPIRED, MALFORMED, UNSUPPORTED, EMPTY_CLAIMS, INVALID_SIGNATURE, UNKNOWN; 26 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/medical/dto/MedicalSortBy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medical.dto; 23 | 24 | public enum MedicalSortBy { 25 | NONE("none"), CODE("code"), NAME("name"); 26 | 27 | String value; 28 | 29 | MedicalSortBy(String value) { 30 | this.value = value; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.shared; 23 | 24 | public class Constants { 25 | 26 | public static final String DATE_FORMAT_YYYY_MM_DD_T_HH_MM_SS_SSS_Z = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"; 27 | 28 | private Constants() { 29 | 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/org/isf/permissions/dto/LitePermissionDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.permissions.dto; 23 | 24 | public class LitePermissionDTO { 25 | 26 | private String name; 27 | 28 | public String getName() { 29 | return name; 30 | } 31 | 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/isf/testing/rest/ControllerBaseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.testing.rest; 23 | 24 | import org.slf4j.Logger; 25 | import org.slf4j.LoggerFactory; 26 | 27 | public class ControllerBaseTest { 28 | 29 | private static final Logger LOGGER = LoggerFactory.getLogger(ControllerBaseTest.class); 30 | 31 | public ControllerBaseTest() { 32 | } 33 | 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/security/jwt/SecurityConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.security.jwt; 23 | 24 | public class SecurityConstants { 25 | 26 | public static final long EXPIRATION_TIME = 900_000; // 15 mins 27 | public static final String TOKEN_PREFIX = "Bearer "; 28 | public static final String HEADER_STRING = "Authorization"; 29 | public static final String SIGN_UP_URL = "/auth/login"; 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/isf/usergroups/dto/GroupPermissionsDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.usergroups.dto; 23 | 24 | import java.util.List; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | public record GroupPermissionsDTO( 29 | @Schema(name = "permissions", example = "[48, 24]", description = "List of permissions' ids") List permissionIds) { 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/org/isf/sms/mapper/SmsMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.sms.mapper; 23 | 24 | import org.isf.shared.GenericMapper; 25 | import org.isf.sms.dto.SmsDTO; 26 | import org.isf.sms.model.Sms; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class SmsMapper extends GenericMapper{ 31 | public SmsMapper() { 32 | super(Sms.class, SmsDTO.class); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/isf/ward/mapper/WardMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.ward.mapper; 23 | 24 | import org.isf.shared.GenericMapper; 25 | import org.isf.ward.dto.WardDTO; 26 | import org.isf.ward.model.Ward; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class WardMapper extends GenericMapper { 31 | public WardMapper() { 32 | super(Ward.class, WardDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/Mapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.shared; 23 | 24 | import java.util.List; 25 | 26 | import org.modelmapper.ModelMapper; 27 | 28 | public interface Mapper { 29 | 30 | ToType map2DTO(FromType fromObj); 31 | FromType map2Model(ToType toObj); 32 | List map2DTOList(List list); 33 | List map2ModelList(List list); 34 | 35 | ModelMapper getMapper(); 36 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/exam/mapper/ExamMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.exam.mapper; 23 | 24 | import org.isf.exa.model.Exam; 25 | import org.isf.exam.dto.ExamDTO; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class ExamMapper extends GenericMapper { 31 | 32 | public ExamMapper() { 33 | super(Exam.class, ExamDTO.class); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/visits/mapper/VisitMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.visits.mapper; 23 | 24 | import org.isf.shared.GenericMapper; 25 | import org.isf.visits.dto.VisitDTO; 26 | import org.isf.visits.model.Visit; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class VisitMapper extends GenericMapper { 31 | public VisitMapper() { 32 | super(Visit.class, VisitDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/accounting/mapper/BillMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.accounting.mapper; 23 | 24 | import org.isf.accounting.dto.BillDTO; 25 | import org.isf.accounting.model.Bill; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class BillMapper extends GenericMapper { 31 | public BillMapper() { 32 | super(Bill.class, BillDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/priceslist/mapper/PriceMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.priceslist.mapper; 23 | 24 | import org.isf.priceslist.dto.PriceDTO; 25 | import org.isf.priceslist.model.Price; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class PriceMapper extends GenericMapper { 31 | public PriceMapper() { 32 | super(Price.class, PriceDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/agetype/mapper/AgeTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.agetype.mapper; 23 | 24 | import org.isf.agetype.dto.AgeTypeDTO; 25 | import org.isf.agetype.model.AgeType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class AgeTypeMapper extends GenericMapper { 31 | public AgeTypeMapper() { 32 | super(AgeType.class, AgeTypeDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/disease/mapper/DiseaseMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.disease.mapper; 23 | 24 | import org.isf.disease.dto.DiseaseDTO; 25 | import org.isf.disease.model.Disease; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class DiseaseMapper extends GenericMapper { 31 | public DiseaseMapper() { 32 | super(Disease.class, DiseaseDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/vaccine/mapper/VaccineMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.vaccine.mapper; 23 | 24 | import org.isf.shared.GenericMapper; 25 | import org.isf.vaccine.dto.VaccineDTO; 26 | import org.isf.vaccine.model.Vaccine; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class VaccineMapper extends GenericMapper { 31 | public VaccineMapper() { 32 | super(Vaccine.class, VaccineDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/exam/mapper/ExamRowMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.exam.mapper; 23 | 24 | import org.isf.exa.model.ExamRow; 25 | import org.isf.exam.dto.ExamRowDTO; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class ExamRowMapper extends GenericMapper { 31 | 32 | public ExamRowMapper() { 33 | super(ExamRow.class, ExamRowDTO.class); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/medicalstock/mapper/LotMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medicalstock.mapper; 23 | 24 | import org.isf.medicalstock.dto.LotDTO; 25 | import org.isf.medicalstock.model.Lot; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class LotMapper extends GenericMapper { 31 | 32 | public LotMapper() { 33 | super(Lot.class, LotDTO.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/isf/therapy/mapper/TherapyMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.therapy.mapper; 23 | 24 | import org.isf.shared.GenericMapper; 25 | import org.isf.therapy.dto.TherapyDTO; 26 | import org.isf.therapy.model.Therapy; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class TherapyMapper extends GenericMapper { 31 | public TherapyMapper() { 32 | super(Therapy.class, TherapyDTO.class); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/isf/menu/mapper/GroupMenuMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.menu.mapper; 23 | 24 | import org.isf.menu.dto.GroupMenuDTO; 25 | import org.isf.menu.model.GroupMenu; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class GroupMenuMapper extends GenericMapper { 31 | public GroupMenuMapper() { 32 | super(GroupMenu.class, GroupMenuDTO.class); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/isf/medical/mapper/MedicalMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medical.mapper; 23 | 24 | import org.isf.medical.dto.MedicalDTO; 25 | import org.isf.medicals.model.Medical; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class MedicalMapper extends GenericMapper { 31 | 32 | public MedicalMapper() { 33 | super(Medical.class, MedicalDTO.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/isf/supplier/mapper/SupplierMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.supplier.mapper; 23 | 24 | import org.isf.shared.GenericMapper; 25 | import org.isf.supplier.dto.SupplierDTO; 26 | import org.isf.supplier.model.Supplier; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class SupplierMapper extends GenericMapper { 31 | public SupplierMapper() { 32 | super(Supplier.class, SupplierDTO.class); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/isf/exatype/mapper/ExamTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.exatype.mapper; 23 | 24 | import org.isf.exatype.dto.ExamTypeDTO; 25 | import org.isf.exatype.model.ExamType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class ExamTypeMapper extends GenericMapper { 31 | 32 | public ExamTypeMapper() { 33 | super(ExamType.class, ExamTypeDTO.class); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/operation/mapper/OperationMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.operation.mapper; 23 | 24 | import org.isf.operation.dto.OperationDTO; 25 | import org.isf.operation.model.Operation; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class OperationMapper extends GenericMapper { 31 | public OperationMapper() { 32 | super(Operation.class, OperationDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/accounting/mapper/BillItemsMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.accounting.mapper; 23 | 24 | import org.isf.accounting.dto.BillItemsDTO; 25 | import org.isf.accounting.model.BillItems; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class BillItemsMapper extends GenericMapper { 31 | public BillItemsMapper() { 32 | super(BillItems.class, BillItemsDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/hospital/mapper/HospitalMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.hospital.mapper; 23 | 24 | import org.isf.hospital.dto.HospitalDTO; 25 | import org.isf.hospital.model.Hospital; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class HospitalMapper extends GenericMapper { 31 | 32 | public HospitalMapper() { 33 | super(Hospital.class, HospitalDTO.class); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/lab/mapper/LaboratoryMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.lab.mapper; 23 | 24 | import org.isf.lab.dto.LaboratoryDTO; 25 | import org.isf.lab.model.Laboratory; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class LaboratoryMapper extends GenericMapper { 31 | 32 | public LaboratoryMapper() { 33 | super(Laboratory.class, LaboratoryDTO.class); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/priceslist/mapper/PriceListMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.priceslist.mapper; 23 | 24 | import org.isf.priceslist.dto.PriceListDTO; 25 | import org.isf.priceslist.model.PriceList; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class PriceListMapper extends GenericMapper { 31 | public PriceListMapper() { 32 | super(PriceList.class, PriceListDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/distype/mapper/DiseaseTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.distype.mapper; 23 | 24 | import org.isf.distype.dto.DiseaseTypeDTO; 25 | import org.isf.distype.model.DiseaseType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class DiseaseTypeMapper extends GenericMapper { 31 | public DiseaseTypeMapper() { 32 | super(DiseaseType.class, DiseaseTypeDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/patvac/mapper/PatVacMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.patvac.mapper; 23 | 24 | import org.isf.patvac.dto.PatientVaccineDTO; 25 | import org.isf.patvac.model.PatientVaccine; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class PatVacMapper extends GenericMapper { 31 | public PatVacMapper() { 32 | super(PatientVaccine.class, PatientVaccineDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/usergroups/mapper/UserGroupMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.usergroups.mapper; 23 | 24 | import org.isf.menu.model.UserGroup; 25 | import org.isf.shared.GenericMapper; 26 | import org.isf.usergroups.dto.UserGroupDTO; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class UserGroupMapper extends GenericMapper { 31 | 32 | public UserGroupMapper() { 33 | super(UserGroup.class, UserGroupDTO.class); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/isf/vactype/mapper/VaccineTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.vactype.mapper; 23 | 24 | import org.isf.shared.GenericMapper; 25 | import org.isf.vactype.dto.VaccineTypeDTO; 26 | import org.isf.vactype.model.VaccineType; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class VaccineTypeMapper extends GenericMapper { 31 | public VaccineTypeMapper() { 32 | super(VaccineType.class, VaccineTypeDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/medtype/mapper/MedicalTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medtype.mapper; 23 | 24 | import org.isf.medtype.dto.MedicalTypeDTO; 25 | import org.isf.medtype.model.MedicalType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class MedicalTypeMapper extends GenericMapper { 31 | public MedicalTypeMapper() { 32 | super(MedicalType.class, MedicalTypeDTO.class); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/isf/menu/mapper/UserMenuItemMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.menu.mapper; 23 | 24 | import org.isf.menu.dto.UserMenuItemDTO; 25 | import org.isf.menu.model.UserMenuItem; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class UserMenuItemMapper extends GenericMapper { 31 | public UserMenuItemMapper() { 32 | super(UserMenuItem.class, UserMenuItemDTO.class); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/org/isf/dlvrtype/mapper/DeliveryTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.dlvrtype.mapper; 23 | 24 | import org.isf.dlvrtype.dto.DeliveryTypeDTO; 25 | import org.isf.dlvrtype.model.DeliveryType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class DeliveryTypeMapper extends GenericMapper { 31 | public DeliveryTypeMapper() { 32 | super(DeliveryType.class, DeliveryTypeDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/medicalstock/mapper/MovementMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medicalstock.mapper; 23 | 24 | import org.isf.medicalstock.dto.MovementDTO; 25 | import org.isf.medicalstock.model.Movement; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class MovementMapper extends GenericMapper { 31 | 32 | public MovementMapper() { 33 | super(Movement.class, MovementDTO.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/isf/accounting/mapper/BillPaymentsMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.accounting.mapper; 23 | 24 | import org.isf.accounting.dto.BillPaymentsDTO; 25 | import org.isf.accounting.model.BillPayments; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class BillPaymentsMapper extends GenericMapper { 31 | public BillPaymentsMapper() { 32 | super(BillPayments.class, BillPaymentsDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/admtype/mapper/AdmissionTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.admtype.mapper; 23 | 24 | import org.isf.admtype.dto.AdmissionTypeDTO; 25 | import org.isf.admtype.model.AdmissionType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class AdmissionTypeMapper extends GenericMapper { 31 | public AdmissionTypeMapper() { 32 | super(AdmissionType.class, AdmissionTypeDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/lab/mapper/LaboratoryRowMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.lab.mapper; 23 | 24 | import org.isf.lab.dto.LaboratoryRowDTO; 25 | import org.isf.lab.model.LaboratoryRow; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class LaboratoryRowMapper extends GenericMapper { 31 | 32 | public LaboratoryRowMapper() { 33 | super(LaboratoryRow.class, LaboratoryRowDTO.class); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/operation/mapper/OperationRowMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.operation.mapper; 23 | 24 | import org.isf.operation.dto.OperationRowDTO; 25 | import org.isf.operation.model.OperationRow; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class OperationRowMapper extends GenericMapper { 31 | public OperationRowMapper() { 32 | super(OperationRow.class, OperationRowDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/opetype/mapper/OperationTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.opetype.mapper; 23 | 24 | import org.isf.opetype.dto.OperationTypeDTO; 25 | import org.isf.opetype.model.OperationType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class OperationTypeMapper extends GenericMapper { 31 | public OperationTypeMapper() { 32 | super(OperationType.class, OperationTypeDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/disctype/mapper/DischargeTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.disctype.mapper; 23 | 24 | import org.isf.disctype.dto.DischargeTypeDTO; 25 | import org.isf.disctype.model.DischargeType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class DischargeTypeMapper extends GenericMapper { 31 | public DischargeTypeMapper() { 32 | super(DischargeType.class, DischargeTypeDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/usersettings/mapper/UserSettingMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.usersettings.mapper; 23 | 24 | import org.isf.menu.model.UserSetting; 25 | import org.isf.shared.GenericMapper; 26 | import org.isf.usersettings.dto.UserSettingDTO; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class UserSettingMapper extends GenericMapper { 31 | 32 | public UserSettingMapper() { 33 | super(UserSetting.class, UserSettingDTO.class); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/isf/pricesothers/mapper/PricesOthersMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.pricesothers.mapper; 23 | 24 | import org.isf.pricesothers.dto.PricesOthersDTO; 25 | import org.isf.pricesothers.model.PricesOthers; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class PricesOthersMapper extends GenericMapper { 31 | public PricesOthersMapper() { 32 | super(PricesOthers.class, PricesOthersDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/login/dto/TokenRefreshRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.login.dto; 23 | 24 | public class TokenRefreshRequest { 25 | 26 | private String refreshToken; 27 | 28 | public TokenRefreshRequest() { 29 | } 30 | 31 | public TokenRefreshRequest(String refreshToken) { 32 | this.refreshToken = refreshToken; 33 | } 34 | 35 | public String getRefreshToken() { 36 | return refreshToken; 37 | } 38 | 39 | public void setRefreshToken(String refreshToken) { 40 | this.refreshToken = refreshToken; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/isf/malnutrition/mapper/MalnutritionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.malnutrition.mapper; 23 | 24 | import org.isf.malnutrition.dto.MalnutritionDTO; 25 | import org.isf.malnutrition.model.Malnutrition; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class MalnutritionMapper extends GenericMapper { 31 | 32 | public MalnutritionMapper() { 33 | super(Malnutrition.class, MalnutritionDTO.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/pagination/Page.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package org.isf.shared.pagination; 24 | 25 | import java.util.List; 26 | 27 | public class Page { 28 | 29 | List data; 30 | PageInfoDTO pageInfoDTO; 31 | 32 | public List getData() { 33 | return data; 34 | } 35 | public void setData(List data) { 36 | this.data = data; 37 | } 38 | public PageInfoDTO getPageInfo() { 39 | return pageInfoDTO; 40 | } 41 | public void setPageInfo(PageInfoDTO pageInfoDTO) { 42 | this.pageInfoDTO = pageInfoDTO; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/isf/admission/mapper/AdmittedPatientMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.admission.mapper; 23 | 24 | import org.isf.admission.dto.AdmittedPatientDTO; 25 | import org.isf.admission.model.AdmittedPatient; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class AdmittedPatientMapper extends GenericMapper { 31 | 32 | public AdmittedPatientMapper() { 33 | super(AdmittedPatient.class, AdmittedPatientDTO.class); 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/medicalstockward/mapper/MedicalWardMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medicalstockward.mapper; 23 | 24 | import org.isf.medicalstockward.dto.MedicalWardDTO; 25 | import org.isf.medicalstockward.model.MedicalWard; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class MedicalWardMapper extends GenericMapper { 31 | 32 | public MedicalWardMapper() { 33 | super(MedicalWard.class, MedicalWardDTO.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/isf/permissions/mapper/LitePermissionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.permissions.mapper; 23 | 24 | import org.isf.permissions.dto.LitePermissionDTO; 25 | import org.isf.permissions.model.Permission; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class LitePermissionMapper extends GenericMapper { 31 | 32 | public LitePermissionMapper() { 33 | super(Permission.class, LitePermissionDTO.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/isf/medstockmovtype/mapper/MovementTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medstockmovtype.mapper; 23 | 24 | import org.isf.medstockmovtype.dto.MovementTypeDTO; 25 | import org.isf.medstockmovtype.model.MovementType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class MovementTypeMapper extends GenericMapper { 31 | 32 | public MovementTypeMapper() { 33 | super(MovementType.class, MovementTypeDTO.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/isf/lab/mapper/LaboratoryForPrintMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.lab.mapper; 23 | 24 | import org.isf.lab.dto.LaboratoryForPrintDTO; 25 | import org.isf.lab.model.LaboratoryForPrint; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class LaboratoryForPrintMapper extends GenericMapper { 31 | 32 | public LaboratoryForPrintMapper() { 33 | super(LaboratoryForPrint.class, LaboratoryForPrintDTO.class); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/medicalstockward/mapper/MovementWardMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medicalstockward.mapper; 23 | 24 | import org.isf.medicalstockward.dto.MovementWardDTO; 25 | import org.isf.medicalstockward.model.MovementWard; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class MovementWardMapper extends GenericMapper { 31 | 32 | public MovementWardMapper() { 33 | super(MovementWard.class, MovementWardDTO.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/isf/medicalstockward/mapper/MedicalWardIdMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medicalstockward.mapper; 23 | 24 | import org.isf.medicalstockward.dto.MedicalWardIdDTO; 25 | import org.isf.medicalstockward.model.MedicalWardId; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class MedicalWardIdMapper extends GenericMapper { 31 | 32 | public MedicalWardIdMapper() { 33 | super(MedicalWardId.class, MedicalWardIdDTO.class); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/org/isf/dlvrrestype/mapper/DeliveryResultTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.dlvrrestype.mapper; 23 | 24 | import org.isf.dlvrrestype.dto.DeliveryResultTypeDTO; 25 | import org.isf.dlvrrestype.model.DeliveryResultType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class DeliveryResultTypeMapper extends GenericMapper { 31 | public DeliveryResultTypeMapper() { 32 | super(DeliveryResultType.class, DeliveryResultTypeDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/exam/dto/ExamWithRowsDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.exam.dto; 23 | 24 | import java.util.List; 25 | 26 | import jakarta.validation.constraints.NotNull; 27 | 28 | import io.swagger.v3.oas.annotations.media.Schema; 29 | 30 | public record ExamWithRowsDTO( 31 | @NotNull @Schema(name = "exam", description = "The exam to be changed") ExamDTO exam, 32 | @Schema(name = "rows", example = "['>=12 (NORMAL)', 'IRREGULAR']", description = "Possible result for the exam(only for exams with procedure 1 and 2)") List rows 33 | ) { 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/isf/examination/mapper/PatientExaminationMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.examination.mapper; 23 | 24 | import org.isf.examination.dto.PatientExaminationDTO; 25 | import org.isf.examination.model.PatientExamination; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class PatientExaminationMapper extends GenericMapper { 31 | 32 | public PatientExaminationMapper() { 33 | super(PatientExamination.class, PatientExaminationDTO.class); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/isf/pregtreattype/mapper/PregnantTreatmentTypeMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.pregtreattype.mapper; 23 | 24 | import org.isf.pregtreattype.dto.PregnantTreatmentTypeDTO; 25 | import org.isf.pregtreattype.model.PregnantTreatmentType; 26 | import org.isf.shared.GenericMapper; 27 | import org.springframework.stereotype.Component; 28 | 29 | @Component 30 | public class PregnantTreatmentTypeMapper extends GenericMapper { 31 | public PregnantTreatmentTypeMapper() { 32 | super(PregnantTreatmentType.class, PregnantTreatmentTypeDTO.class); 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/admission/dto/AdmittedPatientDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.admission.dto; 23 | 24 | import org.isf.patient.dto.PatientDTO; 25 | 26 | public class AdmittedPatientDTO { 27 | 28 | private PatientDTO patient; 29 | 30 | private AdmissionDTO admission; 31 | 32 | public PatientDTO getPatient() { 33 | return this.patient; 34 | } 35 | 36 | public AdmissionDTO getAdmission() { 37 | return this.admission; 38 | } 39 | 40 | public void setPatient(PatientDTO patient) { 41 | this.patient = patient; 42 | } 43 | 44 | public void setAdmission(AdmissionDTO admission) { 45 | this.admission = admission; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/isf/lab/dto/LabWithRowsDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.lab.dto; 23 | 24 | import java.util.List; 25 | 26 | public class LabWithRowsDTO { 27 | 28 | private LaboratoryDTO laboratoryDTO; 29 | 30 | private List laboratoryRowList; 31 | 32 | public LaboratoryDTO getLaboratoryDTO() { 33 | return this.laboratoryDTO; 34 | } 35 | 36 | public List getLaboratoryRowList() { 37 | return this.laboratoryRowList; 38 | } 39 | 40 | public void setLaboratoryDTO(LaboratoryDTO laboratoryDTO) { 41 | this.laboratoryDTO = laboratoryDTO; 42 | } 43 | 44 | public void setLaboratoryRowList(List laboratoryRowList) { 45 | this.laboratoryRowList = laboratoryRowList; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/isf/opd/dto/OpdWithOperationRowDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | 23 | package org.isf.opd.dto; 24 | 25 | import java.util.List; 26 | 27 | import org.isf.operation.dto.OperationRowDTO; 28 | 29 | public class OpdWithOperationRowDTO { 30 | 31 | private OpdDTO opdDTO; 32 | private List operationRows; 33 | 34 | public OpdDTO getOpdDTO() { 35 | return opdDTO; 36 | } 37 | 38 | public void setOpdDTO(OpdDTO opdDTO) { 39 | this.opdDTO = opdDTO; 40 | } 41 | 42 | public List getOperationRows() { 43 | return operationRows; 44 | } 45 | 46 | public void setOperationRows(List operationRows) { 47 | this.operationRows = operationRows; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/exceptions/OHAPIException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.shared.exceptions; 23 | 24 | import org.isf.utils.exception.OHServiceException; 25 | import org.isf.utils.exception.model.OHExceptionMessage; 26 | import org.springframework.http.HttpStatus; 27 | 28 | public class OHAPIException extends OHServiceException { 29 | 30 | private HttpStatus status = HttpStatus.BAD_REQUEST; 31 | 32 | public OHAPIException(OHExceptionMessage message) { 33 | super(message); 34 | } 35 | 36 | public OHAPIException(OHExceptionMessage message, HttpStatus status) { 37 | super(message); 38 | this.status = status; 39 | } 40 | 41 | public HttpStatus getStatus() { 42 | return this.status; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/isf/security/ApiAuditorAwareImpl.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.security; 23 | 24 | import java.util.Optional; 25 | 26 | import org.isf.utils.db.AuditorAwareInterface; 27 | import org.springframework.security.core.Authentication; 28 | import org.springframework.security.core.context.SecurityContextHolder; 29 | 30 | public class ApiAuditorAwareImpl implements AuditorAwareInterface { 31 | 32 | @Override 33 | public Optional getCurrentAuditor() { 34 | Authentication authentication = SecurityContextHolder.getContext().getAuthentication(); 35 | 36 | if (authentication != null && authentication.isAuthenticated()) { 37 | return Optional.of(authentication.getName()); 38 | } else { 39 | return Optional.empty(); 40 | } 41 | } 42 | } -------------------------------------------------------------------------------- /src/test/java/org/isf/OpenHospitalApiApplicationTests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf; 23 | 24 | import org.junit.jupiter.api.extension.ExtendWith; 25 | import org.springframework.boot.test.context.SpringBootTest; 26 | import org.springframework.test.context.junit.jupiter.SpringExtension; 27 | 28 | @ExtendWith(SpringExtension.class) 29 | @SpringBootTest 30 | class OpenHospitalApiApplicationTests { 31 | 32 | // @Test 33 | // void contextLoads() { 34 | // /* 35 | // * Context loading is working correctly. However, since this test does not provide any additional value and may actually slow down the tests execution, 36 | // * it's recommended to remove it. The loading context is implicitly tested by other tests that run as SpringBootTest. 37 | // */ 38 | // } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/isf/permissions/dto/PermissionDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.permissions.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | import io.swagger.v3.oas.annotations.media.Schema; 26 | 27 | public class PermissionDTO extends LitePermissionDTO { 28 | 29 | @NotNull 30 | @Schema(description = "The permission id") 31 | private Integer id; 32 | 33 | @NotNull 34 | @Schema(description = "The permission description", maxLength = 255) 35 | private String description; 36 | 37 | public Integer getId() { 38 | return id; 39 | } 40 | 41 | public void setId(Integer id) { 42 | this.id = id; 43 | } 44 | 45 | public String getDescription() { 46 | return description; 47 | } 48 | 49 | public void setDescription(String description) { 50 | this.description = description; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/isf/opetype/dto/OperationTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.opetype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | public class OperationTypeDTO { 29 | 30 | @NotNull 31 | @Schema(description = "The operation code", maxLength = 2) 32 | private String code; 33 | 34 | @NotNull 35 | @Schema(description = "The operation type", maxLength = 50) 36 | private String description; 37 | 38 | public String getCode() { 39 | return this.code; 40 | } 41 | 42 | public String getDescription() { 43 | return this.description; 44 | } 45 | 46 | public void setCode(String code) { 47 | this.code = code; 48 | } 49 | 50 | public void setDescription(String description) { 51 | this.description = description; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /rsc/sms.properties: -------------------------------------------------------------------------------- 1 | ################################################################## 2 | # Global configuration 3 | ################################################################## 4 | # use: gsm-gateway-service || skebby-gateway-service || textbelt-gateway-service 5 | sms.gateway=textbelt-gateway-service 6 | sms.gateway.thread.timeout=3000 7 | sms.gateway.thread.loop=15 8 | sms.gateway.thread.icc=+39 9 | 10 | 11 | ################################################################## 12 | # GSM configuration 13 | ################################################################## 14 | gsm-gateway-service.port=COM6 15 | gsm-gateway-service.driver-name=com.sun.comm.Win32Driver 16 | gsm-gateway-service.csmp=AT+CSMP\=17,167,0,0\r 17 | gsm-gateway-service.cmgf=AT+CMGF\=1\r 18 | gsm-gateway-service.gmm=AT+GMM\r\n 19 | gsm-gateway-service.cmgs=AT+CMGS\=" 20 | 21 | 22 | ################################################################## 23 | # Skebby configuration 24 | ################################################################## 25 | skebby-gateway-service.username= 26 | skebby-gateway-service.password= 27 | skebby-gateway-service.ribbon.base-url=https://api.skebby.it:443 28 | # USER_KEY and ACCESS_TOKEN avoids the login call every time we need to send sms 29 | skebby-gateway-service.accessToken= 30 | skebby-gateway-service.userKey= 31 | 32 | 33 | ################################################################## 34 | # Textbelt configuration 35 | ################################################################## 36 | # enables/disables server testing mode (so that textbelt will do fake actions) 37 | textbelt-gateway-service.enable-testing-mode=false 38 | # use: textbelt (in order to send 1 free sms per day) or your api key (if you purchased sms) 39 | textbelt-gateway-service.key=textbelt 40 | textbelt-gateway-service.ribbon.base-url=https://textbelt.com:443 -------------------------------------------------------------------------------- /src/main/java/org/isf/security/RestAuthenticationEntryPoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.security; 23 | 24 | import java.io.IOException; 25 | 26 | import jakarta.servlet.http.HttpServletRequest; 27 | import jakarta.servlet.http.HttpServletResponse; 28 | 29 | import org.springframework.security.core.AuthenticationException; 30 | import org.springframework.security.web.AuthenticationEntryPoint; 31 | import org.springframework.stereotype.Component; 32 | 33 | @Component 34 | public class RestAuthenticationEntryPoint implements AuthenticationEntryPoint { 35 | 36 | @Override 37 | public void commence(HttpServletRequest request, HttpServletResponse response, 38 | AuthenticationException authException) throws IOException { 39 | response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Not Authorized"); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/isf/distype/dto/DiseaseTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.distype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | @Schema(description = "Class representing a disease type") 29 | public class DiseaseTypeDTO { 30 | 31 | @NotNull 32 | @Schema(description = "Disease type code", maxLength = 2) 33 | private String code; 34 | 35 | @NotNull 36 | @Schema(description = "Disease type description", maxLength = 110) 37 | private String description; 38 | 39 | public String getCode() { 40 | return this.code; 41 | } 42 | 43 | public String getDescription() { 44 | return this.description; 45 | } 46 | 47 | public void setCode(String code) { 48 | this.code = code; 49 | } 50 | 51 | public void setDescription(String description) { 52 | this.description = description; 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/exam/dto/ExamRowDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.exam.dto; 23 | 24 | import io.swagger.v3.oas.annotations.media.Schema; 25 | 26 | public class ExamRowDTO { 27 | 28 | @Schema(description = "Exam Row Code", example = "999") 29 | private int code; 30 | 31 | @Schema(description = "Exam Row Code", example = "NEGATIVE") 32 | private String description; 33 | 34 | private ExamDTO exam; 35 | 36 | public int getCode() { 37 | return this.code; 38 | } 39 | 40 | public String getDescription() { 41 | return this.description; 42 | } 43 | 44 | public ExamDTO getExam() { 45 | return this.exam; 46 | } 47 | 48 | public void setCode(int code) { 49 | this.code = code; 50 | } 51 | 52 | public void setDescription(String description) { 53 | this.description = description; 54 | } 55 | 56 | public void setExam(ExamDTO exam) { 57 | this.exam = exam; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/org/isf/users/dto/UserProfileDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.users.dto; 23 | 24 | import java.util.List; 25 | 26 | import org.isf.usergroups.dto.UserGroupDTO; 27 | 28 | public class UserProfileDTO { 29 | 30 | private String userName; 31 | 32 | private List permissions; 33 | 34 | private UserGroupDTO userGroup; 35 | 36 | public String getUserName() { 37 | return userName; 38 | } 39 | 40 | public void setUserName(String userName) { 41 | this.userName = userName; 42 | } 43 | 44 | public List getPermissions() { 45 | return permissions; 46 | } 47 | 48 | public void setPermissions(List permission) { 49 | this.permissions = permission; 50 | } 51 | 52 | public UserGroupDTO getUserGroup() { 53 | return userGroup; 54 | } 55 | 56 | public void setUserGroup(UserGroupDTO userGroup) { 57 | this.userGroup = userGroup; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/org/isf/dlvrrestype/dto/DeliveryResultTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.dlvrrestype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | public class DeliveryResultTypeDTO { 29 | 30 | @NotNull 31 | @Schema(description = "Code of the delivery result type", example = "M") 32 | private String code; 33 | 34 | @NotNull 35 | @Schema(description = "Description of the delivery result type", example = "MORTALITÉ MATERNELLE", maxLength = 50) 36 | private String description; 37 | 38 | public String getCode() { 39 | return this.code; 40 | } 41 | 42 | public String getDescription() { 43 | return this.description; 44 | } 45 | 46 | public void setCode(String code) { 47 | this.code = code; 48 | } 49 | 50 | public void setDescription(String description) { 51 | this.description = description; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/org/isf/admtype/dto/AdmissionTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.admtype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | /** 29 | * @author antonio 30 | */ 31 | public class AdmissionTypeDTO { 32 | 33 | @NotNull 34 | @Schema(description = "Code of the admission type", example = "A") 35 | private String code; 36 | 37 | @NotNull 38 | @Schema(description = "Description of the admission type", example = "AMBULANCE", maxLength = 50) 39 | private String description; 40 | 41 | public String getCode() { 42 | return this.code; 43 | } 44 | 45 | public String getDescription() { 46 | return this.description; 47 | } 48 | 49 | public void setCode(String code) { 50 | this.code = code; 51 | } 52 | 53 | public void setDescription(String description) { 54 | this.description = description; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/isf/users/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.users.mapper; 23 | 24 | import org.isf.menu.model.User; 25 | import org.isf.shared.GenericMapper; 26 | import org.isf.users.dto.UserDTO; 27 | import org.springframework.beans.factory.annotation.Autowired; 28 | import org.springframework.security.crypto.password.PasswordEncoder; 29 | import org.springframework.stereotype.Component; 30 | 31 | @Component 32 | public class UserMapper extends GenericMapper { 33 | @Autowired 34 | private PasswordEncoder passwordEncoder; 35 | 36 | public UserMapper() { 37 | super(User.class, UserDTO.class); 38 | } 39 | 40 | @Override 41 | public User map2Model(UserDTO dto) { 42 | var user = super.map2Model(dto); 43 | if (dto.getPasswd() != null && !dto.getPasswd().isEmpty()) { 44 | user.setPasswd(passwordEncoder.encode(user.getPasswd())); 45 | } 46 | return user; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/isf/disctype/dto/DischargeTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.disctype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | /** 29 | * @author gildas 30 | */ 31 | public class DischargeTypeDTO { 32 | 33 | @NotNull 34 | @Schema(description = "Code of the discharge type", example = "SN") 35 | private String code; 36 | 37 | @NotNull 38 | @Schema(description = "Description of the discharge type", example = "SORTIE NORMALE", maxLength = 50) 39 | private String description; 40 | 41 | public String getCode() { 42 | return this.code; 43 | } 44 | 45 | public String getDescription() { 46 | return this.description; 47 | } 48 | 49 | public void setCode(String code) { 50 | this.code = code; 51 | } 52 | 53 | public void setDescription(String description) { 54 | this.description = description; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/isf/dlvrtype/dto/DeliveryTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.dlvrtype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | /** 29 | * @author gildas 30 | */ 31 | public class DeliveryTypeDTO { 32 | 33 | @NotNull 34 | @Schema(description = "Code of the delivery type", example = "N") 35 | private String code; 36 | 37 | @NotNull 38 | @Schema(description = "Description of the delivery type", example = "ACCOUCHEMENT NORMAL", maxLength = 50) 39 | private String description; 40 | 41 | public String getCode() { 42 | return this.code; 43 | } 44 | 45 | public String getDescription() { 46 | return this.description; 47 | } 48 | 49 | public void setCode(String code) { 50 | this.code = code; 51 | } 52 | 53 | public void setDescription(String description) { 54 | this.description = description; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/org/isf/admission/mapper/AdmissionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.admission.mapper; 23 | 24 | import java.util.List; 25 | import java.util.stream.Collectors; 26 | 27 | import org.isf.admission.dto.AdmissionDTO; 28 | import org.isf.admission.model.Admission; 29 | import org.isf.shared.GenericMapper; 30 | import org.springframework.stereotype.Component; 31 | 32 | @Component 33 | public class AdmissionMapper extends GenericMapper { 34 | 35 | public AdmissionMapper() { 36 | super(Admission.class, AdmissionDTO.class); 37 | } 38 | 39 | @Override 40 | public List map2DTOList(List list) { 41 | return list.stream().map(it -> map2DTO(it)).collect(Collectors.toList()); 42 | } 43 | 44 | @Override 45 | public List map2ModelList(List list) { 46 | return list.stream().map(it -> map2Model(it)).collect(Collectors.toList()); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/mapper/converter/ByteArrayToBlobConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.shared.mapper.converter; 23 | 24 | import java.sql.Blob; 25 | import java.sql.SQLException; 26 | 27 | import javax.sql.rowset.serial.SerialBlob; 28 | 29 | import org.modelmapper.AbstractConverter; 30 | import org.slf4j.Logger; 31 | import org.slf4j.LoggerFactory; 32 | import org.springframework.stereotype.Component; 33 | 34 | /** 35 | * @author akashytsa 36 | */ 37 | @Component 38 | public class ByteArrayToBlobConverter extends AbstractConverter { 39 | 40 | private static final Logger LOGGER = LoggerFactory.getLogger(ByteArrayToBlobConverter.class); 41 | 42 | @Override 43 | protected Blob convert(byte[] data) { 44 | try { 45 | return new SerialBlob(data); 46 | } catch (SQLException e) { 47 | LOGGER.error("", e); 48 | } 49 | return null; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/isf/vactype/dto/VaccineTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.vactype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | @Schema(description = "Class representing a vaccine type") 29 | public class VaccineTypeDTO { 30 | 31 | @NotNull 32 | @Schema(description = "Code of the vaccine type", example = "C", maxLength = 1) 33 | private String code; 34 | 35 | @NotNull 36 | @Schema(description = "Description of the vaccine type", example = "Child", maxLength = 50) 37 | private String description; 38 | 39 | public String getCode() { 40 | return this.code; 41 | } 42 | 43 | public String getDescription() { 44 | return this.description; 45 | } 46 | 47 | public void setCode(String code) { 48 | this.code = code; 49 | } 50 | 51 | public void setDescription(String description) { 52 | this.description = description; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/org/isf/login/dto/LoginRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.login.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | public class LoginRequest { 29 | 30 | @NotNull 31 | @Schema(description = "User Name", example = "admin") 32 | private String username; 33 | 34 | @NotNull 35 | @Schema(description = "Password of user", example = "admin") 36 | private String password; 37 | 38 | public LoginRequest(String username, String password) { 39 | this.username = username; 40 | this.password = password; 41 | } 42 | 43 | public String getUsername() { 44 | return username; 45 | } 46 | 47 | public void setUsername(String username) { 48 | this.username = username; 49 | } 50 | 51 | public String getPassword() { 52 | return password; 53 | } 54 | 55 | public void setPassword(String password) { 56 | this.password = password; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/org/isf/permissions/mapper/PermissionMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.permissions.mapper; 23 | 24 | import java.util.List; 25 | import java.util.stream.Collectors; 26 | import org.isf.permissions.dto.PermissionDTO; 27 | import org.isf.permissions.model.Permission; 28 | import org.isf.shared.GenericMapper; 29 | import org.springframework.stereotype.Component; 30 | 31 | @Component 32 | public class PermissionMapper extends GenericMapper { 33 | 34 | public PermissionMapper() { 35 | super(Permission.class, PermissionDTO.class); 36 | } 37 | 38 | @Override 39 | public List map2DTOList(List list) { 40 | return list.stream().map(permission -> modelMapper.map(permission, PermissionDTO.class)).collect(Collectors.toList()); 41 | } 42 | 43 | @Override 44 | public PermissionDTO map2DTO(Permission fromObj) { 45 | return modelMapper.map(fromObj, PermissionDTO.class); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/mapper/converter/ModelMapperConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.shared.mapper.converter; 23 | 24 | import org.modelmapper.ModelMapper; 25 | import org.modelmapper.module.jsr310.Jsr310Module; 26 | import org.springframework.beans.factory.annotation.Autowired; 27 | import org.springframework.context.annotation.Bean; 28 | import org.springframework.context.annotation.Configuration; 29 | 30 | @Configuration 31 | public class ModelMapperConfig { 32 | 33 | @Autowired 34 | protected BlobToByteArrayConverter blobToByteArrayConverter; 35 | 36 | @Autowired 37 | protected ByteArrayToBlobConverter byteArrayToBlobConverter; 38 | 39 | @Bean 40 | public ModelMapper modelMapper() { 41 | ModelMapper modelMapper = new ModelMapper(); 42 | modelMapper.addConverter(blobToByteArrayConverter); 43 | modelMapper.addConverter(byteArrayToBlobConverter); 44 | modelMapper.registerModule(new Jsr310Module()); 45 | return modelMapper; 46 | } 47 | } -------------------------------------------------------------------------------- /src/test/java/org/isf/lab/data/LaboratoryRowHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.lab.data; 23 | 24 | import org.isf.lab.TestLaboratoryRow; 25 | import org.isf.lab.dto.LaboratoryRowDTO; 26 | import org.isf.lab.model.Laboratory; 27 | import org.isf.lab.model.LaboratoryRow; 28 | import org.isf.utils.exception.OHException; 29 | 30 | import com.fasterxml.jackson.core.JsonProcessingException; 31 | import com.fasterxml.jackson.databind.ObjectMapper; 32 | 33 | public class LaboratoryRowHelper { 34 | public static LaboratoryRow setup() throws OHException { 35 | Laboratory lab = new Laboratory(); 36 | boolean usingSet = true; 37 | return new TestLaboratoryRow().setup(lab, usingSet); 38 | } 39 | 40 | 41 | public static String asJsonString(LaboratoryRowDTO body) { 42 | 43 | try { 44 | return new ObjectMapper().writeValueAsString(body); 45 | } catch (JsonProcessingException e) { 46 | e.printStackTrace(); 47 | } 48 | return null; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/mapper/OHModelMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.shared.mapper; 23 | 24 | import org.isf.shared.mapper.converter.BlobToByteArrayConverter; 25 | import org.isf.shared.mapper.converter.ByteArrayToBlobConverter; 26 | import org.modelmapper.ModelMapper; 27 | import org.modelmapper.module.jsr310.Jsr310Module; 28 | 29 | /** 30 | * @author akashytsa 31 | */ 32 | public class OHModelMapper { 33 | 34 | private static ModelMapper modelMapper; 35 | 36 | private static ModelMapper getInstance() { 37 | modelMapper = new ModelMapper(); 38 | modelMapper.addConverter(new BlobToByteArrayConverter()); 39 | modelMapper.addConverter(new ByteArrayToBlobConverter()); 40 | modelMapper.registerModule(new Jsr310Module()); 41 | return modelMapper; 42 | } 43 | 44 | public static ModelMapper getObjectMapper() { 45 | return modelMapper == null ? getInstance() : modelMapper; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/isf/lab/dto/LaboratoryRowDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.lab.dto; 23 | 24 | public class LaboratoryRowDTO { 25 | 26 | private Integer code; 27 | 28 | private LaboratoryDTO laboratory; 29 | 30 | private String description; 31 | 32 | public LaboratoryRowDTO() { 33 | } 34 | 35 | public LaboratoryRowDTO(String description, LaboratoryDTO labDTO) { 36 | this.description = description; 37 | this.laboratory = labDTO; 38 | } 39 | 40 | public Integer getCode() { 41 | return this.code; 42 | } 43 | 44 | public LaboratoryDTO getLaboratory() { 45 | return this.laboratory; 46 | } 47 | 48 | public String getDescription() { 49 | return this.description; 50 | } 51 | 52 | public void setCode(Integer code) { 53 | this.code = code; 54 | } 55 | 56 | public void setLaboratory(LaboratoryDTO laboratory) { 57 | this.laboratory = laboratory; 58 | } 59 | 60 | public void setDescription(String description) { 61 | this.description = description; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/org/isf/security/jwt/AuthEntryPointJwt.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.security.jwt; 23 | 24 | import java.io.IOException; 25 | 26 | import jakarta.servlet.http.HttpServletRequest; 27 | import jakarta.servlet.http.HttpServletResponse; 28 | 29 | import org.slf4j.Logger; 30 | import org.slf4j.LoggerFactory; 31 | import org.springframework.security.core.AuthenticationException; 32 | import org.springframework.security.web.AuthenticationEntryPoint; 33 | import org.springframework.stereotype.Component; 34 | 35 | @Component 36 | public class AuthEntryPointJwt implements AuthenticationEntryPoint { 37 | private static final Logger LOGGER = LoggerFactory.getLogger(AuthEntryPointJwt.class); 38 | @Override 39 | public void commence(HttpServletRequest request, HttpServletResponse response, 40 | AuthenticationException authException) throws IOException { 41 | LOGGER.error("Unauthorized error: {}", authException.getMessage()); 42 | response.sendError(HttpServletResponse.SC_UNAUTHORIZED, "Error: Unauthorized"); 43 | } 44 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/security/LogoutApi.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.security; 23 | 24 | import org.springframework.web.bind.annotation.PostMapping; 25 | import org.springframework.web.bind.annotation.RestController; 26 | 27 | import io.swagger.v3.oas.annotations.Operation; 28 | import io.swagger.v3.oas.annotations.responses.ApiResponse; 29 | import io.swagger.v3.oas.annotations.responses.ApiResponses; 30 | import io.swagger.v3.oas.annotations.tags.Tag; 31 | 32 | /** 33 | * Here only for swagger 34 | * 35 | * @author antonio 36 | */ 37 | 38 | @RestController 39 | @Tag(name = "Login") 40 | public class LogoutApi { 41 | 42 | /** 43 | * Implemented by Spring Security 44 | */ 45 | @Operation(method = "Logout", description = "Logout the current user.") 46 | @ApiResponses({@ApiResponse(responseCode = "200", description = "OK")}) 47 | @PostMapping(value = "/auth/logout") 48 | void logout() { 49 | throw new IllegalStateException("Add Spring Security to handle authentication"); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/isf/medicalstockward/dto/MedicalWardIdDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medicalstockward.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import org.isf.medical.dto.MedicalDTO; 27 | import org.isf.ward.dto.WardDTO; 28 | 29 | import io.swagger.v3.oas.annotations.media.Schema; 30 | 31 | public class MedicalWardIdDTO { 32 | 33 | @NotNull 34 | @Schema(description = "The ward") 35 | private WardDTO ward; 36 | 37 | @NotNull 38 | @Schema(description = "The medical") 39 | private MedicalDTO medical; 40 | 41 | public MedicalWardIdDTO() { 42 | } 43 | 44 | public MedicalWardIdDTO(WardDTO ward, MedicalDTO medical) { 45 | this.ward = ward; 46 | this.medical = medical; 47 | } 48 | 49 | public WardDTO getWard() { 50 | return this.ward; 51 | } 52 | 53 | public MedicalDTO getMedical() { 54 | return this.medical; 55 | } 56 | 57 | public void setWard(WardDTO ward) { 58 | this.ward = ward; 59 | } 60 | 61 | public void setMedical(MedicalDTO medical) { 62 | this.medical = medical; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/org/isf/medtype/dto/MedicalTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medtype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | public class MedicalTypeDTO { 29 | 30 | @NotNull 31 | @Schema(description = "Code of the medical type", example = "M", maxLength = 1) 32 | private String code; 33 | 34 | @NotNull 35 | @Schema(description = "Description of the medical type", example = "Medical material", maxLength = 30) 36 | private String description; 37 | 38 | public MedicalTypeDTO() { 39 | } 40 | 41 | public MedicalTypeDTO(String code, String description) { 42 | this.code = code; 43 | this.description = description; 44 | } 45 | 46 | public String getCode() { 47 | return this.code; 48 | } 49 | 50 | public String getDescription() { 51 | return this.description; 52 | } 53 | 54 | public void setCode(String code) { 55 | this.code = code; 56 | } 57 | 58 | public void setDescription(String description) { 59 | this.description = description; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/test/java/org/isf/pregtreattype/data/PregnantTreatmentTypeHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.pregtreattype.data; 23 | 24 | import java.util.List; 25 | import java.util.stream.Collectors; 26 | import java.util.stream.IntStream; 27 | 28 | import org.isf.pregtreattype.TestPregnantTreatmentType; 29 | import org.isf.pregtreattype.model.PregnantTreatmentType; 30 | import org.isf.utils.exception.OHException; 31 | 32 | public class PregnantTreatmentTypeHelper { 33 | 34 | public static PregnantTreatmentType setup() throws OHException { 35 | TestPregnantTreatmentType testPregnantTreatmentType = new TestPregnantTreatmentType(); 36 | return testPregnantTreatmentType.setup(false); 37 | } 38 | 39 | public static List setupPregnantTreatmentTypeList(int size) { 40 | return IntStream.range(0, size) 41 | .mapToObj(i -> { 42 | try { 43 | return PregnantTreatmentTypeHelper.setup(); 44 | } catch (OHException e) { 45 | e.printStackTrace(); 46 | } 47 | return null; 48 | }).collect(Collectors.toList()); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /rsc/settings.properties.dist: -------------------------------------------------------------------------------- 1 | ########################################### 2 | # This file contains Open Hospital settings 3 | ########################################### 4 | # external settings 5 | MODE=OH_MODE 6 | DEMODATA=off 7 | 8 | # experimental settings 9 | APISERVER=off 10 | 11 | # internal settings, modules, directories 12 | LANGUAGE=OH_LANGUAGE 13 | SINGLEUSER=YES_OR_NO 14 | DEBUG=no 15 | DOC_DIR=OH_DOC_DIR 16 | PATIENTPHOTOSTORAGE=PHOTO_DIR 17 | INTERNALVIEWER=yes 18 | SMSENABLED=no 19 | VIDEOMODULEENABLED=yes 20 | XMPPMODULEENABLED=no 21 | PARAMSURL=https://conf.open-hospital.org/oh-conf.json 22 | 23 | # application settings 24 | ENHANCEDSEARCH=no 25 | INTERNALPHARMACIES=yes 26 | LABEXTENDED=yes 27 | LABMULTIPLEINSERT=yes 28 | MATERNITYRESTARTINJUNE=no 29 | MERGEFUNCTION=yes 30 | OPDEXTENDED=yes 31 | PATIENTEXTENDED=yes 32 | PATIENTVACCINEEXTENDED=yes 33 | 34 | # GUI settings 35 | MAINMENUALWAYSONTOP=no 36 | 37 | # accounting 38 | ALLOWMULTIPLEOPENEDBILL=yes 39 | ALLOWPRINTOPENEDBILL=yes 40 | BILLSREPORT=BillsReport 41 | BILLSREPORTMONTHLY=BillsReportMonthly 42 | BILLSREPORTPENDING=BillsReportPending 43 | PATIENTBILL=PatientBill 44 | PATIENTBILLGROUPED=PatientBillGrouped 45 | PATIENTBILLSTATEMENT=PatientBillStatement 46 | RECEIPTPRINTER=yes 47 | 48 | # pharmacy 49 | AUTOMATICLOT_IN=no 50 | AUTOMATICLOT_OUT=no 51 | AUTOMATICLOTWARD_TOWARD=no 52 | LOTWITHCOST=yes 53 | PHARMACEUTICALORDER=PharmaceuticalOrder 54 | PHARMACEUTICALSTOCK=PharmaceuticalStock_ver4 55 | PHARMACEUTICALSTOCKLOT=PharmaceuticalStock_ver5 56 | PHARMACEUTICALAMC=PharmaceuticalAMC 57 | 58 | # dicom / imaging settings 59 | DICOMMODULEENABLED=yes 60 | DICOMTHUMBNAILS=yes 61 | 62 | # reports 63 | ADMCHART=patient_adm_chart 64 | DISCHART=patient_dis_chart 65 | EXAMINATIONCHART=patient_examination 66 | OPDCHART=patient_opd_chart 67 | PATIENTSHEET=patient_clinical_sheet_ver3 68 | VISITSHEET=WardVisits 69 | 70 | # security 71 | SESSIONTIMEOUT=5 72 | STRONGPASSWORD=yes 73 | STRONGLENGTH=6 74 | USERSLISTLOGIN=no 75 | PASSWORDTRIES=5 76 | PASSWORDLOCKTIME=60 77 | PASSWORDIDLE=365 78 | 79 | # telemetry 80 | TELEMETRYENABLED=yes -------------------------------------------------------------------------------- /src/main/java/org/isf/exatype/dto/ExamTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.exatype.dto; 23 | 24 | import io.swagger.v3.oas.annotations.media.Schema; 25 | 26 | public class ExamTypeDTO { 27 | 28 | @Schema(description = "Exam Type Code", example = "HB") 29 | private String code; 30 | 31 | @Schema(description = "Exam Type Description", example = "1.Haematology", maxLength = 50) 32 | private String description; 33 | 34 | public ExamTypeDTO() { 35 | } 36 | 37 | public ExamTypeDTO(String code, String description) { 38 | this.code = code; 39 | this.description = description; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return "ExamTypeDTO{" + "code='" + code + '\'' + ", description='" + description + '\'' + '}'; 45 | } 46 | 47 | public String getCode() { 48 | return this.code; 49 | } 50 | 51 | public String getDescription() { 52 | return this.description; 53 | } 54 | 55 | public void setCode(String code) { 56 | this.code = code; 57 | } 58 | 59 | public void setDescription(String description) { 60 | this.description = description; 61 | } 62 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/mapper/converter/BlobToByteArrayConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.shared.mapper.converter; 23 | 24 | import java.sql.Blob; 25 | import java.sql.SQLException; 26 | 27 | import org.modelmapper.AbstractConverter; 28 | import org.slf4j.Logger; 29 | import org.slf4j.LoggerFactory; 30 | import org.springframework.stereotype.Component; 31 | 32 | /** 33 | * @author akashytsa 34 | */ 35 | @Component 36 | public class BlobToByteArrayConverter extends AbstractConverter { 37 | 38 | private static final Logger LOGGER = LoggerFactory.getLogger(BlobToByteArrayConverter.class); 39 | 40 | @Override 41 | protected byte[] convert(Blob data){ 42 | byte[] blobAsBytes = new byte[0]; 43 | try { 44 | if (data != null) { 45 | int blobLength = (int) data.length(); 46 | blobAsBytes = data.getBytes(1, blobLength); 47 | data.free(); 48 | } 49 | } catch (SQLException e) { 50 | LOGGER.error("", e); 51 | } 52 | return blobAsBytes; 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/org/isf/patient/mapper/PatientMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.patient.mapper; 23 | 24 | import java.util.List; 25 | import java.util.stream.Collectors; 26 | 27 | import jakarta.annotation.PostConstruct; 28 | 29 | import org.isf.patient.dto.PatientDTO; 30 | import org.isf.patient.model.Patient; 31 | import org.isf.shared.GenericMapper; 32 | import org.isf.shared.mapper.mappings.PatientMapping; 33 | import org.springframework.stereotype.Component; 34 | 35 | @Component 36 | public class PatientMapper extends GenericMapper { 37 | 38 | public PatientMapper() { 39 | super(Patient.class, PatientDTO.class); 40 | } 41 | @PostConstruct 42 | private void postConstruct() { 43 | PatientMapping.addMapping(modelMapper); 44 | } 45 | 46 | @Override 47 | public List map2DTOList(List list) { 48 | return list.stream().map(it -> map2DTO(it)).collect(Collectors.toList()); 49 | } 50 | 51 | @Override 52 | public List map2ModelList(List list) { 53 | return list.stream().map(it -> map2Model(it)).collect(Collectors.toList()); 54 | } 55 | } -------------------------------------------------------------------------------- /src/main/java/org/isf/patconsensus/dto/PatientConsensusDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.patconsensus.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | @Schema(description = "Class representing a patient consensus") 29 | public class PatientConsensusDTO { 30 | 31 | @Schema(description = "Consensus flag") 32 | private boolean consensusFlag; 33 | 34 | @Schema(description = "Service flag") 35 | private boolean serviceFlag; 36 | 37 | @NotNull 38 | @Schema(description = "Patient id") 39 | private Integer patientId; 40 | 41 | public boolean isConsensusFlag() { 42 | return consensusFlag; 43 | } 44 | 45 | public void setConsensusFlag(boolean consensusFlag) { 46 | this.consensusFlag = consensusFlag; 47 | } 48 | 49 | public boolean isServiceFlag() { 50 | return serviceFlag; 51 | } 52 | 53 | public void setServiceFlag(boolean serviceFlag) { 54 | this.serviceFlag = serviceFlag; 55 | } 56 | 57 | public Integer getPatientId() { 58 | return patientId; 59 | } 60 | 61 | public void setPatientId(Integer patientId) { 62 | this.patientId = patientId; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/org/isf/accounting/dto/FullBillDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.accounting.dto; 23 | 24 | import java.util.List; 25 | 26 | import jakarta.validation.constraints.NotNull; 27 | 28 | import io.swagger.v3.oas.annotations.media.Schema; 29 | 30 | public class FullBillDTO { 31 | 32 | @NotNull 33 | @Schema(description = "Bill element") 34 | private BillDTO bill; 35 | 36 | @NotNull 37 | @Schema(description = "List of bill items elements") 38 | private List billItems; 39 | 40 | @Schema(description = "List of bill payments elements") 41 | private List billPayments; 42 | 43 | public BillDTO getBill() { 44 | return this.bill; 45 | } 46 | 47 | public List getBillItems() { 48 | return this.billItems; 49 | } 50 | 51 | public List getBillPayments() { 52 | return this.billPayments; 53 | } 54 | 55 | public void setBill(BillDTO bill) { 56 | this.bill = bill; 57 | } 58 | 59 | public void setBillItems(List billItems) { 60 | this.billItems = billItems; 61 | } 62 | 63 | public void setBillPayments(List billPayments) { 64 | this.billPayments = billPayments; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/org/isf/pregtreattype/dto/PregnantTreatmentTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.pregtreattype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | import io.swagger.v3.oas.annotations.media.Schema.AccessMode; 28 | 29 | @Schema(description = "Class representing a pregnant treatment type") 30 | public class PregnantTreatmentTypeDTO { 31 | 32 | @NotNull 33 | @Schema(description = "The code", maxLength = 10) 34 | private String code; 35 | 36 | @NotNull 37 | @Schema(description = "The description", maxLength = 50) 38 | private String description; 39 | 40 | private int hashCode; 41 | 42 | @Schema(accessMode = AccessMode.READ_ONLY) 43 | public int getHashCode() { 44 | return hashCode; 45 | } 46 | 47 | public String getCode() { 48 | return this.code; 49 | } 50 | 51 | public String getDescription() { 52 | return this.description; 53 | } 54 | 55 | public void setCode(String code) { 56 | this.code = code; 57 | } 58 | 59 | public void setDescription(String description) { 60 | this.description = description; 61 | } 62 | 63 | public void setHashCode(int hashCode) { 64 | this.hashCode = hashCode; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/org/isf/menu/rest/VersionService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.menu.rest; 23 | 24 | import java.io.IOException; 25 | import java.io.InputStream; 26 | import java.util.Properties; 27 | 28 | import jakarta.servlet.ServletContext; 29 | 30 | import org.springframework.stereotype.Service; 31 | 32 | @Service 33 | public class VersionService { 34 | 35 | private final ServletContext servletContext; 36 | 37 | public VersionService(ServletContext servletContext) { 38 | this.servletContext = servletContext; 39 | } 40 | 41 | public String getVersion() throws IOException { 42 | // Trying when using Spring Boot 43 | InputStream inputStream = getClass().getClassLoader().getResourceAsStream("META-INF/maven/org.isf/openhospital-api/pom.properties"); 44 | 45 | // Trying when deployed as WAR 46 | if (inputStream == null && servletContext != null) { 47 | inputStream = servletContext.getResourceAsStream("/META-INF/maven/org.isf/openhospital-api/pom.properties"); 48 | } 49 | 50 | if (inputStream == null) { 51 | throw new IOException("pom.properties not found in classpath or servlet context"); 52 | } 53 | 54 | Properties properties = new Properties(); 55 | properties.load(inputStream); 56 | 57 | return properties.getProperty("version"); 58 | } 59 | } -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | include .env 2 | SHELL=/bin/bash 3 | 4 | # The name of the file to be modified 5 | OH_APPLICATION_PROPERTIES = ./rsc/application.properties 6 | OH_DATABASE_PROPERTIES = ./rsc/database.properties 7 | OH_LOG4J_PROPERTIES = ./rsc/log4j2-spring.properties 8 | OH_SETTINGS = ./rsc/settings.properties 9 | 10 | .DEFAULT_GOAL = modify 11 | 12 | .PHONY: clean deps copy modify 13 | 14 | # Clean configuration 15 | clean-all: 16 | @echo "Clean configuration files and dependencies (deps)..." 17 | rm -rf deps $(OH_APPLICATION_PROPERTIES) $(OH_DATABASE_PROPERTIES) $(OH_LOG4J_PROPERTIES) $(OH_SETTINGS) 18 | 19 | clean: 20 | @echo "Clean configuration files..." 21 | rm -rf $(OH_APPLICATION_PROPERTIES) $(OH_DATABASE_PROPERTIES) $(OH_LOG4J_PROPERTIES) $(OH_SETTINGS) 22 | 23 | # create or update deps 24 | deps: 25 | @echo "Create or update dependencies (deps)..." 26 | @if [ -d "deps" ]; then \ 27 | cd deps; cd openhospital-core; git checkout $(OH_CORE_BRANCH); git pull; \ 28 | else \ 29 | mkdir deps && pushd deps && git clone --depth=1 -b ${OH_CORE_BRANCH} https://github.com/informatici/openhospital-core.git && popd; \ 30 | fi 31 | 32 | # Copy .dist 33 | copy: 34 | @echo "Copy configuration files..." 35 | cp $(OH_APPLICATION_PROPERTIES).dist $(OH_APPLICATION_PROPERTIES) 36 | cp $(OH_DATABASE_PROPERTIES).dist $(OH_DATABASE_PROPERTIES) 37 | cp $(OH_LOG4J_PROPERTIES).dist $(OH_LOG4J_PROPERTIES) 38 | cp $(OH_SETTINGS).dist $(OH_SETTINGS) 39 | 40 | # Modify copies 41 | modify: clean deps copy 42 | @echo "Set configuration files..." 43 | sed -i "s/JWT_TOKEN_SECRET/$(JWT_TOKEN_SECRET)/g" $(OH_APPLICATION_PROPERTIES) 44 | sed -i '0,/server.address=localhost/s/localhost/backend/' $(OH_APPLICATION_PROPERTIES) 45 | sed -i "s/API_HOST/${API_HOST}/g" $(OH_APPLICATION_PROPERTIES) 46 | sed -i "s/API_PORT/${API_PORT}/g" $(OH_APPLICATION_PROPERTIES) 47 | sed -i "s/UI_HOST/${UI_HOST}/g" $(OH_APPLICATION_PROPERTIES) 48 | sed -i "s/UI_PORT/${UI_PORT}/g" $(OH_APPLICATION_PROPERTIES) 49 | sed -i "s/localhost/database/g" $(OH_DATABASE_PROPERTIES) 50 | sed -i "s/oh/${OH_MARIADB_DATABASE}/g" $(OH_DATABASE_PROPERTIES) 51 | sed -i '0,/jdbc.username=isf/s/isf/${OH_MARIADB_USER}/' $(OH_DATABASE_PROPERTIES) 52 | sed -i '0,/jdbc.password=isf123/s/isf123/${OH_MARIADB_PASSWORD}/' $(OH_DATABASE_PROPERTIES) 53 | sed -i "s/LOG_DEST/logs/g" $(OH_LOG4J_PROPERTIES) 54 | 55 | -------------------------------------------------------------------------------- /src/main/java/org/isf/menu/dto/GroupMenuDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.menu.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | public class GroupMenuDTO { 29 | 30 | @Schema(description = "Code of the group menu", example = "1", maxLength = 50) 31 | private Integer code; 32 | 33 | @NotNull 34 | @Schema(description = "The related user group's code", example = "labo", maxLength = 50) 35 | private String userGroup; 36 | 37 | @NotNull 38 | @Schema(description = "The related menu item's code", example = "admtype") 39 | private String menuItem; 40 | 41 | public GroupMenuDTO() { 42 | } 43 | 44 | public GroupMenuDTO(Integer code, String userGroup, String menuItem) { 45 | this.code = code; 46 | this.userGroup = userGroup; 47 | this.menuItem = menuItem; 48 | } 49 | 50 | public Integer getCode() { 51 | return this.code; 52 | } 53 | 54 | public String getUserGroup() { 55 | return this.userGroup; 56 | } 57 | 58 | public String getMenuItem() { 59 | return this.menuItem; 60 | } 61 | 62 | public void setCode(Integer code) { 63 | this.code = code; 64 | } 65 | 66 | public void setUserGroup(String userGroup) { 67 | this.userGroup = userGroup; 68 | } 69 | 70 | public void setMenuItem(String menuItem) { 71 | this.menuItem = menuItem; 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/org/isf/menu/rest/RootController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.menu.rest; 23 | 24 | import java.io.IOException; 25 | import java.util.LinkedHashMap; 26 | import java.util.Map; 27 | 28 | import org.springframework.beans.factory.annotation.Autowired; 29 | import org.springframework.http.MediaType; 30 | import org.springframework.web.bind.annotation.GetMapping; 31 | import org.springframework.web.bind.annotation.RequestMapping; 32 | import org.springframework.web.bind.annotation.RestController; 33 | 34 | @RestController 35 | @RequestMapping(produces = MediaType.APPLICATION_JSON_VALUE) 36 | public class RootController { 37 | 38 | @Autowired 39 | private VersionService versionService; 40 | 41 | @GetMapping(value = "/") 42 | public Map root() { 43 | 44 | String version; 45 | try { 46 | version = versionService.getVersion(); 47 | } catch (IOException e) { 48 | version = "Unknown"; 49 | } 50 | 51 | Map response = new LinkedHashMap<>(); 52 | response.put("service", "Open Hospital API"); 53 | response.put("version", version); 54 | response.put("documentation", "/swagger-ui/index.html"); 55 | response.put("healthcheck", "/healthcheck"); 56 | return response; 57 | } 58 | 59 | @GetMapping(value = "/healthcheck") 60 | public Map healthcheck() { 61 | Map response = new LinkedHashMap<>(); 62 | response.put("status", "UP"); 63 | return response; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/org/isf/medstockmovtype/dto/MovementTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medstockmovtype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | public class MovementTypeDTO { 29 | 30 | @NotNull 31 | @Schema(description = "Code of the movement type", example = "D", maxLength = 10) 32 | private String code; 33 | 34 | @NotNull 35 | @Schema(description = "Description of the movement type", example = "Damage", maxLength = 50) 36 | private String description; 37 | 38 | @NotNull 39 | @Schema(description = "Type of the movement type", example = "-") 40 | private String type; 41 | 42 | public MovementTypeDTO() { 43 | } 44 | 45 | /** 46 | * @param code 47 | * @param description 48 | * @param type 49 | */ 50 | public MovementTypeDTO(String code, String description, String type) { 51 | this.code = code; 52 | this.description = description; 53 | this.type = type; 54 | } 55 | 56 | public String getCode() { 57 | return this.code; 58 | } 59 | 60 | public String getDescription() { 61 | return this.description; 62 | } 63 | 64 | public String getType() { 65 | return this.type; 66 | } 67 | 68 | public void setCode(String code) { 69 | this.code = code; 70 | } 71 | 72 | public void setDescription(String description) { 73 | this.description = description; 74 | } 75 | 76 | public void setType(String type) { 77 | this.type = type; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/mapper/mappings/PatientMapping.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.shared.mapper.mappings; 23 | 24 | import org.isf.patient.dto.PatientDTO; 25 | import org.isf.patient.model.Patient; 26 | import org.modelmapper.ModelMapper; 27 | 28 | public class PatientMapping { 29 | 30 | public static void addMapping(ModelMapper modelMapper) { 31 | 32 | modelMapper.getConfiguration().setAmbiguityIgnored(true); 33 | modelMapper.typeMap(Patient.class, PatientDTO.class).addMappings(mapper -> { 34 | mapper. map(src -> src.getPatientConsensus().isConsensusFlag(), PatientDTO::setConsensusFlag); 35 | mapper. map(src -> src.getPatientConsensus().isServiceFlag(), PatientDTO::setConsensusServiceFlag); 36 | mapper.map(src -> src.getPatientProfilePhoto().getPhoto(), PatientDTO::setBlobPhoto); 37 | }); 38 | 39 | modelMapper.typeMap(PatientDTO.class, Patient.class).addMappings(mapper -> { 40 | mapper. map(src -> src.isConsensusFlag(), (db, value) -> db.getPatientConsensus().setConsensusFlag(value)); 41 | mapper. map(src -> src.isConsensusServiceFlag(), (db, value) -> db.getPatientConsensus().setServiceFlag(value)); 42 | mapper. map(src -> src, (db, value) -> { 43 | db.getPatientConsensus().setPatient(value); 44 | }); 45 | mapper.map(src -> src.getBlobPhoto(), (destination, value) -> { 46 | destination.getPatientProfilePhoto().setPhoto((byte[]) value); 47 | }); 48 | }); 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/isf/login/dto/LoginResponse.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.login.dto; 23 | 24 | import io.swagger.v3.oas.annotations.media.Schema; 25 | 26 | @Schema(description = "Class representing a Login response") 27 | public class LoginResponse { 28 | 29 | @Schema(description = "Token") 30 | private String token; 31 | 32 | @Schema(description = "RefreshToken") 33 | private String refreshToken; 34 | 35 | @Schema(description = "Type of Token", example = "Bearer") 36 | private String type = "Bearer"; 37 | 38 | @Schema(description = "User name", example = "admin") 39 | private String username; 40 | 41 | public LoginResponse() { 42 | } 43 | 44 | public LoginResponse(String token, String refreshToken, String username) { 45 | this.token = token; 46 | this.refreshToken = refreshToken; 47 | this.username = username; 48 | } 49 | 50 | public String getToken() { 51 | return token; 52 | } 53 | 54 | public void setToken(String token) { 55 | this.token = token; 56 | } 57 | 58 | public String getRefreshToken() { 59 | return refreshToken; 60 | } 61 | 62 | public void setRefreshToken(String refreshToken) { 63 | this.refreshToken = refreshToken; 64 | } 65 | 66 | public String getType() { 67 | return type; 68 | } 69 | 70 | public void setType(String type) { 71 | this.type = type; 72 | } 73 | 74 | public String getUsername() { 75 | return username; 76 | } 77 | 78 | public void setUsername(String username) { 79 | this.username = username; 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/org/isf/medicalstockward/dto/MedicalWardDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.medicalstockward.dto; 23 | 24 | import io.swagger.v3.oas.annotations.media.Schema; 25 | 26 | public class MedicalWardDTO { 27 | 28 | @Schema(description = "The medical ward's id", example = "1") 29 | private MedicalWardIdDTO id; 30 | 31 | @Schema(description = "The in-quantity", example = "150") 32 | private float in_quantity; 33 | 34 | @Schema(description = "The out-quantity", example = "89") 35 | private float out_quantity; 36 | 37 | @Schema(description = "Lock", example = "0") 38 | private int lock; 39 | 40 | public MedicalWardDTO() { 41 | } 42 | 43 | public MedicalWardDTO(MedicalWardIdDTO id, float in_quantity, float out_quantity) { 44 | this.id = id; 45 | this.in_quantity = in_quantity; 46 | this.out_quantity = out_quantity; 47 | } 48 | 49 | public MedicalWardIdDTO getId() { 50 | return this.id; 51 | } 52 | 53 | public float getIn_quantity() { 54 | return this.in_quantity; 55 | } 56 | 57 | public float getOut_quantity() { 58 | return this.out_quantity; 59 | } 60 | 61 | public void setId(MedicalWardIdDTO id) { 62 | this.id = id; 63 | } 64 | 65 | public void setIn_quantity(float in_quantity) { 66 | this.in_quantity = in_quantity; 67 | } 68 | 69 | public void setOut_quantity(float out_quantity) { 70 | this.out_quantity = out_quantity; 71 | } 72 | 73 | public int getLock() { 74 | return lock; 75 | } 76 | public void setLock(int lock) { 77 | this.lock = lock; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/org/isf/patconsensus/mapper/PatientConsensusMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.patconsensus.mapper; 23 | 24 | import jakarta.annotation.PostConstruct; 25 | 26 | import org.isf.patconsensus.dto.PatientConsensusDTO; 27 | import org.isf.patconsensus.model.PatientConsensus; 28 | import org.isf.patient.model.Patient; 29 | import org.isf.shared.GenericMapper; 30 | import org.isf.shared.mapper.mappings.PatientMapping; 31 | import org.springframework.stereotype.Component; 32 | 33 | @Component 34 | public class PatientConsensusMapper extends GenericMapper { 35 | 36 | public PatientConsensusMapper() { 37 | super(PatientConsensus.class, PatientConsensusDTO.class); 38 | } 39 | 40 | @PostConstruct 41 | private void postConstruct() { 42 | PatientMapping.addMapping(modelMapper); 43 | } 44 | 45 | @Override 46 | public PatientConsensus map2Model(PatientConsensusDTO fromObj) { 47 | PatientConsensus patientConsensus = super.map2Model(fromObj); 48 | if (fromObj.getPatientId() != null) { 49 | Patient patient = new Patient(); 50 | patient.setCode(fromObj.getPatientId()); 51 | patientConsensus.setPatient(patient); 52 | } 53 | return patientConsensus; 54 | } 55 | 56 | @Override 57 | public PatientConsensusDTO map2DTO(PatientConsensus fromObj) { 58 | PatientConsensusDTO patientConsensus = super.map2DTO(fromObj); 59 | if (fromObj.getPatient() != null) { 60 | patientConsensus.setPatientId(fromObj.getPatient().getCode()); 61 | } 62 | return patientConsensus; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/org/isf/security/CustomAuthenticationManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.security; 23 | 24 | import org.springframework.beans.factory.annotation.Autowired; 25 | import org.springframework.security.authentication.AuthenticationManager; 26 | import org.springframework.security.authentication.BadCredentialsException; 27 | import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; 28 | import org.springframework.security.core.Authentication; 29 | import org.springframework.security.core.AuthenticationException; 30 | import org.springframework.security.core.userdetails.UserDetails; 31 | import org.springframework.security.crypto.password.PasswordEncoder; 32 | import org.springframework.stereotype.Component; 33 | 34 | @Component 35 | public class CustomAuthenticationManager implements AuthenticationManager { 36 | 37 | @Autowired 38 | private UserDetailsServiceImpl customUserDetailsService; 39 | 40 | @Autowired 41 | private PasswordEncoder passwordEncoder; 42 | 43 | @Override 44 | public Authentication authenticate(Authentication authentication) throws AuthenticationException { 45 | final UserDetails userDetail = customUserDetailsService.loadUserByUsername(authentication.getName()); 46 | if (!passwordEncoder.matches(authentication.getCredentials().toString(), userDetail.getPassword())) { 47 | throw new BadCredentialsException("Wrong password"); 48 | } 49 | return new UsernamePasswordAuthenticationToken(userDetail.getUsername(), userDetail.getPassword(), userDetail.getAuthorities()); 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/org/isf/accounting/data/BillDTOHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.accounting.data; 23 | 24 | import java.util.List; 25 | 26 | import org.isf.accounting.dto.BillDTO; 27 | import org.isf.patient.TestPatient; 28 | import org.isf.patient.dto.PatientDTO; 29 | import org.isf.patient.mapper.PatientMapper; 30 | import org.isf.patient.model.Patient; 31 | import org.isf.utils.exception.OHException; 32 | 33 | import com.fasterxml.jackson.core.JsonProcessingException; 34 | 35 | public class BillDTOHelper { 36 | 37 | public static BillDTO setup(PatientMapper patientMapper) throws OHException { 38 | Patient patient = new TestPatient().setup(true); 39 | PatientDTO patientDTO = patientMapper.map2DTO(patient); 40 | BillDTO billDTO = new BillDTO(); 41 | billDTO.setPatient(patientDTO); 42 | return billDTO; 43 | } 44 | 45 | public static BillDTO setup(Integer id, PatientMapper patientMapper) throws OHException { 46 | BillDTO billDTO = BillDTOHelper.setup(patientMapper); 47 | billDTO.setId(id); 48 | return billDTO; 49 | } 50 | 51 | public static String asJsonString(BillDTO billDTO) { 52 | try { 53 | return BillHelper.getObjectMapper().writeValueAsString(billDTO); 54 | } catch (JsonProcessingException e) { 55 | e.printStackTrace(); 56 | } 57 | return null; 58 | } 59 | 60 | public static String asJsonString(List billDTOList) { 61 | try { 62 | return BillHelper.getObjectMapper().writeValueAsString(billDTOList); 63 | } catch (JsonProcessingException e) { 64 | e.printStackTrace(); 65 | } 66 | return null; 67 | } 68 | } -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | services: 3 | database: 4 | build: 5 | context: ./deps/openhospital-core 6 | dockerfile: Dockerfile-ohdb 7 | args: 8 | OH_DB_LANG: ${OH_DB_LANG} 9 | image: oh-core_database:latest 10 | ports: 11 | - "${OH_MARIADB_PORT}:3306" 12 | command: mysqld --sql_mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION" --lower_case_table_names=1 --explicit_defaults_for_timestamp=OFF 13 | environment: 14 | MARIADB_DATABASE: ${OH_MARIADB_DATABASE} 15 | MARIADB_ROOT_PASSWORD: ${OH_MARIADB_ROOT_PASSWORD} 16 | MARIADB_USER: ${OH_MARIADB_USER} 17 | MARIADB_PASSWORD: ${OH_MARIADB_PASSWORD} 18 | networks: 19 | - hospital-net 20 | restart: unless-stopped 21 | 22 | oh-database-init: 23 | image: oh-core_database:latest 24 | command: > 25 | sh -c "mysql -v --host database -u ${OH_MARIADB_USER} -p${OH_MARIADB_PASSWORD} ${OH_MARIADB_DATABASE} < /database-sources/delete_all_data.sql && 26 | mysql -v --host database -u ${OH_MARIADB_USER} -p${OH_MARIADB_PASSWORD} ${OH_MARIADB_DATABASE} < /database-sources/load_demo_data.sql" 27 | depends_on: 28 | - database 29 | working_dir: /database-sources 30 | environment: 31 | MARIADB_MYSQL_LOCALHOST_USER: "true" 32 | MARIADB_DATABASE: ${OH_MARIADB_DATABASE} 33 | MARIADB_ROOT_PASSWORD: ${OH_MARIADB_ROOT_PASSWORD} 34 | MARIADB_USER: ${OH_MARIADB_USER} 35 | MARIADB_PASSWORD: ${OH_MARIADB_PASSWORD} 36 | volumes: 37 | - ./deps/openhospital-core/sql:/database-sources # /docker-entrypoint-initdb.d 38 | networks: 39 | - hospital-net 40 | 41 | backend: 42 | container_name: backend 43 | build: 44 | context: . 45 | dockerfile: Dockerfile.backend 46 | args: 47 | OH_CORE_BRANCH: ${OH_CORE_BRANCH} 48 | OH_API_BRANCH: ${OH_API_BRANCH} 49 | GITHUB_ORG: ${GITHUB_ORG} 50 | restart: always 51 | ports: 52 | - "${API_PORT}:8080" 53 | depends_on: 54 | - database 55 | environment: 56 | SPRING_DATASOURCE_URL: jdbc:mariadb://database:3306/${OH_MARIADB_DATABASE} 57 | SPRING_DATASOURCE_USERNAME: ${OH_MARIADB_USER} 58 | SPRING_DATASOURCE_PASSWORD: ${OH_MARIADB_PASSWORD} 59 | logging: 60 | driver: "json-file" 61 | options: 62 | max-size: "100m" 63 | max-file: "10" 64 | networks: 65 | - hospital-net 66 | 67 | networks: 68 | hospital-net: 69 | driver: bridge 70 | -------------------------------------------------------------------------------- /src/main/java/org/isf/agetype/dto/AgeTypeDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.agetype.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | @Schema(description = "Class representing an age type which is typically a range") 29 | public class AgeTypeDTO { 30 | 31 | @Schema(description = "Age type code") 32 | private String code; 33 | 34 | @NotNull 35 | @Schema(description = "Age type description", maxLength = 100) 36 | private String description; 37 | 38 | @NotNull 39 | @Schema(description = "The minimum value of the range", example = "0") 40 | private int from; 41 | 42 | @Schema(description = "Lock", example = "0") 43 | private int lock; 44 | 45 | @NotNull 46 | @Schema(description = "The maximum value of the range", example = "0") 47 | private int to; 48 | 49 | public String getCode() { 50 | return this.code; 51 | } 52 | 53 | public String getDescription() { 54 | return this.description; 55 | } 56 | 57 | public int getFrom() { 58 | return this.from; 59 | } 60 | 61 | public int getTo() { 62 | return this.to; 63 | } 64 | 65 | public void setCode(String code) { 66 | this.code = code; 67 | } 68 | 69 | public void setDescription(String description) { 70 | this.description = description; 71 | } 72 | 73 | public void setFrom(int from) { 74 | this.from = from; 75 | } 76 | 77 | public void setTo(int to) { 78 | this.to = to; 79 | } 80 | 81 | public int getLock() { 82 | return lock; 83 | } 84 | 85 | public void setLock(int lock) { 86 | this.lock = lock; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/main/java/org/isf/shared/pagination/PageInfoDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2023 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.shared.pagination; 23 | 24 | public class PageInfoDTO { 25 | 26 | int size; 27 | int page; 28 | int nbOfElements; 29 | long totalPages; 30 | long totalNbOfElements ; 31 | boolean hasPreviousPage; 32 | boolean hasNextPage; 33 | 34 | public PageInfoDTO() { 35 | } 36 | 37 | public int getSize() { 38 | return size; 39 | } 40 | 41 | public void setSize(int size) { 42 | this.size = size; 43 | } 44 | 45 | public int getPage() { 46 | return page; 47 | } 48 | 49 | public void setPage(int page) { 50 | this.page = page; 51 | } 52 | 53 | public int getNbOfElements() { 54 | return nbOfElements; 55 | } 56 | 57 | public void setNbOfElements(int nbOfElements) { 58 | this.nbOfElements = nbOfElements; 59 | } 60 | 61 | public long getTotalPages() { 62 | return totalPages; 63 | } 64 | 65 | public void setTotalPages(long l) { 66 | this.totalPages = l; 67 | } 68 | 69 | public long getTotalNbOfElements() { 70 | return totalNbOfElements; 71 | } 72 | 73 | public void setTotalNbOfElements(long totalNbOfElements) { 74 | this.totalNbOfElements = totalNbOfElements; 75 | } 76 | 77 | public boolean isHasPreviousPage() { 78 | return hasPreviousPage; 79 | } 80 | 81 | public void setHasPreviousPage(boolean hasPreviousPage) { 82 | this.hasPreviousPage = hasPreviousPage; 83 | } 84 | 85 | public boolean isHasNextPage() { 86 | return hasNextPage; 87 | } 88 | 89 | public void setHasNextPage(boolean hasNextPage) { 90 | this.hasNextPage = hasNextPage; 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/org/isf/usersettings/dto/UserSettingDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.usersettings.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import io.swagger.v3.oas.annotations.media.Schema; 27 | 28 | public class UserSettingDTO { 29 | 30 | @NotNull 31 | @Schema(description = "The id of the setting (must be unique)", example = "1") 32 | private int id; 33 | 34 | @NotNull 35 | @Schema(description = "The name of the setting", example = "dashboard", maxLength = 50) 36 | private String configName; 37 | 38 | @NotNull 39 | @Schema(description = "The name of the user", example = "admin") 40 | private String user; 41 | 42 | @NotNull 43 | @Schema(description = "The value of the user", maxLength = 65535) 44 | private String configValue; 45 | 46 | @Schema(description = "Lock", example = "0") 47 | private int lock; 48 | 49 | public int getId() { 50 | return id; 51 | } 52 | 53 | public void setId(int id) { 54 | this.id = id; 55 | } 56 | 57 | public String getConfigName() { 58 | return configName; 59 | } 60 | 61 | public void setConfigName(String configName) { 62 | this.configName = configName; 63 | } 64 | 65 | public String getConfigValue() { 66 | return configValue; 67 | } 68 | 69 | public void setConfigValue(String configValue) { 70 | this.configValue = configValue; 71 | } 72 | 73 | public String getUser() { 74 | return user; 75 | } 76 | 77 | public void setUser(String user) { 78 | this.user = user; 79 | } 80 | 81 | public int getLock() { 82 | return lock; 83 | } 84 | 85 | public void setLock(int lock) { 86 | this.lock = lock; 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/test/java/org/isf/accounting/data/BillItemsDTOHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.accounting.data; 23 | 24 | import java.util.List; 25 | import java.util.stream.Collectors; 26 | 27 | import org.isf.accounting.TestBillItems; 28 | import org.isf.accounting.dto.BillItemsDTO; 29 | import org.isf.accounting.mapper.BillItemsMapper; 30 | import org.isf.accounting.model.Bill; 31 | import org.isf.accounting.model.BillItems; 32 | import org.isf.utils.exception.OHException; 33 | 34 | import com.fasterxml.jackson.core.JsonProcessingException; 35 | 36 | public class BillItemsDTOHelper { 37 | 38 | public static BillItemsDTO setup(BillItemsMapper billItemsMapper) throws OHException { 39 | Bill bill = BillHelper.setup(); 40 | TestBillItems tbi = new TestBillItems(); 41 | BillItems billItems = tbi.setup(bill, false); 42 | return billItemsMapper.map2DTO(billItems); 43 | } 44 | 45 | public static String asJsonString(BillItemsDTO billItemsDTO) { 46 | try { 47 | return BillHelper.getObjectMapper().writeValueAsString(billItemsDTO); 48 | } catch (JsonProcessingException e) { 49 | e.printStackTrace(); 50 | } 51 | return null; 52 | } 53 | 54 | public static String asJsonString(List billItemsDTOList) { 55 | try { 56 | return BillHelper.getObjectMapper().writeValueAsString(billItemsDTOList); 57 | } catch (JsonProcessingException e) { 58 | e.printStackTrace(); 59 | } 60 | return null; 61 | } 62 | 63 | public static List toModelList(List billItemsDTOList, BillItemsMapper billItemsMapper) { 64 | return billItemsDTOList.stream().map(billItemsMapper::map2Model).collect(Collectors.toList()); 65 | } 66 | 67 | } -------------------------------------------------------------------------------- /rsc/log4j2-spring.properties.dist: -------------------------------------------------------------------------------- 1 | 2 | status = INFO 3 | rootLogger.level = INFO 4 | rootLogger.appenderRef.console.ref = STDOUT 5 | rootLogger.appenderRef.rolling.ref = RollingFile 6 | 7 | # Direct log messages to STDOUT 8 | appender.console.type = Console 9 | appender.console.name = STDOUT 10 | appender.console.layout.type = PatternLayout 11 | appender.console.layout.pattern = [%d{dd/MMM/yyyy HH:mm:ss}] [%X{OHUserGroup}:%X{OHUser}] %-p - %m%n 12 | 13 | # File Appender (with classes), daily rotation 14 | appender.rolling.type = RollingFile 15 | appender.rolling.name = RollingFile 16 | appender.rolling.fileName= LOG_DEST/openhospital.log 17 | appender.rolling.filePattern= LOG_DEST/openhospital.log.%d{yyyy-MM-dd} 18 | appender.rolling.layout.type = PatternLayout 19 | appender.rolling.layout.pattern = [%d{dd/MMM/yyyy HH:mm:ss}] [%X{OHUserGroup}:%X{OHUser}] %-p - %m (%l)%n 20 | appender.rolling.policies.type = Policies 21 | # To change log file every day 22 | appender.rolling.policies.time.type = TimeBasedTriggeringPolicy 23 | appender.rolling.policies.time.interval = 1 24 | appender.rolling.policies.time.modulate = true 25 | 26 | 27 | # DB Appender (table columns) 28 | appender.jdbc.type = JDBC 29 | appender.jdbc.name = jdbc 30 | appender.jdbc.connectionSource.driverClassName = org.mariadb.jdbc.Driver 31 | appender.jdbc.connectionSource.type = DriverManager 32 | appender.jdbc.connectionSource.connectionString = dbc:mariadb://DBSERVER:DBPORT/DBNAME?autoReconnect=true 33 | appender.jdbc.connectionSource.userName = DBUSER 34 | appender.jdbc.connectionSource.password = DBPASS 35 | appender.jdbc.tableName = logs 36 | appender.jdbc.ignoreExceptions = false 37 | appender.jdbc.columnConfigs[0].type = COLUMN 38 | appender.jdbc.columnConfigs[0].name = LOG_TIME 39 | appender.jdbc.columnConfigs[0].pattern = %d 40 | appender.jdbc.columnConfigs[0].isUnicode = false 41 | appender.jdbc.columnConfigs[1].type = COLUMN 42 | appender.jdbc.columnConfigs[1].name = LOG_LEVEL 43 | appender.jdbc.columnConfigs[1].pattern = %5p 44 | appender.jdbc.columnConfigs[1].isUnicode = false 45 | appender.jdbc.columnConfigs[2].type = COLUMN 46 | appender.jdbc.columnConfigs[2].name = MESSAGE 47 | appender.jdbc.columnConfigs[2].pattern = %mm%ex%n 48 | appender.jdbc.columnConfigs[2].isUnicode = false 49 | 50 | 51 | # Assigning appenders to Hibernate packages (DB loggers) 52 | # - hibernate.SQL to DEBUG for SQL queries to be logged 53 | # - hibernate.type to TRACE for queries parameters to be logged with "binding parameter [?]" 54 | ##logger.hibernate-SQL.name=org.hibernate.SQL 55 | ##logger.hibernate-SQL.level=DEBUG 56 | ## 57 | ##logger.hibernate-type.name=org.hibernate.orm.jdbc.bind 58 | ##logger.hibernate-type.level=TRACE 59 | -------------------------------------------------------------------------------- /src/main/java/org/isf/vaccine/dto/VaccineDTO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Open Hospital (www.open-hospital.org) 3 | * Copyright © 2006-2025 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) 4 | * 5 | * Open Hospital is a free and open source software for healthcare data management. 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * https://www.gnu.org/licenses/gpl-3.0-standalone.html 13 | * 14 | * This program is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with this program. If not, see . 21 | */ 22 | package org.isf.vaccine.dto; 23 | 24 | import jakarta.validation.constraints.NotNull; 25 | 26 | import org.isf.vactype.dto.VaccineTypeDTO; 27 | 28 | import io.swagger.v3.oas.annotations.media.Schema; 29 | 30 | @Schema(description = "Class representing a vaccine") 31 | public class VaccineDTO { 32 | 33 | @NotNull 34 | @Schema(description = "Code of the vaccine", example = "1", maxLength = 10) 35 | private String code; 36 | 37 | @NotNull 38 | @Schema(description = "Description of the vaccine", example = "BCG", maxLength = 50) 39 | private String description; 40 | 41 | @NotNull 42 | @Schema(description = "Type of the vaccine") 43 | private VaccineTypeDTO vaccineType; 44 | 45 | @Schema(description = "Lock", example = "0") 46 | private int lock; 47 | 48 | @Override 49 | public String toString() { 50 | return "VaccineDTO{" + "code='" + code + '\'' + ", description='" + description + '\'' + ", vaccineType=" 51 | + vaccineType + '}'; 52 | } 53 | 54 | public int getLock() { 55 | return lock; 56 | } 57 | 58 | public void setLock(int lock) { 59 | this.lock = lock; 60 | } 61 | 62 | public String getCode() { 63 | return this.code; 64 | } 65 | 66 | public String getDescription() { 67 | return this.description; 68 | } 69 | 70 | public VaccineTypeDTO getVaccineType() { 71 | return this.vaccineType; 72 | } 73 | 74 | public void setCode(String code) { 75 | this.code = code; 76 | } 77 | 78 | public void setDescription(String description) { 79 | this.description = description; 80 | } 81 | 82 | public void setVaccineType(VaccineTypeDTO vaccineType) { 83 | this.vaccineType = vaccineType; 84 | } 85 | } 86 | --------------------------------------------------------------------------------