Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

(feat)Add some missing translations to the cretaepatientform #595

Merged
merged 28 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
0e352ca
Add taranslations to createPatientForm
jona42-ui Nov 10, 2023
c2b4c70
Add translations to createPatientForm
jona42-ui Nov 13, 2023
759401e
Add missing translations to createpatientform
jona42-ui Nov 13, 2023
c351c62
delete yaml
jona42-ui Nov 13, 2023
c41dcf4
clean up
jona42-ui Nov 13, 2023
c396ab6
more clean up
jona42-ui Nov 13, 2023
662f9a2
more more cleanup
jona42-ui Nov 13, 2023
cdc7648
clean ups
jona42-ui Nov 15, 2023
121e13e
remove override
jona42-ui Nov 15, 2023
952e825
revert formatting changes
jona42-ui Nov 15, 2023
8f070a1
Revert "revert formatting changes"
jona42-ui Nov 15, 2023
5ee2574
Revert "Revert "revert formatting changes""
jona42-ui Nov 15, 2023
16f5f16
remove format changes
jona42-ui Nov 15, 2023
22ea210
REMOVE formatting changes
jona42-ui Nov 15, 2023
4705808
remove formatting changes still
jona42-ui Nov 15, 2023
2471193
remove formatting changes still
jona42-ui Nov 15, 2023
e1da906
remove formatting changes
jona42-ui Nov 15, 2023
d15d243
remove formartting changes
jona42-ui Nov 16, 2023
07f4e22
remove formatting changes
jona42-ui Nov 16, 2023
e9cee60
remove formatting changes
jona42-ui Nov 16, 2023
245e9a1
remove formatting changes
jona42-ui Nov 16, 2023
cc740fe
Merge branch '2.8' into 2.8feature
jona42-ui Nov 16, 2023
acbaadf
remove formatting changes
jona42-ui Nov 16, 2023
74f1d21
remove formatting changes
jona42-ui Nov 16, 2023
731dc4f
remove formartting changes
jona42-ui Nov 16, 2023
70b673a
remove formatting changes
jona42-ui Nov 16, 2023
cfe3f50
remove formatting changes
jona42-ui Nov 16, 2023
334b3c4
more clean up
jona42-ui Nov 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
86 changes: 45 additions & 41 deletions frontend/src/components/patient/CreatePatientForm.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useRef, useEffect, useContext } from "react";
import { FormattedMessage, injectIntl } from "react-intl";
import { FormattedMessage, injectIntl, useIntl } from "react-intl";
import "../Style.css";
import { getFromOpenElisServer, postToOpenElisServer } from "../utils/Utils";
import { nationalityList } from "../data/countries";
Expand Down Expand Up @@ -40,12 +40,8 @@ function CreatePatientForm(props) {
const [maritalStatuses, setMaritalStatuses] = useState([]);
const [formAction, setFormAction] = useState("ADD");
const componentMounted = useRef(false);
const [dateOfBirthFormatter, setDateOfBirthFormatter] = useState({
years: "",
months: "",
days: "",
});

const intl = useIntl();
const [dateOfBirthFormatter,setDateOfBirthFormatter] = useState({"years": "", "months": "", "days": ""})
const handleDatePickerChange = (values, ...e) => {
var patient = values;
patient.birthDateForDisplay = e[1];
Expand Down Expand Up @@ -313,7 +309,9 @@ function CreatePatientForm(props) {
<TextInput
value={values.subjectNumber}
name={field.name}
labelText="Unique Health ID number"
labelText={intl.formatMessage({
id: "patient.subject.number",
})}
id={field.name}
className="inputText"
onMouseOut={() => {
Expand All @@ -331,7 +329,9 @@ function CreatePatientForm(props) {
<TextInput
value={values.nationalId}
name={field.name}
labelText="National Id"
labelText={intl.formatMessage({
id: "patient.natioanalid",
})}
id={field.name}
className="inputText"
onMouseOut={() => {
Expand All @@ -355,7 +355,9 @@ function CreatePatientForm(props) {
<TextInput
value={values.lastName}
name={field.name}
labelText="Last Name"
labelText={intl.formatMessage({
id: "patient.last.name",
})}
id={field.name}
className="inputText"
/>
Expand All @@ -366,15 +368,17 @@ function CreatePatientForm(props) {
<TextInput
value={values.firstName}
name={field.name}
labelText="First Name"
labelText={intl.formatMessage({
id: "patient.first.name",
})}
id={field.name}
className="inputText"
/>
)}
</Field>
</div>
<Accordion>
<AccordionItem title="Emergency Contact Information">
<AccordionItem title={intl.formatMessage({ id:"emergencyContactInfo.title" })}>
<div className="inlineDiv">
<Field name="patientContact.person.lastName">
{({ field }) => (
Expand All @@ -385,7 +389,7 @@ function CreatePatientForm(props) {
: values.patientContact?.person.lastName
}
name={field.name}
labelText="Contact Last Name"
labelText={intl.formatMessage({id: "patientcontact.person.lastname",})}
id={field.name}
className="inputText"
/>
Expand All @@ -400,7 +404,7 @@ function CreatePatientForm(props) {
: values.patientContact?.person.firstName
}
name={field.name}
labelText="Contact First Name"
labelText={intl.formatMessage({id: "patientcontact.person.firstname",})}
id={field.name}
className="inputText"
/>
Expand All @@ -417,7 +421,7 @@ function CreatePatientForm(props) {
: values.patientContact?.person.email
}
name={field.name}
labelText="Contact Email"
labelText={intl.formatMessage({id: "patientcontact.person.email",})}
id={field.name}
className="inputText"
/>
Expand All @@ -427,13 +431,12 @@ function CreatePatientForm(props) {
{({ field }) => (
<TextInput
value={
values.patientContact?.person.primaryPhone ===
undefined
values.patientContact?.person.primaryPhone === undefined
? ""
: values.patientContact?.person.primaryPhone
}
name={field.name}
labelText={`Contact Phone: ${configurationProperties.PHONE_FORMAT}`}
labelText={intl.formatMessage({id: "patient.label.contactphone",defaultMessage: "Contact Phone: {PHONE_FORMAT}",},{ PHONE_FORMAT: configurationProperties.PHONE_FORMAT })}
id={field.name}
className="inputText"
/>
Expand All @@ -453,7 +456,7 @@ function CreatePatientForm(props) {
<TextInput
value={values.primaryPhone}
name={field.name}
labelText={`Phone: ${configurationProperties.PHONE_FORMAT}`}
labelText={intl.formatMessage({id: "patient.label.primaryphone",defaultMessage: "Phone: {PHONE_FORMAT}",},{ PHONE_FORMAT: configurationProperties.PHONE_FORMAT })}
id={field.name}
className="inputText"
/>
Expand All @@ -463,13 +466,13 @@ function CreatePatientForm(props) {
{({ field }) => (
<RadioButtonGroup
valueSelected={values.gender}
legendText="Gender"
legendText={intl.formatMessage({ id: "patient.gender" })}
name={field.name}
className="inputText"
id="create_patient_gender"
>
<RadioButton id="radio-1" labelText="Male" value="M" />
<RadioButton id="radio-2" labelText="Female" value="F" />
<RadioButton id="radio-1" labelText={intl.formatMessage({ id: "patient.male" })} value="M" />
<RadioButton id="radio-2" labelText={intl.formatMessage({id: "patient.female",})} value="F" />
</RadioButtonGroup>
)}
</Field>
Expand All @@ -489,18 +492,21 @@ function CreatePatientForm(props) {
<DatePickerInput
id="date-picker-default-id"
placeholder="dd/mm/yyyy"
labelText="Date of Birth"
labelText={intl.formatMessage({
id: "patient.dob",
})}
type="text"
name={field.name}
/>
</DatePicker>
)}
</Field>

<TextInput
value={dateOfBirthFormatter.years}
name="years"
labelText="Age/Years"
labelText={intl.formatMessage({
id: "patient.female",
})}
id="years"
type="number"
onChange={(e) => handleYearsChange(e, values)}
Expand All @@ -510,7 +516,7 @@ function CreatePatientForm(props) {
<TextInput
value={dateOfBirthFormatter.months}
name="months"
labelText="Months"
labelText={intl.formatMessage({ id: "patient.age.months" })}
type="number"
onChange={(e) => handleMonthsChange(e, values)}
id="months"
Expand All @@ -520,9 +526,8 @@ function CreatePatientForm(props) {
<TextInput
value={dateOfBirthFormatter.days}
name="days"
type="number"
onChange={(e) => handleDaysChange(e, values)}
labelText="Days"
onChange={ handleDaysChange}
labelText={intl.formatMessage({ id: "patient.age.days" })}
id="days"
className="inputText"
/>
Expand All @@ -532,7 +537,7 @@ function CreatePatientForm(props) {
<div className="error">
<ErrorMessage name="gender"></ErrorMessage>
</div>
</div>
</div>
<Accordion>
<AccordionItem title="Additional Information">
<div className="inlineDiv">
Expand All @@ -541,18 +546,17 @@ function CreatePatientForm(props) {
<TextInput
value={values.city}
name={field.name}
labelText="Town"
labelText={intl.formatMessage({id: "patient.address.town",})}
id={field.name}
className="inputText"
/>
)}
/> )}
</Field>
<Field name="streetAddress">
{({ field }) => (
<TextInput
value={values.streetAddress}
name={field.name}
labelText="Street"
labelText={intl.formatMessage({id: "patient.address.street",})}
id={field.name}
className="inputText"
/>
Expand All @@ -563,7 +567,7 @@ function CreatePatientForm(props) {
<TextInput
value={values.commune}
name={field.name}
labelText="Camp/Commune"
labelText={intl.formatMessage({id: "patient.address.camp",})}
id={field.name}
className="inputText"
/>
Expand All @@ -577,7 +581,7 @@ function CreatePatientForm(props) {
id="health_region"
value={values.healthRegion}
name={field.name}
labelText="Region"
labelText={intl.formatMessage({id: "patient.address.healthregion",})}
className="inputText"
onChange={(e) => handleRegionSelection(e, values)}
>
Expand All @@ -598,7 +602,7 @@ function CreatePatientForm(props) {
id="health_district"
value={values.healthDistrict}
name={field.name}
labelText="District"
labelText={intl.formatMessage({id: "patient.address.healthdistrict",})}
className="inputText"
onChange={() => {}}
>
Expand All @@ -621,7 +625,7 @@ function CreatePatientForm(props) {
id="education"
value={values.education}
name={field.name}
labelText="Education"
labelText={intl.formatMessage({id: "pateint.eduction",})}
className="inputText"
onChange={() => {}}
>
Expand All @@ -642,7 +646,7 @@ function CreatePatientForm(props) {
id="maritialStatus"
value={values.maritialStatus}
name={field.name}
labelText="Marital Status"
labelText={intl.formatMessage({id: "patient.maritalstatus",})}
className="inputText"
onChange={() => {}}
>
Expand All @@ -665,7 +669,7 @@ function CreatePatientForm(props) {
id="nationality"
value={values.nationality}
name={field.name}
labelText="Nationality"
labelText={intl.formatMessage({id: "patient.nationality",})}
className="inputText"
onChange={() => {}}
>
Expand All @@ -685,7 +689,7 @@ function CreatePatientForm(props) {
<TextInput
value={values.otherNationality}
name={field.name}
labelText="Specify Other nationality"
labelText={intl.formatMessage({id: "patient.nationality.other",})}
id={field.name}
className="inputText"
/>
Expand Down
19 changes: 19 additions & 0 deletions frontend/src/languages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,24 @@
"patient.last.name": "Last Name",
"patient.prev.lab.no": "Previous Lab Number",
"patient.id": "Patient Id",
"patient.age.years": "Age/Years",
"patient.age.months": "Months",
"patient.age.days": "Days",
"patient.address.town": "Town",
"patient.address.street": "Street",
"patient.address.camp": "Camp/Commune",
"patient.address.healthregion": "Region",
"patient.address.healthdistrict": "District",
"pateint.eduction": "Education",
"patient.maritalstatus": "Marital Status",
"patient.nationality": "Nationality",
"patient.nationality.other": "Specify Other nationality",
"patientcontact.person.firstname":"Contact first name",
"patientcontact.person.lastname": "Contact last name",
"patientcontact.person.email": "Contact Email",
"patient.label.contactphone": "Contact Phone:{PHONE_FORMAT}",
"patient.label.primaryphone": "Primary phone:{PHONE_FORMAT}",
"patient.gender": "Gender",
"label.button.select.status": "Select Status" ,
"label.button.select.technician": "Select Technician" ,
"label.button.select.pathologist": "Select Pathologist" ,
Expand Down Expand Up @@ -306,6 +324,7 @@
"pathology.label.block.add.number": "Number of Blocks to add",
"pathology.label.slide.add.number": "Number of Slides to add",
"button.label.genarateReport" : "Generate Report",
"emergencyContactInfo.title":"Emergency Contact Info",
"button.label.showHidePram" : "Show/Hide Report Parameter" ,
"immunohistochemistry.label.numberOfCancer" : "Number of Cancer nuclei",
"immunohistochemistry.label.averageHer2" : "Average HER2 per nucleus" ,
Expand Down
20 changes: 19 additions & 1 deletion frontend/src/languages/fr.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
{
"language.select.label": "French" ,
"label.button.submit": "Connecter",
"label.button.changepassword" : "Changer Mot de Passe",
Expand Down Expand Up @@ -268,6 +268,24 @@
"patient.last.name": "Nom de famille",
"patient.prev.lab.no": "Numéro de laboratoire précédent",
"patient.id": "Numéro du patient",
"patient.age.months": "Mois",
"patient.age.days": "Jours",
"patient.address.town": "Ville",
"patient.address.street": "Rue",
"patient.address.camp": "Camp/Commune",
"patient.address.healthregion": "Région",
"patient.address.healthdistrict": "District",
"pateint.eduction": "Éducation",
"patient.maritalstatus": "État civil",
"patient.nationality": "Nationalité",
"patient.nationality.other": "Précisez Autre nationalité",
"patientcontact.person.firstname": "Prénom du contact",
"patientcontact.person.lastname": "Nom de famille du contact",
"patientcontact.person.email": "Email du contact",
"patient.label.contactphone": "Téléphone de contact : {PHONE_FORMAT}",
"patient.lable.primaryphone": "Téléphone principal : {PHONE_FORMAT}",
"patient.gender": "Genre",
"emergencyContactInfo.title":"Informations de contact d'urgence",
"label.button.select.status": "Sélectionner l'état",
"label.button.select.technician": "Sélectionner le technicien",
"label.button.select.pathologist": "Sélectionner le pathologiste",
Expand Down
Loading