Skip to content

Commit 9501136

Browse files
authored
Merge pull request #316 from kbss-cvut/315-rename-patient-record-to-record
Rename patient records to records
2 parents c317863 + 045c0e1 commit 9501136

File tree

15 files changed

+46
-46
lines changed

15 files changed

+46
-46
lines changed

src/components/dashboard/DashboardController.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class DashboardController extends React.Component {
5757

5858
_createRecord = () => {
5959
{
60-
/*TODO bug on cancel it doesnt return to dashboard but to patient records */
60+
/*TODO bug on cancel it doesnt return to dashboard but to records */
6161
}
6262
this.props.transitionToWithOpts(Routes.createRecord, {
6363
handlers: {

src/components/institution/Institution.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import { Button, Card } from "react-bootstrap";
33
import { FormattedMessage, injectIntl } from "react-intl";
44
import InstitutionMembers from "./InstitutionMembers";
5-
import InstitutionPatients from "./InstitutionPatients";
5+
import InstitutionRecords from "./InstitutionRecords.jsx";
66
import withI18n from "../../i18n/withI18n";
77
import HorizontalInput from "../HorizontalInput";
88
import PropTypes from "prop-types";
@@ -13,7 +13,7 @@ import { LoaderSmall } from "../Loader";
1313
import InstitutionValidator from "../../validation/InstitutionValidator";
1414
import HelpIcon from "../HelpIcon";
1515
import PromiseTrackingMask from "../misc/PromiseTrackingMask";
16-
import { canReadInstitutionPatients, canReadInstitutionUsers, canWriteInstitution } from "../../utils/RoleUtils.js";
16+
import { canReadInstitutionRecords, canReadInstitutionUsers, canWriteInstitution } from "../../utils/RoleUtils.js";
1717

1818
/**
1919
* Institution detail. Editable only for admins.
@@ -87,11 +87,11 @@ class Institution extends React.Component {
8787
{this._renderButtons()}
8888
</form>
8989
{!institution.isNew && canReadInstitutionUsers(currentUser, institution.key) && this._renderMembers()}
90-
{!institution.isNew && canReadInstitutionPatients(currentUser, institution.key) && (
91-
<InstitutionPatients
90+
{!institution.isNew && canReadInstitutionRecords(currentUser, institution.key) && (
91+
<InstitutionRecords
9292
recordsLoaded={recordsLoaded}
9393
formTemplatesLoaded={formTemplatesLoaded}
94-
onEdit={this.props.handlers.onEditPatient}
94+
onEdit={this.props.handlers.onEditRecord}
9595
onExport={this.props.handlers.onExportRecords}
9696
currentUser={currentUser}
9797
filterAndSort={this.props.filterAndSort}

src/components/institution/InstitutionController.jsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { trackPromise } from "react-promise-tracker";
3232
import { INITIAL_PAGE } from "../misc/Pagination";
3333
import BrowserStorage from "../../utils/BrowserStorage";
3434
import PropTypes from "prop-types";
35-
import { canReadInstitutionPatients } from "../../utils/RoleUtils.js";
35+
import { canReadInstitutionRecords } from "../../utils/RoleUtils.js";
3636

3737
class InstitutionController extends React.Component {
3838
constructor(props) {
@@ -63,7 +63,7 @@ class InstitutionController extends React.Component {
6363

6464
if (
6565
this.props.status === ACTION_STATUS.SUCCESS &&
66-
canReadInstitutionPatients(this.props.currentUser, institutionKey)
66+
canReadInstitutionRecords(this.props.currentUser, institutionKey)
6767
) {
6868
this._loadRecords();
6969
}
@@ -162,8 +162,8 @@ class InstitutionController extends React.Component {
162162
});
163163
};
164164

165-
_onEditPatient = (patient) => {
166-
this.props.transitionToWithOpts(Routes.editRecord, { params: { key: patient.key } });
165+
_onEditRecord = (record) => {
166+
this.props.transitionToWithOpts(Routes.editRecord, { params: { key: record.key } });
167167
};
168168

169169
_onExportRecords = (exportType) => {
@@ -206,7 +206,7 @@ class InstitutionController extends React.Component {
206206
onChange: this._onChange,
207207
onEditUser: this._onEditUser,
208208
onAddNewUser: this._onAddNewUser,
209-
onEditPatient: this._onEditPatient,
209+
onEditRecord: this._onEditRecord,
210210
onExportRecords: this._onExportRecords,
211211
onDelete: this._onDeleteUser,
212212
};

src/components/institution/InstitutionPatients.jsx renamed to src/components/institution/InstitutionRecords.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ import ExportRecordsDropdown from "../record/ExportRecordsDropdown";
66
import { useI18n } from "../../hooks/useI18n";
77
import { COLUMNS } from "../../constants/DefaultConstants.js";
88

9-
const InstitutionPatients = (props) => {
9+
const InstitutionRecords = (props) => {
1010
const { recordsLoaded, formTemplatesLoaded, onEdit, onExport, currentUser, filterAndSort } = props;
1111
const { i18n } = useI18n();
1212

1313
return (
1414
<Card variant="info" className="mt-3">
1515
<Card.Header className="text-light bg-primary" as="h6">
16-
{i18n("institution.patients.panel-title")}
16+
{i18n("institution.records.panel-title")}
1717
</Card.Header>
1818
<Card.Body>
1919
<RecordTable
@@ -33,7 +33,7 @@ const InstitutionPatients = (props) => {
3333
);
3434
};
3535

36-
InstitutionPatients.propTypes = {
36+
InstitutionRecords.propTypes = {
3737
recordsLoaded: PropTypes.object.isRequired,
3838
formTemplatesLoaded: PropTypes.object.isRequired,
3939
onEdit: PropTypes.func.isRequired,
@@ -42,4 +42,4 @@ InstitutionPatients.propTypes = {
4242
filterAndSort: PropTypes.object.isRequired,
4343
};
4444

45-
export default InstitutionPatients;
45+
export default InstitutionRecords;

src/components/record/RecordController.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class RecordController extends React.Component {
3131
constructor(props) {
3232
super(props);
3333
this.state = {
34-
record: this._isNew() ? EntityFactory.initNewPatientRecord() : null,
34+
record: this._isNew() ? EntityFactory.initNewRecord() : null,
3535
saved: false,
3636
showAlert: false,
3737
};

src/i18n/cs.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export default {
140140
"institution.email": "Kontaktní email",
141141
"institution.created": "Instituce zaregistrována {date}",
142142
"institution.members.panel-title": "Zaměstnanci instituce",
143-
"institution.patients.panel-title": "Záznamy instituce",
143+
"institution.records.panel-title": "Záznamy instituce",
144144
"institution.save-success": "Instituce úspěšně uložena.",
145145
"institution.save-error": "Instituci se nepodařilo uložit. {error}",
146146
"institution.delete-success": "Instituce úspěšně odstraněna",
@@ -258,7 +258,7 @@ export default {
258258
"Username cannot contain special characters.": "Přezdívka nesmí obsahovat speciální znaky",
259259
"Cannot encode an empty password.": "Nelze zašifrovat prázné heslo.",
260260
"Unable to fetch remote data.": "Nelze načíst vzdálená data.",
261-
"User with patient records cannot be deleted.": "Uživatel s vyplněným záznamem nelze odstranit.",
261+
"User with records cannot be deleted.": "Uživatel s vyplněným záznamem nelze odstranit.",
262262
"Cannot update user URI.": "Nelze aktualizovat uživatelské URI.",
263263
"The passed username already exists.": "Zadané uživatelské jméno již existuje.",
264264
"User with specified username already exists.": "Uživatel s touto přezdívkou již existuje.",
@@ -269,7 +269,7 @@ export default {
269269
or: " nebo",
270270
"error.record.localNameOfRecordIsNotUnique": "Formulářové pole 'Název/Česky' není unikátní napříč všemi záznamy.",
271271
"error.record.localNameOfRecordIsEmpty": "Formulářové pole 'Název/Česky' je prázdne.",
272-
"error.institution.remove.institutionWithMembersOrPatientRecordsCannotBeDeleted":
272+
"error.institution.remove.institutionWithMembersOrRecordsCannotBeDeleted":
273273
"Instituci se zaměstnanci nebo se záznamy nelze odstranit.",
274274
"error.password.validation.thePassedUsersCurrentPasswordIsDifferentFromTheSpecifiedOne":
275275
"Původní heslo uživatele neodpovídá heslu uloženému.",

src/i18n/en.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export default {
138138
"institution.email": "Contact email",
139139
"institution.created": "Institution registered on {date}",
140140
"institution.members.panel-title": "Institution's members",
141-
"institution.patients.panel-title": "Institution's records",
141+
"institution.records.panel-title": "Institution's records",
142142
"institution.save-success": "Institution successfully saved.",
143143
"institution.save-error": "Unable to save institution. {error}",
144144
"institution.delete-success": "Institution deleted successfully",
@@ -172,7 +172,7 @@ export default {
172172
"records.create-tile": "Create",
173173
"records.opened-study.create-tooltip": "Create new record",
174174
"records.closed-study.create-tooltip":
175-
"Study is closed for addition of patient records. Please, contact a study coordinator in case you need to add new patient record.",
175+
"Study is closed for addition of records. Please, contact a study coordinator in case you need to add new record.",
176176
"records.export": "Export",
177177
"records.export.excel": "Export to MS Excel",
178178
"records.export.json": "Export to JSON",
@@ -262,7 +262,7 @@ export default {
262262
"Username cannot contain special characters.": "Username cannot contain special characters.",
263263
"Cannot encode an empty password.": "Cannot encode an empty password.",
264264
"Unable to fetch remote data.": "Unable to fetch remote data.",
265-
"User with patient records cannot be deleted.": "User with records cannot be deleted.",
265+
"User with records cannot be deleted.": "User with records cannot be deleted.",
266266
"Cannot update user URI.": "Cannot update user URI:",
267267
"The passed username already exists.": "The passed username already exists.",
268268
"User with specified username already exists.": "User with specified username already exists.",
@@ -273,8 +273,8 @@ export default {
273273
or: " or",
274274
"error.record.localNameOfRecordIsNotUnique": "Name is not unique.",
275275
"error.record.localNameOfRecordIsEmpty": "Name is empty.",
276-
"error.institution.remove.institutionWithMembersOrPatientRecordsCannotBeDeleted":
277-
"Institution with members or patient records cannot be deleted.",
276+
"error.institution.remove.institutionWithMembersOrRecordsCannotBeDeleted":
277+
"Institution with members or records cannot be deleted.",
278278
"error.password.validation.thePassedUsersCurrentPasswordIsDifferentFromTheSpecifiedOne":
279279
"The user's current password is different from the specified one.",
280280

src/reducers/RecordReducer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { ACTION_STATUS } from "../constants/DefaultConstants";
33
import without from "lodash/without";
44

55
const initialState = {
6-
institutionPatients: {},
6+
institutionRecords: {},
77
recordDeleted: {},
88
recordLoaded: {},
99
recordSaved: {},

src/utils/EntityFactory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export function initNewInstitution() {
2525
};
2626
}
2727

28-
export function initNewPatientRecord() {
28+
export function initNewRecord() {
2929
return {
3030
localName: "",
3131
formTemplate: "",

src/utils/RoleUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export function hasSupersetOfPrivileges(u1, u2) {
3232
return [...u2RoleSet].every((role) => u1RoleSet.has(role));
3333
}
3434

35-
export function canReadInstitutionPatients(currentUser, institutionKey) {
35+
export function canReadInstitutionRecords(currentUser, institutionKey) {
3636
return (
3737
hasRole(currentUser, ROLE.READ_ALL_RECORDS) ||
3838
(hasRole(currentUser, ROLE.READ_ORGANIZATION_RECORDS) && currentUser.institution?.key === institutionKey)

0 commit comments

Comments
 (0)