diff --git a/.ide-settings/idea/OpenHospital-code-style-configuration.xml b/.ide-settings/idea/OpenHospital-code-style-configuration.xml index 87a358cd6..fae17a9fc 100644 --- a/.ide-settings/idea/OpenHospital-code-style-configuration.xml +++ b/.ide-settings/idea/OpenHospital-code-style-configuration.xml @@ -1,80 +1,80 @@ - \ No newline at end of file diff --git a/openapi/oh.yaml b/openapi/oh.yaml index dced99431..c34eafd19 100644 --- a/openapi/oh.yaml +++ b/openapi/oh.yaml @@ -9,14 +9,14 @@ info: url: https://github.com/informatici/openhospital-api?tab=GPL-3.0-1-ov-file#readme version: 0.1.0 servers: -- url: http://localhost:8080 + - url: http://localhost:8080 security: -- bearerAuth: [] + - bearerAuth: [ ] paths: /wards: get: tags: - - Wards + - Wards operationId: getWards responses: "200": @@ -28,10 +28,10 @@ paths: items: $ref: '#/components/schemas/WardDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Wards + - Wards operationId: updateWard requestBody: content: @@ -47,10 +47,10 @@ paths: schema: $ref: '#/components/schemas/WardDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Wards + - Wards operationId: newWard requestBody: content: @@ -66,19 +66,19 @@ paths: schema: $ref: '#/components/schemas/WardDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /visits/{visitID}: put: tags: - - Visit + - Visit operationId: updateVisit parameters: - - name: visitID - in: path - required: true - schema: - type: integer - format: int32 + - name: visitID + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -93,11 +93,11 @@ paths: schema: $ref: '#/components/schemas/VisitDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /vaccinetypes: get: tags: - - Vaccine Type + - Vaccine Type operationId: getVaccineType responses: "200": @@ -109,10 +109,10 @@ paths: items: $ref: '#/components/schemas/VaccineTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Vaccine Type + - Vaccine Type operationId: updateVaccineType requestBody: content: @@ -128,10 +128,10 @@ paths: schema: $ref: '#/components/schemas/VaccineTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Vaccine Type + - Vaccine Type operationId: newVaccineType requestBody: content: @@ -147,11 +147,11 @@ paths: schema: $ref: '#/components/schemas/VaccineTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /vaccines: get: tags: - - Vaccines + - Vaccines operationId: getVaccines responses: "200": @@ -163,10 +163,10 @@ paths: items: $ref: '#/components/schemas/VaccineDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Vaccines + - Vaccines operationId: updateVaccine requestBody: content: @@ -182,10 +182,10 @@ paths: schema: $ref: '#/components/schemas/VaccineDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Vaccines + - Vaccines operationId: newVaccine requestBody: content: @@ -201,19 +201,19 @@ paths: schema: $ref: '#/components/schemas/VaccineDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /usersettings/{id}: put: tags: - - User Settings + - User Settings operationId: updateUserSettings parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -228,34 +228,34 @@ paths: schema: $ref: '#/components/schemas/UserSettingDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - User Settings + - User Settings operationId: deleteUserSetting parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "204": description: No Content security: - - bearerAuth: [] + - bearerAuth: [ ] /users/{username}: get: tags: - - Users + - Users operationId: getUserByName parameters: - - name: username - in: path - required: true - schema: - type: string + - name: username + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -264,17 +264,17 @@ paths: schema: $ref: '#/components/schemas/UserDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Users + - Users operationId: updateUser parameters: - - name: username - in: path - required: true - schema: - type: string + - name: username + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -289,26 +289,26 @@ paths: schema: $ref: '#/components/schemas/UserDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Users + - Users operationId: deleteUser parameters: - - name: username - in: path - required: true - schema: - type: string + - name: username + in: path + required: true + schema: + type: string responses: "204": description: No Content security: - - bearerAuth: [] + - bearerAuth: [ ] /users/me: get: tags: - - Users + - Users operationId: retrieveProfileByCurrentLoggedInUser responses: "200": @@ -318,10 +318,10 @@ paths: schema: $ref: '#/components/schemas/UserProfileDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Users + - Users operationId: updateProfile requestBody: content: @@ -337,18 +337,18 @@ paths: schema: $ref: '#/components/schemas/UserProfileDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /usergroups/{group_code}: get: tags: - - User Groups + - User Groups operationId: getUserGroup parameters: - - name: group_code - in: path - required: true - schema: - type: string + - name: group_code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -357,17 +357,17 @@ paths: schema: $ref: '#/components/schemas/UserGroupDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - User Groups + - User Groups operationId: updateUserGroup parameters: - - name: group_code - in: path - required: true - schema: - type: string + - name: group_code + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -382,34 +382,89 @@ paths: schema: $ref: '#/components/schemas/UserGroupDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - User Groups + - User Groups operationId: deleteGroup parameters: - - name: group_code - in: path - required: true - schema: - type: string + - name: group_code + in: path + required: true + schema: + type: string responses: "204": description: No Content security: - - bearerAuth: [] + - bearerAuth: [ ] + /usergroups/{group_code}/permissions: + put: + tags: + - User Groups + operationId: updateGroupPermissions + parameters: + - name: group_code + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GroupPermissionsDTO' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PermissionDTO' + security: + - bearerAuth: [ ] + patch: + tags: + - User Groups + operationId: replaceGroupPermissions + parameters: + - name: group_code + in: path + required: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GroupPermissionsDTO' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PermissionDTO' + security: + - bearerAuth: [ ] /suppliers: get: tags: - - Suppliers + - Suppliers operationId: getSuppliers parameters: - - name: exclude_deleted - in: query - required: false - schema: - type: boolean - default: true + - name: exclude_deleted + in: query + required: false + schema: + type: boolean + default: true responses: "200": description: OK @@ -420,10 +475,10 @@ paths: items: $ref: '#/components/schemas/SupplierDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Suppliers + - Suppliers operationId: updateSupplier requestBody: content: @@ -439,10 +494,10 @@ paths: schema: $ref: '#/components/schemas/SupplierDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Suppliers + - Suppliers operationId: saveSupplier requestBody: content: @@ -458,19 +513,19 @@ paths: schema: $ref: '#/components/schemas/SupplierDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /pricesothers/{id}: put: tags: - - Others Price + - Others Price operationId: updatePricesOthers parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -485,18 +540,18 @@ paths: schema: $ref: '#/components/schemas/PricesOthersDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Others Price + - Others Price operationId: deletePricesOthers parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -505,19 +560,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /pricelists/{id}: put: tags: - - Price Lists + - Price Lists operationId: updatePriceLists parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -532,18 +587,18 @@ paths: schema: $ref: '#/components/schemas/PriceListDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Price Lists + - Price Lists operationId: deletePriceList parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -552,18 +607,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /pregnanttreatmenttypes/{code}: put: tags: - - Pregnant Treatment Types + - Pregnant Treatment Types operationId: updatePregnantTreatmentTypes parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -578,17 +633,17 @@ paths: schema: $ref: '#/components/schemas/PregnantTreatmentTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Pregnant Treatment Types + - Pregnant Treatment Types operationId: deletePregnantTreatmentType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -597,19 +652,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /patientvaccines/{code}: put: tags: - - Patient Vaccines + - Patient Vaccines operationId: updatePatientVaccinet parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -624,18 +679,18 @@ paths: schema: $ref: '#/components/schemas/PatientVaccineDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Patient Vaccines + - Patient Vaccines operationId: deletePatientVaccine parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -644,19 +699,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /patients/{code}: get: tags: - - Patients + - Patients operationId: getPatient parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -665,18 +720,18 @@ paths: schema: $ref: '#/components/schemas/PatientDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Patients + - Patients operationId: updatePatient parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -691,18 +746,18 @@ paths: schema: $ref: '#/components/schemas/PatientDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Patients + - Patients operationId: deletePatient parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -711,19 +766,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /patientconsensus/{patientId}: get: tags: - - Patient Consensus + - Patient Consensus operationId: getPatientConsensus parameters: - - name: patientId - in: path - required: true - schema: - type: integer - format: int32 + - name: patientId + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -732,18 +787,18 @@ paths: schema: $ref: '#/components/schemas/PatientConsensusDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Patient Consensus + - Patient Consensus operationId: updatePatientConsensus parameters: - - name: patientId - in: path - required: true - schema: - type: integer - format: int32 + - name: patientId + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -758,18 +813,18 @@ paths: schema: $ref: '#/components/schemas/PatientConsensusDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /operationtypes/{code}: put: tags: - - Operations Types + - Operations Types operationId: updateOperationTypes parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -784,17 +839,17 @@ paths: schema: $ref: '#/components/schemas/OperationTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Operations Types + - Operations Types operationId: deleteOperationType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -803,18 +858,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /operations/{code}: get: tags: - - Operations + - Operations operationId: getOperationByCode parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -823,17 +878,17 @@ paths: schema: $ref: '#/components/schemas/OperationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Operations + - Operations operationId: updateOperation parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -848,17 +903,17 @@ paths: schema: $ref: '#/components/schemas/OperationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Operations + - Operations operationId: deleteOperation parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -867,11 +922,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /operations/rows: put: tags: - - Operations + - Operations operationId: updateOperationRow requestBody: content: @@ -888,10 +943,10 @@ paths: type: integer format: int32 security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Operations + - Operations operationId: newOperationRow requestBody: content: @@ -907,19 +962,19 @@ paths: schema: $ref: '#/components/schemas/OperationRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /opds/{code}: put: tags: - - Opds + - Opds operationId: updateOpd parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -934,18 +989,18 @@ paths: schema: $ref: '#/components/schemas/OpdDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Opds + - Opds operationId: deleteOpd parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -954,19 +1009,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /opds/rows/{code}: put: tags: - - Opds + - Opds operationId: updateOpdWithOperationRow parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -981,11 +1036,11 @@ paths: schema: $ref: '#/components/schemas/OpdWithOperationRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medstockmovementtypes: get: tags: - - Medical Stock Movement Type + - Medical Stock Movement Type operationId: getMedicalDsrStockMovementType responses: "200": @@ -997,10 +1052,10 @@ paths: items: $ref: '#/components/schemas/MovementTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Medical Stock Movement Type + - Medical Stock Movement Type operationId: updateMedicalDsrStockMovementType requestBody: content: @@ -1016,10 +1071,10 @@ paths: schema: $ref: '#/components/schemas/MovementTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Medical Stock Movement Type + - Medical Stock Movement Type operationId: newMedicalDsrStockMovementType requestBody: content: @@ -1035,11 +1090,11 @@ paths: schema: $ref: '#/components/schemas/MovementTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicaltypes: get: tags: - - Medical Types + - Medical Types operationId: getMedicalTypes responses: "200": @@ -1051,10 +1106,10 @@ paths: items: $ref: '#/components/schemas/MedicalTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Medical Types + - Medical Types operationId: updateMedicalType requestBody: content: @@ -1070,10 +1125,10 @@ paths: schema: $ref: '#/components/schemas/MedicalTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Medical Types + - Medical Types operationId: createMedicalType requestBody: content: @@ -1089,22 +1144,22 @@ paths: schema: $ref: '#/components/schemas/MedicalTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicals: get: tags: - - Medicals + - Medicals operationId: getMedicals parameters: - - name: sort_by - in: query - required: false - schema: - type: string - enum: - - NONE - - CODE - - NAME + - name: sort_by + in: query + required: false + schema: + type: string + enum: + - NONE + - CODE + - NAME responses: "200": description: OK @@ -1115,18 +1170,18 @@ paths: items: $ref: '#/components/schemas/MedicalDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Medicals + - Medicals operationId: updateMedical parameters: - - name: ignore_similar - in: query - required: false - schema: - type: boolean - default: false + - name: ignore_similar + in: query + required: false + schema: + type: boolean + default: false requestBody: content: application/json: @@ -1141,18 +1196,18 @@ paths: schema: $ref: '#/components/schemas/MedicalDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Medicals + - Medicals operationId: newMedical parameters: - - name: ignore_similar - in: query - required: false - schema: - type: boolean - default: false + - name: ignore_similar + in: query + required: false + schema: + type: boolean + default: false requestBody: content: application/json: @@ -1167,11 +1222,11 @@ paths: schema: $ref: '#/components/schemas/MedicalDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /malnutritions: put: tags: - - Malnutritions + - Malnutritions operationId: updateMalnutrition requestBody: content: @@ -1187,10 +1242,10 @@ paths: schema: $ref: '#/components/schemas/MalnutritionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Malnutritions + - Malnutritions operationId: newMalnutrition requestBody: content: @@ -1206,18 +1261,18 @@ paths: schema: $ref: '#/components/schemas/MalnutritionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Malnutritions + - Malnutritions operationId: deleteMalnutrition parameters: - - name: code - in: query - required: true - schema: - type: integer - format: int32 + - name: code + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -1226,19 +1281,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories/{code}: get: tags: - - Laboratories + - Laboratories operationId: getExamById parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -1247,18 +1302,18 @@ paths: schema: $ref: '#/components/schemas/LaboratoryDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Laboratories + - Laboratories operationId: updateLaboratory parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -1273,18 +1328,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Laboratories + - Laboratories operationId: deleteExam parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -1293,24 +1348,24 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories/examRequest/{code}: put: tags: - - Laboratories + - Laboratories operationId: updateExamRequest parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 - - name: status - in: query - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: integer + format: int32 + - name: status + in: query + required: true + schema: + type: string responses: "200": description: OK @@ -1319,18 +1374,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Laboratories + - Laboratories operationId: deleteExamRequest parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -1339,18 +1394,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /hospitals/{code}: put: tags: - - Hospitals + - Hospitals operationId: updateHospital parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -1365,18 +1420,18 @@ paths: schema: $ref: '#/components/schemas/HospitalDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examtypes/{code}: put: tags: - - Exam Types + - Exam Types operationId: updateExamType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -1391,17 +1446,17 @@ paths: schema: $ref: '#/components/schemas/ExamTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Exam Types + - Exam Types operationId: deleteExamType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -1410,18 +1465,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /exams/{code}: put: tags: - - Exams + - Exams operationId: updateExams parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string requestBody: content: application/json: @@ -1436,17 +1491,17 @@ paths: schema: $ref: '#/components/schemas/ExamDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Exams + - Exams operationId: deleteExam_1 parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -1455,19 +1510,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /examinations/{id}: get: tags: - - Examinations + - Examinations operationId: getByID parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -1476,18 +1531,18 @@ paths: schema: $ref: '#/components/schemas/PatientExaminationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Examinations + - Examinations operationId: updateExamination parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -1502,11 +1557,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /diseasetypes: get: tags: - - Disease Types + - Disease Types operationId: getAllDiseaseTypes responses: "200": @@ -1518,10 +1573,10 @@ paths: items: $ref: '#/components/schemas/DiseaseTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Disease Types + - Disease Types operationId: updateDiseaseType requestBody: content: @@ -1537,10 +1592,10 @@ paths: schema: $ref: '#/components/schemas/DiseaseTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Disease Types + - Disease Types operationId: newDiseaseType requestBody: content: @@ -1556,11 +1611,11 @@ paths: schema: $ref: '#/components/schemas/DiseaseTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases: put: tags: - - Diseases + - Diseases operationId: updateDisease requestBody: content: @@ -1576,10 +1631,10 @@ paths: schema: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Diseases + - Diseases operationId: newDisease requestBody: content: @@ -1595,11 +1650,11 @@ paths: schema: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /dischargetypes: get: tags: - - DischargeType + - DischargeType operationId: getDischargeTypes responses: "200": @@ -1611,10 +1666,10 @@ paths: items: $ref: '#/components/schemas/DischargeTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - DischargeType + - DischargeType operationId: updateDischargeTypet requestBody: content: @@ -1630,10 +1685,10 @@ paths: schema: $ref: '#/components/schemas/DischargeTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - DischargeType + - DischargeType operationId: newDischargeType requestBody: content: @@ -1649,11 +1704,11 @@ paths: schema: $ref: '#/components/schemas/DischargeTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /deliverytypes: get: tags: - - Delivery Type + - Delivery Type operationId: getDeliveryTypes responses: "200": @@ -1665,10 +1720,10 @@ paths: items: $ref: '#/components/schemas/DeliveryTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Delivery Type + - Delivery Type operationId: updateDeliveryTypes requestBody: content: @@ -1684,10 +1739,10 @@ paths: schema: $ref: '#/components/schemas/DeliveryTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Delivery Type + - Delivery Type operationId: newDeliveryType requestBody: content: @@ -1703,11 +1758,11 @@ paths: schema: $ref: '#/components/schemas/DeliveryTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /deliveryresulttypes: get: tags: - - Delivery Result Type + - Delivery Result Type operationId: getDeliveryResultTypes responses: "200": @@ -1719,10 +1774,10 @@ paths: items: $ref: '#/components/schemas/DeliveryResultTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Delivery Result Type + - Delivery Result Type operationId: updateDeliveryResultTypes requestBody: content: @@ -1738,10 +1793,10 @@ paths: schema: $ref: '#/components/schemas/DeliveryResultTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Delivery Result Type + - Delivery Result Type operationId: newDeliveryResultType requestBody: content: @@ -1757,19 +1812,19 @@ paths: schema: $ref: '#/components/schemas/DeliveryResultTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /bills/{id}: get: tags: - - Bills + - Bills operationId: getBill parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -1778,18 +1833,18 @@ paths: schema: $ref: '#/components/schemas/BillDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Bills + - Bills operationId: updateBill parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -1804,18 +1859,18 @@ paths: schema: $ref: '#/components/schemas/FullBillDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Bills + - Bills operationId: deleteBill parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -1824,11 +1879,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /agetypes: get: tags: - - AgeTypes + - AgeTypes operationId: getAllAgeTypes responses: "200": @@ -1840,10 +1895,10 @@ paths: items: $ref: '#/components/schemas/AgeTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - AgeTypes + - AgeTypes operationId: updateAgeType requestBody: content: @@ -1859,11 +1914,11 @@ paths: schema: $ref: '#/components/schemas/AgeTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /admissiontypes: get: tags: - - AdmissionTypes + - AdmissionTypes operationId: getAdmissionTypes responses: "200": @@ -1875,10 +1930,10 @@ paths: items: $ref: '#/components/schemas/AdmissionTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - AdmissionTypes + - AdmissionTypes operationId: updateAdmissionTypes requestBody: content: @@ -1894,10 +1949,10 @@ paths: schema: $ref: '#/components/schemas/AdmissionTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - AdmissionTypes + - AdmissionTypes operationId: newAdmissionType requestBody: content: @@ -1913,40 +1968,40 @@ paths: schema: $ref: '#/components/schemas/AdmissionTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /admissions: get: tags: - - Admissions + - Admissions operationId: getAdmissions parameters: - - name: admissionrange - in: query - required: true - schema: - type: array - items: - type: string - - name: page - in: query - required: false - schema: - type: integer - format: int32 - default: 0 - - name: size - in: query - required: false - schema: - type: integer - format: int32 - default: 80 - - name: paged - in: query - required: false - schema: - type: boolean - default: false + - name: admissionrange + in: query + required: true + schema: + type: array + items: + type: string + - name: page + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: size + in: query + required: false + schema: + type: integer + format: int32 + default: 80 + - name: paged + in: query + required: false + schema: + type: boolean + default: false responses: "400": description: Bad Request @@ -1957,10 +2012,10 @@ paths: schema: $ref: '#/components/schemas/PageAdmissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] put: tags: - - Admissions + - Admissions operationId: updateAdmissions requestBody: content: @@ -1978,10 +2033,10 @@ paths: schema: $ref: '#/components/schemas/AdmissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Admissions + - Admissions operationId: newAdmissions requestBody: content: @@ -1999,11 +2054,11 @@ paths: schema: $ref: '#/components/schemas/AdmissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /visits: post: tags: - - Visit + - Visit operationId: newVisit requestBody: content: @@ -2019,11 +2074,11 @@ paths: schema: $ref: '#/components/schemas/VisitDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /visits/insertList: post: tags: - - Visit + - Visit operationId: newVisits requestBody: content: @@ -2041,11 +2096,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /usersettings: get: tags: - - User Settings + - User Settings operationId: getUserSettings responses: "200": @@ -2057,10 +2112,10 @@ paths: items: $ref: '#/components/schemas/UserSettingDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - User Settings + - User Settings operationId: newUserSettings requestBody: content: @@ -2076,18 +2131,18 @@ paths: schema: $ref: '#/components/schemas/UserSettingDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /users: get: tags: - - Users + - Users operationId: getUser parameters: - - name: group_id - in: query - required: false - schema: - type: string + - name: group_id + in: query + required: false + schema: + type: string responses: "200": description: OK @@ -2098,10 +2153,10 @@ paths: items: $ref: '#/components/schemas/UserDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Users + - Users operationId: newUser requestBody: content: @@ -2117,11 +2172,11 @@ paths: schema: $ref: '#/components/schemas/UserDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /usergroups: get: tags: - - User Groups + - User Groups operationId: getUserGroups responses: "200": @@ -2133,10 +2188,10 @@ paths: items: $ref: '#/components/schemas/UserGroupDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - User Groups + - User Groups operationId: newUserGroup requestBody: content: @@ -2152,24 +2207,24 @@ paths: schema: $ref: '#/components/schemas/UserGroupDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /usergroups/{group_code}/permissions/{id}: post: tags: - - User Groups + - User Groups operationId: assignPermission parameters: - - name: group_code - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: group_code + in: path + required: true + schema: + type: string + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "201": description: Created @@ -2179,32 +2234,32 @@ paths: type: integer format: int32 security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - User Groups + - User Groups operationId: revokePermission parameters: - - name: group_code - in: path - required: true - schema: - type: string - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: group_code + in: path + required: true + schema: + type: string + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "204": description: No Content security: - - bearerAuth: [] + - bearerAuth: [ ] /therapies: post: tags: - - Therapies + - Therapies operationId: newTherapy requestBody: content: @@ -2220,11 +2275,11 @@ paths: schema: $ref: '#/components/schemas/TherapyRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /therapies/replace: post: tags: - - Therapies + - Therapies operationId: replaceTherapies requestBody: content: @@ -2242,11 +2297,11 @@ paths: schema: $ref: '#/components/schemas/TherapyRow' security: - - bearerAuth: [] + - bearerAuth: [ ] /therapies/meds-out-of-stock: post: tags: - - Therapies + - Therapies operationId: getMedicalsOutOfStock requestBody: content: @@ -2266,11 +2321,11 @@ paths: items: $ref: '#/components/schemas/MedicalDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /therapies/from-rows: post: tags: - - Therapies + - Therapies operationId: getTherapies requestBody: content: @@ -2290,11 +2345,11 @@ paths: items: $ref: '#/components/schemas/TherapyDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /therapies/from-row: post: tags: - - Therapies + - Therapies operationId: getTherapy requestBody: content: @@ -2310,18 +2365,18 @@ paths: schema: $ref: '#/components/schemas/TherapyDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /stockmovements/discharge: post: tags: - - Stock Movements + - Stock Movements operationId: newMultipleDischargingMovements parameters: - - name: ref - in: query - required: true - schema: - type: string + - name: ref + in: query + required: true + schema: + type: string requestBody: content: application/json: @@ -2338,18 +2393,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /stockmovements/charge: post: tags: - - Stock Movements + - Stock Movements operationId: newMultipleChargingMovements parameters: - - name: ref - in: query - required: true - schema: - type: string + - name: ref + in: query + required: true + schema: + type: string requestBody: content: application/json: @@ -2366,23 +2421,23 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /sms: get: tags: - - SMS + - SMS operationId: getAll parameters: - - name: dateFrom - in: query - required: true - schema: - type: string - - name: dateTo - in: query - required: true - schema: - type: string + - name: dateFrom + in: query + required: true + schema: + type: string + - name: dateTo + in: query + required: true + schema: + type: string responses: "200": description: OK @@ -2393,18 +2448,18 @@ paths: items: $ref: '#/components/schemas/SmsDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - SMS + - SMS operationId: saveSms parameters: - - name: split - in: query - required: false - schema: - type: boolean - default: false + - name: split + in: query + required: false + schema: + type: boolean + default: false requestBody: content: application/json: @@ -2419,11 +2474,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /sms/delete: post: tags: - - SMS + - SMS operationId: deleteSms requestBody: content: @@ -2441,11 +2496,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /pricesothers: get: tags: - - Others Price + - Others Price operationId: getPricesOthers responses: "200": @@ -2457,10 +2512,10 @@ paths: items: $ref: '#/components/schemas/PricesOthersDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Others Price + - Others Price operationId: newPricesOthers requestBody: content: @@ -2476,11 +2531,11 @@ paths: schema: $ref: '#/components/schemas/PricesOthersDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /pricelists: get: tags: - - Price Lists + - Price Lists operationId: getPriceLists responses: "200": @@ -2492,10 +2547,10 @@ paths: items: $ref: '#/components/schemas/PriceListDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Price Lists + - Price Lists operationId: newPriceList requestBody: content: @@ -2511,11 +2566,11 @@ paths: schema: $ref: '#/components/schemas/PriceListDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /pregnanttreatmenttypes: get: tags: - - Pregnant Treatment Types + - Pregnant Treatment Types operationId: getPregnantTreatmentTypes responses: "200": @@ -2527,10 +2582,10 @@ paths: items: $ref: '#/components/schemas/PregnantTreatmentTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Pregnant Treatment Types + - Pregnant Treatment Types operationId: newPregnantTreatmentType requestBody: content: @@ -2546,11 +2601,11 @@ paths: schema: $ref: '#/components/schemas/PregnantTreatmentTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /patientvaccines: post: tags: - - Patient Vaccines + - Patient Vaccines operationId: newPatientVaccine requestBody: content: @@ -2566,27 +2621,27 @@ paths: schema: $ref: '#/components/schemas/PatientVaccineDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /patients: get: tags: - - Patients + - Patients operationId: getPatients parameters: - - name: page - in: query - required: false - schema: - type: integer - format: int32 - default: 0 - - name: size - in: query - required: false - schema: - type: integer - format: int32 - default: 80 + - name: page + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: size + in: query + required: false + schema: + type: integer + format: int32 + default: 80 responses: "200": description: OK @@ -2595,10 +2650,10 @@ paths: schema: $ref: '#/components/schemas/PagePatientDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Patients + - Patients operationId: newPatient requestBody: content: @@ -2614,11 +2669,11 @@ paths: schema: $ref: '#/components/schemas/PatientDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /operationtypes: get: tags: - - Operations Types + - Operations Types operationId: getOperationTypes responses: "200": @@ -2630,10 +2685,10 @@ paths: items: $ref: '#/components/schemas/OperationTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Operations Types + - Operations Types operationId: newOperationType requestBody: content: @@ -2649,11 +2704,11 @@ paths: schema: $ref: '#/components/schemas/OperationTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /operations: get: tags: - - Operations + - Operations operationId: getOperations responses: "200": @@ -2665,10 +2720,10 @@ paths: items: $ref: '#/components/schemas/OperationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Operations + - Operations operationId: newOperation requestBody: content: @@ -2684,11 +2739,11 @@ paths: schema: $ref: '#/components/schemas/OperationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /operations/rows/search/opd: post: tags: - - Operations + - Operations operationId: getOperationRowsByOpd requestBody: content: @@ -2706,11 +2761,11 @@ paths: items: $ref: '#/components/schemas/OperationRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /opds: post: tags: - - Opds + - Opds operationId: newOpd requestBody: content: @@ -2726,11 +2781,11 @@ paths: schema: $ref: '#/components/schemas/OpdDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /opds/rows: post: tags: - - Opds + - Opds operationId: newOpdWithOperationRow requestBody: content: @@ -2746,11 +2801,11 @@ paths: schema: $ref: '#/components/schemas/OpdWithOperationRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockward/movements: post: tags: - - Medical Stock Ward + - Medical Stock Ward operationId: newMovementWard requestBody: content: @@ -2766,18 +2821,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockmovements/discharge: post: tags: - - Stock Movements + - Stock Movements operationId: newMultipleDischargingMovements_1 parameters: - - name: ref - in: query - required: true - schema: - type: string + - name: ref + in: query + required: true + schema: + type: string requestBody: content: application/json: @@ -2794,18 +2849,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockmovements/charge: post: tags: - - Stock Movements + - Stock Movements operationId: newMultipleChargingMovements_1 parameters: - - name: ref - in: query - required: true - schema: - type: string + - name: ref + in: query + required: true + schema: + type: string requestBody: content: application/json: @@ -2822,30 +2877,30 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories: get: tags: - - Laboratories + - Laboratories operationId: getLaboratory parameters: - - name: oneWeek - in: query - required: true - schema: - type: boolean - - name: page - in: query - required: true - schema: - type: integer - format: int32 - - name: size - in: query - required: true - schema: - type: integer - format: int32 + - name: oneWeek + in: query + required: true + schema: + type: boolean + - name: page + in: query + required: true + schema: + type: integer + format: int32 + - name: size + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -2854,10 +2909,10 @@ paths: schema: $ref: '#/components/schemas/PageLabWithRowsDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Laboratories + - Laboratories operationId: newLaboratory requestBody: content: @@ -2873,11 +2928,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories/insertList: post: tags: - - Laboratories + - Laboratories operationId: newLaboratory2 requestBody: content: @@ -2895,11 +2950,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories/examRequest: get: tags: - - Laboratories + - Laboratories operationId: getLaboratoryExamRequest responses: "200": @@ -2911,10 +2966,10 @@ paths: items: $ref: '#/components/schemas/LaboratoryDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Laboratories + - Laboratories operationId: newExamRequest requestBody: content: @@ -2930,11 +2985,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /examtypes: get: tags: - - Exam Types + - Exam Types operationId: getExamTypes responses: "200": @@ -2946,10 +3001,10 @@ paths: items: $ref: '#/components/schemas/ExamTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Exam Types + - Exam Types operationId: newExamType requestBody: content: @@ -2965,11 +3020,11 @@ paths: schema: $ref: '#/components/schemas/ExamTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /exams: get: tags: - - Exams + - Exams operationId: getExams responses: "200": @@ -2981,10 +3036,10 @@ paths: items: $ref: '#/components/schemas/ExamDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Exams + - Exams operationId: newExam requestBody: content: @@ -3000,11 +3055,11 @@ paths: schema: $ref: '#/components/schemas/ExamDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examrows: get: tags: - - Exam Rows + - Exam Rows operationId: getExamRows responses: "200": @@ -3016,10 +3071,10 @@ paths: items: $ref: '#/components/schemas/ExamRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Exam Rows + - Exam Rows operationId: newExamRow requestBody: content: @@ -3035,11 +3090,11 @@ paths: schema: $ref: '#/components/schemas/ExamRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examinations: post: tags: - - Examinations + - Examinations operationId: newPatientExamination requestBody: content: @@ -3055,29 +3110,29 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /bills: get: tags: - - Bills + - Bills operationId: searchBills_1 parameters: - - name: datefrom - in: query - required: true - schema: - type: string - - name: dateto - in: query - required: true - schema: - type: string - - name: patient_code - in: query - required: false - schema: - type: integer - format: int32 + - name: datefrom + in: query + required: true + schema: + type: string + - name: dateto + in: query + required: true + schema: + type: string + - name: patient_code + in: query + required: false + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3088,10 +3143,10 @@ paths: items: $ref: '#/components/schemas/BillDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] post: tags: - - Bills + - Bills operationId: newBill requestBody: content: @@ -3107,11 +3162,11 @@ paths: schema: $ref: '#/components/schemas/FullBillDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /bills/search/by/payments: post: tags: - - Bills + - Bills operationId: searchBillsByPayments requestBody: content: @@ -3131,23 +3186,23 @@ paths: items: $ref: '#/components/schemas/BillDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /bills/search/by/item: post: tags: - - Bills + - Bills operationId: searchBills parameters: - - name: datefrom - in: query - required: true - schema: - type: string - - name: dateto - in: query - required: true - schema: - type: string + - name: datefrom + in: query + required: true + schema: + type: string + - name: dateto + in: query + required: true + schema: + type: string requestBody: content: application/json: @@ -3164,11 +3219,11 @@ paths: items: $ref: '#/components/schemas/BillDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /auth/refresh-token: post: tags: - - Login + - Login operationId: refreshToken requestBody: content: @@ -3184,11 +3239,11 @@ paths: schema: $ref: '#/components/schemas/LoginResponse' security: - - bearerAuth: [] + - bearerAuth: [ ] /auth/logout: post: tags: - - Login + - Login description: Logout the current user. operationId: logout responses: @@ -3197,7 +3252,7 @@ paths: /auth/login: post: tags: - - Login + - Login operationId: authenticateUser requestBody: content: @@ -3213,19 +3268,19 @@ paths: schema: $ref: '#/components/schemas/LoginResponse' security: - - bearerAuth: [] + - bearerAuth: [ ] /admissions/discharge: post: tags: - - Admissions + - Admissions operationId: dischargePatient parameters: - - name: patientCode - in: query - required: true - schema: - type: integer - format: int32 + - name: patientCode + in: query + required: true + schema: + type: integer + format: int32 requestBody: content: application/json: @@ -3242,11 +3297,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /wardsNoMaternity: get: tags: - - Wards + - Wards operationId: getWardsNoMaternity responses: "200": @@ -3258,18 +3313,18 @@ paths: items: $ref: '#/components/schemas/WardDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /wards/occupation/{code}: get: tags: - - Wards + - Wards operationId: getCurrentOccupation parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3279,18 +3334,18 @@ paths: type: integer format: int32 security: - - bearerAuth: [] + - bearerAuth: [ ] /wards/check/{code}: get: tags: - - Wards + - Wards operationId: checkWardCode parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3299,18 +3354,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /wards/check/maternity/{createIfNotExist}: get: tags: - - Wards + - Wards operationId: checkWardMaternityCode parameters: - - name: createIfNotExist - in: path - required: true - schema: - type: boolean + - name: createIfNotExist + in: path + required: true + schema: + type: boolean responses: "200": description: OK @@ -3319,19 +3374,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /visits/patient/{patID}: get: tags: - - Visit + - Visit operationId: getVisit parameters: - - name: patID - in: path - required: true - schema: - type: integer - format: int32 + - name: patID + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3342,18 +3397,18 @@ paths: items: $ref: '#/components/schemas/VisitDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /vaccinetypes/check/{code}: get: tags: - - Vaccine Type + - Vaccine Type operationId: checkVaccineTypeCode parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3362,18 +3417,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /vaccines/type-code/{vaccineTypeCode}: get: tags: - - Vaccines + - Vaccines operationId: getVaccinesByVaccineTypeCode parameters: - - name: vaccineTypeCode - in: path - required: true - schema: - type: string + - name: vaccineTypeCode + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3384,18 +3439,18 @@ paths: items: $ref: '#/components/schemas/VaccineDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /vaccines/check/{code}: get: tags: - - Vaccines + - Vaccines operationId: checkVaccineCode parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3404,18 +3459,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /usersettings/{configName}: get: tags: - - User Settings + - User Settings operationId: getUserSettingByUser parameters: - - name: configName - in: path - required: true - schema: - type: string + - name: configName + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3424,18 +3479,18 @@ paths: schema: $ref: '#/components/schemas/UserSettingDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /users/{username}/permissions: get: tags: - - Users + - Users operationId: retrievePermissionsByUsername parameters: - - name: username - in: path - required: true - schema: - type: string + - name: username + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3446,19 +3501,19 @@ paths: items: $ref: '#/components/schemas/PermissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /therapies/{code_patient}: get: tags: - - Therapies + - Therapies operationId: getTherapyRows parameters: - - name: code_patient - in: path - required: true - schema: - type: integer - format: int32 + - name: code_patient + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3469,18 +3524,18 @@ paths: items: $ref: '#/components/schemas/TherapyRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Therapies + - Therapies operationId: deleteAllTherapies parameters: - - name: code_patient - in: path - required: true - schema: - type: integer - format: int32 + - name: code_patient + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3489,19 +3544,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /suppliers/{id}: get: tags: - - Suppliers + - Suppliers operationId: getSuppliers_1 parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3510,11 +3565,11 @@ paths: schema: $ref: '#/components/schemas/SupplierDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /stockmovements: get: tags: - - Stock Movements + - Stock Movements operationId: getMovements responses: "200": @@ -3526,18 +3581,18 @@ paths: items: $ref: '#/components/schemas/MovementDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /stockmovements/{ref}: get: tags: - - Stock Movements + - Stock Movements operationId: getMovements_1 parameters: - - name: ref - in: path - required: true - schema: - type: string + - name: ref + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3548,19 +3603,19 @@ paths: items: $ref: '#/components/schemas/MovementDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /stockmovements/lot/{med_code}: get: tags: - - Stock Movements + - Stock Movements operationId: getLotByMedical parameters: - - name: med_code - in: path - required: true - schema: - type: integer - format: int32 + - name: med_code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3571,70 +3626,70 @@ paths: items: $ref: '#/components/schemas/LotDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /stockmovements/filter/v2: get: tags: - - Stock Movements + - Stock Movements operationId: getMovements_2 parameters: - - name: med_code - in: query - required: false - schema: - type: integer - format: int32 - - name: med_type - in: query - required: false - schema: - type: string - - name: ward_id - in: query - required: false - schema: - type: string - - name: mov_type - in: query - required: false - schema: - type: string - - name: mov_from - in: query - required: false - schema: - type: string - format: date-time - - name: mov_to - in: query - required: false - schema: - type: string - format: date-time - - name: lot_prep_from - in: query - required: false - schema: - type: string - format: date-time - - name: lot_prep_to - in: query - required: false - schema: - type: string - format: date-time - - name: lot_due_from - in: query - required: false - schema: - type: string - format: date-time - - name: lot_due_to - in: query - required: false - schema: - type: string - format: date-time + - name: med_code + in: query + required: false + schema: + type: integer + format: int32 + - name: med_type + in: query + required: false + schema: + type: string + - name: ward_id + in: query + required: false + schema: + type: string + - name: mov_type + in: query + required: false + schema: + type: string + - name: mov_from + in: query + required: false + schema: + type: string + format: date-time + - name: mov_to + in: query + required: false + schema: + type: string + format: date-time + - name: lot_prep_from + in: query + required: false + schema: + type: string + format: date-time + - name: lot_prep_to + in: query + required: false + schema: + type: string + format: date-time + - name: lot_due_from + in: query + required: false + schema: + type: string + format: date-time + - name: lot_due_to + in: query + required: false + schema: + type: string + format: date-time responses: "200": description: OK @@ -3645,30 +3700,30 @@ paths: items: $ref: '#/components/schemas/MovementDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /stockmovements/filter/v1: get: tags: - - Stock Movements + - Stock Movements operationId: getMovements_3 parameters: - - name: ward_id - in: query - required: true - schema: - type: string - - name: from - in: query - required: true - schema: - type: string - format: date-time - - name: to - in: query - required: true - schema: - type: string - format: date-time + - name: ward_id + in: query + required: true + schema: + type: string + - name: from + in: query + required: true + schema: + type: string + format: date-time + - name: to + in: query + required: true + schema: + type: string + format: date-time responses: "200": description: OK @@ -3679,25 +3734,25 @@ paths: items: $ref: '#/components/schemas/MovementDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /stockmovements/critical/check: get: tags: - - Stock Movements + - Stock Movements operationId: alertCriticalQuantity parameters: - - name: med_code - in: query - required: true - schema: - type: integer - format: int32 - - name: qty - in: query - required: true - schema: - type: integer - format: int32 + - name: med_code + in: query + required: true + schema: + type: integer + format: int32 + - name: qty + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3706,11 +3761,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /reports/exams-list: get: tags: - - Reports + - Reports operationId: printExamsListPdf responses: "200": @@ -3723,11 +3778,11 @@ paths: type: string format: byte security: - - bearerAuth: [] + - bearerAuth: [ ] /reports/diseases-list: get: tags: - - Reports + - Reports operationId: printDiseasesListPdf responses: "200": @@ -3740,11 +3795,11 @@ paths: type: string format: byte security: - - bearerAuth: [] + - bearerAuth: [ ] /pricelists/prices: get: tags: - - Price Lists + - Price Lists operationId: getPrices responses: "200": @@ -3756,19 +3811,19 @@ paths: items: $ref: '#/components/schemas/PriceDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /pricelists/duplicate/{id}: get: tags: - - Price Lists + - Price Lists operationId: copyList parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int64 + - name: id + in: path + required: true + schema: + type: integer + format: int64 responses: "200": description: OK @@ -3777,31 +3832,31 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /pricelists/duplicate/byfactor/{id}: get: tags: - - Price Lists + - Price Lists operationId: copyByFactorAndStep parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int64 - - name: factor - in: query - required: true - schema: - type: number - format: double - - name: step - in: query - required: true - schema: - type: number - format: double + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: factor + in: query + required: true + schema: + type: number + format: double + - name: step + in: query + required: true + schema: + type: number + format: double responses: "200": description: OK @@ -3810,11 +3865,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /permissions: get: tags: - - Permissions + - Permissions operationId: retrieveAllPermissions responses: "200": @@ -3826,19 +3881,19 @@ paths: items: $ref: '#/components/schemas/PermissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /permissions/{id}: get: tags: - - Permissions + - Permissions operationId: retrievePermissionById parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3847,18 +3902,18 @@ paths: schema: $ref: '#/components/schemas/PermissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /permissions/userGroupCode/{userGroupCode}: get: tags: - - Permissions + - Permissions operationId: retrievePermissionsByUserGroupCode parameters: - - name: userGroupCode - in: path - required: true - schema: - type: string + - name: userGroupCode + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3869,18 +3924,18 @@ paths: items: $ref: '#/components/schemas/PermissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /permissions/name/{name}: get: tags: - - Permissions + - Permissions operationId: retrievePermissionByName parameters: - - name: name - in: path - required: true - schema: - type: string + - name: name + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -3889,18 +3944,18 @@ paths: schema: $ref: '#/components/schemas/PermissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /patientvaccines/week: get: tags: - - Patient Vaccines + - Patient Vaccines operationId: getPatientVaccines parameters: - - name: oneWeek - in: query - required: false - schema: - type: boolean + - name: oneWeek + in: query + required: false + schema: + type: boolean responses: "200": description: OK @@ -3911,19 +3966,19 @@ paths: items: $ref: '#/components/schemas/PatientVaccineDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /patientvaccines/progyear/{year}: get: tags: - - Patient Vaccines + - Patient Vaccines operationId: getProgYear parameters: - - name: year - in: path - required: true - schema: - type: integer - format: int32 + - name: year + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3933,52 +3988,52 @@ paths: type: integer format: int32 security: - - bearerAuth: [] + - bearerAuth: [ ] /patientvaccines/filter: get: tags: - - Patient Vaccines + - Patient Vaccines operationId: getPatientVaccinesByDatesRanges parameters: - - name: vaccineTypeCode - in: query - required: true - schema: - type: string - - name: vaccineCode - in: query - required: true - schema: - type: string - - name: dateFrom - in: query - required: true - schema: - type: string - format: date - - name: dateTo - in: query - required: true - schema: - type: string - format: date - - name: sex - in: query - required: true - schema: - type: string - - name: ageFrom - in: query - required: true - schema: - type: integer - format: int32 - - name: ageTo - in: query - required: true - schema: - type: integer - format: int32 + - name: vaccineTypeCode + in: query + required: true + schema: + type: string + - name: vaccineCode + in: query + required: true + schema: + type: string + - name: dateFrom + in: query + required: true + schema: + type: string + format: date + - name: dateTo + in: query + required: true + schema: + type: string + format: date + - name: sex + in: query + required: true + schema: + type: string + - name: ageFrom + in: query + required: true + schema: + type: integer + format: int32 + - name: ageTo + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -3989,37 +4044,37 @@ paths: items: $ref: '#/components/schemas/PatientVaccineDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /patients/search: get: tags: - - Patients + - Patients operationId: searchPatient parameters: - - name: firstName - in: query - required: false - schema: - type: string - default: "" - - name: secondName - in: query - required: false - schema: - type: string - default: "" - - name: birthDate - in: query - required: false - schema: - type: string - format: date-time - - name: address - in: query - required: false - schema: - type: string - default: "" + - name: firstName + in: query + required: false + schema: + type: string + default: "" + - name: secondName + in: query + required: false + schema: + type: string + default: "" + - name: birthDate + in: query + required: false + schema: + type: string + format: date-time + - name: address + in: query + required: false + schema: + type: string + default: "" responses: "200": description: OK @@ -4030,11 +4085,11 @@ paths: items: $ref: '#/components/schemas/PatientDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /patients/nextcode: get: tags: - - Patients + - Patients operationId: getPatientNextCode responses: "200": @@ -4045,25 +4100,25 @@ paths: type: integer format: int32 security: - - bearerAuth: [] + - bearerAuth: [ ] /patients/merge: get: tags: - - Patients + - Patients operationId: mergePatients parameters: - - name: mergedcode - in: query - required: true - schema: - type: integer - format: int32 - - name: code2 - in: query - required: true - schema: - type: integer - format: int32 + - name: mergedcode + in: query + required: true + schema: + type: integer + format: int32 + - name: code2 + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4072,11 +4127,11 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /patients/cities: get: tags: - - Patients + - Patients operationId: getPatientCities responses: "200": @@ -4088,19 +4143,19 @@ paths: items: type: string security: - - bearerAuth: [] + - bearerAuth: [ ] /patients/all: get: tags: - - Patients + - Patients operationId: getPatientAll parameters: - - name: code - in: query - required: true - schema: - type: integer - format: int32 + - name: code + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4109,18 +4164,18 @@ paths: schema: $ref: '#/components/schemas/PatientDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /operations/search/type: get: tags: - - Operations + - Operations operationId: getOperationByTypeDescription parameters: - - name: typeDescription - in: query - required: true - schema: - type: string + - name: typeDescription + in: query + required: true + schema: + type: string responses: "200": description: OK @@ -4131,19 +4186,19 @@ paths: items: $ref: '#/components/schemas/OperationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /operations/rows/search/patient: get: tags: - - Operations + - Operations operationId: getOperationRowsByPatient parameters: - - name: patientCode - in: query - required: true - schema: - type: integer - format: int32 + - name: patientCode + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4154,19 +4209,19 @@ paths: items: $ref: '#/components/schemas/OperationRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /operations/rows/search/admission: get: tags: - - Operations + - Operations operationId: getOperationRowsByAdmt parameters: - - name: admissionId - in: query - required: true - schema: - type: integer - format: int32 + - name: admissionId + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4177,18 +4232,18 @@ paths: items: $ref: '#/components/schemas/OperationRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /opds/weekly: get: tags: - - Opds + - Opds operationId: getOpdToDayOrWeek parameters: - - name: oneWeek - in: query - required: false - schema: - type: boolean + - name: oneWeek + in: query + required: false + schema: + type: boolean responses: "200": description: OK @@ -4199,91 +4254,91 @@ paths: items: $ref: '#/components/schemas/OpdDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /opds/search: get: tags: - - Opds + - Opds operationId: getOpdByDates parameters: - - name: dateFrom - in: query - required: true - schema: - type: string - - name: dateTo - in: query - required: true - schema: - type: string - - name: diseaseTypeCode - in: query - required: false - schema: - type: string - - name: diseaseCode - in: query - required: false - schema: - type: string - - name: ageFrom - in: query - required: false - schema: - type: integer - format: int32 - default: 0 - - name: ageTo - in: query - required: false - schema: - type: integer - format: int32 - default: 200 - - name: sex - in: query - required: false - schema: - type: string - default: A - - name: newPatient - in: query - required: false - schema: - type: string - default: A - - name: patientCode - in: query - required: false - schema: - type: integer - format: int32 - default: 0 - - name: page - in: query - required: false - schema: - type: integer - format: int32 - default: 0 - - name: size - in: query - required: false - schema: - type: integer - format: int32 - default: 80 - - name: paged - in: query - required: false - schema: - type: boolean - default: false - - name: wardCode - in: query - required: false - schema: - type: string + - name: dateFrom + in: query + required: true + schema: + type: string + - name: dateTo + in: query + required: true + schema: + type: string + - name: diseaseTypeCode + in: query + required: false + schema: + type: string + - name: diseaseCode + in: query + required: false + schema: + type: string + - name: ageFrom + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: ageTo + in: query + required: false + schema: + type: integer + format: int32 + default: 200 + - name: sex + in: query + required: false + schema: + type: string + default: A + - name: newPatient + in: query + required: false + schema: + type: string + default: A + - name: patientCode + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: page + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: size + in: query + required: false + schema: + type: integer + format: int32 + default: 80 + - name: paged + in: query + required: false + schema: + type: boolean + default: false + - name: wardCode + in: query + required: false + schema: + type: string responses: "200": description: OK @@ -4292,19 +4347,19 @@ paths: schema: $ref: '#/components/schemas/PageOpdDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /opds/patient/{pcode}: get: tags: - - Opds + - Opds operationId: getOpdByPatient parameters: - - name: pcode - in: path - required: true - schema: - type: integer - format: int32 + - name: pcode + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4315,19 +4370,19 @@ paths: items: $ref: '#/components/schemas/OpdWithOperationRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /opds/last/{patientCode}: get: tags: - - Opds + - Opds operationId: getLastOpd parameters: - - name: patientCode - in: path - required: true - schema: - type: integer - format: int32 + - name: patientCode + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4336,25 +4391,25 @@ paths: schema: $ref: '#/components/schemas/OpdDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /opds/check/progyear: get: tags: - - Opds + - Opds operationId: isExistOpdNum parameters: - - name: opdNum - in: query - required: true - schema: - type: integer - format: int32 - - name: year - in: query - required: true - schema: - type: integer - format: int32 + - name: opdNum + in: query + required: true + schema: + type: integer + format: int32 + - name: year + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4363,19 +4418,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /opds/ProgYear/{year}: get: tags: - - Opds + - Opds operationId: getProgYear_1 parameters: - - name: year - in: path - required: true - schema: - type: integer - format: int32 + - name: year + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4385,18 +4440,18 @@ paths: type: integer format: int32 security: - - bearerAuth: [] + - bearerAuth: [ ] /medstockmovementtypes/{code}: get: tags: - - Medical Stock Movement Type + - Medical Stock Movement Type operationId: getMovementType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -4405,17 +4460,17 @@ paths: schema: $ref: '#/components/schemas/MovementTypeDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Medical Stock Movement Type + - Medical Stock Movement Type operationId: deleteMedicalDsrStockMovementType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -4424,18 +4479,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /medstockmovementtypes/check/{code}: get: tags: - - Medical Stock Movement Type + - Medical Stock Movement Type operationId: isCodeUsed parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -4444,18 +4499,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /medicaltypes/check/{code}: get: tags: - - Medical Types + - Medical Types operationId: isCodeUsed_1 parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -4464,18 +4519,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockward/{ward_code}: get: tags: - - Medical Stock Ward + - Medical Stock Ward operationId: getMedicalsWard parameters: - - name: ward_code - in: path - required: true - schema: - type: string + - name: ward_code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -4486,30 +4541,30 @@ paths: items: $ref: '#/components/schemas/MedicalWardDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockward/movements/{ward_code}: get: tags: - - Medical Stock Ward + - Medical Stock Ward operationId: getMovementWard parameters: - - name: ward_code - in: path - required: true - schema: - type: string - - name: from - in: query - required: true - schema: - type: string - format: date - - name: to - in: query - required: true - schema: - type: string - format: date + - name: ward_code + in: path + required: true + schema: + type: string + - name: from + in: query + required: true + schema: + type: string + format: date + - name: to + in: query + required: true + schema: + type: string + format: date responses: "200": description: OK @@ -4520,30 +4575,30 @@ paths: items: $ref: '#/components/schemas/MovementWardDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockward/movements/to/{target_ward_code}: get: tags: - - Medical Stock Ward + - Medical Stock Ward operationId: getWardMovementsToWard parameters: - - name: target_ward_code - in: path - required: true - schema: - type: string - - name: from - in: query - required: true - schema: - type: string - format: date-time - - name: to - in: query - required: true - schema: - type: string - format: date-time + - name: target_ward_code + in: path + required: true + schema: + type: string + - name: from + in: query + required: true + schema: + type: string + format: date-time + - name: to + in: query + required: true + schema: + type: string + format: date-time responses: "200": description: OK @@ -4554,24 +4609,24 @@ paths: items: $ref: '#/components/schemas/MovementWardDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockward/current/{ward_code}: get: tags: - - Medical Stock Ward + - Medical Stock Ward operationId: getCurrentQuantityInWard parameters: - - name: ward_code - in: path - required: true - schema: - type: string - - name: med_id - in: query - required: true - schema: - type: integer - format: int32 + - name: ward_code + in: path + required: true + schema: + type: string + - name: med_id + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4581,11 +4636,11 @@ paths: type: integer format: int32 security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockmovements: get: tags: - - Stock Movements + - Stock Movements operationId: getMovements_4 responses: "200": @@ -4597,18 +4652,18 @@ paths: items: $ref: '#/components/schemas/MovementDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockmovements/{ref}: get: tags: - - Stock Movements + - Stock Movements operationId: getMovements_5 parameters: - - name: ref - in: path - required: true - schema: - type: string + - name: ref + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -4619,19 +4674,19 @@ paths: items: $ref: '#/components/schemas/MovementDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockmovements/lot/{med_code}: get: tags: - - Stock Movements + - Stock Movements operationId: getLotByMedical_1 parameters: - - name: med_code - in: path - required: true - schema: - type: integer - format: int32 + - name: med_code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4642,70 +4697,70 @@ paths: items: $ref: '#/components/schemas/LotDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockmovements/filter/v2: get: tags: - - Stock Movements + - Stock Movements operationId: getMovements_6 parameters: - - name: med_code - in: query - required: false - schema: - type: integer - format: int32 - - name: med_type - in: query - required: false - schema: - type: string - - name: ward_id - in: query - required: false - schema: - type: string - - name: mov_type - in: query - required: false - schema: - type: string - - name: mov_from - in: query - required: false - schema: - type: string - format: date-time - - name: mov_to - in: query - required: false - schema: - type: string - format: date-time - - name: lot_prep_from - in: query - required: false - schema: - type: string - format: date-time - - name: lot_prep_to - in: query - required: false - schema: - type: string - format: date-time - - name: lot_due_from - in: query - required: false - schema: - type: string - format: date-time - - name: lot_due_to - in: query - required: false - schema: - type: string - format: date-time + - name: med_code + in: query + required: false + schema: + type: integer + format: int32 + - name: med_type + in: query + required: false + schema: + type: string + - name: ward_id + in: query + required: false + schema: + type: string + - name: mov_type + in: query + required: false + schema: + type: string + - name: mov_from + in: query + required: false + schema: + type: string + format: date-time + - name: mov_to + in: query + required: false + schema: + type: string + format: date-time + - name: lot_prep_from + in: query + required: false + schema: + type: string + format: date-time + - name: lot_prep_to + in: query + required: false + schema: + type: string + format: date-time + - name: lot_due_from + in: query + required: false + schema: + type: string + format: date-time + - name: lot_due_to + in: query + required: false + schema: + type: string + format: date-time responses: "200": description: OK @@ -4716,30 +4771,30 @@ paths: items: $ref: '#/components/schemas/MovementDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockmovements/filter/v1: get: tags: - - Stock Movements + - Stock Movements operationId: getMovements_7 parameters: - - name: ward_id - in: query - required: true - schema: - type: string - - name: from - in: query - required: true - schema: - type: string - format: date-time - - name: to - in: query - required: true - schema: - type: string - format: date-time + - name: ward_id + in: query + required: true + schema: + type: string + - name: from + in: query + required: true + schema: + type: string + format: date-time + - name: to + in: query + required: true + schema: + type: string + format: date-time responses: "200": description: OK @@ -4750,25 +4805,25 @@ paths: items: $ref: '#/components/schemas/MovementDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /medicalstockmovements/critical/check: get: tags: - - Stock Movements + - Stock Movements operationId: alertCriticalQuantity_1 parameters: - - name: med_code - in: query - required: true - schema: - type: integer - format: int32 - - name: qty - in: query - required: true - schema: - type: integer - format: int32 + - name: med_code + in: query + required: true + schema: + type: integer + format: int32 + - name: qty + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4777,19 +4832,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /medicals/{code}: get: tags: - - Medicals + - Medicals operationId: getMedical parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4798,18 +4853,18 @@ paths: schema: $ref: '#/components/schemas/MedicalDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Medicals + - Medicals operationId: deleteMedical parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4818,35 +4873,35 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /medicals/filter: get: tags: - - Medicals + - Medicals operationId: filterMedicals parameters: - - name: desc - in: query - required: false - schema: - type: string - - name: type - in: query - required: false - schema: - type: string - - name: critical - in: query - required: false - schema: - type: boolean - default: false - - name: name_sorted - in: query - required: false - schema: - type: boolean - default: false + - name: desc + in: query + required: false + schema: + type: string + - name: type + in: query + required: false + schema: + type: string + - name: critical + in: query + required: false + schema: + type: boolean + default: false + - name: name_sorted + in: query + required: false + schema: + type: boolean + default: false responses: "200": description: OK @@ -4857,18 +4912,18 @@ paths: items: $ref: '#/components/schemas/MedicalDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /malnutritions/{id_admission}: get: tags: - - Malnutritions + - Malnutritions operationId: getMalnutrition parameters: - - name: id_admission - in: path - required: true - schema: - type: string + - name: id_admission + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -4879,19 +4934,19 @@ paths: items: $ref: '#/components/schemas/MalnutritionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /malnutritions/last/{id_patient}: get: tags: - - Malnutritions + - Malnutritions operationId: getLastMalnutrition parameters: - - name: id_patient - in: path - required: true - schema: - type: integer - format: int32 + - name: id_patient + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -4900,11 +4955,11 @@ paths: schema: $ref: '#/components/schemas/MalnutritionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories/materials: get: tags: - - Laboratories + - Laboratories operationId: getMaterials responses: "200": @@ -4916,62 +4971,62 @@ paths: items: type: string security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories/exams: get: tags: - - Laboratories + - Laboratories operationId: getLaboratoryForPrint parameters: - - name: examName - in: query - required: false - schema: - type: string - default: "" - - name: dateFrom - in: query - required: true - schema: - type: string - - name: dateTo - in: query - required: true - schema: - type: string - - name: patientCode - in: query - required: false - schema: - type: integer - format: int32 - default: 0 - - name: status - in: query - required: false - schema: - type: string - default: "" - - name: page - in: query - required: false - schema: - type: integer - format: int32 - default: 0 - - name: size - in: query - required: false - schema: - type: integer - format: int32 - default: 80 - - name: paged - in: query - required: false - schema: - type: boolean - default: false + - name: examName + in: query + required: false + schema: + type: string + default: "" + - name: dateFrom + in: query + required: true + schema: + type: string + - name: dateTo + in: query + required: true + schema: + type: string + - name: patientCode + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: status + in: query + required: false + schema: + type: string + default: "" + - name: page + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: size + in: query + required: false + schema: + type: integer + format: int32 + default: 80 + - name: paged + in: query + required: false + schema: + type: boolean + default: false responses: "200": description: OK @@ -4980,19 +5035,19 @@ paths: schema: $ref: '#/components/schemas/PageLabWithRowsDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories/exams/{code}: get: tags: - - Laboratories + - Laboratories operationId: getExamWithRowsById parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5001,19 +5056,19 @@ paths: schema: $ref: '#/components/schemas/LabWithRowsDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories/examRequest/patient/{patId}: get: tags: - - Laboratories + - Laboratories operationId: getLaboratoryExamRequest_1 parameters: - - name: patId - in: path - required: true - schema: - type: integer - format: int32 + - name: patId + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5024,19 +5079,19 @@ paths: items: $ref: '#/components/schemas/LaboratoryDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /laboratories/byPatientId/{patId}: get: tags: - - Laboratories + - Laboratories operationId: getLaboratory_1 parameters: - - name: patId - in: path - required: true - schema: - type: integer - format: int32 + - name: patId + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5047,11 +5102,11 @@ paths: items: $ref: '#/components/schemas/LabWithRowsDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /hospitals: get: tags: - - Hospitals + - Hospitals operationId: getHospital responses: "200": @@ -5061,11 +5116,11 @@ paths: schema: $ref: '#/components/schemas/HospitalDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /hospitals/currencyCode: get: tags: - - Hospitals + - Hospitals operationId: getHospitalCurrencyCode responses: "200": @@ -5075,18 +5130,18 @@ paths: schema: type: string security: - - bearerAuth: [] + - bearerAuth: [ ] /exams/description/{description}: get: tags: - - Exams + - Exams operationId: getExams_1 parameters: - - name: description - in: path - required: true - schema: - type: string + - name: description + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5097,19 +5152,19 @@ paths: items: $ref: '#/components/schemas/ExamDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examrows/{code}: get: tags: - - Exam Rows + - Exam Rows operationId: getExamRowsByCode parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5120,18 +5175,18 @@ paths: items: $ref: '#/components/schemas/ExamRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Exam Rows + - Exam Rows operationId: deleteExam_2 parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5140,24 +5195,24 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /examrows/search: get: tags: - - Exam Rows + - Exam Rows operationId: getExamRowsByCodeAndDescription parameters: - - name: code - in: query - required: true - schema: - type: integer - format: int32 - - name: description - in: query - required: true - schema: - type: string + - name: code + in: query + required: true + schema: + type: integer + format: int32 + - name: description + in: query + required: true + schema: + type: string responses: "200": description: OK @@ -5168,18 +5223,18 @@ paths: items: $ref: '#/components/schemas/ExamRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examrows/byExamCode/{examCode}: get: tags: - - Exam Rows + - Exam Rows operationId: getExamRowsByExamCode parameters: - - name: examCode - in: path - required: true - schema: - type: string + - name: examCode + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5190,25 +5245,25 @@ paths: items: $ref: '#/components/schemas/ExamRowDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examinations/lastNByPatId: get: tags: - - Examinations + - Examinations operationId: getLastNByPatID parameters: - - name: limit - in: query - required: true - schema: - type: integer - format: int32 - - name: patId - in: query - required: true - schema: - type: integer - format: int32 + - name: limit + in: query + required: true + schema: + type: integer + format: int32 + - name: patId + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5217,19 +5272,19 @@ paths: schema: $ref: '#/components/schemas/PagePatientExaminationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examinations/lastByPatientId/{patId}: get: tags: - - Examinations + - Examinations operationId: getLastByPatientId parameters: - - name: patId - in: path - required: true - schema: - type: integer - format: int32 + - name: patId + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5238,19 +5293,19 @@ paths: schema: $ref: '#/components/schemas/PatientExaminationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examinations/fromLastPatientExamination/{id}: get: tags: - - Examinations + - Examinations operationId: getFromLastPatientExamination parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5259,19 +5314,19 @@ paths: schema: $ref: '#/components/schemas/PatientExaminationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examinations/defaultPatientExamination: get: tags: - - Examinations + - Examinations operationId: getDefaultPatientExamination parameters: - - name: patId - in: query - required: true - schema: - type: integer - format: int32 + - name: patId + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5280,19 +5335,19 @@ paths: schema: $ref: '#/components/schemas/PatientExaminationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /examinations/byPatientId/{patId}: get: tags: - - Examinations + - Examinations operationId: getByPatientId parameters: - - name: patId - in: path - required: true - schema: - type: integer - format: int32 + - name: patId + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5303,18 +5358,18 @@ paths: items: $ref: '#/components/schemas/PatientExaminationDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/{code}: get: tags: - - Diseases + - Diseases operationId: getDiseaseByCode parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5323,17 +5378,17 @@ paths: schema: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] delete: tags: - - Diseases + - Diseases operationId: deleteDisease parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5344,11 +5399,11 @@ paths: additionalProperties: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/opd: get: tags: - - Diseases + - Diseases operationId: getDiseasesOpd responses: "200": @@ -5360,18 +5415,18 @@ paths: items: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/opd/{typecode}: get: tags: - - Diseases + - Diseases operationId: getDiseasesOpdByCode parameters: - - name: typecode - in: path - required: true - schema: - type: string + - name: typecode + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5382,11 +5437,11 @@ paths: items: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/ipd/out: get: tags: - - Diseases + - Diseases operationId: getDiseasesIpdOut responses: "200": @@ -5398,18 +5453,18 @@ paths: items: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/ipd/out/{typecode}: get: tags: - - Diseases + - Diseases operationId: getDiseasesIpdOutByCode parameters: - - name: typecode - in: path - required: true - schema: - type: string + - name: typecode + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5420,11 +5475,11 @@ paths: items: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/ipd/in: get: tags: - - Diseases + - Diseases operationId: getDiseasesIpdIn responses: "200": @@ -5436,18 +5491,18 @@ paths: items: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/ipd/in/{typecode}: get: tags: - - Diseases + - Diseases operationId: getDiseasesIpdInByCode parameters: - - name: typecode - in: path - required: true - schema: - type: string + - name: typecode + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5458,11 +5513,11 @@ paths: items: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/both: get: tags: - - Diseases + - Diseases operationId: getDiseases responses: "200": @@ -5474,18 +5529,18 @@ paths: items: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/both/{typecode}: get: tags: - - Diseases + - Diseases operationId: getDiseases_1 parameters: - - name: typecode - in: path - required: true - schema: - type: string + - name: typecode + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5496,11 +5551,11 @@ paths: items: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /diseases/all: get: tags: - - Diseases + - Diseases operationId: getAllDiseases responses: "200": @@ -5512,19 +5567,19 @@ paths: items: $ref: '#/components/schemas/DiseaseDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /bills/pending: get: tags: - - Bills + - Bills operationId: getPendingBills parameters: - - name: patient_code - in: query - required: true - schema: - type: integer - format: int32 + - name: patient_code + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5535,19 +5590,19 @@ paths: items: $ref: '#/components/schemas/BillDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /bills/pending/affiliate: get: tags: - - Bills + - Bills operationId: getPendingBillsAffiliate parameters: - - name: patient_code - in: query - required: true - schema: - type: integer - format: int32 + - name: patient_code + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5558,29 +5613,29 @@ paths: items: $ref: '#/components/schemas/BillDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /bills/payments: get: tags: - - Bills + - Bills operationId: searchBillsPayments parameters: - - name: datefrom - in: query - required: true - schema: - type: string - - name: dateto - in: query - required: true - schema: - type: string - - name: patient_code - in: query - required: false - schema: - type: integer - format: int32 + - name: datefrom + in: query + required: true + schema: + type: string + - name: dateto + in: query + required: true + schema: + type: string + - name: patient_code + in: query + required: false + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5591,19 +5646,19 @@ paths: items: $ref: '#/components/schemas/BillPaymentsDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /bills/payments/{bill_id}: get: tags: - - Bills + - Bills operationId: getPaymentsByBillId parameters: - - name: bill_id - in: path - required: true - schema: - type: integer - format: int32 + - name: bill_id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5614,11 +5669,11 @@ paths: items: $ref: '#/components/schemas/BillPaymentsDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /bills/items: get: tags: - - Bills + - Bills operationId: getDistinctItems responses: "200": @@ -5630,19 +5685,19 @@ paths: items: $ref: '#/components/schemas/BillItemsDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /bills/items/{bill_id}: get: tags: - - Bills + - Bills operationId: getItems parameters: - - name: bill_id - in: path - required: true - schema: - type: integer - format: int32 + - name: bill_id + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5653,19 +5708,19 @@ paths: items: $ref: '#/components/schemas/BillItemsDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /agetypes/{index}: get: tags: - - AgeTypes + - AgeTypes operationId: getAgeTypeByIndex parameters: - - name: index - in: path - required: true - schema: - type: integer - format: int32 + - name: index + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5674,19 +5729,19 @@ paths: schema: $ref: '#/components/schemas/AgeType' security: - - bearerAuth: [] + - bearerAuth: [ ] /agetypes/code: get: tags: - - AgeTypes + - AgeTypes operationId: getAgeTypeCodeByAge parameters: - - name: age - in: query - required: true - schema: - type: integer - format: int32 + - name: age + in: query + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5697,19 +5752,19 @@ paths: additionalProperties: type: string security: - - bearerAuth: [] + - bearerAuth: [ ] /admissions/patient/{patientCode}: get: tags: - - Admissions + - Admissions operationId: getAdmissions_1 parameters: - - name: patientCode - in: path - required: true - schema: - type: integer - format: int32 + - name: patientCode + in: path + required: true + schema: + type: integer + format: int32 responses: "400": description: Bad Request @@ -5722,18 +5777,18 @@ paths: items: $ref: '#/components/schemas/AdmissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /admissions/getNextProgressiveIdInYear: get: tags: - - Admissions + - Admissions operationId: getNextYProg parameters: - - name: wardcode - in: query - required: true - schema: - type: string + - name: wardcode + in: query + required: true + schema: + type: string responses: "400": description: Bad Request @@ -5745,18 +5800,18 @@ paths: type: integer format: int32 security: - - bearerAuth: [] + - bearerAuth: [ ] /admissions/getBedsOccupationInWard: get: tags: - - Admissions + - Admissions operationId: getUsedWardBed parameters: - - name: wardid - in: query - required: true - schema: - type: string + - name: wardid + in: query + required: true + schema: + type: string responses: "400": description: Bad Request @@ -5768,34 +5823,34 @@ paths: type: integer format: int32 security: - - bearerAuth: [] + - bearerAuth: [ ] /admissions/discharges: get: tags: - - Admissions + - Admissions operationId: getDischarges parameters: - - name: dischargerange - in: query - required: true - schema: - type: array - items: - type: string - - name: page - in: query - required: false - schema: - type: integer - format: int32 - default: 0 - - name: size - in: query - required: false - schema: - type: integer - format: int32 - default: 80 + - name: dischargerange + in: query + required: true + schema: + type: array + items: + type: string + - name: page + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: size + in: query + required: false + schema: + type: integer + format: int32 + default: 80 responses: "400": description: Bad Request @@ -5806,19 +5861,19 @@ paths: schema: $ref: '#/components/schemas/PageAdmissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /admissions/current: get: tags: - - Admissions + - Admissions operationId: getCurrentAdmission parameters: - - name: patientCode - in: query - required: true - schema: - type: integer - format: int32 + - name: patientCode + in: query + required: true + schema: + type: integer + format: int32 responses: "400": description: Bad Request @@ -5829,33 +5884,33 @@ paths: schema: $ref: '#/components/schemas/AdmissionDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /admissions/admittedPatients: get: tags: - - Admissions + - Admissions operationId: getAdmittedPatients parameters: - - name: searchterms - in: query - required: false - schema: - type: string - default: "" - - name: admissionrange - in: query - required: false - schema: - type: array - items: - type: string - - name: dischargerange - in: query - required: false - schema: - type: array - items: + - name: searchterms + in: query + required: false + schema: type: string + default: "" + - name: admissionrange + in: query + required: false + schema: + type: array + items: + type: string + - name: dischargerange + in: query + required: false + schema: + type: array + items: + type: string responses: "400": description: Bad Request @@ -5868,18 +5923,18 @@ paths: items: $ref: '#/components/schemas/AdmittedPatientDTO' security: - - bearerAuth: [] + - bearerAuth: [ ] /wards/{code}: delete: tags: - - Wards + - Wards operationId: deleteWard parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5888,19 +5943,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /visits/delete/{patID}: delete: tags: - - Visit + - Visit operationId: deleteVisitsRelatedToPatient parameters: - - name: patID - in: path - required: true - schema: - type: integer - format: int32 + - name: patID + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5909,18 +5964,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /vaccinetypes/{code}: delete: tags: - - Vaccine Type + - Vaccine Type operationId: deleteVaccineType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5929,18 +5984,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /vaccines/{code}: delete: tags: - - Vaccines + - Vaccines operationId: deleteVaccine parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5949,19 +6004,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /operations/rows/{code}: delete: tags: - - Operations + - Operations operationId: deleteOperationRow parameters: - - name: code - in: path - required: true - schema: - type: integer - format: int32 + - name: code + in: path + required: true + schema: + type: integer + format: int32 responses: "200": description: OK @@ -5970,18 +6025,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /medicaltypes/{code}: delete: tags: - - Medical Types + - Medical Types operationId: deleteMedicalType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -5990,18 +6045,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /diseasetypes/{code}: delete: tags: - - Disease Types + - Disease Types operationId: deleteDiseaseType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -6012,18 +6067,18 @@ paths: additionalProperties: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /dischargetypes/{code}: delete: tags: - - DischargeType + - DischargeType operationId: deleteDischargeType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -6032,18 +6087,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /deliverytypes/{code}: delete: tags: - - Delivery Type + - Delivery Type operationId: deleteDeliveryType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -6052,18 +6107,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /deliveryresulttypes/{code}: delete: tags: - - Delivery Result Type + - Delivery Result Type operationId: deleteDeliveryResultType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -6072,18 +6127,18 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /admissiontypes/{code}: delete: tags: - - AdmissionTypes + - AdmissionTypes operationId: deleteAdmissionType parameters: - - name: code - in: path - required: true - schema: - type: string + - name: code + in: path + required: true + schema: + type: string responses: "200": description: OK @@ -6092,19 +6147,19 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] /admissions/{id}: delete: tags: - - Admissions + - Admissions operationId: deleteAdmissionType_1 parameters: - - name: id - in: path - required: true - schema: - type: integer - format: int32 + - name: id + in: path + required: true + schema: + type: integer + format: int32 responses: "400": description: Bad Request @@ -6115,16 +6170,16 @@ paths: schema: type: boolean security: - - bearerAuth: [] + - bearerAuth: [ ] components: schemas: WardDTO: required: - - beds - - description - - docs - - nurs - - visitDuration + - beds + - description + - docs + - nurs + - visitDuration type: object properties: code: @@ -6164,24 +6219,24 @@ components: description: lock format: int32 example: 0 + opd: + type: boolean female: type: boolean male: type: boolean - opd: - type: boolean pharmacy: type: boolean PatientDTO: required: - - age - - bloodType - - city - - fatherName - - firstName - - motherName - - secondName - - sex + - age + - bloodType + - city + - fatherName + - firstName + - motherName + - secondName + - sex type: object properties: code: @@ -6219,8 +6274,8 @@ components: description: Sex example: M enum: - - M - - F + - M + - F address: maxLength: 50 type: string @@ -6254,8 +6309,8 @@ components: description: "Mother's status (D=dead, A=alive)" example: A enum: - - D - - A + - D + - A fatherName: maxLength: 50 type: string @@ -6266,35 +6321,35 @@ components: description: "Father's status (D=dead, A=alive)" example: D enum: - - D - - A + - D + - A bloodType: type: string description: "Blood type (0-/+, A-/+ , B-/+, AB-/+)" example: A+ enum: - - 0- - - 0+ - - A- - - A+ - - B- - - B+ - - AB- - - AB+ + - 0- + - 0+ + - A- + - A+ + - B- + - B+ + - AB- + - AB+ hasInsurance: type: string description: "HasInsurance (Y=Yes, N=no)" example: "N" enum: - - "Y" - - "N" + - "Y" + - "N" parentTogether: type: string description: "Parent together (Y=Yes, N=no)" example: "N" enum: - - "Y" - - "N" + - "Y" + - "N" taxCode: maxLength: 30 type: string @@ -6329,8 +6384,8 @@ components: description: Status example: I enum: - - I - - O + - I + - O consensusFlag: type: boolean description: Consensus flag @@ -6342,8 +6397,8 @@ components: description: Class representing a patient VisitDTO: required: - - date - - patient + - date + - patient type: object properties: visitID: @@ -6376,8 +6431,8 @@ components: description: Class representing a vaccine type VaccineTypeDTO: required: - - code - - description + - code + - description type: object properties: code: @@ -6393,9 +6448,9 @@ components: description: Class representing a vaccine type VaccineDTO: required: - - code - - description - - vaccineType + - code + - description + - vaccineType type: object properties: code: @@ -6418,10 +6473,10 @@ components: description: Class representing a vaccine UserSettingDTO: required: - - configName - - configValue - - id - - user + - configName + - configValue + - id + - user type: object properties: id: @@ -6444,8 +6499,8 @@ components: description: The value of the user PermissionDTO: required: - - description - - id + - description + - id type: object properties: name: @@ -6461,9 +6516,9 @@ components: description: List of group's permissions UserDTO: required: - - passwd - - userGroupName - - userName + - passwd + - userGroupName + - userName type: object properties: userName: @@ -6485,7 +6540,7 @@ components: example: Lab chief technician UserGroupDTO: required: - - code + - code type: object properties: code: @@ -6515,10 +6570,23 @@ components: type: string userGroup: $ref: '#/components/schemas/UserGroupDTO' + GroupPermissionsDTO: + type: object + properties: + permissions: + type: array + description: List of permissions' ids + example: + - 48 + - 24 + items: + type: integer + description: List of permissions' ids + format: int32 SupplierDTO: required: - - supId - - supName + - supId + - supName type: object properties: supId: @@ -6560,11 +6628,11 @@ components: description: The supplier's notes PricesOthersDTO: required: - - code - - daily - - description - - ipdInclude - - opdInclude + - code + - daily + - description + - ipdInclude + - opdInclude type: object properties: id: @@ -6627,8 +6695,8 @@ components: description: Class representing a price list PregnantTreatmentTypeDTO: required: - - code - - description + - code + - description type: object properties: code: @@ -6646,10 +6714,10 @@ components: description: Class representing a pregnant treatment type PatientVaccineDTO: required: - - patient - - progr - - vaccine - - vaccineDate + - patient + - progr + - vaccine + - vaccineDate type: object properties: code: @@ -6678,7 +6746,7 @@ components: readOnly: true PatientConsensusDTO: required: - - patientId + - patientId type: object properties: consensusFlag: @@ -6694,8 +6762,8 @@ components: description: Class representing a patient consensus OperationTypeDTO: required: - - code - - description + - code + - description type: object properties: code: @@ -6708,10 +6776,10 @@ components: description: The operation type OperationDTO: required: - - code - - description - - major - - type + - code + - description + - major + - type type: object properties: code: @@ -6735,10 +6803,10 @@ components: example: 0 AdmissionDTO: required: - - admDate - - admitted - - deleted - - type + - admDate + - admitted + - deleted + - type type: object properties: id: @@ -6835,16 +6903,16 @@ components: type: string description: "Flag record deleted, values are 'Y' OR 'N' " example: "N" + fhu: + type: string yprog: type: integer format: int32 - fhu: - type: string description: The admission AdmissionTypeDTO: required: - - code - - description + - code + - description type: object properties: code: @@ -6859,15 +6927,15 @@ components: description: Admission type BillDTO: required: - - amount - - balance - - date - - listName - - patName - - patientTrue - - status - - update - - user + - amount + - balance + - date + - listName + - patName + - patientTrue + - status + - update + - user type: object properties: id: @@ -6923,8 +6991,8 @@ components: description: Class representing a bill DeliveryResultTypeDTO: required: - - code - - description + - code + - description type: object properties: code: @@ -6939,8 +7007,8 @@ components: description: Delivery result type DeliveryTypeDTO: required: - - code - - description + - code + - description type: object properties: code: @@ -6955,8 +7023,8 @@ components: description: Delivery type DischargeTypeDTO: required: - - code - - description + - code + - description type: object properties: code: @@ -6971,12 +7039,12 @@ components: description: DisChargeType DiseaseDTO: required: - - code - - description - - diseaseType - - ipdInInclude - - ipdOutInclude - - opdInclude + - code + - description + - diseaseType + - ipdInInclude + - ipdOutInclude + - opdInclude type: object properties: code: @@ -7014,8 +7082,8 @@ components: description: Class representing a disease DiseaseTypeDTO: required: - - code - - description + - code + - description type: object properties: code: @@ -7029,11 +7097,11 @@ components: description: Class representing a disease type OpdDTO: required: - - age - - newPatient - - note - - sex - - ward + - age + - newPatient + - note + - sex + - ward type: object properties: code: @@ -7128,10 +7196,10 @@ components: description: The opd OperationRowDTO: required: - - opDate - - opResult - - operation - - prescriber + - opDate + - opResult + - operation + - prescriber type: object properties: id: @@ -7179,9 +7247,9 @@ components: $ref: '#/components/schemas/OperationRowDTO' MovementTypeDTO: required: - - code - - description - - type + - code + - description + - type type: object properties: code: @@ -7200,8 +7268,8 @@ components: example: "-" MedicalTypeDTO: required: - - code - - description + - code + - description type: object properties: code: @@ -7266,10 +7334,10 @@ components: example: 0 MalnutritionDTO: required: - - admission - - dateSupp - - height - - weight + - admission + - dateSupp + - height + - weight type: object properties: code: @@ -7399,8 +7467,8 @@ components: description: Laboratory Patient InOut example: "0" enum: - - I - - O + - I + - O age: type: integer description: Laboratory Patient Age @@ -7414,11 +7482,11 @@ components: description: Laboratory status example: DRAFT enum: - - draft - - open - - done - - invalid - - deleted + - draft + - open + - done + - invalid + - deleted HospitalDTO: type: object properties: @@ -7469,8 +7537,8 @@ components: example: 0 PatientExaminationDTO: required: - - patientCode - - pex_date + - patientCode + - pex_date type: object properties: pex_ID: @@ -7523,12 +7591,12 @@ components: description: Patient ausculation example: normal enum: - - normal - - wheezes - - rhonchi - - crackles - - stridor - - bronchial + - normal + - wheezes + - rhonchi + - crackles + - stridor + - bronchial pex_hgt: type: integer description: Hemo Glucose Test @@ -7542,14 +7610,14 @@ components: description: Diuresis description example: physiological enum: - - physiological - - oliguria - - anuria - - frequent - - nocturia - - stranguria - - hematuria - - pyuria + - physiological + - oliguria + - anuria + - frequent + - nocturia + - stranguria + - hematuria + - pyuria pex_note: maxLength: 2000 type: string @@ -7559,18 +7627,18 @@ components: description: Bowel Function example: regular enum: - - constipation - - regular - - diarrheal - - irregular + - constipation + - regular + - diarrheal + - irregular BillItemsDTO: required: - - itemAmount - - itemDescription - - itemDisplayCode - - itemId - - itemQuantity - - priceId + - itemAmount + - itemDescription + - itemDisplayCode + - itemId + - itemQuantity + - priceId type: object properties: id: @@ -7615,10 +7683,10 @@ components: description: Class representing a billItem BillPaymentsDTO: required: - - amount - - billId - - date - - user + - amount + - billId + - date + - user type: object properties: id: @@ -7649,8 +7717,8 @@ components: description: Class representing a billPayment FullBillDTO: required: - - bill - - billItems + - bill + - billItems type: object properties: bill: @@ -7667,9 +7735,9 @@ components: $ref: '#/components/schemas/BillPaymentsDTO' AgeTypeDTO: required: - - description - - from - - to + - description + - from + - to type: object properties: code: @@ -7692,16 +7760,16 @@ components: description: Class representing an age type which is typically a range TherapyRowDTO: required: - - endDate - - freqInDay - - freqInPeriod - - medicalId - - notifyInt - - patID - - qty - - smsInt - - startDate - - unitID + - endDate + - freqInDay + - freqInPeriod + - medicalId + - notifyInt + - patID + - qty + - smsInt + - startDate + - unitID type: object properties: therapyID: @@ -7762,17 +7830,17 @@ components: example: 0 Patient: required: - - age - - birthDate - - bloodType - - city - - deleted - - fatherName - - firstName - - motherName - - name - - secondName - - sex + - age + - birthDate + - bloodType + - city + - deleted + - fatherName + - firstName + - motherName + - name + - secondName + - sex type: object properties: createdBy: @@ -8003,8 +8071,6 @@ components: format: float transformed: type: boolean - plain: - type: boolean psname: type: string size2D: @@ -8014,6 +8080,8 @@ components: type: array items: type: object + plain: + type: boolean fontMetrics: type: object properties: @@ -8088,8 +8156,6 @@ components: format: float transformed: type: boolean - plain: - type: boolean psname: type: string size2D: @@ -8099,6 +8165,8 @@ components: type: array items: type: object + plain: + type: boolean ascent: type: integer format: int32 @@ -8108,9 +8176,6 @@ components: leading: type: integer format: int32 - height: - type: integer - format: int32 maxDescent: type: integer format: int32 @@ -8180,6 +8245,9 @@ components: maxAdvance: type: integer format: int32 + height: + type: integer + format: int32 clipBounds: type: object properties: @@ -8220,34 +8288,34 @@ components: properties: empty: type: boolean - width: + maxX: type: number format: double - height: + maxY: type: number format: double - "y": + centerX: type: number format: double - x: + centerY: type: number format: double - maxX: + width: type: number format: double - maxY: + height: type: number format: double - centerX: + minX: type: number format: double - centerY: + minY: type: number format: double - minX: + x: type: number format: double - minY: + "y": type: number format: double rect: @@ -8255,34 +8323,34 @@ components: properties: empty: type: boolean - width: + maxX: type: number format: double - height: + maxY: type: number format: double - "y": + centerX: type: number format: double - x: + centerY: type: number format: double - maxX: + width: type: number format: double - maxY: + height: type: number format: double - centerX: + minX: type: number format: double - centerY: + minY: type: number format: double - minX: + x: type: number format: double - minY: + "y": type: number format: double writeOnly: true @@ -8380,34 +8448,34 @@ components: properties: empty: type: boolean - width: + maxX: type: number format: double - height: + maxY: type: number format: double - "y": + centerX: type: number format: double - x: + centerY: type: number format: double - maxX: + width: type: number format: double - maxY: + height: type: number format: double - centerX: + minX: type: number format: double - centerY: + minY: type: number format: double - minX: + x: type: number format: double - minY: + "y": type: number format: double rect: @@ -8415,34 +8483,34 @@ components: properties: empty: type: boolean - width: + maxX: type: number format: double - height: + maxY: type: number format: double - "y": + centerX: type: number format: double - x: + centerY: type: number format: double - maxX: + width: type: number format: double - maxY: + height: type: number format: double - centerX: + minX: type: number format: double - centerY: + minY: type: number format: double - minX: + x: type: number format: double - minY: + "y": type: number format: double writeOnly: true @@ -8469,34 +8537,34 @@ components: properties: empty: type: boolean - width: + maxX: type: number format: double - height: + maxY: type: number format: double - "y": + centerX: type: number format: double - x: + centerY: type: number format: double - maxX: + width: type: number format: double - maxY: + height: type: number format: double - centerX: + minX: type: number format: double - centerY: + minY: type: number format: double - minX: + x: type: number format: double - minY: + "y": type: number format: double clipRect: @@ -8539,34 +8607,34 @@ components: properties: empty: type: boolean - width: + maxX: type: number format: double - height: + maxY: type: number format: double - "y": + centerX: type: number format: double - x: + centerY: type: number format: double - maxX: + width: type: number format: double - maxY: + height: type: number format: double - centerX: + minX: type: number format: double - centerY: + minY: type: number format: double - minX: + x: type: number format: double - minY: + "y": type: number format: double rect: @@ -8574,34 +8642,34 @@ components: properties: empty: type: boolean - width: + maxX: type: number format: double - height: + maxY: type: number format: double - "y": + centerX: type: number format: double - x: + centerY: type: number format: double - maxX: + width: type: number format: double - maxY: + height: type: number format: double - centerX: + minX: type: number format: double - centerY: + minY: type: number format: double - minX: + x: type: number format: double - minY: + "y": type: number format: double writeOnly: true @@ -8626,16 +8694,16 @@ components: deprecated: true TherapyRow: required: - - endDate - - freqInDay - - freqInPeriod - - medicalId - - notifyInt - - patient - - qty - - smsInt - - startDate - - unitID + - endDate + - freqInDay + - freqInPeriod + - medicalId + - notifyInt + - patient + - qty + - smsInt + - startDate + - unitID type: object properties: createdBy: @@ -8685,13 +8753,13 @@ components: smsInt: type: integer format: int32 + medical: + type: integer + format: int32 sms: type: boolean notify: type: boolean - medical: - type: integer - format: int32 TherapyDTO: type: object properties: @@ -8709,8 +8777,8 @@ components: type: array description: The dates of the therapy example: - - 2022-01-01T10:00:00 - - 2022-01-02T15:30:00 + - 2022-01-01T10:00:00 + - 2022-01-02T15:30:00 items: type: string description: The dates of the therapy @@ -8747,9 +8815,9 @@ components: example: false LotDTO: required: - - code - - dueDate - - preparationDate + - code + - dueDate + - preparationDate type: object properties: code: @@ -8772,11 +8840,11 @@ components: description: The lot MovementDTO: required: - - date - - medical - - quantity - - refNo - - type + - date + - medical + - quantity + - refNo + - type type: object properties: code: @@ -8809,12 +8877,12 @@ components: example: MVN152445 SmsDTO: required: - - module - - smsDate - - smsDateSched - - smsNumber - - smsText - - smsUser + - module + - smsDate + - smsDateSched + - smsNumber + - smsText + - smsUser type: object properties: smsId: @@ -8860,11 +8928,11 @@ components: description: SMS module Id MovementWardDTO: required: - - date - - description - - quantity - - units - - ward + - date + - description + - quantity + - units + - ward type: object properties: code: @@ -8950,8 +9018,8 @@ components: description: Class representing a Login response LoginRequest: required: - - password - - username + - password + - username type: object properties: username: @@ -8964,11 +9032,11 @@ components: example: admin PriceDTO: required: - - description - - group - - item - - list - - price + - description + - group + - item + - list + - price type: object properties: id: @@ -9002,10 +9070,10 @@ components: description: Class representing a prices PriceList: required: - - code - - currency - - description - - name + - code + - currency + - description + - name type: object properties: createdBy: @@ -9090,8 +9158,8 @@ components: example: 89 MedicalWardIdDTO: required: - - medical - - ward + - medical + - ward type: object properties: ward: @@ -9120,9 +9188,9 @@ components: $ref: '#/components/schemas/PageInfoDTO' AgeType: required: - - description - - from - - to + - description + - from + - to type: object properties: createdBy: diff --git a/src/main/java/org/isf/config/SecurityConfig.java b/src/main/java/org/isf/config/SecurityConfig.java index 1a470bcad..9259fd923 100644 --- a/src/main/java/org/isf/config/SecurityConfig.java +++ b/src/main/java/org/isf/config/SecurityConfig.java @@ -21,6 +21,8 @@ */ package org.isf.config; +import java.util.List; + import org.isf.permissions.manager.PermissionManager; import org.isf.security.ApiAuditorAwareImpl; import org.isf.security.CustomLogoutHandler; @@ -53,8 +55,6 @@ import org.springframework.web.cors.UrlBasedCorsConfigurationSource; import org.springframework.web.filter.CorsFilter; -import java.util.List; - @Configuration @EnableWebSecurity @EnableGlobalMethodSecurity(securedEnabled = true) @@ -252,7 +252,9 @@ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { // grouppermission .requestMatchers(HttpMethod.POST, "/usergroups/{group_code}/permissions/**").hasAuthority("grouppermission.create") .requestMatchers(HttpMethod.GET, "/usergroups/{group_code}/permissions/**").hasAuthority("grouppermission.read") - .requestMatchers(HttpMethod.PUT, "/usergroups/{group_code}/permissions/**").hasAuthority("grouppermission.update") + .requestMatchers(HttpMethod.PUT, "/usergroups/{group_code}/permissions/**").hasAuthority("grouppermission.create") + .requestMatchers(HttpMethod.PATCH, "/usergroups/{group_code}/permissions/**") + .access("hasAuthority('grouppermission.create') and hasAuthority('grouppermission.delete')") .requestMatchers(HttpMethod.DELETE, "/usergroups/{group_code}/permissions/**").hasAuthority("grouppermission.delete") // usergroups .requestMatchers(HttpMethod.POST, "/usergroups/**").hasAuthority("usergroups.create") diff --git a/src/main/java/org/isf/usergroups/dto/GroupPermissionsDTO.java b/src/main/java/org/isf/usergroups/dto/GroupPermissionsDTO.java new file mode 100644 index 000000000..05fd5a6e8 --- /dev/null +++ b/src/main/java/org/isf/usergroups/dto/GroupPermissionsDTO.java @@ -0,0 +1,31 @@ +/* + * Open Hospital (www.open-hospital.org) + * Copyright © 2006-2024 Informatici Senza Frontiere (info@informaticisenzafrontiere.org) + * + * Open Hospital is a free and open source software for healthcare data management. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * https://www.gnu.org/licenses/gpl-3.0-standalone.html + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +package org.isf.usergroups.dto; + +import java.util.List; + +import io.swagger.v3.oas.annotations.media.Schema; + +public record GroupPermissionsDTO( + @Schema(name = "permissions", example = "[48, 24]", description = "List of permissions' ids") List permissionIds) { + +} diff --git a/src/main/java/org/isf/usergroups/rest/UserGroupController.java b/src/main/java/org/isf/usergroups/rest/UserGroupController.java index dbb4091ee..f318ea57d 100644 --- a/src/main/java/org/isf/usergroups/rest/UserGroupController.java +++ b/src/main/java/org/isf/usergroups/rest/UserGroupController.java @@ -21,9 +21,13 @@ */ package org.isf.usergroups.rest; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; +import java.util.stream.Collectors; + import jakarta.validation.Valid; + import org.isf.menu.manager.UserBrowsingManager; import org.isf.menu.model.UserGroup; import org.isf.permissions.dto.PermissionDTO; @@ -33,6 +37,7 @@ import org.isf.permissions.model.GroupPermission; import org.isf.permissions.model.Permission; import org.isf.shared.exceptions.OHAPIException; +import org.isf.usergroups.dto.GroupPermissionsDTO; import org.isf.usergroups.dto.UserGroupDTO; import org.isf.usergroups.mapper.UserGroupMapper; import org.isf.utils.exception.OHDataValidationException; @@ -43,12 +48,18 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PatchMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; +import io.swagger.v3.oas.annotations.security.SecurityRequirement; +import io.swagger.v3.oas.annotations.tags.Tag; @RestController(value = "/usergroups") @Tag(name = "User Groups") @@ -69,7 +80,6 @@ public class UserGroupController { /** * Returns the list of {@link UserGroup}s. - * * @return the list of {@link UserGroup}s */ @GetMapping(value = "/usergroups", produces = MediaType.APPLICATION_JSON_VALUE) @@ -83,7 +93,6 @@ public List getUserGroups() throws OHServiceException { /** * Deletes a {@link UserGroup}. - * * @param code - the code of the {@link UserGroup} to delete */ @ResponseStatus(HttpStatus.NO_CONTENT) @@ -99,7 +108,6 @@ public void deleteGroup(@PathVariable("group_code") String code) throws OHServic /** * Creates a new {@link UserGroup} with a minimum set of rights. - * * @param userGroupDTO - the {@link UserGroup} to insert * @return the {@link UserGroupDTO} of new user group. * @throws OHServiceException When failed to create the user group @@ -126,7 +134,6 @@ public UserGroupDTO newUserGroup(@Valid @RequestBody UserGroupDTO userGroupDTO) /** * Updates an existing {@link UserGroup}. - * * @param userGroupDTO - the {@link UserGroup} to update * @return {@link UserGroupDTO} for the updated group. * @throws OHServiceException When failed to update the user group @@ -139,7 +146,7 @@ public UserGroupDTO updateUserGroup(@PathVariable("group_code") String code, @Va UserGroup group = userGroupMapper.map2Model(userGroupDTO); if (!userManager.findUserGroupByCode(userGroupDTO.getCode()).getCode().equals(group.getCode())) { - throw new OHAPIException(new OHExceptionMessage("User group not found.")); + throw new OHAPIException(new OHExceptionMessage("User group not found."), HttpStatus.NOT_FOUND); } List permissions = new ArrayList<>(); @@ -159,7 +166,6 @@ public UserGroupDTO updateUserGroup(@PathVariable("group_code") String code, @Va /** * Retrieve a {@link UserGroup} using its code - * * @param code UserGroup code * @return Returns the {@link UserGroup} found using the given code * @throws OHServiceException When failed to retrieve the user group @@ -168,7 +174,7 @@ public UserGroupDTO updateUserGroup(@PathVariable("group_code") String code, @Va public UserGroupDTO getUserGroup(@PathVariable("group_code") String code) throws OHServiceException { UserGroup userGroup = userManager.findUserGroupByCode(code); if (userGroup == null) { - throw new OHAPIException(new OHExceptionMessage("User group not found.")); + throw new OHAPIException(new OHExceptionMessage("User group not found."), HttpStatus.NOT_FOUND); } List groupPermissions = groupPermissionManager.findUserGroupPermissions(userGroup.getCode()); @@ -184,9 +190,8 @@ public UserGroupDTO getUserGroup(@PathVariable("group_code") String code) throws /** * Assign a {@link Permission} to a {@link UserGroup} - * * @param userGroupCode - the {@link UserGroup}'s code - * @param permissionId - the {@link Permission}'s id + * @param permissionId - the {@link Permission}'s id * @return the id of the new group permission. * @throws OHServiceException When failed to assign the permission to the user group */ @@ -198,7 +203,7 @@ public int assignPermission( ) throws OHServiceException { UserGroup userGroup = userManager.findUserGroupByCode(userGroupCode); if (userGroup == null) { - throw new OHAPIException(new OHExceptionMessage("User group not found.")); + throw new OHAPIException(new OHExceptionMessage("User group not found."), HttpStatus.NOT_FOUND); } Permission permission = permissionManager.retrievePermissionById(permissionId); @@ -214,11 +219,70 @@ public int assignPermission( } } + /** + * Assign permissions to the target user group, ignore those already assigned. + * @param userGroupCode Code of the group to update + * @param payload New group permissions + * @return List of {@link PermissionDTO} corresponding to the list of permissions assigned to the group + * @throws OHServiceException If the update operation fails + */ + @PutMapping(value = "/usergroups/{group_code}/permissions", produces = MediaType.APPLICATION_JSON_VALUE) + public List updateGroupPermissions( + @PathVariable("group_code") String userGroupCode, + @RequestBody GroupPermissionsDTO payload + ) throws OHServiceException { + LOGGER.info("Attempting to update user group({}) permissions, with permissions ids, {}", userGroupCode, payload.permissionIds()); + UserGroup userGroup = userManager.findUserGroupByCode(userGroupCode); + if (userGroup == null) { + LOGGER.info("Could not find user corresponding to the group code {}", userGroupCode); + throw new OHAPIException(new OHExceptionMessage("User group not found."), HttpStatus.NOT_FOUND); + } + + try { + return permissionMapper.map2DTOList(groupPermissionManager.update(userGroup, payload.permissionIds(), false)); + } catch (OHDataValidationException e) { + LOGGER.info("Fail to update user groups permissions, reason: {}", e.getMessage()); + throw new OHAPIException(new OHExceptionMessage("Failed to update permissions")); + } + } + + /** + * Replace permissions for the target user group with the one provided in the payload. + *
    + *
  • Ids corresponding to permissions already assigned to the group will be skipped.
  • + *
  • User group permissions that don't have their id in the permission ids payload will be removed
  • + *
  • ids that corresponding permission are not yet assigned to the groups will be assigned.
  • + *
  • Permissions ids that don't exist are ignored
  • + *
+ * @param userGroupCode Code of the group to update + * @param payload New group permissions + * @return List of {@link PermissionDTO} corresponding to the list of permissions assigned to the group + * @throws OHServiceException If the update operation fails + */ + @PatchMapping(value = "/usergroups/{group_code}/permissions", produces = MediaType.APPLICATION_JSON_VALUE) + public List replaceGroupPermissions( + @PathVariable("group_code") String userGroupCode, + @RequestBody GroupPermissionsDTO payload + ) throws OHServiceException { + LOGGER.info("Attempting to replace user group({}) permissions, with permissions ids, {}", userGroupCode, payload.permissionIds()); + UserGroup userGroup = userManager.findUserGroupByCode(userGroupCode); + if (userGroup == null) { + LOGGER.info("Could not find user group corresponding to the group code {}", userGroupCode); + throw new OHAPIException(new OHExceptionMessage("User group not found."), HttpStatus.NOT_FOUND); + } + + try { + return permissionMapper.map2DTOList(groupPermissionManager.update(userGroup, payload.permissionIds(), true)); + } catch (OHDataValidationException e) { + LOGGER.info("Fail to replace user groups permissions, reason: {}", e.getMessage()); + throw new OHAPIException(new OHExceptionMessage("Failed to update permissions")); + } + } + /** * Revoke a {@link Permission} from a {@link UserGroup} - * * @param userGroupCode - the {@link UserGroup}'s code - * @param permissionId - the {@link Permission}'s id + * @param permissionId - the {@link Permission}'s id * @throws OHServiceException When failed to revoke the permission to the user group */ @ResponseStatus(HttpStatus.NO_CONTENT) @@ -229,7 +293,7 @@ public void revokePermission( ) throws OHServiceException { UserGroup userGroup = userManager.findUserGroupByCode(userGroupCode); if (userGroup == null) { - throw new OHAPIException(new OHExceptionMessage("User group not found.")); + throw new OHAPIException(new OHExceptionMessage("User group not found."), HttpStatus.NOT_FOUND); } Permission permission = permissionManager.retrievePermissionById(permissionId); diff --git a/src/test/java/org/isf/usergroups/rest/UserGroupControllerTest.java b/src/test/java/org/isf/usergroups/rest/UserGroupControllerTest.java index 7fa88ba9c..6941cf0ff 100644 --- a/src/test/java/org/isf/usergroups/rest/UserGroupControllerTest.java +++ b/src/test/java/org/isf/usergroups/rest/UserGroupControllerTest.java @@ -21,7 +21,23 @@ */ package org.isf.usergroups.rest; -import com.fasterxml.jackson.databind.ObjectMapper; +import static org.hamcrest.Matchers.containsString; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.patch; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; +import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.log; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; + +import java.util.List; + import org.isf.OpenHospitalApiApplication; import org.isf.menu.TestPermission; import org.isf.menu.TestUserGroup; @@ -34,6 +50,7 @@ import org.isf.permissions.model.GroupPermission; import org.isf.permissions.model.Permission; import org.isf.usergroups.data.UserGroupHelper; +import org.isf.usergroups.dto.GroupPermissionsDTO; import org.isf.usergroups.dto.UserGroupDTO; import org.isf.usergroups.mapper.UserGroupMapper; import org.isf.utils.exception.OHDataValidationException; @@ -51,17 +68,7 @@ import org.springframework.security.test.context.support.WithMockUser; import org.springframework.test.web.servlet.MockMvc; -import java.util.List; - -import static org.hamcrest.Matchers.containsString; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyInt; -import static org.mockito.Mockito.doNothing; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; -import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.log; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; +import com.fasterxml.jackson.databind.ObjectMapper; @SpringBootTest(classes = OpenHospitalApiApplication.class) @AutoConfigureMockMvc @@ -91,7 +98,7 @@ public class UserGroupControllerTest { private GroupPermissionManager groupPermissionManager; @Test - @WithMockUser(username = "admin", authorities = {"usergroups.read"}) + @WithMockUser(username = "admin", authorities = { "usergroups.read" }) @DisplayName("Get all user groups") void getAllUserGroups() throws Exception { List userGroups = List.of(UserGroupHelper.generateUserGroup()); @@ -110,7 +117,7 @@ void getAllUserGroups() throws Exception { } @Test - @WithMockUser(username = "admin", authorities = {"usergroups.create"}) + @WithMockUser(username = "admin", authorities = { "usergroups.create" }) @DisplayName("Create user group") void createUserGroup() throws Exception { List permissions = TestPermission.generatePermissions(4); @@ -132,11 +139,63 @@ void createUserGroup() throws Exception { LOGGER.debug("result: {}", result); } + @Test + @WithMockUser(username = "admin", authorities = { "usergroups.read" }) + @DisplayName("Get user group") + void getUserGroup() throws Exception { + List permissions = TestPermission.generatePermissions(4); + UserGroup userGroup = UserGroupHelper.generateUserGroup(); + + List groupPermissions = permissions.stream().map(permission -> { + GroupPermission groupPermission = new GroupPermission(); + groupPermission.setUserGroup(userGroup); + groupPermission.setPermission(permission); + + return groupPermission; + }).toList(); + + List permissionDTOS = permissionMapper.map2DTOList(permissions); + UserGroupDTO userGroupDTO = userGroupMapper.map2DTO(userGroup); + userGroupDTO.setPermissions(permissionDTOS); + + when(userManager.findUserGroupByCode(userGroup.getCode())).thenReturn(userGroup); + when(groupPermissionManager.findUserGroupPermissions(any())).thenReturn(groupPermissions); + + var result = mvc.perform( + get("/usergroups/{group_code}", userGroup.getCode()).contentType(MediaType.APPLICATION_JSON)) + .andDo(log()) + .andExpect(status().isOk()) + .andExpect(content().string(containsString(objectMapper.writeValueAsString(userGroupDTO)))) + .andReturn(); + + LOGGER.debug("result: {}", result); + } + + @Test + @WithMockUser(username = "admin", authorities = { "usergroups.delete" }) + @DisplayName("Delete user groups") + void deleteUserGroup() throws Exception { + UserGroup userGroup = UserGroupHelper.generateUserGroup(); + UserGroupDTO userGroupDTO = userGroupMapper.map2DTO(userGroup); + + when(userManager.getUserGroup()).thenReturn(List.of(userGroup)); + doNothing().when(userManager).deleteGroup(any()); + + var result = mvc.perform( + delete("/usergroups/{group_code}", userGroup.getCode()).contentType(MediaType.APPLICATION_JSON)) + .andDo(log()) + .andExpect(status().isNoContent()) + .andReturn(); + + LOGGER.debug("result: {}", result); + } + @Nested @DisplayName("Update user group") class UpdateUserGroup { + @Test - @WithMockUser(username = "admin", authorities = {"usergroups.update"}) + @WithMockUser(username = "admin", authorities = { "usergroups.update" }) @DisplayName("Should update user group") void shouldUpdateUserGroup() throws Exception { List permissions = TestPermission.generatePermissions(4); @@ -162,7 +221,7 @@ void shouldUpdateUserGroup() throws Exception { } @Test - @WithMockUser(username = "admin", authorities = {"usergroups.update"}) + @WithMockUser(username = "admin", authorities = { "usergroups.update" }) @DisplayName("Should fail to update user group when invalid payload") void shouldFailUpdateUserGroupWhenInvalidPayload() throws Exception { UserGroup userGroup = UserGroupHelper.generateUserGroup(); @@ -202,63 +261,12 @@ void shouldThrowForbiddenErrorWhenUpdatingUserGroup() throws Exception { } } - @Test - @WithMockUser(username = "admin", authorities = {"usergroups.read"}) - @DisplayName("Get user group") - void getUserGroup() throws Exception { - List permissions = TestPermission.generatePermissions(4); - UserGroup userGroup = UserGroupHelper.generateUserGroup(); - - List groupPermissions = permissions.stream().map(permission -> { - GroupPermission groupPermission = new GroupPermission(); - groupPermission.setUserGroup(userGroup); - groupPermission.setPermission(permission); - - return groupPermission; - }).toList(); - - List permissionDTOS = permissionMapper.map2DTOList(permissions); - UserGroupDTO userGroupDTO = userGroupMapper.map2DTO(userGroup); - userGroupDTO.setPermissions(permissionDTOS); - - when(userManager.findUserGroupByCode(userGroup.getCode())).thenReturn(userGroup); - when(groupPermissionManager.findUserGroupPermissions(any())).thenReturn(groupPermissions); - - var result = mvc.perform( - get("/usergroups/{group_code}", userGroup.getCode()).contentType(MediaType.APPLICATION_JSON)) - .andDo(log()) - .andExpect(status().isOk()) - .andExpect(content().string(containsString(objectMapper.writeValueAsString(userGroupDTO)))) - .andReturn(); - - LOGGER.debug("result: {}", result); - } - - @Test - @WithMockUser(username = "admin", authorities = {"usergroups.delete"}) - @DisplayName("Delete user groups") - void deleteUserGroup() throws Exception { - UserGroup userGroup = UserGroupHelper.generateUserGroup(); - UserGroupDTO userGroupDTO = userGroupMapper.map2DTO(userGroup); - - when(userManager.getUserGroup()).thenReturn(List.of(userGroup)); - doNothing().when(userManager).deleteGroup(any()); - - var result = mvc.perform( - delete("/usergroups/{group_code}", userGroup.getCode()).contentType(MediaType.APPLICATION_JSON)) - .andDo(log()) - .andExpect(status().isNoContent()) - .andReturn(); - - LOGGER.debug("result: {}", result); - } - @Nested @DisplayName("Assign / revoke permission") class UserGroupPermissions { @Test - @WithMockUser(username = "admin", authorities = {"usergroups.create", "grouppermission.create"}) + @WithMockUser(username = "admin", authorities = { "usergroups.create", "grouppermission.create" }) @DisplayName("Assign a permission to a user group") void assignPermissionToUserGroup() throws Exception { UserGroup userGroup = new TestUserGroup().setup(false); @@ -283,7 +291,7 @@ void assignPermissionToUserGroup() throws Exception { } @Test - @WithMockUser(username = "admin", authorities = {"usergroups.create", "grouppermission.create"}) + @WithMockUser(username = "admin", authorities = { "usergroups.create", "grouppermission.create" }) @DisplayName("Assign already assigned permission to a user group") void assignAlreadyAssignedPermissionToUserGroup() throws Exception { UserGroup userGroup = new TestUserGroup().setup(false); @@ -308,7 +316,7 @@ void assignAlreadyAssignedPermissionToUserGroup() throws Exception { } @Test - @WithMockUser(username = "admin", authorities = {"usergroups.create", "grouppermission.create"}) + @WithMockUser(username = "admin", authorities = { "usergroups.create", "grouppermission.create" }) @DisplayName("Assign non existing permission to a user group") void assignNonExistingPermissionToUserGroup() throws Exception { UserGroup userGroup = new TestUserGroup().setup(false); @@ -331,7 +339,7 @@ void assignNonExistingPermissionToUserGroup() throws Exception { } @Test - @WithMockUser(username = "admin", authorities = {"grouppermission.delete"}) + @WithMockUser(username = "admin", authorities = { "grouppermission.delete" }) @DisplayName("Revoke a permission from a user group") void revokePermissionFromUserGroup() throws Exception { UserGroup userGroup = new TestUserGroup().setup(false); @@ -356,7 +364,7 @@ void revokePermissionFromUserGroup() throws Exception { } @Test - @WithMockUser(username = "admin", authorities = {"grouppermission.create"}) + @WithMockUser(username = "admin", authorities = { "grouppermission.create" }) @DisplayName("Revoke not assigned permission to a user group") void revokeNotAssignedPermissionToUserGroup() throws Exception { UserGroup userGroup = new TestUserGroup().setup(false); @@ -377,5 +385,85 @@ void revokeNotAssignedPermissionToUserGroup() throws Exception { .andExpect(status().is4xxClientError()) .andExpect(content().string(containsString("not found"))); } + + @Test + @WithMockUser(username = "admin", authorities = { "grouppermission.create", "grouppermission.delete" }) + @DisplayName("Should replace user group permissions") + void shouldReplaceUserGroupPermissions() throws Exception { + UserGroup userGroup = new TestUserGroup().setup(false); + Permission permission = TestPermission.generatePermission(); + + when(userManager.findUserGroupByCode(any())).thenReturn(userGroup); + when(groupPermissionManager.update(any(), any(), any())).thenReturn(List.of(permission)); + + var result = mvc.perform( + patch("/usergroups/{group_code}/permissions", userGroup.getCode()) + .content(objectMapper.writeValueAsString(new GroupPermissionsDTO(List.of(permission.getId())))) + .contentType(MediaType.APPLICATION_JSON) + ) + .andDo(log()) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.[0].id").value(permission.getId())) + .andReturn(); + + LOGGER.debug("result: {}", result); + } + + @Test + @WithMockUser(username = "admin", authorities = { "grouppermission.delete" }) + @DisplayName("Should fail to replace user group permissions when insufficient permissions") + void shouldFailToReplaceUserGroupPermissionsWhenInsufficientPermissions() throws Exception { + + var result = mvc.perform( + patch("/usergroups/{group_code}/permissions", "12") + .content(objectMapper.writeValueAsString(new GroupPermissionsDTO(List.of(44)))) + .contentType(MediaType.APPLICATION_JSON) + ) + .andDo(log()) + .andExpect(status().isForbidden()) + .andReturn(); + + LOGGER.debug("result: {}", result); + } + + @Test + @WithMockUser(username = "admin", authorities = { "grouppermission.create" }) + @DisplayName("Should update user group permissions") + void shouldUpdateUserGroupPermissions() throws Exception { + UserGroup userGroup = new TestUserGroup().setup(false); + Permission permission = TestPermission.generatePermission(); + + when(userManager.findUserGroupByCode(any())).thenReturn(userGroup); + when(groupPermissionManager.update(any(), any(), any())).thenReturn(List.of(permission)); + + var result = mvc.perform( + put("/usergroups/{group_code}/permissions", userGroup.getCode()) + .content(objectMapper.writeValueAsString(new GroupPermissionsDTO(List.of(permission.getId())))) + .contentType(MediaType.APPLICATION_JSON) + ) + .andDo(log()) + .andExpect(status().isOk()) + .andExpect(jsonPath("$.[0].id").value(permission.getId())) + .andReturn(); + + LOGGER.debug("result: {}", result); + } + + @Test + @WithMockUser(username = "admin") + @DisplayName("Should fail to update user group permissions when insufficient permissions") + void shouldFailToUpdateUserGroupPermissionsWhenInsufficientPermissions() throws Exception { + + var result = mvc.perform( + put("/usergroups/{group_code}/permissions", "12") + .content(objectMapper.writeValueAsString(new GroupPermissionsDTO(List.of(44)))) + .contentType(MediaType.APPLICATION_JSON) + ) + .andDo(log()) + .andExpect(status().isForbidden()) + .andReturn(); + + LOGGER.debug("result: {}", result); + } } }