Skip to content

Commit

Permalink
improvement(Patient Details)
Browse files Browse the repository at this point in the history
- Prevent re-registering a patient who is already employed
- Added the status of the employee in the interface
  • Loading branch information
lomamech committed Dec 8, 2021
1 parent 59547db commit f83f215
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions client/src/i18n/fr/employee.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
"EMPLOYEE" : {
"ACTIVE_EMPLOYEE" : "Employé actif",
"CONFIGURATION": "Configuration des employés",
"EDIT" : "Formulaire de mise à jour des employés",
"EMPLOYEES" : "Les employés enregistrés",
"EMPLOYEE_DETAILS" : "Détails des employés",
"HOSPITAL_DATA" : "Données hospitalières",
"INACTIVE_EMPLOYEE" : "Employé inactif",
"INFO" : "L'outil de gestion du personnel peut être utilisé pour créer, afficher et mettre à jour les employés et leurs informations. Les employés inscrits ici sont disponibles pour l'intégration dans des modules tels que / Payroll (Gestion de paiment) /.",
"REGISTER" : "Nouveau employé",
"REGISTRATION_FORM" : "Formulaire d'enregistrement",
Expand Down
10 changes: 9 additions & 1 deletion client/src/modules/patients/record/patient-record.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,21 @@
<span translate>FORM.LABELS.TAKE_A_PICTURE</span>
</a>

<a
<a ng-if="!PatientRecordCtrl.patient.employee_uuid"
data-method="convert-to-employee"
ui-sref="patientAsEmployee({ uuid : PatientRecordCtrl.patient.uuid })"
class="btn btn-default btn-block">
<span class="fa fa-street-view"></span>
<span translate>FORM.LABELS.REGISTER_EMPLOYEE_PATIENT</span>
</a>

<span ng-if="PatientRecordCtrl.patient.employee_uuid && !PatientRecordCtrl.patient.locked" class="btn btn-success btn-block" translate>
EMPLOYEE.ACTIVE_EMPLOYEE
</span>

<span ng-if="PatientRecordCtrl.patient.employee_uuid && PatientRecordCtrl.patient.locked" class="btn btn-warning btn-block" translate>
EMPLOYEE.INACTIVE_EMPLOYEE
</span>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/src/modules/patients/registration/registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ PatientRegistrationController.$inject = [
*/
function PatientRegistrationController(
Patients, Session, util, Notify,
Receipts, ScrollTo, bhConstants
Receipts, ScrollTo, bhConstants,
) {
const vm = this;

Expand Down
4 changes: 3 additions & 1 deletion server/controllers/medical/patients/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,14 +224,16 @@ async function lookupPatient(patientUuid) {
p.spouse_profession, p.spouse_employer, p.notes, p.avatar, proj.abbr, d.text,
dg.account_id, BUID(dg.price_list_uuid) AS price_list_uuid, dg.is_convention,
BUID(dg.uuid) as debtor_group_uuid, dg.locked, dg.name as debtor_group_name, u.username,
u.display_name AS userName, a.number, proj.name, p.health_zone, p.health_area
u.display_name AS userName, a.number, proj.name, p.health_zone, p.health_area, BUID(emp.uuid) AS employee_uuid,
emp.locked
FROM patient AS p
JOIN project AS proj ON p.project_id = proj.id
JOIN debtor AS d ON p.debtor_uuid = d.uuid
JOIN debtor_group AS dg ON d.group_uuid = dg.uuid
JOIN user AS u ON p.user_id = u.id
JOIN account AS a ON a.id = dg.account_id
JOIN entity_map AS em ON p.uuid = em.uuid
LEFT JOIN employee AS emp ON emp.patient_uuid = p.uuid
WHERE p.uuid = ?;
`;

Expand Down

0 comments on commit f83f215

Please sign in to comment.